Browse Source

change css by less

master
iapyang 7 years ago
parent
commit
de1515e044
  1. 73438
      bi/base.js
  2. 25056
      bi/case.js
  3. 2
      bi/widget.css
  4. 228
      dist/base.js
  5. 2
      dist/bundle.css
  6. 1176
      dist/bundle.js
  7. 2
      dist/bundle.min.css
  8. 2
      dist/bundle.min.js
  9. 948
      dist/case.js
  10. 388
      dist/demo.js
  11. 2
      dist/widget.css
  12. 2
      src/css/widget/numberinterval/numberinterval.css

73438
bi/base.js

File diff suppressed because it is too large Load Diff

25056
bi/case.js

File diff suppressed because it is too large Load Diff

2
bi/widget.css

@ -181,7 +181,7 @@
font-size: 14px; font-size: 14px;
} }
.bi-number-interval.number-error .bi-input { .bi-number-interval.number-error .bi-input {
color: #e85050; color: #e85050 !important;
} }
.bi-page-table-cell { .bi-page-table-cell {
-webkit-user-select: text; -webkit-user-select: text;

228
dist/base.js vendored

@ -33779,120 +33779,120 @@ BI.Table.EVENT_TABLE_BEFORE_REGION_RESIZE = "EVENT_TABLE_BEFORE_REGION_RESIZE";
BI.Table.EVENT_TABLE_REGION_RESIZE = "EVENT_TABLE_REGION_RESIZE"; BI.Table.EVENT_TABLE_REGION_RESIZE = "EVENT_TABLE_REGION_RESIZE";
BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE = "EVENT_TABLE_AFTER_REGION_RESIZE"; BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE = "EVENT_TABLE_AFTER_REGION_RESIZE";
BI.shortcut("bi.table_view", BI.Table); BI.shortcut("bi.table_view", BI.Table);
/** /**
* *
* 表格单元格 * 表格单元格
* *
* Created by GUY on 2016/1/12. * Created by GUY on 2016/1/12.
* @class BI.ResizableTableCell * @class BI.ResizableTableCell
* @extends BI.Widget * @extends BI.Widget
*/ */
BI.ResizableTableCell = BI.inherit(BI.Widget, { BI.ResizableTableCell = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.ResizableTableCell.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.ResizableTableCell.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-resizable-table-cell", baseCls: "bi-resizable-table-cell",
cell: {}, cell: {},
minSize: 15, minSize: 15,
// suitableSize, // suitableSize,
maxSize: Number.MAX_VALUE, maxSize: Number.MAX_VALUE,
start: BI.emptyFn, start: BI.emptyFn,
resize: BI.emptyFn, resize: BI.emptyFn,
stop: BI.emptyFn stop: BI.emptyFn
}) })
}, },
_init: function () { _init: function () {
BI.ResizableTableCell.superclass._init.apply(this, arguments); BI.ResizableTableCell.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.cell = BI.createWidget(BI.extend({type: "bi.label"}, o.cell, {width: o.width, height: o.height})); this.cell = BI.createWidget(BI.extend({type: "bi.label"}, o.cell, {width: o.width, height: o.height}));
var startDrag = false; var startDrag = false;
var size = 0, offset = 0, defaultSize = o.width; var size = 0, offset = 0, defaultSize = o.width;
function optimizeSize(s) { function optimizeSize(s) {
var optSize = BI.clamp(s, o.minSize, o.maxSize || Number.MAX_VALUE); var optSize = BI.clamp(s, o.minSize, o.maxSize || Number.MAX_VALUE);
// if (o.suitableSize) { // if (o.suitableSize) {
// if (Math.abs(o.suitableSize - optSize) < 5) { // if (Math.abs(o.suitableSize - optSize) < 5) {
// optSize = o.suitableSize; // optSize = o.suitableSize;
// self.handler.element.addClass("suitable"); // self.handler.element.addClass("suitable");
// } else { // } else {
// self.handler.element.removeClass("suitable"); // self.handler.element.removeClass("suitable");
// } // }
// } // }
return optSize; return optSize;
} }
var mouseMoveTracker = new BI.MouseMoveTracker(function (deltaX, deltaY) { var mouseMoveTracker = new BI.MouseMoveTracker(function (deltaX, deltaY) {
if (mouseMoveTracker.isDragging()) { if (mouseMoveTracker.isDragging()) {
startDrag = true; startDrag = true;
offset += deltaX; offset += deltaX;
size = optimizeSize(defaultSize + offset); size = optimizeSize(defaultSize + offset);
self.handler.element.addClass("dragging"); self.handler.element.addClass("dragging");
o.resize(size); o.resize(size);
} }
}, function () { }, function () {
if (startDrag === true) { if (startDrag === true) {
size = optimizeSize(size); size = optimizeSize(size);
o.stop(size); o.stop(size);
size = 0; size = 0;
offset = 0; offset = 0;
defaultSize = o.width; defaultSize = o.width;
startDrag = false; startDrag = false;
} }
self.handler.element.removeClass("dragging"); self.handler.element.removeClass("dragging");
self.handler.element.removeClass("suitable"); self.handler.element.removeClass("suitable");
mouseMoveTracker.releaseMouseMoves(); mouseMoveTracker.releaseMouseMoves();
}, document); }, document);
this.handler = BI.createWidget({ this.handler = BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
cls: "resizable-table-cell-resizer-container", cls: "resizable-table-cell-resizer-container",
width: 6, width: 6,
items: [{ items: [{
el: { el: {
type: "bi.layout", type: "bi.layout",
cls: "resizable-table-cell-resizer-knob", cls: "resizable-table-cell-resizer-knob",
width: 4 width: 4
}, },
right: 0, right: 0,
top: 0, top: 0,
bottom: 0 bottom: 0
}] }]
}); });
this.handler.element.on("mousedown", function (event) { this.handler.element.on("mousedown", function (event) {
defaultSize = o.width; defaultSize = o.width;
optimizeSize(defaultSize); optimizeSize(defaultSize);
mouseMoveTracker.captureMouseMoves(event); mouseMoveTracker.captureMouseMoves(event);
}); });
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
items: [{ items: [{
el: this.cell, el: this.cell,
left: 0, left: 0,
right: 0, right: 0,
top: 0, top: 0,
bottom: 0 bottom: 0
}, { }, {
el: this.handler, el: this.handler,
right: 0, right: 0,
top: 0, top: 0,
bottom: 0 bottom: 0
}] }]
}) })
}, },
setWidth: function (width) { setWidth: function (width) {
BI.ResizableTableCell.superclass.setWidth.apply(this, arguments); BI.ResizableTableCell.superclass.setWidth.apply(this, arguments);
var o = this.options; var o = this.options;
this.cell.setWidth(o.width); this.cell.setWidth(o.width);
}, },
setHeight: function (height) { setHeight: function (height) {
BI.ResizableTableCell.superclass.setHeight.apply(this, arguments); BI.ResizableTableCell.superclass.setHeight.apply(this, arguments);
var o = this.options; var o = this.options;
this.cell.setHeight(o.height); this.cell.setHeight(o.height);
} }
}); });
BI.shortcut("bi.resizable_table_cell", BI.ResizableTableCell);/** BI.shortcut("bi.resizable_table_cell", BI.ResizableTableCell);/**
* *
* 可调整列宽的grid表格 * 可调整列宽的grid表格

2
dist/bundle.css vendored

@ -3268,7 +3268,7 @@ ul.ztree.zTreeDragUL {
font-size: 14px; font-size: 14px;
} }
.bi-number-interval.number-error .bi-input { .bi-number-interval.number-error .bi-input {
color: #e85050; color: #e85050 !important;
} }
.bi-page-table-cell { .bi-page-table-cell {
-webkit-user-select: text; -webkit-user-select: text;

1176
dist/bundle.js vendored

File diff suppressed because it is too large Load Diff

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

2
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

948
dist/case.js vendored

@ -4791,227 +4791,227 @@ jQuery._farbtastic = function (container, callback) {
if (callback) { if (callback) {
fb.linkTo(callback); fb.linkTo(callback);
} }
}/** }/**
* Created by GUY on 2017/2/8. * Created by GUY on 2017/2/8.
* *
* @class BI.BubbleCombo * @class BI.BubbleCombo
* @extends BI.Widget * @extends BI.Widget
*/ */
BI.BubbleCombo = BI.inherit(BI.Widget, { BI.BubbleCombo = BI.inherit(BI.Widget, {
_const: { _const: {
TRIANGLE_LENGTH: 6 TRIANGLE_LENGTH: 6
}, },
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-bubble-combo", baseCls: "bi-bubble-combo",
trigger: "click", trigger: "click",
toggle: true, toggle: true,
direction: "bottom", //top||bottom||left||right||top,left||top,right||bottom,left||bottom,right direction: "bottom", //top||bottom||left||right||top,left||top,right||bottom,left||bottom,right
isDefaultInit: false, isDefaultInit: false,
destroyWhenHide: false, destroyWhenHide: false,
isNeedAdjustHeight: true,//是否需要高度调整 isNeedAdjustHeight: true,//是否需要高度调整
isNeedAdjustWidth: true, isNeedAdjustWidth: true,
stopPropagation: false, stopPropagation: false,
adjustLength: 0,//调整的距离 adjustLength: 0,//调整的距离
// adjustXOffset: 0, // adjustXOffset: 0,
// adjustYOffset: 10, // adjustYOffset: 10,
hideChecker: BI.emptyFn, hideChecker: BI.emptyFn,
offsetStyle: "left", //left,right,center offsetStyle: "left", //left,right,center
el: {}, el: {},
popup: {}, popup: {},
}) })
}, },
_init: function () { _init: function () {
BI.BubbleCombo.superclass._init.apply(this, arguments); BI.BubbleCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
element: this, element: this,
trigger: o.trigger, trigger: o.trigger,
toggle: o.toggle, toggle: o.toggle,
direction: o.direction, direction: o.direction,
isDefaultInit: o.isDefaultInit, isDefaultInit: o.isDefaultInit,
destroyWhenHide: o.destroyWhenHide, destroyWhenHide: o.destroyWhenHide,
isNeedAdjustHeight: o.isNeedAdjustHeight, isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: o.isNeedAdjustWidth, isNeedAdjustWidth: o.isNeedAdjustWidth,
adjustLength: this._getAdjustLength(), adjustLength: this._getAdjustLength(),
stopPropagation: o.stopPropagation, stopPropagation: o.stopPropagation,
adjustXOffset: 0, adjustXOffset: 0,
adjustYOffset: 0, adjustYOffset: 0,
hideChecker: o.hideChecker, hideChecker: o.hideChecker,
offsetStyle: o.offsetStyle, offsetStyle: o.offsetStyle,
el: o.el, el: o.el,
popup: BI.extend({ popup: BI.extend({
type: "bi.bubble_popup_view" type: "bi.bubble_popup_view"
}, o.popup), }, o.popup),
}); });
this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE, function () { this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE, arguments); self.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE, arguments);
}); });
this.combo.on(BI.Combo.EVENT_CHANGE, function () { this.combo.on(BI.Combo.EVENT_CHANGE, function () {
self.fireEvent(BI.BubbleCombo.EVENT_CHANGE, arguments); self.fireEvent(BI.BubbleCombo.EVENT_CHANGE, arguments);
}); });
this.combo.on(BI.Combo.EVENT_EXPAND, function () { this.combo.on(BI.Combo.EVENT_EXPAND, function () {
self.fireEvent(BI.BubbleCombo.EVENT_EXPAND, arguments); self.fireEvent(BI.BubbleCombo.EVENT_EXPAND, arguments);
}); });
this.combo.on(BI.Combo.EVENT_COLLAPSE, function () { this.combo.on(BI.Combo.EVENT_COLLAPSE, function () {
self.fireEvent(BI.BubbleCombo.EVENT_COLLAPSE, arguments); self.fireEvent(BI.BubbleCombo.EVENT_COLLAPSE, arguments);
}); });
this.combo.on(BI.Combo.EVENT_AFTER_INIT, function () { this.combo.on(BI.Combo.EVENT_AFTER_INIT, function () {
self.fireEvent(BI.BubbleCombo.EVENT_AFTER_INIT, arguments); self.fireEvent(BI.BubbleCombo.EVENT_AFTER_INIT, arguments);
}); });
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW, arguments); self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW, arguments);
}); });
this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW, function () { this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW, function () {
self._showTriangle(); self._showTriangle();
self.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW, arguments); self.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW, arguments);
}); });
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
self._hideTriangle(); self._hideTriangle();
self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW, arguments); self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW, arguments);
}); });
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () { this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
self.fireEvent(BI.BubbleCombo.EVENT_AFTER_HIDEVIEW, arguments); self.fireEvent(BI.BubbleCombo.EVENT_AFTER_HIDEVIEW, arguments);
}); });
}, },
_getAdjustLength: function () { _getAdjustLength: function () {
return this._const.TRIANGLE_LENGTH + this.options.adjustLength; return this._const.TRIANGLE_LENGTH + this.options.adjustLength;
}, },
_createTriangle: function (direction) { _createTriangle: function (direction) {
var pos = {}, op = {}; var pos = {}, op = {};
var adjustLength = this.options.adjustLength; var adjustLength = this.options.adjustLength;
var offset = this.element.offset(); var offset = this.element.offset();
var left = offset.left, right = offset.left + this.element.outerWidth(); var left = offset.left, right = offset.left + this.element.outerWidth();
var top = offset.top, bottom = offset.top + this.element.outerHeight(); var top = offset.top, bottom = offset.top + this.element.outerHeight();
switch (direction) { switch (direction) {
case "left": case "left":
pos = { pos = {
top: top, top: top,
height: this.element.outerHeight(), height: this.element.outerHeight(),
left: left - adjustLength - this._const.TRIANGLE_LENGTH left: left - adjustLength - this._const.TRIANGLE_LENGTH
}; };
op = {width: this._const.TRIANGLE_LENGTH}; op = {width: this._const.TRIANGLE_LENGTH};
break; break;
case "right": case "right":
pos = { pos = {
top: top, top: top,
height: this.element.outerHeight(), height: this.element.outerHeight(),
left: right + adjustLength left: right + adjustLength
}; };
op = {width: this._const.TRIANGLE_LENGTH}; op = {width: this._const.TRIANGLE_LENGTH};
break; break;
case "top": case "top":
pos = { pos = {
left: left, left: left,
width: this.element.outerWidth(), width: this.element.outerWidth(),
top: top - adjustLength - this._const.TRIANGLE_LENGTH top: top - adjustLength - this._const.TRIANGLE_LENGTH
}; };
op = {height: this._const.TRIANGLE_LENGTH}; op = {height: this._const.TRIANGLE_LENGTH};
break; break;
case "bottom": case "bottom":
pos = { pos = {
left: left, left: left,
width: this.element.outerWidth(), width: this.element.outerWidth(),
top: bottom + adjustLength top: bottom + adjustLength
}; };
op = {height: this._const.TRIANGLE_LENGTH}; op = {height: this._const.TRIANGLE_LENGTH};
break; break;
default: default:
break; break;
} }
this.triangle && this.triangle.destroy(); this.triangle && this.triangle.destroy();
this.triangle = BI.createWidget(op, { this.triangle = BI.createWidget(op, {
type: "bi.center_adapt", type: "bi.center_adapt",
cls: "button-combo-triangle-wrapper", cls: "button-combo-triangle-wrapper",
items: [{ items: [{
type: "bi.layout", type: "bi.layout",
cls: "bubble-combo-triangle-" + direction + " bi-high-light-border" cls: "bubble-combo-triangle-" + direction + " bi-high-light-border"
}] }]
}); });
pos.el = this.triangle; pos.el = this.triangle;
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
items: [pos] items: [pos]
}) })
}, },
_createLeftTriangle: function () { _createLeftTriangle: function () {
this._createTriangle("left"); this._createTriangle("left");
}, },
_createRightTriangle: function () { _createRightTriangle: function () {
this._createTriangle("right"); this._createTriangle("right");
}, },
_createTopTriangle: function () { _createTopTriangle: function () {
this._createTriangle("top"); this._createTriangle("top");
}, },
_createBottomTriangle: function () { _createBottomTriangle: function () {
this._createTriangle("bottom"); this._createTriangle("bottom");
}, },
_showTriangle: function () { _showTriangle: function () {
var pos = this.combo.getPopupPosition(); var pos = this.combo.getPopupPosition();
switch (pos.dir) { switch (pos.dir) {
case "left,top": case "left,top":
case "left,bottom": case "left,bottom":
this._createLeftTriangle(); this._createLeftTriangle();
this.combo.getView().showLine("right"); this.combo.getView().showLine("right");
break; break;
case "right,top": case "right,top":
case "right,bottom": case "right,bottom":
this._createRightTriangle(); this._createRightTriangle();
this.combo.getView().showLine("left"); this.combo.getView().showLine("left");
break; break;
case "top,left": case "top,left":
case "top,right": case "top,right":
this._createTopTriangle(); this._createTopTriangle();
this.combo.getView().showLine("bottom"); this.combo.getView().showLine("bottom");
break; break;
case "bottom,left": case "bottom,left":
case "bottom,right": case "bottom,right":
this._createBottomTriangle(); this._createBottomTriangle();
this.combo.getView().showLine("top"); this.combo.getView().showLine("top");
break; break;
} }
}, },
_hideTriangle: function () { _hideTriangle: function () {
this.triangle && this.triangle.destroy(); this.triangle && this.triangle.destroy();
this.triangle = null; this.triangle = null;
this.combo.getView() && this.combo.getView().hideLine(); this.combo.getView() && this.combo.getView().hideLine();
}, },
hideView: function () { hideView: function () {
this._hideTriangle(); this._hideTriangle();
this.combo && this.combo.hideView(); this.combo && this.combo.hideView();
}, },
showView: function () { showView: function () {
this.combo && this.combo.showView(); this.combo && this.combo.showView();
}, },
isViewVisible: function () { isViewVisible: function () {
return this.combo.isViewVisible(); return this.combo.isViewVisible();
} }
}); });
BI.BubbleCombo.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE"; BI.BubbleCombo.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";
BI.BubbleCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.BubbleCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.BubbleCombo.EVENT_EXPAND = "EVENT_EXPAND"; BI.BubbleCombo.EVENT_EXPAND = "EVENT_EXPAND";
BI.BubbleCombo.EVENT_COLLAPSE = "EVENT_COLLAPSE"; BI.BubbleCombo.EVENT_COLLAPSE = "EVENT_COLLAPSE";
BI.BubbleCombo.EVENT_AFTER_INIT = "EVENT_AFTER_INIT"; BI.BubbleCombo.EVENT_AFTER_INIT = "EVENT_AFTER_INIT";
BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.BubbleCombo.EVENT_AFTER_POPUPVIEW = "EVENT_AFTER_POPUPVIEW"; BI.BubbleCombo.EVENT_AFTER_POPUPVIEW = "EVENT_AFTER_POPUPVIEW";
BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW = "EVENT_BEFORE_HIDEVIEW"; BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW = "EVENT_BEFORE_HIDEVIEW";
BI.BubbleCombo.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; BI.BubbleCombo.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.shortcut("bi.bubble_combo", BI.BubbleCombo);/** BI.shortcut("bi.bubble_combo", BI.BubbleCombo);/**
* Created by GUY on 2017/2/8. * Created by GUY on 2017/2/8.
* *
@ -8495,181 +8495,181 @@ BI.ListLoader = BI.inherit(BI.Widget, {
} }
}); });
BI.ListLoader.EVENT_CHANGE = "EVENT_CHANGE"; BI.ListLoader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.list_loader", BI.ListLoader);/** BI.shortcut("bi.list_loader", BI.ListLoader);/**
* Created by GUY on 2016/4/29. * Created by GUY on 2016/4/29.
* *
* @class BI.SortList * @class BI.SortList
* @extends BI.Widget * @extends BI.Widget
*/ */
BI.SortList = BI.inherit(BI.Widget, { BI.SortList = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.SortList.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SortList.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-sort-list", baseCls: "bi-sort-list",
isDefaultInit: true,//是否默认初始化数据 isDefaultInit: true,//是否默认初始化数据
//下面是button_group的属性 //下面是button_group的属性
el: { el: {
type: "bi.button_group" type: "bi.button_group"
}, },
items: [], items: [],
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn, onLoaded: BI.emptyFn,
//下面是分页信息 //下面是分页信息
count: false, count: false,
next: {}, next: {},
hasNext: BI.emptyFn hasNext: BI.emptyFn
//containment: this.element, //containment: this.element,
//connectWith: ".bi-sort-list", //connectWith: ".bi-sort-list",
}) })
}, },
_init: function () { _init: function () {
BI.SortList.superclass._init.apply(this, arguments); BI.SortList.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.loader = BI.createWidget({ this.loader = BI.createWidget({
type: "bi.list_loader", type: "bi.list_loader",
element: this, element: this,
isDefaultInit: o.isDefaultInit, isDefaultInit: o.isDefaultInit,
el: o.el, el: o.el,
items: this._formatItems(o.items), items: this._formatItems(o.items),
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
o.itemsCreator(op, function (items) { o.itemsCreator(op, function (items) {
callback(self._formatItems(items)); callback(self._formatItems(items));
}); });
}, },
onLoaded: o.onLoaded, onLoaded: o.onLoaded,
count: o.count, count: o.count,
next: o.next, next: o.next,
hasNext: o.hasNext hasNext: o.hasNext
}); });
this.loader.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { this.loader.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) { if (type === BI.Events.CLICK) {
self.fireEvent(BI.SortList.EVENT_CHANGE, value, obj); self.fireEvent(BI.SortList.EVENT_CHANGE, value, obj);
} }
}); });
this.loader.element.sortable({ this.loader.element.sortable({
containment: o.containment || this.element, containment: o.containment || this.element,
connectWith: o.connectWith || ".bi-sort-list", connectWith: o.connectWith || ".bi-sort-list",
items: ".sort-item", items: ".sort-item",
cursor: o.cursor || "drag", cursor: o.cursor || "drag",
tolerance: o.tolerance || "intersect", tolerance: o.tolerance || "intersect",
placeholder: { placeholder: {
element: function ($currentItem) { element: function ($currentItem) {
var holder = BI.createWidget({ var holder = BI.createWidget({
type: "bi.layout", type: "bi.layout",
cls: "bi-sortable-holder", cls: "bi-sortable-holder",
height: $currentItem.outerHeight() height: $currentItem.outerHeight()
}); });
holder.element.css({ holder.element.css({
"margin-left": $currentItem.css("margin-left"), "margin-left": $currentItem.css("margin-left"),
"margin-right": $currentItem.css("margin-right"), "margin-right": $currentItem.css("margin-right"),
"margin-top": $currentItem.css("margin-top"), "margin-top": $currentItem.css("margin-top"),
"margin-bottom": $currentItem.css("margin-bottom"), "margin-bottom": $currentItem.css("margin-bottom"),
"margin": $currentItem.css("margin") "margin": $currentItem.css("margin")
}); });
return holder.element; return holder.element;
}, },
update: function () { update: function () {
} }
}, },
start: function (event, ui) { start: function (event, ui) {
}, },
stop: function (event, ui) { stop: function (event, ui) {
self.fireEvent(BI.SortList.EVENT_CHANGE); self.fireEvent(BI.SortList.EVENT_CHANGE);
}, },
over: function (event, ui) { over: function (event, ui) {
} }
}); });
}, },
_formatItems: function (items) { _formatItems: function (items) {
BI.each(items, function (i, item) { BI.each(items, function (i, item) {
item = BI.stripEL(item); item = BI.stripEL(item);
item.cls = item.cls ? item.cls + " sort-item" : "sort-item"; item.cls = item.cls ? item.cls + " sort-item" : "sort-item";
item.attributes = { item.attributes = {
sorted: item.value sorted: item.value
}; };
}); });
return items; return items;
}, },
hasNext: function () { hasNext: function () {
return this.loader.hasNext(); return this.loader.hasNext();
}, },
addItems: function (items) { addItems: function (items) {
this.loader.addItems(items); this.loader.addItems(items);
}, },
populate: function (items) { populate: function (items) {
if (items) { if (items) {
arguments[0] = this._formatItems(items); arguments[0] = this._formatItems(items);
} }
this.loader.populate.apply(this.loader, arguments); this.loader.populate.apply(this.loader, arguments);
}, },
empty: function () { empty: function () {
this.loader.empty(); this.loader.empty();
}, },
setNotSelectedValue: function () { setNotSelectedValue: function () {
this.loader.setNotSelectedValue.apply(this.loader, arguments); this.loader.setNotSelectedValue.apply(this.loader, arguments);
}, },
getNotSelectedValue: function () { getNotSelectedValue: function () {
return this.loader.getNotSelectedValue(); return this.loader.getNotSelectedValue();
}, },
setValue: function () { setValue: function () {
this.loader.setValue.apply(this.loader, arguments); this.loader.setValue.apply(this.loader, arguments);
}, },
getValue: function () { getValue: function () {
return this.loader.getValue(); return this.loader.getValue();
}, },
getAllButtons: function () { getAllButtons: function () {
return this.loader.getAllButtons(); return this.loader.getAllButtons();
}, },
getAllLeaves: function () { getAllLeaves: function () {
return this.loader.getAllLeaves(); return this.loader.getAllLeaves();
}, },
getSelectedButtons: function () { getSelectedButtons: function () {
return this.loader.getSelectedButtons(); return this.loader.getSelectedButtons();
}, },
getNotSelectedButtons: function () { getNotSelectedButtons: function () {
return this.loader.getNotSelectedButtons(); return this.loader.getNotSelectedButtons();
}, },
getIndexByValue: function (value) { getIndexByValue: function (value) {
return this.loader.getIndexByValue(value); return this.loader.getIndexByValue(value);
}, },
getNodeById: function (id) { getNodeById: function (id) {
return this.loader.getNodeById(id); return this.loader.getNodeById(id);
}, },
getNodeByValue: function (value) { getNodeByValue: function (value) {
return this.loader.getNodeByValue(value); return this.loader.getNodeByValue(value);
}, },
getSortedValues: function () { getSortedValues: function () {
return this.loader.element.sortable("toArray", {attribute: "sorted"}); return this.loader.element.sortable("toArray", {attribute: "sorted"});
} }
}); });
BI.SortList.EVENT_CHANGE = "EVENT_CHANGE"; BI.SortList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.sort_list", BI.SortList);/** BI.shortcut("bi.sort_list", BI.SortList);/**
* 有总页数和总行数的分页控件 * 有总页数和总行数的分页控件
* Created by Young's on 2016/10/13. * Created by Young's on 2016/10/13.
@ -12306,84 +12306,84 @@ BI.SimpleTreeView = BI.inherit(BI.Widget, {
}); });
BI.SimpleTreeView.EVENT_CHANGE = "EVENT_CHANGE"; BI.SimpleTreeView.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.simple_tree", BI.SimpleTreeView); BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
/** /**
* 文本输入框trigger * 文本输入框trigger
* *
* Created by GUY on 2015/9/15. * Created by GUY on 2015/9/15.
* @class BI.EditorTrigger * @class BI.EditorTrigger
* @extends BI.Trigger * @extends BI.Trigger
*/ */
BI.EditorTrigger = BI.inherit(BI.Trigger, { BI.EditorTrigger = BI.inherit(BI.Trigger, {
_const: { _const: {
hgap: 4 hgap: 4
}, },
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.EditorTrigger.superclass._defaultConfig.apply(this, arguments); var conf = BI.EditorTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-editor-trigger bi-border", baseCls: (conf.baseCls || "") + " bi-editor-trigger bi-border",
height: 30, height: 30,
validationChecker: BI.emptyFn, validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn, quitChecker: BI.emptyFn,
allowBlank: false, allowBlank: false,
watermark: "", watermark: "",
errorText: "", errorText: "",
triggerWidth: 30 triggerWidth: 30
}); });
}, },
_init: function () { _init: function () {
this.options.height -= 2; this.options.height -= 2;
BI.EditorTrigger.superclass._init.apply(this, arguments); BI.EditorTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options, c = this._const; var self = this, o = this.options, c = this._const;
this.editor = BI.createWidget({ this.editor = BI.createWidget({
type: "bi.sign_editor", type: "bi.sign_editor",
height: o.height, height: o.height,
value: o.value, value: o.value,
validationChecker: o.validationChecker, validationChecker: o.validationChecker,
quitChecker: o.quitChecker, quitChecker: o.quitChecker,
allowBlank: o.allowBlank, allowBlank: o.allowBlank,
watermark: o.watermark, watermark: o.watermark,
errorText: o.errorText errorText: o.errorText
}); });
this.editor.on(BI.Controller.EVENT_CHANGE, function () { this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}); });
this.editor.on(BI.SignEditor.EVENT_CHANGE, function () { this.editor.on(BI.SignEditor.EVENT_CHANGE, function () {
self.fireEvent(BI.EditorTrigger.EVENT_CHANGE, arguments); self.fireEvent(BI.EditorTrigger.EVENT_CHANGE, arguments);
}); });
BI.createWidget({ BI.createWidget({
element: this, element: this,
type: 'bi.htape', type: 'bi.htape',
items: [ items: [
{ {
el: this.editor el: this.editor
}, { }, {
el: { el: {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
cls: "bi-border-left", cls: "bi-border-left",
width: o.triggerWidth width: o.triggerWidth
}, },
width: o.triggerWidth width: o.triggerWidth
} }
] ]
}); });
}, },
getValue: function () { getValue: function () {
return this.editor.getValue(); return this.editor.getValue();
}, },
setValue: function (value) { setValue: function (value) {
this.editor.setValue(value); this.editor.setValue(value);
}, },
setText: function (text) { setText: function (text) {
this.editor.setState(text); this.editor.setState(text);
} }
}); });
BI.EditorTrigger.EVENT_CHANGE = "BI.EditorTrigger.EVENT_CHANGE"; BI.EditorTrigger.EVENT_CHANGE = "BI.EditorTrigger.EVENT_CHANGE";
BI.shortcut("bi.editor_trigger", BI.EditorTrigger);/** BI.shortcut("bi.editor_trigger", BI.EditorTrigger);/**
* 图标按钮trigger * 图标按钮trigger
* *

388
dist/demo.js vendored

@ -5088,200 +5088,200 @@ Demo.COMPONENT_CONFIG = [{
pId: 5, pId: 5,
text: "bi.tree_value_chooser_pane", text: "bi.tree_value_chooser_pane",
value: "demo.tree_value_chooser_pane" value: "demo.tree_value_chooser_pane"
}];Demo.CORE_CONFIG = [{ }];Demo.CORE_CONFIG = [{
id: 1, id: 1,
text: "核心控件" text: "核心控件"
}, { }, {
id: 101, id: 101,
pId: 1, pId: 1,
text: "布局" text: "布局"
}, { }, {
pId: 101, pId: 101,
text: "bi.absolute", text: "bi.absolute",
value: "demo.absolute" value: "demo.absolute"
}, { }, {
pId: 101, pId: 101,
text: "bi.center_adapt", text: "bi.center_adapt",
value: "demo.center_adapt" value: "demo.center_adapt"
}, { }, {
pId: 101, pId: 101,
text: "bi.vertical_adapt", text: "bi.vertical_adapt",
value: "demo.vertical_adapt" value: "demo.vertical_adapt"
}, { }, {
pId: 101, pId: 101,
text: "bi.horizontal_adapt", text: "bi.horizontal_adapt",
value: "demo.horizontal_adapt" value: "demo.horizontal_adapt"
}, { }, {
pId: 101, pId: 101,
text: "bi.horizontal_auto", text: "bi.horizontal_auto",
value: "demo.horizontal_auto" value: "demo.horizontal_auto"
}, { }, {
pId: 101, pId: 101,
text: "bi.horizontal_float", text: "bi.horizontal_float",
value: "demo.horizontal_float" value: "demo.horizontal_float"
}, { }, {
pId: 101, pId: 101,
text: "bi.left_right_vertical_adapt", text: "bi.left_right_vertical_adapt",
value: "demo.left_right_vertical_adapt" value: "demo.left_right_vertical_adapt"
}, { }, {
pId: 101, pId: 101,
text: "bi.center", text: "bi.center",
value: "demo.center_layout" value: "demo.center_layout"
}, { }, {
pId: 101, pId: 101,
text: "bi.float_center", text: "bi.float_center",
value: "demo.float_center" value: "demo.float_center"
}, { }, {
pId: 101, pId: 101,
text: "bi.vertical", text: "bi.vertical",
value: "demo.vertical" value: "demo.vertical"
}, { }, {
pId: 101, pId: 101,
text: "bi.horizontal", text: "bi.horizontal",
value: "demo.horizontal" value: "demo.horizontal"
}, { }, {
pId: 101, pId: 101,
text: "bi.border", text: "bi.border",
value: "demo.border" value: "demo.border"
}, { }, {
pId: 101, pId: 101,
text: "bi.left, bi.right", text: "bi.left, bi.right",
value: "demo.flow" value: "demo.flow"
}, { }, {
pId: 101, pId: 101,
text: "bi.htape", text: "bi.htape",
value: "demo.htape" value: "demo.htape"
}, { }, {
pId: 101, pId: 101,
text: "bi.vtape", text: "bi.vtape",
value: "demo.vtape" value: "demo.vtape"
}, { }, {
pId: 101, pId: 101,
text: "bi.grid", text: "bi.grid",
value: "demo.grid" value: "demo.grid"
}, { }, {
pId: 101, pId: 101,
text: "bi.table", text: "bi.table",
value: "demo.table_layout" value: "demo.table_layout"
}, { }, {
pId: 101, pId: 101,
text: "bi.td", text: "bi.td",
value: "demo.td" value: "demo.td"
}, { }, {
pId: 101, pId: 101,
text: "..." text: "..."
}, { }, {
pId: 1, pId: 1,
id: 102, id: 102,
text: "抽象控件" text: "抽象控件"
}, { }, {
pId: 102, pId: 102,
text: "bi.button_group", text: "bi.button_group",
value: "demo.button_group" value: "demo.button_group"
}, { }, {
pId: 102, pId: 102,
text: "bi.button_tree", text: "bi.button_tree",
value: "demo.button_tree" value: "demo.button_tree"
}, { }, {
pId: 102, pId: 102,
text: "bi.virtual_group", text: "bi.virtual_group",
value: "demo.virtual_group" value: "demo.virtual_group"
}, { }, {
pId: 102, pId: 102,
text: "bi.custom_tree", text: "bi.custom_tree",
value: "demo.custom_tree" value: "demo.custom_tree"
}, { }, {
pId: 102, pId: 102,
text: "bi.grid_view", text: "bi.grid_view",
value: "demo.grid_view" value: "demo.grid_view"
}, { }, {
pId: 102, pId: 102,
text: "bi.collection_view", text: "bi.collection_view",
value: "demo.collection_view" value: "demo.collection_view"
}, { }, {
pId: 102, pId: 102,
text: "bi.list_view", text: "bi.list_view",
value: "demo.list_view" value: "demo.list_view"
}, { }, {
pId: 102, pId: 102,
text: "bi.virtual_list", text: "bi.virtual_list",
value: "demo.virtual_list" value: "demo.virtual_list"
}, { }, {
pId: 102, pId: 102,
id: 10201, id: 10201,
text: "组合控件" text: "组合控件"
}, { }, {
pId: 10201, pId: 10201,
text: "bi.combo", text: "bi.combo",
value: "demo.combo" value: "demo.combo"
}, { }, {
pId: 10201, pId: 10201,
text: "bi.combo(各种位置)", text: "bi.combo(各种位置)",
value: "demo.combo2" value: "demo.combo2"
}, { }, {
pId: 10201, pId: 10201,
text: "bi.expander", text: "bi.expander",
value: "demo.expander" value: "demo.expander"
}, { }, {
pId: 10201, pId: 10201,
text: "bi.combo_group", text: "bi.combo_group",
value: "demo.combo_group" value: "demo.combo_group"
}, { }, {
pId: 10201, pId: 10201,
text: "bi.loader", text: "bi.loader",
value: "demo.loader" value: "demo.loader"
}, { }, {
pId: 10201, pId: 10201,
text: "bi.navigation", text: "bi.navigation",
value: "demo.navigation" value: "demo.navigation"
}, { }, {
pId: 10201, pId: 10201,
text: "bi.searcher", text: "bi.searcher",
value: "demo.searcher" value: "demo.searcher"
}, { }, {
pId: 10201, pId: 10201,
text: "bi.switcher", text: "bi.switcher",
value: "demo.switcher" value: "demo.switcher"
}, { }, {
pId: 10201, pId: 10201,
text: "bi.tab", text: "bi.tab",
value: "demo.tab" value: "demo.tab"
}, { }, {
pId: 102, pId: 102,
id: 10202, id: 10202,
text: "弹出层" text: "弹出层"
}, { }, {
pId: 10202, pId: 10202,
text: "bi.float_box", text: "bi.float_box",
value: "demo.float_box" value: "demo.float_box"
}, { }, {
pId: 10202, pId: 10202,
text: "bi.popup_view", text: "bi.popup_view",
value: "demo.popup_view" value: "demo.popup_view"
}, { }, {
pId: 10202, pId: 10202,
text: "bi.searcher_view", text: "bi.searcher_view",
value: "demo.searcher_view" value: "demo.searcher_view"
}, { }, {
pId: 1, pId: 1,
text: "Widget", text: "Widget",
value: "demo.widget" value: "demo.widget"
}, { }, {
pId: 1, pId: 1,
text: "Single", text: "Single",
value: "demo.single" value: "demo.single"
}, { }, {
pId: 1, pId: 1,
text: "BasicButton", text: "BasicButton",
value: "demo.basic_button" value: "demo.basic_button"
}, { }, {
pId: 1, pId: 1,
text: "NodeButton", text: "NodeButton",
value: "demo.node_button" value: "demo.node_button"
}, { }, {
pId: 1, pId: 1,
text: "Pane", text: "Pane",
value: "demo.pane" value: "demo.pane"
}];//定义Model路由 }];//定义Model路由
var modelRouter = new (BI.inherit(BI.WRouter, { var modelRouter = new (BI.inherit(BI.WRouter, {
routes: { routes: {

2
dist/widget.css vendored

@ -181,7 +181,7 @@
font-size: 14px; font-size: 14px;
} }
.bi-number-interval.number-error .bi-input { .bi-number-interval.number-error .bi-input {
color: #e85050; color: #e85050 !important;
} }
.bi-page-table-cell { .bi-page-table-cell {
-webkit-user-select: text; -webkit-user-select: text;

2
src/css/widget/numberinterval/numberinterval.css

@ -37,5 +37,5 @@
font-size: 14px; font-size: 14px;
} }
.bi-number-interval.number-error .bi-input { .bi-number-interval.number-error .bi-input {
color: #e85050; color: #e85050 !important;
} }

Loading…
Cancel
Save