@smartsoft001/crud-shell-angular 1.1.692 → 1.1.696

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