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. 59
      uidoc/core/layout/center.md
  7. 99
      uidoc/core/layout/center_adapt.md
  8. 47
      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. 59
      uidoc/core/layout/horizontal_adapt.md
  13. 59
      uidoc/core/layout/horizontal_auto.md
  14. 48
      uidoc/core/layout/horizontal_float.md
  15. 64
      uidoc/core/layout/htape.md
  16. 77
      uidoc/core/layout/left_right_vertical_adapt.md
  17. 47
      uidoc/core/layout/vertical.md
  18. 59
      uidoc/core/layout/vertical_adapt.md
  19. 64
      uidoc/core/layout/vtape.md
  20. 111
      uidoc/detailed/bi.button/general.md
  21. 45
      uidoc/detailed/bi.button/items.md
  22. 58
      uidoc/detailed/bi.button/node.md
  23. 55
      uidoc/detailed/bi.button/segment.md
  24. 155
      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 | | |
---

59
uidoc/core/layout/center.md

@ -7,42 +7,31 @@
{% common %}
```javascript
Demo = {};
Demo.CenterLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-center"
},
render: function () {
return {
type: "bi.center",
items: [{
type: "bi.label",
text: "Center 1,这里虽然设置label的高度30,但是最终影响高度的是center布局",
cls: "layout-bg1",
whiteSpace: "normal"
},{
type: "bi.label",
text: "Center 2,为了演示label是占满整个的,用了一个whiteSpace:normal",
cls: "layout-bg2",
whiteSpace: "normal"
},{
type: "bi.label",
text: "Center 3",
cls: "layout-bg3"
},{
type: "bi.label",
text: "Center 4",
cls: "layout-bg5"
}],
hgap: 20,
vgap: 20
}
}
});
BI.shortcut("demo.center_layout", Demo.CenterLayout);
BI.createWidget({
type: 'demo.center_layout',
element: "#wrapper",
type: "bi.center",
element: "#wrapper",
items: [{
type: "bi.label",
text: "Center 1,这里虽然设置label的高度30,但是最终影响高度的是center布局",
cls: "layout-bg1",
whiteSpace: "normal"
},{
type: "bi.label",
text: "Center 2,为了演示label是占满整个的,用了一个whiteSpace:normal",
cls: "layout-bg2",
whiteSpace: "normal"
},{
type: "bi.label",
text: "Center 3",
cls: "layout-bg3"
},{
type: "bi.label",
text: "Center 4",
cls: "layout-bg5"
}],
hgap: 20,
vgap: 20
});

99
uidoc/core/layout/center_adapt.md

@ -7,92 +7,23 @@
{% common %}
```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 () {
return BI.createWidget({
type: "bi.center_adapt",
hgap: 10,
items: [{
type: "bi.label",
text: "Center Adapt 1 这些label都是没有宽度的",
cls: "layout-bg1",
height: 30
}, {
type: "bi.label",
text: "Center Adapt 2",
cls: "layout-bg2",
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",
});
type: "bi.center_adapt",
element: "#wrapper",
hgap: 10,
items: [{
type: "bi.label",
text: "Center Adapt 1",
cls: "layout-bg1",
height: 30
}, {
type: "bi.label",
text: "Center Adapt 2",
cls: "layout-bg2",
height: 30
}]
})

47
uidoc/core/layout/float_center.md

@ -7,35 +7,24 @@
{% common %}
```javascript
Demo = {};
Demo.FloatCenterLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-float-center"
},
render: function () {
return {
type: "bi.float_center",
items: [{
type: "bi.label",
text: "floatCenter与center的不同在于,它可以控制最小宽度和最大宽度",
cls: "layout-bg1",
whiteSpace: "normal"
}, {
type: "bi.label",
text: "floatCenter与center的不同在于,它可以控制最小宽度和最大宽度",
cls: "layout-bg2",
whiteSpace: "normal"
}],
height: 300,
hgap: 20,
vgap: 20
}
}
});
BI.shortcut("demo.float_center", Demo.FloatCenterLayout);
BI.createWidget({
type: 'demo.float_center',
element: "#wrapper",
type: 'bi.float_center',
element: "#wrapper",
items: [{
type: "bi.label",
text: "floatCenter与center的不同在于,它可以控制最小宽度和最大宽度",
cls: "layout-bg1",
whiteSpace: "normal"
}, {
type: "bi.label",
text: "floatCenter与center的不同在于,它可以控制最小宽度和最大宽度",
cls: "layout-bg2",
whiteSpace: "normal"
}],
height: 300,
hgap: 20,
vgap: 20
});
@ -54,6 +43,6 @@ BI.createWidget({
| rgap | 效果相当于容器right-padding值 | number | | 0 |
| tgap | 效果相当于容器top-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 |
---

59
uidoc/core/layout/horizontal_adapt.md

@ -8,50 +8,25 @@
{% common %}
```javascript
Demo = {};
Demo.HorizontalAdapt = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-horizontal-adapt"
},
_createLayout: function () {
return BI.createWidget({
type: "bi.horizontal_adapt",
vgap: 10,
items: [{
type: "bi.label",
text: "Horizontal Adapt左右自适应",
cls: "layout-bg1",
width: 300,
height: 30
}, {
type: "bi.label",
text: "Horizontal Adapt左右自适应",
cls: "layout-bg2",
//width: 300,
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",
});
type: "bi.horizontal_adapt",
element: "#wrapper",
vgap: 10,
items: [{
type: "bi.label",
text: "Horizontal Adapt左右自适应",
cls: "layout-bg1",
width: 300,
height: 30
}, {
type: "bi.label",
text: "Horizontal Adapt左右自适应",
cls: "layout-bg2",
//width: 300,
height: 30
}]
})
```

59
uidoc/core/layout/horizontal_auto.md

@ -7,50 +7,25 @@
{% common %}
```javascript
Demo = {};
Demo.HorizontalAuto = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-horizontal-auto"
},
_createLayout: function () {
return BI.createWidget({
type: "bi.horizontal_auto",
vgap: 10,
items: [{
type: "bi.label",
text: "Horizontal Auto左右自适应",
cls: "layout-bg1",
width: 300,
height: 30
}, {
type: "bi.label",
text: "Horizontal Auto左右自适应",
cls: "layout-bg2",
width: 300,
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",
});
type: "bi.horizontal_auto",
element: "#wrapper",
vgap: 10,
items: [{
type: "bi.label",
text: "Horizontal Auto左右自适应",
cls: "layout-bg1",
width: 300,
height: 30
}, {
type: "bi.label",
text: "Horizontal Auto左右自适应",
cls: "layout-bg2",
width: 300,
height: 30
}]
})
```

48
uidoc/core/layout/horizontal_float.md

@ -7,44 +7,20 @@
{% common %}
```javascript
Demo = {};
Demo.HorizontalFloat = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-horizontal-float"
},
_createLayout: function () {
return BI.createWidget({
type: "bi.horizontal_float",
vgap: 10,
items: [{
type: "bi.label",
text: "Horizontal Float左右自适应",
cls: "layout-bg1",
width: 200,
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",
});
type: "bi.horizontal_float",
element: "#wrapper",
vgap: 10,
items: [{
type: "bi.label",
text: "Horizontal Float左右自适应",
cls: "layout-bg1",
width: 200,
height:30
}]
})
```

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 | | |
---

77
uidoc/core/layout/left_right_vertical_adapt.md

@ -8,51 +8,40 @@
{% common %}
```javascript
Demo = {};
Demo.LeftRightVerticalAdaptLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-left-right-vertical-adapt"
},
render: function () {
return {
type: "bi.left_right_vertical_adapt",
lhgap: 10,
rhgap: 10,
items: {
left: [{
type: "bi.label",
text: "左边的垂直居中",
cls: "layout-bg1",
width: 100,
height: 30
}, {
type: "bi.label",
text: "左边的垂直居中",
cls: "layout-bg2",
width: 100,
height: 30
}],
right: [{
type: "bi.label",
text: "右边的垂直居中",
cls: "layout-bg1",
width: 100,
height: 30
}, {
type: "bi.label",
text: "右边的垂直居中",
cls: "layout-bg2",
width: 100,
height: 30
}]
}
}
}
});
BI.shortcut("demo.left_right_vertical_adapt", Demo.LeftRightVerticalAdaptLayout);
BI.createWidget({
type: 'demo.left_right_vertical_adapt',
element: "#wrapper",
type: 'demo.left_right_vertical_adapt',
element: "#wrapper",
lhgap: 10,
rhgap: 10,
items: {
left: [{
type: "bi.label",
text: "左边的垂直居中",
cls: "layout-bg1",
width: 100,
height: 30
}, {
type: "bi.label",
text: "左边的垂直居中",
cls: "layout-bg2",
width: 100,
height: 30
}],
right: [{
type: "bi.label",
text: "右边的垂直居中",
cls: "layout-bg1",
width: 100,
height: 30
}, {
type: "bi.label",
text: "右边的垂直居中",
cls: "layout-bg2",
width: 100,
height: 30
}]
}
});

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 |
---

59
uidoc/core/layout/vertical_adapt.md

@ -7,50 +7,25 @@
{% common %}
```javascript
Demo = {};
Demo.VerticalAdaptLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-vertical-adapt"
},
_createLayout: function () {
return BI.createWidget({
type: "bi.vertical_adapt",
vgap: 10,
items: [{
type: "bi.label",
text: "Vertical Adapt上下自适应",
cls: "layout-bg1",
width: 300,
height: 30
}, {
type: "bi.label",
text: "Vertical Adapt上下自适应",
cls: "layout-bg2",
width: 300,
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",
});
type: "bi.vertical_adapt",
element: "#wrapper",
vgap: 10,
items: [{
type: "bi.label",
text: "Vertical Adapt上下自适应",
cls: "layout-bg1",
width: 300,
height: 30
}, {
type: "bi.label",
text: "Vertical Adapt上下自适应",
cls: "layout-bg2",
width: 300,
height: 30
}]
})

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 %}
```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({
type: 'demo.buttons',
element: "#wrapper",
@ -155,8 +50,8 @@ BI.createWidget({
| block| 是否块状显示,即不显示边框,没有最小宽度的限制 | boolean| true,false | false |
| clear| 是否去掉边框和背景 |boolean| true,false | false |
| textAlign | 文字布局 | string | left,center,right | cneter |
| whiteSpace | 元素内的空白处理方式 | string | normal,pre,nowrap,pre-wrap,pre-line,inherit | nowrap|
| forceCenter | | boolean | true,false | false |
| whiteSpace | 元素内的空白处理方式 | string | normal,nowrap | nowrap|
| forceCenter | 是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效 | boolean | true,false | false |
| textWidth| 按钮文本宽度 | number| | null |
| textHeight | 按钮文本高度 | number| | null |

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

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

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

@ -5,42 +5,32 @@
{% common %}
```javascript
Demo = {};
Demo.Nodes = BI.inherit(BI.Widget, {
render: function (vessel) {
return {
type: "bi.vertical",
items: [{
type: "bi.label",
height: 30,
text: "十字形的节点"
}, {
type: "bi.plus_group_node",
text: "十字形的节点"
}, {
type: "bi.label",
height: 30,
text: "三角形的节点"
}, {
type: "bi.triangle_group_node",
text: "三角形的节点"
}, {
type: "bi.label",
height: 30,
text: "箭头节点"
}, {
type: "bi.arrow_group_node",
text: "箭头节点"
}]
}
}
});
BI.shortcut("demo.nodes", Demo.Nodes);
BI.createWidget({
type: 'demo.nodes',
element: "#wrapper",
type: 'bi.vertical',
element: "#wrapper",
items: [{
type: "bi.label",
height: 30,
text: "十字形的节点"
}, {
type: "bi.plus_group_node",
text: "十字形的节点"
}, {
type: "bi.label",
height: 30,
text: "三角形的节点"
}, {
type: "bi.triangle_group_node",
text: "三角形的节点"
}, {
type: "bi.label",
height: 30,
text: "箭头节点"
}, {
type: "bi.arrow_group_node",
text: "箭头节点"
}]
});

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

@ -7,40 +7,31 @@
{% common %}
```javascript
Demo = {};
Demo.Segments = BI.inherit(BI.Widget, {
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.label",
height: 30,
text: "默认风格"
}, {
type: "bi.segment",
items: [{
text: "tab1",
value: 1,
selected: true
}, {
text: "tab2",
value: 2
}, {
text: "tab3 disabled",
disabled: true,
value: 3
}]
}],
hgap: 50,
vgap: 20
}
}
});
BI.shortcut("demo.segments", Demo.Segments);
BI.createWidget({
type: 'demo.segments',
element: "#wrapper",
type: "bi.vertical",
element: "#wrapper",
items: [{
type: "bi.label",
height: 30,
text: "默认风格"
}, {
type: "bi.segment",
items: [{
text: "tab1",
value: 1,
selected: true
}, {
text: "tab2",
value: 2
}, {
text: "tab3 disabled",
disabled: true,
value: 3
}]
}],
hgap: 50,
vgap: 20
});
```

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

@ -5,107 +5,72 @@
{% common %}
```javascript
Demo = {};
Demo.Tips = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-tips"
},
render: function () {
var btns = [];
var bubble = BI.createWidget({
type: "bi.left",
items: [{
el: {
type: 'bi.button',
text: 'bubble测试',
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble1", "bubble测试", this);
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: {
type: 'bi.button',
text: '隐藏所有 bubble',
height: 30,
cls: "layout-bg2",
handler: function () {
BI.each(btns, function (index, value) {
BI.Bubbles.hide(value);
})
}
}
}],
hgap: 20,
vgap: 20
});
var title = BI.createWidget({
type: "bi.vertical",
items: [{
type: "bi.label",
cls: "layout-bg1",
height: 50,
title: "title提示",
text: "移上去有title提示",
textAlign: "center"
}],
hgap: 20,
vgap: 20
});
var bubble = BI.createWidget({
type: "bi.left",
items: [{
el: {
type: 'bi.button',
text: 'bubble测试',
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble1", "bubble测试", this);
btns.push("singleBubble1");
}
}
},{
el: {
type: 'bi.button',
text: '隐藏所有 bubble',
height: 30,
cls: "layout-bg2",
handler: function () {
BI.each(btns, function (index, value) {
BI.Bubbles.hide(value);
})
}
}
}],
hgap: 20,
vgap: 20
});
var toast = BI.createWidget({
type: "bi.vertical",
items: [{
el: {
type: 'bi.button',
text: '简单Toast测试',
height: 30,
handler: function () {
BI.Msg.toast("这是一条简单的数据");
}
}
}],
vgap: 20
});
var title = BI.createWidget({
type: "bi.vertical",
items: [{
type: "bi.label",
cls: "layout-bg1",
height: 50,
title: "title提示",
text: "移上去有title提示",
textAlign: "center"
}],
hgap: 20,
vgap: 20
});
return {
type: "bi.horizontal_auto",
vgap: 20,
hgap: 20,
items: [bubble, title, toast]
var toast = BI.createWidget({
type: "bi.vertical",
items: [{
el: {
type: 'bi.button',
text: '简单Toast测试',
height: 30,
handler: function () {
BI.Msg.toast("这是一条简单的数据");
}
}
}
}],
vgap: 20
});
BI.shortcut("demo.tips", Demo.Tips);
BI.createWidget({
type: 'demo.tips',
element: "#wrapper",
type: "bi.horizontal_auto",
element: "#wrapper",
vgap: 20,
hgap: 20,
items: [bubble, title, toast]
});

Loading…
Cancel
Save