Browse Source

Merge pull request #684 in VISUAL/fineui from ~GUY/fineui:master to master

* commit '2aac05b82f83bf2e72fcd3ba77d290cfce4b9a2a':
  update
es6
guy 6 years ago
parent
commit
d9db8153f2
  1. 4
      Gruntfile.js
  2. 7648
      dist/base.js
  3. 13488
      dist/bundle.js
  4. 56
      dist/bundle.min.js
  5. 142
      dist/case.js
  6. 13488
      dist/fineui.js
  7. 56
      dist/fineui.min.js
  8. 274
      dist/fineui_without_jquery_polyfill.js
  9. 2
      dist/utils.min.js
  10. 0
      src/base/tree/ztree/asynctree.js
  11. 0
      src/base/tree/ztree/parttree.js
  12. 0
      src/base/tree/ztree/treeview.js
  13. 0
      src/case/tree/ztree/tree.display.js
  14. 0
      src/case/tree/ztree/tree.simple.js

4
Gruntfile.js

@ -142,13 +142,13 @@ module.exports = function (grunt) {
"src/base/combination/tree.button.js", "src/base/combination/tree.button.js",
"src/base/combination/map.button.js", "src/base/combination/map.button.js",
"src/base/**/*.js", "src/base/**/*.js",
"!src/base/tree/**/*.js", "!src/base/tree/ztree/**/*.js",
"!src/base/single/input/file.js", "!src/base/single/input/file.js",
"src/case/combo/popup.bubble.js", "src/case/combo/popup.bubble.js",
"src/case/**/*.js", "src/case/**/*.js",
"!src/case/colorchooser/**/*.js", "!src/case/colorchooser/**/*.js",
"!src/case/tree/tree.display.js", "!src/case/tree/ztree/**/*.js",
"dist/widget.js", "dist/fix/fix.compact.js", "ui/js/**/*.js"], "dist/widget.js", "dist/fix/fix.compact.js", "ui/js/**/*.js"],
dest: "dist/fineui_without_jquery_polyfill.js" dest: "dist/fineui_without_jquery_polyfill.js"

7648
dist/base.js vendored

File diff suppressed because it is too large Load Diff

13488
dist/bundle.js vendored

File diff suppressed because it is too large Load Diff

56
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

142
dist/case.js vendored

@ -8957,77 +8957,6 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE"; BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE";
BI.shortcut("bi.multi_select_bar", BI.MultiSelectBar); BI.shortcut("bi.multi_select_bar", BI.MultiSelectBar);
/** /**
* guy
* 异步树
* @class BI.DisplayTree
* @extends BI.TreeView
*/
BI.DisplayTree = BI.inherit(BI.TreeView, {
_defaultConfig: function () {
return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-display-tree"
});
},
_init: function () {
BI.DisplayTree.superclass._init.apply(this, arguments);
},
// 配置属性
_configSetting: function () {
var setting = {
view: {
selectedMulti: false,
dblClickExpand: false,
showIcon: false,
nameIsHTML: true,
showTitle: false
},
data: {
key: {
title: "title",
name: "text"
},
simpleData: {
enable: true
}
},
callback: {
beforeCollapse: beforeCollapse
}
};
function beforeCollapse (treeId, treeNode) {
return false;
}
return setting;
},
_dealWidthNodes: function (nodes) {
nodes = BI.DisplayTree.superclass._dealWidthNodes.apply(this, arguments);
var self = this, o = this.options;
BI.each(nodes, function (i, node) {
if (node.text == null) {
if (node.count > 0) {
node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")";
}
}
});
return nodes;
},
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
BI.DisplayTree.superclass.destroy.apply(this, arguments);
}
});
BI.DisplayTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.display_tree", BI.DisplayTree);/**
* guy * guy
* 二级树 * 二级树
* @class BI.LevelTree * @class BI.LevelTree
@ -9162,6 +9091,77 @@ BI.LevelTree = BI.inherit(BI.Widget, {
BI.LevelTree.EVENT_CHANGE = "EVENT_CHANGE"; BI.LevelTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.level_tree", BI.LevelTree);/** BI.shortcut("bi.level_tree", BI.LevelTree);/**
* guy
* 异步树
* @class BI.DisplayTree
* @extends BI.TreeView
*/
BI.DisplayTree = BI.inherit(BI.TreeView, {
_defaultConfig: function () {
return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-display-tree"
});
},
_init: function () {
BI.DisplayTree.superclass._init.apply(this, arguments);
},
// 配置属性
_configSetting: function () {
var setting = {
view: {
selectedMulti: false,
dblClickExpand: false,
showIcon: false,
nameIsHTML: true,
showTitle: false
},
data: {
key: {
title: "title",
name: "text"
},
simpleData: {
enable: true
}
},
callback: {
beforeCollapse: beforeCollapse
}
};
function beforeCollapse (treeId, treeNode) {
return false;
}
return setting;
},
_dealWidthNodes: function (nodes) {
nodes = BI.DisplayTree.superclass._dealWidthNodes.apply(this, arguments);
var self = this, o = this.options;
BI.each(nodes, function (i, node) {
if (node.text == null) {
if (node.count > 0) {
node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")";
}
}
});
return nodes;
},
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
BI.DisplayTree.superclass.destroy.apply(this, arguments);
}
});
BI.DisplayTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.display_tree", BI.DisplayTree);/**
* 简单的多选树 * 简单的多选树
* *
* Created by GUY on 2016/2/16. * Created by GUY on 2016/2/16.

13488
dist/fineui.js vendored

File diff suppressed because it is too large Load Diff

56
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

274
dist/fineui_without_jquery_polyfill.js vendored

@ -33556,6 +33556,153 @@ BI.Trigger = BI.inherit(BI.Single, {
} }
});/** });/**
*
* 自定义树
*
* Created by GUY on 2015/9/7.
* @class BI.CustomTree
* @extends BI.Single
*/
BI.CustomTree = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.CustomTree.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-custom-tree",
expander: {
el: {},
popup: {
type: "bi.custom_tree"
}
},
items: [],
itemsCreator: BI.emptyFn,
el: {
type: "bi.button_tree",
chooseType: 0,
layouts: [{
type: "bi.vertical"
}]
}
});
},
_init: function () {
BI.CustomTree.superclass._init.apply(this, arguments);
this.initTree(this.options.items);
},
_formatItems: function (nodes) {
var self = this, o = this.options;
nodes = BI.Tree.transformToTreeFormat(nodes);
var items = [];
BI.each(nodes, function (i, node) {
if (BI.isNotEmptyArray(node.children) || node.isParent === true) {
var item = BI.extend({
type: "bi.expander",
el: {
value: node.value
},
popup: {type: "bi.custom_tree"}
}, BI.deepClone(o.expander), {
id: node.id,
pId: node.pId
});
var el = BI.stripEL(node);
if (!BI.isWidget(el)) {
el = BI.clone(el);
delete el.children;
BI.extend(item.el, el);
} else {
item.el = el;
}
item.popup.expander = BI.deepClone(o.expander);
item.items = item.popup.items = node.children;
item.itemsCreator = item.popup.itemsCreator = function (op) {
if (BI.isNotNull(op.node)) {// 从子节点传过来的itemsCreator直接向上传递
return o.itemsCreator.apply(self, arguments);
}
var args = Array.prototype.slice.call(arguments, 0);
args[0].node = node;
return o.itemsCreator.apply(self, args);
};
BI.isNull(item.popup.el) && (item.popup.el = BI.deepClone(o.el));
items.push(item);
} else {
items.push(node);
}
});
return items;
},
// 构造树结构,
initTree: function (nodes) {
var self = this, o = this.options;
this.tree = BI.createWidget(o.el, {
element: this,
items: this._formatItems(nodes),
itemsCreator: function (op, callback) {
o.itemsCreator.apply(this, [op, function (items) {
var args = Array.prototype.slice.call(arguments, 0);
args[0] = self._formatItems(items);
callback.apply(null, args);
}]);
},
value: o.value
});
this.tree.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.CustomTree.EVENT_CHANGE, val, obj);
}
});
},
// 生成树方法
stroke: function (nodes) {
this.populate.apply(this, arguments);
},
populate: function (nodes) {
var args = Array.prototype.slice.call(arguments, 0);
if (arguments.length > 0) {
args[0] = this._formatItems(nodes);
}
this.tree.populate.apply(this.tree, args);
},
setValue: function (v) {
this.tree && this.tree.setValue(v);
},
getValue: function () {
return this.tree ? this.tree.getValue() : [];
},
getAllButtons: function () {
return this.tree ? this.tree.getAllButtons() : [];
},
getAllLeaves: function () {
return this.tree ? this.tree.getAllLeaves() : [];
},
getNodeById: function (id) {
return this.tree && this.tree.getNodeById(id);
},
getNodeByValue: function (id) {
return this.tree && this.tree.getNodeByValue(id);
},
empty: function () {
this.tree.empty();
}
});
BI.CustomTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.custom_tree", BI.CustomTree);/**
* 可以改变图标的button * 可以改变图标的button
* *
* Created by GUY on 2016/2/2. * Created by GUY on 2016/2/2.
@ -41019,133 +41166,6 @@ BI.LevelTree = BI.inherit(BI.Widget, {
BI.LevelTree.EVENT_CHANGE = "EVENT_CHANGE"; BI.LevelTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.level_tree", BI.LevelTree);/** BI.shortcut("bi.level_tree", BI.LevelTree);/**
* 简单的多选树
*
* Created by GUY on 2016/2/16.
* @class BI.SimpleTreeView
* @extends BI.Widget
*/
BI.SimpleTreeView = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-simple-tree",
itemsCreator: BI.emptyFn,
items: null
});
},
_init: function () {
BI.SimpleTreeView.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.structure = new BI.Tree();
this.tree = BI.createWidget({
type: "bi.tree_view",
element: this,
itemsCreator: function (op, callback) {
var fn = function (items) {
callback({
items: items
});
self.structure.initTree(BI.Tree.transformToTreeFormat(items));
};
if (BI.isNotNull(o.items)) {
fn(o.items);
} else {
o.itemsCreator(op, fn);
}
}
});
this.tree.on(BI.TreeView.EVENT_CHANGE, function () {
self.fireEvent(BI.SimpleTreeView.EVENT_CHANGE, arguments);
});
if (BI.isNotEmptyArray(o.items)) {
this.populate();
}
if (BI.isNotNull(o.value)) {
this.setValue(o.value);
}
},
populate: function (items, keyword) {
if (items) {
this.options.items = items;
}
this.tree.stroke({
keyword: keyword
});
},
_digest: function (v) {
v || (v = []);
var self = this, map = {};
var selected = [];
BI.each(v, function (i, val) {
var node = self.structure.search(val, "value");
if (node) {
var p = node;
p = p.getParent();
if (p) {
if (!map[p.value]) {
map[p.value] = 0;
}
map[p.value]++;
}
while (p && p.getChildrenLength() <= map[p.value]) {
selected.push(p.value);
p = p.getParent();
if (p) {
if (!map[p.value]) {
map[p.value] = 0;
}
map[p.value]++;
}
}
}
});
return BI.makeObject(v.concat(selected));
},
setValue: function (v) {
this.tree.setValue(this._digest(v));
},
_getValue: function () {
var self = this, result = [], val = this.tree.getValue();
var track = function (nodes) {
BI.each(nodes, function (key, node) {
if (BI.isEmpty(node)) {
result.push(key);
} else {
track(node);
}
});
};
track(val);
return result;
},
empty: function () {
this.tree.empty();
},
getValue: function () {
var self = this, result = [], val = this._getValue();
BI.each(val, function (i, key) {
var target = self.structure.search(key, "value");
if (target) {
self.structure._traverse(target, function (node) {
if (node.isLeaf()) {
result.push(node.value);
}
});
}
});
return result;
}
});
BI.SimpleTreeView.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
/**
* 文本输入框trigger * 文本输入框trigger
* *
* Created by GUY on 2015/9/15. * Created by GUY on 2015/9/15.

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

0
src/base/tree/asynctree.js → src/base/tree/ztree/asynctree.js

0
src/base/tree/parttree.js → src/base/tree/ztree/parttree.js

0
src/base/tree/treeview.js → src/base/tree/ztree/treeview.js

0
src/case/tree/tree.display.js → src/case/tree/ztree/tree.display.js

0
src/case/tree/tree.simple.js → src/case/tree/ztree/tree.simple.js

Loading…
Cancel
Save