@vuu-ui/vuu-utils 4.1.0 → 4.1.2
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
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.1.
|
|
2
|
+
"version": "4.1.2",
|
|
3
3
|
"author": "heswell",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build:dev": "node ../../scripts/run-build.mjs",
|
|
9
8
|
"build": "node ../../scripts/run-build-rslib.ts",
|
|
10
9
|
"test": "vitest run",
|
|
11
10
|
"type-defs": "node ../../scripts/build-type-defs.mjs"
|
|
@@ -15,14 +14,14 @@
|
|
|
15
14
|
},
|
|
16
15
|
"devDependencies": {
|
|
17
16
|
"@dnd-kit/react": "^0.5.0",
|
|
18
|
-
"@vuu-ui/vuu-data-types": "4.1.
|
|
19
|
-
"@vuu-ui/vuu-table-types": "4.1.
|
|
20
|
-
"@vuu-ui/vuu-filter-types": "4.1.
|
|
21
|
-
"@vuu-ui/vuu-protocol-types": "4.1.
|
|
17
|
+
"@vuu-ui/vuu-data-types": "4.1.2",
|
|
18
|
+
"@vuu-ui/vuu-table-types": "4.1.2",
|
|
19
|
+
"@vuu-ui/vuu-filter-types": "4.1.2",
|
|
20
|
+
"@vuu-ui/vuu-protocol-types": "4.1.2"
|
|
22
21
|
},
|
|
23
22
|
"peerDependencies": {
|
|
24
23
|
"@internationalized/date": "^3.0.0",
|
|
25
|
-
"@vuu-ui/vuu-filter-parser": "4.1.
|
|
24
|
+
"@vuu-ui/vuu-filter-parser": "4.1.2",
|
|
26
25
|
"clsx": "^2.0.0",
|
|
27
26
|
"react": "^19.2.3",
|
|
28
27
|
"react-dom": "^19.2.3"
|
package/src/column-utils.js
CHANGED
|
@@ -526,6 +526,11 @@ const getGroupIcon = (columns, dataRow)=>{
|
|
|
526
526
|
return getIcon?.(dataRow);
|
|
527
527
|
}
|
|
528
528
|
};
|
|
529
|
+
const getGroupAdornment = (columns, dataRow)=>{
|
|
530
|
+
const { depth, isLeaf } = dataRow;
|
|
531
|
+
if (isLeaf || 0 === depth || depth > columns.length) return null;
|
|
532
|
+
return columns[depth - 1].getGroupAdornment?.(dataRow) ?? null;
|
|
533
|
+
};
|
|
529
534
|
const getGroupValue = (columns, dataRow)=>{
|
|
530
535
|
const { depth, isLeaf } = dataRow;
|
|
531
536
|
if (isLeaf || depth > columns.length) return null;
|
|
@@ -802,4 +807,4 @@ const columnByAriaIndex = (columns, ariaColIndex)=>{
|
|
|
802
807
|
}
|
|
803
808
|
throw Error(`no column with aria-colIndex ${ariaColIndex}`);
|
|
804
809
|
};
|
|
805
|
-
export { AggregationType, addColumnToSubscribedColumns, applyDefaultColumnConfig, applyGroupByToColumns, applyRuntimeColumnWidthsToConfig, applySortToColumns, applyWidthToColumns, assertAllColumnsAreIncludedInSubscription, buildColumnMap, checkConfirmationPending, columnByAriaIndex, dataAndColumnUnchanged, dataColumnAndKeyUnchanged, dataSourceRowToDataRowDto, existingSort, extractGroupColumn, findColumn, flattenColumnGroup, fromServerDataType, getAllCellsInColumn, getAriaColIndex, getAriaRowIndex, getCalculatedColumnDetails, getColumnLabel, getColumnName, getColumnStyle, getColumnsInViewport, getDefaultAlignment, getDefaultColumnType, getGroupIcon, getGroupValue, getPinStateFromElement, getRuntimeColumnWidth, getServerDataType, getTableHeadings, getTypeFormattingFromColumn, hasCustomRenderer, hasHeadings, hasValidationRules, isCalculatedColumn, isColumnTypeRenderer, isDataLoading, isDataValueEditable, isDateTimeDataType, isDateTimeDataValue, isGroupColumn, isJsonAttribute, isJsonColumn, isJsonGroup, isLookupRenderer, isMappedValueTypeRenderer, isNanoTimestampColumn, isNotHidden, isNumericColumn, isPinned, isResizing, isStringColumn, isTemporalColumn, isTextColumn, isTimeDataType, isTimeDataValue, isTimeDataValueWithMilliseconds, isTimestampColumn, isTypeDescriptor, isValidColumnAlignment, isValidPinLocation, isValueListRenderer, isVuuColumnDataType, mapSortCriteria, measurePinnedColumns, metadataKeys, moveColumnTo, projectUpdates, removeSort, replaceColumn, setAggregations, setCalculatedColumnExpression, setCalculatedColumnName, setCalculatedColumnType, sortPinnedColumns, subscribedOnly, toColumnDescriptor, toColumnName, toDataSourceColumns, updateColumn, updateColumnFormatting, updateColumnRenderProps, updateColumnType, visibleColumnAtIndex };
|
|
810
|
+
export { AggregationType, addColumnToSubscribedColumns, applyDefaultColumnConfig, applyGroupByToColumns, applyRuntimeColumnWidthsToConfig, applySortToColumns, applyWidthToColumns, assertAllColumnsAreIncludedInSubscription, buildColumnMap, checkConfirmationPending, columnByAriaIndex, dataAndColumnUnchanged, dataColumnAndKeyUnchanged, dataSourceRowToDataRowDto, existingSort, extractGroupColumn, findColumn, flattenColumnGroup, fromServerDataType, getAllCellsInColumn, getAriaColIndex, getAriaRowIndex, getCalculatedColumnDetails, getColumnLabel, getColumnName, getColumnStyle, getColumnsInViewport, getDefaultAlignment, getDefaultColumnType, getGroupAdornment, getGroupIcon, getGroupValue, getPinStateFromElement, getRuntimeColumnWidth, getServerDataType, getTableHeadings, getTypeFormattingFromColumn, hasCustomRenderer, hasHeadings, hasValidationRules, isCalculatedColumn, isColumnTypeRenderer, isDataLoading, isDataValueEditable, isDateTimeDataType, isDateTimeDataValue, isGroupColumn, isJsonAttribute, isJsonColumn, isJsonGroup, isLookupRenderer, isMappedValueTypeRenderer, isNanoTimestampColumn, isNotHidden, isNumericColumn, isPinned, isResizing, isStringColumn, isTemporalColumn, isTextColumn, isTimeDataType, isTimeDataValue, isTimeDataValueWithMilliseconds, isTimestampColumn, isTypeDescriptor, isValidColumnAlignment, isValidPinLocation, isValueListRenderer, isVuuColumnDataType, mapSortCriteria, measurePinnedColumns, metadataKeys, moveColumnTo, projectUpdates, removeSort, replaceColumn, setAggregations, setCalculatedColumnExpression, setCalculatedColumnName, setCalculatedColumnType, sortPinnedColumns, subscribedOnly, toColumnDescriptor, toColumnName, toDataSourceColumns, updateColumn, updateColumnFormatting, updateColumnRenderProps, updateColumnType, visibleColumnAtIndex };
|
package/src/tree-utils.js
CHANGED
|
@@ -35,9 +35,9 @@ const addChildValues = (rows, treeSourceNodes, cols, iconProvider, index = {
|
|
|
35
35
|
type: "string"
|
|
36
36
|
});
|
|
37
37
|
for(let i = 0; i < treeSourceNodes.length; i++, index.value += 1){
|
|
38
|
-
const { childNodes, icon, label, nodeData } = treeSourceNodes[i];
|
|
38
|
+
const { childNodes, icon, keySegment = treeSourceNodes[i].label, label, nodeData } = treeSourceNodes[i];
|
|
39
39
|
const blanks = Array(depth - 1).fill("");
|
|
40
|
-
const fullKey = `${keyBase}|${
|
|
40
|
+
const fullKey = `${keyBase}|${keySegment}`;
|
|
41
41
|
const row = [
|
|
42
42
|
index.value,
|
|
43
43
|
index.value,
|
package/types/column-utils.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { DataSourceRow, DataValueDescriptor, DataValueType, DataValueTypeSi
|
|
|
2
2
|
import type { VuuAggType, VuuAggregation, VuuColumnDataType, VuuDataRowDto, VuuGroupBy, VuuSort } from "@vuu-ui/vuu-protocol-types";
|
|
3
3
|
import { TableModel } from "@vuu-ui/vuu-table";
|
|
4
4
|
import type { ColumnAlignment, ColumnDescriptor, ColumnLayout, ColumnTypeFormatting, ColumnTypeRendering, ColumnTypeWithValidationRules, DataRow, DataValueTypeDescriptor, DefaultColumnConfiguration, GroupColumnDescriptor, LookupRenderer, MappedValueTypeRenderer, PinLocation, RuntimeColumnDescriptor, TableCellRendererProps, TableConfig, TableHeadings, ValueListRenderer } from "@vuu-ui/vuu-table-types";
|
|
5
|
-
import {
|
|
5
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
6
6
|
/**
|
|
7
7
|
* ColumnMap provides a lookup of the index position of a data item within a row
|
|
8
8
|
* by column name.
|
|
@@ -170,6 +170,7 @@ export declare const getColumnsInViewport: (columns: RuntimeColumnDescriptor[],
|
|
|
170
170
|
export declare const isNotHidden: (column: RuntimeColumnDescriptor) => boolean;
|
|
171
171
|
export declare const visibleColumnAtIndex: (columns: RuntimeColumnDescriptor[], index: number) => RuntimeColumnDescriptor | undefined;
|
|
172
172
|
export declare const getGroupIcon: (columns: RuntimeColumnDescriptor[], dataRow: DataRow) => string | undefined;
|
|
173
|
+
export declare const getGroupAdornment: (columns: RuntimeColumnDescriptor[], dataRow: DataRow) => ReactNode;
|
|
173
174
|
export declare const getGroupValue: (columns: RuntimeColumnDescriptor[], dataRow: DataRow) => string | null;
|
|
174
175
|
export declare const getDefaultColumnType: (serverDataType?: VuuColumnDataType) => DataValueTypeSimple;
|
|
175
176
|
export declare const updateColumnFormatting: <T extends ColumnDescriptor = ColumnDescriptor>(column: T, formatting: ColumnTypeFormatting) => T;
|
|
@@ -29,6 +29,7 @@ export declare const stripFilterFromColumns: (columns: RuntimeColumnDescriptor[]
|
|
|
29
29
|
exportable?: boolean;
|
|
30
30
|
exportFormatter?: (value: unknown, row: import("@vuu-ui/vuu-table-types").RowAccessor) => string;
|
|
31
31
|
getIcon?: (row: import("@vuu-ui/vuu-table-types").DataRow) => string | undefined;
|
|
32
|
+
getGroupAdornment?: (row: import("@vuu-ui/vuu-table-types").DataRow) => import("react").ReactNode;
|
|
32
33
|
groupable?: boolean;
|
|
33
34
|
hidden?: boolean;
|
|
34
35
|
locked?: Exclude<import("@vuu-ui/vuu-table-types").PinLocation, "left"> | false;
|
package/types/tree-types.d.ts
CHANGED
|
@@ -4,6 +4,11 @@ export interface TreeSourceNode<T = unknown> {
|
|
|
4
4
|
icon?: string;
|
|
5
5
|
header?: boolean;
|
|
6
6
|
label: string;
|
|
7
|
+
/**
|
|
8
|
+
* Segment used to build the row key for this node, defaults to label.
|
|
9
|
+
* Allows a display label to differ from a stable key.
|
|
10
|
+
*/
|
|
11
|
+
keySegment?: string;
|
|
7
12
|
childNodes?: TreeSourceNode<T>[];
|
|
8
13
|
/** node is rendered expanded initially */
|
|
9
14
|
expanded?: boolean;
|