@smartsoft001/crud-shell-angular 1.1.692 → 1.1.693

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.
@@ -2200,25 +2200,30 @@
2200
2200
  this.baseInstance.listOptions = this.listOptions;
2201
2201
  };
2202
2202
  ListComponent.prototype.ngOnInit = function () {
2203
- var _a, _b;
2203
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2204
2204
  return __awaiter(this, void 0, void 0, function () {
2205
- var newFilter, endButtons, compiledComponents, _f, _g;
2205
+ var newFilter, endButtons, compiledComponents, _j, _k;
2206
2206
  var _this = this;
2207
- return __generator(this, function (_h) {
2208
- switch (_h.label) {
2207
+ return __generator(this, function (_l) {
2208
+ switch (_l.label) {
2209
2209
  case 0: return [4 /*yield*/, this.pageService.checkPermissions()];
2210
2210
  case 1:
2211
- _h.sent();
2211
+ _l.sent();
2212
2212
  newFilter = null;
2213
2213
  if (((_a = this.config.list) === null || _a === void 0 ? void 0 : _a.resetQuery) === 'beforeInit') {
2214
2214
  newFilter = Object.assign({ query: this.config.baseQuery ? __spreadArray([], __read(this.config.baseQuery)) : [], paginationMode: this.config.list.paginationMode, limit: this.config.pagination ? this.config.pagination.limit : null, offset: this.config.pagination ? 0 : null, sortBy: this.config.sort ? this.config.sort["default"] : null, sortDesc: this.config.sort ? this.config.sort["defaultDesc"] : null }, this.searchService.filter);
2215
2215
  }
2216
- else {
2216
+ else if (this.filter) {
2217
2217
  newFilter = this.filter;
2218
2218
  }
2219
- if (!this.searchService.filter || !___namespace.isEqual(newFilter, this.filter)) {
2220
- this.facade.read(newFilter);
2219
+ else {
2220
+ newFilter = Object.assign({ paginationMode: this.config.list.paginationMode, limit: ((_b = this.searchService.filter) === null || _b === void 0 ? void 0 : _b.limit) ? this.searchService.filter.limit : this.config.pagination
2221
+ ? this.config.pagination.limit : null, offset: ((_c = this.searchService.filter) === null || _c === void 0 ? void 0 : _c.offset) || ((_d = this.searchService.filter) === null || _d === void 0 ? void 0 : _d.offset) === 0
2222
+ ? this.searchService.filter.offset : this.config.pagination ? 0 : null, sortBy: ((_e = this.searchService.filter) === null || _e === void 0 ? void 0 : _e.sortBy) ? this.searchService.filter.sortBy : this.config.sort
2223
+ ? this.config.sort["default"] : null, sortDesc: ((_f = this.searchService.filter) === null || _f === void 0 ? void 0 : _f.sortDesc) ? this.searchService.filter.sortDesc : this.config.sort
2224
+ ? this.config.sort["defaultDesc"] : null, query: ((_g = this.searchService.filter) === null || _g === void 0 ? void 0 : _g.query) ? this.searchService.filter : [] }, this.searchService.filter);
2221
2225
  }
2226
+ this.facade.read(newFilter);
2222
2227
  endButtons = this.getEndButtons();
2223
2228
  this.pageOptions = {
2224
2229
  title: this.config.title,
@@ -2249,17 +2254,17 @@
2249
2254
  : []))),
2250
2255
  })];
2251
2256
  case 2:
2252
- compiledComponents = _h.sent();
2253
- _f = this;
2254
- _g = {
2257
+ compiledComponents = _l.sent();
2258
+ _j = this;
2259
+ _k = {
2255
2260
  provider: {
2256
2261
  getData: function (filter) {
2257
2262
  var global = Object.assign(Object.assign({}, _this.filter), filter);
2258
2263
  _this.facade.read(global);
2259
2264
  },
2260
2265
  onChangeMultiSelected: function (list) { return __awaiter(_this, void 0, void 0, function () {
2261
- return __generator(this, function (_f) {
2262
- switch (_f.label) {
2266
+ return __generator(this, function (_j) {
2267
+ switch (_j.label) {
2263
2268
  case 0:
2264
2269
  if (!(list.length && !this.menuService.openedEnd)) return [3 /*break*/, 2];
2265
2270
  return [4 /*yield*/, this.menuService.openEnd({
@@ -2267,14 +2272,14 @@
2267
2272
  component: MultiselectComponent,
2268
2273
  })];
2269
2274
  case 1:
2270
- _f.sent();
2275
+ _j.sent();
2271
2276
  return [3 /*break*/, 4];
2272
2277
  case 2:
2273
2278
  if (!(!list.length && this.menuService.openedEnd)) return [3 /*break*/, 4];
2274
2279
  return [4 /*yield*/, this.menuService.closeEnd()];
2275
2280
  case 3:
2276
- _f.sent();
2277
- _f.label = 4;
2281
+ _j.sent();
2282
+ _j.label = 4;
2278
2283
  case 4:
2279
2284
  this.facade.multiSelect(list);
2280
2285
  return [2 /*return*/];
@@ -2285,7 +2290,7 @@
2285
2290
  loading$: this.facade.loaded$.pipe(operators.map(function (l) { return !l; })),
2286
2291
  },
2287
2292
  cellPipe: this.config.list ? this.config.list.cellPipe : null,
2288
- mode: (_b = this.config.list) === null || _b === void 0 ? void 0 : _b.mode,
2293
+ mode: (_h = this.config.list) === null || _h === void 0 ? void 0 : _h.mode,
2289
2294
  type: this.config.type,
2290
2295
  details: this.config.details
2291
2296
  ? {
@@ -2341,9 +2346,9 @@
2341
2346
  },
2342
2347
  })];
2343
2348
  case 3:
2344
- _f.listOptions = (_g.pagination = _h.sent(),
2345
- _g.sort = this.config.sort,
2346
- _g);
2349
+ _j.listOptions = (_k.pagination = _l.sent(),
2350
+ _k.sort = this.config.sort,
2351
+ _k);
2347
2352
  this.cd.detectChanges();
2348
2353
  this.initCloseMenu();
2349
2354
  this.initTopComponent(compiledComponents);
@@ -2356,11 +2361,11 @@
2356
2361
  ListComponent.prototype.initCloseMenu = function () {
2357
2362
  var _this = this;
2358
2363
  this.router.events.pipe(this.takeUntilDestroy).subscribe(function () { return __awaiter(_this, void 0, void 0, function () {
2359
- return __generator(this, function (_f) {
2360
- switch (_f.label) {
2364
+ return __generator(this, function (_j) {
2365
+ switch (_j.label) {
2361
2366
  case 0: return [4 /*yield*/, this.clear()];
2362
2367
  case 1:
2363
- _f.sent();
2368
+ _j.sent();
2364
2369
  return [2 /*return*/];
2365
2370
  }
2366
2371
  });
@@ -2368,11 +2373,11 @@
2368
2373
  };
2369
2374
  ListComponent.prototype.clear = function () {
2370
2375
  return __awaiter(this, void 0, void 0, function () {
2371
- return __generator(this, function (_f) {
2372
- switch (_f.label) {
2376
+ return __generator(this, function (_j) {
2377
+ switch (_j.label) {
2373
2378
  case 0: return [4 /*yield*/, this.menuService.closeEnd()];
2374
2379
  case 1:
2375
- _f.sent();
2380
+ _j.sent();
2376
2381
  this.listOptions = Object.assign(Object.assign({}, this.listOptions), { select: null });
2377
2382
  this.facade.multiSelect([]);
2378
2383
  return [2 /*return*/];
@@ -2397,16 +2402,16 @@
2397
2402
  icon: "checkbox-outline",
2398
2403
  text: "multi",
2399
2404
  handler: function () { return __awaiter(_this, void 0, void 0, function () {
2400
- return __generator(this, function (_f) {
2401
- switch (_f.label) {
2405
+ return __generator(this, function (_j) {
2406
+ switch (_j.label) {
2402
2407
  case 0:
2403
2408
  this.listOptions = Object.assign(Object.assign({}, this.listOptions), { select: this.listOptions.select === "multi" ? null : "multi" });
2404
2409
  this.facade.multiSelect([]);
2405
2410
  if (!this.menuService.openedEnd) return [3 /*break*/, 2];
2406
2411
  return [4 /*yield*/, this.menuService.closeEnd()];
2407
2412
  case 1:
2408
- _f.sent();
2409
- _f.label = 2;
2413
+ _j.sent();
2414
+ _j.label = 2;
2410
2415
  case 2:
2411
2416
  this.cd.detectChanges();
2412
2417
  return [2 /*return*/];
@@ -2421,14 +2426,14 @@
2421
2426
  icon: "filter-outline",
2422
2427
  text: "filters",
2423
2428
  handler: function () { return __awaiter(_this, void 0, void 0, function () {
2424
- return __generator(this, function (_f) {
2425
- switch (_f.label) {
2429
+ return __generator(this, function (_j) {
2430
+ switch (_j.label) {
2426
2431
  case 0: return [4 /*yield*/, this.menuService.openEnd({
2427
2432
  injector: this.injector,
2428
2433
  component: FiltersComponent,
2429
2434
  })];
2430
2435
  case 1:
2431
- _f.sent();
2436
+ _j.sent();
2432
2437
  return [2 /*return*/];
2433
2438
  }
2434
2439
  });