Guyi 5 years ago
parent
commit
1128c0458f
  1. 9
      README.md
  2. 2
      changelog.md
  3. 978
      dist/2.0/fineui.ie.js
  4. 28
      dist/2.0/fineui.ie.min.js
  5. 978
      dist/2.0/fineui.js
  6. 2
      dist/2.0/fineui.min.css
  7. 28
      dist/2.0/fineui.min.js
  8. 978
      dist/bundle.ie.js
  9. 28
      dist/bundle.ie.min.js
  10. 978
      dist/bundle.js
  11. 2
      dist/bundle.min.css
  12. 28
      dist/bundle.min.js
  13. 19
      dist/case.js
  14. 470
      dist/core.js
  15. 978
      dist/fineui.ie.js
  16. 26
      dist/fineui.ie.min.js
  17. 978
      dist/fineui.js
  18. 2
      dist/fineui.min.css
  19. 26
      dist/fineui.min.js
  20. 970
      dist/fineui_without_jquery_polyfill.js
  21. 462
      dist/utils.js
  22. 2
      dist/utils.min.js
  23. 489
      dist/widget.js
  24. 2
      lodash.md
  25. 6
      src/case/trigger/trigger.icon.js
  26. 6
      src/component/treevaluechooser/abstract.treevaluechooser.js
  27. 91
      src/component/valuechooser/combo.valuechooser.insert.js
  28. 2
      src/core/base.js
  29. 460
      src/core/lodash.js
  30. 8
      src/core/platform/web/dom.js
  31. 2
      src/widget/downlist/combo.downlist.js
  32. 13
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  33. 92
      src/widget/multilayerselecttree/multilayerselecttree.insert.search.pane.js
  34. 90
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js
  35. 13
      src/widget/multilayersingletree/multilayersingletree.combo.js
  36. 92
      src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js
  37. 83
      src/widget/multilayersingletree/multilayersingletree.trigger.js
  38. 2
      src/widget/multitree/multi.tree.combo.js
  39. 2
      src/widget/multitree/multi.tree.insert.combo.js
  40. 2
      src/widget/multitree/multi.tree.list.combo.js
  41. 3
      src/widget/numbereditor/number.editor.js
  42. 4
      src/widget/selecttree/selecttree.expander.js

9
README.md

@ -8,14 +8,7 @@ For more details, see the website [http://www.fanruan.com](http://www.fanruan.co
Documentation Documentation
============= =============
### 教程 http://fanruan.design/doc.html?post=0169cf558d
http://fanruan.design/fineui-doc/index.html
### Demo
在线Demo地址: [http://fanruan.design/fineui-demo/index.html](http://fanruan.design/fineui-demo/index.html)
License License
============ ============

2
changelog.md

@ -1,5 +1,7 @@
# 更新日志 # 更新日志
2.0(2019-08) 2.0(2019-08)
- 单选树可展示并选中不存在的值
- 树类型下拉新增可搜索实际值的配置
- 可编辑的combo新增水印配置 - 可编辑的combo新增水印配置
- 单选下拉树同步状态下内置搜索 - 单选下拉树同步状态下内置搜索

978
dist/2.0/fineui.ie.js vendored

File diff suppressed because it is too large Load Diff

28
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

978
dist/2.0/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/2.0/fineui.min.css vendored

File diff suppressed because one or more lines are too long

28
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

978
dist/bundle.ie.js vendored

File diff suppressed because it is too large Load Diff

28
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

978
dist/bundle.js vendored

File diff suppressed because it is too large Load Diff

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

28
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

19
dist/case.js vendored

@ -456,7 +456,7 @@ BI.ArrowNode = BI.inherit(BI.NodeButton, {
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left); var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, { var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 24, width: 16,
el: this.checkbox el: this.checkbox
}, this.text); }, this.text);
BI.createWidget(BI.extend({ BI.createWidget(BI.extend({
@ -635,16 +635,17 @@ BI.IconArrowNode = BI.inherit(BI.NodeButton, {
}); });
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left); var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, { var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 24, width: 16,
el: this.checkbox el: this.checkbox
}, { }, {
width: 24, width: 16,
el: icon el: icon
}, this.text); }, this.text);
BI.createWidget(BI.extend({ BI.createWidget(BI.extend({
element: this element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, { }, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items items: items,
rgap: 5
})))); }))));
}, },
@ -873,7 +874,7 @@ BI.shortcut("bi.mid_plus_group_node", BI.MidPlusGroupNode);BI.MultiLayerIconArro
BI.count(0, o.layer, function () { BI.count(0, o.layer, function () {
items.push({ items.push({
type: "bi.layout", type: "bi.layout",
width: 24, width: 15,
height: o.height height: o.height
}); });
}); });
@ -881,7 +882,7 @@ BI.shortcut("bi.mid_plus_group_node", BI.MidPlusGroupNode);BI.MultiLayerIconArro
BI.createWidget({ BI.createWidget({
type: "bi.td", type: "bi.td",
element: this, element: this,
columnSize: BI.makeArray(o.layer, 24), columnSize: BI.makeArray(o.layer, 15),
items: [items] items: [items]
}); });
}, },
@ -9453,7 +9454,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger", baseCls: "bi-icon-trigger",
extraCls: "pull-down-font",
el: {}, el: {},
height: 24 height: 24
}); });
@ -9465,7 +9467,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
element: this, element: this,
width: o.width, width: o.width,
height: o.height height: o.height,
extraCls: o.extraCls
}); });
} }
}); });

470
dist/core.js vendored

@ -22,7 +22,7 @@ if(_global.BI.prepares == null) {
}/** }/**
* @license * @license
* Lodash (Custom Build) <https://lodash.com/> * 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,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy"` * 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,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy,uniqBy"`
* Copyright JS Foundation and other contributors <https://js.foundation/> * Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license> * Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@ -215,34 +215,34 @@ if(_global.BI.prepares == null) {
/** Used to identify `toStringTag` values of typed arrays. */ /** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {}; var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true; typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false; typedArrayTags[weakMapTag] = false;
/** Used to identify `toStringTag` values supported by `_.clone`. */ /** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {}; var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false; cloneableTags[weakMapTag] = false;
/** Used to map characters to HTML entities. */ /** Used to map characters to HTML entities. */
var htmlEscapes = { var htmlEscapes = {
@ -599,8 +599,8 @@ if(_global.BI.prepares == null) {
*/ */
function baseIndexOf(array, value, fromIndex) { function baseIndexOf(array, value, fromIndex) {
return value === value return value === value
? strictIndexOf(array, value, fromIndex) ? strictIndexOf(array, value, fromIndex)
: baseFindIndex(array, baseIsNaN, fromIndex); : baseFindIndex(array, baseIsNaN, fromIndex);
} }
/** /**
@ -656,8 +656,8 @@ if(_global.BI.prepares == null) {
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
eachFunc(collection, function(value, index, collection) { eachFunc(collection, function(value, index, collection) {
accumulator = initAccum accumulator = initAccum
? (initAccum = false, value) ? (initAccum = false, value)
: iteratee(accumulator, value, index, collection); : iteratee(accumulator, value, index, collection);
}); });
return accumulator; return accumulator;
} }
@ -910,8 +910,8 @@ if(_global.BI.prepares == null) {
*/ */
function safeGet(object, key) { function safeGet(object, key) {
return key == '__proto__' return key == '__proto__'
? undefined ? undefined
: object[key]; : object[key];
} }
/** /**
@ -962,8 +962,8 @@ if(_global.BI.prepares == null) {
*/ */
function stringSize(string) { function stringSize(string) {
return hasUnicode(string) return hasUnicode(string)
? unicodeSize(string) ? unicodeSize(string)
: asciiSize(string); : asciiSize(string);
} }
/** /**
@ -975,8 +975,8 @@ if(_global.BI.prepares == null) {
*/ */
function stringToArray(string) { function stringToArray(string) {
return hasUnicode(string) return hasUnicode(string)
? unicodeToArray(string) ? unicodeToArray(string)
: asciiToArray(string); : asciiToArray(string);
} }
/** /**
@ -1045,8 +1045,8 @@ if(_global.BI.prepares == null) {
/** Used to detect if a method is native. */ /** Used to detect if a method is native. */
var reIsNative = RegExp('^' + var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
); );
/** Built-in value references. */ /** Built-in value references. */
@ -1383,30 +1383,30 @@ if(_global.BI.prepares == null) {
var result = []; var result = [];
outer: outer:
while (length-- && resIndex < takeCount) { while (length-- && resIndex < takeCount) {
index += dir; index += dir;
var iterIndex = -1, var iterIndex = -1,
value = array[index]; value = array[index];
while (++iterIndex < iterLength) { while (++iterIndex < iterLength) {
var data = iteratees[iterIndex], var data = iteratees[iterIndex],
iteratee = data.iteratee, iteratee = data.iteratee,
type = data.type, type = data.type,
computed = iteratee(value); computed = iteratee(value);
if (type == LAZY_MAP_FLAG) { if (type == LAZY_MAP_FLAG) {
value = computed; value = computed;
} else if (!computed) { } else if (!computed) {
if (type == LAZY_FILTER_FLAG) { if (type == LAZY_FILTER_FLAG) {
continue outer; continue outer;
} else { } else {
break outer; break outer;
}
}
} }
result[resIndex++] = value;
} }
}
result[resIndex++] = value;
}
return result; return result;
} }
@ -1914,14 +1914,14 @@ if(_global.BI.prepares == null) {
for (var key in value) { for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) && if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && ( !(skipIndexes && (
// Safari 9 has enumerable `arguments.length` in strict mode. // Safari 9 has enumerable `arguments.length` in strict mode.
key == 'length' || key == 'length' ||
// Node.js 0.10 has enumerable non-index properties on buffers. // Node.js 0.10 has enumerable non-index properties on buffers.
(isBuff && (key == 'offset' || key == 'parent')) || (isBuff && (key == 'offset' || key == 'parent')) ||
// PhantomJS 2 has enumerable non-index properties on typed arrays. // PhantomJS 2 has enumerable non-index properties on typed arrays.
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
// Skip index properties. // Skip index properties.
isIndex(key, length) isIndex(key, length)
))) { ))) {
result.push(key); result.push(key);
} }
@ -2136,8 +2136,8 @@ if(_global.BI.prepares == null) {
result = (isFlat || isFunc) ? {} : initCloneObject(value); result = (isFlat || isFunc) ? {} : initCloneObject(value);
if (!isDeep) { if (!isDeep) {
return isFlat return isFlat
? copySymbolsIn(value, baseAssignIn(result, value)) ? copySymbolsIn(value, baseAssignIn(result, value))
: copySymbols(value, baseAssign(result, value)); : copySymbols(value, baseAssign(result, value));
} }
} else { } else {
if (!cloneableTags[tag]) { if (!cloneableTags[tag]) {
@ -2171,8 +2171,8 @@ if(_global.BI.prepares == null) {
} }
var keysFunc = isFull var keysFunc = isFull
? (isFlat ? getAllKeysIn : getAllKeys) ? (isFlat ? getAllKeysIn : getAllKeys)
: (isFlat ? keysIn : keys); : (isFlat ? keysIn : keys);
var props = isArr ? undefined : keysFunc(value); var props = isArr ? undefined : keysFunc(value);
arrayEach(props || value, function(subValue, key) { arrayEach(props || value, function(subValue, key) {
@ -2238,24 +2238,24 @@ if(_global.BI.prepares == null) {
values = new SetCache(values); values = new SetCache(values);
} }
outer: outer:
while (++index < length) { while (++index < length) {
var value = array[index], var value = array[index],
computed = iteratee == null ? value : iteratee(value); computed = iteratee == null ? value : iteratee(value);
value = (comparator || value !== 0) ? value : 0; value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) { if (isCommon && computed === computed) {
var valuesIndex = valuesLength; var valuesIndex = valuesLength;
while (valuesIndex--) { while (valuesIndex--) {
if (values[valuesIndex] === computed) { if (values[valuesIndex] === computed) {
continue outer; continue outer;
}
}
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
} }
} }
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
return result; return result;
} }
@ -2306,9 +2306,9 @@ if(_global.BI.prepares == null) {
current = iteratee(value); current = iteratee(value);
if (current != null && (computed === undefined if (current != null && (computed === undefined
? (current === current && !isSymbol(current)) ? (current === current && !isSymbol(current))
: comparator(current, computed) : comparator(current, computed)
)) { )) {
var computed = current, var computed = current,
result = value; result = value;
} }
@ -2480,8 +2480,8 @@ if(_global.BI.prepares == null) {
return value === undefined ? undefinedTag : nullTag; return value === undefined ? undefinedTag : nullTag;
} }
return (symToStringTag && symToStringTag in Object(value)) return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value) ? getRawTag(value)
: objectToString(value); : objectToString(value);
} }
/** /**
@ -2547,8 +2547,8 @@ if(_global.BI.prepares == null) {
} }
maxLength = nativeMin(array.length, maxLength); maxLength = nativeMin(array.length, maxLength);
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
? new SetCache(othIndex && array) ? new SetCache(othIndex && array)
: undefined; : undefined;
} }
array = arrays[0]; array = arrays[0];
@ -2556,31 +2556,31 @@ if(_global.BI.prepares == null) {
seen = caches[0]; seen = caches[0];
outer: outer:
while (++index < length && result.length < maxLength) { while (++index < length && result.length < maxLength) {
var value = array[index], var value = array[index],
computed = iteratee ? iteratee(value) : value; computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0; value = (comparator || value !== 0) ? value : 0;
if (!(seen if (!(seen
? cacheHas(seen, computed) ? cacheHas(seen, computed)
: includes(result, computed, comparator) : includes(result, computed, comparator)
)) { )) {
othIndex = othLength; othIndex = othLength;
while (--othIndex) { while (--othIndex) {
var cache = caches[othIndex]; var cache = caches[othIndex];
if (!(cache if (!(cache
? cacheHas(cache, computed) ? cacheHas(cache, computed)
: includes(arrays[othIndex], computed, comparator)) : includes(arrays[othIndex], computed, comparator))
) { ) {
continue outer; continue outer;
}
}
if (seen) {
seen.push(computed);
}
result.push(value);
} }
} }
if (seen) {
seen.push(computed);
}
result.push(value);
}
}
return result; return result;
} }
@ -2702,8 +2702,8 @@ if(_global.BI.prepares == null) {
if (isSameTag && !objIsObj) { if (isSameTag && !objIsObj) {
stack || (stack = new Stack); stack || (stack = new Stack);
return (objIsArr || isTypedArray(object)) return (objIsArr || isTypedArray(object))
? equalArrays(object, other, bitmask, customizer, equalFunc, stack) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
} }
if (!(bitmask & COMPARE_PARTIAL_FLAG)) { if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
@ -2757,9 +2757,9 @@ if(_global.BI.prepares == null) {
while (index--) { while (index--) {
var data = matchData[index]; var data = matchData[index];
if ((noCustomizer && data[2]) if ((noCustomizer && data[2])
? data[1] !== object[data[0]] ? data[1] !== object[data[0]]
: !(data[0] in object) : !(data[0] in object)
) { ) {
return false; return false;
} }
} }
@ -2779,9 +2779,9 @@ if(_global.BI.prepares == null) {
var result = customizer(objValue, srcValue, key, object, source, stack); var result = customizer(objValue, srcValue, key, object, source, stack);
} }
if (!(result === undefined if (!(result === undefined
? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
: result : result
)) { )) {
return false; return false;
} }
} }
@ -2836,7 +2836,7 @@ if(_global.BI.prepares == null) {
*/ */
function baseIsTypedArray(value) { function baseIsTypedArray(value) {
return isObjectLike(value) && return isObjectLike(value) &&
isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
} }
/** /**
@ -2857,8 +2857,8 @@ if(_global.BI.prepares == null) {
} }
if (typeof value == 'object') { if (typeof value == 'object') {
return isArray(value) return isArray(value)
? baseMatchesProperty(value[0], value[1]) ? baseMatchesProperty(value[0], value[1])
: baseMatches(value); : baseMatches(value);
} }
return property(value); return property(value);
} }
@ -2968,8 +2968,8 @@ if(_global.BI.prepares == null) {
return function(object) { return function(object) {
var objValue = get(object, path); var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue) return (objValue === undefined && objValue === srcValue)
? hasIn(object, path) ? hasIn(object, path)
: baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
}; };
} }
@ -2995,8 +2995,8 @@ if(_global.BI.prepares == null) {
} }
else { else {
var newValue = customizer var newValue = customizer
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
: undefined; : undefined;
if (newValue === undefined) { if (newValue === undefined) {
newValue = srcValue; newValue = srcValue;
@ -3031,8 +3031,8 @@ if(_global.BI.prepares == null) {
return; return;
} }
var newValue = customizer var newValue = customizer
? customizer(objValue, srcValue, (key + ''), object, source, stack) ? customizer(objValue, srcValue, (key + ''), object, source, stack)
: undefined; : undefined;
var isCommon = newValue === undefined; var isCommon = newValue === undefined;
@ -3239,8 +3239,8 @@ if(_global.BI.prepares == null) {
newValue = customizer ? customizer(objValue, key, nested) : undefined; newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) { if (newValue === undefined) {
newValue = isObject(objValue) newValue = isObject(objValue)
? objValue ? objValue
: (isIndex(path[index + 1]) ? [] : {}); : (isIndex(path[index + 1]) ? [] : {});
} }
} }
assignValue(nested, key, newValue); assignValue(nested, key, newValue);
@ -3386,30 +3386,30 @@ if(_global.BI.prepares == null) {
seen = iteratee ? [] : result; seen = iteratee ? [] : result;
} }
outer: outer:
while (++index < length) { while (++index < length) {
var value = array[index], var value = array[index],
computed = iteratee ? iteratee(value) : value; computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0; value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) { if (isCommon && computed === computed) {
var seenIndex = seen.length; var seenIndex = seen.length;
while (seenIndex--) { while (seenIndex--) {
if (seen[seenIndex] === computed) { if (seen[seenIndex] === computed) {
continue outer; continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
} }
} }
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result; return result;
} }
@ -3783,8 +3783,8 @@ if(_global.BI.prepares == null) {
var key = props[index]; var key = props[index];
var newValue = customizer var newValue = customizer
? customizer(object[key], source[key], key, object, source) ? customizer(object[key], source[key], key, object, source)
: undefined; : undefined;
if (newValue === undefined) { if (newValue === undefined) {
newValue = source[key]; newValue = source[key];
@ -3854,8 +3854,8 @@ if(_global.BI.prepares == null) {
guard = length > 2 ? sources[2] : undefined; guard = length > 2 ? sources[2] : undefined;
customizer = (assigner.length > 3 && typeof customizer == 'function') customizer = (assigner.length > 3 && typeof customizer == 'function')
? (length--, customizer) ? (length--, customizer)
: undefined; : undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) { if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer; customizer = length < 3 ? undefined : customizer;
@ -4001,14 +4001,14 @@ if(_global.BI.prepares == null) {
args[index] = arguments[index]; args[index] = arguments[index];
} }
var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
? [] ? []
: replaceHolders(args, placeholder); : replaceHolders(args, placeholder);
length -= holders.length; length -= holders.length;
if (length < arity) { if (length < arity) {
return createRecurry( return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, undefined, func, bitmask, createHybrid, wrapper.placeholder, undefined,
args, holders, undefined, undefined, arity - length); args, holders, undefined, undefined, arity - length);
} }
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return apply(fn, this, args); return apply(fn, this, args);
@ -4085,8 +4085,8 @@ if(_global.BI.prepares == null) {
if (isCurried && length < arity) { if (isCurried && length < arity) {
var newHolders = replaceHolders(args, placeholder); var newHolders = replaceHolders(args, placeholder);
return createRecurry( return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, thisArg, func, bitmask, createHybrid, wrapper.placeholder, thisArg,
args, newHolders, argPos, ary, arity - length args, newHolders, argPos, ary, arity - length
); );
} }
var thisBinding = isBind ? thisArg : this, var thisBinding = isBind ? thisArg : this,
@ -4298,8 +4298,8 @@ if(_global.BI.prepares == null) {
partials = newData[3]; partials = newData[3];
holders = newData[4]; holders = newData[4];
arity = newData[9] = newData[9] === undefined arity = newData[9] = newData[9] === undefined
? (isBindKey ? 0 : func.length) ? (isBindKey ? 0 : func.length)
: nativeMax(newData[9] - length, 0); : nativeMax(newData[9] - length, 0);
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
@ -4394,8 +4394,8 @@ if(_global.BI.prepares == null) {
if (customizer) { if (customizer) {
var compared = isPartial var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack) ? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack); : customizer(arrValue, othValue, index, array, other, stack);
} }
if (compared !== undefined) { if (compared !== undefined) {
if (compared) { if (compared) {
@ -4407,18 +4407,18 @@ if(_global.BI.prepares == null) {
// Recursively compare arrays (susceptible to call stack limits). // Recursively compare arrays (susceptible to call stack limits).
if (seen) { if (seen) {
if (!arraySome(other, function(othValue, othIndex) { if (!arraySome(other, function(othValue, othIndex) {
if (!cacheHas(seen, othIndex) && if (!cacheHas(seen, othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
return seen.push(othIndex); return seen.push(othIndex);
} }
})) { })) {
result = false; result = false;
break; break;
} }
} else if (!( } else if (!(
arrValue === othValue || arrValue === othValue ||
equalFunc(arrValue, othValue, bitmask, customizer, stack) equalFunc(arrValue, othValue, bitmask, customizer, stack)
)) { )) {
result = false; result = false;
break; break;
} }
@ -4557,14 +4557,14 @@ if(_global.BI.prepares == null) {
if (customizer) { if (customizer) {
var compared = isPartial var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack) ? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack); : customizer(objValue, othValue, key, object, other, stack);
} }
// Recursively compare objects (susceptible to call stack limits). // Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
: compared : compared
)) { )) {
result = false; result = false;
break; break;
} }
@ -4578,7 +4578,7 @@ if(_global.BI.prepares == null) {
if (objCtor != othCtor && if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) && ('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor && !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) { typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false; result = false;
} }
} }
@ -4677,8 +4677,8 @@ if(_global.BI.prepares == null) {
function getMapData(map, key) { function getMapData(map, key) {
var data = map.__data__; var data = map.__data__;
return isKeyable(key) return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash'] ? data[typeof key == 'string' ? 'string' : 'hash']
: data.map; : data.map;
} }
/** /**
@ -4875,7 +4875,7 @@ if(_global.BI.prepares == null) {
} }
length = object == null ? 0 : object.length; length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isArguments(object)); (isArray(object) || isArguments(object));
} }
/** /**
@ -4906,8 +4906,8 @@ if(_global.BI.prepares == null) {
*/ */
function initCloneObject(object) { function initCloneObject(object) {
return (typeof object.constructor == 'function' && !isPrototype(object)) return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototype(object)) ? baseCreate(getPrototype(object))
: {}; : {};
} }
/** /**
@ -4986,7 +4986,7 @@ if(_global.BI.prepares == null) {
*/ */
function isFlattenable(value) { function isFlattenable(value) {
return isArray(value) || isArguments(value) || return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol]); !!(spreadableSymbol && value && value[spreadableSymbol]);
} }
/** /**
@ -5002,9 +5002,9 @@ if(_global.BI.prepares == null) {
length = length == null ? MAX_SAFE_INTEGER : length; length = length == null ? MAX_SAFE_INTEGER : length;
return !!length && return !!length &&
(type == 'number' || (type == 'number' ||
(type != 'symbol' && reIsUint.test(value))) && (type != 'symbol' && reIsUint.test(value))) &&
(value > -1 && value % 1 == 0 && value < length); (value > -1 && value % 1 == 0 && value < length);
} }
/** /**
@ -5023,9 +5023,9 @@ if(_global.BI.prepares == null) {
} }
var type = typeof index; var type = typeof index;
if (type == 'number' if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length)) ? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object) : (type == 'string' && index in object)
) { ) {
return eq(object[index], value); return eq(object[index], value);
} }
return false; return false;
@ -5049,7 +5049,7 @@ if(_global.BI.prepares == null) {
return true; return true;
} }
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object)); (object != null && value in Object(object));
} }
/** /**
@ -5062,8 +5062,8 @@ if(_global.BI.prepares == null) {
function isKeyable(value) { function isKeyable(value) {
var type = typeof value; var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__') ? (value !== '__proto__')
: (value === null); : (value === null);
} }
/** /**
@ -5140,7 +5140,7 @@ if(_global.BI.prepares == null) {
return false; return false;
} }
return object[key] === srcValue && return object[key] === srcValue &&
(srcValue !== undefined || (key in Object(object))); (srcValue !== undefined || (key in Object(object)));
}; };
} }
@ -5187,9 +5187,9 @@ if(_global.BI.prepares == null) {
isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
var isCombo = var isCombo =
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
// Exit early if metadata can't be merged. // Exit early if metadata can't be merged.
if (!(isCommon || isCombo)) { if (!(isCommon || isCombo)) {
@ -5579,8 +5579,8 @@ if(_global.BI.prepares == null) {
*/ */
var difference = baseRest(function(array, values) { var difference = baseRest(function(array, values) {
return isArrayLikeObject(array) return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
: []; : [];
}); });
/** /**
@ -5708,8 +5708,8 @@ if(_global.BI.prepares == null) {
if (fromIndex !== undefined) { if (fromIndex !== undefined) {
index = toInteger(fromIndex); index = toInteger(fromIndex);
index = fromIndex < 0 index = fromIndex < 0
? nativeMax(length + index, 0) ? nativeMax(length + index, 0)
: nativeMin(index, length - 1); : nativeMin(index, length - 1);
} }
return baseFindIndex(array, baseIteratee(predicate, 3), index, true); return baseFindIndex(array, baseIteratee(predicate, 3), index, true);
} }
@ -5848,8 +5848,8 @@ if(_global.BI.prepares == null) {
var intersection = baseRest(function(arrays) { var intersection = baseRest(function(arrays) {
var mapped = arrayMap(arrays, castArrayLikeObject); var mapped = arrayMap(arrays, castArrayLikeObject);
return (mapped.length && mapped[0] === arrays[0]) return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped) ? baseIntersection(mapped)
: []; : [];
}); });
/** /**
@ -6124,8 +6124,8 @@ if(_global.BI.prepares == null) {
*/ */
var without = baseRest(function(array, values) { var without = baseRest(function(array, values) {
return isArrayLikeObject(array) return isArrayLikeObject(array)
? baseDifference(array, values) ? baseDifference(array, values)
: []; : [];
}); });
/** /**
@ -7195,8 +7195,8 @@ if(_global.BI.prepares == null) {
timeWaiting = wait - timeSinceLastCall; timeWaiting = wait - timeSinceLastCall;
return maxing return maxing
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
: timeWaiting; : timeWaiting;
} }
function shouldInvoke(time) { function shouldInvoke(time) {
@ -7207,7 +7207,7 @@ if(_global.BI.prepares == null) {
// trailing edge, the system time has gone backwards and we're treating // trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit. // it as the trailing edge, or we've hit the `maxWait` limit.
return (lastCallTime === undefined || (timeSinceLastCall >= wait) || return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
} }
function timerExpired() { function timerExpired() {
@ -7646,7 +7646,7 @@ if(_global.BI.prepares == null) {
*/ */
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee'); !propertyIsEnumerable.call(value, 'callee');
}; };
/** /**
@ -7751,7 +7751,7 @@ if(_global.BI.prepares == null) {
*/ */
function isBoolean(value) { function isBoolean(value) {
return value === true || value === false || return value === true || value === false ||
(isObjectLike(value) && baseGetTag(value) == boolTag); (isObjectLike(value) && baseGetTag(value) == boolTag);
} }
/** /**
@ -7831,7 +7831,7 @@ if(_global.BI.prepares == null) {
} }
if (isArrayLike(value) && if (isArrayLike(value) &&
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
isBuffer(value) || isTypedArray(value) || isArguments(value))) { isBuffer(value) || isTypedArray(value) || isArguments(value))) {
return !value.length; return !value.length;
} }
var tag = getTag(value); var tag = getTag(value);
@ -7966,7 +7966,7 @@ if(_global.BI.prepares == null) {
*/ */
function isLength(value) { function isLength(value) {
return typeof value == 'number' && return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
} }
/** /**
@ -8130,7 +8130,7 @@ if(_global.BI.prepares == null) {
*/ */
function isNumber(value) { function isNumber(value) {
return typeof value == 'number' || return typeof value == 'number' ||
(isObjectLike(value) && baseGetTag(value) == numberTag); (isObjectLike(value) && baseGetTag(value) == numberTag);
} }
/** /**
@ -8171,7 +8171,7 @@ if(_global.BI.prepares == null) {
} }
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor && return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString; funcToString.call(Ctor) == objectCtorString;
} }
/** /**
@ -8231,7 +8231,7 @@ if(_global.BI.prepares == null) {
*/ */
function isString(value) { function isString(value) {
return typeof value == 'string' || return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
} }
/** /**
@ -8253,7 +8253,7 @@ if(_global.BI.prepares == null) {
*/ */
function isSymbol(value) { function isSymbol(value) {
return typeof value == 'symbol' || return typeof value == 'symbol' ||
(isObjectLike(value) && baseGetTag(value) == symbolTag); (isObjectLike(value) && baseGetTag(value) == symbolTag);
} }
/** /**
@ -8443,8 +8443,8 @@ if(_global.BI.prepares == null) {
value = value.replace(reTrim, ''); value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value); var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value)) return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8) ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value); : (reIsBadHex.test(value) ? NAN : +value);
} }
/** /**
@ -9355,8 +9355,8 @@ if(_global.BI.prepares == null) {
function escape(string) { function escape(string) {
string = toString(string); string = toString(string);
return (string && reHasUnescapedHtml.test(string)) return (string && reHasUnescapedHtml.test(string))
? string.replace(reUnescapedHtml, escapeHtmlChar) ? string.replace(reUnescapedHtml, escapeHtmlChar)
: string; : string;
} }
/** /**
@ -9782,8 +9782,8 @@ if(_global.BI.prepares == null) {
*/ */
function max(array) { function max(array) {
return (array && array.length) return (array && array.length)
? baseExtremum(array, identity, baseGt) ? baseExtremum(array, identity, baseGt)
: undefined; : undefined;
} }
/** /**
@ -9806,8 +9806,8 @@ if(_global.BI.prepares == null) {
*/ */
function min(array) { function min(array) {
return (array && array.length) return (array && array.length)
? baseExtremum(array, identity, baseLt) ? baseExtremum(array, identity, baseLt)
: undefined; : undefined;
} }
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
@ -9953,8 +9953,8 @@ if(_global.BI.prepares == null) {
n = n === undefined ? 1 : nativeMax(toInteger(n), 0); n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
var result = (this.__filtered__ && !index) var result = (this.__filtered__ && !index)
? new LazyWrapper(this) ? new LazyWrapper(this)
: this.clone(); : this.clone();
if (result.__filtered__) { if (result.__filtered__) {
result.__takeCount__ = nativeMin(n, result.__takeCount__); result.__takeCount__ = nativeMin(n, result.__takeCount__);
@ -10538,7 +10538,7 @@ if (!_global.BI) {
// 数组相关的方法 // 数组相关的方法
_.each(["first", "initial", "last", "rest", "compact", "flatten", "without", "union", "intersection", _.each(["first", "initial", "last", "rest", "compact", "flatten", "without", "union", "intersection",
"difference", "zip", "unzip", "object", "indexOf", "lastIndexOf", "sortedIndex", "range", "take", "takeRight"], 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) { _.each(["findIndex", "findLastIndex"], function (name) {
@ -21871,14 +21871,16 @@ BI.prepares.push(function () {
var canvas = document.createElement("canvas"); var canvas = document.createElement("canvas");
var ratio = 2; var ratio = 2;
BI.Widget._renderEngine.createElement("body").append(canvas); BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 12) + 4;
var ctx = canvas.getContext("2d");
ctx.font = "12px Georgia";
var w = ctx.measureText(param).width + 4;
canvas.width = w * ratio; canvas.width = w * ratio;
canvas.height = 16 * ratio; canvas.height = 16 * ratio;
var ctx = canvas.getContext("2d");
// ctx.fillStyle = "#EAF2FD";
ctx.font = 12 * ratio + "px Georgia"; ctx.font = 12 * ratio + "px Georgia";
ctx.fillStyle = fillStyle || "#3685f2"; ctx.fillStyle = fillStyle || "#3685f2";
ctx.textBaseline = "middle"; ctx.textBaseline = "middle";
// ctx.fillStyle = "#EAF2FD";
ctx.fillText(param, 2 * ratio, 9 * ratio); ctx.fillText(param, 2 * ratio, 9 * ratio);
BI.Widget._renderEngine.createElement(canvas).destroy(); BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)"; var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)";

978
dist/fineui.ie.js vendored

File diff suppressed because it is too large Load Diff

26
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

978
dist/fineui.js vendored

File diff suppressed because it is too large Load Diff

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

26
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

970
dist/fineui_without_jquery_polyfill.js vendored

File diff suppressed because it is too large Load Diff

462
dist/utils.js vendored

@ -22,7 +22,7 @@ if(_global.BI.prepares == null) {
}/** }/**
* @license * @license
* Lodash (Custom Build) <https://lodash.com/> * 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,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy"` * 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,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy,uniqBy"`
* Copyright JS Foundation and other contributors <https://js.foundation/> * Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license> * Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@ -215,34 +215,34 @@ if(_global.BI.prepares == null) {
/** Used to identify `toStringTag` values of typed arrays. */ /** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {}; var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true; typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false; typedArrayTags[weakMapTag] = false;
/** Used to identify `toStringTag` values supported by `_.clone`. */ /** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {}; var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false; cloneableTags[weakMapTag] = false;
/** Used to map characters to HTML entities. */ /** Used to map characters to HTML entities. */
var htmlEscapes = { var htmlEscapes = {
@ -599,8 +599,8 @@ if(_global.BI.prepares == null) {
*/ */
function baseIndexOf(array, value, fromIndex) { function baseIndexOf(array, value, fromIndex) {
return value === value return value === value
? strictIndexOf(array, value, fromIndex) ? strictIndexOf(array, value, fromIndex)
: baseFindIndex(array, baseIsNaN, fromIndex); : baseFindIndex(array, baseIsNaN, fromIndex);
} }
/** /**
@ -656,8 +656,8 @@ if(_global.BI.prepares == null) {
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
eachFunc(collection, function(value, index, collection) { eachFunc(collection, function(value, index, collection) {
accumulator = initAccum accumulator = initAccum
? (initAccum = false, value) ? (initAccum = false, value)
: iteratee(accumulator, value, index, collection); : iteratee(accumulator, value, index, collection);
}); });
return accumulator; return accumulator;
} }
@ -910,8 +910,8 @@ if(_global.BI.prepares == null) {
*/ */
function safeGet(object, key) { function safeGet(object, key) {
return key == '__proto__' return key == '__proto__'
? undefined ? undefined
: object[key]; : object[key];
} }
/** /**
@ -962,8 +962,8 @@ if(_global.BI.prepares == null) {
*/ */
function stringSize(string) { function stringSize(string) {
return hasUnicode(string) return hasUnicode(string)
? unicodeSize(string) ? unicodeSize(string)
: asciiSize(string); : asciiSize(string);
} }
/** /**
@ -975,8 +975,8 @@ if(_global.BI.prepares == null) {
*/ */
function stringToArray(string) { function stringToArray(string) {
return hasUnicode(string) return hasUnicode(string)
? unicodeToArray(string) ? unicodeToArray(string)
: asciiToArray(string); : asciiToArray(string);
} }
/** /**
@ -1045,8 +1045,8 @@ if(_global.BI.prepares == null) {
/** Used to detect if a method is native. */ /** Used to detect if a method is native. */
var reIsNative = RegExp('^' + var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
); );
/** Built-in value references. */ /** Built-in value references. */
@ -1383,30 +1383,30 @@ if(_global.BI.prepares == null) {
var result = []; var result = [];
outer: outer:
while (length-- && resIndex < takeCount) { while (length-- && resIndex < takeCount) {
index += dir; index += dir;
var iterIndex = -1, var iterIndex = -1,
value = array[index]; value = array[index];
while (++iterIndex < iterLength) { while (++iterIndex < iterLength) {
var data = iteratees[iterIndex], var data = iteratees[iterIndex],
iteratee = data.iteratee, iteratee = data.iteratee,
type = data.type, type = data.type,
computed = iteratee(value); computed = iteratee(value);
if (type == LAZY_MAP_FLAG) { if (type == LAZY_MAP_FLAG) {
value = computed; value = computed;
} else if (!computed) { } else if (!computed) {
if (type == LAZY_FILTER_FLAG) { if (type == LAZY_FILTER_FLAG) {
continue outer; continue outer;
} else { } else {
break outer; break outer;
}
}
} }
result[resIndex++] = value;
} }
}
result[resIndex++] = value;
}
return result; return result;
} }
@ -1914,14 +1914,14 @@ if(_global.BI.prepares == null) {
for (var key in value) { for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) && if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && ( !(skipIndexes && (
// Safari 9 has enumerable `arguments.length` in strict mode. // Safari 9 has enumerable `arguments.length` in strict mode.
key == 'length' || key == 'length' ||
// Node.js 0.10 has enumerable non-index properties on buffers. // Node.js 0.10 has enumerable non-index properties on buffers.
(isBuff && (key == 'offset' || key == 'parent')) || (isBuff && (key == 'offset' || key == 'parent')) ||
// PhantomJS 2 has enumerable non-index properties on typed arrays. // PhantomJS 2 has enumerable non-index properties on typed arrays.
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
// Skip index properties. // Skip index properties.
isIndex(key, length) isIndex(key, length)
))) { ))) {
result.push(key); result.push(key);
} }
@ -2136,8 +2136,8 @@ if(_global.BI.prepares == null) {
result = (isFlat || isFunc) ? {} : initCloneObject(value); result = (isFlat || isFunc) ? {} : initCloneObject(value);
if (!isDeep) { if (!isDeep) {
return isFlat return isFlat
? copySymbolsIn(value, baseAssignIn(result, value)) ? copySymbolsIn(value, baseAssignIn(result, value))
: copySymbols(value, baseAssign(result, value)); : copySymbols(value, baseAssign(result, value));
} }
} else { } else {
if (!cloneableTags[tag]) { if (!cloneableTags[tag]) {
@ -2171,8 +2171,8 @@ if(_global.BI.prepares == null) {
} }
var keysFunc = isFull var keysFunc = isFull
? (isFlat ? getAllKeysIn : getAllKeys) ? (isFlat ? getAllKeysIn : getAllKeys)
: (isFlat ? keysIn : keys); : (isFlat ? keysIn : keys);
var props = isArr ? undefined : keysFunc(value); var props = isArr ? undefined : keysFunc(value);
arrayEach(props || value, function(subValue, key) { arrayEach(props || value, function(subValue, key) {
@ -2238,24 +2238,24 @@ if(_global.BI.prepares == null) {
values = new SetCache(values); values = new SetCache(values);
} }
outer: outer:
while (++index < length) { while (++index < length) {
var value = array[index], var value = array[index],
computed = iteratee == null ? value : iteratee(value); computed = iteratee == null ? value : iteratee(value);
value = (comparator || value !== 0) ? value : 0; value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) { if (isCommon && computed === computed) {
var valuesIndex = valuesLength; var valuesIndex = valuesLength;
while (valuesIndex--) { while (valuesIndex--) {
if (values[valuesIndex] === computed) { if (values[valuesIndex] === computed) {
continue outer; continue outer;
}
}
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
} }
} }
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
return result; return result;
} }
@ -2306,9 +2306,9 @@ if(_global.BI.prepares == null) {
current = iteratee(value); current = iteratee(value);
if (current != null && (computed === undefined if (current != null && (computed === undefined
? (current === current && !isSymbol(current)) ? (current === current && !isSymbol(current))
: comparator(current, computed) : comparator(current, computed)
)) { )) {
var computed = current, var computed = current,
result = value; result = value;
} }
@ -2480,8 +2480,8 @@ if(_global.BI.prepares == null) {
return value === undefined ? undefinedTag : nullTag; return value === undefined ? undefinedTag : nullTag;
} }
return (symToStringTag && symToStringTag in Object(value)) return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value) ? getRawTag(value)
: objectToString(value); : objectToString(value);
} }
/** /**
@ -2547,8 +2547,8 @@ if(_global.BI.prepares == null) {
} }
maxLength = nativeMin(array.length, maxLength); maxLength = nativeMin(array.length, maxLength);
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
? new SetCache(othIndex && array) ? new SetCache(othIndex && array)
: undefined; : undefined;
} }
array = arrays[0]; array = arrays[0];
@ -2556,31 +2556,31 @@ if(_global.BI.prepares == null) {
seen = caches[0]; seen = caches[0];
outer: outer:
while (++index < length && result.length < maxLength) { while (++index < length && result.length < maxLength) {
var value = array[index], var value = array[index],
computed = iteratee ? iteratee(value) : value; computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0; value = (comparator || value !== 0) ? value : 0;
if (!(seen if (!(seen
? cacheHas(seen, computed) ? cacheHas(seen, computed)
: includes(result, computed, comparator) : includes(result, computed, comparator)
)) { )) {
othIndex = othLength; othIndex = othLength;
while (--othIndex) { while (--othIndex) {
var cache = caches[othIndex]; var cache = caches[othIndex];
if (!(cache if (!(cache
? cacheHas(cache, computed) ? cacheHas(cache, computed)
: includes(arrays[othIndex], computed, comparator)) : includes(arrays[othIndex], computed, comparator))
) { ) {
continue outer; continue outer;
}
}
if (seen) {
seen.push(computed);
}
result.push(value);
} }
} }
if (seen) {
seen.push(computed);
}
result.push(value);
}
}
return result; return result;
} }
@ -2702,8 +2702,8 @@ if(_global.BI.prepares == null) {
if (isSameTag && !objIsObj) { if (isSameTag && !objIsObj) {
stack || (stack = new Stack); stack || (stack = new Stack);
return (objIsArr || isTypedArray(object)) return (objIsArr || isTypedArray(object))
? equalArrays(object, other, bitmask, customizer, equalFunc, stack) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
} }
if (!(bitmask & COMPARE_PARTIAL_FLAG)) { if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
@ -2757,9 +2757,9 @@ if(_global.BI.prepares == null) {
while (index--) { while (index--) {
var data = matchData[index]; var data = matchData[index];
if ((noCustomizer && data[2]) if ((noCustomizer && data[2])
? data[1] !== object[data[0]] ? data[1] !== object[data[0]]
: !(data[0] in object) : !(data[0] in object)
) { ) {
return false; return false;
} }
} }
@ -2779,9 +2779,9 @@ if(_global.BI.prepares == null) {
var result = customizer(objValue, srcValue, key, object, source, stack); var result = customizer(objValue, srcValue, key, object, source, stack);
} }
if (!(result === undefined if (!(result === undefined
? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
: result : result
)) { )) {
return false; return false;
} }
} }
@ -2836,7 +2836,7 @@ if(_global.BI.prepares == null) {
*/ */
function baseIsTypedArray(value) { function baseIsTypedArray(value) {
return isObjectLike(value) && return isObjectLike(value) &&
isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
} }
/** /**
@ -2857,8 +2857,8 @@ if(_global.BI.prepares == null) {
} }
if (typeof value == 'object') { if (typeof value == 'object') {
return isArray(value) return isArray(value)
? baseMatchesProperty(value[0], value[1]) ? baseMatchesProperty(value[0], value[1])
: baseMatches(value); : baseMatches(value);
} }
return property(value); return property(value);
} }
@ -2968,8 +2968,8 @@ if(_global.BI.prepares == null) {
return function(object) { return function(object) {
var objValue = get(object, path); var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue) return (objValue === undefined && objValue === srcValue)
? hasIn(object, path) ? hasIn(object, path)
: baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
}; };
} }
@ -2995,8 +2995,8 @@ if(_global.BI.prepares == null) {
} }
else { else {
var newValue = customizer var newValue = customizer
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
: undefined; : undefined;
if (newValue === undefined) { if (newValue === undefined) {
newValue = srcValue; newValue = srcValue;
@ -3031,8 +3031,8 @@ if(_global.BI.prepares == null) {
return; return;
} }
var newValue = customizer var newValue = customizer
? customizer(objValue, srcValue, (key + ''), object, source, stack) ? customizer(objValue, srcValue, (key + ''), object, source, stack)
: undefined; : undefined;
var isCommon = newValue === undefined; var isCommon = newValue === undefined;
@ -3239,8 +3239,8 @@ if(_global.BI.prepares == null) {
newValue = customizer ? customizer(objValue, key, nested) : undefined; newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) { if (newValue === undefined) {
newValue = isObject(objValue) newValue = isObject(objValue)
? objValue ? objValue
: (isIndex(path[index + 1]) ? [] : {}); : (isIndex(path[index + 1]) ? [] : {});
} }
} }
assignValue(nested, key, newValue); assignValue(nested, key, newValue);
@ -3386,30 +3386,30 @@ if(_global.BI.prepares == null) {
seen = iteratee ? [] : result; seen = iteratee ? [] : result;
} }
outer: outer:
while (++index < length) { while (++index < length) {
var value = array[index], var value = array[index],
computed = iteratee ? iteratee(value) : value; computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0; value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) { if (isCommon && computed === computed) {
var seenIndex = seen.length; var seenIndex = seen.length;
while (seenIndex--) { while (seenIndex--) {
if (seen[seenIndex] === computed) { if (seen[seenIndex] === computed) {
continue outer; continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
} }
} }
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result; return result;
} }
@ -3783,8 +3783,8 @@ if(_global.BI.prepares == null) {
var key = props[index]; var key = props[index];
var newValue = customizer var newValue = customizer
? customizer(object[key], source[key], key, object, source) ? customizer(object[key], source[key], key, object, source)
: undefined; : undefined;
if (newValue === undefined) { if (newValue === undefined) {
newValue = source[key]; newValue = source[key];
@ -3854,8 +3854,8 @@ if(_global.BI.prepares == null) {
guard = length > 2 ? sources[2] : undefined; guard = length > 2 ? sources[2] : undefined;
customizer = (assigner.length > 3 && typeof customizer == 'function') customizer = (assigner.length > 3 && typeof customizer == 'function')
? (length--, customizer) ? (length--, customizer)
: undefined; : undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) { if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer; customizer = length < 3 ? undefined : customizer;
@ -4001,14 +4001,14 @@ if(_global.BI.prepares == null) {
args[index] = arguments[index]; args[index] = arguments[index];
} }
var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
? [] ? []
: replaceHolders(args, placeholder); : replaceHolders(args, placeholder);
length -= holders.length; length -= holders.length;
if (length < arity) { if (length < arity) {
return createRecurry( return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, undefined, func, bitmask, createHybrid, wrapper.placeholder, undefined,
args, holders, undefined, undefined, arity - length); args, holders, undefined, undefined, arity - length);
} }
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return apply(fn, this, args); return apply(fn, this, args);
@ -4085,8 +4085,8 @@ if(_global.BI.prepares == null) {
if (isCurried && length < arity) { if (isCurried && length < arity) {
var newHolders = replaceHolders(args, placeholder); var newHolders = replaceHolders(args, placeholder);
return createRecurry( return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, thisArg, func, bitmask, createHybrid, wrapper.placeholder, thisArg,
args, newHolders, argPos, ary, arity - length args, newHolders, argPos, ary, arity - length
); );
} }
var thisBinding = isBind ? thisArg : this, var thisBinding = isBind ? thisArg : this,
@ -4298,8 +4298,8 @@ if(_global.BI.prepares == null) {
partials = newData[3]; partials = newData[3];
holders = newData[4]; holders = newData[4];
arity = newData[9] = newData[9] === undefined arity = newData[9] = newData[9] === undefined
? (isBindKey ? 0 : func.length) ? (isBindKey ? 0 : func.length)
: nativeMax(newData[9] - length, 0); : nativeMax(newData[9] - length, 0);
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
@ -4394,8 +4394,8 @@ if(_global.BI.prepares == null) {
if (customizer) { if (customizer) {
var compared = isPartial var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack) ? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack); : customizer(arrValue, othValue, index, array, other, stack);
} }
if (compared !== undefined) { if (compared !== undefined) {
if (compared) { if (compared) {
@ -4407,18 +4407,18 @@ if(_global.BI.prepares == null) {
// Recursively compare arrays (susceptible to call stack limits). // Recursively compare arrays (susceptible to call stack limits).
if (seen) { if (seen) {
if (!arraySome(other, function(othValue, othIndex) { if (!arraySome(other, function(othValue, othIndex) {
if (!cacheHas(seen, othIndex) && if (!cacheHas(seen, othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
return seen.push(othIndex); return seen.push(othIndex);
} }
})) { })) {
result = false; result = false;
break; break;
} }
} else if (!( } else if (!(
arrValue === othValue || arrValue === othValue ||
equalFunc(arrValue, othValue, bitmask, customizer, stack) equalFunc(arrValue, othValue, bitmask, customizer, stack)
)) { )) {
result = false; result = false;
break; break;
} }
@ -4557,14 +4557,14 @@ if(_global.BI.prepares == null) {
if (customizer) { if (customizer) {
var compared = isPartial var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack) ? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack); : customizer(objValue, othValue, key, object, other, stack);
} }
// Recursively compare objects (susceptible to call stack limits). // Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
: compared : compared
)) { )) {
result = false; result = false;
break; break;
} }
@ -4578,7 +4578,7 @@ if(_global.BI.prepares == null) {
if (objCtor != othCtor && if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) && ('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor && !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) { typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false; result = false;
} }
} }
@ -4677,8 +4677,8 @@ if(_global.BI.prepares == null) {
function getMapData(map, key) { function getMapData(map, key) {
var data = map.__data__; var data = map.__data__;
return isKeyable(key) return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash'] ? data[typeof key == 'string' ? 'string' : 'hash']
: data.map; : data.map;
} }
/** /**
@ -4875,7 +4875,7 @@ if(_global.BI.prepares == null) {
} }
length = object == null ? 0 : object.length; length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isArguments(object)); (isArray(object) || isArguments(object));
} }
/** /**
@ -4906,8 +4906,8 @@ if(_global.BI.prepares == null) {
*/ */
function initCloneObject(object) { function initCloneObject(object) {
return (typeof object.constructor == 'function' && !isPrototype(object)) return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototype(object)) ? baseCreate(getPrototype(object))
: {}; : {};
} }
/** /**
@ -4986,7 +4986,7 @@ if(_global.BI.prepares == null) {
*/ */
function isFlattenable(value) { function isFlattenable(value) {
return isArray(value) || isArguments(value) || return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol]); !!(spreadableSymbol && value && value[spreadableSymbol]);
} }
/** /**
@ -5002,9 +5002,9 @@ if(_global.BI.prepares == null) {
length = length == null ? MAX_SAFE_INTEGER : length; length = length == null ? MAX_SAFE_INTEGER : length;
return !!length && return !!length &&
(type == 'number' || (type == 'number' ||
(type != 'symbol' && reIsUint.test(value))) && (type != 'symbol' && reIsUint.test(value))) &&
(value > -1 && value % 1 == 0 && value < length); (value > -1 && value % 1 == 0 && value < length);
} }
/** /**
@ -5023,9 +5023,9 @@ if(_global.BI.prepares == null) {
} }
var type = typeof index; var type = typeof index;
if (type == 'number' if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length)) ? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object) : (type == 'string' && index in object)
) { ) {
return eq(object[index], value); return eq(object[index], value);
} }
return false; return false;
@ -5049,7 +5049,7 @@ if(_global.BI.prepares == null) {
return true; return true;
} }
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object)); (object != null && value in Object(object));
} }
/** /**
@ -5062,8 +5062,8 @@ if(_global.BI.prepares == null) {
function isKeyable(value) { function isKeyable(value) {
var type = typeof value; var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__') ? (value !== '__proto__')
: (value === null); : (value === null);
} }
/** /**
@ -5140,7 +5140,7 @@ if(_global.BI.prepares == null) {
return false; return false;
} }
return object[key] === srcValue && return object[key] === srcValue &&
(srcValue !== undefined || (key in Object(object))); (srcValue !== undefined || (key in Object(object)));
}; };
} }
@ -5187,9 +5187,9 @@ if(_global.BI.prepares == null) {
isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
var isCombo = var isCombo =
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
// Exit early if metadata can't be merged. // Exit early if metadata can't be merged.
if (!(isCommon || isCombo)) { if (!(isCommon || isCombo)) {
@ -5579,8 +5579,8 @@ if(_global.BI.prepares == null) {
*/ */
var difference = baseRest(function(array, values) { var difference = baseRest(function(array, values) {
return isArrayLikeObject(array) return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
: []; : [];
}); });
/** /**
@ -5708,8 +5708,8 @@ if(_global.BI.prepares == null) {
if (fromIndex !== undefined) { if (fromIndex !== undefined) {
index = toInteger(fromIndex); index = toInteger(fromIndex);
index = fromIndex < 0 index = fromIndex < 0
? nativeMax(length + index, 0) ? nativeMax(length + index, 0)
: nativeMin(index, length - 1); : nativeMin(index, length - 1);
} }
return baseFindIndex(array, baseIteratee(predicate, 3), index, true); return baseFindIndex(array, baseIteratee(predicate, 3), index, true);
} }
@ -5848,8 +5848,8 @@ if(_global.BI.prepares == null) {
var intersection = baseRest(function(arrays) { var intersection = baseRest(function(arrays) {
var mapped = arrayMap(arrays, castArrayLikeObject); var mapped = arrayMap(arrays, castArrayLikeObject);
return (mapped.length && mapped[0] === arrays[0]) return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped) ? baseIntersection(mapped)
: []; : [];
}); });
/** /**
@ -6124,8 +6124,8 @@ if(_global.BI.prepares == null) {
*/ */
var without = baseRest(function(array, values) { var without = baseRest(function(array, values) {
return isArrayLikeObject(array) return isArrayLikeObject(array)
? baseDifference(array, values) ? baseDifference(array, values)
: []; : [];
}); });
/** /**
@ -7195,8 +7195,8 @@ if(_global.BI.prepares == null) {
timeWaiting = wait - timeSinceLastCall; timeWaiting = wait - timeSinceLastCall;
return maxing return maxing
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
: timeWaiting; : timeWaiting;
} }
function shouldInvoke(time) { function shouldInvoke(time) {
@ -7207,7 +7207,7 @@ if(_global.BI.prepares == null) {
// trailing edge, the system time has gone backwards and we're treating // trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit. // it as the trailing edge, or we've hit the `maxWait` limit.
return (lastCallTime === undefined || (timeSinceLastCall >= wait) || return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
} }
function timerExpired() { function timerExpired() {
@ -7646,7 +7646,7 @@ if(_global.BI.prepares == null) {
*/ */
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee'); !propertyIsEnumerable.call(value, 'callee');
}; };
/** /**
@ -7751,7 +7751,7 @@ if(_global.BI.prepares == null) {
*/ */
function isBoolean(value) { function isBoolean(value) {
return value === true || value === false || return value === true || value === false ||
(isObjectLike(value) && baseGetTag(value) == boolTag); (isObjectLike(value) && baseGetTag(value) == boolTag);
} }
/** /**
@ -7831,7 +7831,7 @@ if(_global.BI.prepares == null) {
} }
if (isArrayLike(value) && if (isArrayLike(value) &&
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
isBuffer(value) || isTypedArray(value) || isArguments(value))) { isBuffer(value) || isTypedArray(value) || isArguments(value))) {
return !value.length; return !value.length;
} }
var tag = getTag(value); var tag = getTag(value);
@ -7966,7 +7966,7 @@ if(_global.BI.prepares == null) {
*/ */
function isLength(value) { function isLength(value) {
return typeof value == 'number' && return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
} }
/** /**
@ -8130,7 +8130,7 @@ if(_global.BI.prepares == null) {
*/ */
function isNumber(value) { function isNumber(value) {
return typeof value == 'number' || return typeof value == 'number' ||
(isObjectLike(value) && baseGetTag(value) == numberTag); (isObjectLike(value) && baseGetTag(value) == numberTag);
} }
/** /**
@ -8171,7 +8171,7 @@ if(_global.BI.prepares == null) {
} }
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor && return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString; funcToString.call(Ctor) == objectCtorString;
} }
/** /**
@ -8231,7 +8231,7 @@ if(_global.BI.prepares == null) {
*/ */
function isString(value) { function isString(value) {
return typeof value == 'string' || return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
} }
/** /**
@ -8253,7 +8253,7 @@ if(_global.BI.prepares == null) {
*/ */
function isSymbol(value) { function isSymbol(value) {
return typeof value == 'symbol' || return typeof value == 'symbol' ||
(isObjectLike(value) && baseGetTag(value) == symbolTag); (isObjectLike(value) && baseGetTag(value) == symbolTag);
} }
/** /**
@ -8443,8 +8443,8 @@ if(_global.BI.prepares == null) {
value = value.replace(reTrim, ''); value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value); var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value)) return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8) ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value); : (reIsBadHex.test(value) ? NAN : +value);
} }
/** /**
@ -9355,8 +9355,8 @@ if(_global.BI.prepares == null) {
function escape(string) { function escape(string) {
string = toString(string); string = toString(string);
return (string && reHasUnescapedHtml.test(string)) return (string && reHasUnescapedHtml.test(string))
? string.replace(reUnescapedHtml, escapeHtmlChar) ? string.replace(reUnescapedHtml, escapeHtmlChar)
: string; : string;
} }
/** /**
@ -9782,8 +9782,8 @@ if(_global.BI.prepares == null) {
*/ */
function max(array) { function max(array) {
return (array && array.length) return (array && array.length)
? baseExtremum(array, identity, baseGt) ? baseExtremum(array, identity, baseGt)
: undefined; : undefined;
} }
/** /**
@ -9806,8 +9806,8 @@ if(_global.BI.prepares == null) {
*/ */
function min(array) { function min(array) {
return (array && array.length) return (array && array.length)
? baseExtremum(array, identity, baseLt) ? baseExtremum(array, identity, baseLt)
: undefined; : undefined;
} }
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
@ -9953,8 +9953,8 @@ if(_global.BI.prepares == null) {
n = n === undefined ? 1 : nativeMax(toInteger(n), 0); n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
var result = (this.__filtered__ && !index) var result = (this.__filtered__ && !index)
? new LazyWrapper(this) ? new LazyWrapper(this)
: this.clone(); : this.clone();
if (result.__filtered__) { if (result.__filtered__) {
result.__takeCount__ = nativeMin(n, result.__takeCount__); result.__takeCount__ = nativeMin(n, result.__takeCount__);
@ -11317,7 +11317,7 @@ if (!_global.BI) {
// 数组相关的方法 // 数组相关的方法
_.each(["first", "initial", "last", "rest", "compact", "flatten", "without", "union", "intersection", _.each(["first", "initial", "last", "rest", "compact", "flatten", "without", "union", "intersection",
"difference", "zip", "unzip", "object", "indexOf", "lastIndexOf", "sortedIndex", "range", "take", "takeRight"], 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) { _.each(["findIndex", "findLastIndex"], function (name) {

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

489
dist/widget.js vendored

@ -1699,7 +1699,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
stopPropagation: o.stopPropagation, stopPropagation: o.stopPropagation,
el: BI.createWidget(o.el, { el: BI.createWidget(o.el, {
type: "bi.icon_trigger", type: "bi.icon_trigger",
extraCls: o.iconCls ? o.iconCls : "", extraCls: o.iconCls,
width: o.width, width: o.width,
height: o.height height: o.height
}), }),
@ -6653,7 +6653,9 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
attributes: { attributes: {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false allowEdit: false,
allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -6733,6 +6735,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_select_tree_trigger", type: "bi.multilayer_select_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-select-tree-trigger", cls: "multilayer-select-tree-trigger",
ref: function (_ref) { ref: function (_ref) {
@ -6770,6 +6774,13 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -6822,6 +6833,97 @@ BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/** BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSelectTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSelectTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-select-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_insert_search_pane", BI.MultiLayerSelectTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSelectLevelTree * @class BI.MultiLayerSelectLevelTree
@ -7090,7 +7192,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items)))); this.tree.initTree(BI.Tree.treeFormat(o.items));
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -7131,22 +7233,31 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_select_tree_popup", type: o.allowInsertValue ? "bi.multilayer_select_tree_insert_search_pane" : "bi.multilayer_select_tree_popup",
itemsCreator: function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
}, },
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword); callback(self._getSearchItems(keyword));
var matched = finding.match, find = finding.find; o.allowInsertValue && self.popup.setKeyword(keyword);
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else { } else {
callback(); callback();
} }
@ -7188,32 +7299,70 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_getSearchItems: function(keyword) {
var o = this.options;
var findingText = BI.Func.getSearchResult(o.items, keyword, "text");
var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []};
var textItems = findingText.find.concat(findingText.match);
var valueItems = findingValue.find.concat(findingValue.match);
return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id"));
},
_createJson: function(node, open) {
return {
id: node.id,
pId: node.pId,
text: node.text,
value: node.value,
isParent: BI.isNotEmptyArray(node.children),
open: open
}
},
_getChildren: function(node) {
var self = this;
node.children = node.children || [];
var nodes = [];
BI.each(node.children, function (idx, child) {
var children = self._getChildren(child);
nodes = nodes.concat(children);
});
return node.children.concat(nodes);
},
// 将搜索到的节点进行补充,构造成一棵完整的树 // 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) { _fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id"); var self = this;
var queue = leaves.reverse() || []; var result = [];
var queue = [];
BI.each(leaves, function (idx, node) {
queue.push({pId: node.pId});
result.push(node);
result = result.concat(self._getChildren(node));
});
while (BI.isNotEmptyArray(queue)) { while (BI.isNotEmptyArray(queue)) {
var node = queue.pop(); var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id"); var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) { if (pNode != null) {
queue.push(pNode); pNode.open = true;
result.push(pNode.id); queue.push({pId: pNode.pId});
result.push(pNode);
} }
} }
var nodes = []; return BI.uniqBy(BI.map(result, function (idx, node) {
BI.each(this.options.items, function (idx, item) { return self._createJson(node, node.open);
if(BI.contains(result, item.id)) { }), "id");
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
}, },
_digest: function (v) { _digest: function (v) {
var o = this.options; var o = this.options;
return o.valueFormatter(v) || o.text; if(o.itemsCreator === BI.emptyFn) {
var result = BI.find(o.items, function (i, item) {
return item.value === v;
});
return BI.isNotNull(result) ? result.text : o.text;
}
return o.valueFormatter(v);
}, },
stopEditing: function () { stopEditing: function () {
@ -7243,6 +7392,7 @@ BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/** BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *
@ -7668,7 +7818,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
attributes: { attributes: {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false allowEdit: false,
allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -7748,6 +7900,8 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_single_tree_trigger", type: "bi.multilayer_single_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-single-tree-trigger", cls: "multilayer-single-tree-trigger",
ref: function (_ref) { ref: function (_ref) {
@ -7785,6 +7939,13 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {
@ -7837,6 +7998,97 @@ BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS"; BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/** BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSingleTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSingleTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-single-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_insert_search_pane", BI.MultiLayerSingleTreeInsertSearchPane);/**
* guy * guy
* 二级树 * 二级树
* @class BI.MultiLayerSingleLevelTree * @class BI.MultiLayerSingleLevelTree
@ -8096,7 +8348,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
return v; return v;
}, },
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search") watermark: BI.i18nText("BI-Basic_Search"),
allowSearchValue: false
}; };
}, },
@ -8104,7 +8357,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items)))); this.tree.initTree(BI.Tree.treeFormat(o.items));
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -8145,7 +8398,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_single_tree_popup", type: o.allowInsertValue ? "bi.multilayer_single_tree_insert_search_pane" : "bi.multilayer_single_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -8153,14 +8406,23 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword); callback(self._getSearchItems(keyword));
var matched = finding.match, find = finding.find; o.allowInsertValue && self.popup.setKeyword(keyword);
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else { } else {
callback(); callback();
} }
@ -8202,27 +8464,59 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_getSearchItems: function(keyword) {
var o = this.options;
var findingText = BI.Func.getSearchResult(o.items, keyword, "text");
var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []};
var textItems = findingText.find.concat(findingText.match);
var valueItems = findingValue.find.concat(findingValue.match);
return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id"));
},
_createJson: function(node, open) {
return {
id: node.id,
pId: node.pId,
text: node.text,
value: node.value,
isParent: BI.isNotEmptyArray(node.children),
open: open
}
},
_getChildren: function(node) {
var self = this;
node.children = node.children || [];
var nodes = [];
BI.each(node.children, function (idx, child) {
var children = self._getChildren(child);
nodes = nodes.concat(children);
});
return node.children.concat(nodes);
},
// 将搜索到的节点进行补充,构造成一棵完整的树 // 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) { _fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id"); var self = this;
var queue = leaves.reverse() || []; var result = [];
var queue = [];
BI.each(leaves, function (idx, node) {
queue.push({pId: node.pId});
result.push(node);
result = result.concat(self._getChildren(node));
});
while (BI.isNotEmptyArray(queue)) { while (BI.isNotEmptyArray(queue)) {
var node = queue.pop(); var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id"); var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) { if (pNode != null) {
queue.push(pNode); pNode.open = true;
result.push(pNode.id); queue.push({pId: pNode.pId});
result.push(pNode);
} }
} }
var nodes = []; return BI.uniqBy(BI.map(result, function (idx, node) {
BI.each(this.options.items, function (idx, item) { return self._createJson(node, node.open);
if(BI.contains(result, item.id)) { }), "id");
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
}, },
_digest: function (v) { _digest: function (v) {
@ -8263,6 +8557,7 @@ BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/** BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);/**
* 加号表示的组节点 * 加号表示的组节点
* *
@ -13841,7 +14136,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: checked ? this.getValue() : {} value: checked ? this.getValue() : {}
}; };
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getSearcher().setState(val);
this.getCounter().setButtonChecked(val); this.getCounter().setButtonChecked(val);
self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM);
}); });
@ -14144,7 +14439,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: checked ? this.getValue() : {} value: checked ? this.getValue() : {}
}; };
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getSearcher().setState(val);
this.getCounter().setButtonChecked(val); this.getCounter().setButtonChecked(val);
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue()); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue());
}); });
@ -14460,7 +14755,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: checked ? this.getValue() : {} value: checked ? this.getValue() : {}
}; };
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getSearcher().setState(val);
this.getCounter().setButtonChecked(val); this.getCounter().setButtonChecked(val);
self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue()); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue());
}); });
@ -17858,6 +18153,10 @@ BI.SelectTreeExpander = BI.inherit(BI.Widget, {
}); });
}, },
getAllLeaves: function () {
return this.expander.getAllLeaves();
},
setValue: function (v) { setValue: function (v) {
if (BI.contains(v, this.trigger.getValue())) { if (BI.contains(v, this.trigger.getValue())) {
this.trigger.setSelected(true); this.trigger.setSelected(true);
@ -25891,11 +26190,17 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}, },
_isMatch: function (parentValues, value, keyword) { _isMatch: function (parentValues, value, keyword) {
var o = this.options;
var node = this._getTreeNode(parentValues, value); var node = this._getTreeNode(parentValues, value);
if (!node) { if (!node) {
return false; return false;
} }
var find = BI.Func.getSearchResult([node.text || node.value], keyword); var find = BI.Func.getSearchResult([node.text || node.value], keyword);
if(o.allowSearchValue && node.value) {
var valueFind = BI.Func.getSearchResult([node.value], keyword);
return valueFind.find.length > 0 || valueFind.match.length > 0 ||
find.find.length > 0 || find.match.length > 0;
}
return find.find.length > 0 || find.match.length > 0; return find.find.length > 0 || find.match.length > 0;
}, },
@ -26646,6 +26951,96 @@ BI.AbstractValueChooser = BI.inherit(BI.Widget, {
} }
} }
});/** });/**
* 简单的复选下拉框控件, 适用于数据量少的情况
* 封装了字段处理逻辑
*/
BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, {
_defaultConfig: function () {
return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-value-chooser-insert-combo",
width: 200,
height: 24,
items: null,
itemsCreator: BI.emptyFn,
cache: true
});
},
_init: function () {
BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (BI.isNotNull(o.items)) {
this.items = o.items;
}
this.combo = BI.createWidget({
type: "bi.multi_select_insert_combo",
element: this,
text: o.text,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height,
listeners: [{
eventName: BI.MultiSelectCombo.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_BLUR,
action: function () {
self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_STOP,
action: function () {
self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM,
action: function () {
self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_SEARCHING,
action: function () {
self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM);
}
}]
});
},
setValue: function (v) {
this.combo.setValue(v);
},
getValue: function () {
var val = this.combo.getValue() || {};
return {
type: val.type,
value: val.value
};
},
populate: function (items) {
// 直接用combo的populate不会作用到AbstractValueChooser上
this.items = items;
this.combo.populate.apply(this, arguments);
}
});
BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR";
BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);/**
* 简单的复选下拉框控件, 适用于数据量少的情况 * 简单的复选下拉框控件, 适用于数据量少的情况
* 封装了字段处理逻辑 * 封装了字段处理逻辑
* *

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,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy" 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,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy,uniqBy"

6
src/case/trigger/trigger.icon.js

@ -9,7 +9,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-trigger", baseCls: "bi-icon-trigger",
extraCls: "pull-down-font",
el: {}, el: {},
height: 24 height: 24
}); });
@ -21,7 +22,8 @@ BI.IconTrigger = BI.inherit(BI.Trigger, {
type: "bi.trigger_icon_button", type: "bi.trigger_icon_button",
element: this, element: this,
width: o.width, width: o.width,
height: o.height height: o.height,
extraCls: o.extraCls
}); });
} }
}); });

6
src/component/treevaluechooser/abstract.treevaluechooser.js

@ -694,11 +694,17 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}, },
_isMatch: function (parentValues, value, keyword) { _isMatch: function (parentValues, value, keyword) {
var o = this.options;
var node = this._getTreeNode(parentValues, value); var node = this._getTreeNode(parentValues, value);
if (!node) { if (!node) {
return false; return false;
} }
var find = BI.Func.getSearchResult([node.text || node.value], keyword); var find = BI.Func.getSearchResult([node.text || node.value], keyword);
if(o.allowSearchValue && node.value) {
var valueFind = BI.Func.getSearchResult([node.value], keyword);
return valueFind.find.length > 0 || valueFind.match.length > 0 ||
find.find.length > 0 || find.match.length > 0;
}
return find.find.length > 0 || find.match.length > 0; return find.find.length > 0 || find.match.length > 0;
}, },

91
src/component/valuechooser/combo.valuechooser.insert.js

@ -0,0 +1,91 @@
/**
* 简单的复选下拉框控件, 适用于数据量少的情况
* 封装了字段处理逻辑
*/
BI.ValueChooserInsertCombo = BI.inherit(BI.AbstractValueChooser, {
_defaultConfig: function () {
return BI.extend(BI.ValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-value-chooser-insert-combo",
width: 200,
height: 24,
items: null,
itemsCreator: BI.emptyFn,
cache: true
});
},
_init: function () {
BI.ValueChooserInsertCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (BI.isNotNull(o.items)) {
this.items = o.items;
}
this.combo = BI.createWidget({
type: "bi.multi_select_insert_combo",
element: this,
text: o.text,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height,
listeners: [{
eventName: BI.MultiSelectCombo.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.ValueChooserInsertCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_BLUR,
action: function () {
self.fireEvent(BI.ValueChooserInsertCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_STOP,
action: function () {
self.fireEvent(BI.ValueChooserInsertCombo.EVENT_STOP);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM,
action: function () {
self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_SEARCHING,
action: function () {
self.fireEvent(BI.ValueChooserInsertCombo.EVENT_SEARCHING);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.ValueChooserInsertCombo.EVENT_CONFIRM);
}
}]
});
},
setValue: function (v) {
this.combo.setValue(v);
},
getValue: function () {
var val = this.combo.getValue() || {};
return {
type: val.type,
value: val.value
};
},
populate: function (items) {
// 直接用combo的populate不会作用到AbstractValueChooser上
this.items = items;
this.combo.populate.apply(this, arguments);
}
});
BI.ValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR";
BI.ValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.ValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.ValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.ValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.ValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.value_chooser_insert_combo", BI.ValueChooserInsertCombo);

2
src/core/base.js

@ -359,7 +359,7 @@ if (!_global.BI) {
// 数组相关的方法 // 数组相关的方法
_.each(["first", "initial", "last", "rest", "compact", "flatten", "without", "union", "intersection", _.each(["first", "initial", "last", "rest", "compact", "flatten", "without", "union", "intersection",
"difference", "zip", "unzip", "object", "indexOf", "lastIndexOf", "sortedIndex", "range", "take", "takeRight"], 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) { _.each(["findIndex", "findLastIndex"], function (name) {

460
src/core/lodash.js

@ -1,7 +1,7 @@
/** /**
* @license * @license
* Lodash (Custom Build) <https://lodash.com/> * 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,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy"` * 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,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy,uniqBy"`
* Copyright JS Foundation and other contributors <https://js.foundation/> * Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license> * Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@ -194,34 +194,34 @@
/** Used to identify `toStringTag` values of typed arrays. */ /** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {}; var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true; typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false; typedArrayTags[weakMapTag] = false;
/** Used to identify `toStringTag` values supported by `_.clone`. */ /** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {}; var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false; cloneableTags[weakMapTag] = false;
/** Used to map characters to HTML entities. */ /** Used to map characters to HTML entities. */
var htmlEscapes = { var htmlEscapes = {
@ -578,8 +578,8 @@
*/ */
function baseIndexOf(array, value, fromIndex) { function baseIndexOf(array, value, fromIndex) {
return value === value return value === value
? strictIndexOf(array, value, fromIndex) ? strictIndexOf(array, value, fromIndex)
: baseFindIndex(array, baseIsNaN, fromIndex); : baseFindIndex(array, baseIsNaN, fromIndex);
} }
/** /**
@ -635,8 +635,8 @@
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
eachFunc(collection, function(value, index, collection) { eachFunc(collection, function(value, index, collection) {
accumulator = initAccum accumulator = initAccum
? (initAccum = false, value) ? (initAccum = false, value)
: iteratee(accumulator, value, index, collection); : iteratee(accumulator, value, index, collection);
}); });
return accumulator; return accumulator;
} }
@ -889,8 +889,8 @@
*/ */
function safeGet(object, key) { function safeGet(object, key) {
return key == '__proto__' return key == '__proto__'
? undefined ? undefined
: object[key]; : object[key];
} }
/** /**
@ -941,8 +941,8 @@
*/ */
function stringSize(string) { function stringSize(string) {
return hasUnicode(string) return hasUnicode(string)
? unicodeSize(string) ? unicodeSize(string)
: asciiSize(string); : asciiSize(string);
} }
/** /**
@ -954,8 +954,8 @@
*/ */
function stringToArray(string) { function stringToArray(string) {
return hasUnicode(string) return hasUnicode(string)
? unicodeToArray(string) ? unicodeToArray(string)
: asciiToArray(string); : asciiToArray(string);
} }
/** /**
@ -1024,8 +1024,8 @@
/** Used to detect if a method is native. */ /** Used to detect if a method is native. */
var reIsNative = RegExp('^' + var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
); );
/** Built-in value references. */ /** Built-in value references. */
@ -1362,30 +1362,30 @@
var result = []; var result = [];
outer: outer:
while (length-- && resIndex < takeCount) { while (length-- && resIndex < takeCount) {
index += dir; index += dir;
var iterIndex = -1, var iterIndex = -1,
value = array[index]; value = array[index];
while (++iterIndex < iterLength) { while (++iterIndex < iterLength) {
var data = iteratees[iterIndex], var data = iteratees[iterIndex],
iteratee = data.iteratee, iteratee = data.iteratee,
type = data.type, type = data.type,
computed = iteratee(value); computed = iteratee(value);
if (type == LAZY_MAP_FLAG) { if (type == LAZY_MAP_FLAG) {
value = computed; value = computed;
} else if (!computed) { } else if (!computed) {
if (type == LAZY_FILTER_FLAG) { if (type == LAZY_FILTER_FLAG) {
continue outer; continue outer;
} else { } else {
break outer; break outer;
}
}
} }
result[resIndex++] = value;
} }
}
result[resIndex++] = value;
}
return result; return result;
} }
@ -1893,14 +1893,14 @@
for (var key in value) { for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) && if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && ( !(skipIndexes && (
// Safari 9 has enumerable `arguments.length` in strict mode. // Safari 9 has enumerable `arguments.length` in strict mode.
key == 'length' || key == 'length' ||
// Node.js 0.10 has enumerable non-index properties on buffers. // Node.js 0.10 has enumerable non-index properties on buffers.
(isBuff && (key == 'offset' || key == 'parent')) || (isBuff && (key == 'offset' || key == 'parent')) ||
// PhantomJS 2 has enumerable non-index properties on typed arrays. // PhantomJS 2 has enumerable non-index properties on typed arrays.
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
// Skip index properties. // Skip index properties.
isIndex(key, length) isIndex(key, length)
))) { ))) {
result.push(key); result.push(key);
} }
@ -2115,8 +2115,8 @@
result = (isFlat || isFunc) ? {} : initCloneObject(value); result = (isFlat || isFunc) ? {} : initCloneObject(value);
if (!isDeep) { if (!isDeep) {
return isFlat return isFlat
? copySymbolsIn(value, baseAssignIn(result, value)) ? copySymbolsIn(value, baseAssignIn(result, value))
: copySymbols(value, baseAssign(result, value)); : copySymbols(value, baseAssign(result, value));
} }
} else { } else {
if (!cloneableTags[tag]) { if (!cloneableTags[tag]) {
@ -2150,8 +2150,8 @@
} }
var keysFunc = isFull var keysFunc = isFull
? (isFlat ? getAllKeysIn : getAllKeys) ? (isFlat ? getAllKeysIn : getAllKeys)
: (isFlat ? keysIn : keys); : (isFlat ? keysIn : keys);
var props = isArr ? undefined : keysFunc(value); var props = isArr ? undefined : keysFunc(value);
arrayEach(props || value, function(subValue, key) { arrayEach(props || value, function(subValue, key) {
@ -2217,24 +2217,24 @@
values = new SetCache(values); values = new SetCache(values);
} }
outer: outer:
while (++index < length) { while (++index < length) {
var value = array[index], var value = array[index],
computed = iteratee == null ? value : iteratee(value); computed = iteratee == null ? value : iteratee(value);
value = (comparator || value !== 0) ? value : 0; value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) { if (isCommon && computed === computed) {
var valuesIndex = valuesLength; var valuesIndex = valuesLength;
while (valuesIndex--) { while (valuesIndex--) {
if (values[valuesIndex] === computed) { if (values[valuesIndex] === computed) {
continue outer; continue outer;
}
}
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
} }
} }
result.push(value);
}
else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
return result; return result;
} }
@ -2285,9 +2285,9 @@
current = iteratee(value); current = iteratee(value);
if (current != null && (computed === undefined if (current != null && (computed === undefined
? (current === current && !isSymbol(current)) ? (current === current && !isSymbol(current))
: comparator(current, computed) : comparator(current, computed)
)) { )) {
var computed = current, var computed = current,
result = value; result = value;
} }
@ -2459,8 +2459,8 @@
return value === undefined ? undefinedTag : nullTag; return value === undefined ? undefinedTag : nullTag;
} }
return (symToStringTag && symToStringTag in Object(value)) return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value) ? getRawTag(value)
: objectToString(value); : objectToString(value);
} }
/** /**
@ -2526,8 +2526,8 @@
} }
maxLength = nativeMin(array.length, maxLength); maxLength = nativeMin(array.length, maxLength);
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
? new SetCache(othIndex && array) ? new SetCache(othIndex && array)
: undefined; : undefined;
} }
array = arrays[0]; array = arrays[0];
@ -2535,31 +2535,31 @@
seen = caches[0]; seen = caches[0];
outer: outer:
while (++index < length && result.length < maxLength) { while (++index < length && result.length < maxLength) {
var value = array[index], var value = array[index],
computed = iteratee ? iteratee(value) : value; computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0; value = (comparator || value !== 0) ? value : 0;
if (!(seen if (!(seen
? cacheHas(seen, computed) ? cacheHas(seen, computed)
: includes(result, computed, comparator) : includes(result, computed, comparator)
)) { )) {
othIndex = othLength; othIndex = othLength;
while (--othIndex) { while (--othIndex) {
var cache = caches[othIndex]; var cache = caches[othIndex];
if (!(cache if (!(cache
? cacheHas(cache, computed) ? cacheHas(cache, computed)
: includes(arrays[othIndex], computed, comparator)) : includes(arrays[othIndex], computed, comparator))
) { ) {
continue outer; continue outer;
}
}
if (seen) {
seen.push(computed);
}
result.push(value);
} }
} }
if (seen) {
seen.push(computed);
}
result.push(value);
}
}
return result; return result;
} }
@ -2681,8 +2681,8 @@
if (isSameTag && !objIsObj) { if (isSameTag && !objIsObj) {
stack || (stack = new Stack); stack || (stack = new Stack);
return (objIsArr || isTypedArray(object)) return (objIsArr || isTypedArray(object))
? equalArrays(object, other, bitmask, customizer, equalFunc, stack) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
} }
if (!(bitmask & COMPARE_PARTIAL_FLAG)) { if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
@ -2736,9 +2736,9 @@
while (index--) { while (index--) {
var data = matchData[index]; var data = matchData[index];
if ((noCustomizer && data[2]) if ((noCustomizer && data[2])
? data[1] !== object[data[0]] ? data[1] !== object[data[0]]
: !(data[0] in object) : !(data[0] in object)
) { ) {
return false; return false;
} }
} }
@ -2758,9 +2758,9 @@
var result = customizer(objValue, srcValue, key, object, source, stack); var result = customizer(objValue, srcValue, key, object, source, stack);
} }
if (!(result === undefined if (!(result === undefined
? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
: result : result
)) { )) {
return false; return false;
} }
} }
@ -2815,7 +2815,7 @@
*/ */
function baseIsTypedArray(value) { function baseIsTypedArray(value) {
return isObjectLike(value) && return isObjectLike(value) &&
isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
} }
/** /**
@ -2836,8 +2836,8 @@
} }
if (typeof value == 'object') { if (typeof value == 'object') {
return isArray(value) return isArray(value)
? baseMatchesProperty(value[0], value[1]) ? baseMatchesProperty(value[0], value[1])
: baseMatches(value); : baseMatches(value);
} }
return property(value); return property(value);
} }
@ -2947,8 +2947,8 @@
return function(object) { return function(object) {
var objValue = get(object, path); var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue) return (objValue === undefined && objValue === srcValue)
? hasIn(object, path) ? hasIn(object, path)
: baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
}; };
} }
@ -2974,8 +2974,8 @@
} }
else { else {
var newValue = customizer var newValue = customizer
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
: undefined; : undefined;
if (newValue === undefined) { if (newValue === undefined) {
newValue = srcValue; newValue = srcValue;
@ -3010,8 +3010,8 @@
return; return;
} }
var newValue = customizer var newValue = customizer
? customizer(objValue, srcValue, (key + ''), object, source, stack) ? customizer(objValue, srcValue, (key + ''), object, source, stack)
: undefined; : undefined;
var isCommon = newValue === undefined; var isCommon = newValue === undefined;
@ -3218,8 +3218,8 @@
newValue = customizer ? customizer(objValue, key, nested) : undefined; newValue = customizer ? customizer(objValue, key, nested) : undefined;
if (newValue === undefined) { if (newValue === undefined) {
newValue = isObject(objValue) newValue = isObject(objValue)
? objValue ? objValue
: (isIndex(path[index + 1]) ? [] : {}); : (isIndex(path[index + 1]) ? [] : {});
} }
} }
assignValue(nested, key, newValue); assignValue(nested, key, newValue);
@ -3365,30 +3365,30 @@
seen = iteratee ? [] : result; seen = iteratee ? [] : result;
} }
outer: outer:
while (++index < length) { while (++index < length) {
var value = array[index], var value = array[index],
computed = iteratee ? iteratee(value) : value; computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0; value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) { if (isCommon && computed === computed) {
var seenIndex = seen.length; var seenIndex = seen.length;
while (seenIndex--) { while (seenIndex--) {
if (seen[seenIndex] === computed) { if (seen[seenIndex] === computed) {
continue outer; continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
} }
} }
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result; return result;
} }
@ -3762,8 +3762,8 @@
var key = props[index]; var key = props[index];
var newValue = customizer var newValue = customizer
? customizer(object[key], source[key], key, object, source) ? customizer(object[key], source[key], key, object, source)
: undefined; : undefined;
if (newValue === undefined) { if (newValue === undefined) {
newValue = source[key]; newValue = source[key];
@ -3833,8 +3833,8 @@
guard = length > 2 ? sources[2] : undefined; guard = length > 2 ? sources[2] : undefined;
customizer = (assigner.length > 3 && typeof customizer == 'function') customizer = (assigner.length > 3 && typeof customizer == 'function')
? (length--, customizer) ? (length--, customizer)
: undefined; : undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) { if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer; customizer = length < 3 ? undefined : customizer;
@ -3980,14 +3980,14 @@
args[index] = arguments[index]; args[index] = arguments[index];
} }
var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
? [] ? []
: replaceHolders(args, placeholder); : replaceHolders(args, placeholder);
length -= holders.length; length -= holders.length;
if (length < arity) { if (length < arity) {
return createRecurry( return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, undefined, func, bitmask, createHybrid, wrapper.placeholder, undefined,
args, holders, undefined, undefined, arity - length); args, holders, undefined, undefined, arity - length);
} }
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return apply(fn, this, args); return apply(fn, this, args);
@ -4064,8 +4064,8 @@
if (isCurried && length < arity) { if (isCurried && length < arity) {
var newHolders = replaceHolders(args, placeholder); var newHolders = replaceHolders(args, placeholder);
return createRecurry( return createRecurry(
func, bitmask, createHybrid, wrapper.placeholder, thisArg, func, bitmask, createHybrid, wrapper.placeholder, thisArg,
args, newHolders, argPos, ary, arity - length args, newHolders, argPos, ary, arity - length
); );
} }
var thisBinding = isBind ? thisArg : this, var thisBinding = isBind ? thisArg : this,
@ -4277,8 +4277,8 @@
partials = newData[3]; partials = newData[3];
holders = newData[4]; holders = newData[4];
arity = newData[9] = newData[9] === undefined arity = newData[9] = newData[9] === undefined
? (isBindKey ? 0 : func.length) ? (isBindKey ? 0 : func.length)
: nativeMax(newData[9] - length, 0); : nativeMax(newData[9] - length, 0);
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
@ -4373,8 +4373,8 @@
if (customizer) { if (customizer) {
var compared = isPartial var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack) ? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack); : customizer(arrValue, othValue, index, array, other, stack);
} }
if (compared !== undefined) { if (compared !== undefined) {
if (compared) { if (compared) {
@ -4386,18 +4386,18 @@
// Recursively compare arrays (susceptible to call stack limits). // Recursively compare arrays (susceptible to call stack limits).
if (seen) { if (seen) {
if (!arraySome(other, function(othValue, othIndex) { if (!arraySome(other, function(othValue, othIndex) {
if (!cacheHas(seen, othIndex) && if (!cacheHas(seen, othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
return seen.push(othIndex); return seen.push(othIndex);
} }
})) { })) {
result = false; result = false;
break; break;
} }
} else if (!( } else if (!(
arrValue === othValue || arrValue === othValue ||
equalFunc(arrValue, othValue, bitmask, customizer, stack) equalFunc(arrValue, othValue, bitmask, customizer, stack)
)) { )) {
result = false; result = false;
break; break;
} }
@ -4536,14 +4536,14 @@
if (customizer) { if (customizer) {
var compared = isPartial var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack) ? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack); : customizer(objValue, othValue, key, object, other, stack);
} }
// Recursively compare objects (susceptible to call stack limits). // Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
: compared : compared
)) { )) {
result = false; result = false;
break; break;
} }
@ -4557,7 +4557,7 @@
if (objCtor != othCtor && if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) && ('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor && !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) { typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false; result = false;
} }
} }
@ -4656,8 +4656,8 @@
function getMapData(map, key) { function getMapData(map, key) {
var data = map.__data__; var data = map.__data__;
return isKeyable(key) return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash'] ? data[typeof key == 'string' ? 'string' : 'hash']
: data.map; : data.map;
} }
/** /**
@ -4854,7 +4854,7 @@
} }
length = object == null ? 0 : object.length; length = object == null ? 0 : object.length;
return !!length && isLength(length) && isIndex(key, length) && return !!length && isLength(length) && isIndex(key, length) &&
(isArray(object) || isArguments(object)); (isArray(object) || isArguments(object));
} }
/** /**
@ -4885,8 +4885,8 @@
*/ */
function initCloneObject(object) { function initCloneObject(object) {
return (typeof object.constructor == 'function' && !isPrototype(object)) return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototype(object)) ? baseCreate(getPrototype(object))
: {}; : {};
} }
/** /**
@ -4965,7 +4965,7 @@
*/ */
function isFlattenable(value) { function isFlattenable(value) {
return isArray(value) || isArguments(value) || return isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol]); !!(spreadableSymbol && value && value[spreadableSymbol]);
} }
/** /**
@ -4981,9 +4981,9 @@
length = length == null ? MAX_SAFE_INTEGER : length; length = length == null ? MAX_SAFE_INTEGER : length;
return !!length && return !!length &&
(type == 'number' || (type == 'number' ||
(type != 'symbol' && reIsUint.test(value))) && (type != 'symbol' && reIsUint.test(value))) &&
(value > -1 && value % 1 == 0 && value < length); (value > -1 && value % 1 == 0 && value < length);
} }
/** /**
@ -5002,9 +5002,9 @@
} }
var type = typeof index; var type = typeof index;
if (type == 'number' if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length)) ? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object) : (type == 'string' && index in object)
) { ) {
return eq(object[index], value); return eq(object[index], value);
} }
return false; return false;
@ -5028,7 +5028,7 @@
return true; return true;
} }
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
(object != null && value in Object(object)); (object != null && value in Object(object));
} }
/** /**
@ -5041,8 +5041,8 @@
function isKeyable(value) { function isKeyable(value) {
var type = typeof value; var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__') ? (value !== '__proto__')
: (value === null); : (value === null);
} }
/** /**
@ -5119,7 +5119,7 @@
return false; return false;
} }
return object[key] === srcValue && return object[key] === srcValue &&
(srcValue !== undefined || (key in Object(object))); (srcValue !== undefined || (key in Object(object)));
}; };
} }
@ -5166,9 +5166,9 @@
isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
var isCombo = var isCombo =
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
// Exit early if metadata can't be merged. // Exit early if metadata can't be merged.
if (!(isCommon || isCombo)) { if (!(isCommon || isCombo)) {
@ -5558,8 +5558,8 @@
*/ */
var difference = baseRest(function(array, values) { var difference = baseRest(function(array, values) {
return isArrayLikeObject(array) return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
: []; : [];
}); });
/** /**
@ -5687,8 +5687,8 @@
if (fromIndex !== undefined) { if (fromIndex !== undefined) {
index = toInteger(fromIndex); index = toInteger(fromIndex);
index = fromIndex < 0 index = fromIndex < 0
? nativeMax(length + index, 0) ? nativeMax(length + index, 0)
: nativeMin(index, length - 1); : nativeMin(index, length - 1);
} }
return baseFindIndex(array, baseIteratee(predicate, 3), index, true); return baseFindIndex(array, baseIteratee(predicate, 3), index, true);
} }
@ -5827,8 +5827,8 @@
var intersection = baseRest(function(arrays) { var intersection = baseRest(function(arrays) {
var mapped = arrayMap(arrays, castArrayLikeObject); var mapped = arrayMap(arrays, castArrayLikeObject);
return (mapped.length && mapped[0] === arrays[0]) return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped) ? baseIntersection(mapped)
: []; : [];
}); });
/** /**
@ -6103,8 +6103,8 @@
*/ */
var without = baseRest(function(array, values) { var without = baseRest(function(array, values) {
return isArrayLikeObject(array) return isArrayLikeObject(array)
? baseDifference(array, values) ? baseDifference(array, values)
: []; : [];
}); });
/** /**
@ -7174,8 +7174,8 @@
timeWaiting = wait - timeSinceLastCall; timeWaiting = wait - timeSinceLastCall;
return maxing return maxing
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
: timeWaiting; : timeWaiting;
} }
function shouldInvoke(time) { function shouldInvoke(time) {
@ -7186,7 +7186,7 @@
// trailing edge, the system time has gone backwards and we're treating // trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit. // it as the trailing edge, or we've hit the `maxWait` limit.
return (lastCallTime === undefined || (timeSinceLastCall >= wait) || return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
} }
function timerExpired() { function timerExpired() {
@ -7625,7 +7625,7 @@
*/ */
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee'); !propertyIsEnumerable.call(value, 'callee');
}; };
/** /**
@ -7730,7 +7730,7 @@
*/ */
function isBoolean(value) { function isBoolean(value) {
return value === true || value === false || return value === true || value === false ||
(isObjectLike(value) && baseGetTag(value) == boolTag); (isObjectLike(value) && baseGetTag(value) == boolTag);
} }
/** /**
@ -7810,7 +7810,7 @@
} }
if (isArrayLike(value) && if (isArrayLike(value) &&
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
isBuffer(value) || isTypedArray(value) || isArguments(value))) { isBuffer(value) || isTypedArray(value) || isArguments(value))) {
return !value.length; return !value.length;
} }
var tag = getTag(value); var tag = getTag(value);
@ -7945,7 +7945,7 @@
*/ */
function isLength(value) { function isLength(value) {
return typeof value == 'number' && return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
} }
/** /**
@ -8109,7 +8109,7 @@
*/ */
function isNumber(value) { function isNumber(value) {
return typeof value == 'number' || return typeof value == 'number' ||
(isObjectLike(value) && baseGetTag(value) == numberTag); (isObjectLike(value) && baseGetTag(value) == numberTag);
} }
/** /**
@ -8150,7 +8150,7 @@
} }
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
return typeof Ctor == 'function' && Ctor instanceof Ctor && return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString; funcToString.call(Ctor) == objectCtorString;
} }
/** /**
@ -8210,7 +8210,7 @@
*/ */
function isString(value) { function isString(value) {
return typeof value == 'string' || return typeof value == 'string' ||
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
} }
/** /**
@ -8232,7 +8232,7 @@
*/ */
function isSymbol(value) { function isSymbol(value) {
return typeof value == 'symbol' || return typeof value == 'symbol' ||
(isObjectLike(value) && baseGetTag(value) == symbolTag); (isObjectLike(value) && baseGetTag(value) == symbolTag);
} }
/** /**
@ -8422,8 +8422,8 @@
value = value.replace(reTrim, ''); value = value.replace(reTrim, '');
var isBinary = reIsBinary.test(value); var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value)) return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8) ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
: (reIsBadHex.test(value) ? NAN : +value); : (reIsBadHex.test(value) ? NAN : +value);
} }
/** /**
@ -9334,8 +9334,8 @@
function escape(string) { function escape(string) {
string = toString(string); string = toString(string);
return (string && reHasUnescapedHtml.test(string)) return (string && reHasUnescapedHtml.test(string))
? string.replace(reUnescapedHtml, escapeHtmlChar) ? string.replace(reUnescapedHtml, escapeHtmlChar)
: string; : string;
} }
/** /**
@ -9761,8 +9761,8 @@
*/ */
function max(array) { function max(array) {
return (array && array.length) return (array && array.length)
? baseExtremum(array, identity, baseGt) ? baseExtremum(array, identity, baseGt)
: undefined; : undefined;
} }
/** /**
@ -9785,8 +9785,8 @@
*/ */
function min(array) { function min(array) {
return (array && array.length) return (array && array.length)
? baseExtremum(array, identity, baseLt) ? baseExtremum(array, identity, baseLt)
: undefined; : undefined;
} }
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
@ -9932,8 +9932,8 @@
n = n === undefined ? 1 : nativeMax(toInteger(n), 0); n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
var result = (this.__filtered__ && !index) var result = (this.__filtered__ && !index)
? new LazyWrapper(this) ? new LazyWrapper(this)
: this.clone(); : this.clone();
if (result.__filtered__) { if (result.__filtered__) {
result.__takeCount__ = nativeMin(n, result.__takeCount__); result.__takeCount__ = nativeMin(n, result.__takeCount__);

8
src/core/platform/web/dom.js

@ -125,14 +125,16 @@
var canvas = document.createElement("canvas"); var canvas = document.createElement("canvas");
var ratio = 2; var ratio = 2;
BI.Widget._renderEngine.createElement("body").append(canvas); BI.Widget._renderEngine.createElement("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 12) + 4;
var ctx = canvas.getContext("2d");
ctx.font = "12px Georgia";
var w = ctx.measureText(param).width + 4;
canvas.width = w * ratio; canvas.width = w * ratio;
canvas.height = 16 * ratio; canvas.height = 16 * ratio;
var ctx = canvas.getContext("2d");
// ctx.fillStyle = "#EAF2FD";
ctx.font = 12 * ratio + "px Georgia"; ctx.font = 12 * ratio + "px Georgia";
ctx.fillStyle = fillStyle || "#3685f2"; ctx.fillStyle = fillStyle || "#3685f2";
ctx.textBaseline = "middle"; ctx.textBaseline = "middle";
// ctx.fillStyle = "#EAF2FD";
ctx.fillText(param, 2 * ratio, 9 * ratio); ctx.fillText(param, 2 * ratio, 9 * ratio);
BI.Widget._renderEngine.createElement(canvas).destroy(); BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)"; var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)";

2
src/widget/downlist/combo.downlist.js

@ -48,7 +48,7 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
stopPropagation: o.stopPropagation, stopPropagation: o.stopPropagation,
el: BI.createWidget(o.el, { el: BI.createWidget(o.el, {
type: "bi.icon_trigger", type: "bi.icon_trigger",
extraCls: o.iconCls ? o.iconCls : "", extraCls: o.iconCls,
width: o.width, width: o.width,
height: o.height height: o.height
}), }),

13
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -16,7 +16,9 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
attributes: { attributes: {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false allowEdit: false,
allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -96,6 +98,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_select_tree_trigger", type: "bi.multilayer_select_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-select-tree-trigger", cls: "multilayer-select-tree-trigger",
ref: function (_ref) { ref: function (_ref) {
@ -133,6 +137,13 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {

92
src/widget/multilayerselecttree/multilayerselecttree.insert.search.pane.js

@ -0,0 +1,92 @@
/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSelectTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSelectTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-select-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_insert_search_pane", BI.MultiLayerSelectTreeInsertSearchPane);

90
src/widget/multilayerselecttree/multilayerselecttree.trigger.js

@ -19,7 +19,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items)))); this.tree.initTree(BI.Tree.treeFormat(o.items));
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -60,22 +60,31 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_select_tree_popup", type: o.allowInsertValue ? "bi.multilayer_select_tree_insert_search_pane" : "bi.multilayer_select_tree_popup",
itemsCreator: function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
}, },
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword); callback(self._getSearchItems(keyword));
var matched = finding.match, find = finding.find; o.allowInsertValue && self.popup.setKeyword(keyword);
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else { } else {
callback(); callback();
} }
@ -117,32 +126,70 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_getSearchItems: function(keyword) {
var o = this.options;
var findingText = BI.Func.getSearchResult(o.items, keyword, "text");
var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []};
var textItems = findingText.find.concat(findingText.match);
var valueItems = findingValue.find.concat(findingValue.match);
return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id"));
},
_createJson: function(node, open) {
return {
id: node.id,
pId: node.pId,
text: node.text,
value: node.value,
isParent: BI.isNotEmptyArray(node.children),
open: open
}
},
_getChildren: function(node) {
var self = this;
node.children = node.children || [];
var nodes = [];
BI.each(node.children, function (idx, child) {
var children = self._getChildren(child);
nodes = nodes.concat(children);
});
return node.children.concat(nodes);
},
// 将搜索到的节点进行补充,构造成一棵完整的树 // 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) { _fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id"); var self = this;
var queue = leaves.reverse() || []; var result = [];
var queue = [];
BI.each(leaves, function (idx, node) {
queue.push({pId: node.pId});
result.push(node);
result = result.concat(self._getChildren(node));
});
while (BI.isNotEmptyArray(queue)) { while (BI.isNotEmptyArray(queue)) {
var node = queue.pop(); var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id"); var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) { if (pNode != null) {
queue.push(pNode); pNode.open = true;
result.push(pNode.id); queue.push({pId: pNode.pId});
result.push(pNode);
} }
} }
var nodes = []; return BI.uniqBy(BI.map(result, function (idx, node) {
BI.each(this.options.items, function (idx, item) { return self._createJson(node, node.open);
if(BI.contains(result, item.id)) { }), "id");
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
}, },
_digest: function (v) { _digest: function (v) {
var o = this.options; var o = this.options;
return o.valueFormatter(v) || o.text; if(o.itemsCreator === BI.emptyFn) {
var result = BI.find(o.items, function (i, item) {
return item.value === v;
});
return BI.isNotNull(result) ? result.text : o.text;
}
return o.valueFormatter(v);
}, },
stopEditing: function () { stopEditing: function () {
@ -172,4 +219,5 @@ BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger); BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);

13
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -19,7 +19,9 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
attributes: { attributes: {
tabIndex: 0 tabIndex: 0
}, },
allowEdit: false allowEdit: false,
allowSearchValue: false,
allowInsertValue: false
}); });
}, },
@ -99,6 +101,8 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
return { return {
el: { el: {
type: "bi.multilayer_single_tree_trigger", type: "bi.multilayer_single_tree_trigger",
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
cls: "multilayer-single-tree-trigger", cls: "multilayer-single-tree-trigger",
ref: function (_ref) { ref: function (_ref) {
@ -136,6 +140,13 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
action: function () { action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING);
} }
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,
action: function () {
var value = self.trigger.getSearcher().getKeyword();
self.combo.setValue(value);
self.combo.hideView();
}
}] }]
}, },
hideChecker: function (e) { hideChecker: function (e) {

92
src/widget/multilayersingletree/multilayersingletree.insert.search.pane.js

@ -0,0 +1,92 @@
/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSingleTreeInsertSearchPane
* @extends BI.Pane
*/
BI.MultiLayerSingleTreeInsertSearchPane = BI.inherit(BI.Widget, {
props: function() {
return {
baseCls: "bi-multilayer-single-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: ""
};
},
render: function() {
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
o.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
});
},
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.MultiLayerSelectLevelTree.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE);
}
}]
});
return {
type: "bi.vertical",
scrolly: false,
scrollable: true,
vgap: 5,
items: [{
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: 24,
cls: "bi-high-light",
hgap: 5,
ref: function (_ref) {
self.addNotMatchTip = _ref;
},
handler: function () {
self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM, o.keywordGetter());
}
}, this.tree]
};
},
setKeyword: function (keyword) {
var showTip = BI.isEmptyArray(this.tree.getAllLeaves());
this.addNotMatchTip.setVisible(showTip);
showTip && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
this.tree.populate(items);
}
});
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_insert_search_pane", BI.MultiLayerSingleTreeInsertSearchPane);

83
src/widget/multilayersingletree/multilayersingletree.trigger.js

@ -11,7 +11,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
return v; return v;
}, },
itemsCreator: BI.emptyFn, itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search") watermark: BI.i18nText("BI-Basic_Search"),
allowSearchValue: false
}; };
}, },
@ -19,7 +20,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
var self = this, o = this.options; var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
this.tree = new BI.Tree(); this.tree = new BI.Tree();
this.tree.initTree(BI.deepClone(BI.Tree.treeFormat(BI.deepClone(o.items)))); this.tree.initTree(BI.Tree.treeFormat(o.items));
} }
var content = { var content = {
type: "bi.htape", type: "bi.htape",
@ -60,7 +61,7 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}] }]
}, },
popup: { popup: {
type: "bi.multilayer_single_tree_popup", type: o.allowInsertValue ? "bi.multilayer_single_tree_insert_search_pane" : "bi.multilayer_single_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) { itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue(); op.keyword = self.editor.getValue();
o.itemsCreator(op, callback); o.itemsCreator(op, callback);
@ -68,14 +69,23 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
keywordGetter: function () { keywordGetter: function () {
return self.editor.getValue(); return self.editor.getValue();
}, },
cls: "bi-card" cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,
action: function () {
self.options.text = self.getSearcher().getKeyword();
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM);
}
}],
ref: function (_ref) {
self.popup = _ref;
}
}, },
onSearch: function (obj, callback) { onSearch: function (obj, callback) {
var keyword = obj.keyword; var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) { if(o.itemsCreator === BI.emptyFn) {
var finding = BI.Func.getSearchResult(o.items, keyword); callback(self._getSearchItems(keyword));
var matched = finding.match, find = finding.find; o.allowInsertValue && self.popup.setKeyword(keyword);
callback(self._fillTreeStructure4Search(find.concat(matched)));
} else { } else {
callback(); callback();
} }
@ -117,27 +127,59 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
}; };
}, },
_getSearchItems: function(keyword) {
var o = this.options;
var findingText = BI.Func.getSearchResult(o.items, keyword, "text");
var findingValue = o.allowSearchValue ? BI.Func.getSearchResult(o.items, keyword, "value") : {find: [], match: []};
var textItems = findingText.find.concat(findingText.match);
var valueItems = findingValue.find.concat(findingValue.match);
return this._fillTreeStructure4Search(BI.uniqBy(textItems.concat(valueItems), "id"));
},
_createJson: function(node, open) {
return {
id: node.id,
pId: node.pId,
text: node.text,
value: node.value,
isParent: BI.isNotEmptyArray(node.children),
open: open
}
},
_getChildren: function(node) {
var self = this;
node.children = node.children || [];
var nodes = [];
BI.each(node.children, function (idx, child) {
var children = self._getChildren(child);
nodes = nodes.concat(children);
});
return node.children.concat(nodes);
},
// 将搜索到的节点进行补充,构造成一棵完整的树 // 将搜索到的节点进行补充,构造成一棵完整的树
_fillTreeStructure4Search: function (leaves) { _fillTreeStructure4Search: function (leaves) {
var result = BI.map(leaves, "id"); var self = this;
var queue = leaves.reverse() || []; var result = [];
var queue = [];
BI.each(leaves, function (idx, node) {
queue.push({pId: node.pId});
result.push(node);
result = result.concat(self._getChildren(node));
});
while (BI.isNotEmptyArray(queue)) { while (BI.isNotEmptyArray(queue)) {
var node = queue.pop(); var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id"); var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) { if (pNode != null) {
queue.push(pNode); pNode.open = true;
result.push(pNode.id); queue.push({pId: pNode.pId});
result.push(pNode);
} }
} }
var nodes = []; return BI.uniqBy(BI.map(result, function (idx, node) {
BI.each(this.options.items, function (idx, item) { return self._createJson(node, node.open);
if(BI.contains(result, item.id)) { }), "id");
nodes.push(BI.extend({}, item, {
open: true
}))
}
});
return nodes;
}, },
_digest: function (v) { _digest: function (v) {
@ -178,4 +220,5 @@ BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START"; BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger); BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);

2
src/widget/multitree/multi.tree.combo.js

@ -189,7 +189,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: checked ? this.getValue() : {} value: checked ? this.getValue() : {}
}; };
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getSearcher().setState(val);
this.getCounter().setButtonChecked(val); this.getCounter().setButtonChecked(val);
self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM); self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM);
}); });

2
src/widget/multitree/multi.tree.insert.combo.js

@ -206,7 +206,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: checked ? this.getValue() : {} value: checked ? this.getValue() : {}
}; };
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getSearcher().setState(val);
this.getCounter().setButtonChecked(val); this.getCounter().setButtonChecked(val);
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue()); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue());
}); });

2
src/widget/multitree/multi.tree.list.combo.js

@ -214,7 +214,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: checked ? this.getValue() : {} value: checked ? this.getValue() : {}
}; };
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getSearcher().setState(val);
this.getCounter().setButtonChecked(val); this.getCounter().setButtonChecked(val);
self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue()); self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue());
}); });

3
src/widget/numbereditor/number.editor.js

@ -31,11 +31,10 @@ BI.NumberEditor = BI.inherit(BI.Widget, {
errorText: o.errorText errorText: o.errorText
}); });
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () { this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
o.value = BI.parseFloat(this.getValue());
self.fireEvent(BI.NumberEditor.EVENT_CHANGE); self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
}); });
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () { this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
this.setValue(BI.parseFloat(this.getValue())); o.value = BI.parseFloat(this.getValue());
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM); self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
}); });
this.topBtn = BI.createWidget({ this.topBtn = BI.createWidget({

4
src/widget/selecttree/selecttree.expander.js

@ -48,6 +48,10 @@ BI.SelectTreeExpander = BI.inherit(BI.Widget, {
}); });
}, },
getAllLeaves: function () {
return this.expander.getAllLeaves();
},
setValue: function (v) { setValue: function (v) {
if (BI.contains(v, this.trigger.getValue())) { if (BI.contains(v, this.trigger.getValue())) {
this.trigger.setSelected(true); this.trigger.setSelected(true);

Loading…
Cancel
Save