@tilde-nlp/ngx-common 2.0.10 → 2.0.12

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,10 +1,10 @@
1
- import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnInit } from '@angular/core';
2
- import { MatSelectChange } from '@angular/material/select';
3
- import { FilterBarFilter } from './models';
1
+ import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { FormControl, FormGroup } from '@angular/forms';
3
+ import { 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
6
  import * as i0 from "@angular/core";
7
- export declare class FilterBarComponent implements OnInit, AfterViewInit {
7
+ export declare class FilterBarComponent implements OnInit, AfterViewInit, OnDestroy {
8
8
  private cdref;
9
9
  private _inputText;
10
10
  get inputText(): string;
@@ -18,19 +18,35 @@ export declare class FilterBarComponent implements OnInit, AfterViewInit {
18
18
  filterOverflow: boolean;
19
19
  filterBarChange: EventEmitter<FilterBarChangeEvent>;
20
20
  get showSearch(): boolean;
21
- get fields(): FilterBarFilter[];
21
+ get fields(): import("./models").FilterBarFilter[];
22
22
  settings: FilterBarSettings;
23
+ /** To hide filters, but leave chips visible */
24
+ private _filterRowVisible;
25
+ set filterRowVisible(value: boolean);
26
+ get filterRowVisible(): boolean;
23
27
  filterWrapper: ElementRef;
24
28
  onResize(): void;
29
+ private formChangesSubscription;
30
+ readonly inputFormControlName = "input";
31
+ readonly filterFormGroup: FormGroup<{}>;
32
+ readonly form: FormGroup<{
33
+ input: FormControl<string | null>;
34
+ filters: FormGroup<{}>;
35
+ }>;
36
+ get filterFormGroupValue(): {
37
+ [key: string]: FilterBarFilterItem[];
38
+ };
25
39
  private readonly defaultScrollWidth;
26
40
  constructor(cdref: ChangeDetectorRef);
27
41
  ngOnInit(): void;
28
42
  ngAfterViewInit(): void;
29
- filterChange(filter: FilterBarFilter, event: MatSelectChange): void;
43
+ ngOnDestroy(): void;
30
44
  emitFilters(): void;
31
45
  scrollRight(): void;
32
46
  scrollLeft(): void;
47
+ removeFilter(key: string, ix: number): void;
33
48
  private checkOverflow;
49
+ private subscribeToFormValueChanges;
34
50
  static ɵfac: i0.ɵɵFactoryDeclaration<FilterBarComponent, never>;
35
- static ɵcmp: i0.ɵɵComponentDeclaration<FilterBarComponent, "tld-filter-bar", never, { "settings": "settings"; }, { "filterBarChange": "filterBarChange"; }, never, never, false>;
51
+ static ɵcmp: i0.ɵɵComponentDeclaration<FilterBarComponent, "tld-filter-bar", never, { "settings": "settings"; "filterRowVisible": "filterRowVisible"; }, { "filterBarChange": "filterBarChange"; }, never, never, false>;
36
52
  }
@@ -9,8 +9,10 @@ import * as i7 from "@angular/material/select";
9
9
  import * as i8 from "@angular/forms";
10
10
  import * as i9 from "@angular/material/tooltip";
11
11
  import * as i10 from "@angular/material/button";
12
+ import * as i11 from "@angular/material/chips";
13
+ import * as i12 from "@angular/material/icon";
12
14
  export declare class FilterBarModule {
13
15
  static ɵfac: i0.ɵɵFactoryDeclaration<FilterBarModule, never>;
14
- static ɵmod: i0.ɵɵNgModuleDeclaration<FilterBarModule, [typeof i1.FilterBarComponent], [typeof i2.CommonModule, typeof i3.TranslateModule, typeof i4.MatInputModule, typeof i5.MatFormFieldModule, typeof i6.FlexLayoutModule, typeof i7.MatSelectModule, typeof i8.FormsModule, typeof i9.MatTooltipModule, typeof i10.MatButtonModule], [typeof i1.FilterBarComponent]>;
16
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FilterBarModule, [typeof i1.FilterBarComponent], [typeof i2.CommonModule, typeof i3.TranslateModule, typeof i4.MatInputModule, typeof i5.MatFormFieldModule, typeof i6.FlexLayoutModule, typeof i7.MatSelectModule, typeof i8.FormsModule, typeof i9.MatTooltipModule, typeof i10.MatButtonModule, typeof i11.MatChipsModule, typeof i12.MatIconModule, typeof i8.ReactiveFormsModule], [typeof i1.FilterBarComponent]>;
15
17
  static ɵinj: i0.ɵɵInjectorDeclaration<FilterBarModule>;
16
18
  }
@@ -1,10 +1,6 @@
1
1
  import { ExportFormat } from "./export-format.enum";
2
2
  export interface ExportConfig {
3
3
  enabled: boolean;
4
- /**
5
- * If column should not be exported even if it is visible.
6
- */
7
- ignoreAttributeName?: string;
8
4
  fileOptions?: {
9
5
  format?: ExportFormat;
10
6
  saveToFile: boolean;
@@ -28,11 +28,13 @@ export declare class MultiFunctionalTableComponent<T> implements OnInit, AfterCo
28
28
  table: MatTable<T>;
29
29
  sort: MatSort;
30
30
  tableElementRef: ElementRef<HTMLElement>;
31
+ get ignoreAttributeName(): string;
31
32
  displayColumns: string[];
32
33
  columnSelectActive: boolean;
33
34
  get filterActive(): boolean | undefined;
34
35
  exportActive: boolean;
35
36
  noDataRowActive: boolean;
37
+ filterEnabled: boolean;
36
38
  filterBarVisible: boolean;
37
39
  filterSettings: FilterBarSettings;
38
40
  noDataRowConfig: NoDataRowConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tilde-nlp/ngx-common",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^14.0.0",
6
6
  "@angular/core": "^14.0.0",
@@ -12,7 +12,7 @@
12
12
  /// ----------------------------------------
13
13
 
14
14
 
15
-
15
+ [mat-menu-item].align-v-middle *,
16
16
  button.align-v-middle * {
17
17
  vertical-align: middle;
18
18
  }
@@ -1,6 +1,15 @@
1
+ @use "../variables/font-size.variables.scss" as fs;
2
+
1
3
  .mat-dialog-container {
2
4
  min-width: 22rem;
3
5
  width: 40rem !important;
6
+
7
+ h1[mat-dialog-title].mat-dialog-title,
8
+ [mat-dialog-title].mat-dialog-title h1 {
9
+ font-size: fs.$font-size-2-xl !important;
10
+ font-weight: 600 !important;
11
+ margin-bottom: 0 !important;
12
+ }
4
13
  }
5
14
 
6
15
  [mat-dialog-actions] {
@@ -4,9 +4,17 @@
4
4
  @each $key,
5
5
  $value in $color-map {
6
6
 
7
- .mat-button.mat-#{$key},
7
+ .mat-button.mat-#{$key} {
8
+ color: var(--#{$key}) !important;
9
+
10
+ &:hover {
11
+ color: var(--#{$key}) !important;
12
+ }
13
+ }
14
+
8
15
  .mat-stroked-button.mat-#{$key} {
9
16
  color: var(--#{$key}) !important;
17
+ border-color: var(--#{$key}) !important;
10
18
 
11
19
  &:hover {
12
20
  color: var(--#{$key}) !important;