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

edbyrnee-mat-schematics

v0.0.12

Published

Custom Material Design Schematics

Downloads

11

Readme

Tfg-Mat(erial)-Schematics

  1. Install the package into your angular-cli project
    • npm install --save tfg-mat-schematics
  2. Run any of the following:
    • schematics tfg-mat-schematics:tfgdatatable --dry-run=false --path=output/accounts/accounts-list --name=AccountsList --columns=account_namen,account_type_namen,count*n
    • schematics tfg-mat-schematics:tfgdialog

Development

Make sure you have both the tsc and typescript packages installed

schematics .:tfg-page --dry-run=false --path=../../output/test-page/page-list

Publish an update

  1. Update package version 0.0.4 -> 0.0.5
    • npm version patch
  2. Run the following to complie
    • npm run build
  3. Run the following to publish changes
    • npm publish

Test running the schematics

schematics edbyrnee-mat-schematics:tfg-page --dry-run=false --path jobs/jobs-list

TFG-Page Component

edbyrnee-mat-schematics:tfg-page --path users/users-list

Creates a page which:

  • is automatically named componentname-page
  • extends the app-page base component from which all pages inherit
  • injects route, route, app-page etc. deps
  • set up the html for loading, error, content and page header
  • onPageLoad() function for init page data load

TFG-Form Component

schematics tfg-common-schematics:tfg-form --dry-run=false --path=output/test-page/page-list-page --fields=type:text*name:job_name,type:select*name:JobId*object_name:job
(dev) schematics .:tfg-form --dry-run=false --path=output/test-page/page-list-page --form_name=newJobsFormGroup --fields=type:text*name:job_name

Creates a Form and a Form Group, provide the fields in the format: type:textname:job_name,type:selectname:JobId*object_name:job

First provide type:number

Choose from from:

  • text options: name: the name of the formControl
  • select options: name: the name of the formControl object_name: the name of the object, used to create the iterator e.g. let j of jobs
  • number options: name: the name of the formControl
  • textarea options: name: the name of the formControl

Also provide the path and name/options of each formControl

schematics edbyrnee-mat-schematics:tfg-form --dry-run=false --path=output/test-page/page-list

tfgdatatable

Provide the column names and create a data table.

Example

schematics edbyrnee-mat-schematics:tfgdatatable --dry-run=false --path=output/accounts/accounts-list --name=AccountsList --columns=account_name*n,account_type_name*n,count*n

Displayed Columns

Provide a list of column names, along with if you wish to enable sorting. By default this column will show the property of this name on the element.

--columns=account_name*y,account_type_name*y,count*y

This will create the cell below Account Name

<ng-container matColumnDef="account_name">
  <th mat-header-cell *matHeaderCellDef  mat-sort-header>Account Name</th>
  <td mat-cell *matCellDef="let element">
    <span class='tfg-table-td'>
      {{ element.account_name }} 
    </span>
  </td>
</ng-container>

Column sorting

When providing the column names like above, you can enable sorting by providing column_name*enable_sorting e.g. account_name*y

A sorting function (shown below) is provided:

sortAccountsListTableData(sort:any){
    this.accounts_list_sort_by = sort.active;
    this.accounts_list_sort_direction = sort.direction;
    this.loadAccountsListTableData();
}

This will use the column name e.g. matColumnDef="account_name" to sort the data by on the request e.g. ?sortBy=account_name. If you require a more specialist case then you must configure this manually.

Load Data

Data is loaded into the table using the function provided below. You can add this to your initPageLoad() to require the table data to have been loaded before displaying your page.

Best used when passing a query into a tfgLoadData() function, which will remove any null or undefined values, (e.g. sortBy, sortDirection when first load).

// Load table data using the function below, 
// List this in your initPageLoad() function to load data when the page first loads

loadAccountsListTableData(){

    this.dataService.loadDemo({
        sortBy: this.accounts_list_sort_by,
        sortDirection: this.accounts_list_sort_direction,
        limit: this.accounts_list_table_limit,
        page: this.accounts_list_table_current_page
    }).then(data=>{

      this.accounts_list_table_rows = data['data'];
      this.accounts_list_table_limit = data['limit'];
      this.accounts_list_table_count = data['count'];
      this.accounts_list_table_current_page = data['page'];

    })
    
})

Query parameter

When updating the filters on a table e.g. orderBy, we would ideally like to update the query parameters, as this allows for the page state to be saved/shared.

When a filter component is changed, this updates the query parameters.

Component state change => Query param update => Update 

List and create page

ng g module jobs
schematics .:tfg-page --dry-run=false --path=../../output/jobs/jobs-list
schematics .:tfg-form --dry-run=false --path=/output/jobs/jobs-list-page --form_name=newJobFormGroup --fields=type:text*name:job_name,type:select*name:ClientId*object_name:client,type:number*name:job_budget,type:textarea*name:job_comment
schematics .:tfg-dialog --dry-run=false --path=/output/jobs/jobs-list-page --name=newJob

TFG-Http Intercept

A basic http intercept service, no refresh token

schematics edbyrnee-mat-schematics:tfg-http-intercept