@mediusinc/mng-commons 5.3.0-rc.3 → 5.3.0-rc.5

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 (76) hide show
  1. package/core/data-list/data-list.model.d.ts +1 -1
  2. package/core/data-providers/lookup.data-provider.d.ts +5 -5
  3. package/core/descriptors/lookup.descriptor.d.ts +3 -3
  4. package/core/descriptors/table.descriptor.d.ts +1 -1
  5. package/esm2022/core/data-list/data-list-params-helpers.mjs +1 -1
  6. package/esm2022/core/data-list/data-list.model.mjs +1 -1
  7. package/esm2022/core/data-providers/lookup.data-provider.mjs +1 -1
  8. package/esm2022/core/descriptors/lookup.descriptor.mjs +1 -1
  9. package/esm2022/core/descriptors/table.descriptor.mjs +1 -1
  10. package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +60 -2
  11. package/esm2022/filter/descriptors/filter.descriptor.mjs +118 -8
  12. package/esm2022/form/api/data-providers/lookup-data-provider.factory.mjs +17 -6
  13. package/esm2022/form/api/data-providers/lookup.data-provider.mjs +1 -1
  14. package/esm2022/form/components/autocomplete/autocomplete.component.mjs +1 -1
  15. package/esm2022/form/components/dropdown/dropdown.component.mjs +1 -1
  16. package/esm2022/model/helpers/model.mjs +1 -1
  17. package/esm2022/table/api/data-providers/table-data-provider.factory.mjs +16 -7
  18. package/esm2022/table/api/descriptors/column.descriptor.mjs +125 -4
  19. package/esm2022/table/api/descriptors/sort.descriptor.mjs +23 -1
  20. package/esm2022/table/api/descriptors/table-descriptor.factory.mjs +1 -1
  21. package/esm2022/table/api/descriptors/table.descriptor.mjs +424 -43
  22. package/esm2022/table/api/helpers/table-data-provider-descriptor-convert.mjs +7 -0
  23. package/esm2022/table/api/index.mjs +2 -1
  24. package/esm2022/table/api/models/table-columns.model.mjs +1 -1
  25. package/esm2022/table/components/table/table.component.mjs +4 -4
  26. package/esm2022/tableview/api/editor/descriptors/editor.descriptor.mjs +6 -6
  27. package/esm2022/tableview/api/editor/descriptors/field-base.descriptor.mjs +2 -2
  28. package/esm2022/tableview/api/editor/descriptors/field-lookup.descriptor.mjs +1 -1
  29. package/esm2022/tableview/api/index.mjs +2 -1
  30. package/esm2022/tableview/api/tableview/data-providers/tableview-data-provider.factory.mjs +16 -7
  31. package/esm2022/tableview/api/tableview/descriptors/tableview-descriptor.factory.mjs +1 -1
  32. package/esm2022/tableview/api/tableview/descriptors/tableview.descriptor.mjs +5 -5
  33. package/esm2022/tableview/api/tableview/helpers/tableview-data-provider-descriptor-convert.mjs +7 -0
  34. package/esm2022/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +1 -1
  35. package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
  36. package/fesm2022/mediusinc-mng-commons-filter.mjs +176 -8
  37. package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
  38. package/fesm2022/mediusinc-mng-commons-form-api.mjs +16 -5
  39. package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
  40. package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
  41. package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
  42. package/fesm2022/mediusinc-mng-commons-table-api.mjs +591 -52
  43. package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
  44. package/fesm2022/mediusinc-mng-commons-table.mjs +3 -3
  45. package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
  46. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +32 -17
  47. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
  48. package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
  49. package/filter/descriptors/filter-lookup.descriptor.d.ts +70 -12
  50. package/filter/descriptors/filter.descriptor.d.ts +116 -5
  51. package/form/api/data-providers/lookup-data-provider.factory.d.ts +16 -12
  52. package/form/api/data-providers/lookup.data-provider.d.ts +5 -5
  53. package/form/components/autocomplete/autocomplete.component.d.ts +1 -1
  54. package/form/components/dropdown/dropdown.component.d.ts +1 -1
  55. package/model/helpers/model.d.ts +1 -1
  56. package/package.json +1 -1
  57. package/table/api/data-providers/table-data-provider.factory.d.ts +9 -5
  58. package/table/api/descriptors/column.descriptor.d.ts +126 -5
  59. package/table/api/descriptors/sort.descriptor.d.ts +22 -0
  60. package/table/api/descriptors/table-descriptor.factory.d.ts +8 -4
  61. package/table/api/descriptors/table.descriptor.d.ts +421 -27
  62. package/table/api/helpers/table-data-provider-descriptor-convert.d.ts +20 -0
  63. package/table/api/index.d.ts +1 -0
  64. package/table/api/models/table-columns.model.d.ts +6 -6
  65. package/table/components/column-filter/column-filter.component.d.ts +1 -1
  66. package/table/components/filter/filter-form/filter-form.component.d.ts +1 -1
  67. package/tableview/action/components/localization/data-language-dropdown.component.d.ts +1 -1
  68. package/tableview/api/editor/descriptors/editor.descriptor.d.ts +11 -11
  69. package/tableview/api/editor/descriptors/field-base.descriptor.d.ts +1 -1
  70. package/tableview/api/editor/descriptors/field-lookup.descriptor.d.ts +12 -12
  71. package/tableview/api/index.d.ts +1 -0
  72. package/tableview/api/tableview/data-providers/tableview-data-provider.factory.d.ts +9 -5
  73. package/tableview/api/tableview/descriptors/tableview-descriptor.factory.d.ts +10 -6
  74. package/tableview/api/tableview/descriptors/tableview.descriptor.d.ts +17 -17
  75. package/tableview/api/tableview/helpers/tableview-data-provider-descriptor-convert.d.ts +20 -0
  76. package/version-info.json +6 -6
@@ -32,8 +32,6 @@ export declare class TableDescriptorInst<TableModel, Sorts = keyof TableModel, F
32
32
  private _headerClassName?;
33
33
  private _rowClassName?;
34
34
  private _rowClassNameMapFn?;
35
- private _tableFullHeightOffset?;
36
- private _rowHeight?;
37
35
  private _filters;
38
36
  private _sorts;
39
37
  private _isLocalized;
@@ -59,8 +57,6 @@ export declare class TableDescriptorInst<TableModel, Sorts = keyof TableModel, F
59
57
  get model(): ModelDescriptor<TableModel, import("@mediusinc/mng-commons/core").ClassOptType<TableModel>>;
60
58
  get className(): string;
61
59
  get size(): TableSizeEnum;
62
- get tableFullHeightOffset(): number | undefined;
63
- get rowHeight(): number | undefined;
64
60
  get hasHover(): boolean;
65
61
  get hasGridlines(): boolean;
66
62
  get hasResizableColumns(): boolean;
@@ -84,92 +80,490 @@ export declare class TableDescriptorInst<TableModel, Sorts = keyof TableModel, F
84
80
  */
85
81
  get rowExpandableComponentType(): Type<IRowExpandableComponent<TableModel>> | undefined;
86
82
  /**
87
- * Track property is used for the purpose of combined saving user preferences in localstorage if 2 tables have the same track properties they will share the same localstorage entry.
83
+ * Identifier is used for the purpose of combined saving user preferences in localstorage if 2 tables have the same track properties they will share the same localstorage entry.
88
84
  * Similarly, this property can also be used to differentiate two tables of the same model on the same url (so that they have separate entries in localstorage).
89
85
  * @param identifier
90
86
  */
91
87
  withIdentifier(identifier: string): this;
88
+ /**
89
+ * Sets the track property (identifier of table row) for the table.
90
+ *
91
+ * @param {keyof TableModel} property - The property to track the row items by.
92
+ */
92
93
  withTrackProperty(property?: keyof TableModel): this;
94
+ /**
95
+ * Sets the track property (identifier of table row) for the table.
96
+ *
97
+ * This function is UNSAFE!
98
+ *
99
+ * @param {string} property - The property to set '_trackProperty' to.
100
+ */
93
101
  withTrackPropertyUnsafe(property?: string): this;
94
- getColumn(property: keyof TableModel): ColumnDescriptor<any, TableModel, any> | null;
95
- getColumnUnsafe(property: string): ColumnDescriptor<any, TableModel, any> | null;
102
+ /**
103
+ * Retrieves the column descriptor for the given property.
104
+ *
105
+ * @param {keyof TableModel} property - The property for column descriptor.
106
+ *
107
+ * @return The column descriptor.
108
+ */
109
+ getColumn<Property extends keyof TableModel, ColumnModel = NonNullable<TableModel[Property]>, ColumnValue = TableModel[Property]>(property: Property): ColumnDescriptor<ColumnModel, TableModel, ColumnValue> | null;
110
+ /**
111
+ * Retrieves the column descriptor for the given property.
112
+ *
113
+ * This function is UNSAFE!
114
+ *
115
+ * @param {keyof TableModel} property - The property for column descriptor.
116
+ *
117
+ * @return The column descriptor.
118
+ */
119
+ getColumnUnsafe<ColumnModel = any, ColumnValue = ColumnModel>(property: string): ColumnDescriptor<ColumnModel, TableModel, ColumnValue> | null;
120
+ /**
121
+ * Removes the column descriptor for the given property.
122
+ *
123
+ * @param {keyof TableModel} property - The property for column descriptor.
124
+ */
96
125
  removeColumn(property: keyof TableModel): void;
126
+ /**
127
+ * Removes the column descriptor for the given property.
128
+ *
129
+ * This function is UNSAFE!
130
+ *
131
+ * @param {keyof TableModel} property - The property for column descriptor.
132
+ */
97
133
  removeColumnUnsafe(property: string): void;
134
+ /**
135
+ * Adds column descriptor to table columns.
136
+ *
137
+ * @param {ColumnDescriptor<ColumnModel, TableModel, ColumnValue>} column - The property for column descriptor.
138
+ */
98
139
  withColumn<ColumnModel, ColumnValue = ColumnModel>(column: ColumnDescriptor<ColumnModel, TableModel, ColumnValue>): this;
140
+ /**
141
+ * Adds a column to the table.
142
+ *
143
+ * @param {PropertyKey} property - The property key of the column in the table model.
144
+ *
145
+ * @returns The newly added column descriptor.
146
+ */
99
147
  addColumn<PropertyKey extends keyof TableModel>(property: PropertyKey): ColumnDescriptor<NonNullable<TableModel[PropertyKey]>, TableModel, TableModel[PropertyKey]>;
148
+ /**
149
+ * Adds a column with enum display to the table.
150
+ *
151
+ * @param {PropertyKey} property - The property key of the table model.
152
+ * @param {EnumDescriptor<Enum>} enumDesc - The enum descriptor for column display.
153
+ * @return {ColumnDescriptor<Enum, TableModel, TableModel[PropertyKey]>} - The added column descriptor.
154
+ */
100
155
  addColumnEnum<PropertyKey extends keyof TableModel, Enum extends NonNullable<TableModel[PropertyKey]>>(property: PropertyKey, enumDesc: EnumDescriptor<Enum>): ColumnDescriptor<Enum, TableModel, TableModel[PropertyKey]>;
156
+ /**
157
+ * Adds a column to the table.
158
+ *
159
+ * This function is UNSAFE!
160
+ *
161
+ * @param {string} property - The property key of the column in the table model.
162
+ *
163
+ * @returns The newly added column descriptor.
164
+ */
101
165
  addColumnUnsafe<ColumnModel = unknown>(property: string): ColumnDescriptor<ColumnModel, TableModel>;
166
+ /**
167
+ * Adds one or more columns to the table model.
168
+ *
169
+ * @param properties - An array of property names to add as columns.
170
+ */
102
171
  withColumns(...properties: (keyof TableModel)[]): this;
103
- withColumnDescriptors(...descriptors: ColumnDescriptor<any, TableModel>[]): this;
172
+ /**
173
+ * Set the pagination mode for the table.
174
+ *
175
+ * @param {TablePaginationModeEnum} paginationMode - The pagination mode to set. Must be one of the values from the TablePaginationModeEnum.
176
+ */
104
177
  withPaginationMode(paginationMode: TablePaginationModeEnum): this;
178
+ /**
179
+ * Sets the number of rows per page for a paginated display.
180
+ *
181
+ * @param {number} rows - The default number of rows to display per page.
182
+ * @param {Array<number>} [options] - Rows per page options to be available in table paginator.
183
+ */
105
184
  withRowsPerPage(rows: number, options?: Array<number>): this;
106
- withTitle(title: string | undefined): this;
185
+ /**
186
+ * Sets the title for an instance of the class.
187
+ *
188
+ * @param {string} [title] - The title value to be set. It undefiend, no title will be displayed.
189
+ */
190
+ withTitle(title?: string): this;
191
+ /**
192
+ * Shows/hides the header row with column titles.
193
+ *
194
+ * @param {boolean} hideHeader - A boolean value indicating whether to hide the header.
195
+ */
107
196
  withHideHeader(hideHeader?: boolean): this;
108
- withLoading(text?: string, icon?: string | null): this;
109
197
  /**
110
- * Helper method that enables/disables reorderable property on all columns currently in the descriptor.
111
- * @param columnsReorderable
198
+ * Adjusts loading display with custom text and/or icon.
199
+ *
200
+ * @param {string} [text] - Text to be displayed when loading indicator is shown.
201
+ * @param {string | null} [icon] - Icon to be used when loading indicator is shown.
112
202
  */
113
- withCurrentColumnsReorderable(columnsReorderable?: boolean): this;
203
+ withLoading(text?: string, icon?: string | null): this;
114
204
  /**
115
- * Helper method that enables/disables toggleable property on all columns currently in the descriptor.
116
- * @param columnsToggleable
205
+ * Retrieves the sort descriptor for a given property.
206
+ *
207
+ * @param {Sorts} property - The property to retrieve the sort for.
208
+ *
209
+ * @return {SortDescriptor<TableModel> | null} The sort descriptor or null.
117
210
  */
118
- withCurrentColumnsToggleable(columnsToggleable?: boolean): this;
119
211
  getSort(property: Sorts): SortDescriptor<TableModel> | null;
212
+ /**
213
+ * Retrieves the sort descriptor for a given property.
214
+ *
215
+ * This function is UNSAFE!
216
+ *
217
+ * @param {Sorts} property - The property to retrieve the sort for.
218
+ *
219
+ * @return {SortDescriptor<TableModel> | null} The sort descriptor or null.
220
+ */
120
221
  getSortUnsafe(property: string): SortDescriptor<TableModel> | null;
222
+ /**
223
+ * Removes the sort for a given property.
224
+ *
225
+ * @param {Sorts} property - The property to remove the sort for.
226
+ */
121
227
  removeSort(property: Sorts): void;
228
+ /**
229
+ * Removes the sort for a given property.
230
+ *
231
+ * This function is UNSAFE!
232
+ *
233
+ * @param {Sorts} property - The property to remove the sort for.
234
+ */
122
235
  removeSortUnsafe(property: string): void;
236
+ /**
237
+ * Adds sort for the given property.
238
+ *
239
+ * @param property Property to add the sort for.
240
+ * @param isDefault If default sorting is enabled.
241
+ * @param ascending If default sort should be ascending.
242
+ *
243
+ * @return Created sort descriptor.
244
+ */
123
245
  addSort(property: Sorts, isDefault?: boolean, ascending?: boolean): SortDescriptor<TableModel>;
246
+ /**
247
+ * Adds sort for the given property.
248
+ *
249
+ * This function is UNSAFE!
250
+ *
251
+ * @param property Property to add the sort for.
252
+ * @param isDefault If default sorting is enabled.
253
+ * @param ascending If default sort should be ascending.
254
+
255
+ * @return Created sort descriptor.
256
+ */
124
257
  addSortUnsafe(property: string, isDefault?: boolean, ascending?: boolean): SortDescriptor<TableModel>;
258
+ /**
259
+ * Adds sort for the given property.
260
+ *
261
+ * @param property Property to add the sort for.
262
+ * @param isDefault If default sorting is enabled.
263
+ * @param ascending If default sort should be ascending.
264
+ */
125
265
  withSort(property: Sorts, isDefault?: boolean, ascending?: boolean): this;
266
+ /**
267
+ * Adds sort for the given property.
268
+ *
269
+ * This function is UNSAFE!
270
+ *
271
+ * @param property Property to add the sort for.
272
+ * @param isDefault If default sorting is enabled.
273
+ * @param ascending If default sort should be ascending.
274
+ */
126
275
  withSortUnsafe(property: string, isDefault?: boolean, ascending?: boolean): this;
276
+ /**
277
+ * Sets the default sorting for the property.
278
+ *
279
+ * @param property - The property to set default sort for.
280
+ * @param ascending - If the sorting should be ascending (default: true).
281
+ * @param order - The order for this default sort (default: 0).
282
+ * @param enabled - Enables/disabled the default sort.
283
+ */
127
284
  withDefaultSort(property: Sorts, ascending?: boolean, order?: number, enabled?: boolean): this;
285
+ /**
286
+ * Sets the default sorting for the property.
287
+ *
288
+ * This function is UNSAFE!
289
+ *
290
+ * @param property - The property to set default sort for.
291
+ * @param ascending - If the sorting should be ascending (default: true).
292
+ * @param order - The order for this default sort (default: 0).
293
+ * @param enabled - Enables/disabled the default sort.
294
+ */
128
295
  withDefaultSortUnsafe(property: string, ascending?: boolean, order?: number, enabled?: boolean): this;
296
+ /**
297
+ * Add sorts for more properties.
298
+ *
299
+ * @param properties Properties to add the sorts for.
300
+ */
129
301
  withSorts(...properties: Sorts[]): this;
302
+ /**
303
+ * Add sorts for more properties.
304
+ *
305
+ * This function is UNSAFE!
306
+ *
307
+ * @param properties Properties to add the sorts for.
308
+ */
130
309
  withSortsUnsafe(...properties: string[]): this;
131
- getFilter(property: Filters): FilterDescriptor<any, TableModel> | null;
132
- getFilterUnsafe(property: string): FilterDescriptor<any, TableModel> | null;
310
+ /**
311
+ * Gets filter descriptor for given property.
312
+ *
313
+ * @param property Filter property
314
+ *
315
+ * @return Filter descriptor for property or null if not exists.
316
+ */
317
+ getFilter<FilterModel = Filters extends keyof TableModel ? NonNullable<TableModel[Filters]> : any>(property: Filters): FilterDescriptor<FilterModel, TableModel> | null;
318
+ /**
319
+ * Gets filter descriptor for given property.
320
+ *
321
+ * This function is UNSAFE!
322
+ *
323
+ * @param property Filter property
324
+ *
325
+ * @return Filter descriptor for property or null if not exists.
326
+ */
327
+ getFilterUnsafe<FilterModel = any>(property: string): FilterDescriptor<FilterModel, TableModel> | null;
328
+ /**
329
+ * Removes filter descriptor for given property.
330
+ *
331
+ * @param property Filter property
332
+ */
133
333
  removeFilter(property: Filters): void;
334
+ /**
335
+ * Removes filter descriptor for given property.
336
+ *
337
+ * This function is UNSAFE!
338
+ *
339
+ * @param property Filter property
340
+ */
134
341
  removeFilterUnsafe(property: string): void;
342
+ /**
343
+ * Creates filter descriptor for the given property.
344
+ *
345
+ * @param property Filter property.
346
+ *
347
+ * @return Created filter descriptor.
348
+ */
135
349
  addFilter<FilterModel = Filters extends keyof TableModel ? TableModel[Filters] : never>(property: Filters): FilterDescriptor<FilterModel, TableModel>;
350
+ /**
351
+ * Creates filter descriptor for the given property.
352
+ *
353
+ * This function is UNSAFE!
354
+ *
355
+ * @param property Filter property.
356
+ *
357
+ * @return Created filter descriptor.
358
+ */
136
359
  addFilterUnsafe<FilterModel>(property: string): FilterDescriptor<FilterModel, TableModel>;
360
+ /**
361
+ * Creates filter lookup descriptor for the given property.
362
+ *
363
+ * @param property Filter property.
364
+ * @param provider Lookup provider.
365
+ * @param optionsValueProperty Property on lookup provider's item (FilterModel) that will be used as filter value.
366
+ *
367
+ * @return Created filter lookup descriptor.
368
+ */
137
369
  addFilterLookup<FilterModel = Filters extends keyof TableModel ? NonNullable<TableModel[Filters]> : never, Service = undefined>(property: Filters, provider?: ILookupDataProvider<FilterModel, Service>, optionsValueProperty?: keyof FilterModel): FilterLookupDescriptor<FilterModel, TableModel, Service>;
370
+ /**
371
+ * Creates filter lookup descriptor for the given property.
372
+ *
373
+ * This function is UNSAFE!
374
+ *
375
+ * @param property Filter property.
376
+ * @param provider Lookup provider.
377
+ * @param optionsValueProperty Property on lookup provider's item (FilterModel) that will be used as filter value.
378
+ *
379
+ * @return Created filter lookup descriptor.
380
+ */
138
381
  addFilterLookupUnsafe<FilterModel, Service = undefined>(property: string, provider?: ILookupDataProvider<FilterModel, Service>, optionsValueProperty?: string): FilterLookupDescriptor<FilterModel, TableModel, Service>;
382
+ /**
383
+ * Creates filter lookup enum descriptor for the given property.
384
+ *
385
+ * @param property Filter property.
386
+ * @param enumDesc Descriptor for enum.
387
+ * @param options Optional options of enum values to be available to filter by.
388
+ *
389
+ * @return Created filter lookup enum descriptor.
390
+ */
139
391
  addFilterLookupEnum<Enum>(property: Filters, enumDesc: EnumDescriptor<Enum>, options?: Array<Enum>): FilterLookupEnumDescriptor<Enum, unknown>;
392
+ /**
393
+ * Creates filter lookup enum descriptor for the given property.
394
+ *
395
+ * This function is UNSAFE!
396
+ *
397
+ * @param property Filter property.
398
+ * @param enumDesc Descriptor for enum.
399
+ * @param options Optional options of enum values to be available to filter by.
400
+ *
401
+ * @return Created filter lookup enum descriptor.
402
+ */
140
403
  addFilterLookupEnumUnsafe<Enum = EnumConstantType>(property: string, enumDesc: EnumDescriptor<Enum>, options?: Array<Enum>): FilterLookupEnumDescriptor<Enum, unknown>;
141
- addFilterFromColumn(property: Extract<Filters, keyof TableModel>, displayType?: FilterDisplayTypeEnum, forceSimple?: boolean): FilterDescriptor<any, TableModel>;
404
+ /**
405
+ * Creates filter descriptor from column. The column must exist on table descriptor.
406
+ *
407
+ * @param property Column property to add filter for.
408
+ * @param displayType Optional display type setting.
409
+ * @param forceSimple Forces simple creation of filter (no lookup or lookup enum filters).
410
+ *
411
+ * @throws {CommonsInternalError} If column for property doesn't exist.
412
+ *
413
+ * @return Created filter descriptor
414
+ */
415
+ addFilterFromColumn<Property extends keyof TableModel, FilterModel = NonNullable<TableModel[Property]>>(property: Extract<Filters, Property>, displayType?: FilterDisplayTypeEnum, forceSimple?: boolean): FilterDescriptor<FilterModel, TableModel>;
416
+ /**
417
+ * Creates filter descriptors from columns. The columns must exist on table descriptor.
418
+ *
419
+ * @param properties Column properties to add filters for.
420
+ *
421
+ * @throws {CommonsInternalError} If column for property doesn't exist.
422
+ */
142
423
  withFiltersFromColumns(...properties: Extract<Filters, keyof TableModel>[]): this;
424
+ /**
425
+ * Creates filter descriptors from columns. The columns must exist on table descriptor.
426
+ *
427
+ * This function is UNSAFE!
428
+ *
429
+ * @param properties Column properties to add filters for.
430
+ *
431
+ * @throws {CommonsInternalError} If column for property doesn't exist.
432
+ */
143
433
  withFiltersFromColumnsUnsafe(...properties: string[]): this;
144
- addFilterFromColumnUnsafe(property: string, displayType?: FilterDisplayTypeEnum, forceSimple?: boolean): FilterDescriptor<any, TableModel>;
145
- addFilterFromColumnDescriptorUnsafe<ColumnModel, ColumnValue>(column: ColumnDescriptor<ColumnModel, TableModel, ColumnValue>, forceSimple?: boolean): FilterDescriptor<any, TableModel>;
434
+ /**
435
+ * Creates filter descriptor from column. The column must exist on table descriptor.
436
+ *
437
+ * This function is UNSAFE!
438
+ *
439
+ * @param property Column property to add filter for.
440
+ * @param displayType Optional display type setting.
441
+ * @param forceSimple Forces simple creation of filter (no lookup or lookup enum filters).
442
+ *
443
+ * @throws {CommonsInternalError} If column for property doesn't exist.
444
+ *
445
+ * @return Created filter descriptor
446
+ */
447
+ addFilterFromColumnUnsafe<FilterModel = any>(property: string, displayType?: FilterDisplayTypeEnum, forceSimple?: boolean): FilterDescriptor<FilterModel, TableModel>;
448
+ /**
449
+ * Creates filter descriptor from provided column descriptor.
450
+ *
451
+ * This function is UNSAFE!
452
+ *
453
+ * @param column Column descriptor.
454
+ * @param forceSimple Forces simple creation of filter (no lookup or lookup enum filters).
455
+ *
456
+ * @throws {CommonsInternalError} If column for property doesn't exist.
457
+ *
458
+ * @return Created filter descriptor
459
+ */
460
+ addFilterFromColumnDescriptorUnsafe<FilterModel>(column: ColumnDescriptor<FilterModel, TableModel, any>, forceSimple?: boolean): FilterDescriptor<FilterModel, TableModel>;
461
+ /**
462
+ * Adds filter descriptor for the given property.
463
+ *
464
+ * @param property Filter property.
465
+ * @param filter Descriptor for property.
466
+ */
146
467
  withFilter<FilterModel>(property: Filters, filter: FilterDescriptor<FilterModel, TableModel>): this;
468
+ /**
469
+ * Adds filter descriptor for the given property.
470
+ *
471
+ * This function is UNSAFE!
472
+ *
473
+ * @param filter Descriptor for property.
474
+ */
147
475
  withFilterUnsafe<FilterModel>(filter: FilterDescriptor<FilterModel, TableModel>): this;
476
+ /**
477
+ * Sets classes for table component.
478
+ *
479
+ * @param className Class names.
480
+ */
148
481
  withClassName(className: string): this;
482
+ /**
483
+ * Sets table sizing.
484
+ *
485
+ * @param size Table size.
486
+ */
149
487
  withSize(size?: TableSizeEnum): this;
150
- withTableFullHeightOffset(tableFullHeightOffset: number): this;
151
- withRowHeight(rowHeight: number): this;
152
- withHover(hover: boolean): this;
153
- withGridlines(gridlines: boolean): this;
154
488
  /**
155
- * Method that enables/disabled column resize feature with columnResizeMode on all columns.
489
+ * Enables hover effect on table rows.
490
+ *
491
+ * @param hover Enables/disables the hover.
492
+ */
493
+ withHover(hover?: boolean): this;
494
+ /**
495
+ * Enables gridlines on table.
496
+ *
497
+ * @param gridlines Enables/disables the gridlines.
498
+ */
499
+ withGridlines(gridlines?: boolean): this;
500
+ /**
501
+ * Enables/disables reorderable property on all columns currently in the descriptor.
502
+ *
503
+ * @param {boolean} [columnsReorderable] - Boolean flag to set reordering on columns to.
504
+ */
505
+ withCurrentColumnsReorderable(columnsReorderable?: boolean): this;
506
+ /**
507
+ * Enables/disables toggleable property on all columns currently in the descriptor.
508
+ *
509
+ * @param {boolean} [columnsToggleable] - Boolean flag to set toggleable on columns to.
510
+ */
511
+ withCurrentColumnsToggleable(columnsToggleable?: boolean): this;
512
+ /**
513
+ * Enables/disabled column resize feature with columnResizeMode on all columns.
514
+ *
156
515
  * @param resizableColumns True if enabled
157
516
  * @param columnResizeMode 'fit' or 'expand' mode
158
517
  */
159
518
  withColumnsResizable(resizableColumns?: boolean, columnResizeMode?: 'fit' | 'expand'): this;
160
519
  /**
161
520
  * Sets column to (un)frozen.
521
+ *
162
522
  * @param selectionColumnFrozen True to freeze selection column, false to unfreeze it.
163
523
  * @param actionColumnFrozen True to freeze action column, false to unfreeze it.
164
524
  */
165
525
  withColumnFrozen(selectionColumnFrozen?: boolean, actionColumnFrozen?: boolean): this;
526
+ /**
527
+ * Sets the class name for rows in the table.
528
+ *
529
+ * @param {string} rowClassName - The CSS class name to be applied to each row.
530
+ * @param {function} [classNameMapFn] - Optional function to map the class name dynamically based on row's item and current class name.
531
+ */
166
532
  withRowClassName(rowClassName?: string, classNameMapFn?: (className?: string, item?: TableModel) => string): this;
533
+ /**
534
+ * Sets header row class name.
535
+ *
536
+ * @param headerClassName Class name.
537
+ */
167
538
  withHeaderClassName(headerClassName: string): this;
539
+ /**
540
+ * Enables localization of the table.
541
+ */
168
542
  withLocalized(): this;
169
- withLocalizationLocaleProperty(localizationLocaleProperty: string): this;
543
+ /**
544
+ * Sets locale property for localization.
545
+ *
546
+ * @param property Locale property
547
+ */
548
+ withLocalizationLocaleProperty(property: string): this;
549
+ /**
550
+ * Enables row expanding.
551
+ *
552
+ * @param property Property to check if row can be expanded.
553
+ * @param colSpan set custom row span for expanded row.
554
+ * @param componentType Component to be displayed on row expand.
555
+ */
170
556
  withRowExpandable(property?: keyof TableModel, colSpan?: number, componentType?: Type<IRowExpandableComponent<TableModel>>): this;
557
+ /**
558
+ * Enables row reordering.
559
+ *
560
+ * @param reordable Enables/disables feature.
561
+ */
171
562
  withRowReorderable(reordable?: boolean): this;
172
563
  protected copyFieldsTo(obj: TableDescriptorInst<any, any, any>): void;
564
+ /**
565
+ * Copies current descriptor to a new instance.
566
+ */
173
567
  copy(): TableDescriptorInst<TableModel, Sorts, Filters>;
174
568
  }
175
569
  export declare class TableDynamicDescriptorInst extends TableDescriptorInst<any> {
@@ -0,0 +1,20 @@
1
+ import { ServiceClassType } from '@mediusinc/mng-commons/core';
2
+ import { TableDataProviderInst } from '../data-providers/table.data-provider';
3
+ import { TableDescriptorInst } from '../descriptors/table.descriptor';
4
+ /**
5
+ * Creates a data provider for from descriptor. DO NOT use if the model is class, because the type (from model descriptor) will not be set in data provider.
6
+ *
7
+ * @param {TableDescriptorInst<Model, Sorts, Filters>} descriptor - The table descriptor.
8
+ *
9
+ * @return {TableDataProviderInst<Model, undefined, Sorts, Filters, undefined, undefined>} - The data provider for the table component.
10
+ */
11
+ export declare function tableToDataProvider<Model, Sorts = keyof Model, Filters extends keyof any = keyof Model>(descriptor: TableDescriptorInst<Model, Sorts, Filters>): TableDataProviderInst<Model, undefined, Sorts, Filters, undefined, undefined>;
12
+ /**
13
+ * Creates a data provider for from descriptor. DO NOT use if the model is class, because the type (from model descriptor) will not be set in data provider.
14
+ *
15
+ * @param {TableDescriptorInst<Model, Sorts, Filters>} descriptor - The table descriptor.
16
+ * @param {ServiceClassType<Service>} serviceClass - The service class type.
17
+ *
18
+ * @return {TableDataProviderInst<Model, Service, Sorts, Filters, undefined, ServiceClassType<Service>>} - The data provider for the table component.
19
+ */
20
+ export declare function tableToDataProvider<Model, Service = any, Sorts = keyof Model, Filters extends keyof any = keyof Model>(descriptor: TableDescriptorInst<Model, Sorts, Filters>, serviceClass: ServiceClassType<Service>): TableDataProviderInst<Model, Service, Sorts, Filters, undefined, ServiceClassType<Service>>;
@@ -5,6 +5,7 @@ export * from './descriptors/sort.descriptor';
5
5
  export * from './descriptors/table.descriptor';
6
6
  export * from './descriptors/table-descriptor.factory';
7
7
  export * from './helpers/class-attribute-converter';
8
+ export * from './helpers/table-data-provider-descriptor-convert';
8
9
  export * from './helpers/table-descriptor-helpers';
9
10
  export * from './models/class-table-attribute.model';
10
11
  export * from './models/column.model';
@@ -4,8 +4,8 @@ import { EnumDescriptor } from '@mediusinc/mng-commons/model';
4
4
  import { ColumnDescriptor } from '../descriptors/column.descriptor';
5
5
  import { SortDescriptor } from '../descriptors/sort.descriptor';
6
6
  export interface IColumnsManageInterface<TableModel, Sorts, Filters> {
7
- getColumn(property: keyof TableModel): ColumnDescriptor<any, TableModel> | null;
8
- getColumnUnsafe(property: string): ColumnDescriptor<any, TableModel> | null;
7
+ getColumn<Property extends keyof TableModel, ColumnModel = NonNullable<TableModel[Property]>, ColumnValue = TableModel[Property]>(property: Property): ColumnDescriptor<ColumnModel, TableModel, ColumnValue> | null;
8
+ getColumnUnsafe<ColumnModel = any, ColumnValue = ColumnModel>(property: string): ColumnDescriptor<ColumnModel, TableModel, ColumnValue> | null;
9
9
  removeColumn(property: keyof TableModel): void;
10
10
  removeColumnUnsafe(property: string): void;
11
11
  withColumn<ColumnModel, ColumnValue = ColumnModel>(column: ColumnDescriptor<ColumnModel, TableModel, ColumnValue>): this;
@@ -23,8 +23,8 @@ export interface IColumnsManageInterface<TableModel, Sorts, Filters> {
23
23
  withSortUnsafe(property: string, isDefault: boolean, ascending?: boolean): this;
24
24
  withSorts(...properties: Sorts[]): this;
25
25
  withSortsUnsafe(...properties: string[]): this;
26
- getFilter(property: Filters): FilterDescriptor<any, TableModel> | null;
27
- getFilterUnsafe(property: string): FilterDescriptor<any, TableModel> | null;
26
+ getFilter<FilterModel = Filters extends keyof TableModel ? NonNullable<TableModel[Filters]> : any>(property: Filters): FilterDescriptor<FilterModel, TableModel> | null;
27
+ getFilterUnsafe<FilterModel = any>(property: string): FilterDescriptor<FilterModel, TableModel> | null;
28
28
  removeFilter(property: Filters): void;
29
29
  removeFilterUnsafe(property: string): void;
30
30
  addFilter<FilterModel = Filters extends keyof TableModel ? TableModel[Filters] : never>(property: Filters): FilterDescriptor<FilterModel, TableModel>;
@@ -33,8 +33,8 @@ export interface IColumnsManageInterface<TableModel, Sorts, Filters> {
33
33
  addFilterLookupUnsafe<FilterModel, Service = undefined>(property: string, provider?: ILookupDataProvider<FilterModel, Service>, optionsValueProperty?: string): FilterLookupDescriptor<FilterModel, TableModel, Service>;
34
34
  addFilterLookupEnum<Enum>(property: Filters, enumDesc: EnumDescriptor<any>, options?: Array<Enum>): FilterLookupEnumDescriptor<Enum, TableModel>;
35
35
  addFilterLookupEnumUnsafe<Enum = EnumConstantType>(property: string, enumDesc: EnumDescriptor<Enum>, options?: Array<Enum>): FilterLookupEnumDescriptor<Enum, TableModel>;
36
- addFilterFromColumn(property: Extract<Filters, keyof TableModel>, displayType?: FilterDisplayTypeEnum, forceSimple?: boolean): FilterDescriptor<any, TableModel>;
37
- addFilterFromColumnUnsafe(property: string, displayType?: FilterDisplayTypeEnum, forceSimple?: boolean): FilterDescriptor<any, TableModel>;
36
+ addFilterFromColumn<Property extends keyof TableModel, FilterModel = NonNullable<TableModel[Property]>>(property: Extract<Filters, Property>, displayType?: FilterDisplayTypeEnum, forceSimple?: boolean): FilterDescriptor<FilterModel, TableModel>;
37
+ addFilterFromColumnUnsafe<FilterModel = any>(property: string, displayType?: FilterDisplayTypeEnum, forceSimple?: boolean): FilterDescriptor<FilterModel, TableModel>;
38
38
  withFiltersFromColumns(...properties: Extract<Filters, keyof TableModel>[]): this;
39
39
  withFiltersFromColumnsUnsafe(...properties: string[]): this;
40
40
  withFilter<FilterModel>(property: Filters, filter: FilterDescriptor<FilterModel, TableModel>): this;
@@ -22,7 +22,7 @@ export declare class TableColumnFilterComponent implements OnDestroy {
22
22
  private readonly destroyRef;
23
23
  private readonly document;
24
24
  descriptor: import("@angular/core").InputSignal<FilterDescriptor<any, any>>;
25
- descriptorAsLookup: import("@angular/core").Signal<FilterLookupDescriptor<any, any, any> | undefined>;
25
+ descriptorAsLookup: import("@angular/core").Signal<FilterLookupDescriptor<any, any, any, string | number | symbol, string | number | symbol> | undefined>;
26
26
  private icon;
27
27
  private translationObserver;
28
28
  matchModes: import("@angular/core").Signal<import("primeng/api").SelectItem<any>[]>;
@@ -28,7 +28,7 @@ export declare class FilterFormComponent {
28
28
  disabled: boolean;
29
29
  }[]>;
30
30
  selectedDescriptor: import("@angular/core").Signal<FilterDescriptor<any, any> | undefined>;
31
- selectedDescriptorAsLookup: import("@angular/core").Signal<FilterLookupDescriptor<any, any, any> | undefined>;
31
+ selectedDescriptorAsLookup: import("@angular/core").Signal<FilterLookupDescriptor<any, any, any, string | number | symbol, string | number | symbol> | undefined>;
32
32
  matchModeOptions: import("@angular/core").Signal<SelectItem<any>[]>;
33
33
  isEdit: import("@angular/core").Signal<boolean>;
34
34
  formSubmitted: import("@angular/core").WritableSignal<boolean>;
@@ -12,7 +12,7 @@ export declare class DataLanguageDropdownComponent<T = any> implements IActionCo
12
12
  enabled: import("@angular/core").InputSignal<boolean>;
13
13
  loading: import("@angular/core").InputSignal<boolean>;
14
14
  trigger: import("@angular/core").OutputEmitterRef<ActionParameters<T>>;
15
- selectionItemsDataProvider: import("@angular/core").Signal<LookupDataProviderInst<string, any, import("@mediusinc/mng-commons/core").ClassOptType<string>, import("@mediusinc/mng-commons/core").ServiceClassOptType<any>>>;
15
+ selectionItemsDataProvider: import("@angular/core").Signal<LookupDataProviderInst<string, any, number | typeof Symbol.iterator | "length" | "toString" | "concat" | "slice" | "indexOf" | "lastIndexOf" | "includes" | "at" | "valueOf" | "charAt" | "charCodeAt" | "localeCompare" | "match" | "replace" | "search" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" | "codePointAt" | "endsWith" | "normalize" | "repeat" | "startsWith" | "anchor" | "big" | "blink" | "bold" | "fixed" | "fontcolor" | "fontsize" | "italics" | "link" | "small" | "strike" | "sub" | "sup" | "padStart" | "padEnd" | "trimEnd" | "trimStart" | "trimLeft" | "trimRight" | "matchAll" | "replaceAll", number | typeof Symbol.iterator | "length" | "toString" | "concat" | "slice" | "indexOf" | "lastIndexOf" | "includes" | "at" | "valueOf" | "charAt" | "charCodeAt" | "localeCompare" | "match" | "replace" | "search" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" | "codePointAt" | "endsWith" | "normalize" | "repeat" | "startsWith" | "anchor" | "big" | "blink" | "bold" | "fixed" | "fontcolor" | "fontsize" | "italics" | "link" | "small" | "strike" | "sub" | "sup" | "padStart" | "padEnd" | "trimEnd" | "trimStart" | "trimLeft" | "trimRight" | "matchAll" | "replaceAll", import("@mediusinc/mng-commons/core").ClassOptType<string>, import("@mediusinc/mng-commons/core").ServiceClassOptType<any>>>;
16
16
  updateDataLocale(dataLang: string): void;
17
17
  static ɵfac: i0.ɵɵFactoryDeclaration<DataLanguageDropdownComponent<any>, never>;
18
18
  static ɵcmp: i0.ɵɵComponentDeclaration<DataLanguageDropdownComponent<any>, "mng-data-language-dropdown", never, { "action": { "alias": "action"; "required": true; "isSignal": true; }; "actionData": { "alias": "actionData"; "required": true; "isSignal": true; }; "item": { "alias": "item"; "required": true; "isSignal": true; }; "itemId": { "alias": "itemId"; "required": true; "isSignal": true; }; "enabled": { "alias": "enabled"; "required": true; "isSignal": true; }; "loading": { "alias": "loading"; "required": true; "isSignal": true; }; }, { "trigger": "trigger"; }, never, never, true, never>;