All Projects → coderdiaz → Vue Datasource

coderdiaz / Vue Datasource

Licence: mit
A vue.js component to create dynamic tables

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Datasource

Schedule
Schedule is a package that helps tracking schedules for your models. If you have workers in a company, you can set schedules for them and see their availability though the time.
Stars: ✭ 155 (-63.1%)
Mutual labels:  laravel, table
laravel-auto
Laravel Auto - a helper package to make automated lists with filters, sorting and paging like no other
Stars: ✭ 41 (-90.24%)
Mutual labels:  pagination, table
Vue Gates
🔒 A Vue.js & Nuxt.js plugin that allows you to use roles and permissions in your components or DOM elements, also compatible as middleware and methods.
Stars: ✭ 184 (-56.19%)
Mutual labels:  laravel, vue2
Laravel Vue Tasks
📝 Task app built with Laravel 5.5 and Vue 2
Stars: ✭ 66 (-84.29%)
Mutual labels:  laravel, vue2
react-crud-table
A table that includes all the CRUD operations.
Stars: ✭ 34 (-91.9%)
Mutual labels:  pagination, table
Api Restful Con Laravel Guia Definitiva
Repositorio para el código base del curso "API RESTful con Laravel - Guía Definitiva"
Stars: ✭ 95 (-77.38%)
Mutual labels:  laravel, pagination
ag-grid
The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.
Stars: ✭ 8,743 (+1981.67%)
Mutual labels:  pagination, table
Laravel Bootstrap Table List
Bootstrap table list generator for Laravel.
Stars: ✭ 16 (-96.19%)
Mutual labels:  laravel, table
react-strap-table
react table (client and server-side) based on bootstrap.
Stars: ✭ 28 (-93.33%)
Mutual labels:  pagination, table
v-page
A simple pagination bar, including length Menu, i18n support, based on Vue2.x
Stars: ✭ 85 (-79.76%)
Mutual labels:  pagination, vue2
Cursor Pagination
Cursor pagination for your Laravel API
Stars: ✭ 47 (-88.81%)
Mutual labels:  laravel, pagination
Laravel Paginateroute
Laravel router extension to easily use Laravel's paginator without the query string
Stars: ✭ 306 (-27.14%)
Mutual labels:  laravel, pagination
Datagrid
Datagrid for Laravel v5
Stars: ✭ 44 (-89.52%)
Mutual labels:  laravel, pagination
Laravel Table
Generate tables from Eloquent models.
Stars: ✭ 101 (-75.95%)
Mutual labels:  laravel, table
Vue Model
Model component for Vue.js
Stars: ✭ 877 (+108.81%)
Mutual labels:  laravel, vue2
vue3-table-lite
A simple and lightweight data table component for Vue.js 3. Features sorting, paging, row check, dynamic data rendering, supported TypeScript, and more.
Stars: ✭ 148 (-64.76%)
Mutual labels:  pagination, table
Laravel Vue Pagination
A Vue.js pagination component for Laravel paginators that works with Bootstrap
Stars: ✭ 541 (+28.81%)
Mutual labels:  laravel, pagination
Tables
Bulma themed, VueJS powered Datatable with server-side loading and JSON template setup
Stars: ✭ 575 (+36.9%)
Mutual labels:  laravel, pagination
hoc-element-table
📦 A Vue 3.x Table Component built on Webpack 5
Stars: ✭ 26 (-93.81%)
Mutual labels:  table, vue2
Gridjs
Advanced table plugin
Stars: ✭ 3,231 (+669.29%)
Mutual labels:  table, pagination

[WIP] Vue Datasource go back renew. Coming soon V3.

Vue Datasource

A Vue.js component to create dynamic tables. Compatible with Vue 2.x and Laravel.


Demo

Donate

Buy me a coffeeBuy me a coffee

Install/Usage

For use this package is necessary install babel-plugin-transform-vue-jsx dependency.

$ npm install vue-datasource
<div id="#app">
    <server-datasource
        :source="items"
        :total="total_of_items"
        :columns="columns"
        :actions="actions"></server-datasource>
</div>
import { ServerDatasource } from 'vue-datasource'

new Vue({
    el: '#app',
    components: {
        ServerDatasource
    },
    data() {
        return {
            items: [...],
            total: 100,
            columns: [...],
            actions: [...]
        }
    }
});

Documentation

Available Props

Prop Type Default Description
source Array Items to show in table
total Number Total of items
translation Object [Object] Defines the table labels language (structure)
limits Array [1,5,10,15,20] Defines the limits to display
columns Array Columns to display
actions Array Action buttons (structure)

Available Events

Event Description
change Handle show limit changed. Gets object with new show limit and current page {perpage: 10, page: 2}
searching Handles search input. Gets string as parameter
column-sort Only if order is defined in column array. Return the current column sorted with metadata (Sort Column)

Columns

Each column object needs name and key attributes.

{
    ...,
    columns: [
        {
            name: 'Name', // Table column name to display
            key: 'name', // Key name from row object
        }
    ]
}

Laravel users can access relationships through the key attribute. Lets say we have the following object in our users array:

[
    ...,
    {
        name: 'Foo',
        last_name: 'Bar'
        role_id: 1,
        role: {
            name: 'admin'
        }
    }
]

To get the user role we would need to define in our columns array:

{
    ...,
    columns: [
        {
            name: 'Role',
            key: 'role.name'
        }
    ]
}

Sort column

[New] You only need a order property in column defined for use this feature.

{
    ...,
    columns: [
        {
            name: 'Name',
            key: 'name',
            order: true
        }
    ]
}

This feature emit a event column-sort with this data object

{
    sort: {
        key: 'name',
        order: false
    },
    type: 'DESC'
}

Render column

This callback will modify the data for various operations. Such as applying a specific format or an arithmetic operation to the column value and return it.

{
    ...,
    columns: [
        {
            name: 'Name',
            key: 'name',
            render(value) { // Render callback
                return `Enginner ${value}`;
            }
        }
    ]
}

[New] Now you can use JSX for render other templates and too use the row data.

{
    ...,
    columns: [
        {
            name: 'Name',
            key: 'key',
            render (value, row) {
                return <strong>{value}</strong>
            }
        }
    ]
}

Translation Structure

{
    limit: 'Limit',
    search: 'Search',
    placeholder_search: 'Type to search..',
    records_not_found: 'No records found',
    pagination: {
        show: 'Showing',
        to: 'to',
        of: 'of',
        entries: 'entries'
    }
}

Action Event Sctructure

{
    ...,
    actions: [
        {
            text: 'Click me', // Button label
            icon: 'glyphicon glyphicon-check', // Button icon
            class: 'btn-primary', // Button class (background color)
            show(selectedRow) { // Event to define a condition to display the button with the selected row
                return true
            },
            event(e, row) { // Event handler callback. Gets event instace and selected row
                console.log('Click row: ', row); // If no row is selected, row will be NULL
            }
        }
    ]
}

Development

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# run unit tests
npm run unit

# run e2e tests
npm run e2e

# run all tests
npm test

For detailed explanation on how things work, checkout the guide and docs for vue-loader.

Implementation examples

Contributions

All contributions are welcome send your PR and Issues.

License

This is a open-source software licensed under the MIT license

Crafted by Javier Diaz. Translation by itsuwaribito
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].