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

presentation-table

v3.5.5

Published

The Augmented.js Next - Presentation Table View Module.

Downloads

10

Readme

presentation-table

Augmented.js Presentation Table View Module

API

Table of Contents

AutomaticTable

Extends DecoratorView

AutomaticTable Creates a table automatically via a schema for defintion and a uri/json for data

Parameters

  • options (optional, default {})

Examples

const at = new AutomaticTable({
    schema: schema,
    el: "#autoTable",
    crossOrigin: false,
    sortable: true,
    lineNumbers: true,
    editable: true,
    uri: "/example/data/table.json",
    messagePosition: "top", // or bottom
    theme: "material",
    linkable: true,
    links: {
       wholeRow: true,
       column: "",
       link: "rowLink"
    },
    fetchOnStart: false
});

theme

The theme property - The theme of this table (default is 'material')

Properties

  • theme string The theme of this table

linkable

The linkable property - enable links in a row (only works in non-editable tables)

Properties

  • linkable boolean enable/disable linking a row

links

The links property - setup linking structure for links in a row

Properties

  • linkable boolean enable/disable linking a row

Examples

links: {
wholeRow: false, // link whole row vs column
column: "name", // name of column
link: "rowLink" // callback or method in class
}

selectable

The selectable property - enable selecting a row in table

Properties

  • selectable boolean enable/disable selecting a row

sortable

The sortable property - enable sorting in table

Properties

  • sortable boolean enable sorting in the table

sortStyle

The sortStyle property - setup the sort API

Properties

  • sortStyle string setup the sort API

display

Fields to display - null will display all

Properties

  • display array Fields to display

renderPaginationControl

The renderPaginationControl property - render the pagination control

Properties

  • renderPaginationControl boolean render the pagination control

paginationAPI

The paginationAPI property - setup the paginatin API to use

Properties

  • paginationAPI PaginationFactory.type the pagination API to use

description

The description property

Properties

  • description string The description of the table

localStorage

The localStorage property - enables localStorage

Properties

  • localStorage boolean The localStorage property

localStorageKey

The localStorageKey property - set the key for use in storage

Properties

  • localStorageKey string The localStorage key property

editable

The editable property - enables editing of cells

Properties

  • editable boolean The editable property

crossOrigin

The crossOrigin property - enables cross origin fetch

Properties

  • crossOrigin boolean The crossOrigin property

lineNumbers

The lineNumber property - turns on line numbers

Properties

  • lineNumbers boolean The lineNumbers property

uri

The URI property

Properties

isInitalized

The initialized property

Properties

  • isInitalized boolean The initialized property

pageControlBound

The pageControlBound property

Properties

  • pageControlBound boolean is the pagecontrol bound

schema

The schema property - the defining schema

Properties

name

The name property

Properties

  • name string The name of the table

setTheme

The theme of the table

Parameters

  • theme string name of the theme

rowLink

The default rowlink function callback called by row to format a link

Parameters

Returns string Returns the link uri

sortBy

Sort the table by a key (sent via a UI Event)

Parameters

currentPage

Return the current page number

Returns number The current page number

totalPages

Return the total pages

Returns number The total pages

nextPage

Advance to the next page

previousPage

Return to the previous page

goToPage

Go to a specific page

Parameters

firstPage

Return to the first page

lastPage

Advance to the last page

editCell

Edit a cell at the row and column specified

Parameters

  • row number The row
  • col number The column
  • value any The value to set

copyCell

Copy a cell at the row and column to another

Parameters

clearCell

Clear a cell at the row and column specified

Parameters

render

Render the table

Returns object Returns the view context ('this')

retrieveSchema

Fetch the schema from the source URI

Parameters

  • uri {string} the URI to fetch from

fetch

Fetch the data from the source URI

save

Save the data to the source This only functions if the table is editable

Parameters

  • override boolean Save even if not editable

Returns any Returns true if succesfull

populate

Populate the data in the table

Parameters

  • source array The source data array

clear

Clear all the data in the table

refresh

  • **See: AutomaticTable.render **

Refresh the table (Same as render)

Returns object Returns the view context ('this')

compileTemplate

An overridable template compile

Returns string Returns the template

setURI

Sets the URI

Parameters

setSchema

Sets the schema

Parameters

  • schema object The JSON schema of the dataset

showProgressBar

Enable/Disable the progress bar

Parameters

  • show boolean Show or Hide the progress bar

showMessage

Show a message related to the table

Parameters

  • message string Some message to display

validate

Validate the table

Returns boolean Returns true on success of validation

isValid

Is the table valid

Returns boolean Returns true if valid

remove

Remove the table and all binds

Returns any Returns the context (this)

getSelected

Gets the selected models

Parameters

  • json boolean convert to array of objects

Returns Array Returns array of selected rows (models)

getSelectedAsJSON

Gets the selected models as JSON

Returns Array Returns array of selected rows (JSON Objects)

getSelectedIndex

Gets the selected row indexes

Returns Array Returns array of selected rows (indexes)

removeRows

Removes the models

Parameters

  • rows Array Models of the rows to remove

removeSelectedRows

Removes the selected models

addRow

adds a row to the table

Parameters

  • model Model The model to add

exportTo

Export the table data in requested format

Parameters

  • type string The type requested (csv, tsv, json, or html) html is default

Returns string The table data in requested format

BigDataTable

Extends AutomaticTable

Instance class preconfigured for sorting and pagination

Parameters

  • options

EditableBigDataTable

Extends AutomaticTable

Instance class preconfigured for sorting and pagination

Parameters

  • options

EditableLocalStorageTable

Extends AutomaticTable

Instance class preconfigured for editing, sorting, from local storage

Parameters

  • options

EditableTable

Extends AutomaticTable

Instance class preconfigured for editing

Parameters

  • options

LocalStorageTable

Extends AutomaticTable

Instance class preconfigured for local storage-based table

Parameters

  • options

Spreadsheet

Extends AutomaticTable

Instance class preconfigured for editing for use as a Spreadsheet. If a propery for length is not specified, it will buffer 10 lines for editing.

Parameters

  • options

_generate

_generate