@dataclouder/ngx-core 0.1.38 → 0.1.39

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.
package/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnInit, OnChanges, SimpleChanges, OnDestroy, InjectionToken, WritableSignal, Type, Provider, PipeTransform } from '@angular/core';
3
- import { FormGroup, FormControl, FormArray } from '@angular/forms';
2
+ import { OnInit, OnChanges, OnDestroy, SimpleChanges, InjectionToken, WritableSignal, Type, Provider, PipeTransform } from '@angular/core';
4
3
  import { MenuItem, FilterMetadata } from 'primeng/api';
5
4
  import { ActivatedRoute, Router } from '@angular/router';
6
5
  import { Table } from 'primeng/table';
7
6
  import { DynamicDialogRef, DialogService } from 'primeng/dynamicdialog';
7
+ import { FormGroup, FormControl, FormArray } from '@angular/forms';
8
8
  import { HttpErrorResponse } from '@angular/common/http';
9
9
  import * as rxjs from 'rxjs';
10
10
  import { Observable } from 'rxjs';
@@ -85,7 +85,12 @@ interface ListFilterBarOptions {
85
85
  interface PColumn {
86
86
  field: string;
87
87
  header: string;
88
- type?: 'text' | 'image' | 'tags' | 'actions';
88
+ type?: 'text' | 'image' | 'tags' | 'actions' | 'select' | 'boolean' | 'numeric';
89
+ options?: {
90
+ label: string;
91
+ value: any;
92
+ }[];
93
+ reverse?: boolean;
89
94
  }
90
95
  declare class QuickTableComponent {
91
96
  readonly columns: i0.InputSignal<PColumn[]>;
@@ -108,7 +113,7 @@ declare class QuickTableComponent {
108
113
  getFilterType(column: PColumn): string;
109
114
  private initializeFilters;
110
115
  onFilterLocal(event: any): void;
111
- filterOutsideTable(type: 'tags' | 'text', column: string, value: string[]): void;
116
+ filterOutsideTable(type: 'tags' | 'text' | 'select', column: string, value: any): void;
112
117
  static ɵfac: i0.ɵɵFactoryDeclaration<QuickTableComponent, never>;
113
118
  static ɵcmp: i0.ɵɵComponentDeclaration<QuickTableComponent, "app-quick-table", never, { "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "tableData": { "alias": "tableData"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; }, { "onAction": "onAction"; }, never, never, true, never>;
114
119
  }
@@ -197,40 +202,25 @@ declare abstract class PaginationBase {
197
202
  static ɵdir: i0.ɵɵDirectiveDeclaration<PaginationBase, never, never, { "actions": { "alias": "actions"; "required": false; "isSignal": true; }; }, { "onAction": "onAction"; }, never, never, true, never>;
198
203
  }
199
204
 
200
- declare class DCFilterBarComponent implements OnInit, OnChanges {
201
- private readonly fb;
205
+ declare class DCFilterBarComponent {
206
+ private readonly dialogService;
202
207
  readonly items: i0.InputSignal<MenuItem[]>;
203
208
  readonly options: i0.InputSignal<ListFilterBarOptions>;
204
209
  customFilters: ICustomFilter[];
205
210
  isAdmin: boolean;
206
211
  readonly onFilterAction: i0.OutputEmitterRef<any>;
207
- readonly onChangeSort: i0.OutputEmitterRef<any>;
208
212
  readonly onNew: i0.OutputEmitterRef<any>;
209
- customFiltersForm: FormGroup;
210
- ngOnInit(): void;
211
- ngOnChanges(changes: SimpleChanges): void;
212
- private buildCustomFiltersForm;
213
- availibleFilters: {
214
- name: string;
215
- code: string;
216
- }[];
217
- sortOptions: SortOption[];
218
213
  isSearchVisible: boolean;
219
- isFilterVisible: boolean;
220
214
  placeholder: string;
221
215
  filter: FiltersConfig;
222
- selectedFilters: (typeof availibleFilters)[];
223
- selectedSort: SortOption | null;
224
- dateRange: Date[];
225
- changeFilter(event: any): void;
226
- changeSort(event: any): void;
227
216
  createNew(): void;
228
- search(text?: string): void;
217
+ search(text: string | null): void;
218
+ openFilterDialog(): void;
219
+ private applyFilters;
229
220
  clearFilters(): void;
230
- applyFilters(): void;
231
221
  doItemAction(filterEvent: OnActionEvent): void;
232
222
  static ɵfac: i0.ɵɵFactoryDeclaration<DCFilterBarComponent, never>;
233
- static ɵcmp: i0.ɵɵComponentDeclaration<DCFilterBarComponent, "dc-filter-bar", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "customFilters": { "alias": "customFilters"; "required": false; }; "isAdmin": { "alias": "isAdmin"; "required": false; }; }, { "onFilterAction": "onFilterAction"; "onChangeSort": "onChangeSort"; "onNew": "onNew"; }, never, never, true, never>;
223
+ static ɵcmp: i0.ɵɵComponentDeclaration<DCFilterBarComponent, "dc-filter-bar", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "customFilters": { "alias": "customFilters"; "required": false; }; "isAdmin": { "alias": "isAdmin"; "required": false; }; }, { "onFilterAction": "onFilterAction"; "onNew": "onNew"; }, never, never, true, never>;
234
224
  }
235
225
 
236
226
  declare class ConfirmComponent implements OnInit {
@@ -430,13 +420,6 @@ declare class DcLearnableFormComponent {
430
420
  static ɵcmp: i0.ɵɵComponentDeclaration<DcLearnableFormComponent, "dc-learnable-form", never, { "form": { "alias": "form"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
431
421
  }
432
422
 
433
- declare const AppHttpCode: {
434
- GoodRefreshToken: number;
435
- GoodPlanExpired: number;
436
- ErrorRefreshToken: number;
437
- GoodWelcome: number;
438
- ErrorAndLogout: number;
439
- };
440
423
  /**
441
424
  * Interface for HTTP error responses
442
425
  */
@@ -510,8 +493,10 @@ declare class HttpCoreService {
510
493
  */
511
494
  error(): i0.WritableSignal<HttpCoreError>;
512
495
  postHttp<T = any>({ service, data, host }: PostHttpParams): Promise<T>;
496
+ postHttp$<T = any>({ service, data, host }: PostHttpParams): Observable<T>;
513
497
  putHttp<T = any>({ service, data, host }: PutHttpParams): Promise<T>;
514
498
  getHttp<T = any>({ service, host, skipErrorHandling }: GetHttpParams): Promise<T>;
499
+ getHttp$<T = any>({ service, host, skipErrorHandling }: GetHttpParams): Observable<T>;
515
500
  deleteHttp<T = DeletedData>({ service, host }: DeleteHttpParams): Promise<T>;
516
501
  /**
517
502
  * Make a POST request to the specified service
@@ -666,11 +651,6 @@ declare class HttpCoreService {
666
651
  * @returns An observable that throws the error
667
652
  */
668
653
  private handleBlobError;
669
- /**
670
- * Check the status of a response
671
- * @param response The response to check
672
- */
673
- private checkResponseStatus;
674
654
  /**
675
655
  * Convert an object to a plain object
676
656
  * @param obj The object to convert
@@ -731,7 +711,9 @@ declare abstract class EntityBaseFormComponent<T extends {
731
711
  protected route: ActivatedRoute;
732
712
  protected router: Router;
733
713
  toastService: _dataclouder_ngx_core.ToastAlertsAbstractService;
714
+ id: i0.InputSignal<string>;
734
715
  entity: i0.WritableSignal<T>;
716
+ private entityIdFromUrl;
735
717
  entityId: i0.Signal<string>;
736
718
  abstract form: FormGroup;
737
719
  protected abstract entityCommunicationService: EntityCommunicationService<T>;
@@ -743,7 +725,7 @@ declare abstract class EntityBaseFormComponent<T extends {
743
725
  saveDirtyValues(): Promise<T>;
744
726
  private loadEntityEffect;
745
727
  static ɵfac: i0.ɵɵFactoryDeclaration<EntityBaseFormComponent<any>, never>;
746
- static ɵdir: i0.ɵɵDirectiveDeclaration<EntityBaseFormComponent<any>, never, never, {}, {}, never, never, true, never>;
728
+ static ɵdir: i0.ɵɵDirectiveDeclaration<EntityBaseFormComponent<any>, never, never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
747
729
  }
748
730
 
749
731
  declare enum EModelQuality {
@@ -802,6 +784,17 @@ declare class ChatUserSettings {
802
784
  userMessageTask: boolean;
803
785
  assistantMessageTask: boolean;
804
786
  }
787
+ interface AppException {
788
+ error_message?: string;
789
+ explanation?: string;
790
+ path?: string;
791
+ statusCode?: number;
792
+ method?: string;
793
+ obj?: any;
794
+ exception?: any;
795
+ suggestion?: string;
796
+ type?: string;
797
+ }
805
798
 
806
799
  /**
807
800
  * Extracts and parses the first JSON object or array found within a string.
@@ -902,7 +895,7 @@ interface IAppConfig {
902
895
  backendPythonUrl: string;
903
896
  backendNodeUrl: string;
904
897
  aiServicesUrl: string;
905
- kbhost: string;
898
+ kbHost: string;
906
899
  clientId: string;
907
900
  mobile: {
908
901
  appleAppId: string;
@@ -926,7 +919,6 @@ interface IAppConfig {
926
919
  declare const APP_CONFIG: InjectionToken<IAppConfig>;
927
920
  declare class AppConfigService {
928
921
  config: IAppConfig;
929
- constructor();
930
922
  static ɵfac: i0.ɵɵFactoryDeclaration<AppConfigService, never>;
931
923
  static ɵprov: i0.ɵɵInjectableDeclaration<AppConfigService>;
932
924
  }
@@ -1002,5 +994,5 @@ declare const CharacterEventActions: {
1002
994
  label: string;
1003
995
  }[];
1004
996
 
1005
- export { APP_CONFIG, AppConfigService, AppHttpCode, AudioNotificationService, AudioSpeed, AudioSpeedReverse, CharacterEventActions, ChatUserSettings, ConfirmComponent, ConfirmService, DCFilterBarComponent, DCProgressToastComponent, DcAuditableViewerComponent, DcExtensionsViewerComponent, DcLearnableFormComponent, DcLearnableViewerComponent, DcManageableFormComponent, DcManageableViewerComponent, DcReactionsViewerComponent, EModelQuality, EmptyStateComponent, EntityBaseFormComponent, EntityBaseListComponent, EntityCommunicationService, FlagPipe, FormUtilsService, GetPathPipe, HTTP_CORE_CONFIG, HttpCoreService, IAIModel, LANGUAGES, LangDescTranslation, LoadingBarComponent, LoadingBarService, ModelQualityOptions, MoodState, MoodStateOptions, OptionValue, PaginationBase, PromptService, QuickTableComponent, SUPPORTED_LANGUAGES, TOAST_ALERTS_TOKEN, ToastAlertsAbstractService, UiStateService, availibleFilters, extractJsonFromString, formatCamelCaseString, getLangDesc, getSupportedLanguageOptions, provideToastAlert, sortOptions, sortTypes };
1006
- export type { ConfirmOptions, DeleteHttpParams, DeletedData, FiltersConfig, GetHttpParams, HttpCoreConfig, HttpCoreError, IAppConfig, IAuditable, ICustomFilter, IExtensionable, IFilterQueryResponse, ILangTranslation, ILanguageData, ILearnable, IManageable, IReactable, LearnableForm, ListFilterBarOptions, OnActionEvent, PColumn, PostHttpParams, PromptOptions, PutHttpParams, SortOption, ToastData };
997
+ export { APP_CONFIG, AppConfigService, AudioNotificationService, AudioSpeed, AudioSpeedReverse, CharacterEventActions, ChatUserSettings, ConfirmComponent, ConfirmService, DCFilterBarComponent, DCProgressToastComponent, DcAuditableViewerComponent, DcExtensionsViewerComponent, DcLearnableFormComponent, DcLearnableViewerComponent, DcManageableFormComponent, DcManageableViewerComponent, DcReactionsViewerComponent, EModelQuality, EmptyStateComponent, EntityBaseFormComponent, EntityBaseListComponent, EntityCommunicationService, FlagPipe, FormUtilsService, GetPathPipe, HTTP_CORE_CONFIG, HttpCoreService, IAIModel, LANGUAGES, LangDescTranslation, LoadingBarComponent, LoadingBarService, ModelQualityOptions, MoodState, MoodStateOptions, OptionValue, PaginationBase, PromptService, QuickTableComponent, SUPPORTED_LANGUAGES, TOAST_ALERTS_TOKEN, ToastAlertsAbstractService, UiStateService, availibleFilters, extractJsonFromString, formatCamelCaseString, getLangDesc, getSupportedLanguageOptions, provideToastAlert, sortOptions, sortTypes };
998
+ export type { AppException, ConfirmOptions, DeleteHttpParams, DeletedData, FiltersConfig, GetHttpParams, HttpCoreConfig, HttpCoreError, IAppConfig, IAuditable, ICustomFilter, IExtensionable, IFilterQueryResponse, ILangTranslation, ILanguageData, ILearnable, IManageable, IReactable, LearnableForm, ListFilterBarOptions, OnActionEvent, PColumn, PostHttpParams, PromptOptions, PutHttpParams, SortOption, ToastData };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataclouder/ngx-core",
3
- "version": "0.1.38",
3
+ "version": "0.1.39",
4
4
  "description": "Angular core components library for DataClouder applications, only for internal use",
5
5
  "author": {
6
6
  "name": "dataclouder",