impact-ui 4.0.5-tableV36.2 → 4.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index13.js +2 -2
- package/dist/_virtual/index14.js +2 -2
- package/dist/_virtual/index15.js +2 -2
- package/dist/_virtual/index3.js +2 -4
- package/dist/_virtual/index4.js +3 -3
- package/dist/_virtual/index5.js +4 -2
- package/dist/components/CommentsPanel/CommentsContext.d.ts +4 -2
- package/dist/components/CommentsPanel/CommentsContext.d.ts.map +1 -1
- package/dist/components/CommentsPanel/CommentsPanel.impl.js +1 -1
- package/dist/components/CommentsPanel/CommentsPanel.types.d.ts +26 -0
- package/dist/components/CommentsPanel/CommentsPanel.types.d.ts.map +1 -1
- package/dist/components/CreateItemFlow/CreateItemFlow.types.d.ts +4 -10
- package/dist/components/CreateItemFlow/CreateItemFlow.types.d.ts.map +1 -1
- package/dist/components/CreateItemFlow/index.d.ts +15 -3
- package/dist/components/CreateItemFlow/index.d.ts.map +1 -1
- package/dist/components/CreateItemFlow/index.js +63 -134
- package/dist/components/DynamicLayout/index.d.ts +12 -9
- package/dist/components/DynamicLayout/index.d.ts.map +1 -1
- package/dist/components/DynamicLayout/index.js +38 -37
- package/dist/components/Menu/IconMenuItem.js +1 -1
- package/dist/components/Menu/NestedMenuItem.js +1 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Menu/nestedMenuItemsFromObject.js +1 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.js +1 -1
- package/dist/components/Notification/index.js +1 -1
- package/dist/components/Stepper/index.js +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Table/withCommentIcon.d.ts.map +1 -1
- package/dist/components/Table/withCommentIcon.js +3 -1
- package/dist/components/TableOld/index.js +1 -1
- package/dist/components/common/MentionEditor/index.js +1 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -2
- package/dist/mcp-component-registry.json +58 -845
- package/dist/node_modules/@mui/system/colorManipulator.js +2 -2
- package/dist/node_modules/call-bind/index.js +1 -1
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-with-styles-interface-css/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/components/TableV36/AdvanceSearchModalItem.d.ts +0 -27
- package/dist/components/TableV36/AdvanceSearchModalItem.d.ts.map +0 -1
- package/dist/components/TableV36/AdvanceSortModal.d.ts +0 -8
- package/dist/components/TableV36/AdvanceSortModal.d.ts.map +0 -1
- package/dist/components/TableV36/AdvanceSortModal.js +0 -297
- package/dist/components/TableV36/AgGridHeader.d.ts +0 -16
- package/dist/components/TableV36/AgGridHeader.d.ts.map +0 -1
- package/dist/components/TableV36/AgGridHeader.js +0 -799
- package/dist/components/TableV36/CellTooltip.d.ts +0 -14
- package/dist/components/TableV36/CellTooltip.d.ts.map +0 -1
- package/dist/components/TableV36/CellTooltip.js +0 -11
- package/dist/components/TableV36/CommentsPortal.d.ts +0 -31
- package/dist/components/TableV36/CommentsPortal.d.ts.map +0 -1
- package/dist/components/TableV36/CommentsPortal.js +0 -362
- package/dist/components/TableV36/NewAdvanceSearchModal/NewAdvanceSearchModal.d.ts +0 -13
- package/dist/components/TableV36/NewAdvanceSearchModal/NewAdvanceSearchModal.d.ts.map +0 -1
- package/dist/components/TableV36/NewAdvanceSearchModal/NewAdvanceSearchModal.js +0 -282
- package/dist/components/TableV36/NewAdvanceSearchModal/NewAdvanceSearchModalItem.d.ts +0 -16
- package/dist/components/TableV36/NewAdvanceSearchModal/NewAdvanceSearchModalItem.d.ts.map +0 -1
- package/dist/components/TableV36/NewAdvanceSearchModal/NewAdvanceSearchModalItem.js +0 -302
- package/dist/components/TableV36/NoComments.d.ts +0 -16
- package/dist/components/TableV36/NoComments.d.ts.map +0 -1
- package/dist/components/TableV36/NoComments.js +0 -237
- package/dist/components/TableV36/Table.types.d.ts +0 -97
- package/dist/components/TableV36/Table.types.d.ts.map +0 -1
- package/dist/components/TableV36/actionBar.d.ts +0 -7
- package/dist/components/TableV36/actionBar.d.ts.map +0 -1
- package/dist/components/TableV36/actionBar.js +0 -31
- package/dist/components/TableV36/advanceSearchModal.d.ts +0 -20
- package/dist/components/TableV36/advanceSearchModal.d.ts.map +0 -1
- package/dist/components/TableV36/filterUtils.d.ts +0 -133
- package/dist/components/TableV36/filterUtils.d.ts.map +0 -1
- package/dist/components/TableV36/filterUtils.js +0 -478
- package/dist/components/TableV36/index.d.ts +0 -3
- package/dist/components/TableV36/index.d.ts.map +0 -1
- package/dist/components/TableV36/index.js +0 -1632
- package/dist/components/TableV36/mockData.d.ts +0 -39
- package/dist/components/TableV36/mockData.d.ts.map +0 -1
- package/dist/components/TableV36/tableFunctions.d.ts +0 -63
- package/dist/components/TableV36/tableFunctions.d.ts.map +0 -1
- package/dist/components/TableV36/tableFunctions.js +0 -1796
- package/dist/components/TableV36/tableHeader.d.ts +0 -80
- package/dist/components/TableV36/tableHeader.d.ts.map +0 -1
- package/dist/components/TableV36/tableHeader.js +0 -396
- package/dist/components/TableV36/tableIcons.d.ts +0 -3
- package/dist/components/TableV36/tableIcons.d.ts.map +0 -1
- package/dist/components/TableV36/tableMoreOptions.d.ts +0 -52
- package/dist/components/TableV36/tableMoreOptions.d.ts.map +0 -1
- package/dist/components/TableV36/tableMoreOptions.js +0 -324
- package/dist/components/TableV36/tablePagination.d.ts +0 -7
- package/dist/components/TableV36/tablePagination.d.ts.map +0 -1
- package/dist/components/TableV36/tablePagination.js +0 -67
- package/dist/components/TableV36/tableSettings.d.ts +0 -41
- package/dist/components/TableV36/tableSettings.d.ts.map +0 -1
- package/dist/components/TableV36/tableSettings.js +0 -317
- package/dist/components/TableV36/withCommentIcon.d.ts +0 -13
- package/dist/components/TableV36/withCommentIcon.d.ts.map +0 -1
- package/dist/components/TableV36/withCommentIcon.js +0 -125
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exports as colorManipulator } from "../../../_virtual/colorManipulator.js";
|
|
2
2
|
import require$$0 from "@babel/runtime/helpers/interopRequireDefault";
|
|
3
|
-
import require$$1 from "../../../_virtual/
|
|
4
|
-
import require$$2 from "../../../_virtual/
|
|
3
|
+
import require$$1 from "../../../_virtual/index4.js";
|
|
4
|
+
import require$$2 from "../../../_virtual/index5.js";
|
|
5
5
|
var _interopRequireDefault = require$$0;
|
|
6
6
|
Object.defineProperty(colorManipulator, "__esModule", {
|
|
7
7
|
value: true
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as callBind } from "../../_virtual/
|
|
1
|
+
import { __module as callBind } from "../../_virtual/index15.js";
|
|
2
2
|
import { __require as requireSetFunctionLength } from "../set-function-length/index.js";
|
|
3
3
|
import { __require as requireEsDefineProperty } from "../es-define-property/index.js";
|
|
4
4
|
import { __require as requireCallBindApplyHelpers } from "../call-bind-apply-helpers/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as reactIs } from "../../../../_virtual/
|
|
1
|
+
import { __module as reactIs } from "../../../../_virtual/index13.js";
|
|
2
2
|
import { __require as requireReactIs_production_min } from "./cjs/react-is.production.min.js";
|
|
3
3
|
import { __require as requireReactIs_development } from "./cjs/react-is.development.js";
|
|
4
4
|
if (process.env.NODE_ENV === "production") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as reactIs } from "../../_virtual/
|
|
1
|
+
import { __module as reactIs } from "../../_virtual/index3.js";
|
|
2
2
|
import { __require as requireReactIs_production } from "./cjs/react-is.production.js";
|
|
3
3
|
import { __require as requireReactIs_development } from "./cjs/react-is.development.js";
|
|
4
4
|
if (process.env.NODE_ENV === "production") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as dist } from "../../../_virtual/
|
|
1
|
+
import { __exports as dist } from "../../../_virtual/index14.js";
|
|
2
2
|
import require$$0 from "@babel/runtime/helpers/interopRequireDefault";
|
|
3
3
|
import { __require as requireArray_prototype_flat } from "../../array.prototype.flat/index.js";
|
|
4
4
|
import { __require as requireGlobalCache } from "../../global-cache/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "impact-ui",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.6",
|
|
4
4
|
"description": "Impact Analytics UI library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/components/index.js",
|
|
@@ -149,9 +149,9 @@
|
|
|
149
149
|
"@vitest/coverage-istanbul": "^4.0.18",
|
|
150
150
|
"@vitest/coverage-v8": "^4.0.18",
|
|
151
151
|
"@vitest/ui": "^4.0.18",
|
|
152
|
-
"ag-grid-community": "^
|
|
153
|
-
"ag-grid-enterprise": "^
|
|
154
|
-
"ag-grid-react": "^
|
|
152
|
+
"ag-grid-community": "^32.3.2",
|
|
153
|
+
"ag-grid-enterprise": "^32.3.2",
|
|
154
|
+
"ag-grid-react": "^32.3.2",
|
|
155
155
|
"cssnano": "^7.1.3",
|
|
156
156
|
"eslint": "^8.56.0",
|
|
157
157
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
}
|
|
225
225
|
},
|
|
226
226
|
"dependencies": {
|
|
227
|
-
"@ag-grid-community/locale": "^
|
|
227
|
+
"@ag-grid-community/locale": "^32.3.2",
|
|
228
228
|
"@dnd-kit/core": "^6.2.0",
|
|
229
229
|
"@dnd-kit/sortable": "^9.0.0",
|
|
230
230
|
"@dnd-kit/utilities": "^3.2.2",
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
declare const AdvanceSearchModalItem: ({ colDefs, control, index, actualIndex, onDelete, filteredColumnsInitialOptions, totalColumns, currentColumnId, activeOption, getValues, addNewColumn, setToShowDuplicateColumnInAdvanceSearch, selectedThirdOptionDropdownValue, setSelectedThirdOptionDropdownValue, isClearAll, fields, isLastVisible, flag, setFlag, pendingDeletions, setPendingDeletions, remove, ...args }: {
|
|
2
|
-
[x: string]: any;
|
|
3
|
-
colDefs: any;
|
|
4
|
-
control: any;
|
|
5
|
-
index: any;
|
|
6
|
-
actualIndex: any;
|
|
7
|
-
onDelete: any;
|
|
8
|
-
filteredColumnsInitialOptions: any;
|
|
9
|
-
totalColumns: any;
|
|
10
|
-
currentColumnId: any;
|
|
11
|
-
activeOption: any;
|
|
12
|
-
getValues: any;
|
|
13
|
-
addNewColumn: any;
|
|
14
|
-
setToShowDuplicateColumnInAdvanceSearch: any;
|
|
15
|
-
selectedThirdOptionDropdownValue: any;
|
|
16
|
-
setSelectedThirdOptionDropdownValue: any;
|
|
17
|
-
isClearAll: any;
|
|
18
|
-
fields: any;
|
|
19
|
-
isLastVisible: any;
|
|
20
|
-
flag: any;
|
|
21
|
-
setFlag: any;
|
|
22
|
-
pendingDeletions: any;
|
|
23
|
-
setPendingDeletions: any;
|
|
24
|
-
remove: any;
|
|
25
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export default AdvanceSearchModalItem;
|
|
27
|
-
//# sourceMappingURL=AdvanceSearchModalItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AdvanceSearchModalItem.d.ts","sourceRoot":"","sources":["../../../src/components/TableV36/AdvanceSearchModalItem.tsx"],"names":[],"mappings":"AAiBA,QAAA,MAAM,sBAAsB,GAAI;;;;;;;;;;;;;;;;;;;;;;;;CAwB/B,4CAmUA,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export default function AdvanceSortModal({ open, onClose, colDefs, sortState, onApply }: {
|
|
2
|
-
open: any;
|
|
3
|
-
onClose: any;
|
|
4
|
-
colDefs?: never[] | undefined;
|
|
5
|
-
sortState?: never[] | undefined;
|
|
6
|
-
onApply: any;
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
//# sourceMappingURL=AdvanceSortModal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AdvanceSortModal.d.ts","sourceRoot":"","sources":["../../../src/components/TableV36/AdvanceSortModal.tsx"],"names":[],"mappings":"AAuKA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAY,EAAE,SAAc,EAAE,OAAO,EAAE;;;;;;CAAA,2CAkJhG"}
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef, useEffect } from "react";
|
|
3
|
-
import default_1 from "../../node_modules/@mui/icons-material/DragIndicator.js";
|
|
4
|
-
import { getAssetUrl } from "../../utils/assetBase.js";
|
|
5
|
-
import { Badge } from "../Badge/index.js";
|
|
6
|
-
import { Button } from "../Button/index.js";
|
|
7
|
-
import { Modal } from "../Modal/index.js";
|
|
8
|
-
import { Select } from "../Select/index.js";
|
|
9
|
-
import { Tooltip } from "../Tooltip/index.js";
|
|
10
|
-
const SaveViewDeleteIcon = (props) => /* @__PURE__ */ jsx("img", { alt: "", src: getAssetUrl("icons/saveViewDeleteIcon.svg"), ...props });
|
|
11
|
-
const AddOutlinedIcon = (props) => /* @__PURE__ */ jsx("img", { alt: "", src: getAssetUrl("icons/plus.svg"), ...props });
|
|
12
|
-
const SORT_ORDER_OPTIONS_TEXT = [
|
|
13
|
-
{ label: "Ascending (A To Z)", value: "asc" },
|
|
14
|
-
{ label: "Descending (Z To A)", value: "desc" }
|
|
15
|
-
];
|
|
16
|
-
const SORT_ORDER_OPTIONS_NUMBER = [
|
|
17
|
-
{ label: "Smallest to largest", value: "asc" },
|
|
18
|
-
{ label: "Largest to smallest", value: "desc" }
|
|
19
|
-
];
|
|
20
|
-
function getSortOrderOptionsByFilter(filterType) {
|
|
21
|
-
if (filterType === "agNumberColumnFilter") {
|
|
22
|
-
return SORT_ORDER_OPTIONS_NUMBER;
|
|
23
|
-
}
|
|
24
|
-
if (filterType === "agTextColumnFilter") {
|
|
25
|
-
return SORT_ORDER_OPTIONS_TEXT;
|
|
26
|
-
}
|
|
27
|
-
return SORT_ORDER_OPTIONS_TEXT;
|
|
28
|
-
}
|
|
29
|
-
let nextId = 1;
|
|
30
|
-
const generateId = () => `sort-row-${nextId++}`;
|
|
31
|
-
function buildColumnOptions(colDefs) {
|
|
32
|
-
const options = [];
|
|
33
|
-
const collect = (cols) => {
|
|
34
|
-
if (!Array.isArray(cols)) return;
|
|
35
|
-
cols.forEach((col) => {
|
|
36
|
-
if (col.children) {
|
|
37
|
-
collect(col.children);
|
|
38
|
-
} else if (col.field && col.sortable) {
|
|
39
|
-
options.push({
|
|
40
|
-
label: col.headerName || col.field,
|
|
41
|
-
value: col.field,
|
|
42
|
-
filter: col.filter
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
collect(colDefs);
|
|
48
|
-
return options;
|
|
49
|
-
}
|
|
50
|
-
function makeEmptyRow() {
|
|
51
|
-
return { id: generateId(), colId: null, order: "null" };
|
|
52
|
-
}
|
|
53
|
-
function SortRow({
|
|
54
|
-
row,
|
|
55
|
-
index,
|
|
56
|
-
availableColumnOptions,
|
|
57
|
-
selectedColumnOption,
|
|
58
|
-
selectedOrderOption,
|
|
59
|
-
selectedColumnFilter,
|
|
60
|
-
onColumnChange,
|
|
61
|
-
onOrderChange,
|
|
62
|
-
onDelete,
|
|
63
|
-
dragHandlers,
|
|
64
|
-
rowsCount
|
|
65
|
-
}) {
|
|
66
|
-
const [columnIsOpen, setColumnIsOpen] = useState(false);
|
|
67
|
-
const [orderIsOpen, setOrderIsOpen] = useState(false);
|
|
68
|
-
const [columnCurrentOptions, setColumnCurrentOptions] = useState(availableColumnOptions);
|
|
69
|
-
const [orderCurrentOptions, setOrderCurrentOptions] = useState(
|
|
70
|
-
getSortOrderOptionsByFilter(selectedColumnFilter)
|
|
71
|
-
);
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
setColumnCurrentOptions(availableColumnOptions);
|
|
74
|
-
}, [availableColumnOptions]);
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
setOrderCurrentOptions(getSortOrderOptionsByFilter(selectedColumnFilter));
|
|
77
|
-
}, [selectedColumnFilter]);
|
|
78
|
-
return /* @__PURE__ */ jsxs(
|
|
79
|
-
"div",
|
|
80
|
-
{
|
|
81
|
-
draggable: true,
|
|
82
|
-
className: "advance-sort-row",
|
|
83
|
-
onDragEnd: dragHandlers.onDragEnd,
|
|
84
|
-
onDragEnter: () => dragHandlers.onDragEnter(index),
|
|
85
|
-
onDragOver: (e) => {
|
|
86
|
-
e.preventDefault();
|
|
87
|
-
},
|
|
88
|
-
onDragStart: () => dragHandlers.onDragStart(index),
|
|
89
|
-
children: [
|
|
90
|
-
/* @__PURE__ */ jsxs("div", { className: "advance-sort-row-content", children: [
|
|
91
|
-
/* @__PURE__ */ jsx(default_1, { className: "advance-sort-drag-indicator" }),
|
|
92
|
-
/* @__PURE__ */ jsxs("div", { className: "advance-sort-field-group", children: [
|
|
93
|
-
/* @__PURE__ */ jsx(
|
|
94
|
-
Select,
|
|
95
|
-
{
|
|
96
|
-
isWithSearch: true,
|
|
97
|
-
withPortal: true,
|
|
98
|
-
currentOptions: columnCurrentOptions,
|
|
99
|
-
handleChange: (val) => onColumnChange(index, val),
|
|
100
|
-
initialOptions: availableColumnOptions,
|
|
101
|
-
isOpen: columnIsOpen,
|
|
102
|
-
label: "Column",
|
|
103
|
-
minWidth: "210px",
|
|
104
|
-
placeholder: "Select column",
|
|
105
|
-
selectedOptions: selectedColumnOption,
|
|
106
|
-
setCurrentOptions: setColumnCurrentOptions,
|
|
107
|
-
setIsOpen: setColumnIsOpen,
|
|
108
|
-
setSelectedOptions: () => {
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
),
|
|
112
|
-
/* @__PURE__ */ jsx(
|
|
113
|
-
Select,
|
|
114
|
-
{
|
|
115
|
-
withPortal: true,
|
|
116
|
-
currentOptions: orderCurrentOptions,
|
|
117
|
-
handleChange: (val) => onOrderChange(index, val),
|
|
118
|
-
initialOptions: getSortOrderOptionsByFilter(selectedColumnFilter),
|
|
119
|
-
isOpen: orderIsOpen,
|
|
120
|
-
label: "Sorting Order",
|
|
121
|
-
minWidth: "210px",
|
|
122
|
-
placeholder: "Select sorting order",
|
|
123
|
-
selectedOptions: selectedOrderOption,
|
|
124
|
-
setCurrentOptions: setOrderCurrentOptions,
|
|
125
|
-
setIsOpen: setOrderIsOpen,
|
|
126
|
-
setSelectedOptions: () => {
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
] })
|
|
131
|
-
] }),
|
|
132
|
-
/* @__PURE__ */ jsxs("div", { className: "advance-sort-priority-group", children: [
|
|
133
|
-
/* @__PURE__ */ jsx(
|
|
134
|
-
Badge,
|
|
135
|
-
{
|
|
136
|
-
color: "default",
|
|
137
|
-
label: `Priority ${index + 1}`,
|
|
138
|
-
size: "default",
|
|
139
|
-
sx: {
|
|
140
|
-
background: "#F1F3FE !important",
|
|
141
|
-
"& .MuiChip-label": {
|
|
142
|
-
color: "#4259EE !important"
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
variant: "filled"
|
|
146
|
-
}
|
|
147
|
-
),
|
|
148
|
-
/* @__PURE__ */ jsx("div", { className: "divider-line" }),
|
|
149
|
-
/* @__PURE__ */ jsx(Tooltip, { title: "Delete", variant: "tertiary", children: /* @__PURE__ */ jsx("span", { style: { display: "inline-block" }, children: /* @__PURE__ */ jsx(
|
|
150
|
-
Button,
|
|
151
|
-
{
|
|
152
|
-
disabled: rowsCount === 1,
|
|
153
|
-
icon: /* @__PURE__ */ jsx(SaveViewDeleteIcon, {}),
|
|
154
|
-
size: "medium",
|
|
155
|
-
type: "destructive",
|
|
156
|
-
variant: "secondary",
|
|
157
|
-
onClick: () => onDelete(index)
|
|
158
|
-
}
|
|
159
|
-
) }) })
|
|
160
|
-
] })
|
|
161
|
-
]
|
|
162
|
-
}
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
function AdvanceSortModal({ open, onClose, colDefs = [], sortState = [], onApply }) {
|
|
166
|
-
const [rows, setRows] = useState([makeEmptyRow()]);
|
|
167
|
-
const dragIndexRef = useRef(null);
|
|
168
|
-
const dragOverIndexRef = useRef(null);
|
|
169
|
-
const columnOptions = buildColumnOptions(colDefs);
|
|
170
|
-
useEffect(() => {
|
|
171
|
-
if (!open) return;
|
|
172
|
-
if (sortState && sortState.length > 0) {
|
|
173
|
-
setRows(
|
|
174
|
-
sortState.map((s) => ({
|
|
175
|
-
id: generateId(),
|
|
176
|
-
colId: s.colId,
|
|
177
|
-
order: s.sort || "asc"
|
|
178
|
-
}))
|
|
179
|
-
);
|
|
180
|
-
} else {
|
|
181
|
-
setRows([makeEmptyRow()]);
|
|
182
|
-
}
|
|
183
|
-
}, [open]);
|
|
184
|
-
const handleColumnChange = (index, option) => {
|
|
185
|
-
setRows(
|
|
186
|
-
(prev) => prev.map((row, i) => i === index ? { ...row, colId: option ? option.value : null } : row)
|
|
187
|
-
);
|
|
188
|
-
};
|
|
189
|
-
const handleOrderChange = (index, option) => {
|
|
190
|
-
setRows(
|
|
191
|
-
(prev) => prev.map((row, i) => i === index ? { ...row, order: option ? option.value : "asc" } : row)
|
|
192
|
-
);
|
|
193
|
-
};
|
|
194
|
-
const handleDeleteRow = (index) => {
|
|
195
|
-
setRows((prev) => {
|
|
196
|
-
const next = prev.filter((_, i) => i !== index);
|
|
197
|
-
return next.length === 0 ? [makeEmptyRow()] : next;
|
|
198
|
-
});
|
|
199
|
-
};
|
|
200
|
-
const handleAddLevel = () => {
|
|
201
|
-
setRows((prev) => [...prev, makeEmptyRow()]);
|
|
202
|
-
};
|
|
203
|
-
const handleClearValues = () => {
|
|
204
|
-
setRows((prev) => prev.map((row, i) => ({ ...row, order: null })));
|
|
205
|
-
};
|
|
206
|
-
const handleClearAll = () => {
|
|
207
|
-
setRows([makeEmptyRow()]);
|
|
208
|
-
};
|
|
209
|
-
const handleApply = () => {
|
|
210
|
-
const validRows = rows.filter((r) => r.colId);
|
|
211
|
-
onApply(validRows);
|
|
212
|
-
};
|
|
213
|
-
const onDragStart = (index) => {
|
|
214
|
-
dragIndexRef.current = index;
|
|
215
|
-
};
|
|
216
|
-
const onDragEnter = (index) => {
|
|
217
|
-
dragOverIndexRef.current = index;
|
|
218
|
-
};
|
|
219
|
-
const onDragEnd = () => {
|
|
220
|
-
const from = dragIndexRef.current;
|
|
221
|
-
const to = dragOverIndexRef.current;
|
|
222
|
-
if (from === null || to === null || from === to) return;
|
|
223
|
-
setRows((prev) => {
|
|
224
|
-
const next = [...prev];
|
|
225
|
-
const [removed] = next.splice(from, 1);
|
|
226
|
-
next.splice(to, 0, removed);
|
|
227
|
-
return next;
|
|
228
|
-
});
|
|
229
|
-
dragIndexRef.current = null;
|
|
230
|
-
dragOverIndexRef.current = null;
|
|
231
|
-
};
|
|
232
|
-
const getSelectedColumnOption = (colId) => columnOptions.find((o) => o.value === colId) || null;
|
|
233
|
-
const getSelectedOrderOption = (order, colId) => {
|
|
234
|
-
var _a;
|
|
235
|
-
const filterType = (_a = getSelectedColumnOption(colId)) == null ? void 0 : _a.filter;
|
|
236
|
-
return getSortOrderOptionsByFilter(filterType).find((o) => o.value === order) || null;
|
|
237
|
-
};
|
|
238
|
-
const usedColIds = rows.map((r) => r.colId).filter(Boolean);
|
|
239
|
-
const getAvailableColumnOptionsForRow = (rowColId) => columnOptions.filter((opt) => opt.value === rowColId || !usedColIds.includes(opt.value));
|
|
240
|
-
return /* @__PURE__ */ jsx(
|
|
241
|
-
Modal,
|
|
242
|
-
{
|
|
243
|
-
className: "advance-sort-modal",
|
|
244
|
-
open,
|
|
245
|
-
primaryButtonLabel: "Apply",
|
|
246
|
-
secondaryButtonLabel: "Cancel",
|
|
247
|
-
size: "medium",
|
|
248
|
-
title: "Advance Sort",
|
|
249
|
-
onClose,
|
|
250
|
-
onPrimaryButtonClick: handleApply,
|
|
251
|
-
onSecondaryButtonClick: onClose,
|
|
252
|
-
children: /* @__PURE__ */ jsxs("div", { className: "advance-sort-modal-body", children: [
|
|
253
|
-
/* @__PURE__ */ jsxs("div", { className: "advance-sort-section-header", children: [
|
|
254
|
-
/* @__PURE__ */ jsx("span", { className: "advance-sort-section-title", children: "Column sort" }),
|
|
255
|
-
/* @__PURE__ */ jsx(Button, { variant: "url", onClick: handleClearAll, children: "Clear All" })
|
|
256
|
-
] }),
|
|
257
|
-
/* @__PURE__ */ jsx("div", { className: "advance-sort-rows", children: rows.map((row, index) => {
|
|
258
|
-
var _a;
|
|
259
|
-
return /* @__PURE__ */ jsx(
|
|
260
|
-
SortRow,
|
|
261
|
-
{
|
|
262
|
-
availableColumnOptions: getAvailableColumnOptionsForRow(row.colId),
|
|
263
|
-
dragHandlers: { onDragStart, onDragEnter, onDragEnd },
|
|
264
|
-
index,
|
|
265
|
-
row,
|
|
266
|
-
rowsCount: rows.length,
|
|
267
|
-
selectedColumnFilter: (_a = getSelectedColumnOption(row.colId)) == null ? void 0 : _a.filter,
|
|
268
|
-
selectedColumnOption: getSelectedColumnOption(row.colId),
|
|
269
|
-
selectedOrderOption: getSelectedOrderOption(row.order, row.colId),
|
|
270
|
-
onColumnChange: handleColumnChange,
|
|
271
|
-
onDelete: handleDeleteRow,
|
|
272
|
-
onOrderChange: handleOrderChange
|
|
273
|
-
},
|
|
274
|
-
row.id
|
|
275
|
-
);
|
|
276
|
-
}) }),
|
|
277
|
-
/* @__PURE__ */ jsxs("div", { className: "advance-sort-footer-actions", children: [
|
|
278
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: handleClearValues, children: "Clear Values" }),
|
|
279
|
-
/* @__PURE__ */ jsx(
|
|
280
|
-
Button,
|
|
281
|
-
{
|
|
282
|
-
className: "advance-sort-add-level-button",
|
|
283
|
-
disabled: columnOptions.length === rows.length,
|
|
284
|
-
icon: /* @__PURE__ */ jsx(AddOutlinedIcon, {}),
|
|
285
|
-
variant: "tertiary",
|
|
286
|
-
onClick: handleAddLevel,
|
|
287
|
-
children: "Add Level"
|
|
288
|
-
}
|
|
289
|
-
)
|
|
290
|
-
] })
|
|
291
|
-
] })
|
|
292
|
-
}
|
|
293
|
-
);
|
|
294
|
-
}
|
|
295
|
-
export {
|
|
296
|
-
AdvanceSortModal as default
|
|
297
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
declare function AgGridHeader({ children, sortModel, handleInlineSearch, handleClearSearchInline, handleCloseInputField, debounceTime, initialFilters, enableHeaderTextWrap, ...rest }: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
children: any;
|
|
6
|
-
sortModel: any;
|
|
7
|
-
handleInlineSearch: any;
|
|
8
|
-
handleClearSearchInline: any;
|
|
9
|
-
handleCloseInputField: any;
|
|
10
|
-
debounceTime: any;
|
|
11
|
-
initialFilters: any;
|
|
12
|
-
enableHeaderTextWrap?: boolean | undefined;
|
|
13
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
-
declare const _default: React.MemoExoticComponent<typeof AgGridHeader>;
|
|
15
|
-
export default _default;
|
|
16
|
-
//# sourceMappingURL=AgGridHeader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AgGridHeader.d.ts","sourceRoot":"","sources":["../../../src/components/TableV36/AgGridHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAmBxF,iBAAS,YAAY,CAAC,EACpB,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACd,oBAA2B,EAC3B,GAAG,IAAI,EACR;;;;;;;;;;CAAA,kDA66BA;;AA2BD,wBAAuD"}
|