diff --git a/bi/case.js b/bi/case.js index b031c8580..4aec4380f 100644 --- a/bi/case.js +++ b/bi/case.js @@ -6437,212 +6437,6 @@ BI.ClearEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; BI.ClearEditor.EVENT_REMOVE = "EVENT_REMOVE"; BI.ClearEditor.EVENT_EMPTY = "EVENT_EMPTY"; BI.shortcut("bi.clear_editor", BI.ClearEditor);/** - * Created by roy on 15/9/14. - */ -BI.SearchEditor = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: "bi-search-editor bi-border", - height: 30, - errorText: "", - watermark: BI.i18nText("BI-Basic_Search"), - validationChecker: BI.emptyFn, - quitChecker: BI.emptyFn - }); - }, - _init: function () { - this.options.height -= 2; - BI.SearchEditor.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.editor = BI.createWidget({ - type: "bi.editor", - height: o.height, - watermark: o.watermark, - allowBlank: true, - errorText: o.errorText, - validationChecker: o.validationChecker, - quitChecker: o.quitChecker - }); - this.clear = BI.createWidget({ - type: "bi.icon_button", - stopEvent: true, - cls: "search-close-h-font" - }); - this.clear.on(BI.IconButton.EVENT_CHANGE, function () { - self.setValue(""); - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT); - self.fireEvent(BI.SearchEditor.EVENT_CLEAR); - }); - BI.createWidget({ - element: this, - type: "bi.htape", - items: [ - { - el: { - type: "bi.center_adapt", - cls: "search-font", - items: [{ - el: { - type: "bi.icon" - } - }] - }, - width: 25 - }, - { - el: self.editor - }, - { - el: this.clear, - width: 25 - } - ] - }); - this.editor.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - - this.editor.on(BI.Editor.EVENT_FOCUS, function () { - self.fireEvent(BI.SearchEditor.EVENT_FOCUS); - }); - this.editor.on(BI.Editor.EVENT_BLUR, function () { - self.fireEvent(BI.SearchEditor.EVENT_BLUR); - }); - this.editor.on(BI.Editor.EVENT_CLICK, function () { - self.fireEvent(BI.SearchEditor.EVENT_CLICK); - }); - this.editor.on(BI.Editor.EVENT_CHANGE, function () { - self._checkClear(); - self.fireEvent(BI.SearchEditor.EVENT_CHANGE); - }); - this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { - self.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN, v); - }); - this.editor.on(BI.Editor.EVENT_SPACE, function () { - self.fireEvent(BI.SearchEditor.EVENT_SPACE) - }); - this.editor.on(BI.Editor.EVENT_BACKSPACE, function () { - self.fireEvent(BI.SearchEditor.EVENT_BACKSPACE) - }); - - - this.editor.on(BI.Editor.EVENT_VALID, function () { - self.fireEvent(BI.SearchEditor.EVENT_VALID) - }); - this.editor.on(BI.Editor.EVENT_ERROR, function () { - self.fireEvent(BI.SearchEditor.EVENT_ERROR) - }); - this.editor.on(BI.Editor.EVENT_ENTER, function () { - self.fireEvent(BI.SearchEditor.EVENT_ENTER); - }); - this.editor.on(BI.Editor.EVENT_RESTRICT, function () { - self.fireEvent(BI.SearchEditor.EVENT_RESTRICT) - }); - this.editor.on(BI.Editor.EVENT_EMPTY, function () { - self._checkClear(); - self.fireEvent(BI.SearchEditor.EVENT_EMPTY) - }); - this.editor.on(BI.Editor.EVENT_REMOVE, function () { - self.fireEvent(BI.SearchEditor.EVENT_REMOVE) - }); - this.editor.on(BI.Editor.EVENT_CONFIRM, function () { - self.fireEvent(BI.SearchEditor.EVENT_CONFIRM) - }); - this.editor.on(BI.Editor.EVENT_START, function () { - self.fireEvent(BI.SearchEditor.EVENT_START); - }); - this.editor.on(BI.Editor.EVENT_PAUSE, function () { - self.fireEvent(BI.SearchEditor.EVENT_PAUSE); - }); - this.editor.on(BI.Editor.EVENT_STOP, function () { - self.fireEvent(BI.SearchEditor.EVENT_STOP); - }); - - this.clear.invisible(); - }, - - _checkClear: function () { - if (!this.getValue()) { - this.clear.invisible(); - } else { - this.clear.visible(); - } - }, - - focus: function () { - this.editor.focus(); - }, - - blur: function () { - this.editor.blur(); - }, - - getValue: function () { - if (this.isValid()) { - var res = this.editor.getValue().match(/[\S]+/g); - return BI.isNull(res) ? "" : res[res.length - 1]; - } - }, - - getLastValidValue: function () { - return this.editor.getLastValidValue(); - }, - - setValue: function (v) { - this.editor.setValue(v); - if (BI.isKey(v)) { - this.clear.visible(); - } - }, - - isEditing: function () { - return this.editor.isEditing(); - }, - - isValid: function () { - return this.editor.isValid(); - } -}); -BI.SearchEditor.EVENT_CHANGE = "EVENT_CHANGE"; -BI.SearchEditor.EVENT_FOCUS = "EVENT_FOCUS"; -BI.SearchEditor.EVENT_BLUR = "EVENT_BLUR"; -BI.SearchEditor.EVENT_CLICK = "EVENT_CLICK"; -BI.SearchEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; -BI.SearchEditor.EVENT_SPACE = "EVENT_SPACE"; -BI.SearchEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; -BI.SearchEditor.EVENT_CLEAR = "EVENT_CLEAR"; - -BI.SearchEditor.EVENT_START = "EVENT_START"; -BI.SearchEditor.EVENT_PAUSE = "EVENT_PAUSE"; -BI.SearchEditor.EVENT_STOP = "EVENT_STOP"; -BI.SearchEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; -BI.SearchEditor.EVENT_VALID = "EVENT_VALID"; -BI.SearchEditor.EVENT_ERROR = "EVENT_ERROR"; -BI.SearchEditor.EVENT_ENTER = "EVENT_ENTER"; -BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE"; -BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY"; -BI.shortcut("bi.search_editor", BI.SearchEditor);/** - * 小号搜索框 - * Created by GUY on 2015/9/29. - * @class BI.SmallSearchEditor - * @extends BI.SearchEditor - */ -BI.SmallSearchEditor = BI.inherit(BI.SearchEditor, { - _defaultConfig: function () { - var conf = BI.SmallSearchEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-small-search-editor", - height: 24 - }); - }, - - _init: function () { - BI.SmallSearchEditor.superclass._init.apply(this, arguments); - } -}); -BI.shortcut("bi.small_search_editor", BI.SmallSearchEditor);/** * 带标记的文本框 * Created by GUY on 2016/1/25. * @class BI.ShelterEditor @@ -7952,187 +7746,6 @@ BI.SimpleStateEditor.EVENT_SPACE = "EVENT_SPACE"; BI.SimpleStateEditor.EVENT_EMPTY = "EVENT_EMPTY"; BI.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);/** - * guy - * @class BI.TextEditor - * @extends BI.Single - */ -BI.TextEditor = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.TextEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - extraCls: "bi-text-editor bi-border", - hgap: 4, - vgap: 2, - lgap: 0, - rgap: 0, - tgap: 0, - bgap: 0, - validationChecker: BI.emptyFn, - quitChecker: BI.emptyFn, - allowBlank: false, - watermark: "", - errorText: "", - height: 30 - }) - }, - - _init: function () { - BI.TextEditor.superclass._init.apply(this, arguments); - var self = this, o = this.options; - if (BI.isNumber(o.height)) { - this.element.css({height: o.height - 2}); - } - if (BI.isNumber(o.width)) { - this.element.css({width: o.width - 2}); - } - this.editor = BI.createWidget({ - type: "bi.editor", - height: o.height - 2, - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, - value: o.value, - validationChecker: o.validationChecker, - quitChecker: o.quitChecker, - allowBlank: o.allowBlank, - watermark: o.watermark, - errorText: o.errorText - }); - this.editor.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - - this.editor.on(BI.Editor.EVENT_FOCUS, function () { - self.fireEvent(BI.TextEditor.EVENT_FOCUS); - }); - this.editor.on(BI.Editor.EVENT_BLUR, function () { - self.fireEvent(BI.TextEditor.EVENT_BLUR); - }); - this.editor.on(BI.Editor.EVENT_CLICK, function () { - self.fireEvent(BI.TextEditor.EVENT_CLICK); - }); - this.editor.on(BI.Editor.EVENT_CHANGE, function () { - self.fireEvent(BI.TextEditor.EVENT_CHANGE); - }); - this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { - self.fireEvent(BI.TextEditor.EVENT_KEY_DOWN); - }); - this.editor.on(BI.Editor.EVENT_SPACE, function (v) { - self.fireEvent(BI.TextEditor.EVENT_SPACE); - }); - this.editor.on(BI.Editor.EVENT_BACKSPACE, function (v) { - self.fireEvent(BI.TextEditor.EVENT_BACKSPACE); - }); - - - this.editor.on(BI.Editor.EVENT_VALID, function () { - self.fireEvent(BI.TextEditor.EVENT_VALID); - }); - this.editor.on(BI.Editor.EVENT_CONFIRM, function () { - self.fireEvent(BI.TextEditor.EVENT_CONFIRM); - }); - this.editor.on(BI.Editor.EVENT_REMOVE, function (v) { - self.fireEvent(BI.TextEditor.EVENT_REMOVE); - }); - this.editor.on(BI.Editor.EVENT_START, function () { - self.fireEvent(BI.TextEditor.EVENT_START); - }); - this.editor.on(BI.Editor.EVENT_PAUSE, function () { - self.fireEvent(BI.TextEditor.EVENT_PAUSE); - }); - this.editor.on(BI.Editor.EVENT_STOP, function () { - self.fireEvent(BI.TextEditor.EVENT_STOP); - }); - this.editor.on(BI.Editor.EVENT_ERROR, function () { - self.fireEvent(BI.TextEditor.EVENT_ERROR, arguments); - }); - this.editor.on(BI.Editor.EVENT_ENTER, function () { - self.fireEvent(BI.TextEditor.EVENT_ENTER); - }); - this.editor.on(BI.Editor.EVENT_RESTRICT, function () { - self.fireEvent(BI.TextEditor.EVENT_RESTRICT); - }); - this.editor.on(BI.Editor.EVENT_EMPTY, function () { - self.fireEvent(BI.TextEditor.EVENT_EMPTY); - }); - BI.createWidget({ - type: "bi.vertical", - scrolly: false, - element: this, - items: [this.editor] - }); - }, - - focus: function () { - this.editor.focus(); - }, - - blur: function () { - this.editor.blur(); - }, - - setErrorText: function (text) { - this.editor.setErrorText(text); - }, - - getErrorText: function () { - return this.editor.getErrorText(); - }, - - isValid: function () { - return this.editor.isValid(); - }, - - setValue: function (v) { - this.editor.setValue(v); - }, - - getValue: function () { - return this.editor.getValue(); - } -}); -BI.TextEditor.EVENT_CHANGE = "EVENT_CHANGE"; -BI.TextEditor.EVENT_FOCUS = "EVENT_FOCUS"; -BI.TextEditor.EVENT_BLUR = "EVENT_BLUR"; -BI.TextEditor.EVENT_CLICK = "EVENT_CLICK"; -BI.TextEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; -BI.TextEditor.EVENT_SPACE = "EVENT_SPACE"; -BI.TextEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; - -BI.TextEditor.EVENT_START = "EVENT_START"; -BI.TextEditor.EVENT_PAUSE = "EVENT_PAUSE"; -BI.TextEditor.EVENT_STOP = "EVENT_STOP"; -BI.TextEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; -BI.TextEditor.EVENT_VALID = "EVENT_VALID"; -BI.TextEditor.EVENT_ERROR = "EVENT_ERROR"; -BI.TextEditor.EVENT_ENTER = "EVENT_ENTER"; -BI.TextEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.TextEditor.EVENT_REMOVE = "EVENT_REMOVE"; -BI.TextEditor.EVENT_EMPTY = "EVENT_EMPTY"; - -BI.shortcut("bi.text_editor", BI.TextEditor);/** - * 小号搜索框 - * Created by GUY on 2015/9/29. - * @class BI.SmallTextEditor - * @extends BI.SearchEditor - */ -BI.SmallTextEditor = BI.inherit(BI.TextEditor, { - _defaultConfig: function () { - var conf = BI.SmallTextEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-small-text-editor", - height: 25 - }); - }, - - _init: function () { - BI.SmallTextEditor.superclass._init.apply(this, arguments); - } -}); -BI.shortcut("bi.small_text_editor", BI.SmallTextEditor);/** * 有确定取消按钮的弹出层 * @class BI.BarFloatSection * @extends BI.FloatSection @@ -11891,6 +11504,503 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, { }); BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE"; BI.shortcut("bi.multi_select_bar", BI.MultiSelectBar);/** + * 表关联树 + * + * Created by GUY on 2015/12/15. + * @class BI.BranchRelation + * @extends BI.Widget + */ +BI.BranchRelation = BI.inherit(BI.Widget, { + + _defaultConfig: function () { + return BI.extend(BI.BranchRelation.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-branch-relation-tree", + items: [], + + centerOffset: 0,//重心偏移量 + direction: BI.Direction.Bottom, + align: BI.VerticalAlign.Top + }) + }, + + _init: function () { + BI.BranchRelation.superclass._init.apply(this, arguments); + this.populate(this.options.items); + }, + + //树分层 + _stratification: function () { + var levels = []; + this.tree.recursion(function (node, route) { + //node.isRoot = route.length <= 1; + node.leaf = node.isLeaf(); + if (!levels[route.length - 1]) { + levels[route.length - 1] = []; + } + levels[route.length - 1].push(node); + }); + return levels; + }, + + //计算所有节点的叶子结点个数 + _calculateLeaves: function () { + var count = 0; + + function track(node) { + var c = 0; + if (node.isLeaf()) { + return 1; + } + BI.each(node.getChildren(), function (i, child) { + c += track(child); + }); + node.set("leaves", c); + return c; + } + + count = track(this.tree.getRoot()); + return count; + }, + + //树平移 + _translate: function (levels) { + var adjust = []; + var maxLevel = levels.length; + BI.each(levels, function (i, nodes) { + if (!adjust[i]) { + adjust[i] = []; + } + BI.each(nodes, function (j, node) { + if (node.isLeaf() && i < maxLevel - 1) { + var newNode = new BI.Node(BI.UUID()); + //newNode.isEmptyRoot = node.isRoot || node.isEmptyRoot; + newNode.isNew = true; + //把node向下一层移 + var tar = 0; + if (j > 0) { + var c = nodes[j - 1].getLastChild(); + tar = levels[i + 1].indexOf(c) + 1; + } + levels[i + 1].splice(tar, 0, node); + //新增一个临时树节点 + var index = node.parent.getChildIndex(node.id); + node.parent.removeChildByIndex(index); + node.parent.addChild(newNode, index); + newNode.addChild(node); + adjust[i].push(newNode); + nodes[j] = newNode; + } else { + adjust[i].push(node); + } + }) + }); + return adjust; + }, + + //树补白 + _fill: function (levels) { + var adjust = []; + var maxLevel = levels.length; + BI.each(levels, function (i, nodes) { + if (!adjust[i]) { + adjust[i] = []; + } + BI.each(nodes, function (j, node) { + if (node.isLeaf() && i < maxLevel - 1) { + var newNode = new BI.Node(BI.UUID()); + newNode.leaf = true; + newNode.width = node.width; + newNode.height = node.height; + newNode.isNew = true; + //把node向下一层移 + var tar = 0; + if (j > 0) { + var c = nodes[j - 1].getLastChild(); + tar = levels[i + 1].indexOf(c) + 1; + } + levels[i + 1].splice(tar, 0, newNode); + //新增一个临时树节点 + node.addChild(newNode); + } + adjust[i].push(node); + }) + }); + return adjust; + }, + + //树调整 + _adjust: function (adjust) { + while (true) { + var isAllNeedAjust = false; + BI.backEach(adjust, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (!node.isNew) { + var needAdjust = true; + BI.any(node.getChildren(), function (k, n) { + if (!n.isNew) { + needAdjust = false; + return true; + } + }); + if (!node.isLeaf() && needAdjust === true) { + var allChilds = []; + BI.each(node.getChildren(), function (k, n) { + allChilds = allChilds.concat(n.getChildren()); + }); + node.removeAllChilds(); + BI.each(allChilds, function (k, c) { + node.addChild(c); + }); + var newNode = new BI.Node(BI.UUID()); + //newNode.isEmptyRoot = node.isRoot || node.isEmptyRoot; + newNode.isNew = true; + var index = node.parent.getChildIndex(node.id); + node.parent.removeChildByIndex(index); + node.parent.addChild(newNode, index); + newNode.addChild(node); + isAllNeedAjust = true; + } + } + }) + }); + if (isAllNeedAjust === false) { + break; + } else {//树重构 + adjust = this._stratification(); + } + } + return adjust; + }, + + _calculateWidth: function () { + var o = this.options; + var width = 0; + + function track1(node) { + var w = 0; + if (node.isLeaf()) { + return node.width; + } + BI.each(node.getChildren(), function (i, child) { + w += track1(child); + }); + return w; + } + + function track2(node) { + var w = 0; + if (node.isLeaf()) { + return node.height; + } + BI.each(node.getChildren(), function (i, child) { + w += track2(child); + }); + return w; + } + + if (this._isVertical()) { + width = track1(this.tree.getRoot()); + } else { + width = track2(this.tree.getRoot()); + } + + return width; + }, + + _isVertical: function () { + var o = this.options; + return o.direction === BI.Direction.Top || o.direction === BI.Direction.Bottom; + }, + + _calculateHeight: function () { + var o = this.options; + var height = 0; + + function track1(node) { + var h = 0; + BI.each(node.getChildren(), function (i, child) { + h = Math.max(h, track1(child)); + }); + return h + (node.height || 0); + } + + function track2(node) { + var h = 0; + BI.each(node.getChildren(), function (i, child) { + h = Math.max(h, track2(child)); + }); + return h + (node.width || 0); + } + + if (this._isVertical()) { + height = track1(this.tree.getRoot()); + } else { + height = track2(this.tree.getRoot()); + } + return height; + }, + + _calculateXY: function (levels) { + var o = this.options; + var width = this._calculateWidth(); + var height = this._calculateHeight(); + var levelCount = levels.length; + var allLeavesCount = this._calculateLeaves(); + //计算坐标 + var xy = {}; + var levelHeight = height / levelCount; + BI.each(levels, function (i, nodes) { + //计算权重 + var weights = []; + BI.each(nodes, function (j, node) { + weights[j] = (node.get("leaves") || 1) / allLeavesCount; + }); + BI.each(nodes, function (j, node) { + //求前j个元素的权重 + var weight = BI.sum(weights.slice(0, j)); + //求坐标 + var x = weight * width + weights[j] * width / 2; + var y = i * levelHeight + levelHeight / 2; + xy[node.id] = {x: x, y: y}; + }) + }); + return xy; + }, + + _stroke: function (levels, xy) { + var height = this._calculateHeight(); + var levelCount = levels.length; + var levelHeight = height / levelCount; + var self = this, o = this.options; + switch (o.direction) { + case BI.Direction.Top: + BI.each(levels, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (node.getChildrenLength() > 0 && !node.leaf) { + var path = ""; + var start = xy[node.id]; + var split = start.y + levelHeight / 2; + path += "M" + start.x + "," + (start.y + o.centerOffset) + "L" + start.x + "," + split; + var end = []; + BI.each(node.getChildren(), function (t, c) { + var e = end[t] = xy[c.id]; + path += "M" + e.x + "," + (e.y + o.centerOffset) + "L" + e.x + "," + split; + }); + if (end.length > 0) { + path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split; + } + self.svg.path(path).attr("stroke", "#d4dadd"); + } + }) + }); + break; + case BI.Direction.Bottom: + BI.each(levels, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (node.getChildrenLength() > 0 && !node.leaf) { + var path = ""; + var start = xy[node.id]; + var split = start.y - levelHeight / 2; + path += "M" + start.x + "," + (start.y - o.centerOffset) + "L" + start.x + "," + split; + var end = []; + BI.each(node.getChildren(), function (t, c) { + var e = end[t] = xy[c.id]; + path += "M" + e.x + "," + (e.y - o.centerOffset) + "L" + e.x + "," + split; + }); + if (end.length > 0) { + path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split; + } + self.svg.path(path).attr("stroke", "#d4dadd"); + } + }) + }); + break; + case BI.Direction.Left: + BI.each(levels, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (node.getChildrenLength() > 0 && !node.leaf) { + var path = ""; + var start = xy[node.id]; + var split = start.y + levelHeight / 2; + path += "M" + (start.y + o.centerOffset) + "," + start.x + "L" + split + "," + start.x; + var end = []; + BI.each(node.getChildren(), function (t, c) { + var e = end[t] = xy[c.id]; + path += "M" + (e.y + o.centerOffset) + "," + e.x + "L" + split + "," + e.x; + }); + if (end.length > 0) { + path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x; + } + self.svg.path(path).attr("stroke", "#d4dadd"); + } + }) + }); + break; + case BI.Direction.Right: + BI.each(levels, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (node.getChildrenLength() > 0 && !node.leaf) { + var path = ""; + var start = xy[node.id]; + var split = start.y - levelHeight / 2; + path += "M" + (start.y - o.centerOffset) + "," + start.x + "L" + split + "," + start.x; + var end = []; + BI.each(node.getChildren(), function (t, c) { + var e = end[t] = xy[c.id]; + path += "M" + (e.y - o.centerOffset) + "," + e.x + "L" + split + "," + e.x; + }); + if (end.length > 0) { + path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x; + } + self.svg.path(path).attr("stroke", "#d4dadd"); + } + }) + }); + break; + } + }, + + _createBranches: function (levels) { + var self = this, o = this.options; + if (o.direction === BI.Direction.Bottom || o.direction === BI.Direction.Right) { + levels = levels.reverse(); + } + var xy = this._calculateXY(levels); + //画图 + this._stroke(levels, xy); + }, + + _isNeedAdjust: function () { + var o = this.options; + return o.direction === BI.Direction.Top && o.align === BI.VerticalAlign.Bottom || o.direction === BI.Direction.Bottom && o.align === BI.VerticalAlign.Top + || o.direction === BI.Direction.Left && o.align === BI.HorizontalAlign.Right || o.direction === BI.Direction.Right && o.align === BI.HorizontalAlign.Left + }, + + setValue: function (value) { + + }, + + getValue: function () { + + }, + + _transformToTreeFormat: function (sNodes) { + var i, l; + if (!sNodes) { + return []; + } + + if (BI.isArray(sNodes)) { + var r = []; + var tmpMap = []; + for (i = 0, l = sNodes.length; i < l; i++) { + tmpMap[sNodes[i].id] = sNodes[i]; + } + for (i = 0, l = sNodes.length; i < l; i++) { + if (tmpMap[sNodes[i].pId] && sNodes[i].id != sNodes[i].pId) { + if (!tmpMap[sNodes[i].pId].children) { + tmpMap[sNodes[i].pId].children = []; + } + tmpMap[sNodes[i].pId].children.push(sNodes[i]); + } else { + r.push(sNodes[i]); + } + } + return r; + } else { + return [sNodes]; + } + }, + + populate: function (items) { + var self = this, o = this.options; + o.items = items || []; + this.empty(); + items = this._transformToTreeFormat(o.items); + this.tree = new BI.Tree(); + this.tree.initTree(items); + + this.svg = BI.createWidget({ + type: "bi.svg" + }); + + //树分层 + var levels = this._stratification(); + + if (this._isNeedAdjust()) { + //树平移 + var adjust = this._translate(levels); + //树调整 + adjust = this._adjust(adjust); + + this._createBranches(adjust); + } else { + var adjust = this._fill(levels); + + this._createBranches(adjust); + } + + var container = BI.createWidget({ + type: "bi.layout", + width: this._isVertical() ? this._calculateWidth() : this._calculateHeight(), + height: this._isVertical() ? this._calculateHeight() : this._calculateWidth() + }); + BI.createWidget({ + type: "bi.absolute", + element: container, + items: [{ + el: this.svg, + top: 0, + left: 0, + right: 0, + bottom: 0 + }] + }); + if (this._isVertical()) { + items = [{ + type: "bi.handstand_branch_tree", + expander: { + direction: o.direction + }, + el: { + layouts: [{ + type: "bi.horizontal_adapt", + verticalAlign: o.align + }] + }, + items: items + }] + } else { + items = [{ + type: "bi.branch_tree", + expander: { + direction: o.direction + }, + el: { + layouts: [{ + type: "bi.vertical" + }, { + type: o.align === BI.HorizontalAlign.Left ? "bi.left" : "bi.right" + }] + }, + items: items + }] + } + BI.createWidget({ + type: "bi.adaptive", + element: container, + items: items + }); + BI.createWidget({ + type: "bi.center_adapt", + scrollable: true, + element: this, + items: [container] + }); + } +}); +BI.BranchRelation.EVENT_CHANGE = "BranchRelation.EVENT_CHANGE"; +BI.shortcut("bi.branch_relation", BI.BranchRelation);/** * 倒立的Branch * @class BI.HandStandBranchExpander * @extend BI.Widget diff --git a/bi/widget.js b/bi/widget.js index 43e0631fb..dc41f351b 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -1842,503 +1842,6 @@ BI.extend(BI.Arrangement, { } }); BI.shortcut('bi.arrangement', BI.Arrangement);/** - * 表关联树 - * - * Created by GUY on 2015/12/15. - * @class BI.BranchRelation - * @extends BI.Widget - */ -BI.BranchRelation = BI.inherit(BI.Widget, { - - _defaultConfig: function () { - return BI.extend(BI.BranchRelation.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-branch-relation-tree", - items: [], - - centerOffset: 0,//重心偏移量 - direction: BI.Direction.Bottom, - align: BI.VerticalAlign.Top - }) - }, - - _init: function () { - BI.BranchRelation.superclass._init.apply(this, arguments); - this.populate(this.options.items); - }, - - //树分层 - _stratification: function () { - var levels = []; - this.tree.recursion(function (node, route) { - //node.isRoot = route.length <= 1; - node.leaf = node.isLeaf(); - if (!levels[route.length - 1]) { - levels[route.length - 1] = []; - } - levels[route.length - 1].push(node); - }); - return levels; - }, - - //计算所有节点的叶子结点个数 - _calculateLeaves: function () { - var count = 0; - - function track(node) { - var c = 0; - if (node.isLeaf()) { - return 1; - } - BI.each(node.getChildren(), function (i, child) { - c += track(child); - }); - node.set("leaves", c); - return c; - } - - count = track(this.tree.getRoot()); - return count; - }, - - //树平移 - _translate: function (levels) { - var adjust = []; - var maxLevel = levels.length; - BI.each(levels, function (i, nodes) { - if (!adjust[i]) { - adjust[i] = []; - } - BI.each(nodes, function (j, node) { - if (node.isLeaf() && i < maxLevel - 1) { - var newNode = new BI.Node(BI.UUID()); - //newNode.isEmptyRoot = node.isRoot || node.isEmptyRoot; - newNode.isNew = true; - //把node向下一层移 - var tar = 0; - if (j > 0) { - var c = nodes[j - 1].getLastChild(); - tar = levels[i + 1].indexOf(c) + 1; - } - levels[i + 1].splice(tar, 0, node); - //新增一个临时树节点 - var index = node.parent.getChildIndex(node.id); - node.parent.removeChildByIndex(index); - node.parent.addChild(newNode, index); - newNode.addChild(node); - adjust[i].push(newNode); - nodes[j] = newNode; - } else { - adjust[i].push(node); - } - }) - }); - return adjust; - }, - - //树补白 - _fill: function (levels) { - var adjust = []; - var maxLevel = levels.length; - BI.each(levels, function (i, nodes) { - if (!adjust[i]) { - adjust[i] = []; - } - BI.each(nodes, function (j, node) { - if (node.isLeaf() && i < maxLevel - 1) { - var newNode = new BI.Node(BI.UUID()); - newNode.leaf = true; - newNode.width = node.width; - newNode.height = node.height; - newNode.isNew = true; - //把node向下一层移 - var tar = 0; - if (j > 0) { - var c = nodes[j - 1].getLastChild(); - tar = levels[i + 1].indexOf(c) + 1; - } - levels[i + 1].splice(tar, 0, newNode); - //新增一个临时树节点 - node.addChild(newNode); - } - adjust[i].push(node); - }) - }); - return adjust; - }, - - //树调整 - _adjust: function (adjust) { - while (true) { - var isAllNeedAjust = false; - BI.backEach(adjust, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (!node.isNew) { - var needAdjust = true; - BI.any(node.getChildren(), function (k, n) { - if (!n.isNew) { - needAdjust = false; - return true; - } - }); - if (!node.isLeaf() && needAdjust === true) { - var allChilds = []; - BI.each(node.getChildren(), function (k, n) { - allChilds = allChilds.concat(n.getChildren()); - }); - node.removeAllChilds(); - BI.each(allChilds, function (k, c) { - node.addChild(c); - }); - var newNode = new BI.Node(BI.UUID()); - //newNode.isEmptyRoot = node.isRoot || node.isEmptyRoot; - newNode.isNew = true; - var index = node.parent.getChildIndex(node.id); - node.parent.removeChildByIndex(index); - node.parent.addChild(newNode, index); - newNode.addChild(node); - isAllNeedAjust = true; - } - } - }) - }); - if (isAllNeedAjust === false) { - break; - } else {//树重构 - adjust = this._stratification(); - } - } - return adjust; - }, - - _calculateWidth: function () { - var o = this.options; - var width = 0; - - function track1(node) { - var w = 0; - if (node.isLeaf()) { - return node.width; - } - BI.each(node.getChildren(), function (i, child) { - w += track1(child); - }); - return w; - } - - function track2(node) { - var w = 0; - if (node.isLeaf()) { - return node.height; - } - BI.each(node.getChildren(), function (i, child) { - w += track2(child); - }); - return w; - } - - if (this._isVertical()) { - width = track1(this.tree.getRoot()); - } else { - width = track2(this.tree.getRoot()); - } - - return width; - }, - - _isVertical: function () { - var o = this.options; - return o.direction === BI.Direction.Top || o.direction === BI.Direction.Bottom; - }, - - _calculateHeight: function () { - var o = this.options; - var height = 0; - - function track1(node) { - var h = 0; - BI.each(node.getChildren(), function (i, child) { - h = Math.max(h, track1(child)); - }); - return h + (node.height || 0); - } - - function track2(node) { - var h = 0; - BI.each(node.getChildren(), function (i, child) { - h = Math.max(h, track2(child)); - }); - return h + (node.width || 0); - } - - if (this._isVertical()) { - height = track1(this.tree.getRoot()); - } else { - height = track2(this.tree.getRoot()); - } - return height; - }, - - _calculateXY: function (levels) { - var o = this.options; - var width = this._calculateWidth(); - var height = this._calculateHeight(); - var levelCount = levels.length; - var allLeavesCount = this._calculateLeaves(); - //计算坐标 - var xy = {}; - var levelHeight = height / levelCount; - BI.each(levels, function (i, nodes) { - //计算权重 - var weights = []; - BI.each(nodes, function (j, node) { - weights[j] = (node.get("leaves") || 1) / allLeavesCount; - }); - BI.each(nodes, function (j, node) { - //求前j个元素的权重 - var weight = BI.sum(weights.slice(0, j)); - //求坐标 - var x = weight * width + weights[j] * width / 2; - var y = i * levelHeight + levelHeight / 2; - xy[node.id] = {x: x, y: y}; - }) - }); - return xy; - }, - - _stroke: function (levels, xy) { - var height = this._calculateHeight(); - var levelCount = levels.length; - var levelHeight = height / levelCount; - var self = this, o = this.options; - switch (o.direction) { - case BI.Direction.Top: - BI.each(levels, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (node.getChildrenLength() > 0 && !node.leaf) { - var path = ""; - var start = xy[node.id]; - var split = start.y + levelHeight / 2; - path += "M" + start.x + "," + (start.y + o.centerOffset) + "L" + start.x + "," + split; - var end = []; - BI.each(node.getChildren(), function (t, c) { - var e = end[t] = xy[c.id]; - path += "M" + e.x + "," + (e.y + o.centerOffset) + "L" + e.x + "," + split; - }); - if (end.length > 0) { - path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split; - } - self.svg.path(path).attr("stroke", "#d4dadd"); - } - }) - }); - break; - case BI.Direction.Bottom: - BI.each(levels, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (node.getChildrenLength() > 0 && !node.leaf) { - var path = ""; - var start = xy[node.id]; - var split = start.y - levelHeight / 2; - path += "M" + start.x + "," + (start.y - o.centerOffset) + "L" + start.x + "," + split; - var end = []; - BI.each(node.getChildren(), function (t, c) { - var e = end[t] = xy[c.id]; - path += "M" + e.x + "," + (e.y - o.centerOffset) + "L" + e.x + "," + split; - }); - if (end.length > 0) { - path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split; - } - self.svg.path(path).attr("stroke", "#d4dadd"); - } - }) - }); - break; - case BI.Direction.Left: - BI.each(levels, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (node.getChildrenLength() > 0 && !node.leaf) { - var path = ""; - var start = xy[node.id]; - var split = start.y + levelHeight / 2; - path += "M" + (start.y + o.centerOffset) + "," + start.x + "L" + split + "," + start.x; - var end = []; - BI.each(node.getChildren(), function (t, c) { - var e = end[t] = xy[c.id]; - path += "M" + (e.y + o.centerOffset) + "," + e.x + "L" + split + "," + e.x; - }); - if (end.length > 0) { - path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x; - } - self.svg.path(path).attr("stroke", "#d4dadd"); - } - }) - }); - break; - case BI.Direction.Right: - BI.each(levels, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (node.getChildrenLength() > 0 && !node.leaf) { - var path = ""; - var start = xy[node.id]; - var split = start.y - levelHeight / 2; - path += "M" + (start.y - o.centerOffset) + "," + start.x + "L" + split + "," + start.x; - var end = []; - BI.each(node.getChildren(), function (t, c) { - var e = end[t] = xy[c.id]; - path += "M" + (e.y - o.centerOffset) + "," + e.x + "L" + split + "," + e.x; - }); - if (end.length > 0) { - path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x; - } - self.svg.path(path).attr("stroke", "#d4dadd"); - } - }) - }); - break; - } - }, - - _createBranches: function (levels) { - var self = this, o = this.options; - if (o.direction === BI.Direction.Bottom || o.direction === BI.Direction.Right) { - levels = levels.reverse(); - } - var xy = this._calculateXY(levels); - //画图 - this._stroke(levels, xy); - }, - - _isNeedAdjust: function () { - var o = this.options; - return o.direction === BI.Direction.Top && o.align === BI.VerticalAlign.Bottom || o.direction === BI.Direction.Bottom && o.align === BI.VerticalAlign.Top - || o.direction === BI.Direction.Left && o.align === BI.HorizontalAlign.Right || o.direction === BI.Direction.Right && o.align === BI.HorizontalAlign.Left - }, - - setValue: function (value) { - - }, - - getValue: function () { - - }, - - _transformToTreeFormat: function (sNodes) { - var i, l; - if (!sNodes) { - return []; - } - - if (BI.isArray(sNodes)) { - var r = []; - var tmpMap = []; - for (i = 0, l = sNodes.length; i < l; i++) { - tmpMap[sNodes[i].id] = sNodes[i]; - } - for (i = 0, l = sNodes.length; i < l; i++) { - if (tmpMap[sNodes[i].pId] && sNodes[i].id != sNodes[i].pId) { - if (!tmpMap[sNodes[i].pId].children) { - tmpMap[sNodes[i].pId].children = []; - } - tmpMap[sNodes[i].pId].children.push(sNodes[i]); - } else { - r.push(sNodes[i]); - } - } - return r; - } else { - return [sNodes]; - } - }, - - populate: function (items) { - var self = this, o = this.options; - o.items = items || []; - this.empty(); - items = this._transformToTreeFormat(o.items); - this.tree = new BI.Tree(); - this.tree.initTree(items); - - this.svg = BI.createWidget({ - type: "bi.svg" - }); - - //树分层 - var levels = this._stratification(); - - if (this._isNeedAdjust()) { - //树平移 - var adjust = this._translate(levels); - //树调整 - adjust = this._adjust(adjust); - - this._createBranches(adjust); - } else { - var adjust = this._fill(levels); - - this._createBranches(adjust); - } - - var container = BI.createWidget({ - type: "bi.layout", - width: this._isVertical() ? this._calculateWidth() : this._calculateHeight(), - height: this._isVertical() ? this._calculateHeight() : this._calculateWidth() - }); - BI.createWidget({ - type: "bi.absolute", - element: container, - items: [{ - el: this.svg, - top: 0, - left: 0, - right: 0, - bottom: 0 - }] - }); - if (this._isVertical()) { - items = [{ - type: "bi.handstand_branch_tree", - expander: { - direction: o.direction - }, - el: { - layouts: [{ - type: "bi.horizontal_adapt", - verticalAlign: o.align - }] - }, - items: items - }] - } else { - items = [{ - type: "bi.branch_tree", - expander: { - direction: o.direction - }, - el: { - layouts: [{ - type: "bi.vertical" - }, { - type: o.align === BI.HorizontalAlign.Left ? "bi.left" : "bi.right" - }] - }, - items: items - }] - } - BI.createWidget({ - type: "bi.adaptive", - element: container, - items: items - }); - BI.createWidget({ - type: "bi.center_adapt", - scrollable: true, - element: this, - items: [container] - }); - } -}); -BI.BranchRelation.EVENT_CHANGE = "BranchRelation.EVENT_CHANGE"; -BI.shortcut("bi.branch_relation", BI.BranchRelation);/** * 日期控件中的月份下拉框 * * Created by GUY on 2015/9/7. @@ -3250,7 +2753,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, { } }); -BI.shortcut("bi.date_pane_widget", BI.DatePaneWidget);/** +BI.shortcut("bi.date_pane", BI.DatePaneWidget);/** * Created by Urthur on 2017/7/14. */ BI.DateTimeCombo = BI.inherit(BI.Single, { @@ -3328,8 +2831,8 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { }); var triggerBtn = BI.createWidget({ - type: "bi.trigger_icon_button", - cls: "bi-trigger-date-button chart-date-normal-font bi-border-right", + type: "bi.icon_button", + cls: "bi-trigger-icon-button date-font bi-border-right", width: 30, height: 24 }); @@ -4557,6 +4060,393 @@ BI.DownListPopup = BI.inherit(BI.Pane, { BI.DownListPopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.DownListPopup.EVENT_SON_VALUE_CHANGE = "EVENT_SON_VALUE_CHANGE"; BI.shortcut("bi.down_list_popup", BI.DownListPopup);/** + * Created by roy on 15/9/14. + */ +BI.SearchEditor = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: "bi-search-editor bi-border", + height: 30, + errorText: "", + watermark: BI.i18nText("BI-Basic_Search"), + validationChecker: BI.emptyFn, + quitChecker: BI.emptyFn + }); + }, + _init: function () { + this.options.height -= 2; + BI.SearchEditor.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.editor = BI.createWidget({ + type: "bi.editor", + height: o.height, + watermark: o.watermark, + allowBlank: true, + errorText: o.errorText, + validationChecker: o.validationChecker, + quitChecker: o.quitChecker + }); + this.clear = BI.createWidget({ + type: "bi.icon_button", + stopEvent: true, + cls: "search-close-h-font" + }); + this.clear.on(BI.IconButton.EVENT_CHANGE, function () { + self.setValue(""); + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT); + self.fireEvent(BI.SearchEditor.EVENT_CLEAR); + }); + BI.createWidget({ + element: this, + type: "bi.htape", + items: [ + { + el: { + type: "bi.center_adapt", + cls: "search-font", + items: [{ + el: { + type: "bi.icon" + } + }] + }, + width: 25 + }, + { + el: self.editor + }, + { + el: this.clear, + width: 25 + } + ] + }); + this.editor.on(BI.Controller.EVENT_CHANGE, function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); + + this.editor.on(BI.Editor.EVENT_FOCUS, function () { + self.fireEvent(BI.SearchEditor.EVENT_FOCUS); + }); + this.editor.on(BI.Editor.EVENT_BLUR, function () { + self.fireEvent(BI.SearchEditor.EVENT_BLUR); + }); + this.editor.on(BI.Editor.EVENT_CLICK, function () { + self.fireEvent(BI.SearchEditor.EVENT_CLICK); + }); + this.editor.on(BI.Editor.EVENT_CHANGE, function () { + self._checkClear(); + self.fireEvent(BI.SearchEditor.EVENT_CHANGE); + }); + this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { + self.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN, v); + }); + this.editor.on(BI.Editor.EVENT_SPACE, function () { + self.fireEvent(BI.SearchEditor.EVENT_SPACE) + }); + this.editor.on(BI.Editor.EVENT_BACKSPACE, function () { + self.fireEvent(BI.SearchEditor.EVENT_BACKSPACE) + }); + + + this.editor.on(BI.Editor.EVENT_VALID, function () { + self.fireEvent(BI.SearchEditor.EVENT_VALID) + }); + this.editor.on(BI.Editor.EVENT_ERROR, function () { + self.fireEvent(BI.SearchEditor.EVENT_ERROR) + }); + this.editor.on(BI.Editor.EVENT_ENTER, function () { + self.fireEvent(BI.SearchEditor.EVENT_ENTER); + }); + this.editor.on(BI.Editor.EVENT_RESTRICT, function () { + self.fireEvent(BI.SearchEditor.EVENT_RESTRICT) + }); + this.editor.on(BI.Editor.EVENT_EMPTY, function () { + self._checkClear(); + self.fireEvent(BI.SearchEditor.EVENT_EMPTY) + }); + this.editor.on(BI.Editor.EVENT_REMOVE, function () { + self.fireEvent(BI.SearchEditor.EVENT_REMOVE) + }); + this.editor.on(BI.Editor.EVENT_CONFIRM, function () { + self.fireEvent(BI.SearchEditor.EVENT_CONFIRM) + }); + this.editor.on(BI.Editor.EVENT_START, function () { + self.fireEvent(BI.SearchEditor.EVENT_START); + }); + this.editor.on(BI.Editor.EVENT_PAUSE, function () { + self.fireEvent(BI.SearchEditor.EVENT_PAUSE); + }); + this.editor.on(BI.Editor.EVENT_STOP, function () { + self.fireEvent(BI.SearchEditor.EVENT_STOP); + }); + + this.clear.invisible(); + }, + + _checkClear: function () { + if (!this.getValue()) { + this.clear.invisible(); + } else { + this.clear.visible(); + } + }, + + focus: function () { + this.editor.focus(); + }, + + blur: function () { + this.editor.blur(); + }, + + getValue: function () { + if (this.isValid()) { + var res = this.editor.getValue().match(/[\S]+/g); + return BI.isNull(res) ? "" : res[res.length - 1]; + } + }, + + getLastValidValue: function () { + return this.editor.getLastValidValue(); + }, + + setValue: function (v) { + this.editor.setValue(v); + if (BI.isKey(v)) { + this.clear.visible(); + } + }, + + isEditing: function () { + return this.editor.isEditing(); + }, + + isValid: function () { + return this.editor.isValid(); + } +}); +BI.SearchEditor.EVENT_CHANGE = "EVENT_CHANGE"; +BI.SearchEditor.EVENT_FOCUS = "EVENT_FOCUS"; +BI.SearchEditor.EVENT_BLUR = "EVENT_BLUR"; +BI.SearchEditor.EVENT_CLICK = "EVENT_CLICK"; +BI.SearchEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; +BI.SearchEditor.EVENT_SPACE = "EVENT_SPACE"; +BI.SearchEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; +BI.SearchEditor.EVENT_CLEAR = "EVENT_CLEAR"; + +BI.SearchEditor.EVENT_START = "EVENT_START"; +BI.SearchEditor.EVENT_PAUSE = "EVENT_PAUSE"; +BI.SearchEditor.EVENT_STOP = "EVENT_STOP"; +BI.SearchEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.SearchEditor.EVENT_VALID = "EVENT_VALID"; +BI.SearchEditor.EVENT_ERROR = "EVENT_ERROR"; +BI.SearchEditor.EVENT_ENTER = "EVENT_ENTER"; +BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; +BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE"; +BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY"; +BI.shortcut("bi.search_editor", BI.SearchEditor);/** + * 小号搜索框 + * Created by GUY on 2015/9/29. + * @class BI.SmallSearchEditor + * @extends BI.SearchEditor + */ +BI.SmallSearchEditor = BI.inherit(BI.SearchEditor, { + _defaultConfig: function () { + var conf = BI.SmallSearchEditor.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-small-search-editor", + height: 24 + }); + }, + + _init: function () { + BI.SmallSearchEditor.superclass._init.apply(this, arguments); + } +}); +BI.shortcut("bi.small_search_editor", BI.SmallSearchEditor);/** + * guy + * @class BI.TextEditor + * @extends BI.Single + */ +BI.TextEditor = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.TextEditor.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + extraCls: "bi-text-editor bi-border", + hgap: 4, + vgap: 2, + lgap: 0, + rgap: 0, + tgap: 0, + bgap: 0, + validationChecker: BI.emptyFn, + quitChecker: BI.emptyFn, + allowBlank: false, + watermark: "", + errorText: "", + height: 30 + }) + }, + + _init: function () { + BI.TextEditor.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNumber(o.height)) { + this.element.css({height: o.height - 2}); + } + if (BI.isNumber(o.width)) { + this.element.css({width: o.width - 2}); + } + this.editor = BI.createWidget({ + type: "bi.editor", + height: o.height - 2, + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, + value: o.value, + validationChecker: o.validationChecker, + quitChecker: o.quitChecker, + allowBlank: o.allowBlank, + watermark: o.watermark, + errorText: o.errorText + }); + this.editor.on(BI.Controller.EVENT_CHANGE, function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); + + this.editor.on(BI.Editor.EVENT_FOCUS, function () { + self.fireEvent(BI.TextEditor.EVENT_FOCUS); + }); + this.editor.on(BI.Editor.EVENT_BLUR, function () { + self.fireEvent(BI.TextEditor.EVENT_BLUR); + }); + this.editor.on(BI.Editor.EVENT_CLICK, function () { + self.fireEvent(BI.TextEditor.EVENT_CLICK); + }); + this.editor.on(BI.Editor.EVENT_CHANGE, function () { + self.fireEvent(BI.TextEditor.EVENT_CHANGE); + }); + this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { + self.fireEvent(BI.TextEditor.EVENT_KEY_DOWN); + }); + this.editor.on(BI.Editor.EVENT_SPACE, function (v) { + self.fireEvent(BI.TextEditor.EVENT_SPACE); + }); + this.editor.on(BI.Editor.EVENT_BACKSPACE, function (v) { + self.fireEvent(BI.TextEditor.EVENT_BACKSPACE); + }); + + + this.editor.on(BI.Editor.EVENT_VALID, function () { + self.fireEvent(BI.TextEditor.EVENT_VALID); + }); + this.editor.on(BI.Editor.EVENT_CONFIRM, function () { + self.fireEvent(BI.TextEditor.EVENT_CONFIRM); + }); + this.editor.on(BI.Editor.EVENT_REMOVE, function (v) { + self.fireEvent(BI.TextEditor.EVENT_REMOVE); + }); + this.editor.on(BI.Editor.EVENT_START, function () { + self.fireEvent(BI.TextEditor.EVENT_START); + }); + this.editor.on(BI.Editor.EVENT_PAUSE, function () { + self.fireEvent(BI.TextEditor.EVENT_PAUSE); + }); + this.editor.on(BI.Editor.EVENT_STOP, function () { + self.fireEvent(BI.TextEditor.EVENT_STOP); + }); + this.editor.on(BI.Editor.EVENT_ERROR, function () { + self.fireEvent(BI.TextEditor.EVENT_ERROR, arguments); + }); + this.editor.on(BI.Editor.EVENT_ENTER, function () { + self.fireEvent(BI.TextEditor.EVENT_ENTER); + }); + this.editor.on(BI.Editor.EVENT_RESTRICT, function () { + self.fireEvent(BI.TextEditor.EVENT_RESTRICT); + }); + this.editor.on(BI.Editor.EVENT_EMPTY, function () { + self.fireEvent(BI.TextEditor.EVENT_EMPTY); + }); + BI.createWidget({ + type: "bi.vertical", + scrolly: false, + element: this, + items: [this.editor] + }); + }, + + focus: function () { + this.editor.focus(); + }, + + blur: function () { + this.editor.blur(); + }, + + setErrorText: function (text) { + this.editor.setErrorText(text); + }, + + getErrorText: function () { + return this.editor.getErrorText(); + }, + + isValid: function () { + return this.editor.isValid(); + }, + + setValue: function (v) { + this.editor.setValue(v); + }, + + getValue: function () { + return this.editor.getValue(); + } +}); +BI.TextEditor.EVENT_CHANGE = "EVENT_CHANGE"; +BI.TextEditor.EVENT_FOCUS = "EVENT_FOCUS"; +BI.TextEditor.EVENT_BLUR = "EVENT_BLUR"; +BI.TextEditor.EVENT_CLICK = "EVENT_CLICK"; +BI.TextEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; +BI.TextEditor.EVENT_SPACE = "EVENT_SPACE"; +BI.TextEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; + +BI.TextEditor.EVENT_START = "EVENT_START"; +BI.TextEditor.EVENT_PAUSE = "EVENT_PAUSE"; +BI.TextEditor.EVENT_STOP = "EVENT_STOP"; +BI.TextEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.TextEditor.EVENT_VALID = "EVENT_VALID"; +BI.TextEditor.EVENT_ERROR = "EVENT_ERROR"; +BI.TextEditor.EVENT_ENTER = "EVENT_ENTER"; +BI.TextEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; +BI.TextEditor.EVENT_REMOVE = "EVENT_REMOVE"; +BI.TextEditor.EVENT_EMPTY = "EVENT_EMPTY"; + +BI.shortcut("bi.text_editor", BI.TextEditor);/** + * 小号搜索框 + * Created by GUY on 2015/9/29. + * @class BI.SmallTextEditor + * @extends BI.SearchEditor + */ +BI.SmallTextEditor = BI.inherit(BI.TextEditor, { + _defaultConfig: function () { + var conf = BI.SmallTextEditor.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-small-text-editor", + height: 25 + }); + }, + + _init: function () { + BI.SmallTextEditor.superclass._init.apply(this, arguments); + } +}); +BI.shortcut("bi.small_text_editor", BI.SmallTextEditor);/** * * Created by GUY on 2016/3/28. * @class BI.ExcelTableCell @@ -6739,8 +6629,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, { }); var triggerBtn = BI.createWidget({ - type: "bi.trigger_icon_button", - cls: "bi-trigger-date-button chart-date-normal-font", + type: "bi.icon_button", + cls: "bi-trigger-icon-button date-font", width: 30, height: 23 }); @@ -6753,7 +6643,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, { }); this.changeIcon = BI.createWidget({ type: "bi.icon_button", - cls: "bi-trigger-date-change widget-date-h-change-font", + cls: "bi-trigger-icon-button date-change-h-font", width: 30, height: 23 }); diff --git a/demo/config.js b/demo/config.js index daa3bf380..1c7822e9c 100644 --- a/demo/config.js +++ b/demo/config.js @@ -1,4 +1,4 @@ -Demo.CONFIG = Demo.CORE_CONFIG.concat(Demo.BASE_CONFIG).concat(Demo.CASE_CONFIG).concat(Demo.WIDGET_CONFIG).concat(Demo.COMPONENT_CONFIG).concat(Demo.CHART_CONFIG); +Demo.CONFIG = Demo.CORE_CONFIG.concat(Demo.BASE_CONFIG).concat(Demo.CASE_CONFIG).concat(Demo.WIDGET_CONFIG).concat(Demo.COMPONENT_CONFIG).concat(Demo.ADDONS_CONFIG); Demo.CONSTANTS = { ITEMS: BI.map("柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂 柳州市积玉贸易有限公司 柳州市福运来贸易有限责任公司 柳州市钢义物资有限公司 柳州市洋力化工有限公司 柳州市悦盛贸易有限公司 柳州市雁城钢管物资有限公司 柳州市恒瑞钢材经营部 柳州市科拓电子有限公司 柳州市九方电子有限公司 柳州市桂龙汽车配件厂 柳州市制鞋工厂 柳州市炜力科贸有限公司 柳州市希翼贸易有限公司 柳州市兆金物资有限公司 柳州市和润电子科技有限责任公司 柳州市汇凯贸易有限公司 柳州市好机汇商贸有限公司 柳州市泛源商贸经营部 柳州市利汇达物资有限公司 广西全民药业有限责任公司 柳州超凡物资贸易有限责任公司 柳州市贵宏物资有限责任公司 柳州昊恒贸易有限责任公司 柳州市浦联物资有限公司 柳州市广通园林绿化工程有限责任公司 柳州市松发物资贸易有限责任公司 柳州市奥士达办公设备有限责任公司 柳州市海泰物资有限公司 柳州市金三环针织厂 柳州市钢贸物资有限公司 柳州市明阳纺织有限公司 柳州市世科科技发展有限公司 柳州市禄羊贸易有限公司 柳州市金兆阳商贸有限公司 柳州市汇昌物资经营部 柳州市林泰金属物资供应站 柳州市自来水管道材料设备公司 柳州市丹柳铝板有限公司 柳州市桂冶物资有限公司 柳州市宸业物资经营部 柳州市耀成贸易有限公司 柳州奥易自动化科技有限公司 柳州市萃丰科技有限责任公司 柳州市华储贸易有限责任公司 柳州市黄颜钢材有限责任公司 柳州市银盛物资有限责任公司 柳州市新仪化玻供应站 柳州市晶凯化工有限公司 广西柳州市柳江包装纸厂 柳州市志新物资有限责任公司 柳州市兆钢物资有限公司 柳州市友方科技发展有限责任公司 柳州市缝纫机台板家具总厂 柳州市晖海数码办公设备有限责任公司 柳州市富兰特服饰有限责任公司 柳州市柳北区富兴物资经营部 柳州市柳锌福利厂 柳州市海泉印刷有限责任公司 柳州市乾亨贸易有限公司 柳州市悦宁物资贸易有限公司 柳州市昊天贸易有限公司 广西惠字钢铁有限公司 柳州市名青物资有限公司 柳州市林郝物资有限公司 柳州市民政服装厂 柳州市多维劳保用品厂 柳州市轻工物资供应公司 柳州市程源物资有限责任公司 柳州市寿丰物资贸易有限责任公司 柳州市凯凡物资有限公司 柳州市利晖物资经营部 柳州市恒茂金属物资供应站 柳州市中储物资经营部 柳州市第二医疗器械厂 柳州市来鑫物资经营部 柳州市钢鑫物资贸易有限责任公司 柳州市双合袜业有限责任公司 柳州市茂松经贸有限责任公司 柳州市行行物资贸易有限公司 柳州市方一物资有限公司 柳州成异钢管销售有限公司 柳州广惠佳电脑有限公司 桂林市圣泽鑫物资有限公司柳州分公司 柳州市砼基建材贸易有限公司 柳州市海燕针织厂 上海浦光仪表厂柳州销售处 柳州市能电工贸有限责任公司 柳州市广贸物资有限公司 柳州市柳北区大昌电工灯饰经营部 柳州市金龙印务有限公司 柳州市奇缘婚典服务有限公司 柳州市盛博物资经营部 柳州市项元钢铁贸易有限公司 柳州市虞美人化妆品经营部 柳州市俊彦鞋厂 柳州市聚源特钢有限公司 柳州市迅龙科贸有限责任公司 柳州市恒飞电子有限责任公司 柳州市蓝正现代办公设备有限责任公司 柳州地区农业生产资料公司 柳州华菱钢管销售有限公司 柳州融通物资有限公司 柳州市可仁广告策划有限责任公司 柳州市鸟鑫物资有限责任公司 柳州市五丰钢材供应站 柳州市金江不锈钢有限公司 柳州市美日物资设备有限责任公司 柳州市鑫东物资贸易有限责任公司 柳州地区日用杂品公司 柳州市华纳物资贸易有限公司 柳州乾利金虹物资贸易有限责任公司 柳州市新迈计算机有限公司 柳州市富丽实业发展公司 柳州市石钢金属材料有限公司 柳州市力志传真机销售有限公司 广西宝森投资有限公司 柳州市嵘基商贸有限公司 柳州市景民商贸有限责任公司 柳州市银桥化玻有限责任公司 柳州市宏文糖烟店 柳州市科苑电脑网络有限公司 柳州市两面针旅游用品厂 柳州市立早室内装璜有限责任公司 柳州地化建材有限公司 柳州市涛达贸易有限公司 柳州市兰丰档案服务中心 柳州市惠贸物资有限责任公司 柳州市立文物资有限责任公司 柳州市致和商贸经营部 柳州市金色阳光信息咨询有限公司 柳州市赛利钢材经销部 柳州市日用化工厂 柳州市昆廷物资有限责任公司 柳州市邦盛贸易有限公司 柳州市济华贸易有限公司 柳州昕威橡塑化工经营部 柳州市联业贸易有限公司 柳州市兰钢贸易有限公司 柳州市子欣科技有限公司 柳州市狄龙机电设备有限公司 柳州市方真物资贸易有限公司 柳州市银鸥废旧回收中心 柳州市冠宝贸易有限公司 柳州市鑫盛德商务咨询有限责任公司 柳州市泰汇银通经贸有限公司 广西瀚维智测科技有限公司 柳州市钓鱼郎制衣有限责任公司 柳州溪水物资有限公司 柳州市融峰物资有限责任公司 广西新地科技有限责任公司 柳州市纺织装饰公司 柳州市粤翔冶金炉料有限公司 柳州市远腾贸易有限公司 柳州市东鸿城市改造有限公司 广西丛欣实业有限公司 柳州市服装厂 柳州市立安联合刀片有限公司 广西国扬投资有限责任公司 柳州市铭泰办公设备公司 柳州市桂钢物资供应站 柳州市昱升物资有限责任公司 柳州市鹰飞灿科贸有限公司 柳州市先导科贸有限公司 柳州市金秋建材物资经营部 柳州市童装厂 柳州市民泽物资有限公司 柳州市恒先物资贸易有限公司 柳州市银夏冷气工程有限责任公司 柳州粮食批发有限责任公司 柳州市金银华窗纱制造有限责任公司 柳州市三方贸易有限公司 柳州市丰涛商贸有限责任公司 柳州华智企业管理咨询有限责任公司 柳州市诚正建筑工程施工图审查有限公司 柳州市今科电讯设备营销中心 柳州市闽德电子有限公司 柳州市鑫虹针织厂 柳州市畅通通讯器材有限责任公司 柳州市正钢物资经营部 柳州市新柳饲料有限责任公司 柳州市黄村油库 柳州市天泰电力装饰工程有限公司 柳州市兆吉物资有限责任公司 柳州市八龙纸制品有限责任公司 柳州市巨佳电脑网络科技有限公司 ".match(/[^\s]+/g), function (i, v) { diff --git a/demo/js/config/addons.js b/demo/js/config/addons.js new file mode 100644 index 000000000..b02a59047 --- /dev/null +++ b/demo/js/config/addons.js @@ -0,0 +1,27 @@ +Demo.ADDONS_CONFIG = [{ + id: 6, + text: "addons" +}, { + pId: 6, + id: 601, + text: "拓展图表控件" +}, { + pId: 601, + text: "柱状图", + value: "demo.axis_chart" +}, { + pId: 6, + id: 602, + text: "sliders" +}, { + pId: 602, + text: "bi.single_slider" +}, { + id: 100000, + text: "小demo", + value: "demo.platform_level_tree" +}, { + pId: 100000, + text: "平台用", + value: "demo.platform_level_tree" +}]; \ No newline at end of file diff --git a/demo/js/config/base.js b/demo/js/config/base.js index 20f809d81..b6be571b6 100644 --- a/demo/js/config/base.js +++ b/demo/js/config/base.js @@ -118,4 +118,8 @@ Demo.BASE_CONFIG = [{ pId: 2, text: "bi.svg", value: "demo.svg" +}, { + pId: 2, + text: "bi.canvas", + value: "demo.canvas" }]; \ No newline at end of file diff --git a/demo/js/config/case.js b/demo/js/config/case.js index 9988901a8..331c946a3 100644 --- a/demo/js/config/case.js +++ b/demo/js/config/case.js @@ -2,6 +2,22 @@ Demo.CASE_CONFIG = [{ id: 3, text: "实例控件", open: false +}, { + pId: 3, + id: 300, + text: "按钮" +}, { + pId: 300, + text: "bi.multi_select_item", + value: "demo.multi_select_item" +}, { + pId: 300, + text: "bi.single_select_item", + value: "demo.single_select_item" +}, { + pId: 300, + text: "bi.single_select_radio_item", + value: "demo.single_select_radio_item" }, { pId: 3, id: 301, @@ -22,58 +38,162 @@ Demo.CASE_CONFIG = [{ pId: 301, text: "bi.state_editor", value: "demo.state_editor" +}, { + pId: 301, + text: "bi.simple_state_editor", + value: "demo.simple_state_editor" +}, { + pId: 301, + text: "bi.clear_editor", + value: "demo.clear_editor" }, { pId: 3, id: 302, - text: "combo" + text: "列表" +}, { + pId: 302, + text: "bi.select_list", + value: "demo.select_list" +}, { + pId: 302, + text: "bi.lazy_loader", + value: "demo.lazy_loader" +}, { + pId: 302, + text: "bi.list_loader", + value: "demo.list_loader" }, { pId: 302, + text: "bi.sort_list", + value: "demo.sort_list" +}, { + pId: 3, + id: 303, + text: "面板" +}, { + pId: 303, + text: "bi.pane_list", + value: "demo.pane_list" +}, { + pId: 303, + text: "bi.panel", + value: "demo.panel" +}, { + pId: 3, + id: 304, + text: "popup弹出层" +}, { + pId: 304, + text: "bi.multi_popup_view", + value: "demo.multi_popup_view" +}, { + pId: 304, + text: "bi.popup_panel", + value: "demo.popup_panel" +}, { + pId: 3, + id: 305, + text: "触发器trigger" +}, { + pId: 305, + text: "bi.editor_trigger", + value: "demo.editor_trigger" +}, { + pId: 305, + text: "bi.icon_trigger", + value: "demo.icon_trigger" +}, { + pId: 305, + text: "bi.text_trigger", + value: "demo.text_trigger" +}, { + pId: 305, + text: "bi.select_text_trigger", + value: "demo.select_text_trigger" +}, { + pId: 3, + id: 306, + text: "combo" +}, { + pId: 306, text: "bi.bubble_combo", value: "demo.bubble_combo" +}, { + pId: 306, + text: "bi.icon_combo", + value: "demo.icon_combo" +}, { + pId: 306, + text: "bi.static_combo", + value: "demo.static_combo" +}, { + pId: 306, + text: "bi.text_value_combo", + value: "demo.text_value_combo" +}, { + pId: 306, + text: "bi.text_value_check_combo", + value: "demo.text_value_check_combo" +}, { + pId: 306, + text: "bi.text_value_down_list_combo", + value: "demo.text_value_down_list_combo" }, { pId: 3, - id: 303, + id: 307, text: "tree" }, { - pId: 303, + pId: 307, text: "bi.branch_tree", value: "demo.branch_tree" }, { - pId: 303, + pId: 307, text: "bi.handstand_branch_tree", value: "demo.handstand_branch_tree" }, { - pId: 303, + pId: 307, text: "bi.display_tree", value: "demo.display_tree" }, { - pId: 303, + pId: 307, text: "bi.simple_tree", value: "demo.simple_tree" }, { - pId: 303, + pId: 307, text: "bi.level_tree", value: "demo.level_tree" }, { - pId: 303, + pId: 307, text: "bi.branch_relation", value: "demo.branch_relation" }, { pId: 3, - id: 304, + id: 308, text: "table" }, { - pId: 304, + pId: 308, text: "bi.adaptive_table", value: "demo.adaptive_table" }, { - pId: 304, + pId: 308, text: "bi.tree_table", value: "demo.tree_table" }, { - pId: 304, + pId: 308, text: "bi.layer_tree_table", value: "demo.layer_tree_table" +}, { + pId: 3, + id: 309, + text: "pager" +}, { + pId: 309, + text: "bi.all_count_pager", + value: "demo.all_count_pager" +}, { + pId: 309, + text: "bi.direction_pager", + value: "demo.direction_pager" }, { pId: 3, text: "bi.calendar", @@ -90,6 +210,10 @@ Demo.CASE_CONFIG = [{ pId: 3, text: "bi.color_chooser", value: "demo.color_chooser" +}, { + pId: 3, + text: "bi.color_chooser_popup", + value: "demo.color_chooser_popup" }, { pId: 3, text: "bi.segment", diff --git a/demo/js/config/chart.js b/demo/js/config/chart.js index 7dcd0096c..e69de29bb 100644 --- a/demo/js/config/chart.js +++ b/demo/js/config/chart.js @@ -1,8 +0,0 @@ -Demo.CHART_CONFIG = [{ - id: 6, - text: "图表控件" -}, { - pId: 6, - text: "柱状图", - value: "demo.axis_chart" -}]; \ No newline at end of file diff --git a/demo/js/config/component.js b/demo/js/config/component.js index 41e76b6fe..32f67a3e4 100644 --- a/demo/js/config/component.js +++ b/demo/js/config/component.js @@ -20,8 +20,4 @@ Demo.COMPONENT_CONFIG = [{ pId: 5, text: "bi.tree_value_chooser_pane", value: "demo.tree_value_chooser_pane" -}, { - pId: 5, - text: "平台用", - value: "demo.platform_level_tree" }]; \ No newline at end of file diff --git a/demo/js/config/core.js b/demo/js/config/core.js index ea0d355b8..8f32517ce 100644 --- a/demo/js/config/core.js +++ b/demo/js/config/core.js @@ -163,8 +163,8 @@ Demo.CORE_CONFIG = [{ value: "demo.layer_popup" }, { pId: 10202, - text: "bi.layer_searcher", - value: "demo.layer_searcher" + text: "bi.searcher_view", + value: "demo.searcher_view" }, { pId: 1, text: "widget", diff --git a/dist/bundle.js b/dist/bundle.js index 4fbd8a5c1..af66e60ef 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -72104,212 +72104,6 @@ BI.ClearEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; BI.ClearEditor.EVENT_REMOVE = "EVENT_REMOVE"; BI.ClearEditor.EVENT_EMPTY = "EVENT_EMPTY"; BI.shortcut("bi.clear_editor", BI.ClearEditor);/** - * Created by roy on 15/9/14. - */ -BI.SearchEditor = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: "bi-search-editor bi-border", - height: 30, - errorText: "", - watermark: BI.i18nText("BI-Basic_Search"), - validationChecker: BI.emptyFn, - quitChecker: BI.emptyFn - }); - }, - _init: function () { - this.options.height -= 2; - BI.SearchEditor.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.editor = BI.createWidget({ - type: "bi.editor", - height: o.height, - watermark: o.watermark, - allowBlank: true, - errorText: o.errorText, - validationChecker: o.validationChecker, - quitChecker: o.quitChecker - }); - this.clear = BI.createWidget({ - type: "bi.icon_button", - stopEvent: true, - cls: "search-close-h-font" - }); - this.clear.on(BI.IconButton.EVENT_CHANGE, function () { - self.setValue(""); - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT); - self.fireEvent(BI.SearchEditor.EVENT_CLEAR); - }); - BI.createWidget({ - element: this, - type: "bi.htape", - items: [ - { - el: { - type: "bi.center_adapt", - cls: "search-font", - items: [{ - el: { - type: "bi.icon" - } - }] - }, - width: 25 - }, - { - el: self.editor - }, - { - el: this.clear, - width: 25 - } - ] - }); - this.editor.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - - this.editor.on(BI.Editor.EVENT_FOCUS, function () { - self.fireEvent(BI.SearchEditor.EVENT_FOCUS); - }); - this.editor.on(BI.Editor.EVENT_BLUR, function () { - self.fireEvent(BI.SearchEditor.EVENT_BLUR); - }); - this.editor.on(BI.Editor.EVENT_CLICK, function () { - self.fireEvent(BI.SearchEditor.EVENT_CLICK); - }); - this.editor.on(BI.Editor.EVENT_CHANGE, function () { - self._checkClear(); - self.fireEvent(BI.SearchEditor.EVENT_CHANGE); - }); - this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { - self.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN, v); - }); - this.editor.on(BI.Editor.EVENT_SPACE, function () { - self.fireEvent(BI.SearchEditor.EVENT_SPACE) - }); - this.editor.on(BI.Editor.EVENT_BACKSPACE, function () { - self.fireEvent(BI.SearchEditor.EVENT_BACKSPACE) - }); - - - this.editor.on(BI.Editor.EVENT_VALID, function () { - self.fireEvent(BI.SearchEditor.EVENT_VALID) - }); - this.editor.on(BI.Editor.EVENT_ERROR, function () { - self.fireEvent(BI.SearchEditor.EVENT_ERROR) - }); - this.editor.on(BI.Editor.EVENT_ENTER, function () { - self.fireEvent(BI.SearchEditor.EVENT_ENTER); - }); - this.editor.on(BI.Editor.EVENT_RESTRICT, function () { - self.fireEvent(BI.SearchEditor.EVENT_RESTRICT) - }); - this.editor.on(BI.Editor.EVENT_EMPTY, function () { - self._checkClear(); - self.fireEvent(BI.SearchEditor.EVENT_EMPTY) - }); - this.editor.on(BI.Editor.EVENT_REMOVE, function () { - self.fireEvent(BI.SearchEditor.EVENT_REMOVE) - }); - this.editor.on(BI.Editor.EVENT_CONFIRM, function () { - self.fireEvent(BI.SearchEditor.EVENT_CONFIRM) - }); - this.editor.on(BI.Editor.EVENT_START, function () { - self.fireEvent(BI.SearchEditor.EVENT_START); - }); - this.editor.on(BI.Editor.EVENT_PAUSE, function () { - self.fireEvent(BI.SearchEditor.EVENT_PAUSE); - }); - this.editor.on(BI.Editor.EVENT_STOP, function () { - self.fireEvent(BI.SearchEditor.EVENT_STOP); - }); - - this.clear.invisible(); - }, - - _checkClear: function () { - if (!this.getValue()) { - this.clear.invisible(); - } else { - this.clear.visible(); - } - }, - - focus: function () { - this.editor.focus(); - }, - - blur: function () { - this.editor.blur(); - }, - - getValue: function () { - if (this.isValid()) { - var res = this.editor.getValue().match(/[\S]+/g); - return BI.isNull(res) ? "" : res[res.length - 1]; - } - }, - - getLastValidValue: function () { - return this.editor.getLastValidValue(); - }, - - setValue: function (v) { - this.editor.setValue(v); - if (BI.isKey(v)) { - this.clear.visible(); - } - }, - - isEditing: function () { - return this.editor.isEditing(); - }, - - isValid: function () { - return this.editor.isValid(); - } -}); -BI.SearchEditor.EVENT_CHANGE = "EVENT_CHANGE"; -BI.SearchEditor.EVENT_FOCUS = "EVENT_FOCUS"; -BI.SearchEditor.EVENT_BLUR = "EVENT_BLUR"; -BI.SearchEditor.EVENT_CLICK = "EVENT_CLICK"; -BI.SearchEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; -BI.SearchEditor.EVENT_SPACE = "EVENT_SPACE"; -BI.SearchEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; -BI.SearchEditor.EVENT_CLEAR = "EVENT_CLEAR"; - -BI.SearchEditor.EVENT_START = "EVENT_START"; -BI.SearchEditor.EVENT_PAUSE = "EVENT_PAUSE"; -BI.SearchEditor.EVENT_STOP = "EVENT_STOP"; -BI.SearchEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; -BI.SearchEditor.EVENT_VALID = "EVENT_VALID"; -BI.SearchEditor.EVENT_ERROR = "EVENT_ERROR"; -BI.SearchEditor.EVENT_ENTER = "EVENT_ENTER"; -BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE"; -BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY"; -BI.shortcut("bi.search_editor", BI.SearchEditor);/** - * 小号搜索框 - * Created by GUY on 2015/9/29. - * @class BI.SmallSearchEditor - * @extends BI.SearchEditor - */ -BI.SmallSearchEditor = BI.inherit(BI.SearchEditor, { - _defaultConfig: function () { - var conf = BI.SmallSearchEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-small-search-editor", - height: 24 - }); - }, - - _init: function () { - BI.SmallSearchEditor.superclass._init.apply(this, arguments); - } -}); -BI.shortcut("bi.small_search_editor", BI.SmallSearchEditor);/** * 带标记的文本框 * Created by GUY on 2016/1/25. * @class BI.ShelterEditor @@ -73619,222 +73413,41 @@ BI.SimpleStateEditor.EVENT_SPACE = "EVENT_SPACE"; BI.SimpleStateEditor.EVENT_EMPTY = "EVENT_EMPTY"; BI.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);/** - * guy - * @class BI.TextEditor - * @extends BI.Single + * 有确定取消按钮的弹出层 + * @class BI.BarFloatSection + * @extends BI.FloatSection + * @abstract */ -BI.TextEditor = BI.inherit(BI.Widget, { +BI.BarFloatSection = BI.inherit(BI.FloatSection, { _defaultConfig: function () { - var conf = BI.TextEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - extraCls: "bi-text-editor bi-border", - hgap: 4, - vgap: 2, - lgap: 0, - rgap: 0, - tgap: 0, - bgap: 0, - validationChecker: BI.emptyFn, - quitChecker: BI.emptyFn, - allowBlank: false, - watermark: "", - errorText: "", - height: 30 + return BI.extend(BI.BarFloatSection.superclass._defaultConfig.apply(this, arguments), { + btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText("BI-Basic_Cancel")] }) }, _init: function () { - BI.TextEditor.superclass._init.apply(this, arguments); - var self = this, o = this.options; - if (BI.isNumber(o.height)) { - this.element.css({height: o.height - 2}); - } - if (BI.isNumber(o.width)) { - this.element.css({width: o.width - 2}); - } - this.editor = BI.createWidget({ - type: "bi.editor", - height: o.height - 2, - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, - value: o.value, - validationChecker: o.validationChecker, - quitChecker: o.quitChecker, - allowBlank: o.allowBlank, - watermark: o.watermark, - errorText: o.errorText - }); - this.editor.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - - this.editor.on(BI.Editor.EVENT_FOCUS, function () { - self.fireEvent(BI.TextEditor.EVENT_FOCUS); - }); - this.editor.on(BI.Editor.EVENT_BLUR, function () { - self.fireEvent(BI.TextEditor.EVENT_BLUR); - }); - this.editor.on(BI.Editor.EVENT_CLICK, function () { - self.fireEvent(BI.TextEditor.EVENT_CLICK); - }); - this.editor.on(BI.Editor.EVENT_CHANGE, function () { - self.fireEvent(BI.TextEditor.EVENT_CHANGE); - }); - this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { - self.fireEvent(BI.TextEditor.EVENT_KEY_DOWN); - }); - this.editor.on(BI.Editor.EVENT_SPACE, function (v) { - self.fireEvent(BI.TextEditor.EVENT_SPACE); - }); - this.editor.on(BI.Editor.EVENT_BACKSPACE, function (v) { - self.fireEvent(BI.TextEditor.EVENT_BACKSPACE); - }); - - - this.editor.on(BI.Editor.EVENT_VALID, function () { - self.fireEvent(BI.TextEditor.EVENT_VALID); - }); - this.editor.on(BI.Editor.EVENT_CONFIRM, function () { - self.fireEvent(BI.TextEditor.EVENT_CONFIRM); - }); - this.editor.on(BI.Editor.EVENT_REMOVE, function (v) { - self.fireEvent(BI.TextEditor.EVENT_REMOVE); - }); - this.editor.on(BI.Editor.EVENT_START, function () { - self.fireEvent(BI.TextEditor.EVENT_START); - }); - this.editor.on(BI.Editor.EVENT_PAUSE, function () { - self.fireEvent(BI.TextEditor.EVENT_PAUSE); - }); - this.editor.on(BI.Editor.EVENT_STOP, function () { - self.fireEvent(BI.TextEditor.EVENT_STOP); - }); - this.editor.on(BI.Editor.EVENT_ERROR, function () { - self.fireEvent(BI.TextEditor.EVENT_ERROR, arguments); - }); - this.editor.on(BI.Editor.EVENT_ENTER, function () { - self.fireEvent(BI.TextEditor.EVENT_ENTER); - }); - this.editor.on(BI.Editor.EVENT_RESTRICT, function () { - self.fireEvent(BI.TextEditor.EVENT_RESTRICT); - }); - this.editor.on(BI.Editor.EVENT_EMPTY, function () { - self.fireEvent(BI.TextEditor.EVENT_EMPTY); - }); - BI.createWidget({ - type: "bi.vertical", - scrolly: false, - element: this, - items: [this.editor] - }); - }, - - focus: function () { - this.editor.focus(); - }, - - blur: function () { - this.editor.blur(); - }, - - setErrorText: function (text) { - this.editor.setErrorText(text); - }, - - getErrorText: function () { - return this.editor.getErrorText(); - }, - - isValid: function () { - return this.editor.isValid(); - }, - - setValue: function (v) { - this.editor.setValue(v); - }, - - getValue: function () { - return this.editor.getValue(); - } -}); -BI.TextEditor.EVENT_CHANGE = "EVENT_CHANGE"; -BI.TextEditor.EVENT_FOCUS = "EVENT_FOCUS"; -BI.TextEditor.EVENT_BLUR = "EVENT_BLUR"; -BI.TextEditor.EVENT_CLICK = "EVENT_CLICK"; -BI.TextEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; -BI.TextEditor.EVENT_SPACE = "EVENT_SPACE"; -BI.TextEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; - -BI.TextEditor.EVENT_START = "EVENT_START"; -BI.TextEditor.EVENT_PAUSE = "EVENT_PAUSE"; -BI.TextEditor.EVENT_STOP = "EVENT_STOP"; -BI.TextEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; -BI.TextEditor.EVENT_VALID = "EVENT_VALID"; -BI.TextEditor.EVENT_ERROR = "EVENT_ERROR"; -BI.TextEditor.EVENT_ENTER = "EVENT_ENTER"; -BI.TextEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.TextEditor.EVENT_REMOVE = "EVENT_REMOVE"; -BI.TextEditor.EVENT_EMPTY = "EVENT_EMPTY"; - -BI.shortcut("bi.text_editor", BI.TextEditor);/** - * 小号搜索框 - * Created by GUY on 2015/9/29. - * @class BI.SmallTextEditor - * @extends BI.SearchEditor - */ -BI.SmallTextEditor = BI.inherit(BI.TextEditor, { - _defaultConfig: function () { - var conf = BI.SmallTextEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-small-text-editor", - height: 25 - }); - }, - - _init: function () { - BI.SmallTextEditor.superclass._init.apply(this, arguments); - } -}); -BI.shortcut("bi.small_text_editor", BI.SmallTextEditor);/** - * 有确定取消按钮的弹出层 - * @class BI.BarFloatSection - * @extends BI.FloatSection - * @abstract - */ -BI.BarFloatSection = BI.inherit(BI.FloatSection, { - _defaultConfig: function () { - return BI.extend(BI.BarFloatSection.superclass._defaultConfig.apply(this, arguments), { - btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText("BI-Basic_Cancel")] - }) - }, - - _init: function () { - BI.BarFloatSection.superclass._init.apply(this, arguments); - var self = this; - var flatten = ["_init", "_defaultConfig", "_vessel", "_render", "getName", "listenEnd", "local", "refresh", "load", "change"]; - flatten = BI.makeObject(flatten, true); - BI.each(this.constructor.caller.caller.caller.caller.prototype, function (key) { - if (flatten[key]) { - return; - } - var f = self[key]; - if (BI.isFunction(f)) { - self[key] = BI.bind(function () { - if (this.model._start === true) { - this._F.push({f: f, arg: arguments}); - return; - } - return f.apply(this, arguments); - }, self); - } - }) - }, - - rebuildSouth: function (south) { + BI.BarFloatSection.superclass._init.apply(this, arguments); + var self = this; + var flatten = ["_init", "_defaultConfig", "_vessel", "_render", "getName", "listenEnd", "local", "refresh", "load", "change"]; + flatten = BI.makeObject(flatten, true); + BI.each(this.constructor.caller.caller.caller.caller.prototype, function (key) { + if (flatten[key]) { + return; + } + var f = self[key]; + if (BI.isFunction(f)) { + self[key] = BI.bind(function () { + if (this.model._start === true) { + this._F.push({f: f, arg: arguments}); + return; + } + return f.apply(this, arguments); + }, self); + } + }) + }, + + rebuildSouth: function (south) { var self = this, o = this.options; this.sure = BI.createWidget({ type: 'bi.button', @@ -77558,3299 +77171,3299 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, { }); BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE"; BI.shortcut("bi.multi_select_bar", BI.MultiSelectBar);/** - * 倒立的Branch - * @class BI.HandStandBranchExpander - * @extend BI.Widget - * create by young + * 表关联树 + * + * Created by GUY on 2015/12/15. + * @class BI.BranchRelation + * @extends BI.Widget */ -BI.HandStandBranchExpander = BI.inherit(BI.Widget, { +BI.BranchRelation = BI.inherit(BI.Widget, { + _defaultConfig: function () { - return BI.extend(BI.HandStandBranchExpander.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-handstand-branch-expander", - direction: BI.Direction.Top, - logic: { - dynamic: true - }, - el: {type: "bi.label"}, - popup: {} + return BI.extend(BI.BranchRelation.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-branch-relation-tree", + items: [], + + centerOffset: 0,//重心偏移量 + direction: BI.Direction.Bottom, + align: BI.VerticalAlign.Top }) }, _init: function () { - BI.HandStandBranchExpander.superclass._init.apply(this, arguments); - var o = this.options; - this._initExpander(); - this._initBranchView(); - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection(o.direction, { - type: "bi.center_adapt", - items: [this.expander] - }, this.branchView) - })))); + BI.BranchRelation.superclass._init.apply(this, arguments); + this.populate(this.options.items); }, - _initExpander: function () { - var self = this, o = this.options; - this.expander = BI.createWidget(o.el); - this.expander.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + //树分层 + _stratification: function () { + var levels = []; + this.tree.recursion(function (node, route) { + //node.isRoot = route.length <= 1; + node.leaf = node.isLeaf(); + if (!levels[route.length - 1]) { + levels[route.length - 1] = []; + } + levels[route.length - 1].push(node); }); + return levels; }, - _initBranchView: function () { - var self = this, o = this.options; - this.branchView = BI.createWidget(o.popup, {}); - this.branchView.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - }, + //计算所有节点的叶子结点个数 + _calculateLeaves: function () { + var count = 0; - populate: function (items) { - this.branchView.populate.apply(this.branchView, arguments); - }, - - getValue: function () { - return this.branchView.getValue(); - } -}); -BI.HandStandBranchExpander.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.handstand_branch_expander", BI.HandStandBranchExpander);/** - * @class BI.BranchExpander - * @extend BI.Widget - * create by young - */ -BI.BranchExpander = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.BranchExpander.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-branch-expander", - direction: BI.Direction.Left, - logic: { - dynamic: true - }, - el: {}, - popup: {} - }) - }, + function track(node) { + var c = 0; + if (node.isLeaf()) { + return 1; + } + BI.each(node.getChildren(), function (i, child) { + c += track(child); + }); + node.set("leaves", c); + return c; + } - _init: function () { - BI.BranchExpander.superclass._init.apply(this, arguments); - var o = this.options; - this._initExpander(); - this._initBranchView(); - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.expander, this.branchView) - })))); + count = track(this.tree.getRoot()); + return count; }, - _initExpander: function () { - var self = this, o = this.options; - this.expander = BI.createWidget(o.el, { - type: "bi.label", - width: 30, - height: "100%" - }); - this.expander.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + //树平移 + _translate: function (levels) { + var adjust = []; + var maxLevel = levels.length; + BI.each(levels, function (i, nodes) { + if (!adjust[i]) { + adjust[i] = []; + } + BI.each(nodes, function (j, node) { + if (node.isLeaf() && i < maxLevel - 1) { + var newNode = new BI.Node(BI.UUID()); + //newNode.isEmptyRoot = node.isRoot || node.isEmptyRoot; + newNode.isNew = true; + //把node向下一层移 + var tar = 0; + if (j > 0) { + var c = nodes[j - 1].getLastChild(); + tar = levels[i + 1].indexOf(c) + 1; + } + levels[i + 1].splice(tar, 0, node); + //新增一个临时树节点 + var index = node.parent.getChildIndex(node.id); + node.parent.removeChildByIndex(index); + node.parent.addChild(newNode, index); + newNode.addChild(node); + adjust[i].push(newNode); + nodes[j] = newNode; + } else { + adjust[i].push(node); + } + }) }); + return adjust; }, - _initBranchView: function () { - var self = this, o = this.options; - this.branchView = BI.createWidget(o.popup, {}); - this.branchView.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + //树补白 + _fill: function (levels) { + var adjust = []; + var maxLevel = levels.length; + BI.each(levels, function (i, nodes) { + if (!adjust[i]) { + adjust[i] = []; + } + BI.each(nodes, function (j, node) { + if (node.isLeaf() && i < maxLevel - 1) { + var newNode = new BI.Node(BI.UUID()); + newNode.leaf = true; + newNode.width = node.width; + newNode.height = node.height; + newNode.isNew = true; + //把node向下一层移 + var tar = 0; + if (j > 0) { + var c = nodes[j - 1].getLastChild(); + tar = levels[i + 1].indexOf(c) + 1; + } + levels[i + 1].splice(tar, 0, newNode); + //新增一个临时树节点 + node.addChild(newNode); + } + adjust[i].push(node); + }) }); + return adjust; }, - populate: function (items) { - this.branchView.populate.apply(this.branchView, arguments); + //树调整 + _adjust: function (adjust) { + while (true) { + var isAllNeedAjust = false; + BI.backEach(adjust, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (!node.isNew) { + var needAdjust = true; + BI.any(node.getChildren(), function (k, n) { + if (!n.isNew) { + needAdjust = false; + return true; + } + }); + if (!node.isLeaf() && needAdjust === true) { + var allChilds = []; + BI.each(node.getChildren(), function (k, n) { + allChilds = allChilds.concat(n.getChildren()); + }); + node.removeAllChilds(); + BI.each(allChilds, function (k, c) { + node.addChild(c); + }); + var newNode = new BI.Node(BI.UUID()); + //newNode.isEmptyRoot = node.isRoot || node.isEmptyRoot; + newNode.isNew = true; + var index = node.parent.getChildIndex(node.id); + node.parent.removeChildByIndex(index); + node.parent.addChild(newNode, index); + newNode.addChild(node); + isAllNeedAjust = true; + } + } + }) + }); + if (isAllNeedAjust === false) { + break; + } else {//树重构 + adjust = this._stratification(); + } + } + return adjust; }, - getValue: function () { - return this.branchView.getValue(); - } -}); -BI.BranchExpander.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.branch_expander", BI.BranchExpander);/** - * @class BI.HandStandBranchTree - * @extends BI.Widget - * create by young - * 横向分支的树 - */ -BI.HandStandBranchTree = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.HandStandBranchTree.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-handstand-branch-tree", - expander: {}, - el: {}, - items: [] - }) - }, - _init: function () { - BI.HandStandBranchTree.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.branchTree = BI.createWidget({ - type: "bi.custom_tree", - element: this, - expander: BI.extend({ - type: "bi.handstand_branch_expander", - el: {}, - popup: { - type: "bi.custom_tree" - } - }, o.expander), - el: BI.extend({ - type: "bi.button_tree", - chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI, - layouts: [{ - type: "bi.horizontal_adapt" - }] - }, o.el), - items: this.options.items - }); - this.branchTree.on(BI.CustomTree.EVENT_CHANGE, function(){ - self.fireEvent(BI.HandStandBranchTree.EVENT_CHANGE, arguments); - }); - this.branchTree.on(BI.Controller.EVENT_CHANGE, function(){ - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); + _calculateWidth: function () { + var o = this.options; + var width = 0; + + function track1(node) { + var w = 0; + if (node.isLeaf()) { + return node.width; + } + BI.each(node.getChildren(), function (i, child) { + w += track1(child); + }); + return w; + } + + function track2(node) { + var w = 0; + if (node.isLeaf()) { + return node.height; + } + BI.each(node.getChildren(), function (i, child) { + w += track2(child); + }); + return w; + } + + if (this._isVertical()) { + width = track1(this.tree.getRoot()); + } else { + width = track2(this.tree.getRoot()); + } + + return width; }, - populate: function () { - this.branchTree.populate.apply(this.branchTree, arguments); + _isVertical: function () { + var o = this.options; + return o.direction === BI.Direction.Top || o.direction === BI.Direction.Bottom; }, - getValue: function () { - return this.branchTree.getValue(); - } -}); -BI.HandStandBranchTree.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.handstand_branch_tree", BI.HandStandBranchTree);/** - * @class BI.BranchTree - * @extends BI.Widget - * create by young - * 横向分支的树 - */ -BI.BranchTree = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.BranchTree.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-branch-tree", - expander: {}, - el: {}, - items: [] - }) + _calculateHeight: function () { + var o = this.options; + var height = 0; + + function track1(node) { + var h = 0; + BI.each(node.getChildren(), function (i, child) { + h = Math.max(h, track1(child)); + }); + return h + (node.height || 0); + } + + function track2(node) { + var h = 0; + BI.each(node.getChildren(), function (i, child) { + h = Math.max(h, track2(child)); + }); + return h + (node.width || 0); + } + + if (this._isVertical()) { + height = track1(this.tree.getRoot()); + } else { + height = track2(this.tree.getRoot()); + } + return height; }, - _init: function () { - BI.BranchTree.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.branchTree = BI.createWidget({ - type: "bi.custom_tree", - element: this, - expander: BI.extend({ - type: "bi.branch_expander", - el: {}, - popup: { - type: "bi.custom_tree" - } - }, o.expander), - el: BI.extend({ - type: "bi.button_tree", - chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI, - layouts: [{ - type: "bi.vertical" - }] - }, o.el), - items: this.options.items - }); - this.branchTree.on(BI.CustomTree.EVENT_CHANGE, function(){ - self.fireEvent(BI.BranchTree.EVENT_CHANGE, arguments); - }); - this.branchTree.on(BI.Controller.EVENT_CHANGE, function(){ - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + + _calculateXY: function (levels) { + var o = this.options; + var width = this._calculateWidth(); + var height = this._calculateHeight(); + var levelCount = levels.length; + var allLeavesCount = this._calculateLeaves(); + //计算坐标 + var xy = {}; + var levelHeight = height / levelCount; + BI.each(levels, function (i, nodes) { + //计算权重 + var weights = []; + BI.each(nodes, function (j, node) { + weights[j] = (node.get("leaves") || 1) / allLeavesCount; + }); + BI.each(nodes, function (j, node) { + //求前j个元素的权重 + var weight = BI.sum(weights.slice(0, j)); + //求坐标 + var x = weight * width + weights[j] * width / 2; + var y = i * levelHeight + levelHeight / 2; + xy[node.id] = {x: x, y: y}; + }) }); + return xy; }, - populate: function () { - this.branchTree.populate.apply(this.branchTree, arguments); + _stroke: function (levels, xy) { + var height = this._calculateHeight(); + var levelCount = levels.length; + var levelHeight = height / levelCount; + var self = this, o = this.options; + switch (o.direction) { + case BI.Direction.Top: + BI.each(levels, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (node.getChildrenLength() > 0 && !node.leaf) { + var path = ""; + var start = xy[node.id]; + var split = start.y + levelHeight / 2; + path += "M" + start.x + "," + (start.y + o.centerOffset) + "L" + start.x + "," + split; + var end = []; + BI.each(node.getChildren(), function (t, c) { + var e = end[t] = xy[c.id]; + path += "M" + e.x + "," + (e.y + o.centerOffset) + "L" + e.x + "," + split; + }); + if (end.length > 0) { + path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split; + } + self.svg.path(path).attr("stroke", "#d4dadd"); + } + }) + }); + break; + case BI.Direction.Bottom: + BI.each(levels, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (node.getChildrenLength() > 0 && !node.leaf) { + var path = ""; + var start = xy[node.id]; + var split = start.y - levelHeight / 2; + path += "M" + start.x + "," + (start.y - o.centerOffset) + "L" + start.x + "," + split; + var end = []; + BI.each(node.getChildren(), function (t, c) { + var e = end[t] = xy[c.id]; + path += "M" + e.x + "," + (e.y - o.centerOffset) + "L" + e.x + "," + split; + }); + if (end.length > 0) { + path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split; + } + self.svg.path(path).attr("stroke", "#d4dadd"); + } + }) + }); + break; + case BI.Direction.Left: + BI.each(levels, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (node.getChildrenLength() > 0 && !node.leaf) { + var path = ""; + var start = xy[node.id]; + var split = start.y + levelHeight / 2; + path += "M" + (start.y + o.centerOffset) + "," + start.x + "L" + split + "," + start.x; + var end = []; + BI.each(node.getChildren(), function (t, c) { + var e = end[t] = xy[c.id]; + path += "M" + (e.y + o.centerOffset) + "," + e.x + "L" + split + "," + e.x; + }); + if (end.length > 0) { + path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x; + } + self.svg.path(path).attr("stroke", "#d4dadd"); + } + }) + }); + break; + case BI.Direction.Right: + BI.each(levels, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (node.getChildrenLength() > 0 && !node.leaf) { + var path = ""; + var start = xy[node.id]; + var split = start.y - levelHeight / 2; + path += "M" + (start.y - o.centerOffset) + "," + start.x + "L" + split + "," + start.x; + var end = []; + BI.each(node.getChildren(), function (t, c) { + var e = end[t] = xy[c.id]; + path += "M" + (e.y - o.centerOffset) + "," + e.x + "L" + split + "," + e.x; + }); + if (end.length > 0) { + path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x; + } + self.svg.path(path).attr("stroke", "#d4dadd"); + } + }) + }); + break; + } }, - getValue: function () { - return this.branchTree.getValue(); - } -}); -BI.BranchTree.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.branch_tree", BI.BranchTree);/** - * 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" - }) + _createBranches: function (levels) { + var self = this, o = this.options; + if (o.direction === BI.Direction.Bottom || o.direction === BI.Direction.Right) { + levels = levels.reverse(); + } + var xy = this._calculateXY(levels); + //画图 + this._stroke(levels, xy); }, - _init: function () { - BI.DisplayTree.superclass._init.apply(this, arguments); + + _isNeedAdjust: function () { + var o = this.options; + return o.direction === BI.Direction.Top && o.align === BI.VerticalAlign.Bottom || o.direction === BI.Direction.Bottom && o.align === BI.VerticalAlign.Top + || o.direction === BI.Direction.Left && o.align === BI.HorizontalAlign.Right || o.direction === BI.Direction.Right && o.align === BI.HorizontalAlign.Left }, - //配置属性 - _configSetting: function () { - var setting = { - view: { - selectedMulti: false, - dblClickExpand: false, - showIcon: false, - showTitle: false - }, - data: { - key: { - title: "title", - name: "text" - }, - simpleData: { - enable: true - } - }, - callback: { - beforeCollapse: beforeCollapse - } - }; + setValue: function (value) { - function beforeCollapse(treeId, treeNode) { - return false; - } + }, + + getValue: function () { - 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.count > 0) { - node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")"; - } else { - node.text = node.value; + _transformToTreeFormat: function (sNodes) { + var i, l; + if (!sNodes) { + return []; + } + + if (BI.isArray(sNodes)) { + var r = []; + var tmpMap = []; + for (i = 0, l = sNodes.length; i < l; i++) { + tmpMap[sNodes[i].id] = sNodes[i]; } - }); - return nodes; + for (i = 0, l = sNodes.length; i < l; i++) { + if (tmpMap[sNodes[i].pId] && sNodes[i].id != sNodes[i].pId) { + if (!tmpMap[sNodes[i].pId].children) { + tmpMap[sNodes[i].pId].children = []; + } + tmpMap[sNodes[i].pId].children.push(sNodes[i]); + } else { + r.push(sNodes[i]); + } + } + return r; + } else { + return [sNodes]; + } }, - initTree: function (nodes, setting) { - var setting = setting || this._configSetting(); - this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes); - }, + populate: function (items) { + var self = this, o = this.options; + o.items = items || []; + this.empty(); + items = this._transformToTreeFormat(o.items); + this.tree = new BI.Tree(); + this.tree.initTree(items); - destroy: function () { - BI.DisplayTree.superclass.destroy.apply(this, arguments); + this.svg = BI.createWidget({ + type: "bi.svg" + }); + + //树分层 + var levels = this._stratification(); + + if (this._isNeedAdjust()) { + //树平移 + var adjust = this._translate(levels); + //树调整 + adjust = this._adjust(adjust); + + this._createBranches(adjust); + } else { + var adjust = this._fill(levels); + + this._createBranches(adjust); + } + + var container = BI.createWidget({ + type: "bi.layout", + width: this._isVertical() ? this._calculateWidth() : this._calculateHeight(), + height: this._isVertical() ? this._calculateHeight() : this._calculateWidth() + }); + BI.createWidget({ + type: "bi.absolute", + element: container, + items: [{ + el: this.svg, + top: 0, + left: 0, + right: 0, + bottom: 0 + }] + }); + if (this._isVertical()) { + items = [{ + type: "bi.handstand_branch_tree", + expander: { + direction: o.direction + }, + el: { + layouts: [{ + type: "bi.horizontal_adapt", + verticalAlign: o.align + }] + }, + items: items + }] + } else { + items = [{ + type: "bi.branch_tree", + expander: { + direction: o.direction + }, + el: { + layouts: [{ + type: "bi.vertical" + }, { + type: o.align === BI.HorizontalAlign.Left ? "bi.left" : "bi.right" + }] + }, + items: items + }] + } + BI.createWidget({ + type: "bi.adaptive", + element: container, + items: items + }); + BI.createWidget({ + type: "bi.center_adapt", + scrollable: true, + element: this, + items: [container] + }); } }); -BI.DisplayTree.EVENT_CHANGE = "EVENT_CHANGE"; - -BI.shortcut("bi.display_tree", BI.DisplayTree);/** - * guy - * 二级树 - * @class BI.LevelTree - * @extends BI.Single +BI.BranchRelation.EVENT_CHANGE = "BranchRelation.EVENT_CHANGE"; +BI.shortcut("bi.branch_relation", BI.BranchRelation);/** + * 倒立的Branch + * @class BI.HandStandBranchExpander + * @extend BI.Widget + * create by young */ -BI.LevelTree = BI.inherit(BI.Widget, { +BI.HandStandBranchExpander = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-level-tree", - el: { - chooseType: 0 + return BI.extend(BI.HandStandBranchExpander.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-handstand-branch-expander", + direction: BI.Direction.Top, + logic: { + dynamic: true }, - expander: {}, - items: [] + el: {type: "bi.label"}, + popup: {} }) }, _init: function () { - BI.LevelTree.superclass._init.apply(this, arguments); - - this.initTree(this.options.items); - }, - - _formatItems: function (nodes, layer) { - var self = this; - BI.each(nodes, function (i, node) { - var extend = {layer: layer}; - if (!BI.isKey(node.id)) { - node.id = BI.UUID(); - } - if (node.isParent === true || BI.isNotEmptyArray(node.children)) { - switch (i) { - case 0 : - extend.type = "bi.first_plus_group_node"; - break; - case nodes.length - 1 : - extend.type = "bi.last_plus_group_node"; - break; - default : - extend.type = "bi.mid_plus_group_node"; - break; - } - BI.defaults(node, extend); - self._formatItems(node.children, layer + 1); - } else { - switch (i) { - case nodes.length - 1: - extend.type = "bi.last_tree_leaf_item"; - break; - default : - extend.type = "bi.mid_tree_leaf_item"; - } - BI.defaults(node, extend); - } - }); - return nodes; + BI.HandStandBranchExpander.superclass._init.apply(this, arguments); + var o = this.options; + this._initExpander(); + this._initBranchView(); + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection(o.direction, { + type: "bi.center_adapt", + items: [this.expander] + }, this.branchView) + })))); }, - _assertId: function (sNodes) { - BI.each(sNodes, function (i, node) { - if (!BI.isKey(node.id)) { - node.id = BI.UUID(); - } + _initExpander: function () { + var self = this, o = this.options; + this.expander = BI.createWidget(o.el); + this.expander.on(BI.Controller.EVENT_CHANGE, function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); }); }, - //构造树结构, - initTree: function (nodes) { + _initBranchView: function () { var self = this, o = this.options; - this.empty(); - this._assertId(nodes); - this.tree = BI.createWidget({ - type: "bi.custom_tree", - element: this, - expander: BI.extend({ - el: {}, - popup: { - type: "bi.custom_tree" - } - }, o.expander), - - items: this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0), - - el: BI.extend({ - type: "bi.button_tree", - chooseType: 0, - layouts: [{ - type: "bi.vertical" - }] - }, o.el) - }); - this.tree.on(BI.Controller.EVENT_CHANGE, function (type) { + this.branchView = BI.createWidget(o.popup, {}); + this.branchView.on(BI.Controller.EVENT_CHANGE, function () { self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - if (type === BI.Events.CLICK) { - self.fireEvent(BI.LevelTree.EVENT_CHANGE, arguments); - } - }) - }, - - //生成树方法 - stroke: function (nodes) { - this.tree.stroke.apply(this.tree, arguments); + }); }, populate: function (items) { - items = this._formatItems(BI.Tree.transformToTreeFormat(items), 0); - this.tree.populate(items); - }, - - setValue: function (v) { - this.tree.setValue(v); + this.branchView.populate.apply(this.branchView, arguments); }, getValue: function () { - return this.tree.getValue(); - }, - - getAllLeaves: function () { - return this.tree.getAllLeaves(); - }, - - getNodeById: function (id) { - return this.tree.getNodeById(id); - }, - - getNodeByValue: function (id) { - return this.tree.getNodeByValue(id); + return this.branchView.getValue(); } }); -BI.LevelTree.EVENT_CHANGE = "EVENT_CHANGE"; - -BI.shortcut("bi.level_tree", BI.LevelTree);/** - * 简单的多选树 - * - * Created by GUY on 2016/2/16. - * @class BI.SimpleTreeView - * @extends BI.Widget +BI.HandStandBranchExpander.EVENT_CHANGE = "EVENT_CHANGE"; +BI.shortcut("bi.handstand_branch_expander", BI.HandStandBranchExpander);/** + * @class BI.BranchExpander + * @extend BI.Widget + * create by young */ -BI.SimpleTreeView = BI.inherit(BI.Widget, { +BI.BranchExpander = 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 + return BI.extend(BI.BranchExpander.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-branch-expander", + direction: BI.Direction.Left, + logic: { + dynamic: true + }, + el: {}, + popup: {} }) }, + _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(); - } + BI.BranchExpander.superclass._init.apply(this, arguments); + var o = this.options; + this._initExpander(); + this._initBranchView(); + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.expander, this.branchView) + })))); }, - populate: function (items, keyword) { - if (items) { - this.options.items = items; - } - this.tree.stroke({ - keyword: keyword + _initExpander: function () { + var self = this, o = this.options; + this.expander = BI.createWidget(o.el, { + type: "bi.label", + width: 30, + height: "100%" }); - }, - - setValue: 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]++; - } - } - } + this.expander.on(BI.Controller.EVENT_CHANGE, function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); }); - - this.tree.setValue(BI.makeObject(v.concat(selected))); }, - _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; + _initBranchView: function () { + var self = this, o = this.options; + this.branchView = BI.createWidget(o.popup, {}); + this.branchView.on(BI.Controller.EVENT_CHANGE, function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); }, - empty: function () { - this.tree.empty(); + populate: function (items) { + this.branchView.populate.apply(this.branchView, arguments); }, 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; + return this.branchView.getValue(); } }); -BI.SimpleTreeView.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.simple_tree", BI.SimpleTreeView); -/** - * 文本输入框trigger - * - * Created by GUY on 2015/9/15. - * @class BI.EditorTrigger - * @extends BI.Trigger +BI.BranchExpander.EVENT_CHANGE = "EVENT_CHANGE"; +BI.shortcut("bi.branch_expander", BI.BranchExpander);/** + * @class BI.HandStandBranchTree + * @extends BI.Widget + * create by young + * 横向分支的树 */ -BI.EditorTrigger = BI.inherit(BI.Trigger, { - _const: { - hgap: 4 - }, - +BI.HandStandBranchTree = BI.inherit(BI.Widget, { _defaultConfig: function () { - var conf = BI.EditorTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-editor-trigger bi-border", - height: 30, - validationChecker: BI.emptyFn, - quitChecker: BI.emptyFn, - allowBlank: false, - watermark: "", - errorText: "", - triggerWidth: 30 - }); + return BI.extend(BI.HandStandBranchTree.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-handstand-branch-tree", + expander: {}, + el: {}, + items: [] + }) }, - _init: function () { - this.options.height -= 2; - BI.EditorTrigger.superclass._init.apply(this, arguments); - var self = this, o = this.options, c = this._const; - this.editor = BI.createWidget({ - type: "bi.sign_editor", - height: o.height, - value: o.value, - validationChecker: o.validationChecker, - quitChecker: o.quitChecker, - allowBlank: o.allowBlank, - watermark: o.watermark, - errorText: o.errorText - }); - this.editor.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.editor.on(BI.SignEditor.EVENT_CHANGE, function () { - self.fireEvent(BI.EditorTrigger.EVENT_CHANGE, arguments); - }); - - BI.createWidget({ + BI.HandStandBranchTree.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.branchTree = BI.createWidget({ + type: "bi.custom_tree", element: this, - type: 'bi.htape', - items: [ - { - el: this.editor - }, { - el: { - type: "bi.trigger_icon_button", - cls: "bi-border-left", - width: o.triggerWidth - }, - width: o.triggerWidth + expander: BI.extend({ + type: "bi.handstand_branch_expander", + el: {}, + popup: { + type: "bi.custom_tree" } - ] + }, o.expander), + el: BI.extend({ + type: "bi.button_tree", + chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI, + layouts: [{ + type: "bi.horizontal_adapt" + }] + }, o.el), + items: this.options.items + }); + this.branchTree.on(BI.CustomTree.EVENT_CHANGE, function(){ + self.fireEvent(BI.HandStandBranchTree.EVENT_CHANGE, arguments); + }); + this.branchTree.on(BI.Controller.EVENT_CHANGE, function(){ + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); }); }, - getValue: function () { - return this.editor.getValue(); - }, - - setValue: function (value) { - this.editor.setValue(value); + populate: function () { + this.branchTree.populate.apply(this.branchTree, arguments); }, - setText: function (text) { - this.editor.setState(text); + getValue: function () { + return this.branchTree.getValue(); } }); -BI.EditorTrigger.EVENT_CHANGE = "BI.EditorTrigger.EVENT_CHANGE"; -BI.shortcut("bi.editor_trigger", BI.EditorTrigger);/** - * 图标按钮trigger - * - * Created by GUY on 2015/10/8. - * @class BI.IconTrigger - * @extends BI.Trigger +BI.HandStandBranchTree.EVENT_CHANGE = "EVENT_CHANGE"; +BI.shortcut("bi.handstand_branch_tree", BI.HandStandBranchTree);/** + * @class BI.BranchTree + * @extends BI.Widget + * create by young + * 横向分支的树 */ -BI.IconTrigger = BI.inherit(BI.Trigger, { - +BI.BranchTree = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), { - extraCls: "bi-icon-trigger", + return BI.extend(BI.BranchTree.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-branch-tree", + expander: {}, el: {}, - height: 30 - }); + items: [] + }) }, _init: function () { - var o = this.options; - BI.IconTrigger.superclass._init.apply(this, arguments); - this.iconButton = BI.createWidget(o.el, { - type: "bi.trigger_icon_button", + BI.BranchTree.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.branchTree = BI.createWidget({ + type: "bi.custom_tree", element: this, - width: o.width, - height: o.height + expander: BI.extend({ + type: "bi.branch_expander", + el: {}, + popup: { + type: "bi.custom_tree" + } + }, o.expander), + el: BI.extend({ + type: "bi.button_tree", + chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI, + layouts: [{ + type: "bi.vertical" + }] + }, o.el), + items: this.options.items + }); + this.branchTree.on(BI.CustomTree.EVENT_CHANGE, function(){ + self.fireEvent(BI.BranchTree.EVENT_CHANGE, arguments); }); + this.branchTree.on(BI.Controller.EVENT_CHANGE, function(){ + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); + }, + + populate: function () { + this.branchTree.populate.apply(this.branchTree, arguments); + }, + + getValue: function () { + return this.branchTree.getValue(); } }); -BI.shortcut('bi.icon_trigger', BI.IconTrigger);/** - * 文字trigger - * - * Created by GUY on 2015/9/15. - * @class BI.IconTextTrigger - * @extends BI.Trigger +BI.BranchTree.EVENT_CHANGE = "EVENT_CHANGE"; +BI.shortcut("bi.branch_tree", BI.BranchTree);/** + * guy + * 异步树 + * @class BI.DisplayTree + * @extends BI.TreeView */ -BI.IconTextTrigger = BI.inherit(BI.Trigger, { - _const: { - hgap: 4, - triggerWidth: 30 - }, - +BI.DisplayTree = BI.inherit(BI.TreeView, { _defaultConfig: function () { - var conf = BI.IconTextTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-text-trigger", - height: 30 - }); + return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this, arguments), { + extraCls: "bi-display-tree" + }) }, - _init: function () { - BI.IconTextTrigger.superclass._init.apply(this, arguments); - var self = this, o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - textAlign: "left", - height: o.height, - text: o.text, - hgap: c.hgap - }); - this.trigerButton = BI.createWidget({ - type: "bi.trigger_icon_button", - cls: "bi-border-left", - width: c.triggerWidth - }); + BI.DisplayTree.superclass._init.apply(this, arguments); + }, - BI.createWidget({ - element: this, - type: 'bi.htape', - items: [{ - el: { - type: "bi.icon_change_button", - cls: "icon-combo-trigger-icon " + o.iconClass, - ref: function (_ref) { - self.icon = _ref; - }, - disableSelected: true - }, - width: 24 + //配置属性 + _configSetting: function () { + var setting = { + view: { + selectedMulti: false, + dblClickExpand: false, + showIcon: false, + showTitle: false }, - { - el: this.text - }, { - el: this.trigerButton, - width: c.triggerWidth + data: { + key: { + title: "title", + name: "text" + }, + simpleData: { + enable: true } - ] - }); + }, + callback: { + beforeCollapse: beforeCollapse + } + }; + + function beforeCollapse(treeId, treeNode) { + return false; + } + + return setting; }, - setValue: function (value) { - this.text.setValue(value); - this.text.setTitle(value); + _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.count > 0) { + node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")"; + } else { + node.text = node.value; + } + }); + return nodes; }, - setIcon: function (iconCls) { - this.icon.setIcon(iconCls); + initTree: function (nodes, setting) { + var setting = setting || this._configSetting(); + this.nodes = $.fn.zTree.init(this.tree.element, setting, nodes); }, - setText: function (text) { - this.text.setText(text); - this.text.setTitle(text); + destroy: function () { + BI.DisplayTree.superclass.destroy.apply(this, arguments); } }); -BI.shortcut("bi.icon_text_trigger", BI.IconTextTrigger);/** - * 文字trigger - * - * Created by GUY on 2015/9/15. - * @class BI.TextTrigger - * @extends BI.Trigger - */ -BI.TextTrigger = BI.inherit(BI.Trigger, { - _const: { - hgap: 4 - }, +BI.DisplayTree.EVENT_CHANGE = "EVENT_CHANGE"; +BI.shortcut("bi.display_tree", BI.DisplayTree);/** + * guy + * 二级树 + * @class BI.LevelTree + * @extends BI.Single + */ +BI.LevelTree = BI.inherit(BI.Widget, { _defaultConfig: function () { - var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-text-trigger", - height: 30, - triggerWidth: 30 - }); + return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-level-tree", + el: { + chooseType: 0 + }, + expander: {}, + items: [] + }) }, _init: function () { - BI.TextTrigger.superclass._init.apply(this, arguments); - var self = this, o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - textAlign: "left", - height: o.height, - text: o.text, - hgap: c.hgap, - readonly: o.readonly - }); - this.trigerButton = BI.createWidget({ - type: "bi.trigger_icon_button", - cls: "bi-border-left", - width: o.triggerWidth - }); - - BI.createWidget({ - element: this, - type: 'bi.htape', - items: [ - { - el: this.text - }, { - el: this.trigerButton, - width: o.triggerWidth - } - ] - }); - }, + BI.LevelTree.superclass._init.apply(this, arguments); - setValue: function (value) { - this.text.setValue(value); - this.text.setTitle(value); + this.initTree(this.options.items); }, - setText: function (text) { - this.text.setText(text); - this.text.setTitle(text); - } -}); -BI.shortcut("bi.text_trigger", BI.TextTrigger);/** - * 选择字段trigger - * - * Created by GUY on 2015/9/15. - * @class BI.SelectTextTrigger - * @extends BI.Trigger - */ -BI.SelectTextTrigger = BI.inherit(BI.Trigger, { + _formatItems: function (nodes, layer) { + var self = this; + BI.each(nodes, function (i, node) { + var extend = {layer: layer}; + if (!BI.isKey(node.id)) { + node.id = BI.UUID(); + } + if (node.isParent === true || BI.isNotEmptyArray(node.children)) { + switch (i) { + case 0 : + extend.type = "bi.first_plus_group_node"; + break; + case nodes.length - 1 : + extend.type = "bi.last_plus_group_node"; + break; + default : + extend.type = "bi.mid_plus_group_node"; + break; + } + BI.defaults(node, extend); + self._formatItems(node.children, layer + 1); + } else { + switch (i) { + case nodes.length - 1: + extend.type = "bi.last_tree_leaf_item"; + break; + default : + extend.type = "bi.mid_tree_leaf_item"; + } + BI.defaults(node, extend); + } + }); + return nodes; + }, - _defaultConfig: function () { - return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-select-text-trigger bi-border", - height: 24 + _assertId: function (sNodes) { + BI.each(sNodes, function (i, node) { + if (!BI.isKey(node.id)) { + node.id = BI.UUID(); + } }); }, - _init: function () { - this.options.height -= 2; - BI.SelectTextTrigger.superclass._init.apply(this, arguments); + //构造树结构, + initTree: function (nodes) { var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.text_trigger", + this.empty(); + this._assertId(nodes); + this.tree = BI.createWidget({ + type: "bi.custom_tree", element: this, - height: o.height - }); - if (BI.isKey(o.text)) { - this.setValue(o.text); - } - }, + expander: BI.extend({ + el: {}, + popup: { + type: "bi.custom_tree" + } + }, o.expander), - setValue: function (vals) { - var o = this.options; - vals = BI.isArray(vals) ? vals : [vals]; - var result = []; - var items = BI.Tree.transformToArrayFormat(this.options.items); - BI.each(items, function (i, item) { - if (BI.deepContains(vals, item.value) && !result.contains(item.text || item.value)) { - result.push(item.text || item.value); - } + items: this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0), + + el: BI.extend({ + type: "bi.button_tree", + chooseType: 0, + layouts: [{ + type: "bi.vertical" + }] + }, o.el) }); + this.tree.on(BI.Controller.EVENT_CHANGE, function (type) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + if (type === BI.Events.CLICK) { + self.fireEvent(BI.LevelTree.EVENT_CHANGE, arguments); + } + }) + }, - if (result.length > 0) { - this.trigger.setText(result.join(",")); - } else { - this.trigger.setText(o.text); - } + //生成树方法 + stroke: function (nodes) { + this.tree.stroke.apply(this.tree, arguments); }, populate: function (items) { - this.options.items = items; - } -}); -BI.shortcut("bi.select_text_trigger", BI.SelectTextTrigger);/** - * 选择字段trigger小一号的 - * - * @class BI.SmallSelectTextTrigger - * @extends BI.Trigger - */ -BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, { + items = this._formatItems(BI.Tree.transformToTreeFormat(items), 0); + this.tree.populate(items); + }, - _defaultConfig: function () { - return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-small-select-text-trigger bi-border", - height: 20 - }); + setValue: function (v) { + this.tree.setValue(v); }, - _init: function () { - this.options.height -= 2; - BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.small_text_trigger", - element: this, - height: o.height - 2 - }); - if (BI.isKey(o.text)) { - this.setValue(o.text); - } + getValue: function () { + return this.tree.getValue(); }, - setValue: function (vals) { - var o = this.options; - vals = BI.isArray(vals) ? vals : [vals]; - var result = []; - var items = BI.Tree.transformToArrayFormat(this.options.items); - BI.each(items, function (i, item) { - if (BI.deepContains(vals, item.value) && !result.contains(item.text || item.value)) { - result.push(item.text || item.value); - } - }); + getAllLeaves: function () { + return this.tree.getAllLeaves(); + }, - if (result.length > 0) { - this.trigger.element.removeClass("bi-water-mark"); - this.trigger.setText(result.join(",")); - } else { - this.trigger.element.addClass("bi-water-mark"); - this.trigger.setText(o.text); - } + getNodeById: function (id) { + return this.tree.getNodeById(id); }, - populate: function (items) { - this.options.items = items; + getNodeByValue: function (id) { + return this.tree.getNodeByValue(id); } }); -BI.shortcut("bi.small_select_text_trigger", BI.SmallSelectTextTrigger);/** - * 文字trigger(右边小三角小一号的) == +BI.LevelTree.EVENT_CHANGE = "EVENT_CHANGE"; + +BI.shortcut("bi.level_tree", BI.LevelTree);/** + * 简单的多选树 * - * @class BI.SmallTextTrigger - * @extends BI.Trigger + * Created by GUY on 2016/2/16. + * @class BI.SimpleTreeView + * @extends BI.Widget */ -BI.SmallTextTrigger = BI.inherit(BI.Trigger, { - _const: { - hgap: 4, - }, - +BI.SimpleTreeView = BI.inherit(BI.Widget, { _defaultConfig: function () { - var conf = BI.SmallTextTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-text-trigger", - height: 20, - triggerWidth: 20 - }); + return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-simple-tree", + itemsCreator: BI.emptyFn, + items: null + }) }, - _init: function () { - BI.SmallTextTrigger.superclass._init.apply(this, arguments); - var self = this, o = this.options, c = this._const; - this.text = BI.createWidget({ - type: "bi.label", - textAlign: "left", - height: o.height, - text: o.text, - hgap: c.hgap - }); - this.trigerButton = BI.createWidget({ - type: "bi.trigger_icon_button", - width: o.triggerWidth - }); - - BI.createWidget({ + 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, - type: 'bi.htape', - items: [ - { - el: this.text - }, { - el: this.trigerButton, - width: o.triggerWidth + 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(); + } }, - setValue: function (value) { - this.text.setValue(value); + populate: function (items, keyword) { + if (items) { + this.options.items = items; + } + this.tree.stroke({ + keyword: keyword + }); }, - setText: function (text) { - this.text.setText(text); - } -}); -BI.shortcut("bi.small_text_trigger", BI.SmallTextTrigger);/** - * - * Created by GUY on 2016/5/26. - * @class BI.SequenceTableTreeNumber - * @extends BI.Widget - */ -BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { - - _defaultConfig: function () { - return BI.extend(BI.SequenceTableTreeNumber.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-sequence-table-tree-number", - isNeedFreeze: false, - startSequence: 1,//开始的序号 - scrollTop: 0, - headerRowSize: 25, - rowSize: 25, + setValue: 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]++; + } - sequenceHeaderCreator: null, + 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]++; + } + } + } + }); - header: [], - items: [], //二维数组 + this.tree.setValue(BI.makeObject(v.concat(selected))); + }, - //交叉表头 - crossHeader: [], - crossItems: [] - }); + _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; }, - _init: function () { - BI.SequenceTableTreeNumber.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.vCurr = 1; - this.hCurr = 1; - this.tasks = []; - this.renderedCells = []; - this.renderedKeys = []; + empty: function () { + this.tree.empty(); + }, - this.container = BI.createWidget({ - type: "bi.absolute", - width: 60, - scrollable: false + 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 + * + * Created by GUY on 2015/9/15. + * @class BI.EditorTrigger + * @extends BI.Trigger + */ +BI.EditorTrigger = BI.inherit(BI.Trigger, { + _const: { + hgap: 4 + }, - this.scrollContainer = BI.createWidget({ - type: "bi.vertical", - scrollable: false, - scrolly: false, - items: [this.container] + _defaultConfig: function () { + var conf = BI.EditorTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-editor-trigger bi-border", + height: 30, + validationChecker: BI.emptyFn, + quitChecker: BI.emptyFn, + allowBlank: false, + watermark: "", + errorText: "", + triggerWidth: 30 }); + }, - this.headerContainer = BI.createWidget({ - type: "bi.absolute", - cls: "bi-border", - width: 58, - scrollable: false + _init: function () { + this.options.height -= 2; + BI.EditorTrigger.superclass._init.apply(this, arguments); + var self = this, o = this.options, c = this._const; + this.editor = BI.createWidget({ + type: "bi.sign_editor", + height: o.height, + value: o.value, + validationChecker: o.validationChecker, + quitChecker: o.quitChecker, + allowBlank: o.allowBlank, + watermark: o.watermark, + errorText: o.errorText + }); + this.editor.on(BI.Controller.EVENT_CHANGE, function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); + this.editor.on(BI.SignEditor.EVENT_CHANGE, function () { + self.fireEvent(BI.EditorTrigger.EVENT_CHANGE, arguments); }); - this.layout = BI.createWidget({ - type: "bi.vtape", + BI.createWidget({ element: this, - items: [{ - el: this.headerContainer, - height: this._getHeaderHeight() - 2 - }, {el: {type: "bi.layout"}, height: 2}, { - el: this.scrollContainer - }] + type: 'bi.htape', + items: [ + { + el: this.editor + }, { + el: { + type: "bi.trigger_icon_button", + cls: "bi-border-left", + width: o.triggerWidth + }, + width: o.triggerWidth + } + ] }); - //缓存第一行对应的序号 - this.start = this.options.startSequence; - this.cache = {}; - this._nextState(); + }, - this._populate(); + getValue: function () { + return this.editor.getValue(); }, - _getNextSequence: function (nodes) { - var self = this; - var start = this.start; - var cnt = this.start; + setValue: function (value) { + this.editor.setValue(value); + }, - function track(node) { - //如果已经有缓存了就不改计数了,复杂表会出现这种情况 - self.cache[node.text || node.value] || (self.cache[node.text || node.value] = cnt); - cnt++; - } + setText: function (text) { + this.editor.setState(text); + } +}); +BI.EditorTrigger.EVENT_CHANGE = "BI.EditorTrigger.EVENT_CHANGE"; +BI.shortcut("bi.editor_trigger", BI.EditorTrigger);/** + * 图标按钮trigger + * + * Created by GUY on 2015/10/8. + * @class BI.IconTrigger + * @extends BI.Trigger + */ +BI.IconTrigger = BI.inherit(BI.Trigger, { - BI.each(nodes, function (i, node) { - if (BI.isNotEmptyArray(node.children)) { - BI.each(node.children, function (index, child) { - if (index === 0) { - if (self.cache[child.text || child.value]) { - start = cnt = self.cache[child.text || child.value]; - } - } - track(child) - }); - } + _defaultConfig: function () { + return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), { + extraCls: "bi-icon-trigger", + el: {}, + height: 30 }); - this.start = cnt; - return start; }, - - _getStart: function (nodes) { - var self = this; - var start = this.start; - BI.some(nodes, function (i, node) { - if (BI.isNotEmptyArray(node.children)) { - return BI.some(node.children, function (index, child) { - if (index === 0) { - if (self.cache[child.text || child.value]) { - start = self.cache[child.text || child.value]; - return true; - } - } - }); - } + _init: function () { + var o = this.options; + BI.IconTrigger.superclass._init.apply(this, arguments); + this.iconButton = BI.createWidget(o.el, { + type: "bi.trigger_icon_button", + element: this, + width: o.width, + height: o.height }); - return start; + } +}); +BI.shortcut('bi.icon_trigger', BI.IconTrigger);/** + * 文字trigger + * + * Created by GUY on 2015/9/15. + * @class BI.IconTextTrigger + * @extends BI.Trigger + */ +BI.IconTextTrigger = BI.inherit(BI.Trigger, { + _const: { + hgap: 4, + triggerWidth: 30 }, - _formatNumber: function (nodes) { - var self = this, o = this.options; - var result = []; - var count = this._getStart(nodes); + _defaultConfig: function () { + var conf = BI.IconTextTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-text-trigger", + height: 30 + }); + }, - function getLeafCount(node) { - var cnt = 0; - if (BI.isNotEmptyArray(node.children)) { - BI.each(node.children, function (index, child) { - cnt += getLeafCount(child); - }); - if (/**node.children.length > 1 && **/BI.isNotEmptyArray(node.values)) { - cnt++; - } - } else { - cnt++; - } - return cnt; - } + _init: function () { + BI.IconTextTrigger.superclass._init.apply(this, arguments); + var self = this, o = this.options, c = this._const; + this.text = BI.createWidget({ + type: "bi.label", + textAlign: "left", + height: o.height, + text: o.text, + hgap: c.hgap + }); + this.trigerButton = BI.createWidget({ + type: "bi.trigger_icon_button", + cls: "bi-border-left", + width: c.triggerWidth + }); - var start = 0, top = 0; - BI.each(nodes, function (i, node) { - if (BI.isArray(node.children)) { - BI.each(node.children, function (index, child) { - var cnt = getLeafCount(child); - result.push({ - text: count++, - start: start, - top: top, - cnt: cnt, - index: index, - height: cnt * o.rowSize - }); - start += cnt; - top += cnt * o.rowSize; - }); - if (BI.isNotEmptyArray(node.values)) { - result.push({ - text: BI.i18nText("BI-Summary_Values"), - start: start++, - top: top, - cnt: 1, - isSummary: true, - height: o.rowSize - }); - top += o.rowSize; + BI.createWidget({ + element: this, + type: 'bi.htape', + items: [{ + el: { + type: "bi.icon_change_button", + cls: "icon-combo-trigger-icon " + o.iconClass, + ref: function (_ref) { + self.icon = _ref; + }, + disableSelected: true + }, + width: 24 + }, + { + el: this.text + }, { + el: this.trigerButton, + width: c.triggerWidth } - } + ] }); - return result; }, - _layout: function () { - var self = this, o = this.options; - var headerHeight = this._getHeaderHeight() - 2; - var items = this.layout.attr("items"); - if (o.isNeedFreeze === false) { - items[0].height = 0; - items[1].height = 0; - } else if (o.isNeedFreeze === true) { - items[0].height = headerHeight; - items[1].height = 2; - } - this.layout.attr("items", items); - this.layout.resize(); - try { - this.scrollContainer.element.scrollTop(o.scrollTop); - } catch (e) { - - } + setValue: function (value) { + this.text.setValue(value); + this.text.setTitle(value); }, - _getHeaderHeight: function () { - var o = this.options; - return o.headerRowSize * (o.crossHeader.length + (o.header.length > 0 ? 1 : 0)); + setIcon: function (iconCls) { + this.icon.setIcon(iconCls); }, - _nextState: function () { - var o = this.options; - this._getNextSequence(o.items); + setText: function (text) { + this.text.setText(text); + this.text.setTitle(text); + } +}); +BI.shortcut("bi.icon_text_trigger", BI.IconTextTrigger);/** + * 文字trigger + * + * Created by GUY on 2015/9/15. + * @class BI.TextTrigger + * @extends BI.Trigger + */ +BI.TextTrigger = BI.inherit(BI.Trigger, { + _const: { + hgap: 4 }, - _prevState: function () { - var self = this, o = this.options; - var firstChild; - BI.some(o.items, function (i, node) { - if (BI.isNotEmptyArray(node.children)) { - return BI.some(node.children, function (j, child) { - firstChild = child; - return true; - }); - } + _defaultConfig: function () { + var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-text-trigger", + height: 30, + triggerWidth: 30 }); - if (firstChild && BI.isNotEmptyObject(this.cache)) { - this.start = this.cache[firstChild.text || firstChild.value]; - } else { - this.start = 1; - } - this._nextState(); }, - _getMaxScrollTop: function (numbers) { - var cnt = 0; - BI.each(numbers, function (i, number) { - cnt += number.cnt; + _init: function () { + BI.TextTrigger.superclass._init.apply(this, arguments); + var self = this, o = this.options, c = this._const; + this.text = BI.createWidget({ + type: "bi.label", + textAlign: "left", + height: o.height, + text: o.text, + hgap: c.hgap, + readonly: o.readonly + }); + this.trigerButton = BI.createWidget({ + type: "bi.trigger_icon_button", + cls: "bi-border-left", + width: o.triggerWidth }); - return Math.max(0, cnt * this.options.rowSize - (this.options.height - this._getHeaderHeight()) + BI.DOM.getScrollWidth()); - }, - _createHeader: function () { - var o = this.options; BI.createWidget({ - type: "bi.absolute", - element: this.headerContainer, - items: [{ - el: o.sequenceHeaderCreator || { - type: "bi.table_style_cell", - cls: "sequence-table-title-cell", - styleGetter: o.headerCellStyleGetter, - text: BI.i18nText("BI-Number_Index") - }, - left: 0, - top: 0, - right: 0, - bottom: 0 - }] + element: this, + type: 'bi.htape', + items: [ + { + el: this.text + }, { + el: this.trigerButton, + width: o.triggerWidth + } + ] }); }, - _calculateChildrenToRender: function () { - var self = this, o = this.options; + setValue: function (value) { + this.text.setValue(value); + this.text.setTitle(value); + }, - var renderedCells = [], renderedKeys = []; - var numbers = this._formatNumber(o.items); - var intervalTree = BI.PrefixIntervalTree.uniform(numbers.length, 0); - BI.each(numbers, function (i, number) { - intervalTree.set(i, number.height); + setText: function (text) { + this.text.setText(text); + this.text.setTitle(text); + } +}); +BI.shortcut("bi.text_trigger", BI.TextTrigger);/** + * 选择字段trigger + * + * Created by GUY on 2015/9/15. + * @class BI.SelectTextTrigger + * @extends BI.Trigger + */ +BI.SelectTextTrigger = BI.inherit(BI.Trigger, { + + _defaultConfig: function () { + return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-select-text-trigger bi-border", + height: 24 }); - var scrollTop = BI.clamp(o.scrollTop, 0, this._getMaxScrollTop(numbers)); - var index = intervalTree.greatestLowerBound(scrollTop); - var offsetTop = -(scrollTop - (index > 0 ? intervalTree.sumTo(index - 1) : 0)); - var height = offsetTop; - var bodyHeight = o.height - this._getHeaderHeight(); - while (height < bodyHeight && index < numbers.length) { - renderedKeys.push(index); - offsetTop += numbers[index].height; - height += numbers[index].height; - index++; + }, + + _init: function () { + this.options.height -= 2; + BI.SelectTextTrigger.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.trigger = BI.createWidget({ + type: "bi.text_trigger", + element: this, + height: o.height + }); + if (BI.isKey(o.text)) { + this.setValue(o.text); } + }, - BI.each(renderedKeys, function (i, key) { - var index = BI.deepIndexOf(self.renderedKeys, key); - if (index > -1) { - if (numbers[key].height !== self.renderedCells[index]._height) { - self.renderedCells[index]._height = numbers[key].height; - self.renderedCells[index].el.setHeight(numbers[key].height); - } - if (numbers[key].top !== self.renderedCells[index].top) { - self.renderedCells[index].top = numbers[key].top; - self.renderedCells[index].el.element.css("top", numbers[key].top + "px"); - } - renderedCells.push(self.renderedCells[index]); - } else { - var child = BI.createWidget(BI.extend({ - type: "bi.table_style_cell", - cls: "sequence-table-number-cell bi-border-left bi-border-right bi-border-bottom", - width: 60, - styleGetter: numbers[key].isSummary === true ? function () { - return o.summaryCellStyleGetter(true); - } : function (key) { - return function () { - return o.sequenceCellStyleGetter(key); - } - }(numbers[key].index) - }, numbers[key])); - renderedCells.push({ - el: child, - left: 0, - top: numbers[key].top, - _height: numbers[key].height - }); - } - }); - - //已存在的, 需要添加的和需要删除的 - var existSet = {}, addSet = {}, deleteArray = []; - BI.each(renderedKeys, function (i, key) { - if (BI.deepContains(self.renderedKeys, key)) { - existSet[i] = key; - } else { - addSet[i] = key; - } - }); - BI.each(this.renderedKeys, function (i, key) { - if (BI.deepContains(existSet, key)) { - return; - } - if (BI.deepContains(addSet, key)) { - return; + setValue: function (vals) { + var o = this.options; + vals = BI.isArray(vals) ? vals : [vals]; + var result = []; + var items = BI.Tree.transformToArrayFormat(this.options.items); + BI.each(items, function (i, item) { + if (BI.deepContains(vals, item.value) && !result.contains(item.text || item.value)) { + result.push(item.text || item.value); } - deleteArray.push(i); - }); - BI.each(deleteArray, function (i, index) { - self.renderedCells[index].el.destroy(); - }); - var addedItems = []; - BI.each(addSet, function (index) { - addedItems.push(renderedCells[index]) - }); - BI.createWidget({ - type: "bi.absolute", - element: this.container, - items: addedItems }); - this.renderedCells = renderedCells; - this.renderedKeys = renderedKeys; - this.container.setHeight(intervalTree.sumUntil(numbers.length)); + if (result.length > 0) { + this.trigger.setText(result.join(",")); + } else { + this.trigger.setText(o.text); + } }, - _restore: function () { - BI.each(this.renderedCells, function (i, cell) { - cell.el.destroy(); - }); - this.renderedCells = []; - this.renderedKeys = []; - }, + populate: function (items) { + this.options.items = items; + } +}); +BI.shortcut("bi.select_text_trigger", BI.SelectTextTrigger);/** + * 选择字段trigger小一号的 + * + * @class BI.SmallSelectTextTrigger + * @extends BI.Trigger + */ +BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, { - _populate: function () { - var self = this; - BI.each(this.tasks, function (i, task) { - task.apply(self); + _defaultConfig: function () { + return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-small-select-text-trigger bi-border", + height: 20 }); - this.tasks = []; - this.headerContainer.empty(); - this._createHeader(); - this._layout(); - this._calculateChildrenToRender(); }, - setVerticalScroll: function (scrollTop) { - if (this.options.scrollTop !== scrollTop) { - this.options.scrollTop = scrollTop; - try { - this.scrollContainer.element.scrollTop(scrollTop); - } catch (e) { - - } + _init: function () { + this.options.height -= 2; + BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.trigger = BI.createWidget({ + type: "bi.small_text_trigger", + element: this, + height: o.height - 2 + }); + if (BI.isKey(o.text)) { + this.setValue(o.text); } }, - getVerticalScroll: function () { - return this.options.scrollTop; - }, - - setVPage: function (v) { - if (v <= 1) { - this.cache = {}; - this.start = this.options.startSequence; - this._restore(); - this.tasks.push(this._nextState); - } else if (v === this.vCurr + 1) { - this.tasks.push(this._nextState); - } else if (v === this.vCurr - 1) { - this.tasks.push(this._prevState); - } - this.vCurr = v; - }, + setValue: function (vals) { + var o = this.options; + vals = BI.isArray(vals) ? vals : [vals]; + var result = []; + var items = BI.Tree.transformToArrayFormat(this.options.items); + BI.each(items, function (i, item) { + if (BI.deepContains(vals, item.value) && !result.contains(item.text || item.value)) { + result.push(item.text || item.value); + } + }); - setHPage: function (v) { - if (v !== this.hCurr) { - this.tasks.push(this._prevState); + if (result.length > 0) { + this.trigger.element.removeClass("bi-water-mark"); + this.trigger.setText(result.join(",")); + } else { + this.trigger.element.addClass("bi-water-mark"); + this.trigger.setText(o.text); } - this.hCurr = v; - }, - - restore: function () { - this._restore(); }, - populate: function (items, header, crossItems, crossHeader) { - var o = this.options; - if (items && items !== this.options.items) { - o.items = items; - this._restore(); - this.tasks.push(this._prevState); - } - if (header && header !== this.options.header) { - o.header = header; - } - if (crossItems && crossItems !== this.options.crossItems) { - o.crossItems = crossItems; - } - if (crossHeader && crossHeader !== this.options.crossHeader) { - o.crossHeader = crossHeader; - } - this._populate(); + populate: function (items) { + this.options.items = items; } }); -BI.shortcut('bi.sequence_table_tree_number', BI.SequenceTableTreeNumber);/** - * 自适应布局 - * - * 1、resize - * 2、吸附 - * 3、当前组件在最上方 - * 4、可以撤销 - * 5、上下之间插入组件 +BI.shortcut("bi.small_select_text_trigger", BI.SmallSelectTextTrigger);/** + * 文字trigger(右边小三角小一号的) == * - * Created by GUY on 2016/2/23. - * @class BI.AdaptiveArrangement - * @extends BI.Widget + * @class BI.SmallTextTrigger + * @extends BI.Trigger */ -BI.AdaptiveArrangement = BI.inherit(BI.Widget, { +BI.SmallTextTrigger = BI.inherit(BI.Trigger, { + _const: { + hgap: 4, + }, _defaultConfig: function () { - return BI.extend(BI.AdaptiveArrangement.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-adaptive-arrangement", - resizable: true, - layoutType: BI.Arrangement.LAYOUT_TYPE.FREE, - items: [] + var conf = BI.SmallTextTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-text-trigger", + height: 20, + triggerWidth: 20 }); }, _init: function () { - BI.AdaptiveArrangement.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.arrangement = BI.createWidget({ - type: "bi.arrangement", - element: this, - layoutType: o.layoutType, - items: o.items - }); - this.arrangement.on(BI.Arrangement.EVENT_SCROLL, function () { - self.fireEvent(BI.AdaptiveArrangement.EVENT_SCROLL, arguments); + BI.SmallTextTrigger.superclass._init.apply(this, arguments); + var self = this, o = this.options, c = this._const; + this.text = BI.createWidget({ + type: "bi.label", + textAlign: "left", + height: o.height, + text: o.text, + hgap: c.hgap }); - this.zIndex = 0; - BI.each(o.items, function (i, item) { - self._initResizable(item.el); + this.trigerButton = BI.createWidget({ + type: "bi.trigger_icon_button", + width: o.triggerWidth }); - $(document).mousedown(function (e) { - BI.each(self.getAllRegions(), function (i, region) { - if (region.el.element.find(e.target).length === 0) { - region.el.element.removeClass("selected"); + BI.createWidget({ + element: this, + type: 'bi.htape', + items: [ + { + el: this.text + }, { + el: this.trigerButton, + width: o.triggerWidth } - }); - }); - BI.ResizeDetector.addResizeListener(this, function () { - self.arrangement.resize(); - self.fireEvent(BI.AdaptiveArrangement.EVENT_RESIZE); + ] }); }, - _isEqual: function () { - return this.arrangement._isEqual.apply(this.arrangement, arguments); + setValue: function (value) { + this.text.setValue(value); }, - _setSelect: function (item) { - if (!item.element.hasClass("selected")) { - item.element.css("zIndex", ++this.zIndex); - BI.each(this.getAllRegions(), function (i, region) { - region.el.element.removeClass("selected"); - }); - item.element.addClass("selected"); - } + setText: function (text) { + this.text.setText(text); + } +}); +BI.shortcut("bi.small_text_trigger", BI.SmallTextTrigger);/** + * + * Created by GUY on 2016/5/26. + * @class BI.SequenceTableTreeNumber + * @extends BI.Widget + */ +BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, { + + _defaultConfig: function () { + return BI.extend(BI.SequenceTableTreeNumber.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-sequence-table-tree-number", + isNeedFreeze: false, + startSequence: 1,//开始的序号 + scrollTop: 0, + headerRowSize: 25, + rowSize: 25, + + sequenceHeaderCreator: null, + + header: [], + items: [], //二维数组 + + //交叉表头 + crossHeader: [], + crossItems: [] + }); }, - _initResizable: function (item) { + _init: function () { + BI.SequenceTableTreeNumber.superclass._init.apply(this, arguments); var self = this, o = this.options; - item.element.css("zIndex", ++this.zIndex); - item.element.mousedown(function () { - self._setSelect(item) + this.vCurr = 1; + this.hCurr = 1; + this.tasks = []; + this.renderedCells = []; + this.renderedKeys = []; + + this.container = BI.createWidget({ + type: "bi.absolute", + width: 60, + scrollable: false }); - // o.resizable && item.element.resizable({ - // handles: "e, s, se", - // minWidth: 20, - // minHeight: 20, - // autoHide: true, - // helper: "bi-resizer", - // start: function () { - // item.element.css("zIndex", ++self.zIndex); - // self.fireEvent(BI.AdaptiveArrangement.EVENT_ELEMENT_START_RESIZE); - // }, - // resize: function (e, ui) { - // // self._resize(item.attr("id"), ui.size); - // self._resize(item.attr("id"), e, ui.size, ui.position); - // }, - // stop: function (e, ui) { - // self._stopResize(item.attr("id"), ui.size); - // self.fireEvent(BI.AdaptiveArrangement.EVENT_ELEMENT_STOP_RESIZE, item.attr("id"), ui.size); - // self.fireEvent(BI.AdaptiveArrangement.EVENT_RESIZE); - // } - // }); - }, - // _resize: function (name, e, size, position) { - // var self = this; - // this.scrollInterval(e, false, true, function (changedSize) { - // size.width += changedSize.offsetX; - // size.height += changedSize.offsetY; - // var containerWidth = self.arrangement.container.element.width(); - // var containerHeight = self.arrangement.container.element.height(); - // self.arrangement.container.element.width(containerWidth + changedSize.offsetX); - // self.arrangement.container.element.height(containerHeight + changedSize.offsetY); - // switch (self.getLayoutType()) { - // case BI.Arrangement.LAYOUT_TYPE.FREE: - // break; - // case BI.Arrangement.LAYOUT_TYPE.GRID: - // self.setRegionSize(name, size); - // break; - // } - // self.fireEvent(BI.AdaptiveArrangement.EVENT_ELEMENT_RESIZE, name, size); - // }); - // }, - // - // _stopResize: function (name, size) { - // var self = this; - // this.scrollEnd(); - // switch (this.getLayoutType()) { - // case BI.Arrangement.LAYOUT_TYPE.FREE: - // this.setRegionSize(name, size); - // break; - // case BI.Arrangement.LAYOUT_TYPE.GRID: - // this.setRegionSize(name, size); - // break; - // } - // }, + this.scrollContainer = BI.createWidget({ + type: "bi.vertical", + scrollable: false, + scrolly: false, + items: [this.container] + }); - _getScrollOffset: function () { - return this.arrangement._getScrollOffset(); - }, + this.headerContainer = BI.createWidget({ + type: "bi.absolute", + cls: "bi-border", + width: 58, + scrollable: false + }); - getClientWidth: function () { - return this.arrangement.getClientWidth(); - }, + this.layout = BI.createWidget({ + type: "bi.vtape", + element: this, + items: [{ + el: this.headerContainer, + height: this._getHeaderHeight() - 2 + }, {el: {type: "bi.layout"}, height: 2}, { + el: this.scrollContainer + }] + }); + //缓存第一行对应的序号 + this.start = this.options.startSequence; + this.cache = {}; + this._nextState(); - getClientHeight: function () { - return this.arrangement.getClientHeight(); + this._populate(); }, - addRegion: function (region, position) { - this._initResizable(region.el); - this._setSelect(region.el); - var self = this, flag; - var old = this.arrangement.getAllRegions(); - if (flag = this.arrangement.addRegion(region, position)) { - this._old = old; - } - return flag; - }, + _getNextSequence: function (nodes) { + var self = this; + var start = this.start; + var cnt = this.start; - deleteRegion: function (name) { - var flag; - var old = this.getAllRegions(); - if (flag = this.arrangement.deleteRegion(name)) { - this._old = old; - } else { - this._old = this.getAllRegions(); - this.relayout(); + function track(node) { + //如果已经有缓存了就不改计数了,复杂表会出现这种情况 + self.cache[node.text || node.value] || (self.cache[node.text || node.value] = cnt); + cnt++; } - return flag; - }, - setRegionSize: function (name, size) { - var flag; - var old = this.getAllRegions(); - if (flag = this.arrangement.setRegionSize(name, size)) { - this._old = old; - } - return flag; + BI.each(nodes, function (i, node) { + if (BI.isNotEmptyArray(node.children)) { + BI.each(node.children, function (index, child) { + if (index === 0) { + if (self.cache[child.text || child.value]) { + start = cnt = self.cache[child.text || child.value]; + } + } + track(child) + }); + } + }); + this.start = cnt; + return start; }, - setPosition: function (position, size) { + _getStart: function (nodes) { var self = this; - return this.arrangement.setPosition(position, size); - }, - - setRegionPosition: function (name, position) { - var region = this.getRegionByName(name); - return this.arrangement.setRegionPosition(name, position); - }, - - setDropPosition: function (position, size) { - return this.arrangement.setDropPosition(position, size); + var start = this.start; + BI.some(nodes, function (i, node) { + if (BI.isNotEmptyArray(node.children)) { + return BI.some(node.children, function (index, child) { + if (index === 0) { + if (self.cache[child.text || child.value]) { + start = self.cache[child.text || child.value]; + return true; + } + } + }); + } + }); + return start; }, - scrollInterval: function (e, isBorderScroll, isOverflowScroll, cb) { - var self = this; - var map = { - top: [-1, 0], - bottom: [1, 0], - left: [0, -1], - right: [0, 1] - }; - var clientSize = this.element.bounds(); + _formatNumber: function (nodes) { + var self = this, o = this.options; + var result = []; + var count = this._getStart(nodes); - function scrollTo(direction, callback) { - if (direction === "") { - self.lastActiveRegion = ""; - if (self._scrollInterval) { - clearInterval(self._scrollInterval); - self._scrollInterval = null; + function getLeafCount(node) { + var cnt = 0; + if (BI.isNotEmptyArray(node.children)) { + BI.each(node.children, function (index, child) { + cnt += getLeafCount(child); + }); + if (/**node.children.length > 1 && **/BI.isNotEmptyArray(node.values)) { + cnt++; } - return; - } - if (self.lastActiveRegion !== direction) { - self.lastActiveRegion = direction; - if (self._scrollInterval) { - clearInterval(self._scrollInterval); - self._scrollInterval = null; - } - var count = 0; - self._scrollInterval = setInterval(function () { - count++; - if (count <= 3) { - return; - } - var offset = self._getScrollOffset(); - var t = offset.top + map[direction][0] * 40; - var l = offset.left + map[direction][1] * 40; - if (t < 0 || l < 0) { - return; - } - callback({ - offsetX: map[direction][1] * 40, - offsetY: map[direction][0] * 40 - }); - self.scrollTo({ - top: t, - left: l - }); - }, 300); + } else { + cnt++; } + return cnt; } - cb({ - offsetX: 0, - offsetY: 0 - }); - var offset = this.element.offset(); - var p = { - left: e.pageX - offset.left, - top: e.pageY - offset.top - }; - //向上滚 - if (isBorderScroll && p.top >= 0 && p.top <= 30) { - scrollTo("top", cb) - } - //向下滚 - else if (isBorderScroll && p.top >= clientSize.height - 30 && p.top <= clientSize.height) { - scrollTo("bottom", cb) - } - //向左滚 - else if (isBorderScroll && p.left >= 0 && p.left <= 30) { - scrollTo("left", cb) - } - //向右滚 - else if (isBorderScroll && p.left >= clientSize.width - 30 && p.left <= clientSize.width) { - scrollTo("right", cb) - } else { - if (isOverflowScroll === true) { - if (p.top < 0) { - scrollTo("top", cb); - } - else if (p.top > clientSize.height) { - scrollTo("bottom", cb); - } - else if (p.left < 0) { - scrollTo("left", cb); - } - else if (p.left > clientSize.width) { - scrollTo("right", cb); - } else { - scrollTo("", cb); + var start = 0, top = 0; + BI.each(nodes, function (i, node) { + if (BI.isArray(node.children)) { + BI.each(node.children, function (index, child) { + var cnt = getLeafCount(child); + result.push({ + text: count++, + start: start, + top: top, + cnt: cnt, + index: index, + height: cnt * o.rowSize + }); + start += cnt; + top += cnt * o.rowSize; + }); + if (BI.isNotEmptyArray(node.values)) { + result.push({ + text: BI.i18nText("BI-Summary_Values"), + start: start++, + top: top, + cnt: 1, + isSummary: true, + height: o.rowSize + }); + top += o.rowSize; } - } else { - scrollTo("", cb); } - } + }); + return result; }, - scrollEnd: function () { - this.lastActiveRegion = ""; - if (this._scrollInterval) { - clearInterval(this._scrollInterval); - this._scrollInterval = null; + _layout: function () { + var self = this, o = this.options; + var headerHeight = this._getHeaderHeight() - 2; + var items = this.layout.attr("items"); + if (o.isNeedFreeze === false) { + items[0].height = 0; + items[1].height = 0; + } else if (o.isNeedFreeze === true) { + items[0].height = headerHeight; + items[1].height = 2; } - }, - - scrollTo: function (scroll) { - this.arrangement.scrollTo(scroll); - }, - - zoom: function (ratio) { - this.arrangement.zoom(ratio); - }, - - resize: function () { - this.arrangement.resize(); - }, + this.layout.attr("items", items); + this.layout.resize(); + try { + this.scrollContainer.element.scrollTop(o.scrollTop); + } catch (e) { - relayout: function () { - return this.arrangement.relayout(); + } }, - setLayoutType: function (type) { - var self = this; - this.arrangement.setLayoutType(type); + _getHeaderHeight: function () { + var o = this.options; + return o.headerRowSize * (o.crossHeader.length + (o.header.length > 0 ? 1 : 0)); }, - getLayoutType: function () { - return this.arrangement.getLayoutType(); + _nextState: function () { + var o = this.options; + this._getNextSequence(o.items); }, - getLayoutRatio: function () { - return this.arrangement.getLayoutRatio(); + _prevState: function () { + var self = this, o = this.options; + var firstChild; + BI.some(o.items, function (i, node) { + if (BI.isNotEmptyArray(node.children)) { + return BI.some(node.children, function (j, child) { + firstChild = child; + return true; + }); + } + }); + if (firstChild && BI.isNotEmptyObject(this.cache)) { + this.start = this.cache[firstChild.text || firstChild.value]; + } else { + this.start = 1; + } + this._nextState(); }, - getHelper: function () { - return this.arrangement.getHelper(); + _getMaxScrollTop: function (numbers) { + var cnt = 0; + BI.each(numbers, function (i, number) { + cnt += number.cnt; + }); + return Math.max(0, cnt * this.options.rowSize - (this.options.height - this._getHeaderHeight()) + BI.DOM.getScrollWidth()); }, - getRegionByName: function (name) { - return this.arrangement.getRegionByName(name); + _createHeader: function () { + var o = this.options; + BI.createWidget({ + type: "bi.absolute", + element: this.headerContainer, + items: [{ + el: o.sequenceHeaderCreator || { + type: "bi.table_style_cell", + cls: "sequence-table-title-cell", + styleGetter: o.headerCellStyleGetter, + text: BI.i18nText("BI-Number_Index") + }, + left: 0, + top: 0, + right: 0, + bottom: 0 + }] + }); }, - getAllRegions: function () { - return this.arrangement.getAllRegions(); - }, + _calculateChildrenToRender: function () { + var self = this, o = this.options; - revoke: function () { - if (this._old) { - this.populate(BI.toArray(this._old)); + var renderedCells = [], renderedKeys = []; + var numbers = this._formatNumber(o.items); + var intervalTree = BI.PrefixIntervalTree.uniform(numbers.length, 0); + BI.each(numbers, function (i, number) { + intervalTree.set(i, number.height); + }); + var scrollTop = BI.clamp(o.scrollTop, 0, this._getMaxScrollTop(numbers)); + var index = intervalTree.greatestLowerBound(scrollTop); + var offsetTop = -(scrollTop - (index > 0 ? intervalTree.sumTo(index - 1) : 0)); + var height = offsetTop; + var bodyHeight = o.height - this._getHeaderHeight(); + while (height < bodyHeight && index < numbers.length) { + renderedKeys.push(index); + offsetTop += numbers[index].height; + height += numbers[index].height; + index++; } - }, - populate: function (items) { - var self = this; - BI.each(items, function (i, item) { - self._initResizable(item.el); + BI.each(renderedKeys, function (i, key) { + var index = BI.deepIndexOf(self.renderedKeys, key); + if (index > -1) { + if (numbers[key].height !== self.renderedCells[index]._height) { + self.renderedCells[index]._height = numbers[key].height; + self.renderedCells[index].el.setHeight(numbers[key].height); + } + if (numbers[key].top !== self.renderedCells[index].top) { + self.renderedCells[index].top = numbers[key].top; + self.renderedCells[index].el.element.css("top", numbers[key].top + "px"); + } + renderedCells.push(self.renderedCells[index]); + } else { + var child = BI.createWidget(BI.extend({ + type: "bi.table_style_cell", + cls: "sequence-table-number-cell bi-border-left bi-border-right bi-border-bottom", + width: 60, + styleGetter: numbers[key].isSummary === true ? function () { + return o.summaryCellStyleGetter(true); + } : function (key) { + return function () { + return o.sequenceCellStyleGetter(key); + } + }(numbers[key].index) + }, numbers[key])); + renderedCells.push({ + el: child, + left: 0, + top: numbers[key].top, + _height: numbers[key].height + }); + } }); - this.arrangement.populate(items); - } -}); -BI.AdaptiveArrangement.EVENT_ELEMENT_START_RESIZE = "AdaptiveArrangement.EVENT_ELEMENT_START_RESIZE"; -BI.AdaptiveArrangement.EVENT_ELEMENT_RESIZE = "AdaptiveArrangement.EVENT_ELEMENT_RESIZE"; -BI.AdaptiveArrangement.EVENT_ELEMENT_STOP_RESIZE = "AdaptiveArrangement.EVENT_ELEMENT_STOP_RESIZE"; -BI.AdaptiveArrangement.EVENT_RESIZE = "AdaptiveArrangement.EVENT_RESIZE"; -BI.AdaptiveArrangement.EVENT_SCROLL = "AdaptiveArrangement.EVENT_SCROLL"; -BI.shortcut('bi.adaptive_arrangement', BI.AdaptiveArrangement);/** - * Arrangement的block面板 - * - * Created by GUY on 2016/3/1. - * @class BI.ArrangementBlock - * @extends BI.Widget - */ -BI.ArrangementBlock = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.ArrangementBlock.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-arrangement-block bi-mask" + //已存在的, 需要添加的和需要删除的 + var existSet = {}, addSet = {}, deleteArray = []; + BI.each(renderedKeys, function (i, key) { + if (BI.deepContains(self.renderedKeys, key)) { + existSet[i] = key; + } else { + addSet[i] = key; + } }); - } -}); -BI.shortcut('bi.arrangement_block', BI.ArrangementBlock);/** - * Arrangement的drop面板 - * - * Created by GUY on 2016/3/1. - * @class BI.ArrangementDroppable - * @extends BI.Widget - */ -BI.ArrangementDroppable = BI.inherit(BI.Widget, { + BI.each(this.renderedKeys, function (i, key) { + if (BI.deepContains(existSet, key)) { + return; + } + if (BI.deepContains(addSet, key)) { + return; + } + deleteArray.push(i); + }); + BI.each(deleteArray, function (i, index) { + self.renderedCells[index].el.destroy(); + }); + var addedItems = []; + BI.each(addSet, function (index) { + addedItems.push(renderedCells[index]) + }); + BI.createWidget({ + type: "bi.absolute", + element: this.container, + items: addedItems + }); + this.renderedCells = renderedCells; + this.renderedKeys = renderedKeys; - _defaultConfig: function () { - return BI.extend(BI.ArrangementDroppable.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-arrangement-droppable bi-resizer" + this.container.setHeight(intervalTree.sumUntil(numbers.length)); + }, + + _restore: function () { + BI.each(this.renderedCells, function (i, cell) { + cell.el.destroy(); + }); + this.renderedCells = []; + this.renderedKeys = []; + }, + + _populate: function () { + var self = this; + BI.each(this.tasks, function (i, task) { + task.apply(self); }); + this.tasks = []; + this.headerContainer.empty(); + this._createHeader(); + this._layout(); + this._calculateChildrenToRender(); + }, + + setVerticalScroll: function (scrollTop) { + if (this.options.scrollTop !== scrollTop) { + this.options.scrollTop = scrollTop; + try { + this.scrollContainer.element.scrollTop(scrollTop); + } catch (e) { + + } + } + }, + + getVerticalScroll: function () { + return this.options.scrollTop; + }, + + setVPage: function (v) { + if (v <= 1) { + this.cache = {}; + this.start = this.options.startSequence; + this._restore(); + this.tasks.push(this._nextState); + } else if (v === this.vCurr + 1) { + this.tasks.push(this._nextState); + } else if (v === this.vCurr - 1) { + this.tasks.push(this._prevState); + } + this.vCurr = v; + }, + + setHPage: function (v) { + if (v !== this.hCurr) { + this.tasks.push(this._prevState); + } + this.hCurr = v; + }, + + restore: function () { + this._restore(); + }, + + populate: function (items, header, crossItems, crossHeader) { + var o = this.options; + if (items && items !== this.options.items) { + o.items = items; + this._restore(); + this.tasks.push(this._prevState); + } + if (header && header !== this.options.header) { + o.header = header; + } + if (crossItems && crossItems !== this.options.crossItems) { + o.crossItems = crossItems; + } + if (crossHeader && crossHeader !== this.options.crossHeader) { + o.crossHeader = crossHeader; + } + this._populate(); } }); -BI.shortcut('bi.arrangement_droppable', BI.ArrangementDroppable);/** - * 布局 +BI.shortcut('bi.sequence_table_tree_number', BI.SequenceTableTreeNumber);/** + * 自适应布局 + * + * 1、resize + * 2、吸附 + * 3、当前组件在最上方 + * 4、可以撤销 + * 5、上下之间插入组件 * * Created by GUY on 2016/2/23. - * @class BI.Arrangement + * @class BI.AdaptiveArrangement * @extends BI.Widget */ -BI.Arrangement = BI.inherit(BI.Widget, { +BI.AdaptiveArrangement = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.Arrangement.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-arrangement", - layoutType: BI.Arrangement.LAYOUT_TYPE.GRID, + return BI.extend(BI.AdaptiveArrangement.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-adaptive-arrangement", + resizable: true, + layoutType: BI.Arrangement.LAYOUT_TYPE.FREE, items: [] }); }, _init: function () { - BI.Arrangement.superclass._init.apply(this, arguments); + BI.AdaptiveArrangement.superclass._init.apply(this, arguments); var self = this, o = this.options; this.arrangement = BI.createWidget({ - type: "bi.arrangement_droppable", - cls: "arrangement-block", - invisible: true + type: "bi.arrangement", + element: this, + layoutType: o.layoutType, + items: o.items }); - this.block = BI.createWidget({ - type: "bi.arrangement_block", - invisible: true + this.arrangement.on(BI.Arrangement.EVENT_SCROLL, function () { + self.fireEvent(BI.AdaptiveArrangement.EVENT_SCROLL, arguments); }); - this.container = BI.createWidget({ - type: "bi.absolute", - items: o.items.concat([this.block, this.arrangement]) + this.zIndex = 0; + BI.each(o.items, function (i, item) { + self._initResizable(item.el); }); - this.scrollContainer = BI.createWidget({ - type: "bi.adaptive", - width: "100%", - height: "100%", - scrollable: true, - items: [this.container] - }); - this.scrollContainer.element.scroll(function () { - self.fireEvent(BI.Arrangement.EVENT_SCROLL, { - scrollLeft: self.scrollContainer.element.scrollLeft(), - scrollTop: self.scrollContainer.element.scrollTop(), - clientWidth: self.scrollContainer.element[0].clientWidth, - clientHeight: self.scrollContainer.element[0].clientHeight + $(document).mousedown(function (e) { + BI.each(self.getAllRegions(), function (i, region) { + if (region.el.element.find(e.target).length === 0) { + region.el.element.removeClass("selected"); + } }); }); - - BI.createWidget({ - type: "bi.adaptive", - element: this, - items: [this.scrollContainer] + BI.ResizeDetector.addResizeListener(this, function () { + self.arrangement.resize(); + self.fireEvent(BI.AdaptiveArrangement.EVENT_RESIZE); }); - this.regions = {}; - if (o.items.length > 0) { - BI.nextTick(function () { - self.populate(o.items); + }, + + _isEqual: function () { + return this.arrangement._isEqual.apply(this.arrangement, arguments); + }, + + _setSelect: function (item) { + if (!item.element.hasClass("selected")) { + item.element.css("zIndex", ++this.zIndex); + BI.each(this.getAllRegions(), function (i, region) { + region.el.element.removeClass("selected"); }); + item.element.addClass("selected"); } }, - ////初始化操作//// - _calculateRegions: function (items) { + _initResizable: function (item) { var self = this, o = this.options; - this.regions = {}; - BI.each(items, function (i, item) { - var region = self._createOneRegion(item); - self.regions[region.id] = region; + item.element.css("zIndex", ++this.zIndex); + item.element.mousedown(function () { + self._setSelect(item) }); + // o.resizable && item.element.resizable({ + // handles: "e, s, se", + // minWidth: 20, + // minHeight: 20, + // autoHide: true, + // helper: "bi-resizer", + // start: function () { + // item.element.css("zIndex", ++self.zIndex); + // self.fireEvent(BI.AdaptiveArrangement.EVENT_ELEMENT_START_RESIZE); + // }, + // resize: function (e, ui) { + // // self._resize(item.attr("id"), ui.size); + // self._resize(item.attr("id"), e, ui.size, ui.position); + // }, + // stop: function (e, ui) { + // self._stopResize(item.attr("id"), ui.size); + // self.fireEvent(BI.AdaptiveArrangement.EVENT_ELEMENT_STOP_RESIZE, item.attr("id"), ui.size); + // self.fireEvent(BI.AdaptiveArrangement.EVENT_RESIZE); + // } + // }); }, - _isEqual: function (num1, num2) { - return Math.abs(num1 - num2) < 2; - }, - - _isLessThan: function (num1, num2) { - return num1 < num2 && !this._isEqual(num1, num2); - }, + // _resize: function (name, e, size, position) { + // var self = this; + // this.scrollInterval(e, false, true, function (changedSize) { + // size.width += changedSize.offsetX; + // size.height += changedSize.offsetY; + // var containerWidth = self.arrangement.container.element.width(); + // var containerHeight = self.arrangement.container.element.height(); + // self.arrangement.container.element.width(containerWidth + changedSize.offsetX); + // self.arrangement.container.element.height(containerHeight + changedSize.offsetY); + // switch (self.getLayoutType()) { + // case BI.Arrangement.LAYOUT_TYPE.FREE: + // break; + // case BI.Arrangement.LAYOUT_TYPE.GRID: + // self.setRegionSize(name, size); + // break; + // } + // self.fireEvent(BI.AdaptiveArrangement.EVENT_ELEMENT_RESIZE, name, size); + // }); + // }, + // + // _stopResize: function (name, size) { + // var self = this; + // this.scrollEnd(); + // switch (this.getLayoutType()) { + // case BI.Arrangement.LAYOUT_TYPE.FREE: + // this.setRegionSize(name, size); + // break; + // case BI.Arrangement.LAYOUT_TYPE.GRID: + // this.setRegionSize(name, size); + // break; + // } + // }, - _isMoreThan: function (num1, num2) { - return num1 > num2 && !this._isEqual(num1, num2); + _getScrollOffset: function () { + return this.arrangement._getScrollOffset(); }, - _isLessThanEqual: function (num1, num2) { - return num1 <= num2 || this._isEqual(num1, num2); + getClientWidth: function () { + return this.arrangement.getClientWidth(); }, - _isMoreThanEqual: function (num1, num2) { - return num1 >= num2 || this._isEqual(num1, num2); + getClientHeight: function () { + return this.arrangement.getClientHeight(); }, - //获取占有的最大Region - _getRegionOccupied: function (regions) { - var self = this, o = this.options; - if (BI.size(regions || this.regions) <= 0) { - return { - left: 0, - top: 0, - width: 0, - height: 0 - } - } - var minLeft = BI.MAX, maxLeft = BI.MIN, minTop = BI.MAX, maxTop = BI.MIN; - BI.each(regions || this.regions, function (id, region) { - minLeft = Math.min(minLeft, region.left); - maxLeft = Math.max(maxLeft, region.left + region.width); - minTop = Math.min(minTop, region.top); - maxTop = Math.max(maxTop, region.top + region.height); - }); - return { - left: minLeft, - top: minTop, - width: maxLeft - minLeft, - height: maxTop - minTop + addRegion: function (region, position) { + this._initResizable(region.el); + this._setSelect(region.el); + var self = this, flag; + var old = this.arrangement.getAllRegions(); + if (flag = this.arrangement.addRegion(region, position)) { + this._old = old; } + return flag; }, - //两个区域的交叉面积 - _getCrossArea: function (region1, region2) { - if (region1.left <= region2.left) { - if (region1.top <= region2.top) { - if (region1.top + region1.height > region2.top && region1.left + region1.width > region2.left) { - if (this._isEqual(region1.top + region1.height, region2.top) || this._isEqual(region1.left + region1.width, region2.left)) { - return 0; - } - return (region1.top + region1.height - region2.top) * (region1.left + region1.width - region2.left); - } - } else { - if (region2.top + region2.height > region1.top && region1.left + region1.width > region2.left) { - if (this._isEqual(region2.top + region2.height, region1.top) || this._isEqual(region1.left + region1.width, region2.left)) { - return 0; - } - return (region2.top + region2.height - region1.top) * (region1.left + region1.width - region2.left); - } - } + deleteRegion: function (name) { + var flag; + var old = this.getAllRegions(); + if (flag = this.arrangement.deleteRegion(name)) { + this._old = old; } else { - if (region1.top <= region2.top) { - if (region1.top + region1.height > region2.top && region2.left + region2.width > region1.left) { - if (this._isEqual(region1.top + region1.height, region2.top) || this._isEqual(region2.left + region2.width, region1.left)) { - return 0; - } - return (region1.top + region1.height - region2.top) * (region2.left + region2.width - region1.left); - } - } else { - if (region2.top + region2.height > region1.top && region2.left + region2.width > region1.left) { - if (this._isEqual(region2.top + region2.height, region1.top) || this._isEqual(region2.left + region2.width, region1.left)) { - return 0; - } - return (region2.top + region2.height - region1.top) * (region2.left + region2.width - region1.left); - } - } - } - return 0; - }, - - //是否有覆盖的组件 - _isRegionOverlay: function (regions) { - var reg = []; - BI.each(regions || this.regions, function (id, region) { - reg.push(new BI.Region(region.left, region.top, region.width, region.height)); - }); - for (var i = 0, len = reg.length; i < len; i++) { - for (var j = i + 1; j < len; j++) { - var area1 = { - left: reg[i].x, - top: reg[i].y, - width: reg[i].w, - height: reg[i].h - }; - var area2 = { - left: reg[j].x, - top: reg[j].y, - width: reg[j].w, - height: reg[j].h - }; - if (reg[i].isIntersects(reg[j]) && this._getCrossArea(area1, area2) > 1) { - return true; - } - } - } - return false; - }, - - //布局是否是优良的 - _isArrangeFine: function (regions) { - switch (this.options.layoutType) { - case BI.Arrangement.LAYOUT_TYPE.FREE: - return true; - case BI.Arrangement.LAYOUT_TYPE.GRID: - // if (this._isRegionOverlay()) { - // return false; - // } + this._old = this.getAllRegions(); + this.relayout(); } - return true; - }, - - _getRegionNames: function (regions) { - var names = []; - BI.each(regions || this.regions, function (i, region) { - names.push(region.id || region.attr("id")); - }); - return names; + return flag; }, - _getRegionsByNames: function (names, regions) { - names = BI.isArray(names) ? names : [names]; - regions = regions || this.regions; - if (BI.isArray(regions)) { - var result = []; - BI.each(regions, function (i, region) { - if (names.contains(region.id || region.attr("id"))) { - result.push(region); - } - }); - } else { - var result = {}; - BI.each(names, function (i, name) { - result[name] = regions[name]; - }); + setRegionSize: function (name, size) { + var flag; + var old = this.getAllRegions(); + if (flag = this.arrangement.setRegionSize(name, size)) { + this._old = old; } - return result; - }, - - _cloneRegion: function (regions) { - var clone = {}; - BI.each(regions || this.regions, function (id, region) { - clone[id] = {}; - clone[id].el = region.el; - clone[id].id = region.id; - clone[id].left = region.left; - clone[id].top = region.top; - clone[id].width = region.width; - clone[id].height = region.height; - }); - return clone; + return flag; }, - //测试合法性 - _test: function (regions) { + setPosition: function (position, size) { var self = this; - return !BI.any(regions || this.regions, function (i, region) { - if (BI.isNaN(region.width) || BI.isNaN(region.height) || region.width <= 21 || region.height <= 21) { - return true; - } - }) - }, - - _getScrollOffset: function () { - return { - left: this.scrollContainer.element[0].scrollLeft, - top: this.scrollContainer.element[0].scrollTop - } + return this.arrangement.setPosition(position, size); }, - ////操作//// - _createOneRegion: function (item) { - var el = BI.createWidget(item.el); - el.setVisible(true); - return { - id: el.attr("id"), - left: item.left, - top: item.top, - width: item.width, - height: item.height, - el: el - } + setRegionPosition: function (name, position) { + var region = this.getRegionByName(name); + return this.arrangement.setRegionPosition(name, position); }, - _applyRegion: function (regions) { - var self = this, o = this.options; - BI.each(regions || this.regions, function (i, region) { - region.el.element.css({ - left: region.left, - top: region.top, - width: region.width, - height: region.height - }); - }); - this._applyContainer(); - this.ratio = this.getLayoutRatio(); + setDropPosition: function (position, size) { + return this.arrangement.setDropPosition(position, size); }, - _renderRegion: function () { + scrollInterval: function (e, isBorderScroll, isOverflowScroll, cb) { var self = this; - BI.createWidget({ - type: "bi.absolute", - element: this.container, - items: BI.toArray(this.regions) - }); - }, - - getClientWidth: function () { - return this.scrollContainer.element[0].clientWidth; - }, - - getClientHeight: function () { - return this.scrollContainer.element[0].clientHeight; - }, - - _applyContainer: function () { - //先掩藏后显示能够明确滚动条是否出现 - this.scrollContainer.element.css("overflow", "hidden"); - var occupied = this._getRegionOccupied(); - this.container.element.width(occupied.left + occupied.width).height(occupied.top + occupied.height); - this.scrollContainer.element.css("overflow", "auto"); - return occupied; - }, + var map = { + top: [-1, 0], + bottom: [1, 0], + left: [0, -1], + right: [0, 1] + }; + var clientSize = this.element.bounds(); - _modifyRegion: function (regions) { - BI.each(this.regions, function (id, region) { - if (regions[id]) { - region.left = regions[id].left; - region.top = regions[id].top; - region.width = regions[id].width; - region.height = regions[id].height; + function scrollTo(direction, callback) { + if (direction === "") { + self.lastActiveRegion = ""; + if (self._scrollInterval) { + clearInterval(self._scrollInterval); + self._scrollInterval = null; + } + return; } - }); - }, + if (self.lastActiveRegion !== direction) { + self.lastActiveRegion = direction; + if (self._scrollInterval) { + clearInterval(self._scrollInterval); + self._scrollInterval = null; + } + var count = 0; + self._scrollInterval = setInterval(function () { + count++; + if (count <= 3) { + return; + } + var offset = self._getScrollOffset(); + var t = offset.top + map[direction][0] * 40; + var l = offset.left + map[direction][1] * 40; + if (t < 0 || l < 0) { + return; + } + callback({ + offsetX: map[direction][1] * 40, + offsetY: map[direction][0] * 40 + }); + self.scrollTo({ + top: t, + left: l + }); + }, 300); + } + } - _addRegion: function (item) { - var region = this._createOneRegion(item); - this.regions[region.id] = region; - BI.createWidget({ - type: "bi.absolute", - element: this.container, - items: [region] + cb({ + offsetX: 0, + offsetY: 0 }); + var offset = this.element.offset(); + var p = { + left: e.pageX - offset.left, + top: e.pageY - offset.top + }; + //向上滚 + if (isBorderScroll && p.top >= 0 && p.top <= 30) { + scrollTo("top", cb) + } + //向下滚 + else if (isBorderScroll && p.top >= clientSize.height - 30 && p.top <= clientSize.height) { + scrollTo("bottom", cb) + } + //向左滚 + else if (isBorderScroll && p.left >= 0 && p.left <= 30) { + scrollTo("left", cb) + } + //向右滚 + else if (isBorderScroll && p.left >= clientSize.width - 30 && p.left <= clientSize.width) { + scrollTo("right", cb) + } else { + if (isOverflowScroll === true) { + if (p.top < 0) { + scrollTo("top", cb); + } + else if (p.top > clientSize.height) { + scrollTo("bottom", cb); + } + else if (p.left < 0) { + scrollTo("left", cb); + } + else if (p.left > clientSize.width) { + scrollTo("right", cb); + } else { + scrollTo("", cb); + } + } else { + scrollTo("", cb); + } + } }, - _deleteRegionByName: function (name) { - this.regions[name].el.setVisible(false); - delete this.regions[name]; + scrollEnd: function () { + this.lastActiveRegion = ""; + if (this._scrollInterval) { + clearInterval(this._scrollInterval); + this._scrollInterval = null; + } }, - _setArrangeSize: function (size) { - this.arrangement.element.css({ - left: size.left, - top: size.top, - width: size.width, - height: size.height - }) + scrollTo: function (scroll) { + this.arrangement.scrollTo(scroll); }, - //Grid - _getOneWidthPortion: function () { - return this.getClientWidth() / BI.Arrangement.PORTION; - }, - _getOneHeightPortion: function () { - return this.getClientHeight() / BI.Arrangement.H_PORTION; + zoom: function (ratio) { + this.arrangement.zoom(ratio); }, - _getGridPositionAndSize: function (position) { - var perWidth = this._getOneWidthPortion(); - var perHeight = this._getOneHeightPortion(); - var widthPortion = Math.round(position.width / perWidth); - var leftPortion = Math.round(position.left / perWidth); - var topPortion = Math.round(position.top / perHeight); - var heightPortion = Math.round(position.height / perHeight); - // if (leftPortion > BI.Arrangement.PORTION) { - // leftPortion = BI.Arrangement.PORTION; - // } - // if (widthPortion > BI.Arrangement.PORTION) { - // widthPortion = BI.Arrangement.PORTION; - // } - // if (leftPortion + widthPortion > BI.Arrangement.PORTION) { - // leftPortion = BI.Arrangement.PORTION - widthPortion; - // } - if (widthPortion === 0) { - widthPortion = 1; - } - if (heightPortion === 0) { - heightPortion = 1; - } - return { - x: leftPortion, - y: topPortion, - w: widthPortion, - h: heightPortion - } + resize: function () { + this.arrangement.resize(); }, - _getBlockPositionAndSize: function (position) { - var perWidth = this._getOneWidthPortion(); - var perHeight = this._getOneHeightPortion(); - return { - left: position.x * perWidth, - top: position.y * perHeight, - width: position.w * perWidth, - height: position.h * perHeight - }; + relayout: function () { + return this.arrangement.relayout(); }, - _getLayoutsByRegions: function (regions) { + setLayoutType: function (type) { var self = this; - var result = []; - BI.each(regions || this.regions, function (id, region) { - result.push(BI.extend(self._getGridPositionAndSize(region), { - i: region.id - })) - }); - return result; + this.arrangement.setLayoutType(type); }, - _getLayoutIndexByName: function (layout, name) { - return BI.findIndex(layout, function (i, l) { - return l.i === name; - }); + getLayoutType: function () { + return this.arrangement.getLayoutType(); }, - _setBlockPositionAndSize: function (size) { - this.block.element.css({ - left: size.left, - top: size.top, - width: size.width, - height: size.height - }); + getLayoutRatio: function () { + return this.arrangement.getLayoutRatio(); }, - _getRegionsByLayout: function (layout) { - var self = this; - var regions = {}; - BI.each(layout, function (i, ly) { - regions[ly.i] = BI.extend(self._getBlockPositionAndSize(ly), { - id: ly.i - }); - }); - return regions; + getHelper: function () { + return this.arrangement.getHelper(); }, - _setRegionsByLayout: function (regions, layout) { - var self = this; - regions || (regions = this.regions); - BI.each(layout, function (i, ly) { - if (regions[ly.i]) { - BI.extend(regions[ly.i], self._getBlockPositionAndSize(ly)); - } - }); - return regions; + getRegionByName: function (name) { + return this.arrangement.getRegionByName(name); }, - _moveElement: function (layout, l, x, y, isUserAction) { - var self = this; - if (l._static) { - return layout; - } - - if (l.y === y && l.x === x) { - return layout; - } + getAllRegions: function () { + return this.arrangement.getAllRegions(); + }, - var movingUp = y && l.y > y; - if (typeof x === 'number') { - l.x = x; - } - if (typeof y === 'number') { - l.y = y; + revoke: function () { + if (this._old) { + this.populate(BI.toArray(this._old)); } - l.moved = true; + }, - var sorted = this._sortLayoutItemsByRowCol(layout); - if (movingUp) { - sorted = sorted.reverse(); - } - var collisions = getAllCollisions(sorted, l); + populate: function (items) { + var self = this; + BI.each(items, function (i, item) { + self._initResizable(item.el); + }); + this.arrangement.populate(items); + } +}); +BI.AdaptiveArrangement.EVENT_ELEMENT_START_RESIZE = "AdaptiveArrangement.EVENT_ELEMENT_START_RESIZE"; +BI.AdaptiveArrangement.EVENT_ELEMENT_RESIZE = "AdaptiveArrangement.EVENT_ELEMENT_RESIZE"; +BI.AdaptiveArrangement.EVENT_ELEMENT_STOP_RESIZE = "AdaptiveArrangement.EVENT_ELEMENT_STOP_RESIZE"; +BI.AdaptiveArrangement.EVENT_RESIZE = "AdaptiveArrangement.EVENT_RESIZE"; +BI.AdaptiveArrangement.EVENT_SCROLL = "AdaptiveArrangement.EVENT_SCROLL"; +BI.shortcut('bi.adaptive_arrangement', BI.AdaptiveArrangement);/** + * Arrangement的block面板 + * + * Created by GUY on 2016/3/1. + * @class BI.ArrangementBlock + * @extends BI.Widget + */ +BI.ArrangementBlock = BI.inherit(BI.Widget, { - for (var i = 0, len = collisions.length; i < len; i++) { - var collision = collisions[i]; - if (collision.moved) { - continue; - } + _defaultConfig: function () { + return BI.extend(BI.ArrangementBlock.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-arrangement-block bi-mask" + }); + } +}); +BI.shortcut('bi.arrangement_block', BI.ArrangementBlock);/** + * Arrangement的drop面板 + * + * Created by GUY on 2016/3/1. + * @class BI.ArrangementDroppable + * @extends BI.Widget + */ +BI.ArrangementDroppable = BI.inherit(BI.Widget, { - if (l.y > collision.y && l.y - collision.y > collision.h / 4) { - continue; - } + _defaultConfig: function () { + return BI.extend(BI.ArrangementDroppable.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-arrangement-droppable bi-resizer" + }); + } +}); +BI.shortcut('bi.arrangement_droppable', BI.ArrangementDroppable);/** + * 布局 + * + * Created by GUY on 2016/2/23. + * @class BI.Arrangement + * @extends BI.Widget + */ +BI.Arrangement = BI.inherit(BI.Widget, { - if (collision._static) { - layout = this._moveElementAwayFromCollision(layout, collision, l, isUserAction); - } else { - layout = this._moveElementAwayFromCollision(layout, l, collision, isUserAction); - } - } + _defaultConfig: function () { + return BI.extend(BI.Arrangement.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-arrangement", + layoutType: BI.Arrangement.LAYOUT_TYPE.GRID, + items: [] + }); + }, - return layout; + _init: function () { + BI.Arrangement.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.arrangement = BI.createWidget({ + type: "bi.arrangement_droppable", + cls: "arrangement-block", + invisible: true + }); + this.block = BI.createWidget({ + type: "bi.arrangement_block", + invisible: true + }); + this.container = BI.createWidget({ + type: "bi.absolute", + items: o.items.concat([this.block, this.arrangement]) + }); - function getAllCollisions(layout, layoutItem) { - return BI.filter(layout, function (i, l) { - return self._collides(l, layoutItem); + this.scrollContainer = BI.createWidget({ + type: "bi.adaptive", + width: "100%", + height: "100%", + scrollable: true, + items: [this.container] + }); + this.scrollContainer.element.scroll(function () { + self.fireEvent(BI.Arrangement.EVENT_SCROLL, { + scrollLeft: self.scrollContainer.element.scrollLeft(), + scrollTop: self.scrollContainer.element.scrollTop(), + clientWidth: self.scrollContainer.element[0].clientWidth, + clientHeight: self.scrollContainer.element[0].clientHeight + }); + }); + + BI.createWidget({ + type: "bi.adaptive", + element: this, + items: [this.scrollContainer] + }); + this.regions = {}; + if (o.items.length > 0) { + BI.nextTick(function () { + self.populate(o.items); }); } }, - _sortLayoutItemsByRowCol: function (layout) { - return [].concat(layout).sort(function (a, b) { - if (a.y > b.y || (a.y === b.y && a.x > b.x)) { - return 1; - } - return -1; + ////初始化操作//// + _calculateRegions: function (items) { + var self = this, o = this.options; + this.regions = {}; + BI.each(items, function (i, item) { + var region = self._createOneRegion(item); + self.regions[region.id] = region; }); }, - _collides: function (l1, l2) { - if (l1 === l2) { - return false; - } // same element - if (l1.x + l1.w <= l2.x) { - return false; - } // l1 is left of l2 - if (l1.x >= l2.x + l2.w) { - return false; - } // l1 is right of l2 - if (l1.y + l1.h <= l2.y) { - return false; - } // l1 is above l2 - if (l1.y >= l2.y + l2.h) { - return false; - } // l1 is below l2 - return true; // boxes overlap + _isEqual: function (num1, num2) { + return Math.abs(num1 - num2) < 2; }, - _getFirstCollision: function (layout, layoutItem) { - for (var i = 0, len = layout.length; i < len; i++) { - if (this._collides(layout[i], layoutItem)) { - return layout[i]; - } - } + _isLessThan: function (num1, num2) { + return num1 < num2 && !this._isEqual(num1, num2); }, - _moveElementAwayFromCollision: function (layout, collidesWith, - itemToMove, isUserAction) { - if (isUserAction) { - var fakeItem = { - x: itemToMove.x, - y: itemToMove.y, - w: itemToMove.w, - h: itemToMove.h, - i: '-1' - }; - fakeItem.y = Math.max(collidesWith.y - itemToMove.h, 0); - if (!this._getFirstCollision(layout, fakeItem)) { - return this._moveElement(layout, itemToMove, undefined, fakeItem.y); - } - } - - return this._moveElement(layout, itemToMove, undefined, itemToMove.y + 1); + _isMoreThan: function (num1, num2) { + return num1 > num2 && !this._isEqual(num1, num2); }, - _compactItem: function (compareWith, l, verticalCompact) { - if (verticalCompact) { - while (l.y > 0 && !this._getFirstCollision(compareWith, l)) { - l.y--; - } - } - - var collides; - while ((collides = this._getFirstCollision(compareWith, l))) { - l.y = collides.y + collides.h; - } - return l; + _isLessThanEqual: function (num1, num2) { + return num1 <= num2 || this._isEqual(num1, num2); }, - compact: function (layout, verticalCompact) { - var compareWith = getStatics(layout); - var sorted = this._sortLayoutItemsByRowCol(layout); - var out = []; - - for (var i = 0, len = sorted.length; i < len; i++) { - var l = sorted[i]; - - if (!l._static) { - l = this._compactItem(compareWith, l, verticalCompact); + _isMoreThanEqual: function (num1, num2) { + return num1 >= num2 || this._isEqual(num1, num2); + }, - compareWith.push(l); + //获取占有的最大Region + _getRegionOccupied: function (regions) { + var self = this, o = this.options; + if (BI.size(regions || this.regions) <= 0) { + return { + left: 0, + top: 0, + width: 0, + height: 0 } - - out[layout.indexOf(l)] = l; - - l.moved = false; } - - return out; - function getStatics(layout) { - return BI.filter(layout, function (i, l) { - return l._static; - }); + var minLeft = BI.MAX, maxLeft = BI.MIN, minTop = BI.MAX, maxTop = BI.MIN; + BI.each(regions || this.regions, function (id, region) { + minLeft = Math.min(minLeft, region.left); + maxLeft = Math.max(maxLeft, region.left + region.width); + minTop = Math.min(minTop, region.top); + maxTop = Math.max(maxTop, region.top + region.height); + }); + return { + left: minLeft, + top: minTop, + width: maxLeft - minLeft, + height: maxTop - minTop } }, - ////公有方法//// - getRegionByName: function (name) { - var obj = {}; - obj[name] = this.regions[name]; - return this._cloneRegion(obj)[name]; - }, - - getAllRegions: function () { - return BI.toArray(this._cloneRegion()); - }, - - getHelper: function () { - var helper = BI.createWidget({ - type: "bi.layout", - width: 18, - height: 18, - cls: "arrangement-helper bi-border" - }); - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [helper] - }); - return helper; - }, - - _start: function () { - if (this.options.layoutType === BI.Arrangement.LAYOUT_TYPE.GRID) { - this.block.setVisible(true); + //两个区域的交叉面积 + _getCrossArea: function (region1, region2) { + if (region1.left <= region2.left) { + if (region1.top <= region2.top) { + if (region1.top + region1.height > region2.top && region1.left + region1.width > region2.left) { + if (this._isEqual(region1.top + region1.height, region2.top) || this._isEqual(region1.left + region1.width, region2.left)) { + return 0; + } + return (region1.top + region1.height - region2.top) * (region1.left + region1.width - region2.left); + } + } else { + if (region2.top + region2.height > region1.top && region1.left + region1.width > region2.left) { + if (this._isEqual(region2.top + region2.height, region1.top) || this._isEqual(region1.left + region1.width, region2.left)) { + return 0; + } + return (region2.top + region2.height - region1.top) * (region1.left + region1.width - region2.left); + } + } } else { - this.arrangement.setVisible(true); + if (region1.top <= region2.top) { + if (region1.top + region1.height > region2.top && region2.left + region2.width > region1.left) { + if (this._isEqual(region1.top + region1.height, region2.top) || this._isEqual(region2.left + region2.width, region1.left)) { + return 0; + } + return (region1.top + region1.height - region2.top) * (region2.left + region2.width - region1.left); + } + } else { + if (region2.top + region2.height > region1.top && region2.left + region2.width > region1.left) { + if (this._isEqual(region2.top + region2.height, region1.top) || this._isEqual(region2.left + region2.width, region1.left)) { + return 0; + } + return (region2.top + region2.height - region1.top) * (region2.left + region2.width - region1.left); + } + } } + return 0; }, - _stop: function () { - this.arrangement.setVisible(false); - this.block.setVisible(false); - }, - - ////公有操作//// - setLayoutType: function (type) { - var self = this, o = this.options; - if (type !== o.layoutType) { - o.layoutType = type; - switch (o.layoutType) { - case BI.Arrangement.LAYOUT_TYPE.FREE: - break; - case BI.Arrangement.LAYOUT_TYPE.GRID: - this.relayout(); - break; + //是否有覆盖的组件 + _isRegionOverlay: function (regions) { + var reg = []; + BI.each(regions || this.regions, function (id, region) { + reg.push(new BI.Region(region.left, region.top, region.width, region.height)); + }); + for (var i = 0, len = reg.length; i < len; i++) { + for (var j = i + 1; j < len; j++) { + var area1 = { + left: reg[i].x, + top: reg[i].y, + width: reg[i].w, + height: reg[i].h + }; + var area2 = { + left: reg[j].x, + top: reg[j].y, + width: reg[j].w, + height: reg[j].h + }; + if (reg[i].isIntersects(reg[j]) && this._getCrossArea(area1, area2) > 1) { + return true; + } } } + return false; }, - getLayoutType: function () { - return this.options.layoutType; + //布局是否是优良的 + _isArrangeFine: function (regions) { + switch (this.options.layoutType) { + case BI.Arrangement.LAYOUT_TYPE.FREE: + return true; + case BI.Arrangement.LAYOUT_TYPE.GRID: + // if (this._isRegionOverlay()) { + // return false; + // } + } + return true; }, - getLayoutRatio: function () { - var occupied = this._getRegionOccupied(); - var width = this.getClientWidth(), height = this.getClientHeight(); - return { - x: BI.parseFloat(BI.contentFormat((occupied.left + occupied.width) / width, "#.##;-#.##")), - y: BI.parseFloat(BI.contentFormat((occupied.top + occupied.height) / height, "#.##;-#.##")) - } + _getRegionNames: function (regions) { + var names = []; + BI.each(regions || this.regions, function (i, region) { + names.push(region.id || region.attr("id")); + }); + return names; }, - addRegion: function (region, position) { - if (position) { - this.setPosition(position, region); - } - var self = this, o = this.options; - if (!this.position) { - return false; + _getRegionsByNames: function (names, regions) { + names = BI.isArray(names) ? names : [names]; + regions = regions || this.regions; + if (BI.isArray(regions)) { + var result = []; + BI.each(regions, function (i, region) { + if (names.contains(region.id || region.attr("id"))) { + result.push(region); + } + }); + } else { + var result = {}; + BI.each(names, function (i, name) { + result[name] = regions[name]; + }); } - var test = this._cloneRegion(); - BI.each(this.position.regions, function (i, region) { - test[region.id].left = region.left; - test[region.id].top = region.top; - test[region.id].width = region.width; - test[region.id].height = region.height; + return result; + }, + _cloneRegion: function (regions) { + var clone = {}; + BI.each(regions || this.regions, function (id, region) { + clone[id] = {}; + clone[id].el = region.el; + clone[id].id = region.id; + clone[id].left = region.left; + clone[id].top = region.top; + clone[id].width = region.width; + clone[id].height = region.height; }); - var item = BI.extend({}, region, { - left: this.position.insert.left, - top: this.position.insert.top, - width: this.position.insert.width, - height: this.position.insert.height - }); - var added = this._createOneRegion(item); - test[added.id] = added; - if (this._test(test)) { - delete test[added.id]; - this._modifyRegion(test); - this._addRegion(item); - this._populate(this.getAllRegions()); - return true; - } - return false; + return clone; }, - deleteRegion: function (name) { - if (!this.regions[name]) { - return false; - } - var self = this, o = this.options; - switch (o.layoutType) { - case BI.Arrangement.LAYOUT_TYPE.FREE: - this._deleteRegionByName(name); - this._populate(this.getAllRegions()); - return true; - case BI.Arrangement.LAYOUT_TYPE.GRID: - this._deleteRegionByName(name); - this._populate(this.getAllRegions()); - this.resize(); + //测试合法性 + _test: function (regions) { + var self = this; + return !BI.any(regions || this.regions, function (i, region) { + if (BI.isNaN(region.width) || BI.isNaN(region.height) || region.width <= 21 || region.height <= 21) { return true; + } + }) + }, + + _getScrollOffset: function () { + return { + left: this.scrollContainer.element[0].scrollLeft, + top: this.scrollContainer.element[0].scrollTop } - return false; }, - setRegionSize: function (name, size) { - var self = this, o = this.options; - var flag = false; - switch (o.layoutType) { - case BI.Arrangement.LAYOUT_TYPE.FREE: - var clone = this._cloneRegion(); - BI.extend(clone[name], { - width: size.width, - height: size.height - }); - if (this._test(clone)) { - this._modifyRegion(clone); - flag = true; - } - break; - case BI.Arrangement.LAYOUT_TYPE.GRID: - var clone = this._cloneRegion(); - BI.extend(clone[name], { - width: size.width, - height: size.height - }); - if (this._test(clone)) { - var layout = this._getLayoutsByRegions(clone); - layout = this.compact(layout, true); - var regions = this._getRegionsByLayout(layout); - this._modifyRegion(regions); - flag = true; - } - break; + ////操作//// + _createOneRegion: function (item) { + var el = BI.createWidget(item.el); + el.setVisible(true); + return { + id: el.attr("id"), + left: item.left, + top: item.top, + width: item.width, + height: item.height, + el: el } - this._applyRegion(); - return flag; }, - setPosition: function (position, size) { + _applyRegion: function (regions) { var self = this, o = this.options; - var insert, regions = [], cur; - if (position.left < 0 || position.top < 0) { - switch (o.layoutType) { - case BI.Arrangement.LAYOUT_TYPE.FREE: - break; - case BI.Arrangement.LAYOUT_TYPE.GRID: - this.resize(); - break; - } - this._stop(); - this.position = null; - return null; - } - var offset = this._getScrollOffset(); - position = { - left: position.left + offset.left, - top: position.top + offset.top - }; - switch (o.layoutType) { - case BI.Arrangement.LAYOUT_TYPE.FREE: - var insert = { - top: position.top < 0 ? 0 : position.top, - left: position.left < 0 ? 0 : position.left, - width: size.width, - height: size.height - }; - this.position = { - insert: insert - }; - this._setArrangeSize(insert); - this._start(); - break; - case BI.Arrangement.LAYOUT_TYPE.GRID: - var p = { - top: position.top < 0 ? 0 : position.top, - left: position.left < 0 ? 0 : position.left, - width: size.width, - height: size.height - }; - this._setArrangeSize(p); - var cur = this._getGridPositionAndSize(p); - var layout = [{ - x: 0, y: BI.MAX, w: cur.w, h: cur.h, i: cur.i - }].concat(this._getLayoutsByRegions()); - layout = this._moveElement(layout, layout[0], cur.x, cur.y, true); - layout = this.compact(layout, true); - var regions = this._setRegionsByLayout(this._cloneRegion(), layout); - var insert = this._getBlockPositionAndSize(layout[0]); - this.position = { - insert: insert, - regions: regions - }; - this._applyRegion(regions); - this._setBlockPositionAndSize(insert); - this._start(); - break; - } - return this.position; + BI.each(regions || this.regions, function (i, region) { + region.el.element.css({ + left: region.left, + top: region.top, + width: region.width, + height: region.height + }); + }); + this._applyContainer(); + this.ratio = this.getLayoutRatio(); }, - setRegionPosition: function (name, position) { - var self = this, o = this.options; - var offset = this._getScrollOffset(); - position = BI.extend(position, { - left: position.left + offset.left, - top: position.top + offset.top + _renderRegion: function () { + var self = this; + BI.createWidget({ + type: "bi.absolute", + element: this.container, + items: BI.toArray(this.regions) }); - switch (o.layoutType) { - case BI.Arrangement.LAYOUT_TYPE.FREE: - BI.extend(this.regions[name], { - left: position.left < 0 ? 0 : position.left, - top: position.top < 0 ? 0 : position.top - }); - this._applyRegion(); - break; - case BI.Arrangement.LAYOUT_TYPE.GRID: - if (!position.stop) { - BI.extend(this.regions[name], { - left: position.left < 0 ? 0 : position.left, - top: position.top < 0 ? 0 : position.top - }); - var cloned = this._cloneRegion(); - var cur = this._getGridPositionAndSize(BI.extend(cloned[name], { - left: position.left < 0 ? 0 : position.left, - top: position.top < 0 ? 0 : position.top - })); - var x = cur.x, y = cur.y; - cur = BI.extend(cur, { - x: 0, y: BI.MAX, i: -1 - }); - delete cloned[name]; - var layout = this._getLayoutsByRegions(cloned); - layout = this._moveElement([cur].concat(layout), cur, x, y, true); - layout = this.compact(layout, true); - var regions = this._getRegionsByLayout(layout); - this._modifyRegion(regions); - this._applyRegion(); + }, - this._setBlockPositionAndSize(this._getBlockPositionAndSize(cur)); - this.block.setVisible(true); - } else { - BI.extend(this.regions[name], { - left: position.left < 0 ? 0 : position.left, - top: position.top < 0 ? 0 : position.top - }); - var cloned = this._cloneRegion(); - var layout = this._getLayoutsByRegions(cloned); - layout = this.compact(layout, true); - var regions = this._getRegionsByLayout(layout); - this._modifyRegion(regions); - this._applyRegion(); - this.block.setVisible(false); - } - break; - } + getClientWidth: function () { + return this.scrollContainer.element[0].clientWidth; }, - setDropPosition: function (position, size) { - var self = this; - this.arrangement.setVisible(true); - var offset = this._getScrollOffset(); - this._setArrangeSize(BI.extend({}, size, { - left: position.left + offset.left, - top: position.top + offset.top - })); - return function () { - self.arrangement.setVisible(false); - } + getClientHeight: function () { + return this.scrollContainer.element[0].clientHeight; }, - scrollTo: function (scroll) { - this.scrollContainer.element.scrollTop(scroll.top); - this.scrollContainer.element.scrollLeft(scroll.left); + _applyContainer: function () { + //先掩藏后显示能够明确滚动条是否出现 + this.scrollContainer.element.css("overflow", "hidden"); + var occupied = this._getRegionOccupied(); + this.container.element.width(occupied.left + occupied.width).height(occupied.top + occupied.height); + this.scrollContainer.element.css("overflow", "auto"); + return occupied; }, - zoom: function (ratio) { - var self = this, o = this.options; - if (!ratio) { - return; - } - var occupied = this._applyContainer(); - switch (this.getLayoutType()) { - case BI.Arrangement.LAYOUT_TYPE.FREE: - if (this._isArrangeFine()) { - var width = this.getClientWidth(); - var xRatio = (ratio.x || 1) * width / (occupied.left + occupied.width); - //var yRatio = ratio.y * height / (occupied.top + occupied.height); - var regions = this._cloneRegion(); - BI.each(regions, function (i, region) { - region.left = region.left * xRatio; - //region.top = region.top * yRatio; - region.width = region.width * xRatio; - //region.height = region.height * yRatio; - }); - if (this._test(regions)) { - this._modifyRegion(regions); - this._applyRegion(); - } - this.resize(); - // } else { - this.relayout(); - } - break; - case BI.Arrangement.LAYOUT_TYPE.GRID: - if (this._isArrangeFine()) { - var width = this.getClientWidth(), height = this.getClientHeight(); - var xRatio = (ratio.x || 1) * width / (occupied.left + occupied.width); - var yRatio = (ratio.y || 1) * height / (occupied.top + occupied.height); - var regions = this._cloneRegion(); - BI.each(regions, function (i, region) { - region.left = region.left * xRatio; - region.width = region.width * xRatio; - region.top = region.top * yRatio; - region.height = region.height * yRatio; - //做一下自适应布局到网格布局的兼容 - var perWidth = self._getOneWidthPortion(); - var widthPortion = Math.round(region.width / perWidth); - var leftPortion = Math.round(region.left / perWidth); - var comparePortion = Math.round((region.width + region.left) / perWidth); - if (leftPortion + widthPortion !== comparePortion) { - region.left = leftPortion * perWidth; - region.width = comparePortion * perWidth - region.left; - } - }); - if (this._test(regions)) { - var layout = this._getLayoutsByRegions(regions); - layout = this.compact(layout, true); - regions = this._getRegionsByLayout(layout); - this._modifyRegion(regions); - this._applyRegion(); - } - } else { - this.relayout(); - } - break; - } + _modifyRegion: function (regions) { + BI.each(this.regions, function (id, region) { + if (regions[id]) { + region.left = regions[id].left; + region.top = regions[id].top; + region.width = regions[id].width; + region.height = regions[id].height; + } + }); }, - resize: function () { - var self = this, o = this.options; - switch (o.layoutType) { - case BI.Arrangement.LAYOUT_TYPE.FREE: - break; - case BI.Arrangement.LAYOUT_TYPE.GRID: - this.zoom(this.ratio); - var regions = this._cloneRegion(); - var layout = this._getLayoutsByRegions(regions); - layout = this.compact(layout, true); - regions = this._getRegionsByLayout(layout); - this._modifyRegion(regions); - this._applyRegion(); - break; - } + _addRegion: function (item) { + var region = this._createOneRegion(item); + this.regions[region.id] = region; + BI.createWidget({ + type: "bi.absolute", + element: this.container, + items: [region] + }); }, - relayout: function () { - var self = this, o = this.options; - switch (o.layoutType) { - case BI.Arrangement.LAYOUT_TYPE.FREE: - break; - case BI.Arrangement.LAYOUT_TYPE.GRID: - if (!this._isArrangeFine()) { - var perHeight = this._getOneHeightPortion(); - var width = this.getClientWidth(), height = this.getClientHeight(); - var regions = this._cloneRegion(); - var clone = BI.toArray(regions); - clone.sort(function (r1, r2) { - if (self._isEqual(r1.top, r2.top)) { - return r1.left - r2.left; - } - return r1.top - r2.top; - }); - var count = clone.length; - var cols = 4, rows = Math.floor((count - 1) / 4 + 1); - var w = width / cols, h = height / rows; - var store = {}; - BI.each(clone, function (i, region) { - var row = Math.floor(i / 4), col = i % 4; - BI.extend(region, { - top: row * perHeight * 6, - left: col * w, - width: w, - height: perHeight * 6 - }); - if (!store[row]) { - store[row] = {}; - } - store[row][col] = region; - }); - //非4的倍数 - // if (count % 4 !== 0) { - // var lasts = store[rows - 1]; - // var perWidth = width / (count % 4); - // BI.each(lasts, function (i, region) { - // BI.extend(region, { - // left: BI.parseInt(i) * perWidth, - // width: perWidth - // }); - // }); - // } - if (this._test(clone)) { - var layout = this._getLayoutsByRegions(regions); - layout = this.compact(layout, true); - regions = this._getRegionsByLayout(layout); - this._modifyRegion(regions); - this._populate(clone); - } - } else { - this.resize(); - } - break; + _deleteRegionByName: function (name) { + this.regions[name].el.setVisible(false); + delete this.regions[name]; + }, + + _setArrangeSize: function (size) { + this.arrangement.element.css({ + left: size.left, + top: size.top, + width: size.width, + height: size.height + }) + }, + + //Grid + _getOneWidthPortion: function () { + return this.getClientWidth() / BI.Arrangement.PORTION; + }, + _getOneHeightPortion: function () { + return this.getClientHeight() / BI.Arrangement.H_PORTION; + }, + + _getGridPositionAndSize: function (position) { + var perWidth = this._getOneWidthPortion(); + var perHeight = this._getOneHeightPortion(); + var widthPortion = Math.round(position.width / perWidth); + var leftPortion = Math.round(position.left / perWidth); + var topPortion = Math.round(position.top / perHeight); + var heightPortion = Math.round(position.height / perHeight); + // if (leftPortion > BI.Arrangement.PORTION) { + // leftPortion = BI.Arrangement.PORTION; + // } + // if (widthPortion > BI.Arrangement.PORTION) { + // widthPortion = BI.Arrangement.PORTION; + // } + // if (leftPortion + widthPortion > BI.Arrangement.PORTION) { + // leftPortion = BI.Arrangement.PORTION - widthPortion; + // } + if (widthPortion === 0) { + widthPortion = 1; + } + if (heightPortion === 0) { + heightPortion = 1; + } + return { + x: leftPortion, + y: topPortion, + w: widthPortion, + h: heightPortion } }, - _populate: function (items) { - this._stop(); - this._calculateRegions(items); - this._applyRegion(); + _getBlockPositionAndSize: function (position) { + var perWidth = this._getOneWidthPortion(); + var perHeight = this._getOneHeightPortion(); + return { + left: position.x * perWidth, + top: position.y * perHeight, + width: position.w * perWidth, + height: position.h * perHeight + }; }, - populate: function (items) { + _getLayoutsByRegions: function (regions) { var self = this; - BI.each(this.regions, function (name, region) { - self.regions[name].el.setVisible(false); - delete self.regions[name]; + var result = []; + BI.each(regions || this.regions, function (id, region) { + result.push(BI.extend(self._getGridPositionAndSize(region), { + i: region.id + })) }); - this._populate(items); - this._renderRegion(); - } -}); -BI.Arrangement.EVENT_SCROLL = "EVENT_SCROLL"; -BI.extend(BI.Arrangement, { - PORTION: 36, - H_PORTION: 18, - LAYOUT_TYPE: { - GRID: 0, - FREE: 1 - } -}); -BI.shortcut('bi.arrangement', BI.Arrangement);/** - * 表关联树 - * - * Created by GUY on 2015/12/15. - * @class BI.BranchRelation - * @extends BI.Widget - */ -BI.BranchRelation = BI.inherit(BI.Widget, { + return result; + }, - _defaultConfig: function () { - return BI.extend(BI.BranchRelation.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-branch-relation-tree", - items: [], + _getLayoutIndexByName: function (layout, name) { + return BI.findIndex(layout, function (i, l) { + return l.i === name; + }); + }, - centerOffset: 0,//重心偏移量 - direction: BI.Direction.Bottom, - align: BI.VerticalAlign.Top - }) + _setBlockPositionAndSize: function (size) { + this.block.element.css({ + left: size.left, + top: size.top, + width: size.width, + height: size.height + }); }, - _init: function () { - BI.BranchRelation.superclass._init.apply(this, arguments); - this.populate(this.options.items); + _getRegionsByLayout: function (layout) { + var self = this; + var regions = {}; + BI.each(layout, function (i, ly) { + regions[ly.i] = BI.extend(self._getBlockPositionAndSize(ly), { + id: ly.i + }); + }); + return regions; }, - //树分层 - _stratification: function () { - var levels = []; - this.tree.recursion(function (node, route) { - //node.isRoot = route.length <= 1; - node.leaf = node.isLeaf(); - if (!levels[route.length - 1]) { - levels[route.length - 1] = []; + _setRegionsByLayout: function (regions, layout) { + var self = this; + regions || (regions = this.regions); + BI.each(layout, function (i, ly) { + if (regions[ly.i]) { + BI.extend(regions[ly.i], self._getBlockPositionAndSize(ly)); } - levels[route.length - 1].push(node); }); - return levels; + return regions; }, - //计算所有节点的叶子结点个数 - _calculateLeaves: function () { - var count = 0; + _moveElement: function (layout, l, x, y, isUserAction) { + var self = this; + if (l._static) { + return layout; + } - function track(node) { - var c = 0; - if (node.isLeaf()) { - return 1; + if (l.y === y && l.x === x) { + return layout; + } + + var movingUp = y && l.y > y; + if (typeof x === 'number') { + l.x = x; + } + if (typeof y === 'number') { + l.y = y; + } + l.moved = true; + + var sorted = this._sortLayoutItemsByRowCol(layout); + if (movingUp) { + sorted = sorted.reverse(); + } + var collisions = getAllCollisions(sorted, l); + + for (var i = 0, len = collisions.length; i < len; i++) { + var collision = collisions[i]; + if (collision.moved) { + continue; + } + + if (l.y > collision.y && l.y - collision.y > collision.h / 4) { + continue; + } + + if (collision._static) { + layout = this._moveElementAwayFromCollision(layout, collision, l, isUserAction); + } else { + layout = this._moveElementAwayFromCollision(layout, l, collision, isUserAction); } - BI.each(node.getChildren(), function (i, child) { - c += track(child); - }); - node.set("leaves", c); - return c; } - count = track(this.tree.getRoot()); - return count; + return layout; + + function getAllCollisions(layout, layoutItem) { + return BI.filter(layout, function (i, l) { + return self._collides(l, layoutItem); + }); + } }, - //树平移 - _translate: function (levels) { - var adjust = []; - var maxLevel = levels.length; - BI.each(levels, function (i, nodes) { - if (!adjust[i]) { - adjust[i] = []; + _sortLayoutItemsByRowCol: function (layout) { + return [].concat(layout).sort(function (a, b) { + if (a.y > b.y || (a.y === b.y && a.x > b.x)) { + return 1; } - BI.each(nodes, function (j, node) { - if (node.isLeaf() && i < maxLevel - 1) { - var newNode = new BI.Node(BI.UUID()); - //newNode.isEmptyRoot = node.isRoot || node.isEmptyRoot; - newNode.isNew = true; - //把node向下一层移 - var tar = 0; - if (j > 0) { - var c = nodes[j - 1].getLastChild(); - tar = levels[i + 1].indexOf(c) + 1; - } - levels[i + 1].splice(tar, 0, node); - //新增一个临时树节点 - var index = node.parent.getChildIndex(node.id); - node.parent.removeChildByIndex(index); - node.parent.addChild(newNode, index); - newNode.addChild(node); - adjust[i].push(newNode); - nodes[j] = newNode; - } else { - adjust[i].push(node); - } - }) + return -1; }); - return adjust; }, - //树补白 - _fill: function (levels) { - var adjust = []; - var maxLevel = levels.length; - BI.each(levels, function (i, nodes) { - if (!adjust[i]) { - adjust[i] = []; - } - BI.each(nodes, function (j, node) { - if (node.isLeaf() && i < maxLevel - 1) { - var newNode = new BI.Node(BI.UUID()); - newNode.leaf = true; - newNode.width = node.width; - newNode.height = node.height; - newNode.isNew = true; - //把node向下一层移 - var tar = 0; - if (j > 0) { - var c = nodes[j - 1].getLastChild(); - tar = levels[i + 1].indexOf(c) + 1; - } - levels[i + 1].splice(tar, 0, newNode); - //新增一个临时树节点 - node.addChild(newNode); - } - adjust[i].push(node); - }) - }); - return adjust; + _collides: function (l1, l2) { + if (l1 === l2) { + return false; + } // same element + if (l1.x + l1.w <= l2.x) { + return false; + } // l1 is left of l2 + if (l1.x >= l2.x + l2.w) { + return false; + } // l1 is right of l2 + if (l1.y + l1.h <= l2.y) { + return false; + } // l1 is above l2 + if (l1.y >= l2.y + l2.h) { + return false; + } // l1 is below l2 + return true; // boxes overlap }, - //树调整 - _adjust: function (adjust) { - while (true) { - var isAllNeedAjust = false; - BI.backEach(adjust, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (!node.isNew) { - var needAdjust = true; - BI.any(node.getChildren(), function (k, n) { - if (!n.isNew) { - needAdjust = false; - return true; - } - }); - if (!node.isLeaf() && needAdjust === true) { - var allChilds = []; - BI.each(node.getChildren(), function (k, n) { - allChilds = allChilds.concat(n.getChildren()); - }); - node.removeAllChilds(); - BI.each(allChilds, function (k, c) { - node.addChild(c); - }); - var newNode = new BI.Node(BI.UUID()); - //newNode.isEmptyRoot = node.isRoot || node.isEmptyRoot; - newNode.isNew = true; - var index = node.parent.getChildIndex(node.id); - node.parent.removeChildByIndex(index); - node.parent.addChild(newNode, index); - newNode.addChild(node); - isAllNeedAjust = true; - } - } - }) - }); - if (isAllNeedAjust === false) { - break; - } else {//树重构 - adjust = this._stratification(); + _getFirstCollision: function (layout, layoutItem) { + for (var i = 0, len = layout.length; i < len; i++) { + if (this._collides(layout[i], layoutItem)) { + return layout[i]; } } - return adjust; }, - _calculateWidth: function () { - var o = this.options; - var width = 0; - - function track1(node) { - var w = 0; - if (node.isLeaf()) { - return node.width; + _moveElementAwayFromCollision: function (layout, collidesWith, + itemToMove, isUserAction) { + if (isUserAction) { + var fakeItem = { + x: itemToMove.x, + y: itemToMove.y, + w: itemToMove.w, + h: itemToMove.h, + i: '-1' + }; + fakeItem.y = Math.max(collidesWith.y - itemToMove.h, 0); + if (!this._getFirstCollision(layout, fakeItem)) { + return this._moveElement(layout, itemToMove, undefined, fakeItem.y); } - BI.each(node.getChildren(), function (i, child) { - w += track1(child); - }); - return w; } - function track2(node) { - var w = 0; - if (node.isLeaf()) { - return node.height; + return this._moveElement(layout, itemToMove, undefined, itemToMove.y + 1); + }, + + _compactItem: function (compareWith, l, verticalCompact) { + if (verticalCompact) { + while (l.y > 0 && !this._getFirstCollision(compareWith, l)) { + l.y--; } - BI.each(node.getChildren(), function (i, child) { - w += track2(child); - }); - return w; } - if (this._isVertical()) { - width = track1(this.tree.getRoot()); - } else { - width = track2(this.tree.getRoot()); + var collides; + while ((collides = this._getFirstCollision(compareWith, l))) { + l.y = collides.y + collides.h; } - - return width; + return l; }, - _isVertical: function () { - var o = this.options; - return o.direction === BI.Direction.Top || o.direction === BI.Direction.Bottom; - }, + compact: function (layout, verticalCompact) { + var compareWith = getStatics(layout); + var sorted = this._sortLayoutItemsByRowCol(layout); + var out = []; - _calculateHeight: function () { - var o = this.options; - var height = 0; + for (var i = 0, len = sorted.length; i < len; i++) { + var l = sorted[i]; - function track1(node) { - var h = 0; - BI.each(node.getChildren(), function (i, child) { - h = Math.max(h, track1(child)); - }); - return h + (node.height || 0); + if (!l._static) { + l = this._compactItem(compareWith, l, verticalCompact); + + compareWith.push(l); + } + + out[layout.indexOf(l)] = l; + + l.moved = false; } - function track2(node) { - var h = 0; - BI.each(node.getChildren(), function (i, child) { - h = Math.max(h, track2(child)); + return out; + function getStatics(layout) { + return BI.filter(layout, function (i, l) { + return l._static; }); - return h + (node.width || 0); } + }, - if (this._isVertical()) { - height = track1(this.tree.getRoot()); + ////公有方法//// + getRegionByName: function (name) { + var obj = {}; + obj[name] = this.regions[name]; + return this._cloneRegion(obj)[name]; + }, + + getAllRegions: function () { + return BI.toArray(this._cloneRegion()); + }, + + getHelper: function () { + var helper = BI.createWidget({ + type: "bi.layout", + width: 18, + height: 18, + cls: "arrangement-helper bi-border" + }); + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [helper] + }); + return helper; + }, + + _start: function () { + if (this.options.layoutType === BI.Arrangement.LAYOUT_TYPE.GRID) { + this.block.setVisible(true); } else { - height = track2(this.tree.getRoot()); + this.arrangement.setVisible(true); } - return height; }, - _calculateXY: function (levels) { - var o = this.options; - var width = this._calculateWidth(); - var height = this._calculateHeight(); - var levelCount = levels.length; - var allLeavesCount = this._calculateLeaves(); - //计算坐标 - var xy = {}; - var levelHeight = height / levelCount; - BI.each(levels, function (i, nodes) { - //计算权重 - var weights = []; - BI.each(nodes, function (j, node) { - weights[j] = (node.get("leaves") || 1) / allLeavesCount; - }); - BI.each(nodes, function (j, node) { - //求前j个元素的权重 - var weight = BI.sum(weights.slice(0, j)); - //求坐标 - var x = weight * width + weights[j] * width / 2; - var y = i * levelHeight + levelHeight / 2; - xy[node.id] = {x: x, y: y}; - }) - }); - return xy; + _stop: function () { + this.arrangement.setVisible(false); + this.block.setVisible(false); }, - _stroke: function (levels, xy) { - var height = this._calculateHeight(); - var levelCount = levels.length; - var levelHeight = height / levelCount; + ////公有操作//// + setLayoutType: function (type) { var self = this, o = this.options; - switch (o.direction) { - case BI.Direction.Top: - BI.each(levels, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (node.getChildrenLength() > 0 && !node.leaf) { - var path = ""; - var start = xy[node.id]; - var split = start.y + levelHeight / 2; - path += "M" + start.x + "," + (start.y + o.centerOffset) + "L" + start.x + "," + split; - var end = []; - BI.each(node.getChildren(), function (t, c) { - var e = end[t] = xy[c.id]; - path += "M" + e.x + "," + (e.y + o.centerOffset) + "L" + e.x + "," + split; - }); - if (end.length > 0) { - path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split; - } - self.svg.path(path).attr("stroke", "#d4dadd"); - } - }) + if (type !== o.layoutType) { + o.layoutType = type; + switch (o.layoutType) { + case BI.Arrangement.LAYOUT_TYPE.FREE: + break; + case BI.Arrangement.LAYOUT_TYPE.GRID: + this.relayout(); + break; + } + } + }, + + getLayoutType: function () { + return this.options.layoutType; + }, + + getLayoutRatio: function () { + var occupied = this._getRegionOccupied(); + var width = this.getClientWidth(), height = this.getClientHeight(); + return { + x: BI.parseFloat(BI.contentFormat((occupied.left + occupied.width) / width, "#.##;-#.##")), + y: BI.parseFloat(BI.contentFormat((occupied.top + occupied.height) / height, "#.##;-#.##")) + } + }, + + addRegion: function (region, position) { + if (position) { + this.setPosition(position, region); + } + var self = this, o = this.options; + if (!this.position) { + return false; + } + var test = this._cloneRegion(); + BI.each(this.position.regions, function (i, region) { + test[region.id].left = region.left; + test[region.id].top = region.top; + test[region.id].width = region.width; + test[region.id].height = region.height; + + }); + var item = BI.extend({}, region, { + left: this.position.insert.left, + top: this.position.insert.top, + width: this.position.insert.width, + height: this.position.insert.height + }); + var added = this._createOneRegion(item); + test[added.id] = added; + if (this._test(test)) { + delete test[added.id]; + this._modifyRegion(test); + this._addRegion(item); + this._populate(this.getAllRegions()); + return true; + } + return false; + }, + + deleteRegion: function (name) { + if (!this.regions[name]) { + return false; + } + var self = this, o = this.options; + switch (o.layoutType) { + case BI.Arrangement.LAYOUT_TYPE.FREE: + this._deleteRegionByName(name); + this._populate(this.getAllRegions()); + return true; + case BI.Arrangement.LAYOUT_TYPE.GRID: + this._deleteRegionByName(name); + this._populate(this.getAllRegions()); + this.resize(); + return true; + } + return false; + }, + + setRegionSize: function (name, size) { + var self = this, o = this.options; + var flag = false; + switch (o.layoutType) { + case BI.Arrangement.LAYOUT_TYPE.FREE: + var clone = this._cloneRegion(); + BI.extend(clone[name], { + width: size.width, + height: size.height }); + if (this._test(clone)) { + this._modifyRegion(clone); + flag = true; + } break; - case BI.Direction.Bottom: - BI.each(levels, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (node.getChildrenLength() > 0 && !node.leaf) { - var path = ""; - var start = xy[node.id]; - var split = start.y - levelHeight / 2; - path += "M" + start.x + "," + (start.y - o.centerOffset) + "L" + start.x + "," + split; - var end = []; - BI.each(node.getChildren(), function (t, c) { - var e = end[t] = xy[c.id]; - path += "M" + e.x + "," + (e.y - o.centerOffset) + "L" + e.x + "," + split; - }); - if (end.length > 0) { - path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split; - } - self.svg.path(path).attr("stroke", "#d4dadd"); - } - }) + case BI.Arrangement.LAYOUT_TYPE.GRID: + var clone = this._cloneRegion(); + BI.extend(clone[name], { + width: size.width, + height: size.height }); + if (this._test(clone)) { + var layout = this._getLayoutsByRegions(clone); + layout = this.compact(layout, true); + var regions = this._getRegionsByLayout(layout); + this._modifyRegion(regions); + flag = true; + } break; - case BI.Direction.Left: - BI.each(levels, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (node.getChildrenLength() > 0 && !node.leaf) { - var path = ""; - var start = xy[node.id]; - var split = start.y + levelHeight / 2; - path += "M" + (start.y + o.centerOffset) + "," + start.x + "L" + split + "," + start.x; - var end = []; - BI.each(node.getChildren(), function (t, c) { - var e = end[t] = xy[c.id]; - path += "M" + (e.y + o.centerOffset) + "," + e.x + "L" + split + "," + e.x; - }); - if (end.length > 0) { - path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x; - } - self.svg.path(path).attr("stroke", "#d4dadd"); - } - }) - }); + } + this._applyRegion(); + return flag; + }, + + setPosition: function (position, size) { + var self = this, o = this.options; + var insert, regions = [], cur; + if (position.left < 0 || position.top < 0) { + switch (o.layoutType) { + case BI.Arrangement.LAYOUT_TYPE.FREE: + break; + case BI.Arrangement.LAYOUT_TYPE.GRID: + this.resize(); + break; + } + this._stop(); + this.position = null; + return null; + } + var offset = this._getScrollOffset(); + position = { + left: position.left + offset.left, + top: position.top + offset.top + }; + switch (o.layoutType) { + case BI.Arrangement.LAYOUT_TYPE.FREE: + var insert = { + top: position.top < 0 ? 0 : position.top, + left: position.left < 0 ? 0 : position.left, + width: size.width, + height: size.height + }; + this.position = { + insert: insert + }; + this._setArrangeSize(insert); + this._start(); break; - case BI.Direction.Right: - BI.each(levels, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (node.getChildrenLength() > 0 && !node.leaf) { - var path = ""; - var start = xy[node.id]; - var split = start.y - levelHeight / 2; - path += "M" + (start.y - o.centerOffset) + "," + start.x + "L" + split + "," + start.x; - var end = []; - BI.each(node.getChildren(), function (t, c) { - var e = end[t] = xy[c.id]; - path += "M" + (e.y - o.centerOffset) + "," + e.x + "L" + split + "," + e.x; - }); - if (end.length > 0) { - path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x; - } - self.svg.path(path).attr("stroke", "#d4dadd"); - } - }) + case BI.Arrangement.LAYOUT_TYPE.GRID: + var p = { + top: position.top < 0 ? 0 : position.top, + left: position.left < 0 ? 0 : position.left, + width: size.width, + height: size.height + }; + this._setArrangeSize(p); + var cur = this._getGridPositionAndSize(p); + var layout = [{ + x: 0, y: BI.MAX, w: cur.w, h: cur.h, i: cur.i + }].concat(this._getLayoutsByRegions()); + layout = this._moveElement(layout, layout[0], cur.x, cur.y, true); + layout = this.compact(layout, true); + var regions = this._setRegionsByLayout(this._cloneRegion(), layout); + var insert = this._getBlockPositionAndSize(layout[0]); + this.position = { + insert: insert, + regions: regions + }; + this._applyRegion(regions); + this._setBlockPositionAndSize(insert); + this._start(); + break; + } + return this.position; + }, + + setRegionPosition: function (name, position) { + var self = this, o = this.options; + var offset = this._getScrollOffset(); + position = BI.extend(position, { + left: position.left + offset.left, + top: position.top + offset.top + }); + switch (o.layoutType) { + case BI.Arrangement.LAYOUT_TYPE.FREE: + BI.extend(this.regions[name], { + left: position.left < 0 ? 0 : position.left, + top: position.top < 0 ? 0 : position.top }); + this._applyRegion(); + break; + case BI.Arrangement.LAYOUT_TYPE.GRID: + if (!position.stop) { + BI.extend(this.regions[name], { + left: position.left < 0 ? 0 : position.left, + top: position.top < 0 ? 0 : position.top + }); + var cloned = this._cloneRegion(); + var cur = this._getGridPositionAndSize(BI.extend(cloned[name], { + left: position.left < 0 ? 0 : position.left, + top: position.top < 0 ? 0 : position.top + })); + var x = cur.x, y = cur.y; + cur = BI.extend(cur, { + x: 0, y: BI.MAX, i: -1 + }); + delete cloned[name]; + var layout = this._getLayoutsByRegions(cloned); + layout = this._moveElement([cur].concat(layout), cur, x, y, true); + layout = this.compact(layout, true); + var regions = this._getRegionsByLayout(layout); + this._modifyRegion(regions); + this._applyRegion(); + + this._setBlockPositionAndSize(this._getBlockPositionAndSize(cur)); + this.block.setVisible(true); + } else { + BI.extend(this.regions[name], { + left: position.left < 0 ? 0 : position.left, + top: position.top < 0 ? 0 : position.top + }); + var cloned = this._cloneRegion(); + var layout = this._getLayoutsByRegions(cloned); + layout = this.compact(layout, true); + var regions = this._getRegionsByLayout(layout); + this._modifyRegion(regions); + this._applyRegion(); + this.block.setVisible(false); + } break; } }, - _createBranches: function (levels) { - var self = this, o = this.options; - if (o.direction === BI.Direction.Bottom || o.direction === BI.Direction.Right) { - levels = levels.reverse(); + setDropPosition: function (position, size) { + var self = this; + this.arrangement.setVisible(true); + var offset = this._getScrollOffset(); + this._setArrangeSize(BI.extend({}, size, { + left: position.left + offset.left, + top: position.top + offset.top + })); + return function () { + self.arrangement.setVisible(false); } - var xy = this._calculateXY(levels); - //画图 - this._stroke(levels, xy); - }, - - _isNeedAdjust: function () { - var o = this.options; - return o.direction === BI.Direction.Top && o.align === BI.VerticalAlign.Bottom || o.direction === BI.Direction.Bottom && o.align === BI.VerticalAlign.Top - || o.direction === BI.Direction.Left && o.align === BI.HorizontalAlign.Right || o.direction === BI.Direction.Right && o.align === BI.HorizontalAlign.Left - }, - - setValue: function (value) { - }, - getValue: function () { - + scrollTo: function (scroll) { + this.scrollContainer.element.scrollTop(scroll.top); + this.scrollContainer.element.scrollLeft(scroll.left); }, - _transformToTreeFormat: function (sNodes) { - var i, l; - if (!sNodes) { - return []; + zoom: function (ratio) { + var self = this, o = this.options; + if (!ratio) { + return; } - - if (BI.isArray(sNodes)) { - var r = []; - var tmpMap = []; - for (i = 0, l = sNodes.length; i < l; i++) { - tmpMap[sNodes[i].id] = sNodes[i]; - } - for (i = 0, l = sNodes.length; i < l; i++) { - if (tmpMap[sNodes[i].pId] && sNodes[i].id != sNodes[i].pId) { - if (!tmpMap[sNodes[i].pId].children) { - tmpMap[sNodes[i].pId].children = []; + var occupied = this._applyContainer(); + switch (this.getLayoutType()) { + case BI.Arrangement.LAYOUT_TYPE.FREE: + if (this._isArrangeFine()) { + var width = this.getClientWidth(); + var xRatio = (ratio.x || 1) * width / (occupied.left + occupied.width); + //var yRatio = ratio.y * height / (occupied.top + occupied.height); + var regions = this._cloneRegion(); + BI.each(regions, function (i, region) { + region.left = region.left * xRatio; + //region.top = region.top * yRatio; + region.width = region.width * xRatio; + //region.height = region.height * yRatio; + }); + if (this._test(regions)) { + this._modifyRegion(regions); + this._applyRegion(); + } + this.resize(); + // } else { + this.relayout(); + } + break; + case BI.Arrangement.LAYOUT_TYPE.GRID: + if (this._isArrangeFine()) { + var width = this.getClientWidth(), height = this.getClientHeight(); + var xRatio = (ratio.x || 1) * width / (occupied.left + occupied.width); + var yRatio = (ratio.y || 1) * height / (occupied.top + occupied.height); + var regions = this._cloneRegion(); + BI.each(regions, function (i, region) { + region.left = region.left * xRatio; + region.width = region.width * xRatio; + region.top = region.top * yRatio; + region.height = region.height * yRatio; + //做一下自适应布局到网格布局的兼容 + var perWidth = self._getOneWidthPortion(); + var widthPortion = Math.round(region.width / perWidth); + var leftPortion = Math.round(region.left / perWidth); + var comparePortion = Math.round((region.width + region.left) / perWidth); + if (leftPortion + widthPortion !== comparePortion) { + region.left = leftPortion * perWidth; + region.width = comparePortion * perWidth - region.left; + } + }); + if (this._test(regions)) { + var layout = this._getLayoutsByRegions(regions); + layout = this.compact(layout, true); + regions = this._getRegionsByLayout(layout); + this._modifyRegion(regions); + this._applyRegion(); } - tmpMap[sNodes[i].pId].children.push(sNodes[i]); } else { - r.push(sNodes[i]); + this.relayout(); } - } - return r; - } else { - return [sNodes]; + break; } }, - populate: function (items) { + resize: function () { var self = this, o = this.options; - o.items = items || []; - this.empty(); - items = this._transformToTreeFormat(o.items); - this.tree = new BI.Tree(); - this.tree.initTree(items); - - this.svg = BI.createWidget({ - type: "bi.svg" - }); - - //树分层 - var levels = this._stratification(); - - if (this._isNeedAdjust()) { - //树平移 - var adjust = this._translate(levels); - //树调整 - adjust = this._adjust(adjust); - - this._createBranches(adjust); - } else { - var adjust = this._fill(levels); - - this._createBranches(adjust); + switch (o.layoutType) { + case BI.Arrangement.LAYOUT_TYPE.FREE: + break; + case BI.Arrangement.LAYOUT_TYPE.GRID: + this.zoom(this.ratio); + var regions = this._cloneRegion(); + var layout = this._getLayoutsByRegions(regions); + layout = this.compact(layout, true); + regions = this._getRegionsByLayout(layout); + this._modifyRegion(regions); + this._applyRegion(); + break; } + }, - var container = BI.createWidget({ - type: "bi.layout", - width: this._isVertical() ? this._calculateWidth() : this._calculateHeight(), - height: this._isVertical() ? this._calculateHeight() : this._calculateWidth() - }); - BI.createWidget({ - type: "bi.absolute", - element: container, - items: [{ - el: this.svg, - top: 0, - left: 0, - right: 0, - bottom: 0 - }] - }); - if (this._isVertical()) { - items = [{ - type: "bi.handstand_branch_tree", - expander: { - direction: o.direction - }, - el: { - layouts: [{ - type: "bi.horizontal_adapt", - verticalAlign: o.align - }] - }, - items: items - }] - } else { - items = [{ - type: "bi.branch_tree", - expander: { - direction: o.direction - }, - el: { - layouts: [{ - type: "bi.vertical" - }, { - type: o.align === BI.HorizontalAlign.Left ? "bi.left" : "bi.right" - }] - }, - items: items - }] + relayout: function () { + var self = this, o = this.options; + switch (o.layoutType) { + case BI.Arrangement.LAYOUT_TYPE.FREE: + break; + case BI.Arrangement.LAYOUT_TYPE.GRID: + if (!this._isArrangeFine()) { + var perHeight = this._getOneHeightPortion(); + var width = this.getClientWidth(), height = this.getClientHeight(); + var regions = this._cloneRegion(); + var clone = BI.toArray(regions); + clone.sort(function (r1, r2) { + if (self._isEqual(r1.top, r2.top)) { + return r1.left - r2.left; + } + return r1.top - r2.top; + }); + var count = clone.length; + var cols = 4, rows = Math.floor((count - 1) / 4 + 1); + var w = width / cols, h = height / rows; + var store = {}; + BI.each(clone, function (i, region) { + var row = Math.floor(i / 4), col = i % 4; + BI.extend(region, { + top: row * perHeight * 6, + left: col * w, + width: w, + height: perHeight * 6 + }); + if (!store[row]) { + store[row] = {}; + } + store[row][col] = region; + }); + //非4的倍数 + // if (count % 4 !== 0) { + // var lasts = store[rows - 1]; + // var perWidth = width / (count % 4); + // BI.each(lasts, function (i, region) { + // BI.extend(region, { + // left: BI.parseInt(i) * perWidth, + // width: perWidth + // }); + // }); + // } + if (this._test(clone)) { + var layout = this._getLayoutsByRegions(regions); + layout = this.compact(layout, true); + regions = this._getRegionsByLayout(layout); + this._modifyRegion(regions); + this._populate(clone); + } + } else { + this.resize(); + } + break; } - BI.createWidget({ - type: "bi.adaptive", - element: container, - items: items - }); - BI.createWidget({ - type: "bi.center_adapt", - scrollable: true, - element: this, - items: [container] + }, + + _populate: function (items) { + this._stop(); + this._calculateRegions(items); + this._applyRegion(); + }, + + populate: function (items) { + var self = this; + BI.each(this.regions, function (name, region) { + self.regions[name].el.setVisible(false); + delete self.regions[name]; }); + this._populate(items); + this._renderRegion(); } }); -BI.BranchRelation.EVENT_CHANGE = "BranchRelation.EVENT_CHANGE"; -BI.shortcut("bi.branch_relation", BI.BranchRelation);/** +BI.Arrangement.EVENT_SCROLL = "EVENT_SCROLL"; +BI.extend(BI.Arrangement, { + PORTION: 36, + H_PORTION: 18, + LAYOUT_TYPE: { + GRID: 0, + FREE: 1 + } +}); +BI.shortcut('bi.arrangement', BI.Arrangement);/** * 日期控件中的月份下拉框 * * Created by GUY on 2015/9/7. @@ -81762,7 +81375,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, { } }); -BI.shortcut("bi.date_pane_widget", BI.DatePaneWidget);/** +BI.shortcut("bi.date_pane", BI.DatePaneWidget);/** * Created by Urthur on 2017/7/14. */ BI.DateTimeCombo = BI.inherit(BI.Single, { @@ -81840,8 +81453,8 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { }); var triggerBtn = BI.createWidget({ - type: "bi.trigger_icon_button", - cls: "bi-trigger-date-button chart-date-normal-font bi-border-right", + type: "bi.icon_button", + cls: "bi-trigger-icon-button date-font bi-border-right", width: 30, height: 24 }); @@ -82528,547 +82141,934 @@ BI.DownListCombo = BI.inherit(BI.Widget, { }) }, - _init: function () { - BI.DownListCombo.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.popupview = BI.createWidget({ - type: "bi.down_list_popup", - items: o.items, - chooseType: o.chooseType + _init: function () { + BI.DownListCombo.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.popupview = BI.createWidget({ + type: "bi.down_list_popup", + items: o.items, + chooseType: o.chooseType + }); + + this.popupview.on(BI.DownListPopup.EVENT_CHANGE, function (value) { + self.fireEvent(BI.DownListCombo.EVENT_CHANGE, value); + self.downlistcombo.hideView(); + }); + + this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE, function (value, fatherValue) { + self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, value, fatherValue); + self.downlistcombo.hideView(); + }); + + + this.downlistcombo = BI.createWidget({ + element: this, + type: 'bi.combo', + trigger: o.trigger, + isNeedAdjustWidth: false, + adjustLength: o.adjustLength, + direction: o.direction, + el: BI.createWidget(o.el, { + type: "bi.icon_trigger", + extraCls: o.iconCls ? o.iconCls : "pull-down-font", + width: o.width, + height: o.height + }), + popup: { + el: this.popupview, + stopPropagation: true, + maxHeight: 1000 + } + }); + + this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { + self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW); + }); + }, + + hideView: function () { + this.downlistcombo.hideView(); + }, + + showView: function () { + this.downlistcombo.showView(); + }, + + populate: function (items) { + this.popupview.populate(items); + }, + + setValue: function (v) { + this.popupview.setValue(v); + }, + getValue: function () { + return this.popupview.getValue() + } +}); +BI.DownListCombo.EVENT_CHANGE = "EVENT_CHANGE"; +BI.DownListCombo.EVENT_SON_VALUE_CHANGE = "EVENT_SON_VALUE_CHANGE"; +BI.DownListCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; + +BI.shortcut("bi.down_list_combo", BI.DownListCombo);/** + * Created by roy on 15/9/6. + */ +BI.DownListGroup = BI.inherit(BI.Widget, { + constants: { + iconCls: "check-mark-ha-font" + }, + _defaultConfig: function () { + return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-down-list-group", + items: [ + { + el: {} + } + ] + }) + }, + _init: function () { + BI.DownListGroup.superclass._init.apply(this, arguments); + var o = this.options, self = this; + + this.downlistgroup = BI.createWidget({ + element: this, + type: "bi.button_tree", + items: o.items, + chooseType: 0,//0单选,1多选 + layouts: [{ + type: "bi.vertical", + hgap: 0, + vgap: 0 + }] + }); + this.downlistgroup.on(BI.Controller.EVENT_CHANGE, function (type) { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + if(type === BI.Events.CLICK) { + self.fireEvent(BI.DownListGroup.EVENT_CHANGE, arguments); + } + }) + }, + getValue:function(){ + return this.downlistgroup.getValue(); + }, + setValue:function(v){ + this.downlistgroup.setValue(v); + } + + +}) +BI.DownListGroup.EVENT_CHANGE = "EVENT_CHANGE"; +BI.shortcut("bi.down_list_group", BI.DownListGroup);BI.DownListItem = BI.inherit(BI.Single, { + _defaultConfig: function () { + var conf = BI.DownListItem.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: "bi-down-list-item bi-list-item-active", + cls: "", + height: 25, + logic: { + dynamic: true + }, + selected: false, + iconHeight: null, + iconWidth: null, + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0 + }) + }, + _init: function () { + BI.DownListItem.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.text = BI.createWidget({ + type: "bi.icon_text_item", + element: this, + height: o.height, + text: o.text, + value: o.value, + logic: o.logic, + selected: o.selected, + disabled: o.disabled, + iconHeight: o.iconHeight, + iconWidth: o.iconWidth, + textHgap: o.textHgap, + textVgap: o.textVgap, + textLgap: o.textLgap, + textRgap: o.textRgap, + father: o.father + }); + this.text.on(BI.Controller.EVENT_CHANGE, function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); + this.text.on(BI.IconTextItem.EVENT_CHANGE, function () { + self.fireEvent(BI.DownListItem.EVENT_CHANGE); + }); + // this.setSelected(o.selected); + }, + + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); + }, + + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); + }, + + isSelected: function () { + return this.text.isSelected(); + }, + + setSelected: function (b) { + this.text.setSelected(b); + // if (b === true) { + // this.element.addClass("dot-e-font"); + // } else { + // this.element.removeClass("dot-e-font"); + // } + }, + + setValue: function (v) { + this.text.setValue(v); + }, + + getValue: function () { + return this.text.getValue(); + } +}); +BI.DownListItem.EVENT_CHANGE = "EVENT_CHANGE"; +BI.shortcut("bi.down_list_item", BI.DownListItem);BI.DownListGroupItem = BI.inherit(BI.BasicButton, { + _defaultConfig: function () { + var conf = BI.DownListGroupItem.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-down-list-group-item", + logic: { + dynamic: false + }, + // invalid: true, + iconCls1: "dot-e-font", + iconCls2: "pull-right-e-font" + }) + }, + _init: function () { + BI.DownListGroupItem.superclass._init.apply(this, arguments); + var o = this.options; + var self = this; + this.text = BI.createWidget({ + type: "bi.label", + cls: "list-group-item-text", + textAlign: "left", + text: o.text, + value: o.value, + height: o.height + }); + + this.icon1 = BI.createWidget({ + type: "bi.icon_button", + cls: o.iconCls1, + width: 25, + forceNotSelected: true }); - this.popupview.on(BI.DownListPopup.EVENT_CHANGE, function (value) { - self.fireEvent(BI.DownListCombo.EVENT_CHANGE, value); - self.downlistcombo.hideView(); + this.icon2 = BI.createWidget({ + type: "bi.icon_button", + cls: o.iconCls2, + width: 25, + forceNotSelected: true }); - this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE, function (value, fatherValue) { - self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, value, fatherValue); - self.downlistcombo.hideView(); + var blank = BI.createWidget({ + type: "bi.layout", + width: 25 + }); + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.icon2, + top: 0, + bottom: 0, + right: 0 + }] }); + BI.createWidget(BI.extend({ + element: this + }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { + items: BI.LogicFactory.createLogicItemsByDirection("left", this.icon1, this.text, blank) + })))); - this.downlistcombo = BI.createWidget({ - element: this, - type: 'bi.combo', - trigger: o.trigger, - isNeedAdjustWidth: false, - adjustLength: o.adjustLength, - direction: o.direction, - el: BI.createWidget(o.el, { - type: "bi.icon_trigger", - extraCls: o.iconCls ? o.iconCls : "pull-down-font", - width: o.width, - height: o.height - }), - popup: { - el: this.popupview, - stopPropagation: true, - maxHeight: 1000 + this.element.hover(function () { + if (self.isEnabled()) { + self.hover(); + } + }, function () { + if (self.isEnabled()) { + self.dishover() } }); + }, + + hover: function () { + BI.DownListGroupItem.superclass.hover.apply(this, arguments); + this.icon1.element.addClass("hover"); + this.icon2.element.addClass("hover"); - this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { - self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW); - }); }, - hideView: function () { - this.downlistcombo.hideView(); + dishover: function () { + BI.DownListGroupItem.superclass.dishover.apply(this, arguments); + this.icon1.element.removeClass("hover"); + this.icon2.element.removeClass("hover"); }, - showView: function () { - this.downlistcombo.showView(); + doClick: function () { + BI.DownListGroupItem.superclass.doClick.apply(this, arguments); + if (this.isValid()) { + this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE, this.getValue()); + } }, - populate: function (items) { - this.popupview.populate(items); + doRedMark: function () { + this.text.doRedMark.apply(this.text, arguments); }, - setValue: function (v) { - this.popupview.setValue(v); + unRedMark: function () { + this.text.unRedMark.apply(this.text, arguments); }, - getValue: function () { - return this.popupview.getValue() + + setValue: function (v) { + var self = this, o = this.options; + v = BI.isArray(v) ? v : [v]; + BI.find(v, function (idx, value) { + if (BI.contains(o.childValues, value)) { + self.icon1.setSelected(true); + return true; + } else { + self.icon1.setSelected(false); + } + }) } }); -BI.DownListCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.DownListCombo.EVENT_SON_VALUE_CHANGE = "EVENT_SON_VALUE_CHANGE"; -BI.DownListCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; - -BI.shortcut("bi.down_list_combo", BI.DownListCombo);/** - * Created by roy on 15/9/6. +BI.DownListGroupItem.EVENT_CHANGE = "EVENT_CHANGE"; +BI.shortcut("bi.down_list_group_item", BI.DownListGroupItem);/** + * Created by roy on 15/9/8. + * 处理popup中的item分组样式 + * 一个item分组中的成员大于一时,该分组设置为单选,并且默认状态第一个成员设置为已选择项 */ -BI.DownListGroup = BI.inherit(BI.Widget, { +BI.DownListPopup = BI.inherit(BI.Pane, { constants: { - iconCls: "check-mark-ha-font" + nextIcon: "pull-right-e-font", + height: 25, + iconHeight: 12, + iconWidth: 12, + hgap: 0, + vgap: 0, + border: 1 }, _defaultConfig: function () { - return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-down-list-group", - items: [ - { - el: {} - } - ] + var conf = BI.DownListPopup.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: "bi-down-list-popup", + items: [], + chooseType: BI.Selection.Multi }) }, _init: function () { - BI.DownListGroup.superclass._init.apply(this, arguments); - var o = this.options, self = this; - - this.downlistgroup = BI.createWidget({ - element: this, + BI.DownListPopup.superclass._init.apply(this, arguments); + this.singleValues = []; + this.childValueMap = {}; + this.fatherValueMap = {}; + var self = this, o = this.options, children = this._createChildren(o.items); + this.popup = BI.createWidget({ type: "bi.button_tree", - items: o.items, - chooseType: 0,//0单选,1多选 + items: BI.createItems(children, + {}, { + adjustLength: -2 + } + ), layouts: [{ type: "bi.vertical", - hgap: 0, - vgap: 0 - }] + hgap: this.constants.hgap, + vgap: this.constants.vgap + }], + chooseType: o.chooseType }); - this.downlistgroup.on(BI.Controller.EVENT_CHANGE, function (type) { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - if(type === BI.Events.CLICK) { - self.fireEvent(BI.DownListGroup.EVENT_CHANGE, arguments); + + this.popup.on(BI.ButtonTree.EVENT_CHANGE, function (value, object) { + var changedValue = value; + if (BI.isNotNull(self.childValueMap[value])) { + changedValue = self.childValueMap[value]; + self.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE, changedValue, self.fatherValueMap[value]) + } else { + self.fireEvent(BI.DownListPopup.EVENT_CHANGE, changedValue, object); + } + + + if (!self.singleValues.contains(changedValue)) { + var item = self.getValue(); + var result = []; + BI.each(item, function (i, valueObject) { + if (valueObject.value != changedValue) { + result.push(valueObject); + } + }); + self.setValue(result); + } + + }); + + BI.createWidget({ + type: "bi.vertical", + element: this, + items: [this.popup] + }); + + }, + _createChildren: function (items) { + var self = this, result = []; + BI.each(items, function (i, it) { + var item_done = { + type: "bi.down_list_group", + items: [] + }; + + BI.each(it, function (i, item) { + if (BI.isNotEmptyArray(item.children) && !BI.isEmpty(item.el)) { + item.type = "bi.combo_group"; + item.cls = "down-list-group"; + item.trigger = "hover"; + item.isNeedAdjustWidth = false; + item.el.title = item.el.title || item.el.text; + item.el.type = "bi.down_list_group_item"; + item.el.logic = { + dynamic: true + }; + item.el.height = self.constants.height; + item.el.iconCls2 = self.constants.nextIcon; + item.popup = { + lgap: 4, + el: { + type: "bi.button_tree", + chooseType: 0, + layouts: [{ + type: "bi.vertical" + }] + + } + }; + item.el.childValues = []; + BI.each(item.children, function (i, child) { + var fatherValue = BI.deepClone(item.el.value); + var childValue = BI.deepClone(child.value); + self.singleValues.push(child.value); + child.type = "bi.down_list_item"; + child.extraCls = " child-down-list-item"; + child.title = child.title || child.text; + child.textRgap = 10; + child.isNeedAdjustWidth = false; + child.logic = { + dynamic: true + }; + child.father = fatherValue; + self.fatherValueMap[self._createChildValue(fatherValue, childValue)] = fatherValue; + self.childValueMap[self._createChildValue(fatherValue, childValue)] = childValue; + child.value = self._createChildValue(fatherValue, childValue); + item.el.childValues.push(child.value); + }) + } else { + item.type = "bi.down_list_item"; + item.title = item.title || item.text; + item.textRgap = 10; + item.isNeedAdjustWidth = false; + item.logic = { + dynamic: true + } + } + var el_done = {}; + el_done.el = item; + item_done.items.push(el_done); + }); + if (self._isGroup(item_done.items)) { + BI.each(item_done.items, function (i, item) { + self.singleValues.push(item.el.value); + }) } - }) - }, - getValue:function(){ - return this.downlistgroup.getValue(); - }, - setValue:function(v){ - this.downlistgroup.setValue(v); - } + result.push(item_done); + if (self._needSpliter(i, items.length)) { + var spliter_container = BI.createWidget({ + type: "bi.vertical", + items: [{ + el: { + type: "bi.layout", + cls: "bi-down-list-spliter bi-border-top cursor-pointer", + height: 0 + } -}) -BI.DownListGroup.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.down_list_group", BI.DownListGroup);BI.DownListItem = BI.inherit(BI.Single, { - _defaultConfig: function () { - var conf = BI.DownListItem.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: "bi-down-list-item bi-list-item-active", - cls: "", - height: 25, - logic: { - dynamic: true - }, - selected: false, - iconHeight: null, - iconWidth: null, - textHgap: 0, - textVgap: 0, - textLgap: 0, - textRgap: 0 - }) - }, - _init: function () { - BI.DownListItem.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.text = BI.createWidget({ - type: "bi.icon_text_item", - element: this, - height: o.height, - text: o.text, - value: o.value, - logic: o.logic, - selected: o.selected, - disabled: o.disabled, - iconHeight: o.iconHeight, - iconWidth: o.iconWidth, - textHgap: o.textHgap, - textVgap: o.textVgap, - textLgap: o.textLgap, - textRgap: o.textRgap, - father: o.father - }); - this.text.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - this.text.on(BI.IconTextItem.EVENT_CHANGE, function () { - self.fireEvent(BI.DownListItem.EVENT_CHANGE); + }], + cls: "bi-down-list-spliter-container cursor-pointer", + lgap: 10, + rgap: 10 + }); + result.push(spliter_container); + } }); - // this.setSelected(o.selected); + return result; }, - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); + _isGroup: function (i) { + return i.length > 1; }, - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); + _needSpliter: function (i, itemLength) { + return i < itemLength - 1; }, - isSelected: function () { - return this.text.isSelected(); + _createChildValue: function (fatherValue, childValue) { + return fatherValue + "_" + childValue }, - setSelected: function (b) { - this.text.setSelected(b); - // if (b === true) { - // this.element.addClass("dot-e-font"); - // } else { - // this.element.removeClass("dot-e-font"); - // } + populate: function (items) { + BI.DownListPopup.superclass.populate.apply(this, arguments); + var self = this; + self.childValueMap = {}; + self.fatherValueMap = {}; + self.singleValues = []; + var children = self._createChildren(items); + var popupItem = BI.createItems(children, + {}, { + adjustLength: -2 + } + ); + self.popup.populate(popupItem); }, - setValue: function (v) { - this.text.setValue(v); + setValue: function (valueItem) { + var self = this; + var valueArray = []; + BI.each(valueItem, function (i, item) { + var value; + if (BI.isNotNull(item.childValue)) { + value = self._createChildValue(item.value, item.childValue); + } else { + value = item.value; + } + valueArray.push(value); + } + ); + this.popup.setValue(valueArray); }, getValue: function () { - return this.text.getValue(); + var self = this, result = []; + var values = this.popup.getValue(); + BI.each(values, function (i, value) { + var valueItem = {}; + if (BI.isNotNull(self.childValueMap[value])) { + var fartherValue = self.fatherValueMap[value]; + valueItem.childValue = self.childValueMap[value]; + valueItem.value = fartherValue; + } else { + valueItem.value = value; + } + result.push(valueItem); + }); + return result; } + + }); -BI.DownListItem.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.down_list_item", BI.DownListItem);BI.DownListGroupItem = BI.inherit(BI.BasicButton, { + +BI.DownListPopup.EVENT_CHANGE = "EVENT_CHANGE"; +BI.DownListPopup.EVENT_SON_VALUE_CHANGE = "EVENT_SON_VALUE_CHANGE"; +BI.shortcut("bi.down_list_popup", BI.DownListPopup);/** + * Created by roy on 15/9/14. + */ +BI.SearchEditor = BI.inherit(BI.Widget, { _defaultConfig: function () { - var conf = BI.DownListGroupItem.superclass._defaultConfig.apply(this, arguments); + var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-down-list-group-item", - logic: { - dynamic: false - }, - // invalid: true, - iconCls1: "dot-e-font", - iconCls2: "pull-right-e-font" - }) + baseCls: "bi-search-editor bi-border", + height: 30, + errorText: "", + watermark: BI.i18nText("BI-Basic_Search"), + validationChecker: BI.emptyFn, + quitChecker: BI.emptyFn + }); }, _init: function () { - BI.DownListGroupItem.superclass._init.apply(this, arguments); - var o = this.options; - var self = this; - this.text = BI.createWidget({ - type: "bi.label", - cls: "list-group-item-text", - textAlign: "left", - text: o.text, - value: o.value, - height: o.height + this.options.height -= 2; + BI.SearchEditor.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.editor = BI.createWidget({ + type: "bi.editor", + height: o.height, + watermark: o.watermark, + allowBlank: true, + errorText: o.errorText, + validationChecker: o.validationChecker, + quitChecker: o.quitChecker }); - - this.icon1 = BI.createWidget({ + this.clear = BI.createWidget({ type: "bi.icon_button", - cls: o.iconCls1, - width: 25, - forceNotSelected: true + stopEvent: true, + cls: "search-close-h-font" + }); + this.clear.on(BI.IconButton.EVENT_CHANGE, function () { + self.setValue(""); + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT); + self.fireEvent(BI.SearchEditor.EVENT_CLEAR); + }); + BI.createWidget({ + element: this, + type: "bi.htape", + items: [ + { + el: { + type: "bi.center_adapt", + cls: "search-font", + items: [{ + el: { + type: "bi.icon" + } + }] + }, + width: 25 + }, + { + el: self.editor + }, + { + el: this.clear, + width: 25 + } + ] + }); + this.editor.on(BI.Controller.EVENT_CHANGE, function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); + + this.editor.on(BI.Editor.EVENT_FOCUS, function () { + self.fireEvent(BI.SearchEditor.EVENT_FOCUS); + }); + this.editor.on(BI.Editor.EVENT_BLUR, function () { + self.fireEvent(BI.SearchEditor.EVENT_BLUR); + }); + this.editor.on(BI.Editor.EVENT_CLICK, function () { + self.fireEvent(BI.SearchEditor.EVENT_CLICK); + }); + this.editor.on(BI.Editor.EVENT_CHANGE, function () { + self._checkClear(); + self.fireEvent(BI.SearchEditor.EVENT_CHANGE); }); - - this.icon2 = BI.createWidget({ - type: "bi.icon_button", - cls: o.iconCls2, - width: 25, - forceNotSelected: true + this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { + self.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN, v); }); - - var blank = BI.createWidget({ - type: "bi.layout", - width: 25 + this.editor.on(BI.Editor.EVENT_SPACE, function () { + self.fireEvent(BI.SearchEditor.EVENT_SPACE) }); - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.icon2, - top: 0, - bottom: 0, - right: 0 - }] + this.editor.on(BI.Editor.EVENT_BACKSPACE, function () { + self.fireEvent(BI.SearchEditor.EVENT_BACKSPACE) }); - BI.createWidget(BI.extend({ - element: this - }, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, { - items: BI.LogicFactory.createLogicItemsByDirection("left", this.icon1, this.text, blank) - })))); - this.element.hover(function () { - if (self.isEnabled()) { - self.hover(); - } - }, function () { - if (self.isEnabled()) { - self.dishover() - } + this.editor.on(BI.Editor.EVENT_VALID, function () { + self.fireEvent(BI.SearchEditor.EVENT_VALID) + }); + this.editor.on(BI.Editor.EVENT_ERROR, function () { + self.fireEvent(BI.SearchEditor.EVENT_ERROR) + }); + this.editor.on(BI.Editor.EVENT_ENTER, function () { + self.fireEvent(BI.SearchEditor.EVENT_ENTER); + }); + this.editor.on(BI.Editor.EVENT_RESTRICT, function () { + self.fireEvent(BI.SearchEditor.EVENT_RESTRICT) + }); + this.editor.on(BI.Editor.EVENT_EMPTY, function () { + self._checkClear(); + self.fireEvent(BI.SearchEditor.EVENT_EMPTY) + }); + this.editor.on(BI.Editor.EVENT_REMOVE, function () { + self.fireEvent(BI.SearchEditor.EVENT_REMOVE) + }); + this.editor.on(BI.Editor.EVENT_CONFIRM, function () { + self.fireEvent(BI.SearchEditor.EVENT_CONFIRM) + }); + this.editor.on(BI.Editor.EVENT_START, function () { + self.fireEvent(BI.SearchEditor.EVENT_START); }); + this.editor.on(BI.Editor.EVENT_PAUSE, function () { + self.fireEvent(BI.SearchEditor.EVENT_PAUSE); + }); + this.editor.on(BI.Editor.EVENT_STOP, function () { + self.fireEvent(BI.SearchEditor.EVENT_STOP); + }); + + this.clear.invisible(); }, - hover: function () { - BI.DownListGroupItem.superclass.hover.apply(this, arguments); - this.icon1.element.addClass("hover"); - this.icon2.element.addClass("hover"); + _checkClear: function () { + if (!this.getValue()) { + this.clear.invisible(); + } else { + this.clear.visible(); + } + }, + focus: function () { + this.editor.focus(); }, - dishover: function () { - BI.DownListGroupItem.superclass.dishover.apply(this, arguments); - this.icon1.element.removeClass("hover"); - this.icon2.element.removeClass("hover"); + blur: function () { + this.editor.blur(); }, - doClick: function () { - BI.DownListGroupItem.superclass.doClick.apply(this, arguments); + getValue: function () { if (this.isValid()) { - this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE, this.getValue()); + var res = this.editor.getValue().match(/[\S]+/g); + return BI.isNull(res) ? "" : res[res.length - 1]; } }, - doRedMark: function () { - this.text.doRedMark.apply(this.text, arguments); + getLastValidValue: function () { + return this.editor.getLastValidValue(); }, - unRedMark: function () { - this.text.unRedMark.apply(this.text, arguments); + setValue: function (v) { + this.editor.setValue(v); + if (BI.isKey(v)) { + this.clear.visible(); + } + }, + + isEditing: function () { + return this.editor.isEditing(); }, - setValue: function (v) { - var self = this, o = this.options; - v = BI.isArray(v) ? v : [v]; - BI.find(v, function (idx, value) { - if (BI.contains(o.childValues, value)) { - self.icon1.setSelected(true); - return true; - } else { - self.icon1.setSelected(false); - } - }) + isValid: function () { + return this.editor.isValid(); } }); -BI.DownListGroupItem.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.down_list_group_item", BI.DownListGroupItem);/** - * Created by roy on 15/9/8. - * 处理popup中的item分组样式 - * 一个item分组中的成员大于一时,该分组设置为单选,并且默认状态第一个成员设置为已选择项 +BI.SearchEditor.EVENT_CHANGE = "EVENT_CHANGE"; +BI.SearchEditor.EVENT_FOCUS = "EVENT_FOCUS"; +BI.SearchEditor.EVENT_BLUR = "EVENT_BLUR"; +BI.SearchEditor.EVENT_CLICK = "EVENT_CLICK"; +BI.SearchEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; +BI.SearchEditor.EVENT_SPACE = "EVENT_SPACE"; +BI.SearchEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; +BI.SearchEditor.EVENT_CLEAR = "EVENT_CLEAR"; + +BI.SearchEditor.EVENT_START = "EVENT_START"; +BI.SearchEditor.EVENT_PAUSE = "EVENT_PAUSE"; +BI.SearchEditor.EVENT_STOP = "EVENT_STOP"; +BI.SearchEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.SearchEditor.EVENT_VALID = "EVENT_VALID"; +BI.SearchEditor.EVENT_ERROR = "EVENT_ERROR"; +BI.SearchEditor.EVENT_ENTER = "EVENT_ENTER"; +BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; +BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE"; +BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY"; +BI.shortcut("bi.search_editor", BI.SearchEditor);/** + * 小号搜索框 + * Created by GUY on 2015/9/29. + * @class BI.SmallSearchEditor + * @extends BI.SearchEditor */ -BI.DownListPopup = BI.inherit(BI.Pane, { - constants: { - nextIcon: "pull-right-e-font", - height: 25, - iconHeight: 12, - iconWidth: 12, - hgap: 0, - vgap: 0, - border: 1 +BI.SmallSearchEditor = BI.inherit(BI.SearchEditor, { + _defaultConfig: function () { + var conf = BI.SmallSearchEditor.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-small-search-editor", + height: 24 + }); }, + + _init: function () { + BI.SmallSearchEditor.superclass._init.apply(this, arguments); + } +}); +BI.shortcut("bi.small_search_editor", BI.SmallSearchEditor);/** + * guy + * @class BI.TextEditor + * @extends BI.Single + */ +BI.TextEditor = BI.inherit(BI.Widget, { _defaultConfig: function () { - var conf = BI.DownListPopup.superclass._defaultConfig.apply(this, arguments); + var conf = BI.TextEditor.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { - baseCls: "bi-down-list-popup", - items: [], - chooseType: BI.Selection.Multi + extraCls: "bi-text-editor bi-border", + hgap: 4, + vgap: 2, + lgap: 0, + rgap: 0, + tgap: 0, + bgap: 0, + validationChecker: BI.emptyFn, + quitChecker: BI.emptyFn, + allowBlank: false, + watermark: "", + errorText: "", + height: 30 }) }, + _init: function () { - BI.DownListPopup.superclass._init.apply(this, arguments); - this.singleValues = []; - this.childValueMap = {}; - this.fatherValueMap = {}; - var self = this, o = this.options, children = this._createChildren(o.items); - this.popup = BI.createWidget({ - type: "bi.button_tree", - items: BI.createItems(children, - {}, { - adjustLength: -2 - } - ), - layouts: [{ - type: "bi.vertical", - hgap: this.constants.hgap, - vgap: this.constants.vgap - }], - chooseType: o.chooseType + BI.TextEditor.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNumber(o.height)) { + this.element.css({height: o.height - 2}); + } + if (BI.isNumber(o.width)) { + this.element.css({width: o.width - 2}); + } + this.editor = BI.createWidget({ + type: "bi.editor", + height: o.height - 2, + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, + value: o.value, + validationChecker: o.validationChecker, + quitChecker: o.quitChecker, + allowBlank: o.allowBlank, + watermark: o.watermark, + errorText: o.errorText + }); + this.editor.on(BI.Controller.EVENT_CHANGE, function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); + + this.editor.on(BI.Editor.EVENT_FOCUS, function () { + self.fireEvent(BI.TextEditor.EVENT_FOCUS); + }); + this.editor.on(BI.Editor.EVENT_BLUR, function () { + self.fireEvent(BI.TextEditor.EVENT_BLUR); + }); + this.editor.on(BI.Editor.EVENT_CLICK, function () { + self.fireEvent(BI.TextEditor.EVENT_CLICK); + }); + this.editor.on(BI.Editor.EVENT_CHANGE, function () { + self.fireEvent(BI.TextEditor.EVENT_CHANGE); + }); + this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { + self.fireEvent(BI.TextEditor.EVENT_KEY_DOWN); + }); + this.editor.on(BI.Editor.EVENT_SPACE, function (v) { + self.fireEvent(BI.TextEditor.EVENT_SPACE); + }); + this.editor.on(BI.Editor.EVENT_BACKSPACE, function (v) { + self.fireEvent(BI.TextEditor.EVENT_BACKSPACE); }); - this.popup.on(BI.ButtonTree.EVENT_CHANGE, function (value, object) { - var changedValue = value; - if (BI.isNotNull(self.childValueMap[value])) { - changedValue = self.childValueMap[value]; - self.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE, changedValue, self.fatherValueMap[value]) - } else { - self.fireEvent(BI.DownListPopup.EVENT_CHANGE, changedValue, object); - } - - - if (!self.singleValues.contains(changedValue)) { - var item = self.getValue(); - var result = []; - BI.each(item, function (i, valueObject) { - if (valueObject.value != changedValue) { - result.push(valueObject); - } - }); - self.setValue(result); - } + this.editor.on(BI.Editor.EVENT_VALID, function () { + self.fireEvent(BI.TextEditor.EVENT_VALID); + }); + this.editor.on(BI.Editor.EVENT_CONFIRM, function () { + self.fireEvent(BI.TextEditor.EVENT_CONFIRM); + }); + this.editor.on(BI.Editor.EVENT_REMOVE, function (v) { + self.fireEvent(BI.TextEditor.EVENT_REMOVE); + }); + this.editor.on(BI.Editor.EVENT_START, function () { + self.fireEvent(BI.TextEditor.EVENT_START); + }); + this.editor.on(BI.Editor.EVENT_PAUSE, function () { + self.fireEvent(BI.TextEditor.EVENT_PAUSE); + }); + this.editor.on(BI.Editor.EVENT_STOP, function () { + self.fireEvent(BI.TextEditor.EVENT_STOP); + }); + this.editor.on(BI.Editor.EVENT_ERROR, function () { + self.fireEvent(BI.TextEditor.EVENT_ERROR, arguments); + }); + this.editor.on(BI.Editor.EVENT_ENTER, function () { + self.fireEvent(BI.TextEditor.EVENT_ENTER); + }); + this.editor.on(BI.Editor.EVENT_RESTRICT, function () { + self.fireEvent(BI.TextEditor.EVENT_RESTRICT); + }); + this.editor.on(BI.Editor.EVENT_EMPTY, function () { + self.fireEvent(BI.TextEditor.EVENT_EMPTY); }); - BI.createWidget({ type: "bi.vertical", + scrolly: false, element: this, - items: [this.popup] + items: [this.editor] }); - }, - _createChildren: function (items) { - var self = this, result = []; - BI.each(items, function (i, it) { - var item_done = { - type: "bi.down_list_group", - items: [] - }; - - BI.each(it, function (i, item) { - if (BI.isNotEmptyArray(item.children) && !BI.isEmpty(item.el)) { - item.type = "bi.combo_group"; - item.cls = "down-list-group"; - item.trigger = "hover"; - item.isNeedAdjustWidth = false; - item.el.title = item.el.title || item.el.text; - item.el.type = "bi.down_list_group_item"; - item.el.logic = { - dynamic: true - }; - item.el.height = self.constants.height; - item.el.iconCls2 = self.constants.nextIcon; - item.popup = { - lgap: 4, - el: { - type: "bi.button_tree", - chooseType: 0, - layouts: [{ - type: "bi.vertical" - }] - - } - }; - item.el.childValues = []; - BI.each(item.children, function (i, child) { - var fatherValue = BI.deepClone(item.el.value); - var childValue = BI.deepClone(child.value); - self.singleValues.push(child.value); - child.type = "bi.down_list_item"; - child.extraCls = " child-down-list-item"; - child.title = child.title || child.text; - child.textRgap = 10; - child.isNeedAdjustWidth = false; - child.logic = { - dynamic: true - }; - child.father = fatherValue; - self.fatherValueMap[self._createChildValue(fatherValue, childValue)] = fatherValue; - self.childValueMap[self._createChildValue(fatherValue, childValue)] = childValue; - child.value = self._createChildValue(fatherValue, childValue); - item.el.childValues.push(child.value); - }) - } else { - item.type = "bi.down_list_item"; - item.title = item.title || item.text; - item.textRgap = 10; - item.isNeedAdjustWidth = false; - item.logic = { - dynamic: true - } - } - var el_done = {}; - el_done.el = item; - item_done.items.push(el_done); - }); - if (self._isGroup(item_done.items)) { - BI.each(item_done.items, function (i, item) { - self.singleValues.push(item.el.value); - }) - } - - result.push(item_done); - if (self._needSpliter(i, items.length)) { - var spliter_container = BI.createWidget({ - type: "bi.vertical", - items: [{ - el: { - type: "bi.layout", - cls: "bi-down-list-spliter bi-border-top cursor-pointer", - height: 0 - } - }], - cls: "bi-down-list-spliter-container cursor-pointer", - lgap: 10, - rgap: 10 - }); - result.push(spliter_container); - } - }); - return result; + focus: function () { + this.editor.focus(); }, - _isGroup: function (i) { - return i.length > 1; + blur: function () { + this.editor.blur(); }, - _needSpliter: function (i, itemLength) { - return i < itemLength - 1; + setErrorText: function (text) { + this.editor.setErrorText(text); }, - _createChildValue: function (fatherValue, childValue) { - return fatherValue + "_" + childValue + getErrorText: function () { + return this.editor.getErrorText(); }, - populate: function (items) { - BI.DownListPopup.superclass.populate.apply(this, arguments); - var self = this; - self.childValueMap = {}; - self.fatherValueMap = {}; - self.singleValues = []; - var children = self._createChildren(items); - var popupItem = BI.createItems(children, - {}, { - adjustLength: -2 - } - ); - self.popup.populate(popupItem); + isValid: function () { + return this.editor.isValid(); }, - setValue: function (valueItem) { - var self = this; - var valueArray = []; - BI.each(valueItem, function (i, item) { - var value; - if (BI.isNotNull(item.childValue)) { - value = self._createChildValue(item.value, item.childValue); - } else { - value = item.value; - } - valueArray.push(value); - } - ); - this.popup.setValue(valueArray); + setValue: function (v) { + this.editor.setValue(v); }, getValue: function () { - var self = this, result = []; - var values = this.popup.getValue(); - BI.each(values, function (i, value) { - var valueItem = {}; - if (BI.isNotNull(self.childValueMap[value])) { - var fartherValue = self.fatherValueMap[value]; - valueItem.childValue = self.childValueMap[value]; - valueItem.value = fartherValue; - } else { - valueItem.value = value; - } - result.push(valueItem); - }); - return result; + return this.editor.getValue(); } +}); +BI.TextEditor.EVENT_CHANGE = "EVENT_CHANGE"; +BI.TextEditor.EVENT_FOCUS = "EVENT_FOCUS"; +BI.TextEditor.EVENT_BLUR = "EVENT_BLUR"; +BI.TextEditor.EVENT_CLICK = "EVENT_CLICK"; +BI.TextEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; +BI.TextEditor.EVENT_SPACE = "EVENT_SPACE"; +BI.TextEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; + +BI.TextEditor.EVENT_START = "EVENT_START"; +BI.TextEditor.EVENT_PAUSE = "EVENT_PAUSE"; +BI.TextEditor.EVENT_STOP = "EVENT_STOP"; +BI.TextEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.TextEditor.EVENT_VALID = "EVENT_VALID"; +BI.TextEditor.EVENT_ERROR = "EVENT_ERROR"; +BI.TextEditor.EVENT_ENTER = "EVENT_ENTER"; +BI.TextEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; +BI.TextEditor.EVENT_REMOVE = "EVENT_REMOVE"; +BI.TextEditor.EVENT_EMPTY = "EVENT_EMPTY"; +BI.shortcut("bi.text_editor", BI.TextEditor);/** + * 小号搜索框 + * Created by GUY on 2015/9/29. + * @class BI.SmallTextEditor + * @extends BI.SearchEditor + */ +BI.SmallTextEditor = BI.inherit(BI.TextEditor, { + _defaultConfig: function () { + var conf = BI.SmallTextEditor.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-small-text-editor", + height: 25 + }); + }, + _init: function () { + BI.SmallTextEditor.superclass._init.apply(this, arguments); + } }); - -BI.DownListPopup.EVENT_CHANGE = "EVENT_CHANGE"; -BI.DownListPopup.EVENT_SON_VALUE_CHANGE = "EVENT_SON_VALUE_CHANGE"; -BI.shortcut("bi.down_list_popup", BI.DownListPopup);/** +BI.shortcut("bi.small_text_editor", BI.SmallTextEditor);/** * * Created by GUY on 2016/3/28. * @class BI.ExcelTableCell @@ -85251,8 +85251,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, { }); var triggerBtn = BI.createWidget({ - type: "bi.trigger_icon_button", - cls: "bi-trigger-date-button chart-date-normal-font", + type: "bi.icon_button", + cls: "bi-trigger-icon-button date-font", width: 30, height: 23 }); @@ -85265,7 +85265,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, { }); this.changeIcon = BI.createWidget({ type: "bi.icon_button", - cls: "bi-trigger-date-change widget-date-h-change-font", + cls: "bi-trigger-icon-button date-change-h-font", width: 30, height: 23 }); diff --git a/dist/case.js b/dist/case.js index 2f0c18eb2..996b843c8 100644 --- a/dist/case.js +++ b/dist/case.js @@ -6437,212 +6437,6 @@ BI.ClearEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; BI.ClearEditor.EVENT_REMOVE = "EVENT_REMOVE"; BI.ClearEditor.EVENT_EMPTY = "EVENT_EMPTY"; BI.shortcut("bi.clear_editor", BI.ClearEditor);/** - * Created by roy on 15/9/14. - */ -BI.SearchEditor = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: "bi-search-editor bi-border", - height: 30, - errorText: "", - watermark: BI.i18nText("BI-Basic_Search"), - validationChecker: BI.emptyFn, - quitChecker: BI.emptyFn - }); - }, - _init: function () { - this.options.height -= 2; - BI.SearchEditor.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.editor = BI.createWidget({ - type: "bi.editor", - height: o.height, - watermark: o.watermark, - allowBlank: true, - errorText: o.errorText, - validationChecker: o.validationChecker, - quitChecker: o.quitChecker - }); - this.clear = BI.createWidget({ - type: "bi.icon_button", - stopEvent: true, - cls: "search-close-h-font" - }); - this.clear.on(BI.IconButton.EVENT_CHANGE, function () { - self.setValue(""); - self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT); - self.fireEvent(BI.SearchEditor.EVENT_CLEAR); - }); - BI.createWidget({ - element: this, - type: "bi.htape", - items: [ - { - el: { - type: "bi.center_adapt", - cls: "search-font", - items: [{ - el: { - type: "bi.icon" - } - }] - }, - width: 25 - }, - { - el: self.editor - }, - { - el: this.clear, - width: 25 - } - ] - }); - this.editor.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - - this.editor.on(BI.Editor.EVENT_FOCUS, function () { - self.fireEvent(BI.SearchEditor.EVENT_FOCUS); - }); - this.editor.on(BI.Editor.EVENT_BLUR, function () { - self.fireEvent(BI.SearchEditor.EVENT_BLUR); - }); - this.editor.on(BI.Editor.EVENT_CLICK, function () { - self.fireEvent(BI.SearchEditor.EVENT_CLICK); - }); - this.editor.on(BI.Editor.EVENT_CHANGE, function () { - self._checkClear(); - self.fireEvent(BI.SearchEditor.EVENT_CHANGE); - }); - this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { - self.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN, v); - }); - this.editor.on(BI.Editor.EVENT_SPACE, function () { - self.fireEvent(BI.SearchEditor.EVENT_SPACE) - }); - this.editor.on(BI.Editor.EVENT_BACKSPACE, function () { - self.fireEvent(BI.SearchEditor.EVENT_BACKSPACE) - }); - - - this.editor.on(BI.Editor.EVENT_VALID, function () { - self.fireEvent(BI.SearchEditor.EVENT_VALID) - }); - this.editor.on(BI.Editor.EVENT_ERROR, function () { - self.fireEvent(BI.SearchEditor.EVENT_ERROR) - }); - this.editor.on(BI.Editor.EVENT_ENTER, function () { - self.fireEvent(BI.SearchEditor.EVENT_ENTER); - }); - this.editor.on(BI.Editor.EVENT_RESTRICT, function () { - self.fireEvent(BI.SearchEditor.EVENT_RESTRICT) - }); - this.editor.on(BI.Editor.EVENT_EMPTY, function () { - self._checkClear(); - self.fireEvent(BI.SearchEditor.EVENT_EMPTY) - }); - this.editor.on(BI.Editor.EVENT_REMOVE, function () { - self.fireEvent(BI.SearchEditor.EVENT_REMOVE) - }); - this.editor.on(BI.Editor.EVENT_CONFIRM, function () { - self.fireEvent(BI.SearchEditor.EVENT_CONFIRM) - }); - this.editor.on(BI.Editor.EVENT_START, function () { - self.fireEvent(BI.SearchEditor.EVENT_START); - }); - this.editor.on(BI.Editor.EVENT_PAUSE, function () { - self.fireEvent(BI.SearchEditor.EVENT_PAUSE); - }); - this.editor.on(BI.Editor.EVENT_STOP, function () { - self.fireEvent(BI.SearchEditor.EVENT_STOP); - }); - - this.clear.invisible(); - }, - - _checkClear: function () { - if (!this.getValue()) { - this.clear.invisible(); - } else { - this.clear.visible(); - } - }, - - focus: function () { - this.editor.focus(); - }, - - blur: function () { - this.editor.blur(); - }, - - getValue: function () { - if (this.isValid()) { - var res = this.editor.getValue().match(/[\S]+/g); - return BI.isNull(res) ? "" : res[res.length - 1]; - } - }, - - getLastValidValue: function () { - return this.editor.getLastValidValue(); - }, - - setValue: function (v) { - this.editor.setValue(v); - if (BI.isKey(v)) { - this.clear.visible(); - } - }, - - isEditing: function () { - return this.editor.isEditing(); - }, - - isValid: function () { - return this.editor.isValid(); - } -}); -BI.SearchEditor.EVENT_CHANGE = "EVENT_CHANGE"; -BI.SearchEditor.EVENT_FOCUS = "EVENT_FOCUS"; -BI.SearchEditor.EVENT_BLUR = "EVENT_BLUR"; -BI.SearchEditor.EVENT_CLICK = "EVENT_CLICK"; -BI.SearchEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; -BI.SearchEditor.EVENT_SPACE = "EVENT_SPACE"; -BI.SearchEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; -BI.SearchEditor.EVENT_CLEAR = "EVENT_CLEAR"; - -BI.SearchEditor.EVENT_START = "EVENT_START"; -BI.SearchEditor.EVENT_PAUSE = "EVENT_PAUSE"; -BI.SearchEditor.EVENT_STOP = "EVENT_STOP"; -BI.SearchEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; -BI.SearchEditor.EVENT_VALID = "EVENT_VALID"; -BI.SearchEditor.EVENT_ERROR = "EVENT_ERROR"; -BI.SearchEditor.EVENT_ENTER = "EVENT_ENTER"; -BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE"; -BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY"; -BI.shortcut("bi.search_editor", BI.SearchEditor);/** - * 小号搜索框 - * Created by GUY on 2015/9/29. - * @class BI.SmallSearchEditor - * @extends BI.SearchEditor - */ -BI.SmallSearchEditor = BI.inherit(BI.SearchEditor, { - _defaultConfig: function () { - var conf = BI.SmallSearchEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-small-search-editor", - height: 24 - }); - }, - - _init: function () { - BI.SmallSearchEditor.superclass._init.apply(this, arguments); - } -}); -BI.shortcut("bi.small_search_editor", BI.SmallSearchEditor);/** * 带标记的文本框 * Created by GUY on 2016/1/25. * @class BI.ShelterEditor @@ -7952,187 +7746,6 @@ BI.SimpleStateEditor.EVENT_SPACE = "EVENT_SPACE"; BI.SimpleStateEditor.EVENT_EMPTY = "EVENT_EMPTY"; BI.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);/** - * guy - * @class BI.TextEditor - * @extends BI.Single - */ -BI.TextEditor = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.TextEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - extraCls: "bi-text-editor bi-border", - hgap: 4, - vgap: 2, - lgap: 0, - rgap: 0, - tgap: 0, - bgap: 0, - validationChecker: BI.emptyFn, - quitChecker: BI.emptyFn, - allowBlank: false, - watermark: "", - errorText: "", - height: 30 - }) - }, - - _init: function () { - BI.TextEditor.superclass._init.apply(this, arguments); - var self = this, o = this.options; - if (BI.isNumber(o.height)) { - this.element.css({height: o.height - 2}); - } - if (BI.isNumber(o.width)) { - this.element.css({width: o.width - 2}); - } - this.editor = BI.createWidget({ - type: "bi.editor", - height: o.height - 2, - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap, - value: o.value, - validationChecker: o.validationChecker, - quitChecker: o.quitChecker, - allowBlank: o.allowBlank, - watermark: o.watermark, - errorText: o.errorText - }); - this.editor.on(BI.Controller.EVENT_CHANGE, function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); - - this.editor.on(BI.Editor.EVENT_FOCUS, function () { - self.fireEvent(BI.TextEditor.EVENT_FOCUS); - }); - this.editor.on(BI.Editor.EVENT_BLUR, function () { - self.fireEvent(BI.TextEditor.EVENT_BLUR); - }); - this.editor.on(BI.Editor.EVENT_CLICK, function () { - self.fireEvent(BI.TextEditor.EVENT_CLICK); - }); - this.editor.on(BI.Editor.EVENT_CHANGE, function () { - self.fireEvent(BI.TextEditor.EVENT_CHANGE); - }); - this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { - self.fireEvent(BI.TextEditor.EVENT_KEY_DOWN); - }); - this.editor.on(BI.Editor.EVENT_SPACE, function (v) { - self.fireEvent(BI.TextEditor.EVENT_SPACE); - }); - this.editor.on(BI.Editor.EVENT_BACKSPACE, function (v) { - self.fireEvent(BI.TextEditor.EVENT_BACKSPACE); - }); - - - this.editor.on(BI.Editor.EVENT_VALID, function () { - self.fireEvent(BI.TextEditor.EVENT_VALID); - }); - this.editor.on(BI.Editor.EVENT_CONFIRM, function () { - self.fireEvent(BI.TextEditor.EVENT_CONFIRM); - }); - this.editor.on(BI.Editor.EVENT_REMOVE, function (v) { - self.fireEvent(BI.TextEditor.EVENT_REMOVE); - }); - this.editor.on(BI.Editor.EVENT_START, function () { - self.fireEvent(BI.TextEditor.EVENT_START); - }); - this.editor.on(BI.Editor.EVENT_PAUSE, function () { - self.fireEvent(BI.TextEditor.EVENT_PAUSE); - }); - this.editor.on(BI.Editor.EVENT_STOP, function () { - self.fireEvent(BI.TextEditor.EVENT_STOP); - }); - this.editor.on(BI.Editor.EVENT_ERROR, function () { - self.fireEvent(BI.TextEditor.EVENT_ERROR, arguments); - }); - this.editor.on(BI.Editor.EVENT_ENTER, function () { - self.fireEvent(BI.TextEditor.EVENT_ENTER); - }); - this.editor.on(BI.Editor.EVENT_RESTRICT, function () { - self.fireEvent(BI.TextEditor.EVENT_RESTRICT); - }); - this.editor.on(BI.Editor.EVENT_EMPTY, function () { - self.fireEvent(BI.TextEditor.EVENT_EMPTY); - }); - BI.createWidget({ - type: "bi.vertical", - scrolly: false, - element: this, - items: [this.editor] - }); - }, - - focus: function () { - this.editor.focus(); - }, - - blur: function () { - this.editor.blur(); - }, - - setErrorText: function (text) { - this.editor.setErrorText(text); - }, - - getErrorText: function () { - return this.editor.getErrorText(); - }, - - isValid: function () { - return this.editor.isValid(); - }, - - setValue: function (v) { - this.editor.setValue(v); - }, - - getValue: function () { - return this.editor.getValue(); - } -}); -BI.TextEditor.EVENT_CHANGE = "EVENT_CHANGE"; -BI.TextEditor.EVENT_FOCUS = "EVENT_FOCUS"; -BI.TextEditor.EVENT_BLUR = "EVENT_BLUR"; -BI.TextEditor.EVENT_CLICK = "EVENT_CLICK"; -BI.TextEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; -BI.TextEditor.EVENT_SPACE = "EVENT_SPACE"; -BI.TextEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; - -BI.TextEditor.EVENT_START = "EVENT_START"; -BI.TextEditor.EVENT_PAUSE = "EVENT_PAUSE"; -BI.TextEditor.EVENT_STOP = "EVENT_STOP"; -BI.TextEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; -BI.TextEditor.EVENT_VALID = "EVENT_VALID"; -BI.TextEditor.EVENT_ERROR = "EVENT_ERROR"; -BI.TextEditor.EVENT_ENTER = "EVENT_ENTER"; -BI.TextEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; -BI.TextEditor.EVENT_REMOVE = "EVENT_REMOVE"; -BI.TextEditor.EVENT_EMPTY = "EVENT_EMPTY"; - -BI.shortcut("bi.text_editor", BI.TextEditor);/** - * 小号搜索框 - * Created by GUY on 2015/9/29. - * @class BI.SmallTextEditor - * @extends BI.SearchEditor - */ -BI.SmallTextEditor = BI.inherit(BI.TextEditor, { - _defaultConfig: function () { - var conf = BI.SmallTextEditor.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - baseCls: (conf.baseCls || "") + " bi-small-text-editor", - height: 25 - }); - }, - - _init: function () { - BI.SmallTextEditor.superclass._init.apply(this, arguments); - } -}); -BI.shortcut("bi.small_text_editor", BI.SmallTextEditor);/** * 有确定取消按钮的弹出层 * @class BI.BarFloatSection * @extends BI.FloatSection @@ -11891,6 +11504,503 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, { }); BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE"; BI.shortcut("bi.multi_select_bar", BI.MultiSelectBar);/** + * 表关联树 + * + * Created by GUY on 2015/12/15. + * @class BI.BranchRelation + * @extends BI.Widget + */ +BI.BranchRelation = BI.inherit(BI.Widget, { + + _defaultConfig: function () { + return BI.extend(BI.BranchRelation.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-branch-relation-tree", + items: [], + + centerOffset: 0,//重心偏移量 + direction: BI.Direction.Bottom, + align: BI.VerticalAlign.Top + }) + }, + + _init: function () { + BI.BranchRelation.superclass._init.apply(this, arguments); + this.populate(this.options.items); + }, + + //树分层 + _stratification: function () { + var levels = []; + this.tree.recursion(function (node, route) { + //node.isRoot = route.length <= 1; + node.leaf = node.isLeaf(); + if (!levels[route.length - 1]) { + levels[route.length - 1] = []; + } + levels[route.length - 1].push(node); + }); + return levels; + }, + + //计算所有节点的叶子结点个数 + _calculateLeaves: function () { + var count = 0; + + function track(node) { + var c = 0; + if (node.isLeaf()) { + return 1; + } + BI.each(node.getChildren(), function (i, child) { + c += track(child); + }); + node.set("leaves", c); + return c; + } + + count = track(this.tree.getRoot()); + return count; + }, + + //树平移 + _translate: function (levels) { + var adjust = []; + var maxLevel = levels.length; + BI.each(levels, function (i, nodes) { + if (!adjust[i]) { + adjust[i] = []; + } + BI.each(nodes, function (j, node) { + if (node.isLeaf() && i < maxLevel - 1) { + var newNode = new BI.Node(BI.UUID()); + //newNode.isEmptyRoot = node.isRoot || node.isEmptyRoot; + newNode.isNew = true; + //把node向下一层移 + var tar = 0; + if (j > 0) { + var c = nodes[j - 1].getLastChild(); + tar = levels[i + 1].indexOf(c) + 1; + } + levels[i + 1].splice(tar, 0, node); + //新增一个临时树节点 + var index = node.parent.getChildIndex(node.id); + node.parent.removeChildByIndex(index); + node.parent.addChild(newNode, index); + newNode.addChild(node); + adjust[i].push(newNode); + nodes[j] = newNode; + } else { + adjust[i].push(node); + } + }) + }); + return adjust; + }, + + //树补白 + _fill: function (levels) { + var adjust = []; + var maxLevel = levels.length; + BI.each(levels, function (i, nodes) { + if (!adjust[i]) { + adjust[i] = []; + } + BI.each(nodes, function (j, node) { + if (node.isLeaf() && i < maxLevel - 1) { + var newNode = new BI.Node(BI.UUID()); + newNode.leaf = true; + newNode.width = node.width; + newNode.height = node.height; + newNode.isNew = true; + //把node向下一层移 + var tar = 0; + if (j > 0) { + var c = nodes[j - 1].getLastChild(); + tar = levels[i + 1].indexOf(c) + 1; + } + levels[i + 1].splice(tar, 0, newNode); + //新增一个临时树节点 + node.addChild(newNode); + } + adjust[i].push(node); + }) + }); + return adjust; + }, + + //树调整 + _adjust: function (adjust) { + while (true) { + var isAllNeedAjust = false; + BI.backEach(adjust, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (!node.isNew) { + var needAdjust = true; + BI.any(node.getChildren(), function (k, n) { + if (!n.isNew) { + needAdjust = false; + return true; + } + }); + if (!node.isLeaf() && needAdjust === true) { + var allChilds = []; + BI.each(node.getChildren(), function (k, n) { + allChilds = allChilds.concat(n.getChildren()); + }); + node.removeAllChilds(); + BI.each(allChilds, function (k, c) { + node.addChild(c); + }); + var newNode = new BI.Node(BI.UUID()); + //newNode.isEmptyRoot = node.isRoot || node.isEmptyRoot; + newNode.isNew = true; + var index = node.parent.getChildIndex(node.id); + node.parent.removeChildByIndex(index); + node.parent.addChild(newNode, index); + newNode.addChild(node); + isAllNeedAjust = true; + } + } + }) + }); + if (isAllNeedAjust === false) { + break; + } else {//树重构 + adjust = this._stratification(); + } + } + return adjust; + }, + + _calculateWidth: function () { + var o = this.options; + var width = 0; + + function track1(node) { + var w = 0; + if (node.isLeaf()) { + return node.width; + } + BI.each(node.getChildren(), function (i, child) { + w += track1(child); + }); + return w; + } + + function track2(node) { + var w = 0; + if (node.isLeaf()) { + return node.height; + } + BI.each(node.getChildren(), function (i, child) { + w += track2(child); + }); + return w; + } + + if (this._isVertical()) { + width = track1(this.tree.getRoot()); + } else { + width = track2(this.tree.getRoot()); + } + + return width; + }, + + _isVertical: function () { + var o = this.options; + return o.direction === BI.Direction.Top || o.direction === BI.Direction.Bottom; + }, + + _calculateHeight: function () { + var o = this.options; + var height = 0; + + function track1(node) { + var h = 0; + BI.each(node.getChildren(), function (i, child) { + h = Math.max(h, track1(child)); + }); + return h + (node.height || 0); + } + + function track2(node) { + var h = 0; + BI.each(node.getChildren(), function (i, child) { + h = Math.max(h, track2(child)); + }); + return h + (node.width || 0); + } + + if (this._isVertical()) { + height = track1(this.tree.getRoot()); + } else { + height = track2(this.tree.getRoot()); + } + return height; + }, + + _calculateXY: function (levels) { + var o = this.options; + var width = this._calculateWidth(); + var height = this._calculateHeight(); + var levelCount = levels.length; + var allLeavesCount = this._calculateLeaves(); + //计算坐标 + var xy = {}; + var levelHeight = height / levelCount; + BI.each(levels, function (i, nodes) { + //计算权重 + var weights = []; + BI.each(nodes, function (j, node) { + weights[j] = (node.get("leaves") || 1) / allLeavesCount; + }); + BI.each(nodes, function (j, node) { + //求前j个元素的权重 + var weight = BI.sum(weights.slice(0, j)); + //求坐标 + var x = weight * width + weights[j] * width / 2; + var y = i * levelHeight + levelHeight / 2; + xy[node.id] = {x: x, y: y}; + }) + }); + return xy; + }, + + _stroke: function (levels, xy) { + var height = this._calculateHeight(); + var levelCount = levels.length; + var levelHeight = height / levelCount; + var self = this, o = this.options; + switch (o.direction) { + case BI.Direction.Top: + BI.each(levels, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (node.getChildrenLength() > 0 && !node.leaf) { + var path = ""; + var start = xy[node.id]; + var split = start.y + levelHeight / 2; + path += "M" + start.x + "," + (start.y + o.centerOffset) + "L" + start.x + "," + split; + var end = []; + BI.each(node.getChildren(), function (t, c) { + var e = end[t] = xy[c.id]; + path += "M" + e.x + "," + (e.y + o.centerOffset) + "L" + e.x + "," + split; + }); + if (end.length > 0) { + path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split; + } + self.svg.path(path).attr("stroke", "#d4dadd"); + } + }) + }); + break; + case BI.Direction.Bottom: + BI.each(levels, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (node.getChildrenLength() > 0 && !node.leaf) { + var path = ""; + var start = xy[node.id]; + var split = start.y - levelHeight / 2; + path += "M" + start.x + "," + (start.y - o.centerOffset) + "L" + start.x + "," + split; + var end = []; + BI.each(node.getChildren(), function (t, c) { + var e = end[t] = xy[c.id]; + path += "M" + e.x + "," + (e.y - o.centerOffset) + "L" + e.x + "," + split; + }); + if (end.length > 0) { + path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split; + } + self.svg.path(path).attr("stroke", "#d4dadd"); + } + }) + }); + break; + case BI.Direction.Left: + BI.each(levels, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (node.getChildrenLength() > 0 && !node.leaf) { + var path = ""; + var start = xy[node.id]; + var split = start.y + levelHeight / 2; + path += "M" + (start.y + o.centerOffset) + "," + start.x + "L" + split + "," + start.x; + var end = []; + BI.each(node.getChildren(), function (t, c) { + var e = end[t] = xy[c.id]; + path += "M" + (e.y + o.centerOffset) + "," + e.x + "L" + split + "," + e.x; + }); + if (end.length > 0) { + path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x; + } + self.svg.path(path).attr("stroke", "#d4dadd"); + } + }) + }); + break; + case BI.Direction.Right: + BI.each(levels, function (i, nodes) { + BI.each(nodes, function (j, node) { + if (node.getChildrenLength() > 0 && !node.leaf) { + var path = ""; + var start = xy[node.id]; + var split = start.y - levelHeight / 2; + path += "M" + (start.y - o.centerOffset) + "," + start.x + "L" + split + "," + start.x; + var end = []; + BI.each(node.getChildren(), function (t, c) { + var e = end[t] = xy[c.id]; + path += "M" + (e.y - o.centerOffset) + "," + e.x + "L" + split + "," + e.x; + }); + if (end.length > 0) { + path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x; + } + self.svg.path(path).attr("stroke", "#d4dadd"); + } + }) + }); + break; + } + }, + + _createBranches: function (levels) { + var self = this, o = this.options; + if (o.direction === BI.Direction.Bottom || o.direction === BI.Direction.Right) { + levels = levels.reverse(); + } + var xy = this._calculateXY(levels); + //画图 + this._stroke(levels, xy); + }, + + _isNeedAdjust: function () { + var o = this.options; + return o.direction === BI.Direction.Top && o.align === BI.VerticalAlign.Bottom || o.direction === BI.Direction.Bottom && o.align === BI.VerticalAlign.Top + || o.direction === BI.Direction.Left && o.align === BI.HorizontalAlign.Right || o.direction === BI.Direction.Right && o.align === BI.HorizontalAlign.Left + }, + + setValue: function (value) { + + }, + + getValue: function () { + + }, + + _transformToTreeFormat: function (sNodes) { + var i, l; + if (!sNodes) { + return []; + } + + if (BI.isArray(sNodes)) { + var r = []; + var tmpMap = []; + for (i = 0, l = sNodes.length; i < l; i++) { + tmpMap[sNodes[i].id] = sNodes[i]; + } + for (i = 0, l = sNodes.length; i < l; i++) { + if (tmpMap[sNodes[i].pId] && sNodes[i].id != sNodes[i].pId) { + if (!tmpMap[sNodes[i].pId].children) { + tmpMap[sNodes[i].pId].children = []; + } + tmpMap[sNodes[i].pId].children.push(sNodes[i]); + } else { + r.push(sNodes[i]); + } + } + return r; + } else { + return [sNodes]; + } + }, + + populate: function (items) { + var self = this, o = this.options; + o.items = items || []; + this.empty(); + items = this._transformToTreeFormat(o.items); + this.tree = new BI.Tree(); + this.tree.initTree(items); + + this.svg = BI.createWidget({ + type: "bi.svg" + }); + + //树分层 + var levels = this._stratification(); + + if (this._isNeedAdjust()) { + //树平移 + var adjust = this._translate(levels); + //树调整 + adjust = this._adjust(adjust); + + this._createBranches(adjust); + } else { + var adjust = this._fill(levels); + + this._createBranches(adjust); + } + + var container = BI.createWidget({ + type: "bi.layout", + width: this._isVertical() ? this._calculateWidth() : this._calculateHeight(), + height: this._isVertical() ? this._calculateHeight() : this._calculateWidth() + }); + BI.createWidget({ + type: "bi.absolute", + element: container, + items: [{ + el: this.svg, + top: 0, + left: 0, + right: 0, + bottom: 0 + }] + }); + if (this._isVertical()) { + items = [{ + type: "bi.handstand_branch_tree", + expander: { + direction: o.direction + }, + el: { + layouts: [{ + type: "bi.horizontal_adapt", + verticalAlign: o.align + }] + }, + items: items + }] + } else { + items = [{ + type: "bi.branch_tree", + expander: { + direction: o.direction + }, + el: { + layouts: [{ + type: "bi.vertical" + }, { + type: o.align === BI.HorizontalAlign.Left ? "bi.left" : "bi.right" + }] + }, + items: items + }] + } + BI.createWidget({ + type: "bi.adaptive", + element: container, + items: items + }); + BI.createWidget({ + type: "bi.center_adapt", + scrollable: true, + element: this, + items: [container] + }); + } +}); +BI.BranchRelation.EVENT_CHANGE = "BranchRelation.EVENT_CHANGE"; +BI.shortcut("bi.branch_relation", BI.BranchRelation);/** * 倒立的Branch * @class BI.HandStandBranchExpander * @extend BI.Widget diff --git a/dist/demo.js b/dist/demo.js index 7a594fd3e..97301635b 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -3035,7 +3035,33 @@ BI.shortcut("demo.value_chooser_combo", Demo.ValueChooserCombo);Demo.ValueChoose }; } }); -BI.shortcut("demo.value_chooser_pane", Demo.ValueChooserPane);Demo.BASE_CONFIG = [{ +BI.shortcut("demo.value_chooser_pane", Demo.ValueChooserPane);Demo.ADDONS_CONFIG = [{ + id: 6, + text: "addons" +}, { + pId: 6, + id: 601, + text: "拓展图表控件" +}, { + pId: 601, + text: "柱状图", + value: "demo.axis_chart" +}, { + pId: 6, + id: 602, + text: "sliders" +}, { + pId: 602, + text: "bi.single_slider" +}, { + id: 100000, + text: "小demo", + value: "demo.platform_level_tree" +}, { + pId: 100000, + text: "平台用", + value: "demo.platform_level_tree" +}];Demo.BASE_CONFIG = [{ id: 2, text: "基础控件", open: false @@ -3155,10 +3181,30 @@ BI.shortcut("demo.value_chooser_pane", Demo.ValueChooserPane);Demo.BASE_CONFIG = pId: 2, text: "bi.svg", value: "demo.svg" +}, { + pId: 2, + text: "bi.canvas", + value: "demo.canvas" }];Demo.CASE_CONFIG = [{ id: 3, text: "实例控件", open: false +}, { + pId: 3, + id: 300, + text: "按钮" +}, { + pId: 300, + text: "bi.multi_select_item", + value: "demo.multi_select_item" +}, { + pId: 300, + text: "bi.single_select_item", + value: "demo.single_select_item" +}, { + pId: 300, + text: "bi.single_select_radio_item", + value: "demo.single_select_radio_item" }, { pId: 3, id: 301, @@ -3179,58 +3225,162 @@ BI.shortcut("demo.value_chooser_pane", Demo.ValueChooserPane);Demo.BASE_CONFIG = pId: 301, text: "bi.state_editor", value: "demo.state_editor" +}, { + pId: 301, + text: "bi.simple_state_editor", + value: "demo.simple_state_editor" +}, { + pId: 301, + text: "bi.clear_editor", + value: "demo.clear_editor" }, { pId: 3, id: 302, - text: "combo" + text: "列表" }, { pId: 302, + text: "bi.select_list", + value: "demo.select_list" +}, { + pId: 302, + text: "bi.lazy_loader", + value: "demo.lazy_loader" +}, { + pId: 302, + text: "bi.list_loader", + value: "demo.list_loader" +}, { + pId: 302, + text: "bi.sort_list", + value: "demo.sort_list" +}, { + pId: 3, + id: 303, + text: "面板" +}, { + pId: 303, + text: "bi.pane_list", + value: "demo.pane_list" +}, { + pId: 303, + text: "bi.panel", + value: "demo.panel" +}, { + pId: 3, + id: 304, + text: "popup弹出层" +}, { + pId: 304, + text: "bi.multi_popup_view", + value: "demo.multi_popup_view" +}, { + pId: 304, + text: "bi.popup_panel", + value: "demo.popup_panel" +}, { + pId: 3, + id: 305, + text: "触发器trigger" +}, { + pId: 305, + text: "bi.editor_trigger", + value: "demo.editor_trigger" +}, { + pId: 305, + text: "bi.icon_trigger", + value: "demo.icon_trigger" +}, { + pId: 305, + text: "bi.text_trigger", + value: "demo.text_trigger" +}, { + pId: 305, + text: "bi.select_text_trigger", + value: "demo.select_text_trigger" +}, { + pId: 3, + id: 306, + text: "combo" +}, { + pId: 306, text: "bi.bubble_combo", value: "demo.bubble_combo" +}, { + pId: 306, + text: "bi.icon_combo", + value: "demo.icon_combo" +}, { + pId: 306, + text: "bi.static_combo", + value: "demo.static_combo" +}, { + pId: 306, + text: "bi.text_value_combo", + value: "demo.text_value_combo" +}, { + pId: 306, + text: "bi.text_value_check_combo", + value: "demo.text_value_check_combo" +}, { + pId: 306, + text: "bi.text_value_down_list_combo", + value: "demo.text_value_down_list_combo" }, { pId: 3, - id: 303, + id: 307, text: "tree" }, { - pId: 303, + pId: 307, text: "bi.branch_tree", value: "demo.branch_tree" }, { - pId: 303, + pId: 307, text: "bi.handstand_branch_tree", value: "demo.handstand_branch_tree" }, { - pId: 303, + pId: 307, text: "bi.display_tree", value: "demo.display_tree" }, { - pId: 303, + pId: 307, text: "bi.simple_tree", value: "demo.simple_tree" }, { - pId: 303, + pId: 307, text: "bi.level_tree", value: "demo.level_tree" }, { - pId: 303, + pId: 307, text: "bi.branch_relation", value: "demo.branch_relation" }, { pId: 3, - id: 304, + id: 308, text: "table" }, { - pId: 304, + pId: 308, text: "bi.adaptive_table", value: "demo.adaptive_table" }, { - pId: 304, + pId: 308, text: "bi.tree_table", value: "demo.tree_table" }, { - pId: 304, + pId: 308, text: "bi.layer_tree_table", value: "demo.layer_tree_table" +}, { + pId: 3, + id: 309, + text: "pager" +}, { + pId: 309, + text: "bi.all_count_pager", + value: "demo.all_count_pager" +}, { + pId: 309, + text: "bi.direction_pager", + value: "demo.direction_pager" }, { pId: 3, text: "bi.calendar", @@ -3247,17 +3397,14 @@ BI.shortcut("demo.value_chooser_pane", Demo.ValueChooserPane);Demo.BASE_CONFIG = pId: 3, text: "bi.color_chooser", value: "demo.color_chooser" +}, { + pId: 3, + text: "bi.color_chooser_popup", + value: "demo.color_chooser_popup" }, { pId: 3, text: "bi.segment", value: "demo.segment" -}];Demo.CHART_CONFIG = [{ - id: 6, - text: "图表控件" -}, { - pId: 6, - text: "柱状图", - value: "demo.axis_chart" }];/** * Created by User on 2017/3/22. */ @@ -3280,10 +3427,6 @@ Demo.COMPONENT_CONFIG = [{ pId: 5, text: "bi.tree_value_chooser_pane", value: "demo.tree_value_chooser_pane" -}, { - pId: 5, - text: "平台用", - value: "demo.platform_level_tree" }];Demo.CORE_CONFIG = [{ id: 1, text: "核心控件" @@ -3449,8 +3592,8 @@ Demo.COMPONENT_CONFIG = [{ value: "demo.layer_popup" }, { pId: 10202, - text: "bi.layer_searcher", - value: "demo.layer_searcher" + text: "bi.searcher_view", + value: "demo.searcher_view" }, { pId: 1, text: "widget", @@ -9499,7 +9642,7 @@ Demo.YearQuarterCombo = BI.inherit(BI.Widget, { } }) -BI.shortcut("demo.year_quarter_combo", Demo.YearQuarterCombo);Demo.CONFIG = Demo.CORE_CONFIG.concat(Demo.BASE_CONFIG).concat(Demo.CASE_CONFIG).concat(Demo.WIDGET_CONFIG).concat(Demo.COMPONENT_CONFIG).concat(Demo.CHART_CONFIG); +BI.shortcut("demo.year_quarter_combo", Demo.YearQuarterCombo);Demo.CONFIG = Demo.CORE_CONFIG.concat(Demo.BASE_CONFIG).concat(Demo.CASE_CONFIG).concat(Demo.WIDGET_CONFIG).concat(Demo.COMPONENT_CONFIG).concat(Demo.ADDONS_CONFIG); Demo.CONSTANTS = { ITEMS: BI.map("柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂 柳州市积玉贸易有限公司 柳州市福运来贸易有限责任公司 柳州市钢义物资有限公司 柳州市洋力化工有限公司 柳州市悦盛贸易有限公司 柳州市雁城钢管物资有限公司 柳州市恒瑞钢材经营部 柳州市科拓电子有限公司 柳州市九方电子有限公司 柳州市桂龙汽车配件厂 柳州市制鞋工厂 柳州市炜力科贸有限公司 柳州市希翼贸易有限公司 柳州市兆金物资有限公司 柳州市和润电子科技有限责任公司 柳州市汇凯贸易有限公司 柳州市好机汇商贸有限公司 柳州市泛源商贸经营部 柳州市利汇达物资有限公司 广西全民药业有限责任公司 柳州超凡物资贸易有限责任公司 柳州市贵宏物资有限责任公司 柳州昊恒贸易有限责任公司 柳州市浦联物资有限公司 柳州市广通园林绿化工程有限责任公司 柳州市松发物资贸易有限责任公司 柳州市奥士达办公设备有限责任公司 柳州市海泰物资有限公司 柳州市金三环针织厂 柳州市钢贸物资有限公司 柳州市明阳纺织有限公司 柳州市世科科技发展有限公司 柳州市禄羊贸易有限公司 柳州市金兆阳商贸有限公司 柳州市汇昌物资经营部 柳州市林泰金属物资供应站 柳州市自来水管道材料设备公司 柳州市丹柳铝板有限公司 柳州市桂冶物资有限公司 柳州市宸业物资经营部 柳州市耀成贸易有限公司 柳州奥易自动化科技有限公司 柳州市萃丰科技有限责任公司 柳州市华储贸易有限责任公司 柳州市黄颜钢材有限责任公司 柳州市银盛物资有限责任公司 柳州市新仪化玻供应站 柳州市晶凯化工有限公司 广西柳州市柳江包装纸厂 柳州市志新物资有限责任公司 柳州市兆钢物资有限公司 柳州市友方科技发展有限责任公司 柳州市缝纫机台板家具总厂 柳州市晖海数码办公设备有限责任公司 柳州市富兰特服饰有限责任公司 柳州市柳北区富兴物资经营部 柳州市柳锌福利厂 柳州市海泉印刷有限责任公司 柳州市乾亨贸易有限公司 柳州市悦宁物资贸易有限公司 柳州市昊天贸易有限公司 广西惠字钢铁有限公司 柳州市名青物资有限公司 柳州市林郝物资有限公司 柳州市民政服装厂 柳州市多维劳保用品厂 柳州市轻工物资供应公司 柳州市程源物资有限责任公司 柳州市寿丰物资贸易有限责任公司 柳州市凯凡物资有限公司 柳州市利晖物资经营部 柳州市恒茂金属物资供应站 柳州市中储物资经营部 柳州市第二医疗器械厂 柳州市来鑫物资经营部 柳州市钢鑫物资贸易有限责任公司 柳州市双合袜业有限责任公司 柳州市茂松经贸有限责任公司 柳州市行行物资贸易有限公司 柳州市方一物资有限公司 柳州成异钢管销售有限公司 柳州广惠佳电脑有限公司 桂林市圣泽鑫物资有限公司柳州分公司 柳州市砼基建材贸易有限公司 柳州市海燕针织厂 上海浦光仪表厂柳州销售处 柳州市能电工贸有限责任公司 柳州市广贸物资有限公司 柳州市柳北区大昌电工灯饰经营部 柳州市金龙印务有限公司 柳州市奇缘婚典服务有限公司 柳州市盛博物资经营部 柳州市项元钢铁贸易有限公司 柳州市虞美人化妆品经营部 柳州市俊彦鞋厂 柳州市聚源特钢有限公司 柳州市迅龙科贸有限责任公司 柳州市恒飞电子有限责任公司 柳州市蓝正现代办公设备有限责任公司 柳州地区农业生产资料公司 柳州华菱钢管销售有限公司 柳州融通物资有限公司 柳州市可仁广告策划有限责任公司 柳州市鸟鑫物资有限责任公司 柳州市五丰钢材供应站 柳州市金江不锈钢有限公司 柳州市美日物资设备有限责任公司 柳州市鑫东物资贸易有限责任公司 柳州地区日用杂品公司 柳州市华纳物资贸易有限公司 柳州乾利金虹物资贸易有限责任公司 柳州市新迈计算机有限公司 柳州市富丽实业发展公司 柳州市石钢金属材料有限公司 柳州市力志传真机销售有限公司 广西宝森投资有限公司 柳州市嵘基商贸有限公司 柳州市景民商贸有限责任公司 柳州市银桥化玻有限责任公司 柳州市宏文糖烟店 柳州市科苑电脑网络有限公司 柳州市两面针旅游用品厂 柳州市立早室内装璜有限责任公司 柳州地化建材有限公司 柳州市涛达贸易有限公司 柳州市兰丰档案服务中心 柳州市惠贸物资有限责任公司 柳州市立文物资有限责任公司 柳州市致和商贸经营部 柳州市金色阳光信息咨询有限公司 柳州市赛利钢材经销部 柳州市日用化工厂 柳州市昆廷物资有限责任公司 柳州市邦盛贸易有限公司 柳州市济华贸易有限公司 柳州昕威橡塑化工经营部 柳州市联业贸易有限公司 柳州市兰钢贸易有限公司 柳州市子欣科技有限公司 柳州市狄龙机电设备有限公司 柳州市方真物资贸易有限公司 柳州市银鸥废旧回收中心 柳州市冠宝贸易有限公司 柳州市鑫盛德商务咨询有限责任公司 柳州市泰汇银通经贸有限公司 广西瀚维智测科技有限公司 柳州市钓鱼郎制衣有限责任公司 柳州溪水物资有限公司 柳州市融峰物资有限责任公司 广西新地科技有限责任公司 柳州市纺织装饰公司 柳州市粤翔冶金炉料有限公司 柳州市远腾贸易有限公司 柳州市东鸿城市改造有限公司 广西丛欣实业有限公司 柳州市服装厂 柳州市立安联合刀片有限公司 广西国扬投资有限责任公司 柳州市铭泰办公设备公司 柳州市桂钢物资供应站 柳州市昱升物资有限责任公司 柳州市鹰飞灿科贸有限公司 柳州市先导科贸有限公司 柳州市金秋建材物资经营部 柳州市童装厂 柳州市民泽物资有限公司 柳州市恒先物资贸易有限公司 柳州市银夏冷气工程有限责任公司 柳州粮食批发有限责任公司 柳州市金银华窗纱制造有限责任公司 柳州市三方贸易有限公司 柳州市丰涛商贸有限责任公司 柳州华智企业管理咨询有限责任公司 柳州市诚正建筑工程施工图审查有限公司 柳州市今科电讯设备营销中心 柳州市闽德电子有限公司 柳州市鑫虹针织厂 柳州市畅通通讯器材有限责任公司 柳州市正钢物资经营部 柳州市新柳饲料有限责任公司 柳州市黄村油库 柳州市天泰电力装饰工程有限公司 柳州市兆吉物资有限责任公司 柳州市八龙纸制品有限责任公司 柳州市巨佳电脑网络科技有限公司 ".match(/[^\s]+/g), function (i, v) { diff --git a/dist/resource.css b/dist/resource.css index 65f9dbe95..d77bbbf4d 100644 --- a/dist/resource.css +++ b/dist/resource.css @@ -466,6 +466,36 @@ textarea::-webkit-scrollbar-thumb:hover { content: "\e604"; color: inherit; } +.date-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.date-font .b-font:before { + content: "\e61b"; + color: inherit; +} +.date-font.native .b-font:before, +.date-font.disabled .b-font:before { + content: "\e61b"; + color: inherit; +} +.date-change-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.date-change-h-font .b-font:before { + content: "\e660"; + color: inherit; +} +.date-change-h-font:hover .b-font:before, +.date-change-h-font:focus .b-font:before, +.date-change-h-font.hover .b-font:before { + content: "\e660"; + color: inherit; +} +.date-change-h-font.native .b-font:before, +.date-change-h-font.disabled .b-font:before { + content: "\e660"; + color: inherit; +} .dot-font .b-font { *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); } diff --git a/dist/widget.js b/dist/widget.js index 43e0631fb..dc41f351b 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -1842,503 +1842,6 @@ BI.extend(BI.Arrangement, { } }); BI.shortcut('bi.arrangement', BI.Arrangement);/** - * 表关联树 - * - * Created by GUY on 2015/12/15. - * @class BI.BranchRelation - * @extends BI.Widget - */ -BI.BranchRelation = BI.inherit(BI.Widget, { - - _defaultConfig: function () { - return BI.extend(BI.BranchRelation.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-branch-relation-tree", - items: [], - - centerOffset: 0,//重心偏移量 - direction: BI.Direction.Bottom, - align: BI.VerticalAlign.Top - }) - }, - - _init: function () { - BI.BranchRelation.superclass._init.apply(this, arguments); - this.populate(this.options.items); - }, - - //树分层 - _stratification: function () { - var levels = []; - this.tree.recursion(function (node, route) { - //node.isRoot = route.length <= 1; - node.leaf = node.isLeaf(); - if (!levels[route.length - 1]) { - levels[route.length - 1] = []; - } - levels[route.length - 1].push(node); - }); - return levels; - }, - - //计算所有节点的叶子结点个数 - _calculateLeaves: function () { - var count = 0; - - function track(node) { - var c = 0; - if (node.isLeaf()) { - return 1; - } - BI.each(node.getChildren(), function (i, child) { - c += track(child); - }); - node.set("leaves", c); - return c; - } - - count = track(this.tree.getRoot()); - return count; - }, - - //树平移 - _translate: function (levels) { - var adjust = []; - var maxLevel = levels.length; - BI.each(levels, function (i, nodes) { - if (!adjust[i]) { - adjust[i] = []; - } - BI.each(nodes, function (j, node) { - if (node.isLeaf() && i < maxLevel - 1) { - var newNode = new BI.Node(BI.UUID()); - //newNode.isEmptyRoot = node.isRoot || node.isEmptyRoot; - newNode.isNew = true; - //把node向下一层移 - var tar = 0; - if (j > 0) { - var c = nodes[j - 1].getLastChild(); - tar = levels[i + 1].indexOf(c) + 1; - } - levels[i + 1].splice(tar, 0, node); - //新增一个临时树节点 - var index = node.parent.getChildIndex(node.id); - node.parent.removeChildByIndex(index); - node.parent.addChild(newNode, index); - newNode.addChild(node); - adjust[i].push(newNode); - nodes[j] = newNode; - } else { - adjust[i].push(node); - } - }) - }); - return adjust; - }, - - //树补白 - _fill: function (levels) { - var adjust = []; - var maxLevel = levels.length; - BI.each(levels, function (i, nodes) { - if (!adjust[i]) { - adjust[i] = []; - } - BI.each(nodes, function (j, node) { - if (node.isLeaf() && i < maxLevel - 1) { - var newNode = new BI.Node(BI.UUID()); - newNode.leaf = true; - newNode.width = node.width; - newNode.height = node.height; - newNode.isNew = true; - //把node向下一层移 - var tar = 0; - if (j > 0) { - var c = nodes[j - 1].getLastChild(); - tar = levels[i + 1].indexOf(c) + 1; - } - levels[i + 1].splice(tar, 0, newNode); - //新增一个临时树节点 - node.addChild(newNode); - } - adjust[i].push(node); - }) - }); - return adjust; - }, - - //树调整 - _adjust: function (adjust) { - while (true) { - var isAllNeedAjust = false; - BI.backEach(adjust, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (!node.isNew) { - var needAdjust = true; - BI.any(node.getChildren(), function (k, n) { - if (!n.isNew) { - needAdjust = false; - return true; - } - }); - if (!node.isLeaf() && needAdjust === true) { - var allChilds = []; - BI.each(node.getChildren(), function (k, n) { - allChilds = allChilds.concat(n.getChildren()); - }); - node.removeAllChilds(); - BI.each(allChilds, function (k, c) { - node.addChild(c); - }); - var newNode = new BI.Node(BI.UUID()); - //newNode.isEmptyRoot = node.isRoot || node.isEmptyRoot; - newNode.isNew = true; - var index = node.parent.getChildIndex(node.id); - node.parent.removeChildByIndex(index); - node.parent.addChild(newNode, index); - newNode.addChild(node); - isAllNeedAjust = true; - } - } - }) - }); - if (isAllNeedAjust === false) { - break; - } else {//树重构 - adjust = this._stratification(); - } - } - return adjust; - }, - - _calculateWidth: function () { - var o = this.options; - var width = 0; - - function track1(node) { - var w = 0; - if (node.isLeaf()) { - return node.width; - } - BI.each(node.getChildren(), function (i, child) { - w += track1(child); - }); - return w; - } - - function track2(node) { - var w = 0; - if (node.isLeaf()) { - return node.height; - } - BI.each(node.getChildren(), function (i, child) { - w += track2(child); - }); - return w; - } - - if (this._isVertical()) { - width = track1(this.tree.getRoot()); - } else { - width = track2(this.tree.getRoot()); - } - - return width; - }, - - _isVertical: function () { - var o = this.options; - return o.direction === BI.Direction.Top || o.direction === BI.Direction.Bottom; - }, - - _calculateHeight: function () { - var o = this.options; - var height = 0; - - function track1(node) { - var h = 0; - BI.each(node.getChildren(), function (i, child) { - h = Math.max(h, track1(child)); - }); - return h + (node.height || 0); - } - - function track2(node) { - var h = 0; - BI.each(node.getChildren(), function (i, child) { - h = Math.max(h, track2(child)); - }); - return h + (node.width || 0); - } - - if (this._isVertical()) { - height = track1(this.tree.getRoot()); - } else { - height = track2(this.tree.getRoot()); - } - return height; - }, - - _calculateXY: function (levels) { - var o = this.options; - var width = this._calculateWidth(); - var height = this._calculateHeight(); - var levelCount = levels.length; - var allLeavesCount = this._calculateLeaves(); - //计算坐标 - var xy = {}; - var levelHeight = height / levelCount; - BI.each(levels, function (i, nodes) { - //计算权重 - var weights = []; - BI.each(nodes, function (j, node) { - weights[j] = (node.get("leaves") || 1) / allLeavesCount; - }); - BI.each(nodes, function (j, node) { - //求前j个元素的权重 - var weight = BI.sum(weights.slice(0, j)); - //求坐标 - var x = weight * width + weights[j] * width / 2; - var y = i * levelHeight + levelHeight / 2; - xy[node.id] = {x: x, y: y}; - }) - }); - return xy; - }, - - _stroke: function (levels, xy) { - var height = this._calculateHeight(); - var levelCount = levels.length; - var levelHeight = height / levelCount; - var self = this, o = this.options; - switch (o.direction) { - case BI.Direction.Top: - BI.each(levels, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (node.getChildrenLength() > 0 && !node.leaf) { - var path = ""; - var start = xy[node.id]; - var split = start.y + levelHeight / 2; - path += "M" + start.x + "," + (start.y + o.centerOffset) + "L" + start.x + "," + split; - var end = []; - BI.each(node.getChildren(), function (t, c) { - var e = end[t] = xy[c.id]; - path += "M" + e.x + "," + (e.y + o.centerOffset) + "L" + e.x + "," + split; - }); - if (end.length > 0) { - path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split; - } - self.svg.path(path).attr("stroke", "#d4dadd"); - } - }) - }); - break; - case BI.Direction.Bottom: - BI.each(levels, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (node.getChildrenLength() > 0 && !node.leaf) { - var path = ""; - var start = xy[node.id]; - var split = start.y - levelHeight / 2; - path += "M" + start.x + "," + (start.y - o.centerOffset) + "L" + start.x + "," + split; - var end = []; - BI.each(node.getChildren(), function (t, c) { - var e = end[t] = xy[c.id]; - path += "M" + e.x + "," + (e.y - o.centerOffset) + "L" + e.x + "," + split; - }); - if (end.length > 0) { - path += "M" + BI.first(end).x + "," + split + "L" + BI.last(end).x + "," + split; - } - self.svg.path(path).attr("stroke", "#d4dadd"); - } - }) - }); - break; - case BI.Direction.Left: - BI.each(levels, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (node.getChildrenLength() > 0 && !node.leaf) { - var path = ""; - var start = xy[node.id]; - var split = start.y + levelHeight / 2; - path += "M" + (start.y + o.centerOffset) + "," + start.x + "L" + split + "," + start.x; - var end = []; - BI.each(node.getChildren(), function (t, c) { - var e = end[t] = xy[c.id]; - path += "M" + (e.y + o.centerOffset) + "," + e.x + "L" + split + "," + e.x; - }); - if (end.length > 0) { - path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x; - } - self.svg.path(path).attr("stroke", "#d4dadd"); - } - }) - }); - break; - case BI.Direction.Right: - BI.each(levels, function (i, nodes) { - BI.each(nodes, function (j, node) { - if (node.getChildrenLength() > 0 && !node.leaf) { - var path = ""; - var start = xy[node.id]; - var split = start.y - levelHeight / 2; - path += "M" + (start.y - o.centerOffset) + "," + start.x + "L" + split + "," + start.x; - var end = []; - BI.each(node.getChildren(), function (t, c) { - var e = end[t] = xy[c.id]; - path += "M" + (e.y - o.centerOffset) + "," + e.x + "L" + split + "," + e.x; - }); - if (end.length > 0) { - path += "M" + split + "," + BI.first(end).x + "L" + split + "," + BI.last(end).x; - } - self.svg.path(path).attr("stroke", "#d4dadd"); - } - }) - }); - break; - } - }, - - _createBranches: function (levels) { - var self = this, o = this.options; - if (o.direction === BI.Direction.Bottom || o.direction === BI.Direction.Right) { - levels = levels.reverse(); - } - var xy = this._calculateXY(levels); - //画图 - this._stroke(levels, xy); - }, - - _isNeedAdjust: function () { - var o = this.options; - return o.direction === BI.Direction.Top && o.align === BI.VerticalAlign.Bottom || o.direction === BI.Direction.Bottom && o.align === BI.VerticalAlign.Top - || o.direction === BI.Direction.Left && o.align === BI.HorizontalAlign.Right || o.direction === BI.Direction.Right && o.align === BI.HorizontalAlign.Left - }, - - setValue: function (value) { - - }, - - getValue: function () { - - }, - - _transformToTreeFormat: function (sNodes) { - var i, l; - if (!sNodes) { - return []; - } - - if (BI.isArray(sNodes)) { - var r = []; - var tmpMap = []; - for (i = 0, l = sNodes.length; i < l; i++) { - tmpMap[sNodes[i].id] = sNodes[i]; - } - for (i = 0, l = sNodes.length; i < l; i++) { - if (tmpMap[sNodes[i].pId] && sNodes[i].id != sNodes[i].pId) { - if (!tmpMap[sNodes[i].pId].children) { - tmpMap[sNodes[i].pId].children = []; - } - tmpMap[sNodes[i].pId].children.push(sNodes[i]); - } else { - r.push(sNodes[i]); - } - } - return r; - } else { - return [sNodes]; - } - }, - - populate: function (items) { - var self = this, o = this.options; - o.items = items || []; - this.empty(); - items = this._transformToTreeFormat(o.items); - this.tree = new BI.Tree(); - this.tree.initTree(items); - - this.svg = BI.createWidget({ - type: "bi.svg" - }); - - //树分层 - var levels = this._stratification(); - - if (this._isNeedAdjust()) { - //树平移 - var adjust = this._translate(levels); - //树调整 - adjust = this._adjust(adjust); - - this._createBranches(adjust); - } else { - var adjust = this._fill(levels); - - this._createBranches(adjust); - } - - var container = BI.createWidget({ - type: "bi.layout", - width: this._isVertical() ? this._calculateWidth() : this._calculateHeight(), - height: this._isVertical() ? this._calculateHeight() : this._calculateWidth() - }); - BI.createWidget({ - type: "bi.absolute", - element: container, - items: [{ - el: this.svg, - top: 0, - left: 0, - right: 0, - bottom: 0 - }] - }); - if (this._isVertical()) { - items = [{ - type: "bi.handstand_branch_tree", - expander: { - direction: o.direction - }, - el: { - layouts: [{ - type: "bi.horizontal_adapt", - verticalAlign: o.align - }] - }, - items: items - }] - } else { - items = [{ - type: "bi.branch_tree", - expander: { - direction: o.direction - }, - el: { - layouts: [{ - type: "bi.vertical" - }, { - type: o.align === BI.HorizontalAlign.Left ? "bi.left" : "bi.right" - }] - }, - items: items - }] - } - BI.createWidget({ - type: "bi.adaptive", - element: container, - items: items - }); - BI.createWidget({ - type: "bi.center_adapt", - scrollable: true, - element: this, - items: [container] - }); - } -}); -BI.BranchRelation.EVENT_CHANGE = "BranchRelation.EVENT_CHANGE"; -BI.shortcut("bi.branch_relation", BI.BranchRelation);/** * 日期控件中的月份下拉框 * * Created by GUY on 2015/9/7. @@ -3250,7 +2753,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, { } }); -BI.shortcut("bi.date_pane_widget", BI.DatePaneWidget);/** +BI.shortcut("bi.date_pane", BI.DatePaneWidget);/** * Created by Urthur on 2017/7/14. */ BI.DateTimeCombo = BI.inherit(BI.Single, { @@ -3328,8 +2831,8 @@ BI.DateTimeCombo = BI.inherit(BI.Single, { }); var triggerBtn = BI.createWidget({ - type: "bi.trigger_icon_button", - cls: "bi-trigger-date-button chart-date-normal-font bi-border-right", + type: "bi.icon_button", + cls: "bi-trigger-icon-button date-font bi-border-right", width: 30, height: 24 }); @@ -4557,6 +4060,393 @@ BI.DownListPopup = BI.inherit(BI.Pane, { BI.DownListPopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.DownListPopup.EVENT_SON_VALUE_CHANGE = "EVENT_SON_VALUE_CHANGE"; BI.shortcut("bi.down_list_popup", BI.DownListPopup);/** + * Created by roy on 15/9/14. + */ +BI.SearchEditor = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: "bi-search-editor bi-border", + height: 30, + errorText: "", + watermark: BI.i18nText("BI-Basic_Search"), + validationChecker: BI.emptyFn, + quitChecker: BI.emptyFn + }); + }, + _init: function () { + this.options.height -= 2; + BI.SearchEditor.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.editor = BI.createWidget({ + type: "bi.editor", + height: o.height, + watermark: o.watermark, + allowBlank: true, + errorText: o.errorText, + validationChecker: o.validationChecker, + quitChecker: o.quitChecker + }); + this.clear = BI.createWidget({ + type: "bi.icon_button", + stopEvent: true, + cls: "search-close-h-font" + }); + this.clear.on(BI.IconButton.EVENT_CHANGE, function () { + self.setValue(""); + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT); + self.fireEvent(BI.SearchEditor.EVENT_CLEAR); + }); + BI.createWidget({ + element: this, + type: "bi.htape", + items: [ + { + el: { + type: "bi.center_adapt", + cls: "search-font", + items: [{ + el: { + type: "bi.icon" + } + }] + }, + width: 25 + }, + { + el: self.editor + }, + { + el: this.clear, + width: 25 + } + ] + }); + this.editor.on(BI.Controller.EVENT_CHANGE, function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); + + this.editor.on(BI.Editor.EVENT_FOCUS, function () { + self.fireEvent(BI.SearchEditor.EVENT_FOCUS); + }); + this.editor.on(BI.Editor.EVENT_BLUR, function () { + self.fireEvent(BI.SearchEditor.EVENT_BLUR); + }); + this.editor.on(BI.Editor.EVENT_CLICK, function () { + self.fireEvent(BI.SearchEditor.EVENT_CLICK); + }); + this.editor.on(BI.Editor.EVENT_CHANGE, function () { + self._checkClear(); + self.fireEvent(BI.SearchEditor.EVENT_CHANGE); + }); + this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { + self.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN, v); + }); + this.editor.on(BI.Editor.EVENT_SPACE, function () { + self.fireEvent(BI.SearchEditor.EVENT_SPACE) + }); + this.editor.on(BI.Editor.EVENT_BACKSPACE, function () { + self.fireEvent(BI.SearchEditor.EVENT_BACKSPACE) + }); + + + this.editor.on(BI.Editor.EVENT_VALID, function () { + self.fireEvent(BI.SearchEditor.EVENT_VALID) + }); + this.editor.on(BI.Editor.EVENT_ERROR, function () { + self.fireEvent(BI.SearchEditor.EVENT_ERROR) + }); + this.editor.on(BI.Editor.EVENT_ENTER, function () { + self.fireEvent(BI.SearchEditor.EVENT_ENTER); + }); + this.editor.on(BI.Editor.EVENT_RESTRICT, function () { + self.fireEvent(BI.SearchEditor.EVENT_RESTRICT) + }); + this.editor.on(BI.Editor.EVENT_EMPTY, function () { + self._checkClear(); + self.fireEvent(BI.SearchEditor.EVENT_EMPTY) + }); + this.editor.on(BI.Editor.EVENT_REMOVE, function () { + self.fireEvent(BI.SearchEditor.EVENT_REMOVE) + }); + this.editor.on(BI.Editor.EVENT_CONFIRM, function () { + self.fireEvent(BI.SearchEditor.EVENT_CONFIRM) + }); + this.editor.on(BI.Editor.EVENT_START, function () { + self.fireEvent(BI.SearchEditor.EVENT_START); + }); + this.editor.on(BI.Editor.EVENT_PAUSE, function () { + self.fireEvent(BI.SearchEditor.EVENT_PAUSE); + }); + this.editor.on(BI.Editor.EVENT_STOP, function () { + self.fireEvent(BI.SearchEditor.EVENT_STOP); + }); + + this.clear.invisible(); + }, + + _checkClear: function () { + if (!this.getValue()) { + this.clear.invisible(); + } else { + this.clear.visible(); + } + }, + + focus: function () { + this.editor.focus(); + }, + + blur: function () { + this.editor.blur(); + }, + + getValue: function () { + if (this.isValid()) { + var res = this.editor.getValue().match(/[\S]+/g); + return BI.isNull(res) ? "" : res[res.length - 1]; + } + }, + + getLastValidValue: function () { + return this.editor.getLastValidValue(); + }, + + setValue: function (v) { + this.editor.setValue(v); + if (BI.isKey(v)) { + this.clear.visible(); + } + }, + + isEditing: function () { + return this.editor.isEditing(); + }, + + isValid: function () { + return this.editor.isValid(); + } +}); +BI.SearchEditor.EVENT_CHANGE = "EVENT_CHANGE"; +BI.SearchEditor.EVENT_FOCUS = "EVENT_FOCUS"; +BI.SearchEditor.EVENT_BLUR = "EVENT_BLUR"; +BI.SearchEditor.EVENT_CLICK = "EVENT_CLICK"; +BI.SearchEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; +BI.SearchEditor.EVENT_SPACE = "EVENT_SPACE"; +BI.SearchEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; +BI.SearchEditor.EVENT_CLEAR = "EVENT_CLEAR"; + +BI.SearchEditor.EVENT_START = "EVENT_START"; +BI.SearchEditor.EVENT_PAUSE = "EVENT_PAUSE"; +BI.SearchEditor.EVENT_STOP = "EVENT_STOP"; +BI.SearchEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.SearchEditor.EVENT_VALID = "EVENT_VALID"; +BI.SearchEditor.EVENT_ERROR = "EVENT_ERROR"; +BI.SearchEditor.EVENT_ENTER = "EVENT_ENTER"; +BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; +BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE"; +BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY"; +BI.shortcut("bi.search_editor", BI.SearchEditor);/** + * 小号搜索框 + * Created by GUY on 2015/9/29. + * @class BI.SmallSearchEditor + * @extends BI.SearchEditor + */ +BI.SmallSearchEditor = BI.inherit(BI.SearchEditor, { + _defaultConfig: function () { + var conf = BI.SmallSearchEditor.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-small-search-editor", + height: 24 + }); + }, + + _init: function () { + BI.SmallSearchEditor.superclass._init.apply(this, arguments); + } +}); +BI.shortcut("bi.small_search_editor", BI.SmallSearchEditor);/** + * guy + * @class BI.TextEditor + * @extends BI.Single + */ +BI.TextEditor = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.TextEditor.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + extraCls: "bi-text-editor bi-border", + hgap: 4, + vgap: 2, + lgap: 0, + rgap: 0, + tgap: 0, + bgap: 0, + validationChecker: BI.emptyFn, + quitChecker: BI.emptyFn, + allowBlank: false, + watermark: "", + errorText: "", + height: 30 + }) + }, + + _init: function () { + BI.TextEditor.superclass._init.apply(this, arguments); + var self = this, o = this.options; + if (BI.isNumber(o.height)) { + this.element.css({height: o.height - 2}); + } + if (BI.isNumber(o.width)) { + this.element.css({width: o.width - 2}); + } + this.editor = BI.createWidget({ + type: "bi.editor", + height: o.height - 2, + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, + value: o.value, + validationChecker: o.validationChecker, + quitChecker: o.quitChecker, + allowBlank: o.allowBlank, + watermark: o.watermark, + errorText: o.errorText + }); + this.editor.on(BI.Controller.EVENT_CHANGE, function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + }); + + this.editor.on(BI.Editor.EVENT_FOCUS, function () { + self.fireEvent(BI.TextEditor.EVENT_FOCUS); + }); + this.editor.on(BI.Editor.EVENT_BLUR, function () { + self.fireEvent(BI.TextEditor.EVENT_BLUR); + }); + this.editor.on(BI.Editor.EVENT_CLICK, function () { + self.fireEvent(BI.TextEditor.EVENT_CLICK); + }); + this.editor.on(BI.Editor.EVENT_CHANGE, function () { + self.fireEvent(BI.TextEditor.EVENT_CHANGE); + }); + this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) { + self.fireEvent(BI.TextEditor.EVENT_KEY_DOWN); + }); + this.editor.on(BI.Editor.EVENT_SPACE, function (v) { + self.fireEvent(BI.TextEditor.EVENT_SPACE); + }); + this.editor.on(BI.Editor.EVENT_BACKSPACE, function (v) { + self.fireEvent(BI.TextEditor.EVENT_BACKSPACE); + }); + + + this.editor.on(BI.Editor.EVENT_VALID, function () { + self.fireEvent(BI.TextEditor.EVENT_VALID); + }); + this.editor.on(BI.Editor.EVENT_CONFIRM, function () { + self.fireEvent(BI.TextEditor.EVENT_CONFIRM); + }); + this.editor.on(BI.Editor.EVENT_REMOVE, function (v) { + self.fireEvent(BI.TextEditor.EVENT_REMOVE); + }); + this.editor.on(BI.Editor.EVENT_START, function () { + self.fireEvent(BI.TextEditor.EVENT_START); + }); + this.editor.on(BI.Editor.EVENT_PAUSE, function () { + self.fireEvent(BI.TextEditor.EVENT_PAUSE); + }); + this.editor.on(BI.Editor.EVENT_STOP, function () { + self.fireEvent(BI.TextEditor.EVENT_STOP); + }); + this.editor.on(BI.Editor.EVENT_ERROR, function () { + self.fireEvent(BI.TextEditor.EVENT_ERROR, arguments); + }); + this.editor.on(BI.Editor.EVENT_ENTER, function () { + self.fireEvent(BI.TextEditor.EVENT_ENTER); + }); + this.editor.on(BI.Editor.EVENT_RESTRICT, function () { + self.fireEvent(BI.TextEditor.EVENT_RESTRICT); + }); + this.editor.on(BI.Editor.EVENT_EMPTY, function () { + self.fireEvent(BI.TextEditor.EVENT_EMPTY); + }); + BI.createWidget({ + type: "bi.vertical", + scrolly: false, + element: this, + items: [this.editor] + }); + }, + + focus: function () { + this.editor.focus(); + }, + + blur: function () { + this.editor.blur(); + }, + + setErrorText: function (text) { + this.editor.setErrorText(text); + }, + + getErrorText: function () { + return this.editor.getErrorText(); + }, + + isValid: function () { + return this.editor.isValid(); + }, + + setValue: function (v) { + this.editor.setValue(v); + }, + + getValue: function () { + return this.editor.getValue(); + } +}); +BI.TextEditor.EVENT_CHANGE = "EVENT_CHANGE"; +BI.TextEditor.EVENT_FOCUS = "EVENT_FOCUS"; +BI.TextEditor.EVENT_BLUR = "EVENT_BLUR"; +BI.TextEditor.EVENT_CLICK = "EVENT_CLICK"; +BI.TextEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; +BI.TextEditor.EVENT_SPACE = "EVENT_SPACE"; +BI.TextEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE"; + +BI.TextEditor.EVENT_START = "EVENT_START"; +BI.TextEditor.EVENT_PAUSE = "EVENT_PAUSE"; +BI.TextEditor.EVENT_STOP = "EVENT_STOP"; +BI.TextEditor.EVENT_CONFIRM = "EVENT_CONFIRM"; +BI.TextEditor.EVENT_VALID = "EVENT_VALID"; +BI.TextEditor.EVENT_ERROR = "EVENT_ERROR"; +BI.TextEditor.EVENT_ENTER = "EVENT_ENTER"; +BI.TextEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; +BI.TextEditor.EVENT_REMOVE = "EVENT_REMOVE"; +BI.TextEditor.EVENT_EMPTY = "EVENT_EMPTY"; + +BI.shortcut("bi.text_editor", BI.TextEditor);/** + * 小号搜索框 + * Created by GUY on 2015/9/29. + * @class BI.SmallTextEditor + * @extends BI.SearchEditor + */ +BI.SmallTextEditor = BI.inherit(BI.TextEditor, { + _defaultConfig: function () { + var conf = BI.SmallTextEditor.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + baseCls: (conf.baseCls || "") + " bi-small-text-editor", + height: 25 + }); + }, + + _init: function () { + BI.SmallTextEditor.superclass._init.apply(this, arguments); + } +}); +BI.shortcut("bi.small_text_editor", BI.SmallTextEditor);/** * * Created by GUY on 2016/3/28. * @class BI.ExcelTableCell @@ -6739,8 +6629,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, { }); var triggerBtn = BI.createWidget({ - type: "bi.trigger_icon_button", - cls: "bi-trigger-date-button chart-date-normal-font", + type: "bi.icon_button", + cls: "bi-trigger-icon-button date-font", width: 30, height: 23 }); @@ -6753,7 +6643,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, { }); this.changeIcon = BI.createWidget({ type: "bi.icon_button", - cls: "bi-trigger-date-change widget-date-h-change-font", + cls: "bi-trigger-icon-button date-change-h-font", width: 30, height: 23 }); diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index e7d68d1a8..ed9a997fa 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -46,8 +46,8 @@ * [tab](core/combination/tab.md) * 弹出层 * [float_box](core/layer/layer_float_box.md) - * [popup](core/layer/layer_popup.md) - * [searcher](core/layer/layer_searcher.md) + * [popup_view](core/layer/layer_popup.md) + * [searcher_view](core/layer/layer_searcher.md) * [widget](core/widget.md) * [single](core/single.md) * [basic_button](core/basic_button.md) @@ -70,6 +70,7 @@ * [multifile_editor](base/editor/multifile_editor.md) * [textarea_editor](base/editor/textarea_editor.md) * [formula_editor](base/editor/formula_editor.md) + * [rich_editor](base/editor/rich_editor.md) * 表格 * [table_view](base/table/table_view.md) * [grid_table](base/table/grid_table.md) @@ -84,21 +85,24 @@ * [multi_select_item](case/button/multi_select_item.md) * [single_select_item](case/button/single_select_item.md) * [single_select_radio_item](case/button/single_select_radio_item.md) -* 编辑框 +* 文本框 * [shelter_editor](case/editor/shelter_editor.md) * [sign_editor](case/editor/sign_editor.md) * [sign_initial_editor](case/editor/sign_initial_editor.md) * [state_editor](case/editor/state_editor.md) -* 弹出层 - * [multi_popup_layer](case/layer/multi_popup_layer.md) - * [layer_panel](case/layer/layer_panel.md) - * [pane_list](case/layer/pane_list.md) - * [panel](case/layer/panel.md) + * [simple_state_editor](case/editor/simple_state_editor.md) + * [clear_editor](detailed/text_input/bi.clear_editor.md) * 列表 * [select_list](case/list/list.select.md) * [lazy_loader](case/loader/lazy_loader.md) * [list_loader](case/loader/list_loader.md) - * [sort_list](case/loader/sort_list.md) + * [sort_list(jquery-sortable封装)](case/loader/sort_list.md) +* 面板 + * [pane_list](case/layer/pane_list.md) + * [panel](case/layer/panel.md) +* popup弹出层 + * [multi_popup_view](case/layer/multi_popup_layer.md) + * [popup_panel](case/layer/layer_panel.md) * 触发器 * [editor_trigger](case/trigger/editor_trigger.md) * [icon_trigger](case/trigger/icon_trigger.md) @@ -108,7 +112,8 @@ * [icon_combo](case/combo/icon_combo.md) * [static_combo](case/combo/static_combo.md) * [text_value_combo](case/combo/text_value_combo.md) - * [text_value_downlist_combo](case/combo/text_value_downlist_combo.md) + * [text_value_check_combo](case/combo/text_value_check_combo.md) + * [text_value_down_list_combo](case/combo/text_value_down_list_combo.md) * 树 * [branch_tree](case/tree/branch_tree.md) * [handstand_branch_tree](case/tree/handstand_branch_tree.md) @@ -137,18 +142,18 @@ * [各种items](detailed/bi.button/items.md) * [各种节点nodes](detailed/bi.button/node.md) * [各种segment](detailed/bi.button/segment.md) -* 树形结构 +* 树 * [multi_tree_combo](detailed/tree/bi.multi_tree_combo.md) * [switch_tree](detailed/tree/bi.switch_tree.md) * 表格 * [preview_table](detailed/table/bi.preview_table.md) * [responsive_table](detailed/table/bi.responsive_table.md) * [excel_table](detailed/table/bi.excel_table.md) + * [sequence_table](detailed/table/bi.sequence_table.md) * [page_table](detailed/table/bi.page_table.md) * 文本框控件 - * [bi.text_editor](detailed/text_input/bi.text_editor.md) - * [bi.search_editor](detailed/text_input/bi.search_editor.md) - * [bi.clear_editor](detailed/text_input/bi.clear_editor.md) + * [text_editor](detailed/text_input/bi.text_editor.md) + * [search_editor](detailed/text_input/bi.search_editor.md) * [finetuning_number_editor](detailed/text_input/finetuning_number_editor.md) * [year_combo](detailed/year_combo.md) * [month_combo](detailed/month_combo.md) @@ -158,7 +163,7 @@ * [multi_select_combo](detailed/multi_select_combo.md) * 简单日期控件 * [date_combo](detailed/date/date_combo.md) - * [date_pane_widget](detailed/date/date_pane_widget.md) + * [date_pane](detailed/date/date_pane_widget.md) * [year_month_combo](detailed/date/year_month_combo.md) * [year_quarter_combo](detailed/date/year_quarter_combo.md) * [custom_date_time](detailed/date/custom_date_time.md) @@ -173,5 +178,13 @@ * [relation_view](detailed/relation_view.md) * [dialog](detailed/dialog.md) * [file_manager](detailed/file_manager.md) -* [slider](detailed/slider.md) +## 部件 +* [value_chooser_combo](components/value_chooser_combo.md) +* [value_chooser_pane](components/value_chooser_pane.md) +* [all_value_chooser_combo](components/all_value_chooser_combo.md) +* [tree_value_chooser_combo](components/tree_value_chooser_combo.md) +* [tree_value_chooser_pane](components/tree_value_chooser_pane.md) +* addons + * sliders + * [single_slider](detailed/single_slider.md) diff --git a/docs/_book/.gitignore b/docs/_book/.gitignore deleted file mode 100644 index 680a9dfb3..000000000 --- a/docs/_book/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -.DS_Store -.svn -.sass-cache -.vscode -.tmp -node_modules -bower_components -tmp -dist -archive -archive.zip -*.log -#_book -test \ No newline at end of file diff --git a/docs/_book/COURSE.html b/docs/_book/COURSE.html deleted file mode 100644 index 44721cc01..000000000 --- a/docs/_book/COURSE.html +++ /dev/null @@ -1,2530 +0,0 @@ - - - - - - - 高级教程 · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - -
- -
- -
- - - - - - - - -
-
- -
-
- -
- -

高级开发教程

-

KMS: http://www.finedevelop.com/pages/viewpage.action?pageId=15330077

- - -
- -
-
-
- -

results matching ""

-
    - -
    -
    - -

    No results matching ""

    - -
    -
    -
    - -
    -
    - -
    - - - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/LICENSE b/docs/_book/LICENSE deleted file mode 100644 index 8fdf076ab..000000000 --- a/docs/_book/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 gittz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/docs/_book/OVERVIEW.html b/docs/_book/OVERVIEW.html deleted file mode 100644 index 3c4381a6c..000000000 --- a/docs/_book/OVERVIEW.html +++ /dev/null @@ -1,2533 +0,0 @@ - - - - - - - 通用规范 · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - -
    - -
    - - - - - - - - -
    -
    - -
    -
    - -
    - -

    通用规范

    -
      -
    1. 控件都会提供setValue, getValue, populate这几个方法来设置值,获取值(展示类控件除外)和刷新控件
    2. -
    3. 控件都会提供setEnable, setVisible, setValid这几个方法来设置使能,是否可见,是否有效状态,并且在fineui2.0之后,会自动给子组件设置同样的状态,不要重写这些方法,一些需要在设置状态时的额外操作可以通过重写_setXXX来实现
    4. -
    5. 使用populate来清空或者重置布局,不要使用empty, 慎用resize
    6. -
    7. 谨慎监听和触发BI.Controller.EVENT_CHANGE事件,一般来说,控件都会有一个BI.ClassName.EVENT_CHANGE事件,一些特殊的事件会在对应控件文档中列出
    8. -
    - - -
    - -
    -
    -
    - -

    results matching ""

    -
      - -
      -
      - -

      No results matching ""

      - -
      -
      -
      - -
      -
      - -
      - - - - -
      - - -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/START.html b/docs/_book/START.html deleted file mode 100644 index 314715eb0..000000000 --- a/docs/_book/START.html +++ /dev/null @@ -1,2561 +0,0 @@ - - - - - - - 起步 · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      -
      - - - - - - - - -
      - -
      - -
      - - - - - - - - -
      -
      - -
      -
      - -
      - -

      第一个demo

      -
      <html>
      -    <head>
      -          <meta charset="utf-8">
      -          <title></title>
      -          <link rel="stylesheet" type="text/css" href="https://fanruan.coding.me/fineui/dist/bundle.min.css" />
      -          <script src="https://coding.net/u/fanruan/p/fineui/git/raw/master/dist/bundle.min.js"></script>
      -    </head>
      -    <body>
      -          <script>
      -            $(function(){
      -                BI.createWidget({
      -                    type:"bi.absolute",
      -                    element: "body",
      -                    items: [{
      -                        el:{
      -                            type: "bi.button",
      -                            text: "这是一个按钮"
      -                        },
      -                        left: 100,
      -                        top: 100
      -                    }]
      -                })
      -            })
      -          </script>
      -    </body>
      -</html>
      -
      -

      源码集成配置

      -

      http://www.finedevelop.com/pages/viewpage.action?pageId=16056735

      -

      源码集成Demo

      -

      BI的组件就是集成的fineui进行开发的 -https://coding.net/u/fanruan/p/bi-components/

      - - -
      - -
      -
      -
      - -

      results matching ""

      -
        - -
        -
        - -

        No results matching ""

        - -
        -
        -
        - -
        -
        - -
        - - - - -
        - - -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/bubble.html b/docs/_book/base/bubble.html deleted file mode 100644 index f00ad2a05..000000000 --- a/docs/_book/base/bubble.html +++ /dev/null @@ -1,2596 +0,0 @@ - - - - - - - bubble · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        -
        - - - - - - - - -
        - -
        - -
        - - - - - - - - -
        -
        - -
        -
        - -
        - -

        bi.bubble

        -

        气泡提示

        -
        
        -BI.createWidget({
        -  type: 'bi.bubble',
        -  element: "#wrapper",
        -  height: 30,
        -  text: "测试"
        -})
        -
        -
        - - -

        API

        -
        基础属性
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        参数说明类型可选值默认值
        direction气泡显示位置string"top"
        height气泡高度number35
        text气泡显示内容string" "
        -

        对外方法

        - - - - - - - - - - - - - - - -
        名称说明回调参数
        setText设置文本值需要设置的文本值text
        -
        - - -
        - -
        -
        -
        - -

        results matching ""

        -
          - -
          -
          - -

          No results matching ""

          - -
          -
          -
          - -
          -
          - -
          - - - - -
          - - -
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/bubble.md b/docs/_book/base/bubble.md deleted file mode 100644 index bd138066d..000000000 --- a/docs/_book/base/bubble.md +++ /dev/null @@ -1,40 +0,0 @@ -# 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| - - ---- \ No newline at end of file diff --git a/docs/_book/base/button/button.html b/docs/_book/base/button/button.html deleted file mode 100644 index b0a100ecd..000000000 --- a/docs/_book/base/button/button.html +++ /dev/null @@ -1,2769 +0,0 @@ - - - - - - - button · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          -
          - - - - - - - - -
          - -
          - -
          - - - - - - - - -
          -
          - -
          -
          - -
          - -

          bi.button

          -

          文字类型的按钮,基类BI.BasicButton

          -
          
          -BI.createWidget({
          -  type: 'bi.button',
          -  element: "#wrapper",
          -  text: '一般按钮',
          -  level: 'common',
          -  height: 30
          -});
          -
          -
          - -

          API

          -
          基础属性
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          参数说明类型可选值默认值
          hgap效果相当于文本框左右padding值,如果clear属性为true,该属性值置0number10
          vgap效果相当于文本框上下padding值number0
          lgap效果相当于文本框left-padding值number0
          rgap效果相当于文本框right-padding值number0
          tgap效果相当于文本框top-padding值number0
          bgap效果相当于文本框bottom-padding值number0
          width宽度number
          height高度number
          -
          高级属性
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          参数说明类型可选值默认值
          level按钮类型stringcommon,success,warning,ignorecommon
          minWidth最小宽度,如果block/clear中某一项为true,此项值为0,否则为90number90
          shadow是否显示阴影booleantrue,falseprops.clear !== true
          isShadowShowingOnSelected选中状态下是否显示阴影booleantrue,falsetrue
          readonly是否只读booleantrue,falsetrue
          iconClass图标类型string" "
          block是否块状显示,即不显示边框,没有最小宽度的限制booleantrue,falsefalse
          clear是否去掉边框和背景booleantrue,falsefalse
          textAlign文字布局stringleft,center,rightcneter
          whiteSpace元素内的空白处理方式stringnormal,nowrapnowrap
          forceCenter是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效booleantrue,falsefalse
          textWidth按钮文本宽度numbernull
          textHeight按钮文本高度numbernull
          -

          对外方法

          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          名称说明回调参数
          doRedMark文本标红
          unRedMark取消文本标红
          doHighLight文本高亮
          unHighLight取消文本高亮
          setText设置文本值需要设置的文本值text
          doClick点击事件
          destroy销毁事件
          setValue设置文本值需要设置的文本值text
          -
          - - -
          - -
          -
          -
          - -

          results matching ""

          -
            - -
            -
            - -

            No results matching ""

            - -
            -
            -
            - -
            -
            - -
            - - - - -
            - - -
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/button/button.md b/docs/_book/base/button/button.md deleted file mode 100644 index 71ba24040..000000000 --- a/docs/_book/base/button/button.md +++ /dev/null @@ -1,69 +0,0 @@ -# bi.button - -## 文字类型的按钮,基类[BI.BasicButton](/core/basicButton.md) - -{% method %} -[source](https://jsfiddle.net/fineui/txqwwzLm/) - -{% common %} -```javascript - -BI.createWidget({ - type: 'bi.button', - element: "#wrapper", - text: '一般按钮', - level: 'common', - height: 30 -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| hgap | 效果相当于文本框左右padding值,如果clear属性为true,该属性值置0 | number | — | 10 | -| vgap | 效果相当于文本框上下padding值 | number | — | 0 | -| lgap | 效果相当于文本框left-padding值 | number | — | 0 | -| rgap | 效果相当于文本框right-padding值 | number | — | 0 | -| tgap |效果相当于文本框top-padding值 | number | — | 0 | -| bgap | 效果相当于文本框bottom-padding值 | number | — | 0 | -| width | 宽度 | number | — | — | -| height | 高度 | number | — | — | - - -##### 高级属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| level |按钮类型 | string| common,success,warning,ignore | common | -| minWidth | 最小宽度,如果block/clear中某一项为true,此项值为0,否则为90 | number | — | 90 | -| shadow | 是否显示阴影 | boolean| true,false | props.clear !== true | -| isShadowShowingOnSelected|选中状态下是否显示阴影 | boolean| true,false | true | -| readonly | 是否只读 | boolean | true,false | true | -| iconClass | 图标类型 | string| — | " "| -| block| 是否块状显示,即不显示边框,没有最小宽度的限制 | boolean| true,false | false | -| clear| 是否去掉边框和背景 |boolean| true,false | false | -| textAlign | 文字布局 | string | left,center,right | cneter | -| whiteSpace | 元素内的空白处理方式 | string | normal,nowrap | nowrap| -| forceCenter | 是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效 | boolean | true,false | false | -| textWidth| 按钮文本宽度 | number| — | null | -| textHeight | 按钮文本高度 | number| — | null | - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| doRedMark | 文本标红 | — | -| unRedMark | 取消文本标红| —| -| doHighLight | 文本高亮 | —| -| unHighLight | 取消文本高亮 | —| -| setText| 设置文本值 | 需要设置的文本值text| -| doClick | 点击事件 | —| -| destroy | 销毁事件 |— | -| setValue | 设置文本值 | 需要设置的文本值text | - ---- - - diff --git a/docs/_book/base/button/icon_button.html b/docs/_book/base/button/icon_button.html deleted file mode 100644 index d8f619bd7..000000000 --- a/docs/_book/base/button/icon_button.html +++ /dev/null @@ -1,2588 +0,0 @@ - - - - - - - icon_button · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            -
            - - - - - - - - -
            - -
            - -
            - - - - - - - - -
            -
            - -
            -
            - -
            - -

            bi.icon_button

            -

            图标button,基类BI.BasicButton

            -
            
            -BI.createWidget({
            -    type: 'bi.icon_button',
            -    cls: "close-ha-font",
            -    width: 20,
            -    height: 20
            -});
            -
            -
            - -

            API

            -
            基础属性
            - - - - - - - - - - - - - - - - - - - - - - - - - - -
            参数说明类型可选值默认值
            iconWidth图标宽度numbernull
            iconHeight图标高度numbernull
            -

            对外方法

            - - - - - - - - - - - - - - - -
            名称说明回调参数
            doClick点击事件
            -
            - - -
            - -
            -
            -
            - -

            results matching ""

            -
              - -
              -
              - -

              No results matching ""

              - -
              -
              -
              - -
              -
              - -
              - - - - -
              - - -
              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/button/icon_button.md b/docs/_book/base/button/icon_button.md deleted file mode 100644 index e98fd0821..000000000 --- a/docs/_book/base/button/icon_button.md +++ /dev/null @@ -1,39 +0,0 @@ -# bi.icon_button - -## 图标button,基类[BI.BasicButton](/core/basicButton.md) - -{% method %} -[source](https://jsfiddle.net/fineui/g52u14ay/) - -{% common %} -```javascript - -BI.createWidget({ - type: 'bi.icon_button', - cls: "close-ha-font", - width: 20, - height: 20 -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| iconWidth | 图标宽度 | number| — | null | -| iconHeight | 图标高度 | number| — | null | - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| doClick | 点击事件 | —| - - ---- - - diff --git a/docs/_book/base/button/image_button.html b/docs/_book/base/button/image_button.html deleted file mode 100644 index 22d19b642..000000000 --- a/docs/_book/base/button/image_button.html +++ /dev/null @@ -1,2633 +0,0 @@ - - - - - - - image_button · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
              -
              - - - - - - - - -
              - -
              - -
              - - - - - - - - -
              -
              - -
              -
              - -
              - -

              bi.image_button

              -

              图片的button,基类BI.BasicButton

              -
              
              -BI.createWidget({
              -  type: 'bi.image_button',
              -  src: "http://www.easyicon.net/api/resizeApi.php?id=1206741&size=128",
              -  width: 100,
              -  height: 100
              -});
              -
              -
              - -

              API

              -
              基础属性
              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
              参数说明类型可选值默认值
              src图片路径string" "
              iconWidth图标宽度number/string"100%"
              iconHeight图标高度number/string"100%"
              -

              对外方法

              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
              名称说明回调参数
              doClick点击事件
              setWidth设置按钮宽度宽度width
              setHeight设置按钮高度高度height
              setImageWidth设置图片宽度宽度width
              setImageHeight设置图片高度高度height
              getImageWidth获取图片宽度
              getImageHeight获取图片高度
              setSrc设置图片路径src
              getSrc获取图片路径
              -
              - - -
              - -
              -
              -
              - -

              results matching ""

              -
                - -
                -
                - -

                No results matching ""

                - -
                -
                -
                - -
                -
                - -
                - - - - -
                - - -
                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/button/image_button.md b/docs/_book/base/button/image_button.md deleted file mode 100644 index e30b66be4..000000000 --- a/docs/_book/base/button/image_button.md +++ /dev/null @@ -1,49 +0,0 @@ -# bi.image_button - -## 图片的button,基类[BI.BasicButton](/core/basicButton.md) - -{% method %} -[source](https://jsfiddle.net/fineui/yc0g9gLw/) - -{% common %} -```javascript - -BI.createWidget({ - type: 'bi.image_button', - src: "http://www.easyicon.net/api/resizeApi.php?id=1206741&size=128", - width: 100, - height: 100 -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| src |图片路径 |string | —|" " | -| iconWidth | 图标宽度 | number/string| — | "100%" | -| iconHeight | 图标高度 | number/string | — | "100%"| - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| doClick | 点击事件 | —| -| setWidth | 设置按钮宽度| 宽度width | -| setHeight | 设置按钮高度 | 高度height| -| setImageWidth | 设置图片宽度| 宽度width | -| setImageHeight| 设置图片高度| 高度height| -| getImageWidth | 获取图片宽度| —| -| getImageHeight | 获取图片高度| —| -| setSrc| 设置图片路径| src | -| getSrc |获取图片路径| — | - - - ---- - - diff --git a/docs/_book/base/button/text_button.html b/docs/_book/base/button/text_button.html deleted file mode 100644 index a36630bf3..000000000 --- a/docs/_book/base/button/text_button.html +++ /dev/null @@ -1,2692 +0,0 @@ - - - - - - - text_button · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                -
                - - - - - - - - -
                - -
                - -
                - - - - - - - - -
                -
                - -
                -
                - -
                - -

                bi.text_button

                -

                可以点击的一行文字,基类BI.BasicButton

                -
                
                -BI.createWidget({
                - type: 'bi.text_button',
                - text: '文字按钮',
                - height: 30
                -});
                -
                -
                - -

                API

                -
                基础属性
                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                参数说明类型可选值默认值
                hgap效果相当于文本框左右padding值,如果clear属性为true,该属性值置0number10
                lgap效果相当于文本框left-padding值number0
                rgap效果相当于文本框right-padding值number0
                text按钮文本内容string
                textWidth按钮文本宽度numbernull
                textHeight按钮文本高度numbernull
                -
                高级属性
                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                参数说明类型可选值默认值
                py拼音string" "
                textAlign文字布局stringleft,center,rightcneter
                whiteSpace元素内的空白处理方式stringnormal,nowrapnowrap
                forceCenter是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效booleantrue,falsefalse
                -

                对外方法

                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                名称说明回调参数
                doRedMark文本标红
                unRedMark取消文本标红
                doHighLight文本高亮
                unHighLight取消文本高亮
                setText设置文本值需要设置的文本值text
                doClick点击事件
                setValue设置文本值需要设置的文本值text
                setStyle设置文本样式需要设置的文本标签样式,例{"color":"#000"}
                -
                - - -
                - -
                -
                -
                - -

                results matching ""

                -
                  - -
                  -
                  - -

                  No results matching ""

                  - -
                  -
                  -
                  - -
                  -
                  - -
                  - - - - -
                  - - -
                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/button/text_button.md b/docs/_book/base/button/text_button.md deleted file mode 100644 index 6686420a8..000000000 --- a/docs/_book/base/button/text_button.md +++ /dev/null @@ -1,58 +0,0 @@ -# bi.text_button - -## 可以点击的一行文字,基类[BI.BasicButton](/core/basicButton.md) - -{% method %} -[source](https://jsfiddle.net/fineui/5p99L39q/) - -{% common %} -```javascript - -BI.createWidget({ - type: 'bi.text_button', - text: '文字按钮', - height: 30 -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| hgap | 效果相当于文本框左右padding值,如果clear属性为true,该属性值置0 | number | — | 10 | -| lgap | 效果相当于文本框left-padding值 | number | — | 0 | -| rgap | 效果相当于文本框right-padding值 | number | — | 0 | -| text|按钮文本内容 | string| — | — | -| textWidth| 按钮文本宽度 | number| — | null | -| textHeight | 按钮文本高度 | number| — | null | - - -##### 高级属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| py | 拼音 | string| | " " | -| textAlign | 文字布局 | string | left,center,right | cneter | -| whiteSpace | 元素内的空白处理方式 | string | normal,nowrap | nowrap| -| forceCenter | 是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效 | boolean | true,false | false | - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| doRedMark | 文本标红 | — | -| unRedMark | 取消文本标红| —| -| doHighLight | 文本高亮 | —| -| unHighLight | 取消文本高亮 | —| -| setText| 设置文本值 | 需要设置的文本值text| -| doClick | 点击事件 | —| -| setValue | 设置文本值 | 需要设置的文本值text | -| setStyle | 设置文本样式 |需要设置的文本标签样式,例{"color":"#000"} | - - ---- - - diff --git a/docs/_book/base/canvas.html b/docs/_book/base/canvas.html deleted file mode 100644 index e6345cd44..000000000 --- a/docs/_book/base/canvas.html +++ /dev/null @@ -1,2595 +0,0 @@ - - - - - - - canvas · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                  -
                  - - - - - - - - -
                  - -
                  - -
                  - - - - - - - - -
                  -
                  - -
                  -
                  - -
                  - -

                  bi.canvas

                  -

                  canvas绘图,基类BI.Widget

                  -
                  
                  -var canvas = BI.createWidget({
                  -   type: "bi.canvas",
                  -   element: "#wrapper",
                  -   width: 500,
                  -   height: 600
                  -});
                  -canvas.circle(150, 50, 20, "green");
                  -canvas.stroke();
                  -
                  -
                  - - -

                  对外方法

                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                  名称说明回调参数
                  line绘制线段(x0, y0, x1, y1)
                  rect绘制矩形(x,y,w,h,color)分别表示左上角的横坐标、纵坐标,矩形宽、高、以及绘制的颜色
                  circle绘制圆形(x, y, radius, color)分别表示原点的横坐标,纵坐标,半径以及颜色
                  hollow填充中空的路径
                  solid填充实心的路径
                  gradient绘制渐变色(x0, y0, x1, y1, start, end)
                  reset重置画布
                  stroke绘制callback
                  -
                  - - -
                  - -
                  -
                  -
                  - -

                  results matching ""

                  -
                    - -
                    -
                    - -

                    No results matching ""

                    - -
                    -
                    -
                    - -
                    -
                    - -
                    - - - - -
                    - - -
                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/canvas.md b/docs/_book/base/canvas.md deleted file mode 100644 index 7c08f96af..000000000 --- a/docs/_book/base/canvas.md +++ /dev/null @@ -1,40 +0,0 @@ -# bi.canvas - -## canvas绘图,基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/gcgd1va0/) - -{% common %} -```javascript - -var canvas = BI.createWidget({ - type: "bi.canvas", - element: "#wrapper", - width: 500, - height: 600 -}); -canvas.circle(150, 50, 20, "green"); -canvas.stroke(); - - -``` - -{% endmethod %} - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| line | 绘制线段| (x0, y0, x1, y1) | -| rect | 绘制矩形 | (x,y,w,h,color)分别表示左上角的横坐标、纵坐标,矩形宽、高、以及绘制的颜色| -| circle | 绘制圆形 | (x, y, radius, color)分别表示原点的横坐标,纵坐标,半径以及颜色 | -| hollow | 填充中空的路径 | — | -| solid | 填充实心的路径 | — | -| gradient | 绘制渐变色 | (x0, y0, x1, y1, start, end) | -| reset | 重置画布 | —| -| stroke | 绘制 | callback | - ---- - - diff --git a/docs/_book/base/editor/code_editor.html b/docs/_book/base/editor/code_editor.html deleted file mode 100644 index 0d174918d..000000000 --- a/docs/_book/base/editor/code_editor.html +++ /dev/null @@ -1,2649 +0,0 @@ - - - - - - - code_editor · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                    -
                    - - - - - - - - -
                    - -
                    - -
                    - - - - - - - - -
                    -
                    - -
                    -
                    - -
                    - -

                    bi.code_editor

                    -

                    代码文本框,基类BI.Single

                    -
                    
                    -BI.createWidget({
                    -   type: "bi.code_editor",
                    -   cls: "mvc-border",
                    -   width: 600,
                    -   height: 400
                    -});
                    -
                    -
                    - -

                    API

                    -
                    基础属性
                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                    参数说明类型可选值默认值
                    watermark文本框placeholderstring" "
                    readOnly是否只读booleantrue,falsefalse
                    lineHeight行高number2
                    value文本框值string" "
                    paramFormatter参数显示值构造函数functionvalue
                    -

                    对外方法

                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                    名称说明回调参数
                    insertParam插入参数param
                    insertString插入字符串str
                    getValue获取文本框值
                    setValue设置文本框值value
                    focus文本框获取焦点
                    blur文本框失焦
                    setStyle设置文本样式需要设置的文本标签样式style,例{"color":"#000"}
                    getStyle获取文本样式
                    refresh刷新文本框
                    -
                    - - -
                    - -
                    -
                    -
                    - -

                    results matching ""

                    -
                      - -
                      -
                      - -

                      No results matching ""

                      - -
                      -
                      -
                      - -
                      -
                      - -
                      - - - - -
                      - - -
                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/editor/code_editor.md b/docs/_book/base/editor/code_editor.md deleted file mode 100644 index 9a17529e1..000000000 --- a/docs/_book/base/editor/code_editor.md +++ /dev/null @@ -1,53 +0,0 @@ -# bi.code_editor - -## 代码文本框,基类[BI.Single](/core/single.md) - -{% method %} -[source](https://jsfiddle.net/fineui/fx86hLgm/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.code_editor", - cls: "mvc-border", - width: 600, - height: 400 -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| watermark | 文本框placeholder | string | — | " " | -| readOnly | 是否只读 | boolean | true,false | false| -| lineHeight | 行高 | number|— | 2| -| value | 文本框值| string| —| " "| -| paramFormatter| 参数显示值构造函数 | function| — | value | - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| insertParam | 插入参数 | param | -| insertString | 插入字符串 | str| -| getValue | 获取文本框值|—| -| setValue | 设置文本框值|value| -| focus | 文本框获取焦点| — | -| blur | 文本框失焦|—| -| setStyle | 设置文本样式 |需要设置的文本标签样式style,例{"color":"#000"} | -| getStyle | 获取文本样式 |— | -| refresh | 刷新文本框 | —| - - - - ---- - - diff --git a/docs/_book/base/editor/editor.html b/docs/_book/base/editor/editor.html deleted file mode 100644 index 2865cfe57..000000000 --- a/docs/_book/base/editor/editor.html +++ /dev/null @@ -1,2823 +0,0 @@ - - - - - - - editor · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      -
                      - - - - - - - - -
                      - -
                      - -
                      - - - - - - - - -
                      -
                      - -
                      -
                      - -
                      - -

                      bi.editor

                      -

                      文本框,基类BI.Single

                      -
                      
                      -BI.createWidget({
                      -    type: "bi.editor",
                      -    element: "#wrapper",
                      -    errorText: "字段不可重名!",
                      -    width: 200,
                      -    height: 30
                      -});
                      -
                      -
                      - -

                      API

                      -
                      基础属性
                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      参数说明类型可选值默认值
                      hgap效果相当于文本框左右padding值number4
                      vgap效果相当于文本框上下padding值number2
                      lgap效果相当于文本框left-padding值number0
                      rgap效果相当于文本框right-padding值number0
                      tgap效果相当于文本框top-padding值number0
                      bgap效果相当于文本框bottom-padding值number0
                      validationChecker输入较验函数function
                      quitChecker是否允许退出编辑函数function
                      allowBlank是否允许空值booleantrue,falsefalse
                      watermark文本框placeholderstring" "
                      errorText错误提示string/function" "
                      tipType提示类型stringsuccess,warning"warning"
                      inputType输入框类型string参考input输入框类型"text"
                      -

                      对外方法

                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      名称说明回调参数
                      setErrorText设置错误文本text
                      getErrorText获取错误文本
                      setErrorVisible设置错误文本可见b
                      disableError设置error不可用
                      enableError设置error可用
                      disableWaterMark设置文本框placeholder不可用
                      enableWaterMark恢复文本框placeholder可用
                      focus文本框获取焦点
                      blur文本框失焦
                      selectAll选中文本框文本
                      onKeyDown按键事件key
                      setValue设置文本框值value
                      getLastValidValue获取文本框最后一次输入的有效值
                      resetLastValidValue重置文本框最后一次输入的有效值value
                      getValue获取文本框值
                      isEditing文本框是否处于编辑状态
                      isValid文本框值是否有效
                      -

                      事件

                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      事件说明
                      BI.Editor.EVENT_CHANGEeditor的value发生改变触发
                      BI.Editor.EVENT_FOCUSfocus事件
                      BI.Editor.EVENT_BLURblur事件
                      BI.Editor.EVENT_CLICK点击编辑框触发(不在编辑状态时)
                      BI.Editor.EVENT_KEY_DOWNkeyDown时触发
                      BI.Editor.EVENT_SPACE按下空格触发
                      BI.Editor.EVENT_BACKSPACE按下Backspace触发
                      BI.Editor.EVENT_START开始输入触发
                      BI.Editor.EVENT_PAUSE暂停输入触发(输入空白字符)
                      BI.Editor.EVENT_STOP停止输入触发
                      BI.Editor.EVENT_CONFIRM确定输入触发(blur时且输入值有效)
                      BI.Editor.EVENT_VALID输入值有效的状态事件
                      BI.Editor.EVENT_ERROR输入值无效的状态事件
                      BI.Editor.EVENT_ENTER回车事件
                      BI.Editor.EVENT_RESTRICT回车但是值不合法
                      BI.Editor.EVENT_REMOVE输入为空时按下backspace
                      BI.Editor.EVENT_EMPTY输入框为空时触发
                      -
                      - - -
                      - -
                      -
                      -
                      - -

                      results matching ""

                      -
                        - -
                        -
                        - -

                        No results matching ""

                        - -
                        -
                        -
                        - -
                        -
                        - -
                        - - - - -
                        - - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/editor/editor.md b/docs/_book/base/editor/editor.md deleted file mode 100644 index 61be1f4d0..000000000 --- a/docs/_book/base/editor/editor.md +++ /dev/null @@ -1,89 +0,0 @@ -# bi.editor - -## 文本框,基类[BI.Single](/core/single.md) - -{% method %} -[source](https://jsfiddle.net/fineui/4eLytgve/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.editor", - element: "#wrapper", - errorText: "字段不可重名!", - width: 200, - height: 30 -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| hgap | 效果相当于文本框左右padding值 | number | — | 4 | -| vgap | 效果相当于文本框上下padding值 | number | — | 2 | -| lgap | 效果相当于文本框left-padding值 | number | — | 0 | -| rgap | 效果相当于文本框right-padding值 | number | — | 0 | -| tgap |效果相当于文本框top-padding值 | number | — | 0 | -| bgap | 效果相当于文本框bottom-padding值 | number | — | 0 | -| validationChecker | 输入较验函数 |function| — | — | -| quitChecker | 是否允许退出编辑函数 | function | — | — | -| allowBlank | 是否允许空值 | boolean | true,false | false | -| watermark | 文本框placeholder | string | — | " " | -| errorText | 错误提示 | string/function | —| " "| -| tipType| 提示类型 | string |success,warning | "warning"| -| inputType| 输入框类型| string| 参考input输入框类型 | "text"| - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setErrorText | 设置错误文本 | text | -| getErrorText | 获取错误文本 | —| -| setErrorVisible | 设置错误文本可见|b | -| disableError | 设置error不可用|— | -| enableError| 设置error可用| —| -| disableWaterMark | 设置文本框placeholder不可用| —| -| enableWaterMark | 恢复文本框placeholder可用| — | -| focus | 文本框获取焦点| — | -| blur | 文本框失焦|—| -| selectAll | 选中文本框文本| —| -| onKeyDown |按键事件|key| -| setValue | 设置文本框值|value| -| getLastValidValue | 获取文本框最后一次输入的有效值| —| -| resetLastValidValue| 重置文本框最后一次输入的有效值|value| -| getValue | 获取文本框值|—| -| isEditing | 文本框是否处于编辑状态|—| -| isValid | 文本框值是否有效|—| - -## 事件 -| 事件 | 说明 | -| :------ |:------------- | -|BI.Editor.EVENT_CHANGE | editor的value发生改变触发 | -|BI.Editor.EVENT_FOCUS | focus事件 | -|BI.Editor.EVENT_BLUR | blur事件 | -|BI.Editor.EVENT_CLICK | 点击编辑框触发(不在编辑状态时) | -|BI.Editor.EVENT_KEY_DOWN | keyDown时触发 | -|BI.Editor.EVENT_SPACE | 按下空格触发 | -|BI.Editor.EVENT_BACKSPACE | 按下Backspace触发 | -|BI.Editor.EVENT_START | 开始输入触发 | -|BI.Editor.EVENT_PAUSE | 暂停输入触发(输入空白字符) | -|BI.Editor.EVENT_STOP | 停止输入触发 | -|BI.Editor.EVENT_CONFIRM | 确定输入触发(blur时且输入值有效) | -|BI.Editor.EVENT_VALID | 输入值有效的状态事件 | -|BI.Editor.EVENT_ERROR | 输入值无效的状态事件 | -|BI.Editor.EVENT_ENTER | 回车事件 | -|BI.Editor.EVENT_RESTRICT | 回车但是值不合法 | -|BI.Editor.EVENT_REMOVE | 输入为空时按下backspace | -|BI.Editor.EVENT_EMPTY | 输入框为空时触发 | - - ---- - - diff --git a/docs/_book/base/editor/formula_editor.html b/docs/_book/base/editor/formula_editor.html deleted file mode 100644 index ce548d3f0..000000000 --- a/docs/_book/base/editor/formula_editor.html +++ /dev/null @@ -1,2674 +0,0 @@ - - - - - - - formula_editor · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - - - - - - - - -
                        - -
                        - -
                        - - - - - - - - -
                        -
                        - -
                        -
                        - -
                        - -

                        bi.formula_editor

                        -

                        公式编辑控件,基类BI.Single

                        -
                        
                        -BI.createWidget({
                        -  type: "bi.formula_editor",
                        -  cls: "bi-border",
                        -  watermark:'请输入公式',
                        -  value: 'SUM(C5, 16, 26)',
                        -  width: "100%",
                        -  height: "100%"
                        -});
                        -
                        -
                        - -

                        API

                        -
                        基础属性
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        参数说明类型可选值默认值
                        value文本域的值string" "
                        watermark文本框placeholderstring" "
                        fieldTextValueMap字段集合onject{}
                        showHint是否显示提示信息booleantrue,falsetrue
                        lineHeight行高number2
                        -

                        对外方法

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        名称说明回调参数
                        disableWaterMark设置文本框placeholder不可用
                        focus文本框获取焦点
                        insertField添加字段field
                        insertFunction插入函数fn
                        insertOperator插入操作符op
                        setFunction设置函数v
                        insertString插入字符串str
                        getFormulaString获取公式框内容
                        getUsedFields获取可用字段
                        getCheckString获取校验内容
                        getValue获取文本框值
                        setValue设置文本框值value
                        setFieldTextValueMap设置字段集合fieldTextValueMap
                        refresh刷新文本框
                        -
                        - - -
                        - -
                        -
                        -
                        - -

                        results matching ""

                        -
                          - -
                          -
                          - -

                          No results matching ""

                          - -
                          -
                          -
                          - -
                          -
                          - -
                          - - - - -
                          - - -
                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/editor/formula_editor.md b/docs/_book/base/editor/formula_editor.md deleted file mode 100644 index e44f77c32..000000000 --- a/docs/_book/base/editor/formula_editor.md +++ /dev/null @@ -1,59 +0,0 @@ -# bi.formula_editor - -## 公式编辑控件,基类[BI.Single](/core/single.md) - -{% method %} -[source](https://jsfiddle.net/fineui/qnquz4o0/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.formula_editor", - cls: "bi-border", - watermark:'请输入公式', - value: 'SUM(C5, 16, 26)', - width: "100%", - height: "100%" -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| value | 文本域的值 | string | — | " "| -| watermark | 文本框placeholder| string | —| " " | -| fieldTextValueMap | 字段集合 | onject | —| {}| -| showHint | 是否显示提示信息 | boolean | true,false | true | -| lineHeight | 行高 | number | —| 2| - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| disableWaterMark | 设置文本框placeholder不可用 | — | -| focus | 文本框获取焦点| — | -| insertField | 添加字段 | field | -| insertFunction | 插入函数 | fn | -| insertOperator | 插入操作符| op| -| setFunction | 设置函数 | v| -| insertString | 插入字符串 | str| -| getFormulaString | 获取公式框内容 |— | -| getUsedFields | 获取可用字段 | — | -| getCheckString | 获取校验内容 | — | -| getValue | 获取文本框值|—| -| setValue | 设置文本框值|value| -| setFieldTextValueMap | 设置字段集合 | fieldTextValueMap | -| refresh | 刷新文本框 | —| - - - ---- - - diff --git a/docs/_book/base/editor/multifile_editor.html b/docs/_book/base/editor/multifile_editor.html deleted file mode 100644 index ca5d4624a..000000000 --- a/docs/_book/base/editor/multifile_editor.html +++ /dev/null @@ -1,2639 +0,0 @@ - - - - - - - multifile_editor · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                          -
                          - - - - - - - - -
                          - -
                          - -
                          - - - - - - - - -
                          -
                          - -
                          -
                          - -
                          - -

                          bi.multifile_editor

                          -

                          多文件,基类BI.Single

                          -
                          
                          -BI.createWidget({
                          -   type: "bi.multifile_editor",
                          -   width: 400,
                          -   height: 300
                          -});
                          -
                          -
                          - -

                          API

                          -
                          基础属性
                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                          参数说明类型可选值默认值
                          multiple是否支持多选booleantrue,falsefalse
                          maxSize允许上传最大字节数number-1
                          accept允许上传的文件类型string" "
                          url文件路径string" "
                          -

                          对外方法

                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                          名称说明回调参数
                          select选择文件
                          getValue获取文件名称
                          upload文件上传
                          reset重置
                          -

                          事件

                          - - - - - - - - - - - - - - - - - - - - - -
                          事件说明
                          BI.MultifileEditor.EVENT_UPLOADSTART开始上传时触发
                          BI.MultifileEditor.EVENT_PROGRESS上传过程中触发
                          BI.MultifileEditor.EVENT_UPLOADED上传结束后触发
                          -
                          - - -
                          - -
                          -
                          -
                          - -

                          results matching ""

                          -
                            - -
                            -
                            - -

                            No results matching ""

                            - -
                            -
                            -
                            - -
                            -
                            - -
                            - - - - -
                            - - -
                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/editor/multifile_editor.md b/docs/_book/base/editor/multifile_editor.md deleted file mode 100644 index fd23da66e..000000000 --- a/docs/_book/base/editor/multifile_editor.md +++ /dev/null @@ -1,51 +0,0 @@ -# bi.multifile_editor - -## 多文件,基类[BI.Single](/core/single.md) - -{% method %} -[source](https://jsfiddle.net/fineui/25r3r5fq/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.multifile_editor", - width: 400, - height: 300 -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| multiple | 是否支持多选 | boolean | true,false| false | -| maxSize | 允许上传最大字节数 | number |— | -1 | -| accept | 允许上传的文件类型 | string | —| " "| -| url | 文件路径 | string | —| " "| - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| select | 选择文件 | —| -| getValue | 获取文件名称 | —| -| upload | 文件上传| —| -| reset | 重置| —| - -## 事件 -| 事件 | 说明 | -| :------ |:------------- | -|BI.MultifileEditor.EVENT_UPLOADSTART | 开始上传时触发 | -|BI.MultifileEditor.EVENT_PROGRESS | 上传过程中触发 | -|BI.MultifileEditor.EVENT_UPLOADED | 上传结束后触发 | - - ---- - - diff --git a/docs/_book/base/editor/textarea_editor.html b/docs/_book/base/editor/textarea_editor.html deleted file mode 100644 index d683a6f14..000000000 --- a/docs/_book/base/editor/textarea_editor.html +++ /dev/null @@ -1,2605 +0,0 @@ - - - - - - - textarea_editor · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                            -
                            - - - - - - - - -
                            - -
                            - -
                            - - - - - - - - -
                            -
                            - -
                            -
                            - -
                            - -

                            bi.textarea_editor

                            -

                            文本域,基类BI.Single

                            -
                            
                            -BI.createWidget({
                            -   type: "bi.textarea_editor",
                            -   width: 400,
                            -   height: 300
                            -});
                            -
                            -
                            - -

                            API

                            -
                            基础属性
                            - - - - - - - - - - - - - - - - - - - -
                            参数说明类型可选值默认值
                            value文本域的值string" "
                            -

                            对外方法

                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                            名称说明回调参数
                            getValue获取文本域值
                            setValue设置文本域值value
                            setStyle设置文本域样式需要设置的文本域样式style,例{"color":"#000"}
                            getStyle获取文本域样式
                            focus文本域获取焦点
                            blur文本域失焦
                            -
                            - - -
                            - -
                            -
                            -
                            - -

                            results matching ""

                            -
                              - -
                              -
                              - -

                              No results matching ""

                              - -
                              -
                              -
                              - -
                              -
                              - -
                              - - - - -
                              - - -
                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/editor/textarea_editor.md b/docs/_book/base/editor/textarea_editor.md deleted file mode 100644 index a22005163..000000000 --- a/docs/_book/base/editor/textarea_editor.md +++ /dev/null @@ -1,45 +0,0 @@ -# bi.textarea_editor - -## 文本域,基类[BI.Single](/core/single.md) - -{% method %} -[source](https://jsfiddle.net/fineui/90721e0a/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.textarea_editor", - width: 400, - height: 300 -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| value | 文本域的值 | string | — | " "| - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| getValue | 获取文本域值|—| -| setValue | 设置文本域值|value| -| setStyle | 设置文本域样式 |需要设置的文本域样式style,例{"color":"#000"} | -| getStyle | 获取文本域样式 |— | -| focus | 文本域获取焦点| — | -| blur | 文本域失焦|—| - - - - ---- - - diff --git a/docs/_book/base/label.html b/docs/_book/base/label.html deleted file mode 100644 index 1b5c7cdf6..000000000 --- a/docs/_book/base/label.html +++ /dev/null @@ -1,2743 +0,0 @@ - - - - - - - label · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              -
                              - - - - - - - - -
                              - -
                              - -
                              - - - - - - - - -
                              -
                              - -
                              -
                              - -
                              - -

                              bi.label

                              -

                              文本标签

                              -
                              
                              -BI.createWidget({
                              -  type: "bi.label",
                              -    textWidth: 100,
                              -    textHeight: 30,
                              -    text: "基本标签"
                              -});
                              -
                              -
                              - - -

                              API

                              -
                              基础属性
                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              参数说明类型可选值默认值
                              hgap效果相当于容器左右padding值number0
                              vgap效果相当于容器上下padding值number0
                              lgap效果相当于容器left-padding值number0
                              rgap效果相当于容器right-padding值number0
                              tgap效果相当于容器top-padding值number0
                              bgap效果相当于容器bottom-padding值number0
                              textWidth文本标签宽度numbernull
                              textHeight文本标签宽度numbernull
                              text文本内容string" "
                              -
                              高级属性
                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              参数说明类型可选值默认值
                              textAlign文本对齐方式stringleft,center,rightcenter
                              whiteSpace元素内空白处理方式stringnormal,nowrapnowrap
                              forceCenter是否无论如何都要居中, 不考虑超出边界的情况, 在未知宽度和高度时有效booleantrue,falsetrue
                              py拼音string
                              keyword设置标红的关键词string
                              disabled灰化booleantrue,false
                              title提示titlestring
                              warningTitle错误提示titlestring
                              -

                              对外方法

                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              名称说明回调参数
                              doRedMark文本标红
                              unRedMark取消文本标红
                              doHighLight文本高亮
                              unHighLight取消文本高亮
                              setText设置文本值需要设置的文本值text
                              getText获取文本值
                              setStyle设置文本样式需要设置的文本标签样式,例{"color":"#000"}
                              setValue设置文本值需要设置的文本值text
                              -
                              - - -
                              - -
                              -
                              -
                              - -

                              results matching ""

                              -
                                - -
                                -
                                - -

                                No results matching ""

                                - -
                                -
                                -
                                - -
                                -
                                - -
                                - - - - -
                                - - -
                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/label.md b/docs/_book/base/label.md deleted file mode 100644 index 6a3b3c853..000000000 --- a/docs/_book/base/label.md +++ /dev/null @@ -1,66 +0,0 @@ -# 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 | - - ---- \ No newline at end of file diff --git a/docs/_book/base/message.html b/docs/_book/base/message.html deleted file mode 100644 index 789fcef5e..000000000 --- a/docs/_book/base/message.html +++ /dev/null @@ -1,2578 +0,0 @@ - - - - - - - message · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                -
                                - - - - - - - - -
                                - -
                                - -
                                - - - - - - - - -
                                -
                                - -
                                -
                                - -
                                - -

                                bi.Msg

                                -

                                消息提示

                                -
                                
                                -BI.createWidget({
                                -  type: "bi.button",
                                -  element: "#wrapper",
                                -  text : '点击我弹出一个消息框',
                                -  height : 30,
                                -  handler : function() {
                                -      BI.Msg.confirm('测试消息框',"我是测试消息框的内容");
                                -  }
                                -});
                                -
                                -
                                - - - - -

                                对外方法

                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                名称说明回调参数
                                alert警告消息框title, message, callback
                                confirm确认消息框title, message, callback
                                prompt提示消息框title, message, value, callback, min_width
                                toasttoast提示message, level, context
                                -
                                - - -
                                - -
                                -
                                -
                                - -

                                results matching ""

                                -
                                  - -
                                  -
                                  - -

                                  No results matching ""

                                  - -
                                  -
                                  -
                                  - -
                                  -
                                  - -
                                  - - - - -
                                  - - -
                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/message.md b/docs/_book/base/message.md deleted file mode 100644 index ae2532e23..000000000 --- a/docs/_book/base/message.md +++ /dev/null @@ -1,39 +0,0 @@ -# bi.Msg - -#### 消息提示 - -{% method %} -[source](https://jsfiddle.net/fineui/feu8kf4u/) - -{% 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| - - ---- diff --git a/docs/_book/base/pager.html b/docs/_book/base/pager.html deleted file mode 100644 index aff136177..000000000 --- a/docs/_book/base/pager.html +++ /dev/null @@ -1,2732 +0,0 @@ - - - - - - - pager · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                  -
                                  - - - - - - - - -
                                  - -
                                  - -
                                  - - - - - - - - -
                                  -
                                  - -
                                  -
                                  - -
                                  - -

                                  bi.pager

                                  -

                                  分页控件,基类BI.Widget

                                  -
                                  
                                  -BI.createWidget({
                                  -  type: "bi.pager",
                                  -  height: 50,
                                  -  pages: 18,
                                  -  groups: 5,
                                  -  curr: 6,
                                  -  first: "首页",
                                  -  last: "尾页"
                                  -});
                                  -
                                  -
                                  - -

                                  API

                                  -
                                  基础属性
                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                  参数说明类型可选值默认值
                                  dynamicShow是否动态显示上一页、下一页、首页、尾页, 若为false,则指对其设置使能状态booleantrue,falsetrue
                                  dynamicShowFirstLast是否动态显示首页、尾页,dynamicShow为false时生效booleantrue,falsefalse
                                  dynamicShowPrevNext是否动态显示上一页、下一页,dynamicShow为false时生效booleantrue,falsefalse
                                  pages是否显示总页数boolean/numberfalse,numberfalse
                                  curr初始化当前页functionfunction(){return 1;}
                                  groups连续显示分页数number0
                                  jump页数跳转function
                                  first是否显示首页booleantrue,falsefalse
                                  last是否显示尾页booleantrue,falsefalse
                                  prev上一页string,object —"上一页"
                                  next下一页sting,object"下一页"
                                  firstPage第一页number1
                                  lastPage最后一页,在万不得已时才会调用这个函数获取最后一页的页码, 主要作用于setValue方法functionfunction(){ return 1;}
                                  hasPrev判断是否有上一页,pages不可用时有效function
                                  hasNext判断是否有下一页,pages不可用时有效function
                                  -

                                  对外方法

                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                  名称说明回调参数
                                  getCurrentPage获取当前页码
                                  setAllPages设置总页数pages
                                  hasPrev判断是否有上一页v
                                  hasNext判断是否有下一页v
                                  setValue设置当前页码v
                                  getValue获取当前页码
                                  attr设置属性key,value
                                  populate刷新或者清空列表
                                  -

                                  事件

                                  - - - - - - - - - - - - - -
                                  名称说明
                                  BI.Pager.EVENT_AFTER_POPULATEpager刷新完成事件
                                  -
                                  - - -
                                  - -
                                  -
                                  -
                                  - -

                                  results matching ""

                                  -
                                    - -
                                    -
                                    - -

                                    No results matching ""

                                    - -
                                    -
                                    -
                                    - -
                                    -
                                    - -
                                    - - - - -
                                    - - -
                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/pager.md b/docs/_book/base/pager.md deleted file mode 100644 index 824cd62a4..000000000 --- a/docs/_book/base/pager.md +++ /dev/null @@ -1,66 +0,0 @@ -# bi.pager - -## 分页控件,基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/rhhte9b3/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.pager", - height: 50, - pages: 18, - groups: 5, - curr: 6, - first: "首页", - last: "尾页" -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| dynamicShow | 是否动态显示上一页、下一页、首页、尾页, 若为false,则指对其设置使能状态 | boolean| true,false | true| -| dynamicShowFirstLast | 是否动态显示首页、尾页,dynamicShow为false时生效| boolean| true,false | false | -| dynamicShowPrevNext | 是否动态显示上一页、下一页,dynamicShow为false时生效 | boolean| true,false | false| -| pages | 是否显示总页数 | boolean/number| false,number|false| -| curr | 初始化当前页 | function | —| function(){return 1;}| -| groups | 连续显示分页数 | number | — | 0 | -| jump | 页数跳转| function |— | —| -| first | 是否显示首页 | boolean | true,false| false| -| last | 是否显示尾页 | boolean | true,false| false| -| prev | 上一页 | string,object —| — |"上一页" | -| next | 下一页 | sting,object| —| "下一页" | -| firstPage | 第一页 | number|— | 1 | -| lastPage | 最后一页,在万不得已时才会调用这个函数获取最后一页的页码, 主要作用于setValue方法 | function | —| function(){ return 1;}| -| hasPrev | 判断是否有上一页,pages不可用时有效 | function | —| — | -| hasNext | 判断是否有下一页,pages不可用时有效 | function |— | — | - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| getCurrentPage | 获取当前页码 | —| -| setAllPages | 设置总页数 | pages | -| hasPrev | 判断是否有上一页 | v | -| hasNext | 判断是否有下一页 | v | -| setValue | 设置当前页码 | v | -| getValue | 获取当前页码 | —| -| attr | 设置属性 | key,value | -| populate | 刷新或者清空列表| —| - -## 事件 -| 名称 | 说明 | -| :------ |:------------- | -| BI.Pager.EVENT_AFTER_POPULATE | pager刷新完成事件 | - ---- - - diff --git a/docs/_book/base/svg.html b/docs/_book/base/svg.html deleted file mode 100644 index ea0420e59..000000000 --- a/docs/_book/base/svg.html +++ /dev/null @@ -1,2652 +0,0 @@ - - - - - - - svg · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                    -
                                    - - - - - - - - -
                                    - -
                                    - -
                                    - - - - - - - - -
                                    -
                                    - -
                                    -
                                    - -
                                    - -

                                    bi.svg

                                    -

                                    svg绘图,基类BI.Widget

                                    -
                                    
                                    -var svg = BI.createWidget({
                                    -    type: "bi.svg",
                                    -    width: 500,
                                    -    height: 600
                                    -});
                                    -
                                    -svg.path("M10,10L50,50M50,10L10,50")
                                    -    .attr({stroke: "red"});
                                    -
                                    -
                                    - - -

                                    对外方法

                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                    名称说明回调参数
                                    add添加对象到json数组json
                                    path绘制路径pathString
                                    image绘制图片(src,x,y,w,h)分别表示图片路径,绘制的原点横、纵坐标,宽、高
                                    rect绘制矩形(x,y,w,h,r)分别表示左上角的横坐标、纵坐标,矩形宽、高、以及矩形的圆角border-radius大小
                                    circle绘制圆形(x,y,r)分别表示原点的横坐标,纵坐标,以及半径
                                    ellipse绘制椭圆(x,y,rx,ry)分别表示原点的横、纵坐标,以及水平半径和垂直半径
                                    text绘制文本(x,y,text)分别表示绘制的原点横、纵坐标以及要绘制的文本内容
                                    print根据制定参数打印出路径(x, y, string, font, size, origin, letter_spacing, line_spacing)
                                    setStart开始绘制
                                    setFinish结束绘制
                                    setSize设置画布尺寸(width,height)分别表示画布宽高
                                    setViewBox设置画布可视区域(x,y,width,height,fit)分别表示可视区域原点坐标以及可视区域宽高,以及是否根据可视区域进行调整
                                    getById根据id返回元素id
                                    getElementByPoint获根据给定的点坐标返回元素(x,y)
                                    getElementsByPoint获根据给定的点坐标返回元素(x,y)
                                    getFont通过给定的参数在已注册的字体中找到字体对象(family, weight, style, stretch)
                                    set绘制形状的集合
                                    remove设置总页数pages
                                    clear判断是否有上一页v
                                    -
                                    - - -
                                    - -
                                    -
                                    -
                                    - -

                                    results matching ""

                                    -
                                      - -
                                      -
                                      - -

                                      No results matching ""

                                      - -
                                      -
                                      -
                                      - -
                                      -
                                      - -
                                      - - - - -
                                      - - -
                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/svg.md b/docs/_book/base/svg.md deleted file mode 100644 index 6724b4fc9..000000000 --- a/docs/_book/base/svg.md +++ /dev/null @@ -1,55 +0,0 @@ -# bi.svg - -## svg绘图,基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/1xn8snp3/) - -{% common %} -```javascript - -var svg = BI.createWidget({ - type: "bi.svg", - width: 500, - height: 600 -}); - -svg.path("M10,10L50,50M50,10L10,50") - .attr({stroke: "red"}); - - -``` - -{% endmethod %} - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| add | 添加对象到json数组 | json | -| path | 绘制路径 | pathString | -| image | 绘制图片 | (src,x,y,w,h)分别表示图片路径,绘制的原点横、纵坐标,宽、高 | -| rect | 绘制矩形 | (x,y,w,h,r)分别表示左上角的横坐标、纵坐标,矩形宽、高、以及矩形的圆角border-radius大小| -| circle | 绘制圆形 | (x,y,r)分别表示原点的横坐标,纵坐标,以及半径 | -| ellipse | 绘制椭圆 |(x,y,rx,ry)分别表示原点的横、纵坐标,以及水平半径和垂直半径| -| text | 绘制文本 | (x,y,text)分别表示绘制的原点横、纵坐标以及要绘制的文本内容| -| print | 根据制定参数打印出路径 | (x, y, string, font, size, origin, letter_spacing, line_spacing) | -| setStart | 开始绘制 | — | -| setFinish | 结束绘制 | — | -| setSize | 设置画布尺寸 | (width,height)分别表示画布宽高| -| setViewBox | 设置画布可视区域 | (x,y,width,height,fit)分别表示可视区域原点坐标以及可视区域宽高,以及是否根据可视区域进行调整 | -| getById | 根据id返回元素 | id | -| getElementByPoint | 获根据给定的点坐标返回元素 | (x,y)| -| getElementsByPoint | 获根据给定的点坐标返回元素 | (x,y) | -| getFont | 通过给定的参数在已注册的字体中找到字体对象 | (family, weight, style, stretch) | -| set | 绘制形状的集合 | — | -| remove | 设置总页数 | pages | -| clear | 判断是否有上一页 | v | - - - - - ---- - - diff --git a/docs/_book/base/table/collection_table.html b/docs/_book/base/table/collection_table.html deleted file mode 100644 index 0e93d932f..000000000 --- a/docs/_book/base/table/collection_table.html +++ /dev/null @@ -1,2725 +0,0 @@ - - - - - - - collection_table · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                      -
                                      - - - - - - - - -
                                      - -
                                      - -
                                      - - - - - - - - -
                                      -
                                      - -
                                      -
                                      - -
                                      - -

                                      bi.collection_table

                                      -

                                      基本的表格 继承BI.Widget

                                      -
                                      BI.createWidget({
                                      -  type: "bi.collection_table",
                                      -  element: "body",
                                      -  columnSize: [200,200],
                                      -  items: [
                                      -    [{
                                      -      type: "bi.label",
                                      -      cls: "layout-bg1",
                                      -      text: "第一行第一列"
                                      -    }, {
                                      -      type: "bi.label",
                                      -      cls: "layout-bg2",
                                      -      text: "第一行第二列"
                                      -    }],
                                      -    [{
                                      -      type: "bi.label",
                                      -      cls: "layout-bg3",
                                      -      text: "第二行第一列"
                                      -    }, {
                                      -      type: "bi.label",
                                      -      cls: "layout-bg4",
                                      -      text: "第二行第二列"
                                      -    }]
                                      -  ] 
                                      -});
                                      -
                                      -
                                      - -

                                      参数设置

                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                      参数说明类型默认值
                                      isNeedFreeze是否冻结列booleanfalse
                                      freezeCols冻结的列array[]
                                      isNeedMerge是否需要合并单元格booleanfalse
                                      mergeCols合并的单元格列号array[]
                                      mergeRule合并规则, 默认相等时合并function(row1, row2)默认row1 = row2 时合并
                                      columnSize单元格宽度集合array[]
                                      headerRowSize表头高度number25
                                      rowSize普通单元格高度number25
                                      regionColumnSize列项间的array[]
                                      items子组件array[]
                                      -

                                      方法

                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                      方法名说明参数
                                      setWidth设置宽度width
                                      setHeight设置高度height
                                      setColumnSize设置列宽columnSize
                                      getColumnSize得到列宽
                                      setRegionColumnSize设置列项之间的间隙columnSize
                                      getRegionColumnSize获得列项之间的间隙
                                      getScrollRegionColumnSize获取横向滚动条宽度
                                      setVerticalScroll设置纵向滚动距离scrollTop
                                      setLeftHorizontalScroll设置左到右横向滚动距离scrollLeft
                                      setRightHorizontalScroll设置右往左横向滚动距离scrollLeft
                                      getVerticalScroll获取纵向滚动距离
                                      getLeftHorizontalScroll获取左到右横向滚动距离
                                      getRightHorizontalScroll获取右往左横向滚动距离
                                      getColumns获取列项
                                      populate增加行rows
                                      restore存储数据
                                      -
                                      - - -
                                      - -
                                      -
                                      -
                                      - -

                                      results matching ""

                                      -
                                        - -
                                        -
                                        - -

                                        No results matching ""

                                        - -
                                        -
                                        -
                                        - -
                                        -
                                        - -
                                        - - - - -
                                        - - -
                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/table/collection_table.md b/docs/_book/base/table/collection_table.md deleted file mode 100644 index 81679f78d..000000000 --- a/docs/_book/base/table/collection_table.md +++ /dev/null @@ -1,74 +0,0 @@ -# bi.collection_table - -### 基本的表格 继承BI.Widget - -{% method %} -[source](https://jsfiddle.net/fineui/x2zxfzhp/) - -{% common %} -```javascript -BI.createWidget({ - type: "bi.collection_table", - element: "body", - columnSize: [200,200], - items: [ - [{ - type: "bi.label", - cls: "layout-bg1", - text: "第一行第一列" - }, { - type: "bi.label", - cls: "layout-bg2", - text: "第一行第二列" - }], - [{ - type: "bi.label", - cls: "layout-bg3", - text: "第二行第一列" - }, { - type: "bi.label", - cls: "layout-bg4", - text: "第二行第二列" - }] - ] -}); -``` - -{% endmethod %} - -## 参数设置 -| 参数 | 说明 | 类型 | 默认值 | -| ---------------- | ------------- | -------------------- | ----------------- | -| isNeedFreeze | 是否冻结列 | boolean | false | -| freezeCols | 冻结的列 | array | [] | -| isNeedMerge | 是否需要合并单元格 | boolean | false | -| mergeCols | 合并的单元格列号 | array | [] | -| mergeRule | 合并规则, 默认相等时合并 | function(row1, row2) | 默认row1 = row2 时合并 | -| columnSize | 单元格宽度集合 | array | [] | -| headerRowSize | 表头高度 | number | 25 | -| rowSize | 普通单元格高度 | number | 25 | -| regionColumnSize | 列项间的 | array | [] | -| items | 子组件 | array | [] | - -## 方法 -| 方法名 | 说明 | 参数 | -| ------------------------- | ----------- | ---------- | -| setWidth | 设置宽度 | width | -| setHeight | 设置高度 | height | -| setColumnSize | 设置列宽 | columnSize | -| getColumnSize | 得到列宽 | — | -| setRegionColumnSize | 设置列项之间的间隙 | columnSize | -| getRegionColumnSize | 获得列项之间的间隙 | — | -| getScrollRegionColumnSize | 获取横向滚动条宽度 | — | -| setVerticalScroll | 设置纵向滚动距离 | scrollTop | -| setLeftHorizontalScroll | 设置左到右横向滚动距离 | scrollLeft | -| setRightHorizontalScroll | 设置右往左横向滚动距离 | scrollLeft | -| getVerticalScroll | 获取纵向滚动距离 | — | -| getLeftHorizontalScroll | 获取左到右横向滚动距离 | — | -| getRightHorizontalScroll | 获取右往左横向滚动距离 | — | -| getColumns | 获取列项 | — | -| populate | 增加行 | rows | -| restore | 存储数据 | — | - ------- - diff --git a/docs/_book/base/table/grid_table.html b/docs/_book/base/table/grid_table.html deleted file mode 100644 index a7a61e7e3..000000000 --- a/docs/_book/base/table/grid_table.html +++ /dev/null @@ -1,2696 +0,0 @@ - - - - - - - grid_table · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                        -
                                        - - - - - - - - -
                                        - -
                                        - -
                                        - - - - - - - - -
                                        -
                                        - -
                                        -
                                        - -
                                        - -

                                        bi.grid_table

                                        -

                                        列表展示的table,继承BI.Widget

                                        -
                                        BI.createWidget({
                                        -  type: "bi.grid_table",
                                        -  element: 'body',
                                        -  width: 600,
                                        -  height: 500,
                                        -  isResizeAdapt: true,
                                        -  isNeedResize: true,
                                        -  isNeedFreeze: true,
                                        -  freezeCols: [0, 1],
                                        -  columnSize: [50,50,200,250,400],
                                        -  items: items,
                                        -  header: header
                                        -});
                                        -
                                        -
                                        - -

                                        参数设置

                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                        参数说明类型默认值
                                        isNeedFreeze是否需要冻结booleanfalse
                                        freezeCols冻结列array[]
                                        columnSize单元格宽度集合array[]
                                        headerRowSize表头高度number25
                                        rowSize普通单元格高度number25
                                        regionColumnSize列项间的array[]
                                        header表头array[]
                                        items子组件array[]
                                        -

                                        方法

                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                        方法名说明参数
                                        setWidth设置宽度width
                                        setHeight设置高度height
                                        getRegionSize获取间隙大小
                                        setColumnSize设置列宽columnSize
                                        getColumnSize得到列宽
                                        setRegionColumnSize设置列项之间的间隙columnSize
                                        getRegionColumnSize获得列项之间的间隙
                                        setVerticalScroll设置纵向滚动距离scrollTop
                                        setLeftHorizontalScroll设置左到右横向滚动距离scrollLeft
                                        setRightHorizontalScroll设置右往左横向滚动距离scrollLeft
                                        getVerticalScroll获取纵向滚动距离
                                        getLeftHorizontalScroll获取左到右横向滚动距离
                                        getRightHorizontalScroll获取右往左横向滚动距离
                                        populate刷新内容rows
                                        restore储存
                                        -
                                        - - -
                                        - -
                                        -
                                        -
                                        - -

                                        results matching ""

                                        -
                                          - -
                                          -
                                          - -

                                          No results matching ""

                                          - -
                                          -
                                          -
                                          - -
                                          -
                                          - -
                                          - - - - -
                                          - - -
                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/table/grid_table.md b/docs/_book/base/table/grid_table.md deleted file mode 100644 index 365e8f733..000000000 --- a/docs/_book/base/table/grid_table.md +++ /dev/null @@ -1,59 +0,0 @@ -# bi.grid_table - -### 列表展示的table,继承BI.Widget - -{% method %} -[source](https://jsfiddle.net/fineui/a936vcvj/) - -{% common %} -```javascript -BI.createWidget({ - type: "bi.grid_table", - element: 'body', - width: 600, - height: 500, - isResizeAdapt: true, - isNeedResize: true, - isNeedFreeze: true, - freezeCols: [0, 1], - columnSize: [50,50,200,250,400], - items: items, - header: header -}); -``` - -{% endmethod %} - -## 参数设置 -| 参数 | 说明 | 类型 | 默认值 | -| ---------------- | ------- | ------- | ----- | -| isNeedFreeze | 是否需要冻结 | boolean | false | -| freezeCols | 冻结列 | array | [] | -| columnSize | 单元格宽度集合 | array | [] | -| headerRowSize | 表头高度 | number | 25 | -| rowSize | 普通单元格高度 | number | 25 | -| regionColumnSize | 列项间的 | array | [] | -| header | 表头 | array | [] | -| items | 子组件 | array | [] | - -## 方法 -| 方法名 | 说明 | 参数 | -| ------------------------ | ----------- | ---------- | -| setWidth | 设置宽度 | width | -| setHeight | 设置高度 | height | -| getRegionSize | 获取间隙大小 | — | -| setColumnSize | 设置列宽 | columnSize | -| getColumnSize | 得到列宽 | — | -| setRegionColumnSize | 设置列项之间的间隙 | columnSize | -| getRegionColumnSize | 获得列项之间的间隙 | — | -| setVerticalScroll | 设置纵向滚动距离 | scrollTop | -| setLeftHorizontalScroll | 设置左到右横向滚动距离 | scrollLeft | -| setRightHorizontalScroll | 设置右往左横向滚动距离 | scrollLeft | -| getVerticalScroll | 获取纵向滚动距离 | — | -| getLeftHorizontalScroll | 获取左到右横向滚动距离 | — | -| getRightHorizontalScroll | 获取右往左横向滚动距离 | — | -| populate | 刷新内容 | rows | -| restore | 储存 | — | - ------- - diff --git a/docs/_book/base/table/resizable_table.html b/docs/_book/base/table/resizable_table.html deleted file mode 100644 index ad5ea1ff4..000000000 --- a/docs/_book/base/table/resizable_table.html +++ /dev/null @@ -1,2744 +0,0 @@ - - - - - - - resizable_table · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                          -
                                          - - - - - - - - -
                                          - -
                                          - -
                                          - - - - - - - - -
                                          -
                                          - -
                                          -
                                          - -
                                          - -

                                          bi.resizable_table

                                          -

                                          可调整列宽的grid表格,继承BI.Widget

                                          -
                                          BI.createWidget({
                                          -  type: "bi.resizable_table",
                                          -  element: "body",
                                          -  columnSize: [200,200],
                                          -  items: [
                                          -    [{
                                          -      type: "bi.label",
                                          -      cls: "layout-bg1",
                                          -      text: "第一行第一列"
                                          -    }, {
                                          -      type: "bi.label",
                                          -      cls: "layout-bg2",
                                          -      text: "第一行第二列"
                                          -    }],
                                          -    [{
                                          -      type: "bi.label",
                                          -      cls: "layout-bg3",
                                          -      text: "第二行第一列"
                                          -    }, {
                                          -      type: "bi.label",
                                          -      cls: "layout-bg4",
                                          -      text: "第二行第二列"
                                          -    }]
                                          -  ] 
                                          -});
                                          -
                                          -
                                          - -

                                          参数设置

                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                          参数说明类型默认值
                                          isNeedFreeze是否需要冻结列booleanfalse
                                          freezeCols冻结的列array[]
                                          isNeedResize是否需要调整大小booleanfalse
                                          isResizeAdapt是否调整时自适应booleantrue
                                          isNeedMerge是否需要合并单元格booleanfalse
                                          mergeCols合并的单元格列号array[]
                                          columnSize单元格宽度集合array[]
                                          minColumnSize最小列宽array[]
                                          maxColumnSize最大列宽array[]
                                          headerRowSize表头高度number25
                                          rowSize普通单元格高度number25
                                          header表头array[]
                                          regionColumnSize列项间的array[]
                                          items子组件array[]
                                          -

                                          方法

                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                          方法名说明参数
                                          setWidth设置宽度
                                          setHeight设置高度
                                          setColumnSize设置列宽columnSize
                                          getColumnSize得到列宽
                                          setRegionColumnSize设置列项之间的间隙columnSize
                                          getRegionColumnSize获得列项之间的间隙
                                          setVerticalScroll设置纵向滚动距离scrollTop
                                          setLeftHorizontalScroll设置左到右横向滚动距离scrollLeft
                                          setRightHorizontalScroll设置右往左横向滚动距离scrollLeft
                                          getVerticalScroll获取纵向滚动距离
                                          getLeftHorizontalScroll获取左到右横向滚动距离
                                          getRightHorizontalScroll获取右往左横向滚动距离
                                          attr设置属性key:键,value:值
                                          populate刷新内容rows
                                          restore保存表
                                          -
                                          - - -
                                          - -
                                          -
                                          -
                                          - -

                                          results matching ""

                                          -
                                            - -
                                            -
                                            - -

                                            No results matching ""

                                            - -
                                            -
                                            -
                                            - -
                                            -
                                            - -
                                            - - - - -
                                            - - -
                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/table/resizable_table.md b/docs/_book/base/table/resizable_table.md deleted file mode 100644 index 6f67b1c3f..000000000 --- a/docs/_book/base/table/resizable_table.md +++ /dev/null @@ -1,77 +0,0 @@ -# bi.resizable_table - -### 可调整列宽的grid表格,继承BI.Widget - -{% method %} -[source](https://jsfiddle.net/fineui/0e7p2ezc/) - -{% common %} -```javascript -BI.createWidget({ - type: "bi.resizable_table", - element: "body", - columnSize: [200,200], - items: [ - [{ - type: "bi.label", - cls: "layout-bg1", - text: "第一行第一列" - }, { - type: "bi.label", - cls: "layout-bg2", - text: "第一行第二列" - }], - [{ - type: "bi.label", - cls: "layout-bg3", - text: "第二行第一列" - }, { - type: "bi.label", - cls: "layout-bg4", - text: "第二行第二列" - }] - ] -}); -``` - -{% endmethod %} - -## 参数设置 -| 参数 | 说明 | 类型 | 默认值 | -| ---------------- | --------- | ------- | ----- | -| isNeedFreeze | 是否需要冻结列 | boolean | false | -| freezeCols | 冻结的列 | array | [] | -| isNeedResize | 是否需要调整大小 | boolean | false | -| isResizeAdapt | 是否调整时自适应 | boolean | true | -| isNeedMerge | 是否需要合并单元格 | boolean | false | -| mergeCols | 合并的单元格列号 | array | [] | -| columnSize | 单元格宽度集合 | array | [] | -| minColumnSize | 最小列宽 | array | [] | -| maxColumnSize | 最大列宽 | array | [] | -| headerRowSize | 表头高度 | number | 25 | -| rowSize | 普通单元格高度 | number | 25 | -| header | 表头 | array | [] | -| regionColumnSize | 列项间的 | array | [] | -| items | 子组件 | array | [] | - -## 方法 -| 方法名 | 说明 | 参数 | -| ------------------------ | ----------- | ------------- | -| setWidth | 设置宽度 | — | -| setHeight | 设置高度 | — | -| setColumnSize | 设置列宽 | columnSize | -| getColumnSize | 得到列宽 | — | -| setRegionColumnSize | 设置列项之间的间隙 | columnSize | -| getRegionColumnSize | 获得列项之间的间隙 | — | -| setVerticalScroll | 设置纵向滚动距离 | scrollTop | -| setLeftHorizontalScroll | 设置左到右横向滚动距离 | scrollLeft | -| setRightHorizontalScroll | 设置右往左横向滚动距离 | scrollLeft | -| getVerticalScroll | 获取纵向滚动距离 | — | -| getLeftHorizontalScroll | 获取左到右横向滚动距离 | — | -| getRightHorizontalScroll | 获取右往左横向滚动距离 | — | -| attr | 设置属性 | key:键,value:值 | -| populate | 刷新内容 | rows | -| restore | 保存表 | — | - ------- - diff --git a/docs/_book/base/table/table_view.html b/docs/_book/base/table/table_view.html deleted file mode 100644 index 89e4d3366..000000000 --- a/docs/_book/base/table/table_view.html +++ /dev/null @@ -1,2763 +0,0 @@ - - - - - - - table_view · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                            -
                                            - - - - - - - - -
                                            - -
                                            - -
                                            - - - - - - - - -
                                            -
                                            - -
                                            -
                                            - -
                                            - -

                                            bi.table_view

                                            -

                                            能处理静态宽度以及动态宽度的表

                                            -
                                            BI.createWidget({
                                            -  type: "bi.table_view",
                                            -  element: 'body',
                                            -  isNeedMerge: true,
                                            -  isNeedFreeze: true,
                                            -  freezeCols: [0, 1],
                                            -  mergeCols: [0, 1],
                                            -  columnSize: [100, 200, 300, 400, 500],
                                            -  items: [],
                                            -  header: []
                                            -});
                                            -
                                            -
                                            - -

                                            参数设置

                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                            参数说明类型默认值
                                            isNeedMerge是否需要合并单元格booleanfalse
                                            mergeCols合并的单元格列号array[]
                                            mergeRule合并规则, 默认相等时合并function(row1, row2)默认row1 = row2 时合并
                                            columnSize单元格宽度集合array[]
                                            headerRowSize表头高度number25
                                            footerRowSize表尾高度number25
                                            rowSize普通单元格高度number25
                                            regionColumnSize列项间的arrayfalse
                                            header表头array[]
                                            footer表尾arrayfalse
                                            items子组件array[]
                                            -

                                            方法

                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                            方法名说明参数
                                            resize调整表格
                                            setColumnSize设置列宽columnSize
                                            getColumnSize得到列宽
                                            getCalculateColumnSize获得计算后的列宽
                                            setHeaderColumnSize设置表头的列宽columnSize
                                            setRegionColumnSize设置列项之间的间隙columnSize
                                            getRegionColumnSize获得列项之间的间隙
                                            getCalculateRegionColumnSize获取计算后的列项之间的间隙
                                            getCalculateRegionRowSize获取计算后的列项上下之间的间隙
                                            getClientRegionColumnSize获取浏览器中显示的列项之间的间隙
                                            getScrollRegionColumnSize获取横向滚动条宽度
                                            getScrollRegionRowSize获取纵向滚动条宽度
                                            hasVerticalScroll是否含有数值滚动条
                                            setVerticalScroll设置纵向滚动距离scrollTop
                                            setLeftHorizontalScroll设置左到右横向滚动距离scrollLeft
                                            setRightHorizontalScroll设置右往左横向滚动距离scrollLeft
                                            getVerticalScroll获取纵向滚动距离
                                            getLeftHorizontalScroll获取左到右横向滚动距离
                                            getRightHorizontalScroll获取右往左横向滚动距离
                                            getColumns获取列项
                                            populate刷新内容rows
                                            -

                                            事件

                                            - - - - - - - - - - - - - - - - - - - - - -
                                            事件说明
                                            BI.Table.EVENT_TABLE_AFTER_INITtable初始化完成后触发
                                            BI.Table.EVENT_TABLE_RESIZEtable大小调整时触发(窗口变化等)
                                            BI.Table.EVENT_TABLE_SCROLL滚动事件
                                            -
                                            - - -
                                            - -
                                            -
                                            -
                                            - -

                                            results matching ""

                                            -
                                              - -
                                              -
                                              - -

                                              No results matching ""

                                              - -
                                              -
                                              -
                                              - -
                                              -
                                              - -
                                              - - - - -
                                              - - -
                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/table/table_view.md b/docs/_book/base/table/table_view.md deleted file mode 100644 index 2cceb75ab..000000000 --- a/docs/_book/base/table/table_view.md +++ /dev/null @@ -1,73 +0,0 @@ -# bi.table_view - -### 能处理静态宽度以及动态宽度的表 - -{% method %} -[source](https://jsfiddle.net/fineui/mbazb80a/) - -{% common %} -```javascript -BI.createWidget({ - type: "bi.table_view", - element: 'body', - isNeedMerge: true, - isNeedFreeze: true, - freezeCols: [0, 1], - mergeCols: [0, 1], - columnSize: [100, 200, 300, 400, 500], - items: [], - header: [] -}); -``` - -{% endmethod %} - -## 参数设置 -| 参数 | 说明 | 类型 | 默认值 | -| ---------------- | ------------- | -------------------- | ----------------- | -| isNeedMerge | 是否需要合并单元格 | boolean | false | -| mergeCols | 合并的单元格列号 | array | [] | -| mergeRule | 合并规则, 默认相等时合并 | function(row1, row2) | 默认row1 = row2 时合并 | -| columnSize | 单元格宽度集合 | array | [] | -| headerRowSize | 表头高度 | number | 25 | -| footerRowSize | 表尾高度 | number | 25 | -| rowSize | 普通单元格高度 | number | 25 | -| regionColumnSize | 列项间的 | array | false | -| header | 表头 | array | [] | -| footer | 表尾 | array | false | -| items | 子组件 | array | [] | - -## 方法 -| 方法名 | 说明 | 参数 | -| ---------------------------- | ---------------- | ---------- | -| resize | 调整表格 | — | -| setColumnSize | 设置列宽 | columnSize | -| getColumnSize | 得到列宽 | — | -| getCalculateColumnSize | 获得计算后的列宽 | — | -| setHeaderColumnSize | 设置表头的列宽 | columnSize | -| setRegionColumnSize | 设置列项之间的间隙 | columnSize | -| getRegionColumnSize | 获得列项之间的间隙 | — | -| getCalculateRegionColumnSize | 获取计算后的列项之间的间隙 | — | -| getCalculateRegionRowSize | 获取计算后的列项上下之间的间隙 | — | -| getClientRegionColumnSize | 获取浏览器中显示的列项之间的间隙 | — | -| getScrollRegionColumnSize | 获取横向滚动条宽度 | — | -| getScrollRegionRowSize | 获取纵向滚动条宽度 | — | -| hasVerticalScroll | 是否含有数值滚动条 | — | -| setVerticalScroll | 设置纵向滚动距离 | scrollTop | -| setLeftHorizontalScroll | 设置左到右横向滚动距离 | scrollLeft | -| setRightHorizontalScroll | 设置右往左横向滚动距离 | scrollLeft | -| getVerticalScroll | 获取纵向滚动距离 | — | -| getLeftHorizontalScroll | 获取左到右横向滚动距离 | — | -| getRightHorizontalScroll | 获取右往左横向滚动距离 | — | -| getColumns | 获取列项 | — | -| populate | 刷新内容 | rows | - -## 事件 -| 事件 | 说明 | -| :------------------------------ | :------------------ | -| BI.Table.EVENT_TABLE_AFTER_INIT | table初始化完成后触发 | -| BI.Table.EVENT_TABLE_RESIZE | table大小调整时触发(窗口变化等) | -| BI.Table.EVENT_TABLE_SCROLL | 滚动事件 | - ---- - diff --git a/docs/_book/base/toast.html b/docs/_book/base/toast.html deleted file mode 100644 index 71163194e..000000000 --- a/docs/_book/base/toast.html +++ /dev/null @@ -1,2597 +0,0 @@ - - - - - - - toast · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                              -
                                              - - - - - - - - -
                                              - -
                                              - -
                                              - - - - - - - - -
                                              -
                                              - -
                                              -
                                              - -
                                              - -

                                              bi.toast

                                              -

                                              toast提示

                                              -
                                              
                                              -BI.createWidget({
                                              -  type: 'bi.toast',
                                              -  element: "#wrapper",
                                              -  height: 30,
                                              -  level: "warning",
                                              -  text: "toast测试"
                                              -})
                                              -
                                              -
                                              - - -

                                              API

                                              -
                                              基础属性
                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                              参数说明类型可选值默认值
                                              level提示类型stringsuccess,warning"success"
                                              height高度number30
                                              text显示内容string" "
                                              -

                                              对外方法

                                              - - - - - - - - - - - - - - - -
                                              名称说明回调参数
                                              setText设置文本值需要设置的文本值text
                                              -
                                              - - -
                                              - -
                                              -
                                              -
                                              - -

                                              results matching ""

                                              -
                                                - -
                                                -
                                                - -

                                                No results matching ""

                                                - -
                                                -
                                                -
                                                - -
                                                -
                                                - -
                                                - - - - -
                                                - - -
                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/base/toast.md b/docs/_book/base/toast.md deleted file mode 100644 index 86c9273d3..000000000 --- a/docs/_book/base/toast.md +++ /dev/null @@ -1,41 +0,0 @@ -# bi.toast - -#### toast提示 - -{% method %} -[source](https://jsfiddle.net/fineui/wop751sg/) - -{% 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 | - ---- diff --git a/docs/_book/case/button/multi_select_item.html b/docs/_book/case/button/multi_select_item.html deleted file mode 100644 index 80f7d811a..000000000 --- a/docs/_book/case/button/multi_select_item.html +++ /dev/null @@ -1,2607 +0,0 @@ - - - - - - - multi_select_item · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                -
                                                - - - - - - - - -
                                                - -
                                                - -
                                                - - - - - - - - -
                                                -
                                                - -
                                                -
                                                - -
                                                - -

                                                bi.multi_select_item

                                                -

                                                复选框item,基类BI.BasicButton

                                                -
                                                
                                                -BI.createWidget({
                                                -    type: 'bi.vertical',
                                                -    element: "#wrapper",
                                                -    items: [{
                                                -        type: "bi.label",
                                                -        height: 30,
                                                -        text: "复选item"
                                                -    }, {
                                                -        type: "bi.multi_select_item",
                                                -        text: "复选项"
                                                -    }]
                                                -});
                                                -
                                                -
                                                - -

                                                API

                                                -
                                                基础属性
                                                - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                参数说明类型可选值默认值
                                                height高度number30
                                                logic布局逻辑object{dynamic:false}
                                                -

                                                对外方法

                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                名称说明回调参数
                                                setSelected设置选中值v
                                                doRedMark标红
                                                unRedMark取消标红
                                                doClick点击事件
                                                -
                                                - - -
                                                - -
                                                -
                                                -
                                                - -

                                                results matching ""

                                                -
                                                  - -
                                                  -
                                                  - -

                                                  No results matching ""

                                                  - -
                                                  -
                                                  -
                                                  - -
                                                  -
                                                  - -
                                                  - - - - -
                                                  - - -
                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/button/multi_select_item.md b/docs/_book/case/button/multi_select_item.md deleted file mode 100644 index eb48696d3..000000000 --- a/docs/_book/case/button/multi_select_item.md +++ /dev/null @@ -1,53 +0,0 @@ -# bi.multi_select_item - -## 复选框item,基类[BI.BasicButton](/core/basic_button.md) - -{% method %} -[source](https://jsfiddle.net/fineui/0z1fud88/) - -{% common %} -```javascript - -BI.createWidget({ - type: 'bi.vertical', - element: "#wrapper", - items: [{ - type: "bi.label", - height: 30, - text: "复选item" - }, { - type: "bi.multi_select_item", - text: "复选项" - }] -}); - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| height | 高度 | number | — | 30 -| logic | 布局逻辑 | object | — | {dynamic:false} | - - - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setSelected| 设置选中值| v | -| doRedMark | 标红 |—| -| unRedMark | 取消标红 | — | -| doClick | 点击事件| — - - - - - ---- - - diff --git a/docs/_book/case/button/single_select_item.html b/docs/_book/case/button/single_select_item.html deleted file mode 100644 index c1d95f518..000000000 --- a/docs/_book/case/button/single_select_item.html +++ /dev/null @@ -1,2616 +0,0 @@ - - - - - - - single_select_item · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                  -
                                                  - - - - - - - - -
                                                  - -
                                                  - -
                                                  - - - - - - - - -
                                                  -
                                                  - -
                                                  -
                                                  - -
                                                  - -

                                                  bi.single_select_item

                                                  -

                                                  可以点击的label,基类BI.BasicButton

                                                  -
                                                  
                                                  -BI.createWidget({
                                                  -    type: 'bi.vertical',
                                                  -    element: "#wrapper",
                                                  -    items: [{
                                                  -        type: "bi.label",
                                                  -        height: 30,
                                                  -        text: "复选item"
                                                  -    }, {
                                                  -        type: "bi.single_select_item",
                                                  -        text: "复选项"
                                                  -    }]
                                                  -});
                                                  -
                                                  -
                                                  - -

                                                  API

                                                  -
                                                  基础属性
                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                  参数说明类型可选值默认值
                                                  height高度number25
                                                  hgap效果相当于文本框左右padding值number10
                                                  textAlign文本对齐方式stringleft,center,right"left"
                                                  -

                                                  对外方法

                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                  名称说明回调参数
                                                  setSelected设置选中值v
                                                  doRedMark标红
                                                  unRedMark取消标红
                                                  doClick点击事件
                                                  -
                                                  - - -
                                                  - -
                                                  -
                                                  -
                                                  - -

                                                  results matching ""

                                                  -
                                                    - -
                                                    -
                                                    - -

                                                    No results matching ""

                                                    - -
                                                    -
                                                    -
                                                    - -
                                                    -
                                                    - -
                                                    - - - - -
                                                    - - -
                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/button/single_select_item.md b/docs/_book/case/button/single_select_item.md deleted file mode 100644 index 56facc4d5..000000000 --- a/docs/_book/case/button/single_select_item.md +++ /dev/null @@ -1,54 +0,0 @@ -# bi.single_select_item - -## 可以点击的label,基类[BI.BasicButton](/core/basic_button.md) - -{% method %} -[source](https://jsfiddle.net/fineui/19qqcej4/) - -{% common %} -```javascript - -BI.createWidget({ - type: 'bi.vertical', - element: "#wrapper", - items: [{ - type: "bi.label", - height: 30, - text: "复选item" - }, { - type: "bi.single_select_item", - text: "复选项" - }] -}); - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| height | 高度 | number | — | 25 -| hgap | 效果相当于文本框左右padding值 |number | —| 10 | -|textAlign |文本对齐方式 |string |left,center,right |"left" - - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setSelected| 设置选中值| v | -| doRedMark | 标红 |—| -| unRedMark | 取消标红 | — | -| doClick | 点击事件| — - - - - - - ---- - - diff --git a/docs/_book/case/button/single_select_radio_item.html b/docs/_book/case/button/single_select_radio_item.html deleted file mode 100644 index 53c4d008b..000000000 --- a/docs/_book/case/button/single_select_radio_item.html +++ /dev/null @@ -1,2614 +0,0 @@ - - - - - - - single_select_radio_item · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                    -
                                                    - - - - - - - - -
                                                    - -
                                                    - -
                                                    - - - - - - - - -
                                                    -
                                                    - -
                                                    -
                                                    - -
                                                    - -

                                                    bi.single_select_radio_item

                                                    -

                                                    单选框item,基类BI.BasicButton

                                                    -
                                                    
                                                    -BI.createWidget({
                                                    -    type: 'bi.vertical',
                                                    -    element: "#wrapper",
                                                    -    items: [{
                                                    -        type: "bi.label",
                                                    -        height: 30,
                                                    -        text: "单选item"
                                                    -    }, {
                                                    -        type: "bi.single_select_radio_item",
                                                    -        text: "单选项"
                                                    -    }]
                                                    -});
                                                    -
                                                    -
                                                    - -

                                                    API

                                                    -
                                                    基础属性
                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                    参数说明类型可选值默认值
                                                    height高度number25
                                                    hgap效果相当于文本框左右padding值number10
                                                    textAlign文本对齐方式stringleft,center,right"left"
                                                    -

                                                    对外方法

                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                    名称说明回调参数
                                                    setSelected设置选中值v
                                                    doRedMark标红
                                                    unRedMark取消标红
                                                    doClick点击事件
                                                    -
                                                    - - -
                                                    - -
                                                    -
                                                    -
                                                    - -

                                                    results matching ""

                                                    -
                                                      - -
                                                      -
                                                      - -

                                                      No results matching ""

                                                      - -
                                                      -
                                                      -
                                                      - -
                                                      -
                                                      - -
                                                      - - - - -
                                                      - - -
                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/button/single_select_radio_item.md b/docs/_book/case/button/single_select_radio_item.md deleted file mode 100644 index 9aac21b3d..000000000 --- a/docs/_book/case/button/single_select_radio_item.md +++ /dev/null @@ -1,55 +0,0 @@ -# bi.single_select_radio_item - -## 单选框item,基类[BI.BasicButton](/core/basic_button.md) - -{% method %} -[source](https://jsfiddle.net/fineui/d3vw4438/) - -{% common %} -```javascript - -BI.createWidget({ - type: 'bi.vertical', - element: "#wrapper", - items: [{ - type: "bi.label", - height: 30, - text: "单选item" - }, { - type: "bi.single_select_radio_item", - text: "单选项" - }] -}); - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| height | 高度 | number | — | 25 -| hgap | 效果相当于文本框左右padding值 |number | —| 10 | -|textAlign |文本对齐方式 |string |left,center,right |"left" - - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setSelected| 设置选中值| v | -| doRedMark | 标红 |—| -| unRedMark | 取消标红 | — | -| doClick | 点击事件| — - - - - - - - ---- - - diff --git a/docs/_book/case/calendar.html b/docs/_book/case/calendar.html deleted file mode 100644 index ea3ab74ee..000000000 --- a/docs/_book/case/calendar.html +++ /dev/null @@ -1,2621 +0,0 @@ - - - - - - - calendar · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                      -
                                                      - - - - - - - - -
                                                      - -
                                                      - -
                                                      - - - - - - - - -
                                                      -
                                                      - -
                                                      -
                                                      - -
                                                      - -

                                                      bi.calendar

                                                      -

                                                      日历控件

                                                      -
                                                      
                                                      -BI.createWidget({
                                                      -  type: 'bi.calendar',
                                                      -  min: '1900-01-01', //最小日期
                                                      -  max: '2099-12-31', //最大日期
                                                      -  year: 2015,
                                                      -  month: 7,  //7表示八月
                                                      -  day: 25,
                                                      -});
                                                      -
                                                      -
                                                      - - - -

                                                      参数

                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                      参数说明类型默认值
                                                      min最小日期string'1900-01-01'
                                                      max最大日期string'2099-12-31'
                                                      year设定的年份number2015
                                                      month设定的月份number7
                                                      day设定的日期number25
                                                      -

                                                      方法

                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                      方法名说明参数
                                                      isFrontDate是否为最小日期
                                                      isFinalDate是否为最大日期
                                                      setValue设置日期object: {year, month, day}
                                                      getVlaue获得日期
                                                      -
                                                      - - -
                                                      - -
                                                      -
                                                      -
                                                      - -

                                                      results matching ""

                                                      -
                                                        - -
                                                        -
                                                        - -

                                                        No results matching ""

                                                        - -
                                                        -
                                                        -
                                                        - -
                                                        -
                                                        - -
                                                        - - - - -
                                                        - - -
                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/calendar.md b/docs/_book/case/calendar.md deleted file mode 100644 index 87f96a3a2..000000000 --- a/docs/_book/case/calendar.md +++ /dev/null @@ -1,47 +0,0 @@ -# bi.calendar - -### 日历控件 - -{% method %} -[source](https://jsfiddle.net/fineui/4sfsaoma/) - -{% common %} -```javascript - -BI.createWidget({ - type: 'bi.calendar', - min: '1900-01-01', //最小日期 - max: '2099-12-31', //最大日期 - year: 2015, - month: 7, //7表示八月 - day: 25, -}); - -``` - -{% endmethod %} - - - -### 参数 - -| 参数 | 说明 | 类型 | 默认值 | -| ----- | ----- | ------ | ------------ | -| min | 最小日期 | string | '1900-01-01' | -| max | 最大日期 | string | '2099-12-31' | -| year | 设定的年份 | number | 2015 | -| month | 设定的月份 | number | 7 | -| day | 设定的日期 | number | 25 | - - - -### 方法 - -| 方法名 | 说明 | 参数 | -| ----------- | ------- | -------------------------- | -| isFrontDate | 是否为最小日期 | — | -| isFinalDate | 是否为最大日期 | — | -| setValue | 设置日期 | object: {year, month, day} | -| getVlaue | 获得日期 | — | - ------- \ No newline at end of file diff --git a/docs/_book/case/clipboard.html b/docs/_book/case/clipboard.html deleted file mode 100644 index 0704419ee..000000000 --- a/docs/_book/case/clipboard.html +++ /dev/null @@ -1,2571 +0,0 @@ - - - - - - - clipboard · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                        -
                                                        - - - - - - - - -
                                                        - -
                                                        - -
                                                        - - - - - - - - -
                                                        -
                                                        - -
                                                        -
                                                        - -
                                                        - -

                                                        bi.clipboard

                                                        -

                                                        剪切板

                                                        -
                                                        
                                                        -BI.createWidget({
                                                        -    type: 'bi.clipboard',
                                                        -    width: 100,
                                                        -    height: 100,
                                                        -    copy: function () {},
                                                        -
                                                        -    afterCopy: function () {}
                                                        -});
                                                        -
                                                        -
                                                        - - - -

                                                        参数

                                                        - - - - - - - - - - - - - - - - - - - - - - - -
                                                        参数说明类型默认值
                                                        copy获取需要拷贝的值functionBI.emptyFn
                                                        afterCopy完成拷贝后执行的方法functionBI.emptyFn
                                                        -
                                                        - - -
                                                        - -
                                                        -
                                                        -
                                                        - -

                                                        results matching ""

                                                        -
                                                          - -
                                                          -
                                                          - -

                                                          No results matching ""

                                                          - -
                                                          -
                                                          -
                                                          - -
                                                          -
                                                          - -
                                                          - - - - -
                                                          - - -
                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/clipboard.md b/docs/_book/case/clipboard.md deleted file mode 100644 index afd485beb..000000000 --- a/docs/_book/case/clipboard.md +++ /dev/null @@ -1,33 +0,0 @@ -# bi.clipboard - -### 剪切板 - -{% method %} -[source](https://jsfiddle.net/fineui/kLzq99c3/) - -{% common %} -```javascript - -BI.createWidget({ - type: 'bi.clipboard', - width: 100, - height: 100, - copy: function () {}, - - afterCopy: function () {} -}); - -``` - -{% endmethod %} - - - -### 参数 - -| 参数 | 说明 | 类型 | 默认值 | -| --------- | ---------- | -------- | ---------- | -| copy | 获取需要拷贝的值 | function | BI.emptyFn | -| afterCopy | 完成拷贝后执行的方法 | function | BI.emptyFn | - ------- \ No newline at end of file diff --git a/docs/_book/case/color_chooser.html b/docs/_book/case/color_chooser.html deleted file mode 100644 index f32baff3f..000000000 --- a/docs/_book/case/color_chooser.html +++ /dev/null @@ -1,2571 +0,0 @@ - - - - - - - color_chooser · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                          -
                                                          - - - - - - - - -
                                                          - -
                                                          - -
                                                          - - - - - - - - -
                                                          -
                                                          - -
                                                          -
                                                          - -
                                                          - -

                                                          bi.color_chooser

                                                          -

                                                          选色控件

                                                          -
                                                          
                                                          -BI.createWidget({
                                                          -    type: "bi.color_chooser",
                                                          -    element: "#wrapper",
                                                          -    width: 30,
                                                          -    height: 30
                                                          -});
                                                          -
                                                          -
                                                          - - - -

                                                          方法

                                                          - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                          方法名说明参数
                                                          isViewVisible判断是否显示
                                                          setValue设置颜色值color
                                                          getValue获取颜色值
                                                          -
                                                          - - -
                                                          - -
                                                          -
                                                          -
                                                          - -

                                                          results matching ""

                                                          -
                                                            - -
                                                            -
                                                            - -

                                                            No results matching ""

                                                            - -
                                                            -
                                                            -
                                                            - -
                                                            -
                                                            - -
                                                            - - - - -
                                                            - - -
                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/color_chooser.md b/docs/_book/case/color_chooser.md deleted file mode 100644 index b8627be06..000000000 --- a/docs/_book/case/color_chooser.md +++ /dev/null @@ -1,32 +0,0 @@ -# bi.color_chooser - -### 选色控件 - -{% method %} -[source](https://jsfiddle.net/fineui/z4fwweg9/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.color_chooser", - element: "#wrapper", - width: 30, - height: 30 -}); - -``` - -{% endmethod %} - - - -### 方法 - -| 方法名 | 说明 | 参数 | -| ------------- | ------ | ----- | -| isViewVisible | 判断是否显示 | — | -| setValue | 设置颜色值 | color | -| getValue | 获取颜色值 | — | - ------- \ No newline at end of file diff --git a/docs/_book/case/color_chooser_popup.html b/docs/_book/case/color_chooser_popup.html deleted file mode 100644 index 0a47f80a6..000000000 --- a/docs/_book/case/color_chooser_popup.html +++ /dev/null @@ -1,2602 +0,0 @@ - - - - - - - color_chooser_popup · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                            -
                                                            - - - - - - - - -
                                                            - -
                                                            - -
                                                            - - - - - - - - -
                                                            -
                                                            - -
                                                            -
                                                            - -
                                                            - -

                                                            bi.color_chooser_popup

                                                            -

                                                            选色控件弹窗

                                                            -
                                                            
                                                            -BI.createWidget({
                                                            -    type: "bi.color_chooser_popup",
                                                            -});
                                                            -
                                                            -
                                                            - - - -

                                                            参数

                                                            - - - - - - - - - - - - - - - - - -
                                                            参数说明类型默认值
                                                            height高度number145
                                                            -

                                                            方法

                                                            - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                            方法名说明参数
                                                            setStoreColors设置储存的颜色值colors
                                                            setValue设置颜色值color
                                                            getValue获取颜色值
                                                            -

                                                            事件

                                                            - - - - - - - - - - - - - -
                                                            事件说明
                                                            EVENT_VALUE_CHANGE颜色值改变时触发
                                                            -
                                                            - - -
                                                            - -
                                                            -
                                                            -
                                                            - -

                                                            results matching ""

                                                            -
                                                              - -
                                                              -
                                                              - -

                                                              No results matching ""

                                                              - -
                                                              -
                                                              -
                                                              - -
                                                              -
                                                              - -
                                                              - - - - -
                                                              - - -
                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/color_chooser_popup.md b/docs/_book/case/color_chooser_popup.md deleted file mode 100644 index f279f76ac..000000000 --- a/docs/_book/case/color_chooser_popup.md +++ /dev/null @@ -1,45 +0,0 @@ -# bi.color_chooser_popup - -### 选色控件弹窗 - -{% method %} -[source](https://jsfiddle.net/fineui/xL7moydu/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.color_chooser_popup", -}); - -``` - -{% endmethod %} - - - -### 参数 - -| 参数 | 说明 | 类型 | 默认值 | -| ------ | ---- | ------ | ---- | -| height | 高度 | number | 145 | - - - -### 方法 - -| 方法名 | 说明 | 参数 | -| -------------- | -------- | ------ | -| setStoreColors | 设置储存的颜色值 | colors | -| setValue | 设置颜色值 | color | -| getValue | 获取颜色值 | — | - - - -### 事件 - -| 事件 | 说明 | -| ------------------ | -------- | -| EVENT_VALUE_CHANGE | 颜色值改变时触发 | - ------- \ No newline at end of file diff --git a/docs/_book/case/combo/bubble_combo.html b/docs/_book/case/combo/bubble_combo.html deleted file mode 100644 index ce94e3e66..000000000 --- a/docs/_book/case/combo/bubble_combo.html +++ /dev/null @@ -1,2755 +0,0 @@ - - - - - - - bubble_combo · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                              -
                                                              - - - - - - - - -
                                                              - -
                                                              - -
                                                              - - - - - - - - -
                                                              -
                                                              - -
                                                              -
                                                              - -
                                                              - -

                                                              bi.bubble_combo

                                                              -

                                                              表示一个可以展开的节点, 不仅有选中状态而且有展开状态, 基类BI.Widget

                                                              -
                                                              
                                                              -BI.createWidget({
                                                              -    type: "bi.bubble_combo",
                                                              -    element:"#wrapper",
                                                              -    el: {
                                                              -      type: "bi.button",
                                                              -      text: "测试",
                                                              -      height: 25
                                                              -    },
                                                              -    popup: {
                                                              -      el: {
                                                              -        type: "bi.button_group",
                                                              -        items: BI.makeArray(100, {
                                                              -          type: "bi.text_item",
                                                              -          height: 25,
                                                              -          text: "item"
                                                              -        }),
                                                              -        layouts: [{
                                                              -          type: "bi.vertical"
                                                              -        }]
                                                              -      },
                                                              -      maxHeight: 200
                                                              -    }
                                                              -  })
                                                              -
                                                              -
                                                              - -

                                                              API

                                                              -
                                                              基础属性
                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                              参数说明类型可选值默认值
                                                              text组件text值string""
                                                              value组件value值string""
                                                              stopEvent阻止事件booleantrue,falsefalse
                                                              stopPropagation阻止冒泡booleantrue,falsefalse
                                                              selectedbutton的选中状态booleantrue,falsefalse
                                                              once点击一次选中有效,再点无效booleantrue,falsefalse
                                                              forceSelected点击即选中, 选中了就不会被取消,与once的区别是forceSelected不影响事件的触发booleantrue,falsefalse
                                                              forceNotSelected无论怎么点击都不会被选中booleantrue,falsefalse
                                                              disableSelected使能选中booleantrue,falsefalse
                                                              shadow是否显示阴影booleantrue,falsefalse
                                                              isShadowShowingOnSelected选中状态下是否显示阴影booleantrue,falsefalse
                                                              trigger被选元素要触发的事件stringmousedown, mouseup, click, dblclick, lclicknull
                                                              handler点击事件回调functionBI.emptyFn
                                                              -

                                                              对外方法

                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                              名称说明回调参数
                                                              bindEvent绑定事件
                                                              beforeClick点击事件之前
                                                              doClick点击事件
                                                              handle返回该对象
                                                              hoverhover事件
                                                              dishover取消hover事件
                                                              setSelected设置选中的文本b
                                                              isSelected是否被选中
                                                              isOnce是否只允许点击一次
                                                              isForceSelected判断是否点击即选中
                                                              isForceNotSelected判断是否怎么点击都不会被选中
                                                              isDisableSelected判断是否让选中
                                                              setText设置文本值
                                                              getText获取文本值
                                                              empty清空组件
                                                              destroy销毁组件
                                                              -
                                                              - - -
                                                              - -
                                                              -
                                                              -
                                                              - -

                                                              results matching ""

                                                              -
                                                                - -
                                                                -
                                                                - -

                                                                No results matching ""

                                                                - -
                                                                -
                                                                -
                                                                - -
                                                                -
                                                                - -
                                                                - - - - -
                                                                - - -
                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/combo/bubble_combo.md b/docs/_book/case/combo/bubble_combo.md deleted file mode 100644 index c35d143df..000000000 --- a/docs/_book/case/combo/bubble_combo.md +++ /dev/null @@ -1,86 +0,0 @@ -# bi.bubble_combo - -## 表示一个可以展开的节点, 不仅有选中状态而且有展开状态, 基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/urvt04so/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.bubble_combo", - element:"#wrapper", - el: { - type: "bi.button", - text: "测试", - height: 25 - }, - popup: { - el: { - type: "bi.button_group", - items: BI.makeArray(100, { - type: "bi.text_item", - height: 25, - text: "item" - }), - layouts: [{ - type: "bi.vertical" - }] - }, - maxHeight: 200 - } - }) - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| text | 组件text值 | string | —| "" | -| value | 组件value值 | string |— |""| -| stopEvent | 阻止事件 |boolean | true,false | false | -| stopPropagation | 阻止冒泡 | boolean | true,false| false | -| selected | button的选中状态 | boolean | true,false |false | -| once | 点击一次选中有效,再点无效 | boolean | true,false | false| -| forceSelected | 点击即选中, 选中了就不会被取消,与once的区别是forceSelected不影响事件的触发| boolean | true,false| false| -| forceNotSelected | 无论怎么点击都不会被选中 | boolean| true,false | false| -| disableSelected | 使能选中| boolean | true,false| false| -| shadow | 是否显示阴影 | boolean| true,false| false| -| isShadowShowingOnSelected| 选中状态下是否显示阴影|boolean| true,false | false| -| trigger | 被选元素要触发的事件 | string | mousedown, mouseup, click, dblclick, lclick | null| -| handler | 点击事件回调 | function | —| BI.emptyFn | - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| bindEvent | 绑定事件| —| -| beforeClick | 点击事件之前 | —| -| doClick | 点击事件 | — | -| handle | 返回该对象 | —| -| hover | hover事件| —| -| dishover | 取消hover事件| —| -|setSelected | 设置选中的文本| b| -| isSelected | 是否被选中| —| -| isOnce | 是否只允许点击一次| —| -| isForceSelected| 判断是否点击即选中| —| -| isForceNotSelected| 判断是否怎么点击都不会被选中|—| -| isDisableSelected| 判断是否让选中|—| -| setText| 设置文本值|—| -| getText| 获取文本值|—| -| empty| 清空组件|—| -| destroy| 销毁组件|—| - - - - - ---- - - diff --git a/docs/_book/case/combo/icon_combo.html b/docs/_book/case/combo/icon_combo.html deleted file mode 100644 index a53ff9324..000000000 --- a/docs/_book/case/combo/icon_combo.html +++ /dev/null @@ -1,2694 +0,0 @@ - - - - - - - icon_combo · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                -
                                                                - - - - - - - - -
                                                                - -
                                                                - -
                                                                - - - - - - - - -
                                                                -
                                                                - -
                                                                -
                                                                - -
                                                                - -

                                                                bi.icon_combo

                                                                -

                                                                切换trigger图标的combo 基类BI.Widget

                                                                -
                                                                
                                                                -BI.createWidget({
                                                                -  type: "bi.icon_combo",
                                                                -  element: "#wrapper",
                                                                -  iconClass: "rename-font",
                                                                -  items: [{
                                                                -    value: "第一项",
                                                                -    iconClass: "delete-font"
                                                                -  }, {
                                                                -    value: "第二项",
                                                                -    iconClass: "rename-font"
                                                                -  }, {
                                                                -    value: "第三项",
                                                                -    iconClass: "move-font"
                                                                -  }]
                                                                -});
                                                                -
                                                                -
                                                                - -

                                                                API

                                                                -
                                                                基础属性
                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                参数说明类型可选值默认值
                                                                width宽度number24
                                                                height高度number24
                                                                iconClassicon的类名string" "
                                                                el自定义下拉框triggerobject{ }
                                                                popup弹出层object{ }
                                                                minWidth最小宽度number100
                                                                maxWidth最大宽度string/number"auto"
                                                                maxHeight最大高度number300
                                                                adjustLength弹出列表和trigger的距离number0
                                                                adjustXOffset调整横向偏移number0
                                                                adjustYOffset调整纵向偏移number0
                                                                offsetStyle弹出层显示位置stringleft,right,center"left,right,center"
                                                                chooseType选择类型const参考button_groupBI.ButtonGroup.CHOOSE_TYPE_SINGLE
                                                                -

                                                                对外方法

                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                名称说明回调参数
                                                                setValue设置value值
                                                                getValue获取value值
                                                                showView显示弹出层
                                                                hideView隐藏弹出层
                                                                populate刷新列表items
                                                                -
                                                                - - -
                                                                - -
                                                                -
                                                                -
                                                                - -

                                                                results matching ""

                                                                -
                                                                  - -
                                                                  -
                                                                  - -

                                                                  No results matching ""

                                                                  - -
                                                                  -
                                                                  -
                                                                  - -
                                                                  -
                                                                  - -
                                                                  - - - - -
                                                                  - - -
                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/combo/icon_combo.md b/docs/_book/case/combo/icon_combo.md deleted file mode 100644 index 4a2229c8c..000000000 --- a/docs/_book/case/combo/icon_combo.md +++ /dev/null @@ -1,68 +0,0 @@ -# bi.icon_combo - -## 切换trigger图标的combo 基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/z02vzvtb/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.icon_combo", - element: "#wrapper", - iconClass: "rename-font", - items: [{ - value: "第一项", - iconClass: "delete-font" - }, { - value: "第二项", - iconClass: "rename-font" - }, { - value: "第三项", - iconClass: "move-font" - }] -}); - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| width | 宽度 | number | — | 24 -| height | 高度 | number | — | 24 -| iconClass | icon的类名 | string | —|" "| -| el | 自定义下拉框trigger| object | —|{ } | -| popup | 弹出层| object | —| { } -| minWidth| 最小宽度| number | —|100| -| maxWidth | 最大宽度 | string/number | — | "auto"| -| maxHeight | 最大高度 | number | —| 300 -| adjustLength | 弹出列表和trigger的距离 | number | — | 0 | -| adjustXOffset | 调整横向偏移 | number | — | 0 | -| adjustYOffset |调整纵向偏移 | number | — | 0 | -| offsetStyle | 弹出层显示位置 | string | left,right,center | "left,right,center"| -| chooseType | 选择类型 | const | 参考button_group | BI.ButtonGroup.CHOOSE_TYPE_SINGLE | - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setValue| 设置value值|—| -| getValue| 获取value值|—| -| showView | 显示弹出层 | —| -| hideView | 隐藏弹出层 |—| -| populate | 刷新列表 | items | - - - - - ---- - - diff --git a/docs/_book/case/combo/static_combo.html b/docs/_book/case/combo/static_combo.html deleted file mode 100644 index 5cdd94266..000000000 --- a/docs/_book/case/combo/static_combo.html +++ /dev/null @@ -1,2628 +0,0 @@ - - - - - - - static_combo · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                  -
                                                                  - - - - - - - - -
                                                                  - -
                                                                  - -
                                                                  - - - - - - - - -
                                                                  -
                                                                  - -
                                                                  -
                                                                  - -
                                                                  - -

                                                                  bi.static_combo

                                                                  -

                                                                  单选combo,trigger显示项不会改变 基类BI.Widget

                                                                  -
                                                                  
                                                                  -BI.createWidget({
                                                                  -    type: "bi.static_combo",
                                                                  -    element: "#wrapper",
                                                                  -    text: "Value 不变",
                                                                  -    items: [{
                                                                  -      text: "1",
                                                                  -      value: 1
                                                                  -    }, {
                                                                  -      text: "2",
                                                                  -      value: 2
                                                                  -    }, {
                                                                  -      text: "3",
                                                                  -      value: 3
                                                                  -    }]
                                                                  -  });
                                                                  -
                                                                  -
                                                                  - -

                                                                  API

                                                                  -
                                                                  基础属性
                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                  参数说明类型可选值默认值
                                                                  height高度number24
                                                                  el自定义下拉框triggerobject{ }
                                                                  items子组件array[ ]
                                                                  text文本内容string" "
                                                                  chooseType选择类型const参考button_groupBI.ButtonGroup.CHOOSE_TYPE_SINGLE
                                                                  -

                                                                  对外方法

                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                  名称说明回调参数
                                                                  setValue设置value值
                                                                  getValue获取value值
                                                                  populate刷新列表items
                                                                  -
                                                                  - - -
                                                                  - -
                                                                  -
                                                                  -
                                                                  - -

                                                                  results matching ""

                                                                  -
                                                                    - -
                                                                    -
                                                                    - -

                                                                    No results matching ""

                                                                    - -
                                                                    -
                                                                    -
                                                                    - -
                                                                    -
                                                                    - -
                                                                    - - - - -
                                                                    - - -
                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/combo/static_combo.md b/docs/_book/case/combo/static_combo.md deleted file mode 100644 index c6417aa64..000000000 --- a/docs/_book/case/combo/static_combo.md +++ /dev/null @@ -1,58 +0,0 @@ -# bi.static_combo - -## 单选combo,trigger显示项不会改变 基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/kn64gfzn/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.static_combo", - element: "#wrapper", - text: "Value 不变", - items: [{ - text: "1", - value: 1 - }, { - text: "2", - value: 2 - }, { - text: "3", - value: 3 - }] - }); - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| height | 高度 | number | — | 24 -| el | 自定义下拉框trigger| object | —|{ } | -| items | 子组件 | array | — | [ ] -| text | 文本内容 | string | — | " " | -| chooseType | 选择类型 | const |参考button_group | BI.ButtonGroup.CHOOSE_TYPE_SINGLE | - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setValue| 设置value值|—| -| getValue| 获取value值|—| -| populate | 刷新列表 | items | - - - - - ---- - - diff --git a/docs/_book/case/combo/text_value_combo.html b/docs/_book/case/combo/text_value_combo.html deleted file mode 100644 index 1761778c4..000000000 --- a/docs/_book/case/combo/text_value_combo.html +++ /dev/null @@ -1,2622 +0,0 @@ - - - - - - - text_value_combo · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                    -
                                                                    - - - - - - - - -
                                                                    - -
                                                                    - -
                                                                    - - - - - - - - -
                                                                    -
                                                                    - -
                                                                    -
                                                                    - -
                                                                    - -

                                                                    bi.text_value_combo

                                                                    -

                                                                    基类BI.Widget

                                                                    -
                                                                    
                                                                    -BI.createWidget({
                                                                    -  type: "bi.text_value_combo",
                                                                    -  element: "#wrapper",
                                                                    -  text: "value_combo",
                                                                    -  width: 300,
                                                                    -  items: [{
                                                                    -    text: "1",
                                                                    -    value: 1
                                                                    -  }, {
                                                                    -    text: "2",
                                                                    -    value: 2
                                                                    -  }, {
                                                                    -    text: "3",
                                                                    -    value: 3
                                                                    -  }]
                                                                    -});
                                                                    -
                                                                    -
                                                                    - -

                                                                    API

                                                                    -
                                                                    基础属性
                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                    参数说明类型可选值默认值
                                                                    height高度number30
                                                                    el自定义下拉框triggerobject{ }
                                                                    text文本内容string" "
                                                                    chooseType选择类型const参考button_groupBI.ButtonGroup.CHOOSE_TYPE_SINGLE
                                                                    -

                                                                    对外方法

                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                    名称说明回调参数
                                                                    setValue设置value值
                                                                    getValue获取value值
                                                                    populate刷新列表items
                                                                    -
                                                                    - - -
                                                                    - -
                                                                    -
                                                                    -
                                                                    - -

                                                                    results matching ""

                                                                    -
                                                                      - -
                                                                      -
                                                                      - -

                                                                      No results matching ""

                                                                      - -
                                                                      -
                                                                      -
                                                                      - -
                                                                      -
                                                                      - -
                                                                      - - - - -
                                                                      - - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/combo/text_value_combo.md b/docs/_book/case/combo/text_value_combo.md deleted file mode 100644 index 0111637b7..000000000 --- a/docs/_book/case/combo/text_value_combo.md +++ /dev/null @@ -1,58 +0,0 @@ -# bi.text_value_combo - -## 基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/hcf0kd9m/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.text_value_combo", - element: "#wrapper", - text: "value_combo", - width: 300, - items: [{ - text: "1", - value: 1 - }, { - text: "2", - value: 2 - }, { - text: "3", - value: 3 - }] -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| height | 高度 | number | — | 30 -| el | 自定义下拉框trigger| object |—|{ } | -| text | 文本内容 | string | — | " " | -| chooseType | 选择类型 | const |参考button_group | BI.ButtonGroup.CHOOSE_TYPE_SINGLE | - - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setValue| 设置value值|—| -| getValue| 获取value值|—| -| populate | 刷新列表 | items | - - - - - ---- - - diff --git a/docs/_book/case/combo/text_value_downlist_combo.html b/docs/_book/case/combo/text_value_downlist_combo.html deleted file mode 100644 index b6c380454..000000000 --- a/docs/_book/case/combo/text_value_downlist_combo.html +++ /dev/null @@ -1,2614 +0,0 @@ - - - - - - - text_value_downlist_combo · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      -
                                                                      - - - - - - - - -
                                                                      - -
                                                                      - -
                                                                      - - - - - - - - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      - -
                                                                      - -

                                                                      bi.text_value_down_list_combo

                                                                      -

                                                                      有二级下拉菜单的combo 基类BI.Widget

                                                                      -
                                                                      
                                                                      -BI.createWidget({
                                                                      -  type: "bi.text_value_down_list_combo",
                                                                      -  element: "#wrapper",
                                                                      -  text: "text",
                                                                      -  items: [
                                                                      -    [{
                                                                      -      el: {
                                                                      -        text: "1",
                                                                      -        value: 1
                                                                      -      },
                                                                      -      children: [{
                                                                      -        text: "11",
                                                                      -        value: 11
                                                                      -      }]
                                                                      -    }],
                                                                      -    [{
                                                                      -      text: "2",
                                                                      -      value: 2
                                                                      -    }, {
                                                                      -      text: "3",
                                                                      -      value: 3
                                                                      -    }]
                                                                      -  ]
                                                                      -});
                                                                      -
                                                                      -
                                                                      - -

                                                                      API

                                                                      -
                                                                      基础属性
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      参数说明类型可选值默认值
                                                                      height高度number30
                                                                      text文本内容string" "
                                                                      -

                                                                      对外方法

                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      名称说明回调参数
                                                                      setValue设置value值
                                                                      getValue获取value值
                                                                      populate刷新列表items
                                                                      -
                                                                      - - -
                                                                      - -
                                                                      -
                                                                      -
                                                                      - -

                                                                      results matching ""

                                                                      -
                                                                        - -
                                                                        -
                                                                        - -

                                                                        No results matching ""

                                                                        - -
                                                                        -
                                                                        -
                                                                        - -
                                                                        -
                                                                        - -
                                                                        - - - - -
                                                                        - - -
                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/complex_canvas.html b/docs/_book/case/complex_canvas.html deleted file mode 100644 index f979d0e1d..000000000 --- a/docs/_book/case/complex_canvas.html +++ /dev/null @@ -1,2569 +0,0 @@ - - - - - - - complex_canvas · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                        -
                                                                        - - - - - - - - -
                                                                        - -
                                                                        - -
                                                                        - - - - - - - - -
                                                                        -
                                                                        - -
                                                                        -
                                                                        - -
                                                                        - -

                                                                        complex_canvas

                                                                        -

                                                                        复杂的canvas绘图

                                                                        -
                                                                        
                                                                        -var canvas = BI.createWidget({
                                                                        -   type: "bi.complex_canvas",
                                                                        -        width: 500,
                                                                        -        height: 600
                                                                        -    });
                                                                        -canvas.branch(55, 100, 10, 10, 100, 10, 200, 10, {
                                                                        -     offset: 20,
                                                                        -     strokeStyle: "red",
                                                                        -     lineWidth: 2
                                                                        - });
                                                                        -
                                                                        -canvas.stroke();
                                                                        -
                                                                        -
                                                                        - -

                                                                        对外方法

                                                                        - - - - - - - - - - - - - - - - - - - -
                                                                        名称说明回调参数
                                                                        branch绘制树枝节点(x0, y0, x1, y1, x2, y2) (以x0, y0为根节点,分支到x1,y1, x2,y2...)
                                                                        stroke绘制
                                                                        -
                                                                        - - -
                                                                        - -
                                                                        -
                                                                        -
                                                                        - -

                                                                        results matching ""

                                                                        -
                                                                          - -
                                                                          -
                                                                          - -

                                                                          No results matching ""

                                                                          - -
                                                                          -
                                                                          -
                                                                          - -
                                                                          -
                                                                          - -
                                                                          - - - - -
                                                                          - - -
                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/complex_canvas.md b/docs/_book/case/complex_canvas.md deleted file mode 100644 index 8a358a502..000000000 --- a/docs/_book/case/complex_canvas.md +++ /dev/null @@ -1,37 +0,0 @@ -# complex_canvas - -## 复杂的canvas绘图 - -{% method %} -[source](https://jsfiddle.net/fineui/psozjkgn/) - -{% common %} -```javascript - -var canvas = BI.createWidget({ - type: "bi.complex_canvas", - width: 500, - height: 600 - }); -canvas.branch(55, 100, 10, 10, 100, 10, 200, 10, { - offset: 20, - strokeStyle: "red", - lineWidth: 2 - }); - -canvas.stroke(); - - -``` - -{% endmethod %} - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| branch | 绘制树枝节点| (x0, y0, x1, y1, x2, y2) (以x0, y0为根节点,分支到x1,y1, x2,y2...)| -| stroke | 绘制 | | - ---- - - diff --git a/docs/_book/case/editor/shelter_editor.html b/docs/_book/case/editor/shelter_editor.html deleted file mode 100644 index 3713c49cc..000000000 --- a/docs/_book/case/editor/shelter_editor.html +++ /dev/null @@ -1,2833 +0,0 @@ - - - - - - - shelter_editor · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                          -
                                                                          - - - - - - - - -
                                                                          - -
                                                                          - -
                                                                          - - - - - - - - -
                                                                          -
                                                                          - -
                                                                          -
                                                                          - -
                                                                          - -

                                                                          bi.shelter_editor

                                                                          -

                                                                          带标记的文本框,需手动控制进入编辑状态 基类BI.Widget

                                                                          -
                                                                          
                                                                          -BI.createWidget({
                                                                          -    element: "#wrapper",
                                                                          -    type: "bi.shelter_editor",
                                                                          -    cls: "bi-border",
                                                                          -    width: 300,
                                                                          -    watermark: "这个是带标记的"
                                                                          -});
                                                                          -
                                                                          -
                                                                          - -

                                                                          API

                                                                          -
                                                                          基础属性
                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                          参数说明类型可选值默认值
                                                                          hgap效果相当于文本框左右padding值number4
                                                                          vgap效果相当于文本框上下padding值number2
                                                                          lgap效果相当于文本框left-padding值number0
                                                                          rgap效果相当于文本框right-padding值number0
                                                                          tgap效果相当于文本框top-padding值number0
                                                                          bgap效果相当于文本框bottom-padding值number0
                                                                          validationChecker输入较验函数function
                                                                          quitChecker是否允许退出编辑函数function
                                                                          allowBlank是否允许空值booleantrue,falsetrue
                                                                          watermark文本框placeholderstring" "
                                                                          errorText错误提示string/function" "
                                                                          height高度number30
                                                                          textAlign对齐方式stringleft,center,right"left"
                                                                          -

                                                                          对外方法

                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                          名称说明回调参数
                                                                          setErrorText设置错误文本text
                                                                          getErrorText获取错误文本
                                                                          focus文本框获取焦点
                                                                          blur文本框失焦
                                                                          onKeyDown按键事件key
                                                                          setValue设置文本框值value
                                                                          getLastValidValue获取文本框最后一次输入的有效值
                                                                          setTextStyle设置文本框样式style
                                                                          getValue获取文本框值
                                                                          isEditing文本框是否处于编辑状态
                                                                          isValid文本框值是否有效
                                                                          doRedMark文本标红
                                                                          unRedMark取消文本标红
                                                                          doHighLight文本高亮
                                                                          unHighLight取消文本高亮
                                                                          setTitle设置titletitle
                                                                          setWarningTitle设置错误titletitle
                                                                          setState设置文本框值
                                                                          getState获取文本框值
                                                                          -

                                                                          事件

                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                          事件说明
                                                                          BI.Editor.EVENT_CHANGEeditor的value发生改变触发
                                                                          BI.Editor.EVENT_FOCUSfocus事件
                                                                          BI.Editor.EVENT_BLURblur事件
                                                                          BI.Editor.EVENT_CLICK点击编辑框触发(不在编辑状态时)
                                                                          BI.Editor.EVENT_KEY_DOWNkeyDown时触发
                                                                          BI.Editor.EVENT_SPACE按下空格触发
                                                                          BI.Editor.EVENT_BACKSPACE按下Backspace触发
                                                                          BI.Editor.EVENT_START开始输入触发
                                                                          BI.Editor.EVENT_PAUSE暂停输入触发(输入空白字符)
                                                                          BI.Editor.EVENT_STOP停止输入触发
                                                                          BI.Editor.EVENT_CONFIRM确定输入触发(blur时且输入值有效)
                                                                          BI.Editor.EVENT_VALID输入值有效的状态事件
                                                                          BI.Editor.EVENT_ERROR输入值无效的状态事件
                                                                          BI.Editor.EVENT_ENTER回车事件
                                                                          BI.Editor.EVENT_RESTRICT回车但是值不合法
                                                                          BI.Editor.EVENT_REMOVE输入为空时按下backspace
                                                                          BI.Editor.EVENT_EMPTY输入框为空时触发
                                                                          -
                                                                          - - -
                                                                          - -
                                                                          -
                                                                          -
                                                                          - -

                                                                          results matching ""

                                                                          -
                                                                            - -
                                                                            -
                                                                            - -

                                                                            No results matching ""

                                                                            - -
                                                                            -
                                                                            -
                                                                            - -
                                                                            -
                                                                            - -
                                                                            - - - - -
                                                                            - - -
                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/editor/shelter_editor.md b/docs/_book/case/editor/shelter_editor.md deleted file mode 100644 index 58e28c372..000000000 --- a/docs/_book/case/editor/shelter_editor.md +++ /dev/null @@ -1,93 +0,0 @@ -# bi.shelter_editor - -## 带标记的文本框,需手动控制进入编辑状态 基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/9Lbx6kga/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.shelter_editor", - cls: "bi-border", - width: 300, - watermark: "这个是带标记的" -}); - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| hgap | 效果相当于文本框左右padding值 | number | — | 4 | -| vgap | 效果相当于文本框上下padding值 | number | — | 2 | -| lgap | 效果相当于文本框left-padding值 | number | — | 0 | -| rgap | 效果相当于文本框right-padding值 | number | — | 0 | -| tgap |效果相当于文本框top-padding值 | number | — | 0 | -| bgap | 效果相当于文本框bottom-padding值 | number | — | 0 | -| validationChecker | 输入较验函数 |function| — | — | -| quitChecker | 是否允许退出编辑函数 | function | — | — | -| allowBlank | 是否允许空值 | boolean | true,false | true | -| watermark | 文本框placeholder | string | — | " " | -| errorText | 错误提示 | string/function | —| " "| -| height| 高度| number |— | 30| -| textAlign| 对齐方式 | string |left,center,right |"left"| - - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setErrorText | 设置错误文本 | text | -| getErrorText | 获取错误文本 | —| -| focus | 文本框获取焦点| — | -| blur | 文本框失焦|—| -| onKeyDown |按键事件|key| -| setValue | 设置文本框值|value| -| getLastValidValue | 获取文本框最后一次输入的有效值| —| -| setTextStyle| 设置文本框样式| style | -| getValue | 获取文本框值|—| -| isEditing | 文本框是否处于编辑状态|—| -| isValid | 文本框值是否有效|—| -| doRedMark | 文本标红 | — | -| unRedMark | 取消文本标红| —| -| doHighLight | 文本高亮 | —| -| unHighLight | 取消文本高亮 | —| -| setTitle| 设置title | title| -| setWarningTitle| 设置错误title | title | -| setState | 设置文本框值 |— -| getState | 获取文本框值 | — - -## 事件 -| 事件 | 说明 | -| :------ |:------------- | -|BI.Editor.EVENT_CHANGE | editor的value发生改变触发 | -|BI.Editor.EVENT_FOCUS | focus事件 | -|BI.Editor.EVENT_BLUR | blur事件 | -|BI.Editor.EVENT_CLICK | 点击编辑框触发(不在编辑状态时) | -|BI.Editor.EVENT_KEY_DOWN | keyDown时触发 | -|BI.Editor.EVENT_SPACE | 按下空格触发 | -|BI.Editor.EVENT_BACKSPACE | 按下Backspace触发 | -|BI.Editor.EVENT_START | 开始输入触发 | -|BI.Editor.EVENT_PAUSE | 暂停输入触发(输入空白字符) | -|BI.Editor.EVENT_STOP | 停止输入触发 | -|BI.Editor.EVENT_CONFIRM | 确定输入触发(blur时且输入值有效) | -|BI.Editor.EVENT_VALID | 输入值有效的状态事件 | -|BI.Editor.EVENT_ERROR | 输入值无效的状态事件 | -|BI.Editor.EVENT_ENTER | 回车事件 | -|BI.Editor.EVENT_RESTRICT | 回车但是值不合法 | -|BI.Editor.EVENT_REMOVE | 输入为空时按下backspace | -|BI.Editor.EVENT_EMPTY | 输入框为空时触发 | - - - - ---- - - diff --git a/docs/_book/case/editor/sign_editor.html b/docs/_book/case/editor/sign_editor.html deleted file mode 100644 index 33a72075c..000000000 --- a/docs/_book/case/editor/sign_editor.html +++ /dev/null @@ -1,2819 +0,0 @@ - - - - - - - sign_editor · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                            -
                                                                            - - - - - - - - -
                                                                            - -
                                                                            - -
                                                                            - - - - - - - - -
                                                                            -
                                                                            - -
                                                                            -
                                                                            - -
                                                                            - -

                                                                            bi.sign_editor

                                                                            -

                                                                            带标记的文本框,基类BI.Widget

                                                                            -
                                                                            
                                                                            -BI.createWidget({
                                                                            -    element: "#wrapper",
                                                                            -    type: "bi.sign_editor",
                                                                            -    cls:"layout-bg5",
                                                                            -    value: "123",
                                                                            -    text: "456",
                                                                            -    width: 300
                                                                            -});
                                                                            -
                                                                            -
                                                                            - -

                                                                            API

                                                                            -
                                                                            基础属性
                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                            参数说明类型可选值默认值
                                                                            hgap效果相当于文本框左右padding值number4
                                                                            vgap效果相当于文本框上下padding值number2
                                                                            lgap效果相当于文本框left-padding值number0
                                                                            rgap效果相当于文本框right-padding值number0
                                                                            tgap效果相当于文本框top-padding值number0
                                                                            bgap效果相当于文本框bottom-padding值number0
                                                                            validationChecker输入较验函数function
                                                                            quitChecker是否允许退出编辑函数function
                                                                            allowBlank是否允许空值booleantrue,falsetrue
                                                                            watermark文本框placeholderstring" "
                                                                            errorText错误提示string/function" "
                                                                            height高度number30
                                                                            -

                                                                            对外方法

                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                            名称说明回调参数
                                                                            setErrorText设置错误文本text
                                                                            getErrorText获取错误文本
                                                                            focus文本框获取焦点
                                                                            blur文本框失焦
                                                                            setValue设置文本框值value
                                                                            getLastValidValue获取文本框最后一次输入的有效值
                                                                            getValue获取文本框值
                                                                            isEditing文本框是否处于编辑状态
                                                                            isValid文本框值是否有效
                                                                            doRedMark文本标红
                                                                            unRedMark取消文本标红
                                                                            doHighLight文本高亮
                                                                            unHighLight取消文本高亮
                                                                            setTitle设置titletitle
                                                                            setWarningTitle设置错误titletitle
                                                                            setState设置文本框值
                                                                            getState获取文本框值
                                                                            -

                                                                            事件

                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                            事件说明
                                                                            BI.Editor.EVENT_CHANGEeditor的value发生改变触发
                                                                            BI.Editor.EVENT_FOCUSfocus事件
                                                                            BI.Editor.EVENT_BLURblur事件
                                                                            BI.Editor.EVENT_CLICK点击编辑框触发(不在编辑状态时)
                                                                            BI.Editor.EVENT_KEY_DOWNkeyDown时触发
                                                                            BI.Editor.EVENT_SPACE按下空格触发
                                                                            BI.Editor.EVENT_BACKSPACE按下Backspace触发
                                                                            BI.Editor.EVENT_START开始输入触发
                                                                            BI.Editor.EVENT_PAUSE暂停输入触发(输入空白字符)
                                                                            BI.Editor.EVENT_STOP停止输入触发
                                                                            BI.Editor.EVENT_CONFIRM确定输入触发(blur时且输入值有效)
                                                                            BI.Editor.EVENT_VALID输入值有效的状态事件
                                                                            BI.Editor.EVENT_ERROR输入值无效的状态事件
                                                                            BI.Editor.EVENT_ENTER回车事件
                                                                            BI.Editor.EVENT_RESTRICT回车但是值不合法
                                                                            BI.Editor.EVENT_REMOVE输入为空时按下backspace
                                                                            BI.Editor.EVENT_EMPTY输入框为空时触发
                                                                            -
                                                                            - - -
                                                                            - -
                                                                            -
                                                                            -
                                                                            - -

                                                                            results matching ""

                                                                            -
                                                                              - -
                                                                              -
                                                                              - -

                                                                              No results matching ""

                                                                              - -
                                                                              -
                                                                              -
                                                                              - -
                                                                              -
                                                                              - -
                                                                              - - - - -
                                                                              - - -
                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/editor/sign_editor.md b/docs/_book/case/editor/sign_editor.md deleted file mode 100644 index 11dffc2e0..000000000 --- a/docs/_book/case/editor/sign_editor.md +++ /dev/null @@ -1,91 +0,0 @@ -# bi.sign_editor - -## 带标记的文本框,基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/tmdedu5t/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.sign_editor", - cls:"layout-bg5", - value: "123", - text: "456", - width: 300 -}); - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| hgap | 效果相当于文本框左右padding值 | number | — | 4 | -| vgap | 效果相当于文本框上下padding值 | number | —| 2 | -| lgap | 效果相当于文本框left-padding值 | number | — | 0 | -| rgap | 效果相当于文本框right-padding值 | number | — | 0 | -| tgap |效果相当于文本框top-padding值 | number | — | 0 | -| bgap | 效果相当于文本框bottom-padding值 | number | — | 0 | -| validationChecker | 输入较验函数 |function| — | — | -| quitChecker | 是否允许退出编辑函数 | function | — | — | -| allowBlank | 是否允许空值 | boolean | true,false | true | -| watermark | 文本框placeholder | string | — | " " | -| errorText | 错误提示 | string/function | —| " "| -| height| 高度| number |— | 30| - - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setErrorText | 设置错误文本 | text | -| getErrorText | 获取错误文本 | —| -| focus | 文本框获取焦点| — | -| blur | 文本框失焦|—| -| setValue | 设置文本框值|value| -| getLastValidValue | 获取文本框最后一次输入的有效值| —| -| getValue | 获取文本框值|—| -| isEditing | 文本框是否处于编辑状态|—| -| isValid | 文本框值是否有效|—| -| doRedMark | 文本标红 | — | -| unRedMark | 取消文本标红| —| -| doHighLight | 文本高亮 | —| -| unHighLight | 取消文本高亮 | —| -| setTitle| 设置title | title| -| setWarningTitle| 设置错误title | title | -| setState | 设置文本框值 |— -| getState | 获取文本框值 | — - -## 事件 -| 事件 | 说明 | -| :------ |:------------- | -|BI.Editor.EVENT_CHANGE | editor的value发生改变触发 | -|BI.Editor.EVENT_FOCUS | focus事件 | -|BI.Editor.EVENT_BLUR | blur事件 | -|BI.Editor.EVENT_CLICK | 点击编辑框触发(不在编辑状态时) | -|BI.Editor.EVENT_KEY_DOWN | keyDown时触发 | -|BI.Editor.EVENT_SPACE | 按下空格触发 | -|BI.Editor.EVENT_BACKSPACE | 按下Backspace触发 | -|BI.Editor.EVENT_START | 开始输入触发 | -|BI.Editor.EVENT_PAUSE | 暂停输入触发(输入空白字符) | -|BI.Editor.EVENT_STOP | 停止输入触发 | -|BI.Editor.EVENT_CONFIRM | 确定输入触发(blur时且输入值有效) | -|BI.Editor.EVENT_VALID | 输入值有效的状态事件 | -|BI.Editor.EVENT_ERROR | 输入值无效的状态事件 | -|BI.Editor.EVENT_ENTER | 回车事件 | -|BI.Editor.EVENT_RESTRICT | 回车但是值不合法 | -|BI.Editor.EVENT_REMOVE | 输入为空时按下backspace | -|BI.Editor.EVENT_EMPTY | 输入框为空时触发 | - - - - ---- - - diff --git a/docs/_book/case/editor/sign_initial_editor.html b/docs/_book/case/editor/sign_initial_editor.html deleted file mode 100644 index 50819d8bf..000000000 --- a/docs/_book/case/editor/sign_initial_editor.html +++ /dev/null @@ -1,2832 +0,0 @@ - - - - - - - sign_initial_editor · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                              -
                                                                              - - - - - - - - -
                                                                              - -
                                                                              - -
                                                                              - - - - - - - - -
                                                                              -
                                                                              - -
                                                                              -
                                                                              - -
                                                                              - -

                                                                              bi.sign_initial_editor

                                                                              -

                                                                              指定初始值 之后初始值会一直显示的editor 基类BI.Widget

                                                                              -
                                                                              
                                                                              -BI.createWidget({
                                                                              -    element: "#wrapper",
                                                                              -    type: "bi.sign_initial_editor",
                                                                              -    cls: "layout-bg5",
                                                                              -    text: "原始值",
                                                                              -    width: 300
                                                                              -});
                                                                              -
                                                                              -
                                                                              - -

                                                                              API

                                                                              -
                                                                              基础属性
                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                              参数说明类型可选值默认值
                                                                              hgap效果相当于文本框左右padding值number4
                                                                              vgap效果相当于文本框上下padding值number2
                                                                              lgap效果相当于文本框left-padding值number0
                                                                              rgap效果相当于文本框right-padding值number0
                                                                              tgap效果相当于文本框top-padding值number0
                                                                              bgap效果相当于文本框bottom-padding值number0
                                                                              validationChecker输入较验函数function
                                                                              quitChecker是否允许退出编辑函数function
                                                                              allowBlank是否允许空值booleantrue,falsetrue
                                                                              watermark文本框placeholderstring" "
                                                                              errorText错误提示string/function" "
                                                                              height高度number30
                                                                              text文本内容string" "
                                                                              value文本value值string" "
                                                                              -

                                                                              对外方法

                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                              名称说明回调参数
                                                                              setErrorText设置错误文本text
                                                                              getErrorText获取错误文本
                                                                              focus文本框获取焦点
                                                                              blur文本框失焦
                                                                              setValue设置文本框值value
                                                                              getLastValidValue获取文本框最后一次输入的有效值
                                                                              getValue获取文本框值
                                                                              isEditing文本框是否处于编辑状态
                                                                              isValid文本框值是否有效
                                                                              doRedMark文本标红
                                                                              unRedMark取消文本标红
                                                                              doHighLight文本高亮
                                                                              unHighLight取消文本高亮
                                                                              setTitle设置titletitle
                                                                              setWarningTitle设置错误titletitle
                                                                              setState设置文本框值
                                                                              getState获取文本框值
                                                                              -

                                                                              事件

                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                              事件说明
                                                                              BI.Editor.EVENT_CHANGEeditor的value发生改变触发
                                                                              BI.Editor.EVENT_FOCUSfocus事件
                                                                              BI.Editor.EVENT_BLURblur事件
                                                                              BI.Editor.EVENT_CLICK点击编辑框触发(不在编辑状态时)
                                                                              BI.Editor.EVENT_KEY_DOWNkeyDown时触发
                                                                              BI.Editor.EVENT_SPACE按下空格触发
                                                                              BI.Editor.EVENT_BACKSPACE按下Backspace触发
                                                                              BI.Editor.EVENT_START开始输入触发
                                                                              BI.Editor.EVENT_PAUSE暂停输入触发(输入空白字符)
                                                                              BI.Editor.EVENT_STOP停止输入触发
                                                                              BI.Editor.EVENT_CONFIRM确定输入触发(blur时且输入值有效)
                                                                              BI.Editor.EVENT_VALID输入值有效的状态事件
                                                                              BI.Editor.EVENT_ERROR输入值无效的状态事件
                                                                              BI.Editor.EVENT_ENTER回车事件
                                                                              BI.Editor.EVENT_RESTRICT回车但是值不合法
                                                                              BI.Editor.EVENT_REMOVE输入为空时按下backspace
                                                                              BI.Editor.EVENT_EMPTY输入框为空时触发
                                                                              -
                                                                              - - -
                                                                              - -
                                                                              -
                                                                              -
                                                                              - -

                                                                              results matching ""

                                                                              -
                                                                                - -
                                                                                -
                                                                                - -

                                                                                No results matching ""

                                                                                - -
                                                                                -
                                                                                -
                                                                                - -
                                                                                -
                                                                                - -
                                                                                - - - - -
                                                                                - - -
                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/editor/sign_initial_editor.md b/docs/_book/case/editor/sign_initial_editor.md deleted file mode 100644 index c08af2c65..000000000 --- a/docs/_book/case/editor/sign_initial_editor.md +++ /dev/null @@ -1,92 +0,0 @@ -# bi.sign_initial_editor - -## 指定初始值 之后初始值会一直显示的editor 基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/9vjghevp/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.sign_initial_editor", - cls: "layout-bg5", - text: "原始值", - width: 300 -}); - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| hgap | 效果相当于文本框左右padding值 | number | — | 4 | -| vgap | 效果相当于文本框上下padding值 | number | — | 2 | -| lgap | 效果相当于文本框left-padding值 | number | — | 0 | -| rgap | 效果相当于文本框right-padding值 | number | — | 0 | -| tgap |效果相当于文本框top-padding值 | number | —| 0 | -| bgap | 效果相当于文本框bottom-padding值 | number | | 0 | -| validationChecker | 输入较验函数 |function| — | — | -| quitChecker | 是否允许退出编辑函数 | function | — | — | -| allowBlank | 是否允许空值 | boolean | true,false | true | -| watermark | 文本框placeholder | string | — | " " | -| errorText | 错误提示 | string/function | —| " "| -| height| 高度| number |— | 30| -| text | 文本内容 | string | —| " " | -| value | 文本value值 | string | — | " " | - - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setErrorText | 设置错误文本 | text | -| getErrorText | 获取错误文本 | —| -| focus | 文本框获取焦点| — | -| blur | 文本框失焦|—| -| setValue | 设置文本框值|value| -| getLastValidValue | 获取文本框最后一次输入的有效值| —| -| getValue | 获取文本框值|—| -| isEditing | 文本框是否处于编辑状态|—| -| isValid | 文本框值是否有效|—| -| doRedMark | 文本标红 | — | -| unRedMark | 取消文本标红| —| -| doHighLight | 文本高亮 | —| -| unHighLight | 取消文本高亮 | —| -| setTitle| 设置title | title| -| setWarningTitle| 设置错误title | title | -| setState | 设置文本框值 |— -| getState | 获取文本框值 | — - -## 事件 -| 事件 | 说明 | -| :------ |:------------- | -|BI.Editor.EVENT_CHANGE | editor的value发生改变触发 | -|BI.Editor.EVENT_FOCUS | focus事件 | -|BI.Editor.EVENT_BLUR | blur事件 | -|BI.Editor.EVENT_CLICK | 点击编辑框触发(不在编辑状态时) | -|BI.Editor.EVENT_KEY_DOWN | keyDown时触发 | -|BI.Editor.EVENT_SPACE | 按下空格触发 | -|BI.Editor.EVENT_BACKSPACE | 按下Backspace触发 | -|BI.Editor.EVENT_START | 开始输入触发 | -|BI.Editor.EVENT_PAUSE | 暂停输入触发(输入空白字符) | -|BI.Editor.EVENT_STOP | 停止输入触发 | -|BI.Editor.EVENT_CONFIRM | 确定输入触发(blur时且输入值有效) | -|BI.Editor.EVENT_VALID | 输入值有效的状态事件 | -|BI.Editor.EVENT_ERROR | 输入值无效的状态事件 | -|BI.Editor.EVENT_ENTER | 回车事件 | -|BI.Editor.EVENT_RESTRICT | 回车但是值不合法 | -|BI.Editor.EVENT_REMOVE | 输入为空时按下backspace | -|BI.Editor.EVENT_EMPTY | 输入框为空时触发 | - - - - ---- - - diff --git a/docs/_book/case/editor/state_editor.html b/docs/_book/case/editor/state_editor.html deleted file mode 100644 index 6047ece4f..000000000 --- a/docs/_book/case/editor/state_editor.html +++ /dev/null @@ -1,2806 +0,0 @@ - - - - - - - state_editor · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                -
                                                                                - - - - - - - - -
                                                                                - -
                                                                                - -
                                                                                - - - - - - - - -
                                                                                -
                                                                                - -
                                                                                -
                                                                                - -
                                                                                - -

                                                                                bi.state_editor

                                                                                -

                                                                                记录状态的输入框,基类BI.Widget

                                                                                -
                                                                                
                                                                                -BI.createWidget({
                                                                                -    element: "#wrapper",
                                                                                -    type: "bi.state_editor",
                                                                                -    value: "123",
                                                                                -    text: "456",
                                                                                -    width: 300
                                                                                -});
                                                                                -
                                                                                -
                                                                                - -

                                                                                API

                                                                                -
                                                                                基础属性
                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                参数说明类型可选值默认值
                                                                                hgap效果相当于文本框左右padding值number4
                                                                                vgap效果相当于文本框上下padding值number2
                                                                                lgap效果相当于文本框left-padding值number0
                                                                                rgap效果相当于文本框right-padding值number0
                                                                                tgap效果相当于文本框top-padding值number0
                                                                                bgap效果相当于文本框bottom-padding值number0
                                                                                validationChecker输入较验函数function
                                                                                quitChecker是否允许退出编辑函数function
                                                                                allowBlank是否允许空值booleantrue,falsetrue
                                                                                watermark文本框placeholderstring" "
                                                                                errorText错误提示string/function" "
                                                                                height高度number30
                                                                                -

                                                                                对外方法

                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                名称说明回调参数
                                                                                setErrorText设置错误文本text
                                                                                getErrorText获取错误文本
                                                                                focus文本框获取焦点
                                                                                blur文本框失焦
                                                                                setValue设置文本框值value
                                                                                getLastValidValue获取文本框最后一次输入的有效值
                                                                                getValue获取文本框值
                                                                                isEditing文本框是否处于编辑状态
                                                                                isValid文本框值是否有效
                                                                                doRedMark文本标红
                                                                                unRedMark取消文本标红
                                                                                doHighLight文本高亮
                                                                                unHighLight取消文本高亮
                                                                                setState设置文本框值
                                                                                getState获取文本框值
                                                                                -

                                                                                事件

                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                事件说明
                                                                                BI.Editor.EVENT_CHANGEeditor的value发生改变触发
                                                                                BI.Editor.EVENT_FOCUSfocus事件
                                                                                BI.Editor.EVENT_BLURblur事件
                                                                                BI.Editor.EVENT_CLICK点击编辑框触发(不在编辑状态时)
                                                                                BI.Editor.EVENT_KEY_DOWNkeyDown时触发
                                                                                BI.Editor.EVENT_SPACE按下空格触发
                                                                                BI.Editor.EVENT_BACKSPACE按下Backspace触发
                                                                                BI.Editor.EVENT_START开始输入触发
                                                                                BI.Editor.EVENT_PAUSE暂停输入触发(输入空白字符)
                                                                                BI.Editor.EVENT_STOP停止输入触发
                                                                                BI.Editor.EVENT_CONFIRM确定输入触发(blur时且输入值有效)
                                                                                BI.Editor.EVENT_VALID输入值有效的状态事件
                                                                                BI.Editor.EVENT_ERROR输入值无效的状态事件
                                                                                BI.Editor.EVENT_ENTER回车事件
                                                                                BI.Editor.EVENT_RESTRICT回车但是值不合法
                                                                                BI.Editor.EVENT_REMOVE输入为空时按下backspace
                                                                                BI.Editor.EVENT_EMPTY输入框为空时触发
                                                                                -
                                                                                - - -
                                                                                - -
                                                                                -
                                                                                -
                                                                                - -

                                                                                results matching ""

                                                                                -
                                                                                  - -
                                                                                  -
                                                                                  - -

                                                                                  No results matching ""

                                                                                  - -
                                                                                  -
                                                                                  -
                                                                                  - -
                                                                                  -
                                                                                  - -
                                                                                  - - - - -
                                                                                  - - -
                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/editor/state_editor.md b/docs/_book/case/editor/state_editor.md deleted file mode 100644 index 364a5cc0d..000000000 --- a/docs/_book/case/editor/state_editor.md +++ /dev/null @@ -1,89 +0,0 @@ -# bi.state_editor - -## 记录状态的输入框,基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/p68bwkmv/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.state_editor", - value: "123", - text: "456", - width: 300 -}); - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| hgap | 效果相当于文本框左右padding值 | number | — | 4 | -| vgap | 效果相当于文本框上下padding值 | number | — | 2 | -| lgap | 效果相当于文本框left-padding值 | number | — | 0 | -| rgap | 效果相当于文本框right-padding值 | number | — | 0 | -| tgap |效果相当于文本框top-padding值 | number | —| 0 | -| bgap | 效果相当于文本框bottom-padding值 | number | — | 0 | -| validationChecker | 输入较验函数 |function| — | — | -| quitChecker | 是否允许退出编辑函数 | function |— | — | -| allowBlank | 是否允许空值 | boolean | true,false | true | -| watermark | 文本框placeholder | string | —| " " | -| errorText | 错误提示 | string/function |— | " "| -| height| 高度| number |— | 30| - - - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setErrorText | 设置错误文本 | text | -| getErrorText | 获取错误文本 | —| -| focus | 文本框获取焦点| — | -| blur | 文本框失焦|—| -| setValue | 设置文本框值|value| -| getLastValidValue | 获取文本框最后一次输入的有效值| —| -| getValue | 获取文本框值|—| -| isEditing | 文本框是否处于编辑状态|—| -| isValid | 文本框值是否有效|—| -| doRedMark | 文本标红 | — | -| unRedMark | 取消文本标红| —| -| doHighLight | 文本高亮 | —| -| unHighLight | 取消文本高亮 | —| -| setState | 设置文本框值 |— -| getState | 获取文本框值 | — - -## 事件 -| 事件 | 说明 | -| :------ |:------------- | -|BI.Editor.EVENT_CHANGE | editor的value发生改变触发 | -|BI.Editor.EVENT_FOCUS | focus事件 | -|BI.Editor.EVENT_BLUR | blur事件 | -|BI.Editor.EVENT_CLICK | 点击编辑框触发(不在编辑状态时) | -|BI.Editor.EVENT_KEY_DOWN | keyDown时触发 | -|BI.Editor.EVENT_SPACE | 按下空格触发 | -|BI.Editor.EVENT_BACKSPACE | 按下Backspace触发 | -|BI.Editor.EVENT_START | 开始输入触发 | -|BI.Editor.EVENT_PAUSE | 暂停输入触发(输入空白字符) | -|BI.Editor.EVENT_STOP | 停止输入触发 | -|BI.Editor.EVENT_CONFIRM | 确定输入触发(blur时且输入值有效) | -|BI.Editor.EVENT_VALID | 输入值有效的状态事件 | -|BI.Editor.EVENT_ERROR | 输入值无效的状态事件 | -|BI.Editor.EVENT_ENTER | 回车事件 | -|BI.Editor.EVENT_RESTRICT | 回车但是值不合法 | -|BI.Editor.EVENT_REMOVE | 输入为空时按下backspace | -|BI.Editor.EVENT_EMPTY | 输入框为空时触发 | - - - - ---- - - diff --git a/docs/_book/case/layer/layer_panel.html b/docs/_book/case/layer/layer_panel.html deleted file mode 100644 index b560b538e..000000000 --- a/docs/_book/case/layer/layer_panel.html +++ /dev/null @@ -1,2689 +0,0 @@ - - - - - - - layer_panel · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                  -
                                                                                  - - - - - - - - -
                                                                                  - -
                                                                                  - -
                                                                                  - - - - - - - - -
                                                                                  -
                                                                                  - -
                                                                                  -
                                                                                  - -
                                                                                  - -

                                                                                  bi.popup_panel

                                                                                  -

                                                                                  可以理解为MultiPopupView和Panel两个面板的结合体,基类BI.MultiPopupView

                                                                                  -
                                                                                  
                                                                                  -BI.createWidget({
                                                                                  -    element: "#wrapper",
                                                                                  -    type: "bi.popup_panel",
                                                                                  -    title: "测试",
                                                                                  -    width: 300
                                                                                  -});
                                                                                  -
                                                                                  -
                                                                                  - -

                                                                                  API

                                                                                  -
                                                                                  基础属性
                                                                                  - - - - - - - - - - - - - - - - - - - -
                                                                                  参数说明类型可选值默认值
                                                                                  title标题string" "
                                                                                  -

                                                                                  对外方法

                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                  名称说明回调参数
                                                                                  prependItems内部前插入items
                                                                                  addItems内部后插入items
                                                                                  removeItemAt移除指定索引处的itemindexs
                                                                                  populate刷新列表items
                                                                                  setNotSelectedValue设置未被选中的值value,可以是单个值也可以是个数组
                                                                                  setValue设置value值value,可以是单个值也可以是个数组
                                                                                  getNotSelectedValue获取没有被选中的值
                                                                                  getValue获取被选中的值
                                                                                  getAllButtons获取所有button
                                                                                  getAllLeaves获取所有的叶子节点
                                                                                  getSelectedButtons获取所有被选中的元素
                                                                                  getNotSelectedButtons获取所有未被选中的元素
                                                                                  getIndexByValue根据value值获取value在数组中的索引value
                                                                                  getNodeById根据id获取节点id
                                                                                  getNodeByValue根据value值获取节点value
                                                                                  empty清空组件
                                                                                  hasPrev是否有上一页
                                                                                  hasNext是否有下一页
                                                                                  -

                                                                                  事件

                                                                                  - - - - - - - - - - - - - - - - - - - - - -
                                                                                  事件说明
                                                                                  BI.PopupPanel.EVENT_CHANGEpanel的value发生改变触发
                                                                                  BI.PopupPanel.EVENT_CLOSEpanel的关闭事件
                                                                                  BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON点击工具栏事件
                                                                                  -
                                                                                  - - -
                                                                                  - -
                                                                                  -
                                                                                  -
                                                                                  - -

                                                                                  results matching ""

                                                                                  -
                                                                                    - -
                                                                                    -
                                                                                    - -

                                                                                    No results matching ""

                                                                                    - -
                                                                                    -
                                                                                    -
                                                                                    - -
                                                                                    -
                                                                                    - -
                                                                                    - - - - -
                                                                                    - - -
                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/layer/layer_panel.md b/docs/_book/case/layer/layer_panel.md deleted file mode 100644 index 8e34ca2f2..000000000 --- a/docs/_book/case/layer/layer_panel.md +++ /dev/null @@ -1,69 +0,0 @@ -# bi.popup_panel - -## 可以理解为MultiPopupView和Panel两个面板的结合体,基类[BI.MultiPopupView](case/layer/multi_popup_layer.md) - -{% method %} -[source](https://jsfiddle.net/fineui/zhnqvera/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.popup_panel", - title: "测试", - width: 300 -}); - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| title | 标题 | string | — | " " - - - - - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| prependItems | 内部前插入 | items | -| addItems | 内部后插入 | items | -| removeItemAt | 移除指定索引处的item | indexs | -| populate | 刷新列表 | items | -| setNotSelectedValue| 设置未被选中的值 | value,可以是单个值也可以是个数组| -| setValue | 设置value值 | value,可以是单个值也可以是个数组 | -| getNotSelectedValue | 获取没有被选中的值 | —| -| getValue | 获取被选中的值 |—| -| getAllButtons | 获取所有button |—| -| getAllLeaves | 获取所有的叶子节点 | —| -| getSelectedButtons | 获取所有被选中的元素 | —| -| getNotSelectedButtons | 获取所有未被选中的元素 | —| -| getIndexByValue | 根据value值获取value在数组中的索引 | value| -| getNodeById | 根据id获取节点 | id | -| getNodeByValue | 根据value值获取节点 | value | -| empty| 清空组件|—| -| hasPrev| 是否有上一页|—| -| hasNext | 是否有下一页 | — - - -## 事件 -| 事件 | 说明 | -| :------ |:------------- | -|BI.PopupPanel.EVENT_CHANGE | panel的value发生改变触发 | -| BI.PopupPanel.EVENT_CLOSE | panel的关闭事件 -| BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON | 点击工具栏事件 - - - - ---- - - diff --git a/docs/_book/case/layer/multi_popup_layer.html b/docs/_book/case/layer/multi_popup_layer.html deleted file mode 100644 index 5fae13027..000000000 --- a/docs/_book/case/layer/multi_popup_layer.html +++ /dev/null @@ -1,2561 +0,0 @@ - - - - - - - multi_popup_layer · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                    -
                                                                                    - - - - - - - - -
                                                                                    - -
                                                                                    - -
                                                                                    - - - - - - - - -
                                                                                    -
                                                                                    - -
                                                                                    -
                                                                                    - -
                                                                                    - -

                                                                                    bi.multi_popup_view

                                                                                    -

                                                                                    下拉框弹出层的多选版本,toolbar带有若干按钮, zIndex在1000w,基类BI.MultiPopupView

                                                                                    -
                                                                                    
                                                                                    -BI.createWidget({
                                                                                    -    element: "#wrapper",
                                                                                    -    type: "bi.multi_popup_view",
                                                                                    -    width: 300
                                                                                    -});
                                                                                    -
                                                                                    -
                                                                                    - -

                                                                                    API

                                                                                    -
                                                                                    基础属性
                                                                                    - - - - - - - - - - - - - - - - - - - -
                                                                                    参数说明类型可选值默认值
                                                                                    buttons按钮组arrayBI.i18nText("BI-Basic_Sure")
                                                                                    -
                                                                                    - - -
                                                                                    - -
                                                                                    -
                                                                                    -
                                                                                    - -

                                                                                    results matching ""

                                                                                    -
                                                                                      - -
                                                                                      -
                                                                                      - -

                                                                                      No results matching ""

                                                                                      - -
                                                                                      -
                                                                                      -
                                                                                      - -
                                                                                      -
                                                                                      - -
                                                                                      - - - - -
                                                                                      - - -
                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/layer/multi_popup_layer.md b/docs/_book/case/layer/multi_popup_layer.md deleted file mode 100644 index dfe6b7f26..000000000 --- a/docs/_book/case/layer/multi_popup_layer.md +++ /dev/null @@ -1,34 +0,0 @@ -# bi.multi_popup_view - -## 下拉框弹出层的多选版本,toolbar带有若干按钮, zIndex在1000w,基类[BI.MultiPopupView](case/layer/multi_popup_layer.md) - -{% method %} -[source](https://jsfiddle.net/fineui/8of9a7cy/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.multi_popup_view", - width: 300 -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| buttons | 按钮组 |array | — | BI.i18nText("BI-Basic_Sure") - - - - - ---- - - diff --git a/docs/_book/case/layer/pane_list.html b/docs/_book/case/layer/pane_list.html deleted file mode 100644 index 6c15636e2..000000000 --- a/docs/_book/case/layer/pane_list.html +++ /dev/null @@ -1,2743 +0,0 @@ - - - - - - - pane_list · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                      -
                                                                                      - - - - - - - - -
                                                                                      - -
                                                                                      - -
                                                                                      - - - - - - - - -
                                                                                      -
                                                                                      - -
                                                                                      -
                                                                                      - -
                                                                                      - -

                                                                                      bi.list_pane

                                                                                      -

                                                                                      list面板,基类BI.Widget

                                                                                      -
                                                                                      
                                                                                      -BI.createWidget({
                                                                                      -  type: 'bi.list_pane',
                                                                                      -  element: "#wrapper",
                                                                                      -  cls: "bi-border",
                                                                                      -  items: []
                                                                                      -});
                                                                                      -
                                                                                      -
                                                                                      - -

                                                                                      API

                                                                                      -
                                                                                      基础属性
                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                      参数说明类型可选值默认值
                                                                                      items列表array[ ]
                                                                                      itemsCreator列表创建器function
                                                                                      hasNext是否有下一页function
                                                                                      onLoad正在加载function
                                                                                      el开启panel的元素object{type: "bi.button_group" }
                                                                                      logic布局逻辑object{ dynamic:true}
                                                                                      hgap效果相当于容器左右padding值number0
                                                                                      vgap效果相当于容器上下padding值number0
                                                                                      lgap效果相当于容器left-padding值number0
                                                                                      rgap效果相当于容器right-padding值number0
                                                                                      tgap效果相当于容器top-padding值number0
                                                                                      bgap效果相当于容器bottom-padding值number0
                                                                                      -

                                                                                      对外方法

                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                      名称说明回调参数
                                                                                      prependItems内部前插入items
                                                                                      addItems内部后插入items
                                                                                      removeItemAt移除指定索引处的itemindexs
                                                                                      populate刷新列表items
                                                                                      setNotSelectedValue设置未被选中的值value,可以是单个值也可以是个数组
                                                                                      setValue设置value值value,可以是单个值也可以是个数组
                                                                                      getNotSelectedValue获取没有被选中的值
                                                                                      getValue获取被选中的值
                                                                                      getAllButtons获取所有button
                                                                                      getAllLeaves获取所有的叶子节点
                                                                                      getSelectedButtons获取所有被选中的元素
                                                                                      getNotSelectedButtons获取所有未被选中的元素
                                                                                      getIndexByValue根据value值获取value在数组中的索引value
                                                                                      getNodeById根据id获取节点id
                                                                                      getNodeByValue根据value值获取节点value
                                                                                      empty清空组件
                                                                                      hasPrev是否有上一页
                                                                                      hasNext是否有下一页
                                                                                      -
                                                                                      - - -
                                                                                      - -
                                                                                      -
                                                                                      -
                                                                                      - -

                                                                                      results matching ""

                                                                                      -
                                                                                        - -
                                                                                        -
                                                                                        - -

                                                                                        No results matching ""

                                                                                        - -
                                                                                        -
                                                                                        -
                                                                                        - -
                                                                                        -
                                                                                        - -
                                                                                        - - - - -
                                                                                        - - -
                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/layer/pane_list.md b/docs/_book/case/layer/pane_list.md deleted file mode 100644 index 8b60035a6..000000000 --- a/docs/_book/case/layer/pane_list.md +++ /dev/null @@ -1,74 +0,0 @@ -# bi.list_pane - -## list面板,基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/7Lv8q9p9/) - -{% common %} -```javascript - -BI.createWidget({ - type: 'bi.list_pane', - element: "#wrapper", - cls: "bi-border", - items: [] -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| items | 列表 | array | — | [ ] -| itemsCreator | 列表创建器| function | — | — -| hasNext | 是否有下一页 | function | —| — -| onLoad | 正在加载 | function | —| — -| el | 开启panel的元素 | object | —|{type: "bi.button_group" }| -| logic | 布局逻辑 | object |— | { dynamic:true} -| 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 | - - - - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| prependItems | 内部前插入 | items | -| addItems | 内部后插入 | items | -| removeItemAt | 移除指定索引处的item | indexs | -| populate | 刷新列表 | items | -| setNotSelectedValue| 设置未被选中的值 | value,可以是单个值也可以是个数组| -| setValue | 设置value值 | value,可以是单个值也可以是个数组 | -| getNotSelectedValue | 获取没有被选中的值 | —| -| getValue | 获取被选中的值 |—| -| getAllButtons | 获取所有button |—| -| getAllLeaves | 获取所有的叶子节点 | —| -| getSelectedButtons | 获取所有被选中的元素 | —| -| getNotSelectedButtons | 获取所有未被选中的元素 | —| -| getIndexByValue | 根据value值获取value在数组中的索引 | value| -| getNodeById | 根据id获取节点 | id | -| getNodeByValue | 根据value值获取节点 | value | -| empty| 清空组件|—| -| hasPrev| 是否有上一页|—| -| hasNext | 是否有下一页 | — - - - - - - ---- - - diff --git a/docs/_book/case/layer/panel.html b/docs/_book/case/layer/panel.html deleted file mode 100644 index 10475658d..000000000 --- a/docs/_book/case/layer/panel.html +++ /dev/null @@ -1,2607 +0,0 @@ - - - - - - - panel · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                        -
                                                                                        - - - - - - - - -
                                                                                        - -
                                                                                        - -
                                                                                        - - - - - - - - -
                                                                                        -
                                                                                        - -
                                                                                        -
                                                                                        - -
                                                                                        - -

                                                                                        bi.panel

                                                                                        -

                                                                                        带有标题栏的panel,基类BI.Widget

                                                                                        -
                                                                                        
                                                                                        -BI.createWidget({
                                                                                        -  element: "#wrapper",
                                                                                        -  type: "bi.panel",
                                                                                        -  title: "标题",
                                                                                        -  titleButtons: [{
                                                                                        -      type: "bi.button",
                                                                                        -    text: "+"
                                                                                        -  }],
                                                                                        -  el: this.button_group,
                                                                                        -  logic: {
                                                                                        -    dynamic: true
                                                                                        -  }
                                                                                        -});
                                                                                        -
                                                                                        -
                                                                                        - -

                                                                                        API

                                                                                        -
                                                                                        基础属性
                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                        参数说明类型可选值默认值
                                                                                        title标题string" "
                                                                                        titleButton标题后的按钮组array[ ]
                                                                                        el开启panel的元素object{ }
                                                                                        logic布局逻辑object{ dynamic:false}
                                                                                        -

                                                                                        对外方法

                                                                                        - - - - - - - - - - - - - - - -
                                                                                        名称说明回调参数
                                                                                        setTitle设置标题title
                                                                                        -
                                                                                        - - -
                                                                                        - -
                                                                                        -
                                                                                        -
                                                                                        - -

                                                                                        results matching ""

                                                                                        -
                                                                                          - -
                                                                                          -
                                                                                          - -

                                                                                          No results matching ""

                                                                                          - -
                                                                                          -
                                                                                          -
                                                                                          - -
                                                                                          -
                                                                                          - -
                                                                                          - - - - -
                                                                                          - - -
                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/layer/panel.md b/docs/_book/case/layer/panel.md deleted file mode 100644 index 4eb739284..000000000 --- a/docs/_book/case/layer/panel.md +++ /dev/null @@ -1,54 +0,0 @@ -# bi.panel - -## 带有标题栏的panel,基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/3m1q3857/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.panel", - title: "标题", - titleButtons: [{ - type: "bi.button", - text: "+" - }], - el: this.button_group, - logic: { - dynamic: true - } -}); - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| title | 标题 | string | — | " " -| titleButton | 标题后的按钮组 | array | —| [ ] -| el | 开启panel的元素 | object | —|{ }| -| logic | 布局逻辑 | object |— | { dynamic:false} - - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setTitle |设置标题| title - - - - - ---- - - diff --git a/docs/_book/case/list/list.select.html b/docs/_book/case/list/list.select.html deleted file mode 100644 index c761fc57f..000000000 --- a/docs/_book/case/list/list.select.html +++ /dev/null @@ -1,2696 +0,0 @@ - - - - - - - select_list · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                          -
                                                                                          - - - - - - - - -
                                                                                          - -
                                                                                          - -
                                                                                          - - - - - - - - -
                                                                                          -
                                                                                          - -
                                                                                          -
                                                                                          - -
                                                                                          - -

                                                                                          bi.select_list

                                                                                          -

                                                                                          选择列表

                                                                                          -
                                                                                          
                                                                                          -BI.createWidget({
                                                                                          -    type: "bi.select_list",
                                                                                          -    items: [{
                                                                                          -        text: '1',
                                                                                          -    }, {
                                                                                          -        text: '2',
                                                                                          -    }]
                                                                                          -});
                                                                                          -
                                                                                          -
                                                                                          - -

                                                                                          参数

                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                          参数说明类型默认值
                                                                                          directiontoolbar位置stringBI.Direction.Top
                                                                                          onLoaded加载完成的回调(测试了无效果)functionBI.emptyFn
                                                                                          items子项array[]
                                                                                          itemsCreator元素创造器functionBI.emptyFn
                                                                                          -

                                                                                          方法

                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                          方法名说明参数
                                                                                          setAllSelected设置全选v: boolean
                                                                                          setToolBarVisible设置toolbar是否可见b: boolean
                                                                                          isAllSelected是否全选中
                                                                                          hasPrev是否有上一页
                                                                                          hasNext是否有下一页
                                                                                          prependItems列表最前添加元素items
                                                                                          addItems列表最后添加元素items
                                                                                          setValue设置值data
                                                                                          getVlaue获得值
                                                                                          empty清空
                                                                                          populate替换内容items
                                                                                          resetHeight重新设置高度h
                                                                                          setNotSelectedValue设置未选中值
                                                                                          getNotSelectedValue获取未选中植
                                                                                          getAllButtons获得所以根节点
                                                                                          getAllLeaves获得所有叶节点
                                                                                          getSelectedButtons获取选中的根节点
                                                                                          getNotSelectedButtons获取未选中的根节点
                                                                                          getIndexByValue根据值获取索引value
                                                                                          getNodeById根据id获取nodeid
                                                                                          getNodeByValue根据值获取nodevalue
                                                                                          -
                                                                                          - - -
                                                                                          - -
                                                                                          -
                                                                                          -
                                                                                          - -

                                                                                          results matching ""

                                                                                          -
                                                                                            - -
                                                                                            -
                                                                                            - -

                                                                                            No results matching ""

                                                                                            - -
                                                                                            -
                                                                                            -
                                                                                            - -
                                                                                            -
                                                                                            - -
                                                                                            - - - - -
                                                                                            - - -
                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/list/list.select.md b/docs/_book/case/list/list.select.md deleted file mode 100644 index 0b8f2aacf..000000000 --- a/docs/_book/case/list/list.select.md +++ /dev/null @@ -1,59 +0,0 @@ -# bi.select_list - -### 选择列表 - -{% method %} -[source](https://jsfiddle.net/fineui/c3azpxss/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.select_list", - items: [{ - text: '1', - }, { - text: '2', - }] -}); - -``` - -{% endmethod %} - -### 参数 - -| 参数 | 说明 | 类型 | 默认值 | -| ------------ | --------------- | -------- | ---------------- | -| direction | toolbar位置 | string | BI.Direction.Top | -| onLoaded | 加载完成的回调(测试了无效果) | function | BI.emptyFn | -| items | 子项 | array | [] | -| itemsCreator | 元素创造器 | function | BI.emptyFn | - -### 方法 - -| 方法名 | 说明 | 参数 | -| --------------------- | ------------- | ------- | -| setAllSelected | 设置全选 | v: boolean | -| setToolBarVisible | 设置toolbar是否可见 | b: boolean | -| isAllSelected | 是否全选中 | — | -| hasPrev | 是否有上一页 | — | -| hasNext | 是否有下一页 | — | -| prependItems | 列表最前添加元素 | items | -| 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 | - ------- \ No newline at end of file diff --git a/docs/_book/case/loader/lazy_loader.html b/docs/_book/case/loader/lazy_loader.html deleted file mode 100644 index 94085e995..000000000 --- a/docs/_book/case/loader/lazy_loader.html +++ /dev/null @@ -1,2626 +0,0 @@ - - - - - - - lazy_loader · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                            -
                                                                                            - - - - - - - - -
                                                                                            - -
                                                                                            - -
                                                                                            - - - - - - - - -
                                                                                            -
                                                                                            - -
                                                                                            -
                                                                                            - -
                                                                                            - -

                                                                                            bi.lazy_loader

                                                                                            -

                                                                                            懒加载loader

                                                                                            -
                                                                                            
                                                                                            -BI.createWidget({
                                                                                            -    type: "bi.lazy_loader",
                                                                                            -    width: 100,
                                                                                            -    element: 'body',
                                                                                            -    items: items,
                                                                                            -});
                                                                                            -
                                                                                            -
                                                                                            - - - -

                                                                                            方法

                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                            方法名说明参数
                                                                                            addItems列表最后添加元素items
                                                                                            setValue设置值data
                                                                                            getVlaue获得值
                                                                                            empty清空
                                                                                            populate替换内容items
                                                                                            setNotSelectedValue设置未选中值
                                                                                            getNotSelectedValue获取未选中植
                                                                                            getAllButtons获得所以根节点
                                                                                            getAllLeaves获得所有叶节点
                                                                                            getSelectedButtons获取选中的根节点
                                                                                            getNotSelectedButtons获取未选中的根节点
                                                                                            getIndexByValue根据值获取索引value
                                                                                            getNodeById根据id获取nodeid
                                                                                            getNodeByValue根据值获取nodevalue
                                                                                            -
                                                                                            - - -
                                                                                            - -
                                                                                            -
                                                                                            -
                                                                                            - -

                                                                                            results matching ""

                                                                                            -
                                                                                              - -
                                                                                              -
                                                                                              - -

                                                                                              No results matching ""

                                                                                              - -
                                                                                              -
                                                                                              -
                                                                                              - -
                                                                                              -
                                                                                              - -
                                                                                              - - - - -
                                                                                              - - -
                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/loader/lazy_loader.md b/docs/_book/case/loader/lazy_loader.md deleted file mode 100644 index f206e98a9..000000000 --- a/docs/_book/case/loader/lazy_loader.md +++ /dev/null @@ -1,43 +0,0 @@ -# bi.lazy_loader - -### 懒加载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 | - ------- \ No newline at end of file diff --git a/docs/_book/case/loader/list_loader.html b/docs/_book/case/loader/list_loader.html deleted file mode 100644 index 1af990506..000000000 --- a/docs/_book/case/loader/list_loader.html +++ /dev/null @@ -1,2683 +0,0 @@ - - - - - - - list_loader · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                              -
                                                                                              - - - - - - - - -
                                                                                              - -
                                                                                              - -
                                                                                              - - - - - - - - -
                                                                                              -
                                                                                              - -
                                                                                              -
                                                                                              - -
                                                                                              - -

                                                                                              bi.list_loader

                                                                                              -

                                                                                              为解决排序问题引入的控件

                                                                                              -
                                                                                              
                                                                                              -BI.createWidget({
                                                                                              -    type: "bi.list_loader",
                                                                                              -    width: 100,
                                                                                              -    element: 'body',
                                                                                              -    items: items,
                                                                                              -});
                                                                                              -
                                                                                              -
                                                                                              - -

                                                                                              参数

                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                              参数说明类型默认值
                                                                                              count分页计数numberfalse
                                                                                              nextobject{}
                                                                                              hasNext是否有下一页functionBI.emptyFn
                                                                                              items子项array[]
                                                                                              itemsCreator元素创造器functionBI.emptyFn
                                                                                              onLoaded加载完成回调functionBI.emptyFn
                                                                                              -

                                                                                              方法

                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                              方法名说明参数
                                                                                              hasNext是否有下一页
                                                                                              addItems列表最后添加元素items
                                                                                              setValue设置值data
                                                                                              getVlaue获得值
                                                                                              empty清空
                                                                                              populate替换内容items
                                                                                              resetHeight重新设置高度h
                                                                                              setNotSelectedValue设置未选中值
                                                                                              getNotSelectedValue获取未选中植
                                                                                              getAllButtons获得所以根节点
                                                                                              getAllLeaves获得所有叶节点
                                                                                              getSelectedButtons获取选中的根节点
                                                                                              getNotSelectedButtons获取未选中的根节点
                                                                                              getIndexByValue根据值获取索引value
                                                                                              getNodeById根据id获取nodeid
                                                                                              getNodeByValue根据值获取nodevalue
                                                                                              -
                                                                                              - - -
                                                                                              - -
                                                                                              -
                                                                                              -
                                                                                              - -

                                                                                              results matching ""

                                                                                              -
                                                                                                - -
                                                                                                -
                                                                                                - -

                                                                                                No results matching ""

                                                                                                - -
                                                                                                -
                                                                                                -
                                                                                                - -
                                                                                                -
                                                                                                - -
                                                                                                - - - - -
                                                                                                - - -
                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/loader/list_loader.md b/docs/_book/case/loader/list_loader.md deleted file mode 100644 index 35334aadb..000000000 --- a/docs/_book/case/loader/list_loader.md +++ /dev/null @@ -1,54 +0,0 @@ -# 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 | - ------- \ No newline at end of file diff --git a/docs/_book/case/loader/sort_list.html b/docs/_book/case/loader/sort_list.html deleted file mode 100644 index d06929c1f..000000000 --- a/docs/_book/case/loader/sort_list.html +++ /dev/null @@ -1,2681 +0,0 @@ - - - - - - - sort_list · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                -
                                                                                                - - - - - - - - -
                                                                                                - -
                                                                                                - -
                                                                                                - - - - - - - - -
                                                                                                -
                                                                                                - -
                                                                                                -
                                                                                                - -
                                                                                                - -

                                                                                                bi.sort_list

                                                                                                -

                                                                                                排序列表

                                                                                                -
                                                                                                
                                                                                                -BI.createWidget({
                                                                                                -    type: "bi.sort_list",
                                                                                                -    width: 100,
                                                                                                -    element: 'body',
                                                                                                -    items: items,
                                                                                                -});
                                                                                                -
                                                                                                -
                                                                                                - -

                                                                                                参数

                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                参数说明类型默认值
                                                                                                count分页计数numberfalse
                                                                                                nextobject{}
                                                                                                hasNext是否有下一页functionBI.emptyFn
                                                                                                items子项array[]
                                                                                                itemsCreator元素创造器functionBI.emptyFn
                                                                                                onLoaded加载完成回调functionBI.emptyFn
                                                                                                -

                                                                                                方法

                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                方法名说明参数
                                                                                                hasNext是否有下一页
                                                                                                addItems列表最后添加元素items
                                                                                                setValue设置值data
                                                                                                getVlaue获得值
                                                                                                empty清空
                                                                                                populate替换内容items
                                                                                                resetHeight重新设置高度h
                                                                                                setNotSelectedValue设置未选中值
                                                                                                getNotSelectedValue获取未选中植
                                                                                                getAllButtons获得所以根节点
                                                                                                getAllLeaves获得所有叶节点
                                                                                                getSelectedButtons获取选中的根节点
                                                                                                getNotSelectedButtons获取未选中的根节点
                                                                                                getIndexByValue根据值获取索引value
                                                                                                getNodeById根据id获取nodeid
                                                                                                getNodeByValue根据值获取nodevalue
                                                                                                -
                                                                                                - - -
                                                                                                - -
                                                                                                -
                                                                                                -
                                                                                                - -

                                                                                                results matching ""

                                                                                                -
                                                                                                  - -
                                                                                                  -
                                                                                                  - -

                                                                                                  No results matching ""

                                                                                                  - -
                                                                                                  -
                                                                                                  -
                                                                                                  - -
                                                                                                  -
                                                                                                  - -
                                                                                                  - - - - -
                                                                                                  - - -
                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/loader/sort_list.md b/docs/_book/case/loader/sort_list.md deleted file mode 100644 index 572b8f2fc..000000000 --- a/docs/_book/case/loader/sort_list.md +++ /dev/null @@ -1,54 +0,0 @@ -# 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 | - ------- \ No newline at end of file diff --git a/docs/_book/case/pager/all_count_pager.html b/docs/_book/case/pager/all_count_pager.html deleted file mode 100644 index 703087c7f..000000000 --- a/docs/_book/case/pager/all_count_pager.html +++ /dev/null @@ -1,2635 +0,0 @@ - - - - - - - all_count_pager · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                  -
                                                                                                  - - - - - - - - -
                                                                                                  - -
                                                                                                  - -
                                                                                                  - - - - - - - - -
                                                                                                  -
                                                                                                  - -
                                                                                                  -
                                                                                                  - -
                                                                                                  - -

                                                                                                  bi.all_count_pager

                                                                                                  -

                                                                                                  有总页数和总行数的分页控件

                                                                                                  -
                                                                                                  
                                                                                                  -BI.createWidget({
                                                                                                  -    type: 'bi.all_count_pager',
                                                                                                  -    height: 30,
                                                                                                  -    pages: 10, //必选项
                                                                                                  -    curr: 1,
                                                                                                  -    count: 1,
                                                                                                  -});
                                                                                                  -
                                                                                                  -
                                                                                                  - -

                                                                                                  参数

                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                  参数说明类型默认值
                                                                                                  height控件高度number30
                                                                                                  pages总页数number1
                                                                                                  curr当前页number1
                                                                                                  count总行数number1
                                                                                                  -

                                                                                                  方法

                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                  方法名说明参数
                                                                                                  setAllPages设置总页数v
                                                                                                  setValue设置当前页码v
                                                                                                  setVPage设置当前页码v
                                                                                                  setCount设置计数count
                                                                                                  getCurrentPage获取当前页码
                                                                                                  hasPrev是否有前一页
                                                                                                  hasNext是否有后一页
                                                                                                  setPagerVisible设置页码是否可见true/false
                                                                                                  populate清空内容
                                                                                                  -
                                                                                                  - - -
                                                                                                  - -
                                                                                                  -
                                                                                                  -
                                                                                                  - -

                                                                                                  results matching ""

                                                                                                  -
                                                                                                    - -
                                                                                                    -
                                                                                                    - -

                                                                                                    No results matching ""

                                                                                                    - -
                                                                                                    -
                                                                                                    -
                                                                                                    - -
                                                                                                    -
                                                                                                    - -
                                                                                                    - - - - -
                                                                                                    - - -
                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/pager/all_count_pager.md b/docs/_book/case/pager/all_count_pager.md deleted file mode 100644 index 88a580727..000000000 --- a/docs/_book/case/pager/all_count_pager.md +++ /dev/null @@ -1,48 +0,0 @@ -# bi.all_count_pager - -### 有总页数和总行数的分页控件 - -{% method %} -[source](https://jsfiddle.net/fineui/cmtamo5L/) - -{% common %} -```javascript - -BI.createWidget({ - type: 'bi.all_count_pager', - height: 30, - pages: 10, //必选项 - curr: 1, - count: 1, -}); - -``` - -{% endmethod %} - -### 参数 - -| 参数 | 说明 | 类型 | 默认值 | -| ------ | ---- | ------ | ---- | -| height | 控件高度 | number | 30 | -| pages | 总页数 | number | 1 | -| curr | 当前页 | number | 1 | -| count | 总行数 | number | 1 | - - - -### 方法 - -| 方法名 | 说明 | 参数 | -| --------------- | -------- | ---------- | -| setAllPages | 设置总页数 | v | -| setValue | 设置当前页码 | v | -| setVPage | 设置当前页码 | v | -| setCount | 设置计数 | count | -| getCurrentPage | 获取当前页码 | — | -| hasPrev | 是否有前一页 | — | -| hasNext | 是否有后一页 | — | -| setPagerVisible | 设置页码是否可见 | true/false | -| populate | 清空内容 | — | - ------- \ No newline at end of file diff --git a/docs/_book/case/pager/direction_pager.html b/docs/_book/case/pager/direction_pager.html deleted file mode 100644 index b3b248e6d..000000000 --- a/docs/_book/case/pager/direction_pager.html +++ /dev/null @@ -1,2697 +0,0 @@ - - - - - - - direction_pager · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                    -
                                                                                                    - - - - - - - - -
                                                                                                    - -
                                                                                                    - -
                                                                                                    - - - - - - - - -
                                                                                                    -
                                                                                                    - -
                                                                                                    -
                                                                                                    - -
                                                                                                    - -

                                                                                                    bi.direction_pager

                                                                                                    -

                                                                                                    显示页码的分页控件

                                                                                                    -
                                                                                                    
                                                                                                    -var pager = BI.createWidget({
                                                                                                    -  type: 'bi.direction_pager',
                                                                                                    -  height: 30,
                                                                                                    -  horizontal: {
                                                                                                    -      pages: 10, //必选项
                                                                                                    -      curr: 1, //初始化当前页, pages为数字时可用,
                                                                                                    -      firstPage: 1,
                                                                                                    -    lastPage: 10,
                                                                                                    -  },
                                                                                                    -  vertical: {
                                                                                                    -      pages: 10, //必选项
                                                                                                    -      curr: 1, //初始化当前页, pages为数字时可用,
                                                                                                    -      firstPage: 1,
                                                                                                    -    lastPage: 10,
                                                                                                    -  },
                                                                                                    -  element: 'body',
                                                                                                    -});
                                                                                                    -
                                                                                                    -
                                                                                                    - -

                                                                                                    参数

                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                    参数二级参数说明类型默认值
                                                                                                    height控件高度number30
                                                                                                    horizontal横向翻页设置object
                                                                                                    pages总页数number/booleanfalse
                                                                                                    curr当前页, pages为数字时可用number1
                                                                                                    hasPrev判断是否有前一页的方法functionBI.emptyFn
                                                                                                    hasNext判断是否有后一页的方法functionBI.emptyFn
                                                                                                    firstPage第一页number1
                                                                                                    lastPage最后一页number/functionBI.emptyFn
                                                                                                    vertical纵向翻页设置,参数与horizontal相同object
                                                                                                    -

                                                                                                    方法

                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                    方法名说明参数
                                                                                                    getVPage获取纵向页码
                                                                                                    getHPage获取水平向页码
                                                                                                    setVPage获取纵向页码v
                                                                                                    setHPage获取水平向页码v
                                                                                                    hasVNext纵向坐标是否有下一页
                                                                                                    hasHNext横向坐标是否有下一页
                                                                                                    hasVPrev纵向坐标是否有上一页
                                                                                                    hasHPrev横向坐标是否有上一页
                                                                                                    setHPagerVisible设置横向分页键可见
                                                                                                    setVPagerVisible设置纵向分页键可见
                                                                                                    populate清空内容
                                                                                                    -
                                                                                                    - - -
                                                                                                    - -
                                                                                                    -
                                                                                                    -
                                                                                                    - -

                                                                                                    results matching ""

                                                                                                    -
                                                                                                      - -
                                                                                                      -
                                                                                                      - -

                                                                                                      No results matching ""

                                                                                                      - -
                                                                                                      -
                                                                                                      -
                                                                                                      - -
                                                                                                      -
                                                                                                      - -
                                                                                                      - - - - -
                                                                                                      - - -
                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/pager/direction_pager.md b/docs/_book/case/pager/direction_pager.md deleted file mode 100644 index 636fd6931..000000000 --- a/docs/_book/case/pager/direction_pager.md +++ /dev/null @@ -1,65 +0,0 @@ -# bi.direction_pager - -### 显示页码的分页控件 - -{% method %} -[source](https://jsfiddle.net/fineui/vyc36s2a/) - -{% common %} -```javascript - -var pager = BI.createWidget({ - type: 'bi.direction_pager', - height: 30, - horizontal: { - pages: 10, //必选项 - curr: 1, //初始化当前页, pages为数字时可用, - firstPage: 1, - lastPage: 10, - }, - vertical: { - pages: 10, //必选项 - curr: 1, //初始化当前页, pages为数字时可用, - firstPage: 1, - lastPage: 10, - }, - element: 'body', -}); - -``` - -{% endmethod %} - -### 参数 - -| 参数 | 二级参数 | 说明 | 类型 | 默认值 | -| ---------- | --------- | ---------------------- | --------------- | ---------- | -| height | | 控件高度 | number | 30 | -| horizontal | | 横向翻页设置 | object | — | -| | pages | 总页数 | number/boolean | false | -| | curr | 当前页, pages为数字时可用 | number | 1 | -| | hasPrev | 判断是否有前一页的方法 | function | BI.emptyFn | -| | hasNext | 判断是否有后一页的方法 | function | BI.emptyFn | -| | firstPage | 第一页 | number | 1 | -| | lastPage | 最后一页 | number/function | BI.emptyFn | -| vertical | | 纵向翻页设置,参数与horizontal相同 | object | — | - - - -### 方法 - -| 方法名 | 说明 | 参数 | -| ---------------- | ---------- | ---- | -| getVPage | 获取纵向页码 | — | -| getHPage | 获取水平向页码 | — | -| setVPage | 获取纵向页码 | v | -| setHPage | 获取水平向页码 | v | -| hasVNext | 纵向坐标是否有下一页 | — | -| hasHNext | 横向坐标是否有下一页 | — | -| hasVPrev | 纵向坐标是否有上一页 | — | -| hasHPrev | 横向坐标是否有上一页 | — | -| setHPagerVisible | 设置横向分页键可见 | — | -| setVPagerVisible | 设置纵向分页键可见 | — | -| populate | 清空内容 | — | - ------- \ No newline at end of file diff --git a/docs/_book/case/segment.html b/docs/_book/case/segment.html deleted file mode 100644 index 279b1d0a9..000000000 --- a/docs/_book/case/segment.html +++ /dev/null @@ -1,2637 +0,0 @@ - - - - - - - segment · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                      -
                                                                                                      - - - - - - - - -
                                                                                                      - -
                                                                                                      - -
                                                                                                      - - - - - - - - -
                                                                                                      -
                                                                                                      - -
                                                                                                      -
                                                                                                      - -
                                                                                                      - -

                                                                                                      bi.sgement

                                                                                                      -

                                                                                                      各种segment

                                                                                                      -
                                                                                                      
                                                                                                      -BI.createWidget({
                                                                                                      -    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
                                                                                                      -});
                                                                                                      -
                                                                                                      -
                                                                                                      - -

                                                                                                      API

                                                                                                      -
                                                                                                      基础属性
                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                      参数说明类型可选值默认值
                                                                                                      hgap效果相当于文本框左右padding值number10
                                                                                                      vgap效果相当于文本框上下padding值number0
                                                                                                      lgap效果相当于文本框left-padding值number0
                                                                                                      rgap效果相当于文本框right-padding值number0
                                                                                                      tgap效果相当于文本框top-padding值number0
                                                                                                      bgap效果相当于文本框bottom-padding值number0
                                                                                                      items子控件数组array[ ]
                                                                                                      width宽度number
                                                                                                      height高度number
                                                                                                      -
                                                                                                      - - -
                                                                                                      - -
                                                                                                      -
                                                                                                      -
                                                                                                      - -

                                                                                                      results matching ""

                                                                                                      -
                                                                                                        - -
                                                                                                        -
                                                                                                        - -

                                                                                                        No results matching ""

                                                                                                        - -
                                                                                                        -
                                                                                                        -
                                                                                                        - -
                                                                                                        -
                                                                                                        - -
                                                                                                        - - - - -
                                                                                                        - - -
                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/segment.md b/docs/_book/case/segment.md deleted file mode 100644 index 0a8164faa..000000000 --- a/docs/_book/case/segment.md +++ /dev/null @@ -1,58 +0,0 @@ -# bi.sgement - -## 各种segment - -{% method %} -[source](https://jsfiddle.net/fineui/7skvd64L/) - -{% common %} -```javascript - -BI.createWidget({ - 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 -}); - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| hgap | 效果相当于文本框左右padding值 | number | — | 10 | -| 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 |— | [ ] | -| width | 宽度 | number | — | — | -| height | 高度 | number | — | — | - - ---- - - diff --git a/docs/_book/case/shelter_editor.md b/docs/_book/case/shelter_editor.md deleted file mode 100644 index 1b1e4fef3..000000000 --- a/docs/_book/case/shelter_editor.md +++ /dev/null @@ -1,2 +0,0 @@ -# clipboard - diff --git a/docs/_book/case/table/adaptive_table.html b/docs/_book/case/table/adaptive_table.html deleted file mode 100644 index d628d4bc2..000000000 --- a/docs/_book/case/table/adaptive_table.html +++ /dev/null @@ -1,2747 +0,0 @@ - - - - - - - adaptive_table · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                        -
                                                                                                        - - - - - - - - -
                                                                                                        - -
                                                                                                        - -
                                                                                                        - - - - - - - - -
                                                                                                        -
                                                                                                        - -
                                                                                                        -
                                                                                                        - -
                                                                                                        - -

                                                                                                        bi.adaptive_table

                                                                                                        -

                                                                                                        自适应宽度的表格

                                                                                                        -
                                                                                                        BI.createWidget({
                                                                                                        -  type: "bi.adaptive_table",
                                                                                                        -  element: 'body',
                                                                                                        -  width: 600,
                                                                                                        -  height: 500,
                                                                                                        -  isResizeAdapt: true,
                                                                                                        -  isNeedResize: true,
                                                                                                        -  isNeedFreeze: true,
                                                                                                        -  freezeCols: [0, 1],
                                                                                                        -  columnSize: [50,50,200,250,400],
                                                                                                        -  header: [],
                                                                                                        -  items: [],
                                                                                                        -});
                                                                                                        -
                                                                                                        -
                                                                                                        - -

                                                                                                        参数设置

                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                        参数说明类型默认值
                                                                                                        isNeedResize是否可改变列大小booleantrue
                                                                                                        isNeedFreeze是否需要冻结表头booleanfalse
                                                                                                        freezeCols冻结的列array[]
                                                                                                        isNeedMerge是否需要合并单元格booleanfalse
                                                                                                        mergeCols合并的单元格列号array[]
                                                                                                        mergeRule合并规则, 默认相等时合并function(row1, row2)默认row1 = row2 时合并
                                                                                                        columnSize单元格宽度集合array[]
                                                                                                        minColumnSize最小列宽array[]
                                                                                                        maxColumnSize最大列宽array[]
                                                                                                        headerRowSize表头高度number25
                                                                                                        rowSize普通单元格高度number25
                                                                                                        regionColumnSize列项间的array[]
                                                                                                        header表头array[]
                                                                                                        items子组件array[]
                                                                                                        crossHeader交叉表头array[]
                                                                                                        crossItems交叉项array[]
                                                                                                        -

                                                                                                        方法

                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                        方法名说明参数
                                                                                                        setWidth设置宽度width: 宽度
                                                                                                        setHeight设置高度height: 高度
                                                                                                        setColumnSize设置列宽columnSize: 列宽数组
                                                                                                        getColumnSize得到列宽
                                                                                                        setRegionColumnSize设置列项之间的间隙columnSize: 列宽数组
                                                                                                        getRegionColumnSize获得列项之间的间隙
                                                                                                        setVerticalScroll设置纵向滚动距离scrollTop: 纵向滚动距离
                                                                                                        setLeftHorizontalScroll设置左到右横向滚动距离scrollLeft: 横向滚动距离
                                                                                                        setRightHorizontalScroll设置右往左横向滚动距离scrollLeft: 横向滚动距离
                                                                                                        getVerticalScroll获取纵向滚动距离
                                                                                                        getLeftHorizontalScroll获取左到右横向滚动距离
                                                                                                        getRightHorizontalScroll获取右往左横向滚动距离
                                                                                                        attr设置属性key: 键 value: 值
                                                                                                        restore存储
                                                                                                        populate增加项items: array
                                                                                                        destroy摧毁表
                                                                                                        -
                                                                                                        - - -
                                                                                                        - -
                                                                                                        -
                                                                                                        -
                                                                                                        - -

                                                                                                        results matching ""

                                                                                                        -
                                                                                                          - -
                                                                                                          -
                                                                                                          - -

                                                                                                          No results matching ""

                                                                                                          - -
                                                                                                          -
                                                                                                          -
                                                                                                          - -
                                                                                                          -
                                                                                                          - -
                                                                                                          - - - - -
                                                                                                          - - -
                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/table/adaptive_table.md b/docs/_book/case/table/adaptive_table.md deleted file mode 100644 index e10717016..000000000 --- a/docs/_book/case/table/adaptive_table.md +++ /dev/null @@ -1,69 +0,0 @@ -# bi.adaptive_table - -### 自适应宽度的表格 - -{% method %} -[source](https://jsfiddle.net/fineui/pbgnjeg0/) - -{% common %} -```javascript -BI.createWidget({ - type: "bi.adaptive_table", - element: 'body', - width: 600, - height: 500, - isResizeAdapt: true, - isNeedResize: true, - isNeedFreeze: true, - freezeCols: [0, 1], - columnSize: [50,50,200,250,400], - header: [], - items: [], -}); -``` - -{% endmethod %} - -## 参数设置 -| 参数 | 说明 | 类型 | 默认值 | -| ---------------- | ------------- | -------------------- | ----------------- | -| isNeedResize | 是否可改变列大小 | boolean | true | -| isNeedFreeze | 是否需要冻结表头 | boolean | false | -| freezeCols | 冻结的列 | array | [] | -| isNeedMerge | 是否需要合并单元格 | boolean | false | -| mergeCols | 合并的单元格列号 | array | [] | -| mergeRule | 合并规则, 默认相等时合并 | function(row1, row2) | 默认row1 = row2 时合并 | -| columnSize | 单元格宽度集合 | array | [] | -| minColumnSize | 最小列宽 | array | [] | -| maxColumnSize | 最大列宽 | array | [] | -| headerRowSize | 表头高度 | number | 25 | -| rowSize | 普通单元格高度 | number | 25 | -| regionColumnSize | 列项间的 | array | [] | -| header | 表头 | array | [] | -| items | 子组件 | array | [] | -| crossHeader | 交叉表头 | array | [] | -| crossItems | 交叉项 | array | [] | - - - -## 方法 -| 方法名 | 说明 | 参数 | -| ------------------------ | ----------- | ------------------ | -| setWidth | 设置宽度 | width: 宽度 | -| setHeight | 设置高度 | height: 高度 | -| setColumnSize | 设置列宽 | columnSize: 列宽数组 | -| getColumnSize | 得到列宽 | — | -| setRegionColumnSize | 设置列项之间的间隙 | columnSize: 列宽数组 | -| getRegionColumnSize | 获得列项之间的间隙 | — | -| setVerticalScroll | 设置纵向滚动距离 | scrollTop: 纵向滚动距离 | -| setLeftHorizontalScroll | 设置左到右横向滚动距离 | scrollLeft: 横向滚动距离 | -| setRightHorizontalScroll | 设置右往左横向滚动距离 | scrollLeft: 横向滚动距离 | -| getVerticalScroll | 获取纵向滚动距离 | — | -| getLeftHorizontalScroll | 获取左到右横向滚动距离 | — | -| getRightHorizontalScroll | 获取右往左横向滚动距离 | — | -| attr | 设置属性 | key: 键 value: 值 | -| restore | 存储 | — | -| populate | 增加项 | items: array | -| destroy | 摧毁表 | — | - ------- \ No newline at end of file diff --git a/docs/_book/case/table/layer_tree_table.html b/docs/_book/case/table/layer_tree_table.html deleted file mode 100644 index 675c16902..000000000 --- a/docs/_book/case/table/layer_tree_table.html +++ /dev/null @@ -1,2770 +0,0 @@ - - - - - - - layer_tree_table · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                          -
                                                                                                          - - - - - - - - -
                                                                                                          - -
                                                                                                          - -
                                                                                                          - - - - - - - - -
                                                                                                          -
                                                                                                          - -
                                                                                                          -
                                                                                                          - -
                                                                                                          - -

                                                                                                          bi.layer_tree_table

                                                                                                          -

                                                                                                          层级树状结构的表格

                                                                                                          -
                                                                                                          var table = BI.createWidget({
                                                                                                          -    type: "bi.layer_tree_table",
                                                                                                          -    width: 600,
                                                                                                          -    height: 400,
                                                                                                          -    columnSize: [100, 100, 100, 100, 100, 100, 100, 100, 100, 100],
                                                                                                          -    minColumnSize: [100, 100, 100, 100, 100, 100, 100, 100, 100, 100],
                                                                                                          -    header: header,
                                                                                                          -    items: items,
                                                                                                          -    crossHeader: crossHeader,
                                                                                                          -    crossItems: crossItems,
                                                                                                          -    element: 'body',
                                                                                                          -});
                                                                                                          -
                                                                                                          -
                                                                                                          - -

                                                                                                          参数设置

                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                          参数说明类型默认值
                                                                                                          isNeedResize是否需要调整列宽booleanfalse
                                                                                                          isResizeAdapt是否需要在调整列宽或区域宽度的时候它们自适应变化booleantrue
                                                                                                          isNeedFreeze是否需要冻结表头booleanfalse
                                                                                                          freezeCols冻结的列array[]
                                                                                                          isNeedMerge是否需要合并单元格booleanfalse
                                                                                                          mergeCols合并的单元格列号array[]
                                                                                                          mergeRule合并规则, 默认相等时合并function(row1, row2)默认row1 = row2 时合并
                                                                                                          columnSize单元格宽度集合array[]
                                                                                                          minColumnSize最小列宽array[]
                                                                                                          maxColumnSize最大列宽array[]
                                                                                                          headerRowSize表头高度number25
                                                                                                          headerCellStyleGetterfunctionBI.emptyFn
                                                                                                          summaryCellStyleGetterfunctionBI.emptyFn
                                                                                                          sequenceCellStyleGetterfunctionBI.emptyFn
                                                                                                          rowSize普通单元格高度number25
                                                                                                          regionColumnSize列项间的array[]
                                                                                                          header表头array[]
                                                                                                          items子组件array[]
                                                                                                          crossHeader交叉表头array[]
                                                                                                          crossItems交叉项array[]
                                                                                                          -

                                                                                                          方法

                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                          方法名说明参数
                                                                                                          setWidth设置宽度width: 宽度
                                                                                                          setHeight设置高度height: 高度
                                                                                                          setColumnSize设置列宽columnSize: 列宽数组
                                                                                                          getColumnSize得到列宽
                                                                                                          setRegionColumnSize设置列项之间的间隙columnSize: 列宽数组
                                                                                                          getRegionColumnSize获得列项之间的间隙
                                                                                                          setVerticalScroll设置纵向滚动距离scrollTop: 纵向滚动距离
                                                                                                          setLeftHorizontalScroll设置左到右横向滚动距离scrollLeft: 横向滚动距离
                                                                                                          setRightHorizontalScroll设置右往左横向滚动距离scrollLeft: 横向滚动距离
                                                                                                          getVerticalScroll获取纵向滚动距离
                                                                                                          getLeftHorizontalScroll获取左到右横向滚动距离
                                                                                                          getRightHorizontalScroll获取右往左横向滚动距离
                                                                                                          attr设置属性key: 键 value: 值
                                                                                                          restore存储
                                                                                                          populate增加项items: array
                                                                                                          destroy摧毁表
                                                                                                          -
                                                                                                          - - -
                                                                                                          - -
                                                                                                          -
                                                                                                          -
                                                                                                          - -

                                                                                                          results matching ""

                                                                                                          -
                                                                                                            - -
                                                                                                            -
                                                                                                            - -

                                                                                                            No results matching ""

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            - -
                                                                                                            -
                                                                                                            - -
                                                                                                            - - - - -
                                                                                                            - - -
                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/table/layer_tree_table.md b/docs/_book/case/table/layer_tree_table.md deleted file mode 100644 index faca563b5..000000000 --- a/docs/_book/case/table/layer_tree_table.md +++ /dev/null @@ -1,72 +0,0 @@ -# bi.layer_tree_table - -### 层级树状结构的表格 - -{% method %} -[source](https://jsfiddle.net/fineui/pqyuLoay/) - -{% common %} -```javascript -var table = BI.createWidget({ - type: "bi.layer_tree_table", - width: 600, - height: 400, - columnSize: [100, 100, 100, 100, 100, 100, 100, 100, 100, 100], - minColumnSize: [100, 100, 100, 100, 100, 100, 100, 100, 100, 100], - header: header, - items: items, - crossHeader: crossHeader, - crossItems: crossItems, - element: 'body', -}); -``` - -{% endmethod %} - -## 参数设置 -| 参数 | 说明 | 类型 | 默认值 | -| ----------------------- | ------------------------ | -------------------- | ----------------- | -| isNeedResize | 是否需要调整列宽 | boolean | false | -| isResizeAdapt | 是否需要在调整列宽或区域宽度的时候它们自适应变化 | boolean | true | -| isNeedFreeze | 是否需要冻结表头 | boolean | false | -| freezeCols | 冻结的列 | array | [] | -| isNeedMerge | 是否需要合并单元格 | boolean | false | -| mergeCols | 合并的单元格列号 | array | [] | -| mergeRule | 合并规则, 默认相等时合并 | function(row1, row2) | 默认row1 = row2 时合并 | -| columnSize | 单元格宽度集合 | array | [] | -| minColumnSize | 最小列宽 | array | [] | -| maxColumnSize | 最大列宽 | array | [] | -| headerRowSize | 表头高度 | number | 25 | -| headerCellStyleGetter | | function | BI.emptyFn | -| summaryCellStyleGetter | | function | BI.emptyFn | -| sequenceCellStyleGetter | | function | BI.emptyFn | -| rowSize | 普通单元格高度 | number | 25 | -| regionColumnSize | 列项间的 | array | [] | -| header | 表头 | array | [] | -| items | 子组件 | array | [] | -| crossHeader | 交叉表头 | array | [] | -| crossItems | 交叉项 | array | [] | - - - -## 方法 -| 方法名 | 说明 | 参数 | -| ------------------------ | ----------- | ------------------ | -| setWidth | 设置宽度 | width: 宽度 | -| setHeight | 设置高度 | height: 高度 | -| setColumnSize | 设置列宽 | columnSize: 列宽数组 | -| getColumnSize | 得到列宽 | — | -| setRegionColumnSize | 设置列项之间的间隙 | columnSize: 列宽数组 | -| getRegionColumnSize | 获得列项之间的间隙 | — | -| setVerticalScroll | 设置纵向滚动距离 | scrollTop: 纵向滚动距离 | -| setLeftHorizontalScroll | 设置左到右横向滚动距离 | scrollLeft: 横向滚动距离 | -| setRightHorizontalScroll | 设置右往左横向滚动距离 | scrollLeft: 横向滚动距离 | -| getVerticalScroll | 获取纵向滚动距离 | — | -| getLeftHorizontalScroll | 获取左到右横向滚动距离 | — | -| getRightHorizontalScroll | 获取右往左横向滚动距离 | — | -| attr | 设置属性 | key: 键 value: 值 | -| restore | 存储 | — | -| populate | 增加项 | items: array | -| destroy | 摧毁表 | — | - ------- \ No newline at end of file diff --git a/docs/_book/case/table/tree_table.html b/docs/_book/case/table/tree_table.html deleted file mode 100644 index a06211c5d..000000000 --- a/docs/_book/case/table/tree_table.html +++ /dev/null @@ -1,2772 +0,0 @@ - - - - - - - tree_table · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                            -
                                                                                                            - - - - - - - - -
                                                                                                            - -
                                                                                                            - -
                                                                                                            - - - - - - - - -
                                                                                                            -
                                                                                                            - -
                                                                                                            -
                                                                                                            - -
                                                                                                            - -

                                                                                                            bi.tree_table

                                                                                                            -

                                                                                                            树状结构的表格

                                                                                                            -
                                                                                                            var table = BI.createWidget({
                                                                                                            -    type: "bi.tree_table",
                                                                                                            -    width: 600,
                                                                                                            -    height: 400,
                                                                                                            -    columnSize: [100, 100, 100, 100, 100, 100, 100, 100, 100, 100],
                                                                                                            -    minColumnSize: [100, 100, 100, 100, 100, 100, 100, 100, 100, 100],
                                                                                                            -    header: header,
                                                                                                            -    items: items,
                                                                                                            -    crossHeader: crossHeader,
                                                                                                            -    crossItems: crossItems,
                                                                                                            -    element: 'body',
                                                                                                            -});
                                                                                                            -
                                                                                                            -
                                                                                                            - -

                                                                                                            参数设置

                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                            参数说明类型默认值
                                                                                                            isNeedResize是否需要调整列宽booleanfalse
                                                                                                            isResizeAdapt是否需要在调整列宽或区域宽度的时候它们自适应变化booleantrue
                                                                                                            isNeedFreeze是否需要冻结表头booleanfalse
                                                                                                            freezeCols冻结的列array[]
                                                                                                            isNeedMerge是否需要合并单元格booleanfalse
                                                                                                            mergeCols合并的单元格列号array[]
                                                                                                            mergeRule合并规则, 默认相等时合并function(row1, row2)默认row1 = row2 时合并
                                                                                                            columnSize单元格宽度集合array[]
                                                                                                            minColumnSize最小列宽array[]
                                                                                                            maxColumnSize最大列宽array[]
                                                                                                            headerRowSize表头高度number25
                                                                                                            headerCellStyleGetterfunctionBI.emptyFn
                                                                                                            summaryCellStyleGetterfunctionBI.emptyFn
                                                                                                            sequenceCellStyleGetterfunctionBI.emptyFn
                                                                                                            rowSize普通单元格高度number25
                                                                                                            regionColumnSize列项间的array[]
                                                                                                            header表头array[]
                                                                                                            items子组件array[]
                                                                                                            crossHeader交叉表头array[]
                                                                                                            crossItems交叉项array[]
                                                                                                            -

                                                                                                            方法

                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                            方法名说明参数
                                                                                                            setWidth设置宽度width: 宽度
                                                                                                            setHeight设置高度height: 高度
                                                                                                            setColumnSize设置列宽columnSize: 列宽数组
                                                                                                            getColumnSize得到列宽
                                                                                                            setRegionColumnSize设置列项之间的间隙columnSize: 列宽数组
                                                                                                            getRegionColumnSize获得列项之间的间隙
                                                                                                            setVerticalScroll设置纵向滚动距离scrollTop: 纵向滚动距离
                                                                                                            setLeftHorizontalScroll设置左到右横向滚动距离scrollLeft: 横向滚动距离
                                                                                                            setRightHorizontalScroll设置右往左横向滚动距离scrollLeft: 横向滚动距离
                                                                                                            getVerticalScroll获取纵向滚动距离
                                                                                                            getLeftHorizontalScroll获取左到右横向滚动距离
                                                                                                            getRightHorizontalScroll获取右往左横向滚动距离
                                                                                                            attr设置属性key: 键 value: 值
                                                                                                            restore存储
                                                                                                            populate增加项items: array
                                                                                                            destroy摧毁表
                                                                                                            -
                                                                                                            - - -
                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            - -

                                                                                                            results matching ""

                                                                                                            -
                                                                                                              - -
                                                                                                              -
                                                                                                              - -

                                                                                                              No results matching ""

                                                                                                              - -
                                                                                                              -
                                                                                                              -
                                                                                                              - -
                                                                                                              -
                                                                                                              - -
                                                                                                              - - - - -
                                                                                                              - - -
                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/table/tree_table.md b/docs/_book/case/table/tree_table.md deleted file mode 100644 index 5e95b6641..000000000 --- a/docs/_book/case/table/tree_table.md +++ /dev/null @@ -1,73 +0,0 @@ -# bi.tree_table - -### 树状结构的表格 - -{% method %} -[source](https://jsfiddle.net/fineui/a0m21ozk/) - -{% common %} -```javascript -var table = BI.createWidget({ - type: "bi.tree_table", - width: 600, - height: 400, - columnSize: [100, 100, 100, 100, 100, 100, 100, 100, 100, 100], - minColumnSize: [100, 100, 100, 100, 100, 100, 100, 100, 100, 100], - header: header, - items: items, - crossHeader: crossHeader, - crossItems: crossItems, - element: 'body', -}); -``` - -{% endmethod %} - -## 参数设置 -| 参数 | 说明 | 类型 | 默认值 | -| ----------------------- | ------------------------ | -------------------- | ----------------- | -| isNeedResize | 是否需要调整列宽 | boolean | false | -| isResizeAdapt | 是否需要在调整列宽或区域宽度的时候它们自适应变化 | boolean | true | -| isNeedFreeze | 是否需要冻结表头 | boolean | false | -| freezeCols | 冻结的列 | array | [] | -| isNeedMerge | 是否需要合并单元格 | boolean | false | -| mergeCols | 合并的单元格列号 | array | [] | -| mergeRule | 合并规则, 默认相等时合并 | function(row1, row2) | 默认row1 = row2 时合并 | -| columnSize | 单元格宽度集合 | array | [] | -| minColumnSize | 最小列宽 | array | [] | -| maxColumnSize | 最大列宽 | array | [] | -| headerRowSize | 表头高度 | number | 25 | -| headerCellStyleGetter | | function | BI.emptyFn | -| summaryCellStyleGetter | | function | BI.emptyFn | -| sequenceCellStyleGetter | | function | BI.emptyFn | -| rowSize | 普通单元格高度 | number | 25 | -| regionColumnSize | 列项间的 | array | [] | -| header | 表头 | array | [] | -| items | 子组件 | array | [] | -| crossHeader | 交叉表头 | array | [] | -| crossItems | 交叉项 | array | [] | - - - -## 方法 -| 方法名 | 说明 | 参数 | -| ------------------------ | ----------- | ------------------ | -| setWidth | 设置宽度 | width: 宽度 | -| setHeight | 设置高度 | height: 高度 | -| setColumnSize | 设置列宽 | columnSize: 列宽数组 | -| getColumnSize | 得到列宽 | — | -| setRegionColumnSize | 设置列项之间的间隙 | columnSize: 列宽数组 | -| getRegionColumnSize | 获得列项之间的间隙 | — | -| setVerticalScroll | 设置纵向滚动距离 | scrollTop: 纵向滚动距离 | -| setLeftHorizontalScroll | 设置左到右横向滚动距离 | scrollLeft: 横向滚动距离 | -| setRightHorizontalScroll | 设置右往左横向滚动距离 | scrollLeft: 横向滚动距离 | -| getVerticalScroll | 获取纵向滚动距离 | — | -| getLeftHorizontalScroll | 获取左到右横向滚动距离 | — | -| getRightHorizontalScroll | 获取右往左横向滚动距离 | — | -| attr | 设置属性 | key: 键 value: 值 | -| restore | 存储 | — | -| populate | 增加项 | items: array | -| destroy | 摧毁表 | — | - ------- - diff --git a/docs/_book/case/tree/branch_relation.html b/docs/_book/case/tree/branch_relation.html deleted file mode 100644 index 1f9b7f8de..000000000 --- a/docs/_book/case/tree/branch_relation.html +++ /dev/null @@ -1,2597 +0,0 @@ - - - - - - - branch_relation · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                              -
                                                                                                              - - - - - - - - -
                                                                                                              - -
                                                                                                              - -
                                                                                                              - - - - - - - - -
                                                                                                              -
                                                                                                              - -
                                                                                                              -
                                                                                                              - -
                                                                                                              - -

                                                                                                              bi.branch_relation

                                                                                                              -

                                                                                                              表关联树

                                                                                                              -
                                                                                                              var tree = BI.createWidget({
                                                                                                              -  type: "bi.branch_relation",
                                                                                                              -  element: 'body',
                                                                                                              -  items: [],
                                                                                                              -  direction: BI.Direction.Right,
                                                                                                              -  align: BI.HorizontalAlign.Right,
                                                                                                              -  centerOffset: -50
                                                                                                              -});
                                                                                                              -
                                                                                                              -
                                                                                                              - - - -

                                                                                                              参数设置

                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                              参数说明类型默认值
                                                                                                              centerOffset重心偏移量number0
                                                                                                              direction根节点所在方向stringBI.Direction.Bottom
                                                                                                              align对齐方向stringBI.VerticalAlign.Top
                                                                                                              items元素arraynull
                                                                                                              -

                                                                                                              方法

                                                                                                              - - - - - - - - - - - - - - - -
                                                                                                              方法名说明参数
                                                                                                              populate去掉所有内容items: 子项数组
                                                                                                              -
                                                                                                              - - -
                                                                                                              - -
                                                                                                              -
                                                                                                              -
                                                                                                              - -

                                                                                                              results matching ""

                                                                                                              -
                                                                                                                - -
                                                                                                                -
                                                                                                                - -

                                                                                                                No results matching ""

                                                                                                                - -
                                                                                                                -
                                                                                                                -
                                                                                                                - -
                                                                                                                -
                                                                                                                - -
                                                                                                                - - - - -
                                                                                                                - - -
                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/tree/branch_relation.md b/docs/_book/case/tree/branch_relation.md deleted file mode 100644 index 797678694..000000000 --- a/docs/_book/case/tree/branch_relation.md +++ /dev/null @@ -1,41 +0,0 @@ -# bi.branch_relation - -### 表关联树 - -{% method %} -[source](https://jsfiddle.net/fineui/z5hLcruk/) - -{% common %} -```javascript -var tree = BI.createWidget({ - type: "bi.branch_relation", - element: 'body', - items: [], - direction: BI.Direction.Right, - align: BI.HorizontalAlign.Right, - centerOffset: -50 -}); -``` - -{% endmethod %} - - - -### 参数设置 - -| 参数 | 说明 | 类型 | 默认值 | -| ------------ | ------- | ------ | -------------------- | -| centerOffset | 重心偏移量 | number | 0 | -| direction | 根节点所在方向 | string | BI.Direction.Bottom | -| align | 对齐方向 | string | BI.VerticalAlign.Top | -| items | 元素 | array | null | - - - -### 方法 - -| 方法名 | 说明 | 参数 | -| -------- | ---- | ----------- | -| populate | 去掉所有内容 | items: 子项数组 | - ------- \ No newline at end of file diff --git a/docs/_book/case/tree/branch_tree.html b/docs/_book/case/tree/branch_tree.html deleted file mode 100644 index a26d0eb29..000000000 --- a/docs/_book/case/tree/branch_tree.html +++ /dev/null @@ -1,2600 +0,0 @@ - - - - - - - branch_tree · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                -
                                                                                                                - - - - - - - - -
                                                                                                                - -
                                                                                                                - -
                                                                                                                - - - - - - - - -
                                                                                                                -
                                                                                                                - -
                                                                                                                -
                                                                                                                - -
                                                                                                                - -

                                                                                                                bi.branch_tree

                                                                                                                -

                                                                                                                横向分支的树

                                                                                                                -
                                                                                                                BI.createWidget({
                                                                                                                -  type: "bi.branch_tree",
                                                                                                                -  element: 'body',
                                                                                                                -  items: [{
                                                                                                                -    el: {},
                                                                                                                -    children: [{
                                                                                                                -        el: {},
                                                                                                                -        children: {},
                                                                                                                -        // ...
                                                                                                                -    }]
                                                                                                                -  }]
                                                                                                                -});
                                                                                                                -
                                                                                                                -
                                                                                                                - - - -

                                                                                                                参数设置

                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                参数说明类型默认值
                                                                                                                expanderbranch_expander组件配置项object{}
                                                                                                                el基础元素object{}
                                                                                                                items子项array[]
                                                                                                                -

                                                                                                                方法

                                                                                                                - - - - - - - - - - - - - - - - - - - - -
                                                                                                                方法名说明参数
                                                                                                                populate去掉所有内容
                                                                                                                getValue获取所选项值
                                                                                                                -
                                                                                                                - - -
                                                                                                                - -
                                                                                                                -
                                                                                                                -
                                                                                                                - -

                                                                                                                results matching ""

                                                                                                                -
                                                                                                                  - -
                                                                                                                  -
                                                                                                                  - -

                                                                                                                  No results matching ""

                                                                                                                  - -
                                                                                                                  -
                                                                                                                  -
                                                                                                                  - -
                                                                                                                  -
                                                                                                                  - -
                                                                                                                  - - - - -
                                                                                                                  - - -
                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/tree/branch_tree.md b/docs/_book/case/tree/branch_tree.md deleted file mode 100644 index 76e183705..000000000 --- a/docs/_book/case/tree/branch_tree.md +++ /dev/null @@ -1,44 +0,0 @@ -# bi.branch_tree -### 横向分支的树 - -{% method %} -[source](https://jsfiddle.net/fineui/mLq3e170/) - -{% common %} -```javascript -BI.createWidget({ - type: "bi.branch_tree", - element: 'body', - items: [{ - el: {}, - children: [{ - el: {}, - children: {}, - // ... - }] - }] -}); -``` - -{% endmethod %} - - - -### 参数设置 - -| 参数 | 说明 | 类型 | 默认值 | -| -------- | -------------------- | ------ | ---- | -| expander | branch_expander组件配置项 | object | {} | -| el | 基础元素 | object | {} | -| items | 子项 | array | [] | - - - -### 方法 - -| 方法名 | 说明 | 参数 | -| -------- | ------ | ---- | -| populate | 去掉所有内容 | — | -| getValue | 获取所选项值 | — | - ------- \ No newline at end of file diff --git a/docs/_book/case/tree/display_tree.html b/docs/_book/case/tree/display_tree.html deleted file mode 100644 index 9a28f4a93..000000000 --- a/docs/_book/case/tree/display_tree.html +++ /dev/null @@ -1,2568 +0,0 @@ - - - - - - - display_tree · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                  -
                                                                                                                  - - - - - - - - -
                                                                                                                  - -
                                                                                                                  - -
                                                                                                                  - - - - - - - - -
                                                                                                                  -
                                                                                                                  - -
                                                                                                                  -
                                                                                                                  - -
                                                                                                                  - -

                                                                                                                  bi.display_tree

                                                                                                                  -

                                                                                                                  树展示控件

                                                                                                                  -
                                                                                                                  var tree = BI.createWidget({
                                                                                                                  -  type: "bi.display_tree",
                                                                                                                  -  element: 'body',
                                                                                                                  -});
                                                                                                                  -
                                                                                                                  -tree.initTree({
                                                                                                                  -    id: 1,
                                                                                                                  -    text: '',
                                                                                                                  -    open: true,
                                                                                                                  -});
                                                                                                                  -
                                                                                                                  -
                                                                                                                  - - -

                                                                                                                  方法

                                                                                                                  - - - - - - - - - - - - - - - - - - - - -
                                                                                                                  方法名说明参数
                                                                                                                  initTree加载tree结构node: 节点数组 settings: 配置项
                                                                                                                  destroy摧毁元素
                                                                                                                  -
                                                                                                                  - - -
                                                                                                                  - -
                                                                                                                  -
                                                                                                                  -
                                                                                                                  - -

                                                                                                                  results matching ""

                                                                                                                  -
                                                                                                                    - -
                                                                                                                    -
                                                                                                                    - -

                                                                                                                    No results matching ""

                                                                                                                    - -
                                                                                                                    -
                                                                                                                    -
                                                                                                                    - -
                                                                                                                    -
                                                                                                                    - -
                                                                                                                    - - - - -
                                                                                                                    - - -
                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/tree/display_tree.md b/docs/_book/case/tree/display_tree.md deleted file mode 100644 index 4a2c83105..000000000 --- a/docs/_book/case/tree/display_tree.md +++ /dev/null @@ -1,33 +0,0 @@ -# bi.display_tree - -### 树展示控件 - -{% method %} -[source](https://jsfiddle.net/fineui/cfL6fpa1/) - -{% common %} -```javascript -var tree = BI.createWidget({ - type: "bi.display_tree", - element: 'body', -}); - -tree.initTree({ - id: 1, - text: '', - open: true, -}); -``` - -{% endmethod %} - - -### 方法 - -| 方法名 | 说明 | 参数 | -| -------- | ------ | ---- | -| initTree | 加载tree结构 | node: 节点数组 settings: 配置项 | -| destroy | 摧毁元素 | — | - ------- - diff --git a/docs/_book/case/tree/handstand_branch_tree.html b/docs/_book/case/tree/handstand_branch_tree.html deleted file mode 100644 index 0a4d99484..000000000 --- a/docs/_book/case/tree/handstand_branch_tree.html +++ /dev/null @@ -1,2603 +0,0 @@ - - - - - - - handstand_branch_tree · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                    -
                                                                                                                    - - - - - - - - -
                                                                                                                    - -
                                                                                                                    - -
                                                                                                                    - - - - - - - - -
                                                                                                                    -
                                                                                                                    - -
                                                                                                                    -
                                                                                                                    - -
                                                                                                                    - -

                                                                                                                    bi.handstand_branch_tree

                                                                                                                    -

                                                                                                                    纵向分支的树

                                                                                                                    -
                                                                                                                    BI.createWidget({
                                                                                                                    -  type: "bi.handstand_branch_tree",
                                                                                                                    -  element: 'body',
                                                                                                                    -  el: {},
                                                                                                                    -  items: [{
                                                                                                                    -    el: {},
                                                                                                                    -    children: [{
                                                                                                                    -        el: {},
                                                                                                                    -        children: {},
                                                                                                                    -        // ...
                                                                                                                    -    }]
                                                                                                                    -  }]
                                                                                                                    -});
                                                                                                                    -
                                                                                                                    -
                                                                                                                    - - - -

                                                                                                                    参数设置

                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                    参数说明类型默认值
                                                                                                                    expanderbranch_expander组件配置项object{}
                                                                                                                    el基础元素object{}
                                                                                                                    items子项array[]
                                                                                                                    -

                                                                                                                    方法

                                                                                                                    - - - - - - - - - - - - - - - - - - - - -
                                                                                                                    方法名说明参数
                                                                                                                    populate去掉所有内容
                                                                                                                    getValue获取所选项值
                                                                                                                    -
                                                                                                                    - - -
                                                                                                                    - -
                                                                                                                    -
                                                                                                                    -
                                                                                                                    - -

                                                                                                                    results matching ""

                                                                                                                    -
                                                                                                                      - -
                                                                                                                      -
                                                                                                                      - -

                                                                                                                      No results matching ""

                                                                                                                      - -
                                                                                                                      -
                                                                                                                      -
                                                                                                                      - -
                                                                                                                      -
                                                                                                                      - -
                                                                                                                      - - - - -
                                                                                                                      - - -
                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/tree/handstand_branch_tree.md b/docs/_book/case/tree/handstand_branch_tree.md deleted file mode 100644 index bac0a81eb..000000000 --- a/docs/_book/case/tree/handstand_branch_tree.md +++ /dev/null @@ -1,46 +0,0 @@ -# bi.handstand_branch_tree -### 纵向分支的树 - -{% method %} -[source](https://jsfiddle.net/fineui/c2kaoc7x/) - -{% common %} -```javascript -BI.createWidget({ - type: "bi.handstand_branch_tree", - element: 'body', - el: {}, - items: [{ - el: {}, - children: [{ - el: {}, - children: {}, - // ... - }] - }] -}); -``` - -{% endmethod %} - - - -### 参数设置 - -| 参数 | 说明 | 类型 | 默认值 | -| -------- | -------------------- | ------ | ---- | -| expander | branch_expander组件配置项 | object | {} | -| el | 基础元素 | object | {} | -| items | 子项 | array | [] | - - - -### 方法 - -| 方法名 | 说明 | 参数 | -| -------- | ------ | ---- | -| populate | 去掉所有内容 | — | -| getValue | 获取所选项值 | — | - ------- - diff --git a/docs/_book/case/tree/level_tree.html b/docs/_book/case/tree/level_tree.html deleted file mode 100644 index cd206b92e..000000000 --- a/docs/_book/case/tree/level_tree.html +++ /dev/null @@ -1,2619 +0,0 @@ - - - - - - - level_tree · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                      -
                                                                                                                      - - - - - - - - -
                                                                                                                      - -
                                                                                                                      - -
                                                                                                                      - - - - - - - - -
                                                                                                                      -
                                                                                                                      - -
                                                                                                                      -
                                                                                                                      - -
                                                                                                                      - -

                                                                                                                      bi.level_tree

                                                                                                                      -

                                                                                                                      二级树

                                                                                                                      -
                                                                                                                      var tree = BI.createWidget({
                                                                                                                      -  type: "bi.level_tree",
                                                                                                                      -  element: 'body',
                                                                                                                      -  items: [],
                                                                                                                      -});
                                                                                                                      -
                                                                                                                      -
                                                                                                                      - - - -

                                                                                                                      参数设置

                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                      参数说明类型默认值
                                                                                                                      expanderbranch_expander配置object{}
                                                                                                                      items元素array[]
                                                                                                                      -

                                                                                                                      方法

                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                      方法名说明参数
                                                                                                                      initTree构造树结构nodes
                                                                                                                      stroke生成树方法nodes
                                                                                                                      populate去掉所有内容items: 子项数组
                                                                                                                      setValue设置值v
                                                                                                                      getValue获得值
                                                                                                                      getAllLeaves获取所有叶节点
                                                                                                                      getNodeById根据Id获取节点id
                                                                                                                      getNodeByValue根据值获取节点id
                                                                                                                      -
                                                                                                                      - - -
                                                                                                                      - -
                                                                                                                      -
                                                                                                                      -
                                                                                                                      - -

                                                                                                                      results matching ""

                                                                                                                      -
                                                                                                                        - -
                                                                                                                        -
                                                                                                                        - -

                                                                                                                        No results matching ""

                                                                                                                        - -
                                                                                                                        -
                                                                                                                        -
                                                                                                                        - -
                                                                                                                        -
                                                                                                                        - -
                                                                                                                        - - - - -
                                                                                                                        - - -
                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/tree/level_tree.md b/docs/_book/case/tree/level_tree.md deleted file mode 100644 index e444f27e7..000000000 --- a/docs/_book/case/tree/level_tree.md +++ /dev/null @@ -1,43 +0,0 @@ -# bi.level_tree - -### 二级树 - -{% method %} -[source](https://jsfiddle.net/fineui/nvvkwhfo/) - -{% common %} -```javascript -var tree = BI.createWidget({ - type: "bi.level_tree", - element: 'body', - items: [], -}); -``` - -{% endmethod %} - - - -### 参数设置 - -| 参数 | 说明 | 类型 | 默认值 | -| -------- | ----------------- | ------ | ---- | -| expander | branch_expander配置 | object | {} | -| items | 元素 | array | [] | - - - -### 方法 - -| 方法名 | 说明 | 参数 | -| -------------- | -------- | ----------- | -| initTree | 构造树结构 | nodes | -| stroke | 生成树方法 | nodes | -| populate | 去掉所有内容 | items: 子项数组 | -| setValue | 设置值 | v | -| getValue | 获得值 | — | -| getAllLeaves | 获取所有叶节点 | — | -| getNodeById | 根据Id获取节点 | id | -| getNodeByValue | 根据值获取节点 | id | - ------- \ No newline at end of file diff --git a/docs/_book/case/tree/simple_tree.html b/docs/_book/case/tree/simple_tree.html deleted file mode 100644 index 2856180f2..000000000 --- a/docs/_book/case/tree/simple_tree.html +++ /dev/null @@ -1,2600 +0,0 @@ - - - - - - - simple_tree · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                        -
                                                                                                                        - - - - - - - - -
                                                                                                                        - -
                                                                                                                        - -
                                                                                                                        - - - - - - - - -
                                                                                                                        -
                                                                                                                        - -
                                                                                                                        -
                                                                                                                        - -
                                                                                                                        - -

                                                                                                                        bi.simple_tree

                                                                                                                        -

                                                                                                                        简单的多选树

                                                                                                                        -
                                                                                                                        var tree = BI.createWidget({
                                                                                                                        -  type: "bi.simple_tree",
                                                                                                                        -  element: 'body',
                                                                                                                        -});
                                                                                                                        -
                                                                                                                        -tree.populate(items);
                                                                                                                        -
                                                                                                                        -
                                                                                                                        - - - -

                                                                                                                        参数设置

                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                        参数说明类型默认值
                                                                                                                        itemsCreatoritems构造器functionBI.emptyFn
                                                                                                                        items元素arraynull
                                                                                                                        -

                                                                                                                        方法

                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                        方法名说明参数
                                                                                                                        populate去掉所有内容items: 子项数组 keywords: 关键字标红字符串
                                                                                                                        setValue设置值v
                                                                                                                        getValue获得值
                                                                                                                        empty清空树
                                                                                                                        -
                                                                                                                        - - -
                                                                                                                        - -
                                                                                                                        -
                                                                                                                        -
                                                                                                                        - -

                                                                                                                        results matching ""

                                                                                                                        -
                                                                                                                          - -
                                                                                                                          -
                                                                                                                          - -

                                                                                                                          No results matching ""

                                                                                                                          - -
                                                                                                                          -
                                                                                                                          -
                                                                                                                          - -
                                                                                                                          -
                                                                                                                          - -
                                                                                                                          - - - - -
                                                                                                                          - - -
                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/tree/simple_tree.md b/docs/_book/case/tree/simple_tree.md deleted file mode 100644 index 35d8a5308..000000000 --- a/docs/_book/case/tree/simple_tree.md +++ /dev/null @@ -1,40 +0,0 @@ -# bi.simple_tree - -### 简单的多选树 - -{% method %} -[source](https://jsfiddle.net/fineui/5qtobqxb/) - -{% common %} -```javascript -var tree = BI.createWidget({ - type: "bi.simple_tree", - element: 'body', -}); - -tree.populate(items); -``` - -{% endmethod %} - - - -### 参数设置 - -| 参数 | 说明 | 类型 | 默认值 | -| ------------ | -------- | -------- | ---------- | -| itemsCreator | items构造器 | function | BI.emptyFn | -| items | 元素 | array | null | - - - -### 方法 - -| 方法名 | 说明 | 参数 | -| -------- | ---- | ------------------------------ | -| populate | 去掉所有内容 | items: 子项数组 keywords: 关键字标红字符串 | -| setValue | 设置值 | v | -| getValue | 获得值 | — | -| empty | 清空树 | — | - ------- \ No newline at end of file diff --git a/docs/_book/case/trigger/editor_trigger.html b/docs/_book/case/trigger/editor_trigger.html deleted file mode 100644 index 834f63687..000000000 --- a/docs/_book/case/trigger/editor_trigger.html +++ /dev/null @@ -1,2616 +0,0 @@ - - - - - - - editor_trigger · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                          -
                                                                                                                          - - - - - - - - -
                                                                                                                          - -
                                                                                                                          - -
                                                                                                                          - - - - - - - - -
                                                                                                                          -
                                                                                                                          - -
                                                                                                                          -
                                                                                                                          - -
                                                                                                                          - -

                                                                                                                          bi.editor_trigger

                                                                                                                          -

                                                                                                                          文本输入框trigger

                                                                                                                          -
                                                                                                                          
                                                                                                                          -BI.createWidget({
                                                                                                                          -  type: "bi.editor_trigger",
                                                                                                                          -  element: "body",
                                                                                                                          -});
                                                                                                                          -
                                                                                                                          -
                                                                                                                          - - - -

                                                                                                                          参数

                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                          参数说明类型默认值
                                                                                                                          validationChecker验证函数functionBI.emptyFn
                                                                                                                          quitChecker退出时验证函数functionBI.emptyFn
                                                                                                                          allowBlank是否允许为空booleanfalse
                                                                                                                          watermark水印string""
                                                                                                                          errorText错误信息string""
                                                                                                                          triggerWidth触发器宽度number30
                                                                                                                          -

                                                                                                                          方法

                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                          方法名说明参数
                                                                                                                          setValue设置值value
                                                                                                                          getVlaue获得值
                                                                                                                          setTexttext
                                                                                                                          -
                                                                                                                          - - -
                                                                                                                          - -
                                                                                                                          -
                                                                                                                          -
                                                                                                                          - -

                                                                                                                          results matching ""

                                                                                                                          -
                                                                                                                            - -
                                                                                                                            -
                                                                                                                            - -

                                                                                                                            No results matching ""

                                                                                                                            - -
                                                                                                                            -
                                                                                                                            -
                                                                                                                            - -
                                                                                                                            -
                                                                                                                            - -
                                                                                                                            - - - - -
                                                                                                                            - - -
                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/trigger/editor_trigger.md b/docs/_book/case/trigger/editor_trigger.md deleted file mode 100644 index a7c163ccb..000000000 --- a/docs/_book/case/trigger/editor_trigger.md +++ /dev/null @@ -1,44 +0,0 @@ -# bi.editor_trigger - -### 文本输入框trigger - -{% method %} -[source](https://jsfiddle.net/fineui/8ttm4g1u/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.editor_trigger", - element: "body", -}); - -``` - -{% endmethod %} - - - -### 参数 - -| 参数 | 说明 | 类型 | 默认值 | -| ----------------- | ------- | -------- | ---------- | -| validationChecker | 验证函数 | function | BI.emptyFn | -| quitChecker | 退出时验证函数 | function | BI.emptyFn | -| allowBlank | 是否允许为空 | boolean | false | -| watermark | 水印 | string | "" | -| errorText | 错误信息 | string | "" | -| triggerWidth | 触发器宽度 | number | 30 | - - - -### 方法 - -| 方法名 | 说明 | 参数 | -| -------- | ---- | ----- | -| setValue | 设置值 | value | -| getVlaue | 获得值 | — | -| setText | | text | - ------- - diff --git a/docs/_book/case/trigger/icon_trigger.html b/docs/_book/case/trigger/icon_trigger.html deleted file mode 100644 index 939d6577e..000000000 --- a/docs/_book/case/trigger/icon_trigger.html +++ /dev/null @@ -1,2540 +0,0 @@ - - - - - - - icon_trigger · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                            -
                                                                                                                            - - - - - - - - -
                                                                                                                            - -
                                                                                                                            - -
                                                                                                                            - - - - - - - - -
                                                                                                                            -
                                                                                                                            - -
                                                                                                                            -
                                                                                                                            - -
                                                                                                                            - -

                                                                                                                            bi.icon_trigger

                                                                                                                            -

                                                                                                                            图标按钮trigger

                                                                                                                            -
                                                                                                                            
                                                                                                                            -BI.createWidget({
                                                                                                                            -  type: "bi.icon_trigger",
                                                                                                                            -  element: "body",
                                                                                                                            -});
                                                                                                                            -
                                                                                                                            -
                                                                                                                            - -
                                                                                                                            - - -
                                                                                                                            - -
                                                                                                                            -
                                                                                                                            -
                                                                                                                            - -

                                                                                                                            results matching ""

                                                                                                                            -
                                                                                                                              - -
                                                                                                                              -
                                                                                                                              - -

                                                                                                                              No results matching ""

                                                                                                                              - -
                                                                                                                              -
                                                                                                                              -
                                                                                                                              - -
                                                                                                                              -
                                                                                                                              - -
                                                                                                                              - - - - -
                                                                                                                              - - -
                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/trigger/icon_trigger.md b/docs/_book/case/trigger/icon_trigger.md deleted file mode 100644 index e61f8cf77..000000000 --- a/docs/_book/case/trigger/icon_trigger.md +++ /dev/null @@ -1,21 +0,0 @@ -# bi.icon_trigger - -### 图标按钮trigger - -{% method %} -[source](https://jsfiddle.net/fineui/qs44h1xy/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.icon_trigger", - element: "body", -}); - -``` - -{% endmethod %} - ------- - diff --git a/docs/_book/case/trigger/text_trigger.html b/docs/_book/case/trigger/text_trigger.html deleted file mode 100644 index 88cb23a71..000000000 --- a/docs/_book/case/trigger/text_trigger.html +++ /dev/null @@ -1,2560 +0,0 @@ - - - - - - - text_trigger · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                              -
                                                                                                                              - - - - - - - - -
                                                                                                                              - -
                                                                                                                              - -
                                                                                                                              - - - - - - - - -
                                                                                                                              -
                                                                                                                              - -
                                                                                                                              -
                                                                                                                              - -
                                                                                                                              - -

                                                                                                                              bi.text_trigger

                                                                                                                              -

                                                                                                                              文本输入框trigger

                                                                                                                              -
                                                                                                                              
                                                                                                                              -BI.createWidget({
                                                                                                                              -  type: "bi.editor_trigger",
                                                                                                                              -  element: "body",
                                                                                                                              -});
                                                                                                                              -
                                                                                                                              -
                                                                                                                              - -

                                                                                                                              方法

                                                                                                                              - - - - - - - - - - - - - - - - - - - - -
                                                                                                                              方法名说明参数
                                                                                                                              setValue设置值value
                                                                                                                              getVlaue获得值
                                                                                                                              -
                                                                                                                              - - -
                                                                                                                              - -
                                                                                                                              -
                                                                                                                              -
                                                                                                                              - -

                                                                                                                              results matching ""

                                                                                                                              -
                                                                                                                                - -
                                                                                                                                -
                                                                                                                                - -

                                                                                                                                No results matching ""

                                                                                                                                - -
                                                                                                                                -
                                                                                                                                -
                                                                                                                                - -
                                                                                                                                -
                                                                                                                                - -
                                                                                                                                - - - - -
                                                                                                                                - - -
                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/case/trigger/text_trigger.md b/docs/_book/case/trigger/text_trigger.md deleted file mode 100644 index 078cb6b7b..000000000 --- a/docs/_book/case/trigger/text_trigger.md +++ /dev/null @@ -1,28 +0,0 @@ -# bi.text_trigger - -### 文本输入框trigger - -{% method %} -[source](https://jsfiddle.net/fineui/6pz5pjp6/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.editor_trigger", - element: "body", -}); - -``` - -{% endmethod %} - -### 方法 - -| 方法名 | 说明 | 参数 | -| -------- | ---- | ----- | -| setValue | 设置值 | value | -| getVlaue | 获得值 | — | - ------- - diff --git a/docs/_book/core/abstract/button_group.html b/docs/_book/core/abstract/button_group.html deleted file mode 100644 index cdfdb3269..000000000 --- a/docs/_book/core/abstract/button_group.html +++ /dev/null @@ -1,2705 +0,0 @@ - - - - - - - button_group · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                -
                                                                                                                                - - - - - - - - -
                                                                                                                                - -
                                                                                                                                - -
                                                                                                                                - - - - - - - - -
                                                                                                                                -
                                                                                                                                - -
                                                                                                                                -
                                                                                                                                - -
                                                                                                                                - -

                                                                                                                                bi.button_group

                                                                                                                                -

                                                                                                                                一组具有相同属性的元素集合,基类BI.Widget

                                                                                                                                -
                                                                                                                                
                                                                                                                                -BI.createWidget({
                                                                                                                                -    element: "#wrapper",
                                                                                                                                -    type: "bi.button_group",
                                                                                                                                -    chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
                                                                                                                                -    layouts: [{
                                                                                                                                -      type: "bi.vertical"
                                                                                                                                -    }],
                                                                                                                                -    items: [{
                                                                                                                                -      el: {
                                                                                                                                -        type: "bi.label",
                                                                                                                                -        text: "button_group"
                                                                                                                                -      },
                                                                                                                                -      height: 50,
                                                                                                                                -    }]
                                                                                                                                -})
                                                                                                                                -
                                                                                                                                -
                                                                                                                                - -

                                                                                                                                API

                                                                                                                                -
                                                                                                                                基础属性
                                                                                                                                -
                                                                                                                                chooseType可选值为 CHOOSE_TYPE_SINGLE,CHOOSE_TYPE_MULTI,CHOOSE_TYPE_ALL,CHOOSE_TYPE_NONE,CHOOSE_TYPE_DEFAULT
                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                参数说明类型可选值默认值
                                                                                                                                behaviors自定义列表中item项的行为,如高亮,标红等object{ }
                                                                                                                                items子组件数组array[ ]
                                                                                                                                chooseType选择类型const见上BI.ButtonGroup.CHOOSE_TYPE_SINGLE
                                                                                                                                layouts布局array[{type: "bi.center",hgap: 0,vgap: 0}]
                                                                                                                                -

                                                                                                                                对外方法

                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                名称说明回调参数
                                                                                                                                doBehavior自定义列表中item项的行为,如高亮,标红等
                                                                                                                                prependItems内部前插入items
                                                                                                                                addItems内部后插入items
                                                                                                                                removeItemAt移除指定索引处的itemindexs
                                                                                                                                removeItems移除制定元素values
                                                                                                                                populate刷新列表items
                                                                                                                                setNotSelectedValue设置未被选中的值value,可以是单个值也可以是个数组
                                                                                                                                setEnabledValue设置value值可用value,可以是单个值也可以是个数组
                                                                                                                                setValue设置value值value,可以是单个值也可以是个数组
                                                                                                                                getNotSelectedValue获取没有被选中的值
                                                                                                                                getValue获取被选中的值
                                                                                                                                getAllButtons获取所有button
                                                                                                                                getAllLeaves获取所有的叶子节点
                                                                                                                                getSelectedButtons获取所有被选中的元素
                                                                                                                                getNotSelectedButtons获取所有未被选中的元素
                                                                                                                                getIndexByValue根据value值获取value在数组中的索引value
                                                                                                                                getNodeById根据id获取节点id
                                                                                                                                getNodeByValue根据value值获取节点value
                                                                                                                                empty清空组件
                                                                                                                                destroy销毁组件
                                                                                                                                -
                                                                                                                                - - -
                                                                                                                                - -
                                                                                                                                -
                                                                                                                                -
                                                                                                                                - -

                                                                                                                                results matching ""

                                                                                                                                -
                                                                                                                                  - -
                                                                                                                                  -
                                                                                                                                  - -

                                                                                                                                  No results matching ""

                                                                                                                                  - -
                                                                                                                                  -
                                                                                                                                  -
                                                                                                                                  - -
                                                                                                                                  -
                                                                                                                                  - -
                                                                                                                                  - - - - -
                                                                                                                                  - - -
                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/abstract/button_group.md b/docs/_book/core/abstract/button_group.md deleted file mode 100644 index d79e75d18..000000000 --- a/docs/_book/core/abstract/button_group.md +++ /dev/null @@ -1,68 +0,0 @@ -# bi.button_group - -## 一组具有相同属性的元素集合,基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/te0nLap1/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.button_group", - chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, - layouts: [{ - type: "bi.vertical" - }], - items: [{ - el: { - type: "bi.label", - text: "button_group" - }, - height: 50, - }] -}) - -``` - -{% endmethod %} - -## API -##### 基础属性 -###### chooseType可选值为 CHOOSE_TYPE_SINGLE,CHOOSE_TYPE_MULTI,CHOOSE_TYPE_ALL,CHOOSE_TYPE_NONE,CHOOSE_TYPE_DEFAULT -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| behaviors | 自定义列表中item项的行为,如高亮,标红等 |object | — |{ }| -| items | 子组件数组 | array | — | [ ] | -| chooseType | 选择类型 | const | 见上| BI.ButtonGroup.CHOOSE_TYPE_SINGLE | -| layouts | 布局 | array | — | [{type: "bi.center",hgap: 0,vgap: 0}] | - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| doBehavior | 自定义列表中item项的行为,如高亮,标红等 | — | -| prependItems | 内部前插入 | items | -| addItems | 内部后插入 | items | -| removeItemAt | 移除指定索引处的item | indexs | -| removeItems | 移除制定元素 | values | -| populate | 刷新列表 | items | -| setNotSelectedValue| 设置未被选中的值 | value,可以是单个值也可以是个数组| -| setEnabledValue | 设置value值可用| value,可以是单个值也可以是个数组 | -| setValue | 设置value值 | value,可以是单个值也可以是个数组 | -| getNotSelectedValue | 获取没有被选中的值 | —| -| getValue | 获取被选中的值 |—| -| getAllButtons | 获取所有button |—| -| getAllLeaves | 获取所有的叶子节点 | —| -| getSelectedButtons | 获取所有被选中的元素 | —| -| getNotSelectedButtons | 获取所有未被选中的元素 | —| -| getIndexByValue | 根据value值获取value在数组中的索引 | value| -| getNodeById | 根据id获取节点 | id | -| getNodeByValue | 根据value值获取节点 | value | -| empty| 清空组件|—| -| destroy| 销毁组件|—| - - ---- - - diff --git a/docs/_book/core/abstract/button_tree.html b/docs/_book/core/abstract/button_tree.html deleted file mode 100644 index 8a4cd1c35..000000000 --- a/docs/_book/core/abstract/button_tree.html +++ /dev/null @@ -1,2623 +0,0 @@ - - - - - - - button_tree · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                  -
                                                                                                                                  - - - - - - - - -
                                                                                                                                  - -
                                                                                                                                  - -
                                                                                                                                  - - - - - - - - -
                                                                                                                                  -
                                                                                                                                  - -
                                                                                                                                  -
                                                                                                                                  - -
                                                                                                                                  - -

                                                                                                                                  bi.button_tree

                                                                                                                                  -

                                                                                                                                  一组具有相同属性的元素集合,基类BI.ButtonGroup

                                                                                                                                  -
                                                                                                                                  
                                                                                                                                  -BI.createWidget({
                                                                                                                                  -  element: "#wrapper",
                                                                                                                                  -  type: "bi.button_tree",
                                                                                                                                  -  chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
                                                                                                                                  -  layouts: [{
                                                                                                                                  -      type: "bi.vertical"
                                                                                                                                  -  }],
                                                                                                                                  -  items: [{
                                                                                                                                  -      type: "bi.label",
                                                                                                                                  -      text: "0",
                                                                                                                                  -      value: "label1",
                                                                                                                                  -      height:50,
                                                                                                                                  -      vgap:10
                                                                                                                                  -  }]
                                                                                                                                  -})
                                                                                                                                  -
                                                                                                                                  -
                                                                                                                                  - -

                                                                                                                                  对外方法

                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                  名称说明回调参数
                                                                                                                                  setNotSelectedValue设置未被选中的值value,可以是单个值也可以是个数组
                                                                                                                                  setEnabledValue设置value值可用value,可以是单个值也可以是个数组
                                                                                                                                  setValue设置value值value,可以是单个值也可以是个数组
                                                                                                                                  getNotSelectedValue获取没有被选中的值
                                                                                                                                  getValue获取被选中的值
                                                                                                                                  getAllButtons获取所有button
                                                                                                                                  getAllLeaves获取所有的叶子节点
                                                                                                                                  getSelectedButtons获取所有被选中的元素
                                                                                                                                  getNotSelectedButtons获取所有未被选中的元素
                                                                                                                                  getIndexByValue根据value值获取value在数组中的索引value
                                                                                                                                  getNodeById根据id获取节点id
                                                                                                                                  getNodeByValue根据value值获取节点value
                                                                                                                                  -
                                                                                                                                  - - -
                                                                                                                                  - -
                                                                                                                                  -
                                                                                                                                  -
                                                                                                                                  - -

                                                                                                                                  results matching ""

                                                                                                                                  -
                                                                                                                                    - -
                                                                                                                                    -
                                                                                                                                    - -

                                                                                                                                    No results matching ""

                                                                                                                                    - -
                                                                                                                                    -
                                                                                                                                    -
                                                                                                                                    - -
                                                                                                                                    -
                                                                                                                                    - -
                                                                                                                                    - - - - -
                                                                                                                                    - - -
                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/abstract/button_tree.md b/docs/_book/core/abstract/button_tree.md deleted file mode 100644 index 0e3cf8eb6..000000000 --- a/docs/_book/core/abstract/button_tree.md +++ /dev/null @@ -1,50 +0,0 @@ -# bi.button_tree - -## 一组具有相同属性的元素集合,基类[BI.ButtonGroup](/core/abstract/button_group.md) - -{% method %} -[source](https://jsfiddle.net/fineui/pgwpw4n9/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.button_tree", - chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI, - layouts: [{ - type: "bi.vertical" - }], - items: [{ - type: "bi.label", - text: "0", - value: "label1", - height:50, - vgap:10 - }] -}) -``` - -{% endmethod %} - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setNotSelectedValue| 设置未被选中的值 | value,可以是单个值也可以是个数组| -| setEnabledValue | 设置value值可用| value,可以是单个值也可以是个数组 | -| setValue | 设置value值 | value,可以是单个值也可以是个数组 | -| getNotSelectedValue | 获取没有被选中的值 | —| -| getValue | 获取被选中的值 |—| -| getAllButtons | 获取所有button |—| -| getAllLeaves | 获取所有的叶子节点 | —| -| getSelectedButtons | 获取所有被选中的元素 | —| -| getNotSelectedButtons | 获取所有未被选中的元素 | —| -| getIndexByValue | 根据value值获取value在数组中的索引 | value| -| getNodeById | 根据id获取节点 | id | -| getNodeByValue | 根据value值获取节点 | value | - - - ---- - - diff --git a/docs/_book/core/abstract/collection_view.html b/docs/_book/core/abstract/collection_view.html deleted file mode 100644 index 850210bbc..000000000 --- a/docs/_book/core/abstract/collection_view.html +++ /dev/null @@ -1,2715 +0,0 @@ - - - - - - - collection_view · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                    -
                                                                                                                                    - - - - - - - - -
                                                                                                                                    - -
                                                                                                                                    - -
                                                                                                                                    - - - - - - - - -
                                                                                                                                    -
                                                                                                                                    - -
                                                                                                                                    -
                                                                                                                                    - -
                                                                                                                                    - -

                                                                                                                                    bi.collection_view

                                                                                                                                    -

                                                                                                                                    CollectionView,指定行列可以删除看不见的元素 基类BI.Widget

                                                                                                                                    -
                                                                                                                                    
                                                                                                                                    -BI.createWidget({
                                                                                                                                    -  type: "bi.collection_view",
                                                                                                                                    -  element:"#wrapper",
                                                                                                                                    -  width: 400,
                                                                                                                                    -  height: 300,
                                                                                                                                    -  items: [],
                                                                                                                                    -  cellSizeAndPositionGetter: function (index) {
                                                                                                                                    -      return {
                                                                                                                                    -          x: index % 10 * 50,
                                                                                                                                    -          y: Math.floor(index / 10) * 50,
                                                                                                                                    -          width: 50,
                                                                                                                                    -          height: 50
                                                                                                                                    -      }
                                                                                                                                    -  }
                                                                                                                                    -});
                                                                                                                                    -
                                                                                                                                    -
                                                                                                                                    - -

                                                                                                                                    API

                                                                                                                                    -
                                                                                                                                    基础属性
                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                    参数说明类型可选值默认值
                                                                                                                                    items子组件数组array[ ]
                                                                                                                                    overflowX是否显示横向滚动条booleantrue,falsetrue
                                                                                                                                    overflowY是否显示纵向滚动条booleantrue,falsetrue
                                                                                                                                    cellSizeAndPositionGetter设置每个单元格的位置坐标和宽高function
                                                                                                                                    horizontalOverscanSize横向超出可视范围区域预加载的数量number0
                                                                                                                                    verticalOverscanSize纵向超出可视范围区域预加载的数量number0
                                                                                                                                    width行宽,必设number
                                                                                                                                    height列宽,必设number
                                                                                                                                    scrollLeft滚动条相对于左边的偏移number0
                                                                                                                                    scrollTop滚动条相对于顶部的偏移number0
                                                                                                                                    -

                                                                                                                                    对外方法

                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                    名称说明回调参数
                                                                                                                                    setScrollLeft设置滚动条相对于左边的偏移scrollLeft
                                                                                                                                    setScrollTop设置滚动条相对于顶部的偏移scrollTop
                                                                                                                                    setOverflowX设置是否显示横向滚动条b
                                                                                                                                    setOverflowY设置是否显示横向滚动条b
                                                                                                                                    getScrollLeft获取滚动条相对于左边的偏移
                                                                                                                                    getScrollTop获取滚动条相对于顶部的偏移
                                                                                                                                    getMaxScrollLeft获取滚动条相对于左边的最大偏移
                                                                                                                                    getMaxScrollTop获取滚动条相对于顶部的最大偏移
                                                                                                                                    restore还原列表设置
                                                                                                                                    populate刷新列表items
                                                                                                                                    -

                                                                                                                                    事件

                                                                                                                                    - - - - - - - - - - - - - - - -
                                                                                                                                    事件说明回调参数
                                                                                                                                    BI.CollectionView.EVENT_SCROLL滚动时触发的事件{scrollLeft: scrollLeft, scrollTop: scrollTop}
                                                                                                                                    -
                                                                                                                                    - - -
                                                                                                                                    - -
                                                                                                                                    -
                                                                                                                                    -
                                                                                                                                    - -

                                                                                                                                    results matching ""

                                                                                                                                    -
                                                                                                                                      - -
                                                                                                                                      -
                                                                                                                                      - -

                                                                                                                                      No results matching ""

                                                                                                                                      - -
                                                                                                                                      -
                                                                                                                                      -
                                                                                                                                      - -
                                                                                                                                      -
                                                                                                                                      - -
                                                                                                                                      - - - - -
                                                                                                                                      - - -
                                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/abstract/collection_view.md b/docs/_book/core/abstract/collection_view.md deleted file mode 100644 index d6bc36666..000000000 --- a/docs/_book/core/abstract/collection_view.md +++ /dev/null @@ -1,71 +0,0 @@ -# bi.collection_view - -## CollectionView,指定行列可以删除看不见的元素 基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/cmq0b3v0/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.collection_view", - element:"#wrapper", - width: 400, - height: 300, - items: [], - cellSizeAndPositionGetter: function (index) { - return { - x: index % 10 * 50, - y: Math.floor(index / 10) * 50, - width: 50, - height: 50 - } - } -}); - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| items | 子组件数组 | array | — | [ ] | -| overflowX | 是否显示横向滚动条| boolean | true,false | true | -| overflowY | 是否显示纵向滚动条 | boolean | true,false | true | -| cellSizeAndPositionGetter | 设置每个单元格的位置坐标和宽高 | function|— | — | -| horizontalOverscanSize | 横向超出可视范围区域预加载的数量 | number | — | 0 | -| verticalOverscanSize | 纵向超出可视范围区域预加载的数量 | number | — | 0 | -| width | 行宽,必设 |number| — | — | -| height | 列宽,必设 | number | —| — | -| scrollLeft | 滚动条相对于左边的偏移 | number | — | 0 | -| scrollTop | 滚动条相对于顶部的偏移 | number | — | 0 | - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setScrollLeft | 设置滚动条相对于左边的偏移 | scrollLeft| -| setScrollTop | 设置滚动条相对于顶部的偏移 | scrollTop | -| setOverflowX | 设置是否显示横向滚动条 | b | -| setOverflowY | 设置是否显示横向滚动条 | b| -| getScrollLeft | 获取滚动条相对于左边的偏移 | —| -| getScrollTop | 获取滚动条相对于顶部的偏移 | — | -| getMaxScrollLeft | 获取滚动条相对于左边的最大偏移 | — | -| getMaxScrollTop | 获取滚动条相对于顶部的最大偏移 |—| -| restore | 还原列表设置 | — | -| populate | 刷新列表 | items | - - -## 事件 -| 事件 | 说明 | 回调参数 | -| :------ |:------------- |:------------------------| -|BI.CollectionView.EVENT_SCROLL| 滚动时触发的事件 | {scrollLeft: scrollLeft, scrollTop: scrollTop} | - ---- - - diff --git a/docs/_book/core/abstract/custom_tree.html b/docs/_book/core/abstract/custom_tree.html deleted file mode 100644 index 4b1ed7e4b..000000000 --- a/docs/_book/core/abstract/custom_tree.html +++ /dev/null @@ -1,2689 +0,0 @@ - - - - - - - custom_tree · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                      -
                                                                                                                                      - - - - - - - - -
                                                                                                                                      - -
                                                                                                                                      - -
                                                                                                                                      - - - - - - - - -
                                                                                                                                      -
                                                                                                                                      - -
                                                                                                                                      -
                                                                                                                                      - -
                                                                                                                                      - -

                                                                                                                                      bi.custom_tree

                                                                                                                                      -

                                                                                                                                      自定义树,基类BI.Widget

                                                                                                                                      -
                                                                                                                                      
                                                                                                                                      -BI.createWidget({
                                                                                                                                      -    type: "bi.custom_tree",
                                                                                                                                      -    el: {
                                                                                                                                      -        type: "bi.button_tree",
                                                                                                                                      -        chooseType: 0,
                                                                                                                                      -        layouts: [{
                                                                                                                                      -            type: "bi.vertical",
                                                                                                                                      -            hgap: 30
                                                                                                                                      -        }]
                                                                                                                                      -    },
                                                                                                                                      -    items: [{
                                                                                                                                      -               id: -1,
                                                                                                                                      -               pId: -2,
                                                                                                                                      -               value: "根目录",
                                                                                                                                      -               open: true,
                                                                                                                                      -               type: "bi.plus_group_node",
                                                                                                                                      -               height: 25
                                                                                                                                      -           },
                                                                                                                                      -           {
                                                                                                                                      -               id: 1,
                                                                                                                                      -               pId: -1,
                                                                                                                                      -               value: "第一级目录1",
                                                                                                                                      -               type: "bi.plus_group_node",
                                                                                                                                      -               height: 25
                                                                                                                                      -           },
                                                                                                                                      -           {
                                                                                                                                      -               id: 11,
                                                                                                                                      -               pId: 1,
                                                                                                                                      -               value: "第二级文件1",
                                                                                                                                      -               type: "bi.single_select_item",
                                                                                                                                      -               height: 25
                                                                                                                                      -           }]
                                                                                                                                      -});
                                                                                                                                      -
                                                                                                                                      -
                                                                                                                                      - -

                                                                                                                                      API

                                                                                                                                      -
                                                                                                                                      基础属性
                                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                      参数说明类型可选值默认值
                                                                                                                                      items子组件数组array[ ]
                                                                                                                                      itemsCreator子组件构造器object{ }
                                                                                                                                      expanderpopup组件object{el: {},popup: {type: "bi.custom_tree"}}
                                                                                                                                      el开启popup元素object{type: "bi.button_tree",chooseType: 0,layouts: [{type: "bi.vertical"}]}
                                                                                                                                      -

                                                                                                                                      对外方法

                                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                      名称说明回调参数
                                                                                                                                      initTree构造树结构nodes
                                                                                                                                      stroke生成树方法nodes
                                                                                                                                      prependItems内部前插入items
                                                                                                                                      addItems内部后插入items
                                                                                                                                      populate刷新列表nodes
                                                                                                                                      render渲染列表
                                                                                                                                      setValue设置value值value,可以是单个值也可以是个数组
                                                                                                                                      getValue获取被选中的值
                                                                                                                                      getAllButtons获取所有button
                                                                                                                                      getAllLeaves获取所有的叶子节点
                                                                                                                                      getNodeById根据id获取节点id
                                                                                                                                      getNodeByValue根据value值获取节点value
                                                                                                                                      empty清空组件
                                                                                                                                      -
                                                                                                                                      - - -
                                                                                                                                      - -
                                                                                                                                      -
                                                                                                                                      -
                                                                                                                                      - -

                                                                                                                                      results matching ""

                                                                                                                                      -
                                                                                                                                        - -
                                                                                                                                        -
                                                                                                                                        - -

                                                                                                                                        No results matching ""

                                                                                                                                        - -
                                                                                                                                        -
                                                                                                                                        -
                                                                                                                                        - -
                                                                                                                                        -
                                                                                                                                        - -
                                                                                                                                        - - - - -
                                                                                                                                        - - -
                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/abstract/custom_tree.md b/docs/_book/core/abstract/custom_tree.md deleted file mode 100644 index 451cb8466..000000000 --- a/docs/_book/core/abstract/custom_tree.md +++ /dev/null @@ -1,84 +0,0 @@ -# bi.custom_tree - -## 自定义树,基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/gesh31xg/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.custom_tree", - el: { - type: "bi.button_tree", - chooseType: 0, - layouts: [{ - type: "bi.vertical", - hgap: 30 - }] - }, - items: [{ - id: -1, - pId: -2, - value: "根目录", - open: true, - type: "bi.plus_group_node", - height: 25 - }, - { - id: 1, - pId: -1, - value: "第一级目录1", - type: "bi.plus_group_node", - height: 25 - }, - { - id: 11, - pId: 1, - value: "第二级文件1", - type: "bi.single_select_item", - height: 25 - }] -}); - - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| items | 子组件数组 | array | — | [ ] | -| itemsCreator| 子组件构造器 | object | — | { } | -| expander | popup组件 | object | — | {el: {},popup: {type: "bi.custom_tree"}}| -| el | 开启popup元素 | object | — | {type: "bi.button_tree",chooseType: 0,layouts: [{type: "bi.vertical"}]}| - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| initTree | 构造树结构 | nodes | -| stroke | 生成树方法 | nodes | -| prependItems | 内部前插入 | items | -| addItems | 内部后插入 | items | -| populate | 刷新列表 | nodes| -| render | 渲染列表 | — | -| setValue | 设置value值 | value,可以是单个值也可以是个数组 | -| getValue | 获取被选中的值 |—| -| getAllButtons | 获取所有button |—| -| getAllLeaves | 获取所有的叶子节点 | —| -| getNodeById | 根据id获取节点 | id | -| getNodeByValue | 根据value值获取节点 | value | -| empty| 清空组件|—| - - - ---- - - diff --git a/docs/_book/core/abstract/grid_view.html b/docs/_book/core/abstract/grid_view.html deleted file mode 100644 index 84a95141b..000000000 --- a/docs/_book/core/abstract/grid_view.html +++ /dev/null @@ -1,2746 +0,0 @@ - - - - - - - grid_view · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                        -
                                                                                                                                        - - - - - - - - -
                                                                                                                                        - -
                                                                                                                                        - -
                                                                                                                                        - - - - - - - - -
                                                                                                                                        -
                                                                                                                                        - -
                                                                                                                                        -
                                                                                                                                        - -
                                                                                                                                        - -

                                                                                                                                        bi.grid_view

                                                                                                                                        -

                                                                                                                                        可以合并单元格,指定行列可以删除看不见的元素,基类BI.Widget

                                                                                                                                        -
                                                                                                                                        
                                                                                                                                        -BI.createWidget({
                                                                                                                                        -    type: "bi.grid_view",
                                                                                                                                        -    width: 400,
                                                                                                                                        -    height: 300,
                                                                                                                                        -    estimatedRowSize: 30,
                                                                                                                                        -    estimatedColumnSize: 100,
                                                                                                                                        -    items: [],
                                                                                                                                        -    scrollTop: 100,
                                                                                                                                        -    rowHeightGetter: function () {
                                                                                                                                        -        return 30;
                                                                                                                                        -    },
                                                                                                                                        -    columnWidthGetter: function () {
                                                                                                                                        -        return 100;
                                                                                                                                        -    }
                                                                                                                                        -});
                                                                                                                                        -
                                                                                                                                        -
                                                                                                                                        - -

                                                                                                                                        API

                                                                                                                                        -
                                                                                                                                        基础属性
                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                        参数说明类型可选值默认值
                                                                                                                                        items子组件数组array[ ]
                                                                                                                                        overflowX是否显示横向滚动条booleantrue,falsetrue
                                                                                                                                        overflowY是否显示纵向滚动条booleantrue,falsetrue
                                                                                                                                        overscanColumnCount超出可视范围区域预加载多少列number0
                                                                                                                                        overscanRowCount超出可视范围区域预加载多少行number0
                                                                                                                                        width行宽,必设number
                                                                                                                                        height列宽,必设number
                                                                                                                                        rowHeightGetter每格行宽number,functionfunction
                                                                                                                                        columnWidthGetter每格列宽number,functionfunction
                                                                                                                                        estimatedColumnSize预估行宽,columnWidthGetter为function时必设number,functionfunction
                                                                                                                                        estimatedRowSize预估列宽,rowHeightGetter为function时必设number,functionfunction
                                                                                                                                        scrollLeft滚动条相对于左边的偏移number0
                                                                                                                                        scrollTop滚动条相对于顶部的偏移number0
                                                                                                                                        -

                                                                                                                                        对外方法

                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                        名称说明回调参数
                                                                                                                                        setScrollLeft设置滚动条相对于左边的偏移scrollLeft
                                                                                                                                        setScrollTop设置滚动条相对于顶部的偏移scrollTop
                                                                                                                                        setOverflowX设置是否显示横向滚动条b
                                                                                                                                        setOverflowY设置是否显示横向滚动条b
                                                                                                                                        getScrollLeft获取滚动条相对于左边的偏移
                                                                                                                                        getScrollTop获取滚动条相对于顶部的偏移
                                                                                                                                        getMaxScrollLeft获取滚动条相对于左边的最大偏移
                                                                                                                                        getMaxScrollTop获取滚动条相对于顶部的最大偏移
                                                                                                                                        setEstimatedColumnSize设置列宽width
                                                                                                                                        setEstimatedRowSize设置行宽height
                                                                                                                                        restore还原列表设置
                                                                                                                                        populate刷新列表items
                                                                                                                                        -

                                                                                                                                        事件

                                                                                                                                        - - - - - - - - - - - - - - - -
                                                                                                                                        事件说明回调参数
                                                                                                                                        BI.GridView.EVENT_SCROLL滚动时触发的事件{scrollLeft: scrollLeft, scrollTop: scrollTop}
                                                                                                                                        -
                                                                                                                                        - - -
                                                                                                                                        - -
                                                                                                                                        -
                                                                                                                                        -
                                                                                                                                        - -

                                                                                                                                        results matching ""

                                                                                                                                        -
                                                                                                                                          - -
                                                                                                                                          -
                                                                                                                                          - -

                                                                                                                                          No results matching ""

                                                                                                                                          - -
                                                                                                                                          -
                                                                                                                                          -
                                                                                                                                          - -
                                                                                                                                          -
                                                                                                                                          - -
                                                                                                                                          - - - - -
                                                                                                                                          - - -
                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/abstract/grid_view.md b/docs/_book/core/abstract/grid_view.md deleted file mode 100644 index c0b6b94b9..000000000 --- a/docs/_book/core/abstract/grid_view.md +++ /dev/null @@ -1,78 +0,0 @@ -# bi.grid_view - -## 可以合并单元格,指定行列可以删除看不见的元素,基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/fkntzLq5/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.grid_view", - width: 400, - height: 300, - estimatedRowSize: 30, - estimatedColumnSize: 100, - items: [], - scrollTop: 100, - rowHeightGetter: function () { - return 30; - }, - columnWidthGetter: function () { - return 100; - } -}); - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| items | 子组件数组 | array | — | [ ] | -| overflowX | 是否显示横向滚动条| boolean | true,false | true | -| overflowY | 是否显示纵向滚动条 | boolean | true,false | true | -| overscanColumnCount| 超出可视范围区域预加载多少列 | number|— | 0 | -| overscanRowCount| 超出可视范围区域预加载多少行 | number | — | 0 | -| width | 行宽,必设 |number| — | — | -| height | 列宽,必设 | number | —| — | -| rowHeightGetter| 每格行宽 |number,function | —| function | -| columnWidthGetter| 每格列宽 | number,function |— | function | -| estimatedColumnSize| 预估行宽,columnWidthGetter为function时必设 |number,function |— | function | -| estimatedRowSize | 预估列宽,rowHeightGetter为function时必设 | number,function | —| function | -| scrollLeft | 滚动条相对于左边的偏移 | number | — | 0 | -| scrollTop | 滚动条相对于顶部的偏移 | number | —|0 | - - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setScrollLeft | 设置滚动条相对于左边的偏移 | scrollLeft| -| setScrollTop | 设置滚动条相对于顶部的偏移 | scrollTop | -| setOverflowX | 设置是否显示横向滚动条 | b | -| setOverflowY | 设置是否显示横向滚动条 | b| -| getScrollLeft | 获取滚动条相对于左边的偏移 | —| -| getScrollTop | 获取滚动条相对于顶部的偏移 | — | -| getMaxScrollLeft | 获取滚动条相对于左边的最大偏移 | — | -| getMaxScrollTop | 获取滚动条相对于顶部的最大偏移 |—| -| setEstimatedColumnSize | 设置列宽 |width| -| setEstimatedRowSize | 设置行宽 | height | -| restore | 还原列表设置 | — | -| populate | 刷新列表 | items | - -## 事件 -| 事件 | 说明 | 回调参数 -| :------ |:------------- |:----------| -|BI.GridView.EVENT_SCROLL| 滚动时触发的事件 | {scrollLeft: scrollLeft, scrollTop: scrollTop} | - - ---- - - diff --git a/docs/_book/core/abstract/virtual_group.html b/docs/_book/core/abstract/virtual_group.html deleted file mode 100644 index bfedca237..000000000 --- a/docs/_book/core/abstract/virtual_group.html +++ /dev/null @@ -1,2620 +0,0 @@ - - - - - - - virtual_group · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                          -
                                                                                                                                          - - - - - - - - -
                                                                                                                                          - -
                                                                                                                                          - -
                                                                                                                                          - - - - - - - - -
                                                                                                                                          -
                                                                                                                                          - -
                                                                                                                                          -
                                                                                                                                          - -
                                                                                                                                          - -

                                                                                                                                          bi.virtual_group

                                                                                                                                          -

                                                                                                                                          优化过的buttonGroup,删除看不见的元素 基类BI.Widget

                                                                                                                                          -
                                                                                                                                          
                                                                                                                                          -BI.createWidget({
                                                                                                                                          -  element: "#wrapper",
                                                                                                                                          -  type: "bi.virtual_group",
                                                                                                                                          -  width: 500,
                                                                                                                                          -  height: 300,
                                                                                                                                          -  chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
                                                                                                                                          -  layouts: [{
                                                                                                                                          -      type: "bi.vertical"
                                                                                                                                          -  }, {
                                                                                                                                          -      type: "bi.center_adapt",
                                                                                                                                          -  }],
                                                                                                                                          -  items:[]
                                                                                                                                          -})
                                                                                                                                          -
                                                                                                                                          -
                                                                                                                                          - -

                                                                                                                                          API

                                                                                                                                          -
                                                                                                                                          基础属性
                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                          参数说明类型可选值默认值
                                                                                                                                          items子组件数组array[ ]
                                                                                                                                          layouts布局array[{type: "bi.center",hgap: 0,vgap: 0}]
                                                                                                                                          -

                                                                                                                                          对外方法

                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                          名称说明回调参数
                                                                                                                                          setValue设置value值value,可以是单个值也可以是个数组
                                                                                                                                          getValue获取被选中的值
                                                                                                                                          prependItems内部前插入items
                                                                                                                                          addItems内部后插入items
                                                                                                                                          populate刷新列表items
                                                                                                                                          render渲染列表
                                                                                                                                          -
                                                                                                                                          - - -
                                                                                                                                          - -
                                                                                                                                          -
                                                                                                                                          -
                                                                                                                                          - -

                                                                                                                                          results matching ""

                                                                                                                                          -
                                                                                                                                            - -
                                                                                                                                            -
                                                                                                                                            - -

                                                                                                                                            No results matching ""

                                                                                                                                            - -
                                                                                                                                            -
                                                                                                                                            -
                                                                                                                                            - -
                                                                                                                                            -
                                                                                                                                            - -
                                                                                                                                            - - - - -
                                                                                                                                            - - -
                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/abstract/virtual_group.md b/docs/_book/core/abstract/virtual_group.md deleted file mode 100644 index 5cbcf431c..000000000 --- a/docs/_book/core/abstract/virtual_group.md +++ /dev/null @@ -1,51 +0,0 @@ -# bi.virtual_group - -## 优化过的buttonGroup,删除看不见的元素 基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/9pd0dct0/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.virtual_group", - width: 500, - height: 300, - chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI, - layouts: [{ - type: "bi.vertical" - }, { - type: "bi.center_adapt", - }], - items:[] -}) -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| items | 子组件数组 | array | — | [ ] | -| layouts | 布局 | array | — | [{type: "bi.center",hgap: 0,vgap: 0}] | - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setValue | 设置value值 | value,可以是单个值也可以是个数组 | -| getValue | 获取被选中的值 |—| -| prependItems | 内部前插入 | items | -| addItems | 内部后插入 | items | -| populate | 刷新列表 | items | -| render | 渲染列表 | —| - - - ---- - - diff --git a/docs/_book/core/abstract/virtual_list.html b/docs/_book/core/abstract/virtual_list.html deleted file mode 100644 index 0d77d7321..000000000 --- a/docs/_book/core/abstract/virtual_list.html +++ /dev/null @@ -1,2625 +0,0 @@ - - - - - - - virtual_list · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                            -
                                                                                                                                            - - - - - - - - -
                                                                                                                                            - -
                                                                                                                                            - -
                                                                                                                                            - - - - - - - - -
                                                                                                                                            -
                                                                                                                                            - -
                                                                                                                                            -
                                                                                                                                            - -
                                                                                                                                            - -

                                                                                                                                            bi.virtual_list

                                                                                                                                            -

                                                                                                                                            看不见的元素全部删除的list,基类BI.Widget

                                                                                                                                            -
                                                                                                                                            
                                                                                                                                            -BI.createWidget({
                                                                                                                                            -    type: "bi.virtual_list",
                                                                                                                                            -    element:"body",
                                                                                                                                            -    items: BI.map([{value: "xxxx"}], function (i, item) {
                                                                                                                                            -          return BI.extend({}, item, {
                                                                                                                                            -              type: "bi.label",
                                                                                                                                            -              height: 30,
                                                                                                                                            -              text: (i + 1) + "." + item.text,
                                                                                                                                            -          });
                                                                                                                                            -      })
                                                                                                                                            -    })
                                                                                                                                            -
                                                                                                                                            -
                                                                                                                                            - -

                                                                                                                                            API

                                                                                                                                            -
                                                                                                                                            基础属性
                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                            参数说明类型可选值默认值
                                                                                                                                            items子组件数组array[ ]
                                                                                                                                            blockSize滚动加载的个数number10
                                                                                                                                            overscanHeight超出可视范围区域的高度number100
                                                                                                                                            scrollTop滚动条相对于顶部的偏移number0
                                                                                                                                            -

                                                                                                                                            对外方法

                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                            名称说明回调参数
                                                                                                                                            render渲染列表
                                                                                                                                            mounted组件挂载
                                                                                                                                            restore还原列表设置
                                                                                                                                            populate刷新列表items
                                                                                                                                            destroyed销毁组件
                                                                                                                                            -
                                                                                                                                            - - -
                                                                                                                                            - -
                                                                                                                                            -
                                                                                                                                            -
                                                                                                                                            - -

                                                                                                                                            results matching ""

                                                                                                                                            -
                                                                                                                                              - -
                                                                                                                                              -
                                                                                                                                              - -

                                                                                                                                              No results matching ""

                                                                                                                                              - -
                                                                                                                                              -
                                                                                                                                              -
                                                                                                                                              - -
                                                                                                                                              -
                                                                                                                                              - -
                                                                                                                                              - - - - -
                                                                                                                                              - - -
                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/abstract/virtual_list.md b/docs/_book/core/abstract/virtual_list.md deleted file mode 100644 index b462e46c4..000000000 --- a/docs/_book/core/abstract/virtual_list.md +++ /dev/null @@ -1,52 +0,0 @@ -# bi.virtual_list - -## 看不见的元素全部删除的list,基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/L995LrL9/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.virtual_list", - element:"body", - items: BI.map([{value: "xxxx"}], function (i, item) { - return BI.extend({}, item, { - type: "bi.label", - height: 30, - text: (i + 1) + "." + item.text, - }); - }) - }) - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| items | 子组件数组 | array | — | [ ] | -| blockSize | 滚动加载的个数 | number | — | 10 | -| overscanHeight | 超出可视范围区域的高度 | number | — | 100 | -| scrollTop | 滚动条相对于顶部的偏移 | number | — | 0 | - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| render | 渲染列表 | —| -| mounted | 组件挂载 | —| -| restore | 还原列表设置 | — | -| populate | 刷新列表 | items | -| destroyed | 销毁组件 | —| - - - ---- - - diff --git a/docs/_book/core/basic_button.html b/docs/_book/core/basic_button.html deleted file mode 100644 index b8a3a5b2f..000000000 --- a/docs/_book/core/basic_button.html +++ /dev/null @@ -1,2722 +0,0 @@ - - - - - - - basic_button · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                              -
                                                                                                                                              - - - - - - - - -
                                                                                                                                              - -
                                                                                                                                              - -
                                                                                                                                              - - - - - - - - -
                                                                                                                                              -
                                                                                                                                              - -
                                                                                                                                              -
                                                                                                                                              - -
                                                                                                                                              - -

                                                                                                                                              bi.basic_button

                                                                                                                                              -

                                                                                                                                              一般的button父级,基类BI.Single

                                                                                                                                              -

                                                                                                                                              API

                                                                                                                                              -
                                                                                                                                              基础属性
                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                              参数说明类型可选值默认值
                                                                                                                                              value组件value值stringnull
                                                                                                                                              stopEvent阻止事件booleantrue,falsefalse
                                                                                                                                              stopPropagation阻止冒泡booleantrue,falsefalse
                                                                                                                                              selectedbutton的选中状态booleantrue,falsefalse
                                                                                                                                              once点击一次选中有效,再点无效booleantrue,falsefalse
                                                                                                                                              forceSelected点击即选中, 选中了就不会被取消,与once的区别是forceSelected不影响事件的触发booleantrue,falsefalse
                                                                                                                                              forceNotSelected无论怎么点击都不会被选中booleantrue,falsefalse
                                                                                                                                              disableSelected使能选中booleantrue,falsefalse
                                                                                                                                              shadow是否显示阴影booleantrue,falsefalse
                                                                                                                                              isShadowShowingOnSelected选中状态下是否显示阴影booleantrue,falsefalse
                                                                                                                                              trigger被选元素要触发的事件stringmousedown, mouseup, click, dblclick, lclicknull
                                                                                                                                              handler点击事件回调functionBI.emptyFn
                                                                                                                                              -

                                                                                                                                              对外方法

                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                              名称说明回调参数
                                                                                                                                              bindEvent绑定事件
                                                                                                                                              beforeClick点击事件之前
                                                                                                                                              doClick点击事件
                                                                                                                                              handle返回该对象
                                                                                                                                              hoverhover事件
                                                                                                                                              dishover取消hover事件
                                                                                                                                              setSelected设置选中的文本b
                                                                                                                                              isSelected是否被选中
                                                                                                                                              isOnce是否只允许点击一次
                                                                                                                                              isForceSelected判断是否点击即选中
                                                                                                                                              isForceNotSelected判断是否怎么点击都不会被选中
                                                                                                                                              isDisableSelected判断是否让选中
                                                                                                                                              setText设置文本值
                                                                                                                                              getText获取文本值
                                                                                                                                              empty清空组件
                                                                                                                                              destroy销毁组件
                                                                                                                                              -
                                                                                                                                              - - -
                                                                                                                                              - -
                                                                                                                                              -
                                                                                                                                              -
                                                                                                                                              - -

                                                                                                                                              results matching ""

                                                                                                                                              -
                                                                                                                                                - -
                                                                                                                                                -
                                                                                                                                                - -

                                                                                                                                                No results matching ""

                                                                                                                                                - -
                                                                                                                                                -
                                                                                                                                                -
                                                                                                                                                - -
                                                                                                                                                -
                                                                                                                                                - -
                                                                                                                                                - - - - -
                                                                                                                                                - - -
                                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/basic_button.md b/docs/_book/core/basic_button.md deleted file mode 100644 index d30a82160..000000000 --- a/docs/_book/core/basic_button.md +++ /dev/null @@ -1,46 +0,0 @@ -# bi.basic_button - -## 一般的button父级,基类[BI.Single](/core/single.md) - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| value | 组件value值 | string | —| null| -| stopEvent | 阻止事件 |boolean | true,false | false | -| stopPropagation | 阻止冒泡 | boolean | true,false| false | -| selected | button的选中状态 | boolean | true,false |false | -| once | 点击一次选中有效,再点无效 | boolean | true,false | false| -| forceSelected | 点击即选中, 选中了就不会被取消,与once的区别是forceSelected不影响事件的触发| boolean | true,false| false| -| forceNotSelected | 无论怎么点击都不会被选中 | boolean| true,false | false| -| disableSelected | 使能选中| boolean | true,false| false| -| shadow | 是否显示阴影 | boolean| true,false| false| -| isShadowShowingOnSelected| 选中状态下是否显示阴影|boolean| true,false | false| -| trigger | 被选元素要触发的事件 | string | mousedown, mouseup, click, dblclick, lclick | null| -| handler | 点击事件回调 | function | —| BI.emptyFn | - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| bindEvent | 绑定事件| —| -| beforeClick | 点击事件之前 | —| -| doClick | 点击事件 | — | -| handle | 返回该对象 | —| -| hover | hover事件| —| -| dishover | 取消hover事件| —| -|setSelected | 设置选中的文本| b| -| isSelected | 是否被选中| —| -| isOnce | 是否只允许点击一次| —| -| isForceSelected| 判断是否点击即选中| —| -| isForceNotSelected| 判断是否怎么点击都不会被选中|—| -| isDisableSelected| 判断是否让选中|—| -| setText| 设置文本值|—| -| getText| 获取文本值|—| -| empty| 清空组件|—| -| destroy| 销毁组件|—| - - ---- - - diff --git a/docs/_book/core/combination/bi.combo.html b/docs/_book/core/combination/bi.combo.html deleted file mode 100644 index d771bda04..000000000 --- a/docs/_book/core/combination/bi.combo.html +++ /dev/null @@ -1,2815 +0,0 @@ - - - - - - - combo · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                -
                                                                                                                                                - - - - - - - - -
                                                                                                                                                - -
                                                                                                                                                - -
                                                                                                                                                - - - - - - - - -
                                                                                                                                                -
                                                                                                                                                - -
                                                                                                                                                -
                                                                                                                                                - -
                                                                                                                                                - -

                                                                                                                                                bi.combo

                                                                                                                                                -

                                                                                                                                                combo,基类BI.Widget

                                                                                                                                                -
                                                                                                                                                
                                                                                                                                                -BI.createWidget({
                                                                                                                                                -   type: "bi.combo",
                                                                                                                                                -   element: "body",
                                                                                                                                                -   adjustLength: 2,
                                                                                                                                                -   el: {
                                                                                                                                                -       type: "bi.button",
                                                                                                                                                -       text: "测试",
                                                                                                                                                -       height: 25
                                                                                                                                                -    },
                                                                                                                                                -   popup: {}
                                                                                                                                                -});
                                                                                                                                                -
                                                                                                                                                -
                                                                                                                                                - -

                                                                                                                                                API

                                                                                                                                                -
                                                                                                                                                基础属性
                                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                参数说明类型可选值默认值
                                                                                                                                                el自定义下拉框triggerobject{ }
                                                                                                                                                trigger下拉列表的弹出方式stringclick,hover"click"
                                                                                                                                                adjustLength弹出列表和trigger的距离number0
                                                                                                                                                toggle切换状态booleantrue,falsetrue
                                                                                                                                                direction弹出列表和trigger的位置关系stringtop | bottom | left | right | top,left | top,right | bottom,left | bottom,right"bottom"
                                                                                                                                                isDefaultInit是否默认初始化子节点booleantrue,falsefalse
                                                                                                                                                destroyWhenHide隐藏弹窗层是否销毁booleantrue,falsefalse
                                                                                                                                                isNeedAdjustHeight是否需要高度调整booleantrue,falsetrue
                                                                                                                                                isNeedAdjustWidth是否需要宽度调整booleantrue,falsetrue
                                                                                                                                                stopEvent是否阻止事件booleantrue,falsefalse
                                                                                                                                                stopPropagation阻止事件冒泡booleantrue,falsefalse
                                                                                                                                                adjustXOffset调整横向偏移number0
                                                                                                                                                adjustYOffset调整纵向偏移number0
                                                                                                                                                hideChecker是否隐藏弹出层检测function
                                                                                                                                                offsetStyle弹出层显示位置stringleft,right,center"left,right,center"
                                                                                                                                                popup弹出层object{ }
                                                                                                                                                comboClasscombo类string"bi-combo-popup"
                                                                                                                                                hoverClasshover类string"bi-combo-hover"
                                                                                                                                                -

                                                                                                                                                对外方法

                                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                名称说明回调参数
                                                                                                                                                adjustWidth调整宽度
                                                                                                                                                adjustHeight调整高度
                                                                                                                                                resetListHeight重置列表高度height
                                                                                                                                                resetListWidth重置列表宽度width
                                                                                                                                                populate刷新列表items
                                                                                                                                                setValue设置combo value值v
                                                                                                                                                getValue获取combo value值
                                                                                                                                                isViewVisible弹窗层是否可见
                                                                                                                                                showView显示弹出层
                                                                                                                                                hideView隐藏弹出层
                                                                                                                                                getView获取弹出层
                                                                                                                                                getPopupPosition获取弹出层的位置
                                                                                                                                                toggle开启或者隐藏弹出层
                                                                                                                                                destroy销毁组件
                                                                                                                                                -

                                                                                                                                                事件

                                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                名称说明
                                                                                                                                                BI.Combo.EVENT_TRIGGER_CHANGEtrigger发生改变触发
                                                                                                                                                BI.Combo.EVENT_CHANGE弹出层点击触发
                                                                                                                                                BI.Combo.EVENT_EXPAND下拉框展开触发
                                                                                                                                                BI.Combo.EVENT_COLLAPSE下拉框收起触发
                                                                                                                                                BI.Combo.EVENT_AFTER_INIT下拉框初始化后触发
                                                                                                                                                BI.Combo.EVENT_BEFORE_POPUPVIEW下拉列表弹出前触发
                                                                                                                                                BI.Combo.EVENT_AFTER_POPUPVIEW下拉列表弹出后触发
                                                                                                                                                BI.Combo.EVENT_BEFORE_HIDEVIEW下拉列表收起前触发
                                                                                                                                                BI.Combo.EVENT_AFTER_HIDEVIEW下拉列表收起后触发
                                                                                                                                                -
                                                                                                                                                - - -
                                                                                                                                                - -
                                                                                                                                                -
                                                                                                                                                -
                                                                                                                                                - -

                                                                                                                                                results matching ""

                                                                                                                                                -
                                                                                                                                                  - -
                                                                                                                                                  -
                                                                                                                                                  - -

                                                                                                                                                  No results matching ""

                                                                                                                                                  - -
                                                                                                                                                  -
                                                                                                                                                  -
                                                                                                                                                  - -
                                                                                                                                                  -
                                                                                                                                                  - -
                                                                                                                                                  - - - - -
                                                                                                                                                  - - -
                                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/combination/bi.combo.md b/docs/_book/core/combination/bi.combo.md deleted file mode 100644 index 94c8b7824..000000000 --- a/docs/_book/core/combination/bi.combo.md +++ /dev/null @@ -1,88 +0,0 @@ -# bi.combo - -## combo,基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/wxykkjou/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.combo", - element: "body", - adjustLength: 2, - el: { - type: "bi.button", - text: "测试", - height: 25 - }, - popup: {} -}); - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| el | 自定义下拉框trigger | object | — |{ }| -| trigger | 下拉列表的弹出方式 | string | click,hover | "click" | -| adjustLength | 弹出列表和trigger的距离 | number | — | 0 | -| toggle | 切换状态 | boolean | true,false | true | -| direction | 弹出列表和trigger的位置关系 | string | top | bottom | left | right | top,left | top,right | bottom,left | bottom,right | "bottom"| -| isDefaultInit | 是否默认初始化子节点 |boolean | true,false | false | -| destroyWhenHide | 隐藏弹窗层是否销毁 | boolean | true,false | false | -| isNeedAdjustHeight | 是否需要高度调整 | boolean | true,false | true | -| isNeedAdjustWidth | 是否需要宽度调整 | boolean | true,false | true | -| stopEvent | 是否阻止事件 | boolean | true,false | false | -| stopPropagation | 阻止事件冒泡 | boolean | true,false | false | -| adjustXOffset | 调整横向偏移 | number | — | 0 | -| adjustYOffset |调整纵向偏移 | number | — | 0 | -| hideChecker | 是否隐藏弹出层检测 | function | — | —| -| offsetStyle | 弹出层显示位置 | string | left,right,center | "left,right,center"| -| popup | 弹出层 | object | — | { }| -| comboClass | combo类 | string | — | "bi-combo-popup" | -| hoverClass | hover类 | string | — | "bi-combo-hover" | - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| adjustWidth | 调整宽度 | —| -| adjustHeight | 调整高度 | —| -| resetListHeight | 重置列表高度 | height | -| resetListWidth | 重置列表宽度 | width | -| populate | 刷新列表 | items | -| setValue |设置combo value值| v | -| getValue | 获取combo value值 | —| -| isViewVisible | 弹窗层是否可见 | —| -| showView | 显示弹出层 | —| -| hideView | 隐藏弹出层 |—| -| getView | 获取弹出层 | —| -| getPopupPosition | 获取弹出层的位置 | —| -| toggle | 开启或者隐藏弹出层 | —| -| destroy | 销毁组件 | —| - -## 事件 -| 名称 | 说明 | -| :------ |:------------- | -|BI.Combo.EVENT_TRIGGER_CHANGE | trigger发生改变触发 | -|BI.Combo.EVENT_CHANGE | 弹出层点击触发 | -|BI.Combo.EVENT_EXPAND | 下拉框展开触发 | -|BI.Combo.EVENT_COLLAPSE | 下拉框收起触发 -|BI.Combo.EVENT_AFTER_INIT | 下拉框初始化后触发 | -|BI.Combo.EVENT_BEFORE_POPUPVIEW | 下拉列表弹出前触发 | -|BI.Combo.EVENT_AFTER_POPUPVIEW | 下拉列表弹出后触发 | -|BI.Combo.EVENT_BEFORE_HIDEVIEW | 下拉列表收起前触发 | -|BI.Combo.EVENT_AFTER_HIDEVIEW | 下拉列表收起后触发 | - - ---- - - diff --git a/docs/_book/core/combination/bi.expander.html b/docs/_book/core/combination/bi.expander.html deleted file mode 100644 index a06484227..000000000 --- a/docs/_book/core/combination/bi.expander.html +++ /dev/null @@ -1,2756 +0,0 @@ - - - - - - - expander · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                  -
                                                                                                                                                  - - - - - - - - -
                                                                                                                                                  - -
                                                                                                                                                  - -
                                                                                                                                                  - - - - - - - - -
                                                                                                                                                  -
                                                                                                                                                  - -
                                                                                                                                                  -
                                                                                                                                                  - -
                                                                                                                                                  - -

                                                                                                                                                  bi.expander

                                                                                                                                                  -

                                                                                                                                                  某个可以展开的节点,基类BI.Widget

                                                                                                                                                  -
                                                                                                                                                  
                                                                                                                                                  -BI.createWidget({
                                                                                                                                                  -  type: "bi.expander",
                                                                                                                                                  -  element: "#wrapper",
                                                                                                                                                  -  el: {
                                                                                                                                                  -    type: "bi.icon_text_node",
                                                                                                                                                  -    cls: "pull-right-ha-font",
                                                                                                                                                  -    height: 25,
                                                                                                                                                  -    text: "Expander"
                                                                                                                                                  -  },
                                                                                                                                                  -  popup: {
                                                                                                                                                  -    items: [{
                                                                                                                                                  -      type: "bi.single_select_item",
                                                                                                                                                  -      height: 25,
                                                                                                                                                  -      text: "项目1",
                                                                                                                                                  -      value: 1
                                                                                                                                                  -    }, {
                                                                                                                                                  -      type: "bi.single_select_item",
                                                                                                                                                  -      height: 25,
                                                                                                                                                  -      text: "项目2",
                                                                                                                                                  -      value: 2
                                                                                                                                                  -    }]
                                                                                                                                                  -  }
                                                                                                                                                  -});
                                                                                                                                                  -
                                                                                                                                                  -
                                                                                                                                                  - -

                                                                                                                                                  API

                                                                                                                                                  -
                                                                                                                                                  基础属性
                                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                  参数说明类型可选值默认值
                                                                                                                                                  el自定义下拉框triggerobject{ }
                                                                                                                                                  trigger下拉列表的弹出方式stringclick,hover"click"
                                                                                                                                                  adjustLength弹出列表和trigger的距离number0
                                                                                                                                                  toggle切换状态booleantrue,falsetrue
                                                                                                                                                  direction弹出列表和trigger的位置关系stringtop | bottom | left | right | top,left | top,right | bottom,left | bottom,right"bottom"
                                                                                                                                                  isDefaultInit是否默认初始化子节点booleantrue,falsefalse
                                                                                                                                                  popup弹出层object{ }
                                                                                                                                                  expanderClass展开类string"bi-expander-popup"
                                                                                                                                                  hoverClasshover类string"bi-expander-hover"
                                                                                                                                                  -

                                                                                                                                                  对外方法

                                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                  名称说明回调参数
                                                                                                                                                  populate刷新列表items
                                                                                                                                                  setValue设置combo value值v
                                                                                                                                                  getValue获取combo value值
                                                                                                                                                  isViewVisible弹窗层是否可见
                                                                                                                                                  showView显示弹出层
                                                                                                                                                  hideView隐藏弹出层
                                                                                                                                                  getView获取弹出层
                                                                                                                                                  getAllLeaves获取所有的叶子节点
                                                                                                                                                  getNodeById根据id获取节点id
                                                                                                                                                  getNodeByValue根据value值获取节点value
                                                                                                                                                  isExpanded节点是否展开
                                                                                                                                                  destroy销毁组件
                                                                                                                                                  -

                                                                                                                                                  事件

                                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                  名称说明
                                                                                                                                                  BI.Expander.EVENT_TRIGGER_CHANGEtrigger发生改变触发
                                                                                                                                                  BI.Expander.EVENT_CHANGE弹出层点击触发
                                                                                                                                                  BI.Expander.EVENT_EXPANDExpander展开触发
                                                                                                                                                  BI.Expander.EVENT_COLLAPSEExpander收起触发
                                                                                                                                                  BI.Expander.EVENT_AFTER_INITExpander初始化后触发
                                                                                                                                                  BI.Expander.EVENT_BEFORE_POPUPVIEW下拉列表弹出前触发
                                                                                                                                                  BI.Expander.EVENT_AFTER_POPUPVIEW下拉列表弹出后触发
                                                                                                                                                  BI.Expander.EVENT_BEFORE_HIDEVIEW下拉列表收起前触发
                                                                                                                                                  BI.Expander.EVENT_AFTER_HIDEVIEW下拉列表收起后触发
                                                                                                                                                  -
                                                                                                                                                  - - -
                                                                                                                                                  - -
                                                                                                                                                  -
                                                                                                                                                  -
                                                                                                                                                  - -

                                                                                                                                                  results matching ""

                                                                                                                                                  -
                                                                                                                                                    - -
                                                                                                                                                    -
                                                                                                                                                    - -

                                                                                                                                                    No results matching ""

                                                                                                                                                    - -
                                                                                                                                                    -
                                                                                                                                                    -
                                                                                                                                                    - -
                                                                                                                                                    -
                                                                                                                                                    - -
                                                                                                                                                    - - - - -
                                                                                                                                                    - - -
                                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/combination/bi.expander.md b/docs/_book/core/combination/bi.expander.md deleted file mode 100644 index b5d6ab382..000000000 --- a/docs/_book/core/combination/bi.expander.md +++ /dev/null @@ -1,88 +0,0 @@ -# bi.expander - -## 某个可以展开的节点,基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/2xavqk4k/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.expander", - element: "#wrapper", - el: { - type: "bi.icon_text_node", - cls: "pull-right-ha-font", - height: 25, - text: "Expander" - }, - popup: { - items: [{ - type: "bi.single_select_item", - height: 25, - text: "项目1", - value: 1 - }, { - type: "bi.single_select_item", - height: 25, - text: "项目2", - value: 2 - }] - } -}); - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| el | 自定义下拉框trigger | object | — |{ }| -| trigger | 下拉列表的弹出方式 | string | click,hover | "click" | -| adjustLength | 弹出列表和trigger的距离 | number | — | 0 | -| toggle | 切换状态 | boolean | true,false | true | -| direction | 弹出列表和trigger的位置关系 | string | top | bottom | left | right | top,left | top,right | bottom,left | bottom,right | "bottom"| -| isDefaultInit | 是否默认初始化子节点 |boolean | true,false | false | -| popup | 弹出层 | object | — | { }| -| expanderClass | 展开类 | string | —| "bi-expander-popup" | -| hoverClass | hover类| string | — | "bi-expander-hover" | - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| populate | 刷新列表 | items | -| setValue | 设置combo value值| v | -| getValue | 获取combo value值 | —| -| isViewVisible | 弹窗层是否可见 | —| -| showView | 显示弹出层| —| -| hideView | 隐藏弹出层| —| -| getView | 获取弹出层| —| -| getAllLeaves | 获取所有的叶子节点 | —| -| getNodeById | 根据id获取节点 | id | -| getNodeByValue | 根据value值获取节点 | value | -| isExpanded | 节点是否展开 | — | -| destroy | 销毁组件| — | - -## 事件 -| 名称 | 说明 | -| :------ |:------------- | -|BI.Expander.EVENT_TRIGGER_CHANGE | trigger发生改变触发 | -|BI.Expander.EVENT_CHANGE | 弹出层点击触发 | -|BI.Expander.EVENT_EXPAND | Expander展开触发 | -|BI.Expander.EVENT_COLLAPSE | Expander收起触发 -|BI.Expander.EVENT_AFTER_INIT | Expander初始化后触发 | -|BI.Expander.EVENT_BEFORE_POPUPVIEW | 下拉列表弹出前触发 | -|BI.Expander.EVENT_AFTER_POPUPVIEW | 下拉列表弹出后触发 | -|BI.Expander.EVENT_BEFORE_HIDEVIEW | 下拉列表收起前触发 | -|BI.Expander.EVENT_AFTER_HIDEVIEW | 下拉列表收起后触发 | - ---- - - diff --git a/docs/_book/core/combination/group_combo.html b/docs/_book/core/combination/group_combo.html deleted file mode 100644 index 8fad18666..000000000 --- a/docs/_book/core/combination/group_combo.html +++ /dev/null @@ -1,2659 +0,0 @@ - - - - - - - group_combo · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                    -
                                                                                                                                                    - - - - - - - - -
                                                                                                                                                    - -
                                                                                                                                                    - -
                                                                                                                                                    - - - - - - - - -
                                                                                                                                                    -
                                                                                                                                                    - -
                                                                                                                                                    -
                                                                                                                                                    - -
                                                                                                                                                    - -

                                                                                                                                                    bi.combo_group

                                                                                                                                                    -

                                                                                                                                                    基类BI.Widget

                                                                                                                                                    -
                                                                                                                                                    
                                                                                                                                                    -BI.createWidget({
                                                                                                                                                    -  element: "#wrapper",
                                                                                                                                                    -  type: "bi.combo_group",
                                                                                                                                                    -  el: {
                                                                                                                                                    -    type: "bi.icon_text_icon_item",
                                                                                                                                                    -    text: "2010年",
                                                                                                                                                    -    value: 2010,
                                                                                                                                                    -    height: 25,
                                                                                                                                                    -    iconCls: "close-ha-font"
                                                                                                                                                    -  },
                                                                                                                                                    -  children: [{
                                                                                                                                                    -    type: "bi.single_select_item",
                                                                                                                                                    -    height: 25,
                                                                                                                                                    -    text: "一月",
                                                                                                                                                    -    value: 11
                                                                                                                                                    -  }]
                                                                                                                                                    -});
                                                                                                                                                    -
                                                                                                                                                    -
                                                                                                                                                    - - -

                                                                                                                                                    API

                                                                                                                                                    -
                                                                                                                                                    基础属性
                                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                    参数说明类型可选值默认值
                                                                                                                                                    childern子组件array[ ]
                                                                                                                                                    popup弹出层object{el: {type: "bi.button_tree",chooseType: 0,layouts: [{type: "bi.vertical"}]}}
                                                                                                                                                    isDefaultInit是否默认初始化子节点booleantrue,falsefalse
                                                                                                                                                    isNeedAdjustHeight是否需要高度调整booleantrue,falsefalse
                                                                                                                                                    isNeedAdjustWidth是否需要宽度调整booleantrue,falsefalse
                                                                                                                                                    el自定义下拉框triggerobject{type: "bi.text_button", text: "", value: ""}
                                                                                                                                                    trigger下拉列表的弹出方式stringclick,hover"click"
                                                                                                                                                    adjustLength弹出列表和trigger的距离number0
                                                                                                                                                    direction弹出列表和trigger的位置关系stringtop | bottom | left | right | top,left | top,right | bottom,left | bottom,right"bottom"
                                                                                                                                                    -

                                                                                                                                                    对外方法

                                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                    名称说明回调参数
                                                                                                                                                    populate刷新列表items
                                                                                                                                                    setValue设置combo value值v
                                                                                                                                                    getValue获取combo value值
                                                                                                                                                    -
                                                                                                                                                    - - -
                                                                                                                                                    - -
                                                                                                                                                    -
                                                                                                                                                    -
                                                                                                                                                    - -

                                                                                                                                                    results matching ""

                                                                                                                                                    -
                                                                                                                                                      - -
                                                                                                                                                      -
                                                                                                                                                      - -

                                                                                                                                                      No results matching ""

                                                                                                                                                      - -
                                                                                                                                                      -
                                                                                                                                                      -
                                                                                                                                                      - -
                                                                                                                                                      -
                                                                                                                                                      - -
                                                                                                                                                      - - - - -
                                                                                                                                                      - - -
                                                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/combination/group_combo.md b/docs/_book/core/combination/group_combo.md deleted file mode 100644 index d9dc8ab73..000000000 --- a/docs/_book/core/combination/group_combo.md +++ /dev/null @@ -1,64 +0,0 @@ -# bi.combo_group - -## 基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/x32ue8xv/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.combo_group", - el: { - type: "bi.icon_text_icon_item", - text: "2010年", - value: 2010, - height: 25, - iconCls: "close-ha-font" - }, - children: [{ - type: "bi.single_select_item", - height: 25, - text: "一月", - value: 11 - }] -}); - - - - -``` - -{% endmethod %} - - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| childern | 子组件 | array | — | [ ] | -| popup | 弹出层 | object | — |{el: {type: "bi.button_tree",chooseType: 0,layouts: [{type: "bi.vertical"}]}}| -| isDefaultInit | 是否默认初始化子节点 |boolean | true,false | false | -| isNeedAdjustHeight | 是否需要高度调整 | boolean | true,false | false | -| isNeedAdjustWidth | 是否需要宽度调整 | boolean | true,false | false | -| el | 自定义下拉框trigger | object | — |{type: "bi.text_button", text: "", value: ""}| -| trigger | 下拉列表的弹出方式 | string | click,hover | "click" | -| adjustLength | 弹出列表和trigger的距离 | number | — | 0 | -| direction | 弹出列表和trigger的位置关系 | string | top | bottom | left | right | top,left | top,right | bottom,left | bottom,right | "bottom"| - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| populate | 刷新列表 | items | -| setValue | 设置combo value值| v | -| getValue | 获取combo value值 | — | - - - ---- - - diff --git a/docs/_book/core/combination/loader.html b/docs/_book/core/combination/loader.html deleted file mode 100644 index 430db982e..000000000 --- a/docs/_book/core/combination/loader.html +++ /dev/null @@ -1,2746 +0,0 @@ - - - - - - - loader · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                      -
                                                                                                                                                      - - - - - - - - -
                                                                                                                                                      - -
                                                                                                                                                      - -
                                                                                                                                                      - - - - - - - - -
                                                                                                                                                      -
                                                                                                                                                      - -
                                                                                                                                                      -
                                                                                                                                                      - -
                                                                                                                                                      - -

                                                                                                                                                      bi.loader

                                                                                                                                                      -

                                                                                                                                                      加载控件,BI.Widget

                                                                                                                                                      -
                                                                                                                                                      
                                                                                                                                                      -BI.createWidget({
                                                                                                                                                      -  element: "#wrapper",
                                                                                                                                                      -  type: "bi.loader",
                                                                                                                                                      -  itemsCreator: function(options, populate) {
                                                                                                                                                      -    populate(BI.map(BI.map(BI.makeArray(3, null), function(idx, value){
                                                                                                                                                      -        return {
                                                                                                                                                      -             text: faker.name.findName(),
                                                                                                                                                      -        value: BI.UUID()
                                                                                                                                                      -      };
                                                                                                                                                      -    }), function(i, v) {
                                                                                                                                                      -        return BI.extend(v, {
                                                                                                                                                      -          type: "bi.single_select_item",
                                                                                                                                                      -          height: 25
                                                                                                                                                      -        })
                                                                                                                                                      -      }))
                                                                                                                                                      -  },
                                                                                                                                                      -  hasNext: function(option) {
                                                                                                                                                      -    return option.count < 10;
                                                                                                                                                      -  }
                                                                                                                                                      -});
                                                                                                                                                      -
                                                                                                                                                      -
                                                                                                                                                      - - -

                                                                                                                                                      API

                                                                                                                                                      -
                                                                                                                                                      基础属性
                                                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                      参数说明类型可选值默认值
                                                                                                                                                      directioncombo弹出层位置stringtop,bottom,left,right,(top,left),(top,right),(bottom,left),(bottom,right)"top"
                                                                                                                                                      isDefaultInit是否默认初始化子数据booleantrue,falsetrue
                                                                                                                                                      logic布局逻辑object{dynamic:true,scrolly:true}
                                                                                                                                                      items子组件array[]
                                                                                                                                                      itemsCreator子组件构造器function
                                                                                                                                                      onLoaded加载中function
                                                                                                                                                      count是否显示总页数booleantrue,falseboolean
                                                                                                                                                      prev上一页booleantrue,falseboolean
                                                                                                                                                      next下一页booleantrue,falseboolean
                                                                                                                                                      hasPrev判断是否有上一页function
                                                                                                                                                      hasNext判断是否有下一页function
                                                                                                                                                      -

                                                                                                                                                      对外方法

                                                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                      名称说明回调参数
                                                                                                                                                      hasNext判断是否有下一页
                                                                                                                                                      prependItems内部前插入items
                                                                                                                                                      addItems内部后插入items
                                                                                                                                                      populate刷新列表items
                                                                                                                                                      setNotSelectedValue设置未被选中的值value,可以是单个值也可以是个数组
                                                                                                                                                      setValue设置value值value,可以是单个值也可以是个数组
                                                                                                                                                      getNotSelectedValue获取没有被选中的值
                                                                                                                                                      getValue获取被选中的值
                                                                                                                                                      getAllButtons获取所有button
                                                                                                                                                      getAllLeaves获取所有的叶子节点
                                                                                                                                                      getSelectedButtons获取所有被选中的元素
                                                                                                                                                      getNotSelectedButtons获取所有未被选中的元素
                                                                                                                                                      getIndexByValue根据value值获取value在数组中的索引value
                                                                                                                                                      getNodeById根据id获取节点id
                                                                                                                                                      getNodeByValue根据value值获取节点value
                                                                                                                                                      empty清空组件
                                                                                                                                                      destroy销毁组件
                                                                                                                                                      -
                                                                                                                                                      - - -
                                                                                                                                                      - -
                                                                                                                                                      -
                                                                                                                                                      -
                                                                                                                                                      - -

                                                                                                                                                      results matching ""

                                                                                                                                                      -
                                                                                                                                                        - -
                                                                                                                                                        -
                                                                                                                                                        - -

                                                                                                                                                        No results matching ""

                                                                                                                                                        - -
                                                                                                                                                        -
                                                                                                                                                        -
                                                                                                                                                        - -
                                                                                                                                                        -
                                                                                                                                                        - -
                                                                                                                                                        - - - - -
                                                                                                                                                        - - -
                                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/combination/loader.md b/docs/_book/core/combination/loader.md deleted file mode 100644 index 47a406105..000000000 --- a/docs/_book/core/combination/loader.md +++ /dev/null @@ -1,83 +0,0 @@ -# bi.loader - -## 加载控件,[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/qgLtctnx/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.loader", - itemsCreator: function(options, populate) { - populate(BI.map(BI.map(BI.makeArray(3, null), function(idx, value){ - return { - text: faker.name.findName(), - value: BI.UUID() - }; - }), function(i, v) { - return BI.extend(v, { - type: "bi.single_select_item", - height: 25 - }) - })) - }, - hasNext: function(option) { - return option.count < 10; - } -}); - - - - -``` - -{% endmethod %} - - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| direction | combo弹出层位置 | string | top,bottom,left,right,(top,left),(top,right),(bottom,left),(bottom,right) | "top"| -| isDefaultInit | 是否默认初始化子数据 |boolean | true,false | true | -| logic | 布局逻辑 | object | —| {dynamic:true,scrolly:true} | -| items| 子组件 | array | — | []| -| itemsCreator | 子组件构造器 | function | — | — | -| onLoaded | 加载中 | function | — | — | -| count | 是否显示总页数 | boolean| true,false|boolean| -| prev | 上一页 | boolean | true,false | boolean | -| next | 下一页 | boolean | true,false | boolean | -| hasPrev | 判断是否有上一页 | function | — | — | -| hasNext | 判断是否有下一页 | function | — | — | - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| hasNext | 判断是否有下一页 | — | -| prependItems | 内部前插入 | items | -| addItems | 内部后插入 | items | -| populate | 刷新列表 | items | -| setNotSelectedValue| 设置未被选中的值 | value,可以是单个值也可以是个数组| -| setValue | 设置value值 | value,可以是单个值也可以是个数组 | -| getNotSelectedValue | 获取没有被选中的值 | —| -| getValue | 获取被选中的值 |—| -| getAllButtons | 获取所有button |—| -| getAllLeaves | 获取所有的叶子节点 | —| -| getSelectedButtons | 获取所有被选中的元素 | —| -| getNotSelectedButtons | 获取所有未被选中的元素 | —| -| getIndexByValue | 根据value值获取value在数组中的索引 | value| -| getNodeById | 根据id获取节点 | id | -| getNodeByValue | 根据value值获取节点 | value | -| empty| 清空组件|—| -| destroy| 销毁组件|—| - - - ---- - - diff --git a/docs/_book/core/combination/navigation.html b/docs/_book/core/combination/navigation.html deleted file mode 100644 index f02c658fd..000000000 --- a/docs/_book/core/combination/navigation.html +++ /dev/null @@ -1,2703 +0,0 @@ - - - - - - - navigation · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                        -
                                                                                                                                                        - - - - - - - - -
                                                                                                                                                        - -
                                                                                                                                                        - -
                                                                                                                                                        - - - - - - - - -
                                                                                                                                                        -
                                                                                                                                                        - -
                                                                                                                                                        -
                                                                                                                                                        - -
                                                                                                                                                        - -

                                                                                                                                                        bi.navigation

                                                                                                                                                        -

                                                                                                                                                        导航栏控件,BI.Widget

                                                                                                                                                        -
                                                                                                                                                        
                                                                                                                                                        -
                                                                                                                                                        -BI.createWidget({
                                                                                                                                                        -  element: "#wrapper",
                                                                                                                                                        -  type: "bi.navigation",
                                                                                                                                                        -  tab: {
                                                                                                                                                        -    height: 30,
                                                                                                                                                        -    items: [{
                                                                                                                                                        -      once: false,
                                                                                                                                                        -      text: "后退",
                                                                                                                                                        -      value: -1
                                                                                                                                                        -    }, {
                                                                                                                                                        -      once: false,
                                                                                                                                                        -      text: "前进",
                                                                                                                                                        -      value: 1
                                                                                                                                                        -    }]
                                                                                                                                                        -  },
                                                                                                                                                        -  cardCreator: function(v) {
                                                                                                                                                        -    return BI.createWidget({
                                                                                                                                                        -      type: "bi.label",
                                                                                                                                                        -      cls: "layout-bg" + BI.random(1, 8),
                                                                                                                                                        -      text: "第" + v + "页"
                                                                                                                                                        -    })
                                                                                                                                                        -  }
                                                                                                                                                        -})
                                                                                                                                                        -
                                                                                                                                                        -
                                                                                                                                                        - -

                                                                                                                                                        API

                                                                                                                                                        -
                                                                                                                                                        基础属性
                                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                        参数说明类型可选值默认值
                                                                                                                                                        direction控件位置stringtop,bottom,left,right,custom"bottom"
                                                                                                                                                        single是否为单页booleantrue,falsetrue
                                                                                                                                                        defaultShowIndex是否默认显示booleantrue,falsetrue
                                                                                                                                                        tabtab页元素booleantrue,falsetrue
                                                                                                                                                        logic布局逻辑object{dynamic:true}
                                                                                                                                                        cardCreator面板构造器functionv
                                                                                                                                                        afterCardCreated面板构造之后function
                                                                                                                                                        afterCardShow面板显示之后function
                                                                                                                                                        -

                                                                                                                                                        对外方法

                                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                        名称说明回调参数
                                                                                                                                                        render渲染组件
                                                                                                                                                        mounted挂载组件
                                                                                                                                                        afterCardCreated创建卡导航页页之后v
                                                                                                                                                        afterCardShow导航页展示之后v
                                                                                                                                                        setSelect设置选中的indexv
                                                                                                                                                        getSelect获取选中的index
                                                                                                                                                        getSelectedCard获取选中的导航页
                                                                                                                                                        populate刷新列表items
                                                                                                                                                        setValue设置value值value
                                                                                                                                                        getValue获取被选中的值
                                                                                                                                                        empty清空组件
                                                                                                                                                        destroy销毁组件
                                                                                                                                                        -
                                                                                                                                                        - - -
                                                                                                                                                        - -
                                                                                                                                                        -
                                                                                                                                                        -
                                                                                                                                                        - -

                                                                                                                                                        results matching ""

                                                                                                                                                        -
                                                                                                                                                          - -
                                                                                                                                                          -
                                                                                                                                                          - -

                                                                                                                                                          No results matching ""

                                                                                                                                                          - -
                                                                                                                                                          -
                                                                                                                                                          -
                                                                                                                                                          - -
                                                                                                                                                          -
                                                                                                                                                          - -
                                                                                                                                                          - - - - -
                                                                                                                                                          - - -
                                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/combination/navigation.md b/docs/_book/core/combination/navigation.md deleted file mode 100644 index ca3e11e2b..000000000 --- a/docs/_book/core/combination/navigation.md +++ /dev/null @@ -1,78 +0,0 @@ -# bi.navigation - -## 导航栏控件,[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/ubsren48/) - -{% common %} -```javascript - - -BI.createWidget({ - element: "#wrapper", - type: "bi.navigation", - tab: { - height: 30, - items: [{ - once: false, - text: "后退", - value: -1 - }, { - once: false, - text: "前进", - value: 1 - }] - }, - cardCreator: function(v) { - return BI.createWidget({ - type: "bi.label", - cls: "layout-bg" + BI.random(1, 8), - text: "第" + v + "页" - }) - } -}) - - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| direction | 控件位置 | string | top,bottom,left,right,custom | "bottom"| -| single | 是否为单页 | boolean | true,false | true | -| defaultShowIndex | 是否默认显示 |boolean | true,false | true | -| tab | tab页元素 | boolean | true,false | true | -| logic | 布局逻辑 | object | — | {dynamic:true} | -| cardCreator | 面板构造器 | function | — | v | -| afterCardCreated | 面板构造之后 | function | — | — | -| afterCardShow | 面板显示之后 | function | —| — | - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| render | 渲染组件 | — | -| mounted | 挂载组件 | —| -| afterCardCreated | 创建卡导航页页之后 | v | -| afterCardShow | 导航页展示之后 | v | -| setSelect | 设置选中的index | v | -| getSelect | 获取选中的index| —| -| getSelectedCard | 获取选中的导航页| —| -| populate | 刷新列表 | items | -| setValue | 设置value值 | value | -| getValue | 获取被选中的值 |—| -| empty| 清空组件|—| -| destroy| 销毁组件|—| - - - ---- - - diff --git a/docs/_book/core/combination/searcher.html b/docs/_book/core/combination/searcher.html deleted file mode 100644 index 2f5d6f647..000000000 --- a/docs/_book/core/combination/searcher.html +++ /dev/null @@ -1,2841 +0,0 @@ - - - - - - - searcher · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                          -
                                                                                                                                                          - - - - - - - - -
                                                                                                                                                          - -
                                                                                                                                                          - -
                                                                                                                                                          - - - - - - - - -
                                                                                                                                                          -
                                                                                                                                                          - -
                                                                                                                                                          -
                                                                                                                                                          - -
                                                                                                                                                          - -

                                                                                                                                                          bi.searcher

                                                                                                                                                          -

                                                                                                                                                          搜索逻辑控件,BI.Widget

                                                                                                                                                          -
                                                                                                                                                          
                                                                                                                                                          -BI.createWidget({
                                                                                                                                                          -    type: "bi.searcher",
                                                                                                                                                          -    element:"#wrapper",
                                                                                                                                                          -    adapter: {
                                                                                                                                                          -      getItems: function () {
                                                                                                                                                          -        return [{
                                                                                                                                                          -                   type: "bi.label",
                                                                                                                                                          -                   value: "张三"
                                                                                                                                                          -                 }]
                                                                                                                                                          -      }
                                                                                                                                                          -    },
                                                                                                                                                          -    popup: {
                                                                                                                                                          -               type: "bi.button_group",
                                                                                                                                                          -               cls: "bi-border",
                                                                                                                                                          -               items: items,
                                                                                                                                                          -               layouts: [{
                                                                                                                                                          -                 type: "bi.vertical"
                                                                                                                                                          -               }],
                                                                                                                                                          -    },
                                                                                                                                                          -    masker: false
                                                                                                                                                          -  })
                                                                                                                                                          -
                                                                                                                                                          -
                                                                                                                                                          - -

                                                                                                                                                          API

                                                                                                                                                          -
                                                                                                                                                          基础属性
                                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                          参数说明类型可选值默认值
                                                                                                                                                          hgap效果相当于容器左右padding值number0
                                                                                                                                                          vgap效果相当于容器上下padding值number0
                                                                                                                                                          lgap效果相当于容器left-padding值number0
                                                                                                                                                          rgap效果相当于容器right-padding值number0
                                                                                                                                                          tgap效果相当于容器top-padding值number0
                                                                                                                                                          bgap效果相当于容器bottom-padding值number0
                                                                                                                                                          chooseType选择类型constCHOOSE_TYPE_SINGLE
                                                                                                                                                          isDefaultInit是否默认初始化子节点booleantrue,falsefalse
                                                                                                                                                          isAutoSearch是否自动搜索booleantrue,falsetrue
                                                                                                                                                          isAutoSync是否自动同步数据, 即是否保持搜索面板和adapter面板状态值的统一booleantrue,falsetrue
                                                                                                                                                          onSearchisAutoSearch为false时启用function(op.callback)
                                                                                                                                                          el开启弹出层的元素object{type: "bi.search_editor"}
                                                                                                                                                          popup弹出层object{type: "bi.searcher_view"}
                                                                                                                                                          adapter弹出层显示的位置元素objectnull
                                                                                                                                                          maskermasker层object{offset: {}}
                                                                                                                                                          -

                                                                                                                                                          对外方法

                                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                          名称说明回调参数
                                                                                                                                                          populate刷新列表result, searchResult, keyword
                                                                                                                                                          setValue设置value值value
                                                                                                                                                          getValue获取被选中的值
                                                                                                                                                          empty清空组件
                                                                                                                                                          destroy销毁组件
                                                                                                                                                          adapter搜索列表位置
                                                                                                                                                          doSearch开始搜索
                                                                                                                                                          stopSearch停止搜索
                                                                                                                                                          isSearching是否正在搜索
                                                                                                                                                          isViewVisible组件是否可见
                                                                                                                                                          getView获取搜索列表栏
                                                                                                                                                          hasMatched是否匹配
                                                                                                                                                          adjustHeight调整高度
                                                                                                                                                          adjustView调整搜索列表栏
                                                                                                                                                          getKeyword获取搜索关键词
                                                                                                                                                          getKeywords获取搜索关键词数组
                                                                                                                                                          -

                                                                                                                                                          事件方法

                                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                          事件名称说明回调参数
                                                                                                                                                          EVENT_START开始搜索
                                                                                                                                                          EVENT_STOP停止搜索
                                                                                                                                                          EVENT_PAUSE暂停搜索
                                                                                                                                                          EVENT_SEARCHING搜索中
                                                                                                                                                          EVENT_AFTER_INIT初始化之后
                                                                                                                                                          -

                                                                                                                                                          事件

                                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                          事件说明
                                                                                                                                                          BI.Searcher.EVENT_CHANGE搜索结果面板发生改变触发
                                                                                                                                                          BI.Searcher.EVENT_START开始搜索触发
                                                                                                                                                          BI.Searcher.EVENT_STOP停止搜索触发(搜索框为空)
                                                                                                                                                          BI.Searcher.EVENT_PAUSE搜索暂停触发(搜索文本以空白字符结尾)
                                                                                                                                                          BI.Searcher.EVENT_SEARCHING正在搜索时触发
                                                                                                                                                          BI.Searcher.EVENT_AFTER_INIT搜索结果面板初始化完成后触发
                                                                                                                                                          -
                                                                                                                                                          - - -
                                                                                                                                                          - -
                                                                                                                                                          -
                                                                                                                                                          -
                                                                                                                                                          - -

                                                                                                                                                          results matching ""

                                                                                                                                                          -
                                                                                                                                                            - -
                                                                                                                                                            -
                                                                                                                                                            - -

                                                                                                                                                            No results matching ""

                                                                                                                                                            - -
                                                                                                                                                            -
                                                                                                                                                            -
                                                                                                                                                            - -
                                                                                                                                                            -
                                                                                                                                                            - -
                                                                                                                                                            - - - - -
                                                                                                                                                            - - -
                                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/combination/searcher.md b/docs/_book/core/combination/searcher.md deleted file mode 100644 index a7e26cb46..000000000 --- a/docs/_book/core/combination/searcher.md +++ /dev/null @@ -1,102 +0,0 @@ -# bi.searcher - -## 搜索逻辑控件,[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/k6s24et1/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.searcher", - element:"#wrapper", - adapter: { - getItems: function () { - return [{ - type: "bi.label", - value: "张三" - }] - } - }, - popup: { - type: "bi.button_group", - cls: "bi-border", - items: items, - layouts: [{ - type: "bi.vertical" - }], - }, - masker: false - }) - - - -``` - -{% 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 | -| chooseType | 选择类型 | const | | CHOOSE_TYPE_SINGLE | -| isDefaultInit | 是否默认初始化子节点 |boolean | true,false | false | -| isAutoSearch | 是否自动搜索 |boolean | true,false | true | -| isAutoSync | 是否自动同步数据, 即是否保持搜索面板和adapter面板状态值的统一 |boolean | true,false | true | -| onSearch | isAutoSearch为false时启用 | function(op.callback) | — | —| -| el | 开启弹出层的元素 | object | — | {type: "bi.search_editor"}| -| popup | 弹出层 | object | — |{type: "bi.searcher_view"}| -| adapter | 弹出层显示的位置元素 | object | —| null| -| masker | masker层 | object | — | {offset: {}}| - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| populate | 刷新列表 | result, searchResult, keyword | -| setValue | 设置value值 | value | -| getValue | 获取被选中的值 |—| -| empty| 清空组件|—| -| destroy| 销毁组件|—| -| adapter | 搜索列表位置 | — | -| doSearch | 开始搜索 | — | -| stopSearch | 停止搜索 | —| -| isSearching | 是否正在搜索 | —| -| isViewVisible | 组件是否可见 | —| -| getView | 获取搜索列表栏 | —| -| hasMatched | 是否匹配 | —| -| adjustHeight | 调整高度 | —| -| adjustView| 调整搜索列表栏| —| -| getKeyword | 获取搜索关键词| —| -| getKeywords | 获取搜索关键词数组| —| - - -## 事件方法 - -| 事件名称| 说明| 回调参数 | -| :------ |:------------- | :----- -| EVENT_START | 开始搜索 | —| -| EVENT_STOP | 停止搜索 | —| -| EVENT_PAUSE | 暂停搜索 | —| -| EVENT_SEARCHING | 搜索中| —| -| EVENT_AFTER_INIT | 初始化之后 | —| - -## 事件 -| 事件 | 说明 | -| :------ |:------------- | -|BI.Searcher.EVENT_CHANGE | 搜索结果面板发生改变触发 | -|BI.Searcher.EVENT_START | 开始搜索触发 | -|BI.Searcher.EVENT_STOP | 停止搜索触发(搜索框为空) | -|BI.Searcher.EVENT_PAUSE | 搜索暂停触发(搜索文本以空白字符结尾) | -|BI.Searcher.EVENT_SEARCHING | 正在搜索时触发 | -|BI.Searcher.EVENT_AFTER_INIT | 搜索结果面板初始化完成后触发 | - ---- - - diff --git a/docs/_book/core/combination/switcher.html b/docs/_book/core/combination/switcher.html deleted file mode 100644 index 97b8673b7..000000000 --- a/docs/_book/core/combination/switcher.html +++ /dev/null @@ -1,2768 +0,0 @@ - - - - - - - switcher · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                            -
                                                                                                                                                            - - - - - - - - -
                                                                                                                                                            - -
                                                                                                                                                            - -
                                                                                                                                                            - - - - - - - - -
                                                                                                                                                            -
                                                                                                                                                            - -
                                                                                                                                                            -
                                                                                                                                                            - -
                                                                                                                                                            - -

                                                                                                                                                            bi.switcher

                                                                                                                                                            -

                                                                                                                                                            切换显示或隐藏面板,BI.Widget

                                                                                                                                                            -
                                                                                                                                                            
                                                                                                                                                            -BI.createWidget({
                                                                                                                                                            -  element: "#wrapper",
                                                                                                                                                            -  type: "bi.switcher",
                                                                                                                                                            -  el: {
                                                                                                                                                            -    type: "bi.button",
                                                                                                                                                            -    height: 25,
                                                                                                                                                            -    text: "Switcher"
                                                                                                                                                            -  },
                                                                                                                                                            -  popup: {
                                                                                                                                                            -
                                                                                                                                                            -  },
                                                                                                                                                            -  adapter: { 
                                                                                                                                                            -
                                                                                                                                                            -  }
                                                                                                                                                            -})
                                                                                                                                                            -
                                                                                                                                                            -
                                                                                                                                                            - -

                                                                                                                                                            API

                                                                                                                                                            -
                                                                                                                                                            基础属性
                                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                            参数说明类型可选值默认值
                                                                                                                                                            trigger下拉列表的弹出方式stringclick,hover"click"
                                                                                                                                                            toggle切换状态booleantrue,falsetrue
                                                                                                                                                            direction面板显示的位置stringBI.Direction.Top
                                                                                                                                                            el自定义下拉框triggerobject{ }
                                                                                                                                                            popup弹出层object{ }
                                                                                                                                                            adapter弹出层的位置objectnull
                                                                                                                                                            maskermasker层obejct{ }
                                                                                                                                                            switcherClass切换类string"bi-switcher-popup"
                                                                                                                                                            hoverClasshover类string"bi-switcher-hover"
                                                                                                                                                            -

                                                                                                                                                            对外方法

                                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                            名称说明回调参数
                                                                                                                                                            setValue设置value值value
                                                                                                                                                            getValue获取被选中的值
                                                                                                                                                            empty清空组件
                                                                                                                                                            destroy销毁组件
                                                                                                                                                            populate刷新列表items
                                                                                                                                                            isViewVisible弹窗层是否可见
                                                                                                                                                            showView显示弹出层
                                                                                                                                                            hideView隐藏弹出层
                                                                                                                                                            getView获取弹出层
                                                                                                                                                            getAllLeaves获取所有的叶子节点
                                                                                                                                                            getNodeById根据id获取节点id
                                                                                                                                                            getNodeByValue根据value值获取节点value
                                                                                                                                                            isExpanded节点是否展开
                                                                                                                                                            setAdapter设置弹出层显示的位置元素adapter
                                                                                                                                                            adjustView调整弹出层显示的位置元素
                                                                                                                                                            -

                                                                                                                                                            事件方法

                                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                            事件名称说明回调参数
                                                                                                                                                            EVENT_EXPAND面板展开
                                                                                                                                                            EVENT_COLLAPSE面板收起
                                                                                                                                                            EVENT_TRIGGER_CHANGE面板切换
                                                                                                                                                            EVENT_AFTER_INIT初始化之后
                                                                                                                                                            EVENT_BEFORE_POPUPVIEW面板显示之前
                                                                                                                                                            EVENT_AFTER_POPUPVIEW面板显示之后
                                                                                                                                                            EVENT_BEFORE_HIDEVIEW面板隐藏之前
                                                                                                                                                            EVENT_AFTER_HIDEVIEW面板隐藏之后
                                                                                                                                                            -
                                                                                                                                                            - - -
                                                                                                                                                            - -
                                                                                                                                                            -
                                                                                                                                                            -
                                                                                                                                                            - -

                                                                                                                                                            results matching ""

                                                                                                                                                            -
                                                                                                                                                              - -
                                                                                                                                                              -
                                                                                                                                                              - -

                                                                                                                                                              No results matching ""

                                                                                                                                                              - -
                                                                                                                                                              -
                                                                                                                                                              -
                                                                                                                                                              - -
                                                                                                                                                              -
                                                                                                                                                              - -
                                                                                                                                                              - - - - -
                                                                                                                                                              - - -
                                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/combination/switcher.md b/docs/_book/core/combination/switcher.md deleted file mode 100644 index b7354fdf9..000000000 --- a/docs/_book/core/combination/switcher.md +++ /dev/null @@ -1,83 +0,0 @@ -# bi.switcher - -## 切换显示或隐藏面板,[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/4sj60ap0/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.switcher", - el: { - type: "bi.button", - height: 25, - text: "Switcher" - }, - popup: { - - }, - adapter: { - - } -}) - - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| trigger | 下拉列表的弹出方式 | string | click,hover | "click" | -| toggle | 切换状态 | boolean | true,false | true | -| direction | 面板显示的位置 | string | — | BI.Direction.Top | -| el | 自定义下拉框trigger | object | — | { }| -| popup | 弹出层 | object | — |{ }| -| adapter | 弹出层的位置 | object | — | null| -| masker | masker层 | obejct | — | { }| -| switcherClass | 切换类 | string| —| "bi-switcher-popup" | -| hoverClass | hover类 | string | — | "bi-switcher-hover" | - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| setValue | 设置value值 | value | -| getValue | 获取被选中的值 |—| -| empty| 清空组件|—| -| destroy| 销毁组件|—| -| populate | 刷新列表 | items | -| isViewVisible | 弹窗层是否可见 | —| -| showView | 显示弹出层 | —| -| hideView | 隐藏弹出层|—| -| getView | 获取弹出层|—| -| getAllLeaves | 获取所有的叶子节点 | —| -| getNodeById | 根据id获取节点 | id | -| getNodeByValue | 根据value值获取节点 | value | -| isExpanded | 节点是否展开 |— | -| setAdapter | 设置弹出层显示的位置元素|adapter| -| adjustView| 调整弹出层显示的位置元素 |—| - -## 事件方法 - -| 事件名称| 说明| 回调参数 | -| :------ |:------------- | :----- -| EVENT_EXPAND | 面板展开 | —| -| EVENT_COLLAPSE | 面板收起 | —| -| EVENT_TRIGGER_CHANGE | 面板切换 | —| -| EVENT_AFTER_INIT | 初始化之后 | —| -| EVENT_BEFORE_POPUPVIEW | 面板显示之前| —| -| EVENT_AFTER_POPUPVIEW | 面板显示之后| —| -| EVENT_BEFORE_HIDEVIEW | 面板隐藏之前| —| -| EVENT_AFTER_HIDEVIEW | 面板隐藏之后 | —| - - ---- - - diff --git a/docs/_book/core/combination/tab.html b/docs/_book/core/combination/tab.html deleted file mode 100644 index ad61dcfe7..000000000 --- a/docs/_book/core/combination/tab.html +++ /dev/null @@ -1,2696 +0,0 @@ - - - - - - - tab · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                              -
                                                                                                                                                              - - - - - - - - -
                                                                                                                                                              - -
                                                                                                                                                              - -
                                                                                                                                                              - - - - - - - - -
                                                                                                                                                              -
                                                                                                                                                              - -
                                                                                                                                                              -
                                                                                                                                                              - -
                                                                                                                                                              - -

                                                                                                                                                              bi.switcher

                                                                                                                                                              -

                                                                                                                                                              切换显示或隐藏面板,BI.Widget

                                                                                                                                                              -
                                                                                                                                                              
                                                                                                                                                              -BI.createWidget({
                                                                                                                                                              -  element: "#wrapper",
                                                                                                                                                              -  type: "bi.tab",
                                                                                                                                                              -  tab: {
                                                                                                                                                              -    type: "bi.button_group",
                                                                                                                                                              -    height: 30,
                                                                                                                                                              -    items: [{
                                                                                                                                                              -      text: "Tab1",
                                                                                                                                                              -      value: 1,
                                                                                                                                                              -      width: 50
                                                                                                                                                              -    }, {
                                                                                                                                                              -      text: "Tab2",
                                                                                                                                                              -      value: 2,
                                                                                                                                                              -      width: 50
                                                                                                                                                              -    }]
                                                                                                                                                              -  },
                                                                                                                                                              -  cardCreator: function(v) {
                                                                                                                                                              -    switch (v) {
                                                                                                                                                              -      case 1:
                                                                                                                                                              -        return BI.createWidget({
                                                                                                                                                              -          type: "bi.label",
                                                                                                                                                              -          cls: "bi-card",
                                                                                                                                                              -          text: "面板1"
                                                                                                                                                              -        })
                                                                                                                                                              -      case 2:
                                                                                                                                                              -        return BI.createWidget({
                                                                                                                                                              -          type: "bi.label",
                                                                                                                                                              -          cls: "bi-card",
                                                                                                                                                              -          text: "面板2"
                                                                                                                                                              -        })
                                                                                                                                                              -    }
                                                                                                                                                              -  }
                                                                                                                                                              -})
                                                                                                                                                              -
                                                                                                                                                              -
                                                                                                                                                              - -

                                                                                                                                                              API

                                                                                                                                                              -
                                                                                                                                                              基础属性
                                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                              参数说明类型可选值默认值
                                                                                                                                                              direction控件位置stringtop,bottom,left,right,custom"bottom"
                                                                                                                                                              single是否为单页booleantrue,falsefalse
                                                                                                                                                              defaultShowIndex是否默认显示tab页booleantrue,falsefalse
                                                                                                                                                              tabtab标签页object{ }
                                                                                                                                                              logic布局逻辑object{dynamic:false}
                                                                                                                                                              cardCreator面板构造器functionfunction (v) {return BI.createWidget();}
                                                                                                                                                              -

                                                                                                                                                              对外方法

                                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                              名称说明回调参数
                                                                                                                                                              render渲染组件
                                                                                                                                                              mounted挂载组件
                                                                                                                                                              removeTab移除tab面板页cardname
                                                                                                                                                              getTab获取tab面板页v
                                                                                                                                                              setSelect设置选中的indexv
                                                                                                                                                              getSelect获取选中的index
                                                                                                                                                              getSelectedTab获取选中的tab面板页
                                                                                                                                                              populate刷新列表items
                                                                                                                                                              setValue设置value值value
                                                                                                                                                              getValue获取被选中的值
                                                                                                                                                              empty清空组件
                                                                                                                                                              destroy销毁组件
                                                                                                                                                              -
                                                                                                                                                              - - -
                                                                                                                                                              - -
                                                                                                                                                              -
                                                                                                                                                              -
                                                                                                                                                              - -

                                                                                                                                                              results matching ""

                                                                                                                                                              -
                                                                                                                                                                - -
                                                                                                                                                                -
                                                                                                                                                                - -

                                                                                                                                                                No results matching ""

                                                                                                                                                                - -
                                                                                                                                                                -
                                                                                                                                                                -
                                                                                                                                                                - -
                                                                                                                                                                -
                                                                                                                                                                - -
                                                                                                                                                                - - - - -
                                                                                                                                                                - - -
                                                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/combination/tab.md b/docs/_book/core/combination/tab.md deleted file mode 100644 index 9023bbf44..000000000 --- a/docs/_book/core/combination/tab.md +++ /dev/null @@ -1,84 +0,0 @@ -# bi.switcher - -## 切换显示或隐藏面板,[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/pdo5s8pq/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.tab", - tab: { - type: "bi.button_group", - height: 30, - items: [{ - text: "Tab1", - value: 1, - width: 50 - }, { - text: "Tab2", - value: 2, - width: 50 - }] - }, - cardCreator: function(v) { - switch (v) { - case 1: - return BI.createWidget({ - type: "bi.label", - cls: "bi-card", - text: "面板1" - }) - case 2: - return BI.createWidget({ - type: "bi.label", - cls: "bi-card", - text: "面板2" - }) - } - } -}) - - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| direction | 控件位置 | string | top,bottom,left,right,custom | "bottom"| -| single | 是否为单页 | boolean | true,false | false | -| defaultShowIndex | 是否默认显示tab页 | boolean | true,false | false | -| tab | tab标签页 | object | — | { } | -| logic | 布局逻辑 | object | — | {dynamic:false} | -| cardCreator | 面板构造器| function | — | function (v) {return BI.createWidget();} | - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| render | 渲染组件 | — | -| mounted | 挂载组件 | —| -| removeTab | 移除tab面板页 | cardname | -| getTab | 获取tab面板页 | v | -| setSelect | 设置选中的index | v | -| getSelect | 获取选中的index| —| -| getSelectedTab | 获取选中的tab面板页 | —| -| populate | 刷新列表 | items | -| setValue | 设置value值 | value | -| getValue | 获取被选中的值 |—| -| empty| 清空组件|—| -| destroy| 销毁组件|—| - - - - ---- - - diff --git a/docs/_book/core/layer/layer_float_box.html b/docs/_book/core/layer/layer_float_box.html deleted file mode 100644 index e098e5fb9..000000000 --- a/docs/_book/core/layer/layer_float_box.html +++ /dev/null @@ -1,2645 +0,0 @@ - - - - - - - float_box · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                -
                                                                                                                                                                - - - - - - - - -
                                                                                                                                                                - -
                                                                                                                                                                - -
                                                                                                                                                                - - - - - - - - -
                                                                                                                                                                -
                                                                                                                                                                - -
                                                                                                                                                                -
                                                                                                                                                                - -
                                                                                                                                                                - -

                                                                                                                                                                bi.float_box

                                                                                                                                                                -

                                                                                                                                                                floatBox弹出层,BI.Widget

                                                                                                                                                                -
                                                                                                                                                                
                                                                                                                                                                -var id = BI.UUID();
                                                                                                                                                                -
                                                                                                                                                                -BI.createWidget({
                                                                                                                                                                -  element: "#wrapper",
                                                                                                                                                                -  type: "bi.text_button",
                                                                                                                                                                -  text: "点击弹出FloatBox",
                                                                                                                                                                -  width: 200,
                                                                                                                                                                -  height: 80,
                                                                                                                                                                -  handler: function() {
                                                                                                                                                                -    BI.Popovers.remove(id);
                                                                                                                                                                -    BI.Popovers.create(id, new BI.BarPopoverSection()).open(id);
                                                                                                                                                                -  }
                                                                                                                                                                -})
                                                                                                                                                                -
                                                                                                                                                                -
                                                                                                                                                                - -

                                                                                                                                                                API

                                                                                                                                                                -
                                                                                                                                                                基础属性
                                                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                参数说明类型可选值默认值
                                                                                                                                                                width弹出层宽度number600
                                                                                                                                                                height弹出层高度number500
                                                                                                                                                                -

                                                                                                                                                                对外方法

                                                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                名称说明回调参数
                                                                                                                                                                populate刷新列表sectionProvider
                                                                                                                                                                destroyed销毁组件
                                                                                                                                                                show显示
                                                                                                                                                                hide隐藏
                                                                                                                                                                open打开弹出层
                                                                                                                                                                close关闭弹出层
                                                                                                                                                                setZindex设置z-indexz-index
                                                                                                                                                                -

                                                                                                                                                                事件方法

                                                                                                                                                                - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                事件名称说明回调参数
                                                                                                                                                                EVENT_FLOAT_BOX_CLOSED关闭弹出层
                                                                                                                                                                EVENT_FLOAT_BOX_CLOSED打开弹出层
                                                                                                                                                                -
                                                                                                                                                                - - -
                                                                                                                                                                - -
                                                                                                                                                                -
                                                                                                                                                                -
                                                                                                                                                                - -

                                                                                                                                                                results matching ""

                                                                                                                                                                -
                                                                                                                                                                  - -
                                                                                                                                                                  -
                                                                                                                                                                  - -

                                                                                                                                                                  No results matching ""

                                                                                                                                                                  - -
                                                                                                                                                                  -
                                                                                                                                                                  -
                                                                                                                                                                  - -
                                                                                                                                                                  -
                                                                                                                                                                  - -
                                                                                                                                                                  - - - - -
                                                                                                                                                                  - - -
                                                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layer/layer_float_box.md b/docs/_book/core/layer/layer_float_box.md deleted file mode 100644 index 8f2c8178f..000000000 --- a/docs/_book/core/layer/layer_float_box.md +++ /dev/null @@ -1,63 +0,0 @@ -# bi.float_box - -## floatBox弹出层,[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/72gp1n0p/) - -{% common %} -```javascript - -var id = BI.UUID(); - -BI.createWidget({ - element: "#wrapper", - type: "bi.text_button", - text: "点击弹出FloatBox", - width: 200, - height: 80, - handler: function() { - BI.Popovers.remove(id); - BI.Popovers.create(id, new BI.BarPopoverSection()).open(id); - } -}) - - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| width | 弹出层宽度 | number | — | 600 | -| height | 弹出层高度 | number | — | 500 | - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| populate | 刷新列表 | sectionProvider | -| destroyed| 销毁组件|—| -| show | 显示 | —| -| hide | 隐藏 | —| -| open | 打开弹出层 | —| -| close| 关闭弹出层 | —| -| setZindex | 设置z-index| z-index | - - -## 事件方法 - -| 事件名称| 说明| 回调参数 | -| :------ |:------------- | :----- -| EVENT_FLOAT_BOX_CLOSED | 关闭弹出层 | —| -| EVENT_FLOAT_BOX_CLOSED | 打开弹出层 | —| - - - ---- - - diff --git a/docs/_book/core/layer/layer_popup.html b/docs/_book/core/layer/layer_popup.html deleted file mode 100644 index d8a28e646..000000000 --- a/docs/_book/core/layer/layer_popup.html +++ /dev/null @@ -1,2741 +0,0 @@ - - - - - - - popup · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                  -
                                                                                                                                                                  - - - - - - - - -
                                                                                                                                                                  - -
                                                                                                                                                                  - -
                                                                                                                                                                  - - - - - - - - -
                                                                                                                                                                  -
                                                                                                                                                                  - -
                                                                                                                                                                  -
                                                                                                                                                                  - -
                                                                                                                                                                  - -

                                                                                                                                                                  bi.popup_view

                                                                                                                                                                  -

                                                                                                                                                                  下拉框弹出层, zIndex在1000w,BI.Widget

                                                                                                                                                                  -
                                                                                                                                                                  
                                                                                                                                                                  -BI.createWidget({
                                                                                                                                                                  -  element: "#wrapper",
                                                                                                                                                                  -  type: "bi.popup_view",
                                                                                                                                                                  -  el: {
                                                                                                                                                                  -    type: "bi.button_group",
                                                                                                                                                                  -    items: [{
                                                                                                                                                                  -      text: "aaa",
                                                                                                                                                                  -      value: "aaa"
                                                                                                                                                                  -    }, {
                                                                                                                                                                  -      text: "bbb",
                                                                                                                                                                  -      value: "bbb"
                                                                                                                                                                  -    }],
                                                                                                                                                                  -    layouts: [{
                                                                                                                                                                  -      type: "bi.vertical"
                                                                                                                                                                  -    }]
                                                                                                                                                                  -  }
                                                                                                                                                                  -})
                                                                                                                                                                  -
                                                                                                                                                                  -
                                                                                                                                                                  - -

                                                                                                                                                                  API

                                                                                                                                                                  -
                                                                                                                                                                  基础属性
                                                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                  参数说明类型可选值默认值
                                                                                                                                                                  maxWidth弹出层最大宽度number/string"auto"
                                                                                                                                                                  minWidth弹出层最小宽度number100
                                                                                                                                                                  maxHeight弹出层最大高度number/string
                                                                                                                                                                  minHeight弹出层最小高度number25
                                                                                                                                                                  hgap效果相当于容器左右padding值number0
                                                                                                                                                                  vgap效果相当于容器上下padding值number0
                                                                                                                                                                  lgap效果相当于容器left-padding值number0
                                                                                                                                                                  rgap效果相当于容器right-padding值number0
                                                                                                                                                                  tgap效果相当于容器top-padding值number0
                                                                                                                                                                  bgap效果相当于容器bottom-padding值number0
                                                                                                                                                                  direction工具栏的方向const参考button_groupBI.Direction.Top
                                                                                                                                                                  stopEvent是否停止mousedown、mouseup事件booleantrue,falsefalse
                                                                                                                                                                  stopPropagation是否停止mousedown、mouseup向上冒泡booleantrue,falsefalse
                                                                                                                                                                  tabs导航栏array[]
                                                                                                                                                                  logic布局逻辑object{dynamic:true}
                                                                                                                                                                  tools自定义工具栏booleantrue,falsefalse
                                                                                                                                                                  buttonstoolbar栏array[]
                                                                                                                                                                  el子组件object{ type: "bi.button_group",items: [], chooseType: 0,behaviors: {},layouts: [{type: "bi.vertical"}]}
                                                                                                                                                                  -

                                                                                                                                                                  对外方法

                                                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                  名称说明回调参数
                                                                                                                                                                  populate刷新列表items
                                                                                                                                                                  resetWidth重置宽度width
                                                                                                                                                                  resetHeight重置高度height
                                                                                                                                                                  setValue设置value 值value
                                                                                                                                                                  getValue获取value值
                                                                                                                                                                  setZindex设置z-indexz-index
                                                                                                                                                                  getView获取弹出层
                                                                                                                                                                  -
                                                                                                                                                                  - - -
                                                                                                                                                                  - -
                                                                                                                                                                  -
                                                                                                                                                                  -
                                                                                                                                                                  - -

                                                                                                                                                                  results matching ""

                                                                                                                                                                  -
                                                                                                                                                                    - -
                                                                                                                                                                    -
                                                                                                                                                                    - -

                                                                                                                                                                    No results matching ""

                                                                                                                                                                    - -
                                                                                                                                                                    -
                                                                                                                                                                    -
                                                                                                                                                                    - -
                                                                                                                                                                    -
                                                                                                                                                                    - -
                                                                                                                                                                    - - - - -
                                                                                                                                                                    - - -
                                                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layer/layer_popup.md b/docs/_book/core/layer/layer_popup.md deleted file mode 100644 index 365009083..000000000 --- a/docs/_book/core/layer/layer_popup.md +++ /dev/null @@ -1,76 +0,0 @@ -# bi.popup_view - -## 下拉框弹出层, zIndex在1000w,[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/x95pg143/) - -{% common %} -```javascript - -BI.createWidget({ - element: "#wrapper", - type: "bi.popup_view", - el: { - type: "bi.button_group", - items: [{ - text: "aaa", - value: "aaa" - }, { - text: "bbb", - value: "bbb" - }], - layouts: [{ - type: "bi.vertical" - }] - } -}) - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| maxWidth | 弹出层最大宽度 | number/string | — | "auto" | -| minWidth | 弹出层最小宽度 | number | — | 100 | -| maxHeight | 弹出层最大高度 | number/string | — | — | -| minHeight | 弹出层最小高度 | number | — | 25 | -| 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 | -| direction| 工具栏的方向| const | 参考button_group | BI.Direction.Top | -| stopEvent | 是否停止mousedown、mouseup事件 | boolean | true,false | false | -| stopPropagation | 是否停止mousedown、mouseup向上冒泡 | boolean | true,false | false | -| tabs | 导航栏 | array | — | [] | -| logic | 布局逻辑| object | — | {dynamic:true} | -| tools | 自定义工具栏 |boolean | true,false | false | -| buttons | toolbar栏 | array | — | [] | -| el | 子组件 | object | — |{ type: "bi.button_group",items: [], chooseType: 0,behaviors: {},layouts: [{type: "bi.vertical"}]} | - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| populate | 刷新列表 | items | -| resetWidth | 重置宽度 | width | -| resetHeight | 重置高度 | height| -| setValue | 设置value 值 | value | -| getValue| 获取value值 | —| -| setZindex | 设置z-index| z-index | -| getView | 获取弹出层 | —| - - - - - ---- - - diff --git a/docs/_book/core/layer/layer_searcher.html b/docs/_book/core/layer/layer_searcher.html deleted file mode 100644 index dbe5df3a5..000000000 --- a/docs/_book/core/layer/layer_searcher.html +++ /dev/null @@ -1,2630 +0,0 @@ - - - - - - - searcher · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                    -
                                                                                                                                                                    - - - - - - - - -
                                                                                                                                                                    - -
                                                                                                                                                                    - -
                                                                                                                                                                    - - - - - - - - -
                                                                                                                                                                    -
                                                                                                                                                                    - -
                                                                                                                                                                    -
                                                                                                                                                                    - -
                                                                                                                                                                    - -

                                                                                                                                                                    bi.searcher_view

                                                                                                                                                                    -

                                                                                                                                                                    搜索面板, 基类BI.Widget

                                                                                                                                                                    -
                                                                                                                                                                    
                                                                                                                                                                    -var searcher = BI.createWidget({
                                                                                                                                                                    -  element: "#wrapper",
                                                                                                                                                                    -  type: "bi.searcher_view",
                                                                                                                                                                    -});
                                                                                                                                                                    -searcher.populate([{
                                                                                                                                                                    -    text: "aba",
                                                                                                                                                                    -  value: "aba"
                                                                                                                                                                    -},{
                                                                                                                                                                    -    text: "acc",
                                                                                                                                                                    -  value: "acc"
                                                                                                                                                                    -}], [{
                                                                                                                                                                    -    text: "a",
                                                                                                                                                                    -  value: "a"
                                                                                                                                                                    -}], "a");
                                                                                                                                                                    -
                                                                                                                                                                    -
                                                                                                                                                                    - -

                                                                                                                                                                    API

                                                                                                                                                                    -
                                                                                                                                                                    基础属性
                                                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                    参数说明类型可选值默认值
                                                                                                                                                                    tipTexttitle文本stringBI.i18nText("BI-No_Select")
                                                                                                                                                                    chooseType选择类型const参考button_groupBI.Selection.Single
                                                                                                                                                                    matcher完全匹配的构造器object{type: "bi.button_group",behaviors: { redmark: function () { return true;} },items: [], layouts: [{ type: "bi.vertical"}]}
                                                                                                                                                                    searcher搜索到的元素object{type: "bi.button_group",behaviors: {redmark: function () {return true;}}, items: [], layouts: [{ type: "bi.vertical" }]}
                                                                                                                                                                    -

                                                                                                                                                                    对外方法

                                                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                    名称说明回调参数
                                                                                                                                                                    populate刷新列表searchResult, matchResult, keyword
                                                                                                                                                                    setValue设置value 值value
                                                                                                                                                                    getValue获取value值
                                                                                                                                                                    empty清空组件
                                                                                                                                                                    hasMatched是否有匹配的元素
                                                                                                                                                                    -
                                                                                                                                                                    - - -
                                                                                                                                                                    - -
                                                                                                                                                                    -
                                                                                                                                                                    -
                                                                                                                                                                    - -

                                                                                                                                                                    results matching ""

                                                                                                                                                                    -
                                                                                                                                                                      - -
                                                                                                                                                                      -
                                                                                                                                                                      - -

                                                                                                                                                                      No results matching ""

                                                                                                                                                                      - -
                                                                                                                                                                      -
                                                                                                                                                                      -
                                                                                                                                                                      - -
                                                                                                                                                                      -
                                                                                                                                                                      - -
                                                                                                                                                                      - - - - -
                                                                                                                                                                      - - -
                                                                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layer/layer_searcher.md b/docs/_book/core/layer/layer_searcher.md deleted file mode 100644 index 64c0898b2..000000000 --- a/docs/_book/core/layer/layer_searcher.md +++ /dev/null @@ -1,54 +0,0 @@ -# bi.searcher_view - -## 搜索面板, 基类[BI.Widget](/core/widget.md) - -{% method %} -[source](https://jsfiddle.net/fineui/qkfns6wm/) - -{% common %} -```javascript - -var searcher = BI.createWidget({ - element: "#wrapper", - type: "bi.searcher_view", -}); -searcher.populate([{ - text: "aba", - value: "aba" -},{ - text: "acc", - value: "acc" -}], [{ - text: "a", - value: "a" -}], "a"); - - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| tipText | title文本 | string | — | BI.i18nText("BI-No_Select") | -| chooseType | 选择类型 | const | 参考button_group | BI.Selection.Single | -| matcher | 完全匹配的构造器 | object | — | {type: "bi.button_group",behaviors: { redmark: function () { return true;} },items: [], layouts: [{ type: "bi.vertical"}]} | -| searcher | 搜索到的元素 | object| — | {type: "bi.button_group",behaviors: {redmark: function () {return true;}}, items: [], layouts: [{ type: "bi.vertical" }]}| - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| populate | 刷新列表 | searchResult, matchResult, keyword | -| setValue | 设置value 值 | value | -| getValue| 获取value值 | —| -| empty | 清空组件 | —| -| hasMatched | 是否有匹配的元素 | —| - - - ---- - - diff --git a/docs/_book/core/layout/border.html b/docs/_book/core/layout/border.html deleted file mode 100644 index 486071c43..000000000 --- a/docs/_book/core/layout/border.html +++ /dev/null @@ -1,2589 +0,0 @@ - - - - - - - border · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                      -
                                                                                                                                                                      - - - - - - - - -
                                                                                                                                                                      - -
                                                                                                                                                                      - -
                                                                                                                                                                      - - - - - - - - -
                                                                                                                                                                      -
                                                                                                                                                                      - -
                                                                                                                                                                      -
                                                                                                                                                                      - -
                                                                                                                                                                      - -

                                                                                                                                                                      bi.border

                                                                                                                                                                      -

                                                                                                                                                                      上下的高度固定/左右的宽度固定,中间的高度/宽度自适应

                                                                                                                                                                      -
                                                                                                                                                                      BI.createWidget({
                                                                                                                                                                      -    type: 'bi.border',
                                                                                                                                                                      -    element: "#wrapper",
                                                                                                                                                                      -    items: {
                                                                                                                                                                      -        north: {
                                                                                                                                                                      -            el: {type: "bi.label"},
                                                                                                                                                                      -            height: 30,
                                                                                                                                                                      -            top: 20,
                                                                                                                                                                      -            left: 20,
                                                                                                                                                                      -            right: 20
                                                                                                                                                                      -        },
                                                                                                                                                                      -        south: {
                                                                                                                                                                      -            el: {type: "bi.label"},
                                                                                                                                                                      -            height: 50,
                                                                                                                                                                      -            bottom: 20,
                                                                                                                                                                      -            left: 20,
                                                                                                                                                                      -            right: 20
                                                                                                                                                                      -        },
                                                                                                                                                                      -        west: {
                                                                                                                                                                      -            el: {type: "bi.label"},
                                                                                                                                                                      -            width: 200,
                                                                                                                                                                      -            left: 20
                                                                                                                                                                      -        },
                                                                                                                                                                      -        east: {
                                                                                                                                                                      -            el: {type: "bi.label"},
                                                                                                                                                                      -            width: 300,
                                                                                                                                                                      -            right: 20
                                                                                                                                                                      -        },
                                                                                                                                                                      -        center: {el: {type: "bi.label"}}
                                                                                                                                                                      -    }
                                                                                                                                                                      -});
                                                                                                                                                                      -
                                                                                                                                                                      -
                                                                                                                                                                      - - -

                                                                                                                                                                      API

                                                                                                                                                                      -
                                                                                                                                                                      基础属性
                                                                                                                                                                      - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                      参数说明类型可选值默认值
                                                                                                                                                                      items子控件对象objectnorth,east,west,south,center[ ]
                                                                                                                                                                      -
                                                                                                                                                                      - - -
                                                                                                                                                                      - -
                                                                                                                                                                      -
                                                                                                                                                                      -
                                                                                                                                                                      - -

                                                                                                                                                                      results matching ""

                                                                                                                                                                      -
                                                                                                                                                                        - -
                                                                                                                                                                        -
                                                                                                                                                                        - -

                                                                                                                                                                        No results matching ""

                                                                                                                                                                        - -
                                                                                                                                                                        -
                                                                                                                                                                        -
                                                                                                                                                                        - -
                                                                                                                                                                        -
                                                                                                                                                                        - -
                                                                                                                                                                        - - - - -
                                                                                                                                                                        - - -
                                                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/border.md b/docs/_book/core/layout/border.md deleted file mode 100644 index 73ed1973a..000000000 --- a/docs/_book/core/layout/border.md +++ /dev/null @@ -1,54 +0,0 @@ -# bi.border - -#### 上下的高度固定/左右的宽度固定,中间的高度/宽度自适应 - -{% method %} -[source](https://jsfiddle.net/fineui/qtdsdegp/) - -{% common %} -```javascript -BI.createWidget({ - type: 'bi.border', - element: "#wrapper", - items: { - north: { - el: {type: "bi.label"}, - height: 30, - top: 20, - left: 20, - right: 20 - }, - south: { - el: {type: "bi.label"}, - height: 50, - bottom: 20, - left: 20, - right: 20 - }, - west: { - el: {type: "bi.label"}, - width: 200, - left: 20 - }, - east: { - el: {type: "bi.label"}, - width: 300, - right: 20 - }, - center: {el: {type: "bi.label"}} - } -}); - -``` - -{% endmethod %} - - -## API -##### 基础属性 - -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :----- | :----|:---- -| items | 子控件对象 | object | north,east,west,south,center | [ ] | - ---- \ No newline at end of file diff --git a/docs/_book/core/layout/center.html b/docs/_book/core/layout/center.html deleted file mode 100644 index 43d323032..000000000 --- a/docs/_book/core/layout/center.html +++ /dev/null @@ -1,2611 +0,0 @@ - - - - - - - center · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                        -
                                                                                                                                                                        - - - - - - - - -
                                                                                                                                                                        - -
                                                                                                                                                                        - -
                                                                                                                                                                        - - - - - - - - -
                                                                                                                                                                        -
                                                                                                                                                                        - -
                                                                                                                                                                        -
                                                                                                                                                                        - -
                                                                                                                                                                        - -

                                                                                                                                                                        bi.center

                                                                                                                                                                        -

                                                                                                                                                                        水平和垂直方向都居中容器, 非自适应,用于宽度高度固定的面板

                                                                                                                                                                        -
                                                                                                                                                                        
                                                                                                                                                                        -BI.createWidget({
                                                                                                                                                                        -    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"
                                                                                                                                                                        -    }],
                                                                                                                                                                        -    hgap: 20,
                                                                                                                                                                        -    vgap: 20
                                                                                                                                                                        -});
                                                                                                                                                                        -
                                                                                                                                                                        -
                                                                                                                                                                        - - -

                                                                                                                                                                        API

                                                                                                                                                                        -
                                                                                                                                                                        基础属性
                                                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                        参数说明类型可选值默认值
                                                                                                                                                                        hgap效果相当于容器左右padding值number0
                                                                                                                                                                        vgap效果相当于容器上下padding值number0
                                                                                                                                                                        lgap效果相当于容器left-padding值number0
                                                                                                                                                                        rgap效果相当于容器right-padding值number0
                                                                                                                                                                        tgap效果相当于容器top-padding值number0
                                                                                                                                                                        bgap效果相当于容器bottom-padding值number0
                                                                                                                                                                        -
                                                                                                                                                                        - - -
                                                                                                                                                                        - -
                                                                                                                                                                        -
                                                                                                                                                                        -
                                                                                                                                                                        - -

                                                                                                                                                                        results matching ""

                                                                                                                                                                        -
                                                                                                                                                                          - -
                                                                                                                                                                          -
                                                                                                                                                                          - -

                                                                                                                                                                          No results matching ""

                                                                                                                                                                          - -
                                                                                                                                                                          -
                                                                                                                                                                          -
                                                                                                                                                                          - -
                                                                                                                                                                          -
                                                                                                                                                                          - -
                                                                                                                                                                          - - - - -
                                                                                                                                                                          - - -
                                                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/center.md b/docs/_book/core/layout/center.md deleted file mode 100644 index cdce92265..000000000 --- a/docs/_book/core/layout/center.md +++ /dev/null @@ -1,47 +0,0 @@ -# bi.center - -#### 水平和垂直方向都居中容器, 非自适应,用于宽度高度固定的面板 - -{% method %} -[source](https://jsfiddle.net/fineui/8fd2nvkm/) - -{% common %} -```javascript - -BI.createWidget({ - 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" - }], - 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 | - - ---- \ No newline at end of file diff --git a/docs/_book/core/layout/center_adapt.html b/docs/_book/core/layout/center_adapt.html deleted file mode 100644 index 53c51c76a..000000000 --- a/docs/_book/core/layout/center_adapt.html +++ /dev/null @@ -1,2617 +0,0 @@ - - - - - - - center_adapt · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                          -
                                                                                                                                                                          - - - - - - - - -
                                                                                                                                                                          - -
                                                                                                                                                                          - -
                                                                                                                                                                          - - - - - - - - -
                                                                                                                                                                          -
                                                                                                                                                                          - -
                                                                                                                                                                          -
                                                                                                                                                                          - -
                                                                                                                                                                          - -

                                                                                                                                                                          bi.center_adapt

                                                                                                                                                                          -

                                                                                                                                                                          自适应左右垂直居中布局

                                                                                                                                                                          -
                                                                                                                                                                          
                                                                                                                                                                          -BI.createWidget({
                                                                                                                                                                          -    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
                                                                                                                                                                          -    }]
                                                                                                                                                                          -})
                                                                                                                                                                          -
                                                                                                                                                                          -
                                                                                                                                                                          - - -

                                                                                                                                                                          API

                                                                                                                                                                          -
                                                                                                                                                                          基础属性
                                                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                          参数说明类型可选值默认值
                                                                                                                                                                          hgap效果相当于容器左右padding值number0
                                                                                                                                                                          vgap效果相当于容器上下padding值number0
                                                                                                                                                                          lgap效果相当于容器left-padding值number0
                                                                                                                                                                          rgap效果相当于容器right-padding值number0
                                                                                                                                                                          tgap效果相当于容器top-padding值number0
                                                                                                                                                                          bgap效果相当于容器bottom-padding值number0
                                                                                                                                                                          columnSize每列宽度所组成的数组array[ ]
                                                                                                                                                                          -
                                                                                                                                                                          - - -
                                                                                                                                                                          - -
                                                                                                                                                                          -
                                                                                                                                                                          -
                                                                                                                                                                          - -

                                                                                                                                                                          results matching ""

                                                                                                                                                                          -
                                                                                                                                                                            - -
                                                                                                                                                                            -
                                                                                                                                                                            - -

                                                                                                                                                                            No results matching ""

                                                                                                                                                                            - -
                                                                                                                                                                            -
                                                                                                                                                                            -
                                                                                                                                                                            - -
                                                                                                                                                                            -
                                                                                                                                                                            - -
                                                                                                                                                                            - - - - -
                                                                                                                                                                            - - -
                                                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/center_adapt.md b/docs/_book/core/layout/center_adapt.md deleted file mode 100644 index 25a58a328..000000000 --- a/docs/_book/core/layout/center_adapt.md +++ /dev/null @@ -1,47 +0,0 @@ -# bi.center_adapt - -#### 自适应左右垂直居中布局 - -{% method %} -[source](https://jsfiddle.net/fineui/7bsxw7u5/) - -{% common %} -```javascript - -BI.createWidget({ - 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 - }] -}) - - - -``` - -{% 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 | -| columnSize | 每列宽度所组成的数组 | array | — | [ ] | - ---- \ No newline at end of file diff --git a/docs/_book/core/layout/float_center.html b/docs/_book/core/layout/float_center.html deleted file mode 100644 index c724109f9..000000000 --- a/docs/_book/core/layout/float_center.html +++ /dev/null @@ -1,2612 +0,0 @@ - - - - - - - float_center · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                            -
                                                                                                                                                                            - - - - - - - - -
                                                                                                                                                                            - -
                                                                                                                                                                            - -
                                                                                                                                                                            - - - - - - - - -
                                                                                                                                                                            -
                                                                                                                                                                            - -
                                                                                                                                                                            -
                                                                                                                                                                            - -
                                                                                                                                                                            - -

                                                                                                                                                                            bi.float_center

                                                                                                                                                                            -

                                                                                                                                                                            浮动布局实现的居中容器

                                                                                                                                                                            -
                                                                                                                                                                            
                                                                                                                                                                            -BI.createWidget({
                                                                                                                                                                            -    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
                                                                                                                                                                            -});
                                                                                                                                                                            -
                                                                                                                                                                            -
                                                                                                                                                                            - - -

                                                                                                                                                                            API

                                                                                                                                                                            -
                                                                                                                                                                            基础属性
                                                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                            参数说明类型可选值默认值
                                                                                                                                                                            hgap效果相当于容器左右padding值number0
                                                                                                                                                                            vgap效果相当于容器上下padding值number0
                                                                                                                                                                            lgap效果相当于容器left-padding值number0
                                                                                                                                                                            rgap效果相当于容器right-padding值number0
                                                                                                                                                                            tgap效果相当于容器top-padding值number0
                                                                                                                                                                            bgap效果相当于容器bottom-padding值number0
                                                                                                                                                                            -
                                                                                                                                                                            - - -
                                                                                                                                                                            - -
                                                                                                                                                                            -
                                                                                                                                                                            -
                                                                                                                                                                            - -

                                                                                                                                                                            results matching ""

                                                                                                                                                                            -
                                                                                                                                                                              - -
                                                                                                                                                                              -
                                                                                                                                                                              - -

                                                                                                                                                                              No results matching ""

                                                                                                                                                                              - -
                                                                                                                                                                              -
                                                                                                                                                                              -
                                                                                                                                                                              - -
                                                                                                                                                                              -
                                                                                                                                                                              - -
                                                                                                                                                                              - - - - -
                                                                                                                                                                              - - -
                                                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/float_center.md b/docs/_book/core/layout/float_center.md deleted file mode 100644 index d65513fea..000000000 --- a/docs/_book/core/layout/float_center.md +++ /dev/null @@ -1,48 +0,0 @@ -# bi.float_center - -#### 浮动布局实现的居中容器 - -{% method %} -[source](https://jsfiddle.net/fineui/1vgn555m/) - -{% common %} -```javascript - -BI.createWidget({ - 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 -}); - - -``` - -{% 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 | - - ---- \ No newline at end of file diff --git a/docs/_book/core/layout/flow.html b/docs/_book/core/layout/flow.html deleted file mode 100644 index a5db63fa7..000000000 --- a/docs/_book/core/layout/flow.html +++ /dev/null @@ -1,2640 +0,0 @@ - - - - - - - flow · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                              -
                                                                                                                                                                              - - - - - - - - -
                                                                                                                                                                              - -
                                                                                                                                                                              - -
                                                                                                                                                                              - - - - - - - - -
                                                                                                                                                                              -
                                                                                                                                                                              - -
                                                                                                                                                                              -
                                                                                                                                                                              - -
                                                                                                                                                                              - -

                                                                                                                                                                              bi.flow

                                                                                                                                                                              -

                                                                                                                                                                              靠左/右对齐的自由浮动布局

                                                                                                                                                                              -
                                                                                                                                                                              
                                                                                                                                                                              -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
                                                                                                                                                                              -    }]
                                                                                                                                                                              -});
                                                                                                                                                                              -
                                                                                                                                                                              -
                                                                                                                                                                              - - -

                                                                                                                                                                              API

                                                                                                                                                                              -
                                                                                                                                                                              基础属性
                                                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                              参数说明类型可选值默认值
                                                                                                                                                                              hgap效果相当于容器左右padding值number0
                                                                                                                                                                              vgap效果相当于容器上下padding值number0
                                                                                                                                                                              lgap效果相当于容器left-padding值number0
                                                                                                                                                                              rgap效果相当于容器right-padding值number0
                                                                                                                                                                              tgap效果相当于容器top-padding值number0
                                                                                                                                                                              bgap效果相当于容器bottom-padding值number0
                                                                                                                                                                              items子控件数组array
                                                                                                                                                                              -
                                                                                                                                                                              - - -
                                                                                                                                                                              - -
                                                                                                                                                                              -
                                                                                                                                                                              -
                                                                                                                                                                              - -

                                                                                                                                                                              results matching ""

                                                                                                                                                                              -
                                                                                                                                                                                - -
                                                                                                                                                                                -
                                                                                                                                                                                - -

                                                                                                                                                                                No results matching ""

                                                                                                                                                                                - -
                                                                                                                                                                                -
                                                                                                                                                                                -
                                                                                                                                                                                - -
                                                                                                                                                                                -
                                                                                                                                                                                - -
                                                                                                                                                                                - - - - -
                                                                                                                                                                                - - -
                                                                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/flow.md b/docs/_book/core/layout/flow.md deleted file mode 100644 index 88f72ab03..000000000 --- a/docs/_book/core/layout/flow.md +++ /dev/null @@ -1,75 +0,0 @@ -# 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 | — | — | - - - ---- \ No newline at end of file diff --git a/docs/_book/core/layout/grid.html b/docs/_book/core/layout/grid.html deleted file mode 100644 index 000384320..000000000 --- a/docs/_book/core/layout/grid.html +++ /dev/null @@ -1,2612 +0,0 @@ - - - - - - - grid · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                -
                                                                                                                                                                                - - - - - - - - -
                                                                                                                                                                                - -
                                                                                                                                                                                - -
                                                                                                                                                                                - - - - - - - - -
                                                                                                                                                                                -
                                                                                                                                                                                - -
                                                                                                                                                                                -
                                                                                                                                                                                - -
                                                                                                                                                                                - -

                                                                                                                                                                                bi.grid

                                                                                                                                                                                -

                                                                                                                                                                                网格布局

                                                                                                                                                                                -
                                                                                                                                                                                
                                                                                                                                                                                -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"
                                                                                                                                                                                -        }
                                                                                                                                                                                -    }]
                                                                                                                                                                                -});
                                                                                                                                                                                -
                                                                                                                                                                                -
                                                                                                                                                                                - - -

                                                                                                                                                                                API

                                                                                                                                                                                -
                                                                                                                                                                                基础属性
                                                                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                参数说明类型可选值默认值
                                                                                                                                                                                columns列数numbernull
                                                                                                                                                                                rows行数numbernull
                                                                                                                                                                                items子控件数组array[]
                                                                                                                                                                                -
                                                                                                                                                                                - - -
                                                                                                                                                                                - -
                                                                                                                                                                                -
                                                                                                                                                                                -
                                                                                                                                                                                - -

                                                                                                                                                                                results matching ""

                                                                                                                                                                                -
                                                                                                                                                                                  - -
                                                                                                                                                                                  -
                                                                                                                                                                                  - -

                                                                                                                                                                                  No results matching ""

                                                                                                                                                                                  - -
                                                                                                                                                                                  -
                                                                                                                                                                                  -
                                                                                                                                                                                  - -
                                                                                                                                                                                  -
                                                                                                                                                                                  - -
                                                                                                                                                                                  - - - - -
                                                                                                                                                                                  - - -
                                                                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/grid.md b/docs/_book/core/layout/grid.md deleted file mode 100644 index 613e2aed8..000000000 --- a/docs/_book/core/layout/grid.md +++ /dev/null @@ -1,71 +0,0 @@ -# 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 | — | [] | - - - ---- \ No newline at end of file diff --git a/docs/_book/core/layout/horizontal.html b/docs/_book/core/layout/horizontal.html deleted file mode 100644 index 57a4340ed..000000000 --- a/docs/_book/core/layout/horizontal.html +++ /dev/null @@ -1,2632 +0,0 @@ - - - - - - - horizontal · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                  -
                                                                                                                                                                                  - - - - - - - - -
                                                                                                                                                                                  - -
                                                                                                                                                                                  - -
                                                                                                                                                                                  - - - - - - - - -
                                                                                                                                                                                  -
                                                                                                                                                                                  - -
                                                                                                                                                                                  -
                                                                                                                                                                                  - -
                                                                                                                                                                                  - -

                                                                                                                                                                                  bi.horizontal

                                                                                                                                                                                  -

                                                                                                                                                                                  水平流式布局

                                                                                                                                                                                  -
                                                                                                                                                                                  
                                                                                                                                                                                  -BI.createWidget({
                                                                                                                                                                                  -    type: 'bi.horizontal',
                                                                                                                                                                                  -    element: "#wrapper",
                                                                                                                                                                                  -    items: [{
                                                                                                                                                                                  -        type: "bi.text_button",
                                                                                                                                                                                  -        cls: "layout-bg1",
                                                                                                                                                                                  -        text: "这里设置了lgap,rgap,tgap,bgap",
                                                                                                                                                                                  -        height: 30,
                                                                                                                                                                                  -        width: 200
                                                                                                                                                                                  -    }, {
                                                                                                                                                                                  -        type: "bi.text_button",
                                                                                                                                                                                  -        cls: "layout-bg2",
                                                                                                                                                                                  -        text: "这里设置了lgap,rgap,tgap,bgap",
                                                                                                                                                                                  -        height: 30,
                                                                                                                                                                                  -        width: 200
                                                                                                                                                                                  -    }]
                                                                                                                                                                                  -});
                                                                                                                                                                                  -
                                                                                                                                                                                  -
                                                                                                                                                                                  - - -

                                                                                                                                                                                  API

                                                                                                                                                                                  -
                                                                                                                                                                                  基础属性
                                                                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                  参数说明类型可选值默认值
                                                                                                                                                                                  hgap效果相当于容器左右padding值number0
                                                                                                                                                                                  vgap效果相当于容器上下padding值number0
                                                                                                                                                                                  lgap效果相当于容器left-padding值number0
                                                                                                                                                                                  rgap效果相当于容器right-padding值number0
                                                                                                                                                                                  tgap效果相当于容器top-padding值number0
                                                                                                                                                                                  bgap效果相当于容器bottom-padding值number0
                                                                                                                                                                                  columnSize每列宽度所组成的数组array[ ]
                                                                                                                                                                                  verticalAlign元素的垂直对齐方式string参考相关css属性"middle"
                                                                                                                                                                                  scrollx设置水平方向是否有滚动条booleantrue,falsetrue
                                                                                                                                                                                  -
                                                                                                                                                                                  - - -
                                                                                                                                                                                  - -
                                                                                                                                                                                  -
                                                                                                                                                                                  -
                                                                                                                                                                                  - -

                                                                                                                                                                                  results matching ""

                                                                                                                                                                                  -
                                                                                                                                                                                    - -
                                                                                                                                                                                    -
                                                                                                                                                                                    - -

                                                                                                                                                                                    No results matching ""

                                                                                                                                                                                    - -
                                                                                                                                                                                    -
                                                                                                                                                                                    -
                                                                                                                                                                                    - -
                                                                                                                                                                                    -
                                                                                                                                                                                    - -
                                                                                                                                                                                    - - - - -
                                                                                                                                                                                    - - -
                                                                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/horizontal.md b/docs/_book/core/layout/horizontal.md deleted file mode 100644 index 7be0637cc..000000000 --- a/docs/_book/core/layout/horizontal.md +++ /dev/null @@ -1,51 +0,0 @@ -# bi.horizontal - -#### 水平流式布局 - -{% method %} -[source](https://jsfiddle.net/fineui/oj7y7q3o/) - -{% common %} -```javascript - -BI.createWidget({ - type: 'bi.horizontal', - element: "#wrapper", - items: [{ - type: "bi.text_button", - cls: "layout-bg1", - text: "这里设置了lgap,rgap,tgap,bgap", - height: 30, - width: 200 - }, { - type: "bi.text_button", - cls: "layout-bg2", - text: "这里设置了lgap,rgap,tgap,bgap", - height: 30, - width: 200 - }] -}); - - - -``` - -{% 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 | -| columnSize | 每列宽度所组成的数组 | array | — | [ ] | -| verticalAlign | 元素的垂直对齐方式 | string | 参考相关css属性 | "middle" | -| scrollx | 设置水平方向是否有滚动条 | boolean | true,false | true | - ---- \ No newline at end of file diff --git a/docs/_book/core/layout/horizontal_adapt.html b/docs/_book/core/layout/horizontal_adapt.html deleted file mode 100644 index faa3c76b9..000000000 --- a/docs/_book/core/layout/horizontal_adapt.html +++ /dev/null @@ -1,2626 +0,0 @@ - - - - - - - horizontal_adapt · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                    -
                                                                                                                                                                                    - - - - - - - - -
                                                                                                                                                                                    - -
                                                                                                                                                                                    - -
                                                                                                                                                                                    - - - - - - - - -
                                                                                                                                                                                    -
                                                                                                                                                                                    - -
                                                                                                                                                                                    -
                                                                                                                                                                                    - -
                                                                                                                                                                                    - -

                                                                                                                                                                                    bi.horizontal_adapt

                                                                                                                                                                                    -

                                                                                                                                                                                    自适应左右居中布局

                                                                                                                                                                                    -
                                                                                                                                                                                    
                                                                                                                                                                                    -BI.createWidget({
                                                                                                                                                                                    -    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
                                                                                                                                                                                    -    }]
                                                                                                                                                                                    -})
                                                                                                                                                                                    -
                                                                                                                                                                                    -
                                                                                                                                                                                    - - -

                                                                                                                                                                                    API

                                                                                                                                                                                    -
                                                                                                                                                                                    基础属性
                                                                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                    参数说明类型可选值默认值
                                                                                                                                                                                    hgap效果相当于容器左右padding值number0
                                                                                                                                                                                    vgap效果相当于容器上下padding值number0
                                                                                                                                                                                    lgap效果相当于容器left-padding值number0
                                                                                                                                                                                    rgap效果相当于容器right-padding值number0
                                                                                                                                                                                    tgap效果相当于容器top-padding值number0
                                                                                                                                                                                    bgap效果相当于容器bottom-padding值number0
                                                                                                                                                                                    columnSize每列宽度所组成的数组array[ ]
                                                                                                                                                                                    verticalAlign元素的垂直对齐方式const参考相关css属性BI.VerticalAlign.Middle
                                                                                                                                                                                    -
                                                                                                                                                                                    - - -
                                                                                                                                                                                    - -
                                                                                                                                                                                    -
                                                                                                                                                                                    -
                                                                                                                                                                                    - -

                                                                                                                                                                                    results matching ""

                                                                                                                                                                                    -
                                                                                                                                                                                      - -
                                                                                                                                                                                      -
                                                                                                                                                                                      - -

                                                                                                                                                                                      No results matching ""

                                                                                                                                                                                      - -
                                                                                                                                                                                      -
                                                                                                                                                                                      -
                                                                                                                                                                                      - -
                                                                                                                                                                                      -
                                                                                                                                                                                      - -
                                                                                                                                                                                      - - - - -
                                                                                                                                                                                      - - -
                                                                                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/horizontal_adapt.md b/docs/_book/core/layout/horizontal_adapt.md deleted file mode 100644 index 33e41c616..000000000 --- a/docs/_book/core/layout/horizontal_adapt.md +++ /dev/null @@ -1,52 +0,0 @@ -# bi.horizontal_adapt - - -#### 自适应左右居中布局 - -{% method %} -[source](https://jsfiddle.net/fineui/Lgobog42/) - -{% common %} -```javascript - -BI.createWidget({ - 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 - }] -}) - - -``` - -{% 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 | -| columnSize | 每列宽度所组成的数组 | array | — | [ ] | -| verticalAlign | 元素的垂直对齐方式 | const | 参考相关css属性 | BI.VerticalAlign.Middle | - - ---- - diff --git a/docs/_book/core/layout/horizontal_auto.html b/docs/_book/core/layout/horizontal_auto.html deleted file mode 100644 index e9f3a24f2..000000000 --- a/docs/_book/core/layout/horizontal_auto.html +++ /dev/null @@ -1,2612 +0,0 @@ - - - - - - - horizontal_auto · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                      -
                                                                                                                                                                                      - - - - - - - - -
                                                                                                                                                                                      - -
                                                                                                                                                                                      - -
                                                                                                                                                                                      - - - - - - - - -
                                                                                                                                                                                      -
                                                                                                                                                                                      - -
                                                                                                                                                                                      -
                                                                                                                                                                                      - -
                                                                                                                                                                                      - -

                                                                                                                                                                                      bi.horizontal_auto

                                                                                                                                                                                      -

                                                                                                                                                                                      水平方向居中自适应容器

                                                                                                                                                                                      -
                                                                                                                                                                                      
                                                                                                                                                                                      -BI.createWidget({
                                                                                                                                                                                      -    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
                                                                                                                                                                                      -    }]
                                                                                                                                                                                      -})
                                                                                                                                                                                      -
                                                                                                                                                                                      -
                                                                                                                                                                                      - - -

                                                                                                                                                                                      API

                                                                                                                                                                                      -
                                                                                                                                                                                      基础属性
                                                                                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                      参数说明类型可选值默认值
                                                                                                                                                                                      hgap效果相当于容器左右padding值number0
                                                                                                                                                                                      vgap效果相当于容器上下padding值number0
                                                                                                                                                                                      lgap效果相当于容器left-padding值number0
                                                                                                                                                                                      rgap效果相当于容器right-padding值number0
                                                                                                                                                                                      tgap效果相当于容器top-padding值number0
                                                                                                                                                                                      bgap效果相当于容器bottom-padding值number0
                                                                                                                                                                                      -
                                                                                                                                                                                      - - -
                                                                                                                                                                                      - -
                                                                                                                                                                                      -
                                                                                                                                                                                      -
                                                                                                                                                                                      - -

                                                                                                                                                                                      results matching ""

                                                                                                                                                                                      -
                                                                                                                                                                                        - -
                                                                                                                                                                                        -
                                                                                                                                                                                        - -

                                                                                                                                                                                        No results matching ""

                                                                                                                                                                                        - -
                                                                                                                                                                                        -
                                                                                                                                                                                        -
                                                                                                                                                                                        - -
                                                                                                                                                                                        -
                                                                                                                                                                                        - -
                                                                                                                                                                                        - - - - -
                                                                                                                                                                                        - - -
                                                                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/horizontal_auto.md b/docs/_book/core/layout/horizontal_auto.md deleted file mode 100644 index 91ee4f730..000000000 --- a/docs/_book/core/layout/horizontal_auto.md +++ /dev/null @@ -1,49 +0,0 @@ -# bi.horizontal_auto - -#### 水平方向居中自适应容器 - -{% method %} -[source](https://jsfiddle.net/fineui/ej2j8umg/) - -{% common %} -```javascript - -BI.createWidget({ - 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 - }] -}) - - -``` - -{% 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 | - - - ---- \ No newline at end of file diff --git a/docs/_book/core/layout/horizontal_float.html b/docs/_book/core/layout/horizontal_float.html deleted file mode 100644 index 3a83334fb..000000000 --- a/docs/_book/core/layout/horizontal_float.html +++ /dev/null @@ -1,2613 +0,0 @@ - - - - - - - horizontal_float · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                        -
                                                                                                                                                                                        - - - - - - - - -
                                                                                                                                                                                        - -
                                                                                                                                                                                        - -
                                                                                                                                                                                        - - - - - - - - -
                                                                                                                                                                                        -
                                                                                                                                                                                        - -
                                                                                                                                                                                        -
                                                                                                                                                                                        - -
                                                                                                                                                                                        - -

                                                                                                                                                                                        bi.horizontal_float

                                                                                                                                                                                        -

                                                                                                                                                                                        浮动的水平居中布局

                                                                                                                                                                                        -
                                                                                                                                                                                        
                                                                                                                                                                                        -BI.createWidget({
                                                                                                                                                                                        -    type: "bi.horizontal_float",
                                                                                                                                                                                        -    element: "#wrapper",
                                                                                                                                                                                        -    vgap: 10,
                                                                                                                                                                                        -    items: [{
                                                                                                                                                                                        -        type: "bi.label",
                                                                                                                                                                                        -        text: "Horizontal Float左右自适应",
                                                                                                                                                                                        -        cls: "layout-bg1",
                                                                                                                                                                                        -        width: 200,
                                                                                                                                                                                        -        height:30
                                                                                                                                                                                        -    }]
                                                                                                                                                                                        -})
                                                                                                                                                                                        -
                                                                                                                                                                                        -
                                                                                                                                                                                        - - -

                                                                                                                                                                                        API

                                                                                                                                                                                        -
                                                                                                                                                                                        基础属性
                                                                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                        参数说明类型可选值默认值
                                                                                                                                                                                        hgap效果相当于容器左右padding值number0
                                                                                                                                                                                        vgap效果相当于容器上下padding值number0
                                                                                                                                                                                        lgap效果相当于容器left-padding值number0
                                                                                                                                                                                        rgap效果相当于容器right-padding值number0
                                                                                                                                                                                        tgap效果相当于容器top-padding值number0
                                                                                                                                                                                        bgap效果相当于容器bottom-padding值number0
                                                                                                                                                                                        items子控件数组array[ ]
                                                                                                                                                                                        -
                                                                                                                                                                                        - - -
                                                                                                                                                                                        - -
                                                                                                                                                                                        -
                                                                                                                                                                                        -
                                                                                                                                                                                        - -

                                                                                                                                                                                        results matching ""

                                                                                                                                                                                        -
                                                                                                                                                                                          - -
                                                                                                                                                                                          -
                                                                                                                                                                                          - -

                                                                                                                                                                                          No results matching ""

                                                                                                                                                                                          - -
                                                                                                                                                                                          -
                                                                                                                                                                                          -
                                                                                                                                                                                          - -
                                                                                                                                                                                          -
                                                                                                                                                                                          - -
                                                                                                                                                                                          - - - - -
                                                                                                                                                                                          - - -
                                                                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/horizontal_float.md b/docs/_book/core/layout/horizontal_float.md deleted file mode 100644 index 2ec26e17c..000000000 --- a/docs/_book/core/layout/horizontal_float.md +++ /dev/null @@ -1,44 +0,0 @@ -# bi.horizontal_float - -#### 浮动的水平居中布局 - -{% method %} -[source](https://jsfiddle.net/fineui/91rd0zpe/) - -{% common %} -```javascript - -BI.createWidget({ - type: "bi.horizontal_float", - element: "#wrapper", - vgap: 10, - items: [{ - type: "bi.label", - text: "Horizontal Float左右自适应", - cls: "layout-bg1", - 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 | — |[ ] | - - ---- \ No newline at end of file diff --git a/docs/_book/core/layout/htape.html b/docs/_book/core/layout/htape.html deleted file mode 100644 index 11c7b1ca9..000000000 --- a/docs/_book/core/layout/htape.html +++ /dev/null @@ -1,2629 +0,0 @@ - - - - - - - htape · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                          -
                                                                                                                                                                                          - - - - - - - - -
                                                                                                                                                                                          - -
                                                                                                                                                                                          - -
                                                                                                                                                                                          - - - - - - - - -
                                                                                                                                                                                          -
                                                                                                                                                                                          - -
                                                                                                                                                                                          -
                                                                                                                                                                                          - -
                                                                                                                                                                                          - -

                                                                                                                                                                                          bi.htape

                                                                                                                                                                                          -

                                                                                                                                                                                          水平tape布局,两列定宽,一列自适应

                                                                                                                                                                                          -
                                                                                                                                                                                          
                                                                                                                                                                                          -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"
                                                                                                                                                                                          -      }
                                                                                                                                                                                          -    }
                                                                                                                                                                                          -  ]
                                                                                                                                                                                          -});
                                                                                                                                                                                          -
                                                                                                                                                                                          -
                                                                                                                                                                                          - - -

                                                                                                                                                                                          API

                                                                                                                                                                                          -
                                                                                                                                                                                          基础属性
                                                                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                          参数说明类型可选值默认值
                                                                                                                                                                                          hgap效果相当于容器左右padding值number0
                                                                                                                                                                                          vgap效果相当于容器上下padding值number0
                                                                                                                                                                                          lgap效果相当于容器left-padding值number0
                                                                                                                                                                                          rgap效果相当于容器right-padding值number0
                                                                                                                                                                                          tgap效果相当于容器top-padding值number0
                                                                                                                                                                                          bgap效果相当于容器bottom-padding值number0
                                                                                                                                                                                          items子控件数组array[{width: 100,el: {type: 'bi.button', text: 'button1'}},{width: 'fill',el: {type: 'bi.button', text: 'button2'}},{width: 200,el: {type: 'bi.button', text: 'button3'}}]
                                                                                                                                                                                          -
                                                                                                                                                                                          - - -
                                                                                                                                                                                          - -
                                                                                                                                                                                          -
                                                                                                                                                                                          -
                                                                                                                                                                                          - -

                                                                                                                                                                                          results matching ""

                                                                                                                                                                                          -
                                                                                                                                                                                            - -
                                                                                                                                                                                            -
                                                                                                                                                                                            - -

                                                                                                                                                                                            No results matching ""

                                                                                                                                                                                            - -
                                                                                                                                                                                            -
                                                                                                                                                                                            -
                                                                                                                                                                                            - -
                                                                                                                                                                                            -
                                                                                                                                                                                            - -
                                                                                                                                                                                            - - - - -
                                                                                                                                                                                            - - -
                                                                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/htape.md b/docs/_book/core/layout/htape.md deleted file mode 100644 index 166da0a9f..000000000 --- a/docs/_book/core/layout/htape.md +++ /dev/null @@ -1,64 +0,0 @@ -# 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 | — | [{width: 100,el: {type: 'bi.button', text: 'button1'}},{width: 'fill',el: {type: 'bi.button', text: 'button2'}},{width: 200,el: {type: 'bi.button', text: 'button3'}}] | - - - ---- \ No newline at end of file diff --git a/docs/_book/core/layout/left_right_vertical_adapt.html b/docs/_book/core/layout/left_right_vertical_adapt.html deleted file mode 100644 index c57fe5627..000000000 --- a/docs/_book/core/layout/left_right_vertical_adapt.html +++ /dev/null @@ -1,2623 +0,0 @@ - - - - - - - left_right_vertical_adapt · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                            -
                                                                                                                                                                                            - - - - - - - - -
                                                                                                                                                                                            - -
                                                                                                                                                                                            - -
                                                                                                                                                                                            - - - - - - - - -
                                                                                                                                                                                            -
                                                                                                                                                                                            - -
                                                                                                                                                                                            -
                                                                                                                                                                                            - -
                                                                                                                                                                                            - -

                                                                                                                                                                                            bi.left_right_vertical_adapt

                                                                                                                                                                                            -

                                                                                                                                                                                            左右分离,垂直方向居中容器

                                                                                                                                                                                            -
                                                                                                                                                                                            
                                                                                                                                                                                            -BI.createWidget({
                                                                                                                                                                                            -    type: 'bi.left_right_vertical_adapt',
                                                                                                                                                                                            -    element: "#wrapper",
                                                                                                                                                                                            -    lhgap: 10,
                                                                                                                                                                                            -    rhgap: 10,
                                                                                                                                                                                            -    items: {
                                                                                                                                                                                            -        left: [{
                                                                                                                                                                                            -            type: "bi.label",
                                                                                                                                                                                            -            text: "左边的垂直居中",
                                                                                                                                                                                            -            cls: "layout-bg1",
                                                                                                                                                                                            -            width: 100,
                                                                                                                                                                                            -            height: 30
                                                                                                                                                                                            -        }],
                                                                                                                                                                                            -        right: [{
                                                                                                                                                                                            -            type: "bi.label",
                                                                                                                                                                                            -            text: "右边的垂直居中",
                                                                                                                                                                                            -            cls: "layout-bg1",
                                                                                                                                                                                            -            width: 100,
                                                                                                                                                                                            -            height: 30
                                                                                                                                                                                            -        }]
                                                                                                                                                                                            -    }
                                                                                                                                                                                            -});
                                                                                                                                                                                            -
                                                                                                                                                                                            -
                                                                                                                                                                                            - - -

                                                                                                                                                                                            API

                                                                                                                                                                                            -
                                                                                                                                                                                            基础属性
                                                                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                            参数说明类型可选值默认值
                                                                                                                                                                                            lhgap左边容器左右padding值number0
                                                                                                                                                                                            lrgap左边容器right-padding值number0
                                                                                                                                                                                            llgap左边容器left-padding值number0
                                                                                                                                                                                            rhgap右边容器左右padding值number0
                                                                                                                                                                                            rrgap右边容器right-padding值number0
                                                                                                                                                                                            rhgap右边容器left-padding值number0
                                                                                                                                                                                            items子控件数组array[ ]
                                                                                                                                                                                            -
                                                                                                                                                                                            - - -
                                                                                                                                                                                            - -
                                                                                                                                                                                            -
                                                                                                                                                                                            -
                                                                                                                                                                                            - -

                                                                                                                                                                                            results matching ""

                                                                                                                                                                                            -
                                                                                                                                                                                              - -
                                                                                                                                                                                              -
                                                                                                                                                                                              - -

                                                                                                                                                                                              No results matching ""

                                                                                                                                                                                              - -
                                                                                                                                                                                              -
                                                                                                                                                                                              -
                                                                                                                                                                                              - -
                                                                                                                                                                                              -
                                                                                                                                                                                              - -
                                                                                                                                                                                              - - - - -
                                                                                                                                                                                              - - -
                                                                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/left_right_vertical_adapt.md b/docs/_book/core/layout/left_right_vertical_adapt.md deleted file mode 100644 index 8c101a587..000000000 --- a/docs/_book/core/layout/left_right_vertical_adapt.md +++ /dev/null @@ -1,55 +0,0 @@ - -# bi.left_right_vertical_adapt - -#### 左右分离,垂直方向居中容器 - -{% method %} -[source](https://jsfiddle.net/fineui/2udhep9z/) - -{% common %} -```javascript - -BI.createWidget({ - type: 'bi.left_right_vertical_adapt', - element: "#wrapper", - lhgap: 10, - rhgap: 10, - items: { - left: [{ - type: "bi.label", - text: "左边的垂直居中", - cls: "layout-bg1", - width: 100, - height: 30 - }], - right: [{ - type: "bi.label", - text: "右边的垂直居中", - cls: "layout-bg1", - width: 100, - height: 30 - }] - } -}); - - - -``` - -{% endmethod %} - - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :----- | :----|:---- -| lhgap | 左边容器左右padding值 | number | — | 0 | -| lrgap | 左边容器right-padding值 | number | — | 0 | -| llgap | 左边容器left-padding值 | number | — | 0 | -| rhgap | 右边容器左右padding值 | number | — | 0 | -| rrgap | 右边容器right-padding值 | number | — | 0 | -| rhgap | 右边容器left-padding值 | number | — | 0 | -| items | 子控件数组 | array | — | [ ] | - - ---- \ No newline at end of file diff --git a/docs/_book/core/layout/table.html b/docs/_book/core/layout/table.html deleted file mode 100644 index eff323831..000000000 --- a/docs/_book/core/layout/table.html +++ /dev/null @@ -1,2614 +0,0 @@ - - - - - - - table · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                              -
                                                                                                                                                                                              - - - - - - - - -
                                                                                                                                                                                              - -
                                                                                                                                                                                              - -
                                                                                                                                                                                              - - - - - - - - -
                                                                                                                                                                                              -
                                                                                                                                                                                              - -
                                                                                                                                                                                              -
                                                                                                                                                                                              - -
                                                                                                                                                                                              - -

                                                                                                                                                                                              bi.table

                                                                                                                                                                                              -

                                                                                                                                                                                              table作为一个列表集合存在,继承BI.Widget

                                                                                                                                                                                              -
                                                                                                                                                                                              BI.createWidget({
                                                                                                                                                                                              -  element: "body",
                                                                                                                                                                                              -  type: "bi.table",
                                                                                                                                                                                              -  items: [],
                                                                                                                                                                                              -  columnSize: [100, "fill", 200],
                                                                                                                                                                                              -  rowSize: [10, 30, 50, 70, 90, 110, 130],
                                                                                                                                                                                              -  hgap: 20,
                                                                                                                                                                                              -  vgap: 10
                                                                                                                                                                                              -});
                                                                                                                                                                                              -
                                                                                                                                                                                              -
                                                                                                                                                                                              - -

                                                                                                                                                                                              参数设置

                                                                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                              参数说明类型默认值
                                                                                                                                                                                              scrolly是否出现滚动条booleantrue
                                                                                                                                                                                              columnSize列项宽度array/number[200, 200, 'fill']
                                                                                                                                                                                              rowSize行高array/number30
                                                                                                                                                                                              hgap内部元素间纵向距离number0
                                                                                                                                                                                              vgap内部元素间横向距离number0
                                                                                                                                                                                              items子项array[{width: 100,el: {type: 'bi.button', text: 'button1'}},{width: 'fill',el: {type: 'bi.button', text: 'button2'}},{width: 200,el: {type: 'bi.button', text: 'button3'}}]
                                                                                                                                                                                              -

                                                                                                                                                                                              方法

                                                                                                                                                                                              - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                              方法名说明用法
                                                                                                                                                                                              addItem增加内容addItem(arr)
                                                                                                                                                                                              populate更换新的内容poplulate(items)
                                                                                                                                                                                              - - -
                                                                                                                                                                                              - -
                                                                                                                                                                                              -
                                                                                                                                                                                              -
                                                                                                                                                                                              - -

                                                                                                                                                                                              results matching ""

                                                                                                                                                                                              -
                                                                                                                                                                                                - -
                                                                                                                                                                                                -
                                                                                                                                                                                                - -

                                                                                                                                                                                                No results matching ""

                                                                                                                                                                                                - -
                                                                                                                                                                                                -
                                                                                                                                                                                                -
                                                                                                                                                                                                - -
                                                                                                                                                                                                -
                                                                                                                                                                                                - -
                                                                                                                                                                                                - - - - -
                                                                                                                                                                                                - - -
                                                                                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/table.md b/docs/_book/core/layout/table.md deleted file mode 100644 index c8bcb316f..000000000 --- a/docs/_book/core/layout/table.md +++ /dev/null @@ -1,37 +0,0 @@ -# bi.table - -### table作为一个列表集合存在,继承BI.Widget -{% method %} -[source](https://jsfiddle.net/fineui/8t2en619/) - -{% common %} -```javascript -BI.createWidget({ - element: "body", - type: "bi.table", - items: [], - columnSize: [100, "fill", 200], - rowSize: [10, 30, 50, 70, 90, 110, 130], - hgap: 20, - vgap: 10 -}); -``` - -{% endmethod %} - -## 参数设置 -| 参数 | 说明 | 类型 | 默认值 | -| ---------- | --------- | ------------ | ---------------------------------------- | -| scrolly | 是否出现滚动条 | boolean | true | -| columnSize | 列项宽度 | array/number | [200, 200, 'fill'] | -| rowSize | 行高 | array/number | 30 | -| hgap | 内部元素间纵向距离 | number | 0 | -| vgap | 内部元素间横向距离 | number | 0 | -| items | 子项 | array | [{width: 100,el: {type: 'bi.button', text: 'button1'}},{width: 'fill',el: {type: 'bi.button', text: 'button2'}},{width: 200,el: {type: 'bi.button', text: 'button3'}}] | - -## 方法 -| 方法名 | 说明 | 用法 | -| :------- | ------ | ---------------- | -| addItem | 增加内容 | addItem(arr) | -| populate | 更换新的内容 | poplulate(items) | - diff --git a/docs/_book/core/layout/td.html b/docs/_book/core/layout/td.html deleted file mode 100644 index 9c6d0c012..000000000 --- a/docs/_book/core/layout/td.html +++ /dev/null @@ -1,2599 +0,0 @@ - - - - - - - td · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                -
                                                                                                                                                                                                - - - - - - - - -
                                                                                                                                                                                                - -
                                                                                                                                                                                                - -
                                                                                                                                                                                                - - - - - - - - -
                                                                                                                                                                                                -
                                                                                                                                                                                                - -
                                                                                                                                                                                                -
                                                                                                                                                                                                - -
                                                                                                                                                                                                - -

                                                                                                                                                                                                bi.td

                                                                                                                                                                                                -

                                                                                                                                                                                                单元格控件,继承BI.Layout

                                                                                                                                                                                                -
                                                                                                                                                                                                BI.createWidget({
                                                                                                                                                                                                -  type: "bi.td",
                                                                                                                                                                                                -  element: 'body',
                                                                                                                                                                                                -  columnSize: [20, 20, 'fill'],
                                                                                                                                                                                                -  items: []
                                                                                                                                                                                                -});
                                                                                                                                                                                                -
                                                                                                                                                                                                -
                                                                                                                                                                                                - - - -

                                                                                                                                                                                                参数

                                                                                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                参数说明类型默认值
                                                                                                                                                                                                columnSize列宽array[200, 200, 200]
                                                                                                                                                                                                hgap纵向间隙number0
                                                                                                                                                                                                vgap横向间隙number0
                                                                                                                                                                                                items内容项array[[{el: {text: 'label1'}},{ el: {text: 'label2'},{ el: {text: 'label3'}
                                                                                                                                                                                                -

                                                                                                                                                                                                方法

                                                                                                                                                                                                - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                方法名说明用法
                                                                                                                                                                                                addItem增加内容addItem(arr)
                                                                                                                                                                                                populate更换新的内容poplulate(items)
                                                                                                                                                                                                - - -
                                                                                                                                                                                                - -
                                                                                                                                                                                                -
                                                                                                                                                                                                -
                                                                                                                                                                                                - -

                                                                                                                                                                                                results matching ""

                                                                                                                                                                                                -
                                                                                                                                                                                                  - -
                                                                                                                                                                                                  -
                                                                                                                                                                                                  - -

                                                                                                                                                                                                  No results matching ""

                                                                                                                                                                                                  - -
                                                                                                                                                                                                  -
                                                                                                                                                                                                  -
                                                                                                                                                                                                  - -
                                                                                                                                                                                                  -
                                                                                                                                                                                                  - -
                                                                                                                                                                                                  - - - - -
                                                                                                                                                                                                  - - -
                                                                                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/td.md b/docs/_book/core/layout/td.md deleted file mode 100644 index 53f047f5d..000000000 --- a/docs/_book/core/layout/td.md +++ /dev/null @@ -1,38 +0,0 @@ -# bi.td - -### 单元格控件,继承BI.Layout - -{% method %} -[source](https://jsfiddle.net/fineui/v4jrz6a3/) - -{% common %} -```javascript -BI.createWidget({ - type: "bi.td", - element: 'body', - columnSize: [20, 20, 'fill'], - items: [] -}); -``` - -{% endmethod %} - - - -##参数 - -| 参数 | 说明 | 类型 | 默认值 | -| ---------- | ---- | ------ | ---------------------------------------- | -| columnSize | 列宽 | array | [200, 200, 200] | -| hgap | 纵向间隙 | number | 0 | -| vgap | 横向间隙 | number | 0 | -| items | 内容项 | array | [[{el: {text: 'label1'}},{ el: {text: 'label2'},{ el: {text: 'label3'} | - - -## 方法 - -| 方法名 | 说明 | 用法 | -| -------- | ------ | ---------------- | -| addItem | 增加内容 | addItem(arr) | -| populate | 更换新的内容 | poplulate(items) | - diff --git a/docs/_book/core/layout/vertical.html b/docs/_book/core/layout/vertical.html deleted file mode 100644 index f8d478c70..000000000 --- a/docs/_book/core/layout/vertical.html +++ /dev/null @@ -1,2614 +0,0 @@ - - - - - - - vertical · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                  -
                                                                                                                                                                                                  - - - - - - - - -
                                                                                                                                                                                                  - -
                                                                                                                                                                                                  - -
                                                                                                                                                                                                  - - - - - - - - -
                                                                                                                                                                                                  -
                                                                                                                                                                                                  - -
                                                                                                                                                                                                  -
                                                                                                                                                                                                  - -
                                                                                                                                                                                                  - -

                                                                                                                                                                                                  bi.vertical

                                                                                                                                                                                                  -

                                                                                                                                                                                                  垂直流式布局

                                                                                                                                                                                                  -
                                                                                                                                                                                                  
                                                                                                                                                                                                  -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
                                                                                                                                                                                                  -    }]
                                                                                                                                                                                                  -});
                                                                                                                                                                                                  -
                                                                                                                                                                                                  -
                                                                                                                                                                                                  - - -

                                                                                                                                                                                                  API

                                                                                                                                                                                                  -
                                                                                                                                                                                                  基础属性
                                                                                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                  参数说明类型可选值默认值
                                                                                                                                                                                                  hgap效果相当于容器左右padding值number0
                                                                                                                                                                                                  vgap效果相当于容器上下padding值number0
                                                                                                                                                                                                  lgap效果相当于容器left-padding值number0
                                                                                                                                                                                                  rgap效果相当于容器right-padding值number0
                                                                                                                                                                                                  tgap效果相当于容器top-padding值number0
                                                                                                                                                                                                  bgap效果相当于容器bottom-padding值number0
                                                                                                                                                                                                  scrolly设置垂直方向是否有滚动条booleantrue,falsetrue
                                                                                                                                                                                                  -
                                                                                                                                                                                                  - - -
                                                                                                                                                                                                  - -
                                                                                                                                                                                                  -
                                                                                                                                                                                                  -
                                                                                                                                                                                                  - -

                                                                                                                                                                                                  results matching ""

                                                                                                                                                                                                  -
                                                                                                                                                                                                    - -
                                                                                                                                                                                                    -
                                                                                                                                                                                                    - -

                                                                                                                                                                                                    No results matching ""

                                                                                                                                                                                                    - -
                                                                                                                                                                                                    -
                                                                                                                                                                                                    -
                                                                                                                                                                                                    - -
                                                                                                                                                                                                    -
                                                                                                                                                                                                    - -
                                                                                                                                                                                                    - - - - -
                                                                                                                                                                                                    - - -
                                                                                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/vertical.md b/docs/_book/core/layout/vertical.md deleted file mode 100644 index a85b8b942..000000000 --- a/docs/_book/core/layout/vertical.md +++ /dev/null @@ -1,46 +0,0 @@ -# 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 | -| scrolly | 设置垂直方向是否有滚动条 | boolean | true,false | true | - ---- \ No newline at end of file diff --git a/docs/_book/core/layout/vertical_adapt.html b/docs/_book/core/layout/vertical_adapt.html deleted file mode 100644 index 4c2bbab5c..000000000 --- a/docs/_book/core/layout/vertical_adapt.html +++ /dev/null @@ -1,2619 +0,0 @@ - - - - - - - vertical_adapt · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                    -
                                                                                                                                                                                                    - - - - - - - - -
                                                                                                                                                                                                    - -
                                                                                                                                                                                                    - -
                                                                                                                                                                                                    - - - - - - - - -
                                                                                                                                                                                                    -
                                                                                                                                                                                                    - -
                                                                                                                                                                                                    -
                                                                                                                                                                                                    - -
                                                                                                                                                                                                    - -

                                                                                                                                                                                                    bi.vertical_adapt

                                                                                                                                                                                                    -

                                                                                                                                                                                                    自适应垂直居中布局

                                                                                                                                                                                                    -
                                                                                                                                                                                                    
                                                                                                                                                                                                    -BI.createWidget({
                                                                                                                                                                                                    -    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
                                                                                                                                                                                                    -    }]
                                                                                                                                                                                                    -})
                                                                                                                                                                                                    -
                                                                                                                                                                                                    -
                                                                                                                                                                                                    - - -

                                                                                                                                                                                                    API

                                                                                                                                                                                                    -
                                                                                                                                                                                                    基础属性
                                                                                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                    参数说明类型可选值默认值
                                                                                                                                                                                                    hgap效果相当于容器左右padding值number0
                                                                                                                                                                                                    vgap效果相当于容器上下padding值number0
                                                                                                                                                                                                    lgap效果相当于容器left-padding值number0
                                                                                                                                                                                                    rgap效果相当于容器right-padding值number0
                                                                                                                                                                                                    tgap效果相当于容器top-padding值number0
                                                                                                                                                                                                    bgap效果相当于容器bottom-padding值number0
                                                                                                                                                                                                    columnSize每列宽度所组成的数组array[ ]
                                                                                                                                                                                                    -
                                                                                                                                                                                                    - - -
                                                                                                                                                                                                    - -
                                                                                                                                                                                                    -
                                                                                                                                                                                                    -
                                                                                                                                                                                                    - -

                                                                                                                                                                                                    results matching ""

                                                                                                                                                                                                    -
                                                                                                                                                                                                      - -
                                                                                                                                                                                                      -
                                                                                                                                                                                                      - -

                                                                                                                                                                                                      No results matching ""

                                                                                                                                                                                                      - -
                                                                                                                                                                                                      -
                                                                                                                                                                                                      -
                                                                                                                                                                                                      - -
                                                                                                                                                                                                      -
                                                                                                                                                                                                      - -
                                                                                                                                                                                                      - - - - -
                                                                                                                                                                                                      - - -
                                                                                                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/vertical_adapt.md b/docs/_book/core/layout/vertical_adapt.md deleted file mode 100644 index f3ea0a336..000000000 --- a/docs/_book/core/layout/vertical_adapt.md +++ /dev/null @@ -1,49 +0,0 @@ -# bi.vertical_adapt - -#### 自适应垂直居中布局 - -{% method %} -[source](https://jsfiddle.net/fineui/7t1bsfy0/) - -{% common %} -```javascript - -BI.createWidget({ - 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 - }] -}) - - - -``` - -{% 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 | -| columnSize | 每列宽度所组成的数组 | array | — | [ ] | - ---- \ No newline at end of file diff --git a/docs/_book/core/layout/vtape.html b/docs/_book/core/layout/vtape.html deleted file mode 100644 index c4d0ed9ee..000000000 --- a/docs/_book/core/layout/vtape.html +++ /dev/null @@ -1,2629 +0,0 @@ - - - - - - - vtape · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                      -
                                                                                                                                                                                                      - - - - - - - - -
                                                                                                                                                                                                      - -
                                                                                                                                                                                                      - -
                                                                                                                                                                                                      - - - - - - - - -
                                                                                                                                                                                                      -
                                                                                                                                                                                                      - -
                                                                                                                                                                                                      -
                                                                                                                                                                                                      - -
                                                                                                                                                                                                      - -

                                                                                                                                                                                                      bi.vtape

                                                                                                                                                                                                      -

                                                                                                                                                                                                      垂直tape布局,两列定高,一列自适应

                                                                                                                                                                                                      -
                                                                                                                                                                                                      
                                                                                                                                                                                                      -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"
                                                                                                                                                                                                      -      }
                                                                                                                                                                                                      -    }
                                                                                                                                                                                                      -  ]
                                                                                                                                                                                                      -});
                                                                                                                                                                                                      -
                                                                                                                                                                                                      -
                                                                                                                                                                                                      - - -

                                                                                                                                                                                                      API

                                                                                                                                                                                                      -
                                                                                                                                                                                                      基础属性
                                                                                                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                      参数说明类型可选值默认值
                                                                                                                                                                                                      hgap效果相当于容器左右padding值number0
                                                                                                                                                                                                      vgap效果相当于容器上下padding值number0
                                                                                                                                                                                                      lgap效果相当于容器left-padding值number0
                                                                                                                                                                                                      rgap效果相当于容器right-padding值number0
                                                                                                                                                                                                      tgap效果相当于容器top-padding值number0
                                                                                                                                                                                                      bgap效果相当于容器bottom-padding值number0
                                                                                                                                                                                                      items子控件数组array{height: 100,el: {type: 'bi.button', text: 'button1'}},{height: 'fill',el: {type: 'bi.button', text: 'button2'}},{height: 200,el: {type: 'bi.button', text: 'button3'}}
                                                                                                                                                                                                      -
                                                                                                                                                                                                      - - -
                                                                                                                                                                                                      - -
                                                                                                                                                                                                      -
                                                                                                                                                                                                      -
                                                                                                                                                                                                      - -

                                                                                                                                                                                                      results matching ""

                                                                                                                                                                                                      -
                                                                                                                                                                                                        - -
                                                                                                                                                                                                        -
                                                                                                                                                                                                        - -

                                                                                                                                                                                                        No results matching ""

                                                                                                                                                                                                        - -
                                                                                                                                                                                                        -
                                                                                                                                                                                                        -
                                                                                                                                                                                                        - -
                                                                                                                                                                                                        -
                                                                                                                                                                                                        - -
                                                                                                                                                                                                        - - - - -
                                                                                                                                                                                                        - - -
                                                                                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/layout/vtape.md b/docs/_book/core/layout/vtape.md deleted file mode 100644 index 370508b76..000000000 --- a/docs/_book/core/layout/vtape.md +++ /dev/null @@ -1,64 +0,0 @@ -# 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 | — | {height: 100,el: {type: 'bi.button', text: 'button1'}},{height: 'fill',el: {type: 'bi.button', text: 'button2'}},{height: 200,el: {type: 'bi.button', text: 'button3'}} | - - - ---- \ No newline at end of file diff --git a/docs/_book/core/node_button.html b/docs/_book/core/node_button.html deleted file mode 100644 index 1915df179..000000000 --- a/docs/_book/core/node_button.html +++ /dev/null @@ -1,2595 +0,0 @@ - - - - - - - node_button · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                        -
                                                                                                                                                                                                        - - - - - - - - -
                                                                                                                                                                                                        - -
                                                                                                                                                                                                        - -
                                                                                                                                                                                                        - - - - - - - - -
                                                                                                                                                                                                        -
                                                                                                                                                                                                        - -
                                                                                                                                                                                                        -
                                                                                                                                                                                                        - -
                                                                                                                                                                                                        - -

                                                                                                                                                                                                        bi.NodeButton

                                                                                                                                                                                                        -

                                                                                                                                                                                                        表示一个可以展开的节点, 不仅有选中状态而且有展开状态, BI.BasicButton

                                                                                                                                                                                                        -

                                                                                                                                                                                                        API

                                                                                                                                                                                                        -
                                                                                                                                                                                                        基础属性
                                                                                                                                                                                                        - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                        参数说明类型可选值默认值
                                                                                                                                                                                                        open节点是否展开booleantrue,falsefalse
                                                                                                                                                                                                        -

                                                                                                                                                                                                        对外方法

                                                                                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                        名称说明回调参数
                                                                                                                                                                                                        doClick点击展开
                                                                                                                                                                                                        isOnce点击一次后失效
                                                                                                                                                                                                        isOpened判断节点是否展开
                                                                                                                                                                                                        setOpened设置节点展开状态b
                                                                                                                                                                                                        triggerCollapse节点收起
                                                                                                                                                                                                        triggerExpand节点展开
                                                                                                                                                                                                        -
                                                                                                                                                                                                        - - -
                                                                                                                                                                                                        - -
                                                                                                                                                                                                        -
                                                                                                                                                                                                        -
                                                                                                                                                                                                        - -

                                                                                                                                                                                                        results matching ""

                                                                                                                                                                                                        -
                                                                                                                                                                                                          - -
                                                                                                                                                                                                          -
                                                                                                                                                                                                          - -

                                                                                                                                                                                                          No results matching ""

                                                                                                                                                                                                          - -
                                                                                                                                                                                                          -
                                                                                                                                                                                                          -
                                                                                                                                                                                                          - -
                                                                                                                                                                                                          -
                                                                                                                                                                                                          - -
                                                                                                                                                                                                          - - - - -
                                                                                                                                                                                                          - - -
                                                                                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/node_button.md b/docs/_book/core/node_button.md deleted file mode 100644 index 212f98fda..000000000 --- a/docs/_book/core/node_button.md +++ /dev/null @@ -1,28 +0,0 @@ -# bi.NodeButton - -## 表示一个可以展开的节点, 不仅有选中状态而且有展开状态, [BI.BasicButton](/core/basic_button.md) - - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| open | 节点是否展开 | boolean | true,false | false | - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| doClick | 点击展开| — -| isOnce | 点击一次后失效 | — -| isOpened | 判断节点是否展开| — -| setOpened | 设置节点展开状态| b -| triggerCollapse | 节点收起 | — -| triggerExpand | 节点展开| — - - - - ---- - - diff --git a/docs/_book/core/pane.html b/docs/_book/core/pane.html deleted file mode 100644 index 440483719..000000000 --- a/docs/_book/core/pane.html +++ /dev/null @@ -1,2614 +0,0 @@ - - - - - - - pane · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                          -
                                                                                                                                                                                                          - - - - - - - - -
                                                                                                                                                                                                          - -
                                                                                                                                                                                                          - -
                                                                                                                                                                                                          - - - - - - - - -
                                                                                                                                                                                                          -
                                                                                                                                                                                                          - -
                                                                                                                                                                                                          -
                                                                                                                                                                                                          - -
                                                                                                                                                                                                          - -

                                                                                                                                                                                                          bi.pane

                                                                                                                                                                                                          -

                                                                                                                                                                                                          当没有元素时有提示信息的view, BI.Widget

                                                                                                                                                                                                          -

                                                                                                                                                                                                          API

                                                                                                                                                                                                          -
                                                                                                                                                                                                          基础属性
                                                                                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                          参数说明类型可选值默认值
                                                                                                                                                                                                          tipTexttitle文本stringBI.i18nText("BI-No_Selected_Item")
                                                                                                                                                                                                          overlap是否含有遮罩层booleantrue,falsetrue
                                                                                                                                                                                                          onLoaded已经加载function
                                                                                                                                                                                                          -

                                                                                                                                                                                                          对外方法

                                                                                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                          名称说明回调参数
                                                                                                                                                                                                          populate刷新列表items
                                                                                                                                                                                                          empty清空组件
                                                                                                                                                                                                          hasMatched是否有匹配的元素
                                                                                                                                                                                                          loading加载中
                                                                                                                                                                                                          loaded加载完毕
                                                                                                                                                                                                          check检查是否为空
                                                                                                                                                                                                          setTipVisible设tip可见
                                                                                                                                                                                                          -
                                                                                                                                                                                                          - - -
                                                                                                                                                                                                          - -
                                                                                                                                                                                                          -
                                                                                                                                                                                                          -
                                                                                                                                                                                                          - -

                                                                                                                                                                                                          results matching ""

                                                                                                                                                                                                          -
                                                                                                                                                                                                            - -
                                                                                                                                                                                                            -
                                                                                                                                                                                                            - -

                                                                                                                                                                                                            No results matching ""

                                                                                                                                                                                                            - -
                                                                                                                                                                                                            -
                                                                                                                                                                                                            -
                                                                                                                                                                                                            - -
                                                                                                                                                                                                            -
                                                                                                                                                                                                            - -
                                                                                                                                                                                                            - - - - -
                                                                                                                                                                                                            - - -
                                                                                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/pane.md b/docs/_book/core/pane.md deleted file mode 100644 index 93ea2f6e5..000000000 --- a/docs/_book/core/pane.md +++ /dev/null @@ -1,32 +0,0 @@ -# bi.pane - -## 当没有元素时有提示信息的view, [BI.Widget](/core/widget.md) - - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| tipText | title文本 | string | — | BI.i18nText("BI-No_Selected_Item") | -| overlap| 是否含有遮罩层 | boolean | true,false | true | -| onLoaded | 已经加载 | function | — | — | - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| populate | 刷新列表 | items | -| empty | 清空组件 | — | -| hasMatched | 是否有匹配的元素 | —| -| loading | 加载中 | — | -| loaded | 加载完毕 | — -| check | 检查是否为空| — -| setTipVisible | 设tip可见| — - - - - - ---- - - diff --git a/docs/_book/core/single.html b/docs/_book/core/single.html deleted file mode 100644 index e2fc7946c..000000000 --- a/docs/_book/core/single.html +++ /dev/null @@ -1,2648 +0,0 @@ - - - - - - - single · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                            -
                                                                                                                                                                                                            - - - - - - - - -
                                                                                                                                                                                                            - -
                                                                                                                                                                                                            - -
                                                                                                                                                                                                            - - - - - - - - -
                                                                                                                                                                                                            -
                                                                                                                                                                                                            - -
                                                                                                                                                                                                            -
                                                                                                                                                                                                            - -
                                                                                                                                                                                                            - -

                                                                                                                                                                                                            bi.single

                                                                                                                                                                                                            -

                                                                                                                                                                                                            这仅仅只是一个超类, 所有简单控件的基类,类的控制,title的控制,文字超过边界显示3个点,cursor默认pointor,基类BI.Widget

                                                                                                                                                                                                            -

                                                                                                                                                                                                            API

                                                                                                                                                                                                            -
                                                                                                                                                                                                            基础属性
                                                                                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                            参数说明类型可选值默认值
                                                                                                                                                                                                            readonly是否只读booleantrue,falsefalse
                                                                                                                                                                                                            titletitlestringnull
                                                                                                                                                                                                            warningTitle错误titlestringnull
                                                                                                                                                                                                            tipTypetitle类型stringsuccess,warningnull
                                                                                                                                                                                                            value组件value值stringnull
                                                                                                                                                                                                            -

                                                                                                                                                                                                            对外方法

                                                                                                                                                                                                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                            名称说明回调参数
                                                                                                                                                                                                            enableHover恢复hover可用opt
                                                                                                                                                                                                            disabledHover取消hover事件
                                                                                                                                                                                                            populate刷新或者清空列表items
                                                                                                                                                                                                            setTitle设置titletitle,opt
                                                                                                                                                                                                            setWarningTitle设置错误titletitle,opt
                                                                                                                                                                                                            getTipType获取tipType
                                                                                                                                                                                                            isReadOnly是否只读
                                                                                                                                                                                                            getTitle获取title
                                                                                                                                                                                                            getWarningTitle获取warningtitle
                                                                                                                                                                                                            setValue设置value值value
                                                                                                                                                                                                            getValue获取value值
                                                                                                                                                                                                            -
                                                                                                                                                                                                            - - -
                                                                                                                                                                                                            - -
                                                                                                                                                                                                            -
                                                                                                                                                                                                            -
                                                                                                                                                                                                            - -

                                                                                                                                                                                                            results matching ""

                                                                                                                                                                                                            -
                                                                                                                                                                                                              - -
                                                                                                                                                                                                              -
                                                                                                                                                                                                              - -

                                                                                                                                                                                                              No results matching ""

                                                                                                                                                                                                              - -
                                                                                                                                                                                                              -
                                                                                                                                                                                                              -
                                                                                                                                                                                                              - -
                                                                                                                                                                                                              -
                                                                                                                                                                                                              - -
                                                                                                                                                                                                              - - - - -
                                                                                                                                                                                                              - - -
                                                                                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/single.md b/docs/_book/core/single.md deleted file mode 100644 index a99f542b8..000000000 --- a/docs/_book/core/single.md +++ /dev/null @@ -1,39 +0,0 @@ -# bi.single - -## 这仅仅只是一个超类, 所有简单控件的基类,类的控制,title的控制,文字超过边界显示3个点,cursor默认pointor,基类[BI.Widget](/core/widget.md) - - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| readonly | 是否只读 | boolean | true,false| false | -| title | title | string |— | null | -| warningTitle | 错误title | string | —| null| -| tipType | title类型 | string | success,warning | null | -| value | 组件value值 | string |— | null | - - - -## 对外方法 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| enableHover | 恢复hover可用| opt | -| disabledHover | 取消hover事件 | —| -| populate | 刷新或者清空列表 | items | -| setTitle | 设置title| title,opt | -| setWarningTitle | 设置错误title | title,opt| -| getTipType | 获取tipType|—| -| isReadOnly | 是否只读| —| -| getTitle | 获取title|—| -| getWarningTitle | 获取warningtitle| —| -| setValue | 设置value值| value| -|getValue| 获取value值| —| - - - - - ---- - - diff --git a/docs/_book/core/widget.html b/docs/_book/core/widget.html deleted file mode 100644 index 52229e00a..000000000 --- a/docs/_book/core/widget.html +++ /dev/null @@ -1,2847 +0,0 @@ - - - - - - - widget · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                              -
                                                                                                                                                                                                              - - - - - - - - -
                                                                                                                                                                                                              - -
                                                                                                                                                                                                              - -
                                                                                                                                                                                                              - - - - - - - - -
                                                                                                                                                                                                              -
                                                                                                                                                                                                              - -
                                                                                                                                                                                                              -
                                                                                                                                                                                                              - -
                                                                                                                                                                                                              - -

                                                                                                                                                                                                              bi.widget

                                                                                                                                                                                                              -

                                                                                                                                                                                                              所有控件的超类

                                                                                                                                                                                                              -

                                                                                                                                                                                                              API

                                                                                                                                                                                                              -
                                                                                                                                                                                                              基础属性
                                                                                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                              参数说明类型可选值默认值
                                                                                                                                                                                                              root根组件booleantrue,falsefalse
                                                                                                                                                                                                              tagNamehtml标签string"div"
                                                                                                                                                                                                              attributes属性objectnull
                                                                                                                                                                                                              data数据objectnull
                                                                                                                                                                                                              disabled是否可用booleantrue,falsefalse
                                                                                                                                                                                                              invisible是否可见booleantrue,falsefalse
                                                                                                                                                                                                              invalid是否有效booleantrue,falsefalse
                                                                                                                                                                                                              baseCls基础class类string" "
                                                                                                                                                                                                              extraCls扩展class类string" "
                                                                                                                                                                                                              clsclass类名string" "
                                                                                                                                                                                                              -

                                                                                                                                                                                                              生命周期函数

                                                                                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                              名称说明回调参数
                                                                                                                                                                                                              beforeCreate组件实例刚被创建
                                                                                                                                                                                                              created组件实例创建完成
                                                                                                                                                                                                              render渲染组件
                                                                                                                                                                                                              beforeMounted组件挂载之前
                                                                                                                                                                                                              mounted组件挂载
                                                                                                                                                                                                              update组件更新
                                                                                                                                                                                                              beforeDestroyed组件销毁前调用
                                                                                                                                                                                                              destroyed组件销毁后调用
                                                                                                                                                                                                              -

                                                                                                                                                                                                              对外方法

                                                                                                                                                                                                              -
                                                                                                                                                                                                              (注: fineui2.0引入生命周期后,widget的实现类不需要重写setEnable,setValid等方法,会自动调用子组件的对应方法
                                                                                                                                                                                                              -
                                                                                                                                                                                                              ,一些需要在设置状态后做的额外工作可以通过重写_setXXX来实现)
                                                                                                                                                                                                              - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                              名称说明回调参数
                                                                                                                                                                                                              isMounted判断组件是否挂载
                                                                                                                                                                                                              setWidth设置组件宽度width
                                                                                                                                                                                                              setHeight设置组件高度height
                                                                                                                                                                                                              setEnable设置组件是否可用enable
                                                                                                                                                                                                              setVisible设置组件是否可见visible
                                                                                                                                                                                                              setValid设置组件是否有效valid
                                                                                                                                                                                                              doBehavior自定义下拉列表中item项的行为,如高亮,标红等
                                                                                                                                                                                                              getWidth获取组件宽度
                                                                                                                                                                                                              getHeight获取组件高度
                                                                                                                                                                                                              isValid判断是否有效
                                                                                                                                                                                                              addWidget添加组件name,widget
                                                                                                                                                                                                              getWidgetByName根据组件名称获取组件name
                                                                                                                                                                                                              removeWidget移除组件nameOrWidget
                                                                                                                                                                                                              hasWidget判断是否有该组件name
                                                                                                                                                                                                              getName获取组件名称
                                                                                                                                                                                                              setTag设置tagtag
                                                                                                                                                                                                              getTag获取tag
                                                                                                                                                                                                              attr设置组件属性key,value
                                                                                                                                                                                                              getText获取text值
                                                                                                                                                                                                              setText设置text值text
                                                                                                                                                                                                              getValue获取value值
                                                                                                                                                                                                              setValue设置value值value
                                                                                                                                                                                                              isEnabled是否可用
                                                                                                                                                                                                              isVisible是否可见
                                                                                                                                                                                                              disable设置组件不可用
                                                                                                                                                                                                              enable设置组件可用
                                                                                                                                                                                                              valid设置组件有效
                                                                                                                                                                                                              invalid设置组件无效
                                                                                                                                                                                                              invisible设置组件不可见
                                                                                                                                                                                                              visible设置组件可见
                                                                                                                                                                                                              isolate组件不在页面展示,组件事件和内容都在
                                                                                                                                                                                                              empty清空组件
                                                                                                                                                                                                              destroy销毁组件
                                                                                                                                                                                                              -
                                                                                                                                                                                                              - - -
                                                                                                                                                                                                              - -
                                                                                                                                                                                                              -
                                                                                                                                                                                                              -
                                                                                                                                                                                                              - -

                                                                                                                                                                                                              results matching ""

                                                                                                                                                                                                              -
                                                                                                                                                                                                                - -
                                                                                                                                                                                                                -
                                                                                                                                                                                                                - -

                                                                                                                                                                                                                No results matching ""

                                                                                                                                                                                                                - -
                                                                                                                                                                                                                -
                                                                                                                                                                                                                -
                                                                                                                                                                                                                - -
                                                                                                                                                                                                                -
                                                                                                                                                                                                                - -
                                                                                                                                                                                                                - - - - -
                                                                                                                                                                                                                - - -
                                                                                                                                                                                                                - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/core/widget.md b/docs/_book/core/widget.md deleted file mode 100644 index 5cc99bcc7..000000000 --- a/docs/_book/core/widget.md +++ /dev/null @@ -1,77 +0,0 @@ -# bi.widget - -## 所有控件的超类 - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| root | 根组件 | boolean | true,false | false | -| tagName | html标签 | string| —| "div" | -| attributes | 属性| object | —| null | -| data | 数据 | object | — | null | -| disabled | 是否可用 | boolean |true,false | false | -| invisible | 是否可见 | boolean | true,false | false| -| invalid | 是否有效 | boolean | true,false |false | -| baseCls | 基础class类 | string | —| " "| -| extraCls | 扩展class类 | string| — | " "| -| cls | class类名 | string |— | " "| - -## 生命周期函数 -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| beforeCreate | 组件实例刚被创建 |— | -| created | 组件实例创建完成 | —| -| render | 渲染组件 | — | -| beforeMounted | 组件挂载之前| —| -| mounted | 组件挂载 |—| -| update | 组件更新 | —| -| beforeDestroyed | 组件销毁前调用| —| -| destroyed | 组件销毁后调用 | —| - - -## 对外方法 -#####(注: fineui2.0引入生命周期后,widget的实现类不需要重写setEnable,setValid等方法,会自动调用子组件的对应方法 -#####,一些需要在设置状态后做的额外工作可以通过重写_setXXX来实现) - -| 名称 | 说明 | 回调参数 -| :------ |:------------- | :----- -| isMounted | 判断组件是否挂载| — | -| setWidth | 设置组件宽度 | width | -| setHeight | 设置组件高度 | height | -| setEnable | 设置组件是否可用 | enable | -| setVisible | 设置组件是否可见 | visible | -| setValid | 设置组件是否有效 | valid| -| doBehavior | 自定义下拉列表中item项的行为,如高亮,标红等 | —| -| getWidth | 获取组件宽度 | —| -| getHeight| 获取组件高度| —| -| isValid | 判断是否有效 | —| -| addWidget | 添加组件 | name,widget| -| getWidgetByName | 根据组件名称获取组件| name | -| removeWidget | 移除组件 | nameOrWidget | -| hasWidget | 判断是否有该组件 | name | -| getName | 获取组件名称 | —| -| setTag | 设置tag | tag | -| getTag | 获取tag | —| -| attr | 设置组件属性 | key,value | -| getText | 获取text值 | —| -| setText | 设置text值 | text| -| getValue | 获取value值 | —| -|setValue| 设置value值| value| -| isEnabled | 是否可用 | —| -| isVisible | 是否可见 | —| -| disable | 设置组件不可用 | —| -| enable | 设置组件可用| —| -| valid | 设置组件有效| —| -|invalid | 设置组件无效 | —| -| invisible | 设置组件不可见 | —| -| visible | 设置组件可见 | —| -| isolate | 组件不在页面展示,组件事件和内容都在 | —| -| empty | 清空组件 | —| -| destroy | 销毁组件| —| - - - ---- - - diff --git a/docs/_book/detailed/bi.button/general.html b/docs/_book/detailed/bi.button/general.html deleted file mode 100644 index d5f7a96ee..000000000 --- a/docs/_book/detailed/bi.button/general.html +++ /dev/null @@ -1,2528 +0,0 @@ - - - - - - - 通用按钮 · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                                -
                                                                                                                                                                                                                - - - - - - - - -
                                                                                                                                                                                                                - -
                                                                                                                                                                                                                - -
                                                                                                                                                                                                                - - - - - - - - -
                                                                                                                                                                                                                -
                                                                                                                                                                                                                - -
                                                                                                                                                                                                                -
                                                                                                                                                                                                                - -
                                                                                                                                                                                                                - -

                                                                                                                                                                                                                bi.button

                                                                                                                                                                                                                -

                                                                                                                                                                                                                通用按钮,详情见BI.button

                                                                                                                                                                                                                - - -
                                                                                                                                                                                                                - -
                                                                                                                                                                                                                -
                                                                                                                                                                                                                -
                                                                                                                                                                                                                - -

                                                                                                                                                                                                                results matching ""

                                                                                                                                                                                                                -
                                                                                                                                                                                                                  - -
                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  - -

                                                                                                                                                                                                                  No results matching ""

                                                                                                                                                                                                                  - -
                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  - -
                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  - -
                                                                                                                                                                                                                  - - - - -
                                                                                                                                                                                                                  - - -
                                                                                                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/detailed/bi.button/general.md b/docs/_book/detailed/bi.button/general.md deleted file mode 100644 index 76adf095c..000000000 --- a/docs/_book/detailed/bi.button/general.md +++ /dev/null @@ -1,7 +0,0 @@ -# bi.button - -## 通用按钮,详情见[BI.button](/base/button/button.md) - - - - diff --git a/docs/_book/detailed/bi.button/items.html b/docs/_book/detailed/bi.button/items.html deleted file mode 100644 index a9cd7695b..000000000 --- a/docs/_book/detailed/bi.button/items.html +++ /dev/null @@ -1,2632 +0,0 @@ - - - - - - - 各种items · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  - - - - - - - - -
                                                                                                                                                                                                                  - -
                                                                                                                                                                                                                  - -
                                                                                                                                                                                                                  - - - - - - - - -
                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  - -
                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  - -
                                                                                                                                                                                                                  - -

                                                                                                                                                                                                                  各种items

                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  
                                                                                                                                                                                                                  -BI.createWidget({
                                                                                                                                                                                                                  -    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: "复选项"
                                                                                                                                                                                                                  -    }]
                                                                                                                                                                                                                  -});
                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  - -

                                                                                                                                                                                                                  API

                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  基础属性
                                                                                                                                                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                                  参数说明类型可选值默认值
                                                                                                                                                                                                                  hgap效果相当于文本框左右padding值,如果clear属性为true,该属性值置0number10
                                                                                                                                                                                                                  vgap效果相当于文本框上下padding值number0
                                                                                                                                                                                                                  lgap效果相当于文本框left-padding值number0
                                                                                                                                                                                                                  rgap效果相当于文本框right-padding值number0
                                                                                                                                                                                                                  tgap效果相当于文本框top-padding值number0
                                                                                                                                                                                                                  bgap效果相当于文本框bottom-padding值number0
                                                                                                                                                                                                                  items子控件数组array[ ]
                                                                                                                                                                                                                  width宽度number
                                                                                                                                                                                                                  height高度number
                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  - - -
                                                                                                                                                                                                                  - -
                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  -
                                                                                                                                                                                                                  - -

                                                                                                                                                                                                                  results matching ""

                                                                                                                                                                                                                  -
                                                                                                                                                                                                                    - -
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    - -

                                                                                                                                                                                                                    No results matching ""

                                                                                                                                                                                                                    - -
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    - -
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    - -
                                                                                                                                                                                                                    - - - - -
                                                                                                                                                                                                                    - - -
                                                                                                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/detailed/bi.button/items.md b/docs/_book/detailed/bi.button/items.md deleted file mode 100644 index 57bc8ae65..000000000 --- a/docs/_book/detailed/bi.button/items.md +++ /dev/null @@ -1,52 +0,0 @@ -## 各种items - -{% method %} -[source](https://jsfiddle.net/fineui/jyo0qdwL/) - -{% common %} -```javascript - -BI.createWidget({ - 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: "复选项" - }] -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| hgap | 效果相当于文本框左右padding值,如果clear属性为true,该属性值置0 | number | — | 10 | -| 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 | — | [ ] | -| width | 宽度 | number | — | — | -| height | 高度 | number | — | — | - - - ---- - - diff --git a/docs/_book/detailed/bi.button/node.html b/docs/_book/detailed/bi.button/node.html deleted file mode 100644 index db8c3bd79..000000000 --- a/docs/_book/detailed/bi.button/node.html +++ /dev/null @@ -1,2639 +0,0 @@ - - - - - - - 各种节点nodes · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    - - - - - - - - -
                                                                                                                                                                                                                    - -
                                                                                                                                                                                                                    - -
                                                                                                                                                                                                                    - - - - - - - - -
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    - -
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    - -
                                                                                                                                                                                                                    - -

                                                                                                                                                                                                                    各种节点nodes

                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    -BI.createWidget({
                                                                                                                                                                                                                    -    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: "箭头节点"
                                                                                                                                                                                                                    -    }]
                                                                                                                                                                                                                    -});
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    - -

                                                                                                                                                                                                                    API

                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    基础属性
                                                                                                                                                                                                                    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                                    参数说明类型可选值默认值
                                                                                                                                                                                                                    hgap效果相当于文本框左右padding值,如果clear属性为true,该属性值置0number10
                                                                                                                                                                                                                    vgap效果相当于文本框上下padding值number0
                                                                                                                                                                                                                    lgap效果相当于文本框left-padding值number0
                                                                                                                                                                                                                    rgap效果相当于文本框right-padding值number0
                                                                                                                                                                                                                    tgap效果相当于文本框top-padding值number0
                                                                                                                                                                                                                    bgap效果相当于文本框bottom-padding值number0
                                                                                                                                                                                                                    items子控件数组array[ ]
                                                                                                                                                                                                                    width宽度number
                                                                                                                                                                                                                    height高度number
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    - - -
                                                                                                                                                                                                                    - -
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                    - -

                                                                                                                                                                                                                    results matching ""

                                                                                                                                                                                                                    -
                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                      No results matching ""

                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                      - - - - -
                                                                                                                                                                                                                      - - -
                                                                                                                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/detailed/bi.button/node.md b/docs/_book/detailed/bi.button/node.md deleted file mode 100644 index 1445723ba..000000000 --- a/docs/_book/detailed/bi.button/node.md +++ /dev/null @@ -1,58 +0,0 @@ -## 各种节点nodes - -{% method %} -[source](https://jsfiddle.net/fineui/jg257cog/) - -{% common %} -```javascript - -BI.createWidget({ - 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: "箭头节点" - }] -}); - - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| hgap | 效果相当于文本框左右padding值,如果clear属性为true,该属性值置0 | number | — | 10 | -| 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 | — | [ ] | -| width | 宽度 | number | — | — | -| height | 高度 | number | — | — | - - ---- - - diff --git a/docs/_book/detailed/bi.button/segment.html b/docs/_book/detailed/bi.button/segment.html deleted file mode 100644 index f1b1c019b..000000000 --- a/docs/_book/detailed/bi.button/segment.html +++ /dev/null @@ -1,2637 +0,0 @@ - - - - - - - 各种segment · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      - - - - - - - - -
                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                      - - - - - - - - -
                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                      bi.sgement

                                                                                                                                                                                                                      -

                                                                                                                                                                                                                      各种segment

                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      
                                                                                                                                                                                                                      -BI.createWidget({
                                                                                                                                                                                                                      -    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
                                                                                                                                                                                                                      -});
                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                      API

                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      基础属性
                                                                                                                                                                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                                      参数说明类型可选值默认值
                                                                                                                                                                                                                      hgap效果相当于文本框左右padding值number10
                                                                                                                                                                                                                      vgap效果相当于文本框上下padding值number0
                                                                                                                                                                                                                      lgap效果相当于文本框left-padding值number0
                                                                                                                                                                                                                      rgap效果相当于文本框right-padding值number0
                                                                                                                                                                                                                      tgap效果相当于文本框top-padding值number0
                                                                                                                                                                                                                      bgap效果相当于文本框bottom-padding值number0
                                                                                                                                                                                                                      items子控件数组array[ ]
                                                                                                                                                                                                                      width宽度number
                                                                                                                                                                                                                      height高度number
                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      - - -
                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      -
                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                      results matching ""

                                                                                                                                                                                                                      -
                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        - -

                                                                                                                                                                                                                        No results matching ""

                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                        - - - - -
                                                                                                                                                                                                                        - - -
                                                                                                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/detailed/bi.button/segment.md b/docs/_book/detailed/bi.button/segment.md deleted file mode 100644 index 2261e781e..000000000 --- a/docs/_book/detailed/bi.button/segment.md +++ /dev/null @@ -1,58 +0,0 @@ -# bi.sgement - -## 各种segment - -{% method %} -[source](https://jsfiddle.net/fineui/7skvd64L/) - -{% common %} -```javascript - -BI.createWidget({ - 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 -}); - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| hgap | 效果相当于文本框左右padding值 | number | — | 10 | -| 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 | — | [ ] | -| width | 宽度 | number | — | — | -| height | 高度 | number | — | — | - - ---- - - diff --git a/docs/_book/detailed/bi.button/tooltip.html b/docs/_book/detailed/bi.button/tooltip.html deleted file mode 100644 index 03b50354d..000000000 --- a/docs/_book/detailed/bi.button/tooltip.html +++ /dev/null @@ -1,2627 +0,0 @@ - - - - - - - 提示性信息 · GitBook - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        - - - - - - - - -
                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                        - - - - - - - - -
                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                        - -

                                                                                                                                                                                                                        提示性信息

                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        var toast = BI.createWidget({
                                                                                                                                                                                                                        -    type: "bi.vertical",
                                                                                                                                                                                                                        -    element: "#wrapper",
                                                                                                                                                                                                                        -    items: [{
                                                                                                                                                                                                                        -        el: {
                                                                                                                                                                                                                        -            type: 'bi.button',
                                                                                                                                                                                                                        -            text: '简单Toast测试',
                                                                                                                                                                                                                        -            height: 30,
                                                                                                                                                                                                                        -            handler: function () {
                                                                                                                                                                                                                        -                BI.Msg.toast("这是一条简单的数据");
                                                                                                                                                                                                                        -            }
                                                                                                                                                                                                                        -        }
                                                                                                                                                                                                                        -    }],
                                                                                                                                                                                                                        -    vgap: 20
                                                                                                                                                                                                                        -});
                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        - -

                                                                                                                                                                                                                        API

                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        基础属性
                                                                                                                                                                                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                                        参数说明类型可选值默认值
                                                                                                                                                                                                                        hgap效果相当于文本框左右padding值number10
                                                                                                                                                                                                                        vgap效果相当于文本框上下padding值number0
                                                                                                                                                                                                                        lgap效果相当于文本框left-padding值number0
                                                                                                                                                                                                                        rgap效果相当于文本框right-padding值number0
                                                                                                                                                                                                                        tgap效果相当于文本框top-padding值number0
                                                                                                                                                                                                                        bgap效果相当于文本框bottom-padding值number0
                                                                                                                                                                                                                        items子控件数组array[ ]
                                                                                                                                                                                                                        width宽度number
                                                                                                                                                                                                                        height高度number
                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        - - -
                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        - -

                                                                                                                                                                                                                        results matching ""

                                                                                                                                                                                                                        -
                                                                                                                                                                                                                          - -
                                                                                                                                                                                                                          -
                                                                                                                                                                                                                          - -

                                                                                                                                                                                                                          No results matching ""

                                                                                                                                                                                                                          - -
                                                                                                                                                                                                                          -
                                                                                                                                                                                                                          -
                                                                                                                                                                                                                          - -
                                                                                                                                                                                                                          -
                                                                                                                                                                                                                          - -
                                                                                                                                                                                                                          - - - - -
                                                                                                                                                                                                                          - - -
                                                                                                                                                                                                                          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/_book/detailed/bi.button/tooltip.md b/docs/_book/detailed/bi.button/tooltip.md deleted file mode 100644 index ad2075e88..000000000 --- a/docs/_book/detailed/bi.button/tooltip.md +++ /dev/null @@ -1,46 +0,0 @@ -## 提示性信息 - -{% method %} -[source](https://jsfiddle.net/fineui/gn25yyrx/) - -{% common %} -```javascript -var toast = BI.createWidget({ - type: "bi.vertical", - element: "#wrapper", - items: [{ - el: { - type: 'bi.button', - text: '简单Toast测试', - height: 30, - handler: function () { - BI.Msg.toast("这是一条简单的数据"); - } - } - }], - vgap: 20 -}); - -``` - -{% endmethod %} - -## API -##### 基础属性 -| 参数 | 说明 | 类型 | 可选值 | 默认值 -| :------ |:------------- | :-----| :----|:---- -| hgap | 效果相当于文本框左右padding值 | number | — | 10 | -| 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 | — | [ ] | -| width | 宽度 | number | — | — | -| height | 高度 | number | — | — | - - - ---- - - diff --git a/docs/_book/detailed/combo/multilayer_select_tree_combo.html b/docs/_book/detailed/combo/multilayer_select_tree_combo.html index d99b8f7b1..4da19a187 100644 --- a/docs/_book/detailed/combo/multilayer_select_tree_combo.html +++ b/docs/_book/detailed/combo/multilayer_select_tree_combo.html @@ -672,7 +672,7 @@ - popup + popup_view @@ -685,7 +685,7 @@ - searcher + searcher_view @@ -970,6 +970,19 @@ + + +
                                                                                                                                                                                                                        • + + + + + rich_editor + + + + +
                                                                                                                                                                                                                        • @@ -1157,7 +1170,7 @@ - 编辑框 + 文本框 @@ -1216,6 +1229,32 @@ + + +
                                                                                                                                                                                                                        • + + + + + simple_state_editor + + + + + +
                                                                                                                                                                                                                        • + +
                                                                                                                                                                                                                        • + + + + + clear_editor + + + + +
                                                                                                                                                                                                                        • @@ -1228,7 +1267,7 @@ - 弹出层 + 列表 @@ -1237,12 +1276,12 @@