@decaf-ts/for-angular 0.0.25 → 0.0.27

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.
Files changed (78) hide show
  1. package/fesm2022/decaf-ts-for-angular.mjs +1486 -1505
  2. package/fesm2022/decaf-ts-for-angular.mjs.map +1 -1
  3. package/index.d.ts +7482 -3
  4. package/package.json +15 -18
  5. package/components/component-renderer/component-renderer.component.d.ts +0 -278
  6. package/components/crud-field/crud-field.component.d.ts +0 -611
  7. package/components/crud-form/constants.d.ts +0 -5
  8. package/components/crud-form/crud-form.component.d.ts +0 -288
  9. package/components/crud-form/types.d.ts +0 -17
  10. package/components/empty-state/empty-state.component.d.ts +0 -300
  11. package/components/fieldset/fieldset.component.d.ts +0 -555
  12. package/components/filter/filter.component.d.ts +0 -514
  13. package/components/for-angular-components.module.d.ts +0 -20
  14. package/components/index.d.ts +0 -16
  15. package/components/layout/layout.component.d.ts +0 -110
  16. package/components/list/list.component.d.ts +0 -848
  17. package/components/list-item/list-item.component.d.ts +0 -390
  18. package/components/model-renderer/model-renderer.component.d.ts +0 -97
  19. package/components/pagination/constants.d.ts +0 -7
  20. package/components/pagination/pagination.component.d.ts +0 -264
  21. package/components/searchbar/searchbar.component.d.ts +0 -407
  22. package/components/stepped-form/stepped-form.component.d.ts +0 -255
  23. package/directives/collapsable.directive.d.ts +0 -9
  24. package/directives/index.d.ts +0 -1
  25. package/engine/DynamicModule.d.ts +0 -17
  26. package/engine/NgxBaseComponent.d.ts +0 -541
  27. package/engine/NgxCrudFormField.d.ts +0 -123
  28. package/engine/NgxFormService.d.ts +0 -601
  29. package/engine/NgxRenderingEngine.d.ts +0 -282
  30. package/engine/ValidatorFactory.d.ts +0 -15
  31. package/engine/constants.d.ts +0 -168
  32. package/engine/decorators.d.ts +0 -25
  33. package/engine/index.d.ts +0 -18
  34. package/engine/interfaces.d.ts +0 -271
  35. package/engine/types.d.ts +0 -200
  36. package/esm2022/components/component-renderer/component-renderer.component.mjs +0 -321
  37. package/esm2022/components/crud-field/crud-field.component.mjs +0 -518
  38. package/esm2022/components/crud-form/constants.mjs +0 -14
  39. package/esm2022/components/crud-form/crud-form.component.mjs +0 -259
  40. package/esm2022/components/crud-form/types.mjs +0 -2
  41. package/esm2022/components/empty-state/empty-state.component.mjs +0 -345
  42. package/esm2022/components/fieldset/fieldset.component.mjs +0 -677
  43. package/esm2022/components/filter/filter.component.mjs +0 -700
  44. package/esm2022/components/for-angular-components.module.mjs +0 -84
  45. package/esm2022/components/index.mjs +0 -20
  46. package/esm2022/components/layout/layout.component.mjs +0 -150
  47. package/esm2022/components/list/list.component.mjs +0 -1238
  48. package/esm2022/components/list-item/list-item.component.mjs +0 -405
  49. package/esm2022/components/model-renderer/model-renderer.component.mjs +0 -144
  50. package/esm2022/components/pagination/constants.mjs +0 -2
  51. package/esm2022/components/pagination/pagination.component.mjs +0 -321
  52. package/esm2022/components/searchbar/searchbar.component.mjs +0 -491
  53. package/esm2022/components/stepped-form/stepped-form.component.mjs +0 -306
  54. package/esm2022/decaf-ts-for-angular.mjs +0 -5
  55. package/esm2022/directives/collapsable.directive.mjs +0 -29
  56. package/esm2022/directives/index.mjs +0 -2
  57. package/esm2022/engine/DynamicModule.mjs +0 -18
  58. package/esm2022/engine/NgxBaseComponent.mjs +0 -541
  59. package/esm2022/engine/NgxCrudFormField.mjs +0 -137
  60. package/esm2022/engine/NgxFormService.mjs +0 -917
  61. package/esm2022/engine/NgxRenderingEngine.mjs +0 -376
  62. package/esm2022/engine/ValidatorFactory.mjs +0 -106
  63. package/esm2022/engine/constants.mjs +0 -170
  64. package/esm2022/engine/decorators.mjs +0 -38
  65. package/esm2022/engine/index.mjs +0 -19
  66. package/esm2022/engine/interfaces.mjs +0 -4
  67. package/esm2022/engine/types.mjs +0 -2
  68. package/esm2022/for-angular-common.module.mjs +0 -84
  69. package/esm2022/helpers/index.mjs +0 -13
  70. package/esm2022/helpers/utils.mjs +0 -436
  71. package/esm2022/i18n/Loader.mjs +0 -86
  72. package/esm2022/i18n/data/en.json +0 -85
  73. package/esm2022/public-apis.mjs +0 -15
  74. package/for-angular-common.module.d.ts +0 -50
  75. package/helpers/index.d.ts +0 -12
  76. package/helpers/utils.d.ts +0 -279
  77. package/i18n/Loader.d.ts +0 -43
  78. package/public-apis.d.ts +0 -14
@@ -1,848 +0,0 @@
1
- import { OnInit, EventEmitter, OnDestroy } from '@angular/core';
2
- import { InfiniteScrollCustomEvent, RefresherCustomEvent, SpinnerTypes } from '@ionic/angular';
3
- import { OperationKeys } from '@decaf-ts/db-decorators';
4
- import { Model } from '@decaf-ts/decorator-validation';
5
- import { Condition, OrderDirection, Paginator } from '@decaf-ts/core';
6
- import { BaseCustomEvent, RendererCustomEvent, StringOrBoolean, KeyValue, ListItemCustomEvent } from '../../engine';
7
- import { NgxBaseComponent } from '../../engine/NgxBaseComponent';
8
- import { PaginationCustomEvent } from '../pagination/constants';
9
- import { FunctionLike, IFilterQuery, IListEmptyResult, ListComponentsTypes } from '../../engine';
10
- import * as i0 from "@angular/core";
11
- /**
12
- * @description A versatile list component that supports various data display modes.
13
- * @summary This component provides a flexible way to display lists of data with support
14
- * for infinite scrolling, pagination, searching, and custom item rendering. It can fetch
15
- * data from various sources including models, functions, or direct data input.
16
- *
17
- * The component supports two main display types:
18
- * 1. Infinite scrolling - Loads more data as the user scrolls
19
- * 2. Pagination - Displays data in pages with navigation controls
20
- *
21
- * Additional features include:
22
- * - Pull-to-refresh functionality
23
- * - Search filtering
24
- * - Empty state customization
25
- * - Custom item rendering
26
- * - Event emission for interactions
27
- *
28
- * @mermaid
29
- * sequenceDiagram
30
- * participant U as User
31
- * participant L as ListComponent
32
- * participant D as Data Source
33
- * participant E as External Components
34
- *
35
- * U->>L: Initialize component
36
- * L->>L: ngOnInit()
37
- * L->>D: Request initial data
38
- * D-->>L: Return data
39
- * L->>L: Process and display data
40
- *
41
- * alt User scrolls (Infinite mode)
42
- * U->>L: Scroll to bottom
43
- * L->>D: Request more data
44
- * D-->>L: Return additional data
45
- * L->>L: Append to existing data
46
- * else User changes page (Paginated mode)
47
- * U->>L: Click page number
48
- * L->>L: handlePaginate()
49
- * L->>D: Request data for page
50
- * D-->>L: Return page data
51
- * L->>L: Replace displayed data
52
- * end
53
- *
54
- * alt User searches
55
- * U->>L: Enter search term
56
- * L->>L: handleSearch()
57
- * L->>D: Filter data by search term
58
- * D-->>L: Return filtered data
59
- * L->>L: Update displayed data
60
- * end
61
- *
62
- * alt User clicks item
63
- * U->>L: Click list item
64
- * L->>L: handleClick()
65
- * L->>E: Emit clickEvent
66
- * end
67
- *
68
- * @example
69
- * <ngx-decaf-list
70
- * [source]="dataSource"
71
- * [limit]="10"
72
- * [type]="'infinite'"
73
- * [showSearchbar]="true"
74
- * (clickEvent)="handleItemClick($event)"
75
- * (refreshEvent)="handleRefresh($event)">
76
- * </ngx-decaf-list>
77
- *
78
- * @extends {NgxBaseComponent}
79
- * @implements {OnInit}
80
- */
81
- export declare class ListComponent extends NgxBaseComponent implements OnInit, OnDestroy {
82
- /**
83
- * @description The display mode for the list component.
84
- * @summary Determines how the list data is loaded and displayed. Options include:
85
- * - INFINITE: Loads more data as the user scrolls (infinite scrolling)
86
- * - PAGINATED: Displays data in pages with navigation controls
87
- *
88
- * @type {ListComponentsTypes}
89
- * @default ListComponentsTypes.INFINITE
90
- * @memberOf ListComponent
91
- */
92
- type: ListComponentsTypes;
93
- /**
94
- * @description Controls whether the component uses translation services.
95
- * @summary When set to true, the component will attempt to use translation services
96
- * for any text content. This allows for internationalization of the list component.
97
- *
98
- * @type {StringOrBoolean}
99
- * @default true
100
- * @memberOf ListComponent
101
- */
102
- translatable: StringOrBoolean;
103
- /**
104
- * @description Controls the visibility of the search bar.
105
- * @summary When set to true, displays a search bar at the top of the list that allows
106
- * users to filter the list items. The search functionality works by filtering the
107
- * existing data or by triggering a new data fetch with search parameters.
108
- *
109
- * @type {StringOrBoolean}
110
- * @default true
111
- * @memberOf ListComponent
112
- */
113
- showSearchbar: StringOrBoolean;
114
- /**
115
- * @description Direct data input for the list component.
116
- * @summary Provides a way to directly pass data to the list component instead of
117
- * fetching it from a source. When both data and source are provided, the component
118
- * will use the source to fetch data only if the data array is empty.
119
- *
120
- * @type {KeyValue[] | undefined}
121
- * @default undefined
122
- * @memberOf ListComponent
123
- */
124
- data?: KeyValue[] | undefined;
125
- /**
126
- * @description The data source for the list component.
127
- * @summary Specifies where the list should fetch its data from. This can be either:
128
- * - A string URL or endpoint identifier
129
- * - A function that returns data when called
130
- * The component will call this source when it needs to load or refresh data.
131
- *
132
- * @type {string | FunctionLike}
133
- * @required
134
- * @memberOf ListComponent
135
- */
136
- source: string | FunctionLike;
137
- /**
138
- * @description The starting index for data fetching.
139
- * @summary Specifies the index from which to start fetching data. This is used
140
- * for pagination and infinite scrolling to determine which subset of data to load.
141
- *
142
- * @type {number}
143
- * @default 0
144
- * @memberOf ListComponent
145
- */
146
- start: number;
147
- /**
148
- * @description The number of items to fetch per page or load operation.
149
- * @summary Determines how many items are loaded at once during pagination or
150
- * infinite scrolling. This affects the size of data chunks requested from the source.
151
- *
152
- * @type {number}
153
- * @default 10
154
- * @memberOf ListComponent
155
- */
156
- limit: number;
157
- /**
158
- * @description Controls whether more data can be loaded.
159
- * @summary When set to true, the component will allow loading additional data
160
- * through infinite scrolling or pagination. When false, the component will not
161
- * attempt to load more data beyond what is initially displayed.
162
- *
163
- * @type {StringOrBoolean}
164
- * @default true
165
- * @memberOf ListComponent
166
- */
167
- loadMoreData: StringOrBoolean;
168
- /**
169
- * @description The style of dividing lines between list items.
170
- * @summary Determines how dividing lines appear between list items. Options include:
171
- * - "inset": Lines are inset from the edges
172
- * - "full": Lines extend the full width
173
- * - "none": No dividing lines
174
- *
175
- * @type {"inset" | "full" | "none"}
176
- * @default "full"
177
- * @memberOf ListComponent
178
- */
179
- lines: "inset" | "full" | "none";
180
- /**
181
- * @description Controls whether the list has inset styling.
182
- * @summary When set to true, the list will have inset styling with rounded corners
183
- * and margin around the edges. This creates a card-like appearance for the list.
184
- *
185
- * @type {StringOrBoolean}
186
- * @default false
187
- * @memberOf ListComponent
188
- */
189
- inset: StringOrBoolean;
190
- /**
191
- * @description The threshold for triggering infinite scroll loading.
192
- * @summary Specifies how close to the bottom of the list the user must scroll
193
- * before the component triggers loading of additional data. This is expressed
194
- * as a percentage of the list height.
195
- *
196
- * @type {string}
197
- * @default "15%"
198
- * @memberOf ListComponent
199
- */
200
- scrollThreshold: string;
201
- /**
202
- * @description The position where new items are added during infinite scrolling.
203
- * @summary Determines whether new items are added to the top or bottom of the list
204
- * when loading more data through infinite scrolling.
205
- *
206
- * @type {"bottom" | "top"}
207
- * @default "bottom"
208
- * @memberOf ListComponent
209
- */
210
- scrollPosition: "bottom" | "top";
211
- /**
212
- * @description Custom text to display during loading operations.
213
- * @summary Specifies the text shown in the loading indicator when the component
214
- * is fetching data. If not provided, a default loading message will be used.
215
- *
216
- * @type {string | undefined}
217
- * @memberOf ListComponent
218
- */
219
- loadingText?: string;
220
- /**
221
- * @description Controls the visibility of the pull-to-refresh feature.
222
- * @summary When set to true, enables the pull-to-refresh functionality that allows
223
- * users to refresh the list data by pulling down from the top of the list.
224
- *
225
- * @type {StringOrBoolean}
226
- * @default true
227
- * @memberOf ListComponent
228
- */
229
- showRefresher: StringOrBoolean;
230
- /**
231
- * @description The type of spinner to display during loading operations.
232
- * @summary Specifies the visual style of the loading spinner shown during data
233
- * fetching operations. Uses Ionic's predefined spinner types.
234
- *
235
- * @type {SpinnerTypes}
236
- * @default "circular"
237
- * @memberOf ListComponent
238
- */
239
- loadingSpinner: SpinnerTypes;
240
- /**
241
- * @description Controls whether the filtering functionality is enabled.
242
- * @summary When set to true, enables the filter component that allows users to create
243
- * complex search criteria with multiple field filters, conditions, and values.
244
- * When false, disables the filter interface entirely.
245
- *
246
- * @type {StringOrBoolean}
247
- * @default true
248
- * @memberOf ListComponent
249
- */
250
- enableFilter: StringOrBoolean;
251
- /**
252
- * @description Sorting parameters for data fetching.
253
- * @summary Specifies how the fetched data should be sorted. This can be provided
254
- * as a string (field name with optional direction) or a direct object.
255
- *
256
- * @type {string | KeyValue | undefined}
257
- * @memberOf ListComponent
258
- */
259
- sortDirection: OrderDirection;
260
- /**
261
- * @description Sorting parameters for data fetching.
262
- * @summary Specifies how the fetched data should be sorted. This can be provided
263
- * as a string (field name with optional direction) or a direct object.
264
- *
265
- * @type {string | KeyValue | undefined}
266
- * @memberOf ListComponent
267
- */
268
- sortBy: string;
269
- /**
270
- * @description Controls whether sorting functionality is disabled.
271
- * @summary When set to true, disables the sort controls and prevents users from
272
- * changing the sort order or field. The list will maintain its default or
273
- * programmatically set sort configuration without user interaction.
274
- *
275
- * @type {StringOrBoolean}
276
- * @default false
277
- * @memberOf ListComponent
278
- */
279
- disableSort: StringOrBoolean;
280
- /**
281
- * @description Icon to display when the list is empty.
282
- * @summary Specifies the icon shown in the empty state when no data is available.
283
- * This can be any icon name supported by the application's icon system.
284
- *
285
- * @type {string | undefined}
286
- * @default 'ti-database-exclamation'
287
- * @memberOf ListComponent
288
- */
289
- emptyIcon?: string;
290
- /**
291
- * @description Configuration for the empty state display.
292
- * @summary Customizes how the empty state is displayed when no data is available.
293
- * This includes the title, subtitle, button text, icon, and navigation link.
294
- *
295
- * @type {Partial<IListEmptyResult>}
296
- * @default {
297
- * title: 'empty.title',
298
- * subtitle: 'empty.subtitle',
299
- * showButton: false,
300
- * icon: 'alert-circle-outline',
301
- * buttonText: 'locale.empty.button',
302
- * link: ''
303
- * }
304
- * @memberOf ListComponent
305
- */
306
- empty: Partial<IListEmptyResult>;
307
- /**
308
- * @description The current page number in paginated mode.
309
- * @summary Tracks which page is currently being displayed when the component
310
- * is in paginated mode. This is used for pagination controls and data fetching.
311
- *
312
- * @type {number}
313
- * @default 1
314
- * @memberOf ListComponent
315
- */
316
- page: number;
317
- /**
318
- * @description The total number of pages available.
319
- * @summary Stores the calculated total number of pages based on the data size
320
- * and limit. This is used for pagination controls and boundary checking.
321
- *
322
- * @type {number}
323
- * @memberOf ListComponent
324
- */
325
- pages: number;
326
- /**
327
- * @description Indicates whether a refresh operation is in progress.
328
- * @summary When true, the component is currently fetching new data. This is used
329
- * to control loading indicators and prevent duplicate refresh operations from
330
- * being triggered simultaneously.
331
- *
332
- * @type {boolean}
333
- * @default false
334
- * @memberOf ListComponent
335
- */
336
- refreshing: boolean;
337
- /**
338
- * @description Array used for rendering skeleton loading placeholders.
339
- * @summary Contains placeholder items that are displayed during data loading.
340
- * The length of this array determines how many skeleton items are shown.
341
- *
342
- * @type {string[]}
343
- * @default new Array(2)
344
- * @memberOf ListComponent
345
- */
346
- skeletonData: string[];
347
- /**
348
- * @description The processed list items ready for display.
349
- * @summary Stores the current set of items being displayed in the list after
350
- * processing from the raw data source. This may be a subset of the full data
351
- * when using pagination or infinite scrolling.
352
- *
353
- * @type {KeyValue[]}
354
- * @memberOf ListComponent
355
- */
356
- items: KeyValue[];
357
- /**
358
- * @description The current search query value.
359
- * @summary Stores the text entered in the search bar. This is used to filter
360
- * the list data or to send as a search parameter when fetching new data.
361
- *
362
- * @type {string | undefined}
363
- * @memberOf ListComponent
364
- */
365
- searchValue?: string | IFilterQuery | undefined;
366
- /**
367
- * @description A paginator object for handling pagination operations.
368
- * @summary Provides a paginator object that can be used to retrieve and navigate
369
- * through data in chunks, reducing memory usage and improving performance.
370
- *
371
- * The paginator object is initialized in the `ngOnInit` lifecycle hook and is
372
- * used to fetch and display data in the pagination component. It is an instance
373
- * of the `Paginator` class from the `@decaf-ts/core` package, which provides
374
- * methods for querying and manipulating paginated data.
375
- *
376
- * @type {Paginator<Model>}
377
- * @memberOf PaginationComponent
378
- */
379
- paginator: Paginator<Model> | undefined;
380
- /**
381
- * @description The last page number that was displayed.
382
- * @summary Keeps track of the previously displayed page number, which is useful
383
- * for handling navigation and search operations in paginated mode.
384
- *
385
- * @type {number}
386
- * @default 1
387
- * @memberOf ListComponent
388
- */
389
- lastPage: number;
390
- /**
391
- * @description Event emitter for refresh operations.
392
- * @summary Emits an event when the list data is refreshed, either through pull-to-refresh
393
- * or programmatic refresh. The event includes the refreshed data and component information.
394
- *
395
- * @type {EventEmitter<BaseCustomEvent>}
396
- * @memberOf ListComponent
397
- */
398
- refreshEvent: EventEmitter<BaseCustomEvent>;
399
- /**
400
- * @description Event emitter for item click interactions.
401
- * @summary Emits an event when a list item is clicked. The event includes the data
402
- * of the clicked item, allowing parent components to respond to the interaction.
403
- *
404
- * @type {EventEmitter<KeyValue>}
405
- * @memberOf ListComponent
406
- */
407
- clickEvent: EventEmitter<ListItemCustomEvent | RendererCustomEvent>;
408
- /**
409
- * @description Subject for debouncing click events.
410
- * @summary Uses RxJS Subject to collect click events and emit them after a debounce
411
- * period. This prevents multiple rapid clicks from triggering multiple events.
412
- *
413
- * @private
414
- * @type {Subject<CustomEvent | ListItemCustomEvent | RendererCustomEvent>}
415
- * @memberOf ListComponent
416
- */
417
- private clickItemSubject;
418
- /**
419
- * @description Subject for debouncing repository observation events.
420
- * @summary RxJS Subject that collects repository change events and emits them after
421
- * a debounce period. This prevents multiple rapid repository changes from triggering
422
- * multiple list refresh operations, improving performance and user experience.
423
- *
424
- * @private
425
- * @type {Subject<any>}
426
- * @memberOf ListComponent
427
- */
428
- private observerSubjet;
429
- /**
430
- * @description Observer object for repository change notifications.
431
- * @summary Implements the Observer interface to receive notifications when the
432
- * underlying data repository changes. This enables automatic list updates when
433
- * data is created, updated, or deleted through the repository.
434
- *
435
- * @private
436
- * @type {Observer}
437
- * @memberOf ListComponent
438
- */
439
- private observer;
440
- /**
441
- * @description List of available indexes for data querying and filtering.
442
- * @summary Provides a list of index names that can be used to optimize data querying and filtering
443
- * operations, especially in scenarios with large datasets.
444
- *
445
- * Indexes can significantly improve the performance of data retrieval by allowing the database
446
- * to quickly locate and retrieve relevant data based on indexed fields.
447
- *
448
- * @type {string[]}
449
- * @default []
450
- * @memberOf ListComponent
451
- */
452
- indexes: string[];
453
- /**
454
- * @description Initializes a new instance of the ListComponent.
455
- * @summary Creates a new ListComponent and sets up the base component with the appropriate
456
- * component name. This constructor is called when Angular instantiates the component and
457
- * before any input properties are set. It passes the component name to the parent class
458
- * constructor to enable proper localization and component identification.
459
- *
460
- * The constructor is intentionally minimal, with most initialization logic deferred to
461
- * the ngOnInit lifecycle hook. This follows Angular best practices by keeping the constructor
462
- * focused on dependency injection and basic setup, while complex initialization that depends
463
- * on input properties is handled in ngOnInit.
464
- *
465
- * @memberOf ListComponent
466
- */
467
- constructor();
468
- /**
469
- * @description Initializes the component after Angular sets the input properties.
470
- * @summary Sets up the component by initializing event subscriptions, processing boolean
471
- * inputs, and loading the initial data. This method prepares the component for user
472
- * interaction by ensuring all properties are properly initialized and data is loaded.
473
- *
474
- * @returns {Promise<void>}
475
- *
476
- * @mermaid
477
- * sequenceDiagram
478
- * participant A as Angular Lifecycle
479
- * participant L as ListComponent
480
- * participant D as Data Source
481
- *
482
- * A->>L: ngOnInit()
483
- * L->>L: Set up click event debouncing
484
- * L->>L: Process boolean inputs
485
- * L->>L: Configure component based on inputs
486
- * L->>L: refresh()
487
- * L->>D: Request initial data
488
- * D-->>L: Return data
489
- * L->>L: Process and display data
490
- * L->>L: Configure empty state if needed
491
- * L->>L: initialize()
492
- *
493
- * @memberOf ListComponent
494
- */
495
- ngOnInit(): Promise<void>;
496
- /**
497
- * @description Cleans up resources when the component is destroyed.
498
- * @summary Performs cleanup operations when the component is being removed from the DOM.
499
- * This includes clearing references to models and data to prevent memory leaks.
500
- *
501
- * @returns {void}
502
- * @memberOf ListComponent
503
- */
504
- ngOnDestroy(): void;
505
- /**
506
- * @description Handles repository observation events with debouncing.
507
- * @summary Processes repository change notifications and routes them appropriately.
508
- * For CREATE events with a UID, handles them immediately. For other events,
509
- * passes them to the debounced observer subject to prevent excessive updates.
510
- *
511
- * @param {...unknown[]} args - The repository event arguments including table, event type, and UID
512
- * @returns {Promise<void>}
513
- * @memberOf ListComponent
514
- */
515
- observeRepository(...args: unknown[]): Promise<void>;
516
- /**
517
- * @description Handles specific repository events and updates the list accordingly.
518
- * @summary Processes repository change events (CREATE, UPDATE, DELETE) and performs
519
- * the appropriate list operations. This includes adding new items, updating existing
520
- * ones, or removing deleted items from the list display.
521
- *
522
- * @param {string} table - The table/model name that changed
523
- * @param {OperationKeys} event - The type of operation (CREATE, UPDATE, DELETE)
524
- * @param {string | number} uid - The unique identifier of the affected item
525
- * @returns {Promise<void>}
526
- * @memberOf ListComponent
527
- */
528
- handleObserveEvent(table: string, event: OperationKeys, uid: string | number): Promise<void>;
529
- /**
530
- * @description Function for tracking items in the list.
531
- * @summary Provides a tracking function for the `*ngFor` directive in the component template.
532
- * This function is used to identify and control the rendering of items in the list,
533
- * preventing duplicate or unnecessary rendering.
534
- *
535
- * The `trackItemFn` function takes two parameters: `index` (the index of the item in the list)
536
- * and `item` (the actual item from the list). It returns the tracking key, which in this case
537
- * is the union of the `uid` of the item with the model name.
538
- *
539
- * @param {number} index - The index of the item in the list.
540
-
541
- * @param {KeyValue | string | number} item - The actual item from the list.
542
- * @returns {string | number} The tracking key for the item.
543
- * @memberOf ListComponent
544
- */
545
- trackItemFn(index: number, item: KeyValue | string | number): string | number;
546
- /**
547
- * Handles the create event from the repository.
548
- *
549
- * @param {string | number} uid - The ID of the item to create.
550
- * @returns {Promise<void>} A promise that resolves when the item is created and added to the list.
551
- */
552
- handleCreate(uid: string | number): Promise<void>;
553
- /**
554
- * @description Handles the update event from the repository.
555
- * @summary Updates the list item with the specified ID based on the new data.
556
- *
557
- * @param {string | number} uid - The ID of the item to update
558
- * @returns {Promise<void>}
559
- * @private
560
- * @memberOf ListComponent
561
- */
562
- handleUpdate(uid: string | number): Promise<void>;
563
- /**
564
- * @description Removes an item from the list by ID.
565
- * @summary Filters out an item with the specified ID from the data array and
566
- * refreshes the list display. This is typically used after a delete operation.
567
- *
568
- * @param {string} uid - The ID of the item to delete
569
- * @param {string} pk - The primary key field name
570
- * @returns {Promise<void>}
571
- *
572
- * @memberOf ListComponent
573
- */
574
- handleDelete(uid: string | number, pk?: string): void;
575
- /**
576
- * @description Handles click events from list items.
577
- * @summary Listens for global ListItemClickEvent events and passes them to the
578
- * debounced click subject. This allows the component to respond to clicks on
579
- * list items regardless of where they originate from.
580
- *
581
- * @param {ListItemCustomEvent | RendererCustomEvent} event - The click event
582
- * @returns {void}
583
- *
584
- * @memberOf ListComponent
585
- */
586
- handleClick(event: ListItemCustomEvent | RendererCustomEvent): void;
587
- /**
588
- * @description Handles search events from the search bar.
589
- * @summary Processes search queries from the search bar component, updating the
590
- * displayed data based on the search term. The behavior differs between infinite
591
- * and paginated modes to provide the best user experience for each mode.
592
- *
593
- * @param {string | undefined} value - The search term or undefined to clear search
594
- * @returns {Promise<void>}
595
- *
596
- * @mermaid
597
- * flowchart TD
598
- * A[Search Event] --> B{Type is Infinite?}
599
- * B -->|Yes| C[Disable loadMoreData]
600
- * B -->|No| D[Enable loadMoreData]
601
- * C --> E{Search value undefined?}
602
- * E -->|Yes| F[Enable loadMoreData]
603
- * E -->|No| G[Store search value]
604
- * D --> G
605
- * F --> H[Reset page to 1]
606
- * G --> I[Refresh data]
607
- * H --> I
608
- *
609
- * @memberOf ListComponent
610
- */
611
- handleSearch(value: string | IFilterQuery | undefined): Promise<void>;
612
- /**
613
- * @description Handles filter events from the filter component.
614
- * @summary Processes filter queries from the filter component and applies them
615
- * to the list data. This method acts as a bridge between the filter component
616
- * and the search functionality, converting filter queries into search operations.
617
- *
618
- * @param {IFilterQuery | undefined} value - The filter query object or undefined to clear filters
619
- * @returns {Promise<void>}
620
- * @memberOf ListComponent
621
- */
622
- handleFilter(value: IFilterQuery | undefined): Promise<void>;
623
- /**
624
- * @description Clears the current search and resets the list.
625
- * @summary Convenience method that clears the search by calling handleSearch
626
- * with undefined. This resets the list to show all data without filtering.
627
- *
628
- * @returns {Promise<void>}
629
- * @memberOf ListComponent
630
- */
631
- clearSearch(): Promise<void>;
632
- /**
633
- * @description Emits a refresh event with the current data.
634
- * @summary Creates and emits a refresh event containing the current list data.
635
- * This notifies parent components that the list data has been refreshed.
636
- *
637
- * @param {KeyValue[]} [data] - Optional data to include in the event
638
- * @returns {void}
639
- *
640
- * @memberOf ListComponent
641
- */
642
- refreshEventEmit(data?: KeyValue[]): void;
643
- /**
644
- * @description Emits a click event for a list item.
645
- * @summary Processes and emits a click event when a list item is clicked.
646
- * This extracts the relevant data from the event and passes it to parent components.
647
- *
648
- * @private
649
- * @param {ListItemCustomEvent | RendererCustomEvent} event - The click event
650
- * @returns {void}
651
- *
652
- * @memberOf ListComponent
653
- */
654
- private clickEventEmit;
655
- /**
656
- * @description Refreshes the list data from the configured source.
657
- * @summary This method handles both initial data loading and subsequent refresh operations,
658
- * including pull-to-refresh and infinite scrolling. It manages the data fetching process,
659
- * updates the component's state, and handles pagination or infinite scrolling logic based
660
- * on the component's configuration.
661
- *
662
- * The method performs the following steps:
663
- * 1. Sets the refreshing flag to indicate a data fetch is in progress
664
- * 2. Calculates the appropriate start and limit values based on pagination settings
665
- * 3. Fetches data from the appropriate source (model or request)
666
- * 4. Updates the component's data and emits a refresh event
667
- * 5. Handles pagination or infinite scrolling state updates
668
- * 6. Completes any provided event (like InfiniteScrollCustomEvent)
669
- *
670
- * @param {InfiniteScrollCustomEvent | RefresherCustomEvent | boolean} event - The event that triggered the refresh,
671
- * or a boolean flag indicating if this is a forced refresh
672
- * @returns {Promise<void>} A promise that resolves when the refresh operation is complete
673
- *
674
- * @mermaid
675
- * sequenceDiagram
676
- * participant L as ListComponent
677
- * participant D as Data Source
678
- * participant E as Event System
679
- *
680
- * L->>L: refresh(event)
681
- * L->>L: Set refreshing flag
682
- * L->>L: Calculate start and limit
683
- * alt Using model
684
- * L->>D: getFromModel(force, start, limit)
685
- * D-->>L: Return data
686
- * else Using request
687
- * L->>D: getFromRequest(force, start, limit)
688
- * D-->>L: Return data
689
- * end
690
- * L->>E: refreshEventEmit()
691
- * alt Infinite scrolling mode
692
- * L->>L: Check if reached last page
693
- * alt Last page reached
694
- * L->>L: Complete scroll event
695
- * L->>L: Disable loadMoreData
696
- * else More pages available
697
- * L->>L: Increment page number
698
- * L->>L: Complete scroll event after delay
699
- * end
700
- * else Paginated mode
701
- * L->>L: Clear refreshing flag after delay
702
- * end
703
- *
704
- * @memberOf ListComponent
705
- */
706
- refresh(event?: InfiniteScrollCustomEvent | RefresherCustomEvent | boolean): Promise<void>;
707
- /**
708
- * @description Handles pagination events from the pagination component.
709
- * @summary Processes pagination events by updating the current page number and
710
- * refreshing the list data to display the selected page. This method is called
711
- * when a user interacts with the pagination controls to navigate between pages.
712
- *
713
- * @param {PaginationCustomEvent} event - The pagination event containing page information
714
- * @returns {void}
715
- *
716
- * @memberOf ListComponent
717
- */
718
- handlePaginate(event: PaginationCustomEvent): void;
719
- /**
720
- * @description Handles pull-to-refresh events from the refresher component.
721
- * @summary Processes refresh events triggered by the user pulling down on the list
722
- * or by programmatic refresh requests. This method refreshes the list data and
723
- * completes the refresher animation when the data is loaded.
724
- *
725
- * @param {InfiniteScrollCustomEvent | CustomEvent} [event] - The refresh event
726
- * @returns {Promise<void>} A promise that resolves when the refresh operation is complete
727
- *
728
- * @memberOf ListComponent
729
- */
730
- handleRefresh(event?: InfiniteScrollCustomEvent | CustomEvent): Promise<void>;
731
- /**
732
- * @description Filters data based on a search string.
733
- * @summary Processes the current data array to find items that match the provided
734
- * search string. This uses the arrayQueryByString utility to perform the filtering
735
- * across all properties of the items.
736
- *
737
- * @param {KeyValue[]} results - The array of items to search through
738
- * @param {string} search - The search string to filter by
739
- * @returns {KeyValue[]} A promise that resolves to the filtered array of items
740
- *
741
- * @memberOf ListComponent
742
- */
743
- parseSearchResults(results: KeyValue[], search: string): KeyValue[];
744
- /**
745
- * @description Fetches data from a request source.
746
- * @summary Retrieves data from the configured source function or URL, processes it,
747
- * and updates the component's data state. This method handles both initial data loading
748
- * and subsequent refresh operations when using an external data source rather than a model.
749
- *
750
- * @param {boolean} force - Whether to force a refresh even if data already exists
751
- * @param {number} start - The starting index for pagination
752
- * @param {number} limit - The maximum number of items to retrieve
753
- * @returns {Promise<KeyValue[]>} A promise that resolves to the fetched data
754
- *
755
- * @memberOf ListComponent
756
- */
757
- getFromRequest(force: boolean | undefined, start: number, limit: number): Promise<KeyValue[]>;
758
- /**
759
- * @description Fetches data from a model source.
760
- * @summary Retrieves data from the configured model using its pagination or find methods,
761
- * processes it, and updates the component's data state. This method handles both initial
762
- * data loading and subsequent refresh operations when using a model as the data source.
763
- *
764
- * @param {boolean} force - Whether to force a refresh even if data already exists
765
- * @param {number} start - The starting index for pagination
766
- * @param {number} limit - The maximum number of items to retrieve
767
- * @returns {Promise<KeyValue[]>} A promise that resolves to the fetched data
768
- *
769
- * @memberOf ListComponent
770
- */
771
- getFromModel(force?: boolean): Promise<KeyValue[]>;
772
- /**
773
- * @description Converts search values or filter queries into database conditions.
774
- * @summary Transforms search input or complex filter queries into Condition objects
775
- * that can be used for database querying. Handles both simple string/number searches
776
- * across indexed fields and complex filter queries with multiple criteria.
777
- *
778
- * For simple searches (string/number):
779
- * - Creates conditions that search across all indexed fields
780
- * - Uses equality for numeric values and regex for string values
781
- * - Combines conditions with OR logic to search multiple fields
782
- *
783
- * For complex filter queries:
784
- * - Processes each filter item with its specific condition type
785
- * - Supports Equal, Not Equal, Contains, Not Contains, Greater Than, Less Than
786
- * - Updates sort configuration based on the filter query
787
- * - Combines multiple filter conditions with OR logic
788
- *
789
- * @param {string | number | IFilterQuery} value - The search value or filter query object
790
- * @returns {Condition<Model>} A Condition object for database querying
791
- * @memberOf ListComponent
792
- */
793
- parseConditions(value: string | number | IFilterQuery): Condition<Model>;
794
- /**
795
- * @description Processes query results into a standardized format.
796
- * @summary Handles different result formats from various data sources, extracting
797
- * pagination information when available and applying any configured data mapping.
798
- * This ensures consistent data structure regardless of the source.
799
- *
800
- * @protected
801
- * @param {KeyValue[] | Paginator} result - The raw query result
802
- * @returns {KeyValue[]} The processed array of items
803
- *
804
- * @memberOf ListComponent
805
- */
806
- protected parseResult(result: KeyValue[] | Paginator<Model>): Promise<KeyValue[]>;
807
- /**
808
- * @description Updates pagination state based on data length.
809
- * @summary Calculates whether more data is available and how many pages exist
810
- * based on the total number of items and the configured limit per page.
811
- * This information is used to control pagination UI and infinite scrolling behavior.
812
- *
813
- * @param {number} length - The total number of items available
814
- * @returns {void}
815
- *
816
- * @memberOf ListComponent
817
- */
818
- getMoreData(length: number): void;
819
- /**
820
- * @description Maps a single item using the configured mapper.
821
- * @summary Transforms a data item according to the mapping configuration,
822
- * extracting nested properties and formatting values as needed. This allows
823
- * the component to display data in a format different from how it's stored.
824
- *
825
- * @protected
826
- * @param {KeyValue} item - The item to map
827
- * @param {KeyValue} mapper - The mapping configuration
828
- * @param {KeyValue} [props] - Additional properties to include
829
- * @returns {KeyValue} The mapped item
830
- *
831
- * @memberOf ListComponent
832
- */
833
- protected itemMapper(item: KeyValue, mapper: KeyValue, props?: KeyValue): KeyValue;
834
- /**
835
- * @description Maps all result items using the configured mapper.
836
- * @summary Applies the itemMapper to each item in the result set, adding
837
- * common properties like operations and route information. This transforms
838
- * the raw data into the format expected by the list item components.
839
- *
840
- * @param {KeyValue[]} data - The array of items to map
841
- * @returns {KeyValue[]} The array of mapped items
842
- *
843
- * @memberOf ListComponent
844
- */
845
- mapResults(data: KeyValue[]): KeyValue[];
846
- static ɵfac: i0.ɵɵFactoryDeclaration<ListComponent, never>;
847
- static ɵcmp: i0.ɵɵComponentDeclaration<ListComponent, "ngx-decaf-list", never, { "type": { "alias": "type"; "required": false; }; "translatable": { "alias": "translatable"; "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; }; "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; }; "emptyIcon": { "alias": "emptyIcon"; "required": false; }; "empty": { "alias": "empty"; "required": false; }; }, { "refreshEvent": "refreshEvent"; "clickEvent": "clickEvent"; }, never, ["*"], true, never>;
848
- }