Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	dist/bundle.min.js
#	dist/fineui.min.css
#	dist/fineui.min.js
es6
guy 6 years ago
parent
commit
05fd93b04f
  1. 5
      dist/base.css
  2. 5
      dist/bundle.css
  3. 129
      dist/bundle.js
  4. 2
      dist/bundle.min.css
  5. 92
      dist/bundle.min.js
  6. 112
      dist/core.js
  7. 5
      dist/fineui.css
  8. 173
      dist/fineui.js
  9. 2
      dist/fineui.min.css
  10. 96
      dist/fineui.min.js
  11. 44
      dist/polyfill.js
  12. 17
      dist/widget.js
  13. 2
      lodash.md
  14. 2
      src/core/base.js
  15. 28
      src/core/controller/controller.bubbles.js
  16. 82
      src/core/lodash.js
  17. 5
      src/css/base/single/tip/tip.css
  18. 2
      src/less/base/single/tip/tip.less
  19. 1
      src/less/base/single/tip/tip.toast.less
  20. 1
      src/less/base/single/tip/tip.tooltip.less
  21. 43
      src/polyfill/lodash.js
  22. 17
      src/widget/downlist/popup.downlist.js
  23. 84
      utils/utils.js

5
dist/base.css vendored

@ -1552,9 +1552,11 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
color: #faaa39;
}
.bi-tip {
position: fixed !important;
}
.bi-toast {
position: fixed !important;
font-size: 14px;
color: #ffffff;
max-width: 400px;
@ -1580,7 +1582,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
}
.bi-tooltip {
position: fixed !important;
max-width: 250px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;

5
dist/bundle.css vendored

@ -3599,9 +3599,11 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
color: #faaa39;
}
.bi-tip {
position: fixed !important;
}
.bi-toast {
position: fixed !important;
font-size: 14px;
color: #ffffff;
max-width: 400px;
@ -3627,7 +3629,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
}
.bi-tooltip {
position: fixed !important;
max-width: 250px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;

129
dist/bundle.js vendored

@ -9599,7 +9599,7 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
})( window );/**
* @license
* Lodash (Custom Build) <https://lodash.com/>
* Build: `lodash core plus="debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy"`
* Build: `lodash core plus="debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject"`
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@ -12774,6 +12774,28 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
}, result);
}
/**
* This base implementation of `_.zipObject` which assigns values using `assignFunc`.
*
* @private
* @param {Array} props The property identifiers.
* @param {Array} values The property values.
* @param {Function} assignFunc The function to assign values.
* @returns {Object} Returns the new object.
*/
function baseZipObject(props, values, assignFunc) {
var index = -1,
length = props.length,
valsLength = values.length,
result = {};
while (++index < length) {
var value = index < valsLength ? values[index] : undefined;
assignFunc(result, props[index], value);
}
return result;
}
/**
* Casts `value` to an empty array if it's not an array like object.
*
@ -15150,6 +15172,26 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
return baseSlice(array, start, end);
}
/**
* Creates an array of unique values, in order, from all given arrays using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.union([2], [1, 2]);
* // => [2, 1]
*/
var union = baseRest(function(arrays) {
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
});
/**
* Creates a duplicate-free version of an array, using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
@ -15252,6 +15294,26 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
*/
var zip = baseRest(unzip);
/**
* This method is like `_.fromPairs` except that it accepts two arrays,
* one of property identifiers and one of corresponding values.
*
* @static
* @memberOf _
* @since 0.4.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObject(['a', 'b'], [1, 2]);
* // => { 'a': 1, 'b': 2 }
*/
function zipObject(props, values) {
return baseZipObject(props || [], values || [], assignValue);
}
/*------------------------------------------------------------------------*/
/**
@ -18198,21 +18260,6 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
return baseRandom(lower, upper);
}
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
function object (list, values) {
var result = {};
for (var i = 0, length = list && list.length; i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
}
/*------------------------------------------------------------------------*/
/**
@ -18704,11 +18751,13 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
lodash.throttle = throttle;
lodash.thru = thru;
lodash.toArray = toArray;
lodash.union = union;
lodash.uniq = uniq;
lodash.uniqBy = uniqBy;
lodash.unzip = unzip;
lodash.values = values;
lodash.zip = zip;
lodash.zipObject = zipObject;
// Add aliases.
lodash.extend = assignIn;
@ -18760,7 +18809,6 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
lodash.size = size;
lodash.some = some;
lodash.uniqueId = uniqueId;
lodash.object = object;
// Add aliases.
lodash.each = forEach;
@ -19460,7 +19508,7 @@ if (!window.BI) {
_.each(["keys", "allKeys", "values", "pairs", "invert", "create", "functions", "extend", "extendOwn",
"defaults", "clone", "property", "propertyOf", "matcher", "isEqual", "isMatch", "isEmpty",
"isElement", "isNumber", "isString", "isArray", "isObject", "isArguments", "isFunction", "isFinite",
"isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined"], function (name) {
"isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined", "zipObject"], function (name) {
BI[name] = _apply(name);
});
_.each(["mapObject", "findKey", "pick", "omit", "tap"], function (name) {
@ -26116,8 +26164,16 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_init: function () {
BI.BubblesController.superclass._init.apply(this, arguments);
var self = this;
this.bubblesManager = {};
this.storeBubbles = {};
BI.Resizers.add("bubbleController" + BI.uniqueId(), function () {
BI.each(self.bubblesManager, function (name) {
self.remove(name);
});
self.bubblesManager = {};
self.storeBubbles = {};
});
},
_createBubble: function (direct, text, level, height) {
@ -26133,60 +26189,60 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_getOffsetLeft: function (name, context, offsetStyle) {
var left = 0;
if ("center" === offsetStyle) {
left = (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
left = context.element.offset().left + (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
if (left < 0) {
left = 0;
}
return left;
}
if ("right" === offsetStyle) {
left = context.element.bounds().width - this.get(name).element.bounds().width;
left = context.element.offset().left + context.element.bounds().width - this.get(name).element.bounds().width;
if (left < 0) {
left = 0;
}
return left;
}
return left;
return context.element.offset().left;
},
_getOffsetTop: function (name, context, offsetStyle) {
var top = 0;
if ("center" === offsetStyle) {
top = (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
top = context.element.offset().top + (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
if (top < 0) {
top = 0;
}
return top;
} else if ("right" === offsetStyle) {
top = context.element.bounds().height - this.get(name).element.bounds().height;
top = context.element.offset().top + context.element.bounds().height - this.get(name).element.bounds().height;
if (top < 0) {
top = 0;
}
return top;
}
return top;
return context.element.offset().top;
},
_getLeftPosition: function (name, context, offsetStyle) {
var position = {left: - this.get(name).element.bounds().width};
var position = $.getLeftPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
_getBottomPosition: function (name, context, offsetStyle) {
var position = {top: context.element.bounds().height};
var position = $.getBottomPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getTopPosition: function (name, context, offsetStyle) {
var position = {top: -35};
var position = $.getTopPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getRightPosition: function (name, context, offsetStyle) {
var position = {left: context.element.bounds().width};
var position = $.getRightPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
@ -86992,13 +87048,13 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)) {
var childValues = BI.map(item.children, "value");
var v = joinValue(childValues, valueGetter(idx));
var v = joinValue(childValues, values[idx]);
if(BI.isNotEmptyString(v)) {
value.push(v);
}
}else{
if(item.value === valueGetter(idx)[0]) {
value.push(valueGetter(idx)[0]);
if(item.value === values[idx][0]) {
value.push(values[idx][0]);
}
}
});
@ -87017,17 +87073,6 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
});
return value;
}
function valueGetter (index) {
switch (o.chooseType) {
case BI.Selection.Single:
return values[0];
case BI.Selection.Multi:
return values[index];
default:
break;
}
}
},
populate: function (items) {

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

92
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

112
dist/core.js vendored

@ -9599,7 +9599,7 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
})( window );/**
* @license
* Lodash (Custom Build) <https://lodash.com/>
* Build: `lodash core plus="debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy"`
* Build: `lodash core plus="debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject"`
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@ -12774,6 +12774,28 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
}, result);
}
/**
* This base implementation of `_.zipObject` which assigns values using `assignFunc`.
*
* @private
* @param {Array} props The property identifiers.
* @param {Array} values The property values.
* @param {Function} assignFunc The function to assign values.
* @returns {Object} Returns the new object.
*/
function baseZipObject(props, values, assignFunc) {
var index = -1,
length = props.length,
valsLength = values.length,
result = {};
while (++index < length) {
var value = index < valsLength ? values[index] : undefined;
assignFunc(result, props[index], value);
}
return result;
}
/**
* Casts `value` to an empty array if it's not an array like object.
*
@ -15150,6 +15172,26 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
return baseSlice(array, start, end);
}
/**
* Creates an array of unique values, in order, from all given arrays using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.union([2], [1, 2]);
* // => [2, 1]
*/
var union = baseRest(function(arrays) {
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
});
/**
* Creates a duplicate-free version of an array, using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
@ -15252,6 +15294,26 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
*/
var zip = baseRest(unzip);
/**
* This method is like `_.fromPairs` except that it accepts two arrays,
* one of property identifiers and one of corresponding values.
*
* @static
* @memberOf _
* @since 0.4.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObject(['a', 'b'], [1, 2]);
* // => { 'a': 1, 'b': 2 }
*/
function zipObject(props, values) {
return baseZipObject(props || [], values || [], assignValue);
}
/*------------------------------------------------------------------------*/
/**
@ -18198,21 +18260,6 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
return baseRandom(lower, upper);
}
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
function object (list, values) {
var result = {};
for (var i = 0, length = list && list.length; i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
}
/*------------------------------------------------------------------------*/
/**
@ -18704,11 +18751,13 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
lodash.throttle = throttle;
lodash.thru = thru;
lodash.toArray = toArray;
lodash.union = union;
lodash.uniq = uniq;
lodash.uniqBy = uniqBy;
lodash.unzip = unzip;
lodash.values = values;
lodash.zip = zip;
lodash.zipObject = zipObject;
// Add aliases.
lodash.extend = assignIn;
@ -18760,7 +18809,6 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
lodash.size = size;
lodash.some = some;
lodash.uniqueId = uniqueId;
lodash.object = object;
// Add aliases.
lodash.each = forEach;
@ -19460,7 +19508,7 @@ if (!window.BI) {
_.each(["keys", "allKeys", "values", "pairs", "invert", "create", "functions", "extend", "extendOwn",
"defaults", "clone", "property", "propertyOf", "matcher", "isEqual", "isMatch", "isEmpty",
"isElement", "isNumber", "isString", "isArray", "isObject", "isArguments", "isFunction", "isFinite",
"isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined"], function (name) {
"isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined", "zipObject"], function (name) {
BI[name] = _apply(name);
});
_.each(["mapObject", "findKey", "pick", "omit", "tap"], function (name) {
@ -26116,8 +26164,16 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_init: function () {
BI.BubblesController.superclass._init.apply(this, arguments);
var self = this;
this.bubblesManager = {};
this.storeBubbles = {};
BI.Resizers.add("bubbleController" + BI.uniqueId(), function () {
BI.each(self.bubblesManager, function (name) {
self.remove(name);
});
self.bubblesManager = {};
self.storeBubbles = {};
});
},
_createBubble: function (direct, text, level, height) {
@ -26133,60 +26189,60 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_getOffsetLeft: function (name, context, offsetStyle) {
var left = 0;
if ("center" === offsetStyle) {
left = (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
left = context.element.offset().left + (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
if (left < 0) {
left = 0;
}
return left;
}
if ("right" === offsetStyle) {
left = context.element.bounds().width - this.get(name).element.bounds().width;
left = context.element.offset().left + context.element.bounds().width - this.get(name).element.bounds().width;
if (left < 0) {
left = 0;
}
return left;
}
return left;
return context.element.offset().left;
},
_getOffsetTop: function (name, context, offsetStyle) {
var top = 0;
if ("center" === offsetStyle) {
top = (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
top = context.element.offset().top + (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
if (top < 0) {
top = 0;
}
return top;
} else if ("right" === offsetStyle) {
top = context.element.bounds().height - this.get(name).element.bounds().height;
top = context.element.offset().top + context.element.bounds().height - this.get(name).element.bounds().height;
if (top < 0) {
top = 0;
}
return top;
}
return top;
return context.element.offset().top;
},
_getLeftPosition: function (name, context, offsetStyle) {
var position = {left: - this.get(name).element.bounds().width};
var position = $.getLeftPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
_getBottomPosition: function (name, context, offsetStyle) {
var position = {top: context.element.bounds().height};
var position = $.getBottomPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getTopPosition: function (name, context, offsetStyle) {
var position = {top: -35};
var position = $.getTopPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getRightPosition: function (name, context, offsetStyle) {
var position = {left: context.element.bounds().width};
var position = $.getRightPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},

5
dist/fineui.css vendored

@ -3599,9 +3599,11 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
color: #faaa39;
}
.bi-tip {
position: fixed !important;
}
.bi-toast {
position: fixed !important;
font-size: 14px;
color: #ffffff;
max-width: 400px;
@ -3627,7 +3629,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
}
.bi-tooltip {
position: fixed !important;
max-width: 250px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;

173
dist/fineui.js vendored

@ -154,7 +154,49 @@ window.localStorage || (window.localStorage = {
clear: function () {
this.items = {};
}
});if (typeof Set !== "undefined" && Set.toString().match(/native code/)) {
});
if (!Object.keys) {
Object.keys = function(o) {
if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object');
}
// fix的问题
var falsy;
var skipArray = {
__ob__: falsy,
$accessors: falsy,
$vbthis: falsy,
$vbsetter: falsy
};
var k = [], p;
for (p in o) {
if (!(p in skipArray)) {
if (Object.prototype.hasOwnProperty.call(o, p)) {
k.push(p);
}
}
}
return k;
};
}
if (!Array.isArray) {
Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
}
// https://stackoverflow.com/questions/10919915/ie8-getprototypeof-method
if (typeof Object.getPrototypeOf !== "function") {
Object.getPrototypeOf = "".__proto__ === String.prototype
? function (object) {
return object.__proto__;
}
: function (object) {
// May break if the constructor has been tampered with
return object.constructor.prototype;
};
}if (typeof Set !== "undefined" && Set.toString().match(/native code/)) {
} else {
Set = function () {
@ -9800,7 +9842,7 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
})( window );/**
* @license
* Lodash (Custom Build) <https://lodash.com/>
* Build: `lodash core plus="debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy"`
* Build: `lodash core plus="debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject"`
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@ -12975,6 +13017,28 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
}, result);
}
/**
* This base implementation of `_.zipObject` which assigns values using `assignFunc`.
*
* @private
* @param {Array} props The property identifiers.
* @param {Array} values The property values.
* @param {Function} assignFunc The function to assign values.
* @returns {Object} Returns the new object.
*/
function baseZipObject(props, values, assignFunc) {
var index = -1,
length = props.length,
valsLength = values.length,
result = {};
while (++index < length) {
var value = index < valsLength ? values[index] : undefined;
assignFunc(result, props[index], value);
}
return result;
}
/**
* Casts `value` to an empty array if it's not an array like object.
*
@ -15351,6 +15415,26 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
return baseSlice(array, start, end);
}
/**
* Creates an array of unique values, in order, from all given arrays using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.union([2], [1, 2]);
* // => [2, 1]
*/
var union = baseRest(function(arrays) {
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
});
/**
* Creates a duplicate-free version of an array, using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
@ -15453,6 +15537,26 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
*/
var zip = baseRest(unzip);
/**
* This method is like `_.fromPairs` except that it accepts two arrays,
* one of property identifiers and one of corresponding values.
*
* @static
* @memberOf _
* @since 0.4.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObject(['a', 'b'], [1, 2]);
* // => { 'a': 1, 'b': 2 }
*/
function zipObject(props, values) {
return baseZipObject(props || [], values || [], assignValue);
}
/*------------------------------------------------------------------------*/
/**
@ -18399,21 +18503,6 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
return baseRandom(lower, upper);
}
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
function object (list, values) {
var result = {};
for (var i = 0, length = list && list.length; i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
}
/*------------------------------------------------------------------------*/
/**
@ -18905,11 +18994,13 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
lodash.throttle = throttle;
lodash.thru = thru;
lodash.toArray = toArray;
lodash.union = union;
lodash.uniq = uniq;
lodash.uniqBy = uniqBy;
lodash.unzip = unzip;
lodash.values = values;
lodash.zip = zip;
lodash.zipObject = zipObject;
// Add aliases.
lodash.extend = assignIn;
@ -18961,7 +19052,6 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
lodash.size = size;
lodash.some = some;
lodash.uniqueId = uniqueId;
lodash.object = object;
// Add aliases.
lodash.each = forEach;
@ -19661,7 +19751,7 @@ if (!window.BI) {
_.each(["keys", "allKeys", "values", "pairs", "invert", "create", "functions", "extend", "extendOwn",
"defaults", "clone", "property", "propertyOf", "matcher", "isEqual", "isMatch", "isEmpty",
"isElement", "isNumber", "isString", "isArray", "isObject", "isArguments", "isFunction", "isFinite",
"isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined"], function (name) {
"isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined", "zipObject"], function (name) {
BI[name] = _apply(name);
});
_.each(["mapObject", "findKey", "pick", "omit", "tap"], function (name) {
@ -26317,8 +26407,16 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_init: function () {
BI.BubblesController.superclass._init.apply(this, arguments);
var self = this;
this.bubblesManager = {};
this.storeBubbles = {};
BI.Resizers.add("bubbleController" + BI.uniqueId(), function () {
BI.each(self.bubblesManager, function (name) {
self.remove(name);
});
self.bubblesManager = {};
self.storeBubbles = {};
});
},
_createBubble: function (direct, text, level, height) {
@ -26334,60 +26432,60 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_getOffsetLeft: function (name, context, offsetStyle) {
var left = 0;
if ("center" === offsetStyle) {
left = (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
left = context.element.offset().left + (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
if (left < 0) {
left = 0;
}
return left;
}
if ("right" === offsetStyle) {
left = context.element.bounds().width - this.get(name).element.bounds().width;
left = context.element.offset().left + context.element.bounds().width - this.get(name).element.bounds().width;
if (left < 0) {
left = 0;
}
return left;
}
return left;
return context.element.offset().left;
},
_getOffsetTop: function (name, context, offsetStyle) {
var top = 0;
if ("center" === offsetStyle) {
top = (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
top = context.element.offset().top + (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
if (top < 0) {
top = 0;
}
return top;
} else if ("right" === offsetStyle) {
top = context.element.bounds().height - this.get(name).element.bounds().height;
top = context.element.offset().top + context.element.bounds().height - this.get(name).element.bounds().height;
if (top < 0) {
top = 0;
}
return top;
}
return top;
return context.element.offset().top;
},
_getLeftPosition: function (name, context, offsetStyle) {
var position = {left: - this.get(name).element.bounds().width};
var position = $.getLeftPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
_getBottomPosition: function (name, context, offsetStyle) {
var position = {top: context.element.bounds().height};
var position = $.getBottomPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getTopPosition: function (name, context, offsetStyle) {
var position = {top: -35};
var position = $.getTopPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getRightPosition: function (name, context, offsetStyle) {
var position = {left: context.element.bounds().width};
var position = $.getRightPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
@ -88756,13 +88854,13 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)) {
var childValues = BI.map(item.children, "value");
var v = joinValue(childValues, valueGetter(idx));
var v = joinValue(childValues, values[idx]);
if(BI.isNotEmptyString(v)) {
value.push(v);
}
}else{
if(item.value === valueGetter(idx)[0]) {
value.push(valueGetter(idx)[0]);
if(item.value === values[idx][0]) {
value.push(values[idx][0]);
}
}
});
@ -88781,17 +88879,6 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
});
return value;
}
function valueGetter (index) {
switch (o.chooseType) {
case BI.Selection.Single:
return values[0];
case BI.Selection.Multi:
return values[index];
default:
break;
}
}
},
populate: function (items) {

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

96
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

44
dist/polyfill.js vendored

@ -154,7 +154,49 @@ window.localStorage || (window.localStorage = {
clear: function () {
this.items = {};
}
});if (typeof Set !== "undefined" && Set.toString().match(/native code/)) {
});
if (!Object.keys) {
Object.keys = function(o) {
if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object');
}
// fix的问题
var falsy;
var skipArray = {
__ob__: falsy,
$accessors: falsy,
$vbthis: falsy,
$vbsetter: falsy
};
var k = [], p;
for (p in o) {
if (!(p in skipArray)) {
if (Object.prototype.hasOwnProperty.call(o, p)) {
k.push(p);
}
}
}
return k;
};
}
if (!Array.isArray) {
Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
}
// https://stackoverflow.com/questions/10919915/ie8-getprototypeof-method
if (typeof Object.getPrototypeOf !== "function") {
Object.getPrototypeOf = "".__proto__ === String.prototype
? function (object) {
return object.__proto__;
}
: function (object) {
// May break if the constructor has been tampered with
return object.constructor.prototype;
};
}if (typeof Set !== "undefined" && Set.toString().match(/native code/)) {
} else {
Set = function () {

17
dist/widget.js vendored

@ -2354,13 +2354,13 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)) {
var childValues = BI.map(item.children, "value");
var v = joinValue(childValues, valueGetter(idx));
var v = joinValue(childValues, values[idx]);
if(BI.isNotEmptyString(v)) {
value.push(v);
}
}else{
if(item.value === valueGetter(idx)[0]) {
value.push(valueGetter(idx)[0]);
if(item.value === values[idx][0]) {
value.push(values[idx][0]);
}
}
});
@ -2379,17 +2379,6 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
});
return value;
}
function valueGetter (index) {
switch (o.chooseType) {
case BI.Selection.Single:
return values[0];
case BI.Selection.Multi:
return values[index];
default:
break;
}
}
},
populate: function (items) {

2
lodash.md

@ -1 +1 @@
lodash core plus=debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,object
lodash core plus=debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject

2
src/core/base.js

@ -433,7 +433,7 @@ if (!window.BI) {
_.each(["keys", "allKeys", "values", "pairs", "invert", "create", "functions", "extend", "extendOwn",
"defaults", "clone", "property", "propertyOf", "matcher", "isEqual", "isMatch", "isEmpty",
"isElement", "isNumber", "isString", "isArray", "isObject", "isArguments", "isFunction", "isFinite",
"isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined"], function (name) {
"isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined", "zipObject"], function (name) {
BI[name] = _apply(name);
});
_.each(["mapObject", "findKey", "pick", "omit", "tap"], function (name) {

28
src/core/controller/controller.bubbles.js

@ -16,8 +16,16 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_init: function () {
BI.BubblesController.superclass._init.apply(this, arguments);
var self = this;
this.bubblesManager = {};
this.storeBubbles = {};
BI.Resizers.add("bubbleController" + BI.uniqueId(), function () {
BI.each(self.bubblesManager, function (name) {
self.remove(name);
});
self.bubblesManager = {};
self.storeBubbles = {};
});
},
_createBubble: function (direct, text, level, height) {
@ -33,60 +41,60 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_getOffsetLeft: function (name, context, offsetStyle) {
var left = 0;
if ("center" === offsetStyle) {
left = (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
left = context.element.offset().left + (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
if (left < 0) {
left = 0;
}
return left;
}
if ("right" === offsetStyle) {
left = context.element.bounds().width - this.get(name).element.bounds().width;
left = context.element.offset().left + context.element.bounds().width - this.get(name).element.bounds().width;
if (left < 0) {
left = 0;
}
return left;
}
return left;
return context.element.offset().left;
},
_getOffsetTop: function (name, context, offsetStyle) {
var top = 0;
if ("center" === offsetStyle) {
top = (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
top = context.element.offset().top + (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
if (top < 0) {
top = 0;
}
return top;
} else if ("right" === offsetStyle) {
top = context.element.bounds().height - this.get(name).element.bounds().height;
top = context.element.offset().top + context.element.bounds().height - this.get(name).element.bounds().height;
if (top < 0) {
top = 0;
}
return top;
}
return top;
return context.element.offset().top;
},
_getLeftPosition: function (name, context, offsetStyle) {
var position = {left: - this.get(name).element.bounds().width};
var position = $.getLeftPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
_getBottomPosition: function (name, context, offsetStyle) {
var position = {top: context.element.bounds().height};
var position = $.getBottomPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getTopPosition: function (name, context, offsetStyle) {
var position = {top: -35};
var position = $.getTopPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getRightPosition: function (name, context, offsetStyle) {
var position = {left: context.element.bounds().width};
var position = $.getRightPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},

82
src/core/lodash.js

@ -1,7 +1,7 @@
/**
* @license
* Lodash (Custom Build) <https://lodash.com/>
* Build: `lodash core plus="debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy"`
* Build: `lodash core plus="debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject"`
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@ -3176,6 +3176,28 @@
}, result);
}
/**
* This base implementation of `_.zipObject` which assigns values using `assignFunc`.
*
* @private
* @param {Array} props The property identifiers.
* @param {Array} values The property values.
* @param {Function} assignFunc The function to assign values.
* @returns {Object} Returns the new object.
*/
function baseZipObject(props, values, assignFunc) {
var index = -1,
length = props.length,
valsLength = values.length,
result = {};
while (++index < length) {
var value = index < valsLength ? values[index] : undefined;
assignFunc(result, props[index], value);
}
return result;
}
/**
* Casts `value` to an empty array if it's not an array like object.
*
@ -5552,6 +5574,26 @@
return baseSlice(array, start, end);
}
/**
* Creates an array of unique values, in order, from all given arrays using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.union([2], [1, 2]);
* // => [2, 1]
*/
var union = baseRest(function(arrays) {
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
});
/**
* Creates a duplicate-free version of an array, using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
@ -5654,6 +5696,26 @@
*/
var zip = baseRest(unzip);
/**
* This method is like `_.fromPairs` except that it accepts two arrays,
* one of property identifiers and one of corresponding values.
*
* @static
* @memberOf _
* @since 0.4.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObject(['a', 'b'], [1, 2]);
* // => { 'a': 1, 'b': 2 }
*/
function zipObject(props, values) {
return baseZipObject(props || [], values || [], assignValue);
}
/*------------------------------------------------------------------------*/
/**
@ -8600,21 +8662,6 @@
return baseRandom(lower, upper);
}
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
function object (list, values) {
var result = {};
for (var i = 0, length = list && list.length; i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
}
/*------------------------------------------------------------------------*/
/**
@ -9106,11 +9153,13 @@
lodash.throttle = throttle;
lodash.thru = thru;
lodash.toArray = toArray;
lodash.union = union;
lodash.uniq = uniq;
lodash.uniqBy = uniqBy;
lodash.unzip = unzip;
lodash.values = values;
lodash.zip = zip;
lodash.zipObject = zipObject;
// Add aliases.
lodash.extend = assignIn;
@ -9162,7 +9211,6 @@
lodash.size = size;
lodash.some = some;
lodash.uniqueId = uniqueId;
lodash.object = object;
// Add aliases.
lodash.each = forEach;

5
src/css/base/single/tip/tip.css

@ -23,9 +23,11 @@
color: #faaa39;
}
.bi-tip {
position: fixed !important;
}
.bi-toast {
position: fixed !important;
font-size: 14px;
color: #ffffff;
max-width: 400px;
@ -51,7 +53,6 @@
}
.bi-tooltip {
position: fixed !important;
max-width: 250px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;

2
src/less/base/single/tip/tip.less

@ -2,5 +2,5 @@
.bi-tip{
position: fixed !important;
}

1
src/less/base/single/tip/tip.toast.less

@ -1,7 +1,6 @@
@import "../../../index";
.bi-toast{
position: fixed !important;
font-size: @font-size-14;
color: @color-bi-text;
max-width: 400px;

1
src/less/base/single/tip/tip.tooltip.less

@ -1,7 +1,6 @@
@import "../../../index";
.bi-tooltip{
position: fixed !important;
max-width: 250px;
.border-radius(2px);
font-size: 12px;

43
src/polyfill/lodash.js

@ -0,0 +1,43 @@
if (!Object.keys) {
Object.keys = function(o) {
if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object');
}
// fix的问题
var falsy;
var skipArray = {
__ob__: falsy,
$accessors: falsy,
$vbthis: falsy,
$vbsetter: falsy
};
var k = [], p;
for (p in o) {
if (!(p in skipArray)) {
if (Object.prototype.hasOwnProperty.call(o, p)) {
k.push(p);
}
}
}
return k;
};
}
if (!Array.isArray) {
Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
}
// https://stackoverflow.com/questions/10919915/ie8-getprototypeof-method
if (typeof Object.getPrototypeOf !== "function") {
Object.getPrototypeOf = "".__proto__ === String.prototype
? function (object) {
return object.__proto__;
}
: function (object) {
// May break if the constructor has been tampered with
return object.constructor.prototype;
};
}

17
src/widget/downlist/popup.downlist.js

@ -200,13 +200,13 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)) {
var childValues = BI.map(item.children, "value");
var v = joinValue(childValues, valueGetter(idx));
var v = joinValue(childValues, values[idx]);
if(BI.isNotEmptyString(v)) {
value.push(v);
}
}else{
if(item.value === valueGetter(idx)[0]) {
value.push(valueGetter(idx)[0]);
if(item.value === values[idx][0]) {
value.push(values[idx][0]);
}
}
});
@ -225,17 +225,6 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
});
return value;
}
function valueGetter (index) {
switch (o.chooseType) {
case BI.Selection.Single:
return values[0];
case BI.Selection.Multi:
return values[index];
default:
break;
}
}
},
populate: function (items) {

84
utils/utils.js

@ -1,7 +1,7 @@
/**
* @license
* Lodash (Custom Build) <https://lodash.com/>
* Build: `lodash core plus="debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy"`
* Build: `lodash core plus="debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject"`
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@ -3176,6 +3176,28 @@
}, result);
}
/**
* This base implementation of `_.zipObject` which assigns values using `assignFunc`.
*
* @private
* @param {Array} props The property identifiers.
* @param {Array} values The property values.
* @param {Function} assignFunc The function to assign values.
* @returns {Object} Returns the new object.
*/
function baseZipObject(props, values, assignFunc) {
var index = -1,
length = props.length,
valsLength = values.length,
result = {};
while (++index < length) {
var value = index < valsLength ? values[index] : undefined;
assignFunc(result, props[index], value);
}
return result;
}
/**
* Casts `value` to an empty array if it's not an array like object.
*
@ -5552,6 +5574,26 @@
return baseSlice(array, start, end);
}
/**
* Creates an array of unique values, in order, from all given arrays using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {...Array} [arrays] The arrays to inspect.
* @returns {Array} Returns the new array of combined values.
* @example
*
* _.union([2], [1, 2]);
* // => [2, 1]
*/
var union = baseRest(function(arrays) {
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
});
/**
* Creates a duplicate-free version of an array, using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
@ -5654,6 +5696,26 @@
*/
var zip = baseRest(unzip);
/**
* This method is like `_.fromPairs` except that it accepts two arrays,
* one of property identifiers and one of corresponding values.
*
* @static
* @memberOf _
* @since 0.4.0
* @category Array
* @param {Array} [props=[]] The property identifiers.
* @param {Array} [values=[]] The property values.
* @returns {Object} Returns the new object.
* @example
*
* _.zipObject(['a', 'b'], [1, 2]);
* // => { 'a': 1, 'b': 2 }
*/
function zipObject(props, values) {
return baseZipObject(props || [], values || [], assignValue);
}
/*------------------------------------------------------------------------*/
/**
@ -8600,21 +8662,6 @@
return baseRandom(lower, upper);
}
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
function object (list, values) {
var result = {};
for (var i = 0, length = list && list.length; i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
}
/*------------------------------------------------------------------------*/
/**
@ -9106,11 +9153,13 @@
lodash.throttle = throttle;
lodash.thru = thru;
lodash.toArray = toArray;
lodash.union = union;
lodash.uniq = uniq;
lodash.uniqBy = uniqBy;
lodash.unzip = unzip;
lodash.values = values;
lodash.zip = zip;
lodash.zipObject = zipObject;
// Add aliases.
lodash.extend = assignIn;
@ -9162,7 +9211,6 @@
lodash.size = size;
lodash.some = some;
lodash.uniqueId = uniqueId;
lodash.object = object;
// Add aliases.
lodash.each = forEach;
@ -10668,7 +10716,7 @@ if (!window.BI) {
_.each(["keys", "allKeys", "values", "pairs", "invert", "create", "functions", "extend", "extendOwn",
"defaults", "clone", "property", "propertyOf", "matcher", "isEqual", "isMatch", "isEmpty",
"isElement", "isNumber", "isString", "isArray", "isObject", "isArguments", "isFunction", "isFinite",
"isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined"], function (name) {
"isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined", "zipObject"], function (name) {
BI[name] = _apply(name);
});
_.each(["mapObject", "findKey", "pick", "omit", "tap"], function (name) {

Loading…
Cancel
Save