@8sheets/data-grid-angular
v1.1.0
Published
Angular component for 8sheets Data Grid: <eight-data-grid>, standalone, with options passed through and typed outputs.
Maintainers
Readme
8sheets Data Grid for Angular
<eight-data-grid> (DataGridComponent) puts an 8sheets Data Grid in an Angular app. It is a standalone component for Angular 17 and later, with zone.js or zoneless, and with server rendering. This is version 1.1.0.
Install
npm i @8sheets/data-grid-angular @8sheets/data-gridThen serve @8sheets/data-grid as static files: add it to the assets of your build target in angular.json.
"assets": [
{ "glob": "**/*", "input": "node_modules/@8sheets/data-grid", "output": "8sheets-data-grid", "ignore": ["**/*.d.ts", "*.md", "package.json"] }
]The component loads the grid at run time from 8sheets-data-grid/table-view/index.js, read against the page's <base href>, and only on a page that shows a grid. The grid finds its Worker and stylesheet next to its own modules, which the Angular CLI's bundle doesn't copy; served as it is, every file stays where its modules expect it. To serve it from another path, provide the URL:
import { EIGHT_DATA_GRID_URL } from '@8sheets/data-grid-angular';
providers: [{ provide: EIGHT_DATA_GRID_URL, useValue: '/static/data-grid/table-view/index.js' }]Use
import { Component, signal } from '@angular/core';
import { DataGridComponent, DataGridChange, DataGridOptions } from '@8sheets/data-grid-angular';
@Component({
selector: 'app-orders',
imports: [DataGridComponent],
template: `<eight-data-grid class="grid" [options]="options()" (gridChange)="changed($event)" />`,
styles: `.grid { height: 480px; }`,
})
export class Orders {
options = signal<DataGridOptions>({ title: 'Orders', data: [{ Region: 'East', Units: 2 }] });
changed(change: DataGridChange) { console.log(change.action); }
}optionsgoes tomountTableas it is, callbacks included. A changedchromegoes tosetChrome; any other change mounts the grid again.datais compared by identity.- Outputs:
ready,gridChangeandgridError(notchangeanderror, which are DOM events that bubble from the grid's inputs), and the grid's other events by their names (stateChange,beforeEdit…). - The component has
gridand every method of the grid exceptdestroy,onandoff.
Documentation
Framework wrappers for this component in detail, and the API reference for every option of the grid.
Licence
8sheets is commercial software, not open source. You may install it and try it for free, to evaluate it. Using it in a product, or deploying it for your users or your own staff, needs a licence from 8sheets.com/pricing: Internal 999 USD or SaaS / OEM 2,999 USD, each paid once per company and covering every developer and every deployment, or Enterprise, quoted. One licence covers both 8sheets products, Spreadsheet and Data Grid. There is no licence key and nothing in the package checks for one. The terms are in LICENSE.md and, once you hold a licence, the 8sheets Source Licence.
