Skip to content

Commit 3d002ff

Browse files
committed
fix(keyboard-shortcut): initialize shortcut keys input
1 parent 5968b62 commit 3d002ff

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

projects/angular/components/ui-grid/src/filters/ui-grid-dropdown-filter.directive.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { isArray } from 'lodash-es';
1+
import {
2+
isArray, isEqual,
3+
} from 'lodash-es';
24
import { BehaviorSubject } from 'rxjs';
35

46
import {
@@ -135,13 +137,13 @@ export class UiGridDropdownFilterDirective<T> extends UiGridFilterDirective<T> i
135137
}
136138

137139
updateSuggestValue(value?: FilterDropdownPossibleOption) {
138-
if (value === undefined) {
140+
if (value == null) {
139141
this.suggestValue = [];
140142
return;
141143
}
142144

143145
this.suggestValue = this.suggestItems.filter(item => isArray(value) && value.some(s => s.value === item?.data)
144-
|| (!isArray(value) && value!.value === item?.data));
146+
|| (!isArray(value) && value.value === item?.data));
145147
}
146148

147149
/**
@@ -153,7 +155,7 @@ export class UiGridDropdownFilterDirective<T> extends UiGridFilterDirective<T> i
153155
}
154156

155157
findDropDownOptionBySuggestValue(suggestValue: ISuggestDropdownValueData) {
156-
return this.items.find(item => item.value === suggestValue.data);
158+
return this.items.find(item => isEqual(item.value, suggestValue.data));
157159
}
158160

159161
get hasValue() {

projects/angular/components/ui-grid/src/managers/data-manager.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ export class DataManager<T extends IGridDataEntry, K extends StringOrNumberKeyOf
175175
private _hash = (entry: T) =>
176176
this._hashMap.set(`${entry[this.idProperty]}`, objectHash(entry, {
177177
algorithm: 'md5',
178-
encoding: 'hex',
179178
ignoreUnknown: true,
180179
}));
181180

projects/angular/components/ui-grid/src/managers/filter-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class FilterManager<T> {
109109

110110
if (isArray(currentValue)) {
111111
const valueAlreadySelected = currentValue.some(v => v.value === selectedDropdownOption.value);
112-
const filterSelection: FilterDropdownPossibleOption = (valueAlreadySelected
112+
const filterSelection = (valueAlreadySelected
113113
? currentValue.filter(v => v.value !== selectedDropdownOption?.value)
114114
: [...currentValue, selectedDropdownOption]);
115115

projects/angular/components/ui-grid/src/ui-grid.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,7 @@ export class UiGridComponent<T extends IGridDataEntry>
12451245
(!column.searchableDropdown.multiple || (column.searchableDropdown.value as []).length > 0);
12461246

12471247
const dropdownHasValue = column.dropdown?.value != null && column.dropdown.hasValue &&
1248-
(isArray(column.dropdown.value) || column.dropdown!.value!.value !== column.dropdown!.emptyStateValue);
1248+
(isArray(column.dropdown.value) || column.dropdown!.value.value !== column.dropdown.emptyStateValue);
12491249

12501250
return dropdownHasValue || searchableHasValue;
12511251
}

projects/angular/directives/keyboard-shortcut/src/keyboard-shortcut.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
})
1919
export class KeyboardShortcutDirective {
2020
@Input()
21-
shortcutKeys!: string[][];
21+
shortcutKeys: string[][] = [];
2222

2323
@Output()
2424
shortcutPressed = new EventEmitter<void>();

0 commit comments

Comments
 (0)