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

curio-table-ants

v0.2.16

Published

# Installation & Usage

Downloads

3

Readme

table-ants

Installation & Usage

npm install curio-table-ants --save
import TableAnts, {TableAntsProps, TableAntsColumn} from "curio-table-ants"

const props: TableAntsProps = {
    fetchURL: location.origin + "/api/user/all"
}

const columns: TableAntsColumn[] = [
    {
        title: "Email",
        dataIndex: "email",
        key: "email",
        type: "string",
        render(text: any, row: any) {
            return `${text}(${row.name})`
        }
    }
]
render((
    <TableAnts {...props} />
), document.getElementById("#app")

Configuration

TableAntsProps

|PropName | Type | Description | Default value | --- | --- | --- | --- | |begin | number | a Unix timestamp|Timestamp of the day 10 days before today | |end | number | a Unix timestamp|Timestamp of now | |download| boolean| Display the download button or not | true | |format|string|the extention of the file to be downloaded | ".execl" |onTimeChange|(ts: number[]) => boolean||Call back when timepicker's value is changed || |pageSize| number | row of data in each page | 20| |payloadExtra|object| extra payload required by fetchURL API | {} |sheetName|string|the name of file to be doanloaded | "Sheet" |timepicker|boolean|Display the timepicker or not | false| |path|string|relative path of data array (in the JSON object returned by fetchURL API)|""| |baseColor|string|a HSL color value, will be used in many components in the table|hsl(132, 40%, 57%)| |onDataFetched|(data: any) => void| Callback function which is called when data is fetched. |filters|JSX.Element[]|A list of cusomized filter component|[]| |lang|string| language|"en-US"| |downloadURL|string|the API that fetch data from fetchURL and return the download link|required| |fetchURL|string|the API that return actual data (Must be the absolute URL of a HTTP POST API|required| |totalKey|string|relative path of the total number of data (in the JSON object returned by fetchURL API) |required| |columns|TableAntsColumn[]|Definition of columns|required|

TableAntsColumn

|PropName | Type | Description | Default value | --- | --- | --- | --- | |title|string | JSX.Element|the column title|| |dataIndex|string|the key (or path) of data (in a single row).| You can imit dataIndex to hide this column in the page| |key|string|same as dataIndex. |You can omit key to remove this column in the download file| |type|string|type in Golang, should be one of int64, string, bool, slice or float64]|required if key is present| |conv|string[]|a list of conv functions (conv originial data to readable format in download file)|| |hideByDefault|boolean|literally "hide by default"|| |dlDataIndex|string|column will be download only if the column spicified by dlDataIndex is visible in the table || |render|(text: any, row: any) => string | JSX.Element|render function|| |filters|any[]||| |onFilter|(v: string) => void||| |colSpan|number|how many colspans the column will occupy || |width|number | string||| |className|string||| |sorter|(a: any, b:any): boolean | a valid sorter function ||