@guiexpert/angular-table 15.0.0 → 15.0.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.
Files changed (38) hide show
  1. package/README.md +104 -2
  2. package/esm2020/guiexpert-angular-table.mjs +5 -0
  3. package/esm2020/lib/component-renderer.if.mjs +2 -0
  4. package/esm2020/lib/service/dom-service.mjs +56 -0
  5. package/esm2020/lib/service/render-wrapper-factory.mjs +22 -0
  6. package/esm2020/lib/service/renderer-wrapper.mjs +44 -0
  7. package/esm2020/lib/table.component.mjs +97 -0
  8. package/esm2020/public-api.mjs +9 -0
  9. package/fesm2015/guiexpert-angular-table.mjs +221 -0
  10. package/fesm2015/guiexpert-angular-table.mjs.map +1 -0
  11. package/fesm2020/guiexpert-angular-table.mjs +221 -0
  12. package/fesm2020/guiexpert-angular-table.mjs.map +1 -0
  13. package/index.d.ts +5 -0
  14. package/lib/component-renderer.if.d.ts +4 -0
  15. package/lib/service/dom-service.d.ts +17 -0
  16. package/lib/service/render-wrapper-factory.d.ts +13 -0
  17. package/lib/service/renderer-wrapper.d.ts +14 -0
  18. package/lib/table.component.d.ts +39 -0
  19. package/package.json +24 -7
  20. package/public-api.d.ts +5 -0
  21. package/.eslintrc.json +0 -46
  22. package/.idea/angular-table.iml +0 -12
  23. package/.idea/modules.xml +0 -8
  24. package/.idea/vcs.xml +0 -6
  25. package/ng-package.json +0 -7
  26. package/project.json +0 -37
  27. package/src/index.ts +0 -5
  28. package/src/lib/angular-table/component-renderer.if.ts +0 -12
  29. package/src/lib/angular-table/service/dom-service.ts +0 -54
  30. package/src/lib/angular-table/service/render-wrapper-factory.ts +0 -24
  31. package/src/lib/angular-table/service/renderer-wrapper.ts +0 -86
  32. package/src/lib/angular-table/table-color-classes.css +0 -90
  33. package/src/lib/angular-table/table-color-vars.css +0 -141
  34. package/src/lib/angular-table/table.component.css +0 -88
  35. package/src/lib/angular-table/table.component.ts +0 -152
  36. package/tsconfig.json +0 -28
  37. package/tsconfig.lib.json +0 -18
  38. package/tsconfig.lib.prod.json +0 -9
@@ -0,0 +1,221 @@
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) => this.mouseClicked.next(value));
101
+ }
102
+ ngOnDestroy() {
103
+ this.alive = false;
104
+ }
105
+ onMouseDragging(evt) {
106
+ this.mouseDragging.next(evt);
107
+ }
108
+ onMouseDraggingEnd(evt) {
109
+ this.mouseDraggingEnded.next(evt);
110
+ }
111
+ initModel() {
112
+ this.zone.runOutsideAngular(this.init.bind(this));
113
+ }
114
+ init() {
115
+ if (this.tableModel) {
116
+ this.tableScope = new TableScope(this.elementRef.nativeElement, this.tableModel, this.domService, this.tableOptions, this);
117
+ this.tableScope.firstInit();
118
+ this.tableReady.next(this.tableScope.getApi());
119
+ }
120
+ }
121
+ }
122
+ 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 });
123
+ 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\"../../../../table/css/table-classes.css\";@import\"../../../../table/css/table-tree.css\";@import\"../../../../table/css/table-color-vars.css\";@import\"../../../../table/css/table-color-classes.css\";\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
124
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableComponent, decorators: [{
125
+ type: Component,
126
+ args: [{ selector: "guiexpert-table", standalone: true, imports: [CommonModule], providers: [DomService], template: "", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["@import\"../../../../table/css/table-classes.css\";@import\"../../../../table/css/table-tree.css\";@import\"../../../../table/css/table-color-vars.css\";@import\"../../../../table/css/table-color-classes.css\";\n"] }]
127
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: DomService }]; }, propDecorators: { tableReady: [{
128
+ type: Output
129
+ }], mouseMoved: [{
130
+ type: Output
131
+ }], mouseDragging: [{
132
+ type: Output
133
+ }], mouseDraggingEnded: [{
134
+ type: Output
135
+ }], contextmenu: [{
136
+ type: Output
137
+ }], mouseClicked: [{
138
+ type: Output
139
+ }], modelChanged: [{
140
+ type: Output
141
+ }], checkboxChanged: [{
142
+ type: Output
143
+ }], tableModel: [{
144
+ type: Input
145
+ }], tableOptions: [{
146
+ type: Input
147
+ }], debounceMouseClickDelay: [{
148
+ type: Input
149
+ }] } });
150
+
151
+ class RendererWrapper {
152
+ constructor(componentType, appRef, injector, cdr, zone) {
153
+ this.componentType = componentType;
154
+ this.appRef = appRef;
155
+ this.injector = injector;
156
+ this.cdr = cdr;
157
+ this.zone = zone;
158
+ this.event$ = new EventEmitter();
159
+ this.closed$ = new Subject();
160
+ }
161
+ render(cellDiv, rowIndex, columnIndex, areaIdent, areaModel, cellValue, domService) {
162
+ const componentRef = createComponent(this.componentType, {
163
+ environmentInjector: this.injector
164
+ });
165
+ componentRef.instance.setData(rowIndex, columnIndex, areaIdent, areaModel, cellValue);
166
+ const emmiterNames = Object.keys(componentRef.instance)
167
+ .filter(key => {
168
+ // @ts-ignore
169
+ const t = componentRef.instance[key];
170
+ return t['subscribe'];
171
+ });
172
+ // @ts-ignore
173
+ const observables = (emmiterNames.map(key => componentRef.instance[key]));
174
+ observables.forEach(obs => obs
175
+ .pipe(takeUntil(this.closed$))
176
+ .subscribe((event) => {
177
+ console.info('RendererWrapper event >', event); // TODO hmm?
178
+ this.event$.next(event);
179
+ }));
180
+ cellDiv.appendChild(componentRef.location.nativeElement);
181
+ this.appRef.attachView(componentRef.hostView);
182
+ this.zone.run(() => {
183
+ this.cdr.detectChanges();
184
+ });
185
+ return () => {
186
+ // clean up:
187
+ this.appRef.detachView(componentRef.hostView);
188
+ this.closed$.next(Date.now());
189
+ };
190
+ }
191
+ }
192
+
193
+ class RenderWrapperFactory {
194
+ constructor(appRef, injector, zone) {
195
+ this.appRef = appRef;
196
+ this.injector = injector;
197
+ this.zone = zone;
198
+ }
199
+ create(componentType, cdr) {
200
+ return new RendererWrapper(componentType, this.appRef, this.injector, cdr, this.zone);
201
+ }
202
+ }
203
+ 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 });
204
+ RenderWrapperFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RenderWrapperFactory, providedIn: "root" });
205
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RenderWrapperFactory, decorators: [{
206
+ type: Injectable,
207
+ args: [{
208
+ providedIn: "root"
209
+ }]
210
+ }], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i0.EnvironmentInjector }, { type: i0.NgZone }]; } });
211
+
212
+ /*
213
+ * Public API Surface of angular-table
214
+ */
215
+
216
+ /**
217
+ * Generated bundle index. Do not edit.
218
+ */
219
+
220
+ export { DomService, RenderWrapperFactory, RendererWrapper, TableComponent };
221
+ //# sourceMappingURL=guiexpert-angular-table.mjs.map
@@ -0,0 +1 @@
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) => this.mouseClicked.next(value));\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,GAAm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oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACND;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@guiexpert/angular-table" />
5
+ export * from './public-api';
@@ -0,0 +1,4 @@
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
+ }
@@ -0,0 +1,17 @@
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
+ }
@@ -0,0 +1,13 @@
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
+ }
@@ -0,0 +1,14 @@
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
+ }
@@ -0,0 +1,39 @@
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
+ }
package/package.json CHANGED
@@ -1,14 +1,31 @@
1
1
  {
2
2
  "name": "@guiexpert/angular-table",
3
- "version": "15.0.0",
4
- "scripts": {
5
- "publish": "npm publish"
6
- },
3
+ "version": "15.0.2",
7
4
  "peerDependencies": {
8
- "@angular/common": "^15.0.0",
9
- "@angular/core": "^15.0.0"
5
+ "@angular/common": "^15.2.12",
6
+ "@angular/core": "^15.2.12"
10
7
  },
11
8
  "dependencies": {
12
9
  "tslib": "^2.3.0"
10
+ },
11
+ "sideEffects": false,
12
+ "module": "fesm2015/guiexpert-angular-table.mjs",
13
+ "es2020": "fesm2020/guiexpert-angular-table.mjs",
14
+ "esm2020": "esm2020/guiexpert-angular-table.mjs",
15
+ "fesm2020": "fesm2020/guiexpert-angular-table.mjs",
16
+ "fesm2015": "fesm2015/guiexpert-angular-table.mjs",
17
+ "typings": "index.d.ts",
18
+ "exports": {
19
+ "./package.json": {
20
+ "default": "./package.json"
21
+ },
22
+ ".": {
23
+ "types": "./index.d.ts",
24
+ "esm2020": "./esm2020/guiexpert-angular-table.mjs",
25
+ "es2020": "./fesm2020/guiexpert-angular-table.mjs",
26
+ "es2015": "./fesm2015/guiexpert-angular-table.mjs",
27
+ "node": "./fesm2015/guiexpert-angular-table.mjs",
28
+ "default": "./fesm2020/guiexpert-angular-table.mjs"
29
+ }
13
30
  }
14
- }
31
+ }
@@ -0,0 +1,5 @@
1
+ export * from './lib/table.component';
2
+ export * from './lib/component-renderer.if';
3
+ export * from './lib/service/dom-service';
4
+ export * from './lib/service/renderer-wrapper';
5
+ export * from './lib/service/render-wrapper-factory';
package/.eslintrc.json DELETED
@@ -1,46 +0,0 @@
1
- {
2
- "extends": [
3
- "../../.eslintrc.json"
4
- ],
5
- "ignorePatterns": [
6
- "!**/*"
7
- ],
8
- "overrides": [
9
- {
10
- "files": [
11
- "*.ts"
12
- ],
13
- "extends": [
14
- "plugin:@nrwl/nx/angular",
15
- "plugin:@angular-eslint/template/process-inline-templates"
16
- ],
17
- "rules": {
18
- "@angular-eslint/directive-selector": [
19
- "error",
20
- {
21
- "type": "attribute",
22
- "prefix": "guiexpert",
23
- "style": "camelCase"
24
- }
25
- ],
26
- "@angular-eslint/component-selector": [
27
- "error",
28
- {
29
- "type": "element",
30
- "prefix": "guiexpert",
31
- "style": "kebab-case"
32
- }
33
- ]
34
- }
35
- },
36
- {
37
- "files": [
38
- "*.html"
39
- ],
40
- "extends": [
41
- "plugin:@nrwl/nx/angular-template"
42
- ],
43
- "rules": {}
44
- }
45
- ]
46
- }
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
- <excludeFolder url="file://$MODULE_DIR$/temp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/angular-table.iml" filepath="$PROJECT_DIR$/.idea/angular-table.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
package/ng-package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
- "dest": "../../dist/libs/angular-table",
4
- "lib": {
5
- "entryFile": "src/index.ts"
6
- }
7
- }
package/project.json DELETED
@@ -1,37 +0,0 @@
1
- {
2
- "name": "@guiexpert/angular-table",
3
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
- "projectType": "library",
5
- "sourceRoot": "libs/angular-table/src",
6
- "prefix": "guiexpert",
7
- "targets": {
8
- "build": {
9
- "executor": "@nrwl/angular:package",
10
- "outputs": [
11
- "dist/libs/angular-table"
12
- ],
13
- "options": {
14
- "project": "libs/angular-table/ng-package.json"
15
- },
16
- "configurations": {
17
- "production": {
18
- "tsConfig": "libs/angular-table/tsconfig.lib.prod.json"
19
- },
20
- "development": {
21
- "tsConfig": "libs/angular-table/tsconfig.lib.json"
22
- }
23
- },
24
- "defaultConfiguration": "production"
25
- },
26
- "lint": {
27
- "executor": "@nrwl/linter:eslint",
28
- "options": {
29
- "lintFilePatterns": [
30
- "libs/angular-table/**/*.ts",
31
- "libs/angular-table/**/*.html"
32
- ]
33
- }
34
- }
35
- },
36
- "tags": []
37
- }
package/src/index.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from './lib/angular-table/table.component';
2
- export * from './lib/angular-table/component-renderer.if';
3
- export * from './lib/angular-table/service/dom-service';
4
- export * from './lib/angular-table/service/renderer-wrapper';
5
- export * from './lib/angular-table/service/render-wrapper-factory';
@@ -1,12 +0,0 @@
1
- import {AreaIdent, AreaModelIf, RendererCleanupFnType} from "@guiexpert/table";
2
-
3
- export interface ComponentRendererIf<T> {
4
-
5
- setData(
6
- rowIndex: number,
7
- columnIndex: number,
8
- areaIdent: AreaIdent,
9
- areaModel: AreaModelIf,
10
- cellValue: any): RendererCleanupFnType | undefined;
11
-
12
- }
@@ -1,54 +0,0 @@
1
- import {Injectable, Renderer2} from "@angular/core";
2
- import {DomServiceIf} from "@guiexpert/table";
3
-
4
-
5
- @Injectable({
6
- providedIn: "root"
7
- })
8
- export class DomService implements DomServiceIf {
9
-
10
- constructor(
11
- readonly renderer: Renderer2,
12
- ) {
13
- }
14
-
15
- setStyle(el: any, style: string, value: any): any {
16
- this.renderer.setStyle(el, style, value);
17
- return el;
18
- };
19
-
20
-
21
- appendText(parent: HTMLDivElement, text: string): HTMLDivElement {
22
- const div = this.renderer.createText(text);
23
- this.renderer.appendChild(parent, div);
24
- return div;
25
- }
26
-
27
-
28
- addClass(div: HTMLDivElement, clazz: string) {
29
- if (clazz.includes(' ')) {
30
- clazz.split(' ').forEach(c => this.renderer.addClass(div, c))
31
- } else {
32
- this.renderer.addClass(div, clazz);
33
- }
34
- return div;
35
- }
36
-
37
- appendChild(parent: HTMLElement, child: HTMLElement): void {
38
- this.renderer.appendChild(parent, child);
39
- }
40
-
41
- createElement<T>(name: string): T {
42
- return this.renderer.createElement(name);
43
- }
44
-
45
- createText(text: string): HTMLElement {
46
- return this.renderer.createText(text);
47
- }
48
-
49
- setAttribute(ele: HTMLElement, key: string, value: string): void {
50
- this.renderer.setAttribute(ele, key, value);
51
- }
52
-
53
-
54
- }
@@ -1,24 +0,0 @@
1
- import {ApplicationRef, ChangeDetectorRef, EnvironmentInjector, Injectable, NgZone, Type} from "@angular/core";
2
- import {ComponentRendererIf} from "../component-renderer.if";
3
- import {RendererWrapper} from "./renderer-wrapper";
4
-
5
- @Injectable({
6
- providedIn: "root"
7
- })
8
- export class RenderWrapperFactory {
9
-
10
- constructor(
11
- private readonly appRef: ApplicationRef,
12
- private readonly injector: EnvironmentInjector,
13
- private readonly zone: NgZone
14
- ) {
15
- }
16
-
17
- create<T>(
18
- componentType: Type<ComponentRendererIf<T>>,
19
- cdr: ChangeDetectorRef
20
- ) {
21
- return new RendererWrapper(componentType, this.appRef, this.injector, cdr, this.zone);
22
- }
23
-
24
- }