@decaf-ts/for-angular 0.0.78 → 0.0.80

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
@@ -18,7 +18,6 @@ import { Location } from '@angular/common';
18
18
  import * as i3 from '@ngx-translate/core';
19
19
  import { TranslateService, TranslateLoader, TranslationObject, TranslateParser, RootTranslateServiceConfig } from '@ngx-translate/core';
20
20
  import { Observable, Subject, Subscription } from 'rxjs';
21
- import { NgxComponentDirective as NgxComponentDirective$1, ICrudFormEvent as ICrudFormEvent$1, KeyValue as KeyValue$1 } from 'src/lib/engine';
22
21
  import { HttpClient } from '@angular/common/http';
23
22
  import { OverlayBaseController } from '@ionic/angular/common';
24
23
  import { Title, SafeHtml, DomSanitizer } from '@angular/platform-browser';
@@ -688,6 +687,7 @@ interface IBaseCustomEvent {
688
687
  interface IModelComponentSubmitEvent<M extends Model> extends Omit<IBaseCustomEvent, 'name'> {
689
688
  success: boolean;
690
689
  message?: string;
690
+ aborted?: boolean;
691
691
  model: M | M[] | null;
692
692
  }
693
693
  /**
@@ -876,7 +876,7 @@ declare abstract class NgxEventHandler extends DecafEventHandler {
876
876
  label?: string;
877
877
  filterBy?: string;
878
878
  constructor();
879
- handle<T extends NgxComponentDirective$1>(event: Partial<ICrudFormEvent$1>, data?: KeyValue$1, instance?: T, ...args: unknown[]): Promise<void>;
879
+ handle<T extends NgxComponentDirective>(event: Partial<ICrudFormEvent>, data?: KeyValue, instance?: T, ...args: unknown[]): Promise<void>;
880
880
  from(...args: unknown[]): NgxEventHandler;
881
881
  process(...args: unknown[]): Promise<any>;
882
882
  delete(...args: unknown[]): Promise<any>;
@@ -1125,6 +1125,16 @@ declare class NgxMediaService {
1125
1125
 
1126
1126
  declare class NgxRepositoryDirective<M extends Model> extends DecafComponent<M> {
1127
1127
  private _context?;
1128
+ /**
1129
+ * @description The name of the model class to operate on.
1130
+ * @summary Identifies which registered model class this component should work with.
1131
+ * This name is used to resolve the model constructor from the global model registry
1132
+ * and instantiate the appropriate repository for data operations. The model must
1133
+ * be properly registered using the @Model decorator for resolution to work.
1134
+ *
1135
+ * @type {string}
1136
+ */
1137
+ modelName: string;
1128
1138
  /**
1129
1139
  * @description Primary key field name for the data model.
1130
1140
  * @summary Specifies which field in the model should be used as the primary key.
@@ -1220,12 +1230,13 @@ declare class NgxRepositoryDirective<M extends Model> extends DecafComponent<M>
1220
1230
  set context(context: DecafRepository<M>);
1221
1231
  from(repository: IRepository<M>): NgxRepositoryDirective<M>;
1222
1232
  get repository(): DecafRepository<M>;
1233
+ refresh(model?: unknown): Promise<void>;
1223
1234
  protected buildCondition(attr?: keyof M): Condition<M>;
1224
1235
  read(uid: PrimaryKeyType): Promise<M>;
1225
1236
  delete(data: PrimaryKeyType | PrimaryKeyType[] | M[], pk: PrimaryKeyType): Promise<void>;
1226
1237
  query(condtion?: Condition<M>, sortBy?: keyof M, sortDirection?: OrderDirection): Promise<M[]>;
1227
1238
  paginate(limit?: number, sortDirection?: OrderDirection, condition?: Condition<M>): Promise<Paginator<M>>;
1228
- protected transactionBegin<M extends Model>(data: M, repository: DecafRepository<M>, operation: CrudOperations): Promise<M | M[] | EventIds>;
1239
+ protected transactionBegin<M extends Model>(data: M, repository: DecafRepository<M>, operation: CrudOperations): Promise<M | M[] | EventIds | undefined>;
1229
1240
  /**
1230
1241
  * @description Parses and transforms form data for repository operations.
1231
1242
  * @summary Converts raw form data into the appropriate format for repository operations.
@@ -1245,7 +1256,7 @@ declare class NgxRepositoryDirective<M extends Model> extends DecafComponent<M>
1245
1256
  protected getModelPropertyType(constructor: Constructor<M>, prop: keyof M): string;
1246
1257
  protected getModelPkType(clazz: Constructor<M>): string;
1247
1258
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxRepositoryDirective<any>, never>;
1248
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgxRepositoryDirective<any>, never, never, { "pk": { "alias": "pk"; "required": false; }; "filter": { "alias": "filter"; "required": false; }; "filterBy": { "alias": "filterBy"; "required": false; }; "start": { "alias": "start"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; "sortDirection": { "alias": "sortDirection"; "required": false; }; "sortBy": { "alias": "sortBy"; "required": false; }; "indexes": { "alias": "indexes"; "required": false; }; "_data": { "alias": "_data"; "required": false; }; }, {}, never, never, true, never>;
1259
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxRepositoryDirective<any>, never, never, { "modelName": { "alias": "modelName"; "required": false; }; "pk": { "alias": "pk"; "required": false; }; "filter": { "alias": "filter"; "required": false; }; "filterBy": { "alias": "filterBy"; "required": false; }; "start": { "alias": "start"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; "sortDirection": { "alias": "sortDirection"; "required": false; }; "sortBy": { "alias": "sortBy"; "required": false; }; "indexes": { "alias": "indexes"; "required": false; }; "_data": { "alias": "_data"; "required": false; }; }, {}, never, never, true, never>;
1249
1260
  }
1250
1261
 
1251
1262
  /**
@@ -1353,17 +1364,6 @@ declare abstract class NgxComponentDirective extends NgxRepositoryDirective<Mode
1353
1364
  * @memberOf module:lib/engine/NgxComponentDirective
1354
1365
  */
1355
1366
  model: Model | string | undefined;
1356
- /**
1357
- * @description The name of the model class to operate on.
1358
- * @summary Identifies which registered model class this component should work with.
1359
- * This name is used to resolve the model constructor from the global model registry
1360
- * and instantiate the appropriate repository for data operations. The model must
1361
- * be properly registered using the @Model decorator for resolution to work.
1362
- *
1363
- * @type {string}
1364
- * @memberOf module:lib/engine/NgxComponentDirective
1365
- */
1366
- modelName: string;
1367
1367
  /**
1368
1368
  * @description Primary key value of the current model instance.
1369
1369
  * @summary Specifies the primary key value for the current model record being displayed or
@@ -1959,7 +1959,7 @@ declare abstract class NgxComponentDirective extends NgxRepositoryDirective<Mode
1959
1959
  changeOperation(operation: string, id?: string): Promise<boolean>;
1960
1960
  initProps<T extends NgxComponentDirective>(props: T | KeyValue, map?: (keyof T)[] | KeyValue, instance?: NgxComponentDirective & T): Promise<void>;
1961
1961
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxComponentDirective, never>;
1962
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgxComponentDirective, never, never, { "enableDarkMode": { "alias": "enableDarkMode"; "required": false; }; "isDarkMode": { "alias": "isDarkMode"; "required": false; }; "name": { "alias": "name"; "required": false; }; "childOf": { "alias": "childOf"; "required": false; }; "uid": { "alias": "uid"; "required": false; }; "model": { "alias": "model"; "required": false; }; "modelName": { "alias": "modelName"; "required": false; }; "modelId": { "alias": "modelId"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "value": { "alias": "value"; "required": false; }; "mapper": { "alias": "mapper"; "required": false; }; "operations": { "alias": "operations"; "required": false; }; "operation": { "alias": "operation"; "required": false; }; "row": { "alias": "row"; "required": false; }; "col": { "alias": "col"; "required": false; }; "className": { "alias": "className"; "required": false; }; "translatable": { "alias": "translatable"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "item": { "alias": "item"; "required": false; }; "props": { "alias": "props"; "required": false; }; "route": { "alias": "route"; "required": false; }; "borders": { "alias": "borders"; "required": false; }; "isModalChild": { "alias": "isModalChild"; "required": false; }; "handlers": { "alias": "handlers"; "required": false; }; "events": { "alias": "events"; "required": false; }; "propsMapperFn": { "alias": "propsMapperFn"; "required": false; }; }, { "listenEvent": "listenEvent"; "refreshEvent": "refreshEvent"; }, never, never, true, never>;
1962
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxComponentDirective, never, never, { "enableDarkMode": { "alias": "enableDarkMode"; "required": false; }; "isDarkMode": { "alias": "isDarkMode"; "required": false; }; "name": { "alias": "name"; "required": false; }; "childOf": { "alias": "childOf"; "required": false; }; "uid": { "alias": "uid"; "required": false; }; "model": { "alias": "model"; "required": false; }; "modelId": { "alias": "modelId"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "value": { "alias": "value"; "required": false; }; "mapper": { "alias": "mapper"; "required": false; }; "operations": { "alias": "operations"; "required": false; }; "operation": { "alias": "operation"; "required": false; }; "row": { "alias": "row"; "required": false; }; "col": { "alias": "col"; "required": false; }; "className": { "alias": "className"; "required": false; }; "translatable": { "alias": "translatable"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "item": { "alias": "item"; "required": false; }; "props": { "alias": "props"; "required": false; }; "route": { "alias": "route"; "required": false; }; "borders": { "alias": "borders"; "required": false; }; "isModalChild": { "alias": "isModalChild"; "required": false; }; "handlers": { "alias": "handlers"; "required": false; }; "events": { "alias": "events"; "required": false; }; "propsMapperFn": { "alias": "propsMapperFn"; "required": false; }; }, { "listenEvent": "listenEvent"; "refreshEvent": "refreshEvent"; }, never, never, true, never>;
1963
1963
  }
1964
1964
 
1965
1965
  /**
@@ -2416,7 +2416,7 @@ declare abstract class NgxModelPageDirective extends NgxPageDirective implements
2416
2416
  * @param {string} uid - The unique identifier of the model instance to retrieve
2417
2417
  * @return {Promise<Model | undefined>} Promise resolving to the model instance or undefined
2418
2418
  */
2419
- handleRead(uid?: EventIds, repository?: IRepository<Model>, modelName?: string, pk?: string): Promise<Model | undefined>;
2419
+ handleRead<M extends Model>(uid?: EventIds, repository?: IRepository<M>, modelName?: string, pk?: string): Promise<Model | undefined>;
2420
2420
  process<M extends Model>(event: ICrudFormEvent, model?: M, submit?: boolean): Promise<ILayoutModelContext | IModelComponentSubmitEvent<M>>;
2421
2421
  /**
2422
2422
  * @description Handles form submission events for CRUD operations.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/for-angular",
3
- "version": "0.0.78",
3
+ "version": "0.0.80",
4
4
  "author": "Tiago Venceslau and Contributors",
5
5
  "license": "MPL-2.0 OR AGPL-3.0",
6
6
  "repository": {