From d607fbcd6dcc42c1f67b6b897c16620986312cd6 Mon Sep 17 00:00:00 2001 From: liurunze <1414556676@qq.com> Date: Fri, 24 Jul 2020 15:45:44 +0800 Subject: [PATCH] docs(readme): readme,sparkline demo readme --- README-zh.md | 38 +- README.md | 18 +- src/controllers/handler.js | 4 +- src/controllers/sheetmanage.js | 2 +- src/demoData/sheetComment.js | 4 +- src/demoData/sheetFormula.js | 282 ++++++++++ src/demoData/sheetPivotTable.js | 4 +- src/demoData/sheetPivotTableData.js | 4 +- src/demoData/sheetSparkline.js | 790 ++++++++++++++++++++++++++++ src/index.html | 5 +- src/index.js | 4 +- src/plugins/js/jquery-ui.min.js | 2 +- 12 files changed, 1121 insertions(+), 36 deletions(-) create mode 100644 src/demoData/sheetSparkline.js diff --git a/README-zh.md b/README-zh.md index 4814428..2c5fe4d 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,10 +1,10 @@ # Luckysheet 简体中文 | [English](./README.md) -## Introduction - 介绍 +## 介绍 Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。 -## Features - 特性 +## 特性 1. Luckysheet支持表格设置包括冻结行列、合并单元格、筛选、排序、查询、条件格式、批注 2. 支持数据分析功能包括透视表、图表、分列、矩阵操作、内置385个计算函数 3. 支持一键截图、复制为json数据、共享编辑、excel与Luckysheet之间数据的复制粘贴 @@ -15,28 +15,32 @@ Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置 ![演示](https://minio.cnbabylon.com/public/luckysheet/LuckysheetDemo.gif) -## Plan - 计划 -- 模块化(进行中) -- excel导入/导出 -- 表单 +## 计划 +- 完善图表插件 - 插入图片 +- 数据验证(复选框、下拉列表) +- 打印 +- 单元格分段样式 +- 树形菜单 +- 表格功能:筛选,切片 +- excel导入/导出 - 更多... -## Documentation - 文档 +## 文档 [在线demo](https://mengshukeji.github.io/LuckysheetDemo/) [在线文档](https://mengshukeji.github.io/LuckysheetDocs/) -## Requirements - 环境 +## 环境 [Node.js](https://nodejs.org/en/) Version >= 6 -## Installation - 安装 +## 安装 ``` npm install npm install gulp -g ``` -## Development - 开发 +## 开发 开发 ``` npm run dev @@ -49,7 +53,7 @@ npm run build Luckysheet的核心代码为luckysheet-core.js和luckysheet-function.js,开发者看源码只需要看这两个文件即可,接下来会讨论进行模块化方案,完善这个插件. -## Usage - 用法 +## 用法 #### 第一步 `npm run build`后`dist`文件夹下的所有文件复制到项目目录 @@ -82,10 +86,10 @@ Luckysheet的核心代码为luckysheet-core.js和luckysheet-function.js,开发 ``` -## Contact - 联系 +## 联系 mengshu@office2.cn -## communication - 交流 +## 交流 - 添加小编微信,拉你进Luckysheet开发者交流微信群,备注:加群 @@ -97,11 +101,11 @@ mengshu@office2.cn 微信群 -## Authors and acknowledgment - 贡献者和感谢 -- Bug Pan ([@wpxp123456](https://github.com/wpxp123456)) -- Dushusir ([@Dushusir](https://github.com/Dushusir)) +## 贡献者和感谢 +- [@wpxp123456](https://github.com/wpxp123456) +- [@Dushusir](https://github.com/Dushusir) -## License - 版权信息 +## 版权信息 [MIT](http://opensource.org/licenses/MIT) Copyright (c) 2020-present, mengshukeji diff --git a/README.md b/README.md index 0745dd9..383c666 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Luckysheet +[![Join the chat at https://gitter.im/mengshukeji/Luckysheet](https://badges.gitter.im/mengshukeji/Luckysheet.svg)](https://gitter.im/mengshukeji/Luckysheet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + English| [简体中文](./README-zh.md) ## Introduction @@ -17,10 +19,14 @@ Luckysheet is an online spreadsheet like excel that is powerful, simple to confi ![Demo](https://minio.cnbabylon.com/public/luckysheet/LuckysheetDemo.gif) ## Plan -- modularization (in progress) -- Excel import/export -- Form +- Improve chart plugin - Insert picture +- Data validation (checkbox, drop-down list) +- Print +- Cell segmentation style +- Tree menu +- Table function: filter, slice +- Excel import/export - More... ## Documentation @@ -88,11 +94,11 @@ mengshu@office2.cn ## communication -coming soon! +- [Gitter](https://gitter.im/mengshukeji/Luckysheet) ## Authors and acknowledgment -- Bug Pan ([@wpxp123456](https://github.com/wpxp123456)) -- Dushusir ([@Dushusir](https://github.com/Dushusir)) +- [@wpxp123456](https://github.com/wpxp123456) +- [@Dushusir](https://github.com/Dushusir) ## License [MIT](http://opensource.org/licenses/MIT) diff --git a/src/controllers/handler.js b/src/controllers/handler.js index fc4f627..cb535bc 100644 --- a/src/controllers/handler.js +++ b/src/controllers/handler.js @@ -6651,8 +6651,8 @@ export default function luckysheetHandler() { }); $("#luckysheetsheetconfigmoveleft").click(function () { - if (luckysheetcurrentSheetitem.prevAll(":visible").length > 0) { - luckysheetcurrentSheetitem.insertBefore(luckysheetcurrentSheetitem.prevAll(":visible").eq(0)); + if (luckysheetcurrentSheetitem.preval(":visible").length > 0) { + luckysheetcurrentSheetitem.insertBefore(luckysheetcurrentSheetitem.preval(":visible").eq(0)); sheetmanage.reOrderAllSheet(); } $("#luckysheet-input-box").removeAttr("style"); diff --git a/src/controllers/sheetmanage.js b/src/controllers/sheetmanage.js index be96af3..f928cc3 100644 --- a/src/controllers/sheetmanage.js +++ b/src/controllers/sheetmanage.js @@ -228,7 +228,7 @@ const sheetmanage = { indicator = indicator.eq(0).data("index"); } else { - indicator = luckysheetcurrentSheetitem.prevAll(":visible").eq(0).data("index"); + indicator = luckysheetcurrentSheetitem.preval(":visible").eq(0).data("index"); } $("#luckysheet-sheets-item" + indicator).addClass("luckysheet-sheets-item-active"); diff --git a/src/demoData/sheetComment.js b/src/demoData/sheetComment.js index f641700..f17c584 100644 --- a/src/demoData/sheetComment.js +++ b/src/demoData/sheetComment.js @@ -6,7 +6,7 @@ const sheetComment = { "2": 102 } }, - "index": "4", + "index": "5", "chart": [{ "sheetIndex": "0", "dataSheetIndex": "0", @@ -20,7 +20,7 @@ const sheetComment = { "myTop": "11" }], "status": "0", - "order": "4", + "order": "5", "column": 18, "row": 36, "celldata": [{ diff --git a/src/demoData/sheetFormula.js b/src/demoData/sheetFormula.js index b896b7e..804e48c 100644 --- a/src/demoData/sheetFormula.js +++ b/src/demoData/sheetFormula.js @@ -6928,6 +6928,288 @@ const sheetFormula = { "c": 10, "v": {} }], + "calcChain":[ + { + "r": 6, + "c": 3, + "index": 1, + "func": [ + true, + 23.75, + "=AVERAGE(D3:D6)" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 7, + "c": 3, + "index": 1, + "func": [ + true, + 30, + "=MAX(D3:D6)" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 8, + "c": 3, + "index": 1, + "func": [ + true, + 17, + "=MIN(D3:D6)" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 5, + "c": 9, + "index": 1, + "func": [ + true, + "J2", + "=INDIRECT(\"I2\")" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 6, + "c": 9, + "index": 1, + "func": [ + true, + 1, + "=INDIRECT(I2)" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 7, + "c": 9, + "index": 1, + "func": [ + true, + "I", + "=INDIRECT(\"I\"&(1+2))" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 8, + "c": 9, + "index": 1, + "func": [ + true, + 1, + "=INDIRECT(I4&J3)" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 9, + "c": 9, + "index": 1, + "func": [ + true, + "#REF!", + "=INDIRECT(\"Formula!\"&I2)" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 10, + "c": 9, + "index": 1, + "func": [ + true, + "#REF!", + "=INDIRECT(\"Formula!I2\")" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 14, + "c": 7, + "index": 1, + "func": [ + true, + 207, + "=SUBTOTAL(9,OFFSET($D$15,ROW($D$15:$D$18)-ROW($D$15),1,3))" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 15, + "c": 7, + "index": 1, + "func": [ + true, + 182, + "=SUBTOTAL(9,OFFSET(E15,ROW(E15:E18)-ROW(E15),1,3))" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 16, + "c": 7, + "index": 1, + "func": [ + true, + 152, + "=SUBTOTAL(9,OFFSET(F15,ROW(F15:F18)-ROW(F15),1,3))" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 17, + "c": 7, + "index": 1, + "func": [ + true, + 541, + "=SUBTOTAL(9,OFFSET(G15,ROW(G15:G18)-ROW(G15),1,3))" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 22, + "c": 8, + "index": 1, + "func": [ + true, + "#NAME?", + "=INDEX(D21:D25,MATCH(TRUE,ISNA(MATCH(D21:D25,C21:C27,0)),0))" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 23, + "c": 8, + "index": 1, + "func": [ + true, + "#NAME?", + "=INDEX(D21:D25,MATCH(TRUE,ISNA(MATCH(D21:D25,C21:C27,0)),0))" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 38, + "c": 6, + "index": 1, + "func": [ + true, + 1, + "=SUM(IF((C31:C39=\"Fax\")+(D31:D39=\"Jones\")<>2,1,0))" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 30, + "c": 6, + "index": 1, + "func": [ + true, + "#NAME?", + "=SUM((C31:C39=\"Fax\")*(D31:D39=\"Brown\")*(E31:E39))" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 32, + "c": 6, + "index": 1, + "func": [ + true, + "#NAME?", + "=SUM((C31:C39=\"Fax\")*(D31:D39=\"Brown\"))" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 34, + "c": 6, + "index": 1, + "func": [ + true, + 1, + "=SUM(IF((C31:C39=\"Fax\")+(D31:D39=\"Jones\"),1,0))" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 36, + "c": 6, + "index": 1, + "func": [ + true, + 1, + "=SUM(IF(MOD((C31:C39=\"Fax\")+(D31:D39=\"Jones\"),2),1,0))" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + } + ], "visibledatarow": [], "visibledatacolumn": [], "rowsplit": [], diff --git a/src/demoData/sheetPivotTable.js b/src/demoData/sheetPivotTable.js index ca25551..ef0946d 100644 --- a/src/demoData/sheetPivotTable.js +++ b/src/demoData/sheetPivotTable.js @@ -2,7 +2,7 @@ const sheetPivotTable = { "name": "PivotTable", "color": "", "config": {}, - "index": "6", + "index": "7", "chart": [{ "sheetIndex": "0", "dataSheetIndex": "0", @@ -16,7 +16,7 @@ const sheetPivotTable = { "myTop": "11" }], "status": "0", - "order": "6", + "order": "7", "column": 18, "row": 36, "celldata": [{ diff --git a/src/demoData/sheetPivotTableData.js b/src/demoData/sheetPivotTableData.js index f6adef7..d3fb2ba 100644 --- a/src/demoData/sheetPivotTableData.js +++ b/src/demoData/sheetPivotTableData.js @@ -4,7 +4,7 @@ const sheetPivotTableData = { "config": { "merge": {} }, - "index": "5", + "index": "6", "chart": [{ "sheetIndex": "0", "dataSheetIndex": "0", @@ -18,7 +18,7 @@ const sheetPivotTableData = { "myTop": "11" }], "status": "0", - "order": "5", + "order": "6", "hide": 1, "column": 18, "row": 36, diff --git a/src/demoData/sheetSparkline.js b/src/demoData/sheetSparkline.js new file mode 100644 index 0000000..b19db34 --- /dev/null +++ b/src/demoData/sheetSparkline.js @@ -0,0 +1,790 @@ +const sheetSparkline = { + "name": "Sparkline", + "color": "", + "config": { + "merge": { + "1_2": { + "r": 1, + "c": 2, + "rs": 1, + "cs": 2 + }, + "1_4": { + "r": 1, + "c": 4, + "rs": 1, + "cs": 2 + }, + "0_0": { + "r": 0, + "c": 0, + "rs": 1, + "cs": 6 + }, + "2_2": { + "r": 2, + "c": 2, + "rs": 3, + "cs": 2 + }, + "2_4": { + "r": 2, + "c": 4, + "rs": 3, + "cs": 2 + } + }, + "rowlen": { + "0": 25 + }, + "columlen": { + "0": 101 + } + }, + "index": 4, + "chart": [ + { + "sheetIndex": "0", + "dataSheetIndex": "0", + "chartType": "column", + "row": "[1,3]", + "column": "[3,3]", + "chartStyle": "default", + "myWidth": "480", + "myHeight": "288", + "myLeft": "67", + "myTop": "11" + } + ], + "status": "0", + "order": 4, + "column": 18, + "row": 36, + "celldata": [ + { + "r": 0, + "c": 0, + "v": { + "v": "The company revenue in 2014", + "ct": { + "fa": "General", + "t": "g" + }, + "m": "The company revenue in 2014", + "mc": { + "r": 0, + "c": 0, + "rs": 1, + "cs": 6 + }, + "fs": "14", + "ht": "0", + "vt": "0" + } + }, + { + "r": 0, + "c": 1, + "v": { + "mc": { + "r": 0, + "c": 0 + }, + "fs": "14", + "ht": "0", + "vt": "0" + } + }, + { + "r": 0, + "c": 2, + "v": { + "mc": { + "r": 0, + "c": 0 + }, + "fs": "14", + "ht": "0", + "vt": "0" + } + }, + { + "r": 0, + "c": 3, + "v": { + "mc": { + "r": 0, + "c": 0 + }, + "fs": "14", + "ht": "0", + "vt": "0" + } + }, + { + "r": 0, + "c": 4, + "v": { + "mc": { + "r": 0, + "c": 0 + }, + "fs": "14", + "ht": "0", + "vt": "0" + } + }, + { + "r": 0, + "c": 5, + "v": { + "mc": { + "r": 0, + "c": 0 + }, + "fs": "14", + "ht": "0", + "vt": "0" + } + }, + { + "r": 1, + "c": 0, + "v": { + "m": "Month", + "ct": { + "fa": "General", + "t": "g" + }, + "v": "Month", + "bg": "#f1c232", + "fc": "#ffffff", + "ht": "0", + "vt": "0" + } + }, + { + "r": 1, + "c": 1, + "v": { + "m": "Revenue", + "ct": { + "fa": "General", + "t": "g" + }, + "v": "Revenue", + "bg": "#f1c232", + "fc": "#ffffff", + "ht": "0", + "vt": "0" + } + }, + { + "r": 1, + "c": 2, + "v": { + "m": "Diagram 1", + "ct": { + "fa": "General", + "t": "g" + }, + "v": "Diagram 1", + "mc": { + "r": 1, + "c": 2, + "rs": 1, + "cs": 2 + }, + "bg": "#f1c232", + "fc": "#ffffff", + "ht": "0", + "vt": "0" + } + }, + { + "r": 1, + "c": 3, + "v": { + "mc": { + "r": 1, + "c": 2 + }, + "bg": "#f1c232", + "fc": "#ffffff", + "ht": "0", + "vt": "0" + } + }, + { + "r": 1, + "c": 4, + "v": { + "m": "Diagram 2", + "ct": { + "fa": "General", + "t": "g" + }, + "v": "Diagram 2", + "mc": { + "r": 1, + "c": 4, + "rs": 1, + "cs": 2 + }, + "bg": "#f1c232", + "fc": "#ffffff", + "ht": "0", + "vt": "0" + } + }, + { + "r": 1, + "c": 5, + "v": { + "mc": { + "r": 1, + "c": 4 + }, + "bg": "#f1c232", + "fc": "#ffffff", + "ht": "0", + "vt": "0" + } + }, + { + "r": 2, + "c": 0, + "v": { + "m": "2014-02-01", + "ct": { + "fa": "yyyy-MM-dd", + "t": "d" + }, + "v": 41671 + } + }, + { + "r": 2, + "c": 1, + "v": { + "v": 30, + "ct": { + "fa": "General", + "t": "n" + }, + "m": "30", + "ht": "0", + "vt": "0" + } + }, + { + "r": 2, + "c": 2, + "v": { + "mc": { + "r": 2, + "c": 2, + "rs": 3, + "cs": 2 + }, + "f": "=LINESPLINES(B3:B5,'pink',4,'avg','yellow','red','green',3)", + "spl": { + "shapes": { + "0": { + "id": 0, + "type": "Shape", + "args": [ + 0, + [ + [ + 0, + 20 + ], + [ + 0, + 20 + ], + [ + 72, + 51 + ], + [ + 144, + 3 + ] + ], + "pink", + null, + 4 + ] + }, + "1": { + "id": 1, + "type": "Rect", + "args": [ + 1, + 0, + null, + 144, + null, + null, + "yellow" + ] + }, + "2": { + "id": 2, + "type": "Circle", + "args": [ + 2, + 72, + 51, + 3, + null, + "green", + null + ] + }, + "3": { + "id": 3, + "type": "Circle", + "args": [ + 3, + 144, + 3, + 3, + null, + "red", + null + ] + } + }, + "shapeseq": [ + 0, + 1, + 2, + 3 + ], + "offsetX": 0, + "offsetY": 5, + "pixelWidth": 147, + "pixelHeight": 55 + } + } + }, + { + "r": 2, + "c": 3, + "v": { + "mc": { + "r": 2, + "c": 2 + } + } + }, + { + "r": 2, + "c": 4, + "v": { + "mc": { + "r": 2, + "c": 4, + "rs": 3, + "cs": 2 + }, + "f": "=COLUMNSPLINES(B3:B5,35,'red','green','auto','brown')", + "spl": { + "shapes": { + "0": { + "id": 0, + "type": "Rect", + "args": [ + 0, + 98, + 1, + 13, + 28, + "red", + "red" + ] + }, + "1": { + "id": 1, + "type": "Rect", + "args": [ + 1, + 49, + 30, + 13, + 20, + "green", + "green" + ] + }, + "2": { + "id": 2, + "type": "Rect", + "args": [ + 2, + 0, + 20, + 13, + 9, + "brown", + "brown" + ] + } + }, + "shapeseq": [ + 0, + 1, + 2 + ], + "offsetX": 0, + "offsetY": 0, + "pixelWidth": 147, + "pixelHeight": 60 + } + } + }, + { + "r": 2, + "c": 5, + "v": { + "mc": { + "r": 2, + "c": 4 + } + } + }, + { + "r": 3, + "c": 0, + "v": { + "m": "2014-03-01", + "ct": { + "fa": "yyyy-MM-dd", + "t": "d" + }, + "v": 41699 + } + }, + { + "r": 3, + "c": 1, + "v": { + "v": -60, + "ct": { + "fa": "General", + "t": "n" + }, + "m": "-60", + "ht": "0", + "vt": "0" + } + }, + { + "r": 3, + "c": 2, + "v": { + "mc": { + "r": 2, + "c": 2 + } + } + }, + { + "r": 3, + "c": 3, + "v": { + "mc": { + "r": 2, + "c": 2 + } + } + }, + { + "r": 3, + "c": 4, + "v": { + "mc": { + "r": 2, + "c": 4 + } + } + }, + { + "r": 3, + "c": 5, + "v": { + "mc": { + "r": 2, + "c": 4 + } + } + }, + { + "r": 4, + "c": 0, + "v": { + "m": "2014-04-01", + "ct": { + "fa": "yyyy-MM-dd", + "t": "d" + }, + "v": 41730 + } + }, + { + "r": 4, + "c": 1, + "v": { + "v": 80, + "ct": { + "fa": "General", + "t": "n" + }, + "m": "80", + "ht": "0", + "vt": "0" + } + }, + { + "r": 4, + "c": 2, + "v": { + "mc": { + "r": 2, + "c": 2 + } + } + }, + { + "r": 4, + "c": 3, + "v": { + "mc": { + "r": 2, + "c": 2 + } + } + }, + { + "r": 4, + "c": 4, + "v": { + "mc": { + "r": 2, + "c": 4 + } + } + }, + { + "r": 4, + "c": 5, + "v": { + "mc": { + "r": 2, + "c": 4 + } + } + } + ], + "visibledatarow": [ + 26, + 46, + 66, + 86, + 106, + 126, + 146, + 166, + 186, + 206, + 226, + 246, + 266, + 286, + 306, + 326, + 346, + 366, + 386, + 406, + 426, + 446, + 466, + 486, + 506, + 526, + 546, + 566, + 586, + 606, + 626, + 646, + 666, + 686, + 706, + 726, + 746, + 766, + 786, + 806, + 826, + 846, + 866, + 886, + 906, + 926, + 946, + 966, + 986, + 1006, + 1026, + 1046, + 1066, + 1086, + 1106, + 1126, + 1146, + 1166, + 1186, + 1206, + 1226, + 1246, + 1266, + 1286, + 1306, + 1326, + 1346, + 1366, + 1386, + 1406, + 1426, + 1446, + 1466, + 1486, + 1506, + 1526, + 1546, + 1566, + 1586, + 1606, + 1626, + 1646, + 1666, + 1686 + ], + "visibledatacolumn": [ + 102, + 176, + 250, + 324, + 398, + 472, + 546, + 620, + 694, + 768, + 842, + 916, + 990, + 1064, + 1138, + 1212, + 1286, + 1360, + 1434, + 1508, + 1582, + 1656, + 1730, + 1804, + 1878, + 1952, + 2026, + 2100, + 2174, + 2248, + 2322, + 2396, + 2470, + 2544, + 2618, + 2692, + 2766, + 2840, + 2914, + 2988, + 3062, + 3136, + 3210, + 3284, + 3358, + 3432, + 3506, + 3580, + 3654, + 3728, + 3802, + 3876, + 3950, + 4024, + 4098, + 4172, + 4246, + 4320, + 4394, + 4468 + ], + "rowsplit": [], + "ch_width": 4748, + "rh_height": 1790, + "luckysheet_select_save": [ + { + "row": [ + 0, + 0 + ], + "column": [ + 0, + 0 + ] + } + ], + "luckysheet_selection_range": [], + "scrollLeft": 0, + "scrollTop": 0, + "calcChain": [ + { + "r": 2, + "c": 2, + "index": "Sheet_a3wL60hb6ehl_1595574256825", + "func": [ + true, + "", + "=LINESPLINES(B3:B5,'pink',4,'avg','yellow','red','green',3)" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, + { + "r": 2, + "c": 4, + "index": "Sheet_a3wL60hb6ehl_1595574256825", + "func": [ + true, + "", + "=COLUMNSPLINES(B3:B5,35,'red','green','auto','brown')" + ], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + } + ] +} + +export default sheetSparkline; \ No newline at end of file diff --git a/src/index.html b/src/index.html index dfa074d..6836581 100644 --- a/src/index.html +++ b/src/index.html @@ -27,13 +27,14 @@ import sheetComment from './demoData/sheetComment.js' import sheetPivotTableData from './demoData/sheetPivotTableData.js' import sheetPivotTable from './demoData/sheetPivotTable.js' + import sheetSparkline from './demoData/sheetSparkline.js' $(function () { luckysheet.create({ container: 'luckysheet', - lang: 'zh', + lang: 'en', plugins: ['chart'], - data: [sheetCell,sheetFormula,sheetConditionFormat,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable] + data: [sheetCell,sheetFormula,sheetConditionFormat,sheetTable,sheetSparkline,sheetComment,sheetPivotTableData,sheetPivotTable] }) }) diff --git a/src/index.js b/src/index.js index 252759c..2d7e550 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,9 @@ import './utils/math' import { luckysheet } from './core' import __firefox from './utils/polyfill' - +debugger +// Prevent gulp warning: 'Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification' +// window.evall = window.eval; // polyfill event in firefox if(window.addEventListener && (navigator.userAgent.indexOf("Firefox") > 0)){ __firefox(); diff --git a/src/plugins/js/jquery-ui.min.js b/src/plugins/js/jquery-ui.min.js index 8c459fd..2b81c5b 100644 --- a/src/plugins/js/jquery-ui.min.js +++ b/src/plugins/js/jquery-ui.min.js @@ -1 +1 @@ -!function(){var t;t=function(M){M.ui=M.ui||{};M.ui.version="1.12.1";var n,i=0,l=Array.prototype.slice;M.cleanData=(n=M.cleanData,function(t){var e,i,s;for(s=0;null!=(i=t[s]);s++)try{(e=M._data(i,"events"))&&e.remove&&M(i).triggerHandler("remove")}catch(t){}n(t)}),M.widget=function(t,i,e){var s,n,o,a={},l=t.split(".")[0],h=l+"-"+(t=t.split(".")[1]);return e||(e=i,i=M.Widget),M.isArray(e)&&(e=M.extend.apply(null,[{}].concat(e))),M.expr[":"][h.toLowerCase()]=function(t){return!!M.data(t,h)},M[l]=M[l]||{},s=M[l][t],n=M[l][t]=function(t,e){if(!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},M.extend(n,s,{version:e.version,_proto:M.extend({},e),_childConstructors:[]}),(o=new i).options=M.widget.extend({},o.options),M.each(e,function(e,o){M.isFunction(o)?a[e]=function(){function s(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var t,e=this._super,i=this._superApply;return this._super=s,this._superApply=n,t=o.apply(this,arguments),this._super=e,this._superApply=i,t}}():a[e]=o}),n.prototype=M.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},a,{constructor:n,namespace:l,widgetName:t,widgetFullName:h}),s?(M.each(s._childConstructors,function(t,e){var i=e.prototype;M.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),M.widget.bridge(t,n),n},M.widget.extend=function(t){for(var e,i,s=l.call(arguments,1),n=0,o=s.length;n",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=M(e||this.defaultElement||this)[0],this.element=M(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=M(),this.hoverable=M(),this.focusable=M(),this.classesElementLookup={},e!==this&&(M.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=M(e.style?e.ownerDocument:e.document||e),this.window=M(this.document[0].defaultView||this.document[0].parentWindow)),this.options=M.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:M.noop,_create:M.noop,_init:M.noop,destroy:function(){var i=this;this._destroy(),M.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:M.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return M.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=M.widget.extend({},this.options[t]),n=0;n
"),s=i.children()[0];return M("body").append(i),t=s.offsetWidth,i.css("overflow","scroll"),t===(e=s.offsetWidth)&&(e=i[0].clientWidth),i.remove(),n=t-e},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),s="scroll"===e||"auto"===e&&t.widthC(x(s),x(n))?o.important="horizontal":o.important="vertical",c.using.call(this,t,o)}),a.offset(M.extend(u,{using:t}))})},M.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,o=s.width,a=t.left-e.collisionPosition.marginLeft,l=n-a,h=a+e.collisionWidth-o-n;e.collisionWidth>o?0o?0?@[\]^`{|}~])/g,function(t){return t.replace(e,"\\$1")}),M.fn.labels=function(){var t,e,i,s,n;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(s=this.eq(0).parents("label"),(i=this.attr("id"))&&(n=(t=this.eq(0).parents().last()).add(t.length?t.siblings():this.siblings()),e="label[for='"+M.ui.escapeSelector(i)+"']",s=s.add(n.find(e).addBack(e))),this.pushStack(s))},M.fn.extend({uniqueId:(t=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&M(this).removeAttr("id")})}});var e,t,o=/ui-corner-([a-z]){2,6}/g;M.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"
",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var a=this,l=[];M.each(this.options.items,function(n,t){var e,o={};if(t)return"controlgroupLabel"===n?((e=a.element.find(t)).each(function(){var t=M(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("")}),a._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),void(l=l.concat(e.get()))):void(M.fn[n]&&(o=a["_"+n+"Options"]?a["_"+n+"Options"]("middle"):{classes:{}},a.element.find(t).each(function(){var t=M(this),e=t[n]("instance"),i=M.widget.extend({},o);if("button"!==n||!t.parent(".ui-spinner").length){e||(e=t[n]()[n]("instance")),e&&(i.classes=a._resolveClassesValues(i.classes,e)),t[n](i);var s=t[n]("widget");M.data(s[0],"ui-controlgroup-data",e||t[n]("instance")),l.push(s[0])}})))}),this.childWidgets=M(M.unique(l)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=M(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){var i=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,i)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:!!e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return M.each(i,function(t){var e=s.options.classes[t]||"";e=M.trim(e.replace(o,"")),n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var n,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,this.options.onlyVisible&&(n=n.filter(":visible")),n.length&&(M.each(["first","last"],function(t,e){var i=n[e]().data("ui-controlgroup-data");if(i&&o["_"+i.widgetName+"Options"]){var s=o["_"+i.widgetName+"Options"](1===n.length?"only":e);s.classes=o._resolveClassesValues(s.classes,i),i.element[i.widgetName](s)}else o._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}});M.widget("ui.checkboxradio",[M.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e,i=this,s=this._super()||{};return this._readType(),e=this.element.labels(),this.label=M(e[e.length-1]),this.label.length||M.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){i.originalLabel+=3===this.nodeType?M(this).text():this.outerHTML}),this.originalLabel&&(s.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(s.disabled=t),s},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||M.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+M.ui.escapeSelector(t)+"']";return t?(this.form.length?M(this.form[0].elements).filter(e):M(e).filter(function(){return 0===M(this).form().length})).not(this.element):M([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=M(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=M(""),this.iconSpace=M(" "),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);var s;M.ui.checkboxradio;M.widget("ui.button",{version:"1.12.1",defaultElement:"
"),s=i.children()[0];return M("body").append(i),t=s.offsetWidth,i.css("overflow","scroll"),t===(e=s.offsetWidth)&&(e=i[0].clientWidth),i.remove(),n=t-e},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),s="scroll"===e||"auto"===e&&t.widthC(x(s),x(n))?o.important="horizontal":o.important="vertical",c.using.call(this,t,o)}),a.offset(M.extend(u,{using:t}))})},M.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,o=s.width,a=t.left-e.collisionPosition.marginLeft,l=n-a,h=a+e.collisionWidth-o-n;e.collisionWidth>o?0o?0?@[\]^`{|}~])/g,function(t){return t.replace(e,"\\$1")}),M.fn.labels=function(){var t,e,i,s,n;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(s=this.eq(0).parents("label"),(i=this.attr("id"))&&(n=(t=this.eq(0).parents().last()).add(t.length?t.siblings():this.siblings()),e="label[for='"+M.ui.escapeSelector(i)+"']",s=s.add(n.find(e).addBack(e))),this.pushStack(s))},M.fn.extend({uniqueId:(t=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&M(this).removeAttr("id")})}});var e,t,o=/ui-corner-([a-z]){2,6}/g;M.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"
",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var a=this,l=[];M.each(this.options.items,function(n,t){var e,o={};if(t)return"controlgroupLabel"===n?((e=a.element.find(t)).each(function(){var t=M(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("")}),a._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),void(l=l.concat(e.get()))):void(M.fn[n]&&(o=a["_"+n+"Options"]?a["_"+n+"Options"]("middle"):{classes:{}},a.element.find(t).each(function(){var t=M(this),e=t[n]("instance"),i=M.widget.extend({},o);if("button"!==n||!t.parent(".ui-spinner").length){e||(e=t[n]()[n]("instance")),e&&(i.classes=a._resolveClassesValues(i.classes,e)),t[n](i);var s=t[n]("widget");M.data(s[0],"ui-controlgroup-data",e||t[n]("instance")),l.push(s[0])}})))}),this.childWidgets=M(M.unique(l)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=M(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){var i=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,i)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:!!e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return M.each(i,function(t){var e=s.options.classes[t]||"";e=M.trim(e.replace(o,"")),n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var n,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,this.options.onlyVisible&&(n=n.filter(":visible")),n.length&&(M.each(["first","last"],function(t,e){var i=n[e]().data("ui-controlgroup-data");if(i&&o["_"+i.widgetName+"Options"]){var s=o["_"+i.widgetName+"Options"](1===n.length?"only":e);s.classes=o._resolveClassesValues(s.classes,i),i.element[i.widgetName](s)}else o._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}});M.widget("ui.checkboxradio",[M.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e,i=this,s=this._super()||{};return this._readType(),e=this.element.labels(),this.label=M(e[e.length-1]),this.label.length||M.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){i.originalLabel+=3===this.nodeType?M(this).text():this.outerHTML}),this.originalLabel&&(s.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(s.disabled=t),s},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||M.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+M.ui.escapeSelector(t)+"']";return t?(this.form.length?M(this.form[0].elements).filter(e):M(e).filter(function(){return 0===M(this).form().length})).not(this.element):M([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=M(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=M(""),this.iconSpace=M(" "),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);var s;M.ui.checkboxradio;M.widget("ui.button",{version:"1.12.1",defaultElement:"