npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@helveg/ngx-spreadsheet

v1.0.0

Published

Lightweight spreadsheet module for Angular

Downloads

5

Readme

NgxSmartSpreadsheet

Lightweight spreadsheet module for Angular

npm GitHub license npm npm total downloads

DEMO

https://helveg.github.io/ngx-spreadsheet/

Installation

First, install this module in your project.

$ npm install --save ngx-spreadsheet

Import NgxSpreadsheetModule into your module.

import { NgxSpreadsheetModule } from 'ngx-spreadsheet';
...

@NgModule({
  imports: [
    NgxSpreadsheetModule,
  ],
})
export class AppModule { }

Usage for initialize

Now you can use the spreadsheet component in your app components, for example in app.component.ts:

Example: Create an empty table with 3 rows x 6 columns

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  template: `
  <ngx-spreadsheet [rows]="3" [cols]="6">
  </ngx-spreadsheet>
  `
})
export class AppComponent {}

or

Example: Read A two-dimensional array

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  template: `
    <ngx-spreadsheet [data]="data">
    </ngx-spreadsheet>
  `
})
export class AppComponent {

  // Spreadsheet initialization: Read A two-dimensional array
  data: string[][] = [
    ['Product ID', 'Product Category', 'Status', 'Price', 'Date'],
    ['PID1', 'Hat', 'Review', '2883', '"2021/8/9 20:25:05"'],
    ['PID2', 'Bag', 'Discard', '7336', '"2021/8/9 20:25:05"']
  ];

}

Usage for read

import {Component} from '@angular/core';
import {NgxSpreadsheetComponent, SpreadsheetSettings} from 'ngx-spreadsheet';

@Component({
  selector: 'app-root',
  template: `
    <ngx-spreadsheet [settings]="settings">
    </ngx-spreadsheet>
    <button (click)="getData(nss)">Get data</button>
  `
})
export class AppComponent {

  // Spreadsheet initialization: Read A two-dimensional array
  settings: SpreadsheetSettings = SpreadsheetSettings.load([
    ['Product ID', 'Product Category', 'Status', 'Price', 'Date'],
    ['PID1', 'Hat', 'Review', '2883', '"2021/8/9 20:25:05"'],
    ['PID2', 'Bag', 'Discard', '7336', '"2021/8/9 20:25:05"']
  ]);

  getData(nss: NgxSpreadsheetComponent): void {
    console.log(nss.data_);
  }

}

i18n of context menu

import { Component } from '@angular/core';
import { SpreadsheetSettings } from 'ngx-spreadsheet';

@Component({
  selector: 'app-root',
  template: `
    <ngx-spreadsheet [settings]="settings">
    </ngx-spreadsheet>
  `
})
export class AppComponent {

  options: SpreadsheetSettingOptions = {
    contextMenuRowLabel: {
      INSERT_ROW_ABOVE: '上に1行追加',
      INSERT_ROW_BELOW: '下に1行追加',
      DELETE_ROW: '行を削除'
    },
    contextMenuColLabel: {
      INSERT_COLUMN_LEFT: "左に1列追加",
      INSERT_COLUMN_RIGHT: "右に1列追加",
      DELETE_COLUMN: "列を削除",
    }
  };

  // Spreadsheet initialization
  settings: SpreadsheetSettings = SpreadsheetSettings.empty(3, 6, this.options);
  // or 
  // settings: SpreadsheetSettings = SpreadsheetSettings.load([ ... ], this.options);

}