Browse Source

Merge remote-tracking branch 'origin/master'

es6
Young 6 years ago
parent
commit
5f065371a8
  1. 12
      dist/base.js
  2. 112
      dist/bundle.js
  3. 78
      dist/bundle.min.js
  4. 2
      dist/case.js
  5. 63
      dist/core.js
  6. 115
      dist/fineui.js
  7. 78
      dist/fineui.min.js
  8. 104
      dist/fineui_without_jquery_polyfill.js
  9. 4
      dist/fix/fix.compact.js
  10. 31
      dist/fix/fix.js
  11. 3
      dist/polyfill.js
  12. 12
      dist/utils.js
  13. 8
      dist/utils.min.js
  14. 2
      src/base/layer/layer.popover.js
  15. 2
      src/base/list/virtuallist.js
  16. 2
      src/base/single/editor/editor.textarea.js
  17. 2
      src/base/single/icon/icon.js
  18. 4
      src/base/tree/treeview.js
  19. 2
      src/case/colorchooser/colorchooser.trigger.js
  20. 5
      src/core/alias.js
  21. 2
      src/core/controller/controller.resizer.js
  22. 3
      src/core/foundation.js
  23. 2
      src/core/platform/dom/dom.js
  24. 4
      src/core/utils/aspect.js
  25. 41
      src/core/widget.js
  26. 6
      src/core/wrapper/layout.js

12
dist/base.js vendored

@ -1636,10 +1636,10 @@ BI.TreeView = BI.inherit(BI.Pane, {
element: this,
items: [this.tip]
});
if(BI.isNotNull(o.value)){
if(BI.isNotNull(o.value)) {
this.setSelectedValue(o.value);
}
if (BI.isIE9Below()) {
if (BI.isIE9Below && BI.isIE9Below()) {
this.element.addClass("hack");
}
},
@ -5673,7 +5673,7 @@ BI.Popover = BI.inherit(BI.Widget, {
BI.Resizers._resize();
}, function () {
self.tracker.releaseMouseMoves();
}, window);
}, _global);
var items = {
north: {
el: {
@ -6390,7 +6390,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
this.cache[i].destroyed = true;
}
}
var firstFragment = document.createDocumentFragment(), lastFragment = document.createDocumentFragment();
var firstFragment = BI.Widget._renderEngine.createFragment(), lastFragment = BI.Widget._renderEngine.createFragment();
var currentFragment = firstFragment;
for (var i = (start < 0 ? 0 : start); i <= end && i <= this.renderedIndex; i++) {
var index = this.cache[i].index;
@ -8793,7 +8793,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
},
left: 0,
right: 3,
top: 0,
top: 6,
bottom: 5
}]
});
@ -8936,7 +8936,7 @@ BI.Icon = BI.inherit(BI.Single, {
},
_init: function () {
BI.Icon.superclass._init.apply(this, arguments);
if (BI.isIE9Below()) {
if (BI.isIE9Below && BI.isIE9Below()) {
this.element.addClass("hack");
}
}

112
dist/bundle.js vendored

@ -16,7 +16,8 @@ if (typeof window !== "undefined") {
}
if (_global.BI == null) {
_global.BI = {prepares: []};
} else {
}
if(_global.BI.prepares == null) {
_global.BI.prepares = [];
}/**
* @license
@ -11801,29 +11802,28 @@ _.extend(BI.OB.prototype, {
this._parent = parent;
},
_mount: function () {
/**
*
* @param force 是否强制挂载子节点
* @param deep 子节点是否也是按照当前force处理
* @param lifeHook 生命周期钩子触不触发默认触发
* @returns {boolean}
* @private
*/
_mount: function (force, deep, lifeHook) {
var self = this;
var isMounted = this._isMounted;
if (isMounted || !this.isVisible() || this.__asking === true) {
return;
}
if (this._isRoot === true) {
isMounted = true;
} else if (this._parent && this._parent._isMounted === true) {
isMounted = true;
}
if (!isMounted) {
return;
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
this.beforeMount && this.beforeMount();
lifeHook !== false && this.beforeMount && this.beforeMount();
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false);
!self.isValid() && widget._setValid(false);
widget._mount && widget._mount();
widget._mount && widget._mount(deep ? force : false, deep, lifeHook);
});
this.mounted && this.mounted();
lifeHook !== false && this.mounted && this.mounted();
return true;
},
@ -12106,7 +12106,7 @@ _.extend(BI.OB.prototype, {
};
BI.Widget.registerRenderEngine({
createElement: function (widget) {
if(BI.isWidget(widget)) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
@ -12114,8 +12114,18 @@ _.extend(BI.OB.prototype, {
return $(document.createElement(o.tagName));
}
return $(widget);
},
createFragment: function () {
return document.createDocumentFragment();
}
});
BI.mount = function (widget, container) {
if (container) {
BI.Widget._renderEngine.createElement(container).append(widget.element);
}
return widget._mount(true, false, false);
};
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
@ -12172,7 +12182,7 @@ _.extend(BI.OB.prototype, {
throw new Error("无法根据item创建组件");
};
})();(function (window, undefined) {
})();!(function () {
function aspect (type) {
return function (target, methodName, advice) {
var exist = target[methodName],
@ -12234,7 +12244,7 @@ _.extend(BI.OB.prototype, {
return BI.aspect;
})(window);
})();
!(function () {
var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
@ -14700,7 +14710,7 @@ BI.Layout = BI.inherit(BI.Widget, {
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var frag = BI.Widget._renderEngine.createFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
@ -14929,7 +14939,7 @@ BI.Layout = BI.inherit(BI.Widget, {
addItems: function (items) {
var self = this, o = this.options;
var fragment = document.createDocumentFragment();
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
@ -14947,7 +14957,7 @@ BI.Layout = BI.inherit(BI.Widget, {
prependItems: function (items) {
var self = this;
items = items || [];
var fragment = document.createDocumentFragment();
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
@ -15941,7 +15951,12 @@ BI.ShowAction = BI.inherit(BI.Action, {
BI.specialCharsMap = BI.specialCharsMap || {};
url = url || "";
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
switch (str) {
case "\\":
return BI.specialCharsMap["\\\\"] || str;
default:
return BI.specialCharsMap[str] || str;
}
});
return _global.encodeURIComponent(url);
};
@ -16966,7 +16981,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev);
// }
}, 30);
BI.Widget._renderEngine.createElement(window).resize(fn);
BI.Widget._renderEngine.createElement(_global).resize(fn);
},
_resize: function (ev) {
@ -18491,7 +18506,7 @@ BI.extend(BI.DOM, {
if (BI.isEmpty(doms)) {
return;
}
var frag = document.createDocumentFragment();
var frag = BI.Widget._renderEngine.createFragment();
BI.each(doms, function (i, dom) {
dom instanceof BI.Widget && (dom = dom.element);
dom instanceof $ && dom[0] && frag.appendChild(dom[0]);
@ -34938,6 +34953,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return watchers;
}
var mixinInjection = {};
function getMixins(type) {
return mixinInjection[type];
}
function mixin(xtype, cls) {
mixinInjection[xtype] = _.cloneDeep(cls);
}
var computedWatcherOptions = { lazy: true };
function initState(vm, state) {
@ -35042,6 +35067,22 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}
}
function initMixins(vm, mixins) {
mixins = mixins || [];
_.each(mixins.reverse(), function (mixinType) {
var mixin$$1 = getMixins(mixinType);
for (var key in mixin$$1) {
if (typeof mixin$$1[key] !== "function") continue;
if (_.has(vm, key)) continue;
vm[key] = _.bind(mixin$$1[key], vm.$$model ? vm.model : vm);
}
});
}
function defineProps(vm, keys) {
var props = {};
// if (typeof Proxy === 'function') {
@ -35169,14 +35210,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var watch$$1 = this.watch;
var actions = this.actions;
var keys = _.keys(this.$$model).concat(_.keys(state)).concat(_.keys(computed)).concat(context || []);
var mixins = this.mixins;
defineProps(this, keys);
childContext && defineContext(this, childContext);
this.$$model && (this.model.__ob__ = this.$$model.__ob__);
this._init();
initState(this, state);
initMixins(this, mixins);
initMethods(this, actions);
initComputed(this, computed);
initWatch(this, watch$$1);
initMethods(this, actions);
this.created && this.created();
if (this.$$model) {
return this.model;
@ -35233,6 +35276,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
exports.define = define;
exports.version = version;
exports.$$skipArray = $$skipArray;
exports.mixin = mixin;
exports.Model = Model;
exports.observerState = observerState;
exports.Observer = Observer;
@ -36886,10 +36930,10 @@ BI.TreeView = BI.inherit(BI.Pane, {
element: this,
items: [this.tip]
});
if(BI.isNotNull(o.value)){
if(BI.isNotNull(o.value)) {
this.setSelectedValue(o.value);
}
if (BI.isIE9Below()) {
if (BI.isIE9Below && BI.isIE9Below()) {
this.element.addClass("hack");
}
},
@ -40923,7 +40967,7 @@ BI.Popover = BI.inherit(BI.Widget, {
BI.Resizers._resize();
}, function () {
self.tracker.releaseMouseMoves();
}, window);
}, _global);
var items = {
north: {
el: {
@ -41640,7 +41684,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
this.cache[i].destroyed = true;
}
}
var firstFragment = document.createDocumentFragment(), lastFragment = document.createDocumentFragment();
var firstFragment = BI.Widget._renderEngine.createFragment(), lastFragment = BI.Widget._renderEngine.createFragment();
var currentFragment = firstFragment;
for (var i = (start < 0 ? 0 : start); i <= end && i <= this.renderedIndex; i++) {
var index = this.cache[i].index;
@ -44043,7 +44087,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
},
left: 0,
right: 3,
top: 0,
top: 6,
bottom: 5
}]
});
@ -44186,7 +44230,7 @@ BI.Icon = BI.inherit(BI.Single, {
},
_init: function () {
BI.Icon.superclass._init.apply(this, arguments);
if (BI.isIE9Below()) {
if (BI.isIE9Below && BI.isIE9Below()) {
this.element.addClass("hack");
}
}
@ -51267,7 +51311,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
BI.ColorChooserTrigger.superclass._init.apply(this, arguments);
this.colorContainer = BI.createWidget({
type: "bi.layout",
cls: "color-chooser-trigger-content" + (BI.isIE9Below() ? " hack" : "")
cls: "color-chooser-trigger-content" + (BI.isIE9Below && BI.isIE9Below() ? " hack" : "")
});
var down = BI.createWidget({
@ -81490,7 +81534,7 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
function createStore() {
var needPop = false;
if (window.Fix && this._store) {
if (_global.Fix && this._store) {
var store = findStore(this.options.context || this.options.element);
if (store) {
pushTarget(store);
@ -81522,7 +81566,7 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
var _render = BI.Widget.prototype._render;
BI.Widget.prototype._render = function () {
var needPop = false;
if (window.Fix && this._store) {
if (_global.Fix && this._store) {
needPop = true;
pushTarget(this.store);
initWatch(this, this.watch);

78
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/case.js vendored

@ -2655,7 +2655,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
BI.ColorChooserTrigger.superclass._init.apply(this, arguments);
this.colorContainer = BI.createWidget({
type: "bi.layout",
cls: "color-chooser-trigger-content" + (BI.isIE9Below() ? " hack" : "")
cls: "color-chooser-trigger-content" + (BI.isIE9Below && BI.isIE9Below() ? " hack" : "")
});
var down = BI.createWidget({

63
dist/core.js vendored

@ -16,7 +16,8 @@ if (typeof window !== "undefined") {
}
if (_global.BI == null) {
_global.BI = {prepares: []};
} else {
}
if(_global.BI.prepares == null) {
_global.BI.prepares = [];
}/**
* @license
@ -11801,29 +11802,28 @@ _.extend(BI.OB.prototype, {
this._parent = parent;
},
_mount: function () {
/**
*
* @param force 是否强制挂载子节点
* @param deep 子节点是否也是按照当前force处理
* @param lifeHook 生命周期钩子触不触发默认触发
* @returns {boolean}
* @private
*/
_mount: function (force, deep, lifeHook) {
var self = this;
var isMounted = this._isMounted;
if (isMounted || !this.isVisible() || this.__asking === true) {
return;
}
if (this._isRoot === true) {
isMounted = true;
} else if (this._parent && this._parent._isMounted === true) {
isMounted = true;
}
if (!isMounted) {
return;
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
this.beforeMount && this.beforeMount();
lifeHook !== false && this.beforeMount && this.beforeMount();
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false);
!self.isValid() && widget._setValid(false);
widget._mount && widget._mount();
widget._mount && widget._mount(deep ? force : false, deep, lifeHook);
});
this.mounted && this.mounted();
lifeHook !== false && this.mounted && this.mounted();
return true;
},
@ -12106,7 +12106,7 @@ _.extend(BI.OB.prototype, {
};
BI.Widget.registerRenderEngine({
createElement: function (widget) {
if(BI.isWidget(widget)) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
@ -12114,8 +12114,18 @@ _.extend(BI.OB.prototype, {
return $(document.createElement(o.tagName));
}
return $(widget);
},
createFragment: function () {
return document.createDocumentFragment();
}
});
BI.mount = function (widget, container) {
if (container) {
BI.Widget._renderEngine.createElement(container).append(widget.element);
}
return widget._mount(true, false, false);
};
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
@ -12172,7 +12182,7 @@ _.extend(BI.OB.prototype, {
throw new Error("无法根据item创建组件");
};
})();(function (window, undefined) {
})();!(function () {
function aspect (type) {
return function (target, methodName, advice) {
var exist = target[methodName],
@ -12234,7 +12244,7 @@ _.extend(BI.OB.prototype, {
return BI.aspect;
})(window);
})();
!(function () {
var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
@ -14700,7 +14710,7 @@ BI.Layout = BI.inherit(BI.Widget, {
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var frag = BI.Widget._renderEngine.createFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
@ -14929,7 +14939,7 @@ BI.Layout = BI.inherit(BI.Widget, {
addItems: function (items) {
var self = this, o = this.options;
var fragment = document.createDocumentFragment();
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
@ -14947,7 +14957,7 @@ BI.Layout = BI.inherit(BI.Widget, {
prependItems: function (items) {
var self = this;
items = items || [];
var fragment = document.createDocumentFragment();
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
@ -15941,7 +15951,12 @@ BI.ShowAction = BI.inherit(BI.Action, {
BI.specialCharsMap = BI.specialCharsMap || {};
url = url || "";
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
switch (str) {
case "\\":
return BI.specialCharsMap["\\\\"] || str;
default:
return BI.specialCharsMap[str] || str;
}
});
return _global.encodeURIComponent(url);
};
@ -16966,7 +16981,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev);
// }
}, 30);
BI.Widget._renderEngine.createElement(window).resize(fn);
BI.Widget._renderEngine.createElement(_global).resize(fn);
},
_resize: function (ev) {
@ -18491,7 +18506,7 @@ BI.extend(BI.DOM, {
if (BI.isEmpty(doms)) {
return;
}
var frag = document.createDocumentFragment();
var frag = BI.Widget._renderEngine.createFragment();
BI.each(doms, function (i, dom) {
dom instanceof BI.Widget && (dom = dom.element);
dom instanceof $ && dom[0] && frag.appendChild(dom[0]);

115
dist/fineui.js vendored

@ -16,7 +16,8 @@ if (typeof window !== "undefined") {
}
if (_global.BI == null) {
_global.BI = {prepares: []};
} else {
}
if(_global.BI.prepares == null) {
_global.BI.prepares = [];
}// Production steps of ECMA-262, Edition 5, 15.4.4.14
// Reference: http://es5.github.io/#x15.4.4.14
@ -257,7 +258,8 @@ if (typeof window !== "undefined") {
}
if (_global.BI == null) {
_global.BI = {prepares: []};
} else {
}
if(_global.BI.prepares == null) {
_global.BI.prepares = [];
}/**
* @license
@ -12042,29 +12044,28 @@ _.extend(BI.OB.prototype, {
this._parent = parent;
},
_mount: function () {
/**
*
* @param force 是否强制挂载子节点
* @param deep 子节点是否也是按照当前force处理
* @param lifeHook 生命周期钩子触不触发默认触发
* @returns {boolean}
* @private
*/
_mount: function (force, deep, lifeHook) {
var self = this;
var isMounted = this._isMounted;
if (isMounted || !this.isVisible() || this.__asking === true) {
return;
}
if (this._isRoot === true) {
isMounted = true;
} else if (this._parent && this._parent._isMounted === true) {
isMounted = true;
}
if (!isMounted) {
return;
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
this.beforeMount && this.beforeMount();
lifeHook !== false && this.beforeMount && this.beforeMount();
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false);
!self.isValid() && widget._setValid(false);
widget._mount && widget._mount();
widget._mount && widget._mount(deep ? force : false, deep, lifeHook);
});
this.mounted && this.mounted();
lifeHook !== false && this.mounted && this.mounted();
return true;
},
@ -12347,7 +12348,7 @@ _.extend(BI.OB.prototype, {
};
BI.Widget.registerRenderEngine({
createElement: function (widget) {
if(BI.isWidget(widget)) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
@ -12355,8 +12356,18 @@ _.extend(BI.OB.prototype, {
return $(document.createElement(o.tagName));
}
return $(widget);
},
createFragment: function () {
return document.createDocumentFragment();
}
});
BI.mount = function (widget, container) {
if (container) {
BI.Widget._renderEngine.createElement(container).append(widget.element);
}
return widget._mount(true, false, false);
};
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
@ -12413,7 +12424,7 @@ _.extend(BI.OB.prototype, {
throw new Error("无法根据item创建组件");
};
})();(function (window, undefined) {
})();!(function () {
function aspect (type) {
return function (target, methodName, advice) {
var exist = target[methodName],
@ -12475,7 +12486,7 @@ _.extend(BI.OB.prototype, {
return BI.aspect;
})(window);
})();
!(function () {
var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
@ -14941,7 +14952,7 @@ BI.Layout = BI.inherit(BI.Widget, {
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var frag = BI.Widget._renderEngine.createFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
@ -15170,7 +15181,7 @@ BI.Layout = BI.inherit(BI.Widget, {
addItems: function (items) {
var self = this, o = this.options;
var fragment = document.createDocumentFragment();
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
@ -15188,7 +15199,7 @@ BI.Layout = BI.inherit(BI.Widget, {
prependItems: function (items) {
var self = this;
items = items || [];
var fragment = document.createDocumentFragment();
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
@ -16182,7 +16193,12 @@ BI.ShowAction = BI.inherit(BI.Action, {
BI.specialCharsMap = BI.specialCharsMap || {};
url = url || "";
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
switch (str) {
case "\\":
return BI.specialCharsMap["\\\\"] || str;
default:
return BI.specialCharsMap[str] || str;
}
});
return _global.encodeURIComponent(url);
};
@ -17207,7 +17223,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev);
// }
}, 30);
BI.Widget._renderEngine.createElement(window).resize(fn);
BI.Widget._renderEngine.createElement(_global).resize(fn);
},
_resize: function (ev) {
@ -18732,7 +18748,7 @@ BI.extend(BI.DOM, {
if (BI.isEmpty(doms)) {
return;
}
var frag = document.createDocumentFragment();
var frag = BI.Widget._renderEngine.createFragment();
BI.each(doms, function (i, dom) {
dom instanceof BI.Widget && (dom = dom.element);
dom instanceof $ && dom[0] && frag.appendChild(dom[0]);
@ -35179,6 +35195,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return watchers;
}
var mixinInjection = {};
function getMixins(type) {
return mixinInjection[type];
}
function mixin(xtype, cls) {
mixinInjection[xtype] = _.cloneDeep(cls);
}
var computedWatcherOptions = { lazy: true };
function initState(vm, state) {
@ -35283,6 +35309,22 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}
}
function initMixins(vm, mixins) {
mixins = mixins || [];
_.each(mixins.reverse(), function (mixinType) {
var mixin$$1 = getMixins(mixinType);
for (var key in mixin$$1) {
if (typeof mixin$$1[key] !== "function") continue;
if (_.has(vm, key)) continue;
vm[key] = _.bind(mixin$$1[key], vm.$$model ? vm.model : vm);
}
});
}
function defineProps(vm, keys) {
var props = {};
// if (typeof Proxy === 'function') {
@ -35410,14 +35452,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var watch$$1 = this.watch;
var actions = this.actions;
var keys = _.keys(this.$$model).concat(_.keys(state)).concat(_.keys(computed)).concat(context || []);
var mixins = this.mixins;
defineProps(this, keys);
childContext && defineContext(this, childContext);
this.$$model && (this.model.__ob__ = this.$$model.__ob__);
this._init();
initState(this, state);
initMixins(this, mixins);
initMethods(this, actions);
initComputed(this, computed);
initWatch(this, watch$$1);
initMethods(this, actions);
this.created && this.created();
if (this.$$model) {
return this.model;
@ -35474,6 +35518,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
exports.define = define;
exports.version = version;
exports.$$skipArray = $$skipArray;
exports.mixin = mixin;
exports.Model = Model;
exports.observerState = observerState;
exports.Observer = Observer;
@ -37127,10 +37172,10 @@ BI.TreeView = BI.inherit(BI.Pane, {
element: this,
items: [this.tip]
});
if(BI.isNotNull(o.value)){
if(BI.isNotNull(o.value)) {
this.setSelectedValue(o.value);
}
if (BI.isIE9Below()) {
if (BI.isIE9Below && BI.isIE9Below()) {
this.element.addClass("hack");
}
},
@ -41164,7 +41209,7 @@ BI.Popover = BI.inherit(BI.Widget, {
BI.Resizers._resize();
}, function () {
self.tracker.releaseMouseMoves();
}, window);
}, _global);
var items = {
north: {
el: {
@ -41881,7 +41926,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
this.cache[i].destroyed = true;
}
}
var firstFragment = document.createDocumentFragment(), lastFragment = document.createDocumentFragment();
var firstFragment = BI.Widget._renderEngine.createFragment(), lastFragment = BI.Widget._renderEngine.createFragment();
var currentFragment = firstFragment;
for (var i = (start < 0 ? 0 : start); i <= end && i <= this.renderedIndex; i++) {
var index = this.cache[i].index;
@ -44284,7 +44329,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
},
left: 0,
right: 3,
top: 0,
top: 6,
bottom: 5
}]
});
@ -44427,7 +44472,7 @@ BI.Icon = BI.inherit(BI.Single, {
},
_init: function () {
BI.Icon.superclass._init.apply(this, arguments);
if (BI.isIE9Below()) {
if (BI.isIE9Below && BI.isIE9Below()) {
this.element.addClass("hack");
}
}
@ -51508,7 +51553,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
BI.ColorChooserTrigger.superclass._init.apply(this, arguments);
this.colorContainer = BI.createWidget({
type: "bi.layout",
cls: "color-chooser-trigger-content" + (BI.isIE9Below() ? " hack" : "")
cls: "color-chooser-trigger-content" + (BI.isIE9Below && BI.isIE9Below() ? " hack" : "")
});
var down = BI.createWidget({
@ -81731,7 +81776,7 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
function createStore() {
var needPop = false;
if (window.Fix && this._store) {
if (_global.Fix && this._store) {
var store = findStore(this.options.context || this.options.element);
if (store) {
pushTarget(store);
@ -81763,7 +81808,7 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
var _render = BI.Widget.prototype._render;
BI.Widget.prototype._render = function () {
var needPop = false;
if (window.Fix && this._store) {
if (_global.Fix && this._store) {
needPop = true;
pushTarget(this.store);
initWatch(this, this.watch);

78
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

104
dist/fineui_without_jquery_polyfill.js vendored

@ -16,7 +16,8 @@ if (typeof window !== "undefined") {
}
if (_global.BI == null) {
_global.BI = {prepares: []};
} else {
}
if(_global.BI.prepares == null) {
_global.BI.prepares = [];
}/**
* @license
@ -11801,29 +11802,28 @@ _.extend(BI.OB.prototype, {
this._parent = parent;
},
_mount: function () {
/**
*
* @param force 是否强制挂载子节点
* @param deep 子节点是否也是按照当前force处理
* @param lifeHook 生命周期钩子触不触发默认触发
* @returns {boolean}
* @private
*/
_mount: function (force, deep, lifeHook) {
var self = this;
var isMounted = this._isMounted;
if (isMounted || !this.isVisible() || this.__asking === true) {
return;
}
if (this._isRoot === true) {
isMounted = true;
} else if (this._parent && this._parent._isMounted === true) {
isMounted = true;
}
if (!isMounted) {
return;
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
this.beforeMount && this.beforeMount();
lifeHook !== false && this.beforeMount && this.beforeMount();
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false);
!self.isValid() && widget._setValid(false);
widget._mount && widget._mount();
widget._mount && widget._mount(deep ? force : false, deep, lifeHook);
});
this.mounted && this.mounted();
lifeHook !== false && this.mounted && this.mounted();
return true;
},
@ -12106,7 +12106,7 @@ _.extend(BI.OB.prototype, {
};
BI.Widget.registerRenderEngine({
createElement: function (widget) {
if(BI.isWidget(widget)) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
@ -12114,8 +12114,18 @@ _.extend(BI.OB.prototype, {
return $(document.createElement(o.tagName));
}
return $(widget);
},
createFragment: function () {
return document.createDocumentFragment();
}
});
BI.mount = function (widget, container) {
if (container) {
BI.Widget._renderEngine.createElement(container).append(widget.element);
}
return widget._mount(true, false, false);
};
})();(function () {
var kv = {};
BI.shortcut = function (xtype, cls) {
@ -12172,7 +12182,7 @@ _.extend(BI.OB.prototype, {
throw new Error("无法根据item创建组件");
};
})();(function (window, undefined) {
})();!(function () {
function aspect (type) {
return function (target, methodName, advice) {
var exist = target[methodName],
@ -12234,7 +12244,7 @@ _.extend(BI.OB.prototype, {
return BI.aspect;
})(window);
})();
!(function () {
var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
@ -14446,7 +14456,7 @@ BI.Layout = BI.inherit(BI.Widget, {
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var frag = BI.Widget._renderEngine.createFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
@ -14675,7 +14685,7 @@ BI.Layout = BI.inherit(BI.Widget, {
addItems: function (items) {
var self = this, o = this.options;
var fragment = document.createDocumentFragment();
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
@ -14693,7 +14703,7 @@ BI.Layout = BI.inherit(BI.Widget, {
prependItems: function (items) {
var self = this;
items = items || [];
var fragment = document.createDocumentFragment();
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
@ -15687,7 +15697,12 @@ BI.ShowAction = BI.inherit(BI.Action, {
BI.specialCharsMap = BI.specialCharsMap || {};
url = url || "";
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
switch (str) {
case "\\":
return BI.specialCharsMap["\\\\"] || str;
default:
return BI.specialCharsMap[str] || str;
}
});
return _global.encodeURIComponent(url);
};
@ -16712,7 +16727,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev);
// }
}, 30);
BI.Widget._renderEngine.createElement(window).resize(fn);
BI.Widget._renderEngine.createElement(_global).resize(fn);
},
_resize: function (ev) {
@ -23971,6 +23986,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return watchers;
}
var mixinInjection = {};
function getMixins(type) {
return mixinInjection[type];
}
function mixin(xtype, cls) {
mixinInjection[xtype] = _.cloneDeep(cls);
}
var computedWatcherOptions = { lazy: true };
function initState(vm, state) {
@ -24075,6 +24100,22 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}
}
function initMixins(vm, mixins) {
mixins = mixins || [];
_.each(mixins.reverse(), function (mixinType) {
var mixin$$1 = getMixins(mixinType);
for (var key in mixin$$1) {
if (typeof mixin$$1[key] !== "function") continue;
if (_.has(vm, key)) continue;
vm[key] = _.bind(mixin$$1[key], vm.$$model ? vm.model : vm);
}
});
}
function defineProps(vm, keys) {
var props = {};
// if (typeof Proxy === 'function') {
@ -24202,14 +24243,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var watch$$1 = this.watch;
var actions = this.actions;
var keys = _.keys(this.$$model).concat(_.keys(state)).concat(_.keys(computed)).concat(context || []);
var mixins = this.mixins;
defineProps(this, keys);
childContext && defineContext(this, childContext);
this.$$model && (this.model.__ob__ = this.$$model.__ob__);
this._init();
initState(this, state);
initMixins(this, mixins);
initMethods(this, actions);
initComputed(this, computed);
initWatch(this, watch$$1);
initMethods(this, actions);
this.created && this.created();
if (this.$$model) {
return this.model;
@ -24266,6 +24309,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
exports.define = define;
exports.version = version;
exports.$$skipArray = $$skipArray;
exports.mixin = mixin;
exports.Model = Model;
exports.observerState = observerState;
exports.Observer = Observer;
@ -28855,7 +28899,7 @@ BI.Popover = BI.inherit(BI.Widget, {
BI.Resizers._resize();
}, function () {
self.tracker.releaseMouseMoves();
}, window);
}, _global);
var items = {
north: {
el: {
@ -29572,7 +29616,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
this.cache[i].destroyed = true;
}
}
var firstFragment = document.createDocumentFragment(), lastFragment = document.createDocumentFragment();
var firstFragment = BI.Widget._renderEngine.createFragment(), lastFragment = BI.Widget._renderEngine.createFragment();
var currentFragment = firstFragment;
for (var i = (start < 0 ? 0 : start); i <= end && i <= this.renderedIndex; i++) {
var index = this.cache[i].index;
@ -31975,7 +32019,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
},
left: 0,
right: 3,
top: 0,
top: 6,
bottom: 5
}]
});
@ -32118,7 +32162,7 @@ BI.Icon = BI.inherit(BI.Single, {
},
_init: function () {
BI.Icon.superclass._init.apply(this, arguments);
if (BI.isIE9Below()) {
if (BI.isIE9Below && BI.isIE9Below()) {
this.element.addClass("hack");
}
}
@ -64618,7 +64662,7 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
function createStore() {
var needPop = false;
if (window.Fix && this._store) {
if (_global.Fix && this._store) {
var store = findStore(this.options.context || this.options.element);
if (store) {
pushTarget(store);
@ -64650,7 +64694,7 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
var _render = BI.Widget.prototype._render;
BI.Widget.prototype._render = function () {
var needPop = false;
if (window.Fix && this._store) {
if (_global.Fix && this._store) {
needPop = true;
pushTarget(this.store);
initWatch(this, this.watch);

4
dist/fix/fix.compact.js vendored

@ -108,7 +108,7 @@
function createStore() {
var needPop = false;
if (window.Fix && this._store) {
if (_global.Fix && this._store) {
var store = findStore(this.options.context || this.options.element);
if (store) {
pushTarget(store);
@ -140,7 +140,7 @@
var _render = BI.Widget.prototype._render;
BI.Widget.prototype._render = function () {
var needPop = false;
if (window.Fix && this._store) {
if (_global.Fix && this._store) {
needPop = true;
pushTarget(this.store);
initWatch(this, this.watch);

31
dist/fix/fix.js vendored

@ -1069,6 +1069,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return watchers;
}
var mixinInjection = {};
function getMixins(type) {
return mixinInjection[type];
}
function mixin(xtype, cls) {
mixinInjection[xtype] = _.cloneDeep(cls);
}
var computedWatcherOptions = { lazy: true };
function initState(vm, state) {
@ -1173,6 +1183,22 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}
}
function initMixins(vm, mixins) {
mixins = mixins || [];
_.each(mixins.reverse(), function (mixinType) {
var mixin$$1 = getMixins(mixinType);
for (var key in mixin$$1) {
if (typeof mixin$$1[key] !== "function") continue;
if (_.has(vm, key)) continue;
vm[key] = _.bind(mixin$$1[key], vm.$$model ? vm.model : vm);
}
});
}
function defineProps(vm, keys) {
var props = {};
// if (typeof Proxy === 'function') {
@ -1300,14 +1326,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var watch$$1 = this.watch;
var actions = this.actions;
var keys = _.keys(this.$$model).concat(_.keys(state)).concat(_.keys(computed)).concat(context || []);
var mixins = this.mixins;
defineProps(this, keys);
childContext && defineContext(this, childContext);
this.$$model && (this.model.__ob__ = this.$$model.__ob__);
this._init();
initState(this, state);
initMixins(this, mixins);
initMethods(this, actions);
initComputed(this, computed);
initWatch(this, watch$$1);
initMethods(this, actions);
this.created && this.created();
if (this.$$model) {
return this.model;
@ -1364,6 +1392,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
exports.define = define;
exports.version = version;
exports.$$skipArray = $$skipArray;
exports.mixin = mixin;
exports.Model = Model;
exports.observerState = observerState;
exports.Observer = Observer;

3
dist/polyfill.js vendored

@ -16,7 +16,8 @@ if (typeof window !== "undefined") {
}
if (_global.BI == null) {
_global.BI = {prepares: []};
} else {
}
if(_global.BI.prepares == null) {
_global.BI.prepares = [];
}// Production steps of ECMA-262, Edition 5, 15.4.4.14
// Reference: http://es5.github.io/#x15.4.4.14

12
dist/utils.js vendored

@ -16,7 +16,8 @@ if (typeof window !== "undefined") {
}
if (_global.BI == null) {
_global.BI = {prepares: []};
} else {
}
if(_global.BI.prepares == null) {
_global.BI.prepares = [];
}/**
* @license
@ -13038,7 +13039,12 @@ _.extend(BI.OB.prototype, {
BI.specialCharsMap = BI.specialCharsMap || {};
url = url || "";
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
switch (str) {
case "\\":
return BI.specialCharsMap["\\\\"] || str;
default:
return BI.specialCharsMap[str] || str;
}
});
return _global.encodeURIComponent(url);
};
@ -13538,7 +13544,7 @@ _.extend(BI.OB.prototype, {
}
};
})();
(function (window, undefined) {
!(function () {
function aspect (type) {
return function (target, methodName, advice) {
var exist = target[methodName],
@ -13600,7 +13606,7 @@ _.extend(BI.OB.prototype, {
return BI.aspect;
})(window);
})();
!(function () {
var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

8
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

2
src/base/layer/layer.popover.js

@ -41,7 +41,7 @@ BI.Popover = BI.inherit(BI.Widget, {
BI.Resizers._resize();
}, function () {
self.tracker.releaseMouseMoves();
}, window);
}, _global);
var items = {
north: {
el: {

2
src/base/list/virtuallist.js

@ -114,7 +114,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
this.cache[i].destroyed = true;
}
}
var firstFragment = document.createDocumentFragment(), lastFragment = document.createDocumentFragment();
var firstFragment = BI.Widget._renderEngine.createFragment(), lastFragment = BI.Widget._renderEngine.createFragment();
var currentFragment = firstFragment;
for (var i = (start < 0 ? 0 : start); i <= end && i <= this.renderedIndex; i++) {
var index = this.cache[i].index;

2
src/base/single/editor/editor.textarea.js

@ -32,7 +32,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
},
left: 0,
right: 3,
top: 0,
top: 6,
bottom: 5
}]
});

2
src/base/single/icon/icon.js

@ -13,7 +13,7 @@ BI.Icon = BI.inherit(BI.Single, {
},
_init: function () {
BI.Icon.superclass._init.apply(this, arguments);
if (BI.isIE9Below()) {
if (BI.isIE9Below && BI.isIE9Below()) {
this.element.addClass("hack");
}
}

4
src/base/tree/treeview.js

@ -30,10 +30,10 @@ BI.TreeView = BI.inherit(BI.Pane, {
element: this,
items: [this.tip]
});
if(BI.isNotNull(o.value)){
if(BI.isNotNull(o.value)) {
this.setSelectedValue(o.value);
}
if (BI.isIE9Below()) {
if (BI.isIE9Below && BI.isIE9Below()) {
this.element.addClass("hack");
}
},

2
src/case/colorchooser/colorchooser.trigger.js

@ -19,7 +19,7 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
BI.ColorChooserTrigger.superclass._init.apply(this, arguments);
this.colorContainer = BI.createWidget({
type: "bi.layout",
cls: "color-chooser-trigger-content" + (BI.isIE9Below() ? " hack" : "")
cls: "color-chooser-trigger-content" + (BI.isIE9Below && BI.isIE9Below() ? " hack" : "")
});
var down = BI.createWidget({

5
src/core/alias.js

@ -589,7 +589,12 @@
BI.specialCharsMap = BI.specialCharsMap || {};
url = url || "";
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
switch (str) {
case "\\":
return BI.specialCharsMap["\\\\"] || str;
default:
return BI.specialCharsMap[str] || str;
}
});
return _global.encodeURIComponent(url);
};

2
src/core/controller/controller.resizer.js

@ -18,7 +18,7 @@ BI.ResizeController = BI.inherit(BI.Controller, {
self._resize(ev);
// }
}, 30);
BI.Widget._renderEngine.createElement(window).resize(fn);
BI.Widget._renderEngine.createElement(_global).resize(fn);
},
_resize: function (ev) {

3
src/core/foundation.js vendored

@ -16,6 +16,7 @@ if (typeof window !== "undefined") {
}
if (_global.BI == null) {
_global.BI = {prepares: []};
} else {
}
if(_global.BI.prepares == null) {
_global.BI.prepares = [];
}

2
src/core/platform/dom/dom.js

@ -13,7 +13,7 @@ BI.extend(BI.DOM, {
if (BI.isEmpty(doms)) {
return;
}
var frag = document.createDocumentFragment();
var frag = BI.Widget._renderEngine.createFragment();
BI.each(doms, function (i, dom) {
dom instanceof BI.Widget && (dom = dom.element);
dom instanceof $ && dom[0] && frag.appendChild(dom[0]);

4
src/core/utils/aspect.js

@ -1,4 +1,4 @@
(function (window, undefined) {
!(function () {
function aspect (type) {
return function (target, methodName, advice) {
var exist = target[methodName],
@ -60,4 +60,4 @@
return BI.aspect;
})(window);
})();

41
src/core/widget.js

@ -171,29 +171,28 @@
this._parent = parent;
},
_mount: function () {
/**
*
* @param force 是否强制挂载子节点
* @param deep 子节点是否也是按照当前force处理
* @param lifeHook 生命周期钩子触不触发默认触发
* @returns {boolean}
* @private
*/
_mount: function (force, deep, lifeHook) {
var self = this;
var isMounted = this._isMounted;
if (isMounted || !this.isVisible() || this.__asking === true) {
return;
}
if (this._isRoot === true) {
isMounted = true;
} else if (this._parent && this._parent._isMounted === true) {
isMounted = true;
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
if (!isMounted) {
return;
}
this.beforeMount && this.beforeMount();
lifeHook !== false && this.beforeMount && this.beforeMount();
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false);
!self.isValid() && widget._setValid(false);
widget._mount && widget._mount();
widget._mount && widget._mount(deep ? force : false, deep, lifeHook);
});
this.mounted && this.mounted();
lifeHook !== false && this.mounted && this.mounted();
return true;
},
@ -476,7 +475,7 @@
};
BI.Widget.registerRenderEngine({
createElement: function (widget) {
if(BI.isWidget(widget)) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return $(o.element);
@ -484,6 +483,16 @@
return $(document.createElement(o.tagName));
}
return $(widget);
},
createFragment: function () {
return document.createDocumentFragment();
}
});
BI.mount = function (widget, container) {
if (container) {
BI.Widget._renderEngine.createElement(container).append(widget.element);
}
return widget._mount(true, false, false);
};
})();

6
src/core/wrapper/layout.js

@ -69,7 +69,7 @@ BI.Layout = BI.inherit(BI.Widget, {
_mountChildren: function () {
var self = this;
var frag = document.createDocumentFragment();
var frag = BI.Widget._renderEngine.createFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
@ -298,7 +298,7 @@ BI.Layout = BI.inherit(BI.Widget, {
addItems: function (items) {
var self = this, o = this.options;
var fragment = document.createDocumentFragment();
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
@ -316,7 +316,7 @@ BI.Layout = BI.inherit(BI.Widget, {
prependItems: function (items) {
var self = this;
items = items || [];
var fragment = document.createDocumentFragment();
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);

Loading…
Cancel
Save