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

@overflo-srl/full-table

v6.1.0

Published

This library let you use the component `<lib-full-table>` that provides you a sortable, pageable, filterable angular material table which generates automatic queries based on [nestjs/crud](https://github.com/nestjsx/crud).

Downloads

362

Readme

FullTable

This library let you use the component <lib-full-table> that provides you a sortable, pageable, filterable angular material table which generates automatic queries based on nestjs/crud.

Setup (until V5.*)

Add import {FullTableModule} from '@overflo-srl/full-table'; in your module. You also need to add your backend endpoint into FullTableModule.forRoot(*** BASE_URL ***).

Note: you can also add environment variable like FullTableModule.forRoot(enviroment.BASE_PATH)

Setup (V6 and above)

Add import {FullTableComponent} from '@overflo-srl/full-table'; in your module. You also need to inject the value of the BASE_PATH of the backend.

Here's an example:

@NgModule({
  declarations: [
   ...
  ],
  imports: [
    FullTableComponent,
    ...
  ],
  exports: [
    FullTableComponent,
    ...
  ],
  providers: [
    {provide: "BASE_PATH", useValue: 'https://backend.overflo.srl'}, // for full-table
  ]
})
export class ExampleModule { }

Styling

You can customize some properties of the table by overriding the following scss variables:

  • fulltableHeaderBackgroundColor: background color of the table header
  • fulltableHeaderTextColor: text color of the table header
  • fulltableBorderColor: border color of the table

Example from styles.scss:

:root {
  --fulltableHeaderBackgroundColor: #282828;
  --fulltableHeaderTextColor: white;
  --fulltableBorderColor: #e3e3e3;
}

Parameters

To generate the table you need to enter basic information for your entity:

[PATH]: base path for your nestjs/crud entity ('/book)

[columnList]: description and settings for your columns (ColumnListModel[])

interface ColumnModel {
  def: string;
  name: string;
  value: {type: string, icon: string, filter: ((e: any) => boolean)}[] | ((e: any) => string);
  type?: string;
  /** Attempts to force cell type when exporting. If omitted, property 'type' is used. */
  exportedType?: string;
  filterDefault?: {title: string, value: string}[];
  sort?: boolean;
  hidden?: boolean
  /** Expects a callback function that will be executed when the cell is clicked. */
  click?: any;
  /** Displays a tooltip when the cell is hovered. */
  tooltip?: string;
  /** Accept an array of FilterOptions ({ displayedValue: string; realValue: string | boolean }) to display a select field 
  /** in the filter form for columns where this property is set. The select options will use 'displayedValue' 
  /** as labels and 'realValue' as values. In filter chip lists will be shown 'displayedValue'. 
  /** This feature currently supports only string, boolean or number type columns. 
  filterOptions?: FilterOption[];
}

OPTIONALS:

(data): an event emitter that emits the array of displayed entities every time there is an update in the table

(selectedChange): an event emitter that emits the array containing all the selected elements every time the array changes. If 'isOnlyOneSelectable' is set to true, it will return an array with only one element

[columnMobile]: description and settings for your column responsive mobile column (() => string)

[actions]: action event emitter that emits when there is an event on the table (refresh every time a value is emitted)

[search]: search query based on nestjs/crud

[join]: join query based on nestjs/crud

[defaultSort]: default sort column query based on nestjs/crud

[defaultFilter]: {name: string, operation?: string, value: string | number}[] default filter chip placed at table startup. (can be removed)

[pageSize]: page size number (default: 5)

[isSelectable]: a boolean value that implements elements selection column if set to true (default false)

[selectAllLimit]: a number that sets a limit on the quantity of items that can be selected simultaneously through the checkbox in the column header for selection, and thus disables it in case the total number of items in the table exceeds the set limit (default 1000)

[selectedElements]: an array of already selected elements

[isOnlyOneSelectable]: A boolean value that, when set to true, allows the selection of only one element in the table. If set, it will automatically set 'isSelectable' to true. (default: false)

[enableUrlQueryParams]: a boolean than enables the memorization of filters set on the full table via url params

[includeDeleted]: a boolean that includes soft deleted rows

FUNCTIONS:

export(exportOptions?: ExportOptions): a function that enables exporting the current table content to an Excel file. The optional parameter exportOptions is an object containing these three optional fields as well:

  • fileName?: a string that allows modifying the name of the exported file, which would otherwise default to ' "export_" + new Date().getTime() '.

  • additionalFilters?: an array of DefaultFilter that includes three fields: name (a string-type field containing the name of the field for filtering), operation? (an optional field of type OperatorsEnum), value (an any-type field allowing the insertion of the value on which the filter is to be applied). This list of filters will be added to the already present table filters. If not present, only the currently existing filters in the table will be applied.

  • alternativeColumns?: an array of ColumnModel representing the column list to be displayed in the exported file. If not specified, the current list of columns in the table will be used. """`

Deploy

This project is for the NPM package https://www.npmjs.com/package/@overflo-srl/full-table.

To deploy a new version you have to:

  • Build the full table "npm run build"
  • Go on /dist/full-table
  • "npm publish"

Finish.