@guiexpert/angular-table 15.0.7 → 15.0.18

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/esm2020/guiexpert-angular-table.mjs +5 -0
  2. package/esm2020/lib/component-renderer.if.mjs +2 -0
  3. package/esm2020/lib/service/dom-service.mjs +56 -0
  4. package/esm2020/lib/service/render-wrapper-factory.mjs +22 -0
  5. package/esm2020/lib/service/renderer-wrapper.mjs +44 -0
  6. package/esm2020/lib/table.component.mjs +113 -0
  7. package/esm2020/public-api.mjs +9 -0
  8. package/fesm2015/guiexpert-angular-table.mjs +237 -0
  9. package/fesm2015/guiexpert-angular-table.mjs.map +1 -0
  10. package/fesm2020/guiexpert-angular-table.mjs +237 -0
  11. package/fesm2020/guiexpert-angular-table.mjs.map +1 -0
  12. package/index.d.ts +5 -0
  13. package/lib/component-renderer.if.d.ts +4 -0
  14. package/lib/service/dom-service.d.ts +17 -0
  15. package/lib/service/render-wrapper-factory.d.ts +13 -0
  16. package/lib/service/renderer-wrapper.d.ts +14 -0
  17. package/lib/table.component.d.ts +43 -0
  18. package/package.json +25 -37
  19. package/{projects/angular-table/src/public-api.ts → public-api.d.ts} +0 -4
  20. package/.editorconfig +0 -16
  21. package/.vscode/extensions.json +0 -4
  22. package/.vscode/launch.json +0 -20
  23. package/.vscode/tasks.json +0 -42
  24. package/angular.json +0 -40
  25. package/projects/angular-table/README.md +0 -117
  26. package/projects/angular-table/ng-package.json +0 -7
  27. package/projects/angular-table/package.json +0 -16
  28. package/projects/angular-table/src/lib/angular-table.component.spec.ts +0 -23
  29. package/projects/angular-table/src/lib/angular-table.service.spec.ts +0 -16
  30. package/projects/angular-table/src/lib/component-renderer.if.ts +0 -12
  31. package/projects/angular-table/src/lib/service/dom-service.ts +0 -63
  32. package/projects/angular-table/src/lib/service/render-wrapper-factory.ts +0 -24
  33. package/projects/angular-table/src/lib/service/renderer-wrapper.ts +0 -86
  34. package/projects/angular-table/src/lib/table.component.css +0 -1
  35. package/projects/angular-table/src/lib/table.component.ts +0 -170
  36. package/projects/angular-table/tsconfig.lib.json +0 -14
  37. package/projects/angular-table/tsconfig.lib.prod.json +0 -10
  38. package/projects/angular-table/tsconfig.spec.json +0 -14
  39. package/tsconfig.json +0 -39
@@ -1,117 +0,0 @@
1
- # @guiexpert/angular-table
2
-
3
- This is the angular component of the GuiExpert Table Project.
4
-
5
- ## Become a master at creating web applications with large tables
6
-
7
- This is the UI-agnostic table component for your next web app. 😊
8
-
9
- <img src="https://raw.githubusercontent.com/guiexperttable/ge-table/main/apps/table-website/src/assets/screens/heatmap.png" width="50%">
10
-
11
- ### Version compatibility
12
-
13
-
14
- | Angular | @guiexpert/angular-table |
15
- |:-----------------------|:-------------------------|
16
- | 17.x.x | ^17.0.0 |
17
- | 16.x.x | ^16.0.7 |
18
- | 15.x.x | ^15.0.2 |
19
- | 14.x.x | ^14.0.3 |
20
- |
21
-
22
-
23
- ### Features
24
- - Handle large datasets easily
25
- - Excellent performance for large tables by vertical and horizontal virtual scrolling
26
- - Fully-featured (advanced sorting and filtering)
27
- - Highly customizable orderData grid
28
- - Outstanding performance
29
- - No third-party dependencies
30
- - UI-agnostic
31
- - Column Interactions (resize, reorder)
32
- - Sorting Rows
33
- - Row, Column, and Range Selection
34
- - Single and Multi Selection
35
- - UI-agnostic
36
- - Row and Column Spanning
37
- - Fixed Columns (Left and Right)
38
- - Tree table (Hierarchical View)
39
- - Accessibility support: Keyboard Shortcuts
40
- - Custom Filtering
41
- - In-place Cell Editing
42
- - Userdefined Key and Mouse Events
43
- - Customizable Look & Feel (via CSS variables)
44
- - Row sorting
45
- - Column Reordering (Drag and Drop)
46
- - State Persistence (Row Sorting, Column Order, Selection)
47
- - Customizable Cell Contents via Renderer for Header, Body and Footer
48
- - Full control over the HTML structure and style
49
-
50
-
51
- ## Links
52
-
53
- - [Demos](https://gui.expert/demos)
54
- - [Documentation](https://gui.expert/doc)
55
- - [API](https://gui.expert/api)
56
-
57
- ## Get Started
58
-
59
- Add the following two NPM packages to your existing angular project (run this in your project root directory):
60
-
61
- ```
62
- npm install --save @guiexpert/table @guiexpert/angular-table
63
- ```
64
-
65
- Import the (standalone) TableComponent in your angular module:
66
-
67
- ```
68
- @NgModule({
69
- imports: [
70
- CommonModule,
71
- TableComponent, ...
72
- ```
73
-
74
- Add guiexpert-table component to a template:
75
-
76
- ```
77
- <guiexpert-table
78
- [tableModel]="tableModel"
79
- [tableOptions]="tableOptions"
80
- class="table-div"
81
- ></guiexpert-table>
82
- ```
83
-
84
-
85
- Add two properties (tableModel and tableOptions) to the component:
86
-
87
- ```
88
- import {
89
- TableFactory,
90
- TableModelIf,
91
- TableOptions,
92
- TableOptionsIf
93
- } from "@guiexpert/table";
94
-
95
- tableModel: TableModelIf = TableFactory.createTableModel({
96
- headerData: [
97
- ['Header 1', 'Header 2']
98
- ],
99
- bodyData: [
100
- ['Text 1a', 'Text 2a'],
101
- ['Text 1b', 'Text 2b'],
102
- ]
103
- });
104
-
105
- tableOptions = {
106
- ...new TableOptions(),
107
- hoverColumnVisible: false,
108
- defaultRowHeights: {
109
- header: 40,
110
- body: 34,
111
- footer: 0
112
- }
113
-
114
- ```
115
-
116
- There are numerous possibilities to create table models.
117
- Please refer to the [Documentation](https://gui.expert/doc) for further information or the [Demo](https://gui.expert/demos) section for examples.
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
- "dest": "../../dist/angular-table",
4
- "lib": {
5
- "entryFile": "src/public-api.ts"
6
- }
7
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "@guiexpert/angular-table",
3
- "version": "15.0.6",
4
- "peerDependencies": {
5
- "@angular/common": "^15.2.12",
6
- "@angular/core": "^15.2.12"
7
- },
8
- "scripts": {
9
- "git-config": "git config --global url.\"https://\".insteadOf ssh://",
10
- "npm-pub:angular-table": "npm publish ../../dist/angular-table --access public --tag a15"
11
- },
12
- "dependencies": {
13
- "tslib": "^2.3.0"
14
- },
15
- "sideEffects": false
16
- }
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { AngularTableComponent } from './angular-table.component';
4
-
5
- describe('AngularTableComponent', () => {
6
- let component: AngularTableComponent;
7
- let fixture: ComponentFixture<AngularTableComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [AngularTableComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(AngularTableComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,16 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
-
3
- import { AngularTableService } from './angular-table.service';
4
-
5
- describe('AngularTableService', () => {
6
- let service: AngularTableService;
7
-
8
- beforeEach(() => {
9
- TestBed.configureTestingModule({});
10
- service = TestBed.inject(AngularTableService);
11
- });
12
-
13
- it('should be created', () => {
14
- expect(service).toBeTruthy();
15
- });
16
- });
@@ -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,63 +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
- removeClass(div: HTMLDivElement, clazz: string) {
38
- if (clazz.includes(" ")) {
39
- clazz.split(" ").forEach(c => div.classList.remove(c));
40
- } else {
41
- div.classList.remove(clazz);
42
- }
43
- return div;
44
- }
45
-
46
- appendChild(parent: HTMLElement, child: HTMLElement): void {
47
- this.renderer.appendChild(parent, child);
48
- }
49
-
50
- createElement<T>(name: string): T {
51
- return this.renderer.createElement(name);
52
- }
53
-
54
- createText(text: string): HTMLElement {
55
- return this.renderer.createText(text);
56
- }
57
-
58
- setAttribute(ele: HTMLElement, key: string, value: string): void {
59
- this.renderer.setAttribute(ele, key, value);
60
- }
61
-
62
-
63
- }
@@ -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
- }
@@ -1,86 +0,0 @@
1
- import {AreaIdent, AreaModelIf, CellRendererIf, DomServiceIf, RendererCleanupFnType} from "@guiexpert/table";
2
- import {
3
- ApplicationRef,
4
- ChangeDetectorRef,
5
- createComponent,
6
- EnvironmentInjector,
7
- EventEmitter,
8
- NgZone,
9
- Type
10
- } from "@angular/core";
11
- import {ComponentRendererIf} from "../component-renderer.if";
12
- import {Subject, takeUntil} from "rxjs";
13
- import {Observable} from "rxjs/internal/Observable";
14
-
15
-
16
- export class RendererWrapper<T extends ComponentRendererIf<T>>
17
- implements CellRendererIf {
18
-
19
- public readonly event$ = new EventEmitter<any>();
20
- private readonly closed$ = new Subject<number>();
21
-
22
- constructor(
23
- private componentType: Type<ComponentRendererIf<T>>,
24
- private appRef: ApplicationRef,
25
- private injector: EnvironmentInjector,
26
- private cdr: ChangeDetectorRef,
27
- private readonly zone: NgZone
28
- ) {
29
- }
30
-
31
- render(
32
- cellDiv: HTMLDivElement,
33
- rowIndex: number,
34
- columnIndex: number,
35
- areaIdent: AreaIdent,
36
- areaModel: AreaModelIf,
37
- cellValue: any,
38
- domService: DomServiceIf): RendererCleanupFnType | undefined {
39
-
40
- const componentRef = createComponent(this.componentType, {
41
- environmentInjector: this.injector
42
- });
43
- componentRef.instance.setData(
44
- rowIndex,
45
- columnIndex,
46
- areaIdent,
47
- areaModel,
48
- cellValue);
49
-
50
-
51
- const emmiterNames = Object.keys(componentRef.instance)
52
- .filter(key => {
53
- // @ts-ignore
54
- const t = componentRef.instance[key];
55
- return t['subscribe']
56
- });
57
-
58
- // @ts-ignore
59
- const observables: Observable[] = (emmiterNames.map(key => (componentRef.instance[key] as Observable)));
60
- observables.forEach(obs => obs
61
- .pipe(
62
- takeUntil(this.closed$)
63
- )
64
- .subscribe((event: any) => {
65
- console.info('RendererWrapper event >', event); // TODO hmm?
66
- this.event$.next(event);
67
- })
68
- );
69
-
70
- cellDiv.appendChild(componentRef.location.nativeElement);
71
-
72
- this.appRef.attachView(componentRef.hostView);
73
-
74
- this.zone.run(() => {
75
- this.cdr.detectChanges();
76
- });
77
-
78
- return () => {
79
- // clean up:
80
- this.appRef.detachView(componentRef.hostView);
81
- this.closed$.next(Date.now());
82
- };
83
- }
84
-
85
-
86
- }
@@ -1 +0,0 @@
1
- @import "node_modules/@guiexpert/table/css/main.css";
@@ -1,170 +0,0 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- ElementRef,
5
- Input,
6
- NgZone,
7
- OnDestroy,
8
- OnInit,
9
- Output,
10
- Renderer2,
11
- ViewEncapsulation
12
- } from "@angular/core";
13
- import { CommonModule } from "@angular/common";
14
- import { debounceTime, Subject, takeWhile } from "rxjs";
15
- import {
16
- EventListenerIf, FocusModelIf,
17
- GeModelChangeEvent,
18
- GeMouseEvent, SelectionModelIf,
19
- TableApi,
20
- TableModelIf,
21
- TableOptions,
22
- TableOptionsIf,
23
- TableScope
24
- } from '@guiexpert/table';
25
- import { DomService } from "./service/dom-service";
26
-
27
-
28
- @Component({
29
- selector: "guiexpert-table",
30
- standalone: true,
31
- imports: [CommonModule],
32
- providers: [DomService],
33
- template: "",
34
- styleUrls: [
35
- "./table.component.css"
36
- ],
37
- encapsulation: ViewEncapsulation.None,
38
- changeDetection: ChangeDetectionStrategy.OnPush
39
- })
40
- export class TableComponent implements OnInit, OnDestroy, EventListenerIf {
41
-
42
- @Output()
43
- tableReady = new Subject<TableApi>();
44
-
45
- @Output()
46
- mouseMoved: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();
47
-
48
- @Output()
49
- mouseDragging: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();
50
-
51
- @Output()
52
- mouseDraggingEnded: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();
53
-
54
- @Output()
55
- contextmenu: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();
56
-
57
- @Output()
58
- mouseClicked: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();
59
-
60
- @Output()
61
- modelChanged: Subject<GeModelChangeEvent> = new Subject<GeModelChangeEvent>();
62
-
63
-
64
- @Output()
65
- selectionChanged: Subject<SelectionModelIf> = new Subject<SelectionModelIf>();
66
-
67
- @Output()
68
- focusChanged: Subject<FocusModelIf> = new Subject<FocusModelIf>();
69
-
70
- @Output()
71
- checkboxChanged: Subject<any[]> = new Subject<any[]>();
72
-
73
- @Input()
74
- tableModel?: TableModelIf;
75
-
76
- @Input()
77
- tableOptions: TableOptionsIf = new TableOptions();
78
-
79
- @Input()
80
- debounceMouseClickDelay: number = 150;
81
-
82
- private debounceMouseClick: Subject<GeMouseEvent> = new Subject<GeMouseEvent>();
83
-
84
- private tableScope?: TableScope;
85
- private alive = true;
86
-
87
-
88
- constructor(
89
- private readonly renderer: Renderer2,
90
- private readonly elementRef: ElementRef,
91
- private readonly zone: NgZone,
92
- private readonly domService: DomService
93
- ) {
94
- }
95
-
96
-
97
- onSelectionChanged(model: SelectionModelIf): void {
98
- this.selectionChanged.next(model);
99
- }
100
-
101
- onFocusChanged(model: FocusModelIf): void {
102
- this.focusChanged.next(model);
103
- }
104
-
105
-
106
- onContextmenu(evt: GeMouseEvent): void {
107
- this.contextmenu.next(evt);
108
- }
109
-
110
- onMouseMoved(evt: GeMouseEvent): void {
111
- this.mouseMoved.next(evt);
112
- }
113
-
114
- // will be called by table-scope:
115
- onMouseClicked(evt: GeMouseEvent): void {
116
- this.debounceMouseClick.next(evt);
117
- }
118
-
119
- onCheckboxChanged(arr: any[]): void {
120
- this.checkboxChanged.next(arr);
121
- }
122
-
123
- onModelChanged(evt: GeModelChangeEvent): void {
124
- this.modelChanged.next(evt);
125
- }
126
-
127
- ngOnInit(): void {
128
- this.initModel();
129
- this.debounceMouseClick
130
- .pipe(
131
- debounceTime(this.debounceMouseClickDelay),
132
- takeWhile(() => this.alive)
133
- )
134
- .subscribe((value) => {
135
- this.zone.run(() => {
136
- this.mouseClicked.next(value);
137
- });
138
- });
139
- }
140
-
141
- ngOnDestroy(): void {
142
- this.alive = false;
143
- }
144
-
145
-
146
- onMouseDragging(evt: GeMouseEvent): void {
147
- this.mouseDragging.next(evt);
148
- }
149
-
150
- onMouseDraggingEnd(evt: GeMouseEvent): void {
151
- this.mouseDraggingEnded.next(evt);
152
- }
153
-
154
-
155
- private initModel() {
156
- this.zone.runOutsideAngular(this.init.bind(this));
157
- }
158
-
159
- private init() {
160
- if (this.tableModel) {
161
- this.tableScope = new TableScope(
162
- this.elementRef.nativeElement, this.tableModel, this.domService, this.tableOptions, this
163
- );
164
- this.tableScope.firstInit();
165
- this.tableReady.next(this.tableScope.getApi());
166
- }
167
- }
168
-
169
-
170
- }
@@ -1,14 +0,0 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "extends": "../../tsconfig.json",
4
- "compilerOptions": {
5
- "outDir": "../../out-tsc/lib",
6
- "declaration": true,
7
- "declarationMap": true,
8
- "inlineSources": true,
9
- "types": []
10
- },
11
- "exclude": [
12
- "**/*.spec.ts"
13
- ]
14
- }
@@ -1,10 +0,0 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "extends": "./tsconfig.lib.json",
4
- "compilerOptions": {
5
- "declarationMap": false
6
- },
7
- "angularCompilerOptions": {
8
- "compilationMode": "partial"
9
- }
10
- }
@@ -1,14 +0,0 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "extends": "../../tsconfig.json",
4
- "compilerOptions": {
5
- "outDir": "../../out-tsc/spec",
6
- "types": [
7
- "jasmine"
8
- ]
9
- },
10
- "include": [
11
- "**/*.spec.ts",
12
- "**/*.d.ts"
13
- ]
14
- }
package/tsconfig.json DELETED
@@ -1,39 +0,0 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "compileOnSave": false,
4
- "compilerOptions": {
5
- "baseUrl": "./",
6
- "paths": {
7
- "angular-table": [
8
- "./dist/angular-table"
9
- ]
10
- },
11
- "outDir": "./dist/out-tsc",
12
- "forceConsistentCasingInFileNames": true,
13
- "strict": true,
14
- "noImplicitOverride": true,
15
- "noPropertyAccessFromIndexSignature": true,
16
- "noImplicitReturns": true,
17
- "noFallthroughCasesInSwitch": true,
18
- "skipLibCheck": true,
19
- "esModuleInterop": true,
20
- "sourceMap": true,
21
- "declaration": false,
22
- "experimentalDecorators": true,
23
- "moduleResolution": "node",
24
- "importHelpers": true,
25
- "target": "ES2022",
26
- "module": "ES2022",
27
- "useDefineForClassFields": false,
28
- "lib": [
29
- "ES2022",
30
- "dom"
31
- ]
32
- },
33
- "angularCompilerOptions": {
34
- "enableI18nLegacyMessageIdFormat": false,
35
- "strictInjectionParameters": true,
36
- "strictInputAccessModifiers": true,
37
- "strictTemplates": true
38
- }
39
- }