Giter Club home page Giter Club logo

vue3-excel-editor's People

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  avatar  avatar  avatar

vue3-excel-editor's Issues

add or remove record

let rec = {
        id: 1,
        headerId: 1,
        itemNumber: 1,
        description: "description",
 }
this.jsondata.splice(0, 0, rec);

I try modified v-model data on runtime but it won't effect the grid both appending or removing

I also try $refs.newRecord and $ref.deleteRecords(0) both won't work either

I need to use v-if on the component then switch it's visibility to make it work like this

this.shouldShowDataGrid = false;
await setTimeout(async () => {
        this.shouldShowDataGrid = true;
}, 10);

initStyle of column doesn't work properly - VUE 3

Screenshot 2023-12-04 at 18 16 41

My code

function cellStyle(content) { if(content !== null && content === "BREAK45") { objectColor.color = "red"; return content; } else { objectColor.color = "black"; return content; } }

All columns of row 5 that have the string "BREAK45" should be colored red, but they're not.

Any suggestions?

Delete Column Function

There is an add column function but there is no delete column function.
Being able to delete columns would be cool.

Vue3-excel-editor using CDN

If we were to use CDN for vue3-excel-editor, what should be the cdn link and also what could be the basic idea and approach for the same.

Excel like formula feature

I am trying to use formulas in the sheet. To do this I used to-text prop then executed the input if it starts with = symbol. Now I want to show the formula when the cell is double clicked (in the edit mode). Is there a way to do this?

Support for custom colors schemes dark/light

Hello. Excellent component! Congratulations.

But a very nice feature are:

Custom background / font color to fixed headers [ A | B | C ]. Not only the default gray color
Custom background / font color to fixed rows 1, 2, 3. Not only the default gray color.
Custom background / font color to cells. Not only the default white color.

Something similar to dark/light theme. To adapt the color scheme of the component to existent design.

Thanks!!!

下拉表格能够支持吗

我看现在内置的有select datatime 等,我们项目里面有需要 有个 下拉表格。 类似 aggird 和 hansontable 里面的 下拉表格。
1、下拉表格支持的功能, 支持上下箭头选择行。
2、支持回车选中当前行,并填充数据到弹出单元格的行内。
3、自定义下拉表格工具栏。
4、其他功能同当前table。

data source not loading on component mounting

I am adding a local source of data for the Excel editor like this:

<script setup lang="ts">
import { ref } from 'vue'
const jsondata = ref([
  {
    "name": "John Doe",
    "date": "01/10/2023",
    "wages": "$ 1000.00"
  },
  {
    "name": "Jack Smith",
    "date": "01/12/2023",
    "wages": "$ 2000.00"
  }])
</script>
<template>
    <vue-excel-editor no-footer
    v-model="jsondata">
          <vue-excel-column 
          field="name" 
          label="Name"
          type="string" 
          width="300px" />
          <vue-excel-column 
          field="date"
          label="Date"
          type="date"
          width="150px" />
          <vue-excel-column 
          field="wages"
          label="Wages"
          type="number" 
          width="150px" />
     </vue-excel-editor>
</template>

but the grid shows a "no record" message, if I click on one of the table headers, then it loads the data

virtual scrolling on mobile

Hello,

It is not possible to scroll down when using the phone. The horizontal scroll works perfectly (via finger touch), but the same functionality does not work for virtual scrolling.

Background Color

How can i change the background color of this? trying using tailwind css class but doesn't work only text colors

Nested-headers

Hello, everybody! Is it possible to add subtitles in table like on pic?
image

Grid is not refreshing when rows are deleted.

I am using Vue3 composition API, and I made a button handler to delete selected records. The action partially works. The record(s) are removed from the data model, the 'delete' event is called, and exporting the data afterwards does not include the deleted rows.

However: the rows are NOT visually removed from the table. They still appear, and can be selected and edited. No changes are tracked on those edits, and the records can't be deleted again. Tested with just deleteRecord() and had the same problem.

   const grid = ref<any>(null)
   
   const DeleteRecord = () => {
        grid.value.deleteSelectedRecords()
    }

Bug: Not creating new row after exceeding (# of rows in a page) + 1

(newIfBottom is true)

Table stops creating new rows when I click enter after number of rows in a page + 1. If number of rows in a page is 25 after the 26th row it stops creating new rows. When you import an excel it imports without a problem. But the main problem remains. Let say excel table has 56 rows. After 57th row you can not create new row simply by clicking enter or down arrow.

I think the problem is in the moveSouth function (line 2173 in VueExcelEditor.vue). If you change inside of the if statement from this.currentRowPos + 1 >= this.table.length to this.currentRowPos+1 >= this.pageSize && this.pageBottom >= this.table.length it works. Can you please review and change it?

Vulnerability for dependency xlsx (upgrade sheetjs dependency to address Prototype Pollution vulnerability (CVE-2023-30533))

Description:
The current version of the sheetjs dependency used in this package is vulnerable to a Prototype Pollution attack (CVE-2023-30533). This vulnerability can be exploited to potentially compromise the application's security.

Details:

Nested json

Hi
Could you please explain how can I use nested JSON as a column header field?

for example

{
...
car:[{car1: red},{car2: blue}]
....
}
 <vue-excel-column field="car[0].car1">
 <vue-excel-column field="car[1].car2">

Thank you

Sorting is broken on vue3 version

Basic column sorting does not work anymore on the vue3 version

I can provide a codepen if necessary

Thanks for the great work, this plugin is awesome!

Edit selected data

When data is modified, the selected data is also changed

<vue-excel-editor 
    ref="exGrid" 
    v-model="jsondata" 
    height="300px" 
    @select="gridSelect" 
    @update="gridUpdate"
  >
    <vue-excel-column field="user"   label="User ID"       type="string" width="150px" />
    <vue-excel-column field="name"   label="Name"          type="string" width="150px" />
    <vue-excel-column field="phone"  label="Contact"       type="string" width="150px" />
    <vue-excel-column field="gender" label="Gender"        type="select" width="100px" :options="['F','M','U']" />
    <vue-excel-column field="age"    label="Age"           type="number" width="100px" />
    <vue-excel-column field="birth"  label="Date Of Birth" type="date"   width="150px" />
</vue-excel-editor>

image

image

image

Error with Add Column functionality

runtime-core.esm-bundler.js:220 Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
    at getStyleVal (VueExcelEditor.vue:1512:16)
    at Proxy.colSepMouseDown (VueExcelEditor.vue:1519:11)
    at _createElementVNode.onMousedown._cache.<computed>._cache.<computed> (VueExcelEditor.vue:59:33)
  
[Screencast from 05-02-23 07:03:13 PM IST.webm](https://user-images.githubusercontent.com/42907447/216822215-ecd54f49-405c-4fdf-8f32-dd317c9c4ed6.webm)

How to upload and read file?

with XLSX we can read uploaded file but i can't reproduce it.

Usually we find this on the web:

Inside the Template vue

<label>Files
  <!-- <input type="file" id="files" ref="files" multiple onChange={this.handleChange} /> -->
  <input type="file" @change="onChange" />
</label>
<div v-for="(file, key) in files" class="file-listing">{{ file.name }} <span class="remove-file" v-on:click="removeFile( key )">Remove</span></div>
    <button v-on:click="addFiles()">Add Files</button>
// import XLSX from 'xlsx';  // will make a error
// Changed for:
import { read, utils, writeFile } from 'xlsx';
// but XLSX is still undefined

// and something like that with vue:
    onChange(event) {
      this.file = event.target.files ? event.target.files[0] : null;
      alert(this.file)
      if (this.file) {
        const reader = new FileReader();

        reader.onload = (e) => {
          /* Parse data */
          const bstr = e.target.result;
          const wb = XLSX.read(bstr, { type: 'binary' });
          /* Get first worksheet */
          const wsname = wb.SheetNames[0];
          const ws = wb.Sheets[wsname];
          /* Convert array of arrays */
          const data = XLSX.utils.sheet_to_json(ws, { header: 1 });
        }

        reader.readAsBinaryString(this.file);
      }
    },


- NO 2:
If we uploaded a file with success, 
automatically load the hosted file when reloading the web page.

but if i remove the import XLSX from 'xlsx'; we obiously get:
Uncaught ReferenceError: XLSX is not defined.
I can i load, write and read the excel file?

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.