impact-ui 4.0.15-alpha.2 → 4.0.16
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/index4.js +2 -4
- package/dist/_virtual/index5.js +3 -3
- package/dist/_virtual/index6.js +4 -2
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +2 -3
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.d.ts.map +1 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.js +6 -31
- package/dist/components/Notification/NotificationBody/NotificationPanelContent.js +2 -2
- package/dist/components/Notification/NotificationBody/NotificationTaskList.js +1 -2
- package/dist/components/Notification/index.js +1 -1
- package/dist/components/Table/Table.types.d.ts +4 -0
- package/dist/components/Table/Table.types.d.ts.map +1 -1
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +11 -4
- package/dist/components/Table/tableFunctions.d.ts +1 -0
- package/dist/components/Table/tableFunctions.d.ts.map +1 -1
- package/dist/components/Table/tableHeader.d.ts +2 -1
- package/dist/components/Table/tableHeader.d.ts.map +1 -1
- package/dist/components/Table/tableHeader.js +2 -0
- package/dist/components/Table/tableMoreOptions.d.ts +2 -1
- package/dist/components/Table/tableMoreOptions.d.ts.map +1 -1
- package/dist/components/Table/tableMoreOptions.js +46 -2
- package/dist/components/Table/tableSettings.d.ts.map +1 -1
- package/dist/components/Table/tableSettings.js +3 -2
- package/dist/components/TableOld/index.d.ts.map +1 -1
- package/dist/components/TableOld/index.js +23 -9
- package/dist/components/TableOld/tableFunctions.d.ts +1 -0
- package/dist/components/TableOld/tableFunctions.d.ts.map +1 -1
- package/dist/components/TableOld/tableHeader.d.ts +2 -1
- package/dist/components/TableOld/tableHeader.d.ts.map +1 -1
- package/dist/components/TableOld/tableHeader.js +2 -0
- package/dist/components/shared/tableColumnSettings/agGridColumnSettingsApi.d.ts +17 -0
- package/dist/components/shared/tableColumnSettings/agGridColumnSettingsApi.d.ts.map +1 -0
- package/dist/components/shared/tableColumnSettings/agGridColumnSettingsApi.js +52 -0
- package/dist/components/shared/tableColumnSettings/columnsSettingsColumnRow.d.ts +12 -0
- package/dist/components/shared/tableColumnSettings/columnsSettingsColumnRow.d.ts.map +1 -0
- package/dist/components/shared/tableColumnSettings/columnsSettingsColumnRow.js +262 -0
- package/dist/components/shared/tableColumnSettings/columnsSettingsVirtualList.d.ts +39 -0
- package/dist/components/shared/tableColumnSettings/columnsSettingsVirtualList.d.ts.map +1 -0
- package/dist/components/shared/tableColumnSettings/columnsSettingsVirtualList.js +294 -0
- package/dist/components/shared/tableColumnSettings/columnsTabV36.d.ts +4 -0
- package/dist/components/shared/tableColumnSettings/columnsTabV36.d.ts.map +1 -0
- package/dist/components/shared/tableColumnSettings/columnsTabV36.js +1523 -0
- package/dist/components/shared/tableColumnSettings/index.d.ts +4 -0
- package/dist/components/shared/tableColumnSettings/index.d.ts.map +1 -0
- package/dist/components/shared/tableColumnSettings/tableSettingsV36.d.ts +41 -0
- package/dist/components/shared/tableColumnSettings/tableSettingsV36.d.ts.map +1 -0
- package/dist/components/shared/tableColumnSettings/tableSettingsV36.js +327 -0
- package/dist/mcp-component-registry.json +7 -1
- package/dist/node_modules/@impactsmartsuite/impact-icons/dist/index.js +128 -75
- package/dist/node_modules/@mui/system/colorManipulator.js +2 -2
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/stories/tableStoryDefaults.d.ts +18 -0
- package/dist/stories/tableStoryDefaults.d.ts.map +1 -0
- package/dist/stories/tableStoryManyColumns.d.ts +44 -0
- package/dist/stories/tableStoryManyColumns.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -53,4 +53,5 @@ export declare const getMainMenuItems: (params: any) => (string | {
|
|
|
53
53
|
})[];
|
|
54
54
|
export declare const Columns: import('react').ForwardRefExoticComponent<import('react').RefAttributes<unknown>>;
|
|
55
55
|
export declare const updateFontSizeOnToolPanel: (fontSizeType: any) => string;
|
|
56
|
+
export { ColumnsV36 } from '../shared/tableColumnSettings/columnsTabV36';
|
|
56
57
|
//# sourceMappingURL=tableFunctions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableFunctions.d.ts","sourceRoot":"","sources":["../../../src/components/TableOld/tableFunctions.tsx"],"names":[],"mappings":"AAoDA,eAAO,MAAM,oBAAoB,GAAI,WAAM,SAQ1C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,WAAM,EAAE,aAAQ,SAK5C,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,WAAM,SAK9C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,eAAU,EAAE,WAAM,EAAE,QAAG,SAM/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,WAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsItC,CAAC;AAiEF,eAAO,MAAM,OAAO,mFAkyClB,CAAC;AAEH,eAAO,MAAM,yBAAyB,GAAI,iBAAY,WAgBrD,CAAC"}
|
|
1
|
+
{"version":3,"file":"tableFunctions.d.ts","sourceRoot":"","sources":["../../../src/components/TableOld/tableFunctions.tsx"],"names":[],"mappings":"AAoDA,eAAO,MAAM,oBAAoB,GAAI,WAAM,SAQ1C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,WAAM,EAAE,aAAQ,SAK5C,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,WAAM,SAK9C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,eAAU,EAAE,WAAM,EAAE,QAAG,SAM/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,WAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsItC,CAAC;AAiEF,eAAO,MAAM,OAAO,mFAkyClB,CAAC;AAEH,eAAO,MAAM,yBAAyB,GAAI,iBAAY,WAgBrD,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function TableHeader({ actualRef, colDefs, Columns, tableFontSize, setTableFontSize, rowHeight, setRowHeight, tableHeader, topRightOptions, topLeftOptions, onGlobalSearchClick, cardContainer, onNumberFormatChange, hideRowHeightOptionMenu, showDownloadButton, onDownloadButtonClick, closeButton, handleCloseButtonClick, additionalButtons, setTableSettingOpen, showHideEditableCells, handleShowHideEditableCells, topCenterOptions, tableActions, onTableActionsTabClick, hideTableFormat, hideTableActions, hideTableSetting, explicitlyCloseTableSetting, customSystemButton, onContentDensityChange, savedViewsOptions, handleSaveAndApply, maxSavedViews, handleSavedViewClick, handleEditSaveView, isSaveViewEnabled, isSavingViewLoading, handleDeleteViewClick, isDeleteViewLoading, handleSetDefaultView, closeTableSettingOnOutsideClick, onTableSettingClick, deleteViewPromptText, isViewNameUniqueAcrossTypes, saveViewCustomFilter, customRenderSaveViewContent, numericFormatDefault, viewPoint, }: {
|
|
1
|
+
export default function TableHeader({ actualRef, colDefs, Columns, tableFontSize, setTableFontSize, rowHeight, setRowHeight, tableHeader, topRightOptions, topLeftOptions, onGlobalSearchClick, cardContainer, onNumberFormatChange, hideRowHeightOptionMenu, showDownloadButton, onDownloadButtonClick, closeButton, handleCloseButtonClick, additionalButtons, setTableSettingOpen, showHideEditableCells, handleShowHideEditableCells, topCenterOptions, tableActions, onTableActionsTabClick, hideTableFormat, hideTableActions, hideTableSetting, explicitlyCloseTableSetting, customSystemButton, onContentDensityChange, savedViewsOptions, handleSaveAndApply, maxSavedViews, handleSavedViewClick, handleEditSaveView, isSaveViewEnabled, isSavingViewLoading, handleDeleteViewClick, isDeleteViewLoading, handleSetDefaultView, closeTableSettingOnOutsideClick, onTableSettingClick, deleteViewPromptText, isViewNameUniqueAcrossTypes, saveViewCustomFilter, customRenderSaveViewContent, columnSettingsMode, numericFormatDefault, viewPoint, }: {
|
|
2
2
|
actualRef: any;
|
|
3
3
|
colDefs: any;
|
|
4
4
|
Columns: any;
|
|
@@ -46,6 +46,7 @@ export default function TableHeader({ actualRef, colDefs, Columns, tableFontSize
|
|
|
46
46
|
isViewNameUniqueAcrossTypes: any;
|
|
47
47
|
saveViewCustomFilter: any;
|
|
48
48
|
customRenderSaveViewContent: any;
|
|
49
|
+
columnSettingsMode?: string | undefined;
|
|
49
50
|
numericFormatDefault: any;
|
|
50
51
|
viewPoint: any;
|
|
51
52
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableHeader.d.ts","sourceRoot":"","sources":["../../../src/components/TableOld/tableHeader.tsx"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,SAAS,EACT,OAAO,EACP,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,2BAA2B,EAC3B,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,+BAA+B,EAC/B,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,oBAAoB,EACpB,2BAA2B,EAC3B,oBAAoB,EACpB,SAAS,GACV
|
|
1
|
+
{"version":3,"file":"tableHeader.d.ts","sourceRoot":"","sources":["../../../src/components/TableOld/tableHeader.tsx"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,SAAS,EACT,OAAO,EACP,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,2BAA2B,EAC3B,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,+BAA+B,EAC/B,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,oBAAoB,EACpB,2BAA2B,EAC3B,kBAA0B,EAC1B,oBAAoB,EACpB,SAAS,GACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA,kDAwMA"}
|
|
@@ -52,6 +52,7 @@ function TableHeader({
|
|
|
52
52
|
isViewNameUniqueAcrossTypes,
|
|
53
53
|
saveViewCustomFilter,
|
|
54
54
|
customRenderSaveViewContent,
|
|
55
|
+
columnSettingsMode = "v36",
|
|
55
56
|
numericFormatDefault,
|
|
56
57
|
viewPoint
|
|
57
58
|
}) {
|
|
@@ -177,6 +178,7 @@ function TableHeader({
|
|
|
177
178
|
actualRef,
|
|
178
179
|
colDefs,
|
|
179
180
|
Columns,
|
|
181
|
+
columnSettingsMode,
|
|
180
182
|
customRenderSaveViewContent,
|
|
181
183
|
deleteViewPromptText,
|
|
182
184
|
explicitlyCloseTableSetting,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column visibility helpers for Table Settings v36 across AG Grid versions.
|
|
3
|
+
* - v27 (OldTable): columnApi.setColumnVisible
|
|
4
|
+
* - v31+: gridApi.setColumnVisible
|
|
5
|
+
* - v33+: gridApi.setColumnsVisible (batch)
|
|
6
|
+
*/
|
|
7
|
+
type GridRefLike = {
|
|
8
|
+
current?: {
|
|
9
|
+
api?: unknown;
|
|
10
|
+
columnApi?: unknown;
|
|
11
|
+
};
|
|
12
|
+
} | null | undefined;
|
|
13
|
+
export declare function resolveColumnStateApi(gridApi: any, gridRef?: GridRefLike): any;
|
|
14
|
+
/** Apply colId→visible using the best API available on this grid version. */
|
|
15
|
+
export declare function applyVisibilityMapToGrid(gridApi: any, visibilityMap: any, gridRef?: GridRefLike): void;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=agGridColumnSettingsApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agGridColumnSettingsApi.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/tableColumnSettings/agGridColumnSettingsApi.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAE3F,wBAAgB,qBAAqB,CAAC,OAAO,KAAA,EAAE,OAAO,CAAC,EAAE,WAAW,OAUnE;AAkBD,6EAA6E;AAC7E,wBAAgB,wBAAwB,CAAC,OAAO,KAAA,EAAE,aAAa,KAAA,EAAE,OAAO,CAAC,EAAE,WAAW,QAsBrF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
function resolveColumnStateApi(gridApi, gridRef) {
|
|
2
|
+
var _a;
|
|
3
|
+
if (!gridApi) return null;
|
|
4
|
+
if (typeof gridApi.applyColumnState === "function") {
|
|
5
|
+
return gridApi;
|
|
6
|
+
}
|
|
7
|
+
const columnApi = gridApi.columnApi ?? ((_a = gridRef == null ? void 0 : gridRef.current) == null ? void 0 : _a.columnApi);
|
|
8
|
+
if (columnApi && typeof columnApi.applyColumnState === "function") {
|
|
9
|
+
return columnApi;
|
|
10
|
+
}
|
|
11
|
+
return gridApi;
|
|
12
|
+
}
|
|
13
|
+
function setOneColumnVisible(gridApi, colId, visible, gridRef) {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
if (typeof gridApi.setColumnVisible === "function") {
|
|
16
|
+
gridApi.setColumnVisible(colId, visible);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const columnApi = gridApi.columnApi ?? ((_a = gridRef == null ? void 0 : gridRef.current) == null ? void 0 : _a.columnApi);
|
|
20
|
+
if (columnApi && typeof columnApi.setColumnVisible === "function") {
|
|
21
|
+
columnApi.setColumnVisible(colId, visible);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const stateApi = resolveColumnStateApi(gridApi, gridRef);
|
|
25
|
+
(_b = stateApi == null ? void 0 : stateApi.applyColumnState) == null ? void 0 : _b.call(stateApi, {
|
|
26
|
+
state: [{ colId, hide: !visible }]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function applyVisibilityMapToGrid(gridApi, visibilityMap, gridRef) {
|
|
30
|
+
if (!gridApi || !(visibilityMap == null ? void 0 : visibilityMap.size)) return;
|
|
31
|
+
const showIds = [];
|
|
32
|
+
const hideIds = [];
|
|
33
|
+
visibilityMap.forEach((visible, colId) => {
|
|
34
|
+
if (visible) showIds.push(colId);
|
|
35
|
+
else hideIds.push(colId);
|
|
36
|
+
});
|
|
37
|
+
if (typeof gridApi.setColumnsVisible === "function") {
|
|
38
|
+
if (showIds.length) gridApi.setColumnsVisible(showIds, true);
|
|
39
|
+
if (hideIds.length) gridApi.setColumnsVisible(hideIds, false);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
showIds.forEach((colId) => {
|
|
43
|
+
setOneColumnVisible(gridApi, colId, true, gridRef);
|
|
44
|
+
});
|
|
45
|
+
hideIds.forEach((colId) => {
|
|
46
|
+
setOneColumnVisible(gridApi, colId, false, gridRef);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
applyVisibilityMapToGrid,
|
|
51
|
+
resolveColumnStateApi
|
|
52
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare const capitalizeHeader: (name: any) => any;
|
|
4
|
+
/** Figma / TableV36: scrollable rows under Main Column start at 48px; +28px per tree level. */
|
|
5
|
+
export declare const SETTINGS_COLUMN_INDENT_STEP = 28;
|
|
6
|
+
export declare const SETTINGS_SCROLL_COLUMN_INDENT_BASE = 48;
|
|
7
|
+
export declare const SETTINGS_FROZEN_COLUMN_INDENT_BASE = 20;
|
|
8
|
+
/** Top-level sortable row — groups drag as a unit with nested children inside. */
|
|
9
|
+
export declare const SortableColumnItem: React.NamedExoticComponent<object>;
|
|
10
|
+
/** Nested child row — not individually sortable (AG Grid group constraint). */
|
|
11
|
+
export declare const NestedColumnItem: React.NamedExoticComponent<object>;
|
|
12
|
+
//# sourceMappingURL=columnsSettingsColumnRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnsSettingsColumnRow.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/tableColumnSettings/columnsSettingsColumnRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAS1D,eAAO,MAAM,gBAAgB,GAAI,SAAI,QACqB,CAAC;AAE3D,+FAA+F;AAC/F,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,kCAAkC,KAAK,CAAC;AACrD,eAAO,MAAM,kCAAkC,KAAK,CAAC;AAoLrD,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,oCAqDN,CAAC;AAE1B,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,oCAgC3B,CAAC"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo, useCallback } from "react";
|
|
3
|
+
import { useSortable } from "@dnd-kit/sortable";
|
|
4
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
5
|
+
import default_1 from "../../../node_modules/@mui/icons-material/KeyboardArrowRight.js";
|
|
6
|
+
import default_1$1 from "../../../node_modules/@mui/icons-material/KeyboardArrowUp.js";
|
|
7
|
+
import { Checkbox } from "../../Checkbox/index.js";
|
|
8
|
+
import IconButton from "../../../node_modules/@mui/material/IconButton/IconButton.js";
|
|
9
|
+
import DragIndicator from "../../../node_modules/@mui/icons-material/esm/DragIndicator.js";
|
|
10
|
+
const capitalizeHeader = (name) => name ? name.charAt(0).toUpperCase() + name.slice(1) : "";
|
|
11
|
+
const SETTINGS_COLUMN_INDENT_STEP = 28;
|
|
12
|
+
const SETTINGS_SCROLL_COLUMN_INDENT_BASE = 48;
|
|
13
|
+
const SETTINGS_FROZEN_COLUMN_INDENT_BASE = 20;
|
|
14
|
+
const getSettingsRowPaddingLeft = (rowClassName, level) => {
|
|
15
|
+
const isFrozen = rowClassName == null ? void 0 : rowClassName.includes("frozen-columns-list-item");
|
|
16
|
+
const base = isFrozen ? SETTINGS_FROZEN_COLUMN_INDENT_BASE : SETTINGS_SCROLL_COLUMN_INDENT_BASE;
|
|
17
|
+
return base + level * SETTINGS_COLUMN_INDENT_STEP;
|
|
18
|
+
};
|
|
19
|
+
const ColumnRowContent = memo(function ColumnRowContent2({
|
|
20
|
+
column,
|
|
21
|
+
level,
|
|
22
|
+
isCollapsed,
|
|
23
|
+
hasChildren,
|
|
24
|
+
isIndeterminate,
|
|
25
|
+
checkboxChecked,
|
|
26
|
+
reserveCollapseSlot,
|
|
27
|
+
rowClassName,
|
|
28
|
+
dragIconClass,
|
|
29
|
+
onToggleCollapse,
|
|
30
|
+
onToggleVisibility,
|
|
31
|
+
onKeyboardReorder,
|
|
32
|
+
dragHandleProps,
|
|
33
|
+
isOverlay
|
|
34
|
+
}) {
|
|
35
|
+
const rowStyle = useMemo(
|
|
36
|
+
() => ({
|
|
37
|
+
["--indent-level"]: level,
|
|
38
|
+
// Inline padding wins over legacy Table.scss (8px / 50px list) in virtualized lists.
|
|
39
|
+
paddingLeft: `${getSettingsRowPaddingLeft(rowClassName, level)}px`,
|
|
40
|
+
boxSizing: "border-box"
|
|
41
|
+
}),
|
|
42
|
+
[level, rowClassName]
|
|
43
|
+
);
|
|
44
|
+
const handleCollapseClick = useCallback(
|
|
45
|
+
(e) => {
|
|
46
|
+
e.stopPropagation();
|
|
47
|
+
onToggleCollapse == null ? void 0 : onToggleCollapse(column.colId);
|
|
48
|
+
},
|
|
49
|
+
[onToggleCollapse, column.colId]
|
|
50
|
+
);
|
|
51
|
+
const handleVisibilityChange = useCallback(() => {
|
|
52
|
+
onToggleVisibility == null ? void 0 : onToggleVisibility(column.colId);
|
|
53
|
+
}, [onToggleVisibility, column.colId]);
|
|
54
|
+
const handleRowKeyDown = useCallback(
|
|
55
|
+
(e) => {
|
|
56
|
+
var _a, _b, _c, _d;
|
|
57
|
+
if (isOverlay) return;
|
|
58
|
+
const current = e.currentTarget;
|
|
59
|
+
if (e.altKey && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
onKeyboardReorder == null ? void 0 : onKeyboardReorder(column.colId, e.key === "ArrowUp" ? -1 : 1);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
switch (e.key) {
|
|
65
|
+
case "ArrowDown": {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
const next = (_b = (_a = current.parentElement) == null ? void 0 : _a.nextElementSibling) == null ? void 0 : _b.querySelector('[role="treeitem"]');
|
|
68
|
+
next == null ? void 0 : next.focus();
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
case "ArrowUp": {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
const prev = (_d = (_c = current.parentElement) == null ? void 0 : _c.previousElementSibling) == null ? void 0 : _d.querySelector('[role="treeitem"]');
|
|
74
|
+
prev == null ? void 0 : prev.focus();
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
case "ArrowRight": {
|
|
78
|
+
if (hasChildren && isCollapsed) {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
onToggleCollapse == null ? void 0 : onToggleCollapse(column.colId);
|
|
81
|
+
}
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
case "ArrowLeft": {
|
|
85
|
+
if (hasChildren && !isCollapsed) {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
onToggleCollapse == null ? void 0 : onToggleCollapse(column.colId);
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
case "Enter":
|
|
92
|
+
case " ": {
|
|
93
|
+
if (column.disabled) break;
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
onToggleVisibility == null ? void 0 : onToggleVisibility(column.colId);
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
[
|
|
101
|
+
isOverlay,
|
|
102
|
+
level,
|
|
103
|
+
hasChildren,
|
|
104
|
+
isCollapsed,
|
|
105
|
+
onToggleCollapse,
|
|
106
|
+
onToggleVisibility,
|
|
107
|
+
onKeyboardReorder,
|
|
108
|
+
column.colId,
|
|
109
|
+
column.disabled
|
|
110
|
+
]
|
|
111
|
+
);
|
|
112
|
+
return /* @__PURE__ */ jsxs(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
"aria-checked": isIndeterminate ? "mixed" : checkboxChecked,
|
|
116
|
+
"aria-expanded": hasChildren ? !isCollapsed : void 0,
|
|
117
|
+
"aria-label": column.headerName,
|
|
118
|
+
"aria-roledescription": !isOverlay && dragHandleProps ? "sortable column" : void 0,
|
|
119
|
+
"aria-selected": !!checkboxChecked,
|
|
120
|
+
className: rowClassName,
|
|
121
|
+
"data-col-id": column.colId,
|
|
122
|
+
role: "treeitem",
|
|
123
|
+
style: rowStyle,
|
|
124
|
+
tabIndex: isOverlay ? -1 : 0,
|
|
125
|
+
onKeyDown: handleRowKeyDown,
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ jsxs("div", { className: "table-setting-column-leading", children: [
|
|
128
|
+
reserveCollapseSlot && /* @__PURE__ */ jsx("span", { "aria-hidden": !hasChildren, className: "table-setting-column-collapse-slot", children: hasChildren ? /* @__PURE__ */ jsx(
|
|
129
|
+
IconButton,
|
|
130
|
+
{
|
|
131
|
+
"aria-label": isCollapsed ? "Expand column group" : "Collapse column group",
|
|
132
|
+
className: "table-setting-column-collapse-btn",
|
|
133
|
+
onClick: handleCollapseClick,
|
|
134
|
+
children: isCollapsed ? /* @__PURE__ */ jsx(default_1, {}) : /* @__PURE__ */ jsx(default_1$1, {})
|
|
135
|
+
}
|
|
136
|
+
) : null }),
|
|
137
|
+
/* @__PURE__ */ jsx(
|
|
138
|
+
Checkbox,
|
|
139
|
+
{
|
|
140
|
+
checked: checkboxChecked,
|
|
141
|
+
disabled: column.disabled || isOverlay,
|
|
142
|
+
variant: isIndeterminate ? "dashed" : "default",
|
|
143
|
+
onChange: handleVisibilityChange
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
] }),
|
|
147
|
+
/* @__PURE__ */ jsxs("div", { className: "table-setting-column-trailing", children: [
|
|
148
|
+
dragHandleProps && /* @__PURE__ */ jsx(
|
|
149
|
+
"span",
|
|
150
|
+
{
|
|
151
|
+
className: "table-setting-column-drag-handle",
|
|
152
|
+
...dragHandleProps,
|
|
153
|
+
"aria-label": `Reorder ${column.headerName}`,
|
|
154
|
+
children: /* @__PURE__ */ jsx(DragIndicator, { className: dragIconClass })
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
/* @__PURE__ */ jsx("span", { className: "table-setting-column-name", children: capitalizeHeader(column.headerName) })
|
|
158
|
+
] })
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
});
|
|
163
|
+
const areSortablePropsEqual = (prev, next) => prev.column.colId === next.column.colId && prev.column.isVisible === next.column.isVisible && prev.column.headerName === next.column.headerName && prev.column.disabled === next.column.disabled && prev.isIndeterminate === next.isIndeterminate && prev.checkboxChecked === next.checkboxChecked && prev.reserveCollapseSlot === next.reserveCollapseSlot && prev.level === next.level && prev.isCollapsed === next.isCollapsed && prev.hasChildren === next.hasChildren && prev.rowClassName === next.rowClassName && prev.dragIconClass === next.dragIconClass && prev.onToggleCollapse === next.onToggleCollapse && prev.onToggleVisibility === next.onToggleVisibility && prev.onKeyboardReorder === next.onKeyboardReorder && prev.children === next.children;
|
|
164
|
+
const SortableColumnItem = memo(function SortableColumnItem2({
|
|
165
|
+
column,
|
|
166
|
+
level,
|
|
167
|
+
isCollapsed,
|
|
168
|
+
hasChildren,
|
|
169
|
+
isIndeterminate,
|
|
170
|
+
checkboxChecked,
|
|
171
|
+
reserveCollapseSlot,
|
|
172
|
+
rowClassName,
|
|
173
|
+
dragIconClass,
|
|
174
|
+
onToggleCollapse,
|
|
175
|
+
onToggleVisibility,
|
|
176
|
+
onKeyboardReorder,
|
|
177
|
+
children
|
|
178
|
+
}) {
|
|
179
|
+
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
|
|
180
|
+
id: column.colId
|
|
181
|
+
});
|
|
182
|
+
const style = useMemo(
|
|
183
|
+
() => ({
|
|
184
|
+
transform: CSS.Transform.toString(transform),
|
|
185
|
+
transition,
|
|
186
|
+
opacity: isDragging ? 0 : void 0,
|
|
187
|
+
zIndex: isDragging ? 0 : void 0
|
|
188
|
+
}),
|
|
189
|
+
[transform, transition, isDragging]
|
|
190
|
+
);
|
|
191
|
+
return /* @__PURE__ */ jsxs(
|
|
192
|
+
"div",
|
|
193
|
+
{
|
|
194
|
+
ref: setNodeRef,
|
|
195
|
+
className: isDragging ? "table-setting-column-sortable--dragging" : void 0,
|
|
196
|
+
style,
|
|
197
|
+
children: [
|
|
198
|
+
/* @__PURE__ */ jsx(
|
|
199
|
+
ColumnRowContent,
|
|
200
|
+
{
|
|
201
|
+
checkboxChecked,
|
|
202
|
+
column,
|
|
203
|
+
dragHandleProps: { ...attributes, ...listeners },
|
|
204
|
+
dragIconClass,
|
|
205
|
+
hasChildren,
|
|
206
|
+
isCollapsed,
|
|
207
|
+
isIndeterminate,
|
|
208
|
+
level,
|
|
209
|
+
reserveCollapseSlot,
|
|
210
|
+
rowClassName,
|
|
211
|
+
onKeyboardReorder,
|
|
212
|
+
onToggleCollapse,
|
|
213
|
+
onToggleVisibility
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
hasChildren && !isCollapsed && children
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
);
|
|
220
|
+
}, areSortablePropsEqual);
|
|
221
|
+
const NestedColumnItem = memo(function NestedColumnItem2({
|
|
222
|
+
column,
|
|
223
|
+
level,
|
|
224
|
+
isCollapsed,
|
|
225
|
+
hasChildren,
|
|
226
|
+
isIndeterminate,
|
|
227
|
+
checkboxChecked,
|
|
228
|
+
reserveCollapseSlot,
|
|
229
|
+
rowClassName,
|
|
230
|
+
dragIconClass,
|
|
231
|
+
onToggleCollapse,
|
|
232
|
+
onToggleVisibility,
|
|
233
|
+
children
|
|
234
|
+
}) {
|
|
235
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
236
|
+
/* @__PURE__ */ jsx(
|
|
237
|
+
ColumnRowContent,
|
|
238
|
+
{
|
|
239
|
+
checkboxChecked,
|
|
240
|
+
column,
|
|
241
|
+
dragIconClass,
|
|
242
|
+
hasChildren,
|
|
243
|
+
isCollapsed,
|
|
244
|
+
isIndeterminate,
|
|
245
|
+
level,
|
|
246
|
+
reserveCollapseSlot,
|
|
247
|
+
rowClassName,
|
|
248
|
+
onToggleCollapse,
|
|
249
|
+
onToggleVisibility
|
|
250
|
+
}
|
|
251
|
+
),
|
|
252
|
+
hasChildren && !isCollapsed && children
|
|
253
|
+
] });
|
|
254
|
+
});
|
|
255
|
+
export {
|
|
256
|
+
NestedColumnItem,
|
|
257
|
+
SETTINGS_COLUMN_INDENT_STEP,
|
|
258
|
+
SETTINGS_FROZEN_COLUMN_INDENT_BASE,
|
|
259
|
+
SETTINGS_SCROLL_COLUMN_INDENT_BASE,
|
|
260
|
+
SortableColumnItem,
|
|
261
|
+
capitalizeHeader
|
|
262
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Row height (px) — must match Table.styles.scss (26px min-height + 4px padding). */
|
|
4
|
+
export declare const SETTINGS_ROW_HEIGHT = 28;
|
|
5
|
+
/** Above this many painted rows, use the flat virtualized list instead of nested DOM. */
|
|
6
|
+
export declare const SETTINGS_VIRTUALIZE_THRESHOLD = 300;
|
|
7
|
+
export declare const SETTINGS_FROZEN_LIST_MAX_HEIGHT = 204;
|
|
8
|
+
export declare const SETTINGS_SCROLL_LIST_MAX_HEIGHT = 408;
|
|
9
|
+
/** Scroll a windowed settings list when the pointer sits on its top/bottom edge during drag. */
|
|
10
|
+
export declare const scrollListTowardPointer: (listEl: any, clientY: any) => boolean;
|
|
11
|
+
/** One bottom-up pass: colId → { checked, indeterminate } for the whole column tree. */
|
|
12
|
+
export declare const buildCheckStateMap: (columnGroups: any) => Map<any, any>;
|
|
13
|
+
/** Flatten a filtered column tree into painted rows (respects collapsed groups). */
|
|
14
|
+
export declare const flattenColumnRows: (columns: any, collapsedMap: any, section: any) => any[];
|
|
15
|
+
/** Split measured panel height between frozen and scrollable virtual lists. */
|
|
16
|
+
export declare const computeSettingsListHeights: ({ shouldVirtualize, listViewportHeight, frozenRowCount, scrollableRowCount, }: {
|
|
17
|
+
shouldVirtualize: any;
|
|
18
|
+
listViewportHeight: any;
|
|
19
|
+
frozenRowCount: any;
|
|
20
|
+
scrollableRowCount: any;
|
|
21
|
+
}) => {
|
|
22
|
+
frozen: number;
|
|
23
|
+
scrollable: number;
|
|
24
|
+
};
|
|
25
|
+
export declare const FrozenListOuter: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
|
|
26
|
+
export declare const ScrollableListOuter: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
|
|
27
|
+
/**
|
|
28
|
+
* react-window list with a detached scrollbar (AG Grid pattern) so thumb drag is not
|
|
29
|
+
* fighting row mount/unmount on the same scroll element.
|
|
30
|
+
*/
|
|
31
|
+
export declare const VirtualColumnList: ({ className, itemData, maxHeight, outerElementType, outerRef, rows, }: {
|
|
32
|
+
className: any;
|
|
33
|
+
itemData: any;
|
|
34
|
+
maxHeight: any;
|
|
35
|
+
outerElementType: any;
|
|
36
|
+
outerRef: any;
|
|
37
|
+
rows: any;
|
|
38
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
39
|
+
//# sourceMappingURL=columnsSettingsVirtualList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnsSettingsVirtualList.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/tableColumnSettings/columnsSettingsVirtualList.tsx"],"names":[],"mappings":"AACA;;;GAGG;AACH,OAAO,KAAgE,MAAM,OAAO,CAAC;AAIrF,sFAAsF;AACtF,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,yFAAyF;AACzF,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,eAAO,MAAM,+BAA+B,MAAM,CAAC;AACnD,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAYnD,gGAAgG;AAChG,eAAO,MAAM,uBAAuB,GAAI,WAAM,EAAE,YAAO,YAatD,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,kBAAkB,GAAI,iBAAY,kBAwB9C,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,GAAI,YAAO,EAAE,iBAAY,EAAE,YAAO,UAe/D,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,0BAA0B,GAAI;;;;;CAK1C;;;CAuCA,CAAC;AAiDF,eAAO,MAAM,eAAe,+DAAwC,CAAC;AACrE,eAAO,MAAM,mBAAmB,+DAA4C,CAAC;AAO7E;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI;;;;;;;CAOjC,mDAyIA,CAAC"}
|