Adapt
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
# SigPro Grid
|
||||
|
||||
A lightweight, reactive wrapper for AG Grid (Community & Enterprise) built for SigProUI framework.
|
||||
A lightweight, reactive wrapper for AG Grid built for SigProUI.
|
||||
|
||||
## Features
|
||||
|
||||
- **Lightweight wrapper** - AG Grid bundled inside
|
||||
- **Reactive** - Automatically updates when data changes
|
||||
- **Theme aware** - Automatically switches between light/dark themes
|
||||
- **Enterprise ready** - Full AG Grid Enterprise modules included
|
||||
- **TypeScript support** - Full type definitions included
|
||||
- **Auto cleanup** - Proper resource disposal
|
||||
|
||||
## Requirements
|
||||
|
||||
- [SigProUI](https://git.natxocc.com/natxocc/sigpro-ui/#)
|
||||
- [SigProUI](https://github.com/natxocc/sigpro-ui)
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install sigpro-ui
|
||||
npm install sigpro-grid
|
||||
```
|
||||
|
||||
@@ -26,6 +26,7 @@ npm install sigpro-grid
|
||||
## Quick Start
|
||||
|
||||
```javascript
|
||||
import "sigproui";
|
||||
import { Grid } from 'sigpro-grid';
|
||||
|
||||
// Create API reference
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { h, watch, onUnmount } from "sigpro";
|
||||
import { h, watch, onUnmount } from "sigpro-ui";
|
||||
import {
|
||||
ModuleRegistry,
|
||||
ValidationModule,
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
StatusBarModule,
|
||||
ExcelExportModule,
|
||||
ClipboardModule,
|
||||
} from "../ag-grid";
|
||||
} from "./ag-grid";
|
||||
|
||||
ModuleRegistry.registerModules([
|
||||
ValidationModule,
|
||||
@@ -45,7 +45,7 @@ ModuleRegistry.registerModules([
|
||||
ClipboardModule,
|
||||
]);
|
||||
|
||||
export const Grid = (props) => {
|
||||
const Grid = (props) => {
|
||||
const { data, options, api, on, class: className, style = "height: 100%; width: 100%;" } = props;
|
||||
let gridApi = null;
|
||||
|
||||
@@ -141,7 +141,7 @@ export const Grid = (props) => {
|
||||
if (newOptions[key] !== undefined) {
|
||||
try {
|
||||
gridApi.setGridOption(key, newOptions[key]);
|
||||
} catch (e) {}
|
||||
} catch (e) { }
|
||||
}
|
||||
});
|
||||
}, true);
|
||||
@@ -165,4 +165,5 @@ export const Grid = (props) => {
|
||||
});
|
||||
};
|
||||
|
||||
export { createGrid, themeQuartz, iconSetQuartzLight, ModuleRegistry };
|
||||
if (typeof window !== 'undefined') window.Grid = Grid;
|
||||
export { Grid, createGrid, themeQuartz, iconSetQuartzLight, ModuleRegistry };
|
||||
12
package.json
12
package.json
@@ -12,10 +12,10 @@
|
||||
],
|
||||
"scripts": {
|
||||
"clean": "rm -rf dist",
|
||||
"build:iife": "bun build ./src/index.js --bundle --outfile=./dist/sigpro-grid.js --format=iife --global-name=SigProGrid",
|
||||
"build:iife:min": "bun build ./src/index.js --bundle --outfile=./dist/sigpro-grid.min.js --format=iife --global-name=SigProGrid --minify",
|
||||
"build:esm": "bun build ./src/index.js --bundle --outfile=./dist/sigpro-grid.esm.js --format=esm",
|
||||
"build:esm:min": "bun build ./src/index.js --bundle --outfile=./dist/sigpro-grid.esm.min.js --format=esm --minify",
|
||||
"build:iife": "bun build ./index.js --bundle --external sigpro-ui --outfile=./dist/sigpro-grid.js --format=iife --global-name=SigProGrid",
|
||||
"build:iife:min": "bun build ./index.js --bundle --external sigpro-ui --outfile=./dist/sigpro-grid.min.js --format=iife --global-name=SigProGrid --minify",
|
||||
"build:esm": "bun build ./index.js --bundle --external sigpro-ui --external ag-grid-community --external ag-grid-enterprise --outfile=./dist/sigpro-grid.esm.js --format=esm",
|
||||
"build:esm:min": "bun build ./index.js --bundle --external sigpro-ui --external ag-grid-community --external ag-grid-enterprise --outfile=./dist/sigpro-grid.esm.min.js --format=esm --minify",
|
||||
"build": "bun run clean && bun run build:iife:min && bun run build:esm:min",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
@@ -40,9 +40,9 @@
|
||||
"ag-grid-enterprise": "^35.2.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"sigpro": "^1.2.28"
|
||||
"sigpro-ui": "^1.2.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"sigpro-ui": "^1.2.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user