@sci-grid/angular 1.0.1 → 1.0.4
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.
- package/package.json +13 -2
- package/src/index.test.ts +0 -8
- package/src/index.ts +0 -41
- package/tsconfig.json +0 -13
- package/vite.config.ts +0 -33
package/package.json
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sci-grid/angular",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"require": "./dist/index.cjs"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
8
19
|
"peerDependencies": {
|
|
9
20
|
"@angular/core": ">=16.0.0",
|
|
10
21
|
"@angular/common": ">=16.0.0",
|
|
11
|
-
"@sci-grid/core": "1.0.
|
|
22
|
+
"@sci-grid/core": "1.0.4"
|
|
12
23
|
},
|
|
13
24
|
"devDependencies": {
|
|
14
25
|
"@angular/core": "^18.0.0",
|
package/src/index.test.ts
DELETED
package/src/index.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Component, ElementRef, Input, type OnChanges, type OnDestroy, type OnInit, type SimpleChanges, ViewChild } from '@angular/core';
|
|
2
|
-
import { SciGrid } from '@sci-grid/core';
|
|
3
|
-
import type { GridConfig, IDataGridProvider } from '@sci-grid/core';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* SciGrid Angular Adapter
|
|
7
|
-
* Enterprise-ready grid component for Angular applications.
|
|
8
|
-
*/
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'sci-grid',
|
|
11
|
-
template: `<div #gridContainer style="width: 100%; height: 100%; min-height: 400px;"></div>`,
|
|
12
|
-
standalone: true
|
|
13
|
-
})
|
|
14
|
-
export class SciGridAngular implements OnInit, OnChanges, OnDestroy {
|
|
15
|
-
@ViewChild('gridContainer', { static: true }) gridContainer!: ElementRef;
|
|
16
|
-
|
|
17
|
-
@Input() provider!: IDataGridProvider;
|
|
18
|
-
@Input() config: Partial<GridConfig> = {};
|
|
19
|
-
|
|
20
|
-
private grid: SciGrid | null = null;
|
|
21
|
-
|
|
22
|
-
ngOnInit() {
|
|
23
|
-
this.grid = new SciGrid(this.gridContainer.nativeElement, this.provider, this.config);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
ngOnChanges(changes: SimpleChanges) {
|
|
27
|
-
if (!this.grid) return;
|
|
28
|
-
|
|
29
|
-
if (changes['provider']) {
|
|
30
|
-
this.grid.updateProvider(this.provider);
|
|
31
|
-
}
|
|
32
|
-
if (changes['config']) {
|
|
33
|
-
this.grid.updateConfig(this.config);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
ngOnDestroy() {
|
|
38
|
-
this.grid?.destroy();
|
|
39
|
-
this.grid = null;
|
|
40
|
-
}
|
|
41
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "./dist",
|
|
5
|
-
"experimentalDecorators": true,
|
|
6
|
-
"emitDecoratorMetadata": true,
|
|
7
|
-
"useDefineForClassFields": false,
|
|
8
|
-
"noEmit": false,
|
|
9
|
-
"declaration": true,
|
|
10
|
-
"emitDeclarationOnly": true
|
|
11
|
-
},
|
|
12
|
-
"include": ["src"]
|
|
13
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import dts from 'vite-plugin-dts';
|
|
3
|
-
import { resolve } from 'path';
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
plugins: [dts()],
|
|
7
|
-
build: {
|
|
8
|
-
lib: {
|
|
9
|
-
entry: resolve(__dirname, 'src/index.ts'),
|
|
10
|
-
name: 'SciGridAngular',
|
|
11
|
-
fileName: 'index',
|
|
12
|
-
formats: ['es', 'cjs']
|
|
13
|
-
},
|
|
14
|
-
rollupOptions: {
|
|
15
|
-
external: ['@angular/core', '@angular/common', '@sci-grid/core', 'rxjs', 'zone.js'],
|
|
16
|
-
output: {
|
|
17
|
-
globals: {
|
|
18
|
-
'@angular/core': 'ng.core',
|
|
19
|
-
'@angular/common': 'ng.common',
|
|
20
|
-
'@sci-grid/core': 'SciGrid'
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
esbuild: {
|
|
26
|
-
// Angular needs experimentalDecorators and does not support useDefineForClassFields
|
|
27
|
-
// esbuild does not support emitDecoratorMetadata which is required for some Angular DI,
|
|
28
|
-
// but for simple components it might be fine, or we rely on tsc for types.
|
|
29
|
-
// However, for the runtime build, we need decorators to be preserved or transformed.
|
|
30
|
-
// Since we are outputting a library, we should probably output code that uses standard JS decorators or downlevel them.
|
|
31
|
-
// Vite uses esbuild.
|
|
32
|
-
}
|
|
33
|
-
});
|