From 7f29095a4f951a9523ebf1e446b20840c038f8a6 Mon Sep 17 00:00:00 2001 From: woodyjang Date: Sun, 3 Sep 2017 21:16:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E5=90=88=E6=8E=A7=E4=BB=B6fineUI?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=9A=84=E7=BC=96=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uidoc/core/combination/bi.combo.md | 19 +----- uidoc/core/combination/bi.expander.md | 40 +++++++++++- uidoc/core/combination/group_combo.md | 33 +++++++++- uidoc/core/combination/loader.md | 49 ++++++++++++++- uidoc/core/combination/navigation.md | 73 +++++++++++++++++++++- uidoc/core/combination/searcher.md | 89 ++++++++++++++++++++++++++- uidoc/core/widget.md | 5 +- 7 files changed, 284 insertions(+), 24 deletions(-) diff --git a/uidoc/core/combination/bi.combo.md b/uidoc/core/combination/bi.combo.md index 6d092bdee..37c82c36f 100644 --- a/uidoc/core/combination/bi.combo.md +++ b/uidoc/core/combination/bi.combo.md @@ -3,7 +3,7 @@ ## combo,基类[BI.Widget](/core/widget.md) {% method %} -[source]() +[source](https://jsfiddle.net/fineui/wxykkjou/) {% common %} ```javascript @@ -17,20 +17,7 @@ BI.createWidget({ text: "测试", height: 25 }, - popup: { - el: { - type: "bi.button_group", - items: BI.makeArray(100, { - type: "bi.text_item", - height: 25, - text: "item" - }), - layouts: [{ - type: "bi.vertical" - }] - }, - maxHeight: 300 - } + popup: {} }); @@ -46,7 +33,7 @@ BI.createWidget({ | trigger | 事件类型 | string | | "click" | | toggle | 切换状态 | boolean | true,false | true | | direction | combo弹出层位置 | string | top,bottom,left,right,(top,left),(top,right),(bottom,left),(bottom,right) | "bottom"| -| isDefaultInit | 是否默认初始化 |boolean | true,false | false | +| isDefaultInit | 是否默认初始化子节点 |boolean | true,false | false | | destroyWhenHide | 隐藏弹窗层是否销毁 | boolean | true,false | false | | isNeedAdjustHeight | 是否需要高度调整 | boolean | true,false | true | | isNeedAdjustWidth | 是否需要宽度调整 | boolean | true,false | true | diff --git a/uidoc/core/combination/bi.expander.md b/uidoc/core/combination/bi.expander.md index 6e5bb09da..b30d681f1 100644 --- a/uidoc/core/combination/bi.expander.md +++ b/uidoc/core/combination/bi.expander.md @@ -1,2 +1,40 @@ -# expander +# bi.expander + +## 某个可以展开的节点,基类[BI.Widget](/core/widget.md) + + +## API +##### 基础属性 +| 参数 | 说明 | 类型 | 可选值 | 默认值 +| :------ |:------------- | :-----| :----|:---- +| trigger | 事件类型 | string | | "click" | +| toggle | 切换状态 | boolean | true,false | true | +| direction | combo弹出层位置 | string | top,bottom,left,right,(top,left),(top,right),(bottom,left),(bottom,right) | "bottom"| +| isDefaultInit | 是否默认初始化子节点 |boolean | true,false | false | +| el | 开启弹出层的元素 | object | — |{ }| +| popup | 弹出层 | object | — | { }| +| expanderClass | | string | | "bi-expander-popup" | +| hoverClass | | string | | "bi-expander-hover" | + + + +## 对外方法 +| 名称 | 说明 | 回调参数 +| :------ |:------------- | :----- +| populate | 刷新列表 | items | +| setValue | 设置combo value值| v | +| getValue | 获取combo value值 | —| +| isViewVisible | 弹窗层是否可见 | —| +| showView | || +| hideView ||| +| getView ||| +| getAllLeaves | 获取所有的叶子节点 | —| +| getNodeById | 根据id获取节点 | id | +| getNodeByValue | 根据value值获取节点 | value | +| isExpanded | 节点是否展开 | | +| destroy | 销毁组件| — | + + +--- + diff --git a/uidoc/core/combination/group_combo.md b/uidoc/core/combination/group_combo.md index 7f514844b..dc1998ab5 100644 --- a/uidoc/core/combination/group_combo.md +++ b/uidoc/core/combination/group_combo.md @@ -1,2 +1,33 @@ -# group_combo +# bi.combo_group + +## 基类[BI.Widget](/core/widget.md) + + +## API +##### 基础属性 +| 参数 | 说明 | 类型 | 可选值 | 默认值 +| :------ |:------------- | :-----| :----|:---- +| trigger | 事件类型 | string | | "click,hover" | +| direction | combo弹出层位置 | string | top,bottom,left,right,(top,left),(top,right),(bottom,left),(bottom,right) | "right"| +| childern | 子组件 | array | — | [ ] | +| el | 开启弹出层的元素 | object | — | {type: "bi.text_button", text: "", value: ""}| +| popup | 弹出层 | object | — |{el: {type: "bi.button_tree",chooseType: 0,layouts: [{type: "bi.vertical"}]}}| +| isDefaultInit | 是否默认初始化子节点 |boolean | true,false | false | +| isNeedAdjustHeight | 是否需要高度调整 | boolean | true,false | false | +| isNeedAdjustWidth | 是否需要宽度调整 | boolean | true,false | false | +| adjustLength | 调整的距离 | number | — | 0 | + + + +## 对外方法 +| 名称 | 说明 | 回调参数 +| :------ |:------------- | :----- +| populate | 刷新列表 | items | +| setValue | 设置combo value值| v | +| getValue | 获取combo value值 | — | + + + +--- + diff --git a/uidoc/core/combination/loader.md b/uidoc/core/combination/loader.md index c0db04505..acbd8a96e 100644 --- a/uidoc/core/combination/loader.md +++ b/uidoc/core/combination/loader.md @@ -1,2 +1,49 @@ -# loader +# bi.loader + +## 加载控件,[BI.Widget](/core/widget.md) + + +## API +##### 基础属性 +| 参数 | 说明 | 类型 | 可选值 | 默认值 +| :------ |:------------- | :-----| :----|:---- +| direction | combo弹出层位置 | string | top,bottom,left,right,(top,left),(top,right),(bottom,left),(bottom,right) | "top"| +| isDefaultInit | 是否默认初始化子数据 |boolean | true,false | true | +| logic | | object | | {dynamic:true,scrolly:true} | +| items| | array | | []| +| itemsCreator | | function | | — | +| onLoaded | | function | | — | +| count | 是否显示总页数 | boolean| true,false|boolean| +| prev | 上一页 | boolean | true,false | boolean | +| next | 下一页 | boolean | true,false | boolean | +| hasPrev | 判断是否有上一页 | function | | — | +| hasNext | 判断是否有下一页 | function | | — | + + + +## 对外方法 +| 名称 | 说明 | 回调参数 +| :------ |:------------- | :----- +| hasNext | 判断是否有下一页 | — | +| prependItems | 内部前插入 | items | +| addItems | 内部后插入 | items | +| populate | 刷新列表 | items | +| setNotSelectedValue| 设置未被选中的值 | value,可以是单个值也可以是个数组| +| setValue | 设置value值 | value,可以是单个值也可以是个数组 | +| getNotSelectedValue | 获取没有被选中的值 | —| +| getValue | 获取被选中的值 |—| +| getAllButtons | 获取所有button |—| +| getAllLeaves | 获取所有的叶子节点 | —| +| getSelectedButtons | 获取所有被选中的元素 | —| +| getNotSelectedButtons | 获取所有未被选中的元素 | —| +| getIndexByValue | 根据value值获取value在数组中的索引 | value| +| getNodeById | 根据id获取节点 | id | +| getNodeByValue | 根据value值获取节点 | value | +| empty| 清空组件|—| +| destroy| 销毁组件|—| + + + +--- + diff --git a/uidoc/core/combination/navigation.md b/uidoc/core/combination/navigation.md index 6ae162e9d..7d35801f8 100644 --- a/uidoc/core/combination/navigation.md +++ b/uidoc/core/combination/navigation.md @@ -1,2 +1,73 @@ -# navigation +# bi.navigation + +## 导航栏控件,[BI.Widget](/core/widget.md) + +{% method %} +[source](https://jsfiddle.net/fineui/kau5pjm8/) + +{% common %} +```javascript + +BI.createWidget({ + type: "bi.navigation", + element: "body", + height:30, + tab: { + height: 30, + items: [{ + once: false, + text: "后退", + value: -1, + cls: "mvc-button layout-bg3" + },{ + once: false, + text: "前进", + value: 1, + cls: "mvc-button layout-bg4" + }] + }, +}) + + + +``` + +{% endmethod %} + +## API +##### 基础属性 +| 参数 | 说明 | 类型 | 可选值 | 默认值 +| :------ |:------------- | :-----| :----|:---- +| direction | 控件位置 | string | top,bottom,left,right,custom | "bottom"| +| single | | boolean | true,false | true | +| defaultShowIndex | |boolean | true,false | true | +| tab | |boolean | true,false | true | +| defaultShowIndex ||||| +| logic | | object | | {dynamic:true} | +| cardCreator | | function | | v | +| afterCardCreated | | | | — | +| afterCardShow | | | | — | + + + +## 对外方法 +| 名称 | 说明 | 回调参数 +| :------ |:------------- | :----- +| render | 渲染组件 | — | +| mounted | 挂载组件 | —| +| afterCardCreated | | v | +| afterCardShow | | v | +| setSelect | 设置选中的index | v | +| getSelect | 获取选中的index| —| +| getSelectedCard | | —| +| populate | 刷新列表 | items | +| setValue | 设置value值 | value | +| getValue | 获取被选中的值 |—| +| empty| 清空组件|—| +| destroy| 销毁组件|—| + + + +--- + diff --git a/uidoc/core/combination/searcher.md b/uidoc/core/combination/searcher.md index 9cbd8bb15..6045d84fd 100644 --- a/uidoc/core/combination/searcher.md +++ b/uidoc/core/combination/searcher.md @@ -1,2 +1,89 @@ -# searcher +# bi.searcher + +## 搜索逻辑控件,[BI.Widget](/core/widget.md) + +{% method %} +[source](https://jsfiddle.net/fineui/k6s24et1/) + +{% common %} +```javascript + +var items = [{ + type: "bi.label", + value: "张三" + }, { + type: "bi.label", + value: "李四" + }]; + var popup = BI.createWidget({ + type: "bi.button_group", + cls: "bi-border", + items: items, + layouts: [{ + type: "bi.vertical" + }] + }); + +BI.createWidget({ + type: "bi.searcher", + element:"#wrapper", + listeners: [{ + eventName: BI.Searcher.EVENT_STOP, + action: function () { + popup.populate(items) + } + }, { + eventName: BI.Searcher.EVENT_PAUSE, + action: function () { + popup.populate(items) + } + }], + adapter: { + getItems: function () { + return items + } + }, + popup: popup, + masker: false + }) + + + +``` + +{% endmethod %} + +## API +##### 基础属性 +| 参数 | 说明 | 类型 | 可选值 | 默认值 +| :------ |:------------- | :-----| :----|:---- +| hgap | 效果相当于容器左右padding值 | number | | 0 | +| vgap | 效果相当于容器上下padding值 | number | | 0 | +| lgap | 效果相当于容器left-padding值 | number | | 0 | +| rgap | 效果相当于容器right-padding值 | number | | 0 | +| tgap | 效果相当于容器top-padding值 | number | | 0 | +| bgap | 效果相当于容器bottom-padding值 | number | | 0 | +| chooseType | 选择类型 | const | | CHOOSE_TYPE_SINGLE | +| isDefaultInit | 是否默认初始化子节点 |boolean | true,false | false | +| isAutoSearch | 是否自动搜索 |boolean | true,false | true | +| isAutoSync | 是否自动同步数据, 即是否保持搜索面板和adapter面板状态值的统一 |boolean | true,false | true | +| onSearch | isAutoSearch为false时启用 | function(op.callback) | | | +| el | 开启弹出层的元素 | object | — | {type: "bi.search_editor"}| +| popup | 弹出层 | object | — |{type: "bi.searcher_view"}| +| adapter | | | | null| +| masker | masker层 | | — | {offset: {}}| + +## 对外方法 +| 名称 | 说明 | 回调参数 +| :------ |:------------- | :----- +| populate | 刷新列表 | result, searchResult, keyword | +| setValue | 设置value值 | value | +| getValue | 获取被选中的值 |—| +| empty| 清空组件|—| +| destroy| 销毁组件|—| + + + +--- + diff --git a/uidoc/core/widget.md b/uidoc/core/widget.md index 3f3b75d16..2c94965e3 100644 --- a/uidoc/core/widget.md +++ b/uidoc/core/widget.md @@ -32,7 +32,8 @@ ## 对外方法 #####(注: fineui2.0引入生命周期后,widget的实现类不需要重写setEnable,setValid等方法,会自动调用子组件的对应方法 -,一些需要在设置状态后做的额外工作可以通过重写_setXXX来实现) +#####,一些需要在设置状态后做的额外工作可以通过重写_setXXX来实现) + | 名称 | 说明 | 回调参数 | :------ |:------------- | :----- | isMounted | 判断组件是否挂载| — | @@ -71,8 +72,6 @@ - - ---