Browse Source

布局文档以及基础控件文档

es6
WoodyJang 7 years ago
parent
commit
2bd1cdb66d
  1. 40
      uidoc/base/bubble.md
  2. 71
      uidoc/base/label.md
  3. 39
      uidoc/base/message.md
  4. 42
      uidoc/base/toast.md
  5. 114
      uidoc/core/layout/border.md
  6. 17
      uidoc/core/layout/center.md
  7. 75
      uidoc/core/layout/center_adapt.md
  8. 21
      uidoc/core/layout/float_center.md
  9. 75
      uidoc/core/layout/flow.md
  10. 71
      uidoc/core/layout/grid.md
  11. 68
      uidoc/core/layout/horizontal.md
  12. 29
      uidoc/core/layout/horizontal_adapt.md
  13. 29
      uidoc/core/layout/horizontal_auto.md
  14. 28
      uidoc/core/layout/horizontal_float.md
  15. 64
      uidoc/core/layout/htape.md
  16. 19
      uidoc/core/layout/left_right_vertical_adapt.md
  17. 47
      uidoc/core/layout/vertical.md
  18. 29
      uidoc/core/layout/vertical_adapt.md
  19. 64
      uidoc/core/layout/vtape.md
  20. 111
      uidoc/detailed/bi.button/general.md
  21. 17
      uidoc/detailed/bi.button/items.md
  22. 16
      uidoc/detailed/bi.button/node.md
  23. 15
      uidoc/detailed/bi.button/segment.md
  24. 43
      uidoc/detailed/bi.button/tooltip.md

40
uidoc/base/bubble.md

@ -1,2 +1,40 @@
# bubble # bi.bubble
#### 气泡提示
{% method %}
[source](https://jsfiddle.net/fineui/4u705v2v/)
{% common %}
```javascript
BI.createWidget({
type: 'bi.bubble',
element: "#wrapper",
height: 30,
text: "测试"
})
```
{% endmethod %}
## API
##### 基础属性
| 参数 | 说明 | 类型 | 可选值 | 默认值
| :------ |:------------- | :----- | :---- |:----
| direction | 气泡显示位置 | string | | "top" |
| height | 气泡高度 | number | | 35 |
| text | 气泡显示内容 | string | | " " |
## 对外方法
| 名称 | 说明 | 回调参数
| :------ |:------------- | :-----
| setText | 设置文本值 | 需要设置的文本值text|
---

71
uidoc/base/label.md

@ -1,2 +1,71 @@
# label # bi.label
#### 文本标签
{% method %}
[source](https://jsfiddle.net/fineui/47f5ps1j/)
{% common %}
```javascript
BI.createWidget({
type: "bi.label",
textWidth: 100,
textHeight: 30,
text: "基本标签"
});
```
{% 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 |
| textWidth | 文本标签宽度 | number| | null |
| textHeight | 文本标签宽度 | number| | null |
| text | 文本内容 | string | | " " |
##### 高级属性
| 参数 | 说明 | 类型 | 可选值 | 默认值
| :------ |:------------- | :----- | :----|:----
| textAlign | 文本对齐方式 | string | left,center,right | center |
| whiteSpace | 元素内空白处理方式 | string| normal,nowrap | nowrap|
| forceCenter | 是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效 | boolean | true,false | true |
| py | | string | | 空 |
| keyword | | string | | 空 |
| disabled | 灰化 | boolean| true,false | 无 |
| title | 提示title | string | | 空 |
| warningTitle | 错误提示title | string | | 空 |
## 对外方法
| 名称 | 说明 | 回调参数
| :------ |:------------- | :-----
| doRedMark | 文本标红 | — |
| unRedMark | 取消文本标红| —|
| doHighLight | 文本高亮 | —|
| unHighLight | 取消文本高亮 | —|
| setText| 设置文本值 | 需要设置的文本值text|
| getText| 获取文本值 | —|
| setStyle | 设置文本样式 |需要设置的文本标签样式,例{"color":"#000"} |
| setValue | 设置文本值 | 需要设置的文本值text |
| populate| | —|
---

39
uidoc/base/message.md

@ -1,2 +1,39 @@
# message # bi.Msg
#### 消息提示
{% method %}
[source]()
{% common %}
```javascript
BI.createWidget({
type: "bi.button",
element: "#wrapper",
text : '点击我弹出一个消息框',
height : 30,
handler : function() {
BI.Msg.confirm('测试消息框',"我是测试消息框的内容");
}
});
```
{% endmethod %}
## 对外方法
| 名称 | 说明 | 回调参数
| :------ |:------------- | :-----
| alert | 警告消息框 | title, message, callback|
| confirm | 确认消息框 | title, message, callback |
| prompt | 提示消息框 | title, message, value, callback, min_width |
| toast | toast提示 | message, level, context|
---

42
uidoc/base/toast.md

@ -1,2 +1,42 @@
# toast # bi.toast
#### toast提示
{% method %}
[source]()
{% common %}
```javascript
BI.createWidget({
type: 'bi.toast',
element: "#wrapper",
height: 30,
level: "warning",
text: "toast测试"
})
```
{% endmethod %}
## API
##### 基础属性
| 参数 | 说明 | 类型 | 可选值 | 默认值
| :------ |:------------- | :----- | :---- |:----
| level | 提示类型 | string | success,warning | "success" |
| height | 高度 | number | | 30 |
| text | 显示内容 | string | | " " |
## 对外方法
| 名称 | 说明 | 回调参数
| :------ |:------------- | :-----
| setText | 设置文本值 | 需要设置的文本值text |
| setHeight | 设置高度 | 需要设置的高度值height |
---

114
uidoc/core/layout/border.md

@ -1,2 +1,114 @@
# border # bi.border
#### 上下的高度固定/左右的宽度固定,中间的高度/宽度自适应
{% method %}
[source](https://jsfiddle.net/fineui/qtdsdegp/)
{% common %}
```javascript
Demo = {};
Demo._createNorth = function(){
return BI.createWidget({
type: "bi.label",
text: "North",
cls: "layout-bg1",
height: 30
})
};
Demo._createWest = function(){
return BI.createWidget({
type: "bi.center",
cls: "layout-bg2",
items:[{
type: "bi.label",
text: "West",
whiteSpace: "normal"
}]
})
};
Demo._createCenter = function(){
return BI.createWidget({
type: "bi.center",
cls: "layout-bg3",
items: [{
type: "bi.label",
text: "Center",
whiteSpace: "normal"
}]
})
};
Demo._createEast = function(){
return BI.createWidget({
type: "bi.center",
cls: "layout-bg5",
items: [{
type: "bi.label",
text: "East",
whiteSpace: "normal"
}]
})
};
Demo._createSouth = function(){
return BI.createWidget({
type: "bi.label",
text: "South",
cls: "layout-bg6",
height: 50
})
};
BI.createWidget({
type: 'bi.border',
element: "#wrapper",
cls: "",
items: {
north: {
el: Demo._createNorth(),
height: 30,
top: 20,
left: 20,
right: 20
},
south: {
el: Demo._createSouth(),
height: 50,
bottom: 20,
left: 20,
right: 20
},
west: {
el: Demo._createWest(),
width: 200,
left: 20
},
east: {
el: Demo._createEast(),
width: 300,
right: 20
},
center: Demo._createCenter()
}
});
```
{% endmethod %}
## API
##### 基础属性
| 参数 | 说明 | 类型 | 可选值 | 默认值
| :------ |:------------- | :----- | :----|:----
| items | 子控件对象 | object | north,east,west,south,center | | |
---

17
uidoc/core/layout/center.md

@ -7,14 +7,10 @@
{% common %} {% common %}
```javascript ```javascript
Demo = {};
Demo.CenterLayout = BI.inherit(BI.Widget, { BI.createWidget({
props: {
baseCls: "demo-center"
},
render: function () {
return {
type: "bi.center", type: "bi.center",
element: "#wrapper",
items: [{ items: [{
type: "bi.label", type: "bi.label",
text: "Center 1,这里虽然设置label的高度30,但是最终影响高度的是center布局", text: "Center 1,这里虽然设置label的高度30,但是最终影响高度的是center布局",
@ -36,13 +32,6 @@ Demo.CenterLayout = BI.inherit(BI.Widget, {
}], }],
hgap: 20, hgap: 20,
vgap: 20 vgap: 20
}
}
});
BI.shortcut("demo.center_layout", Demo.CenterLayout);
BI.createWidget({
type: 'demo.center_layout',
element: "#wrapper",
}); });

75
uidoc/core/layout/center_adapt.md

@ -7,35 +7,14 @@
{% common %} {% common %}
```javascript ```javascript
Demo = {};
Demo.CenterAdapt = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-absolute"
},
render: function () {
return {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this._createNoWidth()
}, {
column: 0,
row: 1,
el: this._createBottom()
}]
}
},
_createNoWidth: function () { BI.createWidget({
return BI.createWidget({
type: "bi.center_adapt", type: "bi.center_adapt",
element: "#wrapper",
hgap: 10, hgap: 10,
items: [{ items: [{
type: "bi.label", type: "bi.label",
text: "Center Adapt 1 这些label都是没有宽度的", text: "Center Adapt 1",
cls: "layout-bg1", cls: "layout-bg1",
height: 30 height: 30
}, { }, {
@ -43,56 +22,8 @@ Demo.CenterAdapt = BI.inherit(BI.Widget, {
text: "Center Adapt 2", text: "Center Adapt 2",
cls: "layout-bg2", cls: "layout-bg2",
height: 30 height: 30
}, {
type: "bi.label",
text: "Center Adapt 3",
cls: "layout-bg3",
height: 30
}, {
type: "bi.label",
text: "Center Adapt 4",
cls: "layout-bg5",
height: 30
}] }]
}) })
},
_createBottom: function () {
return BI.createWidget({
type: "bi.center_adapt",
items: [{
type: "bi.text_button",
text: "这个是有宽度和高度的按钮按钮-1",
height: "100%",
width: 160,
cls: "layout-bg1"
}, {
type: "bi.text_button",
text: "按钮-2",
height: 30,
width: 100,
cls: "layout-bg2"
}, {
type: "bi.text_button",
text: "按钮-3",
height: 30,
width: 100,
cls: "layout-bg3"
}, {
type: "bi.text_button",
text: "按钮-4",
height: 30,
width: 100,
cls: "layout-bg5"
}]
})
},
});
BI.shortcut("demo.center_adapt", Demo.CenterAdapt);
BI.createWidget({
type: 'demo.center_adapt',
element: "#wrapper",
});

21
uidoc/core/layout/float_center.md

@ -7,14 +7,10 @@
{% common %} {% common %}
```javascript ```javascript
Demo = {};
Demo.FloatCenterLayout = BI.inherit(BI.Widget, { BI.createWidget({
props: { type: 'bi.float_center',
baseCls: "demo-float-center" element: "#wrapper",
},
render: function () {
return {
type: "bi.float_center",
items: [{ items: [{
type: "bi.label", type: "bi.label",
text: "floatCenter与center的不同在于,它可以控制最小宽度和最大宽度", text: "floatCenter与center的不同在于,它可以控制最小宽度和最大宽度",
@ -29,13 +25,6 @@ Demo.FloatCenterLayout = BI.inherit(BI.Widget, {
height: 300, height: 300,
hgap: 20, hgap: 20,
vgap: 20 vgap: 20
}
}
});
BI.shortcut("demo.float_center", Demo.FloatCenterLayout);
BI.createWidget({
type: 'demo.float_center',
element: "#wrapper",
}); });
@ -54,6 +43,6 @@ BI.createWidget({
| rgap | 效果相当于容器right-padding值 | number | | 0 | | rgap | 效果相当于容器right-padding值 | number | | 0 |
| tgap | 效果相当于容器top-padding值 | number | | 0 | | tgap | 效果相当于容器top-padding值 | number | | 0 |
| bgap | 效果相当于容器bottom-padding值 | number | | 0 | | bgap | 效果相当于容器bottom-padding值 | number | | 0 |
| items | 子控件数组 | array | | | | items | 子控件数组 | array | | | |
--- ---

75
uidoc/core/layout/flow.md

@ -1,2 +1,75 @@
# flow # bi.flow
#### 靠左/右对齐的自由浮动布局
{% method %}
[source](https://jsfiddle.net/fineui/c761a856/)
{% common %}
```javascript
BI.createWidget({
type: "bi.center_adapt",
element: "#wrapper",
items: [{
type: "bi.left",
items: [{
type: "bi.label",
height: 30,
text: "Left-1",
cls: "layout-bg1",
hgap: 20
}, {
type: "bi.label",
height: 30,
text: "Left-2",
cls: "layout-bg2",
hgap: 20
}],
hgap: 20,
vgap: 20
}, {
type: "bi.right",
items: [{
type: "bi.label",
height: 30,
text: "Right-1",
cls: "layout-bg3",
hgap: 20
}, {
type: "bi.label",
height: 30,
text: "Right-2",
cls: "layout-bg4",
hgap: 20
}],
hgap: 20,
vgap: 20
}]
});
```
{% 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 |
| items | 子控件数组 | array | | | |
---

71
uidoc/core/layout/grid.md

@ -1,2 +1,71 @@
# grid # bi.grid
#### 上下的高度固定/左右的宽度固定,中间的高度/宽度自适应
{% method %}
[source](https://jsfiddle.net/fineui/1gwjbpL6/)
{% common %}
```javascript
BI.createWidget({
type: 'bi.grid',
element: "#wrapper",
columns: 2,
rows: 2,
items: [{
column: 0,
row: 0,
el: {
type: "bi.label",
text: "column-0, row-0",
cls: "layout-bg1"
}
}, {
column: 1,
row: 0,
el: {
type: "bi.label",
text: "column-1, row-0",
cls: "layout-bg2"
}
} {
column: 0,
row: 1,
el: {
type: "bi.label",
text: "column-0, row-1",
cls: "layout-bg5"
}
}, {
column: 1,
row: 1,
el: {
type: "bi.label",
text: "column-1, row-1",
cls: "layout-bg6"
}
}]
});
```
{% endmethod %}
## API
##### 基础属性
| 参数 | 说明 | 类型 | 可选值 | 默认值
| :------ |:------------- | :----- | :----|:----
| columns | 列的数量 | number | | null |
| rows | 行的数量 | number | | null |
| items | 子控件数组 | array | | [] |
---

68
uidoc/core/layout/horizontal.md

@ -1,2 +1,68 @@
# horizontal # bi.horizontal
#### 水平流式布局
{% method %}
[source](https://jsfiddle.net/fineui/oj7y7q3o/)
{% common %}
```javascript
BI.createWidget({
type: 'bi.horizontal',
element: "#wrapper",
items: [{
type: "bi.absolute",
items: [{
el: {
type: "bi.text_button",
cls: "layout-bg1",
text: "这里设置了lgap,rgap,tgap,bgap",
height: 30
},
left: 0,
right: 0
}],
width: 100,
height: 30
}, {
type: "bi.absolute",
items: [{
el: {
type: "bi.text_button",
cls: "layout-bg2",
text: "这里设置了lgap,rgap,tgap,bgap",
height: 30
},
left: 0,
right: 0
}],
width: 200,
height: 30
}]
});
```
{% 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 |
| items | 子控件数组 | array | | |
| columnSize | 每列宽度所组成的数组 | array | | |
| verticalAlign | 元素的垂直对齐方式 | string | | "middle" |
| scrollx | 设置水平方向是否有滚动条 | boolean | true,false | true |
---

29
uidoc/core/layout/horizontal_adapt.md

@ -8,15 +8,10 @@
{% common %} {% common %}
```javascript ```javascript
Demo = {};
Demo.HorizontalAdapt = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-horizontal-adapt"
},
_createLayout: function () { BI.createWidget({
return BI.createWidget({
type: "bi.horizontal_adapt", type: "bi.horizontal_adapt",
element: "#wrapper",
vgap: 10, vgap: 10,
items: [{ items: [{
type: "bi.label", type: "bi.label",
@ -32,26 +27,6 @@ Demo.HorizontalAdapt = BI.inherit(BI.Widget, {
height: 30 height: 30
}] }]
}) })
},
render: function () {
return {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this._createLayout()
}]
}
}
});
BI.shortcut("demo.horizontal_adapt", Demo.HorizontalAdapt);
BI.createWidget({
type: 'demo.horizontal_adapt',
element: "#wrapper",
});
``` ```

29
uidoc/core/layout/horizontal_auto.md

@ -7,15 +7,10 @@
{% common %} {% common %}
```javascript ```javascript
Demo = {};
Demo.HorizontalAuto = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-horizontal-auto"
},
_createLayout: function () { BI.createWidget({
return BI.createWidget({
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
element: "#wrapper",
vgap: 10, vgap: 10,
items: [{ items: [{
type: "bi.label", type: "bi.label",
@ -31,26 +26,6 @@ Demo.HorizontalAuto = BI.inherit(BI.Widget, {
height: 30 height: 30
}] }]
}) })
},
render: function () {
return {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this._createLayout()
}]
}
}
});
BI.shortcut("demo.horizontal_auto", Demo.HorizontalAuto);
BI.createWidget({
type: 'demo.horizontal_auto',
element: "#wrapper",
});
``` ```

28
uidoc/core/layout/horizontal_float.md

@ -7,15 +7,10 @@
{% common %} {% common %}
```javascript ```javascript
Demo = {};
Demo.HorizontalFloat = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-horizontal-float"
},
_createLayout: function () { BI.createWidget({
return BI.createWidget({
type: "bi.horizontal_float", type: "bi.horizontal_float",
element: "#wrapper",
vgap: 10, vgap: 10,
items: [{ items: [{
type: "bi.label", type: "bi.label",
@ -25,26 +20,7 @@ Demo.HorizontalFloat = BI.inherit(BI.Widget, {
height:30 height:30
}] }]
}) })
},
render: function () {
return {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this._createLayout()
}]
}
}
});
BI.shortcut("demo.horizontal_float", Demo.HorizontalFloat);
BI.createWidget({
type: 'demo.horizontal_float',
element: "#wrapper",
});
``` ```

64
uidoc/core/layout/htape.md

@ -1,2 +1,64 @@
# htape # bi.htape
#### 水平tape布局,两列定宽,一列自适应
{% method %}
[source](https://jsfiddle.net/fineui/ry7Lnhgw/)
{% common %}
```javascript
BI.createWidget({
type: "bi.htape",
element: "#wrapper",
items : [
{
width: 100,
el : {
type : 'bi.label',
text : '1',
cls: "layout-bg1"
}
}, {
width: 200,
el : {
type : 'bi.label',
text : '2',
cls: "layout-bg2"
}
}, {
width: 'fill',
el : {
type : 'bi.label',
text : '3',
cls: "layout-bg3"
}
}
]
});
```
{% 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 |
| items | 子控件数组 | array | | |
---

19
uidoc/core/layout/left_right_vertical_adapt.md

@ -8,14 +8,10 @@
{% common %} {% common %}
```javascript ```javascript
Demo = {};
Demo.LeftRightVerticalAdaptLayout = BI.inherit(BI.Widget, { BI.createWidget({
props: { type: 'demo.left_right_vertical_adapt',
baseCls: "demo-left-right-vertical-adapt" element: "#wrapper",
},
render: function () {
return {
type: "bi.left_right_vertical_adapt",
lhgap: 10, lhgap: 10,
rhgap: 10, rhgap: 10,
items: { items: {
@ -46,13 +42,6 @@ Demo.LeftRightVerticalAdaptLayout = BI.inherit(BI.Widget, {
height: 30 height: 30
}] }]
} }
}
}
});
BI.shortcut("demo.left_right_vertical_adapt", Demo.LeftRightVerticalAdaptLayout);
BI.createWidget({
type: 'demo.left_right_vertical_adapt',
element: "#wrapper",
}); });

47
uidoc/core/layout/vertical.md

@ -1,2 +1,47 @@
# vertical # bi.vertical
#### 垂直流式布局
{% method %}
[source](https://jsfiddle.net/fineui/zjyaz9fn/)
{% common %}
```javascript
BI.createWidget({
type: 'demo.vertical',
element: "#wrapper",
items: [{
type: "bi.label",
cls: "layout-bg1",
text: "这里设置了hgap(水平间距),vgap(垂直间距)",
height: 30
}, {
type: "bi.label",
cls: "layout-bg2",
text: "这里设置了hgap(水平间距),vgap(垂直间距)",
height: 30
}]
});
```
{% 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 |
| items | 子控件数组 | array | | |
| scrolly | 设置垂直方向是否有滚动条 | boolean | true,false | true |
---

29
uidoc/core/layout/vertical_adapt.md

@ -7,15 +7,10 @@
{% common %} {% common %}
```javascript ```javascript
Demo = {};
Demo.VerticalAdaptLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-vertical-adapt"
},
_createLayout: function () { BI.createWidget({
return BI.createWidget({
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
element: "#wrapper",
vgap: 10, vgap: 10,
items: [{ items: [{
type: "bi.label", type: "bi.label",
@ -31,26 +26,6 @@ Demo.VerticalAdaptLayout = BI.inherit(BI.Widget, {
height: 30 height: 30
}] }]
}) })
},
render: function () {
return {
type: "bi.grid",
columns: 2,
rows: 1,
items: [{
column: 0,
row: 0,
el: this._createLayout()
}]
}
}
});
BI.shortcut("demo.vertical_adapt", Demo.VerticalAdaptLayout);
BI.createWidget({
type: 'demo.vertical_adapt',
element: "#wrapper",
});

64
uidoc/core/layout/vtape.md

@ -1,2 +1,64 @@
# vtape # bi.vtape
#### 垂直tape布局,两列定高,一列自适应
{% method %}
[source](https://jsfiddle.net/fineui/ufpnz53d/)
{% common %}
```javascript
BI.createWidget({
type: "bi.vtape",
element: "#wrapper",
items : [
{
height: 100,
el : {
type : 'bi.label',
text : '1',
cls: "layout-bg1"
}
}, {
height: 200,
el : {
type : 'bi.label',
text : '2',
cls: "layout-bg2"
}
}, {
height: 'fill',
el : {
type : 'bi.label',
text : '3',
cls: "layout-bg3"
}
}
]
});
```
{% 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 |
| items | 子控件数组 | array | | |
---

111
uidoc/detailed/bi.button/general.md

@ -7,112 +7,7 @@
{% common %} {% common %}
```javascript ```javascript
Demo = {};
Demo.Buttons = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-button"
},
render: function () {
var items = [{
el: {
type: 'bi.button',
text: '一般按钮',
level: 'common',
height: 30
}
},
{
el: {
type: 'bi.button',
text: '普通灰化按钮',
disabled: true,
level: 'success',
height: 30
}
}, {
el: {
type: 'bi.button',
text: '带图标的按钮',
//level: 'ignore',
iconClass: "close-font",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '一般按钮',
block: true,
level: 'common',
height: 30
}
},
{
el: {
type: 'bi.button',
text: '普通灰化按钮',
block: true,
disabled: true,
level: 'success',
height: 30
}
}, {
el: {
type: 'bi.button',
text: '带图标的按钮',
block: true,
//level: 'ignore',
iconClass: "close-font",
height: 30
}
}, {
el: {
type: 'bi.button',
text: '一般按钮',
clear: true,
level: 'common',
height: 30
}
},
{
el: {
type: 'bi.button',
text: '普通灰化按钮',
clear: true,
disabled: true,
level: 'success',
height: 30
}
}, {
el: {
type: 'bi.button',
text: '带图标的按钮',
clear: true,
//level: 'ignore',
iconClass: "close-font",
height: 30
}
}, {
el: {
type: 'bi.text_button',
text: '文字按钮',
height: 30
}
}
];
BI.each(items, function (i, item) {
item.el.handler = function () {
BI.Msg.alert('按钮', this.options.text);
}
});
return {
type: "bi.left",
vgap: 100,
hgap: 20,
items: items
}
}
});
BI.shortcut("demo.buttons", Demo.Buttons);
BI.createWidget({ BI.createWidget({
type: 'demo.buttons', type: 'demo.buttons',
element: "#wrapper", element: "#wrapper",
@ -155,8 +50,8 @@ BI.createWidget({
| block| 是否块状显示,即不显示边框,没有最小宽度的限制 | boolean| true,false | false | | block| 是否块状显示,即不显示边框,没有最小宽度的限制 | boolean| true,false | false |
| clear| 是否去掉边框和背景 |boolean| true,false | false | | clear| 是否去掉边框和背景 |boolean| true,false | false |
| textAlign | 文字布局 | string | left,center,right | cneter | | textAlign | 文字布局 | string | left,center,right | cneter |
| whiteSpace | 元素内的空白处理方式 | string | normal,pre,nowrap,pre-wrap,pre-line,inherit | nowrap| | whiteSpace | 元素内的空白处理方式 | string | normal,nowrap | nowrap|
| forceCenter | | boolean | true,false | false | | forceCenter | 是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效 | boolean | true,false | false |
| textWidth| 按钮文本宽度 | number| | null | | textWidth| 按钮文本宽度 | number| | null |
| textHeight | 按钮文本高度 | number| | null | | textHeight | 按钮文本高度 | number| | null |

17
uidoc/detailed/bi.button/items.md

@ -5,11 +5,10 @@
{% common %} {% common %}
```javascript ```javascript
Demo = {};
Demo.Items = BI.inherit(BI.Widget, { BI.createWidget({
render: function () { type: 'bi.vertical',
return { element: "#wrapper",
type: "bi.vertical",
items: [{ items: [{
type: "bi.label", type: "bi.label",
height: 30, height: 30,
@ -25,14 +24,6 @@ Demo.Items = BI.inherit(BI.Widget, {
type: "bi.multi_select_item", type: "bi.multi_select_item",
text: "复选项" text: "复选项"
}] }]
}
}
});
BI.shortcut("demo.items", Demo.Items);
BI.createWidget({
type: 'demo.items',
element: "#wrapper",
}); });

16
uidoc/detailed/bi.button/node.md

@ -5,12 +5,10 @@
{% common %} {% common %}
```javascript ```javascript
Demo = {};
Demo.Nodes = BI.inherit(BI.Widget, {
render: function (vessel) { BI.createWidget({
return { type: 'bi.vertical',
type: "bi.vertical", element: "#wrapper",
items: [{ items: [{
type: "bi.label", type: "bi.label",
height: 30, height: 30,
@ -33,14 +31,6 @@ Demo.Nodes = BI.inherit(BI.Widget, {
type: "bi.arrow_group_node", type: "bi.arrow_group_node",
text: "箭头节点" text: "箭头节点"
}] }]
}
}
});
BI.shortcut("demo.nodes", Demo.Nodes);
BI.createWidget({
type: 'demo.nodes',
element: "#wrapper",
}); });

15
uidoc/detailed/bi.button/segment.md

@ -7,11 +7,10 @@
{% common %} {% common %}
```javascript ```javascript
Demo = {};
Demo.Segments = BI.inherit(BI.Widget, { BI.createWidget({
render: function () {
return {
type: "bi.vertical", type: "bi.vertical",
element: "#wrapper",
items: [{ items: [{
type: "bi.label", type: "bi.label",
height: 30, height: 30,
@ -33,14 +32,6 @@ Demo.Segments = BI.inherit(BI.Widget, {
}], }],
hgap: 50, hgap: 50,
vgap: 20 vgap: 20
}
}
});
BI.shortcut("demo.segments", Demo.Segments);
BI.createWidget({
type: 'demo.segments',
element: "#wrapper",
}); });
``` ```

43
uidoc/detailed/bi.button/tooltip.md

@ -5,13 +5,7 @@
{% common %} {% common %}
```javascript ```javascript
Demo = {};
Demo.Tips = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-tips"
},
render: function () {
var btns = [];
var bubble = BI.createWidget({ var bubble = BI.createWidget({
type: "bi.left", type: "bi.left",
items: [{ items: [{
@ -24,30 +18,6 @@ Demo.Tips = BI.inherit(BI.Widget, {
btns.push("singleBubble1"); btns.push("singleBubble1");
} }
} }
}, {
el: {
type: 'bi.button',
text: 'bubble测试(居中显示)',
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble2", "bubble测试", this, {
offsetStyle: "center"
});
btns.push("singleBubble2");
}
}
}, {
el: {
type: 'bi.button',
text: 'bubble测试(右边显示)',
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble3", "bubble测试", this, {
offsetStyle: "right"
});
btns.push("singleBubble3");
}
}
},{ },{
el: { el: {
type: 'bi.button', type: 'bi.button',
@ -94,18 +64,13 @@ Demo.Tips = BI.inherit(BI.Widget, {
vgap: 20 vgap: 20
}); });
return {
BI.createWidget({
type: "bi.horizontal_auto", type: "bi.horizontal_auto",
element: "#wrapper",
vgap: 20, vgap: 20,
hgap: 20, hgap: 20,
items: [bubble, title, toast] items: [bubble, title, toast]
}
}
});
BI.shortcut("demo.tips", Demo.Tips);
BI.createWidget({
type: 'demo.tips',
element: "#wrapper",
}); });

Loading…
Cancel
Save