Browse Source

docs(api): config

1.add config/api/sheet doc 2.gulpfile build issue
master
lrz 5 years ago
parent
commit
cba44eaa53
  1. 79
      docs/guide/api.md
  2. 45
      docs/guide/config.md
  3. 44
      docs/guide/sheet.md
  4. 77
      docs/zh/guide/api.md
  5. 35
      docs/zh/guide/config.md
  6. 6
      docs/zh/guide/sheet.md
  7. 3
      gulpfile.js

79
docs/guide/api.md

@ -212,6 +212,25 @@ Use note:
------------
### exitEditMode([,setting])
- **Parameter**
- {PlainObject} [setting]: optional parameters
+ {Function} [success]: callback function for the end of the operation
- **Explanation**
Exit edit mode. After double-clicking the cell with the mouse, it will enter the cell editing mode. After the editing is completed, when the mouse clicks on the input box elsewhere to lose focus, the editing mode will be exited, and the value of the cell will be saved. This Api is the operation of automatically exiting the editing mode, mainly to trigger the automatic saving of cells.
- **Usage**:
- Manually trigger to exit edit mode
`luckysheet.exitEditMode()`
------------
## Row and column operations
### setHorizontalFrozen(isRange [,setting])
@ -1994,6 +2013,48 @@ Use note:
------------
### showGridLines([setting])
- **Parameter**
- {PlainObject} [setting]: optional parameters
+ {Number} [order]: The subscript of the worksheet that needs to show the grid lines; the default value is the subscript of the current worksheet
+ {Function} [success]: callback function for the end of the operation
- **Explanation**
Show the grid lines of the specified subscript worksheet, and return the worksheet object of the operation
- **Usage**:
- Show the grid lines of the current worksheet
`luckysheet.showGridLines()`
- Show the grid lines of the third worksheet
`luckysheet.showGridLines({order:2})`
------------
### hideGridLines([setting])
- **Parameter**
- {PlainObject} [setting]: optional parameters
+ {Number} [order]: The subscript of the worksheet that needs to hdie the grid lines; the default value is the subscript of the current worksheet
+ {Function} [success]: callback function for the end of the operation
- **Explanation**
Hide the grid lines of the specified subscript worksheet, and return the worksheet object of the operation
- **Usage**:
- Hide grid lines of current worksheet
`luckysheet.hideGridLines()`
- Hide the grid lines of the third worksheet
`luckysheet.hideGridLines({order:2})`
------------
## Workbook operations
### create(options [,setting])
@ -2136,7 +2197,23 @@ Use note:
------------
## chart
### refreshFormula([setting])
[todo]
- **Parameter**
- {PlainObject} [setting]: optional parameters
+ {Object | String} [range]: Set the target selection range of the parameter. The supported selection format is `"A1:B2"`, `"sheetName!A1:B2"` or `{row:[0,1], column:[0,1]}`, allows an array of multiple selections; the default is the current selection ;The default is the entire current worksheet
+ {Function} [success]: callback function for the end of the operation
- **Explanation**
Force refresh formula. When you directly modify the values of multiple cells without triggering a refresh, and these cells are associated with formulas, you can use this API to force a formula refresh to be triggered at the end. It is generally recommended to specify the affected cell range to prevent For performance issues, if you can't determine it, leave it blank to keep the entire worksheet traversed and refreshed.
------------
## Chart
### insertChart([setting])

45
docs/guide/config.md

@ -52,7 +52,6 @@ The following are all supported setting parameters
- Billion format [autoFormatw](#autoFormatw)
- Accuracy [accuracy](#accuracy)
- Allow copying [allowCopy](#allowCopy)
- Grid Lines [showGridLines](#showGridLines)
- Toolbar [showtoolbar](#showtoolbar)
- Customize Toolbar [showtoolbarConfig](#showtoolbarConfig)
- Information bar [showinfobar](#showinfobar)
@ -74,6 +73,10 @@ The following are all supported setting parameters
- 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)
- Whether to show the formula bar [sheetFormulaBar](#sheetFormulaBar)
- Initialize the default font size [defaultFontSize](#defaultFontSize)
### container
- Type: String
@ -174,12 +177,6 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
- Default: true
- Usage: Whether to allow copy
------------
### showGridLines
- Type: Number
- Default: 1
- Usage: Whether to display grid lines, `1` means display, `0` means hidden
------------
### showtoolbar
- Type: Boolean
@ -251,7 +248,7 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
- Type: Object
- Default: {}
- Usage: Custom configuration bottom sheet button
- 格式:
- Format:
```json
{
add: false, //Add worksheet
@ -274,7 +271,7 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
- Type: Object
- Default: {}
- Usage: Customize the bottom count bar
- 格式:
- Format:
```json
{
count: false, // Count bar
@ -289,7 +286,7 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
- Type: Object
- Default: {}
- Usage: Add row button and back to top button configuration below the worksheet
- 格式:
- Format:
```json
{
addRow: false, // Add row button
@ -376,7 +373,7 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
- Type: Object
- Default: {}
- Usage: Custom configuration cell right-click menu
- 格式:
- Format:
```json
{
copy: false, //Copy
@ -401,7 +398,7 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
- Type: Object
- Default: {}
- Usage: Customize the right-click menu of the bottom sheet bar
- 格式:
- Format:
```json
{
delete: false, //Delete
@ -414,6 +411,30 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
right: false //Move to the right
}
------------
### showRowBar
- Type: Boolean
- Default: true
- Usage: Whether to show the row number area
------------
### showColumnBar
- Type: Boolean
- Default: true
- Usage: Whether to show the column number area
------------
### sheetFormulaBar
- Type: Boolean
- Default: true
- Usage: Whether to show the formula bar
------------
### defaultFontSize
- Type:Number
- Default:11
- Usage:Initialize the default font size
------------
## Hook Function (TODO)

44
docs/guide/sheet.md

@ -43,6 +43,8 @@ eg: options.data:
"chart": [], //Chart configuration
"allowEdit": true, //is editable
"zoomRatio":1, // zoom ratio
"image":[], //image
"showGridLines": 1, //Whether to show grid lines
},
{
"name": "Sheet2",
@ -1219,6 +1221,48 @@ eg: options.data:
- default:1
- usage: the zoom ratio of a sheet, which is a two decimal digit between 0~1, like `0.1`、`0.56`.
------------
### image
- type:Array
- default:[]
- usage: Insert the picture information in the table, including picture address, width and height, position, cropping and other information
- example:
The following is an example of `imageItem`, usually there may be multiple images in a worksheet, so the format of `image` is array `[imageItem,imageItem,...]`
```json
{
type: '3', //1 Move and resize the cell 2 Move and do not resize the cell 3 Don't move and resize the cell
src:'', //image url
originWidth: 1484, //The original width of the picture
originHeight: 834, //The original height of the picture
default: {
width: 293, //image width
height: 196, //image height
left: 409, //The position of the picture from the left of the table
top: 248, //The position of the picture from the top of the table
},
crop: {
width: 293, //The width of the picture after cropping
height: 196, //The height of the picture after cropping
offsetLeft: 0, //Displacement from the left of the picture after cropping
offsetTop: 0, //Displacement from the left of the picture after cropping
},
isFixedPos: false, //Fixed position
fixedLeft: 507, //Fixed position left displacement
fixedTop: 141, //fixed position right displacement
border: {
width: 0, //border width
radius: 0, //Border radius
style:'solid', //border type
color:'#000', //Border color
}
}
```
------------
### showGridLines
- Type: Number
- Default: 1
- Usage: Whether to show grid lines, `1` means show, `0` means hidden
------------
## debug information

77
docs/zh/guide/api.md

@ -215,6 +215,25 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
------------
### exitEditMode([,setting])
- **参数**
- {PlainObject} [setting]: 可选参数
+ {Function} [success]: 操作结束的回调函数
- **说明**
退出编辑模式。鼠标双击单元格后,会进入单元格编辑模式,编辑完成后,当鼠标再次点击别的地方输入框失焦的时候,则会退出编辑模式,随即单元格的值会进行保存。此Api就是自动退出编辑模式的操作,主要是为了触发自动保存单元格。
- **示例**:
- 手动触发退出编辑模式
`luckysheet.exitEditMode()`
------------
## 行和列操作
### setHorizontalFrozen(isRange [,setting])
@ -1941,6 +1960,48 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
------------
### showGridLines([setting])
- **参数**
- {PlainObject} [setting]: 可选参数
+ {Number} [order]: 需要显示网格线的工作表下标;默认值为当前工作表下标
+ {Function} [success]: 操作结束的回调函数
- **说明**
显示指定下标工作表的网格线,返回操作的工作表对象
- **示例**:
- 显示当前工作表的网格线
`luckysheet.showGridLines()`
- 显示第三个工作表的网格线
`luckysheet.showGridLines({order:2})`
------------
### hideGridLines([setting])
- **参数**
- {PlainObject} [setting]: 可选参数
+ {Number} [order]: 需要隐藏网格线的工作表下标;默认值为当前工作表下标
+ {Function} [success]: 操作结束的回调函数
- **说明**
隐藏指定下标工作表的网格线,返回操作的工作表对象
- **示例**:
- 隐藏当前工作表的网格线
`luckysheet.hideGridLines()`
- 隐藏第三个工作表的网格线
`luckysheet.hideGridLines({order:2})`
------------
## 工作簿操作
### create(options [,setting])
@ -2083,6 +2144,22 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
------------
### refreshFormula([setting])
[todo]
- **参数**
- {PlainObject} [setting]: 可选参数
+ {Object | String} [range]: 选区范围,支持选区的格式为`"A1:B2"`、`"sheetName!A1:B2"`或者`{row:[0,1],column:[0,1]}`,只能为单个选区;默认为整个当前工作表
+ {Function} [success]: 操作结束的回调函数
- **说明**
强制刷新公式。当你直接修改了多个单元格的值,且没有触发刷新,且这些单元格跟公式相关联,则可以使用这个api最后强制触发一次公式刷新,一般是建议指定受影响的单元格范围便于防止性能问题,如果无法确定,则留空保持整个工作表遍历刷新。
------------
## 图表
### insertChart([setting])

35
docs/zh/guide/config.md

@ -53,7 +53,6 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- 亿万格式 [autoFormatw](#autoFormatw)
- 精度 [accuracy](#accuracy)
- 允许复制 [allowCopy](#allowCopy)
- 网格线 [showGridLines](#showGridLines)
- 工具栏 [showtoolbar](#showtoolbar)
- 自定义工具栏[showtoolbarConfig](#showtoolbarConfig)
- 信息栏 [showinfobar](#showinfobar)
@ -75,6 +74,10 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- 刷新公式 [forceCalculation](#forceCalculation)
- 自定义单元格右键菜单 [cellRightClickConfig](#cellRightClickConfig)
- 自定义sheet页右击菜单 [sheetRightClickConfig](#sheetRightClickConfig)
- 是否显示行号区域 [showRowBar](#showRowBar)
- 是否显示列号区域 [showColumnBar](#showColumnBar)
- 是否显示公式栏 [sheetFormulaBar](#sheetFormulaBar)
- 初始化默认字体大小 [defaultFontSize](#defaultFontSize)
### container
- 类型:String
@ -175,12 +178,6 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- 默认值:true
- 作用:是否允许拷贝
------------
### showGridLines
- 类型:Number
- 默认值:1
- 作用:是否显示网格线,`1`表示显示,`0`表示隐藏
------------
### showtoolbar
- 类型:Boolean
@ -415,6 +412,30 @@ Luckysheet开放了更细致的自定义配置选项,分别有
right: false //向右移
}
------------
### showRowBar
- 类型:Boolean
- 默认值:true
- 作用:是否显示行号区域
------------
### showColumnBar
- 类型:Boolean
- 默认值:true
- 作用:是否显示列号区域
------------
### sheetFormulaBar
- 类型:Boolean
- 默认值:true
- 作用:是否显示公示栏
------------
### defaultFontSize
- 类型:Number
- 默认值:11
- 作用:初始化默认字体大小
------------
## 钩子函数(TODO)

6
docs/zh/guide/sheet.md

@ -44,6 +44,7 @@ options.data示例如下:
"allowEdit": true, //是否允许编辑
"zoomRatio":1, // 缩放比例
"image":[], //图片
"showGridLines": 1, //是否显示网格线
},
{
"name": "Sheet2",
@ -1260,7 +1261,12 @@ options.data示例如下:
}
```
------------
### showGridLines
- 类型:Number
- 默认值:1
- 作用:是否显示网格线,`1`表示显示,`0`表示隐藏
------------
## 调试信息
初始化所需要的参数,会从简洁的角度出发来考虑设计,但是本地存储的参数则不同。

3
gulpfile.js

@ -183,7 +183,8 @@ async function core() {
file: 'dist/luckysheet.esm.js',
format: 'esm',
name: 'luckysheet',
sourcemap: true
sourcemap: true,
inlineDynamicImports:true,
});
}

Loading…
Cancel
Save