forked from fanruan/fineui
woodyjang
7 years ago
7 changed files with 284 additions and 24 deletions
@ -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 | 销毁组件| — | |
||||
|
||||
|
||||
--- |
||||
|
||||
|
||||
|
@ -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值 | — | |
||||
|
||||
|
||||
|
||||
--- |
||||
|
||||
|
||||
|
@ -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| 销毁组件|—| |
||||
|
||||
|
||||
|
||||
--- |
||||
|
||||
|
||||
|
@ -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| 销毁组件|—| |
||||
|
||||
|
||||
|
||||
--- |
||||
|
||||
|
||||
|
@ -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| 销毁组件|—| |
||||
|
||||
|
||||
|
||||
--- |
||||
|
||||
|
||||
|
Loading…
Reference in new issue