@vuu-ui/vuu-utils 0.8.18-debug → 0.8.19-debug
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/cjs/index.js +33 -0
- package/cjs/index.js.map +2 -2
- package/esm/index.js +33 -0
- package/esm/index.js.map +2 -2
- package/package.json +5 -5
- package/types/column-utils.d.ts +1 -0
- package/types/row-utils.d.ts +1 -0
package/cjs/index.js
CHANGED
|
@@ -107,6 +107,7 @@ __export(src_exports, {
|
|
|
107
107
|
getCellRendererOptions: () => getCellRendererOptions,
|
|
108
108
|
getClosest: () => getClosest,
|
|
109
109
|
getClosestIndexItem: () => getClosestIndexItem,
|
|
110
|
+
getColumnByName: () => getColumnByName,
|
|
110
111
|
getColumnHeaderContentRenderer: () => getColumnHeaderContentRenderer,
|
|
111
112
|
getColumnHeaderLabelRenderer: () => getColumnHeaderLabelRenderer,
|
|
112
113
|
getColumnLabel: () => getColumnLabel,
|
|
@@ -123,6 +124,7 @@ __export(src_exports, {
|
|
|
123
124
|
getFocusableElement: () => getFocusableElement,
|
|
124
125
|
getFullRange: () => getFullRange,
|
|
125
126
|
getGroupValueAndOffset: () => getGroupValueAndOffset,
|
|
127
|
+
getIndexFromRowElement: () => getIndexFromRowElement,
|
|
126
128
|
getLoggingConfigForWorker: () => getLoggingConfigForWorker,
|
|
127
129
|
getMissingItems: () => getMissingItems,
|
|
128
130
|
getMovingValueDirection: () => getMovingValueDirection,
|
|
@@ -1004,6 +1006,20 @@ var applyDefaultColumnConfig = ({ columns, table }, getDefaultColumnConfig) => {
|
|
|
1004
1006
|
return columns;
|
|
1005
1007
|
}
|
|
1006
1008
|
};
|
|
1009
|
+
var getColumnByName = (schema, name) => {
|
|
1010
|
+
if (name === void 0) {
|
|
1011
|
+
return void 0;
|
|
1012
|
+
} else {
|
|
1013
|
+
const column = schema.columns.find((col) => col.name === name);
|
|
1014
|
+
if (column) {
|
|
1015
|
+
return column;
|
|
1016
|
+
} else {
|
|
1017
|
+
throw Error(
|
|
1018
|
+
`getColumnByName no column '${name}' in schema for ${schema.table.table}`
|
|
1019
|
+
);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
};
|
|
1007
1023
|
|
|
1008
1024
|
// src/cookie-utils.ts
|
|
1009
1025
|
var getCookieValue = (name) => {
|
|
@@ -2233,6 +2249,23 @@ var virtualRowPositioning = (rowHeight, additionalPixelsNeeded, pctScrollTop) =>
|
|
|
2233
2249
|
return result;
|
|
2234
2250
|
}
|
|
2235
2251
|
];
|
|
2252
|
+
var getIndexFromRowElement = (rowElement) => {
|
|
2253
|
+
const rowIndex = rowElement.ariaRowIndex;
|
|
2254
|
+
if (rowIndex != null) {
|
|
2255
|
+
const index = parseInt(rowIndex) - 1;
|
|
2256
|
+
if (!isNaN(index)) {
|
|
2257
|
+
return index;
|
|
2258
|
+
} else {
|
|
2259
|
+
throw Error(
|
|
2260
|
+
`getIndexFromRowElement row element aria rowindex invalid ${rowIndex}`
|
|
2261
|
+
);
|
|
2262
|
+
}
|
|
2263
|
+
} else {
|
|
2264
|
+
throw Error(
|
|
2265
|
+
"getIndexFromRowElement row element does not have aria rowindex"
|
|
2266
|
+
);
|
|
2267
|
+
}
|
|
2268
|
+
};
|
|
2236
2269
|
|
|
2237
2270
|
// src/selection-utils.ts
|
|
2238
2271
|
var NO_SELECTION = [];
|