@zeedhi/teknisa-components-common 1.97.1 → 1.98.0

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.
@@ -2869,6 +2869,9 @@ class TekGrid extends GridEditable {
2869
2869
  getFilterInputs(columnName) {
2870
2870
  return this.gridBase.getFilterInputs(columnName);
2871
2871
  }
2872
+ isColumnSearchable(column) {
2873
+ return !this.searchVisibleOnly || column.isVisible || column.grouped;
2874
+ }
2872
2875
  }
2873
2876
 
2874
2877
  class TekGridColumnsButtonController extends IterableColumnsButtonController {
@@ -2873,6 +2873,9 @@
2873
2873
  getFilterInputs(columnName) {
2874
2874
  return this.gridBase.getFilterInputs(columnName);
2875
2875
  }
2876
+ isColumnSearchable(column) {
2877
+ return !this.searchVisibleOnly || column.isVisible || column.grouped;
2878
+ }
2876
2879
  }
2877
2880
 
2878
2881
  class TekGridColumnsButtonController extends common.IterableColumnsButtonController {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeedhi/teknisa-components-common",
3
- "version": "1.97.1",
3
+ "version": "1.98.0",
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": "~1.97.0"
34
34
  },
35
- "gitHead": "ff6f76c07441863c96758cecfb84300f914a15d3"
35
+ "gitHead": "f6f647b11fba5bb19effa2faf67580169c7d6acb"
36
36
  }
@@ -2322,4 +2322,47 @@ describe('TekGrid', () => {
2322
2322
  expect(spy).toHaveBeenCalledTimes(1);
2323
2323
  });
2324
2324
  });
2325
+
2326
+ describe('isColumnSearchable()', () => {
2327
+ let instance!: TekGrid;
2328
+
2329
+ beforeEach(() => {
2330
+ instance = new TekGrid({
2331
+ name: 'TekGrid',
2332
+ component: 'TekGrid',
2333
+ columns: [{ name: 'name' }],
2334
+ });
2335
+ });
2336
+
2337
+ it('should return true if column is visible', () => {
2338
+ const column = instance.getColumn('name') as TekGridColumn;
2339
+ column.isVisible = true;
2340
+
2341
+ expect(instance.isColumnSearchable(column)).toBeTruthy();
2342
+ });
2343
+
2344
+ it('should return true if column is grouped', () => {
2345
+ const column = instance.getColumn('name') as TekGridColumn;
2346
+ column.isVisible = false;
2347
+ column.grouped = true;
2348
+
2349
+ expect(instance.isColumnSearchable(column)).toBeTruthy();
2350
+ });
2351
+
2352
+ it('should return false if column is not visible', () => {
2353
+ const column = instance.getColumn('name') as TekGridColumn;
2354
+ column.isVisible = false;
2355
+
2356
+ expect(instance.isColumnSearchable(column)).toBeFalsy();
2357
+ });
2358
+
2359
+ it('should return true if iterable uses searchVisibleOnly as false', () => {
2360
+ instance.searchVisibleOnly = false;
2361
+
2362
+ const column = instance.getColumn('name') as TekGridColumn;
2363
+ expect(instance.isColumnSearchable(column)).toBeTruthy();
2364
+ column.isVisible = false;
2365
+ expect(instance.isColumnSearchable(column)).toBeTruthy();
2366
+ });
2367
+ });
2325
2368
  });
@@ -167,4 +167,5 @@ export declare class TekGrid extends GridEditable implements ITekGrid {
167
167
  selectGroupClick(row: IDictionary<any>, isSelected: boolean, event: Event, element: HTMLElement): void;
168
168
  getAtomInstance<T>(key: keyof ITekGridAtoms): T;
169
169
  getFilterInputs(columnName?: string): import("@zeedhi/common").Input[];
170
+ isColumnSearchable(column: TekGridColumn): boolean;
170
171
  }