@zeedhi/teknisa-components-common 1.96.0 → 1.96.2

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.
@@ -1227,7 +1227,7 @@ Messages.add({
1227
1227
  TEKGRID_CONTAINS: 'contains',
1228
1228
  TEKGRID_NOT_CONTAINS: 'does not contain',
1229
1229
  TEKGRID_EQUALS: 'is equal to',
1230
- TEKGRID_NOT_EQUALS: 'is differente from',
1230
+ TEKGRID_NOT_EQUALS: 'is different from',
1231
1231
  TEKGRID_GREATER_THAN: 'is greater than',
1232
1232
  TEKGRID_LESS_THAN: 'is less than',
1233
1233
  TEKGRID_GREATER_THAN_EQUALS: 'is greater or equals to',
@@ -2429,9 +2429,9 @@ class TekGrid extends GridEditable {
2429
2429
  */
2430
2430
  loadAfterTasks() {
2431
2431
  return __awaiter(this, void 0, void 0, function* () {
2432
- yield Promise.all(this.tasksBeforeLoad);
2432
+ Promise.all(this.tasksBeforeLoad.map((promise) => promise.catch(() => undefined)));
2433
2433
  this.tasksBeforeLoad = [];
2434
- this.request();
2434
+ return this.request();
2435
2435
  });
2436
2436
  }
2437
2437
  initGrouping(lazyLoad) {
@@ -2763,7 +2763,7 @@ class TekGrid extends GridEditable {
2763
2763
  }
2764
2764
  this.datasource.currentRow = newRow;
2765
2765
  }
2766
- directionalLeft() {
2766
+ directionalLeft(params) {
2767
2767
  var _a;
2768
2768
  const { currentRow } = this.datasource;
2769
2769
  if (currentRow.group && currentRow.groupOpened) {
@@ -2774,15 +2774,15 @@ class TekGrid extends GridEditable {
2774
2774
  this.datasource.currentRow = currentRow.groupHeaders[currentRow.groupHeaders.length - 1];
2775
2775
  return;
2776
2776
  }
2777
- this.navigateLeft();
2777
+ this.navigateLeft(params);
2778
2778
  }
2779
- directionalRight() {
2779
+ directionalRight(params) {
2780
2780
  const { currentRow } = this.datasource;
2781
2781
  if (currentRow.group && !currentRow.groupOpened) {
2782
2782
  currentRow.groupOpened = true;
2783
2783
  return;
2784
2784
  }
2785
- this.navigateRight();
2785
+ this.navigateRight(params);
2786
2786
  }
2787
2787
  /**
2788
2788
  * Dispatches row click event
@@ -1231,7 +1231,7 @@
1231
1231
  TEKGRID_CONTAINS: 'contains',
1232
1232
  TEKGRID_NOT_CONTAINS: 'does not contain',
1233
1233
  TEKGRID_EQUALS: 'is equal to',
1234
- TEKGRID_NOT_EQUALS: 'is differente from',
1234
+ TEKGRID_NOT_EQUALS: 'is different from',
1235
1235
  TEKGRID_GREATER_THAN: 'is greater than',
1236
1236
  TEKGRID_LESS_THAN: 'is less than',
1237
1237
  TEKGRID_GREATER_THAN_EQUALS: 'is greater or equals to',
@@ -2433,9 +2433,9 @@
2433
2433
  */
2434
2434
  loadAfterTasks() {
2435
2435
  return __awaiter(this, void 0, void 0, function* () {
2436
- yield Promise.all(this.tasksBeforeLoad);
2436
+ Promise.all(this.tasksBeforeLoad.map((promise) => promise.catch(() => undefined)));
2437
2437
  this.tasksBeforeLoad = [];
2438
- this.request();
2438
+ return this.request();
2439
2439
  });
2440
2440
  }
2441
2441
  initGrouping(lazyLoad) {
@@ -2767,7 +2767,7 @@
2767
2767
  }
2768
2768
  this.datasource.currentRow = newRow;
2769
2769
  }
2770
- directionalLeft() {
2770
+ directionalLeft(params) {
2771
2771
  var _a;
2772
2772
  const { currentRow } = this.datasource;
2773
2773
  if (currentRow.group && currentRow.groupOpened) {
@@ -2778,15 +2778,15 @@
2778
2778
  this.datasource.currentRow = currentRow.groupHeaders[currentRow.groupHeaders.length - 1];
2779
2779
  return;
2780
2780
  }
2781
- this.navigateLeft();
2781
+ this.navigateLeft(params);
2782
2782
  }
2783
- directionalRight() {
2783
+ directionalRight(params) {
2784
2784
  const { currentRow } = this.datasource;
2785
2785
  if (currentRow.group && !currentRow.groupOpened) {
2786
2786
  currentRow.groupOpened = true;
2787
2787
  return;
2788
2788
  }
2789
- this.navigateRight();
2789
+ this.navigateRight(params);
2790
2790
  }
2791
2791
  /**
2792
2792
  * Dispatches row click event
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeedhi/teknisa-components-common",
3
- "version": "1.96.0",
3
+ "version": "1.96.2",
4
4
  "description": "Teknisa Components Common",
5
5
  "author": "Zeedhi <zeedhi@teknisa.com>",
6
6
  "license": "ISC",
@@ -32,5 +32,5 @@
32
32
  "peerDependencies": {
33
33
  "@zeedhi/core": "*"
34
34
  },
35
- "gitHead": "dfe5f1a2a802cfea057de278b8e41f6858b43073"
35
+ "gitHead": "23195c214009cb263eb404224929e8acfd63ed3c"
36
36
  }
@@ -6,7 +6,7 @@ const words = {
6
6
  TEKGRID_CONTAINS: 'contains',
7
7
  TEKGRID_NOT_CONTAINS: 'does not contain',
8
8
  TEKGRID_EQUALS: 'is equal to',
9
- TEKGRID_NOT_EQUALS: 'is differente from',
9
+ TEKGRID_NOT_EQUALS: 'is different from',
10
10
  TEKGRID_GREATER_THAN: 'is greater than',
11
11
  TEKGRID_LESS_THAN: 'is less than',
12
12
  TEKGRID_GREATER_THAN_EQUALS: 'is greater or equals to',
@@ -706,13 +706,13 @@ describe('TekGrid', () => {
706
706
  (KeyMap as any).isElementActive = () => true;
707
707
  instance.onCreated();
708
708
  instance.onMounted(elem);
709
- dispatchEvent('arrowdown', {}); // arrow down
709
+ instance.navigateDatasource(false);
710
710
  expect(instance.datasource.currentRow).toEqual(instance.datasource.data[0]);
711
711
 
712
- dispatchEvent('arrowdown', {}); // arrow down
712
+ instance.navigateDatasource(false);
713
713
  expect(instance.datasource.currentRow).toEqual(instance.datasource.data[1]);
714
714
 
715
- dispatchEvent('arrowup', {}); // arrow up
715
+ instance.navigateDatasource(true);
716
716
  expect(instance.datasource.currentRow).toEqual(instance.datasource.data[0]);
717
717
 
718
718
  dispatchEvent('arrowright', {}); // arrow right
@@ -2278,4 +2278,23 @@ describe('TekGrid', () => {
2278
2278
  spyModalService.mockReset();
2279
2279
  });
2280
2280
  });
2281
+
2282
+ describe('loadAfterTasks', () => {
2283
+ it('should call request even if tasks fail', async () => {
2284
+ const instance = new TekGrid({
2285
+ name: 'grid',
2286
+ component: 'TekGrid',
2287
+ });
2288
+ const spy = jest.spyOn(instance.datasource, 'get');
2289
+
2290
+ const errorFn = async () => {
2291
+ throw new Error();
2292
+ };
2293
+ instance.registerTask(errorFn());
2294
+
2295
+ await instance.loadAfterTasks();
2296
+
2297
+ expect(spy).toHaveBeenCalledTimes(1);
2298
+ });
2299
+ });
2281
2300
  });
@@ -1,5 +1,5 @@
1
1
  import { GridEditable, IComponentRender } from '@zeedhi/common';
2
- import { Datasource, IDictionary } from '@zeedhi/core';
2
+ import { Datasource, IDictionary, IEventParam } from '@zeedhi/core';
3
3
  import { ITekGridAtoms } from '../../utils';
4
4
  import { TekGridColumn } from './grid-column';
5
5
  import { IModalFilterProps, ITekGrid, ITekGridColumn, ITekGridEvents, ITekGridExportConfig } from './interfaces';
@@ -106,7 +106,7 @@ export declare class TekGrid extends GridEditable implements ITekGrid {
106
106
  /**
107
107
  * Loads grid data after resolving all tasks
108
108
  */
109
- loadAfterTasks(): Promise<void>;
109
+ loadAfterTasks(): Promise<void | undefined>;
110
110
  private initGrouping;
111
111
  private buildGetFunction;
112
112
  updateGrouping: (lazyLoad?: boolean) => void;
@@ -136,8 +136,8 @@ export declare class TekGrid extends GridEditable implements ITekGrid {
136
136
  isGrouped(): number | false;
137
137
  navigateDown(params?: any): void;
138
138
  navigateUp(params?: any): void;
139
- directionalLeft(): void;
140
- directionalRight(): void;
139
+ directionalLeft(params: IEventParam<any>): void;
140
+ directionalRight(params: IEventParam<any>): void;
141
141
  /**
142
142
  * Dispatches row click event
143
143
  * @param row Grid row