ngx-techlify-core 18.26.0 → 18.28.0

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.
@@ -5,14 +5,12 @@ import { DomSanitizer } from '@angular/platform-browser';
5
5
  import { TechlifyListingControllerInterface } from '../../base-model';
6
6
  import { FormBuilder } from '@angular/forms';
7
7
  import { AuditLogService } from '../audit-log.service';
8
- import { RequestHelperService } from '../../request-helper/request-helper.service';
9
8
  import * as i0 from "@angular/core";
10
9
  export declare class AuditLogListComponent extends TechlifyListingControllerInterface implements OnInit, OnDestroy {
11
10
  private router;
12
11
  sanitizer: DomSanitizer;
13
12
  private formBuilder;
14
13
  private auditLogService;
15
- private requestHelperService;
16
14
  private activatedRoute;
17
15
  objectId: any;
18
16
  objectType: any;
@@ -24,7 +22,7 @@ export declare class AuditLogListComponent extends TechlifyListingControllerInte
24
22
  filters: any;
25
23
  displayedColumns: any[];
26
24
  sort: MatSort;
27
- constructor(router: Router, sanitizer: DomSanitizer, formBuilder: FormBuilder, auditLogService: AuditLogService, requestHelperService: RequestHelperService, activatedRoute: ActivatedRoute);
25
+ constructor(router: Router, sanitizer: DomSanitizer, formBuilder: FormBuilder, auditLogService: AuditLogService, activatedRoute: ActivatedRoute);
28
26
  ngOnInit(): void;
29
27
  get excelData(): any[];
30
28
  changeSort(event: any): void;
@@ -1,3 +1,4 @@
1
+ import { RequestHelperService } from '../request-helper/request-helper.service';
1
2
  /**
2
3
  * Interface used to ensure we have a consistent structure across our listing pages
3
4
  *
@@ -18,6 +19,31 @@ export declare abstract class TechlifyListingControllerInterface {
18
19
  lastPage: number;
19
20
  isWorking: boolean;
20
21
  filterForm: any;
22
+ /**
23
+ * Boolean to turn off, if we don't want to patch filters from route.
24
+ * This can be overriden in child classes if need
25
+ */
26
+ protected _isFilterPatchFromRoute: boolean;
27
+ get isFilterPatchFromRoute(): boolean;
28
+ set isFilterPatchFromRoute(value: boolean);
29
+ /**
30
+ * Filter form configuration used to decode the route params.
31
+ * Eg: Override in child class
32
+ * ```
33
+ * filterFormConfiguration: any = {
34
+ status_id: { multiple: true },
35
+ branch_ids: { multiple: true },
36
+ department_ids: { multiple: true },
37
+ employee_ids: { multiple: true },
38
+ course_ids: { multiple: true },
39
+ date_from: { date: true },
40
+ date_to: { date: true },
41
+ due_date_from: { date: true },
42
+ due_date_to: { date: true },
43
+ }
44
+ *```
45
+ */
46
+ filterFormConfiguration: any;
21
47
  /**
22
48
  * Child classes can override this.
23
49
  * If left undefined/empty, falls back to environment.appTitle
@@ -25,11 +51,19 @@ export declare abstract class TechlifyListingControllerInterface {
25
51
  protected get pageTitle(): string | undefined;
26
52
  private titleService;
27
53
  private environmentService;
54
+ protected requestHelperService: RequestHelperService;
28
55
  constructor();
29
56
  /**
30
- * Function that listens for any changes in the form group to apply the filters
57
+ * Function that listens for any changes in the filter form group
58
+ * It updates the route automatically
59
+ * Also reload the page on change
31
60
  */
32
- listenForChanges(): void;
61
+ listenFilterChanges(): void;
62
+ /**
63
+ * Function decodes the route params and patches the filter
64
+ * Setup the filterFormConfigurtion to override for multiple and date attributes.
65
+ */
66
+ patchFiltersFromRoute(): void;
33
67
  /**
34
68
  * Function that loads the main models of the application
35
69
  */
@@ -75,4 +109,9 @@ export declare abstract class TechlifyListingControllerInterface {
75
109
  * Trigerred if any entry section is modified
76
110
  */
77
111
  isSelectionModified(event: any, model: any): void;
112
+ /**
113
+ * Defualt method to listen to sort column updates
114
+ * @param event
115
+ */
116
+ sortColumn(event: any): void;
78
117
  }
@@ -10,8 +10,9 @@ import * as i8 from "../action-popup/action-popup.module";
10
10
  import * as i9 from "../material.module";
11
11
  import * as i10 from "../read-more/read-more.module";
12
12
  import * as i11 from "@angular/material/progress-bar";
13
+ import * as i12 from "../techlify-icon/techlify-icon.module";
13
14
  export declare class NoteModule {
14
15
  static ɵfac: i0.ɵɵFactoryDeclaration<NoteModule, never>;
15
- static ɵmod: i0.ɵɵNgModuleDeclaration<NoteModule, [typeof i1.NoteListComponent, typeof i2.NoteFormComponent, typeof i3.CommentFormComponent], [typeof i4.CommonModule, typeof i5.ReactiveFormsModule, typeof i6.InfiniteScrollModule, typeof i7.FlexLayoutModule, typeof i8.ActionPopupModule, typeof i9.MaterialModule, typeof i10.ReadMoreModule, typeof i11.MatProgressBarModule, typeof i5.FormsModule], [typeof i1.NoteListComponent]>;
16
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NoteModule, [typeof i1.NoteListComponent, typeof i2.NoteFormComponent, typeof i3.CommentFormComponent], [typeof i4.CommonModule, typeof i5.ReactiveFormsModule, typeof i6.InfiniteScrollModule, typeof i7.FlexLayoutModule, typeof i8.ActionPopupModule, typeof i9.MaterialModule, typeof i10.ReadMoreModule, typeof i11.MatProgressBarModule, typeof i5.FormsModule, typeof i12.TechlifyIconModule], [typeof i1.NoteListComponent]>;
16
17
  static ɵinj: i0.ɵɵInjectorDeclaration<NoteModule>;
17
18
  }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./techlify-feature-enabled.directive";
3
+ import * as i2 from "@angular/common";
4
+ export declare class TechlifyFeatureDirectiveModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<TechlifyFeatureDirectiveModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TechlifyFeatureDirectiveModule, [typeof i1.TechlifyFeatureEnabledDirective], [typeof i2.CommonModule], [typeof i1.TechlifyFeatureEnabledDirective]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<TechlifyFeatureDirectiveModule>;
8
+ }
@@ -1,16 +1,16 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./techlify-feature-listing.component";
3
3
  import * as i2 from "./on-off-switch/on-off-switch.component";
4
- import * as i3 from "./techlify-feature-enabled.directive";
5
- import * as i4 from "@angular/common";
6
- import * as i5 from "../material.module";
7
- import * as i6 from "@angular/flex-layout";
8
- import * as i7 from "@angular/router";
9
- import * as i8 from "@angular/material/slide-toggle";
10
- import * as i9 from "@angular/forms";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "../material.module";
6
+ import * as i5 from "@angular/flex-layout";
7
+ import * as i6 from "@angular/router";
8
+ import * as i7 from "@angular/material/slide-toggle";
9
+ import * as i8 from "@angular/forms";
10
+ import * as i9 from "./techlify-feature-directive.module";
11
11
  import * as i10 from "ngx-infinite-scroll";
12
12
  export declare class TechlifyFeatureModule {
13
13
  static ɵfac: i0.ɵɵFactoryDeclaration<TechlifyFeatureModule, never>;
14
- static ɵmod: i0.ɵɵNgModuleDeclaration<TechlifyFeatureModule, [typeof i1.TechlifyFeatureListingComponent, typeof i2.OnOffSwitchComponent, typeof i3.TechlifyFeatureEnabledDirective], [typeof i4.CommonModule, typeof i5.MaterialModule, typeof i6.FlexLayoutModule, typeof i7.RouterModule, typeof i8.MatSlideToggleModule, typeof i9.FormsModule, typeof i9.ReactiveFormsModule, typeof i10.InfiniteScrollModule], [typeof i1.TechlifyFeatureListingComponent, typeof i3.TechlifyFeatureEnabledDirective]>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TechlifyFeatureModule, [typeof i1.TechlifyFeatureListingComponent, typeof i2.OnOffSwitchComponent], [typeof i3.CommonModule, typeof i4.MaterialModule, typeof i5.FlexLayoutModule, typeof i6.RouterModule, typeof i7.MatSlideToggleModule, typeof i8.FormsModule, typeof i9.TechlifyFeatureDirectiveModule, typeof i8.ReactiveFormsModule, typeof i10.InfiniteScrollModule], [typeof i1.TechlifyFeatureListingComponent, typeof i9.TechlifyFeatureDirectiveModule]>;
15
15
  static ɵinj: i0.ɵɵInjectorDeclaration<TechlifyFeatureModule>;
16
16
  }
@@ -3,11 +3,12 @@ import { ControlValueAccessor, UntypedFormBuilder, UntypedFormGroup, NgControl }
3
3
  import { Subject } from 'rxjs';
4
4
  import { MatDatepicker } from '@angular/material/datepicker';
5
5
  import { DatePipe } from '@angular/common';
6
- import { MatSelectChange } from '@angular/material/select';
7
6
  import * as i0 from "@angular/core";
8
7
  export declare class TimelineFilterComponent implements OnInit, ControlValueAccessor {
9
8
  ngControl: NgControl;
10
9
  private datePipe;
10
+ isInitialised: boolean;
11
+ isCustomDatePatching: boolean;
11
12
  set defaultValue(value: any);
12
13
  get empty(): boolean;
13
14
  get shouldLabelFloat(): boolean;
@@ -47,10 +48,10 @@ export declare class TimelineFilterComponent implements OnInit, ControlValueAcce
47
48
  resetFieldValue(field: string): void;
48
49
  getFieldValue(field: string): any;
49
50
  setFieldValue(field: string, value: any, emitEvent?: boolean): void;
50
- selectionChanged(selected: MatSelectChange): void;
51
51
  changeTimeline(value: any): void;
52
52
  openCalendar(): void;
53
- applyRange(): void;
53
+ applyRange(defaultFrom?: any, defaultTo?: any): void;
54
+ setCustomDates(from: any, to: any): void;
54
55
  setDescribedByIds(ids: string[]): void;
55
56
  onContainerClick(event: MouseEvent): void;
56
57
  writeValue(data: any): void;
@@ -11,8 +11,9 @@ import * as i9 from "@angular/material/icon";
11
11
  import * as i10 from "@angular/material/input";
12
12
  import * as i11 from "@angular/material/datepicker";
13
13
  import * as i12 from "@angular/material/core";
14
+ import * as i13 from "../techlify-icon/techlify-icon.module";
14
15
  export declare class TimelineFilterModule {
15
16
  static ɵfac: i0.ɵɵFactoryDeclaration<TimelineFilterModule, never>;
16
- static ɵmod: i0.ɵɵNgModuleDeclaration<TimelineFilterModule, [typeof i1.TimelineFilterComponent], [typeof i2.CommonModule, typeof i3.TimelineFilterRoutingModule, typeof i4.FlexLayoutModule, typeof i5.ReactiveFormsModule, typeof i6.MatFormFieldModule, typeof i7.MatSelectModule, typeof i8.MatButtonModule, typeof i9.MatIconModule, typeof i10.MatInputModule, typeof i11.MatDatepickerModule, typeof i12.MatNativeDateModule], [typeof i1.TimelineFilterComponent]>;
17
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TimelineFilterModule, [typeof i1.TimelineFilterComponent], [typeof i2.CommonModule, typeof i3.TimelineFilterRoutingModule, typeof i4.FlexLayoutModule, typeof i5.ReactiveFormsModule, typeof i6.MatFormFieldModule, typeof i7.MatSelectModule, typeof i8.MatButtonModule, typeof i9.MatIconModule, typeof i10.MatInputModule, typeof i11.MatDatepickerModule, typeof i12.MatNativeDateModule, typeof i13.TechlifyIconModule], [typeof i1.TimelineFilterComponent]>;
17
18
  static ɵinj: i0.ɵɵInjectorDeclaration<TimelineFilterModule>;
18
19
  }
@@ -8,7 +8,6 @@ import { UntypedFormBuilder } from '@angular/forms';
8
8
  import { Sort } from '@angular/material/sort';
9
9
  import { PageEvent } from '../data-table';
10
10
  import { AlertService, HttpService } from '../core';
11
- import { RequestHelperService } from '../request-helper/request-helper.service';
12
11
  import { TechlifyListingControllerInterface } from '../base-model';
13
12
  import { ActivatedRoute } from '@angular/router';
14
13
  import * as i0 from "@angular/core";
@@ -20,7 +19,6 @@ export declare class UsersViewAllComponent extends TechlifyListingControllerInte
20
19
  private dialog;
21
20
  private userService;
22
21
  private fb;
23
- private requestHelperService;
24
22
  private activatedRoute;
25
23
  clientId: number;
26
24
  userTypeIds: number[];
@@ -34,7 +32,7 @@ export declare class UsersViewAllComponent extends TechlifyListingControllerInte
34
32
  scrollContainer: string;
35
33
  models: any[];
36
34
  isAppAdminUser: boolean;
37
- constructor(http: HttpService, alertService: AlertService, currentUserService: CurrentUserService, userConfigService: UserConfigService, dialog: MatDialog, userService: UserService, fb: UntypedFormBuilder, requestHelperService: RequestHelperService, activatedRoute: ActivatedRoute);
35
+ constructor(http: HttpService, alertService: AlertService, currentUserService: CurrentUserService, userConfigService: UserConfigService, dialog: MatDialog, userService: UserService, fb: UntypedFormBuilder, activatedRoute: ActivatedRoute);
38
36
  ngOnInit(): void;
39
37
  getUserViewRoute(user: any): any;
40
38
  private createForm;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-techlify-core",
3
- "version": "18.26.0",
3
+ "version": "18.28.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18",
6
6
  "@angular/core": ">=18",
package/public-api.d.ts CHANGED
@@ -94,6 +94,7 @@ export * from './lib/techlify-feature/techlify-feature.module';
94
94
  export * from './lib/techlify-feature/techlify-feature.routing';
95
95
  export * from './lib/techlify-feature/techlify-feature-listing.component';
96
96
  export * from './lib/techlify-feature/techlify-feature-enabled.directive';
97
+ export * from './lib/techlify-feature/techlify-feature-directive.module';
97
98
  export * from './lib/techlify-feature/techlify-feature.service';
98
99
  export * from './lib/request-helper/request-helper.service';
99
100
  export * from './lib/change-password/change-password.module';