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

pn-data-display-temp

v0.1.6

Published

A Vue 3 component library for displaying and managing data in various formats.

Downloads

671

Readme

pn-data-display

A Vue 3 component library for displaying and managing data in various formats.

Table of Contents

Installation

npm install pn-data-display

Components

| Component | Description | |-----------|-------------| | DataDisplay | Main component for displaying data in different structures (Table, Kanban, List, Timeline) | | Table | Component for displaying data in a tabular format | | KanbanBoard | Component for displaying data in a Kanban board format | | Pagination | Component for handling pagination |

Usage

<template>
  <DataDisplay
    :data-source="dataSource"
    :data="data"
    :columns="columns"
    :table-url="tableUrl"
    :kanban-url="kanbanUrl"
    :show-search="true"
    :show-filters="true"
    :show-pagination="true"
  />
</template>

<script setup>
import { DataDisplay } from 'pn-data-display';
import 'pn-data-display/dist/style.css';

// ... your component logic
</script>

Props

DataDisplay Component

| Prop | Type | Default | Description | |------|------|---------|-------------| | dataSource | String | 'client' | Data source type ('client' or 'remote') | | showDisplayStructureSelector | Boolean | true | Show/hide display structure selector | | showSearch | Boolean | false | Show/hide search functionality | | showFilters | Boolean | true | Show/hide filters | | showPagination | Boolean | true | Show/hide pagination | | data | Array | [] | Data to be displayed (for client-side data source) | | tableUrl | String | '' | URL for fetching table data (for remote data source) | | kanbanUrl | String | '' | URL for fetching Kanban data (for remote data source) | | searchQuery | String | '' | Initial search query | | columns | Array | [] | Column definitions for table structure | | pageSize | Number | 50 | Number of items per page | | currentPage | Number | 1 | Initial current page | | sortOrder | String | 'asc' | Initial sort order ('asc' or 'desc') | | sortBy | String | '' | Initial sort field | | filters | Object | {} | Initial filters | | rowColorClasses | Object | { odd: '', even: '' } | CSS classes for odd and even rows | | kanbanColumnKey | String | 'status' | Key for Kanban column grouping | | kanbanColumns | Array | [] | Kanban column definitions | | kanbanKeyProp | String | '' | Key property for Kanban items | | kanbanTitleProp | String | '' | Title property for Kanban items | | kanbanSubtitleProp | String | '' | Subtitle property for Kanban items | | kanbanBodyProp | String | '' | Body property for Kanban items |

Table Component

| Prop | Type | Default | Description | |------|------|---------|-------------| | dataSource | String | - | Data source type ('client' or 'remote') | | showSearch | Boolean | - | Show/hide search functionality | | showFilters | Boolean | - | Show/hide filters | | showPagination | Boolean | - | Show/hide pagination | | data | Array | - | Data to be displayed (for client-side data source) | | tableUrl | String | - | URL for fetching table data (for remote data source) | | searchQuery | String | - | Initial search query | | columns | Array | - | Column definitions | | pageSize | Number | - | Number of items per page | | currentPage | Number | - | Initial current page | | sortOrder | String | - | Initial sort order ('asc' or 'desc') | | sortBy | String | - | Initial sort field | | filters | Object | - | Initial filters | | rowColorClasses | Object | - | CSS classes for odd and even rows |

KanbanBoard Component

| Prop | Type | Default | Description | |------|------|---------|-------------| | kanbanUrl | String | - | URL for fetching Kanban data | | tableUrl | String | - | URL for fetching table data | | showSearch | Boolean | - | Show/hide search functionality | | showFilters | Boolean | - | Show/hide filters | | showPagination | Boolean | - | Show/hide pagination | | pageSize | Number | - | Number of items per page | | columnKey | String | 'Status' | Key for Kanban column grouping | | columns | Array | - | Kanban column definitions | | titleProp | String | - | Title property for Kanban items | | subtitleProp | String | - | Subtitle property for Kanban items | | bodyProp | String | - | Body property for Kanban items | | sortableFields | Array | ['name', 'acquisitionDate', 'value'] | Fields that can be sorted |

Pagination Component

| Prop | Type | Default | Description | |------|------|---------|-------------| | currentPage | Number | 1 | Current page number | | pageSize | Number | 10 | Number of items per page | | totalItems | Number | - | Total number of items | | maxVisiblePages | Number | 5 | Maximum number of visible page buttons |

Events

DataDisplay Component

| Event | Payload | Description | |-------|---------|-------------| | page-change | { currentPage, pageSize } | Emitted when the current page changes | | page-size-change | { currentPage, pageSize } | Emitted when the page size changes | | search | searchQuery | Emitted when the search query changes | | filter | filters | Emitted when filters are applied | | row-selection | selectedRows | Emitted when rows are selected/deselected | | sort | { sortBy, sortOrder } | Emitted when the sort field or order changes |

Table Component

| Event | Payload | Description | |-------|---------|-------------| | page-change | { currentPage, pageSize } | Emitted when the current page changes | | page-size-change | { currentPage, pageSize } | Emitted when the page size changes | | search | searchQuery | Emitted when the search query changes | | filter | filters | Emitted when filters are applied | | row-selection | selectedRows | Emitted when rows are selected/deselected | | sort | { sortBy, sortOrder } | Emitted when the sort field or order changes |

KanbanBoard Component

| Event | Payload | Description | |-------|---------|-------------| | page-change | { currentPage, pageSize } | Emitted when the current page changes | | page-size-change | { currentPage, pageSize } | Emitted when the page size changes | | search | searchQuery | Emitted when the search query changes | | filter | filters | Emitted when filters are applied | | sort | { sortBy, sortOrder } | Emitted when the sort field or order changes |

Pagination Component

| Event | Payload | Description | |-------|---------|-------------| | page-change | page | Emitted when the current page changes | | page-size-change | pageSize | Emitted when the page size changes |

Styling

The component library uses Tailwind CSS for styling. Make sure to include Tailwind CSS in your project for proper styling.

Development

To build the component library:

npm run build

To generate LLM-related files:

npm run llm

License

LGPL v3