Git Product home page Git Product logo

dream-num / luckysheet Goto Github PK

View Code? Open in Web Editor NEW
15.6K 210.0 2.3K 27.59 MB

Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source.

Home Page: https://dream-num.github.io/LuckysheetDocs/

License: MIT License

JavaScript 90.86% CSS 2.72% HTML 6.39% Batchfile 0.03%
spreadsheet javascript excel data-table google-spreadsheet google-sheets formula xlsx canvas office sparkline chart conditional-formatting pivot-tables web-based

luckysheet'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  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

luckysheet's Issues

[BUG]JS浮点数运算结果不精确,导致公式计算结果错误

描述错误
JS浮点数运算结果不精确,导致公式计算结果错误

重现
重现错误的步骤:

  1. https://mengshukeji.github.io/LuckysheetDemo/ 输入数据
A1: 0.3
B1: 0.3
C1: 0.3
D1: 0.1
A2: =1-SUM(A1:D1)
  1. 期待结果 A2 = 0
  2. 实际计算结果 A2 = 1.11022e-16

期望的结果
解决JS浮点数运算结果不精确的Bug
参考1:https://juejin.im/post/6844903903071322119
参考2: camsong/blog#9

屏幕截图或演示
image

环境:
-操作系统:[Windows]
-浏览器 版本号:[例如 Chrome Version 85.0.4183.83 (Official Build) (64-bit)]
-Luckysheet版本:[最新]

[BUG] 复制粘贴单元格之后字体变了

Describe the bug
单元格复制粘贴之后字体发生了变化

To Reproduce
Steps to reproduce the behavior:

  1. 复制一个单元格
  2. 切换到另外一个单元格输入
  3. 再切换一个单元格粘贴
  4. 粘贴后的字体和第二步复制的字体大小不一致,另外按 command 键,会在公式栏显示之前复制的值

What is expected?
css length 文档可知,1in = 2.54cm = 96px,1pt = 1/72nd of 1in. 所以 px 可以直接换算成 pt,和设备的 dpr 是没有关系的。

Screenshots or demo
1222

Environment

  • OS: Mac
  • Browser Version: Chrome Version 85.0.4183.83 (Official Build) (64-bit),Chrome
  • Luckysheet Version: latest

Additional context
Add any other context about the problem here.

[BUG]rowhidden设置无效,表格加载时仍然会显示应该隐藏的行

描述错误
表格加载时,会把config.rowhidden清空,设置为{}。导致本应隐藏的显示出来了

重现
重现错误的步骤:

  1. 可参见Demo,https://mengshukeji.github.io/LuckysheetDemo/
  2. 第31、32行,数据里设置的是

"rowhidden": { "30": 0, "31": 0 }
但加载到Luckysheet之后,在console.log("DATA",luckysheet.getluckysheetfile()[0]);可以看到 rowhidden:{}

期望的结果
colhidden是正常的,希望把rowhidden的bug修复

屏幕截图或演示
image

环境:
-操作系统:[Windows 10]
-浏览器 版本号:[例如 Chrome 版本 85.0.4183.83 (正式版本) (64 位)]
-Luckysheet版本:[最新]

[BUG]'fullscreenmode: false' does not work

Description
Option 'fullscreenmode: false' does not work. I first tried by simply passing it as an option (see below) and verifying in the debugger that the option is passed correctly (it is passed correctly). This had no effect, I still saw a fullscreen spreadsheet. Then I downloaded the cdn js file luckysheet.umd.js, and edited it to change the default to be 'false' (!1) rather than true (!0). Reloading with an html file pointing at this changed version still gave me a fullscreen spreadsheet.

To Reproduce
Follow the exact instructions you give to use luckysheet. In the options object, just add one line: 'fullscreenmode: false,'.

What is expected?
The other divs on the page should show side by side with the luckysheet spreadsheet. They don't.

Environment

  • OS: Linux
  • Browser Version: Firefox Nightly 82, Chromium 85
  • Luckysheet Version: latest

[BUG]相同格式的单元格无法使用拖动方式快速生成序列或复制填充

描述错误
对于格式相同的合并单元格,比如序号列,单无格都是两个单无格的合并方式,在这种情况下采用快速拖动生成数字序列的方式被提示为“无法对合并单元格执行该操作”。

期望的结果
就理解,对于含有不同合并形式的无法执行,但如果是合并形式完全相同的单元格,该操作应该可执行。

[BUG] Cannot create spreadsheet smaller than 22x30

The option object allows the user to specify how many rows and columns the spreadsheet should have. But numbers smaller than 30 rows and 22 columns are not accepted. They are changed to 30 and 22 respectively.

The fix is simple, in the function luckysheetcreatedom, there is:

    if(rowheight < 30){
        rowheight = 30;
    }
    if(colwidth < 22){
        colwidth = 22;
    }

This makes it impossible to use luckysheet for cases where small spreadsheets are needed. Changing the above to something like

    if(rowheight < 2){
        rowheight = 2;
    }
    if(colwidth < 2){
        colwidth = 2;
    }

would allow this use-case without introducing any complication, as far as I can tell. (Changing it in my test worked perfectly fine.)

[BUG]横向滑动到末端触发纵向滚动

Describe the bug
未选中单元格时,用MacBook自带trackpad来横向滑动(从左往右),当滑动到末端,纵向滚动条也会发生滑动

To Reproduce
打开 demo 站点,增加页面的rows,在页面同时出现XY轴的滚动条后,用trackpad来滑动页面

What is expected?
横向(或纵向)的滑动,不会触发纵向(或横向)的滚动

Environment

  • OS: Mac
  • Browser: Safari
  • Luckysheet Version: latest

[Feature request] Support for locked cells and hidden formulas

Similar to excel, cells could be set to be locked and/or hidden,

  • For locked cells, formulas and values would not be editable...
  • For hidden cells, formulas would not be visible

For a cell with a formula, if you lock it and hide it, then you would not be able to edit it, and you would not be able to see the formula. You would only be able to see the result of the formula being executed.

[Feature request] Custom Button

Could you please add a custom button feature that is able to customize buttons (and even other fields, like checkboxes, radios, ...)?

How can I build clickable buttons inside the cells that change their output results when clicked multiple times:

For instance, I want to build this table that has custom buttons:
0

Some other questions: Luckysheet can show just used cells? And does support multiple headers?

数据回填的时候,设置的公式会失效

通过getluckysheet方法遍历里面的数据,把所有的内容填写到v字段中保存,公式f也存在,再保存r和c字段,存到数据库中,再从服务端取得数据之后回填,会发现公式格子中,公式存在,但是无法进行计算

[BUG]单元格计算结果为非数字结果后, 原本的格式也会失效,而且单元格不能再被赋予格式

描述错误
有时候,单元格的计算结果可能会出现 #NUM! 或者 #DIV/0! 之类的非数字结果.
当修改输入值, 计算结果正确时,单元格却不能按照之前的格式来显示,而是只显示计算后的值,而且此单元格不能再改变格式.

重现
重现错误的步骤:

  1. 设置A1为1, B1为2, A2为 =A1/B1, 此时 A2的计算结果为 0.5
  2. 从工具栏点击 % 设置A2的格式为百分比显示, 此时A2显示为 50%
  3. 编辑B1为0, 0不能被除, 所以A2的结果显示为 #NUM!
  4. 再把B1改回2, A2显示为 0.5, 之前设置的百分比格式没有了, 而且这时再点击工具栏的 % 或者其他格式,都不能改变A2的格式.

期望的结果
A2单元格保持格式,无论计算结果是什么, 因为很多时候 会出现 #NUM! 或者 #DIV/0!的情况,当计算结果变回数字后,格式却没有了,也不能再被设置.

屏幕截图或演示
Luckysheet

环境:
-操作系统:[Windows]
-浏览器 版本号:[Chrome 版本 85.0.4183.121 (Official Build) (64-bit)]
-Luckysheet版本:[最新]

[BUG]撤销操作之后,单元格选框不见了

描述错误
撤销操作之后,单元格选框不见了

重现
重现错误的步骤:
1、修改任意单元格,然后"撤销”

期望的结果
撤销操作之后,单元格选框应该定位到撤销的单元格,与 excel 一致。

屏幕截图或演示
image
image

环境:
-操作系统:win10
-浏览器 版本号:Chrome 版本 79.0.3945.88(正式版本) (64 位)
-Luckysheet版本:最新

[BUG]单元格文字编辑非文字末尾时的错误

描述错误
单无格内的文字编辑,如果不是在文字尾部,在头部或中间任意位置编辑,输入一个字符后,光标就会跳到文字尾部,无法连续在头部或中间输入文字。
删除时同样的问题。

使用luckysheet.setcellvalue方法设置表格边框 设置完成之后不生效

使用luckysheet.setcellvalue方法设置表格边框 设置完成之后不生效,代码如下

var obj = {
v: tab_value,
fc: '#f90',
bc: '#000',
bs: 'Thick',
ht: '0',
vt: '0',
tb: 1,
//bg: '#f60',
bs_t: 'Thick',
bc_t: '#000',
};

			luckysheet.setcellvalue(target.row, target.column, luckysheet.flowdata, obj);
			luckysheet.luckysheetrefreshgrid();

更新后的一些小问题

1、设置折行显示后拖动改变列宽,该单元格内容显示不出来。
2、单元的文字垂直对齐方式问题,设置为底部对齐,不管单元格高度多少,文字总会缺失一半。(该问题似乎只在firefox下出现)
3、图表添加后无法操作,也无法通过撤销操作删除,图表会在每个sheet页显示。
4、columlen这个地方应该是个typo,定义列的部分columnlen。(第一版就有了)
5、国际化的命名上是不是按全称会更通用一些,比如使用zh_CN/en_US。
补充:
6、点击添加按钮增加sheet页后,多次执行还原撤销操作,操作后会出现重复sheet,无法还原为原始状态,且所有sheet页数据消失,同时部分菜单功能失效。

[Feature request] "End-user view"

Is your feature request related to a problem? Please describe.
Context: We would like to embed the luckytable in a simple web interface for end users. Currently end users get confused with menu, toolbar, column and row headers, etc.

Describe the solution you'd like
Thus end users shall NOT have the option (nor need the option) to code/edit/layout the model, with exception of few cells that are preconfigured for user inputs.

Moreover, we would love a simple and clean representation/view of the coded spreadsheet for end users - without any of the menus, tools (e.g. formatting table) and the column and row headers.

Related is request #45 about protecting the spreadsheet: in the end user representation, one would only be able to make few inputs in predefined cells and then the model will provide the output.

Additional context
Add any other context or screenshots about the feature request here.
Hope it's clear, am available for questions, and would be very happy to get this feature. thank you!

[BUG]发现了个bug

创建 excel 表格的参数data 为每个sheet 配置 row、column 的数量无效。查看代码 _this.nulldata 创建时只考虑了defaultrowNum、defaultcolumnNum参数配置。file.data 考虑了 sheet 配置 row、column。不解为啥要这样做?
在 createdom.js 中发现了最少30行22列的限定。

[Feature request]I have an idea for cell lock

打算用这个控件实现复杂报表的填报。目前无法实现控制哪些单元格允许编辑,哪些单元格只读。
比如,固定文本类的cell和公式cell只读。

如果通过扩展开发的方式,目前的接口能做到吗?比如cell focus触发一个事件,事件里判断是否允许编辑这个cell?

边框线第一列左边框与第一行上边框缺失

几个问题反馈:
1、设置边框线的时候第一列左边框与第一行上边框设置无效,猜测因为与行、列标题相接部分处理的问题。
2、如果只设置左或右边框,中间会有一个像素的空白,连续单元格之间的仅设置左右边框时看起来就是不连续的,这部分在打印效果上会有些问题。
3、在设置列宽时,如果单元格为“折行显示”,当设置的列宽不足以显示一个字符宽时整个表格会崩溃。在列宽设置或做导入时,可能需要增加对列宽设置时的判断,无法使用折行模式时需要改为其他模式。另外:目前溢出模式与截断模式相同,溢出模式时未显示多出的字符到后续单元格浮层上。

[Feature Request] Suggestions !#zh: 小建议

  • please add License file to the project

  • please use commit cz to standardize the commit message

  • please clear up the src/luckysheet-core.js

!#zh:

  • 请添加 license 文件,表明项目的开源协议

  • 请使用类似 commit cz 之类的工具,规范 commit message

  • 请整理 src/luckysheet-core.js 代码

[Feature request]隐藏、显示隐藏,在行头、列头的菜单操作,而不是在单元格的菜单。

您的功能请求与问题有关吗?
Excel中,隐藏/显示隐藏 行 或者 列的操作按钮,是在 行头 或者 列头 上右键点击的菜单中显示的。例如:当右键选中列头A,整列A也被选中,菜单里有 Hide/Unhide 按钮,同时,如果在整列被选中的单元格上右键点击,菜单中会显示 Hide/Unhide按钮。
image

但是当单独在单元格上右键点击时,是显示另外的一个菜单,没有 Hide/Unhide 按钮,因为这两个都是对 整行/整列 的操作。
image

Luckysheet的相关功能,在单元格上右键点击,菜单中有 隐藏选中行、显示隐藏行,隐藏选中列、显示隐藏列 4个按钮
image

但是在 行头、 列头 上右键点击就没有 隐藏、显示隐藏的按钮。例如:当列B被隐藏时,不能通过操作列头而显示隐藏
image

而是需要操作被隐藏的列B两边的A、C单元格来显示
image

描述您想要的解决方案
调整 隐藏 按钮出现在 列头行头的菜单中,这样是与Excel一致的操作方式,甚至可以简化为只有 隐藏、显示隐藏2个按钮,而不需要同时显示4个按钮。如Excel, 列头上操作就 针对行头上操作就针对

建议:有关excel导入导出

目前各类开源表格控件中对于excel的导入导出大多是用sheetjs,但是sheetjs的开源版在样式上读取不完整,可以考虑exceljs这个开源库,是目前已知的对于excel格式读取较完整全面的开源库。

[BUG]最小行数与列数

描述错误
LuckySheet在构建时代码中设置了最小行数为30,最小列数为22,实际中希望按实际的行列数生成表格。

重现
初始化时给的行列数小于30、22,LuckySheet会以默认的行列数创建。

期望的结果
1、这两个值是否有特殊的意义的?如无,可以不必限制,或限制得更小一些。
2、表格是否可以提供每个sheet中有效的数据范围,即每个sheet中的有效数据行列数,对于完全无内容或无格式设置的行列可以排除在外。

[Feature request] Need for protected sheets / locked cells

PROTECT SHEETS AND CONTENT IN LOCKED CELLS

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
It is not possible to protect the spreadsheet and to lock cells so that users of a preconfigured spreadsheet cannot mess up the formulas.

Describe the solution you'd like
A clear and concise description of what you want to happen.
to be able to protect sheets and the content of locked cells on these sheets (as in Excel)

Additional context
Add any other context or screenshots about the feature request here.
excel equivalent...
Screen Shot 2020-09-17 at 16 25
Screen Shot 2020-09-17 at 16 25 1

luckysheet.setcellvalue 设置单元格的值

luckysheet.setcellvalue(1,1,luckysheet.flowdata,{v:1})
luckysheet.luckysheetrefreshgrid();

设置完成之后,使用headerbar上面的功能(比如使用居中对齐,合并单元格),数据消失

[BUG]Apostrophe imported as %apos;

It is about your current online demo. When importing an Excel spreadsheet with a text field containing an apostrophe, the apostrophe is visible as &apos;. Editing and saving the field converts the apostrophe back to what it should be, i.e. '.

合并单元格报错

plugin.js:1 Uncaught TypeError: ((O.event.special[o.origType] || {}).handle || o.handler).apply is not a function
at HTMLDivElement.dispatch (plugin.js:1)
at HTMLDivElement.b.handle (plugin.js:1)

[BUG] 隐藏的行,重新计算时会找不到被隐藏的单元格,显示#NAME?错误

描述错误
加载的数据有隐藏的行,设置里开启了 forceCalculation: true,有公式的单元格找不到隐藏的单元格,所以报错

重现
重现错误的步骤:
1.设置A1为1,A2为2,A3为 =A1+A2
2.右键点击A2,设置第2行隐藏,保存此数据
3.强制重新计算的设置是开启的
4.刷新加载新数据,A3的结果是 #NAME?而不是3

期望的结果
无论隐藏的有多少行,有公式的单元格都可以获得到被隐藏的单元格的数值,正确的计算并显示出来。

屏幕截图或演示
不隐藏一切正常
image

第2行被隐藏后,A3计算时找不到A2,报错#NAME?
相似的B列被隐藏,C1计算结果是正确的
image

环境:
-操作系统:[Windows 10]
-浏览器 版本号:[Chrome Version 85.0.4183.121 (Official Build) (64-bit)]
-Luckysheet版本:[最新]

备注
对于做了相似的测试,没有此问题

[BUG]粘贴单元格时,公式栏的内容始终是上次在单元格输入的内容,而不是复制的内容

描述错误
粘贴单元格时,公式栏的内容始终是上次在单元格输入的内容,而不是复制的内容

重现
重现错误的步骤:
①先任意复制一份文本,比如复制“2333”;
②在任意单元格输入内容,比如输入“123”;
③选择其他单元格,粘贴。
此时,会发现公式栏的内容是“123”,即上次在单元格输入的内容,而不是复制的内容“2333”

期望的结果
粘贴单元格时,公式栏显示的内容应该是真实复制的内容

屏幕截图或演示
image

环境:
-操作系统:win10 专业版
-浏览器 版本号:Chrome 版本 79.0.3945.88(正式版本) (64 位)、QQ浏览器最新版
-Luckysheet版本:最新

[BUG]双击编辑单元格,输入内容,然后点击上面的公式输入框,表格的单元格内容被清空了

描述错误
双击编辑单元格,输入内容,然后点击上面的公式输入框,单元格中的内容被清空了

重现
重现错误的步骤:
1.双击任一单元格,输入文本,如“123”
2.点击公式栏的公式输入框
3.此时表格中的单元格编辑框内容被清空了

期望的结果
表格中的单元格编辑框内容,应该与公式输入框文本一致

屏幕截图或演示
image
image

环境:
-操作系统:win10
-浏览器 版本号:Chrome
-Luckysheet版本:最新

[BUG] Listing trough autocomplete suggestion with arrows only scrolls one way.

To Reproduce
Steps to reproduce the behavior:

  1. Open the demo
  2. Select an empty cell
  3. Type = AT
  4. Dropdown with options pops in
  5. Press arrow down on keyboard
  6. Press arrow up on keyboard

What is expected?
Instead of going one item up it goes down again, that's not intuitive.

Environment

  • Windows
  • Chrome v86
  • Latest online demo

Note: other than this minor issue this is really impressive work! Thanks for opensourcing it.

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.