@zeedhi/teknisa-components-common 1.92.1 → 1.93.1

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.
Files changed (90) hide show
  1. package/coverage/clover.xml +281 -266
  2. package/coverage/coverage-final.json +45 -45
  3. package/coverage/lcov-report/index.html +9 -9
  4. package/coverage/lcov-report/tests/__helpers__/component-event-helper.ts.html +1 -1
  5. package/coverage/lcov-report/tests/__helpers__/flush-promises-helper.ts.html +2 -2
  6. package/coverage/lcov-report/tests/__helpers__/get-child-helper.ts.html +1 -1
  7. package/coverage/lcov-report/tests/__helpers__/index.html +1 -1
  8. package/coverage/lcov-report/tests/__helpers__/index.ts.html +1 -1
  9. package/coverage/lcov-report/tests/__helpers__/mock-created-helper.ts.html +1 -1
  10. package/coverage/lcov.info +429 -410
  11. package/dist/tek-components-common.esm.js +59 -49
  12. package/dist/tek-components-common.umd.js +59 -49
  13. package/package.json +2 -2
  14. package/tests/unit/components/tek-grid/grid-filter-button.spec.ts +1 -1
  15. package/tests/unit/components/tek-grid/grid.spec.ts +31 -0
  16. package/tests/unit/components/tek-product-card/product-card.spec.ts +2 -2
  17. package/types/components/tek-ag-grid/default-icons.d.ts +53 -0
  18. package/types/components/tek-ag-grid/interfaces.d.ts +9 -0
  19. package/types/components/tek-ag-grid/tek-ag-grid.d.ts +35 -0
  20. package/types/components/tek-datasource/datasource.d.ts +94 -0
  21. package/types/components/tek-grid/default-icons.d.ts +53 -0
  22. package/types/components/tek-grid/filter-dynamic-values.d.ts +9 -0
  23. package/types/components/tek-grid/grid-controller.d.ts +19 -0
  24. package/types/components/tek-grid/grid.d.ts +4 -4
  25. package/types/components/tek-grid/grid_column.d.ts +14 -0
  26. package/types/components/tek-grid/grid_controller.d.ts +15 -0
  27. package/types/components/tek-grid/tek-grid.d.ts +35 -0
  28. package/types/components/tek-login/interfaces.d.ts +3 -0
  29. package/types/components/tek-login/login-children.d.ts +3 -0
  30. package/types/components/tek-login/login.d.ts +58 -0
  31. package/types/components/tek-login/login_children.d.ts +3 -0
  32. package/coverage/lcov-report/components/crud/crud-add-button.ts.html +0 -250
  33. package/coverage/lcov-report/components/crud/crud-button.ts.html +0 -292
  34. package/coverage/lcov-report/components/crud/crud-cancel-button.ts.html +0 -259
  35. package/coverage/lcov-report/components/crud/crud-delete-button.ts.html +0 -322
  36. package/coverage/lcov-report/components/crud/crud-form.ts.html +0 -382
  37. package/coverage/lcov-report/components/crud/crud-save-button.ts.html +0 -253
  38. package/coverage/lcov-report/components/crud/index.html +0 -191
  39. package/coverage/lcov-report/components/index.html +0 -116
  40. package/coverage/lcov-report/components/index.ts.html +0 -394
  41. package/coverage/lcov-report/components/tek-breadcrumb-header/breadcrumb-header.ts.html +0 -172
  42. package/coverage/lcov-report/components/tek-breadcrumb-header/index.html +0 -116
  43. package/coverage/lcov-report/components/tek-card-title/card-title.ts.html +0 -175
  44. package/coverage/lcov-report/components/tek-card-title/index.html +0 -116
  45. package/coverage/lcov-report/components/tek-datasource/index.html +0 -146
  46. package/coverage/lcov-report/components/tek-datasource/interfaces.ts.html +0 -193
  47. package/coverage/lcov-report/components/tek-datasource/memory-datasource.ts.html +0 -1015
  48. package/coverage/lcov-report/components/tek-datasource/rest-datasource.ts.html +0 -751
  49. package/coverage/lcov-report/components/tek-drag-grid/index.html +0 -116
  50. package/coverage/lcov-report/components/tek-drag-grid/tek-drag-grid.ts.html +0 -409
  51. package/coverage/lcov-report/components/tek-grid/filter-helper.ts.html +0 -145
  52. package/coverage/lcov-report/components/tek-grid/grid-column.ts.html +0 -775
  53. package/coverage/lcov-report/components/tek-grid/grid-columns-button-controller.ts.html +0 -169
  54. package/coverage/lcov-report/components/tek-grid/grid-columns-button.ts.html +0 -190
  55. package/coverage/lcov-report/components/tek-grid/grid-filter-button.ts.html +0 -1282
  56. package/coverage/lcov-report/components/tek-grid/grid.ts.html +0 -3157
  57. package/coverage/lcov-report/components/tek-grid/index.html +0 -221
  58. package/coverage/lcov-report/components/tek-grid/interfaces.ts.html +0 -733
  59. package/coverage/lcov-report/components/tek-grid/layout-options.ts.html +0 -826
  60. package/coverage/lcov-report/components/tek-image/image.ts.html +0 -313
  61. package/coverage/lcov-report/components/tek-image/index.html +0 -116
  62. package/coverage/lcov-report/components/tek-iterable-carousel/index.html +0 -116
  63. package/coverage/lcov-report/components/tek-iterable-carousel/iterable-carousel.ts.html +0 -175
  64. package/coverage/lcov-report/components/tek-iterable-component-render/index.html +0 -116
  65. package/coverage/lcov-report/components/tek-iterable-component-render/iterable-component-render.ts.html +0 -118
  66. package/coverage/lcov-report/components/tek-loading/index.html +0 -116
  67. package/coverage/lcov-report/components/tek-loading/loading.ts.html +0 -196
  68. package/coverage/lcov-report/components/tek-notifications/index.html +0 -116
  69. package/coverage/lcov-report/components/tek-notifications/notifications.ts.html +0 -271
  70. package/coverage/lcov-report/components/tek-product-card/index.html +0 -116
  71. package/coverage/lcov-report/components/tek-product-card/product-card.ts.html +0 -391
  72. package/coverage/lcov-report/components/tek-tree-grid/index.html +0 -116
  73. package/coverage/lcov-report/components/tek-tree-grid/tree-grid.ts.html +0 -1255
  74. package/coverage/lcov-report/components/tek-user-info/TekUserInfoController.ts.html +0 -367
  75. package/coverage/lcov-report/components/tek-user-info/index.html +0 -146
  76. package/coverage/lcov-report/components/tek-user-info/tek-user-info-list.ts.html +0 -268
  77. package/coverage/lcov-report/components/tek-user-info/tek-user-info.ts.html +0 -1096
  78. package/coverage/lcov-report/error/delete-rows-error.ts.html +0 -118
  79. package/coverage/lcov-report/error/index.html +0 -116
  80. package/coverage/lcov-report/utils/grid-base/export-options/button-option.ts.html +0 -166
  81. package/coverage/lcov-report/utils/grid-base/export-options/index.html +0 -146
  82. package/coverage/lcov-report/utils/grid-base/export-options/index.ts.html +0 -94
  83. package/coverage/lcov-report/utils/grid-base/export-options/multi-option.ts.html +0 -355
  84. package/coverage/lcov-report/utils/grid-base/grid-base.ts.html +0 -1960
  85. package/coverage/lcov-report/utils/grid-base/grid-controller.ts.html +0 -457
  86. package/coverage/lcov-report/utils/grid-base/index.html +0 -131
  87. package/coverage/lcov-report/utils/index.html +0 -116
  88. package/coverage/lcov-report/utils/index.ts.html +0 -100
  89. package/coverage/lcov-report/utils/report-filter/index.html +0 -116
  90. package/coverage/lcov-report/utils/report-filter/report-filter.ts.html +0 -256
@@ -2295,12 +2295,12 @@ class TekGrid extends GridEditable {
2295
2295
  if (!this.toolbarSlotProps)
2296
2296
  this.toolbarSlot = this.gridBase.createToolbarProps();
2297
2297
  this.navigationKeyMapping.left = {
2298
- event: this.navigateLeft.bind(this),
2298
+ event: this.directionalLeft.bind(this),
2299
2299
  stop: true,
2300
2300
  active: true,
2301
2301
  };
2302
2302
  this.navigationKeyMapping.right = {
2303
- event: this.navigateRight.bind(this),
2303
+ event: this.directionalRight.bind(this),
2304
2304
  stop: true,
2305
2305
  active: true,
2306
2306
  };
@@ -2700,73 +2700,82 @@ class TekGrid extends GridEditable {
2700
2700
  navigateDown(params) {
2701
2701
  if (!this.isGrouped()) {
2702
2702
  super.navigateDown();
2703
+ return;
2703
2704
  }
2704
- else {
2705
- const { index } = params;
2706
- if (!this.groupedData.length || index === this.groupedData.length)
2707
- return;
2708
- const { uniqueKey, currentRow } = this.datasource;
2709
- const rowIndex = index !== undefined
2710
- ? index
2711
- : this.groupedData.findIndex((row) => {
2712
- if (currentRow.group) {
2713
- return row.group && row.groupValue === currentRow.groupValue;
2714
- }
2715
- return row[uniqueKey] && row[uniqueKey] === currentRow[uniqueKey];
2716
- });
2717
- const newRow = this.groupedData[rowIndex + 1];
2718
- if (newRow && this.isItemVisible(newRow) && !newRow.groupFooter) {
2719
- this.datasource.currentRow = newRow;
2720
- }
2721
- else {
2722
- this.navigateDown({ index: rowIndex + 1 });
2723
- }
2705
+ if (this.cellSelection && this.viewNavigate) {
2706
+ this.viewNavigate('down');
2707
+ return;
2724
2708
  }
2709
+ const { index } = params;
2710
+ if (!this.groupedData.length || index === this.groupedData.length)
2711
+ return;
2712
+ const { uniqueKey, currentRow } = this.datasource;
2713
+ const rowIndex = index !== undefined
2714
+ ? index
2715
+ : this.groupedData.findIndex((row) => {
2716
+ if (currentRow.group) {
2717
+ return row.group && row.groupValue === currentRow.groupValue;
2718
+ }
2719
+ return row[uniqueKey] && row[uniqueKey] === currentRow[uniqueKey];
2720
+ });
2721
+ const newRow = this.groupedData[rowIndex + 1];
2722
+ if (!newRow || !this.isItemVisible(newRow) || newRow.groupFooter) {
2723
+ this.navigateDown({ index: rowIndex + 1 });
2724
+ return;
2725
+ }
2726
+ this.datasource.currentRow = newRow;
2725
2727
  }
2726
2728
  navigateUp(params) {
2727
2729
  if (!this.isGrouped()) {
2728
2730
  super.navigateUp();
2731
+ return;
2729
2732
  }
2730
- else {
2731
- const { index } = params;
2732
- if (!this.groupedData.length || index === -1)
2733
- return;
2734
- const { uniqueKey, currentRow } = this.datasource;
2735
- let rowIndex;
2736
- rowIndex = index !== undefined
2737
- ? index
2738
- : this.groupedData.findIndex((row) => {
2739
- if (currentRow.group) {
2740
- return row.group && row.groupValue === currentRow.groupValue;
2741
- }
2742
- return row[uniqueKey] && row[uniqueKey] === currentRow[uniqueKey];
2743
- });
2744
- if (rowIndex === -1)
2745
- rowIndex = this.groupedData.length;
2746
- const newRow = this.groupedData[rowIndex - 1];
2747
- if (newRow && this.isItemVisible(newRow) && !newRow.groupFooter) {
2748
- this.datasource.currentRow = newRow;
2749
- }
2750
- else {
2751
- this.navigateUp({ index: rowIndex - 1 });
2752
- }
2733
+ if (this.cellSelection && this.viewNavigate) {
2734
+ this.viewNavigate('up');
2735
+ return;
2736
+ }
2737
+ const { index } = params;
2738
+ if (!this.groupedData.length || index === -1)
2739
+ return;
2740
+ const { uniqueKey, currentRow } = this.datasource;
2741
+ let rowIndex;
2742
+ rowIndex = index !== undefined
2743
+ ? index
2744
+ : this.groupedData.findIndex((row) => {
2745
+ if (currentRow.group) {
2746
+ return row.group && row.groupValue === currentRow.groupValue;
2747
+ }
2748
+ return row[uniqueKey] && row[uniqueKey] === currentRow[uniqueKey];
2749
+ });
2750
+ if (rowIndex === -1)
2751
+ rowIndex = this.groupedData.length;
2752
+ const newRow = this.groupedData[rowIndex - 1];
2753
+ if (!newRow || !this.isItemVisible(newRow) || newRow.groupFooter) {
2754
+ this.navigateUp({ index: rowIndex - 1 });
2755
+ return;
2753
2756
  }
2757
+ this.datasource.currentRow = newRow;
2754
2758
  }
2755
- navigateLeft() {
2759
+ directionalLeft() {
2756
2760
  var _a;
2757
2761
  const { currentRow } = this.datasource;
2758
2762
  if (currentRow.group && currentRow.groupOpened) {
2759
2763
  currentRow.groupOpened = false;
2764
+ return;
2760
2765
  }
2761
- else if ((_a = currentRow.groupHeaders) === null || _a === void 0 ? void 0 : _a.length) {
2766
+ if (!this.cellSelection && ((_a = currentRow.groupHeaders) === null || _a === void 0 ? void 0 : _a.length)) {
2762
2767
  this.datasource.currentRow = currentRow.groupHeaders[currentRow.groupHeaders.length - 1];
2768
+ return;
2763
2769
  }
2770
+ this.navigateLeft();
2764
2771
  }
2765
- navigateRight() {
2772
+ directionalRight() {
2766
2773
  const { currentRow } = this.datasource;
2767
2774
  if (currentRow.group && !currentRow.groupOpened) {
2768
2775
  currentRow.groupOpened = true;
2776
+ return;
2769
2777
  }
2778
+ this.navigateRight();
2770
2779
  }
2771
2780
  /**
2772
2781
  * Dispatches row click event
@@ -2989,7 +2998,8 @@ class TekGridFilterButton extends Button {
2989
2998
  this.filterModal.hide();
2990
2999
  }
2991
3000
  destroyFilterModal() {
2992
- this.filterModal.destroy();
3001
+ if (this.filterModal)
3002
+ this.filterModal.destroy();
2993
3003
  }
2994
3004
  createFilterFromColumns() {
2995
3005
  if (!this.filterModal) {
@@ -2299,12 +2299,12 @@
2299
2299
  if (!this.toolbarSlotProps)
2300
2300
  this.toolbarSlot = this.gridBase.createToolbarProps();
2301
2301
  this.navigationKeyMapping.left = {
2302
- event: this.navigateLeft.bind(this),
2302
+ event: this.directionalLeft.bind(this),
2303
2303
  stop: true,
2304
2304
  active: true,
2305
2305
  };
2306
2306
  this.navigationKeyMapping.right = {
2307
- event: this.navigateRight.bind(this),
2307
+ event: this.directionalRight.bind(this),
2308
2308
  stop: true,
2309
2309
  active: true,
2310
2310
  };
@@ -2704,73 +2704,82 @@
2704
2704
  navigateDown(params) {
2705
2705
  if (!this.isGrouped()) {
2706
2706
  super.navigateDown();
2707
+ return;
2707
2708
  }
2708
- else {
2709
- const { index } = params;
2710
- if (!this.groupedData.length || index === this.groupedData.length)
2711
- return;
2712
- const { uniqueKey, currentRow } = this.datasource;
2713
- const rowIndex = index !== undefined
2714
- ? index
2715
- : this.groupedData.findIndex((row) => {
2716
- if (currentRow.group) {
2717
- return row.group && row.groupValue === currentRow.groupValue;
2718
- }
2719
- return row[uniqueKey] && row[uniqueKey] === currentRow[uniqueKey];
2720
- });
2721
- const newRow = this.groupedData[rowIndex + 1];
2722
- if (newRow && this.isItemVisible(newRow) && !newRow.groupFooter) {
2723
- this.datasource.currentRow = newRow;
2724
- }
2725
- else {
2726
- this.navigateDown({ index: rowIndex + 1 });
2727
- }
2709
+ if (this.cellSelection && this.viewNavigate) {
2710
+ this.viewNavigate('down');
2711
+ return;
2728
2712
  }
2713
+ const { index } = params;
2714
+ if (!this.groupedData.length || index === this.groupedData.length)
2715
+ return;
2716
+ const { uniqueKey, currentRow } = this.datasource;
2717
+ const rowIndex = index !== undefined
2718
+ ? index
2719
+ : this.groupedData.findIndex((row) => {
2720
+ if (currentRow.group) {
2721
+ return row.group && row.groupValue === currentRow.groupValue;
2722
+ }
2723
+ return row[uniqueKey] && row[uniqueKey] === currentRow[uniqueKey];
2724
+ });
2725
+ const newRow = this.groupedData[rowIndex + 1];
2726
+ if (!newRow || !this.isItemVisible(newRow) || newRow.groupFooter) {
2727
+ this.navigateDown({ index: rowIndex + 1 });
2728
+ return;
2729
+ }
2730
+ this.datasource.currentRow = newRow;
2729
2731
  }
2730
2732
  navigateUp(params) {
2731
2733
  if (!this.isGrouped()) {
2732
2734
  super.navigateUp();
2735
+ return;
2733
2736
  }
2734
- else {
2735
- const { index } = params;
2736
- if (!this.groupedData.length || index === -1)
2737
- return;
2738
- const { uniqueKey, currentRow } = this.datasource;
2739
- let rowIndex;
2740
- rowIndex = index !== undefined
2741
- ? index
2742
- : this.groupedData.findIndex((row) => {
2743
- if (currentRow.group) {
2744
- return row.group && row.groupValue === currentRow.groupValue;
2745
- }
2746
- return row[uniqueKey] && row[uniqueKey] === currentRow[uniqueKey];
2747
- });
2748
- if (rowIndex === -1)
2749
- rowIndex = this.groupedData.length;
2750
- const newRow = this.groupedData[rowIndex - 1];
2751
- if (newRow && this.isItemVisible(newRow) && !newRow.groupFooter) {
2752
- this.datasource.currentRow = newRow;
2753
- }
2754
- else {
2755
- this.navigateUp({ index: rowIndex - 1 });
2756
- }
2737
+ if (this.cellSelection && this.viewNavigate) {
2738
+ this.viewNavigate('up');
2739
+ return;
2740
+ }
2741
+ const { index } = params;
2742
+ if (!this.groupedData.length || index === -1)
2743
+ return;
2744
+ const { uniqueKey, currentRow } = this.datasource;
2745
+ let rowIndex;
2746
+ rowIndex = index !== undefined
2747
+ ? index
2748
+ : this.groupedData.findIndex((row) => {
2749
+ if (currentRow.group) {
2750
+ return row.group && row.groupValue === currentRow.groupValue;
2751
+ }
2752
+ return row[uniqueKey] && row[uniqueKey] === currentRow[uniqueKey];
2753
+ });
2754
+ if (rowIndex === -1)
2755
+ rowIndex = this.groupedData.length;
2756
+ const newRow = this.groupedData[rowIndex - 1];
2757
+ if (!newRow || !this.isItemVisible(newRow) || newRow.groupFooter) {
2758
+ this.navigateUp({ index: rowIndex - 1 });
2759
+ return;
2757
2760
  }
2761
+ this.datasource.currentRow = newRow;
2758
2762
  }
2759
- navigateLeft() {
2763
+ directionalLeft() {
2760
2764
  var _a;
2761
2765
  const { currentRow } = this.datasource;
2762
2766
  if (currentRow.group && currentRow.groupOpened) {
2763
2767
  currentRow.groupOpened = false;
2768
+ return;
2764
2769
  }
2765
- else if ((_a = currentRow.groupHeaders) === null || _a === void 0 ? void 0 : _a.length) {
2770
+ if (!this.cellSelection && ((_a = currentRow.groupHeaders) === null || _a === void 0 ? void 0 : _a.length)) {
2766
2771
  this.datasource.currentRow = currentRow.groupHeaders[currentRow.groupHeaders.length - 1];
2772
+ return;
2767
2773
  }
2774
+ this.navigateLeft();
2768
2775
  }
2769
- navigateRight() {
2776
+ directionalRight() {
2770
2777
  const { currentRow } = this.datasource;
2771
2778
  if (currentRow.group && !currentRow.groupOpened) {
2772
2779
  currentRow.groupOpened = true;
2780
+ return;
2773
2781
  }
2782
+ this.navigateRight();
2774
2783
  }
2775
2784
  /**
2776
2785
  * Dispatches row click event
@@ -2993,7 +3002,8 @@
2993
3002
  this.filterModal.hide();
2994
3003
  }
2995
3004
  destroyFilterModal() {
2996
- this.filterModal.destroy();
3005
+ if (this.filterModal)
3006
+ this.filterModal.destroy();
2997
3007
  }
2998
3008
  createFilterFromColumns() {
2999
3009
  if (!this.filterModal) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeedhi/teknisa-components-common",
3
- "version": "1.92.1",
3
+ "version": "1.93.1",
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": "fd9d5619f6a005aa0c82e22bd53c2fc7db9e40bf"
35
+ "gitHead": "20420a9274a19f72fbea80d245bf6a517b02a96b"
36
36
  }
@@ -106,7 +106,7 @@ describe('TekGridFilterButton', () => {
106
106
  button.onCreated();
107
107
 
108
108
  expect(spy).toBeCalledTimes(1);
109
- button.click({} as Event);
109
+ button.click();
110
110
  expect(spy).toBeCalledTimes(1);
111
111
  expect(button.isVisible).toBeFalsy();
112
112
  (instance as any).gridBase.hideFilterModal();
@@ -938,6 +938,37 @@ describe('TekGrid', () => {
938
938
  spySetFocus.mockReset();
939
939
  spyMetadata.mockReset();
940
940
  });
941
+
942
+ it('when using cellSelection, should use viewNavigate', async () => {
943
+ const instance = new TekGrid({
944
+ name: 'grid_navigation_1',
945
+ component: 'TekGrid',
946
+ cellSelection: true,
947
+ columns: [
948
+ {
949
+ name: 'name',
950
+ grouped: true,
951
+ },
952
+ ],
953
+ });
954
+
955
+ const elem = document.createElement('DIV');
956
+ (KeyMap as any).isElementActive = () => true;
957
+ instance.onCreated();
958
+ instance.onMounted(elem);
959
+
960
+ await flushPromises();
961
+ const spy = jest.fn();
962
+ instance.setViewNavigate(spy);
963
+
964
+ instance.navigateUp();
965
+
966
+ expect(spy).toHaveBeenLastCalledWith('up');
967
+
968
+ instance.navigateDown();
969
+
970
+ expect(spy).toHaveBeenLastCalledWith('down');
971
+ });
941
972
  });
942
973
 
943
974
  describe('reloadClick()', () => {
@@ -28,7 +28,7 @@ describe('ProductCard', () => {
28
28
  src: '/img/zeedhi.svg',
29
29
  productName: 'ProductTest',
30
30
  productPrice: '150',
31
- errorImagePath: 'image-error.jpg',
31
+ errorImagePath: 'image-error.avif',
32
32
  errorImageText: 'Image not found',
33
33
  width: '200',
34
34
  height: '400px',
@@ -39,7 +39,7 @@ describe('ProductCard', () => {
39
39
  expect(instance.id).toBe('id');
40
40
  expect(instance.src).toBe('/img/zeedhi.svg');
41
41
  expect(instance.productName).toBe('ProductTest');
42
- expect(instance.errorImagePath).toBe('image-error.jpg');
42
+ expect(instance.errorImagePath).toBe('image-error.avif');
43
43
  expect(instance.errorImageText).toBe('Image not found');
44
44
  expect(instance.width).toBe('200');
45
45
  expect(instance.productPriceFormat).toBe('$150.00');
@@ -0,0 +1,53 @@
1
+ declare const defaultIcons: {
2
+ columnGroupOpened: string;
3
+ columnGroupClosed: string;
4
+ columnSelectClosed: string;
5
+ columnSelectOpen: string;
6
+ columnSelectIndeterminate: string;
7
+ columnMovePin: string;
8
+ columnMoveHide: string;
9
+ columnMoveMove: string;
10
+ columnMoveLeft: string;
11
+ columnMoveRight: string;
12
+ columnMoveGroup: string;
13
+ columnMoveValue: string;
14
+ dropNotAllowed: string;
15
+ groupContracted: string;
16
+ groupExpanded: string;
17
+ chart: string;
18
+ close: string;
19
+ cancel: string;
20
+ check: string;
21
+ first: string;
22
+ previous: string;
23
+ next: string;
24
+ last: string;
25
+ linked: string;
26
+ unlinked: string;
27
+ colorPicker: string;
28
+ groupLoading: string;
29
+ menu: string;
30
+ filter: string;
31
+ columns: string;
32
+ maximize: string;
33
+ minimize: string;
34
+ menuPin: string;
35
+ menuValue: string;
36
+ menuAddRowGroup: string;
37
+ menuRemoveRowGroup: string;
38
+ clipboardCopy: string;
39
+ clipboardPaste: string;
40
+ rowGroupPanel: string;
41
+ valuePanel: string;
42
+ columnDrag: string;
43
+ rowDrag: string;
44
+ save: string;
45
+ smallDown: string;
46
+ smallLeft: string;
47
+ smallRight: string;
48
+ smallUp: string;
49
+ sortAscending: string;
50
+ sortDescending: string;
51
+ sortUnSort: string;
52
+ };
53
+ export default defaultIcons;
@@ -0,0 +1,9 @@
1
+ import { IIterable } from '@zeedhi/common';
2
+ import { IDictionary } from '@zeedhi/core';
3
+ export interface ITekAgGrid extends IIterable {
4
+ dense?: boolean;
5
+ frameworkComponents?: IDictionary;
6
+ gridOptions?: IDictionary;
7
+ height?: string | number;
8
+ icons?: IDictionary<string>;
9
+ }
@@ -0,0 +1,35 @@
1
+ import { Iterable } from '@zeedhi/common';
2
+ import { IDictionary } from '@zeedhi/core';
3
+ import { ITekAgGrid } from './interfaces';
4
+ /** Grid Component */
5
+ export declare class TekAgGrid extends Iterable implements ITekAgGrid {
6
+ cssClass: string;
7
+ dense: boolean;
8
+ frameworkComponents: IDictionary;
9
+ gridOptions: IDictionary;
10
+ height: string | number;
11
+ icons: IDictionary<string>;
12
+ gridComponent: any;
13
+ /**
14
+ * Creates a new AgGrid.
15
+ * @param props AgGrid properties
16
+ */
17
+ constructor(props: ITekAgGrid);
18
+ private createOptionsAccessors;
19
+ private setAccessor;
20
+ /**
21
+ * Reload dataset
22
+ */
23
+ reload(): Promise<any>;
24
+ /**
25
+ * Compares two dates
26
+ * @param date1
27
+ * @param date2
28
+ * @param format
29
+ * @returns -1 if date1 after date2
30
+ * @returns 0 if date1 equal date2
31
+ * @returns 1 if date1 before date2
32
+ */
33
+ dateComparator(date1: string | Date, date2: string | Date, format?: string): 1 | -1 | 0;
34
+ private getDateAsString;
35
+ }
@@ -0,0 +1,94 @@
1
+ import { IDatasource, IDictionary, RestDatasource } from '@zeedhi/core';
2
+ import { IDynamicFilterItem, ITekRestDatasource } from './interfaces';
3
+ export declare class TekRestDatasource extends RestDatasource implements ITekRestDatasource {
4
+ /** Dynamic filter data */
5
+ dynamicFilter: IDictionary<IDynamicFilterItem[]>;
6
+ /** Search Join data */
7
+ searchJoin: IDictionary<Array<string | number>>;
8
+ /**
9
+ * URL reserved keys
10
+ */
11
+ protected reservedKeys: IDictionary<boolean>;
12
+ /**
13
+ * Dynamic Filter Operations
14
+ */
15
+ dynamicFilterOperations: IDictionary<boolean>;
16
+ /**
17
+ * Dynamic Filter Relations
18
+ */
19
+ dynamicFilterRelations: IDictionary<boolean>;
20
+ /**
21
+ * Dynamic Filter applied flag
22
+ */
23
+ protected dynamicFilterApplied: string;
24
+ /**
25
+ * Create new datasource
26
+ * @param props Datasource properties
27
+ */
28
+ constructor(props: ITekRestDatasource);
29
+ protected updateInternalProperties(datasource?: IDatasource): void;
30
+ protected getEncodedParam(urlParam: string, datasourceParam?: IDictionary<any>): IDictionary<any>;
31
+ protected getQueryStringValues(): IDictionary<any>;
32
+ protected getUrlQueryString(): string;
33
+ /**
34
+ * Adds a new dynamic filter position or replace if exists
35
+ * @param column Dynamic Filter column name
36
+ * @param value Dynamic Filter value
37
+ * @returns Promise with data collection
38
+ */
39
+ addDynamicFilter(column: string, value: any): Promise<any>;
40
+ /**
41
+ * Removes a dynamic filter position
42
+ * @param column Dynamic Filter column name
43
+ * @returns Promise with data collection
44
+ */
45
+ removeDynamicFilter(column: string): Promise<any>;
46
+ /**
47
+ * Sets new dynamic filter value
48
+ * @param filter Dynamic Filter value
49
+ * @returns Promise with data collection
50
+ */
51
+ setDynamicFilter(filter: IDictionary<any>): Promise<any>;
52
+ /**
53
+ * Clears Dynamic filter value
54
+ * @returns Promise with data collection
55
+ */
56
+ clearDynamicFilter(): Promise<any>;
57
+ /**
58
+ * Resets page and selected rows and tries to update the url
59
+ * @returns Promise with data collection
60
+ */
61
+ protected updateDynamicFilter(): Promise<any>;
62
+ /**
63
+ * Checks if a filter value is valid
64
+ * @param value Filter value
65
+ * @returns Is valid filter value
66
+ */
67
+ protected isValidDynamicFilterValue(column: string, value?: IDictionary<any>[]): boolean | undefined;
68
+ /**
69
+ * Retrieves request params
70
+ */
71
+ protected getRequestParams(): any;
72
+ clone(): {
73
+ dynamicFilter: IDictionary<IDynamicFilterItem[]>;
74
+ searchJoin: IDictionary<(string | number)[]>;
75
+ type: string;
76
+ route?: string | undefined;
77
+ lazyLoad?: boolean | undefined;
78
+ arrayFormat?: "indices" | "brackets" | "repeat" | "comma" | undefined;
79
+ find?: IDictionary<any> | undefined;
80
+ currentRow?: IDictionary<any> | undefined;
81
+ data?: IDictionary<any>[] | undefined;
82
+ filter?: IDictionary<any> | undefined;
83
+ limit?: string | number | undefined;
84
+ loadAll?: boolean | undefined;
85
+ loading?: boolean | undefined;
86
+ order?: string[] | undefined;
87
+ page?: string | number | undefined;
88
+ search?: string | undefined;
89
+ searchIn?: string[] | undefined;
90
+ uniqueKey?: string | undefined;
91
+ watchUrl?: boolean | undefined;
92
+ events?: import("@zeedhi/core").IDatasourceEvents<import("@zeedhi/core").IEventParam<any>> | undefined;
93
+ };
94
+ }
@@ -0,0 +1,53 @@
1
+ declare const defaultIcons: {
2
+ columnGroupOpened: string;
3
+ columnGroupClosed: string;
4
+ columnSelectClosed: string;
5
+ columnSelectOpen: string;
6
+ columnSelectIndeterminate: string;
7
+ columnMovePin: string;
8
+ columnMoveHide: string;
9
+ columnMoveMove: string;
10
+ columnMoveLeft: string;
11
+ columnMoveRight: string;
12
+ columnMoveGroup: string;
13
+ columnMoveValue: string;
14
+ dropNotAllowed: string;
15
+ groupContracted: string;
16
+ groupExpanded: string;
17
+ chart: string;
18
+ close: string;
19
+ cancel: string;
20
+ check: string;
21
+ first: string;
22
+ previous: string;
23
+ next: string;
24
+ last: string;
25
+ linked: string;
26
+ unlinked: string;
27
+ colorPicker: string;
28
+ groupLoading: string;
29
+ menu: string;
30
+ filter: string;
31
+ columns: string;
32
+ maximize: string;
33
+ minimize: string;
34
+ menuPin: string;
35
+ menuValue: string;
36
+ menuAddRowGroup: string;
37
+ menuRemoveRowGroup: string;
38
+ clipboardCopy: string;
39
+ clipboardPaste: string;
40
+ rowGroupPanel: string;
41
+ valuePanel: string;
42
+ columnDrag: string;
43
+ rowDrag: string;
44
+ save: string;
45
+ smallDown: string;
46
+ smallLeft: string;
47
+ smallRight: string;
48
+ smallUp: string;
49
+ sortAscending: string;
50
+ sortDescending: string;
51
+ sortUnSort: string;
52
+ };
53
+ export default defaultIcons;
@@ -0,0 +1,9 @@
1
+ import { TekGridColumn } from '..';
2
+ export declare class TekFilterDynamicValues {
3
+ private static values;
4
+ private static formatDate;
5
+ static getLabel(name: string): string;
6
+ static getValue(name: string, column: TekGridColumn): string | string[];
7
+ static register(name: string, label: string, fn: () => Date | [Date, Date]): void;
8
+ static unregister(name: string): void;
9
+ }
@@ -0,0 +1,19 @@
1
+ import { TekGrid } from './grid';
2
+ export declare class TekGridController {
3
+ private grid;
4
+ constructor(grid: TekGrid);
5
+ get gridTitle(): string;
6
+ get showAddButton(): boolean;
7
+ get showDeleteButton(): boolean;
8
+ get showFilterButton(): boolean;
9
+ get showColumnsButton(): boolean;
10
+ get columnsButtonIgnore(): string[];
11
+ get showLayoutOptions(): boolean;
12
+ get showFirstDivider(): boolean;
13
+ get showActionsButton(): boolean;
14
+ get showExportButton(): boolean;
15
+ get showActionAndExportButton(): boolean;
16
+ get isEditing(): boolean;
17
+ get isNotEditing(): boolean;
18
+ get disableDeleteButton(): boolean;
19
+ }