@trudb/tru-common-lib 0.2.245 → 0.2.247
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.
|
@@ -1603,9 +1603,9 @@ class TruEntityAccessor {
|
|
|
1603
1603
|
};
|
|
1604
1604
|
formatQueryChoices = (query, entities, pKeyName, hid = null) => {
|
|
1605
1605
|
if (query && query.orderByClause)
|
|
1606
|
-
return _.map(entities, (entity) => { return { value: { $: entity[pKeyName] }, label: hid !== null ? hid : entity.HID }; });
|
|
1606
|
+
return _.map(entities, (entity) => { return { value: { $: entity[pKeyName] }, label: hid !== null ? hid(entity) : entity.HID }; });
|
|
1607
1607
|
else
|
|
1608
|
-
return _.sortBy(_.map(entities, (entity) => { return { value: { $: entity[pKeyName] }, label: entity.HID }; }), 'label');
|
|
1608
|
+
return _.sortBy(_.map(entities, (entity) => { return { value: { $: entity[pKeyName] }, label: hid !== null ? hid(entity) : entity.HID }; }), 'label');
|
|
1609
1609
|
};
|
|
1610
1610
|
formatNameValues = (query, entities, pKeyName) => {
|
|
1611
1611
|
if (query && query.orderByClause)
|
|
@@ -1656,7 +1656,7 @@ class TruEntityAccessor {
|
|
|
1656
1656
|
query = query.where(entity.name + 'Ref', '==', ref);
|
|
1657
1657
|
return this._entityManager.executeQueryLocally(query);
|
|
1658
1658
|
};
|
|
1659
|
-
searchQueryChoices = (entity, setupQuery = null, goToServer = false, ref = undefined, allRecords = false, dependantEntty = undefined) => {
|
|
1659
|
+
searchQueryChoices = (entity, setupQuery = null, goToServer = false, ref = undefined, allRecords = false, dependantEntty = undefined, hid = null) => {
|
|
1660
1660
|
const pkeyName = entity.name + 'Ref';
|
|
1661
1661
|
let query = this._breezeContext.createQuery(this.getQueryServiceName(entity));
|
|
1662
1662
|
if (setupQuery)
|
|
@@ -1670,11 +1670,11 @@ class TruEntityAccessor {
|
|
|
1670
1670
|
query = query.top(this.appEnvironment.maxRecordCount);
|
|
1671
1671
|
if (goToServer) {
|
|
1672
1672
|
return defer(() => from(this._entityManager.executeQuery(query).then((queryData) => {
|
|
1673
|
-
return this.formatQueryChoices(query, queryData.results, pkeyName,
|
|
1673
|
+
return this.formatQueryChoices(query, queryData.results, pkeyName, hid);
|
|
1674
1674
|
})));
|
|
1675
1675
|
}
|
|
1676
1676
|
else {
|
|
1677
|
-
return of(this.formatQueryChoices(query, this._entityManager.executeQueryLocally(query), pkeyName,
|
|
1677
|
+
return of(this.formatQueryChoices(query, this._entityManager.executeQueryLocally(query), pkeyName, hid));
|
|
1678
1678
|
}
|
|
1679
1679
|
};
|
|
1680
1680
|
searchNameValuesCacheOnly = (entity, setupQuery = null, ref = undefined) => {
|
|
@@ -7818,7 +7818,8 @@ class TruDataGrid {
|
|
|
7818
7818
|
}
|
|
7819
7819
|
}));
|
|
7820
7820
|
this.subs.push(fromEvent(document, 'keydown').subscribe((event) => {
|
|
7821
|
-
|
|
7821
|
+
let editingCells = this.api.getEditingCells();
|
|
7822
|
+
if (event.code === 'Space' && !editingCells.length) {
|
|
7822
7823
|
event.preventDefault();
|
|
7823
7824
|
return;
|
|
7824
7825
|
}
|