diff --git a/uidoc/.gitignore b/uidoc/.gitignore new file mode 100644 index 000000000..44caa22de --- /dev/null +++ b/uidoc/.gitignore @@ -0,0 +1,13 @@ +.DS_Store +.svn +.sass-cache +.vscode +.tmp +node_modules +bower_components +tmp +dist +archive +archive.zip +*.log +_book \ No newline at end of file diff --git a/uidoc/LICENSE b/uidoc/LICENSE new file mode 100644 index 000000000..8fdf076ab --- /dev/null +++ b/uidoc/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 gittz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/uidoc/README.md b/uidoc/README.md new file mode 100644 index 000000000..c8ed22556 --- /dev/null +++ b/uidoc/README.md @@ -0,0 +1,2 @@ +# FineUIdocs +FineUI的交互、前端以及视觉文档规范 diff --git a/uidoc/SUMMARY.md b/uidoc/SUMMARY.md new file mode 100644 index 000000000..bc7b53ac4 --- /dev/null +++ b/uidoc/SUMMARY.md @@ -0,0 +1,25 @@ +# Summary + +## 总览 +* [文档规范](README.md) + +## 详细控件 +* 按钮组 + * [通用按钮](detailed/bi.button/general.md) + * [带提示的按钮](detailed/bi.button/tooltip.md) +* [单选框](detailed/bi.single_select_item.md) +* [复选框](detailed/bi.multi_select_item.md) +* [node节点](detailed/node.md) +* [segment组件](detailed/bi.segment.md) +* 树形结构 + * [bi.multi_tree_combo](detailed/tree/bi.multi_tree_combo.md) + * [bi.switch_tree](detailed/tree/bi.switch_tree.md) +* 表格 + * [bi.preview_table](detailed/table/bi.preview_table.md) + * [bi.responsive_table](detailed/table/bi.responsive_table.md) + * [bi.excel_table](detailed/table/bi.excel_table.md) +* 文本框控件 + * [bi.text_editor](detailed/text_input/bi.text_editor.md) + * [bi.search_editor](detailed/text_input/bi.search_editor.md) + * [bi.clear_editor](detailed/text_input/bi.clear_editor.md) + diff --git a/uidoc/book.json b/uidoc/book.json new file mode 100644 index 000000000..b3fdd5aea --- /dev/null +++ b/uidoc/book.json @@ -0,0 +1,23 @@ +{ + "plugins": [ + "jsfiddle", + "splitter", + "theme-api" + ], + "pluginsConfig": { + "theme-default": { + "showLevel": true + }, + "jsfiddle": { + "type": "script", + "tabs": [ + "result", + "js", + "html" + ], + "height": "100", + "width": "500", + "fontColor": "00FF00" + } + } +} \ No newline at end of file diff --git a/uidoc/detailed/bi.button/general.md b/uidoc/detailed/bi.button/general.md new file mode 100644 index 000000000..94cb76a4b --- /dev/null +++ b/uidoc/detailed/bi.button/general.md @@ -0,0 +1,2 @@ +# 通用按钮 + diff --git a/uidoc/detailed/bi.button/tooltip.md b/uidoc/detailed/bi.button/tooltip.md new file mode 100644 index 000000000..97e017024 --- /dev/null +++ b/uidoc/detailed/bi.button/tooltip.md @@ -0,0 +1,2 @@ +# 带提示的按钮 + diff --git a/uidoc/detailed/bi.multi_select_item.md b/uidoc/detailed/bi.multi_select_item.md new file mode 100644 index 000000000..562f554c4 --- /dev/null +++ b/uidoc/detailed/bi.multi_select_item.md @@ -0,0 +1,2 @@ +# 复选框 + diff --git a/uidoc/detailed/bi.segment.md b/uidoc/detailed/bi.segment.md new file mode 100644 index 000000000..541ac523f --- /dev/null +++ b/uidoc/detailed/bi.segment.md @@ -0,0 +1,2 @@ +# segment组件 + diff --git a/uidoc/detailed/bi.single_select_item.md b/uidoc/detailed/bi.single_select_item.md new file mode 100644 index 000000000..ff75eac3a --- /dev/null +++ b/uidoc/detailed/bi.single_select_item.md @@ -0,0 +1,2 @@ +# 单选框 + diff --git a/uidoc/detailed/node.md b/uidoc/detailed/node.md new file mode 100644 index 000000000..fb1feee2c --- /dev/null +++ b/uidoc/detailed/node.md @@ -0,0 +1,2 @@ +# node节点 + diff --git a/uidoc/detailed/table/bi.excel_table.md b/uidoc/detailed/table/bi.excel_table.md new file mode 100644 index 000000000..1dea283d5 --- /dev/null +++ b/uidoc/detailed/table/bi.excel_table.md @@ -0,0 +1,57 @@ +# bi.excel_table + +{% method %} +[source](https://jsfiddle.net/fineui/cbmv07g4/) + +{% common %} +```javascript +BI.createWidget({ + type: "bi.excel_table", + element: "#wrapper", + width: 500, + columnSize: [200,200,200,200,200], + items: [ + [{ + type: "bi.label", + cls: "layout-bg1", + text: "第一行第一列" + }, { + type: "bi.label", + cls: "layout-bg2", + text: "第一行第二列" + }], + [{ + type: "bi.label", + cls: "layout-bg3", + text: "第二行第一列" + }, { + type: "bi.label", + cls: "layout-bg4", + text: "第二行第二列" + }] + ] +}); +``` + +{% endmethod %} + +| 参数 | 说明 | 类型 | 默认值 | +| ---------------- | ------------- | -------------------- | ----------------- | +| isNeedResize | 是否需要调整大小 | bool | false | +| isResizeAdapt | 是否调整时自适应 | bool | true | +| isNeedMerge | 是否需要合并单元格 | bool | false | +| mergeCols | 合并的单元格列号 | array | [] | +| mergeRule | 合并规则, 默认相等时合并 | function(row1, row2) | 默认row1 = row2 时合并 | +| columnSize | 单元格宽度集合 | array | [] | +| headerRowSize | 表头高度 | number | 37 | +| footerRowSize | 表尾高度 | number | 37 | +| rowSize | 普通单元格高度 | number | 37 | +| regionColumnSize | | bool | false | +| items | 子组件 | array | [] | + + + + + + + diff --git a/uidoc/detailed/table/bi.preview_table.md b/uidoc/detailed/table/bi.preview_table.md new file mode 100644 index 000000000..1024bd88d --- /dev/null +++ b/uidoc/detailed/table/bi.preview_table.md @@ -0,0 +1,2 @@ +# bi.preview_table + diff --git a/uidoc/detailed/table/bi.responsive_table.md b/uidoc/detailed/table/bi.responsive_table.md new file mode 100644 index 000000000..475b738fe --- /dev/null +++ b/uidoc/detailed/table/bi.responsive_table.md @@ -0,0 +1,2 @@ +# bi.responsive_table + diff --git a/uidoc/detailed/text_input/bi.clear_editor.md b/uidoc/detailed/text_input/bi.clear_editor.md new file mode 100644 index 000000000..2db9d44b4 --- /dev/null +++ b/uidoc/detailed/text_input/bi.clear_editor.md @@ -0,0 +1,42 @@ +# bi.clear_editor + +## 带清除按钮的输入框 + +{% method %} +[source](https://jsfiddle.net/fineui/ppgph3qu/) + +{% common %} +```javascript +BI.createWidget({ + type: 'bi.clear_editor', + cls: "bi-border", + element: '#wrapper', + width: 300, + watermark:"带清除按钮的输入框", +}); +``` + +{% endmethod %} + +##API + +| 参数 | 说明 | 类型 | 可选值 | 默认值 +| :------ |:------------- | :-----| :----|:----| +| hgap | 效果相当于文本框左右padding值 | number | | 4 | +| vgap | 效果相当于文本框上下padding值 | number | | 2 | +| lgap | 效果相当于文本框left-padding值 | number | | 0 | +| rgap | 效果相当于文本框right-padding值 | number | | 0 | +| tgap |效果相当于文本框top-padding值 | number | | 0 | +| bgap | 效果相当于文本框bottom-padding值 | number | | 0 | +| validationChecker | 输入较验函数 |function| | | +| quitChecker | 是否允许退出编辑函数 | function | | | +| mouseOut | | boolean | true,false | false | +| allowBlank | 是否允许空值 | boolean | true,false | false | +| watermark | 文本框placeholder | string | | null | +| value | 文本框默认值 | string | | | +| errorText | 错误提示 | string | | null | +| width | 文本框宽度 | number | | | +| height | 文本框高度 | number | | 30 | + +# + diff --git a/uidoc/detailed/text_input/bi.search_editor.md b/uidoc/detailed/text_input/bi.search_editor.md new file mode 100644 index 000000000..55a91b098 --- /dev/null +++ b/uidoc/detailed/text_input/bi.search_editor.md @@ -0,0 +1,60 @@ + +## bi.search_editor +### 搜索框 + +{% method %} +[source](https://jsfiddle.net/fineui/4a1rLppw/) + +{% common %} +```javascript +BI.createWidget({ + type: 'bi.search_editor', + element: '#wrapper', + width: 300, + watermark:"搜索", +}); +``` + +{% endmethod %} + +## bi.small_search_editor +### 小一号的搜索框 +##### height默认为24 + +{% method %} +[source](https://jsfiddle.net/fineui/wwzza22k/) + +{% common %} +```javascript +BI.createWidget({ + type: 'bi.search_editor', + element: '#wrapper', + width: 300, + watermark:"搜索", +}); +``` + +{% endmethod %} +##API + +| 参数 | 说明 | 类型 | 可选值 | 默认值 +| :------ |:------------- | :-----| :----|:----| +| hgap | 效果相当于文本框左右padding值 | number | | 4 | +| vgap | 效果相当于文本框上下padding值 | number | | 2 | +| lgap | 效果相当于文本框left-padding值 | number | | 0 | +| rgap | 效果相当于文本框right-padding值 | number | | 0 | +| tgap |效果相当于文本框top-padding值 | number | | 0 | +| bgap | 效果相当于文本框bottom-padding值 | number | | 0 | +| validationChecker | 输入较验函数 |function| | | +| quitChecker | 是否允许退出编辑函数 | function | | | +| mouseOut | | boolean | true,false | false | +| allowBlank | 是否允许空值 | boolean | true,false | false | +| watermark | 文本框placeholder | string | | null | +| value | 文本框默认值 | string | | | +| errorText | 错误提示 | string | | null | +| width | 文本框宽度 | number | | | +| height | 文本框高度 | number | | 30 | + +# + + diff --git a/uidoc/detailed/text_input/bi.text_editor.md b/uidoc/detailed/text_input/bi.text_editor.md new file mode 100644 index 000000000..eae568c6b --- /dev/null +++ b/uidoc/detailed/text_input/bi.text_editor.md @@ -0,0 +1,89 @@ +#bi.text_editor +#####通过鼠标或键盘输入字符 + +## 基础用法 + +{% method %} +[source](https://jsfiddle.net/fineui/cna5o200/) + +{% common %} +```javascript +BI.createWidget({ + type: "bi.text_editor", + element: "#wrapper", + width: 200, + height: 30, + watermark:"请输入内容" +}); +``` + +{% endmethod %} + +## 不可为空输入框 + +{% method %} +[source](https://jsfiddle.net/fineui/d7td9tfr/) + +{% common %} +```javascript +BI.createWidget({ + type: "bi.text_editor", + element: "#wrapper", + width: 200, + height: 30, + watermark:"这个不予许空", + value: "这是一个不可为空的输入框", + allowBlank: false, + errorText: "不允许为空" +}); +``` + +{% endmethod %} + +## 可为空输入框 + +{% method %} +[source](https://jsfiddle.net/fineui/kjmyg9ps/) + +{% common %} +```javascript +BI.createWidget({ + type: "bi.text_editor", + element: "#wrapper", + width: 200, + height: 30, + allowBlank: true, + errorText: "不能输入只输入a!", + validationChecker: function (v) { + if (v == "a") { + return false; + } + return true; + }, +}); +``` + +{% endmethod %} + +##API + +| 参数 | 说明 | 类型 | 可选值 | 默认值 +| :------ |:------------- | :-----| :----|:----| +| hgap | 效果相当于文本框左右padding值 | number | | 4 | +| vgap | 效果相当于文本框上下padding值 | number | | 2 | +| lgap | 效果相当于文本框left-padding值 | number | | 0 | +| rgap | 效果相当于文本框right-padding值 | number | | 0 | +| tgap |效果相当于文本框top-padding值 | number | | 0 | +| bgap | 效果相当于文本框bottom-padding值 | number | | 0 | +| validationChecker | 输入较验函数 |function| | | +| quitChecker | 是否允许退出编辑函数 | function | | | +| mouseOut | | boolean | true,false | false | +| allowBlank | 是否允许空值 | boolean | true,false | false | +| watermark | 文本框placeholder | string | | null | +| value | 文本框默认值 | string | | | +| errorText | 错误提示 | string | | null | +| width | 文本框宽度 | number | | | +| height | 文本框高度 | number | | 30 | + +# + diff --git a/uidoc/detailed/tree/bi.multi_tree_combo.md b/uidoc/detailed/tree/bi.multi_tree_combo.md new file mode 100644 index 000000000..821b51b8c --- /dev/null +++ b/uidoc/detailed/tree/bi.multi_tree_combo.md @@ -0,0 +1,2 @@ +# bi.multi_tree_combo + diff --git a/uidoc/detailed/tree/bi.switch_tree.md b/uidoc/detailed/tree/bi.switch_tree.md new file mode 100644 index 000000000..01f9fa009 --- /dev/null +++ b/uidoc/detailed/tree/bi.switch_tree.md @@ -0,0 +1,2 @@ +# bi.switch_tree + diff --git a/uidoc/gh.js b/uidoc/gh.js new file mode 100644 index 000000000..d77110a6a --- /dev/null +++ b/uidoc/gh.js @@ -0,0 +1,5 @@ +const gh = require('gh-pages'); + +gh.publish('_book', () => { + console.info('upload successfully'); +}); \ No newline at end of file diff --git a/uidoc/package.json b/uidoc/package.json new file mode 100644 index 000000000..c205aa179 --- /dev/null +++ b/uidoc/package.json @@ -0,0 +1,30 @@ +{ + "name": "fineuidocs", + "version": "1.0.0", + "description": "FineUI的交互、前端以及视觉文档规范", + "main": "index.js", + "scripts": { + "init": "gitbook init", + "serve": "gitbook serve", + "build": "gitbook build", + "gh": "gitbook build && node gh" + }, + "repository": { + "type": "git", + "url": "git+https://gittz@github.com/gittz/FineUIdocs.git" + }, + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/gittz/FineUIdocs/issues" + }, + "homepage": "https://github.com/gittz/FineUIdocs#readme", + "devDependencies": { + "gh-pages": "^1.0.0", + "gitbook-cli": "^2.3.2", + "gitbook-plugin-jsfiddle": "^1.0.0", + "gitbook-plugin-splitter": "0.0.8", + "gitbook-plugin-theme-api": "^1.1.2", + "gitbook-plugin-toggle-chapters": "0.0.3" + } +}