Browse Source

Merge branch 'master' of ssh://code.fineres.com:7999/~dailer/fineui

es6
zsmj 2 years ago
parent
commit
b0ae7a53b5
  1. 4
      dist/fix/fix.compact.js
  2. 90
      dist/fix/fix.js
  3. 97
      dist/fix/fix.proxy.js
  4. 4
      package.json
  5. 4
      src/core/1.lodash.js
  6. 72
      src/core/2.base.js
  7. 16
      src/core/3.ob.js
  8. 26
      src/core/5.inject.js
  9. 7
      src/core/conflict.js
  10. 2
      src/core/constant/events.js
  11. 2
      src/core/constant/var.js
  12. 4
      src/core/func/alias.js
  13. 2
      src/core/func/array.js
  14. 2
      src/core/func/date.js
  15. 4
      src/core/func/function.js
  16. 2
      src/core/func/number.js
  17. 4
      src/core/func/string.js
  18. 2
      src/core/platform/web/function.js
  19. 4
      src/core/platform/web/jquery/_jquery.js
  20. 2
      src/core/platform/web/load.js
  21. 4
      src/core/plugin.js
  22. 2
      src/core/structure/aes.js
  23. 2
      src/core/structure/base64.js
  24. 2
      src/core/utils/chinesePY.js
  25. 2
      src/core/utils/i18n.js
  26. 6
      src/core/wrapper/layout.js
  27. 2
      src/less/lib/constant.less
  28. 32
      src/router/0.router.js
  29. 244
      src/widget/multiselect/loader.js
  30. 18
      src/widget/multiselect/multiselect.loader.js
  31. 2
      test/utils.js
  32. 25
      webpack/attachments.js
  33. 1
      webpack/webpack.prod.js

4
dist/fix/fix.compact.js vendored

@ -38,7 +38,7 @@
cb = cb.handler; cb = cb.handler;
} }
options = options || {}; options = options || {};
return Fix.watch(vm.model, keyOrFn, _.bind(cb, vm), BI.extend(options, { return Fix.watch(vm.model, keyOrFn, BI._.bind(cb, vm), BI.extend(options, {
store: vm.store store: vm.store
})); }));
} }
@ -177,7 +177,7 @@
delete this.__cacheStore; delete this.__cacheStore;
}; };
_.each(["_render", "__afterRender", "_mount", "__afterMount"], function (name) { BI._.each(["_render", "__afterRender", "_mount", "__afterMount"], function (name) {
var old = BI.Widget.prototype[name]; var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () { old && (BI.Widget.prototype[name] = function () {
this.store && pushTarget(this.store); this.store && pushTarget(this.store);

90
dist/fix/fix.js vendored

@ -431,7 +431,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
// Deep watchers and watchers on Object/Arrays should fire even // Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may // when the value is the same, because the value may
// have mutated. // have mutated.
_.isObject(value) && options && options.refresh || this.deep) { BI._.isObject(value) && options && options.refresh || this.deep) {
// set new value // set new value
var oldValue = this.value; var oldValue = this.value;
this.value = value; this.value = value;
@ -491,8 +491,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
function _traverse(val, seen) { function _traverse(val, seen) {
var i = void 0, var i = void 0,
keys = void 0; keys = void 0;
var isA = _.isArray(val); var isA = BI._.isArray(val);
if (!isA && !_.isObject(val)) { if (!isA && !BI._.isObject(val)) {
return; return;
} }
if (val.__ob__) { if (val.__ob__) {
@ -508,7 +508,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
_traverse(val[i], seen); _traverse(val[i], seen);
} }
} else { } else {
keys = _.keys(val); keys = BI._.keys(val);
i = keys.length; i = keys.length;
while (i--) { while (i--) {
_traverse(val[keys[i]], seen); _traverse(val[keys[i]], seen);
@ -518,7 +518,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var arrayProto = Array.prototype; var arrayProto = Array.prototype;
var arrayMethods = []; var arrayMethods = [];
_.each(['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'], function (method) { BI._.each(['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'], function (method) {
var original = arrayProto[method]; var original = arrayProto[method];
arrayMethods[method] = function mutator() { arrayMethods[method] = function mutator() {
for (var _len = arguments.length, args = Array(_len), _key2 = 0; _key2 < _len; _key2++) { for (var _len = arguments.length, args = Array(_len), _key2 = 0; _key2 < _len; _key2++) {
@ -554,7 +554,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
}; };
}); });
var arrayKeys = _.keys(arrayMethods); var arrayKeys = BI._.keys(arrayMethods);
var observerState = { var observerState = {
shouldConvert: true shouldConvert: true
@ -583,7 +583,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
this.value = value; this.value = value;
this.dep = new Dep(); this.dep = new Dep();
this.vmCount = 0; this.vmCount = 0;
if (_.isArray(value)) { if (BI._.isArray(value)) {
var augment = hasProto ? protoAugment : copyAugment; var augment = hasProto ? protoAugment : copyAugment;
augment(value, arrayMethods, arrayKeys); augment(value, arrayMethods, arrayKeys);
this.model = this.observeArray(value); this.model = this.observeArray(value);
@ -623,13 +623,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
} }
function observe(value, parentObserver, parentKey) { function observe(value, parentObserver, parentKey) {
if (!_.isObject(value)) { if (!BI._.isObject(value)) {
return; return;
} }
var ob = void 0; var ob = void 0;
if (value.__ob__ instanceof Observer) { if (value.__ob__ instanceof Observer) {
ob = value.__ob__; ob = value.__ob__;
} else if (observerState.shouldConvert && isExtensible(value) && (_.isArray(value) || isPlainObject(value))) { } else if (observerState.shouldConvert && isExtensible(value) && (BI._.isArray(value) || isPlainObject(value))) {
ob = new Observer(value); ob = new Observer(value);
} }
if (ob) { if (ob) {
@ -643,7 +643,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
dep.notify({ observer: observer, key: key, refresh: refresh }); dep.notify({ observer: observer, key: key, refresh: refresh });
if (observer) { if (observer) {
//触发a.*绑定的依赖 //触发a.*绑定的依赖
_.each(observer._deps, function (dep) { BI._.each(observer._deps, function (dep) {
dep.notify({ observer: observer, key: key }); dep.notify({ observer: observer, key: key });
}); });
//触发a.**绑定的依赖 //触发a.**绑定的依赖
@ -651,7 +651,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
root = observer, root = observer,
route = key || ""; route = key || "";
while (parent) { while (parent) {
_.each(parent._scopeDeps, function (dep) { BI._.each(parent._scopeDeps, function (dep) {
dep.notify({ observer: observer, key: key }); dep.notify({ observer: observer, key: key });
}); });
if (parent.parentKey != null) { if (parent.parentKey != null) {
@ -674,7 +674,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
function defineReactive(obj, observer, shallow) { function defineReactive(obj, observer, shallow) {
var props = {}; var props = {};
var model = void 0; var model = void 0;
_.each(obj, function (val, key) { BI._.each(obj, function (val, key) {
if (key in $$skipArray) { if (key in $$skipArray) {
return; return;
} }
@ -691,7 +691,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
dep.depend(); dep.depend();
if (childOb) { if (childOb) {
childOb.dep.depend(); childOb.dep.depend();
if (_.isArray(value)) { if (BI._.isArray(value)) {
dependArray(value); dependArray(value);
} }
} }
@ -740,7 +740,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
dep.depend(); dep.depend();
if (childOb) { if (childOb) {
childOb.dep.depend(); childOb.dep.depend();
if (_.isArray(value)) { if (BI._.isArray(value)) {
dependArray(value); dependArray(value);
} }
} }
@ -767,12 +767,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
* already exist. * already exist.
*/ */
function set(target, key, val) { function set(target, key, val) {
if (_.isArray(target)) { if (BI._.isArray(target)) {
target.length = Math.max(target.length, key); target.length = Math.max(target.length, key);
target.splice(key, 1, val); target.splice(key, 1, val);
return val; return val;
} }
if (_.has(target, key)) { if (BI._.has(target, key)) {
target[key] = val; target[key] = val;
return val; return val;
} }
@ -795,12 +795,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
* Delete a property and trigger change if necessary. * Delete a property and trigger change if necessary.
*/ */
function del(target, key) { function del(target, key) {
if (_.isArray(target)) { if (BI._.isArray(target)) {
target.splice(key, 1); target.splice(key, 1);
return; return;
} }
var ob = target.__ob__; var ob = target.__ob__;
if (!_.has(target, key)) { if (!BI._.has(target, key)) {
return; return;
} }
if (!ob) { if (!ob) {
@ -821,7 +821,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
for (var e, i = 0, l = value.length; i < l; i++) { for (var e, i = 0, l = value.length; i < l; i++) {
e = value[i]; e = value[i];
e && e.__ob__ && e.__ob__.dep.depend(); e && e.__ob__ && e.__ob__.dep.depend();
if (_.isArray(e)) { if (BI._.isArray(e)) {
dependArray(e); dependArray(e);
} }
} }
@ -838,7 +838,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
function runBinaryFunction(binarys) { function runBinaryFunction(binarys) {
var expr = ''; var expr = '';
for (var i = 0, len = binarys.length; i < len; i++) { for (var i = 0, len = binarys.length; i < len; i++) {
if (_.isBoolean(binarys[i]) || _.has(operators, binarys[i])) { if (BI._.isBoolean(binarys[i]) || BI._.has(operators, binarys[i])) {
expr += binarys[i]; expr += binarys[i];
} else { } else {
expr += 'false'; expr += 'false';
@ -863,7 +863,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
options = options || {}; options = options || {};
options.user = true; options.user = true;
var exps = void 0; var exps = void 0;
if (_.isFunction(expOrFn) || !(exps = expOrFn.match(/[a-zA-Z0-9_.*]+|[|][|]|[&][&]|[(]|[)]/g)) || exps.length === 1 && expOrFn.indexOf("*") < 0) { if (BI._.isFunction(expOrFn) || !(exps = expOrFn.match(/[a-zA-Z0-9BI._.*]+|[|][|]|[&][&]|[(]|[)]/g)) || exps.length === 1 && expOrFn.indexOf("*") < 0) {
var watcher = new Watcher(model, expOrFn, cb, options); var watcher = new Watcher(model, expOrFn, cb, options);
if (options.immediate) { if (options.immediate) {
cb(watcher.value); cb(watcher.value);
@ -900,8 +900,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
} }
} }
}; };
_.each(exps, function (exp, i) { BI._.each(exps, function (exp, i) {
if (_.has(operators, exp)) { if (BI._.has(operators, exp)) {
return; return;
} }
if (exp.indexOf("*") >= 0) { if (exp.indexOf("*") >= 0) {
@ -929,7 +929,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
_dep.depend(); _dep.depend();
return NaN; return NaN;
}, function (newValue, oldValue, attrs) { }, function (newValue, oldValue, attrs) {
callback(i, newValue, oldValue, _.extend({ index: i }, attrs)); callback(i, newValue, oldValue, BI._.extend({ index: i }, attrs));
}, options); }, options);
watchers.push(function unwatchFn() { watchers.push(function unwatchFn() {
_w.teardown(); _w.teardown();
@ -955,7 +955,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var _regStr = routeToRegExp(exp); var _regStr = routeToRegExp(exp);
var _dep2 = new Dep(); var _dep2 = new Dep();
_root._globalDeps || (_root._globalDeps = {}); _root._globalDeps || (_root._globalDeps = {});
if (_.isArray(_root._globalDeps[_regStr])) { if (BI._.isArray(_root._globalDeps[_regStr])) {
_root._globalDeps[_regStr].push(_dep2); _root._globalDeps[_regStr].push(_dep2);
} else { } else {
_root._globalDeps[_regStr] = [_dep2]; _root._globalDeps[_regStr] = [_dep2];
@ -965,7 +965,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
_dep2.depend(); _dep2.depend();
return NaN; return NaN;
}, function (newValue, oldValue, attrs) { }, function (newValue, oldValue, attrs) {
callback(i, newValue, oldValue, _.extend({ index: i }, attrs)); callback(i, newValue, oldValue, BI._.extend({ index: i }, attrs));
}, options); }, options);
watchers.push(function unwatchFn() { watchers.push(function unwatchFn() {
if (_root._globalDeps) { if (_root._globalDeps) {
@ -1005,7 +1005,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var regStr = routeToRegExp(exp); var regStr = routeToRegExp(exp);
var dep = new Dep(); var dep = new Dep();
root._globalDeps || (root._globalDeps = {}); root._globalDeps || (root._globalDeps = {});
if (_.isArray(root._globalDeps[regStr])) { if (BI._.isArray(root._globalDeps[regStr])) {
root._globalDeps[regStr].push(dep); root._globalDeps[regStr].push(dep);
} else { } else {
root._globalDeps[regStr] = [dep]; root._globalDeps[regStr] = [dep];
@ -1015,7 +1015,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
dep.depend(); dep.depend();
return NaN; return NaN;
}, function (newValue, oldValue, attrs) { }, function (newValue, oldValue, attrs) {
callback(i, newValue, oldValue, _.extend({ index: i }, attrs)); callback(i, newValue, oldValue, BI._.extend({ index: i }, attrs));
}, options); }, options);
watchers.push(function unwatchFn() { watchers.push(function unwatchFn() {
if (root._globalDeps) { if (root._globalDeps) {
@ -1029,7 +1029,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return; return;
} }
var watcher = new Watcher(model, exp, function (newValue, oldValue, attrs) { var watcher = new Watcher(model, exp, function (newValue, oldValue, attrs) {
callback(i, newValue, oldValue, _.extend({ index: i }, attrs)); callback(i, newValue, oldValue, BI._.extend({ index: i }, attrs));
}, options); }, options);
watchers.push(function unwatchFn() { watchers.push(function unwatchFn() {
watcher.teardown(); watcher.teardown();
@ -1045,7 +1045,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
} }
function mixin(xtype, cls) { function mixin(xtype, cls) {
mixinInjection[xtype] = _.cloneDeep(cls); mixinInjection[xtype] = BI._.cloneDeep(cls);
} }
var computedWatcherOptions = { lazy: true }; var computedWatcherOptions = { lazy: true };
@ -1119,7 +1119,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
vm._watchers || (vm._watchers = []); vm._watchers || (vm._watchers = []);
for (var key in watch$$1) { for (var key in watch$$1) {
var handler = watch$$1[key]; var handler = watch$$1[key];
if (_.isArray(handler)) { if (BI._.isArray(handler)) {
for (var i = 0; i < handler.length; i++) { for (var i = 0; i < handler.length; i++) {
vm._watchers.push(createWatcher(vm, key, handler[i])); vm._watchers.push(createWatcher(vm, key, handler[i]));
} }
@ -1137,27 +1137,27 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (typeof cb === 'string') { if (typeof cb === 'string') {
cb = vm[cb]; cb = vm[cb];
} }
return watch(vm.model, keyOrFn, _.bind(cb, vm.$$model ? vm.model : vm), options); return watch(vm.model, keyOrFn, BI._.bind(cb, vm.$$model ? vm.model : vm), options);
} }
function initMethods(vm, methods) { function initMethods(vm, methods) {
for (var key in methods) { for (var key in methods) {
vm[key] = methods[key] == null ? noop : _.bind(methods[key], vm.$$model ? vm.model : vm); vm[key] = methods[key] == null ? noop : BI._.bind(methods[key], vm.$$model ? vm.model : vm);
} }
} }
function initMixins(vm, mixins) { function initMixins(vm, mixins) {
mixins = (mixins || []).slice(0); mixins = (mixins || []).slice(0);
_.each(mixins.reverse(), function (mixinType) { BI._.each(mixins.reverse(), function (mixinType) {
var mixin$$1 = getMixins(mixinType); var mixin$$1 = getMixins(mixinType);
for (var key in mixin$$1) { for (var key in mixin$$1) {
if (typeof mixin$$1[key] !== "function") continue; if (typeof mixin$$1[key] !== "function") continue;
if (_.has(vm, key)) continue; if (BI._.has(vm, key)) continue;
vm[key] = _.bind(mixin$$1[key], vm.$$model ? vm.model : vm); vm[key] = BI._.bind(mixin$$1[key], vm.$$model ? vm.model : vm);
} }
}); });
} }
@ -1282,7 +1282,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
function getInjectValues(vm) { function getInjectValues(vm) {
var inject = vm.inject || []; var inject = vm.inject || [];
var result = {}; var result = {};
_.each(inject, function (key) { BI._.each(inject, function (key) {
result[key] = getInjectValue(vm, key); result[key] = getInjectValue(vm, key);
}); });
return result; return result;
@ -1303,7 +1303,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
this.options = model || {}; this.options = model || {};
} }
this._parent = Model.target; this._parent = Model.target;
var state = _.isFunction(this.state) ? this.state() : this.state; var state = BI._.isFunction(this.state) ? this.state() : this.state;
var computed = this.computed; var computed = this.computed;
var context = this.context; var context = this.context;
var inject = this.inject; var inject = this.inject;
@ -1311,7 +1311,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
var provide = this.provide; var provide = this.provide;
var watch$$1 = this.watch; var watch$$1 = this.watch;
var actions = this.actions; var actions = this.actions;
var keys = _.keys(this.$$model).concat(_.keys(state)).concat(_.keys(computed)).concat(inject || []).concat(context || []); var keys = BI._.keys(this.$$model).concat(BI._.keys(state)).concat(BI._.keys(computed)).concat(inject || []).concat(context || []);
var mixins = this.mixins; var mixins = this.mixins;
defineProps(this, keys); defineProps(this, keys);
// deprecated // deprecated
@ -1320,7 +1320,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
this.$$model && (this.model.__ob__ = this.$$model.__ob__); this.$$model && (this.model.__ob__ = this.$$model.__ob__);
initMixins(this, mixins); initMixins(this, mixins);
this.init(); this.init();
initState(this, _.extend(getInjectValues(this), state)); initState(this, BI._.extend(getInjectValues(this), state));
initComputed(this, computed); initComputed(this, computed);
REACTIVE && initWatch(this, watch$$1); REACTIVE && initWatch(this, watch$$1);
initMethods(this, actions); initMethods(this, actions);
@ -1341,9 +1341,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
for (var _key3 in this._computedWatchers) { for (var _key3 in this._computedWatchers) {
this._computedWatchers[_key3].teardown(); this._computedWatchers[_key3].teardown();
} }
_.each(this._watchers, function (unwatches) { BI._.each(this._watchers, function (unwatches) {
unwatches = _.isArray(unwatches) ? unwatches : [unwatches]; unwatches = BI._.isArray(unwatches) ? unwatches : [unwatches];
_.each(unwatches, function (unwatch) { BI._.each(unwatches, function (unwatch) {
unwatch(); unwatch();
}); });
}); });
@ -1373,7 +1373,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
function toJSON(model) { function toJSON(model) {
var result = void 0; var result = void 0;
if (_.isArray(model)) { if (BI._.isArray(model)) {
result = []; result = [];
for (var i = 0, len = model.length; i < len; i++) { for (var i = 0, len = model.length; i < len; i++) {
result[i] = toJSON(model[i]); result[i] = toJSON(model[i]);
@ -1381,7 +1381,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
} else if (model && isPlainObject(model)) { } else if (model && isPlainObject(model)) {
result = {}; result = {};
for (var _key4 in model) { for (var _key4 in model) {
if (!_.has($$skipArray, _key4)) { if (!BI._.has($$skipArray, _key4)) {
result[_key4] = toJSON(model[_key4]); result[_key4] = toJSON(model[_key4]);
} }
} }

97
dist/fix/fix.proxy.js vendored

@ -2,22 +2,16 @@
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) : typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Fix = {})); (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Fix = {}));
}(this, (function (exports) { 'use strict'; })(this, (function (exports) { 'use strict';
function _typeof(obj) { function _typeof(obj) {
"@babel/helpers - typeof"; "@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
_typeof = function (obj) {
return typeof obj; return typeof obj;
}; } : function (obj) {
} else { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
_typeof = function (obj) { }, _typeof(obj);
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
} }
function _classCallCheck(instance, Constructor) { function _classCallCheck(instance, Constructor) {
@ -39,6 +33,9 @@
function _createClass(Constructor, protoProps, staticProps) { function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps); if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor; return Constructor;
} }
@ -1631,7 +1628,7 @@
return mixinInjection[type]; return mixinInjection[type];
} }
function mixin(xtype, cls) { function mixin(xtype, cls) {
mixinInjection[xtype] = _.cloneDeep(cls); mixinInjection[xtype] = BI._.cloneDeep(cls);
} }
var queue = []; var queue = [];
@ -1710,7 +1707,7 @@
} }
function innerWatch(source, cb, options) { function innerWatch(source, cb, options) {
if (!_.isFunction(cb)) { if (!BI._.isFunction(cb)) {
console.warn("`watch(fn, options?)` signature has been moved to a separate API. " + "Use `watchEffect(fn, options?)` instead. `watch` now only " + "supports `watch(source, cb, options?) signature."); console.warn("`watch(fn, options?)` signature has been moved to a separate API. " + "Use `watchEffect(fn, options?)` instead. `watch` now only " + "supports `watch(source, cb, options?) signature.");
} }
@ -1775,21 +1772,21 @@
}; };
deep = true; deep = true;
} else if (_.isArray(source)) { } else if (BI._.isArray(source)) {
getter = function getter() { getter = function getter() {
return source.map(function (s) { return source.map(function (s) {
if (isRef(s)) { if (isRef(s)) {
return s.value; return s.value;
} else if (isReactive(s)) { } else if (isReactive(s)) {
return traverse(s); return traverse(s);
} else if (_.isFunction(s)) { } else if (BI._.isFunction(s)) {
return s.call(instance); return s.call(instance);
} else { } else {
warnInvalidSource(s); warnInvalidSource(s);
} }
}); });
}; };
} else if (_.isFunction(source)) { } else if (BI._.isFunction(source)) {
if (cb) { if (cb) {
// getter with cb // getter with cb
getter = function getter() { getter = function getter() {
@ -1831,7 +1828,7 @@
}; };
}; };
var oldValue = _.isArray(source) ? [] : INITIAL_WATCHER_VALUE; var oldValue = BI._.isArray(source) ? [] : INITIAL_WATCHER_VALUE;
var job = function job() { var job = function job() {
// 这里去掉的原因是,新增属性没有生效也会触发变化监听 // 这里去掉的原因是,新增属性没有生效也会触发变化监听
@ -1903,7 +1900,7 @@
function traverse(value) { function traverse(value) {
var seen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set(); var seen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set();
if (!_.isObject(value) || seen.has(value)) { if (!BI._.isObject(value) || seen.has(value)) {
return value; return value;
} }
@ -1911,7 +1908,7 @@
if (isRef(value)) { if (isRef(value)) {
traverse(value.value, seen); traverse(value.value, seen);
} else if (_.isArray(value)) { } else if (BI._.isArray(value)) {
for (var i = 0; i < value.length; i++) { for (var i = 0; i < value.length; i++) {
traverse(value[i], seen); traverse(value[i], seen);
} }
@ -1940,7 +1937,7 @@
var expr = ""; var expr = "";
for (var i = 0, len = binarys.length; i < len; i++) { for (var i = 0, len = binarys.length; i < len; i++) {
if (_.isBoolean(binarys[i]) || _.has(operators, binarys[i])) { if (BI._.isBoolean(binarys[i]) || BI._.has(operators, binarys[i])) {
expr += binarys[i]; expr += binarys[i];
} else { } else {
expr += "false"; expr += "false";
@ -1953,7 +1950,7 @@
function watchExp(model, getter) { function watchExp(model, getter) {
var result = getter.call(model, model); var result = getter.call(model, model);
if (_.isArray(result)) { if (BI._.isArray(result)) {
return result.concat(); return result.concat();
} }
@ -1974,14 +1971,14 @@
options.user = true; options.user = true;
var exps; var exps;
if (_.isFunction(expOrFn)) { if (BI._.isFunction(expOrFn)) {
var watcher = innerWatch(expOrFn, cb, options); var watcher = innerWatch(expOrFn, cb, options);
return function unwatchFn() { return function unwatchFn() {
watcher(); watcher();
}; };
} }
if (!(exps = expOrFn.match(/[a-zA-Z0-9_.*]+|[|][|]|[&][&]|[(]|[)]/g)) || exps.length === 1 && !/\*/.test(expOrFn)) { if (!(exps = expOrFn.match(/[a-zA-Z0-9BI._.*]+|[|][|]|[&][&]|[(]|[)]/g)) || exps.length === 1 && !/\*/.test(expOrFn)) {
var paths = expOrFn.split("."); var paths = expOrFn.split(".");
var prePaths = paths.slice(0, paths.length - 1); var prePaths = paths.slice(0, paths.length - 1);
var preGetter = parsePath(prePaths.join(".")); var preGetter = parsePath(prePaths.join("."));
@ -2030,8 +2027,8 @@
} }
}; };
_.each(exps, function (exp, i) { BI._.each(exps, function (exp, i) {
if (_.has(operators, exp)) { if (BI._.has(operators, exp)) {
return; return;
} }
@ -2079,14 +2076,14 @@
return watchExp(_v2, _getter); return watchExp(_v2, _getter);
}, function (newValue, oldValue) { }, function (newValue, oldValue) {
// a.** 在a变化的时候不会触发change // a.** 在a变化的时候不会触发change
if (!_.isArray(newValue) && oldValue !== newValue) { if (!BI._.isArray(newValue) && oldValue !== newValue) {
return; return;
} }
callback(i, NaN, NaN, _.extend({ callback(i, NaN, NaN, BI._.extend({
index: i index: i
})); }));
}, _.extend({ }, BI._.extend({
deep: true deep: true
}, options))); }, options)));
return; return;
@ -2145,11 +2142,11 @@
changes = []; changes = [];
if (newValue === true) { if (newValue === true) {
callback(i, NaN, NaN, _.extend({ callback(i, NaN, NaN, BI._.extend({
index: i index: i
})); }));
} }
}, _.extend({}, options, { }, BI._.extend({}, options, {
deep: true, deep: true,
onTrigger: function onTrigger(_ref) { onTrigger: function onTrigger(_ref) {
var target = _ref.target, var target = _ref.target,
@ -2167,7 +2164,7 @@
watchers.push(innerWatch(function () { watchers.push(innerWatch(function () {
return watchExp(model, getter); return watchExp(model, getter);
}, function (newValue, oldValue) { }, function (newValue, oldValue) {
callback(i, newValue, oldValue, _.extend({ callback(i, newValue, oldValue, BI._.extend({
index: i index: i
})); }));
}, options)); }, options));
@ -2188,7 +2185,7 @@
var $$computed = vm.$$computed = {}; var $$computed = vm.$$computed = {};
for (var key in c) { for (var key in c) {
$$computed[key] = computed(_.bind(c[key], vm)); $$computed[key] = computed(BI._.bind(c[key], vm));
} }
} }
@ -2198,7 +2195,7 @@
for (var key in watch) { for (var key in watch) {
var handler = watch[key]; var handler = watch[key];
if (_.isArray(handler)) { if (BI._.isArray(handler)) {
for (var i = 0; i < handler.length; i++) { for (var i = 0; i < handler.length; i++) {
vm._watchers.push(createWatcher(vm, key, handler[i])); vm._watchers.push(createWatcher(vm, key, handler[i]));
} }
@ -2218,25 +2215,25 @@
cb = vm[cb]; cb = vm[cb];
} }
return watch(vm.model, keyOrFn, _.bind(cb, vm), options); return watch(vm.model, keyOrFn, BI._.bind(cb, vm), options);
} }
function initMethods(vm, methods) { function initMethods(vm, methods) {
for (var key in methods) { for (var key in methods) {
vm[key] = methods[key] == null ? noop : _.bind(methods[key], vm); vm[key] = methods[key] == null ? noop : BI._.bind(methods[key], vm);
} }
} }
function initMixins(vm, mixins) { function initMixins(vm, mixins) {
mixins = (mixins || []).slice(0); mixins = (mixins || []).slice(0);
_.each(mixins.reverse(), function (mixinType) { BI._.each(mixins.reverse(), function (mixinType) {
var mixin = getMixins(mixinType); var mixin = getMixins(mixinType);
for (var key in mixin) { for (var key in mixin) {
if (typeof mixin[key] !== "function") continue; if (typeof mixin[key] !== "function") continue;
if (_.has(vm, key)) continue; if (BI._.has(vm, key)) continue;
vm[key] = _.bind(mixin[key], vm); vm[key] = BI._.bind(mixin[key], vm);
} }
}); });
} }
@ -2329,7 +2326,7 @@
var inject = vm.inject || []; var inject = vm.inject || [];
var result = {}; var result = {};
_.each(inject, function (key) { BI._.each(inject, function (key) {
result[key] = getInjectValue(vm, key); result[key] = getInjectValue(vm, key);
}); });
@ -2346,7 +2343,7 @@
value: function _constructor(options, destroyHandler) { value: function _constructor(options, destroyHandler) {
this.options = options || {}; this.options = options || {};
this._parent = Model.target; this._parent = Model.target;
var state = _.isFunction(this.state) ? this.state() : this.state; var state = BI._.isFunction(this.state) ? this.state() : this.state;
var computed = this.computed; var computed = this.computed;
var context = this.context; var context = this.context;
var inject = this.inject; var inject = this.inject;
@ -2354,14 +2351,14 @@
var watch = this.watch; var watch = this.watch;
var actions = this.actions; var actions = this.actions;
_.keys(state).concat(_.keys(computed)).concat(inject || []).concat(context || []); BI._.keys(state).concat(BI._.keys(computed)).concat(inject || []).concat(context || []);
var mixins = this.mixins; var mixins = this.mixins;
defineProps(this); defineProps(this);
childContext && defineContext(this, childContext); childContext && defineContext(this, childContext);
initMixins(this, mixins); initMixins(this, mixins);
this.init(); this.init();
initState(this, _.extend(getInjectValues(this), state)); initState(this, BI._.extend(getInjectValues(this), state));
initComputed(this, computed); initComputed(this, computed);
REACTIVE && initWatch(this, watch); REACTIVE && initWatch(this, watch);
initMethods(this, actions); initMethods(this, actions);
@ -2379,10 +2376,10 @@
}, { }, {
key: "destroy", key: "destroy",
value: function destroy() { value: function destroy() {
_.each(this._watchers, function (unwatches) { BI._.each(this._watchers, function (unwatches) {
unwatches = _.isArray(unwatches) ? unwatches : [unwatches]; unwatches = BI._.isArray(unwatches) ? unwatches : [unwatches];
_.each(unwatches, function (unwatch) { BI._.each(unwatches, function (unwatch) {
unwatch(); unwatch();
}); });
}); });
@ -2398,7 +2395,7 @@
return Model; return Model;
}(); }();
function set(target, key, val) { function set(target, key, val) {
if (_.isArray(target)) { if (BI._.isArray(target)) {
target.length = Math.max(target.length, key); target.length = Math.max(target.length, key);
target.splice(key, 1, val); target.splice(key, 1, val);
return val; return val;
@ -2416,12 +2413,12 @@
return value; return value;
} }
function del(target, key) { function del(target, key) {
if (_.isArray(target)) { if (BI._.isArray(target)) {
target.splice(key, 1); target.splice(key, 1);
return; return;
} }
if (!_.has(target, key)) { if (!BI._.has(target, key)) {
return; return;
} }
@ -2441,7 +2438,7 @@
function toJSON(model) { function toJSON(model) {
var result; var result;
if (_.isArray(model)) { if (BI._.isArray(model)) {
result = []; result = [];
for (var i = 0, len = model.length; i < len; i++) { for (var i = 0, len = model.length; i < len; i++) {
@ -2475,4 +2472,4 @@
Object.defineProperty(exports, '__esModule', { value: true }); Object.defineProperty(exports, '__esModule', { value: true });
}))); }));

4
package.json

@ -1,8 +1,8 @@
{ {
"name": "fineui", "name": "fineui",
"version": "2.0.20220623154535", "version": "2.0.20220624112553",
"description": "fineui", "description": "fineui",
"main": "dist/fineui.min.js", "main": "dist/fineui_without_conflict.min.js",
"types": "dist/lib/index.d.ts", "types": "dist/lib/index.d.ts",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.17.4", "@babel/core": "^7.17.4",

4
src/core/1.lodash.js

@ -10253,7 +10253,7 @@
// loaded by a script tag in the presence of an AMD loader. // loaded by a script tag in the presence of an AMD loader.
// See http://requirejs.org/docs/errors.html#mismatch for more details. // See http://requirejs.org/docs/errors.html#mismatch for more details.
// Use `_.noConflict` to remove Lodash from the global object. // Use `_.noConflict` to remove Lodash from the global object.
root._ = lodash; BI._ = lodash;
// Define as an anonymous module so, through path mapping, it can be // Define as an anonymous module so, through path mapping, it can be
// referenced as the "underscore" module. // referenced as the "underscore" module.
@ -10270,6 +10270,6 @@
} }
else { else {
// Export to the global object. // Export to the global object.
root._ = lodash; BI._ = lodash;
} }
}.call(this)); }.call(this));

72
src/core/2.base.js

@ -11,19 +11,19 @@
}; };
var _apply = function (name) { var _apply = function (name) {
return function () { return function () {
return _[name].apply(_, arguments); return BI._[name].apply(BI._, arguments);
}; };
}; };
var _applyFunc = function (name) { var _applyFunc = function (name) {
return function () { return function () {
var args = Array.prototype.slice.call(arguments, 0); var args = Array.prototype.slice.call(arguments, 0);
args[1] = _.isFunction(args[1]) ? traverse(args[1], args[2]) : args[1]; args[1] = BI._.isFunction(args[1]) ? traverse(args[1], args[2]) : args[1];
return _[name].apply(_, args); return BI._[name].apply(BI._, args);
}; };
}; };
// Utility // Utility
_.extend(BI, { BI._.extend(BI, {
assert: function (v, is) { assert: function (v, is) {
if (this.isFunction(is)) { if (this.isFunction(is)) {
if (!is(v)) { if (!is(v)) {
@ -146,10 +146,10 @@
}); });
// 集合相关方法 // 集合相关方法
_.each(["where", "findWhere", "invoke", "pluck", "shuffle", "sample", "toArray", "size"], function (name) { BI._.each(["where", "findWhere", "invoke", "pluck", "shuffle", "sample", "toArray", "size"], function (name) {
BI[name] = _apply(name); BI[name] = _apply(name);
}); });
_.each(["get", "set", "each", "map", "reduce", "reduceRight", "find", "filter", "reject", "every", "all", "some", "any", "max", "min", BI._.each(["get", "set", "each", "map", "reduce", "reduceRight", "find", "filter", "reject", "every", "all", "some", "any", "max", "min",
"sortBy", "groupBy", "indexBy", "countBy", "partition", "clamp"], function (name) { "sortBy", "groupBy", "indexBy", "countBy", "partition", "clamp"], function (name) {
if (name === "any") { if (name === "any") {
BI[name] = _applyFunc("some"); BI[name] = _applyFunc("some");
@ -157,7 +157,7 @@
BI[name] = _applyFunc(name); BI[name] = _applyFunc(name);
} }
}); });
_.extend(BI, { BI._.extend(BI, {
// 数数 // 数数
count: function (from, to, predicate) { count: function (from, to, predicate) {
var t; var t;
@ -217,10 +217,10 @@
}).join(""); }).join("");
} }
if (BI.isArray(obj1)) { if (BI.isArray(obj1)) {
return _.concat.apply([], arguments); return BI._.concat.apply([], arguments);
} }
if (BI.isObject(obj1)) { if (BI.isObject(obj1)) {
return _.extend.apply({}, arguments); return BI._.extend.apply({}, arguments);
} }
}, },
@ -254,7 +254,7 @@
backFindKey: function (obj, predicate, context) { backFindKey: function (obj, predicate, context) {
predicate = BI.iteratee(predicate, context); predicate = BI.iteratee(predicate, context);
var keys = _.keys(obj), key; var keys = BI._.keys(obj), key;
for (var i = keys.length - 1; i >= 0; i--) { for (var i = keys.length - 1; i >= 0; i--) {
key = keys[i]; key = keys[i];
if (predicate(obj[key], key, obj)) { if (predicate(obj[key], key, obj)) {
@ -347,14 +347,14 @@
}); });
// 数组相关的方法 // 数组相关的方法
_.each(["first", "initial", "last", "rest", "compact", "flatten", "without", "union", "intersection", BI._.each(["first", "initial", "last", "rest", "compact", "flatten", "without", "union", "intersection",
"difference", "zip", "unzip", "object", "indexOf", "lastIndexOf", "sortedIndex", "range", "take", "takeRight", "uniqBy"], function (name) { "difference", "zip", "unzip", "object", "indexOf", "lastIndexOf", "sortedIndex", "range", "take", "takeRight", "uniqBy"], function (name) {
BI[name] = _apply(name); BI[name] = _apply(name);
}); });
_.each(["findIndex", "findLastIndex"], function (name) { BI._.each(["findIndex", "findLastIndex"], function (name) {
BI[name] = _applyFunc(name); BI[name] = _applyFunc(name);
}); });
_.extend(BI, { BI._.extend(BI, {
// 构建一个长度为length的数组 // 构建一个长度为length的数组
makeArray: function (length, value) { makeArray: function (length, value) {
var res = []; var res = [];
@ -401,27 +401,27 @@
if (array == null) { if (array == null) {
return []; return [];
} }
if (!_.isBoolean(isSorted)) { if (!BI._.isBoolean(isSorted)) {
context = iteratee; context = iteratee;
iteratee = isSorted; iteratee = isSorted;
isSorted = false; isSorted = false;
} }
iteratee && (iteratee = traverse(iteratee, context)); iteratee && (iteratee = traverse(iteratee, context));
return _.uniq.call(_, array, isSorted, iteratee, context); return BI._.uniq.call(BI._, array, isSorted, iteratee, context);
} }
}); });
// 对象相关方法 // 对象相关方法
_.each(["keys", "allKeys", "values", "pairs", "invert", "create", "functions", "extend", "extendOwn", BI._.each(["keys", "allKeys", "values", "pairs", "invert", "create", "functions", "extend", "extendOwn",
"defaults", "clone", "property", "propertyOf", "matcher", "isEqual", "isMatch", "isEmpty", "defaults", "clone", "property", "propertyOf", "matcher", "isEqual", "isMatch", "isEmpty",
"isElement", "isNumber", "isString", "isArray", "isObject", "isPlainObject", "isArguments", "isFunction", "isFinite", "isElement", "isNumber", "isString", "isArray", "isObject", "isPlainObject", "isArguments", "isFunction", "isFinite",
"isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined", "zipObject", "cloneDeep"], function (name) { "isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined", "zipObject", "cloneDeep"], function (name) {
BI[name] = _apply(name); BI[name] = _apply(name);
}); });
_.each(["mapObject", "findKey", "pick", "omit", "tap"], function (name) { BI._.each(["mapObject", "findKey", "pick", "omit", "tap"], function (name) {
BI[name] = _applyFunc(name); BI[name] = _applyFunc(name);
}); });
_.extend(BI, { BI._.extend(BI, {
inherit: function (sp, overrides) { inherit: function (sp, overrides) {
var sb = function () { var sb = function () {
@ -432,7 +432,7 @@
F.prototype = spp; F.prototype = spp;
sb.prototype = new F(); sb.prototype = new F();
sb.superclass = spp; sb.superclass = spp;
_.extend(sb.prototype, overrides, { BI._.extend(sb.prototype, overrides, {
superclass: sp superclass: sp
}); });
return sb; return sb;
@ -455,10 +455,10 @@
return false; return false;
} }
return BI.every(keys, function (i, key) { return BI.every(keys, function (i, key) {
return _.has(obj, key); return BI._.has(obj, key);
}); });
} }
return _.has.apply(_, arguments); return BI._.has.apply(BI._, arguments);
}, },
freeze: function (value) { freeze: function (value) {
@ -528,9 +528,9 @@
}); });
// deep方法 // deep方法
_.extend(BI, { BI._.extend(BI, {
deepClone: _.cloneDeep, deepClone: BI._.cloneDeep,
deepExtend: _.merge, deepExtend: BI._.merge,
isDeepMatch: function (object, attrs) { isDeepMatch: function (object, attrs) {
var keys = BI.keys(attrs), length = keys.length; var keys = BI.keys(attrs), length = keys.length;
@ -548,8 +548,8 @@
}, },
contains: function (obj, target, fromIndex) { contains: function (obj, target, fromIndex) {
if (!_.isArrayLike(obj)) obj = _.values(obj); if (!BI._.isArrayLike(obj)) obj = BI._.values(obj);
return _.indexOf(obj, target, typeof fromIndex === "number" && fromIndex) >= 0; return BI._.indexOf(obj, target, typeof fromIndex === "number" && fromIndex) >= 0;
}, },
deepContains: function (obj, copy) { deepContains: function (obj, copy) {
@ -647,20 +647,20 @@
}); });
// 通用方法 // 通用方法
_.each(["uniqueId", "result", "chain", "iteratee", "escape", "unescape", "before", "after"], function (name) { BI._.each(["uniqueId", "result", "chain", "iteratee", "escape", "unescape", "before", "after"], function (name) {
BI[name] = function () { BI[name] = function () {
return _[name].apply(_, arguments); return BI._[name].apply(BI._, arguments);
}; };
}); });
// 事件相关方法 // 事件相关方法
_.each(["bind", "once", "partial", "debounce", "throttle", "delay", "defer", "wrap"], function (name) { BI._.each(["bind", "once", "partial", "debounce", "throttle", "delay", "defer", "wrap"], function (name) {
BI[name] = function () { BI[name] = function () {
return _[name].apply(_, arguments); return BI._[name].apply(BI._, arguments);
}; };
}); });
_.extend(BI, { BI._.extend(BI, {
nextTick: (function () { nextTick: (function () {
var callbacks = []; var callbacks = [];
var pending = false; var pending = false;
@ -731,10 +731,10 @@
}); });
// 数字相关方法 // 数字相关方法
_.each(["random"], function (name) { BI._.each(["random"], function (name) {
BI[name] = _apply(name); BI[name] = _apply(name);
}); });
_.extend(BI, { BI._.extend(BI, {
parseInt: function (number) { parseInt: function (number) {
var radix = 10; var radix = 10;
@ -837,9 +837,9 @@
}); });
// 字符串相关方法 // 字符串相关方法
_.extend(BI, { BI._.extend(BI, {
trim: function () { trim: function () {
return _.trim.apply(_, arguments); return BI._.trim.apply(BI._, arguments);
}, },
toUpperCase: function (string) { toUpperCase: function (string) {
@ -965,7 +965,7 @@
}); });
// 日期相关方法 // 日期相关方法
_.extend(BI, { BI._.extend(BI, {
/** /**
* 是否是闰年 * 是否是闰年
* @param year * @param year

16
src/core/3.ob.js

@ -31,7 +31,7 @@
var OB = function (config) { var OB = function (config) {
this._constructor(config); this._constructor(config);
}; };
_.extend(OB.prototype, { BI._.extend(OB.prototype, {
props: {}, props: {},
init: null, init: null,
destroyed: null, destroyed: null,
@ -66,12 +66,12 @@
_initListeners: function () { _initListeners: function () {
var self = this; var self = this;
if (this.options.listeners != null) { if (this.options.listeners != null) {
_.each(this.options.listeners, function (lis, eventName) { BI._.each(this.options.listeners, function (lis, eventName) {
if (_.isFunction(lis)) { if (BI._.isFunction(lis)) {
self.on(eventName, lis); self.on(eventName, lis);
return; return;
} }
(lis.target ? lis.target : self)[lis.once ? "once" : "on"](lis.eventName, _.bind(lis.action, self)); (lis.target ? lis.target : self)[lis.once ? "once" : "on"](lis.eventName, BI._.bind(lis.action, self));
}); });
delete this.options.listeners; delete this.options.listeners;
} }
@ -100,7 +100,7 @@
}, },
_getEvents: function () { _getEvents: function () {
if (!_.isObject(this.events)) { if (!BI._.isObject(this.events)) {
this.events = {}; this.events = {};
} }
return this.events; return this.events;
@ -115,7 +115,7 @@
var self = this; var self = this;
eventName = eventName.toLowerCase(); eventName = eventName.toLowerCase();
var fns = this._getEvents()[eventName]; var fns = this._getEvents()[eventName];
if (!_.isArray(fns)) { if (!BI._.isArray(fns)) {
fns = []; fns = [];
this._getEvents()[eventName] = fns; this._getEvents()[eventName] = fns;
} }
@ -151,9 +151,9 @@
delete this._getEvents()[eventName]; delete this._getEvents()[eventName];
} else { } else {
var fns = this._getEvents()[eventName]; var fns = this._getEvents()[eventName];
if (_.isArray(fns)) { if (BI._.isArray(fns)) {
var newFns = []; var newFns = [];
_.each(fns, function (ifn) { BI._.each(fns, function (ifn) {
if (ifn != fn) { if (ifn != fn) {
newFns.push(ifn); newFns.push(ifn);
} }

26
src/core/5.inject.js

@ -10,7 +10,7 @@
BI.module = BI.module || function (xtype, cls) { BI.module = BI.module || function (xtype, cls) {
if (moduleInjection[xtype] != null) { if (moduleInjection[xtype] != null) {
_global.console && console.error("module: [" + xtype + "] 已经注册过了"); _global.console && console.error("module: [" + xtype + "] 已经注册过了");
} } else {
if (BI.isFunction(cls)) { if (BI.isFunction(cls)) {
cls = cls(); cls = cls();
} }
@ -31,6 +31,8 @@
} }
} }
moduleInjection[xtype] = cls; moduleInjection[xtype] = cls;
}
return function () { return function () {
return BI.Modules.getModule(xtype); return BI.Modules.getModule(xtype);
}; };
@ -40,8 +42,10 @@
BI.constant = BI.constant || function (xtype, cls) { BI.constant = BI.constant || function (xtype, cls) {
if (constantInjection[xtype] != null) { if (constantInjection[xtype] != null) {
_global.console && console.error("constant: [" + xtype + "]已经注册过了"); _global.console && console.error("constant: [" + xtype + "]已经注册过了");
} } else {
constantInjection[xtype] = cls; constantInjection[xtype] = cls;
}
return function () { return function () {
return BI.Constants.getConstant(xtype); return BI.Constants.getConstant(xtype);
}; };
@ -51,8 +55,10 @@
BI.model = BI.model || function (xtype, cls) { BI.model = BI.model || function (xtype, cls) {
if (modelInjection[xtype] != null) { if (modelInjection[xtype] != null) {
_global.console && console.error("model: [" + xtype + "] 已经注册过了"); _global.console && console.error("model: [" + xtype + "] 已经注册过了");
} } else {
modelInjection[xtype] = cls; modelInjection[xtype] = cls;
}
return function (config) { return function (config) {
return BI.Models.getModel(xtype, config); return BI.Models.getModel(xtype, config);
}; };
@ -62,8 +68,10 @@
BI.store = BI.store || function (xtype, cls) { BI.store = BI.store || function (xtype, cls) {
if (storeInjection[xtype] != null) { if (storeInjection[xtype] != null) {
_global.console && console.error("store: [" + xtype + "] 已经注册过了"); _global.console && console.error("store: [" + xtype + "] 已经注册过了");
} } else {
storeInjection[xtype] = cls; storeInjection[xtype] = cls;
}
return function (config) { return function (config) {
return BI.Stores.getStore(xtype, config); return BI.Stores.getStore(xtype, config);
}; };
@ -73,8 +81,10 @@
BI.service = BI.service || function (xtype, cls) { BI.service = BI.service || function (xtype, cls) {
if (serviceInjection[xtype] != null) { if (serviceInjection[xtype] != null) {
_global.console && console.error("service: [" + xtype + "] 已经注册过了"); _global.console && console.error("service: [" + xtype + "] 已经注册过了");
} } else {
serviceInjection[xtype] = cls; serviceInjection[xtype] = cls;
}
return function (config) { return function (config) {
return BI.Services.getService(xtype, config); return BI.Services.getService(xtype, config);
}; };
@ -84,8 +94,10 @@
BI.provider = BI.provider || function (xtype, cls) { BI.provider = BI.provider || function (xtype, cls) {
if (providerInjection[xtype] != null) { if (providerInjection[xtype] != null) {
_global.console && console.error("provider: [" + xtype + "] 已经注册过了"); _global.console && console.error("provider: [" + xtype + "] 已经注册过了");
} } else {
providerInjection[xtype] = cls; providerInjection[xtype] = cls;
}
return function (config) { return function (config) {
return BI.Providers.getProvider(xtype, config); return BI.Providers.getProvider(xtype, config);
}; };
@ -390,6 +402,8 @@
BI.shortcut = BI.component = BI.shortcut || function (xtype, cls) { BI.shortcut = BI.component = BI.shortcut || function (xtype, cls) {
if (kv[xtype] != null) { if (kv[xtype] != null) {
_global.console && console.error("组件: [" + xtype + "] 已经注册过了"); _global.console && console.error("组件: [" + xtype + "] 已经注册过了");
return;
} }
if (cls) { if (cls) {
cls["xtype"] = xtype; cls["xtype"] = xtype;

7
src/core/conflict.js

@ -0,0 +1,7 @@
if (!window.$ && !window.jQuery) {
window.jQuery = window.$ = BI.jQuery;
}
if (!window._) {
window._ = BI._;
}

2
src/core/constant/events.js

@ -2,7 +2,7 @@
* 事件集合 * 事件集合
* @class BI.Events * @class BI.Events
*/ */
_.extend(BI, { BI._.extend(BI, {
Events: { Events: {
/** /**

2
src/core/constant/var.js

@ -2,7 +2,7 @@
* 常量 * 常量
*/ */
_.extend(BI, { BI._.extend(BI, {
MAX: 0xfffffffffffffff, MAX: 0xfffffffffffffff,
MIN: -0xfffffffffffffff, MIN: -0xfffffffffffffff,
EVENT_RESPONSE_TIME: 200, EVENT_RESPONSE_TIME: 200,

4
src/core/func/alias.js

@ -450,7 +450,7 @@
BI.cjkEncodeDO = function (o) { BI.cjkEncodeDO = function (o) {
if (BI.isPlainObject(o)) { if (BI.isPlainObject(o)) {
var result = {}; var result = {};
_.each(o, function (v, k) { BI._.each(o, function (v, k) {
if (!(typeof v === "string")) { if (!(typeof v === "string")) {
v = BI.jsonEncode(v); v = BI.jsonEncode(v);
} }
@ -603,7 +603,7 @@
return new Date(o.__time__); return new Date(o.__time__);
} }
for (var a in o) { for (var a in o) {
if (o[a] == o || typeof o[a] === "object" || _.isFunction(o[a])) { if (o[a] == o || typeof o[a] === "object" || BI._.isFunction(o[a])) {
break; break;
} }
o[a] = arguments.callee(o[a]); o[a] = arguments.callee(o[a]);

2
src/core/func/array.js

@ -2,7 +2,7 @@
* 对数组对象的扩展 * 对数组对象的扩展
* @class Array * @class Array
*/ */
_.extend(BI, { BI._.extend(BI, {
pushArray: function (sArray, array) { pushArray: function (sArray, array) {
for (var i = 0; i < array.length; i++) { for (var i = 0; i < array.length; i++) {

2
src/core/func/date.js

@ -6,7 +6,7 @@ BI.Date.HOUR = 60 * BI.Date.MINUTE;
BI.Date.DAY = 24 * BI.Date.HOUR; BI.Date.DAY = 24 * BI.Date.HOUR;
BI.Date.WEEK = 7 * BI.Date.DAY; BI.Date.WEEK = 7 * BI.Date.DAY;
_.extend(BI, { BI._.extend(BI, {
/** /**
* 获取时区 * 获取时区
* @returns {String} * @returns {String}

4
src/core/func/function.js

@ -3,7 +3,7 @@
* Created by GUY on 2015/6/24. * Created by GUY on 2015/6/24.
*/ */
BI.Func = BI.Func || {}; BI.Func = BI.Func || {};
_.extend(BI.Func, { BI._.extend(BI.Func, {
/** /**
* 创建唯一的名字 * 创建唯一的名字
* @param array * @param array
@ -143,7 +143,7 @@ _.extend(BI.Func, {
} }
}); });
_.extend(BI, { BI._.extend(BI, {
beforeFunc: function (sFunc, func) { beforeFunc: function (sFunc, func) {
var __self = sFunc; var __self = sFunc;
return function () { return function () {

2
src/core/func/number.js

@ -1,4 +1,4 @@
_.extend(BI, { BI._.extend(BI, {
// 给Number类型增加一个add方法,调用起来更加方便。 // 给Number类型增加一个add方法,调用起来更加方便。
add: function (num, arg) { add: function (num, arg) {
return accAdd(arg, num); return accAdd(arg, num);

4
src/core/func/string.js

@ -2,7 +2,7 @@
* 对字符串对象的扩展 * 对字符串对象的扩展
* @class String * @class String
*/ */
_.extend(BI, { BI._.extend(BI, {
/** /**
* 判断字符串是否已指定的字符串开始 * 判断字符串是否已指定的字符串开始
@ -65,7 +65,7 @@ _.extend(BI, {
} else { } else {
src += "&"; src += "&";
} }
_.each(paras, function (value, name) { BI._.each(paras, function (value, name) {
if (typeof(name) === "string") { if (typeof(name) === "string") {
src += name + "=" + value + "&"; src += name + "=" + value + "&";
} }

2
src/core/platform/web/function.js

@ -1,5 +1,5 @@
// 浏览器相关方法 // 浏览器相关方法
_.extend(BI, { BI._.extend(BI, {
isIE: function () { isIE: function () {
if(!_global.navigator) { if(!_global.navigator) {
return false; return false;

4
src/core/platform/web/jquery/_jquery.js vendored

@ -11012,10 +11012,6 @@
// Expose jQuery and $ identifiers, even in // Expose jQuery and $ identifiers, even in
// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
// and CommonJS for browser emulators (#13566) // and CommonJS for browser emulators (#13566)
if (!window.$ && !window.jQuery) {
window.jQuery = window.$ = jQuery;
}
BI.jQuery = BI.$ = jQuery; BI.jQuery = BI.$ = jQuery;
return jQuery; return jQuery;

2
src/core/platform/web/load.js

@ -1,4 +1,4 @@
_.extend(BI, { BI._.extend(BI, {
$import: function () { $import: function () {
var _LOADED = {}; // alex:保存加载过的 var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) { function loadReady (src, must) {

4
src/core/plugin.js

@ -36,8 +36,8 @@ BI.Plugin = BI.Plugin || {};
}, },
config: function (widgetConfigFn, objectConfigFn) { config: function (widgetConfigFn, objectConfigFn) {
_GlobalWidgetConfigFns = _GlobalWidgetConfigFns.concat(_.isArray(widgetConfigFn) ? widgetConfigFn : [widgetConfigFn]); _GlobalWidgetConfigFns = _GlobalWidgetConfigFns.concat(BI._.isArray(widgetConfigFn) ? widgetConfigFn : [widgetConfigFn]);
__GlobalObjectConfigFns = __GlobalObjectConfigFns.concat(_.isArray(objectConfigFn) ? objectConfigFn : [objectConfigFn]); __GlobalObjectConfigFns = __GlobalObjectConfigFns.concat(BI._.isArray(objectConfigFn) ? objectConfigFn : [objectConfigFn]);
}, },
configWidget: function (type, fn, opt) { configWidget: function (type, fn, opt) {

2
src/core/structure/aes.js

@ -2308,7 +2308,7 @@
}()); }());
_.extend(BI, { BI._.extend(BI, {
/** /**
* aes加密方法 * aes加密方法
* aes-128-ecb * aes-128-ecb

2
src/core/structure/base64.js

@ -57,7 +57,7 @@
return string; return string;
}; };
_.extend(BI, { BI._.extend(BI, {
encode: function (input) { encode: function (input) {
var output = ""; var output = "";

2
src/core/utils/chinesePY.js

@ -422,7 +422,7 @@
return arrRslt.join(splitChar || "").toLowerCase(); return arrRslt.join(splitChar || "").toLowerCase();
}; };
_.extend(BI, { BI._.extend(BI, {
makeFirstPY: function (str, options) { makeFirstPY: function (str, options) {
options = options || {}; options = options || {};
if (typeof (str) !== "string") {return "" + str;} if (typeof (str) !== "string") {return "" + str;}

2
src/core/utils/i18n.js

@ -1,6 +1,6 @@
!(function () { !(function () {
var i18nStore = {}; var i18nStore = {};
_.extend(BI, { BI._.extend(BI, {
changeI18n: function (i18n) { changeI18n: function (i18n) {
if (i18n) { if (i18n) {
i18nStore = i18n; i18nStore = i18n;

6
src/core/wrapper/layout.js

@ -224,14 +224,14 @@ BI.Layout = BI.inherit(BI.Widget, {
} }
} }
} else { } else {
var keys = _.keys(a), key; var keys = BI._.keys(a), key;
length = keys.length; length = keys.length;
if (_.keys(b).length !== length) { if (BI._.keys(b).length !== length) {
return false; return false;
} }
while (length--) { while (length--) {
key = keys[length]; key = keys[length];
if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) { if (!(BI._.has(b, key) && eq(a[key], b[key], aStack, bStack))) {
return false; return false;
} }
} }

2
src/less/lib/constant.less

@ -246,4 +246,4 @@
@scroll-thumb-color-theme-dark: @color-black; @scroll-thumb-color-theme-dark: @color-black;
//box-shadow效果 //box-shadow效果
@box-shadow-toast: 0 2px 6px 0 rgba(0, 0, 0, 0.2); @box-shadow-toast: 0 6px 20px -2px rgba(9, 30, 64, 0.16);

32
src/router/0.router.js

@ -16,7 +16,7 @@
once: function (name, callback, context) { once: function (name, callback, context) {
if (!eventsApi(this, "once", name, [callback, context]) || !callback) return this; if (!eventsApi(this, "once", name, [callback, context]) || !callback) return this;
var self = this; var self = this;
var once = _.once(function () { var once = BI._.once(function () {
self.off(name, once); self.off(name, once);
callback.apply(this, arguments); callback.apply(this, arguments);
}); });
@ -37,7 +37,7 @@
return this; return this;
} }
var names = name ? [name] : _.keys(this._events); var names = name ? [name] : BI._.keys(this._events);
for (var i = 0, length = names.length; i < length; i++) { for (var i = 0, length = names.length; i < length; i++) {
name = names[i]; name = names[i];
@ -103,7 +103,7 @@
// listening to. // listening to.
listenTo: function (obj, name, callback) { listenTo: function (obj, name, callback) {
var listeningTo = this._listeningTo || (this._listeningTo = {}); var listeningTo = this._listeningTo || (this._listeningTo = {});
var id = obj._listenId || (obj._listenId = _.uniqueId("l")); var id = obj._listenId || (obj._listenId = BI._.uniqueId("l"));
listeningTo[id] = obj; listeningTo[id] = obj;
if (!callback && typeof name === "object") callback = this; if (!callback && typeof name === "object") callback = this;
obj.on(name, callback, this); obj.on(name, callback, this);
@ -123,7 +123,7 @@
return this; return this;
} }
if (!callback) return this; if (!callback) return this;
var once = _.once(function () { var once = BI._.once(function () {
this.stopListening(obj, name, once); this.stopListening(obj, name, once);
callback.apply(this, arguments); callback.apply(this, arguments);
}); });
@ -142,7 +142,7 @@
for (var id in listeningTo) { for (var id in listeningTo) {
obj = listeningTo[id]; obj = listeningTo[id];
obj.off(name, callback, this); obj.off(name, callback, this);
if (remove || _.isEmpty(obj._events)) delete this._listeningTo[id]; if (remove || BI._.isEmpty(obj._events)) delete this._listeningTo[id];
} }
return this; return this;
} }
@ -222,7 +222,7 @@
var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g; var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
// Set up all inheritable **BI.Router** properties and methods. // Set up all inheritable **BI.Router** properties and methods.
_.extend(Router.prototype, Events, { BI._.extend(Router.prototype, Events, {
// _init is an empty function by default. Override it with your own // _init is an empty function by default. Override it with your own
// initialization logic. // initialization logic.
@ -236,8 +236,8 @@
// }); // });
// //
route: function (route, name, callback) { route: function (route, name, callback) {
if (!_.isRegExp(route)) route = this._routeToRegExp(route); if (!BI._.isRegExp(route)) route = this._routeToRegExp(route);
if (_.isFunction(name)) { if (BI._.isFunction(name)) {
callback = name; callback = name;
name = ""; name = "";
} }
@ -271,8 +271,8 @@
// routes can be defined at the bottom of the route map. // routes can be defined at the bottom of the route map.
_bindRoutes: function () { _bindRoutes: function () {
if (!this.routes) return; if (!this.routes) return;
this.routes = _.result(this, "routes"); this.routes = BI._.result(this, "routes");
var route, routes = _.keys(this.routes); var route, routes = BI._.keys(this.routes);
while ((route = routes.pop()) != null) { while ((route = routes.pop()) != null) {
this.route(route, this.routes[route]); this.route(route, this.routes[route]);
} }
@ -295,7 +295,7 @@
// treated as `null` to normalize cross-browser behavior. // treated as `null` to normalize cross-browser behavior.
_extractParameters: function (route, fragment) { _extractParameters: function (route, fragment) {
var params = route.exec(fragment).slice(1); var params = route.exec(fragment).slice(1);
return _.map(params, function (param, i) { return BI._.map(params, function (param, i) {
// Don't decode the search params. // Don't decode the search params.
if (i === params.length - 1) return param || null; if (i === params.length - 1) return param || null;
var resultParam = null; var resultParam = null;
@ -322,7 +322,7 @@
// falls back to polling. // falls back to polling.
var History = function () { var History = function () {
this.handlers = []; this.handlers = [];
this.checkUrl = _.bind(this.checkUrl, this); this.checkUrl = BI._.bind(this.checkUrl, this);
// Ensure that `History` can be used outside of the browser. // Ensure that `History` can be used outside of the browser.
if (typeof window !== "undefined") { if (typeof window !== "undefined") {
@ -344,7 +344,7 @@
History.started = false; History.started = false;
// Set up all inheritable **BI.History** properties and methods. // Set up all inheritable **BI.History** properties and methods.
_.extend(History.prototype, Events, { BI._.extend(History.prototype, Events, {
// The default interval to poll for hash changes, if necessary, is // The default interval to poll for hash changes, if necessary, is
// twenty times a second. // twenty times a second.
@ -402,7 +402,7 @@
// Figure out the initial configuration. Do we need an iframe? // Figure out the initial configuration. Do we need an iframe?
// Is pushState desired ... is it available? // Is pushState desired ... is it available?
this.options = _.extend({root: "/"}, this.options, options); this.options = BI._.extend({root: "/"}, this.options, options);
this.root = this.options.root; this.root = this.options.root;
this._wantsHashChange = this.options.hashChange !== false; this._wantsHashChange = this.options.hashChange !== false;
this._hasHashChange = "onhashchange" in window; this._hasHashChange = "onhashchange" in window;
@ -511,7 +511,7 @@
// remove a route match in routes // remove a route match in routes
unRoute: function (route) { unRoute: function (route) {
var index = _.findIndex(this.handlers, function (handler) { var index = BI._.findIndex(this.handlers, function (handler) {
return handler.route.test(route); return handler.route.test(route);
}); });
if (index > -1) { if (index > -1) {
@ -545,7 +545,7 @@
// returns `false`. // returns `false`.
loadUrl: function (fragment) { loadUrl: function (fragment) {
fragment = this.fragment = this.getFragment(fragment); fragment = this.fragment = this.getFragment(fragment);
return _.some(this.handlers, function (handler) { return BI._.some(this.handlers, function (handler) {
if (handler.route.test(fragment)) { if (handler.route.test(fragment)) {
handler.callback(fragment); handler.callback(fragment);
return true; return true;

244
src/widget/multiselect/loader.js

@ -0,0 +1,244 @@
/**
* 加载控件
*
* Created by GUY on 2015/8/31.
* @class BI.Loader
* @extends BI.Widget
*/
BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectInnerLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-inner-loader",
direction: "top",
isDefaultInit: true, // 是否默认初始化数据
logic: {
dynamic: true,
scrolly: true
},
// 下面是button_group的属性
el: {
type: "bi.button_group",
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
behaviors: {
redmark: function () {
return true;
}
},
layouts: [{
type: "bi.vertical"
}]
},
items: [],
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn,
// 下面是分页信息
count: false,
prev: false,
next: {},
hasPrev: BI.emptyFn,
hasNext: BI.emptyFn
});
},
_nextLoad: function () {
var self = this, o = this.options;
this.next.setLoading();
if (this.cachItems && this.cachItems.length > 0) {
this.next.setLoaded();
this.addItems(this.cachItems.slice(0, 100));
this.cachItems = this.cachItems.slice(100);
return;
}
o.itemsCreator.apply(this, [{times: ++this.times}, function () {
self.next.setLoaded();
self.addItems.apply(self, arguments);
}]);
},
render: function () {
var self = this, o = this.options;
if (o.itemsCreator === false) {
o.next = false;
}
this.button_group = BI.createWidget(o.el, {
type: "bi.button_group",
chooseType: 0,
items: o.items,
behaviors: {},
layouts: [{
type: "bi.vertical"
}],
value: o.value
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (type === BI.Events.CLICK) {
var node = self.cachGroup.getNodeByValue(value);
if (node) {
node.setSelected(obj.isSelected());
}
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.Loader.EVENT_CHANGE, obj);
}
});
this.cachGroup = BI.createWidget(o.el, {
type: "bi.button_group",
root: true,
chooseType: 0,
items: o.items,
behaviors: {},
layouts: [{
type: "bi.vertical"
}],
value: o.value
});
if (o.next !== false) {
this.next = BI.createWidget(BI.extend({
type: "bi.loading_bar"
}, o.next));
this.next.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
self._nextLoad();
}
});
}
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.button_group, this.next]
});
o.isDefaultInit && BI.isEmpty(o.items) && BI.nextTick(BI.bind(function () {
o.isDefaultInit && BI.isEmpty(o.items) && this._populate();
}, this));
},
hasNext: function () {
var o = this.options;
if (BI.isNumber(o.count)) {
return this.count < o.count;
}
if (this.cachItems && this.cachItems.length > 0) {
return true;
}
return !!o.hasNext.apply(this, [{
times: this.times,
count: this.count
}]);
},
addItems: function (items) {
this.count += items.length;
if (BI.isObject(this.next)) {
if (this.hasNext()) {
this.options.items = this.options.items.concat(items);
this.next.setLoaded();
} else {
this.next.setEnd();
}
}
this.cachGroup.addItems.apply(this.cachGroup, arguments);
this.button_group.addItems.apply(this.button_group, arguments);
},
_populate: function (items) {
var self = this, o = this.options;
if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) {
o.itemsCreator.apply(this, [{times: 1}, function (items, keyword) {
if (arguments.length === 0) {
throw new Error("参数不能为空");
}
self.populate.apply(self, arguments);
o.onLoaded();
}]);
return false;
}
this.options.items = (items || []).slice(0, 100);
this.times = 1;
this.count = 0;
this.count += items.length;
if (BI.isObject(this.next)) {
if (this.hasNext()) {
this.next.setLoaded();
} else {
this.next.invisible();
}
}
return true;
},
populate: function (items, keyword) {
if (this._populate.apply(this, arguments)) {
this.cachItems = [];
if (items.length > 100) {
this.cachItems = items.slice(100);
}
this.cachGroup.populate.call(this.cachGroup, items, keyword);
this.button_group.populate.call(this.button_group, items.slice(0, 100), keyword);
}
},
setNotSelectedValue: function () {
this.button_group.setNotSelectedValue.apply(this.button_group, arguments);
this.cachGroup.setNotSelectedValue.apply(this.cachGroup, arguments);
},
getNotSelectedValue: function () {
return this.cachGroup.getNotSelectedValue();
},
setValue: function () {
this.cachGroup.setValue.apply(this.cachGroup, arguments);
this.button_group.setValue.apply(this.button_group, arguments);
},
getValue: function () {
return this.cachGroup.getValue.apply(this.cachGroup, arguments);
},
getAllButtons: function () {
return this.button_group.getAllButtons();
},
getAllLeaves: function () {
return this.button_group.getAllLeaves();
},
getSelectedButtons: function () {
return this.button_group.getSelectedButtons();
},
getNotSelectedButtons: function () {
return this.button_group.getNotSelectedButtons();
},
getIndexByValue: function (value) {
return this.button_group.getIndexByValue(value);
},
getNodeById: function (id) {
return this.button_group.getNodeById(id);
},
getNodeByValue: function (value) {
return this.button_group.getNodeByValue(value);
},
empty: function () {
this.button_group.empty();
this.cachGroup.empty();
BI.each([this.prev, this.next], function (i, ob) {
ob && ob.setVisible(false);
});
}
});
BI.MultiSelectInnerLoader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_inner_loader", BI.MultiSelectInnerLoader);

18
src/widget/multiselect/multiselect.loader.js

@ -43,23 +43,7 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
el: BI.extend({ el: BI.extend({
onLoaded: opts.onLoaded, onLoaded: opts.onLoaded,
el: { el: {
type: "bi.loader", type: "bi.multi_select_inner_loader",
isDefaultInit: false,
logic: {
dynamic: true,
scrolly: true
},
el: {
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
behaviors: {
redmark: function () {
return true;
}
},
layouts: [{
type: "bi.vertical"
}]
}
} }
}, opts.el), }, opts.el),
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {

2
test/utils.js

@ -1,6 +1,6 @@
!(function () { !(function () {
BI.Test = {}; BI.Test = {};
_.extend(BI.Test, { BI._.extend(BI.Test, {
createWidget: function (widgetJson) { createWidget: function (widgetJson) {
var widget = BI.createWidget(BI.extend(widgetJson, { var widget = BI.createWidget(BI.extend(widgetJson, {
root: true root: true

25
webpack/attachments.js

@ -5,6 +5,7 @@ const fixProxyJs = './dist/fix/fix.proxy.js';
const fixCompact = "./dist/fix/fix.compact.js"; const fixCompact = "./dist/fix/fix.compact.js";
const workerCompact = './dist/fix/worker.compact.js'; const workerCompact = './dist/fix/worker.compact.js';
const lodashJs = "src/core/1.lodash.js"; const lodashJs = "src/core/1.lodash.js";
const jqueryJs = "src/core/platform/web/jquery/_jquery.js";
const basicAttachmentMap = { const basicAttachmentMap = {
polyfill: sync(["src/core/0.foundation.js", "src/polyfill/**/*.js"]).concat(["@babel/polyfill", "es6-promise/auto"]), polyfill: sync(["src/core/0.foundation.js", "src/polyfill/**/*.js"]).concat(["@babel/polyfill", "es6-promise/auto"]),
@ -12,6 +13,7 @@ const basicAttachmentMap = {
"src/less/core/**/*.less", "src/less/core/**/*.less",
"src/less/theme/**/*.less", "src/less/theme/**/*.less",
lodashJs, lodashJs,
jqueryJs,
"src/core/**/*.js", "src/core/**/*.js",
"src/data/**/*.js", "src/data/**/*.js",
]), ]),
@ -46,6 +48,15 @@ const basicAttachmentMap = {
core_without_normalize: sync( core_without_normalize: sync(
["src/less/core/**/*.less", "src/less/theme/**/*.less"], ["src/less/core/normalize.less", "src/less/core/normalize2.less"] ["src/less/core/**/*.less", "src/less/theme/**/*.less"], ["src/less/core/normalize.less", "src/less/core/normalize2.less"]
), ),
core_without_conflict: sync([
"src/less/core/**/*.less",
"src/less/theme/**/*.less",
lodashJs,
"src/core/**/*.js",
"src/data/**/*.js",
], [
"src/core/conflict.js",
]),
resource: sync(["src/less/resource/**/*.less"]), resource: sync(["src/less/resource/**/*.less"]),
font: sync(["public/less/font.less"]), font: sync(["public/less/font.less"]),
ts: ['./typescript/bundle.ts'], ts: ['./typescript/bundle.ts'],
@ -156,6 +167,19 @@ const fineui = [].concat(
basicAttachmentMap.ts, basicAttachmentMap.ts,
); );
const fineuiWithoutConflict = [].concat(
basicAttachmentMap.polyfill,
basicAttachmentMap.core_without_conflict,
basicAttachmentMap.fix,
basicAttachmentMap.base,
basicAttachmentMap.case,
basicAttachmentMap.widget,
basicAttachmentMap.router,
[fixCompact, workerCompact],
basicAttachmentMap.ui,
basicAttachmentMap.ts,
);
// const fineuiModern = [].concat( // const fineuiModern = [].concat(
// sync(["src/less/modern.less"]), // sync(["src/less/modern.less"]),
// sync([ // sync([
@ -221,6 +245,7 @@ module.exports = {
font: basicAttachmentMap.font, font: basicAttachmentMap.font,
bundle: uniq(bundle), bundle: uniq(bundle),
fineuiWithoutNormalize: uniq(fineuiWithoutNormalize), fineuiWithoutNormalize: uniq(fineuiWithoutNormalize),
fineuiWithoutConflict: uniq(fineuiWithoutConflict),
bundleWithoutNormalize: uniq(bundleWithoutNormalize), bundleWithoutNormalize: uniq(bundleWithoutNormalize),
fineui: uniq(fineui), fineui: uniq(fineui),
fineuiProxy: uniq(fineuiProxy), fineuiProxy: uniq(fineuiProxy),

1
webpack/webpack.prod.js

@ -18,6 +18,7 @@ module.exports = merge.smart(common, {
font: attachments.font, font: attachments.font,
"fineui.min": attachments.fineui, "fineui.min": attachments.fineui,
"fineui_without_normalize.min": attachments.fineuiWithoutNormalize, "fineui_without_normalize.min": attachments.fineuiWithoutNormalize,
"fineui_without_conflict.min": attachments.fineuiWithoutConflict,
"fineui.proxy.min": attachments.fineuiProxy, "fineui.proxy.min": attachments.fineuiProxy,
"core_without_platform": attachments.coreWithoutPlatform, "core_without_platform": attachments.coreWithoutPlatform,
utils: attachments.utils, utils: attachments.utils,

Loading…
Cancel
Save