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

@terminus/ui-csv-entry

v3.0.0

Published

<h1>CSV Entry</h1>

Downloads

7

Readme

CI/CD Status Codecov MIT License
NPM version Library size

Table of Contents

Installation

Use the ng add command to quickly install all the needed dependencies:

ng add @terminus/ui-csv-entry

CSS imports

In your top-level stylesheet, add these imports:

@import '~@terminus/design-tokens/css/library-design-tokens.css';
@import '~@terminus/ui-styles/terminus-ui.css';

CSS resources

Load the needed font families by adding this link to the <head> of your application:

<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,700;1,400&display=swap" rel="stylesheet">

Usage

The most basic implementation only needs the HTML and a single method. Each time the CSV table is updated, a new File Blob is generated and emitted:

<ts-csv-entry (blobGenerated)="myFunc($event)"></ts-csv-entry>
myFunc(blob: Blob) { ... }

Column count

Define the number of columns (default is 2):

<ts-csv-entry [columnCount]="7">
  <!-- Will generate a csv entry with 7 columns -->
</ts-csv-entry>

NOTE: Column count does not restrict how many columns can be pasted into the table.

Row count

Define the number of rows (default is 4):

<ts-csv-entry [rowCount]="5">
  <!-- Will generate a csv entry with 5 rows -->
</ts-csv-entry>

NOTE: Row count does not restrict how may rows can be pasted into the table.

Max rows

Define the maximum number of rows a table will allow (default is 2000):

<ts-csv-entry [maxRows]="100"></ts-csv-entry>

If the user attempts to paste or manually add more rows than are allowed, a validation message will appear below the table.

Column validation

NOTE: Currently, custom validation messaging is only supported for the URL validator. More will be added as needs arise.

Pass in an array of validators matching the column count.

myValidators = [null, this.validatorsService.url(), null, null];
<ts-csv-entry [columnCount]="4" [columnValidators]="myValidators"></ts-csv-entry>

This example would add the URL validation to the second column only.

Static column headers

If there are certain headers that must be available, these can be set via an input:

<ts-csv-entry [columnHeaders]="['Header One', 'Header Two']">
</ts-csv-entry>

Setting static column headers will set the header cells to readonly. This will still allow keyboard navigation but will not allow the user to change the contents of the set header cells.

Full width table

If the table should be a single, full-width column, set both columnCount and fullWidth:

<ts-csv-entry [columnCount]="1" [fullWidth]="true"></ts-csv-entry>

NOTE: full width should only be used with a single column

Custom footer content

Consumer's can add custom footer content by enclosing it within the CSV entry component:

<ts-csv-entry>
  <button>My custom footer button!</button>
</ts-csv-entry>

This content will be added opposite the default footer buttons set.

Footer direction

The footer layout defaults to ltr mode which lays out the default buttons on the left and any custom content on the right. This can be reversed:

<ts-csv-entry footerDirection="rtl"></ts-csv-entry>

Allowed directions are: ltr, rtl.