From f4df145b31e042681b923c060e1316f874853703 Mon Sep 17 00:00:00 2001 From: natxocc Date: Thu, 30 Apr 2026 14:09:27 +0200 Subject: [PATCH] Adapt --- README.md | 7 ++++--- src/index.js => index.js | 11 ++++++----- package.json | 12 ++++++------ 3 files changed, 16 insertions(+), 14 deletions(-) rename src/index.js => index.js (94%) diff --git a/README.md b/README.md index b2553e9..8f4c06d 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/index.js b/index.js similarity index 94% rename from src/index.js rename to index.js index 6565324..7fe7b81 100644 --- a/src/index.js +++ b/index.js @@ -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 }; \ No newline at end of file +if (typeof window !== 'undefined') window.Grid = Grid; +export { Grid, createGrid, themeQuartz, iconSetQuartzLight, ModuleRegistry }; \ No newline at end of file diff --git a/package.json b/package.json index 974f465..314e6fe 100644 --- a/package.json +++ b/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" } -} \ No newline at end of file +}