Browse Source

Merge pull request #167 in FUI/fineui from ~GUY/fineui:master to master

* commit '129252730df4bb1c6d7abec6bf5293162608b464':
  update
  update
  update
  update
  高度默认24
  update
  update
  update
  date.js加一个根据指定时区转换当前时区时间的方法
  update
es6
guy 7 years ago
parent
commit
d0d6060920
  1. 8
      bi/base.js
  2. 65
      bi/case.js
  3. 9
      bi/core.js
  4. 335
      bi/widget.js
  5. 7
      demo/js/config/fix.js
  6. 49
      demo/js/fix-2.0/globalwatcher.js
  7. 1
      demo/version.js
  8. 8
      dist/base.js
  9. 592
      dist/bundle.js
  10. 70
      dist/bundle.min.js
  11. 65
      dist/case.js
  12. 1
      dist/config.js
  13. 9
      dist/core.js
  14. 55
      dist/demo.js
  15. 7
      dist/fix/fix.compact.js
  16. 68
      dist/fix/fix.js
  17. 335
      dist/widget.js
  18. 11
      docs/_book/gitbook/gitbook-plugin-livereload/plugin.js
  19. 1
      public/js/index.js
  20. 4
      src/base/combination/group.combo.js
  21. 2
      src/base/richeditor/plugins/combo.sizechooser.js
  22. 2
      src/base/single/trigger/trigger.js
  23. 2
      src/case/combo/editoriconcheckcombo/combo.editoriconcheck.js
  24. 2
      src/case/combo/staticcombo/combo.static.js
  25. 2
      src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js
  26. 2
      src/case/editor/editor.clear.js
  27. 2
      src/case/editor/editor.shelter.js
  28. 2
      src/case/editor/editor.sign.initial.js
  29. 2
      src/case/editor/editor.sign.js
  30. 2
      src/case/editor/editor.state.js
  31. 2
      src/case/editor/editor.state.simple.js
  32. 9
      src/case/list/list.select.js
  33. 2
      src/case/segment/segment.js
  34. 9
      src/case/trigger/trigger.editor.js
  35. 2
      src/case/trigger/trigger.icon.js
  36. 11
      src/case/trigger/trigger.icon.text.js
  37. 7
      src/case/trigger/trigger.text.js
  38. 7
      src/case/trigger/trigger.text.small.js
  39. 9
      src/core/proto/date.js
  40. 229
      src/widget/adaptivearrangement/adaptivearrangement.js
  41. 51
      src/widget/arrangement/arrangement.js
  42. 3
      src/widget/date/trigger.date.js
  43. 2
      src/widget/datetime/datetime.combo.js
  44. 3
      src/widget/datetime/datetime.trigger.js
  45. 2
      src/widget/editor/editor.search.js
  46. 2
      src/widget/editor/editor.text.js
  47. 11
      src/widget/month/trigger.month.js
  48. 8
      src/widget/multidate/multidate.combo.js
  49. 7
      src/widget/quarter/trigger.quarter.js
  50. 2
      src/widget/singletree/singletree.combo.js
  51. 2
      src/widget/singletree/singletree.trigger.js
  52. 11
      src/widget/year/trigger.year.js

8
bi/base.js

@ -3639,10 +3639,10 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
_init: function () {
BI.ComboGroup.superclass._init.apply(this, arguments);
this.populate(this.options.el);
this._populate(this.options.el);
},
populate: function (item) {
_populate: function (item) {
var self = this, o = this.options;
var children = o.children;
if (BI.isEmpty(children)) {
@ -17104,7 +17104,7 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
type: "bi.text_trigger",
readonly: true,
height: o.height,
triggerWidth: 12,
triggerWidth: 16,
text: BI.i18nText("BI-Font_Size")
});
@ -21477,7 +21477,7 @@ BI.Trigger = BI.inherit(BI.Single, {
var conf = BI.Trigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger cursor-pointer",
height: 30
height: 24
})
},

65
bi/case.js

@ -5137,7 +5137,7 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-check-editor-combo",
width: 100,
height: 30,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
@ -5457,7 +5457,7 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.StaticCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-static-combo",
height: 30,
height: 24,
text: "",
el: {},
items: [],
@ -5523,7 +5523,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-text-value-check-combo",
width: 100,
height: 30,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: ""
})
@ -6036,7 +6036,7 @@ BI.ClearEditor = BI.inherit(BI.Widget, {
var conf = BI.ClearEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-clear-editor",
height: 30,
height: 24,
errorText: "",
watermark: "",
validationChecker: BI.emptyFn,
@ -6215,7 +6215,7 @@ BI.ShelterEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30,
height: 24,
textAlign: "left"
})
},
@ -6472,7 +6472,7 @@ BI.SignInitialEditor = BI.inherit(BI.Widget, {
errorText: "",
value: "",
text: "",
height: 30
height: 24
})
},
@ -6739,7 +6739,7 @@ BI.SignEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30
height: 24
})
},
@ -6997,7 +6997,7 @@ BI.StateEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30
height: 24
})
},
@ -7271,7 +7271,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30
height: 24
})
},
@ -7958,10 +7958,11 @@ BI.SelectList = BI.inherit(BI.Widget, {
//全选
this.toolbar = BI.createWidget(o.toolbar);
this.allSelected = false;
this.toolbar.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
var isAllSelected = this.isSelected();
self.allSelected = this.isSelected();
if (type === BI.Events.CLICK) {
self.setAllSelected(isAllSelected);
self.setAllSelected(self.allSelected);
self.fireEvent(BI.SelectList.EVENT_CHANGE, value, obj);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -8022,6 +8023,7 @@ BI.SelectList = BI.inherit(BI.Widget, {
BI.each(this.getAllButtons(), function (i, btn) {
(btn.setSelected || btn.setAllSelected).apply(btn, [v]);
});
this.allSelected = !!v;
this.toolbar.setSelected(v);
this.toolbar.setHalfSelected(false);
},
@ -8031,7 +8033,8 @@ BI.SelectList = BI.inherit(BI.Widget, {
},
isAllSelected: function () {
return this.toolbar.isSelected();
return this.allSelected;
// return this.toolbar.isSelected();
},
hasPrev: function () {
@ -9400,7 +9403,7 @@ BI.Segment = BI.inherit(BI.Widget, {
return BI.extend(BI.Segment.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-segment",
items: [],
height: 30
height: 24
});
},
_init: function () {
@ -12260,13 +12263,12 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
var conf = BI.EditorTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-editor-trigger bi-border",
height: 30,
height: 24,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: false,
watermark: "",
errorText: "",
triggerWidth: 30
errorText: ""
});
},
@ -12301,9 +12303,9 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
el: {
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: o.triggerWidth
width: o.triggerWidth || o.height
},
width: o.triggerWidth
width: o.triggerWidth || o.height
}
]
});
@ -12335,7 +12337,7 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger",
el: {},
height: 30
height: 24
});
},
_init: function () {
@ -12358,15 +12360,14 @@ BI.shortcut('bi.icon_trigger', BI.IconTrigger);/**
*/
BI.IconTextTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
triggerWidth: 30
hgap: 4
},
_defaultConfig: function () {
var conf = BI.IconTextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 30
height: 24
});
},
@ -12383,7 +12384,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: c.triggerWidth
width: o.triggerWidth || o.height
});
BI.createWidget({
@ -12398,13 +12399,13 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
disableSelected: true
},
width: 24
width: o.triggerWidth || o.height
},
{
el: this.text
}, {
el: this.trigerButton,
width: c.triggerWidth
width: o.triggerWidth || o.height
}
]
});
@ -12440,8 +12441,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 30,
triggerWidth: 30
height: 24
});
},
@ -12459,7 +12459,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: o.triggerWidth
width: o.triggerWidth || o.height
});
BI.createWidget({
@ -12470,7 +12470,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
el: this.text
}, {
el: this.trigerButton,
width: o.triggerWidth
width: o.triggerWidth || o.height
}
]
});
@ -12606,8 +12606,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
var conf = BI.SmallTextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 20,
triggerWidth: 20
height: 20
});
},
@ -12623,7 +12622,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
});
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.triggerWidth
width: o.triggerWidth || o.height
});
BI.createWidget({
@ -12634,7 +12633,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
el: this.text
}, {
el: this.trigerButton,
width: o.triggerWidth
width: o.triggerWidth || o.height
}
]
});

9
bi/core.js

@ -20877,6 +20877,15 @@ Date.prototype.getBeforeMultiMonth = function (n) {
return dt;
};
//获得当前时区对应指定时区的时间
Date.prototype.getTimeZoneTimeByTimezoneOffset = function (offset) {
var dt = new Date(this.getTime());
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + offset);
};
/** Checks date and time equality */
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&

335
bi/widget.js

@ -491,60 +491,7 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
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);
// }
// });
},
// _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;
// }
// },
},
_getScrollOffset: function () {
return this.arrangement._getScrollOffset();
@ -605,99 +552,99 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
},
scrollInterval: function (e, isBorderScroll, isOverflowScroll, cb) {
var self = this;
var map = {
top: [-1, 0],
bottom: [1, 0],
left: [0, -1],
right: [0, 1]
};
var clientWidth = this.arrangement.getClientWidth();
var clientHeight = this.arrangement.getClientHeight();
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);
}
}
// var self = this;
// var map = {
// top: [-1, 0],
// bottom: [1, 0],
// left: [0, -1],
// right: [0, 1]
// };
// var clientWidth = this.arrangement.getClientWidth();
// var clientHeight = this.arrangement.getClientHeight();
//
// 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);
// }
// }
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 >= clientHeight - 30 && p.top <= clientHeight) {
scrollTo("bottom", cb)
}
//向左滚
else if (isBorderScroll && p.left >= 0 && p.left <= 30) {
scrollTo("left", cb)
}
//向右滚
else if (isBorderScroll && p.left >= clientWidth - 30 && p.left <= clientWidth) {
scrollTo("right", cb)
} else {
if (isOverflowScroll === true) {
if (p.top < 0) {
scrollTo("top", cb);
}
else if (p.top > clientHeight) {
scrollTo("bottom", cb);
}
else if (p.left < 0) {
scrollTo("left", cb);
}
else if (p.left > clientWidth) {
scrollTo("right", cb);
} else {
scrollTo("", cb);
}
} else {
scrollTo("", cb);
}
}
// 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 >= clientHeight - 30 && p.top <= clientHeight) {
// scrollTo("bottom", cb)
// }
// //向左滚
// else if (isBorderScroll && p.left >= 0 && p.left <= 30) {
// scrollTo("left", cb)
// }
// //向右滚
// else if (isBorderScroll && p.left >= clientWidth - 30 && p.left <= clientWidth) {
// scrollTo("right", cb)
// } else {
// if (isOverflowScroll === true) {
// if (p.top < 0) {
// scrollTo("top", cb);
// }
// else if (p.top > clientHeight) {
// scrollTo("bottom", cb);
// }
// else if (p.left < 0) {
// scrollTo("left", cb);
// }
// else if (p.left > clientWidth) {
// scrollTo("right", cb);
// } else {
// scrollTo("", cb);
// }
// } else {
// scrollTo("", cb);
// }
// }
},
scrollEnd: function () {
@ -829,30 +776,30 @@ BI.Arrangement = BI.inherit(BI.Widget, {
});
this.container = BI.createWidget({
type: "bi.absolute",
scrollable: true,
cls: "arrangement-container",
items: o.items.concat([this.block, this.arrangement])
});
this.scrollContainer = BI.createWidget({
type: "bi.adaptive",
width: "100%",
height: "100%",
scrollable: true,
items: [this.container]
});
this.scrollContainer.element.scroll(function () {
this.container.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
scrollLeft: self.container.element.scrollLeft(),
scrollTop: self.container.element.scrollTop(),
clientWidth: self.container.element[0].clientWidth,
clientHeight: self.container.element[0].clientHeight
});
});
BI.createWidget({
type: "bi.adaptive",
type: "bi.absolute",
element: this,
items: [this.scrollContainer]
items: [{
el: this.container,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.regions = {};
if (o.items.length > 0) {
@ -1050,8 +997,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
_getScrollOffset: function () {
return {
left: this.scrollContainer.element[0].scrollLeft,
top: this.scrollContainer.element[0].scrollTop
left: this.container.element[0].scrollLeft,
top: this.container.element[0].scrollTop
}
},
@ -1102,26 +1049,15 @@ BI.Arrangement = BI.inherit(BI.Widget, {
},
getClientWidth: function () {
return this.scrollContainer.element[0].clientWidth;
return this.container.element[0].clientWidth;
},
getClientHeight: function () {
return this.scrollContainer.element[0].clientHeight;
return this.container.element[0].clientHeight;
},
_applyContainer: function () {
//先掩藏后显示能够明确滚动条是否出现
this.scrollContainer.element.css("overflow", "hidden");
var occupied = this._getRegionOccupied();
if (this.container._width !== occupied.left + occupied.width) {
this.container.element.width(occupied.left + occupied.width);
this.container._width = occupied.left + occupied.width;
}
if (this.container._height !== occupied.top + occupied.height) {
this.container.element.height(occupied.top + occupied.height);
this.container._height = occupied.top + occupied.height;
}
this.scrollContainer.element.css("overflow", "auto");
return occupied;
},
@ -1692,8 +1628,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
},
scrollTo: function (scroll) {
this.scrollContainer.element.scrollTop(scroll.top);
this.scrollContainer.element.scrollLeft(scroll.left);
this.container.element.scrollTop(scroll.top);
this.container.element.scrollLeft(scroll.left);
},
zoom: function (ratio) {
@ -2357,7 +2293,6 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 30,
yearLength: 4,
yearMonthLength: 7
},
@ -2367,7 +2302,7 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
extraCls: "bi-date-trigger",
min: '1900-01-01', //最小日期
max: '2099-12-31', //最大日期
height: 25
height: 24
});
},
_init: function () {
@ -2871,7 +2806,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
var triggerBtn = BI.createWidget({
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-font bi-border-right",
width: 30,
width: 24,
height: 24
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
@ -3209,7 +3144,6 @@ BI.shortcut("bi.date_time_select", BI.DateTimeSelect);/**
BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
triggerWidth: 30
},
_defaultConfig: function () {
@ -3237,7 +3171,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
element: this,
items: [{
el: BI.createWidget(),
width: c.triggerWidth
width: o.height
}, {
el: this.text
}]
@ -4073,7 +4007,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-search-editor bi-border",
height: 30,
height: 24,
errorText: "",
watermark: BI.i18nText("BI-Basic_Search"),
validationChecker: BI.emptyFn,
@ -4292,7 +4226,7 @@ BI.TextEditor = BI.inherit(BI.Widget, {
allowBlank: false,
watermark: "",
errorText: "",
height: 30
height: 24
})
},
@ -5847,14 +5781,13 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 25,
errorText: BI.i18nText("BI-Month_Trigger_Error_Text")
},
_defaultConfig: function () {
return BI.extend(BI.MonthTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-month-trigger bi-border",
height: 25
height: 24
});
},
_init: function () {
@ -5910,15 +5843,15 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
type: "bi.text_button",
text: BI.i18nText("BI-Multi_Date_Month"),
baseCls: "bi-trigger-month-text",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}
]
});
@ -6230,8 +6163,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
var triggerBtn = BI.createWidget({
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-font",
width: 30,
height: 23
width: 24,
height: 24
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
if (self.combo.isViewVisible()) {
@ -6243,8 +6176,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
this.changeIcon = BI.createWidget({
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 30,
height: 23
width: 24,
height: 24
});
@ -13989,7 +13922,6 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 30,
textWidth: 40,
errorText: BI.i18nText("BI-Quarter_Trigger_Error_Text")
},
@ -13997,7 +13929,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.QuarterTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-quarter-trigger bi-border",
height: 25
height: 24
});
},
_init: function () {
@ -14060,9 +13992,9 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}, {
el: {
type: "bi.trigger_icon_button",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}
]
});
@ -16133,7 +16065,7 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.SingleTreeCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-combo",
trigger: {},
height: 30,
height: 24,
text: "",
items: []
});
@ -16268,7 +16200,7 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SingleTreeTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-trigger",
height: 30,
height: 24,
text: "",
items: []
});
@ -16833,7 +16765,6 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 25,
errorText: BI.i18nText("BI-Please_Input_Positive_Integer"),
errorTextInvalid: BI.i18nText("BI-Year_Trigger_Invalid_Text")
},
@ -16843,7 +16774,7 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
extraCls: "bi-year-trigger bi-border",
min: '1900-01-01', //最小日期
max: '2099-12-31', //最大日期
height: 25
height: 24
});
},
_init: function () {
@ -16900,15 +16831,15 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
type: "bi.text_button",
baseCls: "bi-trigger-year-text",
text: BI.i18nText("BI-Multi_Date_Year"),
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}
]
});

7
demo/js/config/fix.js

@ -101,11 +101,16 @@ Demo.FIX_CONFIG = [{
}, {
id: 74,
pId: 7,
text: "watcher表达式",
text: "watcher且或表达式",
value: "demo.fix4"
}, {
id: 75,
pId: 7,
text: "watcher星号表达式",
value: "demo.fix5"
}, {
id: 76,
pId: 7,
text: "一个混合的例子",
value: "demo.fix"
}];

49
demo/js/fix-2.0/globalwatcher.js

@ -0,0 +1,49 @@
;(function () {
var model = Fix.define({
name: "原始属性",
arr: [{
n: 'a'
}, {
n: 0
}]
});
Demo.Fix = BI.inherit(BI.Widget, {
_store: function () {
return model;
},
watch: {
"arr.**": function () {
debugger
},
"arr.1.*": function () {
this.button.setText(this.model.name + "-" + this.model.arr[1].n)
}
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.arr[0].n += 1;
self.model.arr[1].n += 1;
},
text: this.model.name + "-" + this.model.arr[1].n
}
}]
}
},
mounted: function () {
}
});
BI.shortcut("demo.fix5", Demo.Fix);
}());

1
demo/version.js

@ -122,6 +122,7 @@ BI.i18n = {
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间",
"BI-Basic_Time": "时间",
"BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定",
"BI-Basic_Simple_Thursday": "四",
"BI-Multi_Date_Year_Prev": "年前",
"BI-Tiao_Data": "条数据",

8
dist/base.js vendored

@ -3639,10 +3639,10 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
_init: function () {
BI.ComboGroup.superclass._init.apply(this, arguments);
this.populate(this.options.el);
this._populate(this.options.el);
},
populate: function (item) {
_populate: function (item) {
var self = this, o = this.options;
var children = o.children;
if (BI.isEmpty(children)) {
@ -17104,7 +17104,7 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
type: "bi.text_trigger",
readonly: true,
height: o.height,
triggerWidth: 12,
triggerWidth: 16,
text: BI.i18nText("BI-Font_Size")
});
@ -21477,7 +21477,7 @@ BI.Trigger = BI.inherit(BI.Single, {
var conf = BI.Trigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger cursor-pointer",
height: 30
height: 24
})
},

592
dist/bundle.js vendored

@ -1,55 +1,4 @@
if (!window.BI) {
window.BI = {};
}
BI.servletURL = "https://fanruan.coding.me/fineui/dist/";
BI.resourceURL = "https://fanruan.coding.me/fineui/dist/resource/";
BI.i18n = {
"BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定",
"BI-Basic_Clears": "清空",
"BI-Basic_Cancel": "取消",
"BI-Basic_Time": "时间",
"BI-Basic_Simple_Sunday": "日",
"BI-Basic_Simple_Monday": "一",
"BI-Basic_Simple_Tuesday": "二",
"BI-Basic_Simple_Wednesday": "三",
"BI-Basic_Simple_Thursday": "四",
"BI-Basic_Simple_Friday": "五",
"BI-Basic_Simple_Saturday": "六",
"BI-Multi_Date_Year": "年",
"BI-Multi_Date_Month": "月",
"BI-Multi_Date_Quarter": "季度",
"BI-Basic_Unrestricted": "无限制",
"BI-Quarter_1": "第1季度",
"BI-Quarter_2": "第2季度",
"BI-Quarter_3": "第3季度",
"BI-Quarter_4": "第4季度",
"BI-Basic_Value": "值",
"BI-Load_More": "加载更多",
"BI-Select_All": "全选",
"BI-Basic_Auto": "自动",
"BI-No_More_Data": "无更多数据",
"BI-No_Selected_Value": "没有可选项",
"BI-Basic_Clear": "清除",
"BI-Multi_Date_Relative_Current_Time": "相对当前时间",
"BI-Multi_Date_Year_Prev": "年前",
"BI-Multi_Date_Year_Next": "年后",
"BI-Multi_Date_Year_Begin": "年初",
"BI-Multi_Date_Year_End": "年末",
"BI-Multi_Date_Quarter_Prev": "个季度前",
"BI-Multi_Date_Quarter_Next": "个季度后",
"BI-Multi_Date_Quarter_Begin": "季度初",
"BI-Multi_Date_Quarter_End": "季度末",
"BI-Multi_Date_Month_Prev": "个月前",
"BI-Multi_Date_Month_Next": "个月后",
"BI-Multi_Date_Month_Begin": "月初",
"BI-Multi_Date_Month_End": "月末",
"BI-Multi_Date_Week_Prev": "周前",
"BI-Multi_Date_Week_Next": "周后",
"BI-Multi_Date_Day_Prev": "天前",
"BI-Multi_Date_Day_Next": "天后",
"BI-Multi_Date_Today": "今天"
};/*!
/*!
* jQuery JavaScript Library v1.9.1
* http://jquery.com/
*
@ -20928,6 +20877,15 @@ Date.prototype.getBeforeMultiMonth = function (n) {
return dt;
};
//获得当前时区对应指定时区的时间
Date.prototype.getTimeZoneTimeByTimezoneOffset = function (offset) {
var dt = new Date(this.getTime());
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + offset);
};
/** Checks date and time equality */
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
@ -29422,10 +29380,10 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
_init: function () {
BI.ComboGroup.superclass._init.apply(this, arguments);
this.populate(this.options.el);
this._populate(this.options.el);
},
populate: function (item) {
_populate: function (item) {
var self = this, o = this.options;
var children = o.children;
if (BI.isEmpty(children)) {
@ -42887,7 +42845,7 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
type: "bi.text_trigger",
readonly: true,
height: o.height,
triggerWidth: 12,
triggerWidth: 16,
text: BI.i18nText("BI-Font_Size")
});
@ -47260,7 +47218,7 @@ BI.Trigger = BI.inherit(BI.Single, {
var conf = BI.Trigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger cursor-pointer",
height: 30
height: 24
})
},
@ -67544,7 +67502,7 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-check-editor-combo",
width: 100,
height: 30,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
@ -67864,7 +67822,7 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.StaticCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-static-combo",
height: 30,
height: 24,
text: "",
el: {},
items: [],
@ -67930,7 +67888,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-text-value-check-combo",
width: 100,
height: 30,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: ""
})
@ -68443,7 +68401,7 @@ BI.ClearEditor = BI.inherit(BI.Widget, {
var conf = BI.ClearEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-clear-editor",
height: 30,
height: 24,
errorText: "",
watermark: "",
validationChecker: BI.emptyFn,
@ -68622,7 +68580,7 @@ BI.ShelterEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30,
height: 24,
textAlign: "left"
})
},
@ -68879,7 +68837,7 @@ BI.SignInitialEditor = BI.inherit(BI.Widget, {
errorText: "",
value: "",
text: "",
height: 30
height: 24
})
},
@ -69146,7 +69104,7 @@ BI.SignEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30
height: 24
})
},
@ -69404,7 +69362,7 @@ BI.StateEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30
height: 24
})
},
@ -69678,7 +69636,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30
height: 24
})
},
@ -70365,10 +70323,11 @@ BI.SelectList = BI.inherit(BI.Widget, {
//全选
this.toolbar = BI.createWidget(o.toolbar);
this.allSelected = false;
this.toolbar.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
var isAllSelected = this.isSelected();
self.allSelected = this.isSelected();
if (type === BI.Events.CLICK) {
self.setAllSelected(isAllSelected);
self.setAllSelected(self.allSelected);
self.fireEvent(BI.SelectList.EVENT_CHANGE, value, obj);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -70429,6 +70388,7 @@ BI.SelectList = BI.inherit(BI.Widget, {
BI.each(this.getAllButtons(), function (i, btn) {
(btn.setSelected || btn.setAllSelected).apply(btn, [v]);
});
this.allSelected = !!v;
this.toolbar.setSelected(v);
this.toolbar.setHalfSelected(false);
},
@ -70438,7 +70398,8 @@ BI.SelectList = BI.inherit(BI.Widget, {
},
isAllSelected: function () {
return this.toolbar.isSelected();
return this.allSelected;
// return this.toolbar.isSelected();
},
hasPrev: function () {
@ -71807,7 +71768,7 @@ BI.Segment = BI.inherit(BI.Widget, {
return BI.extend(BI.Segment.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-segment",
items: [],
height: 30
height: 24
});
},
_init: function () {
@ -74667,13 +74628,12 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
var conf = BI.EditorTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-editor-trigger bi-border",
height: 30,
height: 24,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: false,
watermark: "",
errorText: "",
triggerWidth: 30
errorText: ""
});
},
@ -74708,9 +74668,9 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
el: {
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: o.triggerWidth
width: o.triggerWidth || o.height
},
width: o.triggerWidth
width: o.triggerWidth || o.height
}
]
});
@ -74742,7 +74702,7 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger",
el: {},
height: 30
height: 24
});
},
_init: function () {
@ -74765,15 +74725,14 @@ BI.shortcut('bi.icon_trigger', BI.IconTrigger);/**
*/
BI.IconTextTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
triggerWidth: 30
hgap: 4
},
_defaultConfig: function () {
var conf = BI.IconTextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 30
height: 24
});
},
@ -74790,7 +74749,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: c.triggerWidth
width: o.triggerWidth || o.height
});
BI.createWidget({
@ -74805,13 +74764,13 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
disableSelected: true
},
width: 24
width: o.triggerWidth || o.height
},
{
el: this.text
}, {
el: this.trigerButton,
width: c.triggerWidth
width: o.triggerWidth || o.height
}
]
});
@ -74847,8 +74806,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 30,
triggerWidth: 30
height: 24
});
},
@ -74866,7 +74824,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: o.triggerWidth
width: o.triggerWidth || o.height
});
BI.createWidget({
@ -74877,7 +74835,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
el: this.text
}, {
el: this.trigerButton,
width: o.triggerWidth
width: o.triggerWidth || o.height
}
]
});
@ -75013,8 +74971,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
var conf = BI.SmallTextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 20,
triggerWidth: 20
height: 20
});
},
@ -75030,7 +74987,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
});
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.triggerWidth
width: o.triggerWidth || o.height
});
BI.createWidget({
@ -75041,7 +74998,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
el: this.text
}, {
el: this.trigerButton,
width: o.triggerWidth
width: o.triggerWidth || o.height
}
]
});
@ -75548,61 +75505,8 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
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);
// }
// });
},
// _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;
// }
// },
_getScrollOffset: function () {
return this.arrangement._getScrollOffset();
},
@ -75662,99 +75566,99 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
},
scrollInterval: function (e, isBorderScroll, isOverflowScroll, cb) {
var self = this;
var map = {
top: [-1, 0],
bottom: [1, 0],
left: [0, -1],
right: [0, 1]
};
var clientWidth = this.arrangement.getClientWidth();
var clientHeight = this.arrangement.getClientHeight();
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);
}
}
// var self = this;
// var map = {
// top: [-1, 0],
// bottom: [1, 0],
// left: [0, -1],
// right: [0, 1]
// };
// var clientWidth = this.arrangement.getClientWidth();
// var clientHeight = this.arrangement.getClientHeight();
//
// 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);
// }
// }
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 >= clientHeight - 30 && p.top <= clientHeight) {
scrollTo("bottom", cb)
}
//向左滚
else if (isBorderScroll && p.left >= 0 && p.left <= 30) {
scrollTo("left", cb)
}
//向右滚
else if (isBorderScroll && p.left >= clientWidth - 30 && p.left <= clientWidth) {
scrollTo("right", cb)
} else {
if (isOverflowScroll === true) {
if (p.top < 0) {
scrollTo("top", cb);
}
else if (p.top > clientHeight) {
scrollTo("bottom", cb);
}
else if (p.left < 0) {
scrollTo("left", cb);
}
else if (p.left > clientWidth) {
scrollTo("right", cb);
} else {
scrollTo("", cb);
}
} else {
scrollTo("", cb);
}
}
// 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 >= clientHeight - 30 && p.top <= clientHeight) {
// scrollTo("bottom", cb)
// }
// //向左滚
// else if (isBorderScroll && p.left >= 0 && p.left <= 30) {
// scrollTo("left", cb)
// }
// //向右滚
// else if (isBorderScroll && p.left >= clientWidth - 30 && p.left <= clientWidth) {
// scrollTo("right", cb)
// } else {
// if (isOverflowScroll === true) {
// if (p.top < 0) {
// scrollTo("top", cb);
// }
// else if (p.top > clientHeight) {
// scrollTo("bottom", cb);
// }
// else if (p.left < 0) {
// scrollTo("left", cb);
// }
// else if (p.left > clientWidth) {
// scrollTo("right", cb);
// } else {
// scrollTo("", cb);
// }
// } else {
// scrollTo("", cb);
// }
// }
},
scrollEnd: function () {
@ -75886,30 +75790,30 @@ BI.Arrangement = BI.inherit(BI.Widget, {
});
this.container = BI.createWidget({
type: "bi.absolute",
scrollable: true,
cls: "arrangement-container",
items: o.items.concat([this.block, this.arrangement])
});
this.scrollContainer = BI.createWidget({
type: "bi.adaptive",
width: "100%",
height: "100%",
scrollable: true,
items: [this.container]
});
this.scrollContainer.element.scroll(function () {
this.container.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
scrollLeft: self.container.element.scrollLeft(),
scrollTop: self.container.element.scrollTop(),
clientWidth: self.container.element[0].clientWidth,
clientHeight: self.container.element[0].clientHeight
});
});
BI.createWidget({
type: "bi.adaptive",
type: "bi.absolute",
element: this,
items: [this.scrollContainer]
items: [{
el: this.container,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.regions = {};
if (o.items.length > 0) {
@ -76107,8 +76011,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
_getScrollOffset: function () {
return {
left: this.scrollContainer.element[0].scrollLeft,
top: this.scrollContainer.element[0].scrollTop
left: this.container.element[0].scrollLeft,
top: this.container.element[0].scrollTop
}
},
@ -76159,26 +76063,15 @@ BI.Arrangement = BI.inherit(BI.Widget, {
},
getClientWidth: function () {
return this.scrollContainer.element[0].clientWidth;
return this.container.element[0].clientWidth;
},
getClientHeight: function () {
return this.scrollContainer.element[0].clientHeight;
return this.container.element[0].clientHeight;
},
_applyContainer: function () {
//先掩藏后显示能够明确滚动条是否出现
this.scrollContainer.element.css("overflow", "hidden");
var occupied = this._getRegionOccupied();
if (this.container._width !== occupied.left + occupied.width) {
this.container.element.width(occupied.left + occupied.width);
this.container._width = occupied.left + occupied.width;
}
if (this.container._height !== occupied.top + occupied.height) {
this.container.element.height(occupied.top + occupied.height);
this.container._height = occupied.top + occupied.height;
}
this.scrollContainer.element.css("overflow", "auto");
return occupied;
},
@ -76749,8 +76642,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
},
scrollTo: function (scroll) {
this.scrollContainer.element.scrollTop(scroll.top);
this.scrollContainer.element.scrollLeft(scroll.left);
this.container.element.scrollTop(scroll.top);
this.container.element.scrollLeft(scroll.left);
},
zoom: function (ratio) {
@ -77414,7 +77307,6 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 30,
yearLength: 4,
yearMonthLength: 7
},
@ -77424,7 +77316,7 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
extraCls: "bi-date-trigger",
min: '1900-01-01', //最小日期
max: '2099-12-31', //最大日期
height: 25
height: 24
});
},
_init: function () {
@ -77928,7 +77820,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
var triggerBtn = BI.createWidget({
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-font bi-border-right",
width: 30,
width: 24,
height: 24
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
@ -78266,7 +78158,6 @@ BI.shortcut("bi.date_time_select", BI.DateTimeSelect);/**
BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
triggerWidth: 30
},
_defaultConfig: function () {
@ -78294,7 +78185,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
element: this,
items: [{
el: BI.createWidget(),
width: c.triggerWidth
width: o.height
}, {
el: this.text
}]
@ -79130,7 +79021,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-search-editor bi-border",
height: 30,
height: 24,
errorText: "",
watermark: BI.i18nText("BI-Basic_Search"),
validationChecker: BI.emptyFn,
@ -79349,7 +79240,7 @@ BI.TextEditor = BI.inherit(BI.Widget, {
allowBlank: false,
watermark: "",
errorText: "",
height: 30
height: 24
})
},
@ -80904,14 +80795,13 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 25,
errorText: BI.i18nText("BI-Month_Trigger_Error_Text")
},
_defaultConfig: function () {
return BI.extend(BI.MonthTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-month-trigger bi-border",
height: 25
height: 24
});
},
_init: function () {
@ -80967,15 +80857,15 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
type: "bi.text_button",
text: BI.i18nText("BI-Multi_Date_Month"),
baseCls: "bi-trigger-month-text",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}
]
});
@ -81287,8 +81177,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
var triggerBtn = BI.createWidget({
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-font",
width: 30,
height: 23
width: 24,
height: 24
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
if (self.combo.isViewVisible()) {
@ -81300,8 +81190,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
this.changeIcon = BI.createWidget({
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 30,
height: 23
width: 24,
height: 24
});
@ -89046,7 +88936,6 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 30,
textWidth: 40,
errorText: BI.i18nText("BI-Quarter_Trigger_Error_Text")
},
@ -89054,7 +88943,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.QuarterTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-quarter-trigger bi-border",
height: 25
height: 24
});
},
_init: function () {
@ -89117,9 +89006,9 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}, {
el: {
type: "bi.trigger_icon_button",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}
]
});
@ -91190,7 +91079,7 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.SingleTreeCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-combo",
trigger: {},
height: 30,
height: 24,
text: "",
items: []
});
@ -91325,7 +91214,7 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SingleTreeTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-trigger",
height: 30,
height: 24,
text: "",
items: []
});
@ -91890,7 +91779,6 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 25,
errorText: BI.i18nText("BI-Please_Input_Positive_Integer"),
errorTextInvalid: BI.i18nText("BI-Year_Trigger_Invalid_Text")
},
@ -91900,7 +91788,7 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
extraCls: "bi-year-trigger bi-border",
min: '1900-01-01', //最小日期
max: '2099-12-31', //最大日期
height: 25
height: 24
});
},
_init: function () {
@ -91957,15 +91845,15 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
type: "bi.text_button",
baseCls: "bi-trigger-year-text",
text: BI.i18nText("BI-Multi_Date_Year"),
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}
]
});
@ -93279,4 +93167,126 @@ BI.ValueChooserPane = BI.inherit(BI.AbstractValueChooser, {
}
});
BI.ValueChooserPane.EVENT_CHANGE = "ValueChooserPane.EVENT_CHANGE";
BI.shortcut('bi.value_chooser_pane', BI.ValueChooserPane);
BI.shortcut('bi.value_chooser_pane', BI.ValueChooserPane);BI.servletURL = "https://fanruan.coding.me/fineui/dist/";
BI.resourceURL = "https://fanruan.coding.me/fineui/dist/resource/";
BI.i18n = {
"BI-Multi_Date_Quarter_End": "季度末",
"BI-Multi_Date_Month_Begin": "月初",
"BI-Multi_Date_YMD": "年/月/日",
"BI-Custom_Color": "自定义颜色",
"BI-Numerical_Interval_Input_Data": "请输入数值",
"BI-Please_Input_Natural_Number": "请输入非负整数",
"BI-No_More_Data": "无更多数据",
"BI-Basic_Altogether": "共",
"BI-Basic_Sunday": "星期日",
"BI-Widget_Background_Colour": "组件背景",
"BI-Color_Picker_Error_Text": "请输入0~255的正整数",
"BI-Multi_Date_Month": "月",
"BI-No_Selected_Item": "没有可选项",
"BI-Multi_Date_Year_Begin": "年初",
"BI-Quarter_1": "第1季度",
"BI-Quarter_2": "第2季度",
"BI-Quarter_3": "第3季度",
"BI-Quarter_4": "第4季度",
"BI-Multi_Date_Year_Next": "年后",
"BI-Multi_Date_Month_Prev": "个月前",
"BI-Month_Trigger_Error_Text": "请输入1~12的正整数",
"BI-Less_And_Equal": "小于等于",
"BI-Year_Trigger_Invalid_Text": "请输入有效时间",
"BI-Multi_Date_Week_Next": "周后",
"BI-Font_Size": "字号",
"BI-Basic_Total": "共",
"BI-Already_Selected": "已选择",
"BI-Formula_Insert": "插入",
"BI-Select_All": "全选",
"BI-Basic_Tuesday": "星期二",
"BI-Multi_Date_Month_End": "月末",
"BI-Load_More": "点击加载更多数据",
"BI-Basic_September": "九月",
"BI-Current_Is_Last_Page": "当前已是最后一页",
"BI-Basic_Auto": "自动",
"BI-Basic_Count": "个",
"BI-Basic_Value": "值",
"BI-Basic_Unrestricted": "无限制",
"BI-Quarter_Trigger_Error_Text": "请输入1~4的正整数",
"BI-Basic_More": "更多",
"BI-Basic_Wednesday": "星期三",
"BI-Basic_Bold": "加粗",
"BI-Basic_Simple_Saturday": "六",
"BI-Multi_Date_Month_Next": "个月后",
"BI-Basic_March": "三月",
"BI-Current_Is_First_Page": "当前已是第一页",
"BI-Basic_Thursday": "星期四",
"BI-Basic_Prompt": "提示",
"BI-Multi_Date_Today": "今天",
"BI-Multi_Date_Quarter_Prev": "个季度前",
"BI-Row_Header": "行表头",
"BI-Date_Trigger_Error_Text": "日期格式示例:2015-3-11",
"BI-Basic_Cancel": "取消",
"BI-Basic_January": "一月",
"BI-Basic_June": "六月",
"BI-Basic_July": "七月",
"BI-Basic_April": "四月",
"BI-Multi_Date_Quarter_Begin": "季度初",
"BI-Multi_Date_Week": "周",
"BI-Click_Blank_To_Select": "点按\"空格键\"选中匹配项",
"BI-Basic_August": "八月",
"BI-Word_Align_Left": "文字居左",
"BI-Basic_November": "十一月",
"BI-Font_Colour": "字体颜色",
"BI-Multi_Date_Day_Prev": "天前",
"BI-Select_Part": "部分选择",
"BI-Multi_Date_Day_Next": "天后",
"BI-Less_Than": "小于",
"BI-Basic_February": "二月",
"BI-Multi_Date_Year": "年",
"BI-Number_Index": "序号",
"BI-Multi_Date_Week_Prev": "周前",
"BI-Next_Page": "下一页",
"BI-Right_Page": "向右翻页",
"BI-Numerical_Interval_Signal_Value": "前后值相等,请将操作符改为“≤”",
"BI-Basic_December": "十二月",
"BI-Basic_Saturday": "星期六",
"BI-Basic_Simple_Wednesday": "三",
"BI-Multi_Date_Quarter_Next": "个季度后",
"BI-Basic_October": "十月",
"BI-Basic_Simple_Friday": "五",
"BI-Primary_Key": "主键",
"BI-Basic_Save": "保存",
"BI-Numerical_Interval_Number_Value": "请保证前面的数值小于/等于后面的数值",
"BI-Previous_Page": "上一页",
"BI-No_Select": "搜索结果为空",
"BI-Basic_Clears": "清空",
"BI-Created_By_Me": "我创建的",
"BI-Basic_Simple_Tuesday": "二",
"BI-Word_Align_Right": "文字居右",
"BI-Summary_Values": "汇总",
"BI-Basic_Clear": "清除",
"BI-Upload_File_Size_Error": "文件大小不支",
"BI-Up_Page": "向上翻页",
"BI-Basic_Simple_Sunday": "日",
"BI-Multi_Date_Relative_Current_Time": "相对当前时间",
"BI-Selected_Data": "已选数据:",
"BI-Multi_Date_Quarter": "季度",
"BI-Check_Selected": "查看已选",
"BI-Basic_Search": "搜索",
"BI-Basic_May": "五月",
"BI-Continue_Select": "继续选择",
"BI-Please_Input_Positive_Integer": "请输入正整数",
"BI-Upload_File_Type_Error": "文件类型不支持",
"BI-Basic_Friday": "星期五",
"BI-Down_Page": "向下翻页",
"BI-Basic_Monday": "星期一",
"BI-Left_Page": "向左翻页",
"BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间",
"BI-Basic_Time": "时间",
"BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定",
"BI-Basic_Simple_Thursday": "四",
"BI-Multi_Date_Year_Prev": "年前",
"BI-Tiao_Data": "条数据",
"BI-Basic_Italic": "斜体"
};

70
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

65
dist/case.js vendored

@ -5137,7 +5137,7 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-check-editor-combo",
width: 100,
height: 30,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
@ -5457,7 +5457,7 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.StaticCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-static-combo",
height: 30,
height: 24,
text: "",
el: {},
items: [],
@ -5523,7 +5523,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-text-value-check-combo",
width: 100,
height: 30,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: ""
})
@ -6036,7 +6036,7 @@ BI.ClearEditor = BI.inherit(BI.Widget, {
var conf = BI.ClearEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-clear-editor",
height: 30,
height: 24,
errorText: "",
watermark: "",
validationChecker: BI.emptyFn,
@ -6215,7 +6215,7 @@ BI.ShelterEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30,
height: 24,
textAlign: "left"
})
},
@ -6472,7 +6472,7 @@ BI.SignInitialEditor = BI.inherit(BI.Widget, {
errorText: "",
value: "",
text: "",
height: 30
height: 24
})
},
@ -6739,7 +6739,7 @@ BI.SignEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30
height: 24
})
},
@ -6997,7 +6997,7 @@ BI.StateEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30
height: 24
})
},
@ -7271,7 +7271,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30
height: 24
})
},
@ -7958,10 +7958,11 @@ BI.SelectList = BI.inherit(BI.Widget, {
//全选
this.toolbar = BI.createWidget(o.toolbar);
this.allSelected = false;
this.toolbar.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
var isAllSelected = this.isSelected();
self.allSelected = this.isSelected();
if (type === BI.Events.CLICK) {
self.setAllSelected(isAllSelected);
self.setAllSelected(self.allSelected);
self.fireEvent(BI.SelectList.EVENT_CHANGE, value, obj);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -8022,6 +8023,7 @@ BI.SelectList = BI.inherit(BI.Widget, {
BI.each(this.getAllButtons(), function (i, btn) {
(btn.setSelected || btn.setAllSelected).apply(btn, [v]);
});
this.allSelected = !!v;
this.toolbar.setSelected(v);
this.toolbar.setHalfSelected(false);
},
@ -8031,7 +8033,8 @@ BI.SelectList = BI.inherit(BI.Widget, {
},
isAllSelected: function () {
return this.toolbar.isSelected();
return this.allSelected;
// return this.toolbar.isSelected();
},
hasPrev: function () {
@ -9400,7 +9403,7 @@ BI.Segment = BI.inherit(BI.Widget, {
return BI.extend(BI.Segment.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-segment",
items: [],
height: 30
height: 24
});
},
_init: function () {
@ -12260,13 +12263,12 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
var conf = BI.EditorTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-editor-trigger bi-border",
height: 30,
height: 24,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: false,
watermark: "",
errorText: "",
triggerWidth: 30
errorText: ""
});
},
@ -12301,9 +12303,9 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
el: {
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: o.triggerWidth
width: o.triggerWidth || o.height
},
width: o.triggerWidth
width: o.triggerWidth || o.height
}
]
});
@ -12335,7 +12337,7 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger",
el: {},
height: 30
height: 24
});
},
_init: function () {
@ -12358,15 +12360,14 @@ BI.shortcut('bi.icon_trigger', BI.IconTrigger);/**
*/
BI.IconTextTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
triggerWidth: 30
hgap: 4
},
_defaultConfig: function () {
var conf = BI.IconTextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 30
height: 24
});
},
@ -12383,7 +12384,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: c.triggerWidth
width: o.triggerWidth || o.height
});
BI.createWidget({
@ -12398,13 +12399,13 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
disableSelected: true
},
width: 24
width: o.triggerWidth || o.height
},
{
el: this.text
}, {
el: this.trigerButton,
width: c.triggerWidth
width: o.triggerWidth || o.height
}
]
});
@ -12440,8 +12441,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 30,
triggerWidth: 30
height: 24
});
},
@ -12459,7 +12459,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: o.triggerWidth
width: o.triggerWidth || o.height
});
BI.createWidget({
@ -12470,7 +12470,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
el: this.text
}, {
el: this.trigerButton,
width: o.triggerWidth
width: o.triggerWidth || o.height
}
]
});
@ -12606,8 +12606,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
var conf = BI.SmallTextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 20,
triggerWidth: 20
height: 20
});
},
@ -12623,7 +12622,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
});
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.triggerWidth
width: o.triggerWidth || o.height
});
BI.createWidget({
@ -12634,7 +12633,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
el: this.text
}, {
el: this.trigerButton,
width: o.triggerWidth
width: o.triggerWidth || o.height
}
]
});

1
dist/config.js vendored

@ -122,6 +122,7 @@ BI.i18n = {
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间",
"BI-Basic_Time": "时间",
"BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定",
"BI-Basic_Simple_Thursday": "四",
"BI-Multi_Date_Year_Prev": "年前",
"BI-Tiao_Data": "条数据",

9
dist/core.js vendored

@ -20877,6 +20877,15 @@ Date.prototype.getBeforeMultiMonth = function (n) {
return dt;
};
//获得当前时区对应指定时区的时间
Date.prototype.getTimeZoneTimeByTimezoneOffset = function (offset) {
var dt = new Date(this.getTime());
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + offset);
};
/** Checks date and time equality */
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&

55
dist/demo.js vendored

@ -5396,11 +5396,16 @@ Demo.FIX_CONFIG = [{
}, {
id: 74,
pId: 7,
text: "watcher表达式",
text: "watcher且或表达式",
value: "demo.fix4"
}, {
id: 75,
pId: 7,
text: "watcher星号表达式",
value: "demo.fix5"
}, {
id: 76,
pId: 7,
text: "一个混合的例子",
value: "demo.fix"
}];Demo.WIDGET_CONFIG = [{
@ -10260,6 +10265,54 @@ BI.shortcut("demo.tmp", Demo.Func);
});
BI.shortcut("demo.fix", Demo.Fix);
}());;(function () {
var model = Fix.define({
name: "原始属性",
arr: [{
n: 'a'
}, {
n: 0
}]
});
Demo.Fix = BI.inherit(BI.Widget, {
_store: function () {
return model;
},
watch: {
"arr.**": function () {
debugger
},
"arr.1.*": function () {
this.button.setText(this.model.name + "-" + this.model.arr[1].n)
}
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.arr[0].n += 1;
self.model.arr[1].n += 1;
},
text: this.model.name + "-" + this.model.arr[1].n
}
}]
}
},
mounted: function () {
}
});
BI.shortcut("demo.fix5", Demo.Fix);
}());;(function(){
var model = Fix.define({
name: "原始属性",

7
dist/fix/fix.compact.js vendored

@ -42,8 +42,11 @@
BI.Widget.prototype._unMount = function () {
unMount.apply(this, arguments);
this.store && this.store.destroy();
BI.each(this._watchers, function (i, unwatch) {
unwatch();
BI.each(this._watchers, function (i, unwatches) {
unwatches = BI.isArray(unwatches) ? unwatches : [unwatches];
BI.each(unwatches, function (j, unwatch) {
unwatch();
})
});
this._watchers && (this._watchers = []);
this.store && (this.store = null);

68
dist/fix/fix.js vendored

@ -395,12 +395,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}
Observer.prototype.walk = function walk(obj) {
return defineReactive(obj);
return defineReactive(obj, this);
};
Observer.prototype.observeArray = function observeArray(items) {
for (var i = 0, l = items.length; i < l; i++) {
items[i] = observe(items[i]).model;
items[i] = observe(items[i], this).model;
}
return items;
};
@ -422,32 +422,30 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}
}
function observe(value, asRootData) {
function observe(value, parentObserver) {
if (!_.isObject(value)) {
return;
}
var ob = void 0;
if (_.has(value, '__ob__') && value.__ob__ instanceof Observer) {
ob = value.__ob__;
} else if (observerState.shouldConvert && (_.isArray(value) || isPlainObject(value)) && !value._isVue) {
} else if (observerState.shouldConvert && (_.isArray(value) || isPlainObject(value))) {
ob = new Observer(value);
}
if (asRootData && ob) {
ob.vmCount++;
}
ob.parent = parentObserver || ob.parent;
return ob;
}
function defineReactive(obj, observer, shallow) {
var props = {};
var model = void 0;
_.each(obj, function (val, key) {
if (key in $$skipArray) {
return;
}
var dep = observer && observer['__dep' + key] || new Dep();
observer && (observer['__dep' + key] = dep);
var childOb = !shallow && observe(val);
var childOb = !shallow && observe(val, observer);
props[key] = {
enumerable: true,
configurable: true,
@ -470,13 +468,25 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return;
}
val = newVal;
childOb = !shallow && observe(newVal);
childOb = !shallow && observe(newVal, observer);
obj[key] = childOb ? childOb.model : newVal;
dep.notify();
//触发a.*绑定的hooks
_.each(model.__ob__._deps, function (dep) {
dep.notify();
});
//触发a.**绑定的hooks
var parent = model.__ob__;
while (parent) {
_.each(parent._globalDeps, function (dep) {
dep.notify();
});
parent = parent.parent;
}
}
};
});
return createViewModel$1(obj, props);
return model = createViewModel$1(obj, props);
}
/**
@ -495,9 +505,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return val;
}
var ob = target.__ob__;
if (target._isVue || ob && ob.vmCount) {
return val;
}
if (!ob) {
target[key] = val;
return val;
@ -517,9 +524,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return;
}
var ob = target.__ob__;
if (target._isVue || ob && ob.vmCount) {
return;
}
if (!_.has(target, key)) {
return;
}
@ -951,7 +955,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
options = options || {};
options.user = true;
var exps = void 0;
if (_.isFunction(expOrFn) || !(exps = expOrFn.match(/[a-zA-Z0-9_.]+|[|][|]|[&][&]|[(]|[)]/g)) || exps.length === 1) {
if (_.isFunction(expOrFn) || !(exps = expOrFn.match(/[a-zA-Z0-9_.*]+|[|][|]|[&][&]|[(]|[)]/g)) || exps.length === 1 && !/\*/.test(expOrFn)) {
var watcher = new Watcher(vm.model, expOrFn, _.bind(cb, vm), options);
if (options.immediate) {
cb.call(vm, watcher.value);
@ -968,6 +972,34 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (_.has(operators, exp)) {
return;
}
if (/\*\*$|\*$/.test(exp)) {
var isGlobal = /\*\*$/.test(exp);
if (isGlobal) {
//a.**的形式
exp = exp.replace(".**", "");
} else {
//a.*的形式
exp = exp.replace(".*", "");
}
var getter = parsePath(exp);
var v = getter.call(vm.model, vm.model);
var dep = new Dep();
if (isGlobal) {
(v.__ob__._globalDeps || (v.__ob__._globalDeps = [])).push(dep);
} else {
(v.__ob__._deps || (v.__ob__._deps = [])).push(dep);
}
var w = new Watcher(vm.model, function () {
dep.depend();
return NaN;
}, _.bind(cb, vm));
watchers.push(function unwatchFn() {
w.teardown();
v.__ob__._globalDeps && remove(v.__ob__._globalDeps, dep);
v.__ob__._deps && remove(v.__ob__._deps, dep);
});
return;
}
var watcher = new Watcher(vm.model, exp, function () {
if (complete === true) {
return;

335
dist/widget.js vendored

@ -491,60 +491,7 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
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);
// }
// });
},
// _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;
// }
// },
},
_getScrollOffset: function () {
return this.arrangement._getScrollOffset();
@ -605,99 +552,99 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
},
scrollInterval: function (e, isBorderScroll, isOverflowScroll, cb) {
var self = this;
var map = {
top: [-1, 0],
bottom: [1, 0],
left: [0, -1],
right: [0, 1]
};
var clientWidth = this.arrangement.getClientWidth();
var clientHeight = this.arrangement.getClientHeight();
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);
}
}
// var self = this;
// var map = {
// top: [-1, 0],
// bottom: [1, 0],
// left: [0, -1],
// right: [0, 1]
// };
// var clientWidth = this.arrangement.getClientWidth();
// var clientHeight = this.arrangement.getClientHeight();
//
// 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);
// }
// }
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 >= clientHeight - 30 && p.top <= clientHeight) {
scrollTo("bottom", cb)
}
//向左滚
else if (isBorderScroll && p.left >= 0 && p.left <= 30) {
scrollTo("left", cb)
}
//向右滚
else if (isBorderScroll && p.left >= clientWidth - 30 && p.left <= clientWidth) {
scrollTo("right", cb)
} else {
if (isOverflowScroll === true) {
if (p.top < 0) {
scrollTo("top", cb);
}
else if (p.top > clientHeight) {
scrollTo("bottom", cb);
}
else if (p.left < 0) {
scrollTo("left", cb);
}
else if (p.left > clientWidth) {
scrollTo("right", cb);
} else {
scrollTo("", cb);
}
} else {
scrollTo("", cb);
}
}
// 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 >= clientHeight - 30 && p.top <= clientHeight) {
// scrollTo("bottom", cb)
// }
// //向左滚
// else if (isBorderScroll && p.left >= 0 && p.left <= 30) {
// scrollTo("left", cb)
// }
// //向右滚
// else if (isBorderScroll && p.left >= clientWidth - 30 && p.left <= clientWidth) {
// scrollTo("right", cb)
// } else {
// if (isOverflowScroll === true) {
// if (p.top < 0) {
// scrollTo("top", cb);
// }
// else if (p.top > clientHeight) {
// scrollTo("bottom", cb);
// }
// else if (p.left < 0) {
// scrollTo("left", cb);
// }
// else if (p.left > clientWidth) {
// scrollTo("right", cb);
// } else {
// scrollTo("", cb);
// }
// } else {
// scrollTo("", cb);
// }
// }
},
scrollEnd: function () {
@ -829,30 +776,30 @@ BI.Arrangement = BI.inherit(BI.Widget, {
});
this.container = BI.createWidget({
type: "bi.absolute",
scrollable: true,
cls: "arrangement-container",
items: o.items.concat([this.block, this.arrangement])
});
this.scrollContainer = BI.createWidget({
type: "bi.adaptive",
width: "100%",
height: "100%",
scrollable: true,
items: [this.container]
});
this.scrollContainer.element.scroll(function () {
this.container.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
scrollLeft: self.container.element.scrollLeft(),
scrollTop: self.container.element.scrollTop(),
clientWidth: self.container.element[0].clientWidth,
clientHeight: self.container.element[0].clientHeight
});
});
BI.createWidget({
type: "bi.adaptive",
type: "bi.absolute",
element: this,
items: [this.scrollContainer]
items: [{
el: this.container,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.regions = {};
if (o.items.length > 0) {
@ -1050,8 +997,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
_getScrollOffset: function () {
return {
left: this.scrollContainer.element[0].scrollLeft,
top: this.scrollContainer.element[0].scrollTop
left: this.container.element[0].scrollLeft,
top: this.container.element[0].scrollTop
}
},
@ -1102,26 +1049,15 @@ BI.Arrangement = BI.inherit(BI.Widget, {
},
getClientWidth: function () {
return this.scrollContainer.element[0].clientWidth;
return this.container.element[0].clientWidth;
},
getClientHeight: function () {
return this.scrollContainer.element[0].clientHeight;
return this.container.element[0].clientHeight;
},
_applyContainer: function () {
//先掩藏后显示能够明确滚动条是否出现
this.scrollContainer.element.css("overflow", "hidden");
var occupied = this._getRegionOccupied();
if (this.container._width !== occupied.left + occupied.width) {
this.container.element.width(occupied.left + occupied.width);
this.container._width = occupied.left + occupied.width;
}
if (this.container._height !== occupied.top + occupied.height) {
this.container.element.height(occupied.top + occupied.height);
this.container._height = occupied.top + occupied.height;
}
this.scrollContainer.element.css("overflow", "auto");
return occupied;
},
@ -1692,8 +1628,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
},
scrollTo: function (scroll) {
this.scrollContainer.element.scrollTop(scroll.top);
this.scrollContainer.element.scrollLeft(scroll.left);
this.container.element.scrollTop(scroll.top);
this.container.element.scrollLeft(scroll.left);
},
zoom: function (ratio) {
@ -2357,7 +2293,6 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 30,
yearLength: 4,
yearMonthLength: 7
},
@ -2367,7 +2302,7 @@ BI.shortcut('bi.date_combo', BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
extraCls: "bi-date-trigger",
min: '1900-01-01', //最小日期
max: '2099-12-31', //最大日期
height: 25
height: 24
});
},
_init: function () {
@ -2871,7 +2806,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
var triggerBtn = BI.createWidget({
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-font bi-border-right",
width: 30,
width: 24,
height: 24
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
@ -3209,7 +3144,6 @@ BI.shortcut("bi.date_time_select", BI.DateTimeSelect);/**
BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
triggerWidth: 30
},
_defaultConfig: function () {
@ -3237,7 +3171,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
element: this,
items: [{
el: BI.createWidget(),
width: c.triggerWidth
width: o.height
}, {
el: this.text
}]
@ -4073,7 +4007,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-search-editor bi-border",
height: 30,
height: 24,
errorText: "",
watermark: BI.i18nText("BI-Basic_Search"),
validationChecker: BI.emptyFn,
@ -4292,7 +4226,7 @@ BI.TextEditor = BI.inherit(BI.Widget, {
allowBlank: false,
watermark: "",
errorText: "",
height: 30
height: 24
})
},
@ -5847,14 +5781,13 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 25,
errorText: BI.i18nText("BI-Month_Trigger_Error_Text")
},
_defaultConfig: function () {
return BI.extend(BI.MonthTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-month-trigger bi-border",
height: 25
height: 24
});
},
_init: function () {
@ -5910,15 +5843,15 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
type: "bi.text_button",
text: BI.i18nText("BI-Multi_Date_Month"),
baseCls: "bi-trigger-month-text",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}
]
});
@ -6230,8 +6163,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
var triggerBtn = BI.createWidget({
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-font",
width: 30,
height: 23
width: 24,
height: 24
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
if (self.combo.isViewVisible()) {
@ -6243,8 +6176,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
this.changeIcon = BI.createWidget({
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 30,
height: 23
width: 24,
height: 24
});
@ -13989,7 +13922,6 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 30,
textWidth: 40,
errorText: BI.i18nText("BI-Quarter_Trigger_Error_Text")
},
@ -13997,7 +13929,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.QuarterTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-quarter-trigger bi-border",
height: 25
height: 24
});
},
_init: function () {
@ -14060,9 +13992,9 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}, {
el: {
type: "bi.trigger_icon_button",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}
]
});
@ -16133,7 +16065,7 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.SingleTreeCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-combo",
trigger: {},
height: 30,
height: 24,
text: "",
items: []
});
@ -16268,7 +16200,7 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SingleTreeTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-trigger",
height: 30,
height: 24,
text: "",
items: []
});
@ -16833,7 +16765,6 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 25,
errorText: BI.i18nText("BI-Please_Input_Positive_Integer"),
errorTextInvalid: BI.i18nText("BI-Year_Trigger_Invalid_Text")
},
@ -16843,7 +16774,7 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
extraCls: "bi-year-trigger bi-border",
min: '1900-01-01', //最小日期
max: '2099-12-31', //最大日期
height: 25
height: 24
});
},
_init: function () {
@ -16900,15 +16831,15 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
type: "bi.text_button",
baseCls: "bi-trigger-year-text",
text: BI.i18nText("BI-Multi_Date_Year"),
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}
]
});

11
docs/_book/gitbook/gitbook-plugin-livereload/plugin.js

@ -0,0 +1,11 @@
(function() {
var newEl = document.createElement('script'),
firstScriptTag = document.getElementsByTagName('script')[0];
if (firstScriptTag) {
newEl.async = 1;
newEl.src = '//' + window.location.hostname + ':35729/livereload.js';
firstScriptTag.parentNode.insertBefore(newEl, firstScriptTag);
}
})();

1
public/js/index.js

@ -115,6 +115,7 @@ BI.i18n = {
"BI-Time_Interval_Error_Text": "请保证前面时间小于/等于后面的时间",
"BI-Basic_Time": "时间",
"BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定",
"BI-Basic_Simple_Thursday": "四",
"BI-Multi_Date_Year_Prev": "年前",
"BI-Tiao_Data": "条数据",

4
src/base/combination/group.combo.js

@ -32,10 +32,10 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
_init: function () {
BI.ComboGroup.superclass._init.apply(this, arguments);
this.populate(this.options.el);
this._populate(this.options.el);
},
populate: function (item) {
_populate: function (item) {
var self = this, o = this.options;
var children = o.children;
if (BI.isEmpty(children)) {

2
src/base/richeditor/plugins/combo.sizechooser.js

@ -42,7 +42,7 @@ BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, {
type: "bi.text_trigger",
readonly: true,
height: o.height,
triggerWidth: 12,
triggerWidth: 16,
text: BI.i18nText("BI-Font_Size")
});

2
src/base/single/trigger/trigger.js

@ -9,7 +9,7 @@ BI.Trigger = BI.inherit(BI.Single, {
var conf = BI.Trigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger cursor-pointer",
height: 30
height: 24
})
},

2
src/case/combo/editoriconcheckcombo/combo.editoriconcheck.js

@ -6,7 +6,7 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-check-editor-combo",
width: 100,
height: 30,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,

2
src/case/combo/staticcombo/combo.static.js

@ -8,7 +8,7 @@ BI.StaticCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.StaticCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-static-combo",
height: 30,
height: 24,
text: "",
el: {},
items: [],

2
src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js

@ -8,7 +8,7 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-text-value-check-combo",
width: 100,
height: 30,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: ""
})

2
src/case/editor/editor.clear.js

@ -9,7 +9,7 @@ BI.ClearEditor = BI.inherit(BI.Widget, {
var conf = BI.ClearEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-clear-editor",
height: 30,
height: 24,
errorText: "",
watermark: "",
validationChecker: BI.emptyFn,

2
src/case/editor/editor.shelter.js

@ -20,7 +20,7 @@ BI.ShelterEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30,
height: 24,
textAlign: "left"
})
},

2
src/case/editor/editor.sign.initial.js

@ -19,7 +19,7 @@ BI.SignInitialEditor = BI.inherit(BI.Widget, {
errorText: "",
value: "",
text: "",
height: 30
height: 24
})
},

2
src/case/editor/editor.sign.js

@ -20,7 +20,7 @@ BI.SignEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30
height: 24
})
},

2
src/case/editor/editor.state.js

@ -20,7 +20,7 @@ BI.StateEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30
height: 24
})
},

2
src/case/editor/editor.state.simple.js

@ -21,7 +21,7 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
allowBlank: true,
watermark: "",
errorText: "",
height: 30
height: 24
})
},

9
src/case/list/list.select.js

@ -32,10 +32,11 @@ BI.SelectList = BI.inherit(BI.Widget, {
//全选
this.toolbar = BI.createWidget(o.toolbar);
this.allSelected = false;
this.toolbar.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
var isAllSelected = this.isSelected();
self.allSelected = this.isSelected();
if (type === BI.Events.CLICK) {
self.setAllSelected(isAllSelected);
self.setAllSelected(self.allSelected);
self.fireEvent(BI.SelectList.EVENT_CHANGE, value, obj);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
@ -96,6 +97,7 @@ BI.SelectList = BI.inherit(BI.Widget, {
BI.each(this.getAllButtons(), function (i, btn) {
(btn.setSelected || btn.setAllSelected).apply(btn, [v]);
});
this.allSelected = !!v;
this.toolbar.setSelected(v);
this.toolbar.setHalfSelected(false);
},
@ -105,7 +107,8 @@ BI.SelectList = BI.inherit(BI.Widget, {
},
isAllSelected: function () {
return this.toolbar.isSelected();
return this.allSelected;
// return this.toolbar.isSelected();
},
hasPrev: function () {

2
src/case/segment/segment.js

@ -10,7 +10,7 @@ BI.Segment = BI.inherit(BI.Widget, {
return BI.extend(BI.Segment.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-segment",
items: [],
height: 30
height: 24
});
},
_init: function () {

9
src/case/trigger/trigger.editor.js

@ -14,13 +14,12 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
var conf = BI.EditorTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-editor-trigger bi-border",
height: 30,
height: 24,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: false,
watermark: "",
errorText: "",
triggerWidth: 30
errorText: ""
});
},
@ -55,9 +54,9 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, {
el: {
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: o.triggerWidth
width: o.triggerWidth || o.height
},
width: o.triggerWidth
width: o.triggerWidth || o.height
}
]
});

2
src/case/trigger/trigger.icon.js

@ -11,7 +11,7 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger",
el: {},
height: 30
height: 24
});
},
_init: function () {

11
src/case/trigger/trigger.icon.text.js

@ -7,15 +7,14 @@
*/
BI.IconTextTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
triggerWidth: 30
hgap: 4
},
_defaultConfig: function () {
var conf = BI.IconTextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 30
height: 24
});
},
@ -32,7 +31,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: c.triggerWidth
width: o.triggerWidth || o.height
});
BI.createWidget({
@ -47,13 +46,13 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, {
},
disableSelected: true
},
width: 24
width: o.triggerWidth || o.height
},
{
el: this.text
}, {
el: this.trigerButton,
width: c.triggerWidth
width: o.triggerWidth || o.height
}
]
});

7
src/case/trigger/trigger.text.js

@ -14,8 +14,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 30,
triggerWidth: 30
height: 24
});
},
@ -33,7 +32,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
cls: "bi-border-left",
width: o.triggerWidth
width: o.triggerWidth || o.height
});
BI.createWidget({
@ -44,7 +43,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
el: this.text
}, {
el: this.trigerButton,
width: o.triggerWidth
width: o.triggerWidth || o.height
}
]
});

7
src/case/trigger/trigger.text.small.js

@ -13,8 +13,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
var conf = BI.SmallTextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 20,
triggerWidth: 20
height: 20
});
},
@ -30,7 +29,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
});
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.triggerWidth
width: o.triggerWidth || o.height
});
BI.createWidget({
@ -41,7 +40,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
el: this.text
}, {
el: this.trigerButton,
width: o.triggerWidth
width: o.triggerWidth || o.height
}
]
});

9
src/core/proto/date.js

@ -252,6 +252,15 @@ Date.prototype.getBeforeMultiMonth = function (n) {
return dt;
};
//获得当前时区对应指定时区的时间
Date.prototype.getTimeZoneTimeByTimezoneOffset = function (offset) {
var dt = new Date(this.getTime());
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; //获得当地时间偏移的毫秒数
var utc = localTime + localOffset; //utc即GMT时间标准时区
return new Date(utc + offset);
};
/** Checks date and time equality */
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&

229
src/widget/adaptivearrangement/adaptivearrangement.js

@ -72,61 +72,8 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
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);
// }
// });
},
// _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;
// }
// },
_getScrollOffset: function () {
return this.arrangement._getScrollOffset();
},
@ -186,99 +133,99 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, {
},
scrollInterval: function (e, isBorderScroll, isOverflowScroll, cb) {
var self = this;
var map = {
top: [-1, 0],
bottom: [1, 0],
left: [0, -1],
right: [0, 1]
};
var clientWidth = this.arrangement.getClientWidth();
var clientHeight = this.arrangement.getClientHeight();
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);
}
}
// var self = this;
// var map = {
// top: [-1, 0],
// bottom: [1, 0],
// left: [0, -1],
// right: [0, 1]
// };
// var clientWidth = this.arrangement.getClientWidth();
// var clientHeight = this.arrangement.getClientHeight();
//
// 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);
// }
// }
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 >= clientHeight - 30 && p.top <= clientHeight) {
scrollTo("bottom", cb)
}
//向左滚
else if (isBorderScroll && p.left >= 0 && p.left <= 30) {
scrollTo("left", cb)
}
//向右滚
else if (isBorderScroll && p.left >= clientWidth - 30 && p.left <= clientWidth) {
scrollTo("right", cb)
} else {
if (isOverflowScroll === true) {
if (p.top < 0) {
scrollTo("top", cb);
}
else if (p.top > clientHeight) {
scrollTo("bottom", cb);
}
else if (p.left < 0) {
scrollTo("left", cb);
}
else if (p.left > clientWidth) {
scrollTo("right", cb);
} else {
scrollTo("", cb);
}
} else {
scrollTo("", cb);
}
}
// 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 >= clientHeight - 30 && p.top <= clientHeight) {
// scrollTo("bottom", cb)
// }
// //向左滚
// else if (isBorderScroll && p.left >= 0 && p.left <= 30) {
// scrollTo("left", cb)
// }
// //向右滚
// else if (isBorderScroll && p.left >= clientWidth - 30 && p.left <= clientWidth) {
// scrollTo("right", cb)
// } else {
// if (isOverflowScroll === true) {
// if (p.top < 0) {
// scrollTo("top", cb);
// }
// else if (p.top > clientHeight) {
// scrollTo("bottom", cb);
// }
// else if (p.left < 0) {
// scrollTo("left", cb);
// }
// else if (p.left > clientWidth) {
// scrollTo("right", cb);
// } else {
// scrollTo("", cb);
// }
// } else {
// scrollTo("", cb);
// }
// }
},
scrollEnd: function () {

51
src/widget/arrangement/arrangement.js

@ -29,30 +29,30 @@ BI.Arrangement = BI.inherit(BI.Widget, {
});
this.container = BI.createWidget({
type: "bi.absolute",
scrollable: true,
cls: "arrangement-container",
items: o.items.concat([this.block, this.arrangement])
});
this.scrollContainer = BI.createWidget({
type: "bi.adaptive",
width: "100%",
height: "100%",
scrollable: true,
items: [this.container]
});
this.scrollContainer.element.scroll(function () {
this.container.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
scrollLeft: self.container.element.scrollLeft(),
scrollTop: self.container.element.scrollTop(),
clientWidth: self.container.element[0].clientWidth,
clientHeight: self.container.element[0].clientHeight
});
});
BI.createWidget({
type: "bi.adaptive",
type: "bi.absolute",
element: this,
items: [this.scrollContainer]
items: [{
el: this.container,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.regions = {};
if (o.items.length > 0) {
@ -250,8 +250,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
_getScrollOffset: function () {
return {
left: this.scrollContainer.element[0].scrollLeft,
top: this.scrollContainer.element[0].scrollTop
left: this.container.element[0].scrollLeft,
top: this.container.element[0].scrollTop
}
},
@ -302,26 +302,15 @@ BI.Arrangement = BI.inherit(BI.Widget, {
},
getClientWidth: function () {
return this.scrollContainer.element[0].clientWidth;
return this.container.element[0].clientWidth;
},
getClientHeight: function () {
return this.scrollContainer.element[0].clientHeight;
return this.container.element[0].clientHeight;
},
_applyContainer: function () {
//先掩藏后显示能够明确滚动条是否出现
this.scrollContainer.element.css("overflow", "hidden");
var occupied = this._getRegionOccupied();
if (this.container._width !== occupied.left + occupied.width) {
this.container.element.width(occupied.left + occupied.width);
this.container._width = occupied.left + occupied.width;
}
if (this.container._height !== occupied.top + occupied.height) {
this.container.element.height(occupied.top + occupied.height);
this.container._height = occupied.top + occupied.height;
}
this.scrollContainer.element.css("overflow", "auto");
return occupied;
},
@ -892,8 +881,8 @@ BI.Arrangement = BI.inherit(BI.Widget, {
},
scrollTo: function (scroll) {
this.scrollContainer.element.scrollTop(scroll.top);
this.scrollContainer.element.scrollLeft(scroll.left);
this.container.element.scrollTop(scroll.top);
this.container.element.scrollLeft(scroll.left);
},
zoom: function (ratio) {

3
src/widget/date/trigger.date.js

@ -2,7 +2,6 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 30,
yearLength: 4,
yearMonthLength: 7
},
@ -12,7 +11,7 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
extraCls: "bi-date-trigger",
min: '1900-01-01', //最小日期
max: '2099-12-31', //最大日期
height: 25
height: 24
});
},
_init: function () {

2
src/widget/datetime/datetime.combo.js

@ -79,7 +79,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
var triggerBtn = BI.createWidget({
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-font bi-border-right",
width: 30,
width: 24,
height: 24
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {

3
src/widget/datetime/datetime.trigger.js

@ -4,7 +4,6 @@
BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
triggerWidth: 30
},
_defaultConfig: function () {
@ -32,7 +31,7 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
element: this,
items: [{
el: BI.createWidget(),
width: c.triggerWidth
width: o.height
}, {
el: this.text
}]

2
src/widget/editor/editor.search.js

@ -6,7 +6,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-search-editor bi-border",
height: 30,
height: 24,
errorText: "",
watermark: BI.i18nText("BI-Basic_Search"),
validationChecker: BI.emptyFn,

2
src/widget/editor/editor.text.js

@ -19,7 +19,7 @@ BI.TextEditor = BI.inherit(BI.Widget, {
allowBlank: false,
watermark: "",
errorText: "",
height: 30
height: 24
})
},

11
src/widget/month/trigger.month.js

@ -9,14 +9,13 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 25,
errorText: BI.i18nText("BI-Month_Trigger_Error_Text")
},
_defaultConfig: function () {
return BI.extend(BI.MonthTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-month-trigger bi-border",
height: 25
height: 24
});
},
_init: function () {
@ -72,15 +71,15 @@ BI.MonthTrigger = BI.inherit(BI.Trigger, {
type: "bi.text_button",
text: BI.i18nText("BI-Multi_Date_Month"),
baseCls: "bi-trigger-month-text",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}
]
});

8
src/widget/multidate/multidate.combo.js

@ -131,8 +131,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
var triggerBtn = BI.createWidget({
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-font",
width: 30,
height: 23
width: 24,
height: 24
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
if (self.combo.isViewVisible()) {
@ -144,8 +144,8 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
this.changeIcon = BI.createWidget({
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 30,
height: 23
width: 24,
height: 24
});

7
src/widget/quarter/trigger.quarter.js

@ -9,7 +9,6 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 30,
textWidth: 40,
errorText: BI.i18nText("BI-Quarter_Trigger_Error_Text")
},
@ -17,7 +16,7 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.QuarterTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-quarter-trigger bi-border",
height: 25
height: 24
});
},
_init: function () {
@ -80,9 +79,9 @@ BI.QuarterTrigger = BI.inherit(BI.Trigger, {
}, {
el: {
type: "bi.trigger_icon_button",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}
]
});

2
src/widget/singletree/singletree.combo.js

@ -8,7 +8,7 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, {
return BI.extend(BI.SingleTreeCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-combo",
trigger: {},
height: 30,
height: 24,
text: "",
items: []
});

2
src/widget/singletree/singletree.trigger.js

@ -8,7 +8,7 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SingleTreeTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-trigger",
height: 30,
height: 24,
text: "",
items: []
});

11
src/widget/year/trigger.year.js

@ -9,7 +9,6 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
triggerWidth: 25,
errorText: BI.i18nText("BI-Please_Input_Positive_Integer"),
errorTextInvalid: BI.i18nText("BI-Year_Trigger_Invalid_Text")
},
@ -19,7 +18,7 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
extraCls: "bi-year-trigger bi-border",
min: '1900-01-01', //最小日期
max: '2099-12-31', //最大日期
height: 25
height: 24
});
},
_init: function () {
@ -76,15 +75,15 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
type: "bi.text_button",
baseCls: "bi-trigger-year-text",
text: BI.i18nText("BI-Multi_Date_Year"),
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: c.triggerWidth
width: o.height
},
width: c.triggerWidth
width: o.height
}
]
});

Loading…
Cancel
Save