ngx-techlify-core 14.13.4 → 14.13.6

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;
@@ -195,6 +197,7 @@ let TechlifyListingControllerInterface = class TechlifyListingControllerInterfac
195
197
  */
196
198
  reload() {
197
199
  this.models = [];
200
+ this.selectedModelIds = [];
198
201
  this.page = 1;
199
202
  if (!this.isWorking) {
200
203
  this.loadData();
@@ -218,6 +221,33 @@ let TechlifyListingControllerInterface = class TechlifyListingControllerInterfac
218
221
  resetFilter(field) {
219
222
  this.filterForm.get(field).reset('');
220
223
  }
224
+ /**
225
+ * Used for multi select
226
+ * Trigerred when select all is toggled
227
+ */
228
+ selectAll() {
229
+ this.selectedModelIds = [];
230
+ this.models.map((model) => {
231
+ model.is_selected = this.isAllSelected;
232
+ if (this.isAllSelected) {
233
+ this.selectedModelIds.push(model.id);
234
+ }
235
+ });
236
+ this.models = [...this.models];
237
+ }
238
+ /**
239
+ * Used for multi select
240
+ * Trigerred if any entry section is modified
241
+ */
242
+ isSelectionModified(event, model) {
243
+ this.isAllSelected = false;
244
+ if (event.checked) {
245
+ this.selectedModelIds.push(model?.id);
246
+ }
247
+ else {
248
+ this.selectedModelIds = this.selectedModelIds.filter((modelId) => modelId != model?.id);
249
+ }
250
+ }
221
251
  };
222
252
  TechlifyListingControllerInterface = __decorate([
223
253
  UntilDestroy()