@guiexpert/angular-table 15.0.5 → 15.0.7

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 (39) hide show
  1. package/.editorconfig +16 -0
  2. package/.vscode/extensions.json +4 -0
  3. package/.vscode/launch.json +20 -0
  4. package/.vscode/tasks.json +42 -0
  5. package/angular.json +40 -0
  6. package/package.json +37 -25
  7. package/projects/angular-table/README.md +117 -0
  8. package/projects/angular-table/ng-package.json +7 -0
  9. package/projects/angular-table/package.json +16 -0
  10. package/projects/angular-table/src/lib/angular-table.component.spec.ts +23 -0
  11. package/projects/angular-table/src/lib/angular-table.service.spec.ts +16 -0
  12. package/projects/angular-table/src/lib/component-renderer.if.ts +12 -0
  13. package/projects/angular-table/src/lib/service/dom-service.ts +63 -0
  14. package/projects/angular-table/src/lib/service/render-wrapper-factory.ts +24 -0
  15. package/projects/angular-table/src/lib/service/renderer-wrapper.ts +86 -0
  16. package/projects/angular-table/src/lib/table.component.css +1 -0
  17. package/projects/angular-table/src/lib/table.component.ts +170 -0
  18. package/{public-api.d.ts → projects/angular-table/src/public-api.ts} +4 -0
  19. package/projects/angular-table/tsconfig.lib.json +14 -0
  20. package/projects/angular-table/tsconfig.lib.prod.json +10 -0
  21. package/projects/angular-table/tsconfig.spec.json +14 -0
  22. package/tsconfig.json +39 -0
  23. package/esm2020/guiexpert-angular-table.mjs +0 -5
  24. package/esm2020/lib/component-renderer.if.mjs +0 -2
  25. package/esm2020/lib/service/dom-service.mjs +0 -56
  26. package/esm2020/lib/service/render-wrapper-factory.mjs +0 -22
  27. package/esm2020/lib/service/renderer-wrapper.mjs +0 -44
  28. package/esm2020/lib/table.component.mjs +0 -101
  29. package/esm2020/public-api.mjs +0 -9
  30. package/fesm2015/guiexpert-angular-table.mjs +0 -225
  31. package/fesm2015/guiexpert-angular-table.mjs.map +0 -1
  32. package/fesm2020/guiexpert-angular-table.mjs +0 -225
  33. package/fesm2020/guiexpert-angular-table.mjs.map +0 -1
  34. package/index.d.ts +0 -5
  35. package/lib/component-renderer.if.d.ts +0 -4
  36. package/lib/service/dom-service.d.ts +0 -17
  37. package/lib/service/render-wrapper-factory.d.ts +0 -13
  38. package/lib/service/renderer-wrapper.d.ts +0 -14
  39. package/lib/table.component.d.ts +0 -39
@@ -1,225 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, Input, EventEmitter, createComponent } from '@angular/core';
3
- import { CommonModule } from '@angular/common';
4
- import { Subject, debounceTime, takeWhile, takeUntil } from 'rxjs';
5
- import { TableOptions, TableScope } from '@guiexpert/table';
6
-
7
- class DomService {
8
- constructor(renderer) {
9
- this.renderer = renderer;
10
- }
11
- setStyle(el, style, value) {
12
- this.renderer.setStyle(el, style, value);
13
- return el;
14
- }
15
- ;
16
- appendText(parent, text) {
17
- const div = this.renderer.createText(text);
18
- this.renderer.appendChild(parent, div);
19
- return div;
20
- }
21
- addClass(div, clazz) {
22
- if (clazz.includes(' ')) {
23
- clazz.split(' ').forEach(c => this.renderer.addClass(div, c));
24
- }
25
- else {
26
- this.renderer.addClass(div, clazz);
27
- }
28
- return div;
29
- }
30
- removeClass(div, clazz) {
31
- if (clazz.includes(" ")) {
32
- clazz.split(" ").forEach(c => div.classList.remove(c));
33
- }
34
- else {
35
- div.classList.remove(clazz);
36
- }
37
- return div;
38
- }
39
- appendChild(parent, child) {
40
- this.renderer.appendChild(parent, child);
41
- }
42
- createElement(name) {
43
- return this.renderer.createElement(name);
44
- }
45
- createText(text) {
46
- return this.renderer.createText(text);
47
- }
48
- setAttribute(ele, key, value) {
49
- this.renderer.setAttribute(ele, key, value);
50
- }
51
- }
52
- DomService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DomService, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Injectable });
53
- DomService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DomService, providedIn: "root" });
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DomService, decorators: [{
55
- type: Injectable,
56
- args: [{
57
- providedIn: "root"
58
- }]
59
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }]; } });
60
-
61
- class TableComponent {
62
- constructor(renderer, elementRef, zone, domService) {
63
- this.renderer = renderer;
64
- this.elementRef = elementRef;
65
- this.zone = zone;
66
- this.domService = domService;
67
- this.tableReady = new Subject();
68
- this.mouseMoved = new Subject();
69
- this.mouseDragging = new Subject();
70
- this.mouseDraggingEnded = new Subject();
71
- this.contextmenu = new Subject();
72
- this.mouseClicked = new Subject();
73
- this.modelChanged = new Subject();
74
- this.checkboxChanged = new Subject();
75
- this.tableOptions = new TableOptions();
76
- this.debounceMouseClickDelay = 150;
77
- this.debounceMouseClick = new Subject();
78
- this.alive = true;
79
- }
80
- onContextmenu(evt) {
81
- this.contextmenu.next(evt);
82
- }
83
- onMouseMoved(evt) {
84
- this.mouseMoved.next(evt);
85
- }
86
- // will be called by table-scope:
87
- onMouseClicked(evt) {
88
- this.debounceMouseClick.next(evt);
89
- }
90
- onCheckboxChanged(arr) {
91
- this.checkboxChanged.next(arr);
92
- }
93
- onModelChanged(evt) {
94
- this.modelChanged.next(evt);
95
- }
96
- ngOnInit() {
97
- this.initModel();
98
- this.debounceMouseClick
99
- .pipe(debounceTime(this.debounceMouseClickDelay), takeWhile(() => this.alive))
100
- .subscribe((value) => {
101
- this.zone.run(() => {
102
- this.mouseClicked.next(value);
103
- });
104
- });
105
- }
106
- ngOnDestroy() {
107
- this.alive = false;
108
- }
109
- onMouseDragging(evt) {
110
- this.mouseDragging.next(evt);
111
- }
112
- onMouseDraggingEnd(evt) {
113
- this.mouseDraggingEnded.next(evt);
114
- }
115
- initModel() {
116
- this.zone.runOutsideAngular(this.init.bind(this));
117
- }
118
- init() {
119
- if (this.tableModel) {
120
- this.tableScope = new TableScope(this.elementRef.nativeElement, this.tableModel, this.domService, this.tableOptions, this);
121
- this.tableScope.firstInit();
122
- this.tableReady.next(this.tableScope.getApi());
123
- }
124
- }
125
- }
126
- TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: DomService }], target: i0.ɵɵFactoryTarget.Component });
127
- TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TableComponent, isStandalone: true, selector: "guiexpert-table", inputs: { tableModel: "tableModel", tableOptions: "tableOptions", debounceMouseClickDelay: "debounceMouseClickDelay" }, outputs: { tableReady: "tableReady", mouseMoved: "mouseMoved", mouseDragging: "mouseDragging", mouseDraggingEnded: "mouseDraggingEnded", contextmenu: "contextmenu", mouseClicked: "mouseClicked", modelChanged: "modelChanged", checkboxChanged: "checkboxChanged" }, providers: [DomService], ngImport: i0, template: "", isInline: true, styles: ["@import\"node_modules/@guiexpert/table/css/main.css\";\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
128
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableComponent, decorators: [{
129
- type: Component,
130
- args: [{ selector: "guiexpert-table", standalone: true, imports: [CommonModule], providers: [DomService], template: "", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["@import\"node_modules/@guiexpert/table/css/main.css\";\n"] }]
131
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: DomService }]; }, propDecorators: { tableReady: [{
132
- type: Output
133
- }], mouseMoved: [{
134
- type: Output
135
- }], mouseDragging: [{
136
- type: Output
137
- }], mouseDraggingEnded: [{
138
- type: Output
139
- }], contextmenu: [{
140
- type: Output
141
- }], mouseClicked: [{
142
- type: Output
143
- }], modelChanged: [{
144
- type: Output
145
- }], checkboxChanged: [{
146
- type: Output
147
- }], tableModel: [{
148
- type: Input
149
- }], tableOptions: [{
150
- type: Input
151
- }], debounceMouseClickDelay: [{
152
- type: Input
153
- }] } });
154
-
155
- class RendererWrapper {
156
- constructor(componentType, appRef, injector, cdr, zone) {
157
- this.componentType = componentType;
158
- this.appRef = appRef;
159
- this.injector = injector;
160
- this.cdr = cdr;
161
- this.zone = zone;
162
- this.event$ = new EventEmitter();
163
- this.closed$ = new Subject();
164
- }
165
- render(cellDiv, rowIndex, columnIndex, areaIdent, areaModel, cellValue, domService) {
166
- const componentRef = createComponent(this.componentType, {
167
- environmentInjector: this.injector
168
- });
169
- componentRef.instance.setData(rowIndex, columnIndex, areaIdent, areaModel, cellValue);
170
- const emmiterNames = Object.keys(componentRef.instance)
171
- .filter(key => {
172
- // @ts-ignore
173
- const t = componentRef.instance[key];
174
- return t['subscribe'];
175
- });
176
- // @ts-ignore
177
- const observables = (emmiterNames.map(key => componentRef.instance[key]));
178
- observables.forEach(obs => obs
179
- .pipe(takeUntil(this.closed$))
180
- .subscribe((event) => {
181
- console.info('RendererWrapper event >', event); // TODO hmm?
182
- this.event$.next(event);
183
- }));
184
- cellDiv.appendChild(componentRef.location.nativeElement);
185
- this.appRef.attachView(componentRef.hostView);
186
- this.zone.run(() => {
187
- this.cdr.detectChanges();
188
- });
189
- return () => {
190
- // clean up:
191
- this.appRef.detachView(componentRef.hostView);
192
- this.closed$.next(Date.now());
193
- };
194
- }
195
- }
196
-
197
- class RenderWrapperFactory {
198
- constructor(appRef, injector, zone) {
199
- this.appRef = appRef;
200
- this.injector = injector;
201
- this.zone = zone;
202
- }
203
- create(componentType, cdr) {
204
- return new RendererWrapper(componentType, this.appRef, this.injector, cdr, this.zone);
205
- }
206
- }
207
- RenderWrapperFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RenderWrapperFactory, deps: [{ token: i0.ApplicationRef }, { token: i0.EnvironmentInjector }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
208
- RenderWrapperFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RenderWrapperFactory, providedIn: "root" });
209
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RenderWrapperFactory, decorators: [{
210
- type: Injectable,
211
- args: [{
212
- providedIn: "root"
213
- }]
214
- }], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i0.EnvironmentInjector }, { type: i0.NgZone }]; } });
215
-
216
- /*
217
- * Public API Surface of angular-table
218
- */
219
-
220
- /**
221
- * Generated bundle index. Do not edit.
222
- */
223
-
224
- export { DomService, RenderWrapperFactory, RendererWrapper, TableComponent };
225
- //# sourceMappingURL=guiexpert-angular-table.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"guiexpert-angular-table.mjs","sources":["../../../projects/angular-table/src/lib/service/dom-service.ts","../../../projects/angular-table/src/lib/table.component.ts","../../../projects/angular-table/src/lib/service/renderer-wrapper.ts","../../../projects/angular-table/src/lib/service/render-wrapper-factory.ts","../../../projects/angular-table/src/public-api.ts","../../../projects/angular-table/src/guiexpert-angular-table.ts"],"sourcesContent":["import {Injectable, Renderer2} from \"@angular/core\";\nimport {DomServiceIf} from \"@guiexpert/table\";\n\n\n@Injectable({\n providedIn: \"root\"\n})\nexport class DomService implements DomServiceIf {\n\n constructor(\n readonly renderer: Renderer2,\n ) {\n }\n\n setStyle(el: any, style: string, value: any): any {\n this.renderer.setStyle(el, style, value);\n return el;\n };\n\n\n appendText(parent: HTMLDivElement, text: string): HTMLDivElement {\n const div = this.renderer.createText(text);\n this.renderer.appendChild(parent, div);\n return div;\n }\n\n\n addClass(div: HTMLDivElement, clazz: string) {\n if (clazz.includes(' ')) {\n clazz.split(' ').forEach(c => this.renderer.addClass(div, c))\n } else {\n this.renderer.addClass(div, clazz);\n }\n return div;\n }\n\n removeClass(div: HTMLDivElement, clazz: string) {\n if (clazz.includes(\" \")) {\n clazz.split(\" \").forEach(c => div.classList.remove(c));\n } else {\n div.classList.remove(clazz);\n }\n return div;\n }\n\n appendChild(parent: HTMLElement, child: HTMLElement): void {\n this.renderer.appendChild(parent, child);\n }\n\n createElement<T>(name: string): T {\n return this.renderer.createElement(name);\n }\n\n createText(text: string): HTMLElement {\n return this.renderer.createText(text);\n }\n\n setAttribute(ele: HTMLElement, key: string, value: string): void {\n this.renderer.setAttribute(ele, key, value);\n }\n\n\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n Output,\n Renderer2,\n ViewEncapsulation\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { debounceTime, Subject, takeWhile } from \"rxjs\";\nimport {\n EventListenerIf,\n GeModelChangeEvent,\n GeMouseEvent,\n TableApi,\n TableModelIf,\n TableOptions,\n TableOptionsIf,\n TableScope\n} from \"@guiexpert/table\";\nimport { DomService } from \"./service/dom-service\";\n\n\n@Component({\n selector: \"guiexpert-table\",\n standalone: true,\n imports: [CommonModule],\n providers: [DomService],\n template: \"\",\n styleUrls: [\n \"./table.component.css\"\n ],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TableComponent implements OnInit, OnDestroy, EventListenerIf {\n\n @Output()\n tableReady = new Subject<TableApi>();\n\n @Output()\n mouseMoved: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();\n\n @Output()\n mouseDragging: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();\n\n @Output()\n mouseDraggingEnded: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();\n\n @Output()\n contextmenu: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();\n\n @Output()\n mouseClicked: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();\n\n @Output()\n modelChanged: Subject<GeModelChangeEvent> = new Subject<GeModelChangeEvent>();\n\n @Output()\n checkboxChanged: Subject<any[]> = new Subject<any[]>();\n\n @Input()\n tableModel?: TableModelIf;\n\n @Input()\n tableOptions: TableOptionsIf = new TableOptions();\n\n @Input()\n debounceMouseClickDelay: number = 150;\n\n private debounceMouseClick: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();\n\n private tableScope?: TableScope;\n private alive = true;\n\n\n constructor(\n private readonly renderer: Renderer2,\n private readonly elementRef: ElementRef,\n private readonly zone: NgZone,\n private readonly domService: DomService\n ) {\n }\n\n\n onContextmenu(evt: GeMouseEvent): void {\n this.contextmenu.next(evt);\n }\n\n onMouseMoved(evt: GeMouseEvent): void {\n this.mouseMoved.next(evt);\n }\n\n // will be called by table-scope:\n onMouseClicked(evt: GeMouseEvent): void {\n this.debounceMouseClick.next(evt);\n }\n\n onCheckboxChanged(arr: any[]): void {\n this.checkboxChanged.next(arr);\n }\n\n onModelChanged(evt: GeModelChangeEvent): void {\n this.modelChanged.next(evt);\n }\n\n ngOnInit(): void {\n this.initModel();\n this.debounceMouseClick\n .pipe(\n debounceTime(this.debounceMouseClickDelay),\n takeWhile(() => this.alive)\n )\n .subscribe((value) => {\n this.zone.run(() => {\n this.mouseClicked.next(value);\n });\n });\n }\n\n ngOnDestroy(): void {\n this.alive = false;\n }\n\n\n onMouseDragging(evt: GeMouseEvent): void {\n this.mouseDragging.next(evt);\n }\n\n onMouseDraggingEnd(evt: GeMouseEvent): void {\n this.mouseDraggingEnded.next(evt);\n }\n\n\n private initModel() {\n this.zone.runOutsideAngular(this.init.bind(this));\n }\n\n private init() {\n if (this.tableModel) {\n this.tableScope = new TableScope(\n this.elementRef.nativeElement, this.tableModel, this.domService, this.tableOptions, this\n );\n this.tableScope.firstInit();\n this.tableReady.next(this.tableScope.getApi());\n }\n }\n\n\n}\n","import {AreaIdent, AreaModelIf, CellRendererIf, DomServiceIf, RendererCleanupFnType} from \"@guiexpert/table\";\nimport {\n ApplicationRef,\n ChangeDetectorRef,\n createComponent,\n EnvironmentInjector,\n EventEmitter,\n NgZone,\n Type\n} from \"@angular/core\";\nimport {ComponentRendererIf} from \"../component-renderer.if\";\nimport {Subject, takeUntil} from \"rxjs\";\nimport {Observable} from \"rxjs/internal/Observable\";\n\n\nexport class RendererWrapper<T extends ComponentRendererIf<T>>\n implements CellRendererIf {\n\n public readonly event$ = new EventEmitter<any>();\n private readonly closed$ = new Subject<number>();\n\n constructor(\n private componentType: Type<ComponentRendererIf<T>>,\n private appRef: ApplicationRef,\n private injector: EnvironmentInjector,\n private cdr: ChangeDetectorRef,\n private readonly zone: NgZone\n ) {\n }\n\n render(\n cellDiv: HTMLDivElement,\n rowIndex: number,\n columnIndex: number,\n areaIdent: AreaIdent,\n areaModel: AreaModelIf,\n cellValue: any,\n domService: DomServiceIf): RendererCleanupFnType | undefined {\n\n const componentRef = createComponent(this.componentType, {\n environmentInjector: this.injector\n });\n componentRef.instance.setData(\n rowIndex,\n columnIndex,\n areaIdent,\n areaModel,\n cellValue);\n\n\n const emmiterNames = Object.keys(componentRef.instance)\n .filter(key => {\n // @ts-ignore\n const t = componentRef.instance[key];\n return t['subscribe']\n });\n\n // @ts-ignore\n const observables: Observable[] = (emmiterNames.map(key => (componentRef.instance[key] as Observable)));\n observables.forEach(obs => obs\n .pipe(\n takeUntil(this.closed$)\n )\n .subscribe((event: any) => {\n console.info('RendererWrapper event >', event); // TODO hmm?\n this.event$.next(event);\n })\n );\n\n cellDiv.appendChild(componentRef.location.nativeElement);\n\n this.appRef.attachView(componentRef.hostView);\n\n this.zone.run(() => {\n this.cdr.detectChanges();\n });\n\n return () => {\n // clean up:\n this.appRef.detachView(componentRef.hostView);\n this.closed$.next(Date.now());\n };\n }\n\n\n}\n","import {ApplicationRef, ChangeDetectorRef, EnvironmentInjector, Injectable, NgZone, Type} from \"@angular/core\";\nimport {ComponentRendererIf} from \"../component-renderer.if\";\nimport {RendererWrapper} from \"./renderer-wrapper\";\n\n@Injectable({\n providedIn: \"root\"\n})\nexport class RenderWrapperFactory {\n\n constructor(\n private readonly appRef: ApplicationRef,\n private readonly injector: EnvironmentInjector,\n private readonly zone: NgZone\n ) {\n }\n\n create<T>(\n componentType: Type<ComponentRendererIf<T>>,\n cdr: ChangeDetectorRef\n ) {\n return new RendererWrapper(componentType, this.appRef, this.injector, cdr, this.zone);\n }\n\n}\n","/*\n * Public API Surface of angular-table\n */\n\nexport * from './lib/table.component';\nexport * from './lib/component-renderer.if';\nexport * from './lib/service/dom-service';\nexport * from './lib/service/renderer-wrapper';\nexport * from './lib/service/render-wrapper-factory';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.DomService"],"mappings":";;;;;;MAOa,UAAU,CAAA;AAErB,IAAA,WAAA,CACW,QAAmB,EAAA;AAAnB,QAAA,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAW;KAE7B;AAED,IAAA,QAAQ,CAAC,EAAO,EAAE,KAAa,EAAE,KAAU,EAAA;QACzC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACzC,QAAA,OAAO,EAAE,CAAC;KACX;;IAGD,UAAU,CAAC,MAAsB,EAAE,IAAY,EAAA;QAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACvC,QAAA,OAAO,GAAG,CAAC;KACZ;IAGD,QAAQ,CAAC,GAAmB,EAAE,KAAa,EAAA;AACzC,QAAA,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACvB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAA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AA,EAAA,CAAA;kBAHhC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACND;;AAEG;;ACFH;;AAEG;;;;"}
@@ -1,225 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, Input, EventEmitter, createComponent } from '@angular/core';
3
- import { CommonModule } from '@angular/common';
4
- import { Subject, debounceTime, takeWhile, takeUntil } from 'rxjs';
5
- import { TableOptions, TableScope } from '@guiexpert/table';
6
-
7
- class DomService {
8
- constructor(renderer) {
9
- this.renderer = renderer;
10
- }
11
- setStyle(el, style, value) {
12
- this.renderer.setStyle(el, style, value);
13
- return el;
14
- }
15
- ;
16
- appendText(parent, text) {
17
- const div = this.renderer.createText(text);
18
- this.renderer.appendChild(parent, div);
19
- return div;
20
- }
21
- addClass(div, clazz) {
22
- if (clazz.includes(' ')) {
23
- clazz.split(' ').forEach(c => this.renderer.addClass(div, c));
24
- }
25
- else {
26
- this.renderer.addClass(div, clazz);
27
- }
28
- return div;
29
- }
30
- removeClass(div, clazz) {
31
- if (clazz.includes(" ")) {
32
- clazz.split(" ").forEach(c => div.classList.remove(c));
33
- }
34
- else {
35
- div.classList.remove(clazz);
36
- }
37
- return div;
38
- }
39
- appendChild(parent, child) {
40
- this.renderer.appendChild(parent, child);
41
- }
42
- createElement(name) {
43
- return this.renderer.createElement(name);
44
- }
45
- createText(text) {
46
- return this.renderer.createText(text);
47
- }
48
- setAttribute(ele, key, value) {
49
- this.renderer.setAttribute(ele, key, value);
50
- }
51
- }
52
- DomService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DomService, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Injectable });
53
- DomService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DomService, providedIn: "root" });
54
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DomService, decorators: [{
55
- type: Injectable,
56
- args: [{
57
- providedIn: "root"
58
- }]
59
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }]; } });
60
-
61
- class TableComponent {
62
- constructor(renderer, elementRef, zone, domService) {
63
- this.renderer = renderer;
64
- this.elementRef = elementRef;
65
- this.zone = zone;
66
- this.domService = domService;
67
- this.tableReady = new Subject();
68
- this.mouseMoved = new Subject();
69
- this.mouseDragging = new Subject();
70
- this.mouseDraggingEnded = new Subject();
71
- this.contextmenu = new Subject();
72
- this.mouseClicked = new Subject();
73
- this.modelChanged = new Subject();
74
- this.checkboxChanged = new Subject();
75
- this.tableOptions = new TableOptions();
76
- this.debounceMouseClickDelay = 150;
77
- this.debounceMouseClick = new Subject();
78
- this.alive = true;
79
- }
80
- onContextmenu(evt) {
81
- this.contextmenu.next(evt);
82
- }
83
- onMouseMoved(evt) {
84
- this.mouseMoved.next(evt);
85
- }
86
- // will be called by table-scope:
87
- onMouseClicked(evt) {
88
- this.debounceMouseClick.next(evt);
89
- }
90
- onCheckboxChanged(arr) {
91
- this.checkboxChanged.next(arr);
92
- }
93
- onModelChanged(evt) {
94
- this.modelChanged.next(evt);
95
- }
96
- ngOnInit() {
97
- this.initModel();
98
- this.debounceMouseClick
99
- .pipe(debounceTime(this.debounceMouseClickDelay), takeWhile(() => this.alive))
100
- .subscribe((value) => {
101
- this.zone.run(() => {
102
- this.mouseClicked.next(value);
103
- });
104
- });
105
- }
106
- ngOnDestroy() {
107
- this.alive = false;
108
- }
109
- onMouseDragging(evt) {
110
- this.mouseDragging.next(evt);
111
- }
112
- onMouseDraggingEnd(evt) {
113
- this.mouseDraggingEnded.next(evt);
114
- }
115
- initModel() {
116
- this.zone.runOutsideAngular(this.init.bind(this));
117
- }
118
- init() {
119
- if (this.tableModel) {
120
- this.tableScope = new TableScope(this.elementRef.nativeElement, this.tableModel, this.domService, this.tableOptions, this);
121
- this.tableScope.firstInit();
122
- this.tableReady.next(this.tableScope.getApi());
123
- }
124
- }
125
- }
126
- TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: DomService }], target: i0.ɵɵFactoryTarget.Component });
127
- TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TableComponent, isStandalone: true, selector: "guiexpert-table", inputs: { tableModel: "tableModel", tableOptions: "tableOptions", debounceMouseClickDelay: "debounceMouseClickDelay" }, outputs: { tableReady: "tableReady", mouseMoved: "mouseMoved", mouseDragging: "mouseDragging", mouseDraggingEnded: "mouseDraggingEnded", contextmenu: "contextmenu", mouseClicked: "mouseClicked", modelChanged: "modelChanged", checkboxChanged: "checkboxChanged" }, providers: [DomService], ngImport: i0, template: "", isInline: true, styles: ["@import\"node_modules/@guiexpert/table/css/main.css\";\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
128
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableComponent, decorators: [{
129
- type: Component,
130
- args: [{ selector: "guiexpert-table", standalone: true, imports: [CommonModule], providers: [DomService], template: "", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["@import\"node_modules/@guiexpert/table/css/main.css\";\n"] }]
131
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: DomService }]; }, propDecorators: { tableReady: [{
132
- type: Output
133
- }], mouseMoved: [{
134
- type: Output
135
- }], mouseDragging: [{
136
- type: Output
137
- }], mouseDraggingEnded: [{
138
- type: Output
139
- }], contextmenu: [{
140
- type: Output
141
- }], mouseClicked: [{
142
- type: Output
143
- }], modelChanged: [{
144
- type: Output
145
- }], checkboxChanged: [{
146
- type: Output
147
- }], tableModel: [{
148
- type: Input
149
- }], tableOptions: [{
150
- type: Input
151
- }], debounceMouseClickDelay: [{
152
- type: Input
153
- }] } });
154
-
155
- class RendererWrapper {
156
- constructor(componentType, appRef, injector, cdr, zone) {
157
- this.componentType = componentType;
158
- this.appRef = appRef;
159
- this.injector = injector;
160
- this.cdr = cdr;
161
- this.zone = zone;
162
- this.event$ = new EventEmitter();
163
- this.closed$ = new Subject();
164
- }
165
- render(cellDiv, rowIndex, columnIndex, areaIdent, areaModel, cellValue, domService) {
166
- const componentRef = createComponent(this.componentType, {
167
- environmentInjector: this.injector
168
- });
169
- componentRef.instance.setData(rowIndex, columnIndex, areaIdent, areaModel, cellValue);
170
- const emmiterNames = Object.keys(componentRef.instance)
171
- .filter(key => {
172
- // @ts-ignore
173
- const t = componentRef.instance[key];
174
- return t['subscribe'];
175
- });
176
- // @ts-ignore
177
- const observables = (emmiterNames.map(key => componentRef.instance[key]));
178
- observables.forEach(obs => obs
179
- .pipe(takeUntil(this.closed$))
180
- .subscribe((event) => {
181
- console.info('RendererWrapper event >', event); // TODO hmm?
182
- this.event$.next(event);
183
- }));
184
- cellDiv.appendChild(componentRef.location.nativeElement);
185
- this.appRef.attachView(componentRef.hostView);
186
- this.zone.run(() => {
187
- this.cdr.detectChanges();
188
- });
189
- return () => {
190
- // clean up:
191
- this.appRef.detachView(componentRef.hostView);
192
- this.closed$.next(Date.now());
193
- };
194
- }
195
- }
196
-
197
- class RenderWrapperFactory {
198
- constructor(appRef, injector, zone) {
199
- this.appRef = appRef;
200
- this.injector = injector;
201
- this.zone = zone;
202
- }
203
- create(componentType, cdr) {
204
- return new RendererWrapper(componentType, this.appRef, this.injector, cdr, this.zone);
205
- }
206
- }
207
- RenderWrapperFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RenderWrapperFactory, deps: [{ token: i0.ApplicationRef }, { token: i0.EnvironmentInjector }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
208
- RenderWrapperFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RenderWrapperFactory, providedIn: "root" });
209
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RenderWrapperFactory, decorators: [{
210
- type: Injectable,
211
- args: [{
212
- providedIn: "root"
213
- }]
214
- }], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i0.EnvironmentInjector }, { type: i0.NgZone }]; } });
215
-
216
- /*
217
- * Public API Surface of angular-table
218
- */
219
-
220
- /**
221
- * Generated bundle index. Do not edit.
222
- */
223
-
224
- export { DomService, RenderWrapperFactory, RendererWrapper, TableComponent };
225
- //# sourceMappingURL=guiexpert-angular-table.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"guiexpert-angular-table.mjs","sources":["../../../projects/angular-table/src/lib/service/dom-service.ts","../../../projects/angular-table/src/lib/table.component.ts","../../../projects/angular-table/src/lib/service/renderer-wrapper.ts","../../../projects/angular-table/src/lib/service/render-wrapper-factory.ts","../../../projects/angular-table/src/public-api.ts","../../../projects/angular-table/src/guiexpert-angular-table.ts"],"sourcesContent":["import {Injectable, Renderer2} from \"@angular/core\";\nimport {DomServiceIf} from \"@guiexpert/table\";\n\n\n@Injectable({\n providedIn: \"root\"\n})\nexport class DomService implements DomServiceIf {\n\n constructor(\n readonly renderer: Renderer2,\n ) {\n }\n\n setStyle(el: any, style: string, value: any): any {\n this.renderer.setStyle(el, style, value);\n return el;\n };\n\n\n appendText(parent: HTMLDivElement, text: string): HTMLDivElement {\n const div = this.renderer.createText(text);\n this.renderer.appendChild(parent, div);\n return div;\n }\n\n\n addClass(div: HTMLDivElement, clazz: string) {\n if (clazz.includes(' ')) {\n clazz.split(' ').forEach(c => this.renderer.addClass(div, c))\n } else {\n this.renderer.addClass(div, clazz);\n }\n return div;\n }\n\n removeClass(div: HTMLDivElement, clazz: string) {\n if (clazz.includes(\" \")) {\n clazz.split(\" \").forEach(c => div.classList.remove(c));\n } else {\n div.classList.remove(clazz);\n }\n return div;\n }\n\n appendChild(parent: HTMLElement, child: HTMLElement): void {\n this.renderer.appendChild(parent, child);\n }\n\n createElement<T>(name: string): T {\n return this.renderer.createElement(name);\n }\n\n createText(text: string): HTMLElement {\n return this.renderer.createText(text);\n }\n\n setAttribute(ele: HTMLElement, key: string, value: string): void {\n this.renderer.setAttribute(ele, key, value);\n }\n\n\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n Output,\n Renderer2,\n ViewEncapsulation\n} from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { debounceTime, Subject, takeWhile } from \"rxjs\";\nimport {\n EventListenerIf,\n GeModelChangeEvent,\n GeMouseEvent,\n TableApi,\n TableModelIf,\n TableOptions,\n TableOptionsIf,\n TableScope\n} from \"@guiexpert/table\";\nimport { DomService } from \"./service/dom-service\";\n\n\n@Component({\n selector: \"guiexpert-table\",\n standalone: true,\n imports: [CommonModule],\n providers: [DomService],\n template: \"\",\n styleUrls: [\n \"./table.component.css\"\n ],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TableComponent implements OnInit, OnDestroy, EventListenerIf {\n\n @Output()\n tableReady = new Subject<TableApi>();\n\n @Output()\n mouseMoved: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();\n\n @Output()\n mouseDragging: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();\n\n @Output()\n mouseDraggingEnded: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();\n\n @Output()\n contextmenu: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();\n\n @Output()\n mouseClicked: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();\n\n @Output()\n modelChanged: Subject<GeModelChangeEvent> = new Subject<GeModelChangeEvent>();\n\n @Output()\n checkboxChanged: Subject<any[]> = new Subject<any[]>();\n\n @Input()\n tableModel?: TableModelIf;\n\n @Input()\n tableOptions: TableOptionsIf = new TableOptions();\n\n @Input()\n debounceMouseClickDelay: number = 150;\n\n private debounceMouseClick: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();\n\n private tableScope?: TableScope;\n private alive = true;\n\n\n constructor(\n private readonly renderer: Renderer2,\n private readonly elementRef: ElementRef,\n private readonly zone: NgZone,\n private readonly domService: DomService\n ) {\n }\n\n\n onContextmenu(evt: GeMouseEvent): void {\n this.contextmenu.next(evt);\n }\n\n onMouseMoved(evt: GeMouseEvent): void {\n this.mouseMoved.next(evt);\n }\n\n // will be called by table-scope:\n onMouseClicked(evt: GeMouseEvent): void {\n this.debounceMouseClick.next(evt);\n }\n\n onCheckboxChanged(arr: any[]): void {\n this.checkboxChanged.next(arr);\n }\n\n onModelChanged(evt: GeModelChangeEvent): void {\n this.modelChanged.next(evt);\n }\n\n ngOnInit(): void {\n this.initModel();\n this.debounceMouseClick\n .pipe(\n debounceTime(this.debounceMouseClickDelay),\n takeWhile(() => this.alive)\n )\n .subscribe((value) => {\n this.zone.run(() => {\n this.mouseClicked.next(value);\n });\n });\n }\n\n ngOnDestroy(): void {\n this.alive = false;\n }\n\n\n onMouseDragging(evt: GeMouseEvent): void {\n this.mouseDragging.next(evt);\n }\n\n onMouseDraggingEnd(evt: GeMouseEvent): void {\n this.mouseDraggingEnded.next(evt);\n }\n\n\n private initModel() {\n this.zone.runOutsideAngular(this.init.bind(this));\n }\n\n private init() {\n if (this.tableModel) {\n this.tableScope = new TableScope(\n this.elementRef.nativeElement, this.tableModel, this.domService, this.tableOptions, this\n );\n this.tableScope.firstInit();\n this.tableReady.next(this.tableScope.getApi());\n }\n }\n\n\n}\n","import {AreaIdent, AreaModelIf, CellRendererIf, DomServiceIf, RendererCleanupFnType} from \"@guiexpert/table\";\nimport {\n ApplicationRef,\n ChangeDetectorRef,\n createComponent,\n EnvironmentInjector,\n EventEmitter,\n NgZone,\n Type\n} from \"@angular/core\";\nimport {ComponentRendererIf} from \"../component-renderer.if\";\nimport {Subject, takeUntil} from \"rxjs\";\nimport {Observable} from \"rxjs/internal/Observable\";\n\n\nexport class RendererWrapper<T extends ComponentRendererIf<T>>\n implements CellRendererIf {\n\n public readonly event$ = new EventEmitter<any>();\n private readonly closed$ = new Subject<number>();\n\n constructor(\n private componentType: Type<ComponentRendererIf<T>>,\n private appRef: ApplicationRef,\n private injector: EnvironmentInjector,\n private cdr: ChangeDetectorRef,\n private readonly zone: NgZone\n ) {\n }\n\n render(\n cellDiv: HTMLDivElement,\n rowIndex: number,\n columnIndex: number,\n areaIdent: AreaIdent,\n areaModel: AreaModelIf,\n cellValue: any,\n domService: DomServiceIf): RendererCleanupFnType | undefined {\n\n const componentRef = createComponent(this.componentType, {\n environmentInjector: this.injector\n });\n componentRef.instance.setData(\n rowIndex,\n columnIndex,\n areaIdent,\n areaModel,\n cellValue);\n\n\n const emmiterNames = Object.keys(componentRef.instance)\n .filter(key => {\n // @ts-ignore\n const t = componentRef.instance[key];\n return t['subscribe']\n });\n\n // @ts-ignore\n const observables: Observable[] = (emmiterNames.map(key => (componentRef.instance[key] as Observable)));\n observables.forEach(obs => obs\n .pipe(\n takeUntil(this.closed$)\n )\n .subscribe((event: any) => {\n console.info('RendererWrapper event >', event); // TODO hmm?\n this.event$.next(event);\n })\n );\n\n cellDiv.appendChild(componentRef.location.nativeElement);\n\n this.appRef.attachView(componentRef.hostView);\n\n this.zone.run(() => {\n this.cdr.detectChanges();\n });\n\n return () => {\n // clean up:\n this.appRef.detachView(componentRef.hostView);\n this.closed$.next(Date.now());\n };\n }\n\n\n}\n","import {ApplicationRef, ChangeDetectorRef, EnvironmentInjector, Injectable, NgZone, Type} from \"@angular/core\";\nimport {ComponentRendererIf} from \"../component-renderer.if\";\nimport {RendererWrapper} from \"./renderer-wrapper\";\n\n@Injectable({\n providedIn: \"root\"\n})\nexport class RenderWrapperFactory {\n\n constructor(\n private readonly appRef: ApplicationRef,\n private readonly injector: EnvironmentInjector,\n private readonly zone: NgZone\n ) {\n }\n\n create<T>(\n componentType: Type<ComponentRendererIf<T>>,\n cdr: ChangeDetectorRef\n ) {\n return new RendererWrapper(componentType, this.appRef, this.injector, cdr, this.zone);\n }\n\n}\n","/*\n * Public API Surface of angular-table\n */\n\nexport * from './lib/table.component';\nexport * from './lib/component-renderer.if';\nexport * from './lib/service/dom-service';\nexport * from './lib/service/renderer-wrapper';\nexport * from './lib/service/render-wrapper-factory';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.DomService"],"mappings":";;;;;;MAOa,UAAU,CAAA;AAErB,IAAA,WAAA,CACW,QAAmB,EAAA;QAAnB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAW;KAE7B;AAED,IAAA,QAAQ,CAAC,EAAO,EAAE,KAAa,EAAE,KAAU,EAAA;QACzC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACzC,QAAA,OAAO,EAAE,CAAC;KACX;;IAGD,UAAU,CAAC,MAAsB,EAAE,IAAY,EAAA;QAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACvC,QAAA,OAAO,GAAG,CAAC;KACZ;IAGD,QAAQ,CAAC,GAAmB,EAAE,KAAa,EAAA;AACzC,QAAA,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACvB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;AAC9D,SAAA;AAAM,aAAA;Y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;AAEG;;;;"}
package/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@guiexpert/angular-table" />
5
- export * from './public-api';
@@ -1,4 +0,0 @@
1
- import { AreaIdent, AreaModelIf, RendererCleanupFnType } from "@guiexpert/table";
2
- export interface ComponentRendererIf<T> {
3
- setData(rowIndex: number, columnIndex: number, areaIdent: AreaIdent, areaModel: AreaModelIf, cellValue: any): RendererCleanupFnType | undefined;
4
- }
@@ -1,17 +0,0 @@
1
- import { Renderer2 } from "@angular/core";
2
- import { DomServiceIf } from "@guiexpert/table";
3
- import * as i0 from "@angular/core";
4
- export declare class DomService implements DomServiceIf {
5
- readonly renderer: Renderer2;
6
- constructor(renderer: Renderer2);
7
- setStyle(el: any, style: string, value: any): any;
8
- appendText(parent: HTMLDivElement, text: string): HTMLDivElement;
9
- addClass(div: HTMLDivElement, clazz: string): HTMLDivElement;
10
- removeClass(div: HTMLDivElement, clazz: string): HTMLDivElement;
11
- appendChild(parent: HTMLElement, child: HTMLElement): void;
12
- createElement<T>(name: string): T;
13
- createText(text: string): HTMLElement;
14
- setAttribute(ele: HTMLElement, key: string, value: string): void;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<DomService, never>;
16
- static ɵprov: i0.ɵɵInjectableDeclaration<DomService>;
17
- }
@@ -1,13 +0,0 @@
1
- import { ApplicationRef, ChangeDetectorRef, EnvironmentInjector, NgZone, Type } from "@angular/core";
2
- import { ComponentRendererIf } from "../component-renderer.if";
3
- import { RendererWrapper } from "./renderer-wrapper";
4
- import * as i0 from "@angular/core";
5
- export declare class RenderWrapperFactory {
6
- private readonly appRef;
7
- private readonly injector;
8
- private readonly zone;
9
- constructor(appRef: ApplicationRef, injector: EnvironmentInjector, zone: NgZone);
10
- create<T>(componentType: Type<ComponentRendererIf<T>>, cdr: ChangeDetectorRef): RendererWrapper<ComponentRendererIf<T>>;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<RenderWrapperFactory, never>;
12
- static ɵprov: i0.ɵɵInjectableDeclaration<RenderWrapperFactory>;
13
- }
@@ -1,14 +0,0 @@
1
- import { AreaIdent, AreaModelIf, CellRendererIf, DomServiceIf, RendererCleanupFnType } from "@guiexpert/table";
2
- import { ApplicationRef, ChangeDetectorRef, EnvironmentInjector, EventEmitter, NgZone, Type } from "@angular/core";
3
- import { ComponentRendererIf } from "../component-renderer.if";
4
- export declare class RendererWrapper<T extends ComponentRendererIf<T>> implements CellRendererIf {
5
- private componentType;
6
- private appRef;
7
- private injector;
8
- private cdr;
9
- private readonly zone;
10
- readonly event$: EventEmitter<any>;
11
- private readonly closed$;
12
- constructor(componentType: Type<ComponentRendererIf<T>>, appRef: ApplicationRef, injector: EnvironmentInjector, cdr: ChangeDetectorRef, zone: NgZone);
13
- render(cellDiv: HTMLDivElement, rowIndex: number, columnIndex: number, areaIdent: AreaIdent, areaModel: AreaModelIf, cellValue: any, domService: DomServiceIf): RendererCleanupFnType | undefined;
14
- }
@@ -1,39 +0,0 @@
1
- import { ElementRef, NgZone, OnDestroy, OnInit, Renderer2 } from "@angular/core";
2
- import { Subject } from "rxjs";
3
- import { EventListenerIf, GeModelChangeEvent, GeMouseEvent, TableApi, TableModelIf, TableOptionsIf } from "@guiexpert/table";
4
- import { DomService } from "./service/dom-service";
5
- import * as i0 from "@angular/core";
6
- export declare class TableComponent implements OnInit, OnDestroy, EventListenerIf {
7
- private readonly renderer;
8
- private readonly elementRef;
9
- private readonly zone;
10
- private readonly domService;
11
- tableReady: Subject<TableApi>;
12
- mouseMoved: Subject<GeMouseEvent>;
13
- mouseDragging: Subject<GeMouseEvent>;
14
- mouseDraggingEnded: Subject<GeMouseEvent>;
15
- contextmenu: Subject<GeMouseEvent>;
16
- mouseClicked: Subject<GeMouseEvent>;
17
- modelChanged: Subject<GeModelChangeEvent>;
18
- checkboxChanged: Subject<any[]>;
19
- tableModel?: TableModelIf;
20
- tableOptions: TableOptionsIf;
21
- debounceMouseClickDelay: number;
22
- private debounceMouseClick;
23
- private tableScope?;
24
- private alive;
25
- constructor(renderer: Renderer2, elementRef: ElementRef, zone: NgZone, domService: DomService);
26
- onContextmenu(evt: GeMouseEvent): void;
27
- onMouseMoved(evt: GeMouseEvent): void;
28
- onMouseClicked(evt: GeMouseEvent): void;
29
- onCheckboxChanged(arr: any[]): void;
30
- onModelChanged(evt: GeModelChangeEvent): void;
31
- ngOnInit(): void;
32
- ngOnDestroy(): void;
33
- onMouseDragging(evt: GeMouseEvent): void;
34
- onMouseDraggingEnd(evt: GeMouseEvent): void;
35
- private initModel;
36
- private init;
37
- static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, never>;
38
- static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "guiexpert-table", never, { "tableModel": "tableModel"; "tableOptions": "tableOptions"; "debounceMouseClickDelay": "debounceMouseClickDelay"; }, { "tableReady": "tableReady"; "mouseMoved": "mouseMoved"; "mouseDragging": "mouseDragging"; "mouseDraggingEnded": "mouseDraggingEnded"; "contextmenu": "contextmenu"; "mouseClicked": "mouseClicked"; "modelChanged": "modelChanged"; "checkboxChanged": "checkboxChanged"; }, never, never, true, never>;
39
- }