Browse Source

Merge pull request #676 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit 'f71640ab237af17a64b08872b4fa7a5b6e6d6655':
  update
  无JIRA任务 图标换一换,demo删一删,名字改一改
  无JIRA任务 发现线没有连上
es6
guy 6 years ago
parent
commit
933e00317a
  1. 1
      demo/js/base/demo.label.js
  2. 215
      demo/js/category/customATree/demo.multilayerselecttree.leveltree.js
  3. 4
      demo/js/config/category.js
  4. 38
      dist/base.js
  5. 47
      dist/bundle.js
  6. 12
      dist/bundle.min.js
  7. 219
      dist/demo.js
  8. 47
      dist/fineui.js
  9. 12
      dist/fineui.min.js
  10. 9
      dist/fineui_without_jquery_polyfill.js
  11. 2
      dist/utils.min.js
  12. 9
      dist/widget.js
  13. 3
      src/widget/singleselect/search/singleselect.search.loader.js
  14. 2
      src/widget/singleselect/singleselect.item.js
  15. 2
      src/widget/singleselect/singleselect.loader.js
  16. 2
      src/widget/singleselect/singleselectlist.insert.js

1
demo/js/base/demo.label.js

@ -9,6 +9,7 @@ Demo.Label = BI.inherit(BI.Widget, {
type: "bi.label",
cls: "layout-bg6",
text: "这是一个label控件,默认居中",
disabled: true,
textAlign: "center"
}, {
type: "bi.label",

215
demo/js/category/customATree/demo.multilayerselecttree.leveltree.js

@ -1,215 +0,0 @@
/**
* guy
* 二级树
* @class BI.PlatformLevelTree
* @extends BI.Select
*/
BI.PlatformLevelTree = BI.inherit(BI.Widget, {
props: {
baseCls: "platform-level-tree",
itemsCreator: BI.emptyFn
},
render: function () {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.custom_tree",
element: this,
expander: {
type: "bi.select_tree_expander",
isDefaultInit: false,
el: {},
popup: {
type: "bi.custom_tree"
}
},
itemsCreator: function (op, callback) {
o.itemsCreator(op, function (items) {
callback(self._formatItems(items));
});
},
el: {
type: "bi.loader",
next: false,
el: {
type: "bi.button_tree",
chooseType: 0,
layouts: [{
type: "bi.vertical"
}]
}
}
});
this.tree.on(BI.CustomTree.EVENT_CHANGE, function () {
self.fireEvent(BI.PlatformLevelTree.EVENT_CHANGE, arguments);
});
},
_formatItems: function (nodes) {
var self = this;
BI.each(nodes, function (i, node) {
var extend = {};
if (node.isParent === true || BI.isNotEmptyArray(node.children)) {
switch (i) {
case 0 :
extend.type = "bi.multilayer_select_tree_first_plus_group_node";
break;
case nodes.length - 1 :
extend.type = "bi.multilayer_select_tree_last_plus_group_node";
break;
default :
extend.type = "bi.multilayer_select_tree_mid_plus_group_node";
break;
}
BI.defaults(node, extend);
} else {
switch (i) {
case nodes.length - 1:
extend.type = "bi.multilayer_single_tree_last_tree_leaf_item";
break;
default :
extend.type = "bi.multilayer_single_tree_mid_tree_leaf_item";
}
BI.defaults(node, extend);
}
});
return nodes;
},
populate: function () {
this.tree.populate();
},
getValue: function () {
return this.tree.getValue();
}
});
BI.PlatformLevelTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.platform_level_tree", BI.PlatformLevelTree);
BI.DemoLevelTree = BI.inherit(BI.Widget, {
render: function () {
var self = this;
return {
type: "bi.vtape",
items: [{
el: {
type: "bi.platform_level_tree",
ref: function () {
self.tree = this;
},
itemsCreator: function (op, callback) {
if (!op.node) {// 根节点
callback([{
id: 1,
pId: 0,
text: "A",
value: 1,
isParent: true
}, {
id: 2,
pId: 0,
text: "B",
value: 2,
isParent: true,
open: true
}]);
} else {
if (op.node.id == 1) {
callback([
{
id: 11,
pId: 1,
text: "test11",
value: 11,
layer: 1,
isParent: true
},
{
id: 12,
pId: 1,
text: "test12",
value: 12,
layer: 1
},
{
id: 13,
pId: 1,
text: "test13",
value: 13,
layer: 1
},
{
id: 14,
pId: 1,
text: "test14",
value: 14,
layer: 1,
height: 35
},
{
id: 15,
pId: 1,
text: "test15",
value: 15,
layer: 1
},
{
id: 16,
pId: 1,
text: "test16",
value: 16,
layer: 1
},
{id: 17, pId: 1, text: "test17", layer: 1, value: 17}
]);
} else if (op.node.id == 2) {
callback([{
id: 21,
pId: 2,
text: "test21",
value: 21,
layer: 1
},
{
id: 22,
pId: 2,
text: "test22",
value: 22,
layer: 1
}]);
} else if (op.node.id == 11) {
callback([{
id: 111,
pId: 11,
text: "test111",
value: 111,
layer: 2
}]);
}
}
}
}
}, {
el: {
type: "bi.button",
text: "确定",
handler: function () {
BI.Msg.toast(JSON.stringify(self.tree.getValue()));
}
},
height: 25
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.platform_level_tree", BI.DemoLevelTree);

4
demo/js/config/category.js

@ -1,10 +1,6 @@
Demo.CATEGORY_CONFIG = [{
id: 100000,
text: "专题"
}, {
pId: 100000,
text: "自定义一棵树",
value: "demo.platform_level_tree"
}, {
pId: 100000,
text: "可以排序的树",

38
dist/base.js vendored

@ -9196,15 +9196,15 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
return;
}
for (var
xhr = new XMLHttpRequest,
upload = xhr.upload || {
addEventListener: function (event, callback) {
this["on" + event] = callback;
}
},
i = 0;
i < length;
i++
xhr = new XMLHttpRequest,
upload = xhr.upload || {
addEventListener: function (event, callback) {
this["on" + event] = callback;
}
},
i = 0;
i < length;
i++
) {
upload.addEventListener(
split[i].substring(2),
@ -9259,9 +9259,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
switch (xhr.readyState) {
case 2:
case 3:
if (rpe.total <= rpe.loaded) {
rpe.loaded = rpe.total;
}
if (rpe.total <= rpe.loaded) {rpe.loaded = rpe.total;}
upload.onprogress(rpe);
break;
case 4:
@ -9327,12 +9325,8 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
var url = handler.url.concat(-1 === handler.url.indexOf("?") ? "?" : "&", "AjaxUploadFrame=true"),
rpe = {
loaded: 1, total: 100, simulation: true, interval: setInterval(function () {
if (rpe.loaded < rpe.total) {
++rpe.loaded;
}
if (isFunction(handler.onprogress)) {
handler.onprogress(rpe, {});
}
if (rpe.loaded < rpe.total) {++rpe.loaded;}
if (isFunction(handler.onprogress)) {handler.onprogress(rpe, {});}
}, 100)
},
onload = function () {
@ -9356,13 +9350,9 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
handler.attach_array.push(attachO);
}
} catch (e) {
if (isFunction(handler.onerror)) {
handler.onerror(rpe, event || _global.event);
}
}
if (isFunction(handler.onload)) {
handler.onload(rpe, {responseText: responseText});
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || _global.event);}
}
if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});}
},
target = ["AjaxUpload", (new Date).getTime(), String(Math.random()).substring(2)].join("_");
try { // IE < 8 does not accept enctype attribute ...

47
dist/bundle.js vendored

@ -44559,15 +44559,15 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
return;
}
for (var
xhr = new XMLHttpRequest,
upload = xhr.upload || {
addEventListener: function (event, callback) {
this["on" + event] = callback;
}
},
i = 0;
i < length;
i++
xhr = new XMLHttpRequest,
upload = xhr.upload || {
addEventListener: function (event, callback) {
this["on" + event] = callback;
}
},
i = 0;
i < length;
i++
) {
upload.addEventListener(
split[i].substring(2),
@ -44622,9 +44622,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
switch (xhr.readyState) {
case 2:
case 3:
if (rpe.total <= rpe.loaded) {
rpe.loaded = rpe.total;
}
if (rpe.total <= rpe.loaded) {rpe.loaded = rpe.total;}
upload.onprogress(rpe);
break;
case 4:
@ -44690,12 +44688,8 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
var url = handler.url.concat(-1 === handler.url.indexOf("?") ? "?" : "&", "AjaxUploadFrame=true"),
rpe = {
loaded: 1, total: 100, simulation: true, interval: setInterval(function () {
if (rpe.loaded < rpe.total) {
++rpe.loaded;
}
if (isFunction(handler.onprogress)) {
handler.onprogress(rpe, {});
}
if (rpe.loaded < rpe.total) {++rpe.loaded;}
if (isFunction(handler.onprogress)) {handler.onprogress(rpe, {});}
}, 100)
},
onload = function () {
@ -44719,13 +44713,9 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
handler.attach_array.push(attachO);
}
} catch (e) {
if (isFunction(handler.onerror)) {
handler.onerror(rpe, event || _global.event);
}
}
if (isFunction(handler.onload)) {
handler.onload(rpe, {responseText: responseText});
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || _global.event);}
}
if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});}
},
target = ["AjaxUpload", (new Date).getTime(), String(Math.random()).substring(2)].join("_");
try { // IE < 8 does not accept enctype attribute ...
@ -74317,7 +74307,8 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.single_select_item",
type: "bi.single_select_combo_item",
cls: "bi-list-item-active",
logic: {
dynamic: false
},
@ -75071,7 +75062,7 @@ BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, {
}
});
BI.shortcut("bi.single_select_combo.item", BI.SingleSelectComboItem);/**
BI.shortcut("bi.single_select_combo_item", BI.SingleSelectComboItem);/**
* 选择列表
*
* Created by GUY on 2015/11/1.
@ -75309,7 +75300,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.single_select_combo.item",
type: "bi.single_select_combo_item",
logic: this.options.logic,
cls: "bi-list-item-active",
height: 24,
@ -75691,7 +75682,7 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
element: this,
items: [{
el: this.searcherPane,
top: 30,
top: 24,
bottom: 0,
left: 0,
right: 0

12
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

219
dist/demo.js vendored

@ -349,6 +349,7 @@ BI.shortcut("demo.icon_label", Demo.IconLabel);Demo.Label = BI.inherit(BI.Widget
type: "bi.label",
cls: "layout-bg6",
text: "这是一个label控件,默认居中",
disabled: true,
textAlign: "center"
}, {
type: "bi.label",
@ -2644,220 +2645,6 @@ BI.shortcut("demo.select_text_trigger", Demo.Func);Demo.Func = BI.inherit(BI.Wid
}
});
BI.shortcut("demo.text_trigger", Demo.Func);/**
* guy
* 二级树
* @class BI.PlatformLevelTree
* @extends BI.Select
*/
BI.PlatformLevelTree = BI.inherit(BI.Widget, {
props: {
baseCls: "platform-level-tree",
itemsCreator: BI.emptyFn
},
render: function () {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.custom_tree",
element: this,
expander: {
type: "bi.select_tree_expander",
isDefaultInit: false,
el: {},
popup: {
type: "bi.custom_tree"
}
},
itemsCreator: function (op, callback) {
o.itemsCreator(op, function (items) {
callback(self._formatItems(items));
});
},
el: {
type: "bi.loader",
next: false,
el: {
type: "bi.button_tree",
chooseType: 0,
layouts: [{
type: "bi.vertical"
}]
}
}
});
this.tree.on(BI.CustomTree.EVENT_CHANGE, function () {
self.fireEvent(BI.PlatformLevelTree.EVENT_CHANGE, arguments);
});
},
_formatItems: function (nodes) {
var self = this;
BI.each(nodes, function (i, node) {
var extend = {};
if (node.isParent === true || BI.isNotEmptyArray(node.children)) {
switch (i) {
case 0 :
extend.type = "bi.multilayer_select_tree_first_plus_group_node";
break;
case nodes.length - 1 :
extend.type = "bi.multilayer_select_tree_last_plus_group_node";
break;
default :
extend.type = "bi.multilayer_select_tree_mid_plus_group_node";
break;
}
BI.defaults(node, extend);
} else {
switch (i) {
case nodes.length - 1:
extend.type = "bi.multilayer_single_tree_last_tree_leaf_item";
break;
default :
extend.type = "bi.multilayer_single_tree_mid_tree_leaf_item";
}
BI.defaults(node, extend);
}
});
return nodes;
},
populate: function () {
this.tree.populate();
},
getValue: function () {
return this.tree.getValue();
}
});
BI.PlatformLevelTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.platform_level_tree", BI.PlatformLevelTree);
BI.DemoLevelTree = BI.inherit(BI.Widget, {
render: function () {
var self = this;
return {
type: "bi.vtape",
items: [{
el: {
type: "bi.platform_level_tree",
ref: function () {
self.tree = this;
},
itemsCreator: function (op, callback) {
if (!op.node) {// 根节点
callback([{
id: 1,
pId: 0,
text: "A",
value: 1,
isParent: true
}, {
id: 2,
pId: 0,
text: "B",
value: 2,
isParent: true,
open: true
}]);
} else {
if (op.node.id == 1) {
callback([
{
id: 11,
pId: 1,
text: "test11",
value: 11,
layer: 1,
isParent: true
},
{
id: 12,
pId: 1,
text: "test12",
value: 12,
layer: 1
},
{
id: 13,
pId: 1,
text: "test13",
value: 13,
layer: 1
},
{
id: 14,
pId: 1,
text: "test14",
value: 14,
layer: 1,
height: 35
},
{
id: 15,
pId: 1,
text: "test15",
value: 15,
layer: 1
},
{
id: 16,
pId: 1,
text: "test16",
value: 16,
layer: 1
},
{id: 17, pId: 1, text: "test17", layer: 1, value: 17}
]);
} else if (op.node.id == 2) {
callback([{
id: 21,
pId: 2,
text: "test21",
value: 21,
layer: 1
},
{
id: 22,
pId: 2,
text: "test22",
value: 22,
layer: 1
}]);
} else if (op.node.id == 11) {
callback([{
id: 111,
pId: 11,
text: "test111",
value: 111,
layer: 2
}]);
}
}
}
}
}, {
el: {
type: "bi.button",
text: "确定",
handler: function () {
BI.Msg.toast(JSON.stringify(self.tree.getValue()));
}
},
height: 25
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.platform_level_tree", BI.DemoLevelTree);/**
* Created by roy on 16/5/23.
*/
BI.DetailTableCell = BI.inherit(BI.Widget, {
@ -3486,10 +3273,6 @@ BI.shortcut("demo.value_chooser_pane", Demo.ValueChooserPane);Demo.BASE_CONFIG =
}];Demo.CATEGORY_CONFIG = [{
id: 100000,
text: "专题"
}, {
pId: 100000,
text: "自定义一棵树",
value: "demo.platform_level_tree"
}, {
pId: 100000,
text: "可以排序的树",

47
dist/fineui.js vendored

@ -44801,15 +44801,15 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
return;
}
for (var
xhr = new XMLHttpRequest,
upload = xhr.upload || {
addEventListener: function (event, callback) {
this["on" + event] = callback;
}
},
i = 0;
i < length;
i++
xhr = new XMLHttpRequest,
upload = xhr.upload || {
addEventListener: function (event, callback) {
this["on" + event] = callback;
}
},
i = 0;
i < length;
i++
) {
upload.addEventListener(
split[i].substring(2),
@ -44864,9 +44864,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
switch (xhr.readyState) {
case 2:
case 3:
if (rpe.total <= rpe.loaded) {
rpe.loaded = rpe.total;
}
if (rpe.total <= rpe.loaded) {rpe.loaded = rpe.total;}
upload.onprogress(rpe);
break;
case 4:
@ -44932,12 +44930,8 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
var url = handler.url.concat(-1 === handler.url.indexOf("?") ? "?" : "&", "AjaxUploadFrame=true"),
rpe = {
loaded: 1, total: 100, simulation: true, interval: setInterval(function () {
if (rpe.loaded < rpe.total) {
++rpe.loaded;
}
if (isFunction(handler.onprogress)) {
handler.onprogress(rpe, {});
}
if (rpe.loaded < rpe.total) {++rpe.loaded;}
if (isFunction(handler.onprogress)) {handler.onprogress(rpe, {});}
}, 100)
},
onload = function () {
@ -44961,13 +44955,9 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
handler.attach_array.push(attachO);
}
} catch (e) {
if (isFunction(handler.onerror)) {
handler.onerror(rpe, event || _global.event);
}
}
if (isFunction(handler.onload)) {
handler.onload(rpe, {responseText: responseText});
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || _global.event);}
}
if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});}
},
target = ["AjaxUpload", (new Date).getTime(), String(Math.random()).substring(2)].join("_");
try { // IE < 8 does not accept enctype attribute ...
@ -74559,7 +74549,8 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.single_select_item",
type: "bi.single_select_combo_item",
cls: "bi-list-item-active",
logic: {
dynamic: false
},
@ -75313,7 +75304,7 @@ BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, {
}
});
BI.shortcut("bi.single_select_combo.item", BI.SingleSelectComboItem);/**
BI.shortcut("bi.single_select_combo_item", BI.SingleSelectComboItem);/**
* 选择列表
*
* Created by GUY on 2015/11/1.
@ -75551,7 +75542,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.single_select_combo.item",
type: "bi.single_select_combo_item",
logic: this.options.logic,
cls: "bi-list-item-active",
height: 24,
@ -75933,7 +75924,7 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
element: this,
items: [{
el: this.searcherPane,
top: 30,
top: 24,
bottom: 0,
left: 0,
right: 0

12
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

9
dist/fineui_without_jquery_polyfill.js vendored

@ -57414,7 +57414,8 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.single_select_item",
type: "bi.single_select_combo_item",
cls: "bi-list-item-active",
logic: {
dynamic: false
},
@ -58168,7 +58169,7 @@ BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, {
}
});
BI.shortcut("bi.single_select_combo.item", BI.SingleSelectComboItem);/**
BI.shortcut("bi.single_select_combo_item", BI.SingleSelectComboItem);/**
* 选择列表
*
* Created by GUY on 2015/11/1.
@ -58406,7 +58407,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.single_select_combo.item",
type: "bi.single_select_combo_item",
logic: this.options.logic,
cls: "bi-list-item-active",
height: 24,
@ -58788,7 +58789,7 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
element: this,
items: [{
el: this.searcherPane,
top: 30,
top: 24,
bottom: 0,
left: 0,
right: 0

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

9
dist/widget.js vendored

@ -15766,7 +15766,8 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.single_select_item",
type: "bi.single_select_combo_item",
cls: "bi-list-item-active",
logic: {
dynamic: false
},
@ -16520,7 +16521,7 @@ BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, {
}
});
BI.shortcut("bi.single_select_combo.item", BI.SingleSelectComboItem);/**
BI.shortcut("bi.single_select_combo_item", BI.SingleSelectComboItem);/**
* 选择列表
*
* Created by GUY on 2015/11/1.
@ -16758,7 +16759,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.single_select_combo.item",
type: "bi.single_select_combo_item",
logic: this.options.logic,
cls: "bi-list-item-active",
height: 24,
@ -17140,7 +17141,7 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
element: this,
items: [{
el: this.searcherPane,
top: 30,
top: 24,
bottom: 0,
left: 0,
right: 0

3
src/widget/singleselect/search/singleselect.search.loader.js

@ -82,7 +82,8 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.single_select_item",
type: "bi.single_select_combo_item",
cls: "bi-list-item-active",
logic: {
dynamic: false
},

2
src/widget/singleselect/singleselect.item.js

@ -64,4 +64,4 @@ BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, {
}
});
BI.shortcut("bi.single_select_combo.item", BI.SingleSelectComboItem);
BI.shortcut("bi.single_select_combo_item", BI.SingleSelectComboItem);

2
src/widget/singleselect/singleselect.loader.js

@ -103,7 +103,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.single_select_combo.item",
type: "bi.single_select_combo_item",
logic: this.options.logic,
cls: "bi-list-item-active",
height: 24,

2
src/widget/singleselect/singleselectlist.insert.js

@ -141,7 +141,7 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
element: this,
items: [{
el: this.searcherPane,
top: 30,
top: 24,
bottom: 0,
left: 0,
right: 0

Loading…
Cancel
Save