@messaia/cdk 22.0.1-rc.19 → 22.0.1-rc.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@messaia/cdk",
3
- "version": "22.0.1-rc.19",
3
+ "version": "22.0.1-rc.21",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.0.7",
6
6
  "@angular/core": "^22.0.7",
@@ -4053,7 +4053,11 @@ declare class Pagination<TModel> {
4053
4053
  }
4054
4054
 
4055
4055
  /**
4056
- * A generic datasource for data-table
4056
+ * @class TableDataSource
4057
+ * @description Provides a server-backed data source with filtering, sorting, pagination,
4058
+ * reloading, and row selection for an Angular Material table.
4059
+ * @template TEntity - The entity type displayed by the table.
4060
+ * @template TService - The service type used to retrieve entities.
4057
4061
  */
4058
4062
  declare class TableDataSource<TEntity, TService extends GenericService<TEntity>> extends DataSource<TEntity> {
4059
4063
  service: TService;
@@ -4061,214 +4065,238 @@ declare class TableDataSource<TEntity, TService extends GenericService<TEntity>>
4061
4065
  sorter?: MatSort | undefined;
4062
4066
  /**
4063
4067
  * @property _filterChange
4064
- * @description Represents a value that changes over time.
4065
- * Observers can subscribe to this BehaviorSubject to receive filter changes.
4068
+ * @description Stores and emits the current free-text filter.
4066
4069
  * @type {BehaviorSubject<string>}
4067
4070
  */
4068
4071
  private _filterChange;
4069
4072
  /**
4070
4073
  * @property _reloadChange
4071
- * @description Represents a value that triggers reload actions.
4072
- * It is used to notify when a reload should occur by emitting a new value.
4074
+ * @description Emits a new token whenever the table data must be reloaded.
4073
4075
  * @type {BehaviorSubject<number>}
4074
4076
  */
4075
4077
  _reloadChange: BehaviorSubject<number>;
4076
4078
  /**
4077
4079
  * @property onDataLoaded
4078
- * @description Event emitted after the data is loaded.
4079
- * It is a BehaviorSubject that holds pagination data or a null value if no data is loaded.
4080
+ * @description Emits the latest pagination response after data loads successfully.
4081
+ * The initial value is `null` until the first response is received.
4080
4082
  * @type {BehaviorSubject<Pagination<TEntity> | any>}
4081
4083
  */
4082
4084
  onDataLoaded: BehaviorSubject<Pagination<TEntity> | any>;
4083
4085
  /**
4084
4086
  * @property selectionModel
4085
- * @description Used to power selecting one or more options from a list.
4087
+ * @description Tracks the entities selected across the table.
4086
4088
  * @type {SelectionModel<TEntity>}
4087
4089
  */
4088
4090
  selectionModel: SelectionModel<TEntity>;
4089
4091
  /**
4090
4092
  * @property filter
4091
- * @description Gets the current filter applied to the data.
4093
+ * @description Gets the current free-text filter.
4092
4094
  * @type {string}
4093
4095
  */
4094
4096
  get filter(): string;
4095
4097
  /**
4096
4098
  * @property filter
4097
- * @description Sets the filter and resets the page index if the paginator exists.
4098
- * @param {string} filter - The filter value to be applied.
4099
+ * @description Sets the free-text filter and returns pagination to the first page.
4100
+ * @param {string} filter - The filter text to apply.
4099
4101
  */
4100
4102
  set filter(filter: string);
4101
4103
  /**
4102
4104
  * @property onSortChange
4103
- * @description Sort change event emitter used to notify changes in sorting.
4105
+ * @description Relays changes emitted by the assigned sort controller.
4104
4106
  * @type {EventEmitter<Sort>}
4105
4107
  */
4106
4108
  private onSortChange;
4107
4109
  /**
4108
4110
  * @property _sort
4109
- * @description Private instance of MatSort used to control the sorting of the table.
4110
- * @type {MatSort | null}
4111
+ * @description Stores the sort controller currently assigned to the data source.
4112
+ * @type {MatSort | undefined}
4111
4113
  */
4112
4114
  private _sort?;
4113
4115
  /**
4114
4116
  * @property sort
4115
- * @description Gets or sets the MatSort instance used to control the sorting of the table.
4116
- * Changes in sorting will trigger an update to the table’s rendered data.
4117
+ * @description Gets or sets the sort controller whose changes reload the table data.
4117
4118
  * @type {MatSort | undefined}
4118
4119
  */
4119
4120
  get sort(): MatSort | undefined;
4120
4121
  set sort(sort: MatSort | undefined);
4121
4122
  /**
4122
4123
  * @property reloadToken
4123
- * @description Gets the current reload token, used to trigger reload events.
4124
+ * @description Gets the token emitted by the most recent reload request.
4124
4125
  * @type {number}
4125
4126
  */
4126
4127
  get reloadToken(): number;
4127
4128
  /**
4128
4129
  * @property isConnected
4129
- * @description Flag indicating whether the data source is connected.
4130
+ * @description Indicates whether a collection viewer is connected to the data source.
4130
4131
  * @type {boolean}
4131
4132
  */
4132
4133
  isConnected: boolean;
4133
4134
  /**
4134
4135
  * @property includes
4135
- * @description The list of navigations to be included in the data query.
4136
+ * @description Lists the related resources to include in each data request.
4136
4137
  * @type {Array<string>}
4137
4138
  */
4138
4139
  includes: Array<string>;
4139
4140
  /**
4140
4141
  * @property path
4141
- * @description The endpoint path for the data source.
4142
+ * @description Specifies the optional service endpoint path used to retrieve data.
4142
4143
  * @type {string | undefined}
4143
4144
  */
4144
4145
  path?: string;
4145
4146
  /**
4146
4147
  * @property projection
4147
- * @description Defines the fields to be included in the data query projection.
4148
+ * @description Specifies the fields requested from the service, either as a comma-separated
4149
+ * string or an array of field names.
4148
4150
  * @type {string | string[]}
4149
4151
  */
4150
4152
  projection: string | string[];
4151
4153
  /**
4152
4154
  * @property items
4153
- * @description The list of items to be displayed in the data table.
4155
+ * @description Contains the entities returned for the current page.
4154
4156
  * @type {TEntity[]}
4155
4157
  */
4156
4158
  items: TEntity[];
4157
4159
  /**
4158
4160
  * @property parameters
4159
- * @description The parameters for pagination and sorting.
4161
+ * @description Contains additional parameters returned by the latest data request.
4160
4162
  * @type {any}
4161
4163
  */
4162
4164
  parameters?: any;
4163
4165
  /**
4164
4166
  * @property facets
4165
- * @description The list of facets for filtering items.
4167
+ * @description Contains the facets returned by the latest data request.
4166
4168
  * @type {Facet[] | undefined}
4167
4169
  */
4168
4170
  facets?: Facet[];
4169
4171
  /**
4170
4172
  * @property fieldFilters
4171
- * @description A set of field filters applied to the data.
4173
+ * @description Contains mutable field filters applied to data requests.
4172
4174
  * @type {any}
4173
4175
  */
4174
4176
  fieldFilters: any;
4175
4177
  /**
4176
4178
  * @property fieldOperators
4177
- * @description A set of field operators used for filtering.
4179
+ * @description Contains operators associated with field-based filtering.
4178
4180
  * @type {any}
4179
4181
  */
4180
4182
  fieldOperators: any;
4181
4183
  /**
4182
4184
  * @property staticFieldFilters
4183
- * @description A set of static field filters applied to the data.
4185
+ * @description Contains persistent field filters applied to every data request.
4184
4186
  * @type {any}
4185
4187
  */
4186
4188
  staticFieldFilters: any;
4187
4189
  /**
4188
4190
  * @property pageIndex
4189
- * @description The current page index for pagination.
4191
+ * @description Stores the zero-based index of the current page.
4190
4192
  * @type {number}
4191
4193
  */
4192
4194
  pageIndex: number;
4193
4195
  /**
4194
4196
  * @property total
4195
- * @description The current total number of items being paged.
4197
+ * @description Stores the total number of entities reported by the service.
4196
4198
  * @type {number}
4197
4199
  */
4198
4200
  total: number;
4199
4201
  /**
4200
4202
  * @property pageSize
4201
- * @description The number of items displayed per page in the data-table.
4202
- * It controls how many records are shown on a single page.
4203
+ * @description Stores the number of entities requested per page.
4203
4204
  * @type {number}
4204
4205
  */
4205
4206
  pageSize: number;
4206
4207
  /**
4207
4208
  * @property pageCount
4208
- * @description The total number of pages based on pagination.
4209
+ * @description Stores the total number of pages reported by the service.
4209
4210
  * @type {number}
4210
4211
  */
4211
4212
  pageCount: number;
4212
4213
  /**
4213
4214
  * @property isLoading
4214
- * @description Flag to show the loading process when the data is being fetched.
4215
+ * @description Indicates whether a data request is currently in progress.
4215
4216
  * @type {boolean}
4216
4217
  */
4217
4218
  isLoading: boolean;
4218
4219
  /**
4219
4220
  * @constructor
4220
- * @description Initializes a new instance of the class and sets up the service, paginator, and sorter.
4221
- * The paginator and sorter are optional parameters used for handling pagination and sorting logic
4222
- * for the data displayed in the table.
4223
- * @param {TService} service - The service used for fetching and managing data.
4224
- * @param {MatPaginator} [paginator] - The paginator instance used for pagination functionality.
4225
- * @param {MatSort} [sorter] - The MatSort instance used for sorting functionality.
4221
+ * @description Creates a data source backed by the supplied service and optional Material
4222
+ * pagination and sorting controllers.
4223
+ * @param {TService} service - The service used to retrieve table data.
4224
+ * @param {MatPaginator} [paginator] - The controller used for server-side pagination.
4225
+ * @param {MatSort} [sorter] - The controller used for server-side sorting.
4226
4226
  */
4227
4227
  constructor(service: TService, paginator?: MatPaginator | undefined, sorter?: MatSort | undefined);
4228
4228
  /**
4229
- * Connects a collection viewer (such as a data-table) to this data source.
4230
- * @param _ The component that exposes a view over the data provided by this
4231
- * data source.
4232
- * @returns Observable that emits a new value when the data changes.
4229
+ * @method connect
4230
+ * @description Connects a collection viewer and reloads server data when sorting,
4231
+ * pagination, filtering, or the reload token changes.
4232
+ * @param {CollectionViewer} [_] - The viewer that consumes the emitted entities.
4233
+ * @returns {Observable<TEntity[]>} An observable that emits the current page of entities.
4233
4234
  */
4234
4235
  connect(_?: CollectionViewer): Observable<TEntity[]>;
4235
4236
  /**
4236
- * Disconnects a collection viewer (such as a data-table) from this data source. Can be used
4237
- * to perform any clean-up or tear-down operations when a view is being destroyed.
4238
- *
4239
- * @param _ The component that exposes a view over the data provided by this
4240
- * data source.
4237
+ * @method disconnect
4238
+ * @description Marks the data source as disconnected from its collection viewer.
4239
+ * @param {CollectionViewer} _ - The viewer that no longer consumes this data source.
4240
+ * @returns {void}
4241
4241
  */
4242
4242
  disconnect(_: CollectionViewer): void;
4243
4243
  /**
4244
- * Reloads items
4245
- * @param clearSelection
4244
+ * @method reload
4245
+ * @description Requests fresh data and optionally clears the current row selection.
4246
+ * @param {boolean} [clearSelection=true] - Whether to clear selected entities.
4247
+ * @returns {void}
4246
4248
  */
4247
4249
  reload(clearSelection?: boolean): void;
4248
4250
  /**
4249
- * Clears field filters
4251
+ * @method applyFilters
4252
+ * @description Replaces the mutable field filters and requests fresh data.
4253
+ * @param {any} [newFilters={}] - The field filters to apply.
4254
+ * @returns {void}
4250
4255
  */
4251
4256
  applyFilters(newFilters?: any): void;
4252
4257
  /**
4253
- * Clears field filters
4258
+ * @method clearFilters
4259
+ * @description Resets mutable field filters to the supplied object, or to an empty object
4260
+ * when no replacement is supplied, and requests fresh data.
4261
+ * @param {any} [newFilters={}] - Optional field filters retained after the reset.
4262
+ * @returns {void}
4254
4263
  */
4255
4264
  clearFilters(newFilters?: any): void;
4256
4265
  /**
4257
- * Checks, whether all items are selected
4266
+ * @method isAllSelected
4267
+ * @description Determines whether the selected entity count matches the total entity count.
4268
+ * An empty selection is never considered complete.
4269
+ * @returns {boolean} `true` when every reported entity is selected; otherwise, `false`.
4258
4270
  */
4259
4271
  isAllSelected(): boolean;
4260
4272
  /**
4261
- * Toggles selected items
4262
- * @param checkbox
4263
- * @param predicate
4273
+ * @method toggleSelect
4274
+ * @description Clears an existing selection or selects each unlocked entity on the current
4275
+ * page that satisfies the optional predicate.
4276
+ * @param {MatCheckboxChange} checkbox - The select-all checkbox change event.
4277
+ * @param {(value: TEntity, index: number, array: TEntity[]) => unknown} [predicate] - Optional
4278
+ * condition used to choose selectable entities.
4279
+ * @returns {void}
4264
4280
  */
4265
4281
  toggleSelect(checkbox: MatCheckboxChange, predicate?: (value: TEntity, index: number, array: TEntity[]) => unknown): void;
4266
4282
  /**
4267
- * Get selected Items
4283
+ * @property getSelected
4284
+ * @description Maps selected entities to the values stored under the specified property key.
4285
+ * @template TType - The expected property value type.
4286
+ * @param {string} key - The entity property key to read.
4287
+ * @returns {TType[]} The selected property values.
4268
4288
  */
4269
4289
  getSelected: <TType>(key: string) => TType[];
4270
4290
  /**
4271
- * Get selected Items
4291
+ * @property getSelectedItems
4292
+ * @description Gets all currently selected entities.
4293
+ * @returns {TEntity[]} The selected entities.
4294
+ */
4295
+ getSelectedItems: () => TEntity[];
4296
+ /**
4297
+ * @property getSelectedIds
4298
+ * @description Gets the numeric identifiers of all selected entities.
4299
+ * @returns {number[]} The selected entity identifiers.
4272
4300
  */
4273
4301
  getSelectedIds: () => number[];
4274
4302
  }
@@ -6387,7 +6415,7 @@ declare abstract class GenericFormBaseComponent<TEntity extends IEntity, TServic
6387
6415
  * Emitted when the form has been fully initialized
6388
6416
  * and is ready to be accessed or modified.
6389
6417
  */
6390
- formInitialized: EventEmitter<FormGroup<any> | NgForm>;
6418
+ formInitialized: EventEmitter<NgForm | FormGroup<any>>;
6391
6419
  /**
6392
6420
  * The current date.
6393
6421
  */