diff --git a/CHANGELOG.md b/CHANGELOG.md
index a3e5ccb..b75a6d0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,35 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+### [2.1.5](https://github.com/mengshukeji/Luckysheet/compare/v2.1.4...v2.1.5) (2020-11-03)
+
+
+### Features
+
+* **cell date picker:** cell date picker and bug solve ([2996ae9](https://github.com/mengshukeji/Luckysheet/commit/2996ae9cab724714903d00e0b63022abc4a1a3b6))
+* **cell hooks add:** go to document for detail ([927ff46](https://github.com/mengshukeji/Luckysheet/commit/927ff46949f688a5bcffcb3fe48dc6b4b12b61c9))
+* **config:** custom menu button config ([14eb78e](https://github.com/mengshukeji/Luckysheet/commit/14eb78e153cbce726adf9e093702f9b93af1fa03))
+* **config:** sheetbar ([3555746](https://github.com/mengshukeji/Luckysheet/commit/3555746f4cc8ef2c1fe163a34edd428f1a6377ed))
+* **date format:** date format Chinese ([8f8d0cb](https://github.com/mengshukeji/Luckysheet/commit/8f8d0cb8c5563a31afba3fe11b525e6bccd5eb56))
+* **hyperlink:** add hyperlink function ([439dff4](https://github.com/mengshukeji/Luckysheet/commit/439dff4330ab5053643331286091d44ae910fb8d))
+* **hyperlink:** perfect hyperlink function ([5adfc60](https://github.com/mengshukeji/Luckysheet/commit/5adfc6055bf4cfed7f1ff40933d292057196bc7e))
+* **statisticbar:** config docs ([c1ed417](https://github.com/mengshukeji/Luckysheet/commit/c1ed417074e89e665f9ef39ee186db9106904c4e))
+* **tojson:** api/docs ([8e410f5](https://github.com/mengshukeji/Luckysheet/commit/8e410f5d3cd61724230b3024898d6de3c6c41101))
+
+
+### Bug Fixes
+
+* **bug:** bug ([ad73f9a](https://github.com/mengshukeji/Luckysheet/commit/ad73f9a679d77721d8af0a483dffe70b90e56412)), closes [#129](https://github.com/mengshukeji/Luckysheet/issues/129)
+* **bug:** bug ([801cbe5](https://github.com/mengshukeji/Luckysheet/commit/801cbe5a8040d80f2e672b3607c0b92c922281a9))
+* **bug:** bug ([f8716c1](https://github.com/mengshukeji/Luckysheet/commit/f8716c18db05c7ab8bf59d1feb0dc4c3b364c560)), closes [#67](https://github.com/mengshukeji/Luckysheet/issues/67) [#85](https://github.com/mengshukeji/Luckysheet/issues/85)
+* **bug:** bug ([0909f5e](https://github.com/mengshukeji/Luckysheet/commit/0909f5e4c957e3d3248a8c86d6e092c5a5396112)), closes [#142](https://github.com/mengshukeji/Luckysheet/issues/142) [#132](https://github.com/mengshukeji/Luckysheet/issues/132)
+* **bug:** dataVerification and sheet move and delete cell bug ([4815d86](https://github.com/mengshukeji/Luckysheet/commit/4815d86ce564da43aa1ced3b48d38e88afc39f77))
+* **conflict:** conflict ([b11de26](https://github.com/mengshukeji/Luckysheet/commit/b11de26c4d2dbdd7e9d4363558e95d4433f26585))
+* **conflict:** toolbar ([8cfa6ac](https://github.com/mengshukeji/Luckysheet/commit/8cfa6ac1bec8bcb156fe45e8c488aa7026b65738))
+* **fix bug with inline string rotate wrap:** add change to max, fix height error ([1988687](https://github.com/mengshukeji/Luckysheet/commit/198868719ffb19738ee5ecc1ee060a0840fa92df))
+* **hide row/column:** right click menu ([8070858](https://github.com/mengshukeji/Luckysheet/commit/8070858f6c35f11ee8cf2692d8828d0e78c46d92)), closes [#37](https://github.com/mengshukeji/Luckysheet/issues/37)
+* **restore demo:** restore demo ([e799862](https://github.com/mengshukeji/Luckysheet/commit/e7998627400b82bf082bad3c984f4d26e3c9f43a))
+
### [2.1.3](https://github.com/mengshukeji/Luckysheet/compare/v2.1.2...v2.1.3) (2020-10-22)
diff --git a/README-zh.md b/README-zh.md
index 38ca733..4ad471f 100644
--- a/README-zh.md
+++ b/README-zh.md
@@ -35,6 +35,7 @@
+ **数据类型**
+ **货币, 百分比, 数字, 日期**
+ **Custom** (和excel保持一致,例如: `##,###0.00` , `$1,234.56$##,###0.00_);[Red]($##,###0.00)`, `_($* ##,###0.00_);_(...($* "-"_);_(@_)`, `08-05 PM 01:30MM-dd AM/PM hh:mm` )
++ **单元格内多样式** (Alt+Enter单元格内换行、上标、下标、单元格内科定义每个文字的不同样式)
### 🧬单元格
+ **拖拽选取来修改单元格** (对选区进行操作,可以拖动四边来移动选区,也可以在右下角对选区进行下拉填充操作)
@@ -44,6 +45,7 @@
+ **查找和替换** (对内容进行查找替换,支持正则表达式,整词,大小写敏感)
+ **定位** (可以根据单元格的数据类型进行自动定位并选中,选中后可以批量进行格式等操作)
+ **合并单元格**
++ **数据验证(表单功能)** (支持Checkbox, drop-down list, datePicker)
### 🖱️行和列操作
+ **隐藏,插入,删除行或列**
@@ -90,19 +92,21 @@
+ **评论** (评论的删除、添加、修改、隐藏)
+ **共享编辑** (支持多用户共享编辑,内置API)
+### 📚插入对象
++ **插入图片** (支持JPG,PNG,SVG的插入、修改和删除,并且随表格的变动而产生变化)
+
### ⚡Luckysheet专有
+ **矩阵计算** (通过右键菜单进行支持:对选区内的数据进行转置、旋转、数值计算)
+ **截图** (把选区的内容进行截图展示)
+ **复制到其他格式** (右键菜单的"复制为", 支持复制为json、array、对角线数据、去重等)
-+ **EXCEL,CSV,TXT 导入及导出** (专为Luckysheet打造的导入导出插件,支持密码、水印、公式等的本地导入导出)
-+ **插入图片和svg形状** (支持JPG,PNG,SVG,Pen tool的插入、修改和删除,并且随表格的变动而产生变化)
-+ **数据验证(表单功能)** (支持Checkbox, drop-down list, datePicker)
-+ **单元格内多样式** (Alt+Enter单元格内换行、上标、下标、单元格内科定义每个文字的不同样式)
++ **EXCEL导入及导出** (专为Luckysheet打造的导入导出插件,支持密码、水印、公式等的本地导入导出,导出正在开发)
### ⏱️未来开发计划
+ **打印及设置** (像excel一样进行打印设置,并导出为图片或者PDF)
+ **树形菜单** (类似excel中的分级显示(分组))
+ **表格新功能** (类似excel中表格的筛选器和切片器)
++ **CSV,TXT导入及导出** (专为Luckysheet打造的导入导出插件,支持密码、水印、公式等的本地导入导出)
++ **插入svg形状** (支持[Pen tool](https://github.com/mengshukeji/Pentool)的插入、修改和删除,并且随表格的变动而产生变化)
+ **文档** (完善文档和API)
+ **敬请期待...** (可以提出好的建议给我们)
@@ -161,6 +165,7 @@ npm run build
- [鲁班h5](https://github.com/ly525/luban-h5)
- [excelize](https://github.com/360EntSecGroup-Skylar/excelize)
+- [h5-Dooring](https://github.com/MrXujiang/h5-Dooring)
## 加入共建
@@ -190,6 +195,31 @@ npm run build
[英文社群](./README.md)
+## 赞助
+
+如果你感觉这个项目对你有用或者有所启发,可以请作者喝杯果汁:
+
+注意事项:
+1. 付款留言请备注:昵称,您的网站地址
+2. 默认会将您加入到下方的赞助者列表。如果您想匿名赞助,付款留言请备注:匿名
+3. 如果您忘记留言昵称或者网站地址,请联系小编email: alexads@foxmail.com或者微信:dushusir2。
+
+| 微信 | 支付宝 |
+|---|---|
+|
|
|
+
+### [Paypal Me](https://www.paypal.me/wbfsa)
+
+## 赞助者列表
+(按时间顺序排列)
+- *勇 ¥ 30
+- 虚我 ¥ 200
+- 甜党 ¥ 50
+- Alphabet(Google)-gcf ¥ 1
+- **平 ¥ 100
+- **东 ¥ 10
+- debugger ¥ 20
+
## 贡献者和感谢
### 团队成员
@@ -207,16 +237,6 @@ npm run build
- [@gsw945](https://github.com/gsw945)
- [@swen-xiong](https://github.com/swen-xiong)
-## 捐赠
-
-如果你感觉这个项目对你有用或者有所启发,可以请作者喝杯果汁:
-
-| 微信 | 支付宝 |
-|---|---|
-|
|
|
-
-[Paypal Me](https://www.paypal.me/wbfsa)
-
## 版权信息
[MIT](http://opensource.org/licenses/MIT)
diff --git a/README.md b/README.md
index aa89a99..c81f9a2 100644
--- a/README.md
+++ b/README.md
@@ -37,6 +37,7 @@ English| [简体中文](./README-zh.md)
+ **Data types**
+ **currency, percentages, decimals, dates**
+ **Custom** (E.g `##,###0.00` , `$1,234.56$##,###0.00_);[Red]($##,###0.00)`, `_($* ##,###0.00_);_(...($* "-"_);_(@_)`, `08-05 PM 01:30MM-dd AM/PM hh:mm` )
++ **Cell segmentation style** (Alt+Enter line break, sub,super, in-cell style)
### 🧬Cells
+ **Move cells by drag and dropping** (Operate on selection)
@@ -46,6 +47,7 @@ English| [简体中文](./README-zh.md)
+ **Find and replace** (Such as a particular number or text string, Support regular expression, whole word, case sensitive)
+ **Location** (Cells can be selected according to the data type)
+ **Merge cells**
++ **Data validation** (Checkbox, drop-down list, datePicker)
### 🖱️Row & columns
+ **Hide, Insert, Delete rows and columns**
@@ -92,19 +94,21 @@ English| [简体中文](./README-zh.md)
+ **Comments** (Add, delete, update)
+ **Collaborate** (Simultaneous editing by multiple users)
+### 📚Insert object
++ **Insert picture** (JPG,PNG,SVG and so on)
+
### ⚡Luckysheet
+ **Matrix operation** (Operate selection through the right-click menu: transpose, rotate, numerical calculation)
+ **Screenshot** (Take a screenshot with selection)
+ **Copy to** (In the right-click menu, copy selection to json, array etc.)
-+ **EXCEL,CSV,TXT import/export** (Specially adapted to Luckysheet)
-+ **Insert picture and Shapes** (JPG,PNG,SVG,Pen tool and so on)
-+ **Data validation** (Checkbox, drop-down list, datePicker)
-+ **Cell segmentation style** (Alt+Enter line break, sub,super, in-cell style)
++ **EXCEL import/export** (Specially adapted to Luckysheet, export is under development)
### ⏱️Coming soon
+ **Print** (Like excel print option, save to PDF)
+ **Tree menu** (Just like the outline (group) function of excel)
+ **Table new Features** (filter, slicer)
++ **CSV,TXT import/export** (Specially adapted to Luckysheet)
++ **Insert Shapes** ([Pen tool](https://github.com/mengshukeji/Pentool) Shapes)
+ **Documentation** (Improve documentation and API)
+ **More...** (Please advise us)
@@ -162,6 +166,7 @@ Create a table
- [luban-h5](https://github.com/ly525/luban-h5)
- [excelize](https://github.com/360EntSecGroup-Skylar/excelize)
+- [h5-Dooring](https://github.com/MrXujiang/h5-Dooring)
## Co-construction
@@ -183,6 +188,31 @@ Create a table
[Chinese community](./README-zh.md)
+## Sponsor
+
+If you find this project useful, you can buy author a glass of juice:
+
+Note:
+1. Please note the payment message: nickname, your website address
+2. By default, you will be added to the sponsor list below. If you want to sponsor anonymously, please leave a note on payment: anonymous
+3. If you forget your nickname or website address, please contact the editor email: alexads@foxmail.com or WeChat: dushusir2.
+
+| WeChat | Alipay |
+|---|---|
+|
|
|
+
+### [Paypal Me](https://www.paypal.me/wbfsa)
+
+## Sponsors List
+(Sort by time)
+- *勇 ¥ 30
+- 虚我 ¥ 200
+- 甜党 ¥ 50
+- Alphabet(Google)-gcf ¥ 1
+- **平 ¥ 100
+- **东 ¥ 10
+- debugger ¥ 20
+
## Authors and acknowledgment
### Team
@@ -202,13 +232,6 @@ Create a table
## Donate
-If you find this project useful, you can buy author a glass of juice:
-
-| WeChat | Alipay |
-|---|---|
-|
|
|
-
-[Paypal Me](https://www.paypal.me/wbfsa)
## License
diff --git a/deploy.bat b/deploy.bat
index e41a76f..a7d776b 100644
--- a/deploy.bat
+++ b/deploy.bat
@@ -24,5 +24,8 @@ npm publish
# only publish
npm run build
+git add .
+npm run commit
npm version patch
+git push -u origin master
npm publish
diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js
index 39f2bac..0cf986e 100644
--- a/docs/.vuepress/config.js
+++ b/docs/.vuepress/config.js
@@ -16,8 +16,9 @@ module.exports = {
},
themeConfig: {
+ domain: 'https://mengshukeji.github.io/LuckysheetDemo',
logo: '/img/logo.png',
-
+ author: 'Luckysheet',
// 仓库地址
repo: 'mengshukeji/Luckysheet',
// 允许编辑链接文字
@@ -53,6 +54,7 @@ module.exports = {
'cell',
'operate',
'api',
+ 'resource',
'FAQ'
],
},
@@ -88,6 +90,7 @@ module.exports = {
'cell',
'operate',
'api',
+ 'resource',
'FAQ'
],
},
@@ -95,4 +98,24 @@ module.exports = {
},
},
+ plugins: {
+ 'vuepress-plugin-baidu-autopush': {},
+ 'sitemap': {
+ hostname: 'https://mengshukeji.github.io/LuckysheetDocs'
+ },
+ 'vuepress-plugin-code-copy': true,
+ 'seo': {
+ siteTitle: (_, $site) => $site.title,
+ title: $page => $page.title,
+ description: $page => $page.frontmatter.description,
+ author: (_, $site) => $site.themeConfig.author,
+ tags: $page => $page.frontmatter.tags,
+ twitterCard: _ => 'summary_large_image',
+ type: $page => ['guide'].some(folder => $page.regularPath.startsWith('/' + folder)) ? 'article' : 'website',
+ url: (_, $site, path) => ($site.themeConfig.domain || '') + path,
+ image: ($page, $site) => $page.frontmatter.image && (($site.themeConfig.domain && !$page.frontmatter.image.startsWith('http') || '') + $page.frontmatter.image),
+ publishedAt: $page => $page.frontmatter.date && new Date($page.frontmatter.date),
+ modifiedAt: $page => $page.lastUpdated && new Date($page.lastUpdated),
+ }
+ }
}
\ No newline at end of file
diff --git a/docs/guide/FAQ.md b/docs/guide/FAQ.md
index 79b9212..e895882 100644
--- a/docs/guide/FAQ.md
+++ b/docs/guide/FAQ.md
@@ -2,25 +2,25 @@
## **Q** What is the difference between data and celldata in luckysheetfile?
-**A**: Use one-dimensional array format [celldata](/zh/guide/sheet.html#celldata), after the initialization is completed, the data converted into a two-dimensional array format is used for storage and update, and celldata is no longer used.
+**A**: Use one-dimensional array format [celldata](/guide/sheet.html#celldata), after the initialization is completed, the data converted into a two-dimensional array format is used for storage and update, and celldata is no longer used.
-If you need to take out data as initial data, you need to execute `luckysheet.getGridData(data)` to convert it to celldata data.
-Among them, the celldata in `{ r, c, v }` format is converted to a two-dimensional array using `luckysheet.buildGridData(luckysheetfile)`, and the input parameter is the table data object `luckysheetfile`
+If you need to take out `data` as initial data, you need to execute [transToCellData(data)](/guide/api.html#transtocelldata-data-setting) to convert it to celldata data.
+Among them, the celldata in `{ r, c, v }` format is converted to a two-dimensional array using [transToData(celldata)](/guide/api.html#transtodata-celldata-setting)
Summarized as follows:
```js
-// data => celldata two-dimensional array data is converted into {r, c, v} format one-dimensional array, the input parameter is two-dimensional data
-luckysheet.getGridData(data)
+// data => celldata two-dimensional array data into {r, c, v} format one-dimensional array
+luckysheet.transToCellData(data)
-// celldata => data The two-dimensional array required to generate the table, the input parameter is the table data object file
-luckysheet.buildGridData(luckysheetfile)
+// celldata => data to generate the two-dimensional array required for the table
+luckysheet.transToData(celldata)
```
------------
## **Q** What are the cell types?
-**A**: Refer to [Cell Format List](/zh/guide/cell.html), with examples of available cell formats
+**A**: Refer to [Cell Format List](/guide/cell.html), with examples of available cell formats
------------
@@ -35,13 +35,13 @@ luckysheet.buildGridData(luckysheetfile)
## **Q** Why will the formula in the table not be triggered after initialization?
-**A** : Refer to [Table data format](/zh/guide/sheet.html#calcchain) ,just set the calcChain corresponding to the cell data.
+**A** : Refer to [Table data format](/guide/sheet.html#calcchain) ,just set the calcChain corresponding to the cell data.
------------
## **Q** Is the remote loading data loadUrl or updateUrl?
-**A**: [loadUrl](/zh/guide/config.html#loadurl). Configure loadUrl, Luckysheet will request the entire table data through ajax, and updateUrl will be used as the interface address for collaborative editing in real-time saving.
+**A**: [loadUrl](/guide/config.html#loadurl). Configure loadUrl, Luckysheet will request the entire table data through ajax, and updateUrl will be used as the interface address for collaborative editing in real-time saving.
Note: Initial data needs to be configured with loadUrl and loadSheetUrl parameters, while for collaborative editing, the four parameters of loadUrl, loadSheetUrl, updateUrl and allowUpdate can be configured to take effect.
------------
@@ -63,14 +63,17 @@ Note: Initial data needs to be configured with loadUrl and loadSheetUrl paramete
## **Q** How to import and export excel?
-**A**: The excel import and export library developed with Luckysheet-[Luckyexcel](https://github.com/mengshukeji/Luckyexcel) has realized the excel import function, and the export function is under development. You can refer to this blog post for excel export at this stage: https://www.cnblogs.com/recode-hyh/p/13168226.html.
+**A**: The excel import and export library developed with Luckysheet-[Luckyexcel](https://github.com/mengshukeji/Luckyexcel) has realized the excel import function, and the export function is under development.You can refer to these 2 blog posts for excel export at this stage:
+
+- [Development of Excel download function based on LuckySheet online form](https://www.cnblogs.com/recode-hyh/p/13168226.html)
+- [Use exceljs to export luckysheet form](https://blog.csdn.net/csdn_lsy/article/details/107179708)
------------
## **Q** How to merge cells during initialization?
-**A**: Refer to the following case
-- Luckysheet initializes data with merged cells: https://www.cnblogs.com/DuShuSir/p/13272397.html
+**A**: Refer to the following case:
+- [How Luckysheet initializes the data with merged cells](https://www.cnblogs.com/DuShuSir/p/13272397.html)
------------
@@ -80,20 +83,21 @@ Note: Initial data needs to be configured with loadUrl and loadSheetUrl paramete
- 1. after the table operation is completed, you can use `luckysheet.getAllSheets()` to get all sheet data that stroed in the back-end.
- 2. enable the collaborative editing function to transmit data to the back-end in real-time.
-refer this article:https://www.cnblogs.com/DuShuSir/p/13857874.html
+refer this article:
+[How Luckysheet saves the data in the table to the database](https://www.cnblogs.com/DuShuSir/p/13857874.html)
------------
## **Q** How to monitor cell hover or click events? how to monitor `cellRenderAfter` in real-time?
-**A** :我们搜集到需要针对单元格事件的二次开发需求,规划了单元格相关的钩子函数,参考[单元格钩子函数](/zh/guide/config.html#cellrenderafter)(显示的TODO的暂未开放)
+**A** :我们搜集到需要针对单元格事件的二次开发需求,规划了单元格相关的钩子函数,参考[单元格钩子函数](/guide/config.html#cellrenderafter)(显示的TODO的暂未开放)
------------
## **Q** How to customize the top toolbar?
**A** :
-reference: [options.showtoolbarconfig](/zh/guide/config.html#showtoolbarconfig)(TODO means waiting to developed)
+reference: [options.showtoolbarconfig](/guide/config.html#showtoolbarconfig)(TODO means waiting to developed)
------------
@@ -109,7 +113,7 @@ if you want to remove jQuery in `Luckysheet`, you can find `jQuery` in source co
## **Q** How to add a field to a cell object?
-**A** reference [cell object format](/zh/guide/cell.html),then read this annotation[src/controllers/postil.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/postil.js)。the annotation is a configuration in a cell object.
+**A** reference [cell object format](/guide/cell.html),then read this annotation[src/controllers/postil.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/postil.js)。the annotation is a configuration in a cell object.
------------
@@ -117,7 +121,7 @@ if you want to remove jQuery in `Luckysheet`, you can find `jQuery` in source co
**A** The luckysheet use iconfont icon in this project, if any icon cannot be loaded ,plz check your iconfont.css. we are so sorry that we did not describe it clearly in the old version documents.
-Now the documents have been updated.[official documents](/zh/guide/#使用步骤)
+Now the documents have been updated.[official documents](/guide/#steps-for-usage)
------------
@@ -136,7 +140,7 @@ more information:[Luckyexcel](https://github.com/mengshukeji/Luckyexcel/)
## **Q** How to disable editing of cells?How to open sheet protection?
-**A** Sheet protection includes disable editing of cells that you need to make some configurations on each sheets. `config.authority`, the latest configurations[sheet protection](/zh/guide/sheet.html#config-authority)。
+**A** Sheet protection includes disable editing of cells that you need to make some configurations on each sheets. `config.authority`, the latest configurations[sheet protection](/guide/sheet.html#config-authority)。
In order to make it easier for you to understand the function of sheet protection, the following video shows how to make the whole sheet uneditable, but allow a column of cells to be edited:
@@ -148,7 +152,7 @@ In you local browser, you can open the control pannel, use `luckysheet.getLuckys
## **Q** How to configure data validation?
-**A** there is the configuration of data validation,[data validation](/zh/guide/sheet.html#dataVerification)。Also there is the API that you can use `data validation` in any time. [setDataVerification](/zh/guide/api.html#setdataverification-optionitem-setting).
+**A** there is the configuration of data validation,[data validation](/guide/sheet.html#dataVerification)。Also there is the API that you can use `data validation` in any time. [setDataVerification](/guide/api.html#setdataverification-optionitem-setting).
------------
@@ -177,6 +181,57 @@ if you want to get the position of the picture, you can overlap the picture with
**A** There are two ways to get it
- 1. use `luckysheet.getLuckysheetfile()` to get all configuration data, so you can get the `defaultRowHeight` and `defaultColWidth` in the sheet configuration data。
-- 2. use API to get the default row height [getDefaultRowHeight](/zh/guide/api.html#getdefaultrowheight-setting) and column width.[getDefaultColWidth](/zh/guide/api.html#getdefaultcolwidth-setting)
+- 2. use API to get the default row height [getDefaultRowHeight](/guide/api.html#getdefaultrowheight-setting) and column width.[getDefaultColWidth](/guide/api.html#getdefaultcolwidth-setting)
+
+------------
+
+## **Q** How to hide the add row button and the back to top button below the worksheet?
+
+**A** Configuration is open
+- Allow adding rows [enableAddRow](/guide/config.html#enableaddrow)
+- Allow back to top [enableAddBackTop](/guide/config.html#enableAddBackTop)
+
+------------
+
+## **Q** How to hide the row and column headings of the worksheet?
+
+**A** Configuration is open
+- The width of the row header area [rowHeaderWidth](/guide/config.html#rowheaderwidth)
+- The height of the column header area [columnHeaderHeight](/guide/config.html#columnHeaderHeight)
+
+------------
+
+## **Q** What method can be called to set `config.merge`?
+
+**A** Three methods
+- Interface operation
+- Use API: [setRangeMerge](/guide/api.html#setrangemerge-type-setting)
+- Manually assemble merge parameters
+
+------------
+
+## **Q** Why is the official new feature ineffective?
+
+**A** The first step is to check whether you have used CDN to import,
+
+The CDN link used in the Luckysheet tutorial is the service provided by [jsdelivr](https://www.jsdelivr.com/package/npm/luckysheet), and the code is from [npmjs.com](https://www.npmjs.com/) automatically sync the past, not from [Github](https://github.com/mengshukeji/Luckysheet/). Because our newly submitted code still needs to be tested for a period of time, it will not be released to npm immediately, causing the npm code to lag behind Github.
+
+If you need to try the latest code, we strongly recommend that you pull the code from the [Luckysheet Github](https://github.com/mengshukeji/Luckysheet/) main repository. After our version is stable, we will consider releasing the npm package in real time.
+
+The second step, if it is to import the packaged code of the github repository, test to determine whether there is a bug, you can find the problem and try to fix it, and then [submit a PR](https://github.com/mengshukeji/Luckysheet/pulls), if can't fix it, please [submit issues](https://github.com/mengshukeji/Luckysheet/issues).
+
+------------
+
+## **Q** `npm run dev` reported an error: ʻError: Cannot find module'rollup'`?
+
+**A** It may be a problem with the npm package installation, try the following steps:
+1. `npm cache clean --force`
+2. `npm i rimraf -g`
+3. `rimraf node_modules`
+4. Delete the package-lock.json file
+5. `npm i`
+6. `npm run dev`
+
+Tip: Most other npm installation problems can also be solved by trying above steps.
------------
\ No newline at end of file
diff --git a/docs/guide/README.md b/docs/guide/README.md
index 7141366..656cec1 100644
--- a/docs/guide/README.md
+++ b/docs/guide/README.md
@@ -10,7 +10,7 @@ Luckysheet is an online spreadsheet like excel that is powerful, simple to confi
## Features
-### Formatting
+### 🛠️Formatting
+ **Styling** (Change font style, size, color, or apply effects)
+ **Conditional formatting** (highlight interesting cells or ranges of cells, emphasize unusual values, and visualize data by using data bars, color scales, and icon sets that correspond to specific variations in the data)
+ **Align or rotate text**
@@ -18,8 +18,9 @@ Luckysheet is an online spreadsheet like excel that is powerful, simple to confi
+ **Data types**
+ **currency, percentages, decimals, dates**
+ **Custom** (E.g `##,###0.00` , `$1,234.56$##,###0.00_);[Red]($##,###0.00)`, `_($* ##,###0.00_);_(...($* "-"_);_(@_)`, `08-05 PM 01:30MM-dd AM/PM hh:mm` )
++ **Cell segmentation style** (Alt+Enter line break, sub,super, in-cell style)
-### Cells
+### 🧬Cells
+ **Move cells by drag and dropping** (Operate on selection)
+ **Fill handle** (For a series like 1, 2, 3, 4, 5..., type 1 and 2 in the first two cells. For the series 2, 4, 6, 8..., type 2 and 4. Support arithmetic sequence, geometric sequence,date, week,chinese numbers)
+ **Auto Fill Options** (Fill copy, sequence, only format, no format, day, month, year)
@@ -27,20 +28,21 @@ Luckysheet is an online spreadsheet like excel that is powerful, simple to confi
+ **Find and replace** (Such as a particular number or text string, Support regular expression, whole word, case sensitive)
+ **Location** (Cells can be selected according to the data type)
+ **Merge cells**
++ **Data validation** (Checkbox, drop-down list, datePicker)
-### Row & columns
+### 🖱️Row & columns
+ **Hide, Insert, Delete rows and columns**
+ **Frozen rows and columns** (First row, first column, Frozen to selection, freeze adjustment lever can be dragged)
+ **Split text** (Split text into different columns with the Convert Text to Columns Wizard)
-### Operation
+### 🔨Operation
+ **Undo/Redo**
-+ **Copy/Paste/Cut** (Copy from excel to luckysheet with format, vice versa)
++ **Copy/Paste/Cut** (Copy from excel to Luckysheet with format, vice versa)
+ **Hot key** (The operating experience is consistent with excel, if there are differences or missing, please feedback to us)
+ **Format Painter** (Similar to google sheet)
+ **Selection by drag and dropping** (Change the parameters of formula and chart through selection)
-### Formulas & functions
+### ⚙️Formulas & functions
+ **Built-in formulas**
+ Math (SUMIFS, AVERAGEIFS, SUMIF, SUM, etc.)
+ Text (CONCATENATE, REGEXMATCH, MID)
@@ -53,39 +55,41 @@ Luckysheet is an online spreadsheet like excel that is powerful, simple to confi
+ **Remote formulas** (DM_TEXT_TFIDF, DM_TEXT_TEXTRANK,DATA_CN_STOCK_CLOSE etc. Need remote interface, can realize complex calculation)
+ **Custom** (Some formula suitable for use in China have been added. AGE_BY_IDCARD, SEX_BY_IDCARD, BIRTHDAY_BY_IDCARD, PROVINCE_BY_IDCARD, CITY_BY_IDCARD, etc. You can define any formula you want)
-### Tables
+### 📐Tables
+ **Filters** (Support color , numerical, date, text filtering)
+ **Sort** (Sort multiple fields simultaneously)
-### Pivot table
+### 📈Pivot table
+ **Arrange fields** (Add fileds to rows, columns, values, area, it is similar to excel)
+ **Aggregation** (Surport Sum,Count,CountA,CountUnique,Average,Max,Min,Median,Product,Stdev,Stdevp,Var,VarP etc.)
+ **Filter data** (Add fileds to filters area and analyze the desired data )
+ **Drill down** (Double click pivot table cell to drill down for detail data )
+ **Create a PivotChart** (Pivot table can create a chart )
-### Chart
+### 📊Chart
+ **Support types** (Line, Column, Area, Bar, Pie, comming soon Scatter, Radar, Gauge, Funnel etc.)
+ **Chart Plugins** (Link to another project [ChartMix](https://github.com/mengshukeji/chartMix)(MIT): ECharts is currently supported,Highcharts, Ali G2, amCharts, googleChart, chart.js are being developed gradually)
+ **Sparklines** (Support by formula : Line, Pie, Box, Pie etc.)
-### Share
+### ✍️Share
+ **Comments** (Add, delete, update)
+ **Collaborate** (Simultaneous editing by multiple users)
-### LuckySheet
+### 📚Insert object
++ **Insert picture** (JPG,PNG,SVG and so on)
+
+### ⚡Luckysheet
+ **Matrix operation** (Operate selection through the right-click menu: transpose, rotate, numerical calculation)
+ **Screenshot** (Take a screenshot with selection)
+ **Copy to** (In the right-click menu, copy selection to json, array etc.)
-+ **EXCEL,CSV,TXT import/export** (Specially adapted to luckysheet)
-+ **Insert picture and Shapes** (JPG,PNG,SVG,Pen tool and so on)
-+ **Data validation** (Checkbox, drop-down list, datePicker)
-+ **Cell segmentation style** (Alt+Enter line break, sub,super, in-cell style)
++ **EXCEL import/export** (Specially adapted to Luckysheet, export is under development)
-### Coming soon
+### ⏱️Coming soon
+ **Print** (Like excel print option, save to PDF)
+ **Tree menu** (Just like the outline (group) function of excel)
+ **Table new Features** (filter, slicer)
++ **CSV,TXT import/export** (Specially adapted to Luckysheet)
++ **Insert Shapes** ([Pen tool](https://github.com/mengshukeji/Pentool) Shapes)
+ **Documentation** (Improve documentation and API)
+ **More...** (Please advise us)
diff --git a/docs/guide/api.md b/docs/guide/api.md
index 23fcca3..05153c1 100644
--- a/docs/guide/api.md
+++ b/docs/guide/api.md
@@ -1823,13 +1823,12 @@ Use note:
### getAllSheets()
-[todo]
- **Explanation**:
Return all worksheet configurations, the format is the same as the worksheet configuration, and the results obtained can be used as options.data when the form is initialized.
- Therefore, this API is suitable for manually operating and configuring a table, and then taking out all the worksheet information to save it, and then use it for table creation in other places. If you want to get all the workbook data including the workbook configuration, you can use [toJson](#toJson())
+ Therefore, this API is suitable for manually operating and configuring a table, and then taking out all the worksheet information to save it, and then use it for table creation in other places. If you want to get all the workbook data including the workbook configuration, it is recommended to use [toJson](#toJson()), and it can be directly used to initialize Luckysheet.
- **Usage**:
@@ -1844,6 +1843,13 @@ Use note:
Returns a one-dimensional array `luckysheetfile` of all table data structures. Unlike the `getAllSheets` method, the worksheet parameters obtained by this method will contain many internal variables. The most obvious difference is that the table data operation will maintain `luckysheetfile[i]. data`, and the initialization data uses `options.data[i].celldata`, so `luckysheetfile` can be used for debugging, but the initialization table is not applicable.
+ In addition, a `load = 1` will be added to the loaded worksheet parameters, this parameter needs to be set to 0 when initializing the data. Therefore, to initialize the workbook with the data obtained by `getLuckysheetfile()`, two tasks need to be done:
+
+ - Convert celldata to data, refer to: [transToData](/zh/guide/api.html#transtodata-celldata-setting)
+ - Load reset to 0 or delete this field
+
+ Now there is `getAllSheets` to complete this work, no need to manually convert the data.
+
- **Usage**:
- Get all the debugging information of the first worksheet
@@ -1922,7 +1928,7 @@ Use note:
- **Parameter**:
- {PlainObject} [setting]: optional parameters
- + {Object} [sheetObject]: The data of the newly added worksheet; the default value is an empty object
+ + {Object} [sheetObject]: The data of the newly added worksheet; the default value is an empty object.Worksheet data format reference [options.data](/guide/sheet.html#initial)
+ {Number} [order]: New worksheet subscript; the default value is the last subscript
+ {Function} [success]: callback function for the end of the operation
@@ -2562,8 +2568,6 @@ Use note:
### toJson()
-[todo]
-
- **Explanation**:
The exported json string can be directly used as the parameter `options` when the workbook is initialized by `luckysheet.create(options)`. The usage scenario is to manually save all the parameters after the user manipulates the table, and then initialize the table elsewhere. Use, similar to the import and export of a luckysheet proprietary format.
diff --git a/docs/guide/config.md b/docs/guide/config.md
index 4d9e44d..3e18124 100644
--- a/docs/guide/config.md
+++ b/docs/guide/config.md
@@ -28,7 +28,6 @@ Luckysheet has opened more detailed custom configuration options, which are as f
- Customize the toolbar ([showtoolbarConfig](#showtoolbarConfig))
- Customize the bottom sheet bar ([showsheetbarConfig](#showsheetbarConfig))
- Customize the counting bar ([showstatisticBarConfig](#showstatisticBarConfig))
-- Custom add row and back to the top ([sheetBottomConfig](#sheetBottomConfig))
- Custom cell right-click menu ([cellRightClickConfig](#cellRightClickConfig))
- Customize the right-click menu of the bottom sheet bar ([sheetRightClickConfig](#sheetRightClickConfig))
@@ -59,22 +58,20 @@ The following are all supported setting parameters
- Customize the bottom sheet bar [showsheetbarConfig](#showsheetbarConfig)
- The bottom count bar [showstatisticBar](#showstatisticBar)
- Custom Count Bar [showstatisticBarConfig](#showstatisticBarConfig)
-- Custom add row and back to top [sheetBottomConfig](#sheetBottomConfig)
- Allow editing [allowEdit](#allowEdit)
- Allow adding rows [enableAddRow](#enableAddRow)
-- Allow adding columns [enableAddCol](#enableAddCol)
+- Allow back to top [enableAddBackTop](#enableAddBackTop)
- User Info [userInfo](#userInfo)
- User Information Menu [userMenuItem](#userMenuItem)
- Back button link [myFolderUrl](#myFolderUrl)
- Ratio [devicePixelRatio](#devicePixelRatio)
- Function Button [functionButton](#functionButton)
- Auto-indent interface [showConfigWindowResize](#showConfigWindowResize)
-- Load the next page [enablePage](#enablePage)
- Refresh formula [forceCalculation](#forceCalculation)
- Custom cell right-click menu [cellRightClickConfig](#cellRightClickConfig)
- Customize the right-click menu of the bottom sheet bar [sheetRightClickConfig](#sheetRightClickConfig)
-- Whether to show the row number area [showRowBar](#showRowBar)
-- Whether to show the column number area [showColumnBar](#showColumnBar)
+- The width of the row header area [rowHeaderWidth](#rowHeaderWidth)
+- The height of the column header area [columnHeaderHeight](#columnHeaderHeight)
- Whether to show the formula bar [sheetFormulaBar](#sheetFormulaBar)
- Initialize the default font size [defaultFontSize](#defaultFontSize)
@@ -186,11 +183,9 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
------------
### showtoolbarConfig
-[todo]
-
- Type: Object
- Default: {}
-- Usage: Custom configuration toolbar
+- Usage: Custom configuration toolbar,can be used in conjunction with `showtoolbar`, `showtoolbarConfig` has a higher priority.
- Format:
```json
{
@@ -214,19 +209,48 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
verticalAlignMode: false, //'Vertical alignment'
textWrapMode: false, //'Wrap mode'
textRotateMode: false, //'Text Rotation Mode'
- frozenMode: false, //'freeze mode'
- sort: false, //'sort'
- filter: false, //'filter'
- findAndReplace: false, //'Find and Replace'
- function: false, //'formula'
- conditionalFormat: false, //'Conditional Format'
- postil: false, //'comment'
- pivotTable: false, //'PivotTable'
- chart: false, //'chart' (the icon is hidden, but if the chart plugin is configured, you can still create a new chart by right click)
- screenshot: false, //'screenshot'
- splitColumn: false, //'Split column'
+ image:false, // 'Insert picture'
+ link:false, // 'Insert link'
+ chart: false, //'chart' (the icon is hidden, but if the chart plugin is configured, you can still create a new chart by right click)
+ postil: false, //'comment'
+ pivotTable: false, //'PivotTable'
+ function: false, //'formula'
+ frozenMode: false, //'freeze mode'
+ sortAndFilter: false, //'Sort and filter'
+ conditionalFormat: false, //'Conditional Format'
+ dataVerification: false, // 'Data Verification'
+ splitColumn: false, //'Split column'
+ screenshot: false, //'screenshot'
+ findAndReplace: false, //'Find and Replace'
+ protection:false, // 'Worksheet protection'
+ print:false, // 'Print'
}
```
+- Example:
+ - Show only the `undo/redo` and `font` buttons:
+
+ ```js
+ //options
+ {
+ showtoolbar: false,
+ showtoolbarConfig:{
+ undoRedo: true,
+ font: true,
+ }
+ }
+ ```
+ - Hide only the `image` and `print` buttons:
+
+ ```js
+ //options
+ {
+ showtoolbar: true, // The default is true, you can leave it unset
+ showtoolbarConfig:{
+ image: false,
+ print: false,
+ }
+ }
+ ```
------------
### showinfobar
@@ -243,11 +267,9 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
------------
### showsheetbarConfig
-[todo]
-
- Type: Object
- Default: {}
-- Usage: Custom configuration bottom sheet button
+- Usage: Custom configuration bottom sheet button, can be used in conjunction with `showsheetbar`, `showsheetbarConfig` has a higher priority.
- Format:
```json
{
@@ -256,6 +278,30 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
sheet: false //Worksheet display
}
```
+- Example:
+ - Only display the `Add worksheet` button:
+
+ ```js
+ //options
+ {
+ showsheetbar: false,
+ showsheetbarConfig:{
+ add: true,
+ }
+ }
+ ```
+ - Only hide the `Add worksheet` and `Worksheet management menu` buttons:
+
+ ```js
+ //options
+ {
+ showsheetbar: true, // The default is true, you can leave it unset
+ showsheetbarConfig:{
+ add: false,
+ menu: false,
+ }
+ }
+ ```
------------
### showstatisticBar
@@ -266,33 +312,40 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
------------
### showstatisticBarConfig
-[todo]
-
- Type: Object
- Default: {}
-- Usage: Customize the bottom count bar
+- Usage: Customize the bottom count bar, can be used in conjunction with `showstatisticBar`, `showstatisticBarConfig` has a higher priority.
- Format:
```json
{
- count: false, // Count bar
+ count: false, // Count bar
+ view: false, // Print view
zoom: false // Zoom
}
-
-------------
-### sheetBottomConfig
-
-[todo]
-
-- Type: Object
-- Default: {}
-- Usage: Add row button and back to top button configuration below the worksheet
-- Format:
- ```json
- {
- addRow: false, // Add row button
- backTop: false // Back to the top
- }
-
+ ```
+- Example:
+ - Only display the `Zoom` button:
+
+ ```js
+ //options
+ {
+ showstatisticBar: false,
+ showstatisticBarConfig:{
+ zoom: true,
+ }
+ }
+ ```
+ - Only hide the `print view` button:
+
+ ```js
+ //options
+ {
+ showstatisticBar: true, // The default is true, you can leave it unset
+ showstatisticBarConfig:{
+ view: false,
+ }
+ }
+ ```
------------
### allowEdit
- Type: Boolean
@@ -306,10 +359,10 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
- Usage: Allow additional rows
------------
-### enableAddCol
+### enableAddBackTop
- Type: Boolean
- Default: true
-- Usage: Allow adding columns
+- Usage: Allow back to top
------------
### userInfo
@@ -347,12 +400,6 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
- Default: true
- Usage: The configuration of the chart or pivot table will pop up on the right, set whether the workbook will be automatically indented after popping up
-------------
-### enablePage
-- Type: Boolean
-- Default: false
-- Usage: Allow to load next page
-
------------
### forceCalculation
- Type: Boolean
@@ -368,33 +415,65 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
------------
### cellRightClickConfig
-[todo]
-
- Type: Object
- Default: {}
- Usage: Custom configuration cell right-click menu
-- Format:
- ```json
+- Format:
+ ```json
{
- copy: false, //Copy
- copyAs: false, //Copy as
- paste: false, //Paste
- insert: false, //Insert
- delete: false, //Delete
- hide: false, //Hide
- deleteCell: false, //Delete cell
- clear: false, //Clear content
- matrix: false, //Matrix operation selection
- sort: false, //Sort selection
- filter: false, //Filter selection
- chart: false //Chart generation
- }
+ copy: false, // copy
+ copyAs: false, // copy as
+ paste: false, // paste
+ insertRow: false, // insert row
+ insertColumn: false, // insert column
+ deleteRow: false, // delete the selected row
+ deleteColumn: false, // delete the selected column
+ deleteCell: false, // delete cell
+ hideRow: false, // hide the selected row and display the selected row
+ hideColumn: false, // hide the selected column and display the selected column
+ rowHeight: false, // row height
+ columnWidth: false, // column width
+ clear: false, // clear content
+ matrix: false, // matrix operation selection
+ sort: false, // sort selection
+ filter: false, // filter selection
+ chart: false, // chart generation
+ image: false, // insert picture
+ link: false, // insert link
+ data: false, // data verification
+ cellFormat: false // Set cell format
+ }
+ ```
+
+ In addition to the cells, the configuration here also includes the row header right-click menu, the column header right-click menu, and the column header drop-down arrow menu. The specific configuration relationships are as follows:
+
+ |Right-click menu configuration|Cell|Row header|Column header|Column arrow|
+ | ------------ | ------------ | ------------ | ----------- | ------------ |
+ |copy|copy|copy|copy|copy|
+ |copyAs|copy as|copy as|copy as|copy as|
+ |paste|paste|paste|paste|paste|
+ |insertRow|Insert a row|Increase N rows upwards and N rows downwards|-|-|
+ |insertColumn|Insert Column|-|Add N columns to the left and N columns to the right|Add N columns to the left and N columns to the right|
+ |deleteRow|Delete selected row|Delete selected row|-|-|
+ |deleteColumn|Delete selected column|-|Delete selected column|Delete selected column|
+ |deleteCell|Delete cell|-|-|-|
+ |hideRow|-|Hide the selected row and show the selected row|-|-|
+ |hideColumn|-|-|Hide the selected column and show the selected column|Hide the selected column and show the selected column|
+ |rowHeight|-|row height|-|-|
+ |columnWidth|-|-|Column Width|Column Width|
+ |clear|clear content|clear content|clear content|-|
+ |matrix|Matrix Operation Selection|Matrix Operation Selection|Matrix Operation Selection|-|
+ |sort|Sort selection|Sort selection|Sort selection|A-Z sort and Z-A sort|
+ |filter|Filter selection|Filter selection|Filter selection|-|
+ |chart|chart generation|chart generation|chart generation|-|
+ |image|Insert Picture|Insert Picture|Insert Picture|-|
+ |link|Insert link|Insert link|Insert link|-|
+ |data|Data Verification|Data Verification|Data Verification|-|
+ |cellFormat|Set cell format|Set cell format|Set cell format|-|
------------
### sheetRightClickConfig
-[todo]
-
- Type: Object
- Default: {}
- Usage: Customize the right-click menu of the bottom sheet bar
@@ -405,23 +484,21 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
copy: false, //Copy
rename: false, //Rename
color: false, //Change color
- hide: false, //Hide
- show: false, //Unhide
- left: false, //Move to the left
- right: false //Move to the right
+ hide: false, //Hide, unhide
+ move: false, //Move to the left, move to the right
}
------------
-### showRowBar
-- Type: Boolean
-- Default: true
-- Usage: Whether to show the row number area
+### rowHeaderWidth
+- Type: Number
+- Default: 46
+- Usage: The width of the row header area, if set to 0, it means to hide the row header
------------
-### showColumnBar
-- Type: Boolean
-- Default: true
-- Usage: Whether to show the column number area
+### columnHeaderHeight
+- Type: Number
+- Default: 20
+- Usage: The height of the column header area, if set to 0, it means hide the column header
------------
### sheetFormulaBar
@@ -485,12 +562,6 @@ The hook functions are uniformly configured under ʻoptions.hook`, and configura
- {Object} [oldV]: Cell object before Modified
- {Object} [newV]: Cell object after Modified
-------------
-### fireMousedown
-- Type: Function
-- Default: null
-- Usage: Customized method of drilling down cell data
-
------------
## Selected area
@@ -972,4 +1043,13 @@ The hook functions are uniformly configured under ʻoptions.hook`, and configura
- Parameter:
- {Object} [frozen]: Freeze type information
+------------
+
+#### Legacy Hook Function
+
+### fireMousedown
+- Type: Function
+- Default: null
+- Usage: Customized method of drilling down cell data, note that this hook function is mounted under options: `options.fireMousedown`
+
------------
\ No newline at end of file
diff --git a/docs/guide/resource.md b/docs/guide/resource.md
new file mode 100644
index 0000000..b777d4e
--- /dev/null
+++ b/docs/guide/resource.md
@@ -0,0 +1,20 @@
+# Tutorials and resources
+
+Open source software is inseparable from the contribution of the community. Here will be a list of tutorials, learning materials and supporting solutions provided by the community.
+
+If you have written or found an excellent tutorial and want to recommend it to us, please directly [edit this page](https://github.com/mengshukeji/Luckysheet/edit/master/docs/guide/resource.md) submit a PR.
+
+## Blog
+- [How Luckysheet initializes the data with merged cells](https://www.cnblogs.com/DuShuSir/p/13272397.html)[Pending translation]
+- [How Luckysheet saves the data in the table to the database](https://www.cnblogs.com/DuShuSir/p/13857874.html)[Pending translation]
+- [Case of introducing Luckysheet into local HTML using CDN loading](https://www.cnblogs.com/DuShuSir/p/13859103.html)[Pending translation]
+
+## Collaborative editing background
+
+### Community Case
+- Java background [Luckysheet save and restore](https://gitee.com/ichiva/luckysheet-saved-in-recovery)[Pending translation]
+
+
+## Learning Materials
+
+- [How to build a web data analysis report from 0 to 1](https://github.com/mengshukeji/LuckyResources/blob/master/ppt/%E5%A6%82%E4%BD%95%E4%BB%8E0%E5%88%B01%E6%90%AD%E5%BB%BA%20Web%20%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E6%8A%A5%E8%A1%A8.pptx)[Pending translation]
\ No newline at end of file
diff --git a/docs/zh/guide/FAQ.md b/docs/zh/guide/FAQ.md
index b9d7f3a..3b7eabf 100644
--- a/docs/zh/guide/FAQ.md
+++ b/docs/zh/guide/FAQ.md
@@ -6,16 +6,16 @@
**A** : 表格初始化时使用一维数组格式的 [celldata](/zh/guide/sheet.html#celldata),初始化完成后转化为二维数组格式的data作为存储更新使用,celldata不再使用。
-如果需要将data拿出来作为初始化数据,则需要执行 `luckysheet.getGridData(data)`转换为celldata数据。
-其中`{ r, c, v }`格式的celldata转换为二维数组使用的是`luckysheet.buildGridData(luckysheetfile)`,传入参数为表格数据对象`luckysheetfile`
+如果需要将`data`拿出来作为初始化数据,则需要执行 [transToCellData(data)](/zh/guide/api.html#transtocelldata-data-setting)转换为celldata数据。
+其中`{ r, c, v }`格式的celldata转换为二维数组使用的是[transToData(celldata)](/zh/guide/api.html#transtodata-celldata-setting)
总结如下:
```js
-// data => celldata 二维数组数据 转化成 {r, c, v}格式 一维数组,传入参数为二维数据data
-luckysheet.getGridData(data)
+// data => celldata 二维数组数据 转化成 {r, c, v}格式 一维数组
+luckysheet.transToCellData(data)
-// celldata => data 生成表格所需二维数组,传入参数为表格数据对象file
-luckysheet.buildGridData(luckysheetfile)
+// celldata => data 生成表格所需二维数组
+luckysheet.transToData(celldata)
```
------------
@@ -65,14 +65,17 @@ luckysheet.buildGridData(luckysheetfile)
## **Q** excel导入导出怎么做?
-**A** :配合Luckysheet开发的excel导入导出库-[Luckyexcel](https://github.com/mengshukeji/Luckyexcel)已经实现了excel导入功能,导出功能正在开发当中。现阶段excel导出可以参考这篇博文: https://www.cnblogs.com/recode-hyh/p/13168226.html。
+**A** :配合Luckysheet开发的excel导入导出库-[Luckyexcel](https://github.com/mengshukeji/Luckyexcel)已经实现了excel导入功能,导出功能正在开发当中。现阶段excel导出可以参考这2篇博文:
+
+- [基于LuckySheet在线表格的Excel下载功能开发](https://www.cnblogs.com/recode-hyh/p/13168226.html)
+- [使用exceljs导出luckysheet表格](https://blog.csdn.net/csdn_lsy/article/details/107179708)
------------
## **Q** 初始化时合并单元格怎么做?
**A** :参考以下案例
-- Luckysheet初始化含合并单元格的数据: https://www.cnblogs.com/DuShuSir/p/13272397.html
+- [Luckysheet如何初始化含合并单元格的数据](https://www.cnblogs.com/DuShuSir/p/13272397.html)
------------
@@ -82,7 +85,7 @@ luckysheet.buildGridData(luckysheetfile)
- 一是表格操作完成后,使用`luckysheet.getAllSheets()`方法获取到全部的工作表数据,全部发送到后台存储。
- 二是开启协同编辑功能,实时传输数据给后端。
-具体的操作步骤参考这篇文章:https://www.cnblogs.com/DuShuSir/p/13857874.html
+具体的操作步骤参考这篇文章:[Luckysheet如何把表格里的数据保存到数据库](https://www.cnblogs.com/DuShuSir/p/13857874.html)
------------
@@ -181,4 +184,55 @@ Luckyexcel是excel导入导出库,项目采用了gulp作为打包工具,旧
- 一是使用`luckysheet.getLuckysheetfile()`获取到所有工作表配置后,在各个工作表的配置中直接取得默认行高`defaultRowHeight`和默认列宽`defaultColWidth`。
- 二是开放了API可以获取到工作表默认的行高[getDefaultRowHeight](/zh/guide/api.html#getdefaultrowheight-setting)和列宽[getDefaultColWidth](/zh/guide/api.html#getdefaultcolwidth-setting)
+------------
+
+## **Q** 如何隐藏工作表下方的添加行按钮和回到顶部按钮?
+
+**A** 已开放配置
+- 允许添加行 [enableAddRow](/zh/guide/config.html#enableaddrow)
+- 允许回到顶部 [enableAddBackTop](/zh/guide/config.html#enableAddBackTop)
+
+------------
+
+## **Q** 如何隐藏工作表的行标题和列标题?
+
+**A** 已开放配置
+- 行标题区域的宽度 [rowHeaderWidth](/zh/guide/config.html#rowheaderwidth)
+- 列标题区域的高度 [columnHeaderHeight](/zh/guide/config.html#columnHeaderHeight)
+
+------------
+
+## **Q** 调用什么方法能设置`config.merge`?
+
+**A** 三个方法
+- 界面操作
+- 用API:[setRangeMerge](/zh/guide/api.html#setrangemerge-type-setting)
+- 手动组装merge参数
+
+------------
+
+## **Q** 为什么官方公布的新功能没有效果?
+
+**A** 第一步,检查下您是否使用了CDN的方式引入,
+
+Luckysheet教程里采用的CDN链接是 [jsdelivr](https://www.jsdelivr.com/package/npm/luckysheet) 提供的服务,代码是从 [npmjs.com](https://www.npmjs.com/) 自动同步过去的,不是从 [Github](https://github.com/mengshukeji/Luckysheet/) 同步过去的。因为我们新提交的代码,还需要经过一段时间的测试,所以不会立即发布到npm使用,导致了npm的代码稍滞后于Github。
+
+如果需要尝试最新代码,我们强烈建议您从 [Luckysheet Github](https://github.com/mengshukeji/Luckysheet/) 主仓库拉取代码。后续我们版本稳定了,会考虑实时发布npm包。
+
+第二步,如果是引用github仓库打包后的代码,测试判断是否有bug,您可以查找问题并尝试修复,再[提交PR](https://github.com/mengshukeji/Luckysheet/pulls),如果修复不了,请[提交issues](https://github.com/mengshukeji/Luckysheet/issues)。
+
+------------
+
+## **Q** `npm run dev`报错:`Error: Cannot find module 'rollup'`?
+
+**A** 可能是npm包安装问题,尝试以下步骤:
+1. `npm cache clean --force`
+2. `npm i rimraf -g`
+3. `rimraf node_modules`
+4. 删除package-lock.json文件
+5. `npm i`
+6. `npm run dev`
+
+提示:大多数的其他npm安装问题,也可以尝试此步骤来解决。
+
------------
\ No newline at end of file
diff --git a/docs/zh/guide/README.md b/docs/zh/guide/README.md
index ac9fa97..f199455 100644
--- a/docs/zh/guide/README.md
+++ b/docs/zh/guide/README.md
@@ -10,7 +10,7 @@ Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置
## 特性
-### 格式设置
+### 🛠️格式设置
+ **样式** (修改字体样式,字号,颜色或者其他通用的样式)
+ **条件格式** (突出显示所关注的单元格或单元格区域;强调异常值;使用数据栏、色阶和图标集(与数据中的特定变体对应)直观地显示数据)
+ **文本对齐及旋转**
@@ -18,8 +18,9 @@ Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置
+ **数据类型**
+ **货币, 百分比, 数字, 日期**
+ **Custom** (和excel保持一致,例如: `##,###0.00` , `$1,234.56$##,###0.00_);[Red]($##,###0.00)`, `_($* ##,###0.00_);_(...($* "-"_);_(@_)`, `08-05 PM 01:30MM-dd AM/PM hh:mm` )
++ **单元格内多样式** (Alt+Enter单元格内换行、上标、下标、单元格内科定义每个文字的不同样式)
-### 单元格
+### 🧬单元格
+ **拖拽选取来修改单元格** (对选区进行操作,可以拖动四边来移动选区,也可以在右下角对选区进行下拉填充操作)
+ **选取下拉填充** (对于一个1,2,3,4,5的序列,将会按照间隔为1进行下拉填充,而对2,4,6,8将会以2作为间隔。支持等差数列,等比数列,日期,周,天,月,年,中文数字填充)
+ **自动填充选项** (下拉填充后,会出现填充选项的菜单,支持选择复制,序列,仅格式,只填充格式,天,月,年的选择)
@@ -27,20 +28,21 @@ Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置
+ **查找和替换** (对内容进行查找替换,支持正则表达式,整词,大小写敏感)
+ **定位** (可以根据单元格的数据类型进行自动定位并选中,选中后可以批量进行格式等操作)
+ **合并单元格**
++ **数据验证(表单功能)** (支持Checkbox, drop-down list, datePicker)
-### 行和列操作
+### 🖱️行和列操作
+ **隐藏,插入,删除行或列**
+ **冻结行或列** (支持冻结首行和首列,冻结到选区,冻结调节杆可以进行拖动操作)
+ **文本分列** (可以把文本根据不同符号进行拆分,和excel的分列功能类似)
-### 操作体验
+### 🔨操作体验
+ **撤销/重做**
-+ **复制/粘贴/剪切操作** (支持luckysheet到excel和excel到luckysheet带格式的互相拷贝)
++ **复制/粘贴/剪切操作** (支持Luckysheet到excel和excel到Luckysheet带格式的互相拷贝)
+ **快捷键支持** (快捷键操作保持与excel一致,如果有不同或者缺失请反馈给我们)
+ **格式刷** (与google sheet类似)
+ **任意选区拖拽** (选择单元格,输入公式,插入图表,会与选区相关,可以通过任意拖动和放大缩小选区来改变与之关联的参数)
-### 公式和函数
+### ⚙️公式和函数
+ **内置公式**
+ 数学 (SUMIFS, AVERAGEIFS, SUMIF, SUM, etc.)
+ 文本 (CONCATENATE, REGEXMATCH, MID)
@@ -53,39 +55,41 @@ Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置
+ **远程公式** (DM_TEXT_TFIDF, DM_TEXT_TEXTRANK,DATA_CN_STOCK_CLOSE etc. Need remote interface, can realize complex calculation)
+ **自定义公式** (根据身份证识别年龄,性别,生日,省份,城市等. AGE_BY_IDCARD, SEX_BY_IDCARD, BIRTHDAY_BY_IDCARD, PROVINCE_BY_IDCARD, CITY_BY_IDCARD, etc. 可以任意加入自己的公式哦)
-### 表格操作
+### 📐表格操作
+ **筛选** (支持颜色、数字、字符、日期的筛选)
+ **排序** (同时加入多个字段进行排序)
-### 数据透视表
+### 📈数据透视表
+ **字段拖拽** (操作方式与excel类似,拖动字段到行、列、数值、筛选等4个区域)
+ **聚合方式** (支持汇总、计数、去重计数、平均、最大、最小、中位数、协方差、标准差、方差等计算)
+ **筛选数据** (可对字段进行筛选后再进行汇总)
+ **数据透视表下钻** (双击数据透视表中的数据,可以下钻查看到明细,操作方式与excel一致)
+ **根据数据透视表新建图表** (数据透视表产生的数据也可以进行图表的制作)
-### 图表
+### 📊图表
+ **支持的图表类型** (目前折线图、柱状图、面积图、条形图、饼图可以使用,散点图、雷达图、仪表盘、漏斗图正在接入,其他图表正在陆续开发中,请大家给予建议)
+ **关于图表插件** (图表使用了一个中间插件[ChartMix](https://github.com/mengshukeji/chartMix)(MIT协议): 目前支持ECharts,正在逐步接入Highcharts、阿里G2、amCharts、googleChart、chart.js)
+ **Sparklines小图** (以公式的形式进行设置和展示,目前支持:折线图、面积图、柱状图、累积图、条形图、离散图、三态图、饼图、箱线图等)
-### 分享及写作
+### ✍️分享及写作
+ **评论** (评论的删除、添加、修改、隐藏)
+ **共享编辑** (支持多用户共享编辑,内置API)
-### LuckySheet专有
+### 📚插入对象
++ **插入图片** (支持JPG,PNG,SVG的插入、修改和删除,并且随表格的变动而产生变化)
+
+### ⚡Luckysheet专有
+ **矩阵计算** (通过右键菜单进行支持:对选区内的数据进行转置、旋转、数值计算)
+ **截图** (把选区的内容进行截图展示)
+ **复制到其他格式** (右键菜单的"复制为", 支持复制为json、array、对角线数据、去重等)
-+ **EXCEL,CSV,TXT 导入及导出** (专为luckysheet打造的导入导出插件,支持密码、水印、公式等的本地导入导出)
-+ **插入图片和svg形状** (支持JPG,PNG,SVG,Pen tool的插入、修改和删除,并且随表格的变动而产生变化)
-+ **数据验证(表单功能)** (支持Checkbox, drop-down list, datePicker)
-+ **单元格内多样式** (Alt+Enter单元格内换行、上标、下标、单元格内科定义每个文字的不同样式)
++ **EXCEL导入及导出** (专为Luckysheet打造的导入导出插件,支持密码、水印、公式等的本地导入导出,导出正在开发)
-### 未来开发计划
+### ⏱️未来开发计划
+ **打印及设置** (像excel一样进行打印设置,并导出为图片或者PDF)
+ **树形菜单** (类似excel中的分级显示(分组))
+ **表格新功能** (类似excel中表格的筛选器和切片器)
++ **CSV,TXT导入及导出** (专为Luckysheet打造的导入导出插件,支持密码、水印、公式等的本地导入导出)
++ **插入svg形状** (支持[Pen tool](https://github.com/mengshukeji/Pentool)的插入、修改和删除,并且随表格的变动而产生变化)
+ **文档** (完善文档和API)
+ **敬请期待...** (可以提出好的建议给我们)
diff --git a/docs/zh/guide/api.md b/docs/zh/guide/api.md
index 461fef8..a67d942 100644
--- a/docs/zh/guide/api.md
+++ b/docs/zh/guide/api.md
@@ -1791,7 +1791,7 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
返回所有工作表配置,格式同工作表配置,得到的结果可用于表格初始化时作为options.data使用。
- 所以此API适用于,手动操作配置完一个表格后,将所有工作表信息取出来自行保存,再用于其他地方的表格创建。如果想得到包括工作簿配置在内的所有工作簿数据,可以使用 [toJson](#toJson())
+ 所以此API适用于,手动操作配置完一个表格后,将所有工作表信息取出来自行保存,再用于其他地方的表格创建。如果想得到包括工作簿配置在内的所有工作簿数据,推荐使用 [toJson](#toJson()),并且可以直接用于初始化Luckysheet。
- **示例**:
@@ -1806,6 +1806,13 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
返回所有表格数据结构的一维数组`luckysheetfile`,不同于`getAllSheets`方法,此方法得到的工作表参数会包含很多内部使用变量,最明显的区别是表格数据操作会维护`luckysheetfile[i].data`,而初始化数据采用的是`options.data[i].celldata`,所以`luckysheetfile`可用于调试使用,但是不适用初始化表格。
+ 除此之外,加载过的工作表参数中会增加一个`load = 1`,这个参数在初始化数据的时候需要置为0才行。所以,将`getLuckysheetfile()`得到的数据拿来初始化工作簿,需要做两个工作:
+
+ - celldata转为data,参考:[transToData](/zh/guide/api.html#transtodata-celldata-setting)
+ - load重置为0或者删除此字段
+
+ 现在已有`getAllSheets`来完成这个工作,无需再手动转化数据。
+
- **示例**:
- 取得第一个工作表的所有调试信息
@@ -1873,13 +1880,13 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
- **参数**:
- {PlainObject} [setting]: 可选参数
- + {Object} [sheetObject]: 新增的工作表的数据;默认值为空对象
+ + {Object} [sheetObject]: 新增的工作表的数据;默认值为空对象,工作表数据格式参考[options.data](/zh/guide/sheet.html#初始化配置)
+ {Number} [order]: 新增的工作表下标;默认值为最后一个下标位置
+ {Function} [success]: 操作结束的回调函数
- **说明**:
- 新增一个sheet,返回新增的工作表对象,`setting`中可选设置数据为 `sheetObject`,不传`sheetObject`则会新增一个空白的工作表
+ 新增一个sheet,返回新增的工作表对象,`setting`中可选设置数据为 `sheetObject`,不传`sheetObject`则会新增一个空白的工作表。
- **示例**:
@@ -2467,7 +2474,6 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
### toJson()
-[todo]
- **说明**:
diff --git a/docs/zh/guide/cell.md b/docs/zh/guide/cell.md
index 287d762..ae9326e 100644
--- a/docs/zh/guide/cell.md
+++ b/docs/zh/guide/cell.md
@@ -330,7 +330,7 @@ Luckysheet在存储数字类型的内容时,支持多种格式转换,所以
]
```
-> borderInfo 详细参考:[表格数据config](/zh/guide/data.html#config)
+> borderInfo 详细参考:[config.borderInfo](/zh/guide/sheet.html#config-borderinfo)
## 简化的单元格数据
diff --git a/docs/zh/guide/config.md b/docs/zh/guide/config.md
index 5621fb8..720c718 100644
--- a/docs/zh/guide/config.md
+++ b/docs/zh/guide/config.md
@@ -28,7 +28,6 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- 自定义工具栏([showtoolbarConfig](#showtoolbarConfig))
- 自定义底部sheet页([showsheetbarConfig](#showsheetbarConfig))
- 自定义计数栏([showstatisticBarConfig](#showstatisticBarConfig))
-- 自定义添加行和回到顶部([sheetBottomConfig](#sheetBottomConfig))
- 自定义单元格右键菜单([cellRightClickConfig](#cellRightClickConfig))
- 自定义底部sheet页右击菜单([sheetRightClickConfig](#sheetRightClickConfig))
@@ -60,22 +59,20 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- 自定义底部sheet页 [showsheetbarConfig](#showsheetbarConfig)
- 底部计数栏 [showstatisticBar](#showstatisticBar)
- 自定义计数栏 [showstatisticBarConfig](#showstatisticBarConfig)
-- 自定义添加行和回到顶部 [sheetBottomConfig](#sheetBottomConfig)
- 允许编辑 [allowEdit](#allowEdit)
-- 允许增加行 [enableAddRow](#enableAddRow)
-- 允许增加列 [enableAddCol](#enableAddCol)
+- 允许添加行 [enableAddRow](#enableAddRow)
+- 允许回到顶部 [enableAddBackTop](#enableAddBackTop)
- 用户信息 [userInfo](#userInfo)
- 用户信息菜单 [userMenuItem](#userMenuItem)
- 返回按钮链接 [myFolderUrl](#myFolderUrl)
- 比例 [devicePixelRatio](#devicePixelRatio)
- 功能按钮 [functionButton](#functionButton)
- 自动缩进界面 [showConfigWindowResize](#showConfigWindowResize)
-- 加载下一页 [enablePage](#enablePage)
- 刷新公式 [forceCalculation](#forceCalculation)
- 自定义单元格右键菜单 [cellRightClickConfig](#cellRightClickConfig)
- 自定义sheet页右击菜单 [sheetRightClickConfig](#sheetRightClickConfig)
-- 是否显示行号区域 [showRowBar](#showRowBar)
-- 是否显示列号区域 [showColumnBar](#showColumnBar)
+- 行标题区域的宽度 [rowHeaderWidth](#rowHeaderWidth)
+- 列标题区域的高度 [columnHeaderHeight](#columnHeaderHeight)
- 是否显示公式栏 [sheetFormulaBar](#sheetFormulaBar)
- 初始化默认字体大小 [defaultFontSize](#defaultFontSize)
@@ -213,6 +210,8 @@ Luckysheet开放了更细致的自定义配置选项,分别有
+ 配置了`loadSheetUrl`
+ 配置了`updateUrl`
+ 注意,发送给后端的数据默认是经过pako压缩过后的。后台拿到数据需要先解压。
+
通过共享编辑功能,可以实现Luckysheet实时保存数据和多人同步数据,每一次操作都会发送不同的参数到后台,具体的操作类型和参数参见[表格操作](/zh/guide/operate.html)
------------
@@ -272,15 +271,13 @@ Luckysheet开放了更细致的自定义配置选项,分别有
------------
### showtoolbarConfig
-[todo]
-
- 类型:Object
- 默认值:{}
-- 作用:自定义配置工具栏
+- 作用:自定义配置工具栏,可以与showtoolbar配合使用,`showtoolbarConfig`拥有更高的优先级。
- 格式:
```json
{
- undoRedo: false, //撤销重做
+ undoRedo: false, //撤销重做,注意撤消重做是两个按钮,由这一个配置决定显示还是隐藏
paintFormat: false, //格式刷
currencyFormat: false, //货币格式
percentageFormat: false, //百分比格式
@@ -300,19 +297,48 @@ Luckysheet开放了更细致的自定义配置选项,分别有
verticalAlignMode: false, // '垂直对齐方式'
textWrapMode: false, // '换行方式'
textRotateMode: false, // '文本旋转方式'
- frozenMode: false, // '冻结方式'
- sort: false, // '排序'
- filter: false, // '筛选'
- findAndReplace: false, // '查找替换'
- function: false, // '公式'
- conditionalFormat: false, // '条件格式'
+ image:false, // '插入图片'
+ link:false, // '插入链接'
+ chart: false, // '图表'(图标隐藏,但是如果配置了chart插件,右击仍然可以新建图表)
postil: false, //'批注'
pivotTable: false, //'数据透视表'
- chart: false, // '图表'(图标隐藏,但是如果配置了chart插件,右击仍然可以新建图表)
+ function: false, // '公式'
+ frozenMode: false, // '冻结方式'
+ sortAndFilter: false, // '排序和筛选'
+ conditionalFormat: false, // '条件格式'
+ dataVerification: false, // '数据验证'
+ splitColumn: false, // '分列'
screenshot: false, // '截图'
- splitColumn: false, // '分列'
+ findAndReplace: false, // '查找替换'
+ protection:false, // '工作表保护'
+ print:false, // '打印'
}
```
+- 示例:
+ - 仅显示撤消重做和字体按钮:
+
+ ```js
+ //options
+ {
+ showtoolbar: false,
+ showtoolbarConfig:{
+ undoRedo: true,
+ font: true,
+ }
+ }
+ ```
+ - 仅隐藏图片和打印按钮:
+
+ ```js
+ //options
+ {
+ showtoolbar: true, // 默认就是true,可以不设置
+ showtoolbarConfig:{
+ image: false,
+ print: false,
+ }
+ }
+ ```
------------
### showinfobar
@@ -329,11 +355,9 @@ Luckysheet开放了更细致的自定义配置选项,分别有
------------
### showsheetbarConfig
-[todo]
-
- 类型:Object
- 默认值:{}
-- 作用:自定义配置底部sheet页按钮
+- 作用:自定义配置底部sheet页按钮,可以与showsheetbar配合使用,`showsheetbarConfig`拥有更高的优先级。
- 格式:
```json
{
@@ -342,6 +366,30 @@ Luckysheet开放了更细致的自定义配置选项,分别有
sheet: false //sheet页显示
}
```
+- 示例:
+ - 仅显示新增sheet按钮:
+
+ ```js
+ //options
+ {
+ showsheetbar: false,
+ showsheetbarConfig:{
+ add: true,
+ }
+ }
+ ```
+ - 仅隐藏新增sheet和管理按钮:
+
+ ```js
+ //options
+ {
+ showsheetbar: true, // 默认就是true,可以不设置
+ showsheetbarConfig:{
+ add: false,
+ menu: false,
+ }
+ }
+ ```
------------
### showstatisticBar
@@ -352,32 +400,40 @@ Luckysheet开放了更细致的自定义配置选项,分别有
------------
### showstatisticBarConfig
-[todo]
-
- 类型:Object
- 默认值:{}
-- 作用:自定义配置底部计数栏
+- 作用:自定义配置底部计数栏,可以与showstatisticBar配合使用,`showstatisticBarConfig`拥有更高的优先级。
- 格式:
```json
{
count: false, // 计数栏
- zoom: false // 缩放
- }
-
-------------
-### sheetBottomConfig
-
-[todo]
-
-- 类型:Object
-- 默认值:{}
-- 作用:sheet页下方的添加行按钮和回到顶部按钮配置
-- 格式:
- ```json
- {
- addRow: false, // 添加行按钮
- backTop: false // 回到顶部
+ view: false, // 打印视图
+ zoom: false, // 缩放
}
+ ```
+- 示例:
+ - 仅显示缩放按钮:
+
+ ```js
+ //options
+ {
+ showstatisticBar: false,
+ showstatisticBarConfig:{
+ zoom: true,
+ }
+ }
+ ```
+ - 仅隐藏打印视图按钮:
+
+ ```js
+ //options
+ {
+ showstatisticBar: true, // 默认就是true,可以不设置
+ showstatisticBarConfig:{
+ view: false,
+ }
+ }
+ ```
------------
### allowEdit
@@ -389,13 +445,13 @@ Luckysheet开放了更细致的自定义配置选项,分别有
### enableAddRow
- 类型:Boolean
- 默认值:true
-- 作用:允许增加行
+- 作用:允许添加行
------------
-### enableAddCol
+### enableAddBackTop
- 类型:Boolean
- 默认值:true
-- 作用:允许增加列
+- 作用:允许回到顶部
------------
### userInfo
@@ -433,12 +489,6 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- 默认值:true
- 作用:图表或数据透视表的配置会在右侧弹出,设置弹出后表格是否会自动缩进
-------------
-### enablePage
-- 类型:Boolean
-- 默认值:false
-- 作用:允许加载下一页
-
------------
### forceCalculation
- 类型:Boolean
@@ -454,8 +504,6 @@ Luckysheet开放了更细致的自定义配置选项,分别有
------------
### cellRightClickConfig
-[todo]
-
- 类型:Object
- 默认值:{}
- 作用:自定义配置单元格右击菜单
@@ -465,22 +513,56 @@ Luckysheet开放了更细致的自定义配置选项,分别有
copy: false, // 复制
copyAs: false, // 复制为
paste: false, // 粘贴
- insert: false, // 插入
- delete: false, // 删除
- hide: false, // 隐藏
+ insertRow: false, // 插入行
+ insertColumn: false, // 插入列
+ deleteRow: false, // 删除选中行
+ deleteColumn: false, // 删除选中列
deleteCell: false, // 删除单元格
+ hideRow: false, // 隐藏选中行和显示选中行
+ hideColumn: false, // 隐藏选中列和显示选中列
+ rowHeight: false, // 行高
+ columnWidth: false, // 列宽
clear: false, // 清除内容
matrix: false, // 矩阵操作选区
sort: false, // 排序选区
filter: false, // 筛选选区
- chart: false // 图表生成
+ chart: false, // 图表生成
+ image: false, // 插入图片
+ link: false, // 插入链接
+ data: false, // 数据验证
+ cellFormat: false // 设置单元格格式
}
+ ```
+ 除了单元格,这里的配置还包括行标题右击菜单、列标题右击菜单和列标题下拉箭头的菜单,具体配置关系如下表格:
+
+ |右击菜单配置|单元格|行标题|列标题|列箭头|
+ | ------------ | ------------ | ------------ | ------------ | ------------ |
+ |copy|复制|复制|复制|复制|
+ |copyAs|复制为|复制为|复制为|复制为|
+ |paste|粘贴|粘贴|粘贴|粘贴|
+ |insertRow|插入行|向上增加N行,向下增加N行|-|-|
+ |insertColumn|插入列|-|向左增加N列,向右增加N列|向左增加N列,向右增加N列|
+ |deleteRow|删除选中行|删除选中行|-|-|
+ |deleteColumn|删除选中列|-|删除选中列|删除选中列|
+ |deleteCell|删除单元格|-|-|-|
+ |hideRow|-|隐藏选中行和显示选中行|-|-|
+ |hideColumn|-|-|隐藏选中列和显示选中列|隐藏选中列和显示选中列|
+ |rowHeight|-|行高|-|-|
+ |columnWidth|-|-|列宽|列宽|
+ |clear|清除内容|清除内容|清除内容|-|
+ |matrix|矩阵操作选区|矩阵操作选区|矩阵操作选区|-|
+ |sort|排序选区|排序选区|排序选区|A-Z排序和Z-A排序|
+ |filter|筛选选区|筛选选区|筛选选区|-|
+ |chart|图表生成|图表生成|图表生成|-|
+ |image|插入图片|插入图片|插入图片|-|
+ |link|插入链接|插入链接|插入链接|-|
+ |data|数据验证|数据验证|数据验证|-|
+ |cellFormat|设置单元格格式|设置单元格格式|设置单元格格式|-|
+
------------
### sheetRightClickConfig
-[todo]
-
- 类型:Object
- 默认值:{}
- 作用:自定义配置sheet页右击菜单
@@ -491,29 +573,27 @@ Luckysheet开放了更细致的自定义配置选项,分别有
copy: false, // 复制
rename: false, //重命名
color: false, //更改颜色
- hide: false, //隐藏
- show: false, //取消隐藏
- left: false, //向左移
- right: false //向右移
+ hide: false, //隐藏,取消隐藏
+ move: false, //向左移,向右移
}
------------
-### showRowBar
-[todo]
-- 类型:Boolean
-- 默认值:true
-- 作用:是否显示行号区域
+### rowHeaderWidth
+
+- 类型:Number
+- 默认值:46
+- 作用:行标题区域的宽度,如果设置为0,则表示隐藏行标题
------------
-### showColumnBar
-[todo]
-- 类型:Boolean
-- 默认值:true
-- 作用:是否显示列号区域
+### columnHeaderHeight
+
+- 类型:Number
+- 默认值:20
+- 作用:列标题区域的高度,如果设置为0,则表示隐藏列标题
------------
### sheetFormulaBar
-[todo]
+
- 类型:Boolean
- 默认值:true
- 作用:是否显示公式栏
@@ -534,26 +614,40 @@ Luckysheet开放了更细致的自定义配置选项,分别有
## 单元格
-### cellRenderAfter
-(TODO)
+### cellRenderBefore
+
- 类型:Function
- 默认值:null
-- 作用:单元格渲染结束后触发
+- 作用:单元格渲染前触发,`return false` 则不渲染该单元格
- 参数:
- - {Number} [r]: 单元格所在行数
- - {Number} [c]: 单元格所在列数
- - {Object} [v]: 单元格对象
+ - {Object} [cell]:单元格对象
+ - {Object} [postion]:
+ + {Number} [r]:单元格所在行号
+ + {Number} [c]:单元格所在列号
+ + {Number} [start_r]:单元格左上角的水平坐标
+ + {Number} [start_c]:单元格左上角的垂直坐标
+ + {Number} [end_r]:单元格右下角的水平坐标
+ + {Number} [end_c]:单元格右下角的垂直坐标
+ - {Object} [sheet]:当前sheet对象
+ - {Object} [ctx]: 当前画布的context
------------
-### cellHover
-(TODO)
+### cellRenderAfter
+
- 类型:Function
- 默认值:null
-- 作用:鼠标移过单元格时(hover)触发
+- 作用:单元格渲染结束后触发,`return false` 则不渲染该单元格
- 参数:
- - {Number} [r]: 单元格所在行数
- - {Number} [c]: 单元格所在列数
- - {Object} [v]: 单元格对象
+ - {Object} [cell]:单元格对象
+ - {Object} [postion]:
+ + {Number} [r]:单元格所在行号
+ + {Number} [c]:单元格所在列号
+ + {Number} [start_r]:单元格左上角的水平坐标
+ + {Number} [start_c]:单元格左上角的垂直坐标
+ + {Number} [end_r]:单元格右下角的水平坐标
+ + {Number} [end_c]:单元格右下角的垂直坐标
+ - {Object} [sheet]:当前sheet对象
+ - {Object} [ctx]: 当前画布的context
------------
### cellEditBefore
@@ -579,11 +673,175 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- {Object} [newV]: 修改后单元格对象
------------
-### fireMousedown
-(TODO)
+### rowTitleCellRenderBefore
+
- 类型:Function
- 默认值:null
-- 作用:单元格数据下钻自定义方法
+- 作用:行标题单元格渲染前触发,`return false` 则不渲染行标题
+- 参数:
+ - {String} [rowNum]:行号
+ - {Object} [postion]:
+ + {Number} [r]:单元格所在行号
+ + {Number} [top]:单元格左上角的垂直坐标
+ + {Number} [width]:单元格宽度
+ + {Number} [height]:单元格高度
+ - {Object} [ctx]: 当前画布的context
+
+------------
+### rowTitleCellRenderAfter
+
+- 类型:Function
+- 默认值:null
+- 作用:行标题单元格渲染后触发,`return false` 则不渲染行标题
+- 参数:
+ - {String} [rowNum]:行号
+ - {Object} [postion]:
+ + {Number} [r]:单元格所在行号
+ + {Number} [top]:单元格左上角的垂直坐标
+ + {Number} [width]:单元格宽度
+ + {Number} [height]:单元格高度
+ - {Object} [ctx]: 当前画布的context
+
+------------
+### columnTitleCellRenderBefore
+
+- 类型:Function
+- 默认值:null
+- 作用:列标题单元格渲染前触发,`return false` 则不渲染列标题
+- 参数:
+ - {Object} [columnAbc]:列标题字符
+ - {Object} [postion]:
+ - {Number} [c]:单元格所在列号
+ - {Number} [left]:单元格左上角的水平坐标
+ - {Number} [width]:单元格宽度
+ - {Number} [height]:单元格高度
+ - {Object} [ctx]: 当前画布的context
+
+------------
+### columnTitleCellRenderAfter
+
+- 类型:Function
+- 默认值:null
+- 作用:列标题单元格渲染后触发,`return false` 则不渲染列标题
+- 参数:
+ - {Object} [columnAbc]:列标题字符
+ - {Object} [postion]:
+ - {Number} [c]:单元格所在列号
+ - {Number} [left]:单元格左上角的水平坐标
+ - {Number} [width]:单元格宽度
+ - {Number} [height]:单元格高度
+ - {Object} [ctx]: 当前画布的context
+
+------------
+
+## 鼠标钩子
+
+### cellMousedownBefore
+
+- 类型:Function
+- 默认值:null
+- 作用:单元格点击前的事件,`return false`则终止之后的点击操作
+- 参数:
+ - {Object} [cell]:单元格对象
+ - {Object} [postion]:
+ + {Number} [r]:单元格所在行号
+ + {Number} [c]:单元格所在列号
+ + {Number} [start_r]:单元格左上角的水平坐标
+ + {Number} [start_c]:单元格左上角的垂直坐标
+ + {Number} [end_r]:单元格右下角的水平坐标
+ + {Number} [end_c]:单元格右下角的垂直坐标
+ - {Object} [sheet]:当前sheet对象
+ - {Object} [ctx]: 当前画布的context
+
+------------
+### cellMousedown
+
+- 类型:Function
+- 默认值:null
+- 作用:单元格点击后的事件,`return false`则终止之后的点击操作
+- 参数:
+ - {Object} [cell]:单元格对象
+ - {Object} [postion]:
+ + {Number} [r]:单元格所在行号
+ + {Number} [c]:单元格所在列号
+ + {Number} [start_r]:单元格左上角的水平坐标
+ + {Number} [start_c]:单元格左上角的垂直坐标
+ + {Number} [end_r]:单元格右下角的水平坐标
+ + {Number} [end_c]:单元格右下角的垂直坐标
+ - {Object} [sheet]:当前sheet对象
+ - {Object} [ctx]: 当前画布的context
+
+------------
+### sheetMousemove
+
+- 类型:Function
+- 默认值:null
+- 作用:鼠标移动事件,可通过cell判断鼠标停留在哪个单元格
+- 参数:
+ - {Object} [cell]:单元格对象
+ - {Object} [postion]:
+ + {Number} [r]:单元格所在行号
+ + {Number} [c]:单元格所在列号
+ + {Number} [start_r]:单元格左上角的水平坐标
+ + {Number} [start_c]:单元格左上角的垂直坐标
+ + {Number} [end_r]:单元格右下角的水平坐标
+ + {Number} [end_c]:单元格右下角的垂直坐标
+ - {Object} [sheet]:当前sheet对象
+ - {Object} [moveState]:鼠标移动状态,可判断现在鼠标操作的对象,false和true
+ + {Boolean} [functionResizeStatus]:工具栏拖动
+ + {Boolean} [horizontalmoveState]:水平冻结分割烂拖动
+ + {Boolean} [verticalmoveState]:垂直冻结分割烂拖动
+ + {Boolean} [pivotTableMoveState]:数据透视表字段拖动
+ + {Boolean} [sheetMoveStatus]:sheet改变你位置拖动
+ + {Boolean} [scrollStatus]:鼠标触发了滚动条移动
+ + {Boolean} [selectStatus]:鼠标移动框选数据
+ + {Boolean} [rowsSelectedStatus]:通过行标题来选择整行操作
+ + {Boolean} [colsSelectedStatus]:通过列标题来选择整列操作
+ + {Boolean} [cellSelectedMove]:选框的移动
+ + {Boolean} [cellSelectedExtend]:选框下拉填充
+ + {Boolean} [colsChangeSize]:拖拽改变列宽
+ + {Boolean} [rowsChangeSize]:拖拽改变行高
+ + {Boolean} [chartMove]:图表移动
+ + {Boolean} [chartResize]:图表改变大小
+ + {Boolean} [rangeResize]:公式参数高亮选区的大小拖拽
+ + {Boolean} [rangeMove]:公式参数高亮选区的位置拖拽
+ - {Object} [ctx]: 当前画布的context
+
+------------
+### sheetMouseup
+
+- 类型:Function
+- 默认值:null
+- 作用:鼠标按钮释放事件,可通过cell判断鼠标停留在哪个单元格
+- 参数:
+ - {Object} [cell]:单元格对象
+ - {Object} [postion]:
+ + {Number} [r]:单元格所在行号
+ + {Number} [c]:单元格所在列号
+ + {Number} [start_r]:单元格左上角的水平坐标
+ + {Number} [start_c]:单元格左上角的垂直坐标
+ + {Number} [end_r]:单元格右下角的水平坐标
+ + {Number} [end_c]:单元格右下角的垂直坐标
+ - {Object} [sheet]:当前sheet对象
+ - {Object} [moveState]:鼠标移动状态,可判断现在鼠标操作的对象,false和true
+ + {Boolean} [functionResizeStatus]:工具栏拖动
+ + {Boolean} [horizontalmoveState]:水平冻结分割烂拖动
+ + {Boolean} [verticalmoveState]:垂直冻结分割烂拖动
+ + {Boolean} [pivotTableMoveState]:数据透视表字段拖动
+ + {Boolean} [sheetMoveStatus]:sheet改变你位置拖动
+ + {Boolean} [scrollStatus]:鼠标触发了滚动条移动
+ + {Boolean} [selectStatus]:鼠标移动框选数据
+ + {Boolean} [rowsSelectedStatus]:通过行标题来选择整行操作
+ + {Boolean} [colsSelectedStatus]:通过列标题来选择整列操作
+ + {Boolean} [cellSelectedMove]:选框的移动
+ + {Boolean} [cellSelectedExtend]:选框下拉填充
+ + {Boolean} [colsChangeSize]:拖拽改变列宽
+ + {Boolean} [rowsChangeSize]:拖拽改变行高
+ + {Boolean} [chartMove]:图表移动
+ + {Boolean} [chartResize]:图表改变大小
+ + {Boolean} [rangeResize]:公式参数高亮选区的大小拖拽
+ + {Boolean} [rangeMove]:公式参数高亮选区的位置拖拽
+ - {Object} [ctx]: 当前画布的context
------------
@@ -1120,4 +1378,14 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- 参数:
- {Object} [frozen]: 冻结类型信息
+------------
+
+## 旧版钩子函数
+
+### fireMousedown
+
+- 类型:Function
+- 默认值:null
+- 作用:单元格数据下钻自定义方法,注意此钩子函数是挂载在options下:`options.fireMousedown`
+
------------
\ No newline at end of file
diff --git a/docs/zh/guide/resource.md b/docs/zh/guide/resource.md
new file mode 100644
index 0000000..b54e683
--- /dev/null
+++ b/docs/zh/guide/resource.md
@@ -0,0 +1,20 @@
+# 教程与资源
+
+开源软件离不开社区的贡献,这里将会列举出社区提供的教程、学习资料及配套解决方案。
+
+如果您写了或者发现了优秀的教程想要推荐给我们,请直接[编辑此页](https://github.com/mengshukeji/Luckysheet/edit/master/docs/zh/guide/resource.md)提交PR。
+
+## 博客
+- [Luckysheet如何初始化含合并单元格的数据](https://www.cnblogs.com/DuShuSir/p/13272397.html)
+- [Luckysheet如何把表格里的数据保存到数据库](https://www.cnblogs.com/DuShuSir/p/13857874.html)
+- [本地HTML采用cdn加载方式引入Luckysheet的案例](https://www.cnblogs.com/DuShuSir/p/13859103.html)
+
+## 协同编辑后台
+
+### 社区案例
+- Java后台 [Luckysheet保存与恢复](https://gitee.com/ichiva/luckysheet-saved-in-recovery)
+
+
+## 学习资料
+
+- [如何从0到1搭建 Web 数据分析报表](https://github.com/mengshukeji/LuckyResources/blob/master/ppt/%E5%A6%82%E4%BD%95%E4%BB%8E0%E5%88%B01%E6%90%AD%E5%BB%BA%20Web%20%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E6%8A%A5%E8%A1%A8.pptx)
\ No newline at end of file
diff --git a/gulpfile.js b/gulpfile.js
index bbfd919..6728463 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -43,7 +43,14 @@ const babelConfig = {
plugins: [
],
presets: [
- '@babel/preset-env'
+ ['@babel/preset-env', {
+ useBuiltIns: 'usage',
+ corejs: 3,
+ targets: {
+ chrome: 58,
+ ie: 11
+ }
+ }]
]
};
@@ -68,7 +75,7 @@ const paths = {
destStaticCssImages: ['dist/css'],
//core es module
- core: ['src/**/*.js','!src/demoData/*.js','src/expendPlugins/**/plugin.js','!src/plugins/js/*.js'],
+ core: ['src/**/*.js','!src/demoData/*.js','src/expendPlugins/**/plugin.js','!src/plugins/js/*.js'],
//plugins src
pluginsCss: ['src/plugins/css/*.css'],
@@ -98,7 +105,7 @@ const paths = {
concatPlugins: 'plugins.css',
concatCss: 'luckysheet.css',
concatPluginsJs: 'plugin.js',
-
+
//plugins dest
destPluginsCss: ['dist/plugins/css'],
destPlugins: ['dist/plugins'],
@@ -187,7 +194,7 @@ async function core() {
inlineDynamicImports:true,
});
}
-
+
}
// According to the build tag in html, package js and css
@@ -196,7 +203,7 @@ function pluginsCss() {
.pipe(concat(paths.concatPluginsCss))
.pipe(gulpif(production, cleanCSS()))
.pipe(dest(paths.destPluginsCss))
-
+
}
function plugins() {
@@ -255,4 +262,4 @@ const build = series(clean, parallel(pluginsCss, plugins, css, pluginsJs, copySt
exports.dev = dev;
exports.build = build;
-exports.default = dev;
\ No newline at end of file
+exports.default = dev;
diff --git a/package.json b/package.json
index 23d2ba3..43c0291 100644
--- a/package.json
+++ b/package.json
@@ -1,14 +1,15 @@
{
"name": "luckysheet",
- "version": "2.1.4",
+ "version": "2.1.5",
"main": "dist/luckysheet.cjs.js",
"module": "dist/luckysheet.esm.js",
"browser": "dist/luckysheet.umd.js",
"devDependencies": {
"@babel/preset-env": "^7.10.2",
+ "@babel/runtime-corejs3": "^7.12.1",
"@commitlint/cli": "^9.1.1",
"@commitlint/config-conventional": "^9.1.1",
- "@rollup/plugin-babel": "^5.0.3",
+ "@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-node-resolve": "^8.0.1",
"browser-sync": "^2.26.7",
@@ -21,12 +22,17 @@
"gulp-if": "^3.0.0",
"gulp-uglify": "^3.0.2",
"gulp-useref": "^4.0.1",
- "rollup": "^2.16.1",
+ "rollup": "^2.32.1",
"rollup-plugin-terser": "^6.1.0",
"standard-version": "^8.0.2",
- "vuepress": "^1.5.0"
+ "vuepress": "^1.5.0",
+ "vuepress-plugin-baidu-autopush": "^1.0.1",
+ "vuepress-plugin-code-copy": "^1.0.6",
+ "vuepress-plugin-seo": "^0.1.4",
+ "vuepress-plugin-sitemap": "^2.3.1"
},
"dependencies": {
+ "@babel/runtime": "^7.12.1",
"jspdf": "^2.1.1"
},
"scripts": {
diff --git a/src/assets/iconfont/demo_index.html b/src/assets/iconfont/demo_index.html
index d1f50f4..0354cb6 100644
--- a/src/assets/iconfont/demo_index.html
+++ b/src/assets/iconfont/demo_index.html
@@ -30,6 +30,30 @@