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

inline-data-table

v0.0.23

Published

material data table

Downloads

7

Readme

Installation

  1. npm install inline-data-table
  2. For the project you need to install angular cli 14 and above
  3. to use angular material icons please these below links into your index.html file
    import { InlineDataTableModule  } from 'inline-data-table';

    @NgModule({
        declarations: [
            AppComponent,
        ],
        imports: [
            BrowserModule,
            AppRoutingModule,
            InlineDataTableModule,
            BrowserAnimationsModule,
        ],
        providers: [],
        bootstrap: [AppComponent]
    })

    export class AppModule { }
  1. install angular material as its an core dependency for the package e.g. ng add @angular/material

How to use

Step1: in your html file (app.component.html)

<lib-inline-data-table *ngIf="dtOptions" [dtOptions]="dtOptions" >

Step2: In your .ts file (app.component.ts)

import { HttpClient } from '@angular/common/http'; import { Component } from '@angular/core';

@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent { title = 'Angular inline edit data table example';

constructor( private http: HttpClient ) {

}

dtOptions: any;

Inputs()

  1. dtOptions Example. <lib-inline-data-table *ngIf="dtOptions" [dtOptions]="dtOptions" >

Outputs()

  1. getRowData Example. <lib-inline-data-table *ngIf="dtOptions" [dtOptions]="dtOptions" (getRowData)="getRowData($event)">

    dtOptions

    this is a object it takes several value to render table in the browser

    1. columnFilter by default its false to enable column filter feature change the value to true columnFilter: true/false
    2. length defines the total length of the recored want to display, which helps to implement pagination

HTML

            </div>
        </div>
        <div class="text-black-50 fw-medium mb-2">
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque cum nulla voluptatibus voluptatum,
            inventore
            sapiente tempore
            Neque cum nulla voluptatibus voluptatum, inventore
            sapiente tempore
        </div>

        <div class="text-black-50 fw-medium mb-2">
            I can that the .........
        </div>

        <div class="row mb-2">
            <ng-container class="mr-2"
                *ngFor="let zipCode of typeList; let i = index; let odd= odd; let even = even"
                formArrayName="types">
                <div class="col-md-6 d-flex mb-3">
                    <input class="me-2" type="checkbox" [formControlName]="i" [id]="i" />
                    <label [for]="i" class="text-black-50 fw-medium ">{{zipCode}}</label>
                </div>
            </ng-container>
        </div>
        <div class="d-flex">
            <button class="btn btn-primary">
                Clear
            </button>
        </div>
        <div class="row mb-2">
            <div class="col-md-6">
                <div class="row">
                    <label for="inputone" class="col-md-5 col-form-label">input one</label>
                    <div class="col-md-7">
                        <input formControlName="inputone" type="text" class="form-control" id="inputone">
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="row">
                    <label for="inputtwo" class="col-md-5 col-form-label">input two</label>
                    <div class="col-md-7">
                        <input formControlName="color" type="text" class="form-control" id="inputtwo">
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>

CSS

.statement { background-color: #d4e2f7; }

::ng-deep.mat-mdc-dialog-container { border: 2px solid black !important; border-radius: unset !important; }

label { font-weight: 600; }

input { border: 2px solid #c2c2c2; &:focus { outline: none; box-shadow: none; } &:focus-within { outline: none; } }

input[type="checkbox"] { width: 18px; cursor: pointer; }

TS

constructor(private fb: FormBuilder) {} public typeList: any = [ 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', ]; defaultValueInCheckbox = ['One', 'Two']; patchData: any = { dateIssued: '18/01/2024', reference: '123456789', registration: 'ABC12345', make: '1818', model: 'Feweee', color: 'black', date: '18/03/2023', time: '09:18', location: 'India Bangalore', inputone: 'test', inputtwo: 'test two', };

offenceForm = this.fb.group({ dateIssued: '', reference: '', registration: '', make: '', model: '', color: '', date: '', time: '', location: '', inputone: '', inputtwo: '', types: this.fb.array(this.typeList.map((value: any) => !value)), // types: this.fb.array(this.typeList.map((value: any) => this.defaultValueInCheckbox.indexOf(value) != -1)) // enable if data need to set by default in checkbox });

ngOnInit(): void { this.offenceForm.patchValue(this.patchData); }

onSubmit() { const getTypes: any = this.offenceForm.value.types; let valueToStore: any = {}; this.typeList.forEach((element: any, index: any) => { getTypes.map((item: any, idx: any) => { if (index === idx && item === true) { valueToStore[element] = item; }
}); }); console.log(valueToStore); }