@sci-grid/solid 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.tsx +0 -8
- package/src/index.tsx +0 -43
- package/tsconfig.json +0 -12
- package/vite.config.ts +0 -25
package/package.json
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sci-grid/solid",
|
|
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
|
"solid-js": "^1.0.0",
|
|
10
|
-
"@sci-grid/core": "1.0.
|
|
21
|
+
"@sci-grid/core": "1.0.4"
|
|
11
22
|
},
|
|
12
23
|
"devDependencies": {
|
|
13
24
|
"solid-js": "^1.8.0",
|
package/src/index.test.tsx
DELETED
package/src/index.tsx
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { onMount, onCleanup, createEffect } from 'solid-js';
|
|
2
|
-
import { SciGrid } from '@sci-grid/core';
|
|
3
|
-
import type { GridConfig, IDataGridProvider } from '@sci-grid/core';
|
|
4
|
-
|
|
5
|
-
interface SciGridSolidProps {
|
|
6
|
-
provider: IDataGridProvider;
|
|
7
|
-
config?: Partial<GridConfig>;
|
|
8
|
-
class?: string;
|
|
9
|
-
style?: any;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* SciGrid SolidJS Adapter
|
|
14
|
-
* Fine-grained reactive wrapper for maximum performance.
|
|
15
|
-
*/
|
|
16
|
-
export const SciGridSolid = (props: SciGridSolidProps) => {
|
|
17
|
-
let containerRef!: HTMLDivElement;
|
|
18
|
-
let grid: SciGrid | null = null;
|
|
19
|
-
|
|
20
|
-
onMount(() => {
|
|
21
|
-
grid = new SciGrid(containerRef, props.provider, props.config || {});
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
onCleanup(() => {
|
|
25
|
-
grid?.destroy();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
createEffect(() => {
|
|
29
|
-
grid?.updateProvider(props.provider);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
createEffect(() => {
|
|
33
|
-
grid?.updateConfig(props.config || {});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<div
|
|
38
|
-
ref={containerRef}
|
|
39
|
-
class={props.class}
|
|
40
|
-
style={{ width: '100%', height: '100%', ...props.style } as any}
|
|
41
|
-
/>
|
|
42
|
-
);
|
|
43
|
-
};
|
package/tsconfig.json
DELETED
package/vite.config.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import solidPlugin from 'vite-plugin-solid';
|
|
3
|
-
import dts from 'vite-plugin-dts';
|
|
4
|
-
import { resolve } from 'path';
|
|
5
|
-
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
plugins: [solidPlugin(), dts()],
|
|
8
|
-
build: {
|
|
9
|
-
lib: {
|
|
10
|
-
entry: resolve(__dirname, 'src/index.tsx'),
|
|
11
|
-
name: 'SciGridSolid',
|
|
12
|
-
fileName: 'index',
|
|
13
|
-
formats: ['es', 'cjs']
|
|
14
|
-
},
|
|
15
|
-
rollupOptions: {
|
|
16
|
-
external: ['solid-js', '@sci-grid/core', 'solid-js/web', 'solid-js/store'],
|
|
17
|
-
output: {
|
|
18
|
-
globals: {
|
|
19
|
-
'solid-js': 'Solid',
|
|
20
|
-
'@sci-grid/core': 'SciGrid'
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
});
|