woodyjang
7 years ago
43 changed files with 928 additions and 326 deletions
File diff suppressed because one or more lines are too long
@ -0,0 +1,100 @@
|
||||
/** |
||||
* Created by User on 2017/9/5. |
||||
*/ |
||||
BI.CustomFineTuningNumberEditor = BI.inherit(BI.Widget, { |
||||
_defaultConfig: function () { |
||||
return BI.extend(BI.CustomFineTuningNumberEditor.superclass._defaultConfig.apply(this, arguments), { |
||||
baseCls: "bi-fine-tuning-number-editor bi-border", |
||||
value: 0, |
||||
validationChecker: function () { |
||||
return true; |
||||
}, |
||||
errorText: "" |
||||
}) |
||||
}, |
||||
|
||||
_init: function () { |
||||
BI.CustomFineTuningNumberEditor.superclass._init.apply(this, arguments); |
||||
var self = this, o = this.options; |
||||
this.editor = BI.createWidget({ |
||||
type: "bi.sign_editor", |
||||
height: o.height, |
||||
value: o.value, |
||||
validationChecker: o.validationChecker, |
||||
errorText: o.errorText |
||||
}); |
||||
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () { |
||||
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE); |
||||
}); |
||||
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function(){ |
||||
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM); |
||||
}); |
||||
this.topBtn = BI.createWidget({ |
||||
type: "bi.icon_button", |
||||
trigger: "lclick,", |
||||
cls: "column-pre-page-h-font top-button bi-border-left bi-border-bottom" |
||||
}); |
||||
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function(){ |
||||
self._finetuning(1); |
||||
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE); |
||||
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM); |
||||
}); |
||||
this.bottomBtn = BI.createWidget({ |
||||
type: "bi.icon_button", |
||||
trigger: "lclick,", |
||||
cls: "column-next-page-h-font bottom-button bi-border-left bi-border-top" |
||||
}); |
||||
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function(){ |
||||
self._finetuning(-1); |
||||
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CHANGE); |
||||
self.fireEvent(BI.CustomFineTuningNumberEditor.EVENT_CONFIRM); |
||||
}); |
||||
BI.createWidget({ |
||||
type: "bi.htape", |
||||
element: this, |
||||
items: [this.editor, { |
||||
el: { |
||||
type: "bi.grid", |
||||
columns: 1, |
||||
rows: 2, |
||||
items: [{ |
||||
column: 0, |
||||
row: 0, |
||||
el: this.topBtn |
||||
}, { |
||||
column: 0, |
||||
row: 1, |
||||
el: this.bottomBtn |
||||
}] |
||||
}, |
||||
width: 23 |
||||
}] |
||||
}); |
||||
}, |
||||
|
||||
//微调
|
||||
_finetuning: function(add){ |
||||
var v = BI.parseFloat(this.editor.getValue()); |
||||
this.editor.setValue(v.add(add)); |
||||
}, |
||||
|
||||
setUpEnable: function (v) { |
||||
this.topBtn.setEnable(!!v); |
||||
}, |
||||
|
||||
setBottomEnable: function (v) { |
||||
this.bottomBtn.setEnable(!!v); |
||||
}, |
||||
|
||||
getValue: function () { |
||||
return this.editor.getValue(); |
||||
}, |
||||
|
||||
setValue: function (v) { |
||||
this.editor.setValue(v); |
||||
} |
||||
|
||||
}); |
||||
BI.CustomFineTuningNumberEditor.EVENT_CHANGE = "EVENT_CHANGE"; |
||||
BI.CustomFineTuningNumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; |
||||
BI.shortcut("bi.custom_fine_tuning_number_editor", BI.CustomFineTuningNumberEditor); |
@ -1,2 +1,43 @@
|
||||
# lazy_loader |
||||
# bi.lazy_loader |
||||
|
||||
### 懒加载 |
||||
|
||||
{% method %} |
||||
[source](https://jsfiddle.net/fineui/n710yphc/) |
||||
|
||||
{% common %} |
||||
```javascript |
||||
|
||||
BI.createWidget({ |
||||
type: "bi.lazy_loader", |
||||
width: 100, |
||||
element: 'body', |
||||
items: items, |
||||
}); |
||||
|
||||
``` |
||||
|
||||
{% endmethod %} |
||||
|
||||
|
||||
|
||||
### 方法 |
||||
|
||||
| 方法名 | 说明 | 参数 | |
||||
| --------------------- | ---------- | ----- | |
||||
| addItems | 列表最后添加元素 | items | |
||||
| setValue | 设置值 | data | |
||||
| getVlaue | 获得值 | — | |
||||
| empty | 清空 | — | |
||||
| populate | 替换内容 | items | |
||||
| setNotSelectedValue | 设置未选中值 | — | |
||||
| getNotSelectedValue | 获取未选中植 | — | |
||||
| getAllButtons | 获得所以根节点 | — | |
||||
| getAllLeaves | 获得所有叶节点 | — | |
||||
| getSelectedButtons | 获取选中的根节点 | — | |
||||
| getNotSelectedButtons | 获取未选中的根节点 | — | |
||||
| getIndexByValue | 根据值获取索引 | value | |
||||
| getNodeById | 根据id获取node | id | |
||||
| getNodeByValue | 根据值获取node | value | |
||||
|
||||
------ |
@ -1,2 +1,54 @@
|
||||
# list_loader |
||||
# bi.list_loader |
||||
|
||||
### 恶心的加载控件, 为解决排序问题引入的控件 |
||||
|
||||
{% method %} |
||||
[source](https://jsfiddle.net/fineui/8wa7rvcd/) |
||||
|
||||
{% common %} |
||||
```javascript |
||||
|
||||
BI.createWidget({ |
||||
type: "bi.list_loader", |
||||
width: 100, |
||||
element: 'body', |
||||
items: items, |
||||
}); |
||||
|
||||
``` |
||||
|
||||
{% endmethod %} |
||||
|
||||
### 参数 |
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 | |
||||
| ------------ | ------ | -------- | ---------- | |
||||
| count | 分页计数 | number | false | |
||||
| next | | object | {} | |
||||
| hasNext | 是否有下一页 | function | BI.emptyFn | |
||||
| items | 子项 | array | [] | |
||||
| itemsCreator | 元素创造器 | function | BI.emptyFn | |
||||
| onLoaded | 加载完成回调 | function | BI.emptyFn | |
||||
|
||||
### 方法 |
||||
|
||||
| 方法名 | 说明 | 参数 | |
||||
| --------------------- | ---------- | ----- | |
||||
| hasNext | 是否有下一页 | — | |
||||
| addItems | 列表最后添加元素 | items | |
||||
| setValue | 设置值 | data | |
||||
| getVlaue | 获得值 | — | |
||||
| empty | 清空 | — | |
||||
| populate | 替换内容 | items | |
||||
| resetHeight | 重新设置高度 | h | |
||||
| setNotSelectedValue | 设置未选中值 | — | |
||||
| getNotSelectedValue | 获取未选中植 | — | |
||||
| getAllButtons | 获得所以根节点 | — | |
||||
| getAllLeaves | 获得所有叶节点 | — | |
||||
| getSelectedButtons | 获取选中的根节点 | — | |
||||
| getNotSelectedButtons | 获取未选中的根节点 | — | |
||||
| getIndexByValue | 根据值获取索引 | value | |
||||
| getNodeById | 根据id获取node | id | |
||||
| getNodeByValue | 根据值获取node | value | |
||||
|
||||
------ |
@ -1,2 +1,54 @@
|
||||
# sort_list |
||||
# bi.sort_list |
||||
|
||||
### 排序列表 |
||||
|
||||
{% method %} |
||||
[source](https://jsfiddle.net/fineui/wj68tdvx/) |
||||
|
||||
{% common %} |
||||
```javascript |
||||
|
||||
BI.createWidget({ |
||||
type: "bi.sort_list", |
||||
width: 100, |
||||
element: 'body', |
||||
items: items, |
||||
}); |
||||
|
||||
``` |
||||
|
||||
{% endmethod %} |
||||
|
||||
### 参数 |
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 | |
||||
| ------------ | ------ | -------- | ---------- | |
||||
| count | 分页计数 | number | false | |
||||
| next | | object | {} | |
||||
| hasNext | 是否有下一页 | function | BI.emptyFn | |
||||
| items | 子项 | array | [] | |
||||
| itemsCreator | 元素创造器 | function | BI.emptyFn | |
||||
| onLoaded | 加载完成回调 | function | BI.emptyFn | |
||||
|
||||
### 方法 |
||||
|
||||
| 方法名 | 说明 | 参数 | |
||||
| --------------------- | ---------- | ----- | |
||||
| hasNext | 是否有下一页 | — | |
||||
| addItems | 列表最后添加元素 | items | |
||||
| setValue | 设置值 | data | |
||||
| getVlaue | 获得值 | — | |
||||
| empty | 清空 | — | |
||||
| populate | 替换内容 | items | |
||||
| resetHeight | 重新设置高度 | h | |
||||
| setNotSelectedValue | 设置未选中值 | — | |
||||
| getNotSelectedValue | 获取未选中植 | — | |
||||
| getAllButtons | 获得所以根节点 | — | |
||||
| getAllLeaves | 获得所有叶节点 | — | |
||||
| getSelectedButtons | 获取选中的根节点 | — | |
||||
| getNotSelectedButtons | 获取未选中的根节点 | — | |
||||
| getIndexByValue | 根据值获取索引 | value | |
||||
| getNodeById | 根据id获取node | id | |
||||
| getNodeByValue | 根据值获取node | value | |
||||
|
||||
------ |
@ -1,5 +0,0 @@
|
||||
const gh = require('gh-pages'); |
||||
|
||||
gh.publish('_book', () => { |
||||
console.info('upload successfully'); |
||||
}); |
Loading…
Reference in new issue