@sinequa/atomic-angular 1.0.7 → 1.0.8
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/fesm2022/sinequa-atomic-angular.mjs +13 -2
- package/fesm2022/sinequa-atomic-angular.mjs.map +1 -1
- package/index.d.ts +157 -157
- package/package.json +1 -1
|
@@ -488,9 +488,13 @@ function withAppFeatures() {
|
|
|
488
488
|
* @returns The alias of the column if it exists, otherwise the original column name.
|
|
489
489
|
*/
|
|
490
490
|
getColumnAlias(column) {
|
|
491
|
+
if (typeof column !== "string" || column.length === 0) {
|
|
492
|
+
return column;
|
|
493
|
+
}
|
|
491
494
|
const state = getState(store);
|
|
492
495
|
const schema = state.indexes._.columns;
|
|
493
|
-
const
|
|
496
|
+
const key = column.toLocaleLowerCase();
|
|
497
|
+
const col = Object.hasOwn(schema, key) ? schema[key] : undefined;
|
|
494
498
|
if (col) {
|
|
495
499
|
return col.aliases?.[0] ? `${col.aliases[0].charAt(0).toLowerCase()}${col.aliases[0].slice(1)}` : column;
|
|
496
500
|
}
|
|
@@ -503,8 +507,15 @@ function withAppFeatures() {
|
|
|
503
507
|
* @returns The column definition as a `CCColumn` object if found, or `undefined` if the column does not exist.
|
|
504
508
|
*/
|
|
505
509
|
getColumn(columnOrAlias) {
|
|
510
|
+
if (typeof columnOrAlias !== "string" || columnOrAlias.length === 0) {
|
|
511
|
+
return undefined;
|
|
512
|
+
}
|
|
506
513
|
const state = getState(store);
|
|
507
|
-
|
|
514
|
+
const columnMap = state.columnMap;
|
|
515
|
+
if (!columnMap)
|
|
516
|
+
return undefined;
|
|
517
|
+
const key = columnOrAlias.toLocaleLowerCase();
|
|
518
|
+
return Object.hasOwn(columnMap, key) ? columnMap[key] : undefined;
|
|
508
519
|
},
|
|
509
520
|
/**
|
|
510
521
|
* Determines if the specified column is of a date-related type.
|