@acorex/data-grid 4.2.73 → 5.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. package/karma.conf.js +32 -0
  2. package/ng-package.json +12 -0
  3. package/package.json +17 -37
  4. package/src/lib/data-grid/columns/check-column.component.ts +113 -0
  5. package/src/lib/data-grid/columns/column.component.ts +182 -0
  6. package/src/lib/data-grid/columns/command-column.component.ts +101 -0
  7. package/src/lib/data-grid/columns/date-column.component.ts +118 -0
  8. package/src/lib/data-grid/columns/row-number-column.component.ts +36 -0
  9. package/src/lib/data-grid/columns/selection-column.component.ts +39 -0
  10. package/src/lib/data-grid/columns/text-column.component.ts +92 -0
  11. package/src/lib/data-grid/datagrid.component.html +27 -0
  12. package/src/lib/data-grid/datagrid.component.ts +769 -0
  13. package/{lib/data-grid/datagrid.events.d.ts → src/lib/data-grid/datagrid.events.ts} +4 -1
  14. package/src/lib/data-grid/datagrid.module.ts +81 -0
  15. package/src/lib/data-grid/filters/filter.component.ts +21 -0
  16. package/src/lib/data-grid/templates/cell-template.component.ts +47 -0
  17. package/src/lib/data-grid/templates/detail-template.component.ts +43 -0
  18. package/src/lib/data-grid/templates/row-template.component.ts +41 -0
  19. package/src/lib/data-lov/data-lov-popup/data-lov-popup.component.html +16 -0
  20. package/src/lib/data-lov/data-lov-popup/data-lov-popup.component.ts +130 -0
  21. package/src/lib/data-lov/data-lov.component.html +61 -0
  22. package/src/lib/data-lov/data-lov.component.ts +184 -0
  23. package/src/lib/data-lov/data-lov.module.ts +16 -0
  24. package/{public-api.d.ts → src/public-api.ts} +3 -0
  25. package/src/test.ts +28 -0
  26. package/tsconfig.lib.json +23 -0
  27. package/tsconfig.lib.prod.json +6 -0
  28. package/tsconfig.spec.json +17 -0
  29. package/tslint.json +17 -0
  30. package/acorex-data-grid.d.ts +0 -5
  31. package/esm2020/acorex-data-grid.mjs +0 -5
  32. package/esm2020/lib/data-grid/columns/check-column.component.mjs +0 -117
  33. package/esm2020/lib/data-grid/columns/column.component.mjs +0 -164
  34. package/esm2020/lib/data-grid/columns/command-column.component.mjs +0 -115
  35. package/esm2020/lib/data-grid/columns/date-column.component.mjs +0 -111
  36. package/esm2020/lib/data-grid/columns/row-number-column.component.mjs +0 -37
  37. package/esm2020/lib/data-grid/columns/selection-column.component.mjs +0 -42
  38. package/esm2020/lib/data-grid/columns/text-column.component.mjs +0 -89
  39. package/esm2020/lib/data-grid/datagrid.component.mjs +0 -667
  40. package/esm2020/lib/data-grid/datagrid.events.mjs +0 -2
  41. package/esm2020/lib/data-grid/datagrid.module.mjs +0 -145
  42. package/esm2020/lib/data-grid/filters/filter.component.mjs +0 -39
  43. package/esm2020/lib/data-grid/templates/cell-template.component.mjs +0 -53
  44. package/esm2020/lib/data-grid/templates/detail-template.component.mjs +0 -46
  45. package/esm2020/lib/data-grid/templates/row-template.component.mjs +0 -43
  46. package/esm2020/lib/data-lov/data-lov-popup/data-lov-popup.component.mjs +0 -114
  47. package/esm2020/lib/data-lov/data-lov.component.mjs +0 -165
  48. package/esm2020/lib/data-lov/data-lov.module.mjs +0 -23
  49. package/esm2020/public-api.mjs +0 -18
  50. package/fesm2015/acorex-data-grid.mjs +0 -1881
  51. package/fesm2015/acorex-data-grid.mjs.map +0 -1
  52. package/fesm2020/acorex-data-grid.mjs +0 -1881
  53. package/fesm2020/acorex-data-grid.mjs.map +0 -1
  54. package/lib/data-grid/columns/check-column.component.d.ts +0 -37
  55. package/lib/data-grid/columns/column.component.d.ts +0 -32
  56. package/lib/data-grid/columns/command-column.component.d.ts +0 -27
  57. package/lib/data-grid/columns/date-column.component.d.ts +0 -32
  58. package/lib/data-grid/columns/row-number-column.component.d.ts +0 -10
  59. package/lib/data-grid/columns/selection-column.component.d.ts +0 -12
  60. package/lib/data-grid/columns/text-column.component.d.ts +0 -25
  61. package/lib/data-grid/datagrid.component.d.ts +0 -142
  62. package/lib/data-grid/datagrid.module.d.ts +0 -23
  63. package/lib/data-grid/filters/filter.component.d.ts +0 -5
  64. package/lib/data-grid/templates/cell-template.component.d.ts +0 -22
  65. package/lib/data-grid/templates/detail-template.component.d.ts +0 -21
  66. package/lib/data-grid/templates/row-template.component.d.ts +0 -20
  67. package/lib/data-lov/data-lov-popup/data-lov-popup.component.d.ts +0 -33
  68. package/lib/data-lov/data-lov.component.d.ts +0 -43
  69. package/lib/data-lov/data-lov.module.d.ts +0 -12
@@ -0,0 +1,92 @@
1
+ import { AXGridDataColumn } from './column.component';
2
+ import {
3
+ ChangeDetectionStrategy,
4
+ Component,
5
+ ViewContainerRef,
6
+ ViewChild
7
+ } from '@angular/core';
8
+ import {
9
+ IFilterParams,
10
+ RowNode,
11
+ IDoesFilterPassParams,
12
+ IAfterGuiAttachedParams
13
+ } from 'ag-grid-community';
14
+ import { IFilterAngularComp } from 'ag-grid-angular';
15
+ import { AXTextBoxComponent } from '@acorex/components';
16
+
17
+
18
+ @Component({
19
+ selector: 'ax-text-column',
20
+ template: '',
21
+ providers: [{ provide: AXGridDataColumn, useExisting: AXGridTextColumn }],
22
+ changeDetection: ChangeDetectionStrategy.OnPush
23
+ })
24
+ export class AXGridTextColumn extends AXGridDataColumn {
25
+ constructor() {
26
+ super();
27
+ }
28
+
29
+ render() {
30
+ const col = super.render();
31
+ // if (this.allowFiltering) {
32
+ // col.filterFramework = TextFilterRenderer;
33
+ // }
34
+ col.filter = 'agTextColumnFilter';
35
+ return col;
36
+ }
37
+ }
38
+
39
+ @Component({
40
+ template: `
41
+ <ax-data-grid-filter>
42
+ <ax-text-box label='Filter' allowClear='true' (textChange)='onChange($event)'>
43
+ </ax-text-box>
44
+ </ax-data-grid-filter>
45
+ `,
46
+ changeDetection: ChangeDetectionStrategy.OnPush
47
+ })
48
+ export class TextFilterRenderer implements IFilterAngularComp {
49
+ public value?: string = null;
50
+ private params: IFilterParams;
51
+ private valueGetter: (rowNode: RowNode) => any;
52
+ @ViewChild(AXTextBoxComponent, { static: true })
53
+ private input: AXTextBoxComponent;
54
+
55
+ agInit(params: IFilterParams): void {
56
+ this.params = params;
57
+ this.valueGetter = (params.valueGetter) as any;
58
+ }
59
+
60
+ isFilterActive(): boolean {
61
+ return this.value !== null && this.value !== undefined;
62
+ }
63
+
64
+ doesFilterPass(params: IDoesFilterPassParams): boolean {
65
+ return this.value === this.valueGetter(params.node);
66
+ }
67
+
68
+ getModel(): any {
69
+ return { value: this.value };
70
+ }
71
+
72
+ setModel(model: any): void {
73
+ ;
74
+ this.onChange(model ? model.value : null);
75
+ }
76
+
77
+ ngAfterViewInit(params: IAfterGuiAttachedParams): void {
78
+ window.setTimeout(() => {
79
+ this.input.focus();
80
+ });
81
+ }
82
+
83
+ onChange(newValue): void {
84
+ if (this.value !== newValue) {
85
+ this.value = newValue;
86
+ if (this.value === '') {
87
+ this.value = null;
88
+ }
89
+ this.params.filterChangedCallback();
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,27 @@
1
+ <div class="ax-grid-toolbar" *ngIf="toolbar">
2
+ <ng-content select="ax-toolbar"></ng-content>
3
+ </div>
4
+ <!-- [enableSorting]="true" [enableColResize]="true" [enableFilter]="allowFiltering" -->
5
+ <ag-grid-angular *ngIf="gridView" class="ag-theme-balham" [getRowClass]="internalGetRowClass"
6
+ [style.height]="internalHeight" [columnDefs]="columnDefs" [enableRtl]="rtl" [pagination]="pagination"
7
+ [rowGroupPanelShow]="rowGroupPanelShow" [rowModelType]="rowModelType" [detailRowHeight]="detailRowHeight"
8
+ [getRowHeight]="getRowHeight" [paginationAutoPageSize]="paginationAutoPageSize"
9
+ [paginationPageSize]="paginationPageSize" [suppressMenuHide]="true" [frameworkComponents]="frameworkComponents"
10
+ [isFullWidthCell]="isFullWidthCell" [rowSelection]="selectionMode" [rowMultiSelectWithClick]="rowMultiSelectWithClick"
11
+ [fullWidthCellRendererFramework]="fullWidthCellRendererFramework"
12
+ [fullWidthCellRendererParams]="fullWidthCellRendererParams" (cellClicked)="internalGridCellClicked($event)"
13
+ (cellDoubleClicked)="internalGridCellDoubleClicked($event)" (cellFocused)="internalGridCellFocused($event)"
14
+ (rowClicked)="internalGridRowClicked($event)" (selectionChanged)="internalGridSelectionChanged($event)"
15
+ (rowSelected)="rowSelectionChanged($event)" (rowDoubleClicked)="internalGridRowDoubleClicked($event)"
16
+ (gridReady)="internalGridReady($event)" [groupSelectsChildren]="groupSelectsChildren"
17
+ [suppressRowClickSelection]="suppressRowClickSelection" [groupSelectsFiltered]="true"
18
+ [suppressCellSelection]="suppressCellSelection" [autoGroupColumnDef]="autoGroupColumnDef"
19
+ [suppressAggFuncInHeader]="true" [treeData]="treeData" [animateRows]="true" [isServerSideGroup]="isServerSideGroup"
20
+ [getServerSideGroupKey]="getServerSideGroupKey" [masterDetail]="masterDetail"
21
+ [detailCellRendererParams]="detailCellRendererParams" [detailCellRenderer]="detailCellRenderer"
22
+ (gridSizeChanged)="internalGridSizeChanged($event)" (firstDataRendered)="internalGridFirstDataRendered($event)"
23
+ [localeText]="localeText" [groupHideOpenParents]="groupHideOpenParents" [enableRangeSelection]="true"
24
+ [enableRangeSelection]="false" [allowContextMenuWithControlKey]="false" [getMainMenuItems]="getMainMenuItems">
25
+ </ag-grid-angular>
26
+
27
+ <!-- (displayedColumnsChanged)="displayedColumnsChanged($event)" -->