ngx-techlify-core 14.13.4 → 14.13.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.
@@ -176,6 +176,8 @@ class TechlifyFormComponentInterface {
176
176
  let TechlifyListingControllerInterface = class TechlifyListingControllerInterface {
177
177
  constructor() {
178
178
  this.models = [];
179
+ this.selectedModelIds = [];
180
+ this.isAllSelected = false;
179
181
  this.page = 1;
180
182
  this.perPage = 25;
181
183
  this.lastPage = 0;
@@ -218,6 +220,33 @@ let TechlifyListingControllerInterface = class TechlifyListingControllerInterfac
218
220
  resetFilter(field) {
219
221
  this.filterForm.get(field).reset('');
220
222
  }
223
+ /**
224
+ * Used for multi select
225
+ * Trigerred when select all is toggled
226
+ */
227
+ selectAll() {
228
+ this.selectedModelIds = [];
229
+ this.models.map((model) => {
230
+ model.is_selected = this.isAllSelected;
231
+ if (this.isAllSelected) {
232
+ this.selectedModelIds.push(model.id);
233
+ }
234
+ });
235
+ this.models = [...this.models];
236
+ }
237
+ /**
238
+ * Used for multi select
239
+ * Trigerred if any entry section is modified
240
+ */
241
+ isSelectionModified(event, model) {
242
+ this.isAllSelected = false;
243
+ if (event.checked) {
244
+ this.selectedModelIds.push(model?.id);
245
+ }
246
+ else {
247
+ this.selectedModelIds = this.selectedModelIds.filter((modelId) => modelId != model?.id);
248
+ }
249
+ }
221
250
  };
222
251
  TechlifyListingControllerInterface = __decorate([
223
252
  UntilDestroy()