@decaf-ts/for-angular 0.0.47 → 0.0.49

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
@@ -5,7 +5,7 @@ import { TextFieldTypes, SelectInterface, AutocompleteTypes, CheckboxCustomEvent
5
5
  import * as i2 from '@angular/forms';
6
6
  import { FormGroup, FormControl, FormArray, ControlValueAccessor, AbstractControl } from '@angular/forms';
7
7
  import { OrderDirection, Repository, Adapter, EventIds, Paginator, Condition } from '@decaf-ts/core';
8
- import { FieldProperties, IPagedComponentProperties, CrudOperationKeys, UIFunctionLike, HTML5InputTypes, DecafComponent, UIModelMetadata, FieldDefinition, UIMediaBreakPointsType, RenderingEngine } from '@decaf-ts/ui-decorators';
8
+ import { FieldProperties, IPagedComponentProperties, CrudOperationKeys, UIFunctionLike, HTML5InputTypes, DecafComponent, UIModelMetadata, FieldDefinition, UIMediaBreakPointsType, UIElementMetadata, RenderingEngine, DecafEventHandler } from '@decaf-ts/ui-decorators';
9
9
  import * as _decaf_ts_decorator_validation from '@decaf-ts/decorator-validation';
10
10
  import { Model, VALIDATION_PARENT_KEY, ModelConstructor } from '@decaf-ts/decorator-validation';
11
11
  import { RepositoryFlags, Context, CrudOperations, OperationKeys, IRepository } from '@decaf-ts/db-decorators';
@@ -19,8 +19,8 @@ import { TranslateService, TranslateLoader, TranslationObject, TranslateParser,
19
19
  import { HttpClient } from '@angular/common/http';
20
20
  import { Observable, Subscription } from 'rxjs';
21
21
  import { SafeHtml, DomSanitizer, Title } from '@angular/platform-browser';
22
- import { LoggedClass, Logger } from '@decaf-ts/logging';
23
22
  import { InjectablesRegistry } from '@decaf-ts/injectable-decorators';
23
+ import { Logger } from '@decaf-ts/logging';
24
24
 
25
25
  /**
26
26
  * @module lib/engine/interfaces
@@ -778,8 +778,8 @@ interface RawQuery<M extends Model> {
778
778
  limit?: number;
779
779
  skip?: number;
780
780
  }
781
- type DecafRepositoryAdapter<F extends RepositoryFlags = RepositoryFlags, C extends Context<F> = Context<F>> = Adapter<any, any, RawQuery<any>, F, C>;
782
- type DecafRepository<M extends Model> = Repository<M, RawQuery<M>, DecafRepositoryAdapter<RepositoryFlags, Context<RepositoryFlags>>, RepositoryFlags, Context<RepositoryFlags>>;
781
+ type DecafRepositoryAdapter<F extends RepositoryFlags = RepositoryFlags, C extends Context<F> = Context<F>> = Adapter<any, any, RawQuery<any>, C>;
782
+ type DecafRepository<M extends Model> = Repository<M, DecafRepositoryAdapter<RepositoryFlags, Context>>;
783
783
  /**
784
784
  * @description Generic key-value pair type
785
785
  * @summary Represents a generic object with string keys and any type of values.
@@ -1310,6 +1310,7 @@ declare abstract class NgxComponentDirective extends DecafComponent implements O
1310
1310
  * @memberOf module:lib/engine/NgxComponentDirective
1311
1311
  */
1312
1312
  modelId?: EventIds;
1313
+ value: unknown;
1313
1314
  /**
1314
1315
  * @description Primary key field name for the data model.
1315
1316
  * @summary Specifies which field in the model should be used as the primary key.
@@ -1347,9 +1348,9 @@ declare abstract class NgxComponentDirective extends DecafComponent implements O
1347
1348
  * The operation affects form validation, field availability, and the specific repository
1348
1349
  * method called during data submission.
1349
1350
  *
1350
- * @type {OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE}
1351
+ * @type {OperationKeys}
1351
1352
  * @default OperationKeys.READ
1352
- * @memberOf ModelPage
1353
+ * @memberOf module:lib/engine/NgxComponentDirective
1353
1354
  */
1354
1355
  operation: OperationKeys | undefined;
1355
1356
  /**
@@ -1437,6 +1438,16 @@ declare abstract class NgxComponentDirective extends DecafComponent implements O
1437
1438
  * @memberOf module:lib/engine/NgxComponentDirective
1438
1439
  */
1439
1440
  listenEvent: EventEmitter<IBaseCustomEvent>;
1441
+ /**
1442
+ * @description Event emitter for custom component events.
1443
+ * @summary Emits custom events that occur within child components or the component itself.
1444
+ * This allows parent components to listen for and respond to user interactions or
1445
+ * state changes. Events are passed up the component hierarchy to enable coordinated
1446
+ * behavior across the application.
1447
+ * @type {EventEmitter<IBaseCustomEvent>}
1448
+ * @memberOf module:lib/engine/NgxComponentDirective
1449
+ */
1450
+ refreshEvent: EventEmitter<IBaseCustomEvent | boolean>;
1440
1451
  /**
1441
1452
  * @description Angular Router instance for programmatic navigation.
1442
1453
  * @summary Injected Router service used for programmatic navigation between routes
@@ -1446,7 +1457,7 @@ declare abstract class NgxComponentDirective extends DecafComponent implements O
1446
1457
  * @type {Router}
1447
1458
  * @memberOf module:lib/engine/NgxComponentDirective
1448
1459
  */
1449
- protected router: Router;
1460
+ router: Router;
1450
1461
  /**
1451
1462
  * @description Current locale identifier for component internationalization.
1452
1463
  * @summary Specifies the locale code (e.g., 'en-US', 'pt-BR') used for translating UI text
@@ -1528,6 +1539,24 @@ declare abstract class NgxComponentDirective extends DecafComponent implements O
1528
1539
  isModalChild: boolean;
1529
1540
  protected handlers: Record<string, UIFunctionLike>;
1530
1541
  protected events: Record<string, UIFunctionLike>;
1542
+ /**
1543
+ * @description Indicates whether a refresh operation is in progress.
1544
+ * @summary When true, the component is currently fetching new data. This is used
1545
+ * to control loading indicators and prevent duplicate refresh operations from
1546
+ * being triggered simultaneously.
1547
+ *
1548
+ * @type {boolean}
1549
+ * @default false
1550
+ */
1551
+ refreshing: boolean;
1552
+ /**
1553
+ * @description Represents the color scheme used for application.
1554
+ * @summary This property determines the visual appearance of the application
1555
+ * based on predefined color schemes (e.g., light or dark mode).
1556
+ * @type {WindowColorScheme}
1557
+ * @default WindowColorSchemes.light
1558
+ */
1559
+ protected colorSchema: WindowColorScheme;
1531
1560
  /**
1532
1561
  * @description Constructor for NgxComponentDirective.
1533
1562
  * @summary Initializes the directive by setting up the component name, locale root,
@@ -1548,6 +1577,7 @@ declare abstract class NgxComponentDirective extends DecafComponent implements O
1548
1577
  * @returns {void}
1549
1578
  */
1550
1579
  ngOnDestroy(): Promise<void> | void;
1580
+ refresh(...args: unknown[]): Promise<void>;
1551
1581
  /**
1552
1582
  * @description Getter for the current locale context identifier.
1553
1583
  * @summary Returns the current locale identifier by calling the getLocale method.
@@ -1566,7 +1596,8 @@ declare abstract class NgxComponentDirective extends DecafComponent implements O
1566
1596
  * @throws {InternalError} If repository initialization fails
1567
1597
  * @memberOf module:lib/engine/NgxComponentDirective
1568
1598
  */
1569
- protected get repository(): DecafRepository<Model> | undefined;
1599
+ get repository(): DecafRepository<Model> | undefined;
1600
+ set repository(repository: DecafRepository<Model> | undefined);
1570
1601
  /**
1571
1602
  * @description Angular lifecycle hook for handling input property changes.
1572
1603
  * @summary Responds to changes in component input properties, specifically monitoring changes
@@ -1722,7 +1753,7 @@ declare abstract class NgxComponentDirective extends DecafComponent implements O
1722
1753
  * end
1723
1754
  * @memberOf module:lib/engine/NgxComponentDirective
1724
1755
  */
1725
- handleEvent(event: IBaseCustomEvent | ICrudFormEvent | CustomEvent): Promise<void>;
1756
+ handleEvent(event: IBaseCustomEvent | ICrudFormEvent | CustomEvent, repository?: DecafRepository<Model>): Promise<void>;
1726
1757
  /**
1727
1758
  * @description Determines if a specific operation is allowed in the current context.
1728
1759
  * @summary This method checks if an operation is included in the list of available
@@ -1775,7 +1806,7 @@ declare abstract class NgxComponentDirective extends DecafComponent implements O
1775
1806
  */
1776
1807
  changeOperation(operation: string, id?: string): Promise<boolean>;
1777
1808
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxComponentDirective, never>;
1778
- 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; }; "pk": { "alias": "pk"; "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; }; "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; }; }, { "listenEvent": "listenEvent"; }, never, never, true, never>;
1809
+ 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; }; "value": { "alias": "value"; "required": false; }; "pk": { "alias": "pk"; "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; }; "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; }; }, { "listenEvent": "listenEvent"; "refreshEvent": "refreshEvent"; }, never, never, true, never>;
1779
1810
  }
1780
1811
 
1781
1812
  declare class NgxRenderableComponentDirective extends NgxComponentDirective implements OnChanges, OnDestroy, IRenderedModel {
@@ -3066,7 +3097,7 @@ declare class NgxParentComponentDirective extends NgxComponentDirective implemen
3066
3097
  protected timerSubscription: Subscription;
3067
3098
  ngOnInit(model?: Model | string): Promise<void>;
3068
3099
  ngOnDestroy(): Promise<void> | void;
3069
- protected getActivePage(page: number): UIModelMetadata | UIModelMetadata[] | FieldDefinition | undefined;
3100
+ protected getActivePage(page: number, firstClick?: boolean): UIModelMetadata | UIModelMetadata[] | FieldDefinition | undefined;
3070
3101
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxParentComponentDirective, never>;
3071
3102
  static ɵdir: i0.ɵɵDirectiveDeclaration<NgxParentComponentDirective, never, never, { "page": { "alias": "page"; "required": false; }; "pages": { "alias": "pages"; "required": false; }; "parentForm": { "alias": "parentForm"; "required": false; }; "children": { "alias": "children"; "required": false; }; "cols": { "alias": "cols"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "cardBody": { "alias": "cardBody"; "required": false; }; "cardType": { "alias": "cardType"; "required": false; }; "breakpoint": { "alias": "breakpoint"; "required": false; }; "match": { "alias": "match"; "required": false; }; }, {}, never, never, true, never>;
3072
3103
  }
@@ -3243,7 +3274,7 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
3243
3274
  * @returns {void}
3244
3275
  */
3245
3276
  handleReset(): void;
3246
- handleSubmit(event?: SubmitEvent, eventName?: string, componentName?: string): Promise<boolean | void>;
3277
+ submit(event?: SubmitEvent, eventName?: string, componentName?: string): Promise<boolean | void>;
3247
3278
  /**
3248
3279
  * @description Updates the active form group and children for the specified page.
3249
3280
  * @summary Extracts the FormGroup for the given page from the FormArray and filters
@@ -3914,7 +3945,7 @@ declare class FieldsetComponent extends NgxFormDirective implements OnInit, Afte
3914
3945
  * @default []
3915
3946
  * @memberOf FieldsetComponent
3916
3947
  */
3917
- items: IFieldSetItem[];
3948
+ items: IFieldSetItem[] | UIElementMetadata[][];
3918
3949
  /**
3919
3950
  * @description Currently selected item for update operations.
3920
3951
  * @summary Holds the item being edited when in update mode. Used to track
@@ -4081,6 +4112,7 @@ declare class FieldsetComponent extends NgxFormDirective implements OnInit, Afte
4081
4112
  * @memberOf FieldsetComponent
4082
4113
  */
4083
4114
  ngAfterViewInit(): Promise<void>;
4115
+ refresh(): Promise<void>;
4084
4116
  /**
4085
4117
  * @description Handles removal of the fieldset with slide animation.
4086
4118
  * @summary Initiates the removal process for the fieldset with a smooth slide-up animation.
@@ -4605,7 +4637,7 @@ declare class FilterComponent extends NgxComponentDirective implements OnInit, O
4605
4637
  *
4606
4638
  * @memberOf FilterComponent
4607
4639
  */
4608
- addFilter(value: string, event?: CustomEvent): void;
4640
+ addFilter(value: string, event?: CustomEvent): Promise<void>;
4609
4641
  /**
4610
4642
  * @description Selects an option from the dropdown suggestions.
4611
4643
  * @summary Handles option selection when a user clicks on a suggestion in the dropdown.
@@ -4676,10 +4708,10 @@ declare class FilterComponent extends NgxComponentDirective implements OnInit, O
4676
4708
  * @summary Emits the current filter array to parent components when filters are ready
4677
4709
  * to be applied. Only emits if there are active filters. Clears options after submission.
4678
4710
  *
4679
- * @returns {void}
4711
+ * @returns {Promise<void>}
4680
4712
  * @memberOf FilterComponent
4681
4713
  */
4682
- submit(): void;
4714
+ submit(): Promise<void>;
4683
4715
  /**
4684
4716
  * @description Toggles the sort direction between ascending and descending.
4685
4717
  * @summary Handles sort direction changes by toggling between ASC and DSC values.
@@ -5052,7 +5084,7 @@ declare class ListComponent extends NgxComponentDirective implements OnInit, OnD
5052
5084
  * @default "full"
5053
5085
  * @memberOf ListComponent
5054
5086
  */
5055
- lines: "inset" | "full" | "none";
5087
+ lines: 'inset' | 'full' | 'none';
5056
5088
  /**
5057
5089
  * @description Controls whether the list has inset styling.
5058
5090
  * @summary When set to true, the list will have inset styling with rounded corners
@@ -5083,7 +5115,7 @@ declare class ListComponent extends NgxComponentDirective implements OnInit, OnD
5083
5115
  * @default "bottom"
5084
5116
  * @memberOf ListComponent
5085
5117
  */
5086
- scrollPosition: "bottom" | "top";
5118
+ scrollPosition: 'bottom' | 'top';
5087
5119
  /**
5088
5120
  * @description Custom text to display during loading operations.
5089
5121
  * @summary Specifies the text shown in the loading indicator when the component
@@ -5198,17 +5230,6 @@ declare class ListComponent extends NgxComponentDirective implements OnInit, OnD
5198
5230
  * @memberOf ListComponent
5199
5231
  */
5200
5232
  pages: number;
5201
- /**
5202
- * @description Indicates whether a refresh operation is in progress.
5203
- * @summary When true, the component is currently fetching new data. This is used
5204
- * to control loading indicators and prevent duplicate refresh operations from
5205
- * being triggered simultaneously.
5206
- *
5207
- * @type {boolean}
5208
- * @default false
5209
- * @memberOf ListComponent
5210
- */
5211
- refreshing: boolean;
5212
5233
  /**
5213
5234
  * @description Array used for rendering skeleton loading placeholders.
5214
5235
  * @summary Contains placeholder items that are displayed during data loading.
@@ -5263,15 +5284,6 @@ declare class ListComponent extends NgxComponentDirective implements OnInit, OnD
5263
5284
  * @memberOf ListComponent
5264
5285
  */
5265
5286
  lastPage: number;
5266
- /**
5267
- * @description Event emitter for refresh operations.
5268
- * @summary Emits an event when the list data is refreshed, either through pull-to-refresh
5269
- * or programmatic refresh. The event includes the refreshed data and component information.
5270
- *
5271
- * @type {EventEmitter<IBaseCustomEvent>}
5272
- * @memberOf ListComponent
5273
- */
5274
- refreshEvent: EventEmitter<IBaseCustomEvent>;
5275
5287
  /**
5276
5288
  * @description Event emitter for item click interactions.
5277
5289
  * @summary Emits an event when a list item is clicked. The event includes the data
@@ -5581,16 +5593,16 @@ declare class ListComponent extends NgxComponentDirective implements OnInit, OnD
5581
5593
  */
5582
5594
  refresh(event?: InfiniteScrollCustomEvent | RefresherCustomEvent | boolean): Promise<void>;
5583
5595
  /**
5584
- * @description Handles pagination events from the pagination component.
5585
- * @summary Processes pagination events by updating the current page number and
5586
- * refreshing the list data to display the selected page. This method is called
5587
- * when a user interacts with the pagination controls to navigate between pages.
5588
- *
5589
- * @param {IPaginationCustomEvent} event - The pagination event containing page information
5590
- * @returns {void}
5591
- *
5592
- * @memberOf ListComponent
5593
- */
5596
+ * @description Handles pagination events from the pagination component.
5597
+ * @summary Processes pagination events by updating the current page number and
5598
+ * refreshing the list data to display the selected page. This method is called
5599
+ * when a user interacts with the pagination controls to navigate between pages.
5600
+ *
5601
+ * @param {IPaginationCustomEvent} event - The pagination event containing page information
5602
+ * @returns {void}
5603
+ *
5604
+ * @memberOf ListComponent
5605
+ */
5594
5606
  handlePaginate(event: IPaginationCustomEvent): void;
5595
5607
  /**
5596
5608
  * @description Handles pull-to-refresh events from the refresher component.
@@ -5679,7 +5691,7 @@ declare class ListComponent extends NgxComponentDirective implements OnInit, OnD
5679
5691
  *
5680
5692
  * @memberOf ListComponent
5681
5693
  */
5682
- protected parseResult(result: KeyValue[] | Paginator<Model>): Promise<KeyValue[]>;
5694
+ protected parseResult(result: KeyValue[] | Paginator<any>): Promise<KeyValue[]>;
5683
5695
  /**
5684
5696
  * @description Updates pagination state based on data length.
5685
5697
  * @summary Calculates whether more data is available and how many pages exist
@@ -5721,7 +5733,7 @@ declare class ListComponent extends NgxComponentDirective implements OnInit, OnD
5721
5733
  mapResults(data: KeyValue[]): KeyValue[];
5722
5734
  parseSearchValue(): string | IFilterQuery;
5723
5735
  static ɵfac: i0.ɵɵFactoryDeclaration<ListComponent, never>;
5724
- static ɵcmp: i0.ɵɵComponentDeclaration<ListComponent, "ngx-decaf-list", never, { "type": { "alias": "type"; "required": false; }; "showSearchbar": { "alias": "showSearchbar"; "required": false; }; "data": { "alias": "data"; "required": false; }; "source": { "alias": "source"; "required": false; }; "start": { "alias": "start"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; "loadMoreData": { "alias": "loadMoreData"; "required": false; }; "lines": { "alias": "lines"; "required": false; }; "inset": { "alias": "inset"; "required": false; }; "scrollThreshold": { "alias": "scrollThreshold"; "required": false; }; "scrollPosition": { "alias": "scrollPosition"; "required": false; }; "loadingText": { "alias": "loadingText"; "required": false; }; "showRefresher": { "alias": "showRefresher"; "required": false; }; "createButton": { "alias": "createButton"; "required": false; }; "loadingSpinner": { "alias": "loadingSpinner"; "required": false; }; "enableFilter": { "alias": "enableFilter"; "required": false; }; "sortDirection": { "alias": "sortDirection"; "required": false; }; "sortBy": { "alias": "sortBy"; "required": false; }; "disableSort": { "alias": "disableSort"; "required": false; }; "empty": { "alias": "empty"; "required": false; }; }, { "refreshEvent": "refreshEvent"; "clickEvent": "clickEvent"; }, never, ["*"], true, never>;
5736
+ static ɵcmp: i0.ɵɵComponentDeclaration<ListComponent, "ngx-decaf-list", never, { "type": { "alias": "type"; "required": false; }; "showSearchbar": { "alias": "showSearchbar"; "required": false; }; "data": { "alias": "data"; "required": false; }; "source": { "alias": "source"; "required": false; }; "start": { "alias": "start"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; "loadMoreData": { "alias": "loadMoreData"; "required": false; }; "lines": { "alias": "lines"; "required": false; }; "inset": { "alias": "inset"; "required": false; }; "scrollThreshold": { "alias": "scrollThreshold"; "required": false; }; "scrollPosition": { "alias": "scrollPosition"; "required": false; }; "loadingText": { "alias": "loadingText"; "required": false; }; "showRefresher": { "alias": "showRefresher"; "required": false; }; "createButton": { "alias": "createButton"; "required": false; }; "loadingSpinner": { "alias": "loadingSpinner"; "required": false; }; "enableFilter": { "alias": "enableFilter"; "required": false; }; "sortDirection": { "alias": "sortDirection"; "required": false; }; "sortBy": { "alias": "sortBy"; "required": false; }; "disableSort": { "alias": "disableSort"; "required": false; }; "empty": { "alias": "empty"; "required": false; }; }, { "clickEvent": "clickEvent"; }, never, ["*"], true, never>;
5725
5737
  }
5726
5738
 
5727
5739
  /**
@@ -6159,7 +6171,7 @@ declare class ModelRendererComponent<M extends Model> extends NgxRenderableCompo
6159
6171
  * @description Refreshes the rendered model
6160
6172
  * @param {string | M} model - The model to be rendered
6161
6173
  */
6162
- private refresh;
6174
+ refresh(model: string | M): Promise<void>;
6163
6175
  /**
6164
6176
  * @description Lifecycle hook that is called when data-bound properties of a directive change
6165
6177
  * @param {SimpleChanges} changes - Object containing changes
@@ -7126,6 +7138,13 @@ declare class ModalComponent extends NgxParentComponentDirective implements OnIn
7126
7138
  * @default false
7127
7139
  */
7128
7140
  lightBox: boolean;
7141
+ /**
7142
+ * @description Controls the visibility of the modal header.
7143
+ * @summary When set to true, the modal header is displayed; when false, it is hidden.
7144
+ * @type {boolean}
7145
+ * @default true
7146
+ */
7147
+ showHeader: boolean;
7129
7148
  /**
7130
7149
  * @description Event emitted when the modal is about to be dismissed.
7131
7150
  * @summary Emits an OverlayEventDetail object containing details about the dismiss event.
@@ -7201,7 +7220,7 @@ declare class ModalComponent extends NgxParentComponentDirective implements OnIn
7201
7220
  */
7202
7221
  confirm(event: IBaseCustomEvent): Promise<void>;
7203
7222
  static ɵfac: i0.ɵɵFactoryDeclaration<ModalComponent, never>;
7204
- static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "ngx-decaf-modal", never, { "title": { "alias": "title"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; "tag": { "alias": "tag"; "required": false; }; "options": { "alias": "options"; "required": false; }; "globals": { "alias": "globals"; "required": false; }; "inlineContent": { "alias": "inlineContent"; "required": false; }; "inlineContentPosition": { "alias": "inlineContentPosition"; "required": false; }; "fullscreen": { "alias": "fullscreen"; "required": false; }; "lightBox": { "alias": "lightBox"; "required": false; }; }, { "willDismissEvent": "willDismissEvent"; }, never, never, true, never>;
7223
+ static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "ngx-decaf-modal", never, { "title": { "alias": "title"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; "tag": { "alias": "tag"; "required": false; }; "options": { "alias": "options"; "required": false; }; "globals": { "alias": "globals"; "required": false; }; "inlineContent": { "alias": "inlineContent"; "required": false; }; "inlineContentPosition": { "alias": "inlineContentPosition"; "required": false; }; "fullscreen": { "alias": "fullscreen"; "required": false; }; "lightBox": { "alias": "lightBox"; "required": false; }; "showHeader": { "alias": "showHeader"; "required": false; }; }, { "willDismissEvent": "willDismissEvent"; }, never, never, true, never>;
7205
7224
  }
7206
7225
  /**
7207
7226
  * @description Retrieves a modal component instance.
@@ -7223,6 +7242,16 @@ declare function getNgxModalComponent(props?: Partial<ModalComponent>, modalProp
7223
7242
  * @returns {Promise<void>} - A promise that resolves when the modal is presented.
7224
7243
  */
7225
7244
  declare function presentNgxLightBoxModal(inlineContent: string | SafeHtml, props?: Partial<ModalComponent>, injector?: EnvironmentInjector): Promise<void>;
7245
+ /**
7246
+ * @description Presents a lightbox modal with inline content.
7247
+ * @summary Displays a modal in lightbox mode with the specified content and properties.
7248
+ *
7249
+ * @param {string | SafeHtml} inlineContent - The content to display in the lightbox modal.
7250
+ * @param {Partial<ModalComponent>} [props={}] - Properties to initialize the modal component.
7251
+ * @param {EnvironmentInjector} [injector] - Optional environment injector for dependency injection.
7252
+ * @returns {Promise<void>} - A promise that resolves when the modal is presented.
7253
+ */
7254
+ declare function presentNgxInlineModal(inlineContent: string | SafeHtml, props?: Partial<ModalComponent>, injector?: EnvironmentInjector): Promise<void>;
7226
7255
  /**
7227
7256
  * @description Retrieves a modal for selecting options.
7228
7257
  * @summary Creates and initializes a modal component for displaying a list of selectable options.
@@ -7391,6 +7420,7 @@ declare class FileUploadComponent extends NgxFormFieldDirective implements OnIni
7391
7420
  * @default false
7392
7421
  */
7393
7422
  enableDirectoryMode: boolean;
7423
+ previewHandler?: unknown;
7394
7424
  /**
7395
7425
  * @description Maximum file size allowed for upload.
7396
7426
  * @summary Specifies the maximum size (in MB) for files that can be uploaded.
@@ -7413,7 +7443,7 @@ declare class FileUploadComponent extends NgxFormFieldDirective implements OnIni
7413
7443
  *
7414
7444
  * @type {string | undefined}
7415
7445
  */
7416
- preview: string | undefined;
7446
+ previewFile: string | undefined;
7417
7447
  /**
7418
7448
  * @description List of files selected for upload.
7419
7449
  * @summary Contains the files selected by the user for upload. This array is updated
@@ -7421,7 +7451,7 @@ declare class FileUploadComponent extends NgxFormFieldDirective implements OnIni
7421
7451
  *
7422
7452
  * @type {File[]}
7423
7453
  */
7424
- files: File[];
7454
+ files: File[] | KeyValue[];
7425
7455
  /**
7426
7456
  * @description List of errors encountered during file validation.
7427
7457
  * @summary Stores validation errors for files that do not meet the specified criteria,
@@ -7457,6 +7487,7 @@ declare class FileUploadComponent extends NgxFormFieldDirective implements OnIni
7457
7487
  * @returns {void}
7458
7488
  */
7459
7489
  ngOnInit(): void;
7490
+ initialize(): Promise<void>;
7460
7491
  /**
7461
7492
  * @description Lifecycle hook that is called when a directive, pipe, or service is destroyed.
7462
7493
  * @summary Cleans up the component by calling the parent ngOnDestroy method and clearing the file upload state.
@@ -7543,7 +7574,7 @@ declare class FileUploadComponent extends NgxFormFieldDirective implements OnIni
7543
7574
  * @param {File | string} [file] - The file to be previewed. If not provided, the current preview file is used.
7544
7575
  * @returns {Promise<void>}
7545
7576
  */
7546
- showFilePreview(file: File | string, fileExtension?: string): Promise<void>;
7577
+ preview(file: File | string, fileExtension?: string): Promise<void | UIFunctionLike>;
7547
7578
  /**
7548
7579
  * @description Checks if a file is an image based on its MIME type.
7549
7580
  * @summary Determines if the file can be accepted as an image by checking
@@ -7553,6 +7584,7 @@ declare class FileUploadComponent extends NgxFormFieldDirective implements OnIni
7553
7584
  * @returns {boolean} - True if the file is an image, false otherwise.
7554
7585
  */
7555
7586
  isImageFile(file: File): boolean;
7587
+ getFileMime(base64: string): string;
7556
7588
  /**
7557
7589
  * @description Removes a file from the selection.
7558
7590
  * @summary Updates the file list to exclude the file at the specified index.
@@ -7615,7 +7647,7 @@ declare class FileUploadComponent extends NgxFormFieldDirective implements OnIni
7615
7647
  */
7616
7648
  private readFile;
7617
7649
  static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, never>;
7618
- static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "ngx-decaf-file-upload", never, { "formGroup": { "alias": "formGroup"; "required": false; }; "name": { "alias": "name"; "required": false; }; "formControl": { "alias": "formControl"; "required": false; }; "required": { "alias": "required"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "type": { "alias": "type"; "required": false; }; "label": { "alias": "label"; "required": false; }; "buttonLabel": { "alias": "buttonLabel"; "required": false; }; "size": { "alias": "size"; "required": false; }; "position": { "alias": "position"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "showIcon": { "alias": "showIcon"; "required": false; }; "enableDirectoryMode": { "alias": "enableDirectoryMode"; "required": false; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; }; }, { "changeEvent": "changeEvent"; }, never, never, true, never>;
7650
+ static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "ngx-decaf-file-upload", never, { "formGroup": { "alias": "formGroup"; "required": false; }; "name": { "alias": "name"; "required": false; }; "formControl": { "alias": "formControl"; "required": false; }; "required": { "alias": "required"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "type": { "alias": "type"; "required": false; }; "label": { "alias": "label"; "required": false; }; "buttonLabel": { "alias": "buttonLabel"; "required": false; }; "size": { "alias": "size"; "required": false; }; "position": { "alias": "position"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "showIcon": { "alias": "showIcon"; "required": false; }; "enableDirectoryMode": { "alias": "enableDirectoryMode"; "required": false; }; "previewHandler": { "alias": "previewHandler"; "required": false; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; }; }, { "changeEvent": "changeEvent"; }, never, never, true, never>;
7619
7651
  }
7620
7652
 
7621
7653
  declare class ForAngularComponentsModule {
@@ -8529,17 +8561,10 @@ declare class NgxFormService {
8529
8561
  static reset(formGroup: FormGroup | FormControl): void;
8530
8562
  }
8531
8563
 
8532
- /**
8533
- * @module module:lib/engine/NgxEventHandler
8534
- * @description Event handler base class used by Decaf components.
8535
- * @summary Defines NgxEventHandler which standardizes event handling logic and provides
8536
- * logging support for handlers that process custom events emitted by components.
8537
- *
8538
- * @link {@link NgxEventHandler}
8539
- */
8540
-
8541
- declare abstract class NgxEventHandler<PAYLOAD> extends LoggedClass {
8542
- abstract handle(evt: IBaseCustomEvent | CustomEvent<PAYLOAD>): Promise<unknown>;
8564
+ declare abstract class NgxEventHandler extends DecafEventHandler {
8565
+ constructor();
8566
+ refresh(args?: unknown[]): Promise<void>;
8567
+ preview(args?: unknown[]): Promise<void>;
8543
8568
  }
8544
8569
 
8545
8570
  /**
@@ -8732,15 +8757,15 @@ declare abstract class NgxModelPageDirective extends NgxPageDirective {
8732
8757
  */
8733
8758
  allowedOperations: OperationKeys[];
8734
8759
  /**
8735
- * @description Current model data loaded from the repository.
8736
- * @summary Stores the raw data object representing the current model instance retrieved
8737
- * from the repository. This property holds the actual data values for the model being
8738
- * displayed or edited, and is set to undefined when no data is available or when an
8739
- * error occurs during data loading.
8740
- * @type {KeyValue | undefined}
8741
- * @default undefined
8742
- * @memberOf NgxModelPageDirective
8743
- */
8760
+ * @description Current model data loaded from the repository.
8761
+ * @summary Stores the raw data object representing the current model instance retrieved
8762
+ * from the repository. This property holds the actual data values for the model being
8763
+ * displayed or edited, and is set to undefined when no data is available or when an
8764
+ * error occurs during data loading.
8765
+ * @type {KeyValue | undefined}
8766
+ * @default undefined
8767
+ * @memberOf NgxModelPageDirective
8768
+ */
8744
8769
  modelData: KeyValue | undefined;
8745
8770
  /**
8746
8771
  * @description Error message from failed operations.
@@ -8764,7 +8789,7 @@ declare abstract class NgxModelPageDirective extends NgxPageDirective {
8764
8789
  *
8765
8790
  * @throws {InternalError} When the model is not found in the registry
8766
8791
  */
8767
- protected get repository(): DecafRepository<Model> | undefined;
8792
+ get repository(): DecafRepository<Model> | undefined;
8768
8793
  /**
8769
8794
  * @description Angular lifecycle hook for component initialization.
8770
8795
  * @summary Initializes the component by setting up the logger instance using the getLogger
@@ -8786,12 +8811,12 @@ declare abstract class NgxModelPageDirective extends NgxPageDirective {
8786
8811
  * @description Generic event handler for component events.
8787
8812
  * @summary Processes incoming events from child components and routes them to appropriate
8788
8813
  * handlers based on the event name. Currently handles SUBMIT events by delegating to
8789
- * the handleSubmit method. This centralized event handling approach allows for easy
8814
+ * the submit method. This centralized event handling approach allows for easy
8790
8815
  * extension and consistent event processing.
8791
8816
  *
8792
8817
  * @param {IBaseCustomEvent} event - The event object containing event data and metadata
8793
8818
  */
8794
- handleEvent(event: IBaseCustomEvent): Promise<void>;
8819
+ handleEvent(event: IBaseCustomEvent, repository?: DecafRepository<Model>): Promise<void>;
8795
8820
  /**
8796
8821
  * @description Handles form submission events for CRUD operations.
8797
8822
  * @summary Processes form submission by executing the appropriate repository operation
@@ -8803,7 +8828,7 @@ declare abstract class NgxModelPageDirective extends NgxPageDirective {
8803
8828
  * @param {IBaseCustomEvent} event - The submit event containing form data
8804
8829
  * @return {Promise<IModelPageCustomEvent|void>} Promise that resolves on success or throws on error
8805
8830
  */
8806
- handleSubmit(event: IBaseCustomEvent, redirect?: boolean): Promise<IModelPageCustomEvent | void>;
8831
+ submit(event: IBaseCustomEvent, repository?: DecafRepository<Model>, redirect?: boolean): Promise<IModelPageCustomEvent | void>;
8807
8832
  /**
8808
8833
  * @description Retrieves a model instance from the repository by unique identifier.
8809
8834
  * @summary Fetches a specific model instance using the repository's read method.
@@ -8814,7 +8839,7 @@ declare abstract class NgxModelPageDirective extends NgxPageDirective {
8814
8839
  * @param {string} uid - The unique identifier of the model instance to retrieve
8815
8840
  * @return {Promise<Model | undefined>} Promise resolving to the model instance or undefined
8816
8841
  */
8817
- handleGet(uid?: EventIds, repository?: IRepository<Model>, modelName?: string): Promise<Model | undefined>;
8842
+ handleGet(uid?: EventIds, repository?: IRepository<any>, modelName?: string): Promise<Model | undefined>;
8818
8843
  /**
8819
8844
  * @description Parses and transforms form data for repository operations.
8820
8845
  * @summary Converts raw form data into the appropriate format for repository operations.
@@ -9201,7 +9226,7 @@ declare class DecafFakerRepository<T extends Model> {
9201
9226
  constructor(model: string | Model, limit?: number);
9202
9227
  protected get repository(): DecafRepository<Model>;
9203
9228
  initialize(): Promise<void>;
9204
- generateData<T extends Model>(pkValues?: KeyValue, pk?: string, pkType?: string): Promise<T[]>;
9229
+ generateData<T extends Model>(values?: KeyValue, key?: string, keyType?: string): Promise<T[]>;
9205
9230
  }
9206
9231
  declare function getFakerData<T extends Model>(limit: number | undefined, data: Record<string, FunctionLike>, model?: string): T[];
9207
9232
 
@@ -9409,6 +9434,7 @@ declare function provideDynamicComponents(...components: Constructor<unknown>[])
9409
9434
  declare function getModelAndRepository(model: Model | string): {
9410
9435
  repository: DecafRepository<Model>;
9411
9436
  model: Model;
9437
+ pk: string;
9412
9438
  } | undefined;
9413
9439
  /**
9414
9440
  * @description Provides a database adapter for dependency injection.
@@ -9434,7 +9460,7 @@ declare function getModelAndRepository(model: Model | string): {
9434
9460
  */
9435
9461
  declare function provideDbAdapter<DbAdapter extends {
9436
9462
  flavour: string;
9437
- }>(adapterClass: Constructor<DbAdapter>, options?: KeyValue, flavour?: string): Provider;
9463
+ }>(clazz: Constructor<DbAdapter>, options?: KeyValue, flavour?: string): Provider;
9438
9464
  /**
9439
9465
  * @description Retrieves a logger instance for the given context.
9440
9466
  * @summary Creates or retrieves a namespaced logger instance using the Decaf logging system.
@@ -9496,5 +9522,5 @@ declare class ForAngularCommonModule {
9496
9522
  static ɵinj: i0.ɵɵInjectorDeclaration<ForAngularCommonModule>;
9497
9523
  }
9498
9524
 
9499
- export { ActionRoles, AngularEngineKeys, BaseComponentProps, CPTKN, CardComponent, ComponentEventNames, ComponentRendererComponent, ComponentsTagNames, CrudFieldComponent, CrudFormComponent, CssClasses, DB_ADAPTER_PROVIDER, DB_ADAPTER_PROVIDER_TOKEN, DecafFakerRepository, DefaultFormReactiveOptions, DefaultListEmptyOptions, DefaultModalOptions, Dynamic, DynamicModule, ElementPositions, ElementSizes, EmptyStateComponent, FieldsetComponent, FileUploadComponent, FilterComponent, ForAngularCommonModule, ForAngularComponentsModule, FormConstants, I18N_CONFIG_TOKEN, I18nLoader, I18nLoaderFactory, I18nParser, IconComponent, LOCALE_ROOT_TOKEN, LayoutComponent, LayoutGridGaps, ListComponent, ListComponentsTypes, ListItemComponent, ListItemPositions, LoggerLevels, ModalComponent, ModelRendererComponent, NgxComponentDirective, NgxEventHandler, NgxFormDirective, NgxFormFieldDirective, NgxFormService, NgxMediaService, NgxModelPageDirective, NgxPageDirective, NgxParentComponentDirective, NgxRenderingEngine, NgxSvgDirective, PaginationComponent, RouteDirections, SearchbarComponent, SteppedFormComponent, WindowColorSchemes, cleanSpaces, dataMapper, filterString, formatDate, generateRandomValue, getFakerData, getInjectablesRegistry, getLocaleContext, getLocaleContextByKey, getLocaleFromClassName, getLocaleLanguage, getLogger, getModelAndRepository, getNgxModalComponent, getNgxSelectOptionsModal, getOnWindow, getOnWindowDocument, getWindow, getWindowDocument, getWindowWidth, isDarkMode, isDevelopmentMode, isNotUndefined, isValidDate, itemMapper, parseToValidDate, presentNgxLightBoxModal, provideDbAdapter, provideDynamicComponents, provideI18n, provideI18nLoader, removeFocusTrap, setOnWindow, stringToBoolean, windowEventEmitter };
9525
+ export { ActionRoles, AngularEngineKeys, BaseComponentProps, CPTKN, CardComponent, ComponentEventNames, ComponentRendererComponent, ComponentsTagNames, CrudFieldComponent, CrudFormComponent, CssClasses, DB_ADAPTER_PROVIDER, DB_ADAPTER_PROVIDER_TOKEN, DecafFakerRepository, DefaultFormReactiveOptions, DefaultListEmptyOptions, DefaultModalOptions, Dynamic, DynamicModule, ElementPositions, ElementSizes, EmptyStateComponent, FieldsetComponent, FileUploadComponent, FilterComponent, ForAngularCommonModule, ForAngularComponentsModule, FormConstants, I18N_CONFIG_TOKEN, I18nLoader, I18nLoaderFactory, I18nParser, IconComponent, LOCALE_ROOT_TOKEN, LayoutComponent, LayoutGridGaps, ListComponent, ListComponentsTypes, ListItemComponent, ListItemPositions, LoggerLevels, ModalComponent, ModelRendererComponent, NgxComponentDirective, NgxEventHandler, NgxFormDirective, NgxFormFieldDirective, NgxFormService, NgxMediaService, NgxModelPageDirective, NgxPageDirective, NgxParentComponentDirective, NgxRenderingEngine, NgxSvgDirective, PaginationComponent, RouteDirections, SearchbarComponent, SteppedFormComponent, WindowColorSchemes, cleanSpaces, dataMapper, filterString, formatDate, generateRandomValue, getFakerData, getInjectablesRegistry, getLocaleContext, getLocaleContextByKey, getLocaleFromClassName, getLocaleLanguage, getLogger, getModelAndRepository, getNgxModalComponent, getNgxSelectOptionsModal, getOnWindow, getOnWindowDocument, getWindow, getWindowDocument, getWindowWidth, isDarkMode, isDevelopmentMode, isNotUndefined, isValidDate, itemMapper, parseToValidDate, presentNgxInlineModal, presentNgxLightBoxModal, provideDbAdapter, provideDynamicComponents, provideI18n, provideI18nLoader, removeFocusTrap, setOnWindow, stringToBoolean, windowEventEmitter };
9500
9526
  export type { ActionRole, AngularDynamicOutput, AngularFieldDefinition, CheckboxOption, ComponentMetadata, CrudFieldOption, DecafRepository, DecafRepositoryAdapter, ElementPosition, ElementSize, FieldUpdateMode, FlexPosition, FormParent, FormParentGroup, FormServiceControl, FormServiceControls, FunctionLike, HTML5InputType, HTMLFormTarget, I18nResourceConfig, I18nResourceConfigType, I18nToken, IBaseCustomEvent, IComponentConfig, IComponentHolder, IComponentProperties, ICrudFormEvent, ICrudFormOptions, IFieldSetItem, IFieldSetValidationEvent, IFileUploadError, IFilterQuery, IFilterQueryItem, IFormComponentProperties, IFormElement, IFormReactiveSubmitEvent, IListComponentRefreshEvent, IListEmptyOptions, IMenuItem, IModelPageCustomEvent, IPaginationCustomEvent, IRenderedModel, ISortObject, IWindowResizeEvent, InputOption, KeyValue, LayoutGridGap, ListItemCustomEvent, ListItemPosition, PossibleInputTypes, RadioOption, RawQuery, SelectOption, StringOrBoolean, WindowColorScheme };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/for-angular",
3
- "version": "0.0.47",
3
+ "version": "0.0.49",
4
4
  "author": "Tiago Venceslau and Contributors",
5
5
  "license": "MPL-2.0 OR AGPL-3.0",
6
6
  "repository": {