@tilde-nlp/ngx-common 4.1.2 → 4.1.3

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.
@@ -1,14 +1,16 @@
1
1
  import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { FormControl, FormGroup } from '@angular/forms';
3
- import { FilterBarFilterItem } from './models';
3
+ import { FilterBarFilter, FilterBarFilterItem } from './models';
4
4
  import { FilterBarChangeEvent } from './models/filter-bar-change-event.model';
5
5
  import { FilterBarSettings } from './models/filter-bar-settings.model';
6
+ import { MatSelect } from '@angular/material/select';
6
7
  import { TranslateService } from '@ngx-translate/core';
7
8
  import * as i0 from "@angular/core";
8
9
  export declare class FilterBarComponent implements OnInit, AfterViewInit, OnDestroy {
9
10
  private cdref;
10
11
  private translate;
11
12
  filterWrapper: ElementRef;
13
+ optionSearchInputs: ElementRef<MatSelect>[];
12
14
  onResize(): void;
13
15
  settings: FilterBarSettings;
14
16
  set filterRowVisible(value: boolean);
@@ -44,6 +46,9 @@ export declare class FilterBarComponent implements OnInit, AfterViewInit, OnDest
44
46
  ngOnInit(): void;
45
47
  ngAfterViewInit(): void;
46
48
  ngOnDestroy(): void;
49
+ focusOptionSearchInput(filter: FilterBarFilter, select: MatSelect, index: number): void;
50
+ filterOptions(event: KeyboardEvent, filter: FilterBarFilter): void;
51
+ setMaxPanelWidth(filter: FilterBarFilter, select: MatSelect): void;
47
52
  emitFilters(): void;
48
53
  switchRight(): void;
49
54
  switchLeft(): void;
@@ -0,0 +1,9 @@
1
+ import { FilterBarFilterItem } from './filter-bar-filter-item.model';
2
+ export interface FilterBarFilterSearch {
3
+ /**
4
+ * If placeholder is defined search will be appeared.
5
+ * When searching for items, the filteredValues are being set automatically.
6
+ */
7
+ placeholder: string;
8
+ filteredValues?: FilterBarFilterItem[];
9
+ }
@@ -0,0 +1,13 @@
1
+ export interface FilterBarFilterSingleSelection {
2
+ /**
3
+ * Indicates whether the filter is selected. This property must be supplied externally.
4
+ * When set to true, it disables all options except the one with the corresponding value.
5
+ * In order to allow unselecting the currently selected value, a specific value must be defined.
6
+ */
7
+ selected: boolean;
8
+ /**
9
+ * The value of the filter option that remains enabled when `selected` is true.
10
+ * This is used to match the option that should not be disabled.
11
+ */
12
+ value: string;
13
+ }
@@ -1,7 +1,20 @@
1
- import { FilterBarFilterItem } from "./filter-bar-filter-item.model";
1
+ import { FilterBarFilterItem } from './filter-bar-filter-item.model';
2
+ import { FilterBarFilterSearch } from './filter-bar-filter-search.model';
3
+ import { FilterBarFilterSingleSelection } from './filter-bar-filter-single-selection.model';
2
4
  export interface FilterBarFilter {
3
5
  fieldName: string;
4
6
  title: string;
5
7
  values: FilterBarFilterItem[];
8
+ search?: FilterBarFilterSearch;
9
+ singleSelection?: FilterBarFilterSingleSelection;
10
+ disableTitleCase?: boolean;
11
+ /**
12
+ * Set this to '' in case you need to fit longest content.
13
+ * Combine this with search, so filtering does not affect panel size.
14
+ */
15
+ maxPanelWidth?: number | string;
16
+ /**
17
+ * If values array keys are already translated, set this to true.
18
+ */
6
19
  translated?: boolean;
7
20
  }
@@ -11,6 +11,7 @@ export declare class TerminologyPanelComponent implements OnInit {
11
11
  sourceLanguageCode: string;
12
12
  targetLanguageCode: string;
13
13
  };
14
+ setSelectedFromLocalStorage: boolean;
14
15
  selectedCollection: CombinedCollection | null;
15
16
  glossarySelectEvent: EventEmitter<CombinedCollection | null>;
16
17
  get isAuthenticated(): boolean | undefined;
@@ -26,5 +27,5 @@ export declare class TerminologyPanelComponent implements OnInit {
26
27
  selectGlossary(collection: CombinedCollection | null): void;
27
28
  private initializeData;
28
29
  static ɵfac: i0.ɵɵFactoryDeclaration<TerminologyPanelComponent, never>;
29
- static ɵcmp: i0.ɵɵComponentDeclaration<TerminologyPanelComponent, "lib-terminology-panel", never, { "system": { "alias": "system"; "required": true; }; "selectedCollection": { "alias": "selectedCollection"; "required": false; }; }, { "glossarySelectEvent": "glossarySelectEvent"; }, never, never, false, never>;
30
+ static ɵcmp: i0.ɵɵComponentDeclaration<TerminologyPanelComponent, "lib-terminology-panel", never, { "system": { "alias": "system"; "required": true; }; "setSelectedFromLocalStorage": { "alias": "setSelectedFromLocalStorage"; "required": true; }; "selectedCollection": { "alias": "selectedCollection"; "required": false; }; }, { "glossarySelectEvent": "glossarySelectEvent"; }, never, never, false, never>;
30
31
  }
@@ -14,6 +14,7 @@ export declare class TerminologyComponent implements OnInit, OnDestroy, OnChange
14
14
  };
15
15
  disabled: boolean;
16
16
  storeSelectedInLocalStorage: boolean;
17
+ setSelectedFromLocalStorage: boolean;
17
18
  showMenuIconOnMobile: boolean;
18
19
  glossarySelectEvent: EventEmitter<CombinedCollection | null>;
19
20
  menuToggleEvent: EventEmitter<boolean>;
@@ -33,5 +34,5 @@ export declare class TerminologyComponent implements OnInit, OnDestroy, OnChange
33
34
  private presetCollection;
34
35
  private watchSystemChanges;
35
36
  static ɵfac: i0.ɵɵFactoryDeclaration<TerminologyComponent, never>;
36
- static ɵcmp: i0.ɵɵComponentDeclaration<TerminologyComponent, "lib-terminology", never, { "selectedCollectionId": { "alias": "selectedCollectionId"; "required": false; }; "system": { "alias": "system"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; "storeSelectedInLocalStorage": { "alias": "storeSelectedInLocalStorage"; "required": false; }; "showMenuIconOnMobile": { "alias": "showMenuIconOnMobile"; "required": false; }; }, { "glossarySelectEvent": "glossarySelectEvent"; "menuToggleEvent": "menuToggleEvent"; }, never, never, false, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<TerminologyComponent, "lib-terminology", never, { "selectedCollectionId": { "alias": "selectedCollectionId"; "required": false; }; "system": { "alias": "system"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; "storeSelectedInLocalStorage": { "alias": "storeSelectedInLocalStorage"; "required": false; }; "setSelectedFromLocalStorage": { "alias": "setSelectedFromLocalStorage"; "required": false; }; "showMenuIconOnMobile": { "alias": "showMenuIconOnMobile"; "required": false; }; }, { "glossarySelectEvent": "glossarySelectEvent"; "menuToggleEvent": "menuToggleEvent"; }, never, never, false, never>;
37
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tilde-nlp/ngx-common",
3
- "version": "4.1.2",
3
+ "version": "4.1.3",
4
4
  "peerDependencies": {
5
5
  "@angular/common": " ^16.0.0",
6
6
  "@angular/core": " ^16.0.0",