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

gridy-grid-bundle

v2.1.2

Published

Gridy Grid Web Components datagrid library compiled bundles

Downloads

37

Readme

Gridy Grid All-in-One Bundle

This is Gridy Grid datatables library bundle can be used to load all needed Gridy Grid code with one file for convenience or to have wide browser support including legacy versions like Internet Explorer 11.

This package is a prebuilt version of gridy-grid

Usage

npm i gridy-grid-bundle gridy-grid-antd sk-theme-antd jquery

note: jquery is needed to render table with handlebars template engine that may be needed for old browsers support and actually optional as well as this feature

<script src="/node_modules/jquery/dist/jquery.js"></script>
<script src="/node_modules/gridy-grid-bundle/dist/gridy-grid-bundle.js"></script>
<gridy-grid theme="antd" id="gridyGrid">
    <gridy-data-source dataref="gridData">
        <gridy-data-field title="Title" path="$.title"></gridy-data-field>
        <gridy-data-field title="Price" path="$.price"></gridy-data-field>
        <gridy-data-field title="Created" path="$.created"></gridy-data-field>
    </gridy-data-source>
    <gridy-spinner></gridy-spinner>
    <gridy-filter id="gridyFilter"></gridy-filter>
    <gridy-table id="gridyTable" rd-tpl-fmt="handlebars">
    </gridy-table>
    <gridy-pager id="gridyPager"></gridy-pager>
    <gridy-table-info id="gridyTableInfo"></gridy-table-info>
</gridy-grid>
<script type="module">
    let data = [];
    for (let i = 0; i < 25; i++) {
        let today = new Date();
        today.setDate(today.getDate() + i);
        data.push({title: 'row' + i, price: 100 * i, created: today.toLocaleDateString("en-US")})
    }
    let grid = document.querySelector('#gridyGrid');
    grid.addEventListener('bootstrap', () => {
        grid.dataSource.loadData(data);
        grid.table.whenRendered(() => {
            console.log('table rendered');
        });
    });
    customElements.define('gridy-grid', GridyGrid);
</script>

note: grid-grid-antd is optional and depends on theme of your choice, you will have to set tpl-path to folder with templates (gridy-grid.tpl.html, table.tpl.html and others), and dt-css-path for styles file in case you not installed theme (-antd, -jquery or -default) package

<script src="/node_modules/gridy-grid-bundle/dist/gridy-grid-bundle.js"></script>
<gridy-grid theme="antd" id="gridyGrid" tpl-path="/tpl/" dt-css-path="tpl/">
    <gridy-data-source dataref="gridData">
        <gridy-data-field title="Title" path="$.title"></gridy-data-field>
        <gridy-data-field title="Price" path="$.price"></gridy-data-field>
    </gridy-data-source>
    <gridy-spinner></gridy-spinner>
    <gridy-filter id="gridyFilter"></gridy-filter>
    <gridy-table id="gridyTable" rd-tpl-fmt="handlebars">
    </gridy-table>
    <gridy-pager id="gridyPager"></gridy-pager>
    <gridy-table-info id="gridyTableInfo"></gridy-table-info>
</gridy-grid>

Adding filters

To use date filter gridy-filter-date pakage have to be installed or you to plug preloaded templates.

npm i gridy-filter-date
<script src="/node_modules/jquery/dist/jquery.js"></script>
<script src="/node_modules/gridy-grid-bundle/dist/gridy-grid-bundle.js"></script>
<sk-config
 lang="ru" id="skConfig" theme="antd"></sk-config>
<gridy-grid theme="antd" id="gridyGrid">
    <gridy-data-source dataref="gridData">
        <gridy-data-field title="Title" path="$.title"></gridy-data-field>
        <gridy-data-field title="Price" path="$.price"></gridy-data-field>
        <gridy-data-field title="Created" path="$.created"></gridy-data-field>
    </gridy-data-source>
    <gridy-spinner></gridy-spinner>
    <gridy-filter dri="date" filter-mode="ge" field-title="Created" id="gridyFilter"></gridy-filter>
    <gridy-table id="gridyTable" rd-tpl-fmt="handlebars">
    </gridy-table>
    <gridy-pager id="gridyPager"></gridy-pager>
    <gridy-table-info id="gridyTableInfo"></gridy-table-info>
</gridy-grid>
<script type="module">
    let data = [];
    for (let i = 0; i < 25; i++) {
        let today = new Date();
        today.setDate(today.getDate() + i);
        data.push({title: 'row' + i, price: 100 * i, created: today.toLocaleDateString("en-US")})
    }
    let grid = document.querySelector('#gridyGrid');
    grid.addEventListener('bootstrap', () => {
        grid.dataSource.loadData(data);
        grid.table.whenRendered(() => {
            console.log('table rendered');
        });
    });
    customElements.define('gridy-grid', GridyGrid);
    customElements.define('sk-datepicker', SkDatePicker);
</script>

Bundle build

Just pack everything in one file. No transpilations. Esm modules with components will be bundled in one file.

npm run build

Build with styles inlining

npm --tpl-inline-styles=./node_modules/gridy-grid-jquery,./node_modules/sk-theme-jquery,./node_modules/sk-theme-antd run build

Usage

check index.html for example serve it with http server like this:

npx http-server