Giter Club home page Giter Club logo

vue-dataset's Introduction

vue-dataset


πŸ”₯ HEADS UP! You're currently looking at vue-dataset branch for Vue.js 2.
If you're looking for a Vue.js 3 compatible version of vue-dataset, please check out the next branch.


A set of Vue.js components to display datasets (lists) with filtering, paging, and sorting capabilities!
Created with reusability in mind, so that one doesn't have to recreate the same functionality for lists over and over again.

vue-dataset does not impose any structure or layout limitations on your HTML, you can use divs, tables or anything you like to present your data.

Features

  • Highly customizable DOM structure
  • Custom filtering based on the row values from all or specific data keys
  • "Search as" feature allows for searching using a custom search method
  • Multi "column" searching, search data keys are configurable
  • "Sort as" feature allows for sorting using a custom sorting method
  • Multi "column" sorting, sortable data keys are configurable
  • Pagination
  • Global search with debounce setting
  • Easy to extend with custom components

Browsers support

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
IE11, Edge last 2 versions last 2 versions last 2 versions last 2 versions

Documentation and examples https://vue-dataset-demo.netlify.app/

Development

In order to start development:

npm i
npm run watch

vue-dataset's People

Contributors

kouts avatar mesqueeb avatar semantic-release-bot avatar simedia-andreasbaumgartner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-dataset's Issues

Issues with # entries to show and page focus.

Hi,

I implemented your libary but when I started testing with some more data I found the following issues:

  • When I set :ds-show-entries="100" on DatasetShow it will automatically focus on the last page.
  • The same will happen if you leave the default of 10 and switch to 100 using the dropdown or switch from 100 to 50, go to page one and reselect 100.

sidenote: you can also see that when we switch from 100 -> 25 the pagenr 3 stays active. because of this item 50-74 gets rendered. I think this is a bit weird. I think switching the amount of items should always preserve the first item and add the amount needed after that.
eg.

  • show 100 (showing 201-250)
  • switch to 25 (showing 201-225)

I made a codepen/screencast so you can see this issue for yourself:
https://codesandbox.io/embed/vue-2-playground-forked-0rgcdo?fontsize=14&hidenavigation=1&theme=dark

issues_dataset.mov

Vue @ 2.6.12 -> tried with latest version too but issue still exists
vue-dataset @ 1.1.15 -> issue seems to exists from all versions > 1.1.5 (lower versions can not run the code as is.)

Hope you can find a solution for this issue since I really like how this component is made apart from this.

Thanks for your work & time!

documentation: ds-filter-fields

The general functionality of ds-filter-fields might benefit from further detail as to how multiple values for one field can be part of the filtering of that field and how testing for the truthiness of a condition is the basis for filtering rather than just passing the actual list of values as the filter (in my mind, the latter would have been a more intuitive and simpler approach for the end-user).

Also, the documentation seems to have a bug related to the explanation.

startsWithD (value) {
  return value.toLowerCase().startsWith('D')
}

The startsWithD function is going to return false all the time because startsWith('D') is always comparing a lowercase d with an uppercase D. I think the function was supposed to be value.toLowerCase().startsWith('d')?

https://next--vue-dataset-demo.netlify.app/components/#props

passing an object variable into :ds-filter-fields

Hi @kouts,

Let me start by saying I've been enjoying vue-dataset very much! You've done a great job here, so please read this as more of a question than a complaint.

I'm trying to add custom filtering to a dataset table, by building a "filterObject" object and then passing that as the value of the ds-filter-fields prop:

let filterObject = { id: 115 }
:ds-filter-fields="filterObject"

But it doesn't seem to be working. It works correctly when I explicitly define the object inline:

:ds-filter-fields="{ id: 115 }"

I've tried it as a ref:

let filterObject = ref({ id: 115 })
:ds-filter-fields="filterObject.value"

I've also tried as a reactive object to no success, but I haven't tried as a computed variable.

Is there a way to make it work by passing an object variable? Is there something I'm missing?

Thanks for any help!

DatasetItem and get values from nested json array

Hi,
I had this vue-dataset of yours to get the values to display the table of array of json data, and it looks great. Then I tried to get the data in sub_title_2 that is the nested json array to display as a table using the feature similar to 'DatasetItem' as a new .vue file to add some v-for in the child node, but failed to do so. Is there a way how to get this feature work a bit for nested json data structure like this?

nested json data structure

[{
    "id": 1,
    "title": "Salad",
    "sub_title": [{
        "id": 11,
        "title": "size",
        "sub_title_2": [{
             "id": 111,
             "title": "size S"
             "publication_date": "2017-08-28",
             "year": 2560
          },
          {
             "id": 112,
             "title": "size M"
             "publication_date": "2017-09-28",
             "year": 2560
          }]
      }]
},
{
    "id": 2,
    "title": "Meat",
    "sub_title": [{
        "id": 21,
        "title": "size",
        "sub_title_2": [{
             "id": 211,
             "title": "size S"
             "publication_date": "2017-08-28",
             "year": 2560
          },
          {
             "id": 212,
             "title": "size M"
             "publication_date": "2017-09-28",
             "year": 2560
          },
          {
             "id": 213,
             "title": "size L"
             "publication_date": "2017-10-28",
             "year": 2560
          }]
      }]
}]

DatasetNestedItem.vue

<template>
  <component :is="tag">
    <template v-for="(rowIndex, i) in dsRows">
      <slot :row="dsData[rowIndex]" :row-index="rowIndex" :index="indexes[i]"></slot>
      <template v-for="(rowIndex2, j) in i.sub_title">
        <slot :row2="dsData[rowIndex2]" :row-index="rowIndex2" :index="indexes[j]"></slot>
      </template>
    </template>
    <slot v-if="!dsRows.length" name="noDataFound"></slot>
  </component>
</template>

And this is how I created the table

<table class="table table-striped d-md-table">
<thead>
    < tr >
      < th scope="col">Title</ th>
      < th scope="col">Date</ th>
      < th scope="col">Year</ th>
    </ tr >
</thead>
<dataset-nested-item class="form-row mb-3" tag="tbody">
  <template #default="{ row2, rowIndex2 }">
    <tr>
       <td>{{ row2.sub_title_2.title }}</td>
       <td>{{ isoDateToEuroDate(row2.sub_title_2.publication_date) }}</a></td>
       <td>{{ row2.sub_title_2.year }}</td>
    </tr>
  </template>
</dataset-nested-item>
</table>

Suggestions will be great help.
Thanks

Use naive-ui class for pager

Hi,
I use naive-ui css base style for my project, and I'm interested to use vue-dataset as card list for tables data.
No problem to render items as cards, but the pager is displayed as ul, because the pager control is strictly bounded to Bootstrap css class, and my project don't use Bootstrap.

The best would be to use the naive-ui pagination control component.

I have tried to use your proposal vue2-dataset-custom-pager to post Custom pagination controls **#75**
but it is for Vue2 and I use Vue 3 composition api, the inject it seems not load any value.

Any help please ?
Thanks for your code.

is support Ajax

Hi kouts, thanks for the effort of the repo, I like the card UI very much.

In my situation, I need to get data from ajax request, and I wrote code below, but it always error and can not display card properly. I feel frustrated, how should I make it work?

1 html

<!DOCTYPE html>
<html lang="en">
 <head>
   <!-- Required meta tags -->
   <meta charset="utf-8" />
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />

   <!-- Bootstrap CSS -->
   <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous" />

   <title>Dataset UMD build test 11 1</title>
 </head>
 <body>
   <div id="app"></div>
   <script type="text/html" id="app-template">
     <div class="container pt-4">
       <dataset
         :ds-data="users"
         :ds-sortby="['name']"
         :ds-search-in="['balance', 'birthdate', 'name', 'company', 'email', 'phone', 'address', 'favoriteAnimal']"
       >
         <div class="row mb-2">
           <div class="col-md-6 mb-2 mb-md-0">
             <dataset-show />
           </div>
           <div class="col-md-6">
             <dataset-search  ds-search-placeholder="Search..." />
           </div>
         </div>
         <div class="row" >
           <div class="col-md-12">
             <dataset-item class="form-row">
               <template v-slot="{row, rowIndex}"   >
                 <div class="col-md-4" >
                   <div class="card mb-2">
                     <div class="card-body pt-3 pb-2 px-3">
                       <h5 class="card-title text-truncate mb-2" :title="'Index: ' + rowIndex">
                         <span :class="['font-16', statusClass[row.onlineStatus]]">⬀</span> {{ row.name }}
                       </h5>
                       <h6 class="card-subtitle text-truncate text-muted">{{ row.email }}</h6>
                       <p class="card-text text-truncate mb-0">{{ row.balance }}</p>
                       <p class="card-text text-truncate text-right">{{ row.birthdate }}</p>
                     </div>
                   </div>
                 </div>
               </template>
               <template v-slot:noDataFound>
                 <div class="col-md-12 pt-2">
                   <p class="text-center">No results found</p>
                 </div>
               </template>
             </dataset-item>
           </div>
         </div>
         <div class="d-flex flex-md-row flex-column justify-content-between align-items-center">
           <dataset-info class="mb-2 mb-md-0" />
           <dataset-pager />
         </div>
       </dataset>
       </div>
   </script>

   <script type="text/javascript" src="https://livejs.com/live.js"></script>
   <script src="jquery-3.5.1.js"> </script>
   <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
   <script type="text/javascript" src="./umd/Dataset.js"></script>
   <script type="text/javascript" src="./umd/DatasetInfo.js"></script>
   <script type="text/javascript" src="./umd/DatasetItem.js"></script>
   <script type="text/javascript" src="./umd/DatasetPager.js"></script>
   <script type="text/javascript" src="./umd/DatasetSearch.js"></script>
   <script type="text/javascript" src="./umd/DatasetShow.js"></script>

   <script type="text/javascript">
     const app = new Vue({
       el: '#app',
       template: '#app-template',
       data: {
         users: [] ,
         statusClass: {
           Active: 'text-success',
           Away: 'text-warning',
           'Do not disturb': 'text-danger',
           Invisible: 'text-secondary'
         }
       },

       components: {
         Dataset: Dataset,
         DatasetInfo: DatasetInfo,
         DatasetItem: DatasetItem,
         DatasetPager: DatasetPager,
         DatasetSearch: DatasetSearch,
         DatasetShow:  DatasetShow
       },

       mounted: function () {
         var self = this;
         $.ajax({
           url: 'users.json',
           method: 'GET',
           success: function (data) {
             self.users = data
           },
           error: function (error) {
             console.log(error);
           }
         });
       }
     });



   </script>
 </body>
</html>

2 users.json

 [
 	{"_id":"58b7d739-5045-49b6-9404-6e0e69dab341","isActive":false,"onlineStatus":"Invisible","balance":39317,"birthdate":"1980-03-09","favoriteColor":"Crimson","name":"Gawain Cumpsty","firstName":"Gawain","lastName":"Cumpsty","company":"Quaxo","email":"[email protected]","phone":"985-353-3917","address":"4669 Northland Circle","favoriteAnimal":"Deer, roe"},
 	{"_id":"254781b4-4bc2-49c1-98de-4a93a7bbace4","isActive":true,"onlineStatus":"Do not disturb","balance":31192,"birthdate":"1972-09-29","favoriteColor":"Indigo","name":"Even Harraway","firstName":"Even","lastName":"Harraway","company":"Shuffledrive","email":"[email protected]","phone":"217-861-5367","address":"1 Meadow Valley Circle","favoriteAnimal":"African clawless otter"},
 	{"_id":"482c48e5-7dd5-4e28-8968-51813ca63625","isActive":true,"onlineStatus":"Do not disturb","balance":34949,"birthdate":"2004-02-11","favoriteColor":"Fuscia","name":"Mile Fulloway","firstName":"Mile","lastName":"Fulloway","company":"Flashspan","email":"[email protected]","phone":"225-853-2332","address":"683 Lakeland Crossing","favoriteAnimal":"Starling, cape"}
 ]

3 error info and preview

image

Update dataset item

Hi, i'm workin on Vue 3.2 + naiveUI.
The dataset is working fine in dev environment but when i build the web app (production env) the dataset doesn't update reactive but i have to reload the page when i add a new item to array of object.

Main .vue component instructions:

// Dataset definition:
let dsRollType = reactive<dsRollTypeBase[]>([])

onBeforeMount(async () => {
    dsRollType = (await getRollTypes()).data
})

Dataset component definition on template

<dataset v-slot="{ ds }" :ds-data="dsRollType" :ds-filter-fields="dsFilterFields" :ds-search-in="['name', 'description', 'id']" :ds-search-as="{}">

The following function is from external class:

private liveModelAdd(dsRollType: any, row: rsRollType) {
    const newElementBase = this.createCardObject(row)
    dsRollType.push(newElementBase)
  }

Is there also a way to delete an item from dataset without reload the page?

Thanks

External contributions

@kouts -- Thank you for this useful project. I'm using in a current project and finding it very helpful. There were a few changes I needed to make to suit my needs including using Bootstrap 5, some additional styling items, and a couple bug fixes. I ended up just pulling the code files into my project branch and making local modifications. Along the way, I converted it over to the composition API since that's what I'm using in my project.

I'd love to help your project out if my changes are useful. Unfortunately, it'll be a while before I have time to make a proper PR from a branch of your project. If you'd find it useful I can send you my version of code along with some notes about what I changed.

Either way, thanks for you work on this.

vue-dataset is not reactive

I am using vue-dataset for Vue.js 3.

In this case, vue-dataset does not show any data, only 'No results found'.

<script setup lang='ts'>
import { Dataset, DatasetInfo, DatasetItem, DatasetPager, DatasetSearch, DatasetShow } from 'vue-dataset';
import { dataService } from '../client';

import { onBeforeMount, ref, reactive } from 'vue';

let itemId = 123;
let itemData = reactive( [] );

onBeforeMount( async () => {
  dataArray = await dataService.getItemData( itemId );
  for ( let dataEntry of dataArray ) { itemData.push( { attrA: dataEntry.a, attrB: dataEntry.b } ) }
});
</script>

<template>
<dataset v-slot=" { ds } " :ds-data=" itemData ">
  <dataset-item>
    <template #default=" { row, roIndex, index } ">
      <div>{{ row.attrA }}</div>
      <div>{{ row.attrB }}</div>
    </template>

    <template #noDataFound>
      <p>No results found</p>
    </template>
  </dataset-item>
</dataset>
</template>

Filtering (<select>) on nested array

First, thank you for publishing this great feature set -- nice work!

I've been trying to find a solution for filtering (based on a <select> value) in a nested array, e.g. in "majors" here:

{
      "name": "Environmental Science",
      "type": "BA",
      "year_of_entry": "2020–2022",
      "plan_label": "4-Year Plan",
      "majors": [
        "Environmental Science",
        "Biology"
      ]
    }

Following one of your past examples, I was looking to a computed method, filterFields(), but haven't had any luck. In my trials I also found that the previously mentioned example doesn't seem to work on Vue 3 and the latest (next) version of vue-dataset.

Any assistance getting me in going in the right direction will be much appreciated.

Cheers!

template is being rendered above the table

Hi,

I have copied your code over and am trying to simply get the example working. As far as searching, sorting, paging etc everything works fine. The one thing that doesn't is the rendering of the datasetitems. I'm certain there is some config I am missing.

image

As you can see the rows appear above the table even though the html is as the example in the docs.

This is the code:

Vue.component('v-select', VueSelect.VueSelect);
Vue.component('Dataset', VueDataset.Dataset);
Vue.component('DatasetItem', VueDataset.DatasetItem);
Vue.component('DatasetInfo', VueDataset.DatasetInfo); 
Vue.component('DatasetPager', VueDataset.DatasetPager);
Vue.component('DatasetSearch', VueDataset.DatasetSearch);
Vue.component('DatasetShow', VueDataset.DatasetShow);

var vm = new Vue({
        el: '#normsApp',
        data: {
            users: [{
                "_id": "EA265B20-45F2-953C-C534-3E2A7862059C",
                "isActive": false,
                "onlineStatus": "Do not disturb",
                "balance": 93683,
                "birthdate": "1946-07-22",
                "favoriteColor": "orange",
                "firstName": "Harper",
                "lastName": "Nolan",
                "name": "Harper Nolan",
                "company": "Tortor At Risus LLC",
                "email": "[email protected]",
                "phone": "(0111) 194 7651",
                "address": "P.O. Box 298, 5571 Mauris Rd.",
                "favoriteAnimal": "owl"
            }] // left the rest out for the sake of the example.
            
            cols: [
                {
                    name: 'Name',
                    field: 'name',
                    sort: ''
                },
                {
                    name: 'Email',
                    field: 'email',
                    sort: ''
                }
            ]
        },
        computed: {
            sortBy() {
                return this.cols.reduce((acc, o) => {
                    if (o.sort) {
                        o.sort === 'asc' ? acc.push(o.field) : acc.push('-' + o.field)
                    }
                    return acc
                }, [])
            }
        },
        methods: {
            click(event, i) {
                let toset;
                const sortEl = this.cols[i];
                if (!event.shiftKey) {
                    this.cols.forEach((o) => {
                        if (o.field !== sortEl.field) {
                            o.sort = '';
                        }
                    })
                }
                if (!sortEl.sort) {
                    toset = 'asc';
                }
                if (sortEl.sort === 'desc') {
                    toset = event.shiftKey ? '' : 'asc';
                }
                if (sortEl.sort === 'asc') {
                    toset = 'desc';
                }
                sortEl.sort = toset;
            }
        },
        mounted() {
            
        }        
    });
                               <dataset v-slot="{ ds }"
                                     :ds-data="users"
                                     :ds-sortby="sortBy"
                                     :ds-search-in="['balance', 'name', 'company', 'email', 'phone', 'address', 'favoriteAnimal']">
                                <div class="row" :data-page-count="ds.dsPagecount">
                                    <div class="col-md-6 mb-2 mb-md-0">
                                        <dataset-show />
                                    </div>
                                    <div class="col-md-6">
                                        <dataset-search ds-search-placeholder="Search..." />
                                    </div>
                                </div>
                                <div class="row mt-3">
                                    <div class="col-md-12 table-responsive">
                                        <table class="table table-striped">
                                            <thead>
                                                <tr>
                                                    <th v-for="(th, index) in cols" :key="th.field" :class="['sort', th.sort]" v-on:click="click($event, index)">
                                                        {{ th.name }} <i class="gg-select float-right"></i>
                                                    </th>
                                                </tr>
                                            </thead>
                                            <dataset-item tag="tbody">
                                                <template #default="{ row, rowIndex }">
                                                    <tr>
                                                        <td>{{ row.name }}</td>
                                                        <td>{{ row.email }}</td>
                                                    </tr>
                                                </template>
                                            </dataset-item>
                                        </table>
                                    </div>
                                </div>

                                <div class="row">
                                    <div class="col-6">
                                        <dataset-info class="mb-2 mb-md-0" />
                                    </div>
                                    <div class="col-6">
                                        <dataset-pager />
                                    </div>
                                </div>
                            </dataset>

I18N

First of all, thank you for this very useful project!

I was wondering: How would I go about changing I18N to another language?

Custom pagination controls

Does this package support custom pagination controls and if yes, is there a guide on how to do it because the current docs do not explain this really well.

Example 2

In directory playground is missing directory utilities..
import { filterList, clone, isoDateToEuroDate, searchAsEuroDate } from '../utilities'

incorrectly "packaged" ...?

not 100% sure yet what's causing this but Vite gives this error
image

Vite might force packages to use exports in the package.json, but will research some more.

Vite import problem and workaround

Using Vitepress and Vite with SSR, I used this import:

  import { 
    Dataset,
    DatasetItem,
    DatasetInfo,
    DatasetPager,
    DatasetSearch,
    DatasetShow
  } from 'vue-dataset'

and received this error:

SyntaxError: Named export 'Dataset' not found. The requested module 'vue-dataset' is a CommonJS module, which may not support all module.exports as named exports.

I don't know exactly what Vite doesn't like about the package but I found a workaround using:

// vite.config.js

export default {
  ssr: {
    // Add npm packages containing invalid code here
    noExternal: ['vue-dataset']
  }
}

from this page: https://vite-plugin-ssr.com/broken-npm-package#solution

How to fix rowindex ordering?

This is very lightweight project, I loved it!.
I have issue about row index. It mess up when we sort by column, How to fixed that?
Thank

Screenshot 2564-10-20 at 20 33 46

Screenshot 2564-10-20 at 20 34 03

Clear the search input?

Hi Kouts, How can I clear the search input with a click method? I've tried this.search = '' and this.dsSearch = '' but neither seem to work.

Comparison Mode "Multiple"

Hi there,

first: very nice extension, thanks for developing.

My question is: is it possible to have a checkbox logic, where the cards in the list get filtered on a multiple comparison mode?

[ checkbox-a, checkbox-b ]

So, i check checkbox a and the list displays only items with items-a - so far, so good, thats what possible in the cards example - but when i also check checkbox b, i want the list to display items with values a and b.

So, instead of a radio-logic like in the example, i want a checkbox logic where the items in the list add up based on the selected checkboxes. Any ideas how i get there?

DatasetShow output raw html

@kouts It would be really nice, if would actually only output the select, so the dev can decide if and what text should go around it and which classes should be applied. In my case, I am using tailwind andoverwriting existing classes feels really bad.

Maybe reopen this issue?

Originally posted by @heikopaiko in #47 (comment)

:ds-search-in="['customer.xxxx']" nested object

Hi,
I have a ds-data like
[ { reference:'ref1', customer:{ name:'my name1', code:'my code1'} }, reference:'ref2', customer:{ name:'my name2', code:'my code2'} } ]

I added :ds-search-in="['customer.code']" but it doesn't work i search for 'My code2'
Where am I wrong ?

Thanks a lot for your help
Guillaume

Translations with Nuxt

How to import Dataset using NuxtJS?

Using pure Vue I can do it as in the documentation, but Nuxt doesn't accept the import in the standard way.

*I need to extend and be able to do the translation.

What is the returned data object after I run a filter function?

Hi, after I execute a filter function I need to use the returned (filtered) data object in another vue method. Can you show example snippet of how this is done? IE.. Using "ds-data" or "dsData" does not seem to work. What is the returned data object after filtering it?
As an example, after running the filter function, in another method how do I console.log that filtered data set?

Thanks

Group results

Is there an easy way to group results? E.g., with a dataset like this:

    [
         { id: 0, grouptitle: 'Group 1', items: [
             { id: 0, title: 'Test 1' },
             { id: 1, title: 'Test 2' },
        ]},
         { id: 1, grouptitle: 'Group 2', items: [
             { id: 0, title: 'Test 3' },
             { id: 1, title: 'Test 4' },
        ]},
   ]

... to create a table something like this:

IDTitle
Group 1
0Test 1
1Test 2
Group 2
0Test 3
1Test 4

Access data sub element

Hello,
the title is a bit vague so let me illustrate :
i would like to know if "ds-search-in" can take an element that is inside an object, basically like this :
image
image

Thanks !

DatasetShow Component shows wrong number of shown entries on initial load

I'm using the the dataset-show component like this:
<dataset-show :ds-show-entries="25" />

It shows me 25 items per page, which is correct. But the selected options is 5, but it should be 25.

When changing the selected options to 50, I get 50 results and the text inside the select is 50, which is fully correct.

Bildschirmfoto 2022-06-18 um 17 42 14
.

documentation: update:dsData and returned data object after filter function

The documentation for update:dsData as found on the "next" site left me wondering how to use the feature.
https://next--vue-dataset-demo.netlify.app/components/#provides

Fortunately, someone had raised the issue earlier on github. "What is the returned data object after I run a filter function? #95"
#95

An example of how to use the api was provided in the answer.

@update:ds-data="updateDsData"

It would be helpful if the documentation site could reflect some of this info so it is not necessary to search through github issues as to how the update:dsData feature works.

Dataset opening on last page

I have a dataset that is empty on mount. The data is loaded in the parent's mounted() method and arrives whenever the AJAX call there has finished. The dataset does populate correctly, then, but it always opens on the last page. Is there a way to fix this?

search in object

I have a json like this
[ { "id": 1, "station_name": "ARR Sungsang", "station_type": 1, "provinsi": 1, "balai": 1, "location": "Sungsang 1", "sungai": null, "sn_logger": "1", "sn_modem": "1", "longitude": 104.897285, "latitude": -2.364155, "elevasi": 4, "image": "/media/stations/e4eb6e30-0a9.jpg", "topic_MQTT": "topic 1", "observator": "obs arr 1", "observator_phone": "0897887887", "map_icon": 1, "siaga": 1 }, { "sensor1_act": true, "sensor1_ch": 1, "sensor1_w_lvl_1": 1, "sensor1_w_lvl_2": 1.5, "sensor1_w_lvl_3": 2, } ]
How to search inside station_name? thanks

custom filtering: array of values instead of one specific value for a field?

I've tried to look for examples in documentation and past issues about filtering, but have been unable to find a solution to the challenge of using an array of values for one field as a filter. The examples, whether they use the standard filtering mechanism, or whether they pass a custom filterFields function to :ds-filter-fields all appear to pass one value to one field; e.g., { "active": true } or { "color": "green" }.
But what about the case where you want to filter on more than one value of one field, such as { "color": ["green", "blue", "orange"] }, or passing as [{ "color": "green" }, { "color": "blue" }, { "color": "orange" }]? Is it possible to filter data in this type of scenario?

Filter a row on multiple fields

Pull request #124

I would like to filter rows depending on the value of two related fields.
For instance, let's say we've got two fields, startDate and endDate

[
...
{ startDate: "2023-10-10T10:00:00", endDate: "2023-11-10T10:00:00" },
...
]

and I would like to filter that row if it's matching with today date:

startDate < Date.now() < endDate

Given the fact that currently each filter definition in "ds-filter-fields" receives the value of the key field only, is it possible, and how?

Thank you!

Dynamic data import sets pager to last page

I'm using dataset in a component that dynamically loads in data in its created() method. This means, the data array is initially empty and gets filled once the AJAX call has finished. Dataset correctly displays the data, however, if there is more than one page, it always jumps to the last page. Is there a way to fix this?

Alternatively, is there a way to programmatically set the current page?

nodatafound template might need to be lowercase

My browser (chrome) is normalizing the #noDataFound template name to lowercase, thus breaking the functionality.

I have found a bit of documentation on this behavior, it seems like we might want to migrate it to kebab-case.

https://vuejs.org/guide/essentials/component-basics.html#dom-template-parsing-caveats
HTML tags and attribute names are case-insensitive, so browsers will interpret any uppercase characters as lowercase. That means when you’re using in-DOM templates, PascalCase component names and camelCased prop names or v-on event names all need to use their kebab-cased (hyphen-delimited) equivalents

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


The release 1.2.0 on branch master cannot be published as it is out of range.

Based on the releases published on other branches, only versions within the range >=1.1.8 <1.2.0 can be published from branch master.

The following commits are responsible for the invalid release:

  • Merge branch 'dev' (8d1b491)
  • feat: added iteration index (58cdb2f)
  • chore: updated npm packages (4fca8dd)
  • Merge branch 'dev' (e00919d)
  • docs: fixed badge styling (6ad0704)
  • Merge branch 'dev' (3eb82f7)
  • chore: removed dist from .gitignore (d326d99)

Those commits should be moved to a valid branch with git merge or git cherry-pick and removed from branch master with git revert or git reset.

A valid branch could be next.

See the workflow configuration documentation for more details.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Why does DatasetShow output DOM?

Hi there,

I'm wondering why dataset-show outputs

<div class="form-inline">
  <label>Show</label>
  <select class="form-control mr-1 ml-1"> ... </select>
  <label>entries</label>
</div>

I would think it would solely output the <select> and the dev could make the decision on whether they want to output "Show" & "entries", and where to output them, as well as what classes to give them, if any.

Is there a way to remove these or override the classes passed? Currently, this is how the outlook looks:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.