fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

111101 lines
3.7 MiB

/*! time: 2020-7-3 12:02:09 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1076);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(1);
var core = __webpack_require__(7);
var hide = __webpack_require__(15);
var redefine = __webpack_require__(11);
var ctx = __webpack_require__(18);
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
var key, own, out, exp;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
// export native or passed
out = (own ? target : source)[key];
// bind timers to global for call from export context
exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// extend global
if (target) redefine(target, key, out, type & $export.U);
// export
if (exports[key] != out) hide(exports, key, exp);
if (IS_PROTO && expProto[key] != out) expProto[key] = out;
}
};
global.core = core;
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/* 1 */
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/* 2 */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(4);
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/* 4 */
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__(53)('wks');
var uid = __webpack_require__(30);
var Symbol = __webpack_require__(1).Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__(20);
var min = Math.min;
module.exports = function (it) {
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ }),
/* 7 */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.6.11' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(2)(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(3);
var IE8_DOM_DEFINE = __webpack_require__(268);
var toPrimitive = __webpack_require__(27);
var dP = Object.defineProperty;
exports.f = __webpack_require__(8) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__(25);
module.exports = function (it) {
return Object(defined(it));
};
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(1);
var hide = __webpack_require__(15);
var has = __webpack_require__(14);
var SRC = __webpack_require__(30)('src');
var $toString = __webpack_require__(755);
var TO_STRING = 'toString';
var TPL = ('' + $toString).split(TO_STRING);
__webpack_require__(7).inspectSource = function (it) {
return $toString.call(it);
};
(module.exports = function (O, key, val, safe) {
var isFunction = typeof val == 'function';
if (isFunction) has(val, 'name') || hide(val, 'name', key);
if (O[key] === val) return;
if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
if (O === global) {
O[key] = val;
} else if (!safe) {
delete O[key];
hide(O, key, val);
} else if (O[key]) {
O[key] = val;
} else {
hide(O, key, val);
}
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(Function.prototype, TO_STRING, function toString() {
return typeof this == 'function' && this[SRC] || $toString.call(this);
});
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
var fails = __webpack_require__(2);
var defined = __webpack_require__(25);
var quot = /"/g;
// B.2.3.2.1 CreateHTML(string, tag, attribute, value)
var createHTML = function (string, tag, attribute, value) {
var S = String(defined(string));
var p1 = '<' + tag;
if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '&quot;') + '"';
return p1 + '>' + S + '</' + tag + '>';
};
module.exports = function (NAME, exec) {
var O = {};
O[NAME] = exec(createHTML);
$export($export.P + $export.F * fails(function () {
var test = ''[NAME]('"');
return test !== test.toLowerCase() || test.split('"').length > 3;
}), 'String', O);
};
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var g; // This works in non-strict mode
g = function () {
return this;
}();
try {
// This works if eval is allowed (see CSP)
g = g || new Function("return this")();
} catch (e) {
// This works if the window reference is available
if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window;
} // g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 14 */
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(9);
var createDesc = __webpack_require__(29);
module.exports = __webpack_require__(8) ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(46);
var defined = __webpack_require__(25);
module.exports = function (it) {
return IObject(defined(it));
};
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var fails = __webpack_require__(2);
module.exports = function (method, arg) {
return !!method && fails(function () {
// eslint-disable-next-line no-useless-call
arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
});
};
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__(19);
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
/***/ }),
/* 19 */
/***/ (function(module, exports) {
module.exports = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
/***/ }),
/* 20 */
/***/ (function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
var pIE = __webpack_require__(47);
var createDesc = __webpack_require__(29);
var toIObject = __webpack_require__(16);
var toPrimitive = __webpack_require__(27);
var has = __webpack_require__(14);
var IE8_DOM_DEFINE = __webpack_require__(268);
var gOPD = Object.getOwnPropertyDescriptor;
exports.f = __webpack_require__(8) ? gOPD : function getOwnPropertyDescriptor(O, P) {
O = toIObject(O);
P = toPrimitive(P, true);
if (IE8_DOM_DEFINE) try {
return gOPD(O, P);
} catch (e) { /* empty */ }
if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
};
/***/ }),
/* 22 */
/***/ (function(module, exports, __webpack_require__) {
// most Object methods by ES6 should accept primitives
var $export = __webpack_require__(0);
var core = __webpack_require__(7);
var fails = __webpack_require__(2);
module.exports = function (KEY, exec) {
var fn = (core.Object || {})[KEY] || Object[KEY];
var exp = {};
exp[KEY] = exec(fn);
$export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
};
/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {
// 0 -> Array#forEach
// 1 -> Array#map
// 2 -> Array#filter
// 3 -> Array#some
// 4 -> Array#every
// 5 -> Array#find
// 6 -> Array#findIndex
var ctx = __webpack_require__(18);
var IObject = __webpack_require__(46);
var toObject = __webpack_require__(10);
var toLength = __webpack_require__(6);
var asc = __webpack_require__(284);
module.exports = function (TYPE, $create) {
var IS_MAP = TYPE == 1;
var IS_FILTER = TYPE == 2;
var IS_SOME = TYPE == 3;
var IS_EVERY = TYPE == 4;
var IS_FIND_INDEX = TYPE == 6;
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
var create = $create || asc;
return function ($this, callbackfn, that) {
var O = toObject($this);
var self = IObject(O);
var f = ctx(callbackfn, that, 3);
var length = toLength(self.length);
var index = 0;
var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
var val, res;
for (;length > index; index++) if (NO_HOLES || index in self) {
val = self[index];
res = f(val, index, O);
if (TYPE) {
if (IS_MAP) result[index] = res; // map
else if (res) switch (TYPE) {
case 3: return true; // some
case 5: return val; // find
case 6: return index; // findIndex
case 2: result.push(val); // filter
} else if (IS_EVERY) return false; // every
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
};
};
/***/ }),
/* 24 */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
/***/ }),
/* 25 */
/***/ (function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/* 26 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
if (__webpack_require__(8)) {
var LIBRARY = __webpack_require__(31);
var global = __webpack_require__(1);
var fails = __webpack_require__(2);
var $export = __webpack_require__(0);
var $typed = __webpack_require__(64);
var $buffer = __webpack_require__(94);
var ctx = __webpack_require__(18);
var anInstance = __webpack_require__(43);
var propertyDesc = __webpack_require__(29);
var hide = __webpack_require__(15);
var redefineAll = __webpack_require__(44);
var toInteger = __webpack_require__(20);
var toLength = __webpack_require__(6);
var toIndex = __webpack_require__(295);
var toAbsoluteIndex = __webpack_require__(33);
var toPrimitive = __webpack_require__(27);
var has = __webpack_require__(14);
var classof = __webpack_require__(48);
var isObject = __webpack_require__(4);
var toObject = __webpack_require__(10);
var isArrayIter = __webpack_require__(86);
var create = __webpack_require__(34);
var getPrototypeOf = __webpack_require__(36);
var gOPN = __webpack_require__(35).f;
var getIterFn = __webpack_require__(88);
var uid = __webpack_require__(30);
var wks = __webpack_require__(5);
var createArrayMethod = __webpack_require__(23);
var createArrayIncludes = __webpack_require__(54);
var speciesConstructor = __webpack_require__(49);
var ArrayIterators = __webpack_require__(90);
var Iterators = __webpack_require__(41);
var $iterDetect = __webpack_require__(57);
var setSpecies = __webpack_require__(42);
var arrayFill = __webpack_require__(89);
var arrayCopyWithin = __webpack_require__(286);
var $DP = __webpack_require__(9);
var $GOPD = __webpack_require__(21);
var dP = $DP.f;
var gOPD = $GOPD.f;
var RangeError = global.RangeError;
var TypeError = global.TypeError;
var Uint8Array = global.Uint8Array;
var ARRAY_BUFFER = 'ArrayBuffer';
var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;
var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
var PROTOTYPE = 'prototype';
var ArrayProto = Array[PROTOTYPE];
var $ArrayBuffer = $buffer.ArrayBuffer;
var $DataView = $buffer.DataView;
var arrayForEach = createArrayMethod(0);
var arrayFilter = createArrayMethod(2);
var arraySome = createArrayMethod(3);
var arrayEvery = createArrayMethod(4);
var arrayFind = createArrayMethod(5);
var arrayFindIndex = createArrayMethod(6);
var arrayIncludes = createArrayIncludes(true);
var arrayIndexOf = createArrayIncludes(false);
var arrayValues = ArrayIterators.values;
var arrayKeys = ArrayIterators.keys;
var arrayEntries = ArrayIterators.entries;
var arrayLastIndexOf = ArrayProto.lastIndexOf;
var arrayReduce = ArrayProto.reduce;
var arrayReduceRight = ArrayProto.reduceRight;
var arrayJoin = ArrayProto.join;
var arraySort = ArrayProto.sort;
var arraySlice = ArrayProto.slice;
var arrayToString = ArrayProto.toString;
var arrayToLocaleString = ArrayProto.toLocaleString;
var ITERATOR = wks('iterator');
var TAG = wks('toStringTag');
var TYPED_CONSTRUCTOR = uid('typed_constructor');
var DEF_CONSTRUCTOR = uid('def_constructor');
var ALL_CONSTRUCTORS = $typed.CONSTR;
var TYPED_ARRAY = $typed.TYPED;
var VIEW = $typed.VIEW;
var WRONG_LENGTH = 'Wrong length!';
var $map = createArrayMethod(1, function (O, length) {
return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
});
var LITTLE_ENDIAN = fails(function () {
// eslint-disable-next-line no-undef
return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
});
var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {
new Uint8Array(1).set({});
});
var toOffset = function (it, BYTES) {
var offset = toInteger(it);
if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');
return offset;
};
var validate = function (it) {
if (isObject(it) && TYPED_ARRAY in it) return it;
throw TypeError(it + ' is not a typed array!');
};
var allocate = function (C, length) {
if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {
throw TypeError('It is not a typed array constructor!');
} return new C(length);
};
var speciesFromList = function (O, list) {
return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
};
var fromList = function (C, list) {
var index = 0;
var length = list.length;
var result = allocate(C, length);
while (length > index) result[index] = list[index++];
return result;
};
var addGetter = function (it, key, internal) {
dP(it, key, { get: function () { return this._d[internal]; } });
};
var $from = function from(source /* , mapfn, thisArg */) {
var O = toObject(source);
var aLen = arguments.length;
var mapfn = aLen > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var iterFn = getIterFn(O);
var i, length, values, result, step, iterator;
if (iterFn != undefined && !isArrayIter(iterFn)) {
for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {
values.push(step.value);
} O = values;
}
if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);
for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {
result[i] = mapping ? mapfn(O[i], i) : O[i];
}
return result;
};
var $of = function of(/* ...items */) {
var index = 0;
var length = arguments.length;
var result = allocate(this, length);
while (length > index) result[index] = arguments[index++];
return result;
};
// iOS Safari 6.x fails here
var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });
var $toLocaleString = function toLocaleString() {
return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
};
var proto = {
copyWithin: function copyWithin(target, start /* , end */) {
return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
},
every: function every(callbackfn /* , thisArg */) {
return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars
return arrayFill.apply(validate(this), arguments);
},
filter: function filter(callbackfn /* , thisArg */) {
return speciesFromList(this, arrayFilter(validate(this), callbackfn,
arguments.length > 1 ? arguments[1] : undefined));
},
find: function find(predicate /* , thisArg */) {
return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
},
findIndex: function findIndex(predicate /* , thisArg */) {
return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
},
forEach: function forEach(callbackfn /* , thisArg */) {
arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
indexOf: function indexOf(searchElement /* , fromIndex */) {
return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
},
includes: function includes(searchElement /* , fromIndex */) {
return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
},
join: function join(separator) { // eslint-disable-line no-unused-vars
return arrayJoin.apply(validate(this), arguments);
},
lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars
return arrayLastIndexOf.apply(validate(this), arguments);
},
map: function map(mapfn /* , thisArg */) {
return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
},
reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
return arrayReduce.apply(validate(this), arguments);
},
reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
return arrayReduceRight.apply(validate(this), arguments);
},
reverse: function reverse() {
var that = this;
var length = validate(that).length;
var middle = Math.floor(length / 2);
var index = 0;
var value;
while (index < middle) {
value = that[index];
that[index++] = that[--length];
that[length] = value;
} return that;
},
some: function some(callbackfn /* , thisArg */) {
return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
},
sort: function sort(comparefn) {
return arraySort.call(validate(this), comparefn);
},
subarray: function subarray(begin, end) {
var O = validate(this);
var length = O.length;
var $begin = toAbsoluteIndex(begin, length);
return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
O.buffer,
O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)
);
}
};
var $slice = function slice(start, end) {
return speciesFromList(this, arraySlice.call(validate(this), start, end));
};
var $set = function set(arrayLike /* , offset */) {
validate(this);
var offset = toOffset(arguments[1], 1);
var length = this.length;
var src = toObject(arrayLike);
var len = toLength(src.length);
var index = 0;
if (len + offset > length) throw RangeError(WRONG_LENGTH);
while (index < len) this[offset + index] = src[index++];
};
var $iterators = {
entries: function entries() {
return arrayEntries.call(validate(this));
},
keys: function keys() {
return arrayKeys.call(validate(this));
},
values: function values() {
return arrayValues.call(validate(this));
}
};
var isTAIndex = function (target, key) {
return isObject(target)
&& target[TYPED_ARRAY]
&& typeof key != 'symbol'
&& key in target
&& String(+key) == String(key);
};
var $getDesc = function getOwnPropertyDescriptor(target, key) {
return isTAIndex(target, key = toPrimitive(key, true))
? propertyDesc(2, target[key])
: gOPD(target, key);
};
var $setDesc = function defineProperty(target, key, desc) {
if (isTAIndex(target, key = toPrimitive(key, true))
&& isObject(desc)
&& has(desc, 'value')
&& !has(desc, 'get')
&& !has(desc, 'set')
// TODO: add validation descriptor w/o calling accessors
&& !desc.configurable
&& (!has(desc, 'writable') || desc.writable)
&& (!has(desc, 'enumerable') || desc.enumerable)
) {
target[key] = desc.value;
return target;
} return dP(target, key, desc);
};
if (!ALL_CONSTRUCTORS) {
$GOPD.f = $getDesc;
$DP.f = $setDesc;
}
$export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
getOwnPropertyDescriptor: $getDesc,
defineProperty: $setDesc
});
if (fails(function () { arrayToString.call({}); })) {
arrayToString = arrayToLocaleString = function toString() {
return arrayJoin.call(this);
};
}
var $TypedArrayPrototype$ = redefineAll({}, proto);
redefineAll($TypedArrayPrototype$, $iterators);
hide($TypedArrayPrototype$, ITERATOR, $iterators.values);
redefineAll($TypedArrayPrototype$, {
slice: $slice,
set: $set,
constructor: function () { /* noop */ },
toString: arrayToString,
toLocaleString: $toLocaleString
});
addGetter($TypedArrayPrototype$, 'buffer', 'b');
addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
addGetter($TypedArrayPrototype$, 'byteLength', 'l');
addGetter($TypedArrayPrototype$, 'length', 'e');
dP($TypedArrayPrototype$, TAG, {
get: function () { return this[TYPED_ARRAY]; }
});
// eslint-disable-next-line max-statements
module.exports = function (KEY, BYTES, wrapper, CLAMPED) {
CLAMPED = !!CLAMPED;
var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';
var GETTER = 'get' + KEY;
var SETTER = 'set' + KEY;
var TypedArray = global[NAME];
var Base = TypedArray || {};
var TAC = TypedArray && getPrototypeOf(TypedArray);
var FORCED = !TypedArray || !$typed.ABV;
var O = {};
var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
var getter = function (that, index) {
var data = that._d;
return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
};
var setter = function (that, index, value) {
var data = that._d;
if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
};
var addElement = function (that, index) {
dP(that, index, {
get: function () {
return getter(this, index);
},
set: function (value) {
return setter(this, index, value);
},
enumerable: true
});
};
if (FORCED) {
TypedArray = wrapper(function (that, data, $offset, $length) {
anInstance(that, TypedArray, NAME, '_d');
var index = 0;
var offset = 0;
var buffer, byteLength, length, klass;
if (!isObject(data)) {
length = toIndex(data);
byteLength = length * BYTES;
buffer = new $ArrayBuffer(byteLength);
} else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
buffer = data;
offset = toOffset($offset, BYTES);
var $len = data.byteLength;
if ($length === undefined) {
if ($len % BYTES) throw RangeError(WRONG_LENGTH);
byteLength = $len - offset;
if (byteLength < 0) throw RangeError(WRONG_LENGTH);
} else {
byteLength = toLength($length) * BYTES;
if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);
}
length = byteLength / BYTES;
} else if (TYPED_ARRAY in data) {
return fromList(TypedArray, data);
} else {
return $from.call(TypedArray, data);
}
hide(that, '_d', {
b: buffer,
o: offset,
l: byteLength,
e: length,
v: new $DataView(buffer)
});
while (index < length) addElement(that, index++);
});
TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
hide(TypedArrayPrototype, 'constructor', TypedArray);
} else if (!fails(function () {
TypedArray(1);
}) || !fails(function () {
new TypedArray(-1); // eslint-disable-line no-new
}) || !$iterDetect(function (iter) {
new TypedArray(); // eslint-disable-line no-new
new TypedArray(null); // eslint-disable-line no-new
new TypedArray(1.5); // eslint-disable-line no-new
new TypedArray(iter); // eslint-disable-line no-new
}, true)) {
TypedArray = wrapper(function (that, data, $offset, $length) {
anInstance(that, TypedArray, NAME);
var klass;
// `ws` module bug, temporarily remove validation length for Uint8Array
// https://github.com/websockets/ws/pull/645
if (!isObject(data)) return new Base(toIndex(data));
if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
return $length !== undefined
? new Base(data, toOffset($offset, BYTES), $length)
: $offset !== undefined
? new Base(data, toOffset($offset, BYTES))
: new Base(data);
}
if (TYPED_ARRAY in data) return fromList(TypedArray, data);
return $from.call(TypedArray, data);
});
arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {
if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);
});
TypedArray[PROTOTYPE] = TypedArrayPrototype;
if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;
}
var $nativeIterator = TypedArrayPrototype[ITERATOR];
var CORRECT_ITER_NAME = !!$nativeIterator
&& ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);
var $iterator = $iterators.values;
hide(TypedArray, TYPED_CONSTRUCTOR, true);
hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
hide(TypedArrayPrototype, VIEW, true);
hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);
if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {
dP(TypedArrayPrototype, TAG, {
get: function () { return NAME; }
});
}
O[NAME] = TypedArray;
$export($export.G + $export.W + $export.F * (TypedArray != Base), O);
$export($export.S, NAME, {
BYTES_PER_ELEMENT: BYTES
});
$export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {
from: $from,
of: $of
});
if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);
$export($export.P, NAME, proto);
setSpecies(NAME);
$export($export.P + $export.F * FORCED_SET, NAME, { set: $set });
$export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);
if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;
$export($export.P + $export.F * fails(function () {
new TypedArray(1).slice();
}), NAME, { slice: $slice });
$export($export.P + $export.F * (fails(function () {
return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();
}) || !fails(function () {
TypedArrayPrototype.toLocaleString.call([1, 2]);
})), NAME, { toLocaleString: $toLocaleString });
Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);
};
} else module.exports = function () { /* empty */ };
/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(4);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
if (!isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {
var META = __webpack_require__(30)('meta');
var isObject = __webpack_require__(4);
var has = __webpack_require__(14);
var setDesc = __webpack_require__(9).f;
var id = 0;
var isExtensible = Object.isExtensible || function () {
return true;
};
var FREEZE = !__webpack_require__(2)(function () {
return isExtensible(Object.preventExtensions({}));
});
var setMeta = function (it) {
setDesc(it, META, { value: {
i: 'O' + ++id, // object ID
w: {} // weak collections IDs
} });
};
var fastKey = function (it, create) {
// return primitive with prefix
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
if (!has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return 'F';
// not necessary to add metadata
if (!create) return 'E';
// add missing metadata
setMeta(it);
// return object ID
} return it[META].i;
};
var getWeak = function (it, create) {
if (!has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return true;
// not necessary to add metadata
if (!create) return false;
// add missing metadata
setMeta(it);
// return hash weak collections IDs
} return it[META].w;
};
// add metadata on freeze-family methods calling
var onFreeze = function (it) {
if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
return it;
};
var meta = module.exports = {
KEY: META,
NEED: false,
fastKey: fastKey,
getWeak: getWeak,
onFreeze: onFreeze
};
/***/ }),
/* 29 */
/***/ (function(module, exports) {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
/***/ }),
/* 30 */
/***/ (function(module, exports) {
var id = 0;
var px = Math.random();
module.exports = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ }),
/* 31 */
/***/ (function(module, exports) {
module.exports = false;
/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(270);
var enumBugKeys = __webpack_require__(73);
module.exports = Object.keys || function keys(O) {
return $keys(O, enumBugKeys);
};
/***/ }),
/* 33 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(20);
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
/***/ }),
/* 34 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__(3);
var dPs = __webpack_require__(271);
var enumBugKeys = __webpack_require__(73);
var IE_PROTO = __webpack_require__(72)('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__(70)('iframe');
var i = enumBugKeys.length;
var lt = '<';
var gt = '>';
var iframeDocument;
iframe.style.display = 'none';
__webpack_require__(74).appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
return createDict();
};
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
Empty[PROTOTYPE] = anObject(O);
result = new Empty();
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
/***/ }),
/* 35 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
var $keys = __webpack_require__(270);
var hiddenKeys = __webpack_require__(73).concat('length', 'prototype');
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
return $keys(O, hiddenKeys);
};
/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__(14);
var toObject = __webpack_require__(10);
var IE_PROTO = __webpack_require__(72)('IE_PROTO');
var ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function (O) {
O = toObject(O);
if (has(O, IE_PROTO)) return O[IE_PROTO];
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.31 Array.prototype[@@unscopables]
var UNSCOPABLES = __webpack_require__(5)('unscopables');
var ArrayProto = Array.prototype;
if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(15)(ArrayProto, UNSCOPABLES, {});
module.exports = function (key) {
ArrayProto[UNSCOPABLES][key] = true;
};
/***/ }),
/* 38 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(4);
module.exports = function (it, TYPE) {
if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
return it;
};
/***/ }),
/* 39 */
/***/ (function(module, exports, __webpack_require__) {
var def = __webpack_require__(9).f;
var has = __webpack_require__(14);
var TAG = __webpack_require__(5)('toStringTag');
module.exports = function (it, tag, stat) {
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
};
/***/ }),
/* 40 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
var defined = __webpack_require__(25);
var fails = __webpack_require__(2);
var spaces = __webpack_require__(76);
var space = '[' + spaces + ']';
var non = '\u200b\u0085';
var ltrim = RegExp('^' + space + space + '*');
var rtrim = RegExp(space + space + '*$');
var exporter = function (KEY, exec, ALIAS) {
var exp = {};
var FORCE = fails(function () {
return !!spaces[KEY]() || non[KEY]() != non;
});
var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
if (ALIAS) exp[ALIAS] = fn;
$export($export.P + $export.F * FORCE, 'String', exp);
};
// 1 -> String#trimLeft
// 2 -> String#trimRight
// 3 -> String#trim
var trim = exporter.trim = function (string, TYPE) {
string = String(defined(string));
if (TYPE & 1) string = string.replace(ltrim, '');
if (TYPE & 2) string = string.replace(rtrim, '');
return string;
};
module.exports = exporter;
/***/ }),
/* 41 */
/***/ (function(module, exports) {
module.exports = {};
/***/ }),
/* 42 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var global = __webpack_require__(1);
var dP = __webpack_require__(9);
var DESCRIPTORS = __webpack_require__(8);
var SPECIES = __webpack_require__(5)('species');
module.exports = function (KEY) {
var C = global[KEY];
if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
configurable: true,
get: function () { return this; }
});
};
/***/ }),
/* 43 */
/***/ (function(module, exports) {
module.exports = function (it, Constructor, name, forbiddenField) {
if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
throw TypeError(name + ': incorrect invocation!');
} return it;
};
/***/ }),
/* 44 */
/***/ (function(module, exports, __webpack_require__) {
var redefine = __webpack_require__(11);
module.exports = function (target, src, safe) {
for (var key in src) redefine(target, key, src[key], safe);
return target;
};
/***/ }),
/* 45 */,
/* 46 */
/***/ (function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__(24);
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
return cof(it) == 'String' ? it.split('') : Object(it);
};
/***/ }),
/* 47 */
/***/ (function(module, exports) {
exports.f = {}.propertyIsEnumerable;
/***/ }),
/* 48 */
/***/ (function(module, exports, __webpack_require__) {
// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = __webpack_require__(24);
var TAG = __webpack_require__(5)('toStringTag');
// ES3 wrong here
var ARG = cof(function () { return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
try {
return it[key];
} catch (e) { /* empty */ }
};
module.exports = function (it) {
var O, T, B;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
// builtinTag case
: ARG ? cof(O)
// ES3 arguments fallback
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};
/***/ }),
/* 49 */
/***/ (function(module, exports, __webpack_require__) {
// 7.3.20 SpeciesConstructor(O, defaultConstructor)
var anObject = __webpack_require__(3);
var aFunction = __webpack_require__(19);
var SPECIES = __webpack_require__(5)('species');
module.exports = function (O, D) {
var C = anObject(O).constructor;
var S;
return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
};
/***/ }),
/* 50 */,
/* 51 */,
/* 52 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {
var scope = typeof global !== "undefined" && global || typeof self !== "undefined" && self || window;
var apply = Function.prototype.apply; // DOM APIs, for completeness
exports.setTimeout = function () {
return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
};
exports.setInterval = function () {
return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
};
exports.clearTimeout = exports.clearInterval = function (timeout) {
if (timeout) {
timeout.close();
}
};
function Timeout(id, clearFn) {
this._id = id;
this._clearFn = clearFn;
}
Timeout.prototype.unref = Timeout.prototype.ref = function () {};
Timeout.prototype.close = function () {
this._clearFn.call(scope, this._id);
}; // Does not start the time, just sets up the members needed.
exports.enroll = function (item, msecs) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = msecs;
};
exports.unenroll = function (item) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = -1;
};
exports._unrefActive = exports.active = function (item) {
clearTimeout(item._idleTimeoutId);
var msecs = item._idleTimeout;
if (msecs >= 0) {
item._idleTimeoutId = setTimeout(function onTimeout() {
if (item._onTimeout) item._onTimeout();
}, msecs);
}
}; // setimmediate attaches itself to the global object
__webpack_require__(106); // On some exotic environments, it's not clear which object `setimmediate` was
// able to install onto. Search each possibility in the same order as the
// `setimmediate` library.
exports.setImmediate = typeof self !== "undefined" && self.setImmediate || typeof global !== "undefined" && global.setImmediate || void 0 && (void 0).setImmediate;
exports.clearImmediate = typeof self !== "undefined" && self.clearImmediate || typeof global !== "undefined" && global.clearImmediate || void 0 && (void 0).clearImmediate;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)))
/***/ }),
/* 53 */
/***/ (function(module, exports, __webpack_require__) {
var core = __webpack_require__(7);
var global = __webpack_require__(1);
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: core.version,
mode: __webpack_require__(31) ? 'pure' : 'global',
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
});
/***/ }),
/* 54 */
/***/ (function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__(16);
var toLength = __webpack_require__(6);
var toAbsoluteIndex = __webpack_require__(33);
module.exports = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIObject($this);
var length = toLength(O.length);
var index = toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
if (O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
/***/ }),
/* 55 */
/***/ (function(module, exports) {
exports.f = Object.getOwnPropertySymbols;
/***/ }),
/* 56 */
/***/ (function(module, exports, __webpack_require__) {
// 7.2.2 IsArray(argument)
var cof = __webpack_require__(24);
module.exports = Array.isArray || function isArray(arg) {
return cof(arg) == 'Array';
};
/***/ }),
/* 57 */
/***/ (function(module, exports, __webpack_require__) {
var ITERATOR = __webpack_require__(5)('iterator');
var SAFE_CLOSING = false;
try {
var riter = [7][ITERATOR]();
riter['return'] = function () { SAFE_CLOSING = true; };
// eslint-disable-next-line no-throw-literal
Array.from(riter, function () { throw 2; });
} catch (e) { /* empty */ }
module.exports = function (exec, skipClosing) {
if (!skipClosing && !SAFE_CLOSING) return false;
var safe = false;
try {
var arr = [7];
var iter = arr[ITERATOR]();
iter.next = function () { return { done: safe = true }; };
arr[ITERATOR] = function () { return iter; };
exec(arr);
} catch (e) { /* empty */ }
return safe;
};
/***/ }),
/* 58 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 21.2.5.3 get RegExp.prototype.flags
var anObject = __webpack_require__(3);
module.exports = function () {
var that = anObject(this);
var result = '';
if (that.global) result += 'g';
if (that.ignoreCase) result += 'i';
if (that.multiline) result += 'm';
if (that.unicode) result += 'u';
if (that.sticky) result += 'y';
return result;
};
/***/ }),
/* 59 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var classof = __webpack_require__(48);
var builtinExec = RegExp.prototype.exec;
// `RegExpExec` abstract operation
// https://tc39.github.io/ecma262/#sec-regexpexec
module.exports = function (R, S) {
var exec = R.exec;
if (typeof exec === 'function') {
var result = exec.call(R, S);
if (typeof result !== 'object') {
throw new TypeError('RegExp exec method returned something other than an Object or null');
}
return result;
}
if (classof(R) !== 'RegExp') {
throw new TypeError('RegExp#exec called on incompatible receiver');
}
return builtinExec.call(R, S);
};
/***/ }),
/* 60 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(288);
var redefine = __webpack_require__(11);
var hide = __webpack_require__(15);
var fails = __webpack_require__(2);
var defined = __webpack_require__(25);
var wks = __webpack_require__(5);
var regexpExec = __webpack_require__(91);
var SPECIES = wks('species');
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
// #replace needs built-in support for named groups.
// #match works fine because it just return the exec results, even if it has
// a "grops" property.
var re = /./;
re.exec = function () {
var result = [];
result.groups = { a: '7' };
return result;
};
return ''.replace(re, '$<a>') !== '7';
});
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
var re = /(?:)/;
var originalExec = re.exec;
re.exec = function () { return originalExec.apply(this, arguments); };
var result = 'ab'.split(re);
return result.length === 2 && result[0] === 'a' && result[1] === 'b';
})();
module.exports = function (KEY, length, exec) {
var SYMBOL = wks(KEY);
var DELEGATES_TO_SYMBOL = !fails(function () {
// String methods call symbol-named RegEp methods
var O = {};
O[SYMBOL] = function () { return 7; };
return ''[KEY](O) != 7;
});
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {
// Symbol-named RegExp methods call .exec
var execCalled = false;
var re = /a/;
re.exec = function () { execCalled = true; return null; };
if (KEY === 'split') {
// RegExp[@@split] doesn't call the regex's exec method, but first creates
// a new one. We need to return the patched regex when creating the new one.
re.constructor = {};
re.constructor[SPECIES] = function () { return re; };
}
re[SYMBOL]('');
return !execCalled;
}) : undefined;
if (
!DELEGATES_TO_SYMBOL ||
!DELEGATES_TO_EXEC ||
(KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
) {
var nativeRegExpMethod = /./[SYMBOL];
var fns = exec(
defined,
SYMBOL,
''[KEY],
function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
if (regexp.exec === regexpExec) {
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
// The native String method already delegates to @@method (this
// polyfilled function), leasing to infinite recursion.
// We avoid it by directly calling the native @@method method.
return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
}
return { done: true, value: nativeMethod.call(str, regexp, arg2) };
}
return { done: false };
}
);
var strfn = fns[0];
var rxfn = fns[1];
redefine(String.prototype, KEY, strfn);
hide(RegExp.prototype, SYMBOL, length == 2
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
// 21.2.5.11 RegExp.prototype[@@split](string, limit)
? function (string, arg) { return rxfn.call(string, this, arg); }
// 21.2.5.6 RegExp.prototype[@@match](string)
// 21.2.5.9 RegExp.prototype[@@search](string)
: function (string) { return rxfn.call(string, this); }
);
}
};
/***/ }),
/* 61 */
/***/ (function(module, exports, __webpack_require__) {
var ctx = __webpack_require__(18);
var call = __webpack_require__(283);
var isArrayIter = __webpack_require__(86);
var anObject = __webpack_require__(3);
var toLength = __webpack_require__(6);
var getIterFn = __webpack_require__(88);
var BREAK = {};
var RETURN = {};
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
var f = ctx(fn, that, entries ? 2 : 1);
var index = 0;
var length, step, iterator, result;
if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
// fast case for arrays with default iterator
if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
if (result === BREAK || result === RETURN) return result;
} else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
result = call(iterator, f, step.value, entries);
if (result === BREAK || result === RETURN) return result;
}
};
exports.BREAK = BREAK;
exports.RETURN = RETURN;
/***/ }),
/* 62 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(1);
var navigator = global.navigator;
module.exports = navigator && navigator.userAgent || '';
/***/ }),
/* 63 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var global = __webpack_require__(1);
var $export = __webpack_require__(0);
var redefine = __webpack_require__(11);
var redefineAll = __webpack_require__(44);
var meta = __webpack_require__(28);
var forOf = __webpack_require__(61);
var anInstance = __webpack_require__(43);
var isObject = __webpack_require__(4);
var fails = __webpack_require__(2);
var $iterDetect = __webpack_require__(57);
var setToStringTag = __webpack_require__(39);
var inheritIfRequired = __webpack_require__(77);
module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
var Base = global[NAME];
var C = Base;
var ADDER = IS_MAP ? 'set' : 'add';
var proto = C && C.prototype;
var O = {};
var fixMethod = function (KEY) {
var fn = proto[KEY];
redefine(proto, KEY,
KEY == 'delete' ? function (a) {
return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'has' ? function has(a) {
return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'get' ? function get(a) {
return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
} : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }
: function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }
);
};
if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
new C().entries().next();
}))) {
// create collection constructor
C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
redefineAll(C.prototype, methods);
meta.NEED = true;
} else {
var instance = new C();
// early implementations not supports chaining
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
// V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
// most early implementations doesn't supports iterables, most modern - not close it correctly
var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new
// for early implementations -0 and +0 not the same
var BUGGY_ZERO = !IS_WEAK && fails(function () {
// V8 ~ Chromium 42- fails only with 5+ elements
var $instance = new C();
var index = 5;
while (index--) $instance[ADDER](index, index);
return !$instance.has(-0);
});
if (!ACCEPT_ITERABLES) {
C = wrapper(function (target, iterable) {
anInstance(target, C, NAME);
var that = inheritIfRequired(new Base(), target, C);
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
return that;
});
C.prototype = proto;
proto.constructor = C;
}
if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
fixMethod('delete');
fixMethod('has');
IS_MAP && fixMethod('get');
}
if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
// weak collections should not contains .clear method
if (IS_WEAK && proto.clear) delete proto.clear;
}
setToStringTag(C, NAME);
O[NAME] = C;
$export($export.G + $export.W + $export.F * (C != Base), O);
if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
return C;
};
/***/ }),
/* 64 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(1);
var hide = __webpack_require__(15);
var uid = __webpack_require__(30);
var TYPED = uid('typed_array');
var VIEW = uid('view');
var ABV = !!(global.ArrayBuffer && global.DataView);
var CONSTR = ABV;
var i = 0;
var l = 9;
var Typed;
var TypedArrayConstructors = (
'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
).split(',');
while (i < l) {
if (Typed = global[TypedArrayConstructors[i++]]) {
hide(Typed.prototype, TYPED, true);
hide(Typed.prototype, VIEW, true);
} else CONSTR = false;
}
module.exports = {
ABV: ABV,
CONSTR: CONSTR,
TYPED: TYPED,
VIEW: VIEW
};
/***/ }),
/* 65 */,
/* 66 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// shim for using process in browser
var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout() {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
})();
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
} // if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch (e) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch (e) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
} // if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while (len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
}; // v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) {
return [];
};
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () {
return '/';
};
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function () {
return 0;
};
/***/ }),
/* 67 */,
/* 68 */,
/* 69 */,
/* 70 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(4);
var document = __webpack_require__(1).document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return is ? document.createElement(it) : {};
};
/***/ }),
/* 71 */
/***/ (function(module, exports, __webpack_require__) {
exports.f = __webpack_require__(5);
/***/ }),
/* 72 */
/***/ (function(module, exports, __webpack_require__) {
var shared = __webpack_require__(53)('keys');
var uid = __webpack_require__(30);
module.exports = function (key) {
return shared[key] || (shared[key] = uid(key));
};
/***/ }),
/* 73 */
/***/ (function(module, exports) {
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
/***/ }),
/* 74 */
/***/ (function(module, exports, __webpack_require__) {
var document = __webpack_require__(1).document;
module.exports = document && document.documentElement;
/***/ }),
/* 75 */
/***/ (function(module, exports, __webpack_require__) {
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
var isObject = __webpack_require__(4);
var anObject = __webpack_require__(3);
var check = function (O, proto) {
anObject(O);
if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
};
module.exports = {
set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
function (test, buggy, set) {
try {
set = __webpack_require__(18)(Function.call, __webpack_require__(21).f(Object.prototype, '__proto__').set, 2);
set(test, []);
buggy = !(test instanceof Array);
} catch (e) { buggy = true; }
return function setPrototypeOf(O, proto) {
check(O, proto);
if (buggy) O.__proto__ = proto;
else set(O, proto);
return O;
};
}({}, false) : undefined),
check: check
};
/***/ }),
/* 76 */
/***/ (function(module, exports) {
module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
/***/ }),
/* 77 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(4);
var setPrototypeOf = __webpack_require__(75).set;
module.exports = function (that, target, C) {
var S = target.constructor;
var P;
if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
setPrototypeOf(that, P);
} return that;
};
/***/ }),
/* 78 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toInteger = __webpack_require__(20);
var defined = __webpack_require__(25);
module.exports = function repeat(count) {
var str = String(defined(this));
var res = '';
var n = toInteger(count);
if (n < 0 || n == Infinity) throw RangeError("Count can't be negative");
for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;
return res;
};
/***/ }),
/* 79 */
/***/ (function(module, exports) {
// 20.2.2.28 Math.sign(x)
module.exports = Math.sign || function sign(x) {
// eslint-disable-next-line no-self-compare
return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
};
/***/ }),
/* 80 */
/***/ (function(module, exports) {
// 20.2.2.14 Math.expm1(x)
var $expm1 = Math.expm1;
module.exports = (!$expm1
// Old FF bug
|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
// Tor Browser bug
|| $expm1(-2e-17) != -2e-17
) ? function expm1(x) {
return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
} : $expm1;
/***/ }),
/* 81 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(20);
var defined = __webpack_require__(25);
// true -> String#at
// false -> String#codePointAt
module.exports = function (TO_STRING) {
return function (that, pos) {
var s = String(defined(that));
var i = toInteger(pos);
var l = s.length;
var a, b;
if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? TO_STRING ? s.charAt(i) : a
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
/***/ }),
/* 82 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var LIBRARY = __webpack_require__(31);
var $export = __webpack_require__(0);
var redefine = __webpack_require__(11);
var hide = __webpack_require__(15);
var Iterators = __webpack_require__(41);
var $iterCreate = __webpack_require__(282);
var setToStringTag = __webpack_require__(39);
var getPrototypeOf = __webpack_require__(36);
var ITERATOR = __webpack_require__(5)('iterator');
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';
var returnThis = function () { return this; };
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
$iterCreate(Constructor, NAME, next);
var getMethod = function (kind) {
if (!BUGGY && kind in proto) return proto[kind];
switch (kind) {
case KEYS: return function keys() { return new Constructor(this, kind); };
case VALUES: return function values() { return new Constructor(this, kind); };
} return function entries() { return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator';
var DEF_VALUES = DEFAULT == VALUES;
var VALUES_BUG = false;
var proto = Base.prototype;
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
var $default = $native || getMethod(DEFAULT);
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
var methods, key, IteratorPrototype;
// Fix native
if ($anyNative) {
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if (DEF_VALUES && $native && $native.name !== VALUES) {
VALUES_BUG = true;
$default = function values() { return $native.call(this); };
}
// Define iterator
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
hide(proto, ITERATOR, $default);
}
// Plug for library
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if (DEFAULT) {
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if (FORCED) for (key in methods) {
if (!(key in proto)) redefine(proto, key, methods[key]);
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
/***/ }),
/* 83 */
/***/ (function(module, exports, __webpack_require__) {
// helper for String#{startsWith, endsWith, includes}
var isRegExp = __webpack_require__(84);
var defined = __webpack_require__(25);
module.exports = function (that, searchString, NAME) {
if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
return String(defined(that));
};
/***/ }),
/* 84 */
/***/ (function(module, exports, __webpack_require__) {
// 7.2.8 IsRegExp(argument)
var isObject = __webpack_require__(4);
var cof = __webpack_require__(24);
var MATCH = __webpack_require__(5)('match');
module.exports = function (it) {
var isRegExp;
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
};
/***/ }),
/* 85 */
/***/ (function(module, exports, __webpack_require__) {
var MATCH = __webpack_require__(5)('match');
module.exports = function (KEY) {
var re = /./;
try {
'/./'[KEY](re);
} catch (e) {
try {
re[MATCH] = false;
return !'/./'[KEY](re);
} catch (f) { /* empty */ }
} return true;
};
/***/ }),
/* 86 */
/***/ (function(module, exports, __webpack_require__) {
// check on default Array iterator
var Iterators = __webpack_require__(41);
var ITERATOR = __webpack_require__(5)('iterator');
var ArrayProto = Array.prototype;
module.exports = function (it) {
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
};
/***/ }),
/* 87 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $defineProperty = __webpack_require__(9);
var createDesc = __webpack_require__(29);
module.exports = function (object, index, value) {
if (index in object) $defineProperty.f(object, index, createDesc(0, value));
else object[index] = value;
};
/***/ }),
/* 88 */
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__(48);
var ITERATOR = __webpack_require__(5)('iterator');
var Iterators = __webpack_require__(41);
module.exports = __webpack_require__(7).getIteratorMethod = function (it) {
if (it != undefined) return it[ITERATOR]
|| it['@@iterator']
|| Iterators[classof(it)];
};
/***/ }),
/* 89 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
var toObject = __webpack_require__(10);
var toAbsoluteIndex = __webpack_require__(33);
var toLength = __webpack_require__(6);
module.exports = function fill(value /* , start = 0, end = @length */) {
var O = toObject(this);
var length = toLength(O.length);
var aLen = arguments.length;
var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);
var end = aLen > 2 ? arguments[2] : undefined;
var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
while (endPos > index) O[index++] = value;
return O;
};
/***/ }),
/* 90 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var addToUnscopables = __webpack_require__(37);
var step = __webpack_require__(287);
var Iterators = __webpack_require__(41);
var toIObject = __webpack_require__(16);
// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = __webpack_require__(82)(Array, 'Array', function (iterated, kind) {
this._t = toIObject(iterated); // target
this._i = 0; // next index
this._k = kind; // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function () {
var O = this._t;
var kind = this._k;
var index = this._i++;
if (!O || index >= O.length) {
this._t = undefined;
return step(1);
}
if (kind == 'keys') return step(0, index);
if (kind == 'values') return step(0, O[index]);
return step(0, [index, O[index]]);
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
/***/ }),
/* 91 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var regexpFlags = __webpack_require__(58);
var nativeExec = RegExp.prototype.exec;
// This always refers to the native implementation, because the
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
// which loads this file before patching the method.
var nativeReplace = String.prototype.replace;
var patchedExec = nativeExec;
var LAST_INDEX = 'lastIndex';
var UPDATES_LAST_INDEX_WRONG = (function () {
var re1 = /a/,
re2 = /b*/g;
nativeExec.call(re1, 'a');
nativeExec.call(re2, 'a');
return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
})();
// nonparticipating capturing group, copied from es5-shim's String#split patch.
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
if (PATCH) {
patchedExec = function exec(str) {
var re = this;
var lastIndex, reCopy, match, i;
if (NPCG_INCLUDED) {
reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
}
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];
match = nativeExec.call(re, str);
if (UPDATES_LAST_INDEX_WRONG && match) {
re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;
}
if (NPCG_INCLUDED && match && match.length > 1) {
// Fix browsers whose `exec` methods don't consistently return `undefined`
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
// eslint-disable-next-line no-loop-func
nativeReplace.call(match[0], reCopy, function () {
for (i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undefined) match[i] = undefined;
}
});
}
return match;
};
}
module.exports = patchedExec;
/***/ }),
/* 92 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var at = __webpack_require__(81)(true);
// `AdvanceStringIndex` abstract operation
// https://tc39.github.io/ecma262/#sec-advancestringindex
module.exports = function (S, index, unicode) {
return index + (unicode ? at(S, index).length : 1);
};
/***/ }),
/* 93 */
/***/ (function(module, exports, __webpack_require__) {
var ctx = __webpack_require__(18);
var invoke = __webpack_require__(276);
var html = __webpack_require__(74);
var cel = __webpack_require__(70);
var global = __webpack_require__(1);
var process = global.process;
var setTask = global.setImmediate;
var clearTask = global.clearImmediate;
var MessageChannel = global.MessageChannel;
var Dispatch = global.Dispatch;
var counter = 0;
var queue = {};
var ONREADYSTATECHANGE = 'onreadystatechange';
var defer, channel, port;
var run = function () {
var id = +this;
// eslint-disable-next-line no-prototype-builtins
if (queue.hasOwnProperty(id)) {
var fn = queue[id];
delete queue[id];
fn();
}
};
var listener = function (event) {
run.call(event.data);
};
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
if (!setTask || !clearTask) {
setTask = function setImmediate(fn) {
var args = [];
var i = 1;
while (arguments.length > i) args.push(arguments[i++]);
queue[++counter] = function () {
// eslint-disable-next-line no-new-func
invoke(typeof fn == 'function' ? fn : Function(fn), args);
};
defer(counter);
return counter;
};
clearTask = function clearImmediate(id) {
delete queue[id];
};
// Node.js 0.8-
if (__webpack_require__(24)(process) == 'process') {
defer = function (id) {
process.nextTick(ctx(run, id, 1));
};
// Sphere (JS game engine) Dispatch API
} else if (Dispatch && Dispatch.now) {
defer = function (id) {
Dispatch.now(ctx(run, id, 1));
};
// Browsers with MessageChannel, includes WebWorkers
} else if (MessageChannel) {
channel = new MessageChannel();
port = channel.port2;
channel.port1.onmessage = listener;
defer = ctx(port.postMessage, port, 1);
// Browsers with postMessage, skip WebWorkers
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
} else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
defer = function (id) {
global.postMessage(id + '', '*');
};
global.addEventListener('message', listener, false);
// IE8-
} else if (ONREADYSTATECHANGE in cel('script')) {
defer = function (id) {
html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
html.removeChild(this);
run.call(id);
};
};
// Rest old browsers
} else {
defer = function (id) {
setTimeout(ctx(run, id, 1), 0);
};
}
}
module.exports = {
set: setTask,
clear: clearTask
};
/***/ }),
/* 94 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var global = __webpack_require__(1);
var DESCRIPTORS = __webpack_require__(8);
var LIBRARY = __webpack_require__(31);
var $typed = __webpack_require__(64);
var hide = __webpack_require__(15);
var redefineAll = __webpack_require__(44);
var fails = __webpack_require__(2);
var anInstance = __webpack_require__(43);
var toInteger = __webpack_require__(20);
var toLength = __webpack_require__(6);
var toIndex = __webpack_require__(295);
var gOPN = __webpack_require__(35).f;
var dP = __webpack_require__(9).f;
var arrayFill = __webpack_require__(89);
var setToStringTag = __webpack_require__(39);
var ARRAY_BUFFER = 'ArrayBuffer';
var DATA_VIEW = 'DataView';
var PROTOTYPE = 'prototype';
var WRONG_LENGTH = 'Wrong length!';
var WRONG_INDEX = 'Wrong index!';
var $ArrayBuffer = global[ARRAY_BUFFER];
var $DataView = global[DATA_VIEW];
var Math = global.Math;
var RangeError = global.RangeError;
// eslint-disable-next-line no-shadow-restricted-names
var Infinity = global.Infinity;
var BaseBuffer = $ArrayBuffer;
var abs = Math.abs;
var pow = Math.pow;
var floor = Math.floor;
var log = Math.log;
var LN2 = Math.LN2;
var BUFFER = 'buffer';
var BYTE_LENGTH = 'byteLength';
var BYTE_OFFSET = 'byteOffset';
var $BUFFER = DESCRIPTORS ? '_b' : BUFFER;
var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;
var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;
// IEEE754 conversions based on https://github.com/feross/ieee754
function packIEEE754(value, mLen, nBytes) {
var buffer = new Array(nBytes);
var eLen = nBytes * 8 - mLen - 1;
var eMax = (1 << eLen) - 1;
var eBias = eMax >> 1;
var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;
var i = 0;
var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
var e, m, c;
value = abs(value);
// eslint-disable-next-line no-self-compare
if (value != value || value === Infinity) {
// eslint-disable-next-line no-self-compare
m = value != value ? 1 : 0;
e = eMax;
} else {
e = floor(log(value) / LN2);
if (value * (c = pow(2, -e)) < 1) {
e--;
c *= 2;
}
if (e + eBias >= 1) {
value += rt / c;
} else {
value += rt * pow(2, 1 - eBias);
}
if (value * c >= 2) {
e++;
c /= 2;
}
if (e + eBias >= eMax) {
m = 0;
e = eMax;
} else if (e + eBias >= 1) {
m = (value * c - 1) * pow(2, mLen);
e = e + eBias;
} else {
m = value * pow(2, eBias - 1) * pow(2, mLen);
e = 0;
}
}
for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
e = e << mLen | m;
eLen += mLen;
for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
buffer[--i] |= s * 128;
return buffer;
}
function unpackIEEE754(buffer, mLen, nBytes) {
var eLen = nBytes * 8 - mLen - 1;
var eMax = (1 << eLen) - 1;
var eBias = eMax >> 1;
var nBits = eLen - 7;
var i = nBytes - 1;
var s = buffer[i--];
var e = s & 127;
var m;
s >>= 7;
for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
m = e & (1 << -nBits) - 1;
e >>= -nBits;
nBits += mLen;
for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
if (e === 0) {
e = 1 - eBias;
} else if (e === eMax) {
return m ? NaN : s ? -Infinity : Infinity;
} else {
m = m + pow(2, mLen);
e = e - eBias;
} return (s ? -1 : 1) * m * pow(2, e - mLen);
}
function unpackI32(bytes) {
return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
}
function packI8(it) {
return [it & 0xff];
}
function packI16(it) {
return [it & 0xff, it >> 8 & 0xff];
}
function packI32(it) {
return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
}
function packF64(it) {
return packIEEE754(it, 52, 8);
}
function packF32(it) {
return packIEEE754(it, 23, 4);
}
function addGetter(C, key, internal) {
dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });
}
function get(view, bytes, index, isLittleEndian) {
var numIndex = +index;
var intIndex = toIndex(numIndex);
if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
var store = view[$BUFFER]._b;
var start = intIndex + view[$OFFSET];
var pack = store.slice(start, start + bytes);
return isLittleEndian ? pack : pack.reverse();
}
function set(view, bytes, index, conversion, value, isLittleEndian) {
var numIndex = +index;
var intIndex = toIndex(numIndex);
if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
var store = view[$BUFFER]._b;
var start = intIndex + view[$OFFSET];
var pack = conversion(+value);
for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
}
if (!$typed.ABV) {
$ArrayBuffer = function ArrayBuffer(length) {
anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
var byteLength = toIndex(length);
this._b = arrayFill.call(new Array(byteLength), 0);
this[$LENGTH] = byteLength;
};
$DataView = function DataView(buffer, byteOffset, byteLength) {
anInstance(this, $DataView, DATA_VIEW);
anInstance(buffer, $ArrayBuffer, DATA_VIEW);
var bufferLength = buffer[$LENGTH];
var offset = toInteger(byteOffset);
if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');
byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
this[$BUFFER] = buffer;
this[$OFFSET] = offset;
this[$LENGTH] = byteLength;
};
if (DESCRIPTORS) {
addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
addGetter($DataView, BUFFER, '_b');
addGetter($DataView, BYTE_LENGTH, '_l');
addGetter($DataView, BYTE_OFFSET, '_o');
}
redefineAll($DataView[PROTOTYPE], {
getInt8: function getInt8(byteOffset) {
return get(this, 1, byteOffset)[0] << 24 >> 24;
},
getUint8: function getUint8(byteOffset) {
return get(this, 1, byteOffset)[0];
},
getInt16: function getInt16(byteOffset /* , littleEndian */) {
var bytes = get(this, 2, byteOffset, arguments[1]);
return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
},
getUint16: function getUint16(byteOffset /* , littleEndian */) {
var bytes = get(this, 2, byteOffset, arguments[1]);
return bytes[1] << 8 | bytes[0];
},
getInt32: function getInt32(byteOffset /* , littleEndian */) {
return unpackI32(get(this, 4, byteOffset, arguments[1]));
},
getUint32: function getUint32(byteOffset /* , littleEndian */) {
return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
},
getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
},
getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
},
setInt8: function setInt8(byteOffset, value) {
set(this, 1, byteOffset, packI8, value);
},
setUint8: function setUint8(byteOffset, value) {
set(this, 1, byteOffset, packI8, value);
},
setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
set(this, 2, byteOffset, packI16, value, arguments[2]);
},
setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
set(this, 2, byteOffset, packI16, value, arguments[2]);
},
setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packI32, value, arguments[2]);
},
setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packI32, value, arguments[2]);
},
setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packF32, value, arguments[2]);
},
setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
set(this, 8, byteOffset, packF64, value, arguments[2]);
}
});
} else {
if (!fails(function () {
$ArrayBuffer(1);
}) || !fails(function () {
new $ArrayBuffer(-1); // eslint-disable-line no-new
}) || fails(function () {
new $ArrayBuffer(); // eslint-disable-line no-new
new $ArrayBuffer(1.5); // eslint-disable-line no-new
new $ArrayBuffer(NaN); // eslint-disable-line no-new
return $ArrayBuffer.name != ARRAY_BUFFER;
})) {
$ArrayBuffer = function ArrayBuffer(length) {
anInstance(this, $ArrayBuffer);
return new BaseBuffer(toIndex(length));
};
var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {
if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);
}
if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;
}
// iOS Safari 7.x bug
var view = new $DataView(new $ArrayBuffer(2));
var $setInt8 = $DataView[PROTOTYPE].setInt8;
view.setInt8(0, 2147483648);
view.setInt8(1, 2147483649);
if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {
setInt8: function setInt8(byteOffset, value) {
$setInt8.call(this, byteOffset, value << 24 >> 24);
},
setUint8: function setUint8(byteOffset, value) {
$setInt8.call(this, byteOffset, value << 24 >> 24);
}
}, true);
}
setToStringTag($ArrayBuffer, ARRAY_BUFFER);
setToStringTag($DataView, DATA_VIEW);
hide($DataView[PROTOTYPE], $typed.VIEW, true);
exports[ARRAY_BUFFER] = $ArrayBuffer;
exports[DATA_VIEW] = $DataView;
/***/ }),
/* 95 */
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/* 96 */
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/* 97 */
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(300)(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 98 */,
/* 99 */,
/* 100 */,
/* 101 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/**
* Created by richie on 15/7/8.
*/
/**
* 初始化BI对象
*/
_global = undefined;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {prepares: []};
}
if(_global.BI.prepares == null) {
_global.BI.prepares = [];
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)))
/***/ }),
/* 102 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(103)(__webpack_require__(104))
/***/ }),
/* 103 */
/***/ (function(module, exports) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
module.exports = function(src) {
function log(error) {
(typeof console !== "undefined")
&& (console.error || console.log)("[Script Loader]", error);
}
// Check for IE =< 8
function isIE() {
return typeof attachEvent !== "undefined" && typeof addEventListener === "undefined";
}
try {
if (typeof execScript !== "undefined" && isIE()) {
execScript(src);
} else if (typeof eval !== "undefined") {
eval.call(null, src);
} else {
log("EvalError: No eval function available");
}
} catch (error) {
log(error);
}
}
/***/ }),
/* 104 */
/***/ (function(module, exports) {
module.exports = "/**\n * @license\n * Lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash core plus=\"debounce,throttle,get,set,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,before,after\"`\n * Copyright JS Foundation and other contributors <https://js.foundation/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.5';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var FUNC_ERROR_TEXT = 'Expected a function';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match HTML entities and HTML characters. */\n var reUnescapedHtml = /[&<>\"']/g,\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n /** Used to match leading and trailing whitespace. */\n var reTrim = /^\\s+|\\s+$/g;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n /** Used to compose unicode capture groups. */\n var rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#39;'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n return key == '__proto__'\n ? undefined\n : object[key];\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = root['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = root.isFinite,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n\n return result;\n }\n\n if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n\n return result;\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n if (isObject(srcValue)) {\n stack || (stack = new Stack);\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n var index = -1;\n iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = baseIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, baseIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, baseIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, baseIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, baseIteratee(iteratee, 3));\n }\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(baseIteratee(predicate, 3)));\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, baseIteratee);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(baseIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = baseIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, &amp; pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Removes leading and trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trim(' abc ');\n * // => 'abc'\n *\n * _.trim('-_-abc-_-', '_-');\n * // => 'abc'\n *\n * _.map([' foo ', ' bar '], _.trim);\n * // => ['foo', 'bar']\n */\n function trim(string, chars, guard) {\n string = toString(string);\n if (string && (guard || chars === undefined)) {\n return string.replace(reTrim, '');\n }\n if (!string || !(chars = baseToString(chars))) {\n return string;\n }\n var strSymbols = stringToArray(string),\n chrSymbols = stringToArray(chars),\n start = charsStartIndex(strSymbols, chrSymbols),\n end = charsEndIndex(strSymbols, chrSymbols) + 1;\n\n return castSlice(strSymbols, start, end).join('');\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\n function constant(value) {\n return function() {\n return value;\n };\n }\n\n /**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\n function identity(value) {\n return value;\n }\n\n /**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name, the created function returns the\n * property value for a given element. If `func` is an array or object, the\n * created function returns `true` for elements that contain the equivalent\n * source properties, otherwise it returns `false`.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));\n * // => [{ 'user': 'barney', 'age': 36, 'active': true }]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, _.iteratee(['user', 'fred']));\n * // => [{ 'user': 'fred', 'age': 40 }]\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, _.iteratee('user'));\n * // => ['barney', 'fred']\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {\n * return !_.isRegExp(func) ? iteratee(func) : function(string) {\n * return func.test(string);\n * };\n * });\n *\n * _.filter(['abc', 'def'], /ef/);\n * // => ['def']\n */\n function iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));\n }\n\n /**\n * Creates a function that performs a partial deep comparison between a given\n * object and `source`, returning `true` if the given object has equivalent\n * property values, else `false`.\n *\n * **Note:** The created function is equivalent to `_.isMatch` with `source`\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));\n * // => [{ 'a': 4, 'b': 5, 'c': 6 }]\n */\n function matches(source) {\n return baseMatches(baseClone(source, CLONE_DEEP_FLAG));\n }\n\n /**\n * Adds all own enumerable string keyed function properties of a source\n * object to the destination object. If `object` is a function, then methods\n * are added to its prototype as well.\n *\n * **Note:** Use `_.runInContext` to create a pristine `lodash` function to\n * avoid conflicts caused by modifying the original.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Function|Object} [object=lodash] The destination object.\n * @param {Object} source The object of functions to add.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.chain=true] Specify whether mixins are chainable.\n * @returns {Function|Object} Returns `object`.\n * @example\n *\n * function vowels(string) {\n * return _.filter(string, function(v) {\n * return /[aeiou]/i.test(v);\n * });\n * }\n *\n * _.mixin({ 'vowels': vowels });\n * _.vowels('fred');\n * // => ['e']\n *\n * _('fred').vowels().value();\n * // => ['e']\n *\n * _.mixin({ 'vowels': vowels }, { 'chain': false });\n * _('fred').vowels();\n * // => ['e']\n */\n function mixin(object, source, options) {\n var props = keys(source),\n methodNames = baseFunctions(source, props);\n\n if (options == null &&\n !(isObject(source) && (methodNames.length || !props.length))) {\n options = source;\n source = object;\n object = this;\n methodNames = baseFunctions(source, keys(source));\n }\n var chain = !(isObject(options) && 'chain' in options) || !!options.chain,\n isFunc = isFunction(object);\n\n arrayEach(methodNames, function(methodName) {\n var func = source[methodName];\n object[methodName] = func;\n if (isFunc) {\n object.prototype[methodName] = function() {\n var chainAll = this.__chain__;\n if (chain || chainAll) {\n var result = object(this.__wrapped__),\n actions = result.__actions__ = copyArray(this.__actions__);\n\n actions.push({ 'func': func, 'args': arguments, 'thisArg': object });\n result.__chain__ = chainAll;\n return result;\n }\n return func.apply(object, arrayPush([this.value()], arguments));\n };\n }\n });\n\n return object;\n }\n\n /**\n * Reverts the `_` variable to its previous value and returns a reference to\n * the `lodash` function.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @returns {Function} Returns the `lodash` function.\n * @example\n *\n * var lodash = _.noConflict();\n */\n function noConflict() {\n if (root._ === this) {\n root._ = oldDash;\n }\n return this;\n }\n\n /**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\n function noop() {\n // No operation performed.\n }\n\n /**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\n function property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n }\n\n /**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\n var range = createRange();\n\n /**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\n function stubArray() {\n return [];\n }\n\n /**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\n function stubFalse() {\n return false;\n }\n\n /**\n * Generates a unique ID. If `prefix` is given, the ID is appended to it.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {string} [prefix=''] The value to prefix the ID with.\n * @returns {string} Returns the unique ID.\n * @example\n *\n * _.uniqueId('contact_');\n * // => 'contact_104'\n *\n * _.uniqueId();\n * // => '105'\n */\n function uniqueId(prefix) {\n var id = ++idCounter;\n return toString(prefix) + id;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Computes the maximum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the maximum value.\n * @example\n *\n * _.max([4, 2, 8, 6]);\n * // => 8\n *\n * _.max([]);\n * // => undefined\n */\n function max(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseGt)\n : undefined;\n }\n\n /**\n * Computes the minimum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * _.min([4, 2, 8, 6]);\n * // => 2\n *\n * _.min([]);\n * // => undefined\n */\n function min(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseLt)\n : undefined;\n }\n\n /*------------------------------------------------------------------------*/\n\n // Add methods that return wrapped values in chain sequences.\n lodash.after = after;\n lodash.assignIn = assignIn;\n lodash.before = before;\n lodash.bind = bind;\n lodash.chain = chain;\n lodash.compact = compact;\n lodash.concat = concat;\n lodash.countBy = countBy;\n lodash.create = create;\n lodash.debounce = debounce;\n lodash.defaults = defaults;\n lodash.defaultsDeep = defaultsDeep;\n lodash.defer = defer;\n lodash.delay = delay;\n lodash.difference = difference;\n lodash.drop = drop;\n lodash.filter = filter;\n lodash.flatten = flatten;\n lodash.flattenDeep = flattenDeep;\n lodash.groupBy = groupBy;\n lodash.initial = initial;\n lodash.intersection = intersection;\n lodash.invert = invert;\n lodash.invertBy = invertBy;\n lodash.iteratee = iteratee;\n lodash.keys = keys;\n lodash.map = map;\n lodash.matches = matches;\n lodash.merge = merge;\n lodash.mixin = mixin;\n lodash.negate = negate;\n lodash.omit = omit;\n lodash.omitBy = omitBy;\n lodash.once = once;\n lodash.pick = pick;\n lodash.range = range;\n lodash.reject = reject;\n lodash.rest = rest;\n lodash.set = set;\n lodash.slice = slice;\n lodash.sortBy = sortBy;\n lodash.take = take;\n lodash.takeRight = takeRight;\n lodash.tap = tap;\n lodash.throttle = throttle;\n lodash.thru = thru;\n lodash.toArray = toArray;\n lodash.union = union;\n lodash.uniq = uniq;\n lodash.uniqBy = uniqBy;\n lodash.unzip = unzip;\n lodash.values = values;\n lodash.without = without;\n lodash.zip = zip;\n lodash.zipObject = zipObject;\n\n // Add aliases.\n lodash.extend = assignIn;\n\n // Add methods to `lodash.prototype`.\n mixin(lodash, lodash);\n\n /*------------------------------------------------------------------------*/\n\n // Add methods that return unwrapped values in chain sequences.\n lodash.clamp = clamp;\n lodash.clone = clone;\n lodash.cloneDeep = cloneDeep;\n lodash.escape = escape;\n lodash.every = every;\n lodash.find = find;\n lodash.findIndex = findIndex;\n lodash.findKey = findKey;\n lodash.findLastIndex = findLastIndex;\n lodash.findLastKey = findLastKey;\n lodash.forEach = forEach;\n lodash.get = get;\n lodash.has = has;\n lodash.head = head;\n lodash.identity = identity;\n lodash.indexOf = indexOf;\n lodash.isArguments = isArguments;\n lodash.isArray = isArray;\n lodash.isArrayLike = isArrayLike;\n lodash.isBoolean = isBoolean;\n lodash.isDate = isDate;\n lodash.isEmpty = isEmpty;\n lodash.isEqual = isEqual;\n lodash.isFinite = isFinite;\n lodash.isFunction = isFunction;\n lodash.isNaN = isNaN;\n lodash.isNull = isNull;\n lodash.isNumber = isNumber;\n lodash.isObject = isObject;\n lodash.isPlainObject = isPlainObject;\n lodash.isRegExp = isRegExp;\n lodash.isString = isString;\n lodash.isUndefined = isUndefined;\n lodash.last = last;\n lodash.max = max;\n lodash.min = min;\n lodash.noConflict = noConflict;\n lodash.noop = noop;\n lodash.random = random;\n lodash.reduce = reduce;\n lodash.result = result;\n lodash.size = size;\n lodash.some = some;\n lodash.trim = trim;\n lodash.uniqueId = uniqueId;\n\n // Add aliases.\n lodash.each = forEach;\n lodash.first = head;\n\n mixin(lodash, (function() {\n var source = {};\n baseForOwn(lodash, function(func, methodName) {\n if (!hasOwnProperty.call(lodash.prototype, methodName)) {\n source[methodName] = func;\n }\n });\n return source;\n }()), { 'chain': false });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The semantic version number.\n *\n * @static\n * @memberOf _\n * @type {string}\n */\n lodash.VERSION = VERSION;\n\n // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.\n arrayEach(['drop', 'take'], function(methodName, index) {\n LazyWrapper.prototype[methodName] = function(n) {\n n = n === undefined ? 1 : nativeMax(toInteger(n), 0);\n\n var result = (this.__filtered__ && !index)\n ? new LazyWrapper(this)\n : this.clone();\n\n if (result.__filtered__) {\n result.__takeCount__ = nativeMin(n, result.__takeCount__);\n } else {\n result.__views__.push({\n 'size': nativeMin(n, MAX_ARRAY_LENGTH),\n 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')\n });\n }\n return result;\n };\n\n LazyWrapper.prototype[methodName + 'Right'] = function(n) {\n return this.reverse()[methodName](n).reverse();\n };\n });\n\n // Add `LazyWrapper` methods that accept an `iteratee` value.\n arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {\n var type = index + 1,\n isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;\n\n LazyWrapper.prototype[methodName] = function(iteratee) {\n var result = this.clone();\n result.__iteratees__.push({\n 'iteratee': getIteratee(iteratee, 3),\n 'type': type\n });\n result.__filtered__ = result.__filtered__ || isFilter;\n return result;\n };\n });\n\n // Add `LazyWrapper` methods for `_.head` and `_.last`.\n arrayEach(['head', 'last'], function(methodName, index) {\n var takeName = 'take' + (index ? 'Right' : '');\n\n LazyWrapper.prototype[methodName] = function() {\n return this[takeName](1).value()[0];\n };\n });\n\n // Add `LazyWrapper` methods for `_.initial` and `_.tail`.\n arrayEach(['initial', 'tail'], function(methodName, index) {\n var dropName = 'drop' + (index ? '' : 'Right');\n\n LazyWrapper.prototype[methodName] = function() {\n return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);\n };\n });\n\n LazyWrapper.prototype.compact = function() {\n return this.filter(identity);\n };\n\n LazyWrapper.prototype.find = function(predicate) {\n return this.filter(predicate).head();\n };\n\n LazyWrapper.prototype.findLast = function(predicate) {\n return this.reverse().find(predicate);\n };\n\n LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {\n if (typeof path == 'function') {\n return new LazyWrapper(this);\n }\n return this.map(function(value) {\n return baseInvoke(value, path, args);\n });\n });\n\n LazyWrapper.prototype.reject = function(predicate) {\n return this.filter(negate(getIteratee(predicate)));\n };\n\n LazyWrapper.prototype.slice = function(start, end) {\n start = toInteger(start);\n\n var result = this;\n if (result.__filtered__ && (start > 0 || end < 0)) {\n return new LazyWrapper(result);\n }\n if (start < 0) {\n result = result.takeRight(-start);\n } else if (start) {\n result = result.drop(start);\n }\n if (end !== undefined) {\n end = toInteger(end);\n result = end < 0 ? result.dropRight(-end) : result.take(end - start);\n }\n return result;\n };\n\n LazyWrapper.prototype.takeRightWhile = function(predicate) {\n return this.reverse().takeWhile(predicate).reverse();\n };\n\n LazyWrapper.prototype.toArray = function() {\n return this.take(MAX_ARRAY_LENGTH);\n };\n\n // Add `LazyWrapper` methods to `lodash.prototype`.\n baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),\n isTaker = /^(?:head|last)$/.test(methodName),\n lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],\n retUnwrapped = isTaker || /^find/.test(methodName);\n\n if (!lodashFunc) {\n return;\n }\n lodash.prototype[methodName] = function() {\n var value = this.__wrapped__,\n args = isTaker ? [1] : arguments,\n isLazy = value instanceof LazyWrapper,\n iteratee = args[0],\n useLazy = isLazy || isArray(value);\n\n var interceptor = function(value) {\n var result = lodashFunc.apply(lodash, arrayPush([value], args));\n return (isTaker && chainAll) ? result[0] : result;\n };\n\n if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {\n // Avoid lazy use if the iteratee has a \"length\" value other than `1`.\n isLazy = useLazy = false;\n }\n var chainAll = this.__chain__,\n isHybrid = !!this.__actions__.length,\n isUnwrapped = retUnwrapped && !chainAll,\n onlyLazy = isLazy && !isHybrid;\n\n if (!retUnwrapped && useLazy) {\n value = onlyLazy ? value : new LazyWrapper(this);\n var result = func.apply(value, args);\n result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });\n return new LodashWrapper(result, chainAll);\n }\n if (isUnwrapped && onlyLazy) {\n return func.apply(this, args);\n }\n result = this.thru(interceptor);\n return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;\n };\n });\n\n // Add `Array` methods to `lodash.prototype`.\n arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {\n var func = arrayProto[methodName],\n chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',\n retUnwrapped = /^(?:pop|shift)$/.test(methodName);\n\n lodash.prototype[methodName] = function() {\n var args = arguments;\n if (retUnwrapped && !this.__chain__) {\n var value = this.value();\n return func.apply(isArray(value) ? value : [], args);\n }\n return this[chainName](function(value) {\n return func.apply(isArray(value) ? value : [], args);\n });\n };\n });\n\n // Map minified method names to their real names.\n baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n var lodashFunc = lodash[methodName];\n if (lodashFunc) {\n var key = (lodashFunc.name + ''),\n names = realNames[key] || (realNames[key] = []);\n\n names.push({ 'name': methodName, 'func': lodashFunc });\n }\n });\n\n realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{\n 'name': 'wrapper',\n 'func': undefined\n }];\n\n // Add methods to `LazyWrapper`.\n LazyWrapper.prototype.clone = lazyClone;\n LazyWrapper.prototype.reverse = lazyReverse;\n LazyWrapper.prototype.value = lazyValue;\n\n // Add lazy aliases.\n lodash.prototype.first = lodash.prototype.head;\n\n if (symIterator) {\n lodash.prototype[symIterator] = wrapperToIterator;\n }\n\n /*--------------------------------------------------------------------------*/\n\n // Some AMD build optimizers, like r.js, check for condition patterns like:\n if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {\n // Expose Lodash on the global object to prevent errors when Lodash is\n // loaded by a script tag in the presence of an AMD loader.\n // See http://requirejs.org/docs/errors.html#mismatch for more details.\n // Use `_.noConflict` to remove Lodash from the global object.\n root._ = lodash;\n\n // Define as an anonymous module so, through path mapping, it can be\n // referenced as the \"underscore\" module.\n define(function() {\n return lodash;\n });\n }\n // Check for `exports` after `define` in case a build optimizer adds it.\n else if (freeModule) {\n // Export for Node.js.\n (freeModule.exports = lodash)._ = lodash;\n // Export for CommonJS support.\n freeExports._ = lodash;\n }\n else {\n // Export to the global object.\n root._ = lodash;\n }\n}.call(this));\n"
/***/ }),
/* 105 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, setImmediate) {/**
* 基本函数
* Create By GUY 2014\11\17
*
*/
_global = undefined;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
}
!(function (undefined) {
var traverse = function (func, context) {
return function (value, key, obj) {
return func.call(context, key, value, obj);
};
};
var _apply = function (name) {
return function () {
return _[name].apply(_, arguments);
};
};
var _applyFunc = function (name) {
return function () {
var args = Array.prototype.slice.call(arguments, 0);
args[1] = _.isFunction(args[1]) ? traverse(args[1], args[2]) : args[1];
return _[name].apply(_, args);
};
};
// Utility
_.extend(BI, {
assert: function (v, is) {
if (this.isFunction(is)) {
if (!is(v)) {
throw new Error(v + " error");
} else {
return true;
}
}
if (!this.isArray(is)) {
is = [is];
}
if (!this.deepContains(is, v)) {
throw new Error(v + " error");
}
return true;
},
warn: function (message) {
console.warn(message);
},
UUID: function () {
var f = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
var str = "";
for (var i = 0; i < 16; i++) {
var r = parseInt(f.length * Math.random(), 10);
str += f[r];
}
return str;
},
isWidget: function (widget) {
return widget instanceof BI.Widget || (BI.View && widget instanceof BI.View);
},
createWidgets: function (items, options, context) {
if (!BI.isArray(items)) {
throw new Error("cannot create Widgets");
}
if (BI.isWidget(options)) {
context = options;
options = {};
} else {
options || (options = {});
}
return BI.map(BI.flatten(items), function (i, item) {
return BI.createWidget(item, BI.deepClone(options));
});
},
createItems: function (data, innerAttr, outerAttr) {
innerAttr = BI.isArray(innerAttr) ? innerAttr : BI.makeArray(BI.flatten(data).length, innerAttr || {});
outerAttr = BI.isArray(outerAttr) ? outerAttr : BI.makeArray(BI.flatten(data).length, outerAttr || {});
return BI.map(data, function (i, item) {
if (BI.isArray(item)) {
return BI.createItems(item, innerAttr, outerAttr);
}
if (item instanceof BI.Widget) {
return BI.extend({}, innerAttr.shift(), outerAttr.shift(), {
type: null,
el: item
});
}
if (innerAttr[0] instanceof BI.Widget) {
outerAttr.shift();
return BI.extend({}, item, {
el: innerAttr.shift()
});
}
if (item.el instanceof BI.Widget || (BI.View && item.el instanceof BI.View)) {
innerAttr.shift();
return BI.extend({}, outerAttr.shift(), { type: null }, item);
}
if (item.el) {
return BI.extend({}, outerAttr.shift(), item, {
el: BI.extend({}, innerAttr.shift(), item.el)
});
}
return BI.extend({}, outerAttr.shift(), {
el: BI.extend({}, innerAttr.shift(), item)
});
});
},
// 用容器包装items
packageItems: function (items, layouts) {
for (var i = layouts.length - 1; i >= 0; i--) {
items = BI.map(items, function (k, it) {
return BI.extend({}, layouts[i], {
items: [
BI.extend({}, layouts[i].el, {
el: it
})
]
});
});
}
return items;
},
formatEL: function (obj) {
if (obj && !obj.type && obj.el) {
return obj;
}
return {
el: obj
};
},
// 剥开EL
stripEL: function (obj) {
return obj.type && obj || obj.el || obj;
},
trans2Element: function (widgets) {
return BI.map(widgets, function (i, wi) {
return wi.element;
});
}
});
// 集合相关方法
_.each(["where", "findWhere", "invoke", "pluck", "shuffle", "sample", "toArray", "size"], function (name) {
BI[name] = _apply(name);
});
_.each(["get", "set", "each", "map", "reduce", "reduceRight", "find", "filter", "reject", "every", "all", "some", "any", "max", "min",
"sortBy", "groupBy", "indexBy", "countBy", "partition", "clamp"], function (name) {
if (name === "any") {
BI[name] = _applyFunc("some");
} else {
BI[name] = _applyFunc(name);
}
});
_.extend(BI, {
// 数数
count: function (from, to, predicate) {
var t;
if (predicate) {
for (t = from; t < to; t++) {
predicate(t);
}
}
return to - from;
},
// 倒数
inverse: function (from, to, predicate) {
return BI.count(to, from, predicate);
},
firstKey: function (obj) {
var res = undefined;
BI.any(obj, function (key, value) {
res = key;
return true;
});
return res;
},
lastKey: function (obj) {
var res = undefined;
BI.each(obj, function (key, value) {
res = key;
return true;
});
return res;
},
firstObject: function (obj) {
var res = undefined;
BI.any(obj, function (key, value) {
res = value;
return true;
});
return res;
},
lastObject: function (obj) {
var res = undefined;
BI.each(obj, function (key, value) {
res = value;
return true;
});
return res;
},
concat: function (obj1, obj2) {
if (BI.isKey(obj1)) {
return BI.map([].slice.apply(arguments), function (idx, v) {
return v;
}).join("");
}
if (BI.isArray(obj1)) {
return _.concat.apply([], arguments);
}
if (BI.isObject(obj1)) {
return _.extend.apply({}, arguments);
}
},
backEach: function (obj, predicate, context) {
predicate = BI.iteratee(predicate, context);
for (var index = obj.length - 1; index >= 0; index--) {
predicate(index, obj[index], obj);
}
return false;
},
backAny: function (obj, predicate, context) {
predicate = BI.iteratee(predicate, context);
for (var index = obj.length - 1; index >= 0; index--) {
if (predicate(index, obj[index], obj)) {
return true;
}
}
return false;
},
backEvery: function (obj, predicate, context) {
predicate = BI.iteratee(predicate, context);
for (var index = obj.length - 1; index >= 0; index--) {
if (!predicate(index, obj[index], obj)) {
return false;
}
}
return true;
},
backFindKey: function (obj, predicate, context) {
predicate = BI.iteratee(predicate, context);
var keys = _.keys(obj), key;
for (var i = keys.length - 1; i >= 0; i--) {
key = keys[i];
if (predicate(obj[key], key, obj)) {
return key;
}
}
},
backFind: function (obj, predicate, context) {
var key;
if (BI.isArray(obj)) {
key = BI.findLastIndex(obj, predicate, context);
} else {
key = BI.backFindKey(obj, predicate, context);
}
if (key !== void 0 && key !== -1) {
return obj[key];
}
},
remove: function (obj, target, context) {
var isFunction = BI.isFunction(target);
target = isFunction || BI.isArray(target) ? target : [target];
var i;
if (BI.isArray(obj)) {
for (i = 0; i < obj.length; i++) {
if ((isFunction && target.apply(context, [i, obj[i]]) === true) || (!isFunction && BI.contains(target, obj[i]))) {
obj.splice(i--, 1);
}
}
} else {
BI.each(obj, function (i, v) {
if ((isFunction && target.apply(context, [i, obj[i]]) === true) || (!isFunction && BI.contains(target, obj[i]))) {
delete obj[i];
}
});
}
},
removeAt: function (obj, index) {
index = BI.isArray(index) ? index : [index];
var isArray = BI.isArray(obj), i;
for (i = 0; i < index.length; i++) {
if (isArray) {
obj[index[i]] = "$deleteIndex";
} else {
delete obj[index[i]];
}
}
if (isArray) {
BI.remove(obj, "$deleteIndex");
}
},
string2Array: function (str) {
return str.split("&-&");
},
array2String: function (array) {
return array.join("&-&");
},
abc2Int: function (str) {
var idx = 0, start = "A", str = str.toUpperCase();
for (var i = 0, len = str.length; i < len; ++i) {
idx = str.charAt(i).charCodeAt(0) - start.charCodeAt(0) + 26 * idx + 1;
if (idx > (2147483646 - str.charAt(i).charCodeAt(0) + start.charCodeAt(0)) / 26) {
return 0;
}
}
return idx;
},
int2Abc: function (num) {
var DIGITS = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
var idx = num, str = "";
if (num === 0) {
return "";
}
while (idx !== 0) {
var t = idx % 26;
if (t === 0) {
t = 26;
}
str = DIGITS[t - 1] + str;
idx = (idx - t) / 26;
}
return str;
}
});
// 数组相关的方法
_.each(["first", "initial", "last", "rest", "compact", "flatten", "without", "union", "intersection",
"difference", "zip", "unzip", "object", "indexOf", "lastIndexOf", "sortedIndex", "range", "take", "takeRight", "uniqBy"], function (name) {
BI[name] = _apply(name);
});
_.each(["findIndex", "findLastIndex"], function (name) {
BI[name] = _applyFunc(name);
});
_.extend(BI, {
// 构建一个长度为length的数组
makeArray: function (length, value) {
var res = [];
for (var i = 0; i < length; i++) {
if (BI.isNull(value)) {
res.push(i);
} else {
res.push(BI.deepClone(value));
}
}
return res;
},
makeObject: function (array, value) {
var map = {};
for (var i = 0; i < array.length; i++) {
if (BI.isNull(value)) {
map[array[i]] = array[i];
} else {
map[array[i]] = BI.deepClone(value);
}
}
return map;
},
makeArrayByArray: function (array, value) {
var res = [];
if (!array) {
return res;
}
for (var i = 0, len = array.length; i < len; i++) {
if (BI.isArray(array[i])) {
res.push(arguments.callee(array[i], value));
} else {
res.push(BI.deepClone(value));
}
}
return res;
},
uniq: function (array, isSorted, iteratee, context) {
if (array == null) {
return [];
}
if (!_.isBoolean(isSorted)) {
context = iteratee;
iteratee = isSorted;
isSorted = false;
}
iteratee && (iteratee = traverse(iteratee, context));
return _.uniq.call(_, array, isSorted, iteratee, context);
}
});
// 对象相关方法
_.each(["keys", "allKeys", "values", "pairs", "invert", "create", "functions", "extend", "extendOwn",
"defaults", "clone", "property", "propertyOf", "matcher", "isEqual", "isMatch", "isEmpty",
"isElement", "isNumber", "isString", "isArray", "isObject", "isPlainObject", "isArguments", "isFunction", "isFinite",
"isBoolean", "isDate", "isRegExp", "isError", "isNaN", "isUndefined", "zipObject", "cloneDeep"], function (name) {
BI[name] = _apply(name);
});
_.each(["mapObject", "findKey", "pick", "omit", "tap"], function (name) {
BI[name] = _applyFunc(name);
});
_.extend(BI, {
inherit: function (sb, sp, overrides) {
if (typeof sp === "object") {
overrides = sp;
sp = sb;
sb = function () {
return sp.apply(this, arguments);
};
}
var F = function () {
}, spp = sp.prototype;
F.prototype = spp;
sb.prototype = new F();
sb.superclass = spp;
_.extend(sb.prototype, overrides, {
superclass: sp
});
return sb;
},
init: function () {
// 先把准备环境准备好
while (BI.prepares && BI.prepares.length > 0) {
BI.prepares.shift()();
}
while (_global.___fineuiExposedFunction && _global.___fineuiExposedFunction.length > 0) {
_global.___fineuiExposedFunction.shift()();
}
BI.initialized = true;
},
has: function (obj, keys) {
if (BI.isArray(keys)) {
if (keys.length === 0) {
return false;
}
return BI.every(keys, function (i, key) {
return _.has(obj, key);
});
}
return _.has.apply(_, arguments);
},
freeze: function (value) {
// 在ES5中,如果这个方法的参数不是一个对象(一个原始值),那么它会导致 TypeError
// 在ES2015中,非对象参数将被视为要被冻结的普通对象,并被简单地返回
if (Object.freeze && BI.isObject(value)) {
return Object.freeze(value);
}
return value;
},
// 数字和字符串可以作为key
isKey: function (key) {
return BI.isNumber(key) || (BI.isString(key) && key.length > 0);
},
// 忽略大小写的等于
isCapitalEqual: function (a, b) {
a = BI.isNull(a) ? a : ("" + a).toLowerCase();
b = BI.isNull(b) ? b : ("" + b).toLowerCase();
return BI.isEqual(a, b);
},
isWidthOrHeight: function (w) {
if (typeof w === "number") {
return w >= 0;
} else if (typeof w === "string") {
return /^\d{1,3}%$/.exec(w) || w == "auto" || /^\d+px$/.exec(w);
}
},
isNotNull: function (obj) {
return !BI.isNull(obj);
},
isNull: function (obj) {
return typeof obj === "undefined" || obj === null;
},
isEmptyArray: function (arr) {
return BI.isArray(arr) && BI.isEmpty(arr);
},
isNotEmptyArray: function (arr) {
return BI.isArray(arr) && !BI.isEmpty(arr);
},
isEmptyObject: function (obj) {
return BI.isEqual(obj, {});
},
isNotEmptyObject: function (obj) {
return BI.isPlainObject(obj) && !BI.isEmptyObject(obj);
},
isEmptyString: function (obj) {
return BI.isString(obj) && obj.length === 0;
},
isNotEmptyString: function (obj) {
return BI.isString(obj) && !BI.isEmptyString(obj);
},
isWindow: function (obj) {
return obj != null && obj == obj.window;
}
});
// deep方法
_.extend(BI, {
deepClone: _.cloneDeep,
deepExtend: _.merge,
isDeepMatch: function (object, attrs) {
var keys = BI.keys(attrs), length = keys.length;
if (object == null) {
return !length;
}
var obj = Object(object);
for (var i = 0; i < length; i++) {
var key = keys[i];
if (!BI.isEqual(attrs[key], obj[key]) || !(key in obj)) {
return false;
}
}
return true;
},
contains: function (obj, target, fromIndex) {
if (!_.isArrayLike(obj)) obj = _.values(obj);
return _.indexOf(obj, target, typeof fromIndex === "number" && fromIndex) >= 0;
},
deepContains: function (obj, copy) {
if (BI.isObject(copy)) {
return BI.any(obj, function (i, v) {
if (BI.isEqual(v, copy)) {
return true;
}
});
}
return BI.contains(obj, copy);
},
deepIndexOf: function (obj, target) {
for (var i = 0; i < obj.length; i++) {
if (BI.isEqual(target, obj[i])) {
return i;
}
}
return -1;
},
deepRemove: function (obj, target) {
var done = false;
var i;
if (BI.isArray(obj)) {
for (i = 0; i < obj.length; i++) {
if (BI.isEqual(target, obj[i])) {
obj.splice(i--, 1);
done = true;
}
}
} else {
BI.each(obj, function (i, v) {
if (BI.isEqual(target, obj[i])) {
delete obj[i];
done = true;
}
});
}
return done;
},
deepWithout: function (obj, target) {
if (BI.isArray(obj)) {
var result = [];
for (var i = 0; i < obj.length; i++) {
if (!BI.isEqual(target, obj[i])) {
result.push(obj[i]);
}
}
return result;
}
var result = {};
BI.each(obj, function (i, v) {
if (!BI.isEqual(target, obj[i])) {
result[i] = v;
}
});
return result;
},
deepUnique: function (array) {
var result = [];
BI.each(array, function (i, item) {
if (!BI.deepContains(result, item)) {
result.push(item);
}
});
return result;
},
// 比较两个对象得出不一样的key值
deepDiff: function (object, other) {
object || (object = {});
other || (other = {});
var result = [];
var used = [];
for (var b in object) {
if (this.has(object, b)) {
if (!this.isEqual(object[b], other[b])) {
result.push(b);
}
used.push(b);
}
}
for (var b in other) {
if (this.has(other, b) && !BI.contains(used, b)) {
result.push(b);
}
}
return result;
}
});
// 通用方法
_.each(["uniqueId", "result", "chain", "iteratee", "escape", "unescape", "before", "after"], function (name) {
BI[name] = function () {
return _[name].apply(_, arguments);
};
});
// 事件相关方法
_.each(["bind", "once", "partial", "debounce", "throttle", "delay", "defer", "wrap"], function (name) {
BI[name] = function () {
return _[name].apply(_, arguments);
};
});
_.extend(BI, {
nextTick: (function () {
var callbacks = [];
var pending = false;
var timerFunc = void 0;
function nextTickHandler() {
pending = false;
var copies = callbacks.slice(0);
callbacks.length = 0;
for (var i = 0; i < copies.length; i++) {
copies[i]();
}
}
if (typeof Promise !== "undefined") {
var p = Promise.resolve();
timerFunc = function timerFunc() {
p.then(nextTickHandler);
};
} else if (typeof MutationObserver !== "undefined") {
var counter = 1;
var observer = new MutationObserver(nextTickHandler);
var textNode = document.createTextNode(String(counter));
observer.observe(textNode, {
characterData: true
});
timerFunc = function timerFunc() {
counter = (counter + 1) % 2;
textNode.data = String(counter);
};
} else if (typeof setImmediate !== "undefined") {
timerFunc = function timerFunc() {
setImmediate(nextTickHandler);
};
} else {
// Fallback to setTimeout.
timerFunc = function timerFunc() {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb) {
var _resolve = void 0;
var args = [].slice.call(arguments, 1);
callbacks.push(function () {
if (cb) {
try {
cb.apply(null, args);
} catch (e) {
console.error(e);
}
} else if (_resolve) {
_resolve.apply(null, args);
}
});
if (!pending) {
pending = true;
timerFunc();
}
// $flow-disable-line
if (!cb && typeof Promise !== 'undefined') {
return new Promise(function (resolve, reject) {
_resolve = resolve;
});
}
};
})()
});
// 数字相关方法
_.each(["random"], function (name) {
BI[name] = _apply(name);
});
_.extend(BI, {
getTime: function () {
if (_global.performance && _global.performance.now) {
return _global.performance.now();
}
if (_global.performance && _global.performance.webkitNow) {
return _global.performance.webkitNow();
}
if (Date.now) {
return Date.now();
}
return BI.getDate().getTime();
},
parseInt: function (number) {
var radix = 10;
if (/^0x/g.test(number)) {
radix = 16;
}
try {
return parseInt(number, radix);
} catch (e) {
throw new Error(number + "parse int error");
return NaN;
}
},
parseSafeInt: function (value) {
var MAX_SAFE_INTEGER = 9007199254740991;
return value
? this.clamp(this.parseInt(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
: (value === 0 ? value : 0);
},
parseFloat: function (number) {
try {
return parseFloat(number);
} catch (e) {
throw new Error(number + "parse float error");
return NaN;
}
},
isNaturalNumber: function (number) {
if (/^\d+$/.test(number)) {
return true;
}
return false;
},
isPositiveInteger: function (number) {
if (/^\+?[1-9][0-9]*$/.test(number)) {
return true;
}
return false;
},
isNegativeInteger: function (number) {
if (/^\-[1-9][0-9]*$/.test(number)) {
return true;
}
return false;
},
isInteger: function (number) {
if (/^\-?\d+$/.test(number)) {
return true;
}
return false;
},
isNumeric: function (number) {
return !isNaN(parseFloat(number)) && isFinite(number);
},
isFloat: function (number) {
if (/^([+-]?)\d*\.\d+$/.test(number)) {
return true;
}
return false;
},
isOdd: function (number) {
if (!BI.isInteger(number)) {
return false;
}
return (number & 1) === 1;
},
isEven: function (number) {
if (!BI.isInteger(number)) {
return false;
}
return (number & 1) === 0;
},
sum: function (array, iteratee, context) {
var sum = 0;
BI.each(array, function (i, item) {
if (iteratee) {
sum += Number(iteratee.apply(context, [i, item]));
} else {
sum += Number(item);
}
});
return sum;
},
average: function (array, iteratee, context) {
var sum = BI.sum(array, iteratee, context);
return sum / array.length;
}
});
// 字符串相关方法
_.extend(BI, {
trim: function () {
return _.trim.apply(_, arguments);
},
toUpperCase: function (string) {
return (string + "").toLocaleUpperCase();
},
toLowerCase: function (string) {
return (string + "").toLocaleLowerCase();
},
isEndWithBlank: function (string) {
return /(\s|\u00A0)$/.test(string);
},
isLiteral: function (exp) {
var literalValueRE = /^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/;
return literalValueRE.test(exp);
},
stripQuotes: function (str) {
var a = str.charCodeAt(0);
var b = str.charCodeAt(str.length - 1);
return a === b && (a === 0x22 || a === 0x27)
? str.slice(1, -1)
: str;
},
// background-color => backgroundColor
camelize: function (str) {
return str.replace(/-(.)/g, function (_, character) {
return character.toUpperCase();
});
},
// backgroundColor => background-color
hyphenate: function (str) {
return str.replace(/([A-Z])/g, "-$1").toLowerCase();
},
isNotEmptyString: function (str) {
return BI.isString(str) && !BI.isEmpty(str);
},
isEmptyString: function (str) {
return BI.isString(str) && BI.isEmpty(str);
},
/**
* 通用加密方法
*/
encrypt: function (type, text, key) {
switch (type) {
case BI.CRYPT_TYPE.AES:
default:
return BI.aesEncrypt(text, key);
}
},
/**
* 通用解密方法
* @param type 解密方式
* @param text 文本
* @param key 种子
* @return {*}
*/
decrypt: function (type, text, key) {
switch (type) {
case BI.CRYPT_TYPE.AES:
default:
return BI.aesDecrypt(text, key);
}
},
/**
* 对字符串中的'和\做编码处理
* @static
* @param {String} string 要做编码处理的字符串
* @return {String} 编码后的字符串
*/
escape: function (string) {
return string.replace(/('|\\)/g, "\\$1");
},
/**
* 让字符串通过指定字符做补齐的函数
*
* var s = BI.leftPad('123', 5, '0');//s的值为:'00123'
*
* @static
* @param {String} val 原始值
* @param {Number} size 总共需要的位数
* @param {String} ch 用于补齐的字符
* @return {String} 补齐后的字符串
*/
leftPad: function (val, size, ch) {
var result = String(val);
if (!ch) {
ch = " ";
}
while (result.length < size) {
result = ch + result;
}
return result.toString();
},
/**
* 对字符串做替换的函数
*
* var cls = 'my-class', text = 'Some text';
* var res = BI.format('<div class="{0}">{1}</div>', cls, text);
* //res的值为:'<div class="my-class">Some text</div>';
*
* @static
* @param {String} format 要做替换的字符串,替换字符串1,替换字符串2...
* @return {String} 做了替换后的字符串
*/
format: function (format) {
var args = Array.prototype.slice.call(arguments, 1);
return format.replace(/\{(\d+)\}/g, function (m, i) {
return args[i];
});
}
});
// 日期相关方法
_.extend(BI, {
/**
* 是否是闰年
* @param year
* @returns {boolean}
*/
isLeapYear: function (year) {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
},
/**
* 检测是否在有效期
*
* @param YY 年
* @param MM 月
* @param DD 日
* @param minDate '1900-01-01'
* @param maxDate '2099-12-31'
* @returns {Array} 若无效返回无效状态
*/
checkDateVoid: function (YY, MM, DD, minDate, maxDate) {
var back = [];
YY = YY | 0;
MM = MM | 0;
DD = DD | 0;
minDate = BI.isString(minDate) ? minDate.match(/\d+/g) : minDate;
maxDate = BI.isString(maxDate) ? maxDate.match(/\d+/g) : maxDate;
if (YY < minDate[0]) {
back = ["y"];
} else if (YY > maxDate[0]) {
back = ["y", 1];
} else if (YY >= minDate[0] && YY <= maxDate[0]) {
if (YY == minDate[0]) {
if (MM < minDate[1]) {
back = ["m"];
} else if (MM == minDate[1]) {
if (DD < minDate[2]) {
back = ["d"];
}
}
}
if (YY == maxDate[0]) {
if (MM > maxDate[1]) {
back = ["m", 1];
} else if (MM == maxDate[1]) {
if (DD > maxDate[2]) {
back = ["d", 1];
}
}
}
}
return back;
},
checkDateLegal: function (str) {
var ar = str.match(/\d+/g);
var YY = ar[0] | 0, MM = ar[1] | 0, DD = ar[2] | 0;
if (ar.length <= 1) {
return true;
}
if (ar.length <= 2) {
return MM >= 1 && MM <= 12;
}
var MD = BI.Date._MD.slice(0);
MD[1] = BI.isLeapYear(YY) ? 29 : 28;
return MM >= 1 && MM <= 12 && DD <= MD[MM - 1];
},
parseDateTime: function (str, fmt) {
var today = BI.getDate();
var y = 0;
var m = 0;
var d = 1;
// wei : 对于fmt为‘YYYYMM’或者‘YYYYMMdd’的格式,str的值为类似'201111'的形式,因为年月之间没有分隔符,所以正则表达式分割无效,导致bug7376。
var a = str.split(/\W+/);
if (fmt.toLowerCase() == "%y%x" || fmt.toLowerCase() == "%y%x%d") {
var yearlength = 4;
var otherlength = 2;
a[0] = str.substring(0, yearlength);
a[1] = str.substring(yearlength, yearlength + otherlength);
a[2] = str.substring(yearlength + otherlength, yearlength + otherlength * 2);
}
var b = fmt.match(/%./g);
var i = 0, j = 0;
var hr = 0;
var min = 0;
var sec = 0;
for (i = 0; i < a.length; ++i) {
switch (b[i]) {
case "%d":
case "%e":
d = parseInt(a[i], 10);
break;
case "%X":
m = parseInt(a[i], 10) - 1;
break;
case "%x":
m = parseInt(a[i], 10) - 1;
break;
case "%Y":
case "%y":
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
break;
case "%b":
case "%B":
for (j = 0; j < 12; ++j) {
if (BI.Date._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) {
m = j;
break;
}
}
break;
case "%H":
case "%I":
case "%k":
case "%l":
hr = parseInt(a[i], 10);
break;
case "%P":
case "%p":
if (/pm/i.test(a[i]) && hr < 12) {
hr += 12;
} else if (/am/i.test(a[i]) && hr >= 12) {
hr -= 12;
}
break;
case "%M":
min = parseInt(a[i], 10);
case "%S":
sec = parseInt(a[i], 10);
break;
}
}
// if (!a[i]) {
// continue;
// }
if (isNaN(y)) {
y = today.getFullYear();
}
if (isNaN(m)) {
m = today.getMonth();
}
if (isNaN(d)) {
d = today.getDate();
}
if (isNaN(hr)) {
hr = today.getHours();
}
if (isNaN(min)) {
min = today.getMinutes();
}
if (isNaN(sec)) {
sec = today.getSeconds();
}
if (y != 0) {
return BI.getDate(y, m, d, hr, min, sec);
}
y = 0;
m = -1;
d = 0;
for (i = 0; i < a.length; ++i) {
if (a[i].search(/[a-zA-Z]+/) != -1) {
var t = -1;
for (j = 0; j < 12; ++j) {
if (BI.Date._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) {
t = j;
break;
}
}
if (t != -1) {
if (m != -1) {
d = m + 1;
}
m = t;
}
} else if (parseInt(a[i], 10) <= 12 && m == -1) {
m = a[i] - 1;
} else if (parseInt(a[i], 10) > 31 && y == 0) {
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
} else if (d == 0) {
d = a[i];
}
}
if (y == 0) {
y = today.getFullYear();
}
if (m != -1 && d != 0) {
return BI.getDate(y, m, d, hr, min, sec);
}
return today;
},
getDate: function () {
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if (BI.isNotNull(BI.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))) {
var localTime = dt.getTime();
// BI-33791 1901年以前的东8区标准是GMT+0805, 统一无论是什么时间,都以整的0800这样的为基准
var localOffset = dt.getTimezoneOffset() * 60000; // 获得当地时间偏移的毫秒数
var utc = localTime + localOffset; // utc即GMT时间标准时区
return new Date(utc + BI.timeZone);// + Pool.timeZone.offset);
}
return dt;
},
getTime: function () {
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if (BI.isNotNull(BI.timeZone)) {
// BI-33791 1901年以前的东8区标准是GMT+0805, 统一无论是什么时间,都以整的0800这样的为基准
return dt.getTime() - BI.timeZone - new Date().getTimezoneOffset() * 60000;
}
return dt.getTime();
}
});
})();
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13), __webpack_require__(52).setImmediate))
/***/ }),
/* 106 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global, process) {
(function (global, undefined) {
"use strict";
if (global.setImmediate) {
return;
}
var nextHandle = 1; // Spec says greater than zero
var tasksByHandle = {};
var currentlyRunningATask = false;
var doc = global.document;
var registerImmediate;
function setImmediate(callback) {
// Callback can either be a function or a string
if (typeof callback !== "function") {
callback = new Function("" + callback);
} // Copy function arguments
var args = new Array(arguments.length - 1);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i + 1];
} // Store and register the task
var task = {
callback: callback,
args: args
};
tasksByHandle[nextHandle] = task;
registerImmediate(nextHandle);
return nextHandle++;
}
function clearImmediate(handle) {
delete tasksByHandle[handle];
}
function run(task) {
var callback = task.callback;
var args = task.args;
switch (args.length) {
case 0:
callback();
break;
case 1:
callback(args[0]);
break;
case 2:
callback(args[0], args[1]);
break;
case 3:
callback(args[0], args[1], args[2]);
break;
default:
callback.apply(undefined, args);
break;
}
}
function runIfPresent(handle) {
// From the spec: "Wait until any invocations of this algorithm started before this one have completed."
// So if we're currently running a task, we'll need to delay this invocation.
if (currentlyRunningATask) {
// Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
// "too much recursion" error.
setTimeout(runIfPresent, 0, handle);
} else {
var task = tasksByHandle[handle];
if (task) {
currentlyRunningATask = true;
try {
run(task);
} finally {
clearImmediate(handle);
currentlyRunningATask = false;
}
}
}
}
function installNextTickImplementation() {
registerImmediate = function registerImmediate(handle) {
process.nextTick(function () {
runIfPresent(handle);
});
};
}
function canUsePostMessage() {
// The test against `importScripts` prevents this implementation from being installed inside a web worker,
// where `global.postMessage` means something completely different and can't be used for this purpose.
if (global.postMessage && !global.importScripts) {
var postMessageIsAsynchronous = true;
var oldOnMessage = global.onmessage;
global.onmessage = function () {
postMessageIsAsynchronous = false;
};
global.postMessage("", "*");
global.onmessage = oldOnMessage;
return postMessageIsAsynchronous;
}
}
function installPostMessageImplementation() {
// Installs an event handler on `global` for the `message` event: see
// * https://developer.mozilla.org/en/DOM/window.postMessage
// * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
var messagePrefix = "setImmediate$" + Math.random() + "$";
var onGlobalMessage = function onGlobalMessage(event) {
if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) {
runIfPresent(+event.data.slice(messagePrefix.length));
}
};
if (global.addEventListener) {
global.addEventListener("message", onGlobalMessage, false);
} else {
global.attachEvent("onmessage", onGlobalMessage);
}
registerImmediate = function registerImmediate(handle) {
global.postMessage(messagePrefix + handle, "*");
};
}
function installMessageChannelImplementation() {
var channel = new MessageChannel();
channel.port1.onmessage = function (event) {
var handle = event.data;
runIfPresent(handle);
};
registerImmediate = function registerImmediate(handle) {
channel.port2.postMessage(handle);
};
}
function installReadyStateChangeImplementation() {
var html = doc.documentElement;
registerImmediate = function registerImmediate(handle) {
// Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
// into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
var script = doc.createElement("script");
script.onreadystatechange = function () {
runIfPresent(handle);
script.onreadystatechange = null;
html.removeChild(script);
script = null;
};
html.appendChild(script);
};
}
function installSetTimeoutImplementation() {
registerImmediate = function registerImmediate(handle) {
setTimeout(runIfPresent, 0, handle);
};
} // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
attachTo = attachTo && attachTo.setTimeout ? attachTo : global; // Don't get fooled by e.g. browserify environments.
if ({}.toString.call(global.process) === "[object process]") {
// For Node.js before 0.9
installNextTickImplementation();
} else if (canUsePostMessage()) {
// For non-IE10 modern browsers
installPostMessageImplementation();
} else if (global.MessageChannel) {
// For web workers, where supported
installMessageChannelImplementation();
} else if (doc && "onreadystatechange" in doc.createElement("script")) {
// For IE 6–8
installReadyStateChangeImplementation();
} else {
// For older browsers
installSetTimeoutImplementation();
}
attachTo.setImmediate = setImmediate;
attachTo.clearImmediate = clearImmediate;
})(typeof self === "undefined" ? typeof global === "undefined" ? void 0 : global : self);
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13), __webpack_require__(66)))
/***/ }),
/* 107 */
/***/ (function(module, exports) {
!(function () {
function extend () {
var target = arguments[0] || {}, length = arguments.length, i = 1, options, name, src, copy;
for (; i < length; i++) {
// Only deal with non-null/undefined values
if ((options = arguments[i]) != null) {
// Extend the base object
for (name in options) {
src = target[name];
copy = options[name];
// Prevent never-ending loop
if (target === copy) {
continue;
}
if (copy !== undefined) {
target[name] = copy;
}
}
}
}
return target;
}
/**
* 客户端观察者,主要处理事件的添加、删除、执行等
* @class BI.OB
* @abstract
*/
BI.OB = function (config) {
this._constructor(config);
};
_.extend(BI.OB.prototype, {
props: {},
init: null,
destroyed: null,
_constructor: function (config) {
this._initProps(config);
this._init();
this._initRef();
},
_defaultConfig: function (config) {
return {};
},
_initProps: function (config) {
var props = this.props;
if (BI.isFunction(this.props)) {
props = this.props(config);
}
this.options = extend(this._defaultConfig(config), props, config);
},
_init: function () {
this._initListeners();
this.init && this.init();
},
_initListeners: function () {
var self = this;
if (this.options.listeners != null) {
_.each(this.options.listeners, function (lis) {
(lis.target ? lis.target : self)[lis.once ? "once" : "on"]
(lis.eventName, _.bind(lis.action, self));
});
delete this.options.listeners;
}
},
// 获得一个当前对象的引用
_initRef: function () {
if (this.options.ref) {
this.options.ref.call(this, this);
}
},
//释放当前对象
_purgeRef: function () {
if (this.options.ref) {
this.options.ref.call(null);
this.options.ref = null;
}
},
_getEvents: function () {
if (!_.isArray(this.events)) {
this.events = [];
}
return this.events;
},
/**
* 给观察者绑定一个事件
* @param {String} eventName 事件的名字
* @param {Function} fn 事件对应的执行函数
*/
on: function (eventName, fn) {
eventName = eventName.toLowerCase();
var fns = this._getEvents()[eventName];
if (!_.isArray(fns)) {
fns = [];
this._getEvents()[eventName] = fns;
}
fns.push(fn);
},
/**
* 给观察者绑定一个只执行一次的事件
* @param {String} eventName 事件的名字
* @param {Function} fn 事件对应的执行函数
*/
once: function (eventName, fn) {
var proxy = function () {
fn.apply(this, arguments);
this.un(eventName, proxy);
};
this.on(eventName, proxy);
},
/**
* 解除观察者绑定的指定事件
* @param {String} eventName 要解除绑定事件的名字
* @param {Function} fn 事件对应的执行函数,该参数是可选的,没有该参数时,将解除绑定所有同名字的事件
*/
un: function (eventName, fn) {
eventName = eventName.toLowerCase();
/* alex:如果fn是null,就是把eventName上面所有方法都un掉*/
if (fn == null) {
delete this._getEvents()[eventName];
} else {
var fns = this._getEvents()[eventName];
if (_.isArray(fns)) {
var newFns = [];
_.each(fns, function (ifn) {
if (ifn != fn) {
newFns.push(ifn);
}
});
this._getEvents()[eventName] = newFns;
}
}
},
/**
* 清除观察者的所有事件绑定
*/
purgeListeners: function () {
/* alex:清空events*/
this.events = [];
},
/**
* 触发绑定过的事件
*
* @param {String} eventName 要触发的事件的名字
* @returns {Boolean} 如果事件函数返回false,则返回false并中断其他同名事件的执行,否则执行所有的同名事件并返回true
*/
fireEvent: function () {
var eventName = arguments[0].toLowerCase();
var fns = this._getEvents()[eventName];
if (BI.isArray(fns)) {
if (BI.isArguments(arguments[1])) {
for (var i = 0; i < fns.length; i++) {
if (fns[i].apply(this, arguments[1]) === false) {
return false;
}
}
} else {
var args = Array.prototype.slice.call(arguments, 1);
for (var i = 0; i < fns.length; i++) {
if (fns[i].apply(this, args) === false) {
return false;
}
}
}
}
return true;
},
destroy: function () {
this.destroyed && this.destroyed();
this._purgeRef();
this.purgeListeners();
}
});
})();
/***/ }),
/* 108 */
/***/ (function(module, exports) {
!(function () {
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
/**
* CryptoJS core components.
*/
BI.CRYPT_TYPE = BI.CRYPT_TYPE || {};
BI.CRYPT_TYPE.AES = "aes";
var CryptoJS = CryptoJS || (function (Math, undefined) {
/**
* CryptoJS namespace.
*/
var C = {};
/**
* Library namespace.
*/
var C_lib = C.lib = {};
/**
* Base object for prototypal inheritance.
*/
var Base = C_lib.Base = (function () {
function F () {
}
return {
/**
* Creates a new object that inherits from this object.
*
* @param {Object} overrides Properties to copy into the new object.
*
* @return {Object} The new object.
*
* @static
*
* @example
*
* var MyType = CryptoJS.lib.Base.extend({
* field: 'value',
*
* method: function () {
* }
* });
*/
extend: function (overrides) {
// Spawn
F.prototype = this;
var subtype = new F();
// Augment
if (overrides) {
subtype.mixIn(overrides);
}
// Create default initializer
if (!subtype.hasOwnProperty('init')) {
subtype.init = function () {
subtype.$super.init.apply(this, arguments);
};
}
// Initializer's prototype is the subtype object
subtype.init.prototype = subtype;
// Reference supertype
subtype.$super = this;
return subtype;
},
/**
* Extends this object and runs the init method.
* Arguments to create() will be passed to init().
*
* @return {Object} The new object.
*
* @static
*
* @example
*
* var instance = MyType.create();
*/
create: function () {
var instance = this.extend();
instance.init.apply(instance, arguments);
return instance;
},
/**
* Initializes a newly created object.
* Override this method to add some logic when your objects are created.
*
* @example
*
* var MyType = CryptoJS.lib.Base.extend({
* init: function () {
* // ...
* }
* });
*/
init: function () {
},
/**
* Copies properties into this object.
*
* @param {Object} properties The properties to mix in.
*
* @example
*
* MyType.mixIn({
* field: 'value'
* });
*/
mixIn: function (properties) {
for (var propertyName in properties) {
if (properties.hasOwnProperty(propertyName)) {
this[propertyName] = properties[propertyName];
}
}
// IE won't copy toString using the loop above
if (properties.hasOwnProperty('toString')) {
this.toString = properties.toString;
}
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = instance.clone();
*/
clone: function () {
return this.init.prototype.extend(this);
}
};
}());
/**
* An array of 32-bit words.
*
* @property {Array} words The array of 32-bit words.
* @property {number} sigBytes The number of significant bytes in this word array.
*/
var WordArray = C_lib.WordArray = Base.extend({
/**
* Initializes a newly created word array.
*
* @param {Array} words (Optional) An array of 32-bit words.
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
*
* @example
*
* var wordArray = CryptoJS.lib.WordArray.create();
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
*/
init: function (words, sigBytes) {
words = this.words = words || [];
if (sigBytes != undefined) {
this.sigBytes = sigBytes;
} else {
this.sigBytes = words.length * 4;
}
},
/**
* Converts this word array to a string.
*
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
*
* @return {string} The stringified word array.
*
* @example
*
* var string = wordArray + '';
* var string = wordArray.toString();
* var string = wordArray.toString(CryptoJS.enc.Utf8);
*/
toString: function (encoder) {
return (encoder || Hex).stringify(this);
},
/**
* Concatenates a word array to this word array.
*
* @param {WordArray} wordArray The word array to append.
*
* @return {WordArray} This word array.
*
* @example
*
* wordArray1.concat(wordArray2);
*/
concat: function (wordArray) {
// Shortcuts
var thisWords = this.words;
var thatWords = wordArray.words;
var thisSigBytes = this.sigBytes;
var thatSigBytes = wordArray.sigBytes;
// Clamp excess bits
this.clamp();
// Concat
if (thisSigBytes % 4) {
// Copy one byte at a time
for (var i = 0; i < thatSigBytes; i++) {
var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
}
} else if (thatWords.length > 0xffff) {
// Copy one word at a time
for (var i = 0; i < thatSigBytes; i += 4) {
thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
}
} else {
// Copy all words at once
thisWords.push.apply(thisWords, thatWords);
}
this.sigBytes += thatSigBytes;
// Chainable
return this;
},
/**
* Removes insignificant bits.
*
* @example
*
* wordArray.clamp();
*/
clamp: function () {
// Shortcuts
var words = this.words;
var sigBytes = this.sigBytes;
// Clamp
words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
words.length = Math.ceil(sigBytes / 4);
},
/**
* Creates a copy of this word array.
*
* @return {WordArray} The clone.
*
* @example
*
* var clone = wordArray.clone();
*/
clone: function () {
var clone = Base.clone.call(this);
clone.words = this.words.slice(0);
return clone;
},
/**
* Creates a word array filled with random bytes.
*
* @param {number} nBytes The number of random bytes to generate.
*
* @return {WordArray} The random word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.lib.WordArray.random(16);
*/
random: function (nBytes) {
var words = [];
for (var i = 0; i < nBytes; i += 4) {
words.push((Math.random() * 0x100000000) | 0);
}
return new WordArray.init(words, nBytes);
}
});
/**
* Encoder namespace.
*/
var C_enc = C.enc = {};
/**
* Hex encoding strategy.
*/
var Hex = C_enc.Hex = {
/**
* Converts a word array to a hex string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The hex string.
*
* @static
*
* @example
*
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
*/
stringify: function (wordArray) {
// Shortcuts
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
// Convert
var hexChars = [];
for (var i = 0; i < sigBytes; i++) {
var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
hexChars.push((bite >>> 4).toString(16));
hexChars.push((bite & 0x0f).toString(16));
}
return hexChars.join('');
},
/**
* Converts a hex string to a word array.
*
* @param {string} hexStr The hex string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
*/
parse: function (hexStr) {
// Shortcut
var hexStrLength = hexStr.length;
// Convert
var words = [];
for (var i = 0; i < hexStrLength; i += 2) {
words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
}
return new WordArray.init(words, hexStrLength / 2);
}
};
/**
* Latin1 encoding strategy.
*/
var Latin1 = C_enc.Latin1 = {
/**
* Converts a word array to a Latin1 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The Latin1 string.
*
* @static
*
* @example
*
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
*/
stringify: function (wordArray) {
// Shortcuts
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
// Convert
var latin1Chars = [];
for (var i = 0; i < sigBytes; i++) {
var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
latin1Chars.push(String.fromCharCode(bite));
}
return latin1Chars.join('');
},
/**
* Converts a Latin1 string to a word array.
*
* @param {string} latin1Str The Latin1 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
*/
parse: function (latin1Str) {
// Shortcut
var latin1StrLength = latin1Str.length;
// Convert
var words = [];
for (var i = 0; i < latin1StrLength; i++) {
words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
}
return new WordArray.init(words, latin1StrLength);
}
};
/**
* UTF-8 encoding strategy.
*/
var Utf8 = C_enc.Utf8 = {
/**
* Converts a word array to a UTF-8 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The UTF-8 string.
*
* @static
*
* @example
*
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
*/
stringify: function (wordArray) {
try {
return decodeURIComponent(escape(Latin1.stringify(wordArray)));
} catch (e) {
throw new Error('Malformed UTF-8 data');
}
},
/**
* Converts a UTF-8 string to a word array.
*
* @param {string} utf8Str The UTF-8 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
*/
parse: function (utf8Str) {
return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
}
};
/**
* Abstract buffered block algorithm template.
*
* The property blockSize must be implemented in a concrete subtype.
*
* @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
*/
var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
/**
* Resets this block algorithm's data buffer to its initial state.
*
* @example
*
* bufferedBlockAlgorithm.reset();
*/
reset: function () {
// Initial values
this._data = new WordArray.init();
this._nDataBytes = 0;
},
/**
* Adds new data to this block algorithm's buffer.
*
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
*
* @example
*
* bufferedBlockAlgorithm._append('data');
* bufferedBlockAlgorithm._append(wordArray);
*/
_append: function (data) {
// Convert string to WordArray, else assume WordArray already
if (typeof data == 'string') {
data = Utf8.parse(data);
}
// Append
this._data.concat(data);
this._nDataBytes += data.sigBytes;
},
/**
* Processes available data blocks.
*
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
*
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
*
* @return {WordArray} The processed data.
*
* @example
*
* var processedData = bufferedBlockAlgorithm._process();
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
*/
_process: function (doFlush) {
// Shortcuts
var data = this._data;
var dataWords = data.words;
var dataSigBytes = data.sigBytes;
var blockSize = this.blockSize;
var blockSizeBytes = blockSize * 4;
// Count blocks ready
var nBlocksReady = dataSigBytes / blockSizeBytes;
if (doFlush) {
// Round up to include partial blocks
nBlocksReady = Math.ceil(nBlocksReady);
} else {
// Round down to include only full blocks,
// less the number of blocks that must remain in the buffer
nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
}
// Count words ready
var nWordsReady = nBlocksReady * blockSize;
// Count bytes ready
var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
// Process blocks
if (nWordsReady) {
for (var offset = 0; offset < nWordsReady; offset += blockSize) {
// Perform concrete-algorithm logic
this._doProcessBlock(dataWords, offset);
}
// Remove processed words
var processedWords = dataWords.splice(0, nWordsReady);
data.sigBytes -= nBytesReady;
}
// Return processed words
return new WordArray.init(processedWords, nBytesReady);
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = bufferedBlockAlgorithm.clone();
*/
clone: function () {
var clone = Base.clone.call(this);
clone._data = this._data.clone();
return clone;
},
_minBufferSize: 0
});
/**
* Abstract hasher template.
*
* @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
*/
var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
/**
* Configuration options.
*/
cfg: Base.extend(),
/**
* Initializes a newly created hasher.
*
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
*
* @example
*
* var hasher = CryptoJS.algo.SHA256.create();
*/
init: function (cfg) {
// Apply config defaults
this.cfg = this.cfg.extend(cfg);
// Set initial values
this.reset();
},
/**
* Resets this hasher to its initial state.
*
* @example
*
* hasher.reset();
*/
reset: function () {
// Reset data buffer
BufferedBlockAlgorithm.reset.call(this);
// Perform concrete-hasher logic
this._doReset();
},
/**
* Updates this hasher with a message.
*
* @param {WordArray|string} messageUpdate The message to append.
*
* @return {Hasher} This hasher.
*
* @example
*
* hasher.update('message');
* hasher.update(wordArray);
*/
update: function (messageUpdate) {
// Append
this._append(messageUpdate);
// Update the hash
this._process();
// Chainable
return this;
},
/**
* Finalizes the hash computation.
* Note that the finalize operation is effectively a destructive, read-once operation.
*
* @param {WordArray|string} messageUpdate (Optional) A final message update.
*
* @return {WordArray} The hash.
*
* @example
*
* var hash = hasher.finalize();
* var hash = hasher.finalize('message');
* var hash = hasher.finalize(wordArray);
*/
finalize: function (messageUpdate) {
// Final message update
if (messageUpdate) {
this._append(messageUpdate);
}
// Perform concrete-hasher logic
var hash = this._doFinalize();
return hash;
},
blockSize: 512 / 32,
/**
* Creates a shortcut function to a hasher's object interface.
*
* @param {Hasher} hasher The hasher to create a helper for.
*
* @return {Function} The shortcut function.
*
* @static
*
* @example
*
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
*/
_createHelper: function (hasher) {
return function (message, cfg) {
return new hasher.init(cfg).finalize(message);
};
},
/**
* Creates a shortcut function to the HMAC's object interface.
*
* @param {Hasher} hasher The hasher to use in this HMAC helper.
*
* @return {Function} The shortcut function.
*
* @static
*
* @example
*
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
*/
_createHmacHelper: function (hasher) {
return function (message, key) {
return new C_algo.HMAC.init(hasher, key).finalize(message);
};
}
});
/**
* Algorithm namespace.
*/
var C_algo = C.algo = {};
return C;
}(Math));
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var WordArray = C_lib.WordArray;
var C_enc = C.enc;
/**
* Base64 encoding strategy.
*/
var Base64 = C_enc.Base64 = {
/**
* Converts a word array to a Base64 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The Base64 string.
*
* @static
*
* @example
*
* var base64String = CryptoJS.enc.Base64.stringify(wordArray);
*/
stringify: function (wordArray) {
// Shortcuts
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
var map = this._map;
// Clamp excess bits
wordArray.clamp();
// Convert
var base64Chars = [];
for (var i = 0; i < sigBytes; i += 3) {
var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
}
}
// Add padding
var paddingChar = map.charAt(64);
if (paddingChar) {
while (base64Chars.length % 4) {
base64Chars.push(paddingChar);
}
}
return base64Chars.join('');
},
/**
* Converts a Base64 string to a word array.
*
* @param {string} base64Str The Base64 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Base64.parse(base64String);
*/
parse: function (base64Str) {
// Shortcuts
var base64StrLength = base64Str.length;
var map = this._map;
// Ignore padding
var paddingChar = map.charAt(64);
if (paddingChar) {
var paddingIndex = base64Str.indexOf(paddingChar);
if (paddingIndex != -1) {
base64StrLength = paddingIndex;
}
}
// Convert
var words = [];
var nBytes = 0;
for (var i = 0; i < base64StrLength; i++) {
if (i % 4) {
var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2);
var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2);
words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);
nBytes++;
}
}
return WordArray.create(words, nBytes);
},
_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
};
}());
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
(function (Math) {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var WordArray = C_lib.WordArray;
var Hasher = C_lib.Hasher;
var C_algo = C.algo;
// Constants table
var T = [];
// Compute constants
(function () {
for (var i = 0; i < 64; i++) {
T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;
}
}());
/**
* MD5 hash algorithm.
*/
var MD5 = C_algo.MD5 = Hasher.extend({
_doReset: function () {
this._hash = new WordArray.init([
0x67452301, 0xefcdab89,
0x98badcfe, 0x10325476
]);
},
_doProcessBlock: function (M, offset) {
// Swap endian
for (var i = 0; i < 16; i++) {
// Shortcuts
var offset_i = offset + i;
var M_offset_i = M[offset_i];
M[offset_i] = (
(((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
(((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
);
}
// Shortcuts
var H = this._hash.words;
var M_offset_0 = M[offset + 0];
var M_offset_1 = M[offset + 1];
var M_offset_2 = M[offset + 2];
var M_offset_3 = M[offset + 3];
var M_offset_4 = M[offset + 4];
var M_offset_5 = M[offset + 5];
var M_offset_6 = M[offset + 6];
var M_offset_7 = M[offset + 7];
var M_offset_8 = M[offset + 8];
var M_offset_9 = M[offset + 9];
var M_offset_10 = M[offset + 10];
var M_offset_11 = M[offset + 11];
var M_offset_12 = M[offset + 12];
var M_offset_13 = M[offset + 13];
var M_offset_14 = M[offset + 14];
var M_offset_15 = M[offset + 15];
// Working varialbes
var a = H[0];
var b = H[1];
var c = H[2];
var d = H[3];
// Computation
a = FF(a, b, c, d, M_offset_0, 7, T[0]);
d = FF(d, a, b, c, M_offset_1, 12, T[1]);
c = FF(c, d, a, b, M_offset_2, 17, T[2]);
b = FF(b, c, d, a, M_offset_3, 22, T[3]);
a = FF(a, b, c, d, M_offset_4, 7, T[4]);
d = FF(d, a, b, c, M_offset_5, 12, T[5]);
c = FF(c, d, a, b, M_offset_6, 17, T[6]);
b = FF(b, c, d, a, M_offset_7, 22, T[7]);
a = FF(a, b, c, d, M_offset_8, 7, T[8]);
d = FF(d, a, b, c, M_offset_9, 12, T[9]);
c = FF(c, d, a, b, M_offset_10, 17, T[10]);
b = FF(b, c, d, a, M_offset_11, 22, T[11]);
a = FF(a, b, c, d, M_offset_12, 7, T[12]);
d = FF(d, a, b, c, M_offset_13, 12, T[13]);
c = FF(c, d, a, b, M_offset_14, 17, T[14]);
b = FF(b, c, d, a, M_offset_15, 22, T[15]);
a = GG(a, b, c, d, M_offset_1, 5, T[16]);
d = GG(d, a, b, c, M_offset_6, 9, T[17]);
c = GG(c, d, a, b, M_offset_11, 14, T[18]);
b = GG(b, c, d, a, M_offset_0, 20, T[19]);
a = GG(a, b, c, d, M_offset_5, 5, T[20]);
d = GG(d, a, b, c, M_offset_10, 9, T[21]);
c = GG(c, d, a, b, M_offset_15, 14, T[22]);
b = GG(b, c, d, a, M_offset_4, 20, T[23]);
a = GG(a, b, c, d, M_offset_9, 5, T[24]);
d = GG(d, a, b, c, M_offset_14, 9, T[25]);
c = GG(c, d, a, b, M_offset_3, 14, T[26]);
b = GG(b, c, d, a, M_offset_8, 20, T[27]);
a = GG(a, b, c, d, M_offset_13, 5, T[28]);
d = GG(d, a, b, c, M_offset_2, 9, T[29]);
c = GG(c, d, a, b, M_offset_7, 14, T[30]);
b = GG(b, c, d, a, M_offset_12, 20, T[31]);
a = HH(a, b, c, d, M_offset_5, 4, T[32]);
d = HH(d, a, b, c, M_offset_8, 11, T[33]);
c = HH(c, d, a, b, M_offset_11, 16, T[34]);
b = HH(b, c, d, a, M_offset_14, 23, T[35]);
a = HH(a, b, c, d, M_offset_1, 4, T[36]);
d = HH(d, a, b, c, M_offset_4, 11, T[37]);
c = HH(c, d, a, b, M_offset_7, 16, T[38]);
b = HH(b, c, d, a, M_offset_10, 23, T[39]);
a = HH(a, b, c, d, M_offset_13, 4, T[40]);
d = HH(d, a, b, c, M_offset_0, 11, T[41]);
c = HH(c, d, a, b, M_offset_3, 16, T[42]);
b = HH(b, c, d, a, M_offset_6, 23, T[43]);
a = HH(a, b, c, d, M_offset_9, 4, T[44]);
d = HH(d, a, b, c, M_offset_12, 11, T[45]);
c = HH(c, d, a, b, M_offset_15, 16, T[46]);
b = HH(b, c, d, a, M_offset_2, 23, T[47]);
a = II(a, b, c, d, M_offset_0, 6, T[48]);
d = II(d, a, b, c, M_offset_7, 10, T[49]);
c = II(c, d, a, b, M_offset_14, 15, T[50]);
b = II(b, c, d, a, M_offset_5, 21, T[51]);
a = II(a, b, c, d, M_offset_12, 6, T[52]);
d = II(d, a, b, c, M_offset_3, 10, T[53]);
c = II(c, d, a, b, M_offset_10, 15, T[54]);
b = II(b, c, d, a, M_offset_1, 21, T[55]);
a = II(a, b, c, d, M_offset_8, 6, T[56]);
d = II(d, a, b, c, M_offset_15, 10, T[57]);
c = II(c, d, a, b, M_offset_6, 15, T[58]);
b = II(b, c, d, a, M_offset_13, 21, T[59]);
a = II(a, b, c, d, M_offset_4, 6, T[60]);
d = II(d, a, b, c, M_offset_11, 10, T[61]);
c = II(c, d, a, b, M_offset_2, 15, T[62]);
b = II(b, c, d, a, M_offset_9, 21, T[63]);
// Intermediate hash value
H[0] = (H[0] + a) | 0;
H[1] = (H[1] + b) | 0;
H[2] = (H[2] + c) | 0;
H[3] = (H[3] + d) | 0;
},
_doFinalize: function () {
// Shortcuts
var data = this._data;
var dataWords = data.words;
var nBitsTotal = this._nDataBytes * 8;
var nBitsLeft = data.sigBytes * 8;
// Add padding
dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
var nBitsTotalL = nBitsTotal;
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (
(((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) |
(((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)
);
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
(((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) |
(((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)
);
data.sigBytes = (dataWords.length + 1) * 4;
// Hash final blocks
this._process();
// Shortcuts
var hash = this._hash;
var H = hash.words;
// Swap endian
for (var i = 0; i < 4; i++) {
// Shortcut
var H_i = H[i];
H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
(((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
}
// Return final computed hash
return hash;
},
clone: function () {
var clone = Hasher.clone.call(this);
clone._hash = this._hash.clone();
return clone;
}
});
function FF (a, b, c, d, x, s, t) {
var n = a + ((b & c) | (~b & d)) + x + t;
return ((n << s) | (n >>> (32 - s))) + b;
}
function GG (a, b, c, d, x, s, t) {
var n = a + ((b & d) | (c & ~d)) + x + t;
return ((n << s) | (n >>> (32 - s))) + b;
}
function HH (a, b, c, d, x, s, t) {
var n = a + (b ^ c ^ d) + x + t;
return ((n << s) | (n >>> (32 - s))) + b;
}
function II (a, b, c, d, x, s, t) {
var n = a + (c ^ (b | ~d)) + x + t;
return ((n << s) | (n >>> (32 - s))) + b;
}
/**
* Shortcut function to the hasher's object interface.
*
* @param {WordArray|string} message The message to hash.
*
* @return {WordArray} The hash.
*
* @static
*
* @example
*
* var hash = CryptoJS.MD5('message');
* var hash = CryptoJS.MD5(wordArray);
*/
C.MD5 = Hasher._createHelper(MD5);
/**
* Shortcut function to the HMAC's object interface.
*
* @param {WordArray|string} message The message to hash.
* @param {WordArray|string} key The secret key.
*
* @return {WordArray} The HMAC.
*
* @static
*
* @example
*
* var hmac = CryptoJS.HmacMD5(message, key);
*/
C.HmacMD5 = Hasher._createHmacHelper(MD5);
}(Math));
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var Base = C_lib.Base;
var WordArray = C_lib.WordArray;
var C_algo = C.algo;
var MD5 = C_algo.MD5;
/**
* This key derivation function is meant to conform with EVP_BytesToKey.
* www.openssl.org/docs/crypto/EVP_BytesToKey.html
*/
var EvpKDF = C_algo.EvpKDF = Base.extend({
/**
* Configuration options.
*
* @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
* @property {Hasher} hasher The hash algorithm to use. Default: MD5
* @property {number} iterations The number of iterations to perform. Default: 1
*/
cfg: Base.extend({
keySize: 128 / 32,
hasher: MD5,
iterations: 1
}),
/**
* Initializes a newly created key derivation function.
*
* @param {Object} cfg (Optional) The configuration options to use for the derivation.
*
* @example
*
* var kdf = CryptoJS.algo.EvpKDF.create();
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
*/
init: function (cfg) {
this.cfg = this.cfg.extend(cfg);
},
/**
* Derives a key from a password.
*
* @param {WordArray|string} password The password.
* @param {WordArray|string} salt A salt.
*
* @return {WordArray} The derived key.
*
* @example
*
* var key = kdf.compute(password, salt);
*/
compute: function (password, salt) {
// Shortcut
var cfg = this.cfg;
// Init hasher
var hasher = cfg.hasher.create();
// Initial values
var derivedKey = WordArray.create();
// Shortcuts
var derivedKeyWords = derivedKey.words;
var keySize = cfg.keySize;
var iterations = cfg.iterations;
// Generate key
while (derivedKeyWords.length < keySize) {
if (block) {
hasher.update(block);
}
var block = hasher.update(password).finalize(salt);
hasher.reset();
// Iterations
for (var i = 1; i < iterations; i++) {
block = hasher.finalize(block);
hasher.reset();
}
derivedKey.concat(block);
}
derivedKey.sigBytes = keySize * 4;
return derivedKey;
}
});
/**
* Derives a key from a password.
*
* @param {WordArray|string} password The password.
* @param {WordArray|string} salt A salt.
* @param {Object} cfg (Optional) The configuration options to use for this computation.
*
* @return {WordArray} The derived key.
*
* @static
*
* @example
*
* var key = CryptoJS.EvpKDF(password, salt);
* var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
* var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
*/
C.EvpKDF = function (password, salt, cfg) {
return EvpKDF.create(cfg).compute(password, salt);
};
}());
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
/**
* Cipher core components.
*/
CryptoJS.lib.Cipher || (function (undefined) {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var Base = C_lib.Base;
var WordArray = C_lib.WordArray;
var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
var C_enc = C.enc;
var Utf8 = C_enc.Utf8;
var Base64 = C_enc.Base64;
var C_algo = C.algo;
var EvpKDF = C_algo.EvpKDF;
/**
* Abstract base cipher template.
*
* @property {number} keySize This cipher's key size. Default: 4 (128 bits)
* @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
* @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
* @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
*/
var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
/**
* Configuration options.
*
* @property {WordArray} iv The IV to use for this operation.
*/
cfg: Base.extend(),
/**
* Creates this cipher in encryption mode.
*
* @param {WordArray} key The key.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @return {Cipher} A cipher instance.
*
* @static
*
* @example
*
* var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
*/
createEncryptor: function (key, cfg) {
return this.create(this._ENC_XFORM_MODE, key, cfg);
},
/**
* Creates this cipher in decryption mode.
*
* @param {WordArray} key The key.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @return {Cipher} A cipher instance.
*
* @static
*
* @example
*
* var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
*/
createDecryptor: function (key, cfg) {
return this.create(this._DEC_XFORM_MODE, key, cfg);
},
/**
* Initializes a newly created cipher.
*
* @param {number} xformMode Either the encryption or decryption transormation mode constant.
* @param {WordArray} key The key.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @example
*
* var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
*/
init: function (xformMode, key, cfg) {
// Apply config defaults
this.cfg = this.cfg.extend(cfg);
// Store transform mode and key
this._xformMode = xformMode;
this._key = key;
// Set initial values
this.reset();
},
/**
* Resets this cipher to its initial state.
*
* @example
*
* cipher.reset();
*/
reset: function () {
// Reset data buffer
BufferedBlockAlgorithm.reset.call(this);
// Perform concrete-cipher logic
this._doReset();
},
/**
* Adds data to be encrypted or decrypted.
*
* @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
*
* @return {WordArray} The data after processing.
*
* @example
*
* var encrypted = cipher.process('data');
* var encrypted = cipher.process(wordArray);
*/
process: function (dataUpdate) {
// Append
this._append(dataUpdate);
// Process available blocks
return this._process();
},
/**
* Finalizes the encryption or decryption process.
* Note that the finalize operation is effectively a destructive, read-once operation.
*
* @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
*
* @return {WordArray} The data after final processing.
*
* @example
*
* var encrypted = cipher.finalize();
* var encrypted = cipher.finalize('data');
* var encrypted = cipher.finalize(wordArray);
*/
finalize: function (dataUpdate) {
// Final data update
if (dataUpdate) {
this._append(dataUpdate);
}
// Perform concrete-cipher logic
var finalProcessedData = this._doFinalize();
return finalProcessedData;
},
keySize: 128 / 32,
ivSize: 128 / 32,
_ENC_XFORM_MODE: 1,
_DEC_XFORM_MODE: 2,
/**
* Creates shortcut functions to a cipher's object interface.
*
* @param {Cipher} cipher The cipher to create a helper for.
*
* @return {Object} An object with encrypt and decrypt shortcut functions.
*
* @static
*
* @example
*
* var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
*/
_createHelper: (function () {
function selectCipherStrategy (key) {
if (typeof key == 'string') {
return PasswordBasedCipher;
} else {
return SerializableCipher;
}
}
return function (cipher) {
return {
encrypt: function (message, key, cfg) {
return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
},
decrypt: function (ciphertext, key, cfg) {
return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
}
};
};
}())
});
/**
* Abstract base stream cipher template.
*
* @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
*/
var StreamCipher = C_lib.StreamCipher = Cipher.extend({
_doFinalize: function () {
// Process partial blocks
var finalProcessedBlocks = this._process(!!'flush');
return finalProcessedBlocks;
},
blockSize: 1
});
/**
* Mode namespace.
*/
var C_mode = C.mode = {};
/**
* Abstract base block cipher mode template.
*/
var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
/**
* Creates this mode for encryption.
*
* @param {Cipher} cipher A block cipher instance.
* @param {Array} iv The IV words.
*
* @static
*
* @example
*
* var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
*/
createEncryptor: function (cipher, iv) {
return this.Encryptor.create(cipher, iv);
},
/**
* Creates this mode for decryption.
*
* @param {Cipher} cipher A block cipher instance.
* @param {Array} iv The IV words.
*
* @static
*
* @example
*
* var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
*/
createDecryptor: function (cipher, iv) {
return this.Decryptor.create(cipher, iv);
},
/**
* Initializes a newly created mode.
*
* @param {Cipher} cipher A block cipher instance.
* @param {Array} iv The IV words.
*
* @example
*
* var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
*/
init: function (cipher, iv) {
this._cipher = cipher;
this._iv = iv;
}
});
/**
* Cipher Block Chaining mode.
*/
var CBC = C_mode.CBC = (function () {
/**
* Abstract base CBC mode.
*/
var CBC = BlockCipherMode.extend();
/**
* CBC encryptor.
*/
CBC.Encryptor = CBC.extend({
/**
* Processes the data block at offset.
*
* @param {Array} words The data words to operate on.
* @param {number} offset The offset where the block starts.
*
* @example
*
* mode.processBlock(data.words, offset);
*/
processBlock: function (words, offset) {
// Shortcuts
var cipher = this._cipher;
var blockSize = cipher.blockSize;
// XOR and encrypt
xorBlock.call(this, words, offset, blockSize);
cipher.encryptBlock(words, offset);
// Remember this block to use with next block
this._prevBlock = words.slice(offset, offset + blockSize);
}
});
/**
* CBC decryptor.
*/
CBC.Decryptor = CBC.extend({
/**
* Processes the data block at offset.
*
* @param {Array} words The data words to operate on.
* @param {number} offset The offset where the block starts.
*
* @example
*
* mode.processBlock(data.words, offset);
*/
processBlock: function (words, offset) {
// Shortcuts
var cipher = this._cipher;
var blockSize = cipher.blockSize;
// Remember this block to use with next block
var thisBlock = words.slice(offset, offset + blockSize);
// Decrypt and XOR
cipher.decryptBlock(words, offset);
xorBlock.call(this, words, offset, blockSize);
// This block becomes the previous block
this._prevBlock = thisBlock;
}
});
function xorBlock (words, offset, blockSize) {
// Shortcut
var iv = this._iv;
// Choose mixing block
if (iv) {
var block = iv;
// Remove IV for subsequent blocks
this._iv = undefined;
} else {
var block = this._prevBlock;
}
// XOR blocks
for (var i = 0; i < blockSize; i++) {
words[offset + i] ^= block[i];
}
}
return CBC;
}());
/**
* Padding namespace.
*/
var C_pad = C.pad = {};
/**
* PKCS #5/7 padding strategy.
*/
var Pkcs7 = C_pad.Pkcs7 = {
/**
* Pads data using the algorithm defined in PKCS #5/7.
*
* @param {WordArray} data The data to pad.
* @param {number} blockSize The multiple that the data should be padded to.
*
* @static
*
* @example
*
* CryptoJS.pad.Pkcs7.pad(wordArray, 4);
*/
pad: function (data, blockSize) {
// Shortcut
var blockSizeBytes = blockSize * 4;
// Count padding bytes
var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
// Create padding word
var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;
// Create padding
var paddingWords = [];
for (var i = 0; i < nPaddingBytes; i += 4) {
paddingWords.push(paddingWord);
}
var padding = WordArray.create(paddingWords, nPaddingBytes);
// Add padding
data.concat(padding);
},
/**
* Unpads data that had been padded using the algorithm defined in PKCS #5/7.
*
* @param {WordArray} data The data to unpad.
*
* @static
*
* @example
*
* CryptoJS.pad.Pkcs7.unpad(wordArray);
*/
unpad: function (data) {
// Get number of padding bytes from last byte
var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
// Remove padding
data.sigBytes -= nPaddingBytes;
}
};
/**
* Abstract base block cipher template.
*
* @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
*/
var BlockCipher = C_lib.BlockCipher = Cipher.extend({
/**
* Configuration options.
*
* @property {Mode} mode The block mode to use. Default: CBC
* @property {Padding} padding The padding strategy to use. Default: Pkcs7
*/
cfg: Cipher.cfg.extend({
mode: CBC,
padding: Pkcs7
}),
reset: function () {
// Reset cipher
Cipher.reset.call(this);
// Shortcuts
var cfg = this.cfg;
var iv = cfg.iv;
var mode = cfg.mode;
// Reset block mode
if (this._xformMode == this._ENC_XFORM_MODE) {
var modeCreator = mode.createEncryptor;
} else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
var modeCreator = mode.createDecryptor;
// Keep at least one block in the buffer for unpadding
this._minBufferSize = 1;
}
this._mode = modeCreator.call(mode, this, iv && iv.words);
},
_doProcessBlock: function (words, offset) {
this._mode.processBlock(words, offset);
},
_doFinalize: function () {
// Shortcut
var padding = this.cfg.padding;
// Finalize
if (this._xformMode == this._ENC_XFORM_MODE) {
// Pad data
padding.pad(this._data, this.blockSize);
// Process final blocks
var finalProcessedBlocks = this._process(!!'flush');
} else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
// Process final blocks
var finalProcessedBlocks = this._process(!!'flush');
// Unpad data
padding.unpad(finalProcessedBlocks);
}
return finalProcessedBlocks;
},
blockSize: 128 / 32
});
/**
* A collection of cipher parameters.
*
* @property {WordArray} ciphertext The raw ciphertext.
* @property {WordArray} key The key to this ciphertext.
* @property {WordArray} iv The IV used in the ciphering operation.
* @property {WordArray} salt The salt used with a key derivation function.
* @property {Cipher} algorithm The cipher algorithm.
* @property {Mode} mode The block mode used in the ciphering operation.
* @property {Padding} padding The padding scheme used in the ciphering operation.
* @property {number} blockSize The block size of the cipher.
* @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
*/
var CipherParams = C_lib.CipherParams = Base.extend({
/**
* Initializes a newly created cipher params object.
*
* @param {Object} cipherParams An object with any of the possible cipher parameters.
*
* @example
*
* var cipherParams = CryptoJS.lib.CipherParams.create({
* ciphertext: ciphertextWordArray,
* key: keyWordArray,
* iv: ivWordArray,
* salt: saltWordArray,
* algorithm: CryptoJS.algo.AES,
* mode: CryptoJS.mode.CBC,
* padding: CryptoJS.pad.PKCS7,
* blockSize: 4,
* formatter: CryptoJS.format.OpenSSL
* });
*/
init: function (cipherParams) {
this.mixIn(cipherParams);
},
/**
* Converts this cipher params object to a string.
*
* @param {Format} formatter (Optional) The formatting strategy to use.
*
* @return {string} The stringified cipher params.
*
* @throws Error If neither the formatter nor the default formatter is set.
*
* @example
*
* var string = cipherParams + '';
* var string = cipherParams.toString();
* var string = cipherParams.toString(CryptoJS.format.OpenSSL);
*/
toString: function (formatter) {
return (formatter || this.formatter).stringify(this);
}
});
/**
* Format namespace.
*/
var C_format = C.format = {};
/**
* OpenSSL formatting strategy.
*/
var OpenSSLFormatter = C_format.OpenSSL = {
/**
* Converts a cipher params object to an OpenSSL-compatible string.
*
* @param {CipherParams} cipherParams The cipher params object.
*
* @return {string} The OpenSSL-compatible string.
*
* @static
*
* @example
*
* var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
*/
stringify: function (cipherParams) {
// Shortcuts
var ciphertext = cipherParams.ciphertext;
var salt = cipherParams.salt;
// Format
if (salt) {
var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
} else {
var wordArray = ciphertext;
}
return wordArray.toString(Base64);
},
/**
* Converts an OpenSSL-compatible string to a cipher params object.
*
* @param {string} openSSLStr The OpenSSL-compatible string.
*
* @return {CipherParams} The cipher params object.
*
* @static
*
* @example
*
* var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
*/
parse: function (openSSLStr) {
// Parse base64
var ciphertext = Base64.parse(openSSLStr);
// Shortcut
var ciphertextWords = ciphertext.words;
// Test for salt
if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
// Extract salt
var salt = WordArray.create(ciphertextWords.slice(2, 4));
// Remove salt from ciphertext
ciphertextWords.splice(0, 4);
ciphertext.sigBytes -= 16;
}
return CipherParams.create({ciphertext: ciphertext, salt: salt});
}
};
/**
* A cipher wrapper that returns ciphertext as a serializable cipher params object.
*/
var SerializableCipher = C_lib.SerializableCipher = Base.extend({
/**
* Configuration options.
*
* @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
*/
cfg: Base.extend({
format: OpenSSLFormatter
}),
/**
* Encrypts a message.
*
* @param {Cipher} cipher The cipher algorithm to use.
* @param {WordArray|string} message The message to encrypt.
* @param {WordArray} key The key.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @return {CipherParams} A cipher params object.
*
* @static
*
* @example
*
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
*/
encrypt: function (cipher, message, key, cfg) {
// Apply config defaults
cfg = this.cfg.extend(cfg);
// Encrypt
var encryptor = cipher.createEncryptor(key, cfg);
var ciphertext = encryptor.finalize(message);
// Shortcut
var cipherCfg = encryptor.cfg;
// Create and return serializable cipher params
return CipherParams.create({
ciphertext: ciphertext,
key: key,
iv: cipherCfg.iv,
algorithm: cipher,
mode: cipherCfg.mode,
padding: cipherCfg.padding,
blockSize: cipher.blockSize,
formatter: cfg.format
});
},
/**
* Decrypts serialized ciphertext.
*
* @param {Cipher} cipher The cipher algorithm to use.
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
* @param {WordArray} key The key.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @return {WordArray} The plaintext.
*
* @static
*
* @example
*
* var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
* var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
*/
decrypt: function (cipher, ciphertext, key, cfg) {
// Apply config defaults
cfg = this.cfg.extend(cfg);
// Convert string to CipherParams
ciphertext = this._parse(ciphertext, cfg.format);
// Decrypt
var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
return plaintext;
},
/**
* Converts serialized ciphertext to CipherParams,
* else assumed CipherParams already and returns ciphertext unchanged.
*
* @param {CipherParams|string} ciphertext The ciphertext.
* @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
*
* @return {CipherParams} The unserialized ciphertext.
*
* @static
*
* @example
*
* var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
*/
_parse: function (ciphertext, format) {
if (typeof ciphertext == 'string') {
return format.parse(ciphertext, this);
} else {
return ciphertext;
}
}
});
/**
* Key derivation function namespace.
*/
var C_kdf = C.kdf = {};
/**
* OpenSSL key derivation function.
*/
var OpenSSLKdf = C_kdf.OpenSSL = {
/**
* Derives a key and IV from a password.
*
* @param {string} password The password to derive from.
* @param {number} keySize The size in words of the key to generate.
* @param {number} ivSize The size in words of the IV to generate.
* @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
*
* @return {CipherParams} A cipher params object with the key, IV, and salt.
*
* @static
*
* @example
*
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
*/
execute: function (password, keySize, ivSize, salt) {
// Generate random salt
if (!salt) {
salt = WordArray.random(64 / 8);
}
// Derive key and IV
var key = EvpKDF.create({keySize: keySize + ivSize}).compute(password, salt);
// Separate key and IV
var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
key.sigBytes = keySize * 4;
// Return params
return CipherParams.create({key: key, iv: iv, salt: salt});
}
};
/**
* A serializable cipher wrapper that derives the key from a password,
* and returns ciphertext as a serializable cipher params object.
*/
var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
/**
* Configuration options.
*
* @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
*/
cfg: SerializableCipher.cfg.extend({
kdf: OpenSSLKdf
}),
/**
* Encrypts a message using a password.
*
* @param {Cipher} cipher The cipher algorithm to use.
* @param {WordArray|string} message The message to encrypt.
* @param {string} password The password.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @return {CipherParams} A cipher params object.
*
* @static
*
* @example
*
* var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
* var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
*/
encrypt: function (cipher, message, password, cfg) {
// Apply config defaults
cfg = this.cfg.extend(cfg);
// Derive key and other params
var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);
// Add IV to config
cfg.iv = derivedParams.iv;
// Encrypt
var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
// Mix in derived params
ciphertext.mixIn(derivedParams);
return ciphertext;
},
/**
* Decrypts serialized ciphertext using a password.
*
* @param {Cipher} cipher The cipher algorithm to use.
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
* @param {string} password The password.
* @param {Object} cfg (Optional) The configuration options to use for this operation.
*
* @return {WordArray} The plaintext.
*
* @static
*
* @example
*
* var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
* var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
*/
decrypt: function (cipher, ciphertext, password, cfg) {
// Apply config defaults
cfg = this.cfg.extend(cfg);
// Convert string to CipherParams
ciphertext = this._parse(ciphertext, cfg.format);
// Derive key and other params
var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
// Add IV to config
cfg.iv = derivedParams.iv;
// Decrypt
var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
return plaintext;
}
});
}());
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
/**
* Electronic Codebook block mode.
*/
CryptoJS.mode.ECB = (function () {
var ECB = CryptoJS.lib.BlockCipherMode.extend();
ECB.Encryptor = ECB.extend({
processBlock: function (words, offset) {
this._cipher.encryptBlock(words, offset);
}
});
ECB.Decryptor = ECB.extend({
processBlock: function (words, offset) {
this._cipher.decryptBlock(words, offset);
}
});
return ECB;
}());
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
(function () {
// Shortcuts
var C = CryptoJS;
var C_lib = C.lib;
var BlockCipher = C_lib.BlockCipher;
var C_algo = C.algo;
// Lookup tables
var SBOX = [];
var INV_SBOX = [];
var SUB_MIX_0 = [];
var SUB_MIX_1 = [];
var SUB_MIX_2 = [];
var SUB_MIX_3 = [];
var INV_SUB_MIX_0 = [];
var INV_SUB_MIX_1 = [];
var INV_SUB_MIX_2 = [];
var INV_SUB_MIX_3 = [];
// Compute lookup tables
(function () {
// Compute double table
var d = [];
for (var i = 0; i < 256; i++) {
if (i < 128) {
d[i] = i << 1;
} else {
d[i] = (i << 1) ^ 0x11b;
}
}
// Walk GF(2^8)
var x = 0;
var xi = 0;
for (var i = 0; i < 256; i++) {
// Compute sbox
var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);
sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;
SBOX[x] = sx;
INV_SBOX[sx] = x;
// Compute multiplication
var x2 = d[x];
var x4 = d[x2];
var x8 = d[x4];
// Compute sub bytes, mix columns tables
var t = (d[sx] * 0x101) ^ (sx * 0x1010100);
SUB_MIX_0[x] = (t << 24) | (t >>> 8);
SUB_MIX_1[x] = (t << 16) | (t >>> 16);
SUB_MIX_2[x] = (t << 8) | (t >>> 24);
SUB_MIX_3[x] = t;
// Compute inv sub bytes, inv mix columns tables
var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);
INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);
INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);
INV_SUB_MIX_3[sx] = t;
// Compute next counter
if (!x) {
x = xi = 1;
} else {
x = x2 ^ d[d[d[x8 ^ x2]]];
xi ^= d[d[xi]];
}
}
}());
// Precomputed Rcon lookup
var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
/**
* AES block cipher algorithm.
*/
var AES = C_algo.AES = BlockCipher.extend({
_doReset: function () {
// Shortcuts
var key = this._key;
var keyWords = key.words;
var keySize = key.sigBytes / 4;
// Compute number of rounds
var nRounds = this._nRounds = keySize + 6;
// Compute number of key schedule rows
var ksRows = (nRounds + 1) * 4;
// Compute key schedule
var keySchedule = this._keySchedule = [];
for (var ksRow = 0; ksRow < ksRows; ksRow++) {
if (ksRow < keySize) {
keySchedule[ksRow] = keyWords[ksRow];
} else {
var t = keySchedule[ksRow - 1];
if (!(ksRow % keySize)) {
// Rot word
t = (t << 8) | (t >>> 24);
// Sub word
t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
// Mix Rcon
t ^= RCON[(ksRow / keySize) | 0] << 24;
} else if (keySize > 6 && ksRow % keySize == 4) {
// Sub word
t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
}
keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
}
}
// Compute inv key schedule
var invKeySchedule = this._invKeySchedule = [];
for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
var ksRow = ksRows - invKsRow;
if (invKsRow % 4) {
var t = keySchedule[ksRow];
} else {
var t = keySchedule[ksRow - 4];
}
if (invKsRow < 4 || ksRow <= 4) {
invKeySchedule[invKsRow] = t;
} else {
invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^
INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];
}
}
},
encryptBlock: function (M, offset) {
this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
},
decryptBlock: function (M, offset) {
// Swap 2nd and 4th rows
var t = M[offset + 1];
M[offset + 1] = M[offset + 3];
M[offset + 3] = t;
this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
// Inv swap 2nd and 4th rows
var t = M[offset + 1];
M[offset + 1] = M[offset + 3];
M[offset + 3] = t;
},
_doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {
// Shortcut
var nRounds = this._nRounds;
// Get input, add round key
var s0 = M[offset] ^ keySchedule[0];
var s1 = M[offset + 1] ^ keySchedule[1];
var s2 = M[offset + 2] ^ keySchedule[2];
var s3 = M[offset + 3] ^ keySchedule[3];
// Key schedule row counter
var ksRow = 4;
// Rounds
for (var round = 1; round < nRounds; round++) {
// Shift rows, sub bytes, mix columns, add round key
var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];
var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];
var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];
var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];
// Update state
s0 = t0;
s1 = t1;
s2 = t2;
s3 = t3;
}
// Shift rows, sub bytes, add round key
var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];
// Set output
M[offset] = t0;
M[offset + 1] = t1;
M[offset + 2] = t2;
M[offset + 3] = t3;
},
keySize: 256 / 32
});
/**
* Shortcut functions to the cipher's object interface.
*
* @example
*
* var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);
* var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);
*/
C.AES = BlockCipher._createHelper(AES);
}());
_.extend(BI, {
/**
* aes加密方法
* aes-128-ecb
*
* @example
*
* var ciphertext = BI.aesEncrypt(text, key);
*/
aesEncrypt: function (text, key) {
key = CryptoJS.enc.Utf8.parse(key);
var cipher = CryptoJS.AES.encrypt(text, key, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
});
var base64Cipher = cipher.ciphertext.toString(CryptoJS.enc.Base64);
return base64Cipher;
},
/**
* aes解密方法
* @param {String} text
* @param {String} key
*/
aesDecrypt: function (text, key) {
key = CryptoJS.enc.Utf8.parse(key);
var decipher = CryptoJS.AES.decrypt(text, key, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
});
return CryptoJS.enc.Utf8.stringify(decipher);
}
});
}());
/***/ }),
/* 109 */
/***/ (function(module, exports) {
!(function () {
function aspect (type) {
return function (target, methodName, advice) {
var exist = target[methodName],
dispatcher;
if (!exist || exist.target != target) {
dispatcher = target[methodName] = function () {
// before methods
var beforeArr = dispatcher.before;
var args = arguments, next;
for (var l = beforeArr.length; l--;) {
next = beforeArr[l].advice.apply(this, args);
if (next === false) {
return false;
}
args = next || args;
}
// target method
var rs = dispatcher.method.apply(this, args);
// after methods
var afterArr = dispatcher.after;
for (var i = 0, ii = afterArr.length; i < ii; i++) {
next = afterArr[i].advice.call(this, rs, args);
if (rs === false) {
return false;
}
args = next || args;
}
return rs;
};
dispatcher.before = [];
dispatcher.after = [];
if (exist) {
dispatcher.method = exist;
}
dispatcher.target = target;
}
var aspectArr = (dispatcher || exist)[type];
var obj = {
advice: advice,
_index: aspectArr.length,
remove: function () {
aspectArr.splice(this._index, 1);
}
};
aspectArr.push(obj);
return obj;
};
}
BI.aspect = {
before: aspect("before"),
after: aspect("after")
};
return BI.aspect;
})();
/***/ }),
/* 110 */
/***/ (function(module, exports) {
!(function () {
var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
// private method for UTF-8 encoding
var _utf8_encode = function (string) {
string = string.replace(/\r\n/g, "\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
} else if ((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
} else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
};
// private method for UTF-8 decoding
var _utf8_decode = function (utftext) {
var string = "";
var i = 0;
var c = 0, c3 = 0, c2 = 0;
while (i < utftext.length) {
c = utftext.charCodeAt(i);
if (c < 128) {
string += String.fromCharCode(c);
i++;
} else if ((c > 191) && (c < 224)) {
c2 = utftext.charCodeAt(i + 1);
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
i += 2;
} else {
c2 = utftext.charCodeAt(i + 1);
c3 = utftext.charCodeAt(i + 2);
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}
}
return string;
};
_.extend(BI, {
encode: function (input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
input = _utf8_encode(input);
while (i < input.length) {
chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
chr3 = input.charCodeAt(i++);
enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;
if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}
output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
}
return output;
},
// public method for decoding
decode: function (input) {
var output = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
while (i < input.length) {
enc1 = _keyStr.indexOf(input.charAt(i++));
enc2 = _keyStr.indexOf(input.charAt(i++));
enc3 = _keyStr.indexOf(input.charAt(i++));
enc4 = _keyStr.indexOf(input.charAt(i++));
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
output = output + String.fromCharCode(chr1);
if (enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
if (enc4 != 64) {
output = output + String.fromCharCode(chr3);
}
}
output = _utf8_decode(output);
return output;
}
});
})();
/***/ }),
/* 111 */
/***/ (function(module, exports) {
BI.Cache = {
_prefix: "bi",
setUsername: function (username) {
localStorage.setItem(BI.Cache._prefix + ".username", (username + "" || "").toUpperCase());
},
getUsername: function () {
return localStorage.getItem(BI.Cache._prefix + ".username") || "";
},
_getKeyPrefix: function () {
return BI.Cache.getUsername() + "." + BI.Cache._prefix + ".";
},
_generateKey: function (key) {
return BI.Cache._getKeyPrefix() + (key || "");
},
getItem: function (key) {
return localStorage.getItem(BI.Cache._generateKey(key));
},
setItem: function (key, value) {
localStorage.setItem(BI.Cache._generateKey(key), value);
},
removeItem: function (key) {
localStorage.removeItem(BI.Cache._generateKey(key));
},
clear: function () {
for (var i = localStorage.length; i >= 0; i--) {
var key = localStorage.key(i);
if (key) {
if (key.indexOf(BI.Cache._getKeyPrefix()) === 0) {
localStorage.removeItem(key);
}
}
}
},
keys: function () {
var result = [];
for (var i = localStorage.length; i >= 0; i--) {
var key = localStorage.key(i);
if (key) {
var prefix = BI.Cache._getKeyPrefix();
if (key.indexOf(prefix) === 0) {
result[result.length] = key.substring(prefix.length);
}
}
}
return result;
},
addCookie: function (name, value, path, expiresHours) {
var cookieString = name + "=" + escape(value);
// 判断是否设置过期时间
if (expiresHours && expiresHours > 0) {
var date = new Date();
// expires是标准GMT格式时间,应该使用时间戳作为起始时间
date.setTime(date.getTime() + expiresHours * 3600 * 1000);
cookieString = cookieString + "; expires=" + date.toUTCString();
}
if (path) {
cookieString = cookieString + "; path=" + path;
}
document.cookie = cookieString;
},
getCookie: function (name) {
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if (arr = document.cookie.match(reg)) {return unescape(arr[2]);}
return null;
},
deleteCookie: function (name, path) {
var date = new Date();
date.setTime(date.getTime() - 10000);
var cookieString = name + "=v; expires=" + date.toUTCString();
if (path) {
cookieString = cookieString + "; path=" + path;
}
document.cookie = cookieString;
}
};
/***/ }),
/* 112 */
/***/ (function(module, exports) {
BI.CellSizeAndPositionManager = function (cellCount, cellSizeGetter, estimatedCellSize) {
this._cellSizeGetter = cellSizeGetter;
this._cellCount = cellCount;
this._estimatedCellSize = estimatedCellSize;
this._cellSizeAndPositionData = {};
this._lastMeasuredIndex = -1;
};
BI.CellSizeAndPositionManager.prototype = {
constructor: BI.CellSizeAndPositionManager,
configure: function (cellCount, estimatedCellSize) {
this._cellCount = cellCount;
this._estimatedCellSize = estimatedCellSize;
},
getCellCount: function () {
return this._cellCount;
},
getEstimatedCellSize: function () {
return this._estimatedCellSize;
},
getLastMeasuredIndex: function () {
return this._lastMeasuredIndex;
},
getSizeAndPositionOfCell: function (index) {
if (index < 0 || index >= this._cellCount) {
return;
}
if (index > this._lastMeasuredIndex) {
var lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell();
var offset = lastMeasuredCellSizeAndPosition.offset + lastMeasuredCellSizeAndPosition.size;
for (var i = this._lastMeasuredIndex + 1; i <= index; i++) {
var size = this._cellSizeGetter(i);
if (size == null || isNaN(size)) {
continue;
}
this._cellSizeAndPositionData[i] = {
offset: offset,
size: size
};
offset += size;
}
this._lastMeasuredIndex = index;
}
return this._cellSizeAndPositionData[index];
},
getSizeAndPositionOfLastMeasuredCell: function () {
return this._lastMeasuredIndex >= 0
? this._cellSizeAndPositionData[this._lastMeasuredIndex]
: {
offset: 0,
size: 0
};
},
getTotalSize: function () {
var lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell();
return lastMeasuredCellSizeAndPosition.offset + lastMeasuredCellSizeAndPosition.size + (this._cellCount - this._lastMeasuredIndex - 1) * this._estimatedCellSize;
},
getUpdatedOffsetForIndex: function (align, containerSize, currentOffset, targetIndex) {
var datum = this.getSizeAndPositionOfCell(targetIndex);
var maxOffset = datum.offset;
var minOffset = maxOffset - containerSize + datum.size;
var idealOffset;
switch (align) {
case "start":
idealOffset = maxOffset;
break;
case "end":
idealOffset = minOffset;
break;
case "center":
idealOffset = maxOffset - ((containerSize - datum.size) / 2);
break;
default:
idealOffset = Math.max(minOffset, Math.min(maxOffset, currentOffset));
break;
}
var totalSize = this.getTotalSize();
return Math.max(0, Math.min(totalSize - containerSize, idealOffset));
},
getVisibleCellRange: function (containerSize, offset) {
var totalSize = this.getTotalSize();
if (totalSize === 0) {
return {};
}
var maxOffset = offset + containerSize;
var start = this._findNearestCell(offset);
var datum = this.getSizeAndPositionOfCell(start);
offset = datum.offset + datum.size;
var stop = start;
while (offset < maxOffset && stop < this._cellCount - 1) {
stop++;
offset += this.getSizeAndPositionOfCell(stop).size;
}
return {
start: start,
stop: stop
};
},
resetCell: function (index) {
this._lastMeasuredIndex = Math.min(this._lastMeasuredIndex, index - 1);
},
_binarySearch: function (high, low, offset) {
var middle;
var currentOffset;
while (low <= high) {
middle = low + Math.floor((high - low) / 2);
currentOffset = this.getSizeAndPositionOfCell(middle).offset;
if (currentOffset === offset) {
return middle;
} else if (currentOffset < offset) {
low = middle + 1;
} else if (currentOffset > offset) {
high = middle - 1;
}
}
if (low > 0) {
return low - 1;
}
},
_exponentialSearch: function (index, offset) {
var interval = 1;
while (index < this._cellCount && this.getSizeAndPositionOfCell(index).offset < offset) {
index += interval;
interval *= 2;
}
return this._binarySearch(Math.min(index, this._cellCount - 1), Math.floor(index / 2), offset);
},
_findNearestCell: function (offset) {
if (isNaN(offset)) {
return;
}
offset = Math.max(0, offset);
var lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell();
var lastMeasuredIndex = Math.max(0, this._lastMeasuredIndex);
if (lastMeasuredCellSizeAndPosition.offset >= offset) {
return this._binarySearch(lastMeasuredIndex, 0, offset);
}
return this._exponentialSearch(lastMeasuredIndex, offset);
}
};
BI.ScalingCellSizeAndPositionManager = function (cellCount, cellSizeGetter, estimatedCellSize, maxScrollSize) {
this._cellSizeAndPositionManager = new BI.CellSizeAndPositionManager(cellCount, cellSizeGetter, estimatedCellSize);
this._maxScrollSize = maxScrollSize || 10000000;
};
BI.ScalingCellSizeAndPositionManager.prototype = {
constructor: BI.ScalingCellSizeAndPositionManager,
configure: function () {
this._cellSizeAndPositionManager.configure.apply(this._cellSizeAndPositionManager, arguments);
},
getCellCount: function () {
return this._cellSizeAndPositionManager.getCellCount();
},
getEstimatedCellSize: function () {
return this._cellSizeAndPositionManager.getEstimatedCellSize();
},
getLastMeasuredIndex: function () {
return this._cellSizeAndPositionManager.getLastMeasuredIndex();
},
getOffsetAdjustment: function (containerSize, offset) {
var totalSize = this._cellSizeAndPositionManager.getTotalSize();
var safeTotalSize = this.getTotalSize();
var offsetPercentage = this._getOffsetPercentage(containerSize, offset, safeTotalSize);
return Math.round(offsetPercentage * (safeTotalSize - totalSize));
},
getSizeAndPositionOfCell: function (index) {
return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(index);
},
getSizeAndPositionOfLastMeasuredCell: function () {
return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell();
},
getTotalSize: function () {
return Math.min(this._maxScrollSize, this._cellSizeAndPositionManager.getTotalSize());
},
getUpdatedOffsetForIndex: function (align, containerSize, currentOffset, targetIndex) {
currentOffset = this._safeOffsetToOffset(containerSize, currentOffset);
var offset = this._cellSizeAndPositionManager.getUpdatedOffsetForIndex(align, containerSize, currentOffset, targetIndex);
return this._offsetToSafeOffset(containerSize, offset);
},
getVisibleCellRange: function (containerSize, offset) {
offset = this._safeOffsetToOffset(containerSize, offset);
return this._cellSizeAndPositionManager.getVisibleCellRange(containerSize, offset);
},
resetCell: function (index) {
this._cellSizeAndPositionManager.resetCell(index);
},
_getOffsetPercentage: function (containerSize, offset, totalSize) {
return totalSize <= containerSize
? 0
: offset / (totalSize - containerSize);
},
_offsetToSafeOffset: function (containerSize, offset) {
var totalSize = this._cellSizeAndPositionManager.getTotalSize();
var safeTotalSize = this.getTotalSize();
if (totalSize === safeTotalSize) {
return offset;
}
var offsetPercentage = this._getOffsetPercentage(containerSize, offset, totalSize);
return Math.round(offsetPercentage * (safeTotalSize - containerSize));
},
_safeOffsetToOffset: function (containerSize, offset) {
var totalSize = this._cellSizeAndPositionManager.getTotalSize();
var safeTotalSize = this.getTotalSize();
if (totalSize === safeTotalSize) {
return offset;
}
var offsetPercentage = this._getOffsetPercentage(containerSize, offset, safeTotalSize);
return Math.round(offsetPercentage * (totalSize - containerSize));
}
};
/***/ }),
/* 113 */
/***/ (function(module, exports) {
/**
* 汉字拼音索引
*/
!(function () {
var _ChineseFirstPY = "YDYQSXMWZSSXJBYMGCCZQPSSQBYCDSCDQLDYLYBSSJGYZZJJFKCCLZDHWDWZJLJPFYYNWJJTMYHZWZHFLZPPQHGSCYYYNJQYXXGJHHSDSJNKKTMOMLCRXYPSNQSECCQZGGLLYJLMYZZSECYKYYHQWJSSGGYXYZYJWWKDJHYCHMYXJTLXJYQBYXZLDWRDJRWYSRLDZJPCBZJJBRCFTLECZSTZFXXZHTRQHYBDLYCZSSYMMRFMYQZPWWJJYFCRWFDFZQPYDDWYXKYJAWJFFXYPSFTZYHHYZYSWCJYXSCLCXXWZZXNBGNNXBXLZSZSBSGPYSYZDHMDZBQBZCWDZZYYTZHBTSYYBZGNTNXQYWQSKBPHHLXGYBFMJEBJHHGQTJCYSXSTKZHLYCKGLYSMZXYALMELDCCXGZYRJXSDLTYZCQKCNNJWHJTZZCQLJSTSTBNXBTYXCEQXGKWJYFLZQLYHYXSPSFXLMPBYSXXXYDJCZYLLLSJXFHJXPJBTFFYABYXBHZZBJYZLWLCZGGBTSSMDTJZXPTHYQTGLJSCQFZKJZJQNLZWLSLHDZBWJNCJZYZSQQYCQYRZCJJWYBRTWPYFTWEXCSKDZCTBZHYZZYYJXZCFFZZMJYXXSDZZOTTBZLQWFCKSZSXFYRLNYJMBDTHJXSQQCCSBXYYTSYFBXDZTGBCNSLCYZZPSAZYZZSCJCSHZQYDXLBPJLLMQXTYDZXSQJTZPXLCGLQTZWJBHCTSYJSFXYEJJTLBGXSXJMYJQQPFZASYJNTYDJXKJCDJSZCBARTDCLYJQMWNQNCLLLKBYBZZSYHQQLTWLCCXTXLLZNTYLNEWYZYXCZXXGRKRMTCNDNJTSYYSSDQDGHSDBJGHRWRQLYBGLXHLGTGXBQJDZPYJSJYJCTMRNYMGRZJCZGJMZMGXMPRYXKJNYMSGMZJYMKMFXMLDTGFBHCJHKYLPFMDXLQJJSMTQGZSJLQDLDGJYCALCMZCSDJLLNXDJFFFFJCZFMZFFPFKHKGDPSXKTACJDHHZDDCRRCFQYJKQCCWJDXHWJLYLLZGCFCQDSMLZPBJJPLSBCJGGDCKKDEZSQCCKJGCGKDJTJDLZYCXKLQSCGJCLTFPCQCZGWPJDQYZJJBYJHSJDZWGFSJGZKQCCZLLPSPKJGQJHZZLJPLGJGJJTHJJYJZCZMLZLYQBGJWMLJKXZDZNJQSYZMLJLLJKYWXMKJLHSKJGBMCLYYMKXJQLBMLLKMDXXKWYXYSLMLPSJQQJQXYXFJTJDXMXXLLCXQBSYJBGWYMBGGBCYXPJYGPEPFGDJGBHBNSQJYZJKJKHXQFGQZKFHYGKHDKLLSDJQXPQYKYBNQSXQNSZSWHBSXWHXWBZZXDMNSJBSBKBBZKLYLXGWXDRWYQZMYWSJQLCJXXJXKJEQXSCYETLZHLYYYSDZPAQYZCMTLSHTZCFYZYXYLJSDCJQAGYSLCQLYYYSHMRQQKLDXZSCSSSYDYCJYSFSJBFRSSZQSBXXPXJYSDRCKGJLGDKZJZBDKTCSYQPYHSTCLDJDHMXMCGXYZHJDDTMHLTXZXYLYMOHYJCLTYFBQQXPFBDFHHTKSQHZYYWCNXXCRWHOWGYJLEGWDQCWGFJYCSNTMYTOLBYGWQWESJPWNMLRYDZSZTXYQPZGCWXHNGPYXSHMYQJXZTDPPBFYHZHTJYFDZWKGKZBLDNTSXHQEEGZZYLZMMZYJZGXZXKHKSTXNXXWYLYAPSTHXDWHZYMPXAGKYDXBHNHXKDPJNMYHYLPMGOCSLNZHKXXLPZZLBMLSFBHHGYGYYGGBHSCYAQTYWLXTZQCEZYDQDQMMHTKLLSZHLSJZWFYHQSWSCWLQAZYNYTLSXTHAZNKZZSZZLAXXZWWCTGQQTDDYZTCCHYQZFLXPSLZYGPZSZNGLNDQTBDLXGTCTAJDKYWNSYZLJHHZZCWNYYZYWMHYCHHYXHJKZWSXHZYXLYSKQYSPSLYZWMYPPKBYGLKZHTYXAXQSYSHXASMCHKDSCRSWJPWXSGZJLWWSCHSJHSQNHCSEGNDAQTBAALZZMSSTDQJCJKTSCJAXPLGGXHHGXXZCXPDMMHLDGTYBYSJMXHMRCPXXJZCKZXSHMLQXXTTHXWZFKHCCZDYTCJYXQHLXDHYPJQXYLSYYDZOZJNYXQEZYSQYAYXWYPDGXDDXSPPYZNDLTWRHXYDXZZJHTCXMCZLHPYYYYMHZLLHNXMYLLLMDCPPXHMXDKYCYRDLTXJCHHZZXZLCCLYLNZSHZJZZLNNRLWHYQSNJHXYNTTTKYJPYCHHYEGKCTTWLGQRLGGTGTYGYHPYHYLQYQGCWYQKPYYYTTTTLHYHLLTYTTSPLKYZXGZWGPYDSSZZDQXSKCQNMJJZZBXYQMJRTFFBTKHZKBXLJJKDXJTLBWFZPPTKQTZTGPDGNTPJYFALQMKGXBDCLZFHZCLLLLADPMXDJHLCCLGYHDZFGYDDGCYYFGYDXKSSEBDHYKDKDKHNAXXYBPBYYHXZQGAFFQYJXDMLJCSQZLLPCHBSXGJYNDYBYQSPZWJLZKSDDTACTBXZDYZYPJZQSJNKKTKNJDJGYYPGTLFYQKASDNTCYHBLWDZHBBYDWJRYGKZYHEYYFJMSDTYFZJJHGCXPLXHLDWXXJKYTCYKSSSMTWCTTQZLPBSZDZWZXGZAGYKTYWXLHLSPBCLLOQMMZSSLCMBJCSZZKYDCZJGQQDSMCYTZQQLWZQZXSSFPTTFQMDDZDSHDTDWFHTDYZJYQJQKYPBDJYYXTLJHDRQXXXHAYDHRJLKLYTWHLLRLLRCXYLBWSRSZZSYMKZZHHKYHXKSMDSYDYCJPBZBSQLFCXXXNXKXWYWSDZYQOGGQMMYHCDZTTFJYYBGSTTTYBYKJDHKYXBELHTYPJQNFXFDYKZHQKZBYJTZBXHFDXKDASWTAWAJLDYJSFHBLDNNTNQJTJNCHXFJSRFWHZFMDRYJYJWZPDJKZYJYMPCYZNYNXFBYTFYFWYGDBNZZZDNYTXZEMMQBSQEHXFZMBMFLZZSRXYMJGSXWZJSPRYDJSJGXHJJGLJJYNZZJXHGXKYMLPYYYCXYTWQZSWHWLYRJLPXSLSXMFSWWKLCTNXNYNPSJSZHDZEPTXMYYWXYYSYWLXJQZQXZDCLEEELMCPJPCLWBXSQHFWWTFFJTNQJHJQDXHWLBYZNFJLALKYYJLDXHHYCSTYYWNRJYXYWTRMDRQHWQCMFJDYZMHMYYXJWMYZQZXTLMRSPWWCHAQBXYGZYPXYYRRCLMPYMGKSJSZYSRMYJSNXTPLNBAPPYPYLXYYZKYNLDZYJZCZNNLMZHHARQMPGWQTZMXXMLLHGDZXYHXKYXYCJMFFYYHJFSBSSQLXXNDYCANNMTCJCYPRRNYTYQNYYMBMSXNDLYLYSLJRLXYSXQMLLYZLZJJJKYZZCSFBZXXMSTBJGNXYZHLXNMCWSCYZYFZLXBRNNNYLBNRTGZQYSATSWRYHYJZMZDHZGZDWYBSSCSKXSYHYTXXGCQGXZZSHYXJSCRHMKKBXCZJYJYMKQHZJFNBHMQHYSNJNZYBKNQMCLGQHWLZNZSWXKHLJHYYBQLBFCDSXDLDSPFZPSKJYZWZXZDDXJSMMEGJSCSSMGCLXXKYYYLNYPWWWGYDKZJGGGZGGSYCKNJWNJPCXBJJTQTJWDSSPJXZXNZXUMELPXFSXTLLXCLJXJJLJZXCTPSWXLYDHLYQRWHSYCSQYYBYAYWJJJQFWQCQQCJQGXALDBZZYJGKGXPLTZYFXJLTPADKYQHPMATLCPDCKBMTXYBHKLENXDLEEGQDYMSAWHZMLJTWYGXLYQZLJEEYYBQQFFNLYXRDSCTGJGXYYNKLLYQKCCTLHJLQMKKZGCYYGLLLJDZGYDHZWXPYSJBZKDZGYZZHYWYFQYTYZSZYEZZLYMHJJHTSMQWYZLKYYWZCSRKQYTLTDXWCTYJKLWSQZWBDCQYNCJSRSZJLKCDCDTLZZZACQQZZDDXYPLXZBQJYLZLLLQDDZQJYJYJZYXNYYYNYJXKXDAZWYRDLJYYYRJLXLLDYXJCYWYWNQCCLDDNYYYNYCKCZHXXCCLGZQJGKWPPCQQJYSBZZXYJSQPXJPZBSBDSFNSFPZXHDWZTDWPPTFLZZBZDMYYPQJRSDZSQZSQXBDGCPZSWDWCSQZGMDHZXMWWFYBPDGPHTMJTHZSMMBGZMBZJCFZWFZBBZMQCFMBDMCJXLGPNJBBXGYHYYJGPTZGZMQBQTCGYXJXLWZKYDPDYMGCFTPFXYZTZXDZXTGKMTYBBCLBJASKYTSSQYYMSZXFJEWLXLLSZBQJJJAKLYLXLYCCTSXMCWFKKKBSXLLLLJYXTYLTJYYTDPJHNHNNKBYQNFQYYZBYYESSESSGDYHFHWTCJBSDZZTFDMXHCNJZYMQWSRYJDZJQPDQBBSTJGGFBKJBXTGQHNGWJXJGDLLTHZHHYYYYYYSXWTYYYCCBDBPYPZYCCZYJPZYWCBDLFWZCWJDXXHYHLHWZZXJTCZLCDPXUJCZZZLYXJJTXPHFXWPYWXZPTDZZBDZCYHJHMLXBQXSBYLRDTGJRRCTTTHYTCZWMXFYTWWZCWJWXJYWCSKYBZSCCTZQNHXNWXXKHKFHTSWOCCJYBCMPZZYKBNNZPBZHHZDLSYDDYTYFJPXYNGFXBYQXCBHXCPSXTYZDMKYSNXSXLHKMZXLYHDHKWHXXSSKQYHHCJYXGLHZXCSNHEKDTGZXQYPKDHEXTYKCNYMYYYPKQYYYKXZLTHJQTBYQHXBMYHSQCKWWYLLHCYYLNNEQXQWMCFBDCCMLJGGXDQKTLXKGNQCDGZJWYJJLYHHQTTTNWCHMXCXWHWSZJYDJCCDBQCDGDNYXZTHCQRXCBHZTQCBXWGQWYYBXHMBYMYQTYEXMQKYAQYRGYZSLFYKKQHYSSQYSHJGJCNXKZYCXSBXYXHYYLSTYCXQTHYSMGSCPMMGCCCCCMTZTASMGQZJHKLOSQYLSWTMXSYQKDZLJQQYPLSYCZTCQQPBBQJZCLPKHQZYYXXDTDDTSJCXFFLLCHQXMJLWCJCXTSPYCXNDTJSHJWXDQQJSKXYAMYLSJHMLALYKXCYYDMNMDQMXMCZNNCYBZKKYFLMCHCMLHXRCJJHSYLNMTJZGZGYWJXSRXCWJGJQHQZDQJDCJJZKJKGDZQGJJYJYLXZXXCDQHHHEYTMHLFSBDJSYYSHFYSTCZQLPBDRFRZTZYKYWHSZYQKWDQZRKMSYNBCRXQBJYFAZPZZEDZCJYWBCJWHYJBQSZYWRYSZPTDKZPFPBNZTKLQYHBBZPNPPTYZZYBQNYDCPJMMCYCQMCYFZZDCMNLFPBPLNGQJTBTTNJZPZBBZNJKLJQYLNBZQHKSJZNGGQSZZKYXSHPZSNBCGZKDDZQANZHJKDRTLZLSWJLJZLYWTJNDJZJHXYAYNCBGTZCSSQMNJPJYTYSWXZFKWJQTKHTZPLBHSNJZSYZBWZZZZLSYLSBJHDWWQPSLMMFBJDWAQYZTCJTBNNWZXQXCDSLQGDSDPDZHJTQQPSWLYYJZLGYXYZLCTCBJTKTYCZJTQKBSJLGMGZDMCSGPYNJZYQYYKNXRPWSZXMTNCSZZYXYBYHYZAXYWQCJTLLCKJJTJHGDXDXYQYZZBYWDLWQCGLZGJGQRQZCZSSBCRPCSKYDZNXJSQGXSSJMYDNSTZTPBDLTKZWXQWQTZEXNQCZGWEZKSSBYBRTSSSLCCGBPSZQSZLCCGLLLZXHZQTHCZMQGYZQZNMCOCSZJMMZSQPJYGQLJYJPPLDXRGZYXCCSXHSHGTZNLZWZKJCXTCFCJXLBMQBCZZWPQDNHXLJCTHYZLGYLNLSZZPCXDSCQQHJQKSXZPBAJYEMSMJTZDXLCJYRYYNWJBNGZZTMJXLTBSLYRZPYLSSCNXPHLLHYLLQQZQLXYMRSYCXZLMMCZLTZSDWTJJLLNZGGQXPFSKYGYGHBFZPDKMWGHCXMSGDXJMCJZDYCABXJDLNBCDQYGSKYDQTXDJJYXMSZQAZDZFSLQXYJSJZYLBTXXWXQQZBJZUFBBLYLWDSLJHXJYZJWTDJCZFQZQZZDZSXZZQLZCDZFJHYSPYMPQZMLPPLFFXJJNZZYLSJEYQZFPFZKSYWJJJHRDJZZXTXXGLGHYDXCSKYSWMMZCWYBAZBJKSHFHJCXMHFQHYXXYZFTSJYZFXYXPZLCHMZMBXHZZSXYFYMNCWDABAZLXKTCSHHXKXJJZJSTHYGXSXYYHHHJWXKZXSSBZZWHHHCWTZZZPJXSNXQQJGZYZYWLLCWXZFXXYXYHXMKYYSWSQMNLNAYCYSPMJKHWCQHYLAJJMZXHMMCNZHBHXCLXTJPLTXYJHDYYLTTXFSZHYXXSJBJYAYRSMXYPLCKDUYHLXRLNLLSTYZYYQYGYHHSCCSMZCTZQXKYQFPYYRPFFLKQUNTSZLLZMWWTCQQYZWTLLMLMPWMBZSSTZRBPDDTLQJJBXZCSRZQQYGWCSXFWZLXCCRSZDZMCYGGDZQSGTJSWLJMYMMZYHFBJDGYXCCPSHXNZCSBSJYJGJMPPWAFFYFNXHYZXZYLREMZGZCYZSSZDLLJCSQFNXZKPTXZGXJJGFMYYYSNBTYLBNLHPFZDCYFBMGQRRSSSZXYSGTZRNYDZZCDGPJAFJFZKNZBLCZSZPSGCYCJSZLMLRSZBZZLDLSLLYSXSQZQLYXZLSKKBRXBRBZCYCXZZZEEYFGKLZLYYHGZSGZLFJHGTGWKRAAJYZKZQTSSHJJXDCYZUYJLZYRZDQQHGJZXSSZBYKJPBFRTJXLLFQWJHYLQTYMBLPZDXTZYGBDHZZRBGXHWNJTJXLKSCFSMWLSDQYSJTXKZSCFWJLBXFTZLLJZLLQBLSQMQQCGCZFPBPHZCZJLPYYGGDTGWDCFCZQYYYQYSSCLXZSKLZZZGFFCQNWGLHQYZJJCZLQZZYJPJZZBPDCCMHJGXDQDGDLZQMFGPSYTSDYFWWDJZJYSXYYCZCYHZWPBYKXRYLYBHKJKSFXTZJMMCKHLLTNYYMSYXYZPYJQYCSYCWMTJJKQYRHLLQXPSGTLYYCLJSCPXJYZFNMLRGJJTYZBXYZMSJYJHHFZQMSYXRSZCWTLRTQZSSTKXGQKGSPTGCZNJSJCQCXHMXGGZTQYDJKZDLBZSXJLHYQGGGTHQSZPYHJHHGYYGKGGCWJZZYLCZLXQSFTGZSLLLMLJSKCTBLLZZSZMMNYTPZSXQHJCJYQXYZXZQZCPSHKZZYSXCDFGMWQRLLQXRFZTLYSTCTMJCXJJXHJNXTNRZTZFQYHQGLLGCXSZSJDJLJCYDSJTLNYXHSZXCGJZYQPYLFHDJSBPCCZHJJJQZJQDYBSSLLCMYTTMQTBHJQNNYGKYRQYQMZGCJKPDCGMYZHQLLSLLCLMHOLZGDYYFZSLJCQZLYLZQJESHNYLLJXGJXLYSYYYXNBZLJSSZCQQCJYLLZLTJYLLZLLBNYLGQCHXYYXOXCXQKYJXXXYKLXSXXYQXCYKQXQCSGYXXYQXYGYTQOHXHXPYXXXULCYEYCHZZCBWQBBWJQZSCSZSSLZYLKDESJZWMYMCYTSDSXXSCJPQQSQYLYYZYCMDJDZYWCBTJSYDJKCYDDJLBDJJSODZYSYXQQYXDHHGQQYQHDYXWGMMMAJDYBBBPPBCMUUPLJZSMTXERXJMHQNUTPJDCBSSMSSSTKJTSSMMTRCPLZSZMLQDSDMJMQPNQDXCFYNBFSDQXYXHYAYKQYDDLQYYYSSZBYDSLNTFQTZQPZMCHDHCZCWFDXTMYQSPHQYYXSRGJCWTJTZZQMGWJJTJHTQJBBHWZPXXHYQFXXQYWYYHYSCDYDHHQMNMTMWCPBSZPPZZGLMZFOLLCFWHMMSJZTTDHZZYFFYTZZGZYSKYJXQYJZQBHMBZZLYGHGFMSHPZFZSNCLPBQSNJXZSLXXFPMTYJYGBXLLDLXPZJYZJYHHZCYWHJYLSJEXFSZZYWXKZJLUYDTMLYMQJPWXYHXSKTQJEZRPXXZHHMHWQPWQLYJJQJJZSZCPHJLCHHNXJLQWZJHBMZYXBDHHYPZLHLHLGFWLCHYYTLHJXCJMSCPXSTKPNHQXSRTYXXTESYJCTLSSLSTDLLLWWYHDHRJZSFGXTSYCZYNYHTDHWJSLHTZDQDJZXXQHGYLTZPHCSQFCLNJTCLZPFSTPDYNYLGMJLLYCQHYSSHCHYLHQYQTMZYPBYWRFQYKQSYSLZDQJMPXYYSSRHZJNYWTQDFZBWWTWWRXCWHGYHXMKMYYYQMSMZHNGCEPMLQQMTCWCTMMPXJPJJHFXYYZSXZHTYBMSTSYJTTQQQYYLHYNPYQZLCYZHZWSMYLKFJXLWGXYPJYTYSYXYMZCKTTWLKSMZSYLMPWLZWXWQZSSAQSYXYRHSSNTSRAPXCPWCMGDXHXZDZYFJHGZTTSBJHGYZSZYSMYCLLLXBTYXHBBZJKSSDMALXHYCFYGMQYPJYCQXJLLLJGSLZGQLYCJCCZOTYXMTMTTLLWTGPXYMZMKLPSZZZXHKQYSXCTYJZYHXSHYXZKXLZWPSQPYHJWPJPWXQQYLXSDHMRSLZZYZWTTCYXYSZZSHBSCCSTPLWSSCJCHNLCGCHSSPHYLHFHHXJSXYLLNYLSZDHZXYLSXLWZYKCLDYAXZCMDDYSPJTQJZLNWQPSSSWCTSTSZLBLNXSMNYYMJQBQHRZWTYYDCHQLXKPZWBGQYBKFCMZWPZLLYYLSZYDWHXPSBCMLJBSCGBHXLQHYRLJXYSWXWXZSLDFHLSLYNJLZYFLYJYCDRJLFSYZFSLLCQYQFGJYHYXZLYLMSTDJCYHBZLLNWLXXYGYYHSMGDHXXHHLZZJZXCZZZCYQZFNGWPYLCPKPYYPMCLQKDGXZGGWQBDXZZKZFBXXLZXJTPJPTTBYTSZZDWSLCHZHSLTYXHQLHYXXXYYZYSWTXZKHLXZXZPYHGCHKCFSYHUTJRLXFJXPTZTWHPLYXFCRHXSHXKYXXYHZQDXQWULHYHMJTBFLKHTXCWHJFWJCFPQRYQXCYYYQYGRPYWSGSUNGWCHKZDXYFLXXHJJBYZWTSXXNCYJJYMSWZJQRMHXZWFQSYLZJZGBHYNSLBGTTCSYBYXXWXYHXYYXNSQYXMQYWRGYQLXBBZLJSYLPSYTJZYHYZAWLRORJMKSCZJXXXYXCHDYXRYXXJDTSQFXLYLTSFFYXLMTYJMJUYYYXLTZCSXQZQHZXLYYXZHDNBRXXXJCTYHLBRLMBRLLAXKYLLLJLYXXLYCRYLCJTGJCMTLZLLCYZZPZPCYAWHJJFYBDYYZSMPCKZDQYQPBPCJPDCYZMDPBCYYDYCNNPLMTMLRMFMMGWYZBSJGYGSMZQQQZTXMKQWGXLLPJGZBQCDJJJFPKJKCXBLJMSWMDTQJXLDLPPBXCWRCQFBFQJCZAHZGMYKPHYYHZYKNDKZMBPJYXPXYHLFPNYYGXJDBKXNXHJMZJXSTRSTLDXSKZYSYBZXJLXYSLBZYSLHXJPFXPQNBYLLJQKYGZMCYZZYMCCSLCLHZFWFWYXZMWSXTYNXJHPYYMCYSPMHYSMYDYSHQYZCHMJJMZCAAGCFJBBHPLYZYLXXSDJGXDHKXXTXXNBHRMLYJSLTXMRHNLXQJXYZLLYSWQGDLBJHDCGJYQYCMHWFMJYBMBYJYJWYMDPWHXQLDYGPDFXXBCGJSPCKRSSYZJMSLBZZJFLJJJLGXZGYXYXLSZQYXBEXYXHGCXBPLDYHWETTWWCJMBTXCHXYQXLLXFLYXLLJLSSFWDPZSMYJCLMWYTCZPCHQEKCQBWLCQYDPLQPPQZQFJQDJHYMMCXTXDRMJWRHXCJZYLQXDYYNHYYHRSLSRSYWWZJYMTLTLLGTQCJZYABTCKZCJYCCQLJZQXALMZYHYWLWDXZXQDLLQSHGPJFJLJHJABCQZDJGTKHSSTCYJLPSWZLXZXRWGLDLZRLZXTGSLLLLZLYXXWGDZYGBDPHZPBRLWSXQBPFDWOFMWHLYPCBJCCLDMBZPBZZLCYQXLDOMZBLZWPDWYYGDSTTHCSQSCCRSSSYSLFYBFNTYJSZDFNDPDHDZZMBBLSLCMYFFGTJJQWFTMTPJWFNLBZCMMJTGBDZLQLPYFHYYMJYLSDCHDZJWJCCTLJCLDTLJJCPDDSQDSSZYBNDBJLGGJZXSXNLYCYBJXQYCBYLZCFZPPGKCXZDZFZTJJFJSJXZBNZYJQTTYJYHTYCZHYMDJXTTMPXSPLZCDWSLSHXYPZGTFMLCJTYCBPMGDKWYCYZCDSZZYHFLYCTYGWHKJYYLSJCXGYWJCBLLCSNDDBTZBSCLYZCZZSSQDLLMQYYHFSLQLLXFTYHABXGWNYWYYPLLSDLDLLBJCYXJZMLHLJDXYYQYTDLLLBUGBFDFBBQJZZMDPJHGCLGMJJPGAEHHBWCQXAXHHHZCHXYPHJAXHLPHJPGPZJQCQZGJJZZUZDMQYYBZZPHYHYBWHAZYJHYKFGDPFQSDLZMLJXKXGALXZDAGLMDGXMWZQYXXDXXPFDMMSSYMPFMDMMKXKSYZYSHDZKXSYSMMZZZMSYDNZZCZXFPLSTMZDNMXCKJMZTYYMZMZZMSXHHDCZJEMXXKLJSTLWLSQLYJZLLZJSSDPPMHNLZJCZYHMXXHGZCJMDHXTKGRMXFWMCGMWKDTKSXQMMMFZZYDKMSCLCMPCGMHSPXQPZDSSLCXKYXTWLWJYAHZJGZQMCSNXYYMMPMLKJXMHLMLQMXCTKZMJQYSZJSYSZHSYJZJCDAJZYBSDQJZGWZQQXFKDMSDJLFWEHKZQKJPEYPZYSZCDWYJFFMZZYLTTDZZEFMZLBNPPLPLPEPSZALLTYLKCKQZKGENQLWAGYXYDPXLHSXQQWQCQXQCLHYXXMLYCCWLYMQYSKGCHLCJNSZKPYZKCQZQLJPDMDZHLASXLBYDWQLWDNBQCRYDDZTJYBKBWSZDXDTNPJDTCTQDFXQQMGNXECLTTBKPWSLCTYQLPWYZZKLPYGZCQQPLLKCCYLPQMZCZQCLJSLQZDJXLDDHPZQDLJJXZQDXYZQKZLJCYQDYJPPYPQYKJYRMPCBYMCXKLLZLLFQPYLLLMBSGLCYSSLRSYSQTMXYXZQZFDZUYSYZTFFMZZSMZQHZSSCCMLYXWTPZGXZJGZGSJSGKDDHTQGGZLLBJDZLCBCHYXYZHZFYWXYZYMSDBZZYJGTSMTFXQYXQSTDGSLNXDLRYZZLRYYLXQHTXSRTZNGZXBNQQZFMYKMZJBZYMKBPNLYZPBLMCNQYZZZSJZHJCTZKHYZZJRDYZHNPXGLFZTLKGJTCTSSYLLGZRZBBQZZKLPKLCZYSSUYXBJFPNJZZXCDWXZYJXZZDJJKGGRSRJKMSMZJLSJYWQSKYHQJSXPJZZZLSNSHRNYPZTWCHKLPSRZLZXYJQXQKYSJYCZTLQZYBBYBWZPQDWWYZCYTJCJXCKCWDKKZXSGKDZXWWYYJQYYTCYTDLLXWKCZKKLCCLZCQQDZLQLCSFQCHQHSFSMQZZLNBJJZBSJHTSZDYSJQJPDLZCDCWJKJZZLPYCGMZWDJJBSJQZSYZYHHXJPBJYDSSXDZNCGLQMBTSFSBPDZDLZNFGFJGFSMPXJQLMBLGQCYYXBQKDJJQYRFKZTJDHCZKLBSDZCFJTPLLJGXHYXZCSSZZXSTJYGKGCKGYOQXJPLZPBPGTGYJZGHZQZZLBJLSQFZGKQQJZGYCZBZQTLDXRJXBSXXPZXHYZYCLWDXJJHXMFDZPFZHQHQMQGKSLYHTYCGFRZGNQXCLPDLBZCSCZQLLJBLHBZCYPZZPPDYMZZSGYHCKCPZJGSLJLNSCDSLDLXBMSTLDDFJMKDJDHZLZXLSZQPQPGJLLYBDSZGQLBZLSLKYYHZTTNTJYQTZZPSZQZTLLJTYYLLQLLQYZQLBDZLSLYYZYMDFSZSNHLXZNCZQZPBWSKRFBSYZMTHBLGJPMCZZLSTLXSHTCSYZLZBLFEQHLXFLCJLYLJQCBZLZJHHSSTBRMHXZHJZCLXFNBGXGTQJCZTMSFZKJMSSNXLJKBHSJXNTNLZDNTLMSJXGZJYJCZXYJYJWRWWQNZTNFJSZPZSHZJFYRDJSFSZJZBJFZQZZHZLXFYSBZQLZSGYFTZDCSZXZJBQMSZKJRHYJZCKMJKHCHGTXKXQGLXPXFXTRTYLXJXHDTSJXHJZJXZWZLCQSBTXWXGXTXXHXFTSDKFJHZYJFJXRZSDLLLTQSQQZQWZXSYQTWGWBZCGZLLYZBCLMQQTZHZXZXLJFRMYZFLXYSQXXJKXRMQDZDMMYYBSQBHGZMWFWXGMXLZPYYTGZYCCDXYZXYWGSYJYZNBHPZJSQSYXSXRTFYZGRHZTXSZZTHCBFCLSYXZLZQMZLMPLMXZJXSFLBYZMYQHXJSXRXSQZZZSSLYFRCZJRCRXHHZXQYDYHXSJJHZCXZBTYNSYSXJBQLPXZQPYMLXZKYXLXCJLCYSXXZZLXDLLLJJYHZXGYJWKJRWYHCPSGNRZLFZWFZZNSXGXFLZSXZZZBFCSYJDBRJKRDHHGXJLJJTGXJXXSTJTJXLYXQFCSGSWMSBCTLQZZWLZZKXJMLTMJYHSDDBXGZHDLBMYJFRZFSGCLYJBPMLYSMSXLSZJQQHJZFXGFQFQBPXZGYYQXGZTCQWYLTLGWSGWHRLFSFGZJMGMGBGTJFSYZZGZYZAFLSSPMLPFLCWBJZCLJJMZLPJJLYMQDMYYYFBGYGYZMLYZDXQYXRQQQHSYYYQXYLJTYXFSFSLLGNQCYHYCWFHCCCFXPYLYPLLZYXXXXXKQHHXSHJZCFZSCZJXCPZWHHHHHAPYLQALPQAFYHXDYLUKMZQGGGDDESRNNZLTZGCHYPPYSQJJHCLLJTOLNJPZLJLHYMHEYDYDSQYCDDHGZUNDZCLZYZLLZNTNYZGSLHSLPJJBDGWXPCDUTJCKLKCLWKLLCASSTKZZDNQNTTLYYZSSYSSZZRYLJQKCQDHHCRXRZYDGRGCWCGZQFFFPPJFZYNAKRGYWYQPQXXFKJTSZZXSWZDDFBBXTBGTZKZNPZZPZXZPJSZBMQHKCYXYLDKLJNYPKYGHGDZJXXEAHPNZKZTZCMXCXMMJXNKSZQNMNLWBWWXJKYHCPSTMCSQTZJYXTPCTPDTNNPGLLLZSJLSPBLPLQHDTNJNLYYRSZFFJFQWDPHZDWMRZCCLODAXNSSNYZRESTYJWJYJDBCFXNMWTTBYLWSTSZGYBLJPXGLBOCLHPCBJLTMXZLJYLZXCLTPNCLCKXTPZJSWCYXSFYSZDKNTLBYJCYJLLSTGQCBXRYZXBXKLYLHZLQZLNZCXWJZLJZJNCJHXMNZZGJZZXTZJXYCYYCXXJYYXJJXSSSJSTSSTTPPGQTCSXWZDCSYFPTFBFHFBBLZJCLZZDBXGCXLQPXKFZFLSYLTUWBMQJHSZBMDDBCYSCCLDXYCDDQLYJJWMQLLCSGLJJSYFPYYCCYLTJANTJJPWYCMMGQYYSXDXQMZHSZXPFTWWZQSWQRFKJLZJQQYFBRXJHHFWJJZYQAZMYFRHCYYBYQWLPEXCCZSTYRLTTDMQLYKMBBGMYYJPRKZNPBSXYXBHYZDJDNGHPMFSGMWFZMFQMMBCMZZCJJLCNUXYQLMLRYGQZCYXZLWJGCJCGGMCJNFYZZJHYCPRRCMTZQZXHFQGTJXCCJEAQCRJYHPLQLSZDJRBCQHQDYRHYLYXJSYMHZYDWLDFRYHBPYDTSSCNWBXGLPZMLZZTQSSCPJMXXYCSJYTYCGHYCJWYRXXLFEMWJNMKLLSWTXHYYYNCMMCWJDQDJZGLLJWJRKHPZGGFLCCSCZMCBLTBHBQJXQDSPDJZZGHGLFQYWBZYZJLTSTDHQHCTCBCHFLQMPWDSHYYTQWCNZZJTLBYMBPDYYYXSQKXWYYFLXXNCWCXYPMAELYKKJMZZZBRXYYQJFLJPFHHHYTZZXSGQQMHSPGDZQWBWPJHZJDYSCQWZKTXXSQLZYYMYSDZGRXCKKUJLWPYSYSCSYZLRMLQSYLJXBCXTLWDQZPCYCYKPPPNSXFYZJJRCEMHSZMSXLXGLRWGCSTLRSXBZGBZGZTCPLUJLSLYLYMTXMTZPALZXPXJTJWTCYYZLBLXBZLQMYLXPGHDSLSSDMXMBDZZSXWHAMLCZCPJMCNHJYSNSYGCHSKQMZZQDLLKABLWJXSFMOCDXJRRLYQZKJMYBYQLYHETFJZFRFKSRYXFJTWDSXXSYSQJYSLYXWJHSNLXYYXHBHAWHHJZXWMYLJCSSLKYDZTXBZSYFDXGXZJKHSXXYBSSXDPYNZWRPTQZCZENYGCXQFJYKJBZMLJCMQQXUOXSLYXXLYLLJDZBTYMHPFSTTQQWLHOKYBLZZALZXQLHZWRRQHLSTMYPYXJJXMQSJFNBXYXYJXXYQYLTHYLQYFMLKLJTMLLHSZWKZHLJMLHLJKLJSTLQXYLMBHHLNLZXQJHXCFXXLHYHJJGBYZZKBXSCQDJQDSUJZYYHZHHMGSXCSYMXFEBCQWWRBPYYJQTYZCYQYQQZYHMWFFHGZFRJFCDPXNTQYZPDYKHJLFRZXPPXZDBBGZQSTLGDGYLCQMLCHHMFYWLZYXKJLYPQHSYWMQQGQZMLZJNSQXJQSYJYCBEHSXFSZPXZWFLLBCYYJDYTDTHWZSFJMQQYJLMQXXLLDTTKHHYBFPWTYYSQQWNQWLGWDEBZWCMYGCULKJXTMXMYJSXHYBRWFYMWFRXYQMXYSZTZZTFYKMLDHQDXWYYNLCRYJBLPSXCXYWLSPRRJWXHQYPHTYDNXHHMMYWYTZCSQMTSSCCDALWZTCPQPYJLLQZYJSWXMZZMMYLMXCLMXCZMXMZSQTZPPQQBLPGXQZHFLJJHYTJSRXWZXSCCDLXTYJDCQJXSLQYCLZXLZZXMXQRJMHRHZJBHMFLJLMLCLQNLDXZLLLPYPSYJYSXCQQDCMQJZZXHNPNXZMEKMXHYKYQLXSXTXJYYHWDCWDZHQYYBGYBCYSCFGPSJNZDYZZJZXRZRQJJYMCANYRJTLDPPYZBSTJKXXZYPFDWFGZZRPYMTNGXZQBYXNBUFNQKRJQZMJEGRZGYCLKXZDSKKNSXKCLJSPJYYZLQQJYBZSSQLLLKJXTBKTYLCCDDBLSPPFYLGYDTZJYQGGKQTTFZXBDKTYYHYBBFYTYYBCLPDYTGDHRYRNJSPTCSNYJQHKLLLZSLYDXXWBCJQSPXBPJZJCJDZFFXXBRMLAZHCSNDLBJDSZBLPRZTSWSBXBCLLXXLZDJZSJPYLYXXYFTFFFBHJJXGBYXJPMMMPSSJZJMTLYZJXSWXTYLEDQPJMYGQZJGDJLQJWJQLLSJGJGYGMSCLJJXDTYGJQJQJCJZCJGDZZSXQGSJGGCXHQXSNQLZZBXHSGZXCXYLJXYXYYDFQQJHJFXDHCTXJYRXYSQTJXYEFYYSSYYJXNCYZXFXMSYSZXYYSCHSHXZZZGZZZGFJDLTYLNPZGYJYZYYQZPBXQBDZTZCZYXXYHHSQXSHDHGQHJHGYWSZTMZMLHYXGEBTYLZKQWYTJZRCLEKYSTDBCYKQQSAYXCJXWWGSBHJYZYDHCSJKQCXSWXFLTYNYZPZCCZJQTZWJQDZZZQZLJJXLSBHPYXXPSXSHHEZTXFPTLQYZZXHYTXNCFZYYHXGNXMYWXTZSJPTHHGYMXMXQZXTSBCZYJYXXTYYZYPCQLMMSZMJZZLLZXGXZAAJZYXJMZXWDXZSXZDZXLEYJJZQBHZWZZZQTZPSXZTDSXJJJZNYAZPHXYYSRNQDTHZHYYKYJHDZXZLSWCLYBZYECWCYCRYLCXNHZYDZYDYJDFRJJHTRSQTXYXJRJHOJYNXELXSFSFJZGHPZSXZSZDZCQZBYYKLSGSJHCZSHDGQGXYZGXCHXZJWYQWGYHKSSEQZZNDZFKWYSSTCLZSTSYMCDHJXXYWEYXCZAYDMPXMDSXYBSQMJMZJMTZQLPJYQZCGQHXJHHLXXHLHDLDJQCLDWBSXFZZYYSCHTYTYYBHECXHYKGJPXHHYZJFXHWHBDZFYZBCAPNPGNYDMSXHMMMMAMYNBYJTMPXYYMCTHJBZYFCGTYHWPHFTWZZEZSBZEGPFMTSKFTYCMHFLLHGPZJXZJGZJYXZSBBQSCZZLZCCSTPGXMJSFTCCZJZDJXCYBZLFCJSYZFGSZLYBCWZZBYZDZYPSWYJZXZBDSYUXLZZBZFYGCZXBZHZFTPBGZGEJBSTGKDMFHYZZJHZLLZZGJQZLSFDJSSCBZGPDLFZFZSZYZYZSYGCXSNXXCHCZXTZZLJFZGQSQYXZJQDCCZTQCDXZJYQJQCHXZTDLGSCXZSYQJQTZWLQDQZTQCHQQJZYEZZZPBWKDJFCJPZTYPQYQTTYNLMBDKTJZPQZQZZFPZSBNJLGYJDXJDZZKZGQKXDLPZJTCJDQBXDJQJSTCKNXBXZMSLYJCQMTJQWWCJQNJNLLLHJCWQTBZQYDZCZPZZDZYDDCYZZZCCJTTJFZDPRRTZTJDCQTQZDTJNPLZBCLLCTZSXKJZQZPZLBZRBTJDCXFCZDBCCJJLTQQPLDCGZDBBZJCQDCJWYNLLZYZCCDWLLXWZLXRXNTQQCZXKQLSGDFQTDDGLRLAJJTKUYMKQLLTZYTDYYCZGJWYXDXFRSKSTQTENQMRKQZHHQKDLDAZFKYPBGGPZREBZZYKZZSPEGJXGYKQZZZSLYSYYYZWFQZYLZZLZHWCHKYPQGNPGBLPLRRJYXCCSYYHSFZFYBZYYTGZXYLXCZWXXZJZBLFFLGSKHYJZEYJHLPLLLLCZGXDRZELRHGKLZZYHZLYQSZZJZQLJZFLNBHGWLCZCFJYSPYXZLZLXGCCPZBLLCYBBBBUBBCBPCRNNZCZYRBFSRLDCGQYYQXYGMQZWTZYTYJXYFWTEHZZJYWLCCNTZYJJZDEDPZDZTSYQJHDYMBJNYJZLXTSSTPHNDJXXBYXQTZQDDTJTDYYTGWSCSZQFLSHLGLBCZPHDLYZJYCKWTYTYLBNYTSDSYCCTYSZYYEBHEXHQDTWNYGYCLXTSZYSTQMYGZAZCCSZZDSLZCLZRQXYYELJSBYMXSXZTEMBBLLYYLLYTDQYSHYMRQWKFKBFXNXSBYCHXBWJYHTQBPBSBWDZYLKGZSKYHXQZJXHXJXGNLJKZLYYCDXLFYFGHLJGJYBXQLYBXQPQGZTZPLNCYPXDJYQYDYMRBESJYYHKXXSTMXRCZZYWXYQYBMCLLYZHQYZWQXDBXBZWZMSLPDMYSKFMZKLZCYQYCZLQXFZZYDQZPZYGYJYZMZXDZFYFYTTQTZHGSPCZMLCCYTZXJCYTJMKSLPZHYSNZLLYTPZCTZZCKTXDHXXTQCYFKSMQCCYYAZHTJPCYLZLYJBJXTPNYLJYYNRXSYLMMNXJSMYBCSYSYLZYLXJJQYLDZLPQBFZZBLFNDXQKCZFYWHGQMRDSXYCYTXNQQJZYYPFZXDYZFPRXEJDGYQBXRCNFYYQPGHYJDYZXGRHTKYLNWDZNTSMPKLBTHBPYSZBZTJZSZZJTYYXZPHSSZZBZCZPTQFZMYFLYPYBBJQXZMXXDJMTSYSKKBJZXHJCKLPSMKYJZCXTMLJYXRZZQSLXXQPYZXMKYXXXJCLJPRMYYGADYSKQLSNDHYZKQXZYZTCGHZTLMLWZYBWSYCTBHJHJFCWZTXWYTKZLXQSHLYJZJXTMPLPYCGLTBZZTLZJCYJGDTCLKLPLLQPJMZPAPXYZLKKTKDZCZZBNZDYDYQZJYJGMCTXLTGXSZLMLHBGLKFWNWZHDXUHLFMKYSLGXDTWWFRJEJZTZHYDXYKSHWFZCQSHKTMQQHTZHYMJDJSKHXZJZBZZXYMPAGQMSTPXLSKLZYNWRTSQLSZBPSPSGZWYHTLKSSSWHZZLYYTNXJGMJSZSUFWNLSOZTXGXLSAMMLBWLDSZYLAKQCQCTMYCFJBSLXCLZZCLXXKSBZQCLHJPSQPLSXXCKSLNHPSFQQYTXYJZLQLDXZQJZDYYDJNZPTUZDSKJFSLJHYLZSQZLBTXYDGTQFDBYAZXDZHZJNHHQBYKNXJJQCZMLLJZKSPLDYCLBBLXKLELXJLBQYCXJXGCNLCQPLZLZYJTZLJGYZDZPLTQCSXFDMNYCXGBTJDCZNBGBQYQJWGKFHTNPYQZQGBKPBBYZMTJDYTBLSQMPSXTBNPDXKLEMYYCJYNZCTLDYKZZXDDXHQSHDGMZSJYCCTAYRZLPYLTLKXSLZCGGEXCLFXLKJRTLQJAQZNCMBYDKKCXGLCZJZXJHPTDJJMZQYKQSECQZDSHHADMLZFMMZBGNTJNNLGBYJBRBTMLBYJDZXLCJLPLDLPCQDHLXZLYCBLCXZZJADJLNZMMSSSMYBHBSQKBHRSXXJMXSDZNZPXLGBRHWGGFCXGMSKLLTSJYYCQLTSKYWYYHYWXBXQYWPYWYKQLSQPTNTKHQCWDQKTWPXXHCPTHTWUMSSYHBWCRWXHJMKMZNGWTMLKFGHKJYLSYYCXWHYECLQHKQHTTQKHFZLDXQWYZYYDESBPKYRZPJFYYZJCEQDZZDLATZBBFJLLCXDLMJSSXEGYGSJQXCWBXSSZPDYZCXDNYXPPZYDLYJCZPLTXLSXYZYRXCYYYDYLWWNZSAHJSYQYHGYWWAXTJZDAXYSRLTDPSSYYFNEJDXYZHLXLLLZQZSJNYQYQQXYJGHZGZCYJCHZLYCDSHWSHJZYJXCLLNXZJJYYXNFXMWFPYLCYLLABWDDHWDXJMCXZTZPMLQZHSFHZYNZTLLDYWLSLXHYMMYLMBWWKYXYADTXYLLDJPYBPWUXJMWMLLSAFDLLYFLBHHHBQQLTZJCQJLDJTFFKMMMBYTHYGDCQRDDWRQJXNBYSNWZDBYYTBJHPYBYTTJXAAHGQDQTMYSTQXKBTZPKJLZRBEQQSSMJJBDJOTGTBXPGBKTLHQXJJJCTHXQDWJLWRFWQGWSHCKRYSWGFTGYGBXSDWDWRFHWYTJJXXXJYZYSLPYYYPAYXHYDQKXSHXYXGSKQHYWFDDDPPLCJLQQEEWXKSYYKDYPLTJTHKJLTCYYHHJTTPLTZZCDLTHQKZXQYSTEEYWYYZYXXYYSTTJKLLPZMCYHQGXYHSRMBXPLLNQYDQHXSXXWGDQBSHYLLPJJJTHYJKYPPTHYYKTYEZYENMDSHLCRPQFDGFXZPSFTLJXXJBSWYYSKSFLXLPPLBBBLBSFXFYZBSJSSYLPBBFFFFSSCJDSTZSXZRYYSYFFSYZYZBJTBCTSBSDHRTJJBYTCXYJEYLXCBNEBJDSYXYKGSJZBXBYTFZWGENYHHTHZHHXFWGCSTBGXKLSXYWMTMBYXJSTZSCDYQRCYTWXZFHMYMCXLZNSDJTTTXRYCFYJSBSDYERXJLJXBBDEYNJGHXGCKGSCYMBLXJMSZNSKGXFBNBPTHFJAAFXYXFPXMYPQDTZCXZZPXRSYWZDLYBBKTYQPQJPZYPZJZNJPZJLZZFYSBTTSLMPTZRTDXQSJEHBZYLZDHLJSQMLHTXTJECXSLZZSPKTLZKQQYFSYGYWPCPQFHQHYTQXZKRSGTTSQCZLPTXCDYYZXSQZSLXLZMYCPCQBZYXHBSXLZDLTCDXTYLZJYYZPZYZLTXJSJXHLPMYTXCQRBLZSSFJZZTNJYTXMYJHLHPPLCYXQJQQKZZSCPZKSWALQSBLCCZJSXGWWWYGYKTJBBZTDKHXHKGTGPBKQYSLPXPJCKBMLLXDZSTBKLGGQKQLSBKKTFXRMDKBFTPZFRTBBRFERQGXYJPZSSTLBZTPSZQZSJDHLJQLZBPMSMMSXLQQNHKNBLRDDNXXDHDDJCYYGYLXGZLXSYGMQQGKHBPMXYXLYTQWLWGCPBMQXCYZYDRJBHTDJYHQSHTMJSBYPLWHLZFFNYPMHXXHPLTBQPFBJWQDBYGPNZTPFZJGSDDTQSHZEAWZZYLLTYYBWJKXXGHLFKXDJTMSZSQYNZGGSWQSPHTLSSKMCLZXYSZQZXNCJDQGZDLFNYKLJCJLLZLMZZNHYDSSHTHZZLZZBBHQZWWYCRZHLYQQJBEYFXXXWHSRXWQHWPSLMSSKZTTYGYQQWRSLALHMJTQJSMXQBJJZJXZYZKXBYQXBJXSHZTSFJLXMXZXFGHKZSZGGYLCLSARJYHSLLLMZXELGLXYDJYTLFBHBPNLYZFBBHPTGJKWETZHKJJXZXXGLLJLSTGSHJJYQLQZFKCGNNDJSSZFDBCTWWSEQFHQJBSAQTGYPQLBXBMMYWXGSLZHGLZGQYFLZBYFZJFRYSFMBYZHQGFWZSYFYJJPHZBYYZFFWODGRLMFTWLBZGYCQXCDJYGZYYYYTYTYDWEGAZYHXJLZYYHLRMGRXXZCLHNELJJTJTPWJYBJJBXJJTJTEEKHWSLJPLPSFYZPQQBDLQJJTYYQLYZKDKSQJYYQZLDQTGJQYZJSUCMRYQTHTEJMFCTYHYPKMHYZWJDQFHYYXWSHCTXRLJHQXHCCYYYJLTKTTYTMXGTCJTZAYYOCZLYLBSZYWJYTSJYHBYSHFJLYGJXXTMZYYLTXXYPZLXYJZYZYYPNHMYMDYYLBLHLSYYQQLLNJJYMSOYQBZGDLYXYLCQYXTSZEGXHZGLHWBLJHEYXTWQMAKBPQCGYSHHEGQCMWYYWLJYJHYYZLLJJYLHZYHMGSLJLJXCJJYCLYCJPCPZJZJMMYLCQLNQLJQJSXYJMLSZLJQLYCMMHCFMMFPQQMFYLQMCFFQMMMMHMZNFHHJGTTHHKHSLNCHHYQDXTMMQDCYZYXYQMYQYLTDCYYYZAZZCYMZYDLZFFFMMYCQZWZZMABTBYZTDMNZZGGDFTYPCGQYTTSSFFWFDTZQSSYSTWXJHXYTSXXYLBYQHWWKXHZXWZNNZZJZJJQJCCCHYYXBZXZCYZTLLCQXYNJYCYYCYNZZQYYYEWYCZDCJYCCHYJLBTZYYCQWMPWPYMLGKDLDLGKQQBGYCHJXY";
// 此处收录了375个多音字,数据来自于http://www.51windows.net/pages/pinyin.asp
var oMultiDiff = {
19969: "DZ",
19975: "WM",
19988: "QJ",
20048: "YL",
20056: "SC",
20060: "NM",
20094: "QG",
20127: "QJ",
20167: "QC",
20193: "YG",
20250: "KH",
20256: "ZC",
20282: "SC",
20285: "QJG",
20291: "TD",
20314: "YD",
20315: "BF",
20340: "NE",
20375: "TD",
20389: "YJ",
20391: "CZ",
20415: "PB",
20446: "YS",
20447: "SQ",
20504: "TC",
20608: "KG",
20854: "QJ",
20857: "ZC",
20911: "PF",
20985: "AW",
21032: "PB",
21048: "XQ",
21049: "SC",
21089: "YS",
21119: "JC",
21242: "SB",
21273: "SC",
21305: "YP",
21306: "QO",
21330: "ZC",
21333: "SDC",
21345: "QK",
21378: "CA",
21397: "SC",
21414: "XS",
21442: "SC",
21477: "JG",
21480: "TD",
21484: "ZS",
21494: "YX",
21505: "YX",
21512: "HG",
21523: "XH",
21537: "PB",
21542: "PF",
21549: "KH",
21571: "E",
21574: "DA",
21588: "TD",
21589: "O",
21618: "ZC",
21621: "KHA",
21632: "ZJ",
21654: "KG",
21679: "LKG",
21683: "KH",
21710: "A",
21719: "YH",
21734: "WOE",
21769: "A",
21780: "WN",
21804: "XH",
21834: "A",
21899: "ZD",
21903: "RN",
21908: "WO",
21939: "ZC",
21956: "SA",
21964: "YA",
21970: "TD",
22003: "A",
22031: "JG",
22040: "XS",
22060: "ZC",
22066: "ZC",
22079: "MH",
22129: "XJ",
22179: "XA",
22237: "NJ",
22244: "TD",
22280: "JQ",
22300: "YH",
22313: "XW",
22331: "YQ",
22343: "YJ",
22351: "PH",
22395: "DC",
22412: "TD",
22484: "PB",
22500: "PB",
22534: "ZD",
22549: "DH",
22561: "PB",
22612: "TD",
22771: "KQ",
22831: "HB",
22841: "JG",
22855: "QJ",
22865: "XQ",
23013: "ML",
23081: "WM",
23487: "SX",
23558: "QJ",
23561: "YW",
23586: "YW",
23614: "YW",
23615: "SN",
23631: "PB",
23646: "ZS",
23663: "ZT",
23673: "YG",
23762: "TD",
23769: "ZS",
23780: "QJ",
23884: "QK",
24055: "XH",
24113: "DC",
24162: "ZC",
24191: "GA",
24273: "QJ",
24324: "NL",
24377: "TD",
24378: "QJ",
24439: "PF",
24554: "ZS",
24683: "TD",
24694: "WE",
24733: "LK",
24925: "TN",
25094: "ZG",
25100: "XQ",
25103: "XH",
25153: "PB",
25170: "PB",
25179: "KG",
25203: "PB",
25240: "ZS",
25282: "FB",
25303: "NA",
25324: "KG",
25341: "ZY",
25373: "WZ",
25375: "XJ",
25384: "A",
25457: "A",
25528: "SD",
25530: "SC",
25552: "TD",
25774: "ZC",
25874: "ZC",
26044: "YW",
26080: "WM",
26292: "PB",
26333: "PB",
26355: "ZY",
26366: "CZ",
26397: "ZC",
26399: "QJ",
26415: "ZS",
26451: "SB",
26526: "ZC",
26552: "JG",
26561: "TD",
26588: "JG",
26597: "CZ",
26629: "ZS",
26638: "YL",
26646: "XQ",
26653: "KG",
26657: "XJ",
26727: "HG",
26894: "ZC",
26937: "ZS",
26946: "ZC",
26999: "KJ",
27099: "KJ",
27449: "YQ",
27481: "XS",
27542: "ZS",
27663: "ZS",
27748: "TS",
27784: "SC",
27788: "ZD",
27795: "TD",
27812: "O",
27850: "PB",
27852: "MB",
27895: "SL",
27898: "PL",
27973: "QJ",
27981: "KH",
27986: "HX",
27994: "XJ",
28044: "YC",
28065: "WG",
28177: "SM",
28267: "QJ",
28291: "KH",
28337: "ZQ",
28463: "TL",
28548: "DC",
28601: "TD",
28689: "PB",
28805: "JG",
28820: "QG",
28846: "PB",
28952: "TD",
28975: "ZC",
29100: "A",
29325: "QJ",
29575: "SL",
29602: "FB",
30010: "TD",
30044: "CX",
30058: "PF",
30091: "YSP",
30111: "YN",
30229: "XJ",
30427: "SC",
30465: "SX",
30631: "YQ",
30655: "QJ",
30684: "QJG",
30707: "SD",
30729: "XH",
30796: "LG",
30917: "PB",
31074: "NM",
31085: "JZ",
31109: "SC",
31181: "ZC",
31192: "MLB",
31293: "JQ",
31400: "YX",
31584: "YJ",
31896: "ZN",
31909: "ZY",
31995: "XJ",
32321: "PF",
32327: "ZY",
32418: "HG",
32420: "XQ",
32421: "HG",
32438: "LG",
32473: "GJ",
32488: "TD",
32521: "QJ",
32527: "PB",
32562: "ZSQ",
32564: "JZ",
32735: "ZD",
32793: "PB",
33071: "PF",
33098: "XL",
33100: "YA",
33152: "PB",
33261: "CX",
33324: "BP",
33333: "TD",
33406: "YA",
33426: "WM",
33432: "PB",
33445: "JG",
33486: "ZN",
33493: "TS",
33507: "QJ",
33540: "QJ",
33544: "ZC",
33564: "XQ",
33617: "YT",
33632: "QJ",
33636: "XH",
33637: "YX",
33694: "WG",
33705: "PF",
33728: "YW",
33882: "SR",
34067: "WM",
34074: "YW",
34121: "QJ",
34255: "ZC",
34259: "XL",
34425: "JH",
34430: "XH",
34485: "KH",
34503: "YS",
34532: "HG",
34552: "XS",
34558: "YE",
34593: "ZL",
34660: "YQ",
34892: "XH",
34928: "SC",
34999: "QJ",
35048: "PB",
35059: "SC",
35098: "ZC",
35203: "TQ",
35265: "JX",
35299: "JX",
35782: "SZ",
35828: "YS",
35830: "E",
35843: "TD",
35895: "YG",
35977: "MH",
36158: "JG",
36228: "QJ",
36426: "XQ",
36466: "DC",
36710: "CJ",
36711: "ZYG",
36767: "PB",
36866: "SK",
36951: "YW",
37034: "YX",
37063: "XH",
37218: "ZC",
37325: "ZC",
38063: "PB",
38079: "TD",
38085: "QY",
38107: "DC",
38116: "TD",
38123: "YD",
38224: "HG",
38241: "XTC",
38271: "ZC",
38415: "YE",
38426: "KH",
38461: "YD",
38463: "AE",
38466: "PB",
38477: "XJ",
38518: "YT",
38551: "WK",
38585: "ZC",
38704: "XS",
38739: "LJ",
38761: "GJ",
38808: "SQ",
39048: "JG",
39049: "XJ",
39052: "HG",
39076: "CZ",
39271: "XT",
39534: "TD",
39552: "TD",
39584: "PB",
39647: "SB",
39730: "LG",
39748: "TPB",
40109: "ZQ",
40479: "ND",
40516: "HG",
40536: "HG",
40583: "QJ",
40765: "YQ",
40784: "QJ",
40840: "YK",
40863: "QJG"
};
var _checkPYCh = function (ch) {
var uni = ch.charCodeAt(0);
// 如果不在汉字处理范围之内,返回原字符,也可以调用自己的处理函数
if (uni > 40869 || uni < 19968) {return ch;} // dealWithOthers(ch);
return (oMultiDiff[uni] ? oMultiDiff[uni] : (_ChineseFirstPY.charAt(uni - 19968)));
};
var _mkPYRslt = function (arr, options) {
var ignoreMulti = options.ignoreMulti;
var splitChar = options.splitChar;
var arrRslt = [""], k, multiLen = 0;
for (var i = 0, len = arr.length; i < len; i++) {
var str = arr[i];
var strlen = str.length;
// 多音字过多的情况下,指数增长会造成浏览器卡死,超过20完全卡死,18勉强能用,考虑到不同性能最好是16或者14
// 超过14个多音字之后,后面的都用第一个拼音
if (strlen == 1 || multiLen > 14 || ignoreMulti) {
var tmpStr = str.substring(0, 1);
for (k = 0; k < arrRslt.length; k++) {
arrRslt[k] += tmpStr;
}
} else {
var tmpArr = arrRslt.slice(0);
arrRslt = [];
multiLen ++;
for (k = 0; k < strlen; k++) {
// 复制一个相同的arrRslt
var tmp = tmpArr.slice(0);
// 把当前字符str[k]添加到每个元素末尾
for (var j = 0; j < tmp.length; j++) {
tmp[j] += str.charAt(k);
}
// 把复制并修改后的数组连接到arrRslt上
arrRslt = arrRslt.concat(tmp);
}
}
}
// BI-56386 这边直接将所有多音字组合拼接是有风险的,因为丢失了每一组的起始索引信息, 外部使用indexOf等方法会造成错位
// 一旦错位就可能认为不符合条件, 但实际上还是有可能符合条件的,故此处以一个无法搜索的不可见字符作为连接
return arrRslt.join(splitChar || "").toLowerCase();
};
_.extend(BI, {
makeFirstPY: function (str, options) {
options = options || {};
if (typeof (str) !== "string") {return "" + str;}
var arrResult = []; // 保存中间结果的数组
for (var i = 0, len = str.length; i < len; i++) {
// 获得unicode码
var ch = str.charAt(i);
// 检查该unicode码是否在处理范围之内,在则返回该码对映汉字的拼音首字母,不在则调用其它函数处理
arrResult.push(_checkPYCh(ch));
}
// 处理arrResult,返回所有可能的拼音首字母串数组
return _mkPYRslt(arrResult, options);
}
});
})();
/***/ }),
/* 114 */
/***/ (function(module, exports) {
(function () {
function defaultComparator (a, b) {
return a < b;
}
BI.Heap = function (items, comparator) {
this._items = items || [];
this._size = this._items.length;
this._comparator = comparator || defaultComparator;
this._heapify();
};
BI.Heap.prototype = {
constructor: BI.Heap,
empty: function () {
return this._size === 0;
},
pop: function () {
if (this._size === 0) {
return;
}
var elt = this._items[0];
var lastElt = this._items.pop();
this._size--;
if (this._size > 0) {
this._items[0] = lastElt;
this._sinkDown(0);
}
return elt;
},
push: function (item) {
this._items[this._size++] = item;
this._bubbleUp(this._size - 1);
},
size: function () {
return this._size;
},
peek: function () {
if (this._size === 0) {
return;
}
return this._items[0];
},
_heapify: function () {
for (var index = Math.floor((this._size + 1) / 2); index >= 0; index--) {
this._sinkDown(index);
}
},
_bubbleUp: function (index) {
var elt = this._items[index];
while (index > 0) {
var parentIndex = Math.floor((index + 1) / 2) - 1;
var parentElt = this._items[parentIndex];
// if parentElt < elt, stop
if (this._comparator(parentElt, elt)) {
return;
}
// swap
this._items[parentIndex] = elt;
this._items[index] = parentElt;
index = parentIndex;
}
},
_sinkDown: function (index) {
var elt = this._items[index];
while (true) {
var leftChildIndex = 2 * (index + 1) - 1;
var rightChildIndex = 2 * (index + 1);
var swapIndex = -1;
if (leftChildIndex < this._size) {
var leftChild = this._items[leftChildIndex];
if (this._comparator(leftChild, elt)) {
swapIndex = leftChildIndex;
}
}
if (rightChildIndex < this._size) {
var rightChild = this._items[rightChildIndex];
if (this._comparator(rightChild, elt)) {
if (swapIndex === -1 ||
this._comparator(rightChild, this._items[swapIndex])) {
swapIndex = rightChildIndex;
}
}
}
// if we don't have a swap, stop
if (swapIndex === -1) {
return;
}
this._items[index] = this._items[swapIndex];
this._items[swapIndex] = elt;
index = swapIndex;
}
}
};
})();
/***/ }),
/* 115 */
/***/ (function(module, exports) {
!(function () {
BI.LinkHashMap = function () {
this.array = [];
this.map = {};
};
BI.LinkHashMap.prototype = {
constructor: BI.LinkHashMap,
has: function (key) {
if (key in this.map) {
return true;
}
return false;
},
add: function (key, value) {
if (typeof key === "undefined") {
return;
}
if (key in this.map) {
this.map[key] = value;
} else {
this.array.push(key);
this.map[key] = value;
}
},
remove: function (key) {
if (key in this.map) {
delete this.map[key];
for (var i = 0; i < this.array.length; i++) {
if (this.array[i] == key) {
this.array.splice(i, 1);
break;
}
}
}
},
size: function () {
return this.array.length;
},
each: function (fn, scope) {
var scope = scope || window;
var fn = fn || null;
if (fn == null || typeof (fn) !== "function") {
return;
}
for (var i = 0; i < this.array.length; i++) {
var key = this.array[i];
var value = this.map[key];
var re = fn.call(scope, key, value, i, this.array, this.map);
if (re == false) {
break;
}
}
},
get: function (key) {
return this.map[key];
},
toArray: function () {
var array = [];
this.each(function (key, value) {
array.push(value);
});
return array;
}
};
})();
/***/ }),
/* 116 */
/***/ (function(module, exports) {
!(function () {
BI.LRU = function (limit) {
this.size = 0;
this.limit = limit;
this.head = this.tail = undefined;
this._keymap = {};
};
var p = BI.LRU.prototype;
p.put = function (key, value) {
var removed;
if (this.size === this.limit) {
removed = this.shift();
}
var entry = this.get(key, true);
if (!entry) {
entry = {
key: key
};
this._keymap[key] = entry;
if (this.tail) {
this.tail.newer = entry;
entry.older = this.tail;
} else {
this.head = entry;
}
this.tail = entry;
this.size++;
}
entry.value = value;
return removed;
};
p.shift = function () {
var entry = this.head;
if (entry) {
this.head = this.head.newer;
this.head.older = undefined;
entry.newer = entry.older = undefined;
this._keymap[entry.key] = undefined;
this.size--;
}
return entry;
};
p.get = function (key, returnEntry) {
var entry = this._keymap[key];
if (entry === undefined) return;
if (entry === this.tail) {
return returnEntry
? entry
: entry.value;
}
// HEAD--------------TAIL
// <.older .newer>
// <--- add direction --
// A B C <D> E
if (entry.newer) {
if (entry === this.head) {
this.head = entry.newer;
}
entry.newer.older = entry.older; // C <-- E.
}
if (entry.older) {
entry.older.newer = entry.newer; // C. --> E
}
entry.newer = undefined; // D --x
entry.older = this.tail; // D. --> E
if (this.tail) {
this.tail.newer = entry; // E. <-- D
}
this.tail = entry;
return returnEntry
? entry
: entry.value;
};
p.has = function (key) {
return this._keymap[key] != null;
};
})();
/***/ }),
/* 117 */
/***/ (function(module, exports) {
// 线段树
(function () {
var parent = function (node) {
return Math.floor(node / 2);
};
var Int32Array = _global.Int32Array || function (size) {
var xs = [];
for (var i = size - 1; i >= 0; --i) {
xs[i] = 0;
}
return xs;
};
var ceilLog2 = function (x) {
var y = 1;
while (y < x) {
y *= 2;
}
return y;
};
BI.PrefixIntervalTree = function (xs) {
this._size = xs.length;
this._half = ceilLog2(this._size);
// _heap是一个_size两倍以上的堆
this._heap = new Int32Array(2 * this._half);
var i;
// 初始化 >= _size 的堆空间, 即叶子节点
for (i = 0; i < this._size; ++i) {
this._heap[this._half + i] = xs[i];
}
// 初始化 < _size 的堆空间, 即非叶子节点,根节点包含整个区间
for (i = this._half - 1; i > 0; --i) {
this._heap[i] = this._heap[2 * i] + this._heap[2 * i + 1];
}
};
BI.PrefixIntervalTree.prototype = {
constructor: BI.PrefixIntervalTree,
// 往_half之后的空间set值,需要更新其所有祖先节点的值
set: function (index, value) {
var node = this._half + index;
this._heap[node] = value;
node = parent(node);
for (; node !== 0; node = parent(node)) {
this._heap[node] =
this._heap[2 * node] + this._heap[2 * node + 1];
}
},
get: function (index) {
var node = this._half + index;
return this._heap[node];
},
getSize: function () {
return this._size;
},
/**
* get(0) + get(1) + ... + get(end - 1).
*/
sumUntil: function (end) {
if (end === 0) {
return 0;
}
var node = this._half + end - 1;
var sum = this._heap[node];
for (; node !== 1; node = parent(node)) {
if (node % 2 === 1) {
sum += this._heap[node - 1];
}
}
return sum;
},
/**
* get(0) + get(1) + ... + get(inclusiveEnd).
*/
sumTo: function (inclusiveEnd) {
return this.sumUntil(inclusiveEnd + 1);
},
/**
* sum get(begin) + get(begin + 1) + ... + get(end - 1).
*/
sum: function (begin, end) {
return this.sumUntil(end) - this.sumUntil(begin);
},
/**
* Returns the smallest i such that 0 <= i <= size and sumUntil(i) <= t, or
* -1 if no such i exists.
*/
greatestLowerBound: function (t) {
if (t < 0) {
return -1;
}
var node = 1;
if (this._heap[node] <= t) {
return this._size;
}
while (node < this._half) {
var leftSum = this._heap[2 * node];
if (t < leftSum) {
node = 2 * node;
} else {
node = 2 * node + 1;
t -= leftSum;
}
}
return node - this._half;
},
/**
* Returns the smallest i such that 0 <= i <= size and sumUntil(i) < t, or
* -1 if no such i exists.
*/
greatestStrictLowerBound: function (t) {
if (t <= 0) {
return -1;
}
var node = 1;
if (this._heap[node] < t) {
return this._size;
}
while (node < this._half) {
var leftSum = this._heap[2 * node];
if (t <= leftSum) {
node = 2 * node;
} else {
node = 2 * node + 1;
t -= leftSum;
}
}
return node - this._half;
},
/**
* Returns the smallest i such that 0 <= i <= size and t <= sumUntil(i), or
* size + 1 if no such i exists.
*/
leastUpperBound: function (t) {
return this.greatestStrictLowerBound(t) + 1;
},
/**
* Returns the smallest i such that 0 <= i <= size and t < sumUntil(i), or
* size + 1 if no such i exists.
*/
leastStrictUpperBound: function (t) {
return this.greatestLowerBound(t) + 1;
}
};
BI.PrefixIntervalTree.uniform = function (size, initialValue) {
var xs = [];
for (var i = size - 1; i >= 0; --i) {
xs[i] = initialValue;
}
return new BI.PrefixIntervalTree(xs);
};
BI.PrefixIntervalTree.empty = function (size) {
return BI.PrefixIntervalTree.uniform(size, 0);
};
})();
/***/ }),
/* 118 */
/***/ (function(module, exports) {
!(function () {
BI.Queue = function (capacity) {
this.capacity = capacity;
this.array = [];
};
BI.Queue.prototype = {
constructor: BI.Queue,
contains: function (v) {
return BI.contains(this.array, v);
},
indexOf: function (v) {
return BI.contains(this.array, v);
},
getElementByIndex: function (index) {
return this.array[index];
},
push: function (v) {
this.array.push(v);
if (this.capacity && this.array.length > this.capacity) {
this.array.shift();
}
},
pop: function () {
this.array.pop();
},
shift: function () {
this.array.shift();
},
unshift: function (v) {
this.array.unshift(v);
if (this.capacity && this.array.length > this.capacity) {
this.array.pop();
}
},
remove: function (v) {
BI.remove(this.array, v);
},
splice: function () {
this.array.splice.apply(this.array, arguments);
},
slice: function () {
this.array.slice.apply(this.array, arguments);
},
size: function () {
return this.array.length;
},
each: function (fn, scope) {
var scope = scope || window;
var fn = fn || null;
if (fn == null || typeof (fn) !== "function") {
return;
}
for (var i = 0; i < this.array.length; i++) {
var re = fn.call(scope, i, this.array[i], this.array);
if (re == false) {
break;
}
}
},
toArray: function () {
return this.array;
},
fromArray: function (array) {
var self = this;
BI.each(array, function (i, v) {
self.push(v);
});
},
clear: function () {
this.array.length = 0;
}
};
})();
/***/ }),
/* 119 */
/***/ (function(module, exports) {
!(function () {
var Section = function (height, width, x, y) {
this.height = height;
this.width = width;
this.x = x;
this.y = y;
this._indexMap = {};
this._indices = [];
};
Section.prototype = {
constructor: Section,
addCellIndex: function (index) {
if (!this._indexMap[index]) {
this._indexMap[index] = true;
this._indices.push(index);
}
},
getCellIndices: function () {
return this._indices;
}
};
var SECTION_SIZE = 100;
BI.SectionManager = function (sectionSize) {
this._sectionSize = sectionSize || SECTION_SIZE;
this._cellMetadata = [];
this._sections = {};
};
BI.SectionManager.prototype = {
constructor: BI.SectionManager,
getCellIndices: function (height, width, x, y) {
var indices = {};
BI.each(this.getSections(height, width, x, y), function (i, section) {
BI.each(section.getCellIndices(), function (j, index) {
indices[index] = index;
});
});
return BI.map(BI.keys(indices), function (i, index) {
return indices[index];
});
},
getCellMetadata: function (index) {
return this._cellMetadata[index];
},
getSections: function (height, width, x, y) {
var sectionXStart = Math.floor(x / this._sectionSize);
var sectionXStop = Math.floor((x + width - 1) / this._sectionSize);
var sectionYStart = Math.floor(y / this._sectionSize);
var sectionYStop = Math.floor((y + height - 1) / this._sectionSize);
var sections = [];
for (var sectionX = sectionXStart; sectionX <= sectionXStop; sectionX++) {
for (var sectionY = sectionYStart; sectionY <= sectionYStop; sectionY++) {
var key = sectionX + "." + sectionY;
if (!this._sections[key]) {
this._sections[key] = new Section(this._sectionSize, this._sectionSize, sectionX * this._sectionSize, sectionY * this._sectionSize);
}
sections.push(this._sections[key]);
}
}
return sections;
},
getTotalSectionCount: function () {
return BI.size(this._sections);
},
registerCell: function (cellMetadatum, index) {
this._cellMetadata[index] = cellMetadatum;
BI.each(this.getSections(cellMetadatum.height, cellMetadatum.width, cellMetadatum.x, cellMetadatum.y), function (i, section) {
section.addCellIndex(index);
});
}
};
})();
/***/ }),
/* 120 */
/***/ (function(module, exports) {
(function () {
BI.Tree = function () {
this.root = new BI.Node(BI.UUID());
};
BI.Tree.prototype = {
constructor: BI.Tree,
addNode: function (node, newNode, index) {
if (BI.isNull(newNode)) {
this.root.addChild(node, index);
} else if (BI.isNull(node)) {
this.root.addChild(newNode, index);
} else {
node.addChild(newNode, index);
}
},
isRoot: function (node) {
return node === this.root;
},
getRoot: function () {
return this.root;
},
clear: function () {
this.root.clear();
},
initTree: function (nodes) {
var self = this;
this.clear();
var queue = [];
BI.each(nodes, function (i, node) {
var n = new BI.Node(node);
n.set("data", node);
self.addNode(n);
queue.push(n);
});
while (!BI.isEmpty(queue)) {
var parent = queue.shift();
var node = parent.get("data");
BI.each(node.children, function (i, child) {
var n = new BI.Node(child);
n.set("data", child);
queue.push(n);
self.addNode(parent, n);
});
}
},
_toJSON: function (node) {
var self = this;
var children = [];
BI.each(node.getChildren(), function (i, child) {
children.push(self._toJSON(child));
});
return BI.extend({
id: node.id
}, BI.deepClone(node.get("data")), (children.length > 0 ? {
children: children
} : {}));
},
toJSON: function (node) {
var self = this, result = [];
BI.each((node || this.root).getChildren(), function (i, child) {
result.push(self._toJSON(child));
});
return result;
},
_toJSONWithNode: function (node) {
var self = this;
var children = [];
BI.each(node.getChildren(), function (i, child) {
children.push(self._toJSONWithNode(child));
});
return BI.extend({
id: node.id
}, BI.deepClone(node.get("data")), {
node: node
}, (children.length > 0 ? {
children: children
} : {}));
},
toJSONWithNode: function (node) {
var self = this, result = [];
BI.each((node || this.root).getChildren(), function (i, child) {
result.push(self._toJSONWithNode(child));
});
return result;
},
search: function (root, target, param) {
if (!(root instanceof BI.Node)) {
return arguments.callee.apply(this, [this.root, root, target]);
}
var self = this, next = null;
if (BI.isNull(target)) {
return null;
}
if (BI.isEqual(root[param || "id"], target)) {
return root;
}
BI.any(root.getChildren(), function (i, child) {
next = self.search(child, target, param);
if (null !== next) {
return true;
}
});
return next;
},
_traverse: function (node, callback) {
var queue = [];
queue.push(node);
while (!BI.isEmpty(queue)) {
var temp = queue.shift();
var b = callback && callback(temp);
if (b === false) {
break;
}
if (b === true) {
continue;
}
if (temp != null) {
queue = queue.concat(temp.getChildren());
}
}
},
traverse: function (callback) {
this._traverse(this.root, callback);
},
_recursion: function (node, route, callback) {
var self = this;
return BI.every(node.getChildren(), function (i, child) {
var next = BI.clone(route);
next.push(child.id);
var b = callback && callback(child, next);
if (b === false) {
return false;
}
if (b === true) {
return true;
}
return self._recursion(child, next, callback);
});
},
recursion: function (callback) {
this._recursion(this.root, [], callback);
},
inOrderTraverse: function (callback) {
this._inOrderTraverse(this.root, callback);
},
// 中序遍历(递归)
_inOrderTraverse: function (node, callback) {
if (node != null) {
this._inOrderTraverse(node.getLeft());
callback && callback(node);
this._inOrderTraverse(node.getRight());
}
},
// 中序遍历(非递归)
nrInOrderTraverse: function (callback) {
var stack = [];
var node = this.root;
while (node != null || !BI.isEmpty(stack)) {
while (node != null) {
stack.push(node);
node = node.getLeft();
}
node = stack.pop();
callback && callback(node);
node = node.getRight();
}
},
preOrderTraverse: function (callback) {
this._preOrderTraverse(this.root, callback);
},
// 先序遍历(递归)
_preOrderTraverse: function (node, callback) {
if (node != null) {
callback && callback(node);
this._preOrderTraverse(node.getLeft());
this._preOrderTraverse(node.getRight());
}
},
// 先序遍历(非递归)
nrPreOrderTraverse: function (callback) {
var stack = [];
var node = this.root;
while (node != null || !BI.isEmpty(stack)) {
while (node != null) {
callback && callback(node);
stack.push(node);
node = node.getLeft();
}
node = stack.pop();
node = node.getRight();
}
},
postOrderTraverse: function (callback) {
this._postOrderTraverse(this.root, callback);
},
// 后序遍历(递归)
_postOrderTraverse: function (node, callback) {
if (node != null) {
this._postOrderTraverse(node.getLeft());
this._postOrderTraverse(node.getRight());
callback && callback(node);
}
},
// 后续遍历(非递归)
nrPostOrderTraverse: function (callback) {
var stack = [];
var node = this.root;
var preNode = null;// 表示最近一次访问的节点
while (node != null || !BI.isEmpty(stack)) {
while (node != null) {
stack.push(node);
node = node.getLeft();
}
node = BI.last(stack);
if (node.getRight() == null || node.getRight() == preNode) {
callback && callback(node);
node = stack.pop();
preNode = node;
node = null;
} else {
node = node.getRight();
}
}
}
};
BI.Node = function (id) {
if (BI.isObject(id)) {
BI.extend(this, id);
} else {
this.id = id;
}
this.clear.apply(this, arguments);
};
BI.Node.prototype = {
constructor: BI.Node,
set: function (key, value) {
if (BI.isObject(key)) {
BI.extend(this, key);
return;
}
this[key] = value;
},
get: function (key) {
return this[key];
},
isLeaf: function () {
return BI.isEmpty(this.children);
},
getChildren: function () {
return this.children;
},
getChildrenLength: function () {
return this.children.length;
},
getFirstChild: function () {
return BI.first(this.children);
},
getLastChild: function () {
return BI.last(this.children);
},
setLeft: function (left) {
this.left = left;
},
getLeft: function () {
return this.left;
},
setRight: function (right) {
this.right = right;
},
getRight: function () {
return this.right;
},
setParent: function (parent) {
this.parent = parent;
},
getParent: function () {
return this.parent;
},
getChild: function (index) {
return this.children[index];
},
getChildIndex: function (id) {
return BI.findIndex(this.children, function (i, ch) {
return ch.get("id") === id;
});
},
removeChild: function (id) {
this.removeChildByIndex(this.getChildIndex(id));
},
removeChildByIndex: function (index) {
var before = this.getChild(index - 1);
var behind = this.getChild(index + 1);
if (before != null) {
before.setRight(behind || null);
}
if (behind != null) {
behind.setLeft(before || null);
}
this.children.splice(index, 1);
},
removeAllChilds: function () {
this.children = [];
},
addChild: function (child, index) {
var cur = null;
if (BI.isUndefined(index)) {
cur = this.children.length - 1;
} else {
cur = index - 1;
}
child.setParent(this);
if (cur >= 0) {
this.getChild(cur) && this.getChild(cur).setRight(child);
child.setLeft(this.getChild(cur));
}
if (BI.isUndefined(index)) {
this.children.push(child);
} else {
this.children.splice(index, 0, child);
}
},
equals: function (obj) {
return this === obj || this.id === obj.id;
},
clear: function () {
this.parent = null;
this.left = null;
this.right = null;
this.children = [];
}
};
BI.extend(BI.Tree, {
transformToArrayFormat: function (nodes, pId) {
if (!nodes) return [];
var r = [];
if (BI.isArray(nodes)) {
for (var i = 0, l = nodes.length; i < l; i++) {
var node = BI.clone(nodes[i]);
node.pId = node.pId == null ? pId : node.pId;
delete node.children;
r.push(node);
if (nodes[i]["children"]) {
r = r.concat(BI.Tree.transformToArrayFormat(nodes[i]["children"], node.id));
}
}
} else {
var newNodes = BI.clone(nodes);
newNodes.pId = newNodes.pId == null ? pId : newNodes.pId;
delete newNodes.children;
r.push(newNodes);
if (nodes["children"]) {
r = r.concat(BI.Tree.transformToArrayFormat(nodes["children"], newNodes.id));
}
}
return r;
},
arrayFormat: function (nodes, pId) {
if (!nodes) {
return [];
}
var r = [];
if (BI.isArray(nodes)) {
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
node.pId = node.pId == null ? pId : node.pId;
r.push(node);
if (nodes[i]["children"]) {
r = r.concat(BI.Tree.arrayFormat(nodes[i]["children"], node.id));
}
}
} else {
var newNodes = nodes;
newNodes.pId = newNodes.pId == null ? pId : newNodes.pId;
r.push(newNodes);
if (nodes["children"]) {
r = r.concat(BI.Tree.arrayFormat(nodes["children"], newNodes.id));
}
}
return r;
},
transformToTreeFormat: function (sNodes) {
var i, l;
if (!sNodes) {
return [];
}
if (BI.isArray(sNodes)) {
var r = [];
var tmpMap = {};
for (i = 0, l = sNodes.length; i < l; i++) {
if (BI.isNull(sNodes[i].id)) {
return sNodes;
}
tmpMap[sNodes[i].id] = BI.clone(sNodes[i]);
}
for (i = 0, l = sNodes.length; i < l; i++) {
if (tmpMap[sNodes[i].pId] && sNodes[i].id !== sNodes[i].pId) {
if (!tmpMap[sNodes[i].pId].children) {
tmpMap[sNodes[i].pId].children = [];
}
tmpMap[sNodes[i].pId].children.push(tmpMap[sNodes[i].id]);
} else {
r.push(tmpMap[sNodes[i].id]);
}
delete tmpMap[sNodes[i].id].pId;
}
return r;
}
return [sNodes];
},
treeFormat: function (sNodes) {
var i, l;
if (!sNodes) {
return [];
}
if (BI.isArray(sNodes)) {
var r = [];
var tmpMap = {};
for (i = 0, l = sNodes.length; i < l; i++) {
if (BI.isNull(sNodes[i].id)) {
return sNodes;
}
tmpMap[sNodes[i].id] = sNodes[i];
}
for (i = 0, l = sNodes.length; i < l; i++) {
if (tmpMap[sNodes[i].pId] && sNodes[i].id !== sNodes[i].pId) {
if (!tmpMap[sNodes[i].pId].children) {
tmpMap[sNodes[i].pId].children = [];
}
tmpMap[sNodes[i].pId].children.push(tmpMap[sNodes[i].id]);
} else {
r.push(tmpMap[sNodes[i].id]);
}
}
return r;
}
return [sNodes];
},
traversal: function (array, callback) {
if (BI.isNull(array)) {
return;
}
var self = this;
BI.some(array, function (i, item) {
if (callback(i, item) === false) {
return true;
}
self.traversal(item.children, callback);
});
}
});
})();
/***/ }),
/* 121 */
/***/ (function(module, exports) {
// 向量操作
BI.Vector = function (x, y) {
this.x = x;
this.y = y;
};
BI.Vector.prototype = {
constructor: BI.Vector,
cross: function (v) {
return (this.x * v.y - this.y * v.x);
},
length: function (v) {
return (Math.sqrt(this.x * v.x + this.y * v.y));
}
};
BI.Region = function (x, y, w, h) {
this.x = x;
this.y = y;
this.w = w;
this.h = h;
};
BI.Region.prototype = {
constructor: BI.Region,
// 判断两个区域是否相交,若相交,则要么顶点互相包含,要么矩形边界(或对角线)相交
isIntersects: function (obj) {
if (this.isPointInside(obj.x, obj.y) ||
this.isPointInside(obj.x + obj.w, obj.y) ||
this.isPointInside(obj.x, obj.y + obj.h) ||
this.isPointInside(obj.x + obj.w, obj.y + obj.h)) {
return true;
} else if (obj.isPointInside(this.x, this.y) ||
obj.isPointInside(this.x + this.w, this.y) ||
obj.isPointInside(this.x, this.y + this.h) ||
obj.isPointInside(this.x + this.w, this.y + this.h)) {
return true;
} else if (obj.x != null && obj.y != null)// 判断矩形对角线相交 |v1 X v2||v1 X v3| < 0
{
var vector1 = new BI.Vector(this.w, this.h);// 矩形对角线向量
var vector2 = new BI.Vector(obj.x - this.x, obj.y - this.y);
var vector3 = new BI.Vector(vector2.x + obj.w, vector2.y + obj.h);
if ((vector1.cross(vector2) * vector1.cross(vector3)) < 0) {
return true;
}
}
return false;
},
// 判断一个点是否在这个区域内部
isPointInside: function (x, y) {
if (this.x == null || this.y == null) {
return false;
}
if (x >= this.x && x <= this.x + this.w && y >= this.y && y <= this.y + this.h) {
return true;
}
return false;
},
// 返回区域的重心,因为是矩形所以返回中点
getPosition: function () {
var pos = [];
pos.push(this.x + this.w / 2);
pos.push(this.y + this.h / 2);
return pos;
}
};
/***/ }),
/* 122 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {(function () {
var _global;
if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
}
function isEmpty (value) {
// 判断是否为空值
var result = value === "" || value === null || value === undefined;
return result;
}
// 判断是否是无效的日期
function isInvalidDate (date) {
return date == "Invalid Date" || date == "NaN";
}
/**
* CHART-1400
* 使用数值计算的方式来获取任意数值的科学技术表示值。
* 科学计数格式
*/
function _eFormat (text, fmt) {
text = +text;
return eFormat(text, fmt);
/**
* 科学计数格式具体计算过程
* @param num
* @param format {String}有两种形式,
* 1、"0.00E00"这样的字符串表示正常的科学计数表示,只不过规定了数值精确到百分位,
* 而数量级的绝对值如果是10以下的时候在前面补零。
* 2、 "##0.0E0"这样的字符串则规定用科学计数法表示之后的数值的整数部分是三位,精确到十分位,
* 数量级没有规定,因为没见过实数里有用科学计数法表示之后E的后面会小于一位的情况(0无所谓)。
* @returns {*}
*/
function eFormat (num, format) {
var neg = num < 0 ? (num *= -1, "-") : "",
magnitudeNeg = "";
var funcName = num > 0 && num < 1 ? "floor" : "ceil"; // -0.9999->-1
// 数量级
var magnitude = Math[funcName](Math.log(num) / Math.log(10));
if (!isFinite(magnitude)) {
return format.replace(/#/ig, "").replace(/\.e/ig, "E");
}
num = num / Math.pow(10, magnitude);
// 让num转化成[1, 10)区间上的数
if (num > 0 && num < 1) {
num *= 10;
magnitude -= 1;
}
// 计算出format中需要显示的整数部分的位数,然后更新这个数值,也更新数量级
var integerLen = getInteger(magnitude, format);
integerLen > 1 && (magnitude -= integerLen - 1, num *= Math.pow(10, integerLen - 1));
magnitude < 0 && (magnitudeNeg = "-", magnitude *= -1);
// 获取科学计数法精确到的位数
var precision = getPrecision(format);
// 判断num经过四舍五入之后是否有进位
var isValueCarry = isValueCarried(num);
num *= Math.pow(10, precision);
num = Math.round(num);
// 如果出现进位的情况,将num除以10
isValueCarry && (num /= 10, magnitude += magnitudeNeg === "-" ? -1 : 1);
num /= Math.pow(10, precision);
// 小数部分保留precision位
num = num.toFixed(precision);
// 格式化指数的部分
magnitude = formatExponential(format, magnitude, magnitudeNeg);
return neg + num + "E" + magnitude;
}
// 获取format格式规定的数量级的形式
function formatExponential (format, num, magnitudeNeg) {
num += "";
if (!/e/ig.test(format)) {
return num;
}
format = format.split(/e/ig)[1];
while (num.length < format.length) {
num = "0" + num;
}
// 如果magnitudeNeg是一个"-",而且num正好全是0,那么就别显示负号了
var isAllZero = true;
for (var i = 0, len = num.length; i < len; i++) {
if (!isAllZero) {
continue;
}
isAllZero = num.charAt(i) === "0";
}
magnitudeNeg = isAllZero ? "" : magnitudeNeg;
return magnitudeNeg + num;
}
// 获取format规定的科学计数法精确到的位数
function getPrecision (format) {
if (!/e/ig.test(format)) {
return 0;
}
var arr = format.split(/e/ig)[0].split(".");
return arr.length > 1 ? arr[1].length : 0;
}
// 获取数值科学计数法表示之后整数的位数
// 这边我们还需要考虑#和0的问题
function getInteger (magnitude, format) {
if (!/e/ig.test(format)) {
return 0;
}
// return format.split(/e/ig)[0].split(".")[0].length;
var formatLeft = format.split(/e/ig)[0].split(".")[0], i, f, len = formatLeft.length;
var valueLeftLen = 0;
for (i = 0; i < len; i++) {
f = formatLeft.charAt(i);
// "#"所在的位置到末尾长度小于等于值的整数部分长度,那么这个#才可以占位
if (f == 0 || (f == "#" && (len - i <= magnitude + 1))) {
valueLeftLen++;
}
}
return valueLeftLen;
}
// 判断num通过round函数之后是否有进位
function isValueCarried (num) {
var roundNum = Math.round(num);
num = (num + "").split(".")[0];
roundNum = (roundNum + "").split(".")[0];
return num.length !== roundNum.length;
}
}
//'#.##'之类的格式处理 1.324e-18 这种的科学数字
function _dealNumberPrecision (text, fright) {
if (/[eE]/.test(text)) {
var precision = 0, i = 0, ch;
if (/[%‰]$/.test(fright)) {
precision = /[%]$/.test(fright) ? 2 : 3;
}
for (var len = fright.length; i < len; i++) {
if ((ch = fright.charAt(i)) == "0" || ch == "#") {
precision++;
}
}
return Number(text).toFixed(precision);
}
return text;
}
/**
* 数字格式
*/
function _numberFormat (text, format) {
var text = text + "";
//在调用数字格式的时候如果text里没有任何数字则不处理
if (!(/[0-9]/.test(text)) || !format) {
return text;
}
// 数字格式,区分正负数
var numMod = format.indexOf(";");
if (numMod > -1) {
if (text >= 0) {
return _numberFormat(text + "", format.substring(0, numMod));
}
return _numberFormat((-text) + "", format.substr(numMod + 1));
} else {
// 兼容格式处理负数的情况(copy:fr-jquery.format.js)
if (+text < 0 && format.charAt(0) !== "-") {
return _numberFormat((-text) + "", "-" + format);
}
}
var fp = format.split("."), fleft = fp[0] || "", fright = fp[1] || "";
text = _dealNumberPrecision(text, fright);
var tp = text.split("."), tleft = tp[0] || "", tright = tp[1] || "";
// 百分比,千分比的小数点移位处理
if (/[%‰]$/.test(format)) {
var paddingZero = /[%]$/.test(format) ? "00" : "000";
tright += paddingZero;
tleft += tright.substr(0, paddingZero.length);
tleft = tleft.replace(/^0+/gi, "");
tright = tright.substr(paddingZero.length).replace(/0+$/gi, "");
}
var right = _dealWithRight(tright, fright);
if (right.leftPlus) {
// 小数点后有进位
tleft = parseInt(tleft) + 1 + "";
tleft = isNaN(tleft) ? "1" : tleft;
}
right = right.num;
var left = _dealWithLeft(tleft, fleft);
if (!(/[0-9]/.test(left))) {
left = left + "0";
}
if (!(/[0-9]/.test(right))) {
return left + right;
} else {
return left + "." + right;
}
}
/**
* 处理小数点右边小数部分
* @param tright 右边内容
* @param fright 右边格式
* @returns {JSON} 返回处理结果和整数部分是否需要进位
* @private
*/
function _dealWithRight (tright, fright) {
var right = "", j = 0, i = 0;
for (var len = fright.length; i < len; i++) {
var ch = fright.charAt(i);
var c = tright.charAt(j);
switch (ch) {
case "0":
if (isEmpty(c)) {
c = "0";
}
right += c;
j++;
break;
case "#":
right += c;
j++;
break;
default :
right += ch;
break;
}
}
var rll = tright.substr(j);
var result = {};
if (!isEmpty(rll) && rll.charAt(0) > 4) {
// 有多余字符,需要四舍五入
result.leftPlus = true;
var numReg = right.match(/^[0-9]+/);
if (numReg) {
var num = numReg[0];
var orilen = num.length;
var newnum = parseInt(num) + 1 + "";
// 进位到整数部分
if (newnum.length > orilen) {
newnum = newnum.substr(1);
} else {
newnum = BI.leftPad(newnum, orilen, "0");
result.leftPlus = false;
}
right = right.replace(/^[0-9]+/, newnum);
}
}
result.num = right;
return result;
}
/**
* 处理小数点左边整数部分
* @param tleft 左边内容
* @param fleft 左边格式
* @returns {string} 返回处理结果
* @private
*/
function _dealWithLeft (tleft, fleft) {
var left = "";
var j = tleft.length - 1;
var combo = -1, last = -1;
var i = fleft.length - 1;
for (; i >= 0; i--) {
var ch = fleft.charAt(i);
var c = tleft.charAt(j);
switch (ch) {
case "0":
if (isEmpty(c)) {
c = "0";
}
last = -1;
left = c + left;
j--;
break;
case "#":
last = i;
left = c + left;
j--;
break;
case ",":
if (!isEmpty(c)) {
// 计算一个,分隔区间的长度
var com = fleft.match(/,[#0]+/);
if (com) {
combo = com[0].length - 1;
}
left = "," + left;
}
break;
default :
left = ch + left;
break;
}
}
if (last > -1) {
// 处理剩余字符
var tll = tleft.substr(0, j + 1);
left = left.substr(0, last) + tll + left.substr(last);
}
if (combo > 0) {
// 处理,分隔区间
var res = left.match(/[0-9]+,/);
if (res) {
res = res[0];
var newstr = "", n = res.length - 1 - combo;
for (; n >= 0; n = n - combo) {
newstr = res.substr(n, combo) + "," + newstr;
}
var lres = res.substr(0, n + combo);
if (!isEmpty(lres)) {
newstr = lres + "," + newstr;
}
}
left = left.replace(/[0-9]+,/, newstr);
}
return left;
}
BI.cjkEncode = function (text) {
// alex:如果非字符串,返回其本身(cjkEncode(234) 返回 ""是不对的)
if (typeof text !== "string") {
return text;
}
var newText = "";
for (var i = 0; i < text.length; i++) {
var code = text.charCodeAt(i);
if (code >= 128 || code === 91 || code === 93) {// 91 is "[", 93 is "]".
newText += "[" + code.toString(16) + "]";
} else {
newText += text.charAt(i);
}
}
return newText;
};
/**
* 将cjkEncode处理过的字符串转化为原始字符串
*
* @static
* @param text 需要做解码的字符串
* @return {String} 解码后的字符串
*/
BI.cjkDecode = function (text) {
if (text == null) {
return "";
}
// 查找没有 "[", 直接返回. kunsnat:数字的时候, 不支持indexOf方法, 也是直接返回.
if (!isNaN(text) || text.indexOf("[") == -1) {
return text;
}
var newText = "";
for (var i = 0; i < text.length; i++) {
var ch = text.charAt(i);
if (ch == "[") {
var rightIdx = text.indexOf("]", i + 1);
if (rightIdx > i + 1) {
var subText = text.substring(i + 1, rightIdx);
// james:主要是考虑[CDATA[]]这样的值的出现
if (subText.length > 0) {
ch = String.fromCharCode(eval("0x" + subText));
}
i = rightIdx;
}
}
newText += ch;
}
return newText;
};
// replace the html special tags
var SPECIAL_TAGS = {
"&": "&amp;",
"\"": "&quot;",
"<": "&lt;",
">": "&gt;"
};
BI.htmlEncode = function (text) {
return BI.isNull(text) ? "" : BI.replaceAll(text + "", "&|\"|<|>", function (v) {
return SPECIAL_TAGS[v] ? SPECIAL_TAGS[v] : "&nbsp;";
});
};
// html decode
BI.htmlDecode = function (text) {
return BI.isNull(text) ? "" : BI.replaceAll(text + "", "&amp;|&quot;|&lt;|&gt;|&nbsp;", function (v) {
switch (v) {
case "&amp;":
return "&";
case "&quot;":
return "\"";
case "&lt;":
return "<";
case "&gt;":
return ">";
case "&nbsp;":
default:
return " ";
}
});
};
BI.cjkEncodeDO = function (o) {
if (BI.isPlainObject(o)) {
var result = {};
_.each(o, function (v, k) {
if (!(typeof v === "string")) {
v = BI.jsonEncode(v);
}
// wei:bug 43338,如果key是中文,cjkencode后o的长度就加了1,ie9以下版本死循环,所以新建对象result。
k = BI.cjkEncode(k);
result[k] = BI.cjkEncode(v);
});
return result;
}
return o;
};
BI.jsonEncode = function (o) {
// james:这个Encode是抄的EXT的
var useHasOwn = !!{}.hasOwnProperty;
// crashes Safari in some instances
// var validRE = /^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/;
var m = {
"\b": "\\b",
"\t": "\\t",
"\n": "\\n",
"\f": "\\f",
"\r": "\\r",
"\"": "\\\"",
"\\": "\\\\"
};
var encodeString = function (s) {
if (/["\\\x00-\x1f]/.test(s)) {
return "\"" + s.replace(/([\x00-\x1f\\"])/g, function (a, b) {
var c = m[b];
if (c) {
return c;
}
c = b.charCodeAt();
return "\\u00" +
Math.floor(c / 16).toString(16) +
(c % 16).toString(16);
}) + "\"";
}
return "\"" + s + "\"";
};
var encodeArray = function (o) {
var a = ["["], b, i, l = o.length, v;
for (i = 0; i < l; i += 1) {
v = o[i];
switch (typeof v) {
case "undefined":
case "function":
case "unknown":
break;
default:
if (b) {
a.push(",");
}
a.push(v === null ? "null" : BI.jsonEncode(v));
b = true;
}
}
a.push("]");
return a.join("");
};
if (typeof o === "undefined" || o === null) {
return "null";
} else if (BI.isArray(o)) {
return encodeArray(o);
} else if (o instanceof Date) {
/*
* alex:原来只是把年月日时分秒简单地拼成一个String,无法decode
* 现在这么处理就可以decode了,但是JS.jsonDecode和Java.JSONObject也要跟着改一下
*/
return BI.jsonEncode({
__time__: o.getTime()
});
} else if (typeof o === "string") {
return encodeString(o);
} else if (typeof o === "number") {
return isFinite(o) ? String(o) : "null";
} else if (typeof o === "boolean") {
return String(o);
} else if (BI.isFunction(o)) {
return String(o);
}
var a = ["{"], b, i, v;
for (i in o) {
if (!useHasOwn || o.hasOwnProperty(i)) {
v = o[i];
switch (typeof v) {
case "undefined":
case "unknown":
break;
default:
if (b) {
a.push(",");
}
a.push(BI.jsonEncode(i), ":",
v === null ? "null" : BI.jsonEncode(v));
b = true;
}
}
}
a.push("}");
return a.join("");
};
BI.jsonDecode = function (text) {
try {
// 注意0啊
// var jo = $.parseJSON(text) || {};
var jo = BI.$ ? BI.$.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) {
jo = {};
}
} catch (e) {
/*
* richie:浏览器只支持标准的JSON字符串转换,而jQuery会默认调用浏览器的window.JSON.parse()函数进行解析
* 比如:var str = "{'a':'b'}",这种形式的字符串转换为JSON就会抛异常
*/
try {
jo = new Function("return " + text)() || {};
} catch (e) {
// do nothing
}
if (jo == null) {
jo = [];
}
}
if (!_hasDateInJson(text)) {
return jo;
}
function _hasDateInJson (json) {
if (!json || typeof json !== "string") {
return false;
}
return json.indexOf("__time__") != -1;
}
return (function (o) {
if (typeof o === "string") {
return o;
}
if (o && o.__time__ != null) {
return new Date(o.__time__);
}
for (var a in o) {
if (o[a] == o || typeof o[a] === "object" || _.isFunction(o[a])) {
break;
}
o[a] = arguments.callee(o[a]);
}
return o;
})(jo);
};
/**
* 获取编码后的url
* @param urlTemplate url模板
* @param param 参数
* @returns {*|String}
* @example
* BI.getEncodeURL("design/{tableName}/{fieldName}",{tableName: "A", fieldName: "a"}) // design/A/a
*/
BI.getEncodeURL = function (urlTemplate, param) {
return BI.replaceAll(urlTemplate, "\\{(.*?)\\}", function (ori, str) {
return BI.encodeURIComponent(BI.isObject(param) ? param[str] : param);
});
};
BI.encodeURIComponent = function (url) {
BI.specialCharsMap = BI.specialCharsMap || {};
url = url || "";
url = BI.replaceAll(url + "", BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
switch (str) {
case "\\":
return BI.specialCharsMap["\\\\"] || str;
default:
return BI.specialCharsMap[str] || str;
}
});
return _global.encodeURIComponent(url);
};
BI.decodeURIComponent = function (url) {
var reserveSpecialCharsMap = {};
BI.each(BI.specialCharsMap, function (initialChar, encodeChar) {
reserveSpecialCharsMap[encodeChar] = initialChar === "\\\\" ? "\\" : initialChar;
});
url = url || "";
url = BI.replaceAll(url + "", BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) {
return reserveSpecialCharsMap[str] || str;
});
return _global.decodeURIComponent(url);
};
BI.contentFormat = function (cv, fmt) {
if (isEmpty(cv)) {
// 原值为空,返回空字符
return "";
}
var text = cv.toString();
if (isEmpty(fmt)) {
// 格式为空,返回原字符
return text;
}
if (fmt.match(/^T/)) {
// T - 文本格式
return text;
} else if (fmt.match(/^D/)) {
// D - 日期(时间)格式
if (!(cv instanceof Date)) {
if (typeof cv === "number") {
// 毫秒数类型
cv = new Date(cv);
} else {
//字符串类型转化为date类型
cv = new Date(Date.parse(("" + cv).replace(/-|\./g, "/")));
}
}
if (!isInvalidDate(cv) && !BI.isNull(cv)) {
var needTrim = fmt.match(/^DT/);
text = BI.date2Str(cv, fmt.substring(needTrim ? 2 : 1));
}
} else if (fmt.match(/E/)) {
// 科学计数格式
text = _eFormat(text, fmt);
} else {
// 数字格式
text = _numberFormat(text, fmt);
}
// ¤ - 货币格式
text = text.replace(/¤/g, "¥");
return text;
};
/**
* 将Java提供的日期格式字符串装换为JS识别的日期格式字符串
* @class FR.parseFmt
* @param fmt 日期格式
* @returns {String}
*/
BI.parseFmt = function (fmt) {
if (!fmt) {
return "";
}
//日期
fmt = String(fmt)
//年
.replace(/y{4,}/g, "%Y")//yyyy的时候替换为Y
.replace(/y{2}/g, "%y")//yy的时候替换为y
//月
.replace(/M{4,}/g, "%b")//MMMM的时候替换为b,八
.replace(/M{3}/g, "%B")//MMM的时候替换为M,八月
.replace(/M{2}/g, "%X")//MM的时候替换为X,08
.replace(/M{1}/g, "%x")//M的时候替换为x,8
.replace(/a{1}/g, "%p");
//天
if (new RegExp("d{2,}", "g").test(fmt)) {
fmt = fmt.replace(/d{2,}/g, "%d");//dd的时候替换为d
} else {
fmt = fmt.replace(/d{1}/g, "%e");//d的时候替换为j
}
//时
if (new RegExp("h{2,}", "g").test(fmt)) {//12小时制
fmt = fmt.replace(/h{2,}/g, "%I");
} else {
fmt = fmt.replace(/h{1}/g, "%I");
}
if (new RegExp("H{2,}", "g").test(fmt)) {//24小时制
fmt = fmt.replace(/H{2,}/g, "%H");
} else {
fmt = fmt.replace(/H{1}/g, "%H");
}
fmt = fmt.replace(/m{2,}/g, "%M")//分
//秒
.replace(/s{2,}/g, "%S");
return fmt;
};
/**
* 把字符串按照对应的格式转化成日期对象
*
* @example
* var result = BI.str2Date('2013-12-12', 'yyyy-MM-dd');//Thu Dec 12 2013 00:00:00 GMT+0800
*
* @class BI.str2Date
* @param str 字符串
* @param format 日期格式
* @returns {*}
*/
BI.str2Date = function (str, format) {
if (typeof str != "string" || typeof format != "string") {
return null;
}
var fmt = BI.parseFmt(format);
return BI.parseDateTime(str, fmt);
};
/**
* 把日期对象按照指定格式转化成字符串
*
* @example
* var date = new Date('Thu Dec 12 2013 00:00:00 GMT+0800');
* var result = BI.date2Str(date, 'yyyy-MM-dd');//2013-12-12
*
* @class BI.date2Str
* @param date 日期
* @param format 日期格式
* @returns {String}
*/
BI.date2Str = function (date, format) {
if (!date) {
return "";
}
// O(len(format))
var len = format.length, result = "";
if (len > 0) {
var flagch = format.charAt(0), start = 0, str = flagch;
for (var i = 1; i < len; i++) {
var ch = format.charAt(i);
if (flagch !== ch) {
result += compileJFmt({
char: flagch,
str: str,
len: i - start
}, date);
flagch = ch;
start = i;
str = flagch;
} else {
str += ch;
}
}
result += compileJFmt({
char: flagch,
str: str,
len: len - start
}, date);
}
return result;
function compileJFmt (jfmt, date) {
var str = jfmt.str, len = jfmt.len, ch = jfmt["char"];
switch (ch) {
case "E": // 星期
str = BI.Date._DN[date.getDay()];
break;
case "y": // 年
if (len <= 3) {
str = (date.getFullYear() + "").slice(2, 4);
} else {
str = date.getFullYear();
}
break;
case "M": // 月
if (len > 2) {
str = BI.Date._MN[date.getMonth()];
} else if (len < 2) {
str = date.getMonth() + 1;
} else {
str = BI.leftPad(date.getMonth() + 1 + "", 2, "0");
}
break;
case "d": // 日
if (len > 1) {
str = BI.leftPad(date.getDate() + "", 2, "0");
} else {
str = date.getDate();
}
break;
case "h": // 时(12)
var hour = date.getHours() % 12;
if (hour === 0) {
hour = 12;
}
if (len > 1) {
str = BI.leftPad(hour + "", 2, "0");
} else {
str = hour;
}
break;
case "H": // 时(24)
if (len > 1) {
str = BI.leftPad(date.getHours() + "", 2, "0");
} else {
str = date.getHours();
}
break;
case "m":
if (len > 1) {
str = BI.leftPad(date.getMinutes() + "", 2, "0");
} else {
str = date.getMinutes();
}
break;
case "s":
if (len > 1) {
str = BI.leftPad(date.getSeconds() + "", 2, "0");
} else {
str = date.getSeconds();
}
break;
case "a":
str = date.getHours() < 12 ? "am" : "pm";
break;
case "z":
str = BI.getTimezone(date);
break;
default:
str = jfmt.str;
break;
}
return str;
}
};
BI.object2Number = function (value) {
if (value == null) {
return 0;
}
if (typeof value === "number") {
return value;
}
var str = value + "";
if (str.indexOf(".") === -1) {
return parseInt(str);
}
return parseFloat(str);
};
BI.object2Date = function (obj) {
if (obj == null) {
return new Date();
}
if (obj instanceof Date) {
return obj;
} else if (typeof obj === "number") {
return new Date(obj);
}
var str = obj + "";
str = str.replace(/-/g, "/");
var dt = new Date(str);
if (!isInvalidDate(dt)) {
return dt;
}
return new Date();
};
BI.object2Time = function (obj) {
if (obj == null) {
return new Date();
}
if (obj instanceof Date) {
return obj;
}
var str = obj + "";
str = str.replace(/-/g, "/");
var dt = new Date(str);
if (!isInvalidDate(dt)) {
return dt;
}
if (str.indexOf("/") === -1 && str.indexOf(":") !== -1) {
dt = new Date("1970/01/01 " + str);
if (!isInvalidDate(dt)) {
return dt;
}
}
dt = BI.parseDateTime(str, "HH:mm:ss");
if (!isInvalidDate(dt)) {
return dt;
}
return new Date();
};
})();
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)))
/***/ }),
/* 123 */
/***/ (function(module, exports) {
/**
* 对数组对象的扩展
* @class Array
*/
_.extend(BI, {
pushArray: function (sArray, array) {
for (var i = 0; i < array.length; i++) {
sArray.push(array[i]);
}
},
pushDistinct: function (sArray, obj) {
if (!BI.contains(sArray, obj)) {
sArray.push(obj);
}
},
pushDistinctArray: function (sArray, array) {
for (var i = 0, len = array.length; i < len; i++) {
BI.pushDistinct(sArray, array[i]);
}
}
});
/***/ }),
/* 124 */
/***/ (function(module, exports) {
/** Constants used for time computations */
BI.Date = BI.Date || {};
BI.Date.SECOND = 1000;
BI.Date.MINUTE = 60 * BI.Date.SECOND;
BI.Date.HOUR = 60 * BI.Date.MINUTE;
BI.Date.DAY = 24 * BI.Date.HOUR;
BI.Date.WEEK = 7 * BI.Date.DAY;
_.extend(BI, {
/**
* 获取时区
* @returns {String}
*/
getTimezone: function (date) {
return date.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/, "$1$2").replace(/[^A-Z]/g, "");
},
/** Returns the number of days in the current month */
getMonthDays: function (date, month) {
var year = date.getFullYear();
if (typeof month === "undefined") {
month = date.getMonth();
}
if (((0 == (year % 4)) && ((0 != (year % 100)) || (0 == (year % 400)))) && month == 1) {
return 29;
}
return BI.Date._MD[month];
},
/**
* 获取每月的最后一天
* @returns {Date}
*/
getLastDateOfMonth: function (date) {
return BI.getDate(date.getFullYear(), date.getMonth(), BI.getMonthDays(date));
},
/** Returns the number of day in the year. */
getDayOfYear: function (date) {
var now = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
var then = BI.getDate(date.getFullYear(), 0, 0, 0, 0, 0);
var time = now - then;
return Math.floor(time / BI.Date.DAY);
},
/** Returns the number of the week in year, as defined in ISO 8601. */
getWeekNumber: function (date) {
var d = BI.getDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
var week = d.getDay();
var startOfWeek = BI.StartOfWeek % 7;
var middleDay = (startOfWeek + 3) % 7;
middleDay = middleDay || 7;
// 偏移到周周首之前需要多少天
var offsetWeekStartCount = week < startOfWeek ? (7 + week - startOfWeek) : (week - startOfWeek);
var offsetWeekMiddleCount = middleDay < startOfWeek ? (7 + middleDay - startOfWeek) : (middleDay - startOfWeek);
d.setDate(d.getDate() - offsetWeekStartCount + offsetWeekMiddleCount);
var ms = d.valueOf();
d.setMonth(0);
d.setDate(1);
return Math.floor((ms - d.valueOf()) / (7 * 864e5)) + 1;
},
getQuarter: function (date) {
return Math.floor(date.getMonth() / 3) + 1;
},
// 离当前时间多少天的时间
getOffsetDate: function (date, offset) {
return BI.getDate(BI.getTime(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()) + offset * 864e5);
},
getOffsetQuarter: function (date, n) {
var dt = BI.getDate(BI.getTime(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()));
var day = dt.getDate();
var monthDay = BI.getMonthDays(BI.getDate(dt.getFullYear(), dt.getMonth() + BI.parseInt(n) * 3, 1));
if (day > monthDay) {
day = monthDay;
}
dt.setDate(day);
dt.setMonth(dt.getMonth() + parseInt(n) * 3);
return dt;
},
// 得到本季度的起始月份
getQuarterStartMonth: function (date) {
var quarterStartMonth = 0;
var nowMonth = date.getMonth();
if (nowMonth < 3) {
quarterStartMonth = 0;
}
if (2 < nowMonth && nowMonth < 6) {
quarterStartMonth = 3;
}
if (5 < nowMonth && nowMonth < 9) {
quarterStartMonth = 6;
}
if (nowMonth > 8) {
quarterStartMonth = 9;
}
return quarterStartMonth;
},
// 获得本季度的起始日期
getQuarterStartDate: function (date) {
return BI.getDate(date.getFullYear(), BI.getQuarterStartMonth(date), 1);
},
// 得到本季度的结束日期
getQuarterEndDate: function (date) {
var quarterEndMonth = BI.getQuarterStartMonth(date) + 2;
return BI.getDate(date.getFullYear(), quarterEndMonth, BI.getMonthDays(date, quarterEndMonth));
},
// 指定日期n个月之前或之后的日期
getOffsetMonth: function (date, n) {
var dt = BI.getDate(BI.getTime(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()));
var day = dt.getDate();
var monthDay = BI.getMonthDays(BI.getDate(dt.getFullYear(), dt.getMonth() + parseInt(n), 1));
if (day > monthDay) {
day = monthDay;
}
dt.setDate(day);
dt.setMonth(dt.getMonth() + parseInt(n));
return dt;
},
// 获得本周的起始日期
getWeekStartDate: function (date) {
var w = date.getDay();
var startOfWeek = BI.StartOfWeek % 7;
return BI.getOffsetDate(date, BI.Date._OFFSET[w < startOfWeek ? (7 + w - startOfWeek) : (w - startOfWeek)]);
},
// 得到本周的结束日期
getWeekEndDate: function (date) {
var w = date.getDay();
var startOfWeek = BI.StartOfWeek % 7;
return BI.getOffsetDate(date, BI.Date._OFFSET[w < startOfWeek ? (7 + w - startOfWeek) : (w - startOfWeek)] + 6);
},
// 格式化打印日期
print: function (date, str) {
var m = date.getMonth();
var d = date.getDate();
var y = date.getFullYear();
var yWith4number = y + "";
while (yWith4number.length < 4) {
yWith4number = "0" + yWith4number;
}
var wn = BI.getWeekNumber(date);
var qr = BI.getQuarter(date);
var w = date.getDay();
var s = {};
var hr = date.getHours();
var pm = (hr >= 12);
var ir = (pm) ? (hr - 12) : hr;
var dy = BI.getDayOfYear(date);
if (ir == 0) {
ir = 12;
}
var min = date.getMinutes();
var sec = date.getSeconds();
s["%a"] = BI.Date._SDN[w]; // abbreviated weekday name [FIXME: I18N]
s["%A"] = BI.Date._DN[w]; // full weekday name
s["%b"] = BI.Date._SMN[m]; // abbreviated month name [FIXME: I18N]
s["%B"] = BI.Date._MN[m]; // full month name
// FIXME: %c : preferred date and time representation for the current locale
s["%C"] = 1 + Math.floor(y / 100); // the century number
s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31)
s["%e"] = d; // the day of the month (range 1 to 31)
// FIXME: %D : american date style: %m/%d/%y
// FIXME: %E, %F, %G, %g, %h (man strftime)
s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format)
s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format)
s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366)
s["%k"] = hr + ""; // hour, range 0 to 23 (24h format)
s["%l"] = ir + ""; // hour, range 1 to 12 (12h format)
s["%X"] = (m < 9) ? ("0" + (1 + m)) : (1 + m); // month, range 01 to 12
s["%x"] = m + 1; // month, range 1 to 12
s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59
s["%n"] = "\n"; // a newline character
s["%p"] = pm ? "PM" : "AM";
s["%P"] = pm ? "pm" : "am";
// FIXME: %r : the time in am/pm notation %I:%M:%S %p
// FIXME: %R : the time in 24-hour notation %H:%M
s["%s"] = Math.floor(date.getTime() / 1000);
s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59
s["%t"] = "\t"; // a tab character
// FIXME: %T : the time in 24-hour notation (%H:%M:%S)
s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn;
s["%u"] = w + 1; // the day of the week (range 1 to 7, 1 = MON)
s["%w"] = w; // the day of the week (range 0 to 6, 0 = SUN)
// FIXME: %x : preferred date representation for the current locale without the time
// FIXME: %X : preferred time representation for the current locale without the date
s["%y"] = yWith4number.substr(2, 2); // year without the century (range 00 to 99)
s["%Y"] = yWith4number; // year with the century
s["%%"] = "%"; // a literal '%' character
s["%Q"] = qr;
var re = /%./g;
BI.isKhtml = BI.isKhtml || function () {
if(!_global.navigator) {
return false;
}
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
};
// 包含年周的格式化,ISO8601标准周的计数会影响年
if ((str.indexOf("%Y") !== -1 || str.indexOf("%y") !== -1) && (str.indexOf("%W") !== -1 || str.indexOf("%U") !== -1 || str.indexOf("%V") !== -1)) {
switch (wn) {
// 如果周数是1,但是当前却在12月,表示此周数为下一年的
case 1:
if (m === 11) {
s["%y"] = parseInt(s["%y"]) + 1;
s["%Y"] = parseInt(s["%Y"]) + 1;
}
break;
// 如果周数是53,但是当前却在1月,表示此周数为上一年的
case 53:
if (m === 0) {
s["%y"] = parseInt(s["%y"]) - 1;
s["%Y"] = parseInt(s["%Y"]) - 1;
}
break;
default:
break;
}
}
if (!BI.isKhtml()) {
return str.replace(re, function (par) {
return s[par] || par;
});
}
var a = str.match(re);
for (var i = 0; i < a.length; i++) {
var tmp = s[a[i]];
if (tmp) {
re = new RegExp(a[i], "g");
str = str.replace(re, tmp);
}
}
return str;
}
});
/***/ }),
/* 125 */
/***/ (function(module, exports) {
/**
* 基本的函数
* Created by GUY on 2015/6/24.
*/
BI.Func = {};
_.extend(BI.Func, {
/**
* 创建唯一的名字
* @param array
* @param name
* @returns {*}
*/
createDistinctName: function (array, name) {
var src = name, idx = 1;
name = name || "";
while (true) {
if (BI.every(array, function (i, item) {
return BI.isKey(item) ? item !== name : item.name !== name;
})) {
break;
}
name = src + (idx++);
}
return name;
},
/**
* 获取字符宽度
* @param str
* @return {number}
*/
getGBWidth: function (str) {
str = str + "";
str = str.replace(/[^\x00-\xff]/g, "xx");
return Math.ceil(str.length / 2);
},
/**
* 获取搜索结果
* @param items
* @param keyword
* @param param 搜索哪个属性
*/
getSearchResult: function (items, keyword, param) {
var isArray = BI.isArray(items);
items = isArray ? BI.flatten(items) : items;
param || (param = "text");
if (!BI.isKey(keyword)) {
return {
find: BI.deepClone(items),
match: isArray ? [] : {}
};
}
var t, text, py;
keyword = BI.toUpperCase(keyword);
var matched = isArray ? [] : {}, find = isArray ? [] : {};
BI.each(items, function (i, item) {
// 兼容item为null的处理
if (BI.isNull(item)) {
return;
}
item = BI.deepClone(item);
t = BI.stripEL(item);
text = BI.find([t[param], t.text, t.value, t.name, t], function (index, val) {
return BI.isNotNull(val);
});
if (BI.isNull(text) || BI.isObject(text)) return;
py = BI.makeFirstPY(text, {
splitChar: "\u200b"
});
text = BI.toUpperCase(text);
py = BI.toUpperCase(py);
var pidx;
if (text.indexOf(keyword) > -1) {
if (text === keyword) {
isArray ? matched.push(item) : (matched[i] = item);
} else {
isArray ? find.push(item) : (find[i] = item);
}
// BI-56386 这边两个pid / text.length是为了防止截取的首字符串不是完整的,但光这样做还不够,即时错位了,也不能说明就不符合条件
} else if (pidx = py.indexOf(keyword), (pidx > -1)) {
if (text === keyword || keyword.length === text.length) {
isArray ? matched.push(item) : (matched[i] = item);
} else {
isArray ? find.push(item) : (find[i] = item);
}
}
});
return {
match: matched,
find: find
};
}
});
_.extend(BI, {
beforeFunc: function (sFunc, func) {
var __self = sFunc;
return function () {
if (func.apply(sFunc, arguments) === false) {
return false;
}
return __self.apply(sFunc, arguments);
};
},
afterFunc: function (sFunc, func) {
var __self = sFunc;
return function () {
var ret = __self.apply(sFunc, arguments);
if (ret === false) {
return false;
}
func.apply(sFunc, arguments);
return ret;
};
}
});
/***/ }),
/* 126 */
/***/ (function(module, exports) {
_.extend(BI, {
// 给Number类型增加一个add方法,调用起来更加方便。
add: function (num, arg) {
return accAdd(arg, num);
/**
** 加法函数,用来得到精确的加法结果
** 说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。
** 调用:accAdd(arg1,arg2)
** 返回值:arg1加上arg2的精确结果
**/
function accAdd (arg1, arg2) {
var r1, r2, m, c;
try {
r1 = arg1.toString().split(".")[1].length;
} catch (e) {
r1 = 0;
}
try {
r2 = arg2.toString().split(".")[1].length;
} catch (e) {
r2 = 0;
}
c = Math.abs(r1 - r2);
m = Math.pow(10, Math.max(r1, r2));
if (c > 0) {
var cm = Math.pow(10, c);
if (r1 > r2) {
arg1 = Number(arg1.toString().replace(".", ""));
arg2 = Number(arg2.toString().replace(".", "")) * cm;
} else {
arg1 = Number(arg1.toString().replace(".", "")) * cm;
arg2 = Number(arg2.toString().replace(".", ""));
}
} else {
arg1 = Number(arg1.toString().replace(".", ""));
arg2 = Number(arg2.toString().replace(".", ""));
}
return (arg1 + arg2) / m;
}
},
// 给Number类型增加一个sub方法,调用起来更加方便。
sub: function (num, arg) {
return accSub(num, arg);
/**
** 减法函数,用来得到精确的减法结果
** 说明:javascript的减法结果会有误差,在两个浮点数相减的时候会比较明显。这个函数返回较为精确的减法结果。
** 调用:accSub(arg1,arg2)
** 返回值:arg1加上arg2的精确结果
**/
function accSub (arg1, arg2) {
var r1, r2, m, n;
try {
r1 = arg1.toString().split(".")[1].length;
} catch (e) {
r1 = 0;
}
try {
r2 = arg2.toString().split(".")[1].length;
} catch (e) {
r2 = 0;
}
m = Math.pow(10, Math.max(r1, r2)); // last modify by deeka //动态控制精度长度
n = (r1 >= r2) ? r1 : r2;
return ((arg1 * m - arg2 * m) / m).toFixed(n);
}
},
// 给Number类型增加一个mul方法,调用起来更加方便。
mul: function (num, arg) {
return accMul(arg, num);
/**
** 乘法函数,用来得到精确的乘法结果
** 说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。
** 调用:accMul(arg1,arg2)
** 返回值:arg1乘以 arg2的精确结果
**/
function accMul (arg1, arg2) {
var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
try {
m += s1.split(".")[1].length;
} catch (e) {
}
try {
m += s2.split(".")[1].length;
} catch (e) {
}
return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
}
},
// 给Number类型增加一个div方法,调用起来更加方便。
div: function (num, arg) {
return accDivide(num, arg);
/**
* Return digits length of a number
* @param {*number} num Input number
*/
function digitLength (num) {
// Get digit length of e
var eSplit = num.toString().split(/[eE]/);
var len = (eSplit[0].split(".")[1] || "").length - (+(eSplit[1] || 0));
return len > 0 ? len : 0;
}
/**
* 把小数转成整数,支持科学计数法。如果是小数则放大成整数
* @param {*number} num 输入数
*/
function float2Fixed (num) {
if (num.toString().indexOf("e") === -1) {
return Number(num.toString().replace(".", ""));
}
var dLen = digitLength(num);
return dLen > 0 ? num * Math.pow(10, dLen) : num;
}
/**
* 精确乘法
*/
function times (num1, num2) {
var others = [];
for (var _i = 2; _i < arguments.length; _i++) {
others[_i - 2] = arguments[_i];
}
if (others.length > 0) {
return times.apply(void 0, [times(num1, num2), others[0]].concat(others.slice(1)));
}
var num1Changed = float2Fixed(num1);
var num2Changed = float2Fixed(num2);
var baseNum = digitLength(num1) + digitLength(num2);
var leftValue = num1Changed * num2Changed;
return leftValue / Math.pow(10, baseNum);
}
/**
* 精确除法
*/
function accDivide (num1, num2) {
var others = [];
for (var _i = 2; _i < arguments.length; _i++) {
others[_i - 2] = arguments[_i];
}
if (others.length > 0) {
return accDivide.apply(void 0, [accDivide(num1, num2), others[0]].concat(others.slice(1)));
}
var num1Changed = float2Fixed(num1);
var num2Changed = float2Fixed(num2);
return times((num1Changed / num2Changed), Math.pow(10, digitLength(num2) - digitLength(num1)));
}
}
});
/***/ }),
/* 127 */
/***/ (function(module, exports) {
/**
* 对字符串对象的扩展
* @class String
*/
_.extend(BI, {
/**
* 判断字符串是否已指定的字符串开始
* @param str source字符串
* @param {String} startTag 指定的开始字符串
* @return {Boolean} 如果字符串以指定字符串开始则返回true,否则返回false
*/
startWith: function (str, startTag) {
str = str || "";
if (startTag == null || startTag == "" || str.length === 0 || startTag.length > str.length) {
return false;
}
return str.substr(0, startTag.length) == startTag;
},
/**
* 判断字符串是否以指定的字符串结束
* @param str source字符串
* @param {String} endTag 指定的字符串
* @return {Boolean} 如果字符串以指定字符串结束则返回true,否则返回false
*/
endWith: function (str, endTag) {
if (endTag == null || endTag == "" || str.length === 0 || endTag.length > str.length) {
return false;
}
return str.substring(str.length - endTag.length) == endTag;
},
/**
* 获取url中指定名字的参数
* @param str source字符串
* @param {String} name 参数的名字
* @return {String} 参数的值
*/
getQuery: function (str, name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = str.substr(str.indexOf("?") + 1).match(reg);
if (r) {
return unescape(r[2]);
}
return null;
},
/**
* 给url加上给定的参数
* @param str source字符串
* @param {Object} paras 参数对象,是一个键值对对象
* @return {String} 添加了给定参数的url
*/
appendQuery: function (str, paras) {
if (!paras) {
return str;
}
var src = str;
// 没有问号说明还没有参数
if (src.indexOf("?") === -1) {
src += "?";
}
// 如果以问号结尾,说明没有其他参数
if (BI.endWith(src, "?") !== false) {
} else {
src += "&";
}
_.each(paras, function (value, name) {
if (typeof(name) === "string") {
src += name + "=" + value + "&";
}
});
src = src.substr(0, src.length - 1);
return src;
},
/**
* 将所有符合第一个字符串所表示的字符串替换成为第二个字符串
* @param str source字符串
* @param {String} s1 要替换的字符串的正则表达式
* @param {String} s2 替换的结果字符串
* @returns {String} 替换后的字符串
*/
replaceAll: function (str, s1, s2) {
return BI.isString(str) ? str.replace(new RegExp(s1, "gm"), s2) : str;
},
/**
* 总是让字符串以指定的字符开头
* @param str source字符串
* @param {String} start 指定的字符
* @returns {String} 以指定字符开头的字符串
*/
perfectStart: function (str, start) {
if (BI.startWith(str, start)) {
return str;
}
return start + str;
},
/**
* 获取字符串中某字符串的所有项位置数组
* @param str source字符串
* @param {String} sub 子字符串
* @return {Number[]} 子字符串在父字符串中出现的所有位置组成的数组
*/
allIndexOf: function (str, sub) {
if (typeof sub !== "string") {
return [];
}
var location = [];
var offset = 0;
while (str.length > 0) {
var loc = str.indexOf(sub);
if (loc === -1) {
break;
}
location.push(offset + loc);
str = str.substring(loc + sub.length, str.length);
offset += loc + sub.length;
}
return location;
}
});
/***/ }),
/* 128 */
/***/ (function(module, exports) {
!(function () {
var i18nStore = {};
_.extend(BI, {
addI18n: function (i18n) {
BI.extend(i18nStore, i18n);
},
i18nText: function (key) {
var localeText = i18nStore[key] || (BI.i18n && BI.i18n[key]) || "";
if (!localeText) {
localeText = key;
}
var len = arguments.length;
if (len > 1) {
if (localeText.indexOf("{R1}") > -1) {
for (var i = 1; i < len; i++) {
var key = "{R" + i + "}";
localeText = BI.replaceAll(localeText, key, arguments[i] + "");
}
} else {
var args = Array.prototype.slice.call(arguments);
var count = 1;
return BI.replaceAll(localeText, "\\{\\s*\\}", function () {
return args[count++] + "";
});
}
}
return localeText;
}
});
})();
/***/ }),
/* 129 */
/***/ (function(module, exports) {
(function () {
var moduleInjection = {};
BI.module = function (xtype, cls) {
if (moduleInjection[xtype] != null) {
_global.console && console.error("module:[" + xtype + "] has been registed");
}
moduleInjection[xtype] = cls;
};
var constantInjection = {};
BI.constant = function (xtype, cls) {
if (constantInjection[xtype] != null) {
_global.console && console.error("constant:[" + xtype + "] has been registed");
}
constantInjection[xtype] = cls;
};
var modelInjection = {};
BI.model = function (xtype, cls) {
if (modelInjection[xtype] != null) {
_global.console && console.error("model:[" + xtype + "] has been registed");
}
modelInjection[xtype] = cls;
};
var storeInjection = {};
BI.store = function (xtype, cls) {
if (storeInjection[xtype] != null) {
_global.console && console.error("store:[" + xtype + "] has been registed");
}
storeInjection[xtype] = cls;
};
var serviceInjection = {};
BI.service = function (xtype, cls) {
if (serviceInjection[xtype] != null) {
_global.console && console.error("service:[" + xtype + "] has been registed");
}
serviceInjection[xtype] = cls;
};
var providerInjection = {};
BI.provider = function (xtype, cls) {
if (providerInjection[xtype] != null) {
_global.console && console.error("provider:[" + xtype + "] has been registed");
}
providerInjection[xtype] = cls;
};
var configFunctions = {};
BI.config = function (type, configFn) {
if (BI.initialized) {
if (constantInjection[type]) {
return (constantInjection[type] = configFn(constantInjection[type]));
}
if (providerInjection[type]) {
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
// 如果config被重新配置的话,需要删除掉之前的实例
if (providerInstance[type]) {
delete providerInstance[type];
}
return configFn(providers[type]);
}
return BI.Plugin.configWidget(type, configFn);
}
if (!configFunctions[type]) {
configFunctions[type] = [];
BI.prepares.push(function () {
var queue = configFunctions[type];
for (var i = 0; i < queue.length; i++) {
if (constantInjection[type]) {
constantInjection[type] = queue[i](constantInjection[type]);
continue;
}
if (providerInjection[type]) {
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
if (providerInstance[type]) {
delete providerInstance[type];
}
queue[i](providers[type]);
continue;
}
BI.Plugin.configWidget(type, queue[i]);
}
configFunctions[type] = null;
});
}
configFunctions[type].push(configFn);
};
var actions = {};
var globalAction = [];
BI.action = function (type, actionFn) {
if (BI.isFunction(type)) {
globalAction.push(type);
return function () {
BI.remove(globalAction, function (idx) {
return globalAction.indexOf(actionFn) === idx;
});
};
}
if (!actions[type]) {
actions[type] = [];
}
actions[type].push(actionFn);
return function () {
BI.remove(actions[type], function (idx) {
return actions[type].indexOf(actionFn) === idx;
});
if (actions[type].length === 0) {
delete actions[type];
}
};
};
var points = {};
BI.point = function (type, action, pointFn, after) {
if (!points[type]) {
points[type] = {};
}
if (!points[type][action]) {
points[type][action] = {};
}
if (!points[type][action][after ? "after" : "before"]) {
points[type][action][after ? "after" : "before"] = [];
}
points[type][action][after ? "after" : "before"].push(pointFn);
};
BI.Modules = {
getModule: function (type) {
if (!moduleInjection[type]) {
_global.console && console.error("module:[" + type + "] does not exists");
return false;
}
return moduleInjection[type];
},
getAllModules: function () {
return moduleInjection;
}
};
BI.Constants = {
getConstant: function (type) {
return constantInjection[type];
}
};
var callPoint = function (inst, types) {
types = BI.isArray(types) ? types : [types];
BI.each(types, function (idx, type) {
if (points[type]) {
for (var action in points[type]) {
var bfns = points[type][action].before;
if (bfns) {
BI.aspect.before(inst, action, function (bfns) {
return function () {
for (var i = 0, len = bfns.length; i < len; i++) {
try {
bfns[i].apply(inst, arguments);
} catch (e) {
_global.console && console.error(e);
}
}
};
}(bfns));
}
var afns = points[type][action].after;
if (afns) {
BI.aspect.after(inst, action, function (afns) {
return function () {
for (var i = 0, len = afns.length; i < len; i++) {
try {
afns[i].apply(inst, arguments);
} catch (e) {
_global.console && console.error(e);
}
}
};
}(afns));
}
}
}
});
};
BI.Models = {
getModel: function (type, config) {
var inst = new modelInjection[type](config);
inst._constructor && inst._constructor(config);
inst.mixins && callPoint(inst, inst.mixins);
callPoint(inst, type);
return inst;
}
};
var stores = {};
BI.Stores = {
getStore: function (type, config) {
if (stores[type]) {
return stores[type];
}
var inst = stores[type] = new storeInjection[type](config);
inst._constructor && inst._constructor(config, function () {
delete stores[type];
});
callPoint(inst, type);
return inst;
}
};
var services = {};
BI.Services = {
getService: function (type, config) {
if (services[type]) {
return services[type];
}
services[type] = new serviceInjection[type](config);
callPoint(services[type], type);
return services[type];
}
};
var providers = {},
providerInstance = {};
BI.Providers = {
getProvider: function (type, config) {
if (!providers[type]) {
providers[type] = new providerInjection[type]();
}
if (!providerInstance[type]) {
providerInstance[type] = new (providers[type].$get())(config);
}
return providerInstance[type];
}
};
BI.Actions = {
runAction: function (type, event, config) {
BI.each(actions[type], function (i, act) {
try {
act(event, config);
} catch (e) {
_global.console && console.error(e);
}
});
},
runGlobalAction: function () {
var args = [].slice.call(arguments);
BI.each(globalAction, function (i, act) {
try {
act.apply(null, args);
} catch (e) {
_global.console && console.error(e);
}
});
}
};
BI.getContext = function (type, config) {
if (constantInjection[type]) {
return BI.Constants.getConstant(type);
}
if (modelInjection[type]) {
return BI.Models.getModel(type, config);
}
if (storeInjection[type]) {
return BI.Stores.getStore(type, config);
}
if (serviceInjection[type]) {
return BI.Services.getService(type, config);
}
if (providerInjection[type]) {
return BI.Providers.getProvider(type, config);
}
};
})();
/***/ }),
/* 130 */
/***/ (function(module, exports) {
/**
* 常量
*/
_.extend(BI, {
MAX: 0xfffffffffffffff,
MIN: -0xfffffffffffffff,
EVENT_RESPONSE_TIME: 200,
zIndex_layer: 1e5,
zIndex_popover: 1e6,
zIndex_popup: 1e7,
zIndex_masker: 1e8,
zIndex_tip: 1e9,
emptyStr: "",
emptyFn: function () {
},
empty: null,
Key: {
48: "0",
49: "1",
50: "2",
51: "3",
52: "4",
53: "5",
54: "6",
55: "7",
56: "8",
57: "9",
65: "a",
66: "b",
67: "c",
68: "d",
69: "e",
70: "f",
71: "g",
72: "h",
73: "i",
74: "j",
75: "k",
76: "l",
77: "m",
78: "n",
79: "o",
80: "p",
81: "q",
82: "r",
83: "s",
84: "t",
85: "u",
86: "v",
87: "w",
88: "x",
89: "y",
90: "z",
96: "0",
97: "1",
98: "2",
99: "3",
100: "4",
101: "5",
102: "6",
103: "7",
104: "8",
105: "9",
106: "*",
107: "+",
109: "-",
110: ".",
111: "/"
},
KeyCode: {
BACKSPACE: 8,
COMMA: 188,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
HOME: 36,
LEFT: 37,
NUMPAD_ADD: 107,
NUMPAD_DECIMAL: 110,
NUMPAD_DIVIDE: 111,
NUMPAD_ENTER: 108,
NUMPAD_MULTIPLY: 106,
NUMPAD_SUBTRACT: 109,
PAGE_DOWN: 34,
PAGE_UP: 33,
PERIOD: 190,
RIGHT: 39,
SPACE: 32,
TAB: 9,
UP: 38
},
Status: {
SUCCESS: 1,
WRONG: 2,
START: 3,
END: 4,
WAITING: 5,
READY: 6,
RUNNING: 7,
OUTOFBOUNDS: 8,
NULL: -1
},
Direction: {
Top: "top",
Bottom: "bottom",
Left: "left",
Right: "right",
Custom: "custom"
},
Axis: {
Vertical: "vertical",
Horizontal: "horizontal"
},
Selection: {
Default: -2,
None: -1,
Single: 0,
Multi: 1,
All: 2
},
HorizontalAlign: {
Left: "left",
Right: "right",
Center: "center",
Stretch: "stretch"
},
VerticalAlign: {
Middle: "middle",
Top: "top",
Bottom: "bottom",
Stretch: "stretch"
},
StartOfWeek: 1
});
/***/ }),
/* 131 */
/***/ (function(module, exports) {
/**
* 缓冲池
* @type {{Buffer: {}}}
*/
(function () {
var Buffer = {};
var MODE = false;// 设置缓存模式为关闭
BI.BufferPool = {
put: function (name, cache) {
if (BI.isNotNull(Buffer[name])) {
throw new Error("Buffer Pool has the key already!");
}
Buffer[name] = cache;
},
get: function (name) {
return Buffer[name];
}
};
})();
/***/ }),
/* 132 */
/***/ (function(module, exports) {
/**
* 共享池
* @type {{Shared: {}}}
*/
(function () {
var _Shared = {};
BI.SharingPool = {
_Shared: _Shared,
put: function (name, shared) {
_Shared[name] = shared;
},
cat: function () {
var args = Array.prototype.slice.call(arguments, 0),
copy = _Shared;
for (var i = 0; i < args.length; i++) {
copy = copy && copy[args[i]];
}
return copy;
},
get: function () {
return BI.deepClone(this.cat.apply(this, arguments));
},
remove: function (key) {
delete _Shared[key];
}
};
})();
/***/ }),
/* 133 */
/***/ (function(module, exports) {
BI.Req = {
};
/***/ }),
/* 134 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 135 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 136 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 137 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 138 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 139 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 140 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 141 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 142 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 143 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 144 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 145 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 146 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 147 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 148 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 149 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 150 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 151 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 152 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 153 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 154 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 155 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 156 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 157 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 158 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 159 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 160 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 161 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 162 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 163 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 164 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 165 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 166 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 167 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 168 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 169 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 170 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 171 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 172 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 173 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 174 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 175 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 176 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 177 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 178 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 179 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 180 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 181 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 182 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 183 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 184 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 185 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 186 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 187 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 188 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 189 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 190 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 191 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 192 */,
/* 193 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 194 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 195 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 196 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 197 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 198 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 199 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 200 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 201 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 202 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 203 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 204 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 205 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 206 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 207 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 208 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 209 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 210 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 211 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 212 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 213 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 214 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 215 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 216 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 217 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 218 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 219 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 220 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 221 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 222 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 223 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 224 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 225 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 226 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 227 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 228 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 229 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 230 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 231 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 232 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 233 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 234 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 235 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 236 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 237 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 238 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 239 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 240 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 241 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 242 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 243 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 244 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 245 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 246 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 247 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 248 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 249 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 250 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 251 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 252 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 253 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 254 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 255 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 256 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 257 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 258 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 259 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 260 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 261 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 262 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 263 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 264 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 265 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 266 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 267 */,
/* 268 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__(8) && !__webpack_require__(2)(function () {
return Object.defineProperty(__webpack_require__(70)('div'), 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 269 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(1);
var core = __webpack_require__(7);
var LIBRARY = __webpack_require__(31);
var wksExt = __webpack_require__(71);
var defineProperty = __webpack_require__(9).f;
module.exports = function (name) {
var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
};
/***/ }),
/* 270 */
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__(14);
var toIObject = __webpack_require__(16);
var arrayIndexOf = __webpack_require__(54)(false);
var IE_PROTO = __webpack_require__(72)('IE_PROTO');
module.exports = function (object, names) {
var O = toIObject(object);
var i = 0;
var result = [];
var key;
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (has(O, key = names[i++])) {
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
/***/ }),
/* 271 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(9);
var anObject = __webpack_require__(3);
var getKeys = __webpack_require__(32);
module.exports = __webpack_require__(8) ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = getKeys(Properties);
var length = keys.length;
var i = 0;
var P;
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
return O;
};
/***/ }),
/* 272 */
/***/ (function(module, exports, __webpack_require__) {
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
var toIObject = __webpack_require__(16);
var gOPN = __webpack_require__(35).f;
var toString = {}.toString;
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function (it) {
try {
return gOPN(it);
} catch (e) {
return windowNames.slice();
}
};
module.exports.f = function getOwnPropertyNames(it) {
return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
};
/***/ }),
/* 273 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 19.1.2.1 Object.assign(target, source, ...)
var DESCRIPTORS = __webpack_require__(8);
var getKeys = __webpack_require__(32);
var gOPS = __webpack_require__(55);
var pIE = __webpack_require__(47);
var toObject = __webpack_require__(10);
var IObject = __webpack_require__(46);
var $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__(2)(function () {
var A = {};
var B = {};
// eslint-disable-next-line no-undef
var S = Symbol();
var K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function (k) { B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
var T = toObject(target);
var aLen = arguments.length;
var index = 1;
var getSymbols = gOPS.f;
var isEnum = pIE.f;
while (aLen > index) {
var S = IObject(arguments[index++]);
var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) {
key = keys[j++];
if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
}
} return T;
} : $assign;
/***/ }),
/* 274 */
/***/ (function(module, exports) {
// 7.2.9 SameValue(x, y)
module.exports = Object.is || function is(x, y) {
// eslint-disable-next-line no-self-compare
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
};
/***/ }),
/* 275 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var aFunction = __webpack_require__(19);
var isObject = __webpack_require__(4);
var invoke = __webpack_require__(276);
var arraySlice = [].slice;
var factories = {};
var construct = function (F, len, args) {
if (!(len in factories)) {
for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
// eslint-disable-next-line no-new-func
factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
} return factories[len](F, args);
};
module.exports = Function.bind || function bind(that /* , ...args */) {
var fn = aFunction(this);
var partArgs = arraySlice.call(arguments, 1);
var bound = function (/* args... */) {
var args = partArgs.concat(arraySlice.call(arguments));
return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
};
if (isObject(fn.prototype)) bound.prototype = fn.prototype;
return bound;
};
/***/ }),
/* 276 */
/***/ (function(module, exports) {
// fast apply, http://jsperf.lnkit.com/fast-apply/5
module.exports = function (fn, args, that) {
var un = that === undefined;
switch (args.length) {
case 0: return un ? fn()
: fn.call(that);
case 1: return un ? fn(args[0])
: fn.call(that, args[0]);
case 2: return un ? fn(args[0], args[1])
: fn.call(that, args[0], args[1]);
case 3: return un ? fn(args[0], args[1], args[2])
: fn.call(that, args[0], args[1], args[2]);
case 4: return un ? fn(args[0], args[1], args[2], args[3])
: fn.call(that, args[0], args[1], args[2], args[3]);
} return fn.apply(that, args);
};
/***/ }),
/* 277 */
/***/ (function(module, exports, __webpack_require__) {
var $parseInt = __webpack_require__(1).parseInt;
var $trim = __webpack_require__(40).trim;
var ws = __webpack_require__(76);
var hex = /^[-+]?0[xX]/;
module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
var string = $trim(String(str), 3);
return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
} : $parseInt;
/***/ }),
/* 278 */
/***/ (function(module, exports, __webpack_require__) {
var $parseFloat = __webpack_require__(1).parseFloat;
var $trim = __webpack_require__(40).trim;
module.exports = 1 / $parseFloat(__webpack_require__(76) + '-0') !== -Infinity ? function parseFloat(str) {
var string = $trim(String(str), 3);
var result = $parseFloat(string);
return result === 0 && string.charAt(0) == '-' ? -0 : result;
} : $parseFloat;
/***/ }),
/* 279 */
/***/ (function(module, exports, __webpack_require__) {
var cof = __webpack_require__(24);
module.exports = function (it, msg) {
if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);
return +it;
};
/***/ }),
/* 280 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.3 Number.isInteger(number)
var isObject = __webpack_require__(4);
var floor = Math.floor;
module.exports = function isInteger(it) {
return !isObject(it) && isFinite(it) && floor(it) === it;
};
/***/ }),
/* 281 */
/***/ (function(module, exports) {
// 20.2.2.20 Math.log1p(x)
module.exports = Math.log1p || function log1p(x) {
return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
};
/***/ }),
/* 282 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var create = __webpack_require__(34);
var descriptor = __webpack_require__(29);
var setToStringTag = __webpack_require__(39);
var IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
__webpack_require__(15)(IteratorPrototype, __webpack_require__(5)('iterator'), function () { return this; });
module.exports = function (Constructor, NAME, next) {
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
setToStringTag(Constructor, NAME + ' Iterator');
};
/***/ }),
/* 283 */
/***/ (function(module, exports, __webpack_require__) {
// call something on iterator step with safe closing on error
var anObject = __webpack_require__(3);
module.exports = function (iterator, fn, value, entries) {
try {
return entries ? fn(anObject(value)[0], value[1]) : fn(value);
// 7.4.6 IteratorClose(iterator, completion)
} catch (e) {
var ret = iterator['return'];
if (ret !== undefined) anObject(ret.call(iterator));
throw e;
}
};
/***/ }),
/* 284 */
/***/ (function(module, exports, __webpack_require__) {
// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
var speciesConstructor = __webpack_require__(845);
module.exports = function (original, length) {
return new (speciesConstructor(original))(length);
};
/***/ }),
/* 285 */
/***/ (function(module, exports, __webpack_require__) {
var aFunction = __webpack_require__(19);
var toObject = __webpack_require__(10);
var IObject = __webpack_require__(46);
var toLength = __webpack_require__(6);
module.exports = function (that, callbackfn, aLen, memo, isRight) {
aFunction(callbackfn);
var O = toObject(that);
var self = IObject(O);
var length = toLength(O.length);
var index = isRight ? length - 1 : 0;
var i = isRight ? -1 : 1;
if (aLen < 2) for (;;) {
if (index in self) {
memo = self[index];
index += i;
break;
}
index += i;
if (isRight ? index < 0 : length <= index) {
throw TypeError('Reduce of empty array with no initial value');
}
}
for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {
memo = callbackfn(memo, self[index], index, O);
}
return memo;
};
/***/ }),
/* 286 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
var toObject = __webpack_require__(10);
var toAbsoluteIndex = __webpack_require__(33);
var toLength = __webpack_require__(6);
module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
var O = toObject(this);
var len = toLength(O.length);
var to = toAbsoluteIndex(target, len);
var from = toAbsoluteIndex(start, len);
var end = arguments.length > 2 ? arguments[2] : undefined;
var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
var inc = 1;
if (from < to && to < from + count) {
inc = -1;
from += count - 1;
to += count - 1;
}
while (count-- > 0) {
if (from in O) O[to] = O[from];
else delete O[to];
to += inc;
from += inc;
} return O;
};
/***/ }),
/* 287 */
/***/ (function(module, exports) {
module.exports = function (done, value) {
return { value: value, done: !!done };
};
/***/ }),
/* 288 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var regexpExec = __webpack_require__(91);
__webpack_require__(0)({
target: 'RegExp',
proto: true,
forced: regexpExec !== /./.exec
}, {
exec: regexpExec
});
/***/ }),
/* 289 */
/***/ (function(module, exports, __webpack_require__) {
// 21.2.5.3 get RegExp.prototype.flags()
if (__webpack_require__(8) && /./g.flags != 'g') __webpack_require__(9).f(RegExp.prototype, 'flags', {
configurable: true,
get: __webpack_require__(58)
});
/***/ }),
/* 290 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var LIBRARY = __webpack_require__(31);
var global = __webpack_require__(1);
var ctx = __webpack_require__(18);
var classof = __webpack_require__(48);
var $export = __webpack_require__(0);
var isObject = __webpack_require__(4);
var aFunction = __webpack_require__(19);
var anInstance = __webpack_require__(43);
var forOf = __webpack_require__(61);
var speciesConstructor = __webpack_require__(49);
var task = __webpack_require__(93).set;
var microtask = __webpack_require__(865)();
var newPromiseCapabilityModule = __webpack_require__(291);
var perform = __webpack_require__(866);
var userAgent = __webpack_require__(62);
var promiseResolve = __webpack_require__(292);
var PROMISE = 'Promise';
var TypeError = global.TypeError;
var process = global.process;
var versions = process && process.versions;
var v8 = versions && versions.v8 || '';
var $Promise = global[PROMISE];
var isNode = classof(process) == 'process';
var empty = function () { /* empty */ };
var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
var USE_NATIVE = !!function () {
try {
// correct subclassing with @@species support
var promise = $Promise.resolve(1);
var FakePromise = (promise.constructor = {})[__webpack_require__(5)('species')] = function (exec) {
exec(empty, empty);
};
// unhandled rejections tracking support, NodeJS Promise without it fails @@species test
return (isNode || typeof PromiseRejectionEvent == 'function')
&& promise.then(empty) instanceof FakePromise
// v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
// we can't detect it synchronously, so just check versions
&& v8.indexOf('6.6') !== 0
&& userAgent.indexOf('Chrome/66') === -1;
} catch (e) { /* empty */ }
}();
// helpers
var isThenable = function (it) {
var then;
return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
};
var notify = function (promise, isReject) {
if (promise._n) return;
promise._n = true;
var chain = promise._c;
microtask(function () {
var value = promise._v;
var ok = promise._s == 1;
var i = 0;
var run = function (reaction) {
var handler = ok ? reaction.ok : reaction.fail;
var resolve = reaction.resolve;
var reject = reaction.reject;
var domain = reaction.domain;
var result, then, exited;
try {
if (handler) {
if (!ok) {
if (promise._h == 2) onHandleUnhandled(promise);
promise._h = 1;
}
if (handler === true) result = value;
else {
if (domain) domain.enter();
result = handler(value); // may throw
if (domain) {
domain.exit();
exited = true;
}
}
if (result === reaction.promise) {
reject(TypeError('Promise-chain cycle'));
} else if (then = isThenable(result)) {
then.call(result, resolve, reject);
} else resolve(result);
} else reject(value);
} catch (e) {
if (domain && !exited) domain.exit();
reject(e);
}
};
while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
promise._c = [];
promise._n = false;
if (isReject && !promise._h) onUnhandled(promise);
});
};
var onUnhandled = function (promise) {
task.call(global, function () {
var value = promise._v;
var unhandled = isUnhandled(promise);
var result, handler, console;
if (unhandled) {
result = perform(function () {
if (isNode) {
process.emit('unhandledRejection', value, promise);
} else if (handler = global.onunhandledrejection) {
handler({ promise: promise, reason: value });
} else if ((console = global.console) && console.error) {
console.error('Unhandled promise rejection', value);
}
});
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
promise._h = isNode || isUnhandled(promise) ? 2 : 1;
} promise._a = undefined;
if (unhandled && result.e) throw result.v;
});
};
var isUnhandled = function (promise) {
return promise._h !== 1 && (promise._a || promise._c).length === 0;
};
var onHandleUnhandled = function (promise) {
task.call(global, function () {
var handler;
if (isNode) {
process.emit('rejectionHandled', promise);
} else if (handler = global.onrejectionhandled) {
handler({ promise: promise, reason: promise._v });
}
});
};
var $reject = function (value) {
var promise = this;
if (promise._d) return;
promise._d = true;
promise = promise._w || promise; // unwrap
promise._v = value;
promise._s = 2;
if (!promise._a) promise._a = promise._c.slice();
notify(promise, true);
};
var $resolve = function (value) {
var promise = this;
var then;
if (promise._d) return;
promise._d = true;
promise = promise._w || promise; // unwrap
try {
if (promise === value) throw TypeError("Promise can't be resolved itself");
if (then = isThenable(value)) {
microtask(function () {
var wrapper = { _w: promise, _d: false }; // wrap
try {
then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
} catch (e) {
$reject.call(wrapper, e);
}
});
} else {
promise._v = value;
promise._s = 1;
notify(promise, false);
}
} catch (e) {
$reject.call({ _w: promise, _d: false }, e); // wrap
}
};
// constructor polyfill
if (!USE_NATIVE) {
// 25.4.3.1 Promise(executor)
$Promise = function Promise(executor) {
anInstance(this, $Promise, PROMISE, '_h');
aFunction(executor);
Internal.call(this);
try {
executor(ctx($resolve, this, 1), ctx($reject, this, 1));
} catch (err) {
$reject.call(this, err);
}
};
// eslint-disable-next-line no-unused-vars
Internal = function Promise(executor) {
this._c = []; // <- awaiting reactions
this._a = undefined; // <- checked in isUnhandled reactions
this._s = 0; // <- state
this._d = false; // <- done
this._v = undefined; // <- value
this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
this._n = false; // <- notify
};
Internal.prototype = __webpack_require__(44)($Promise.prototype, {
// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
then: function then(onFulfilled, onRejected) {
var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
reaction.fail = typeof onRejected == 'function' && onRejected;
reaction.domain = isNode ? process.domain : undefined;
this._c.push(reaction);
if (this._a) this._a.push(reaction);
if (this._s) notify(this, false);
return reaction.promise;
},
// 25.4.5.1 Promise.prototype.catch(onRejected)
'catch': function (onRejected) {
return this.then(undefined, onRejected);
}
});
OwnPromiseCapability = function () {
var promise = new Internal();
this.promise = promise;
this.resolve = ctx($resolve, promise, 1);
this.reject = ctx($reject, promise, 1);
};
newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
return C === $Promise || C === Wrapper
? new OwnPromiseCapability(C)
: newGenericPromiseCapability(C);
};
}
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
__webpack_require__(39)($Promise, PROMISE);
__webpack_require__(42)(PROMISE);
Wrapper = __webpack_require__(7)[PROMISE];
// statics
$export($export.S + $export.F * !USE_NATIVE, PROMISE, {
// 25.4.4.5 Promise.reject(r)
reject: function reject(r) {
var capability = newPromiseCapability(this);
var $$reject = capability.reject;
$$reject(r);
return capability.promise;
}
});
$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
// 25.4.4.6 Promise.resolve(x)
resolve: function resolve(x) {
return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
}
});
$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(57)(function (iter) {
$Promise.all(iter)['catch'](empty);
})), PROMISE, {
// 25.4.4.1 Promise.all(iterable)
all: function all(iterable) {
var C = this;
var capability = newPromiseCapability(C);
var resolve = capability.resolve;
var reject = capability.reject;
var result = perform(function () {
var values = [];
var index = 0;
var remaining = 1;
forOf(iterable, false, function (promise) {
var $index = index++;
var alreadyCalled = false;
values.push(undefined);
remaining++;
C.resolve(promise).then(function (value) {
if (alreadyCalled) return;
alreadyCalled = true;
values[$index] = value;
--remaining || resolve(values);
}, reject);
});
--remaining || resolve(values);
});
if (result.e) reject(result.v);
return capability.promise;
},
// 25.4.4.4 Promise.race(iterable)
race: function race(iterable) {
var C = this;
var capability = newPromiseCapability(C);
var reject = capability.reject;
var result = perform(function () {
forOf(iterable, false, function (promise) {
C.resolve(promise).then(capability.resolve, reject);
});
});
if (result.e) reject(result.v);
return capability.promise;
}
});
/***/ }),
/* 291 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 25.4.1.5 NewPromiseCapability(C)
var aFunction = __webpack_require__(19);
function PromiseCapability(C) {
var resolve, reject;
this.promise = new C(function ($$resolve, $$reject) {
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
resolve = $$resolve;
reject = $$reject;
});
this.resolve = aFunction(resolve);
this.reject = aFunction(reject);
}
module.exports.f = function (C) {
return new PromiseCapability(C);
};
/***/ }),
/* 292 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(3);
var isObject = __webpack_require__(4);
var newPromiseCapability = __webpack_require__(291);
module.exports = function (C, x) {
anObject(C);
if (isObject(x) && x.constructor === C) return x;
var promiseCapability = newPromiseCapability.f(C);
var resolve = promiseCapability.resolve;
resolve(x);
return promiseCapability.promise;
};
/***/ }),
/* 293 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var dP = __webpack_require__(9).f;
var create = __webpack_require__(34);
var redefineAll = __webpack_require__(44);
var ctx = __webpack_require__(18);
var anInstance = __webpack_require__(43);
var forOf = __webpack_require__(61);
var $iterDefine = __webpack_require__(82);
var step = __webpack_require__(287);
var setSpecies = __webpack_require__(42);
var DESCRIPTORS = __webpack_require__(8);
var fastKey = __webpack_require__(28).fastKey;
var validate = __webpack_require__(38);
var SIZE = DESCRIPTORS ? '_s' : 'size';
var getEntry = function (that, key) {
// fast case
var index = fastKey(key);
var entry;
if (index !== 'F') return that._i[index];
// frozen object case
for (entry = that._f; entry; entry = entry.n) {
if (entry.k == key) return entry;
}
};
module.exports = {
getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
var C = wrapper(function (that, iterable) {
anInstance(that, C, NAME, '_i');
that._t = NAME; // collection type
that._i = create(null); // index
that._f = undefined; // first entry
that._l = undefined; // last entry
that[SIZE] = 0; // size
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
});
redefineAll(C.prototype, {
// 23.1.3.1 Map.prototype.clear()
// 23.2.3.2 Set.prototype.clear()
clear: function clear() {
for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
entry.r = true;
if (entry.p) entry.p = entry.p.n = undefined;
delete data[entry.i];
}
that._f = that._l = undefined;
that[SIZE] = 0;
},
// 23.1.3.3 Map.prototype.delete(key)
// 23.2.3.4 Set.prototype.delete(value)
'delete': function (key) {
var that = validate(this, NAME);
var entry = getEntry(that, key);
if (entry) {
var next = entry.n;
var prev = entry.p;
delete that._i[entry.i];
entry.r = true;
if (prev) prev.n = next;
if (next) next.p = prev;
if (that._f == entry) that._f = next;
if (that._l == entry) that._l = prev;
that[SIZE]--;
} return !!entry;
},
// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
forEach: function forEach(callbackfn /* , that = undefined */) {
validate(this, NAME);
var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
var entry;
while (entry = entry ? entry.n : this._f) {
f(entry.v, entry.k, this);
// revert to the last existing entry
while (entry && entry.r) entry = entry.p;
}
},
// 23.1.3.7 Map.prototype.has(key)
// 23.2.3.7 Set.prototype.has(value)
has: function has(key) {
return !!getEntry(validate(this, NAME), key);
}
});
if (DESCRIPTORS) dP(C.prototype, 'size', {
get: function () {
return validate(this, NAME)[SIZE];
}
});
return C;
},
def: function (that, key, value) {
var entry = getEntry(that, key);
var prev, index;
// change existing entry
if (entry) {
entry.v = value;
// create new entry
} else {
that._l = entry = {
i: index = fastKey(key, true), // <- index
k: key, // <- key
v: value, // <- value
p: prev = that._l, // <- previous entry
n: undefined, // <- next entry
r: false // <- removed
};
if (!that._f) that._f = entry;
if (prev) prev.n = entry;
that[SIZE]++;
// add to index
if (index !== 'F') that._i[index] = entry;
} return that;
},
getEntry: getEntry,
setStrong: function (C, NAME, IS_MAP) {
// add .keys, .values, .entries, [@@iterator]
// 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
$iterDefine(C, NAME, function (iterated, kind) {
this._t = validate(iterated, NAME); // target
this._k = kind; // kind
this._l = undefined; // previous
}, function () {
var that = this;
var kind = that._k;
var entry = that._l;
// revert to the last existing entry
while (entry && entry.r) entry = entry.p;
// get next entry
if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
// or finish the iteration
that._t = undefined;
return step(1);
}
// return step by kind
if (kind == 'keys') return step(0, entry.k);
if (kind == 'values') return step(0, entry.v);
return step(0, [entry.k, entry.v]);
}, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
// add [@@species], 23.1.2.2, 23.2.2.2
setSpecies(NAME);
}
};
/***/ }),
/* 294 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var redefineAll = __webpack_require__(44);
var getWeak = __webpack_require__(28).getWeak;
var anObject = __webpack_require__(3);
var isObject = __webpack_require__(4);
var anInstance = __webpack_require__(43);
var forOf = __webpack_require__(61);
var createArrayMethod = __webpack_require__(23);
var $has = __webpack_require__(14);
var validate = __webpack_require__(38);
var arrayFind = createArrayMethod(5);
var arrayFindIndex = createArrayMethod(6);
var id = 0;
// fallback for uncaught frozen keys
var uncaughtFrozenStore = function (that) {
return that._l || (that._l = new UncaughtFrozenStore());
};
var UncaughtFrozenStore = function () {
this.a = [];
};
var findUncaughtFrozen = function (store, key) {
return arrayFind(store.a, function (it) {
return it[0] === key;
});
};
UncaughtFrozenStore.prototype = {
get: function (key) {
var entry = findUncaughtFrozen(this, key);
if (entry) return entry[1];
},
has: function (key) {
return !!findUncaughtFrozen(this, key);
},
set: function (key, value) {
var entry = findUncaughtFrozen(this, key);
if (entry) entry[1] = value;
else this.a.push([key, value]);
},
'delete': function (key) {
var index = arrayFindIndex(this.a, function (it) {
return it[0] === key;
});
if (~index) this.a.splice(index, 1);
return !!~index;
}
};
module.exports = {
getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
var C = wrapper(function (that, iterable) {
anInstance(that, C, NAME, '_i');
that._t = NAME; // collection type
that._i = id++; // collection id
that._l = undefined; // leak store for uncaught frozen objects
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
});
redefineAll(C.prototype, {
// 23.3.3.2 WeakMap.prototype.delete(key)
// 23.4.3.3 WeakSet.prototype.delete(value)
'delete': function (key) {
if (!isObject(key)) return false;
var data = getWeak(key);
if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);
return data && $has(data, this._i) && delete data[this._i];
},
// 23.3.3.4 WeakMap.prototype.has(key)
// 23.4.3.4 WeakSet.prototype.has(value)
has: function has(key) {
if (!isObject(key)) return false;
var data = getWeak(key);
if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);
return data && $has(data, this._i);
}
});
return C;
},
def: function (that, key, value) {
var data = getWeak(anObject(key), true);
if (data === true) uncaughtFrozenStore(that).set(key, value);
else data[that._i] = value;
return that;
},
ufstore: uncaughtFrozenStore
};
/***/ }),
/* 295 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/ecma262/#sec-toindex
var toInteger = __webpack_require__(20);
var toLength = __webpack_require__(6);
module.exports = function (it) {
if (it === undefined) return 0;
var number = toInteger(it);
var length = toLength(number);
if (number !== length) throw RangeError('Wrong length!');
return length;
};
/***/ }),
/* 296 */
/***/ (function(module, exports, __webpack_require__) {
// all object keys, includes non-enumerable and symbols
var gOPN = __webpack_require__(35);
var gOPS = __webpack_require__(55);
var anObject = __webpack_require__(3);
var Reflect = __webpack_require__(1).Reflect;
module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {
var keys = gOPN.f(anObject(it));
var getSymbols = gOPS.f;
return getSymbols ? keys.concat(getSymbols(it)) : keys;
};
/***/ }),
/* 297 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-string-pad-start-end
var toLength = __webpack_require__(6);
var repeat = __webpack_require__(78);
var defined = __webpack_require__(25);
module.exports = function (that, maxLength, fillString, left) {
var S = String(defined(that));
var stringLength = S.length;
var fillStr = fillString === undefined ? ' ' : String(fillString);
var intMaxLength = toLength(maxLength);
if (intMaxLength <= stringLength || fillStr == '') return S;
var fillLen = intMaxLength - stringLength;
var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
return left ? stringFiller + S : S + stringFiller;
};
/***/ }),
/* 298 */
/***/ (function(module, exports, __webpack_require__) {
var DESCRIPTORS = __webpack_require__(8);
var getKeys = __webpack_require__(32);
var toIObject = __webpack_require__(16);
var isEnum = __webpack_require__(47).f;
module.exports = function (isEntries) {
return function (it) {
var O = toIObject(it);
var keys = getKeys(O);
var length = keys.length;
var i = 0;
var result = [];
var key;
while (length > i) {
key = keys[i++];
if (!DESCRIPTORS || isEnum.call(O, key)) {
result.push(isEntries ? [key, O[key]] : O[key]);
}
}
return result;
};
};
/***/ }),
/* 299 */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.6.11' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/* 300 */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/* 301 */
/***/ (function(module, exports) {
/**
* Widget超类
* @class BI.Widget
* @extends BI.OB
*
* @cfg {JSON} options 配置属性
*/
!(function () {
BI.Widget = BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.Widget.superclass._defaultConfig.apply(this), {
root: false,
tagName: "div",
attributes: null,
data: null,
tag: null,
disabled: false,
invisible: false,
invalid: false,
baseCls: "",
extraCls: "",
cls: "",
css: null
});
},
// 覆盖父类的_constructor方法,widget不走ob的生命周期
_constructor: function () {
},
beforeInit: null,
// 生命周期函数
beforeCreate: null,
created: null,
render: null,
beforeMount: null,
mounted: null,
shouldUpdate: null,
update: function () {
},
beforeDestroy: null,
destroyed: null,
_init: function () {
BI.Widget.superclass._init.apply(this, arguments);
this._initRoot();
this._initElementWidth();
this._initElementHeight();
this._initVisual();
this._initState();
this._initRender();
},
_initRender: function () {
if (this.beforeInit) {
this.__asking = true;
this.beforeInit(BI.bind(this._render, this));
if (this.__asking === true) {
this.__async = true;
}
} else {
this._render();
}
},
_render: function () {
this.__asking = false;
this.beforeCreate && this.beforeCreate();
this._initElement();
this._initEffects();
this.created && this.created();
},
/**
* 初始化根节点
* @private
*/
_initRoot: function () {
var o = this.options;
this.widgetName = o.widgetName || BI.uniqueId("widget");
this._isRoot = o.root;
if (BI.isWidget(o.element)) {
if (o.element instanceof BI.Widget) {
this._parent = o.element;
this._parent.addWidget(this.widgetName, this);
} else {
this._isRoot = true;
}
this.element = this.options.element.element;
} else if (o.element) {
// if (o.root !== true) {
// throw new Error("root is a required property");
// }
this.element = BI.Widget._renderEngine.createElement(this);
this._isRoot = true;
} else {
this.element = BI.Widget._renderEngine.createElement(this);
}
this.element._isWidget = true;
if (o._baseCls || o.baseCls || o.extraCls || o.cls) {
this.element.addClass((o._baseCls || "") + " " + (o.baseCls || "") + " " + (o.extraCls || "") + " " + (o.cls || ""));
}
if (o.attributes) {
this.element.attr(o.attributes);
}
if (o.data) {
this.element.data(o.data);
}
if (o.css) {
this.element.css(o.css);
}
this._children = {};
},
_initElementWidth: function () {
var o = this.options;
if (BI.isWidthOrHeight(o.width)) {
this.element.css("width", o.width);
}
},
_initElementHeight: function () {
var o = this.options;
if (BI.isWidthOrHeight(o.height)) {
this.element.css("height", o.height);
}
},
_initVisual: function () {
var o = this.options;
if (o.invisible) {
// 用display属性做显示和隐藏,否则jquery会在显示时将display设为block会覆盖掉display:flex属性
this.element.css("display", "none");
}
},
_initEffects: function () {
var o = this.options;
if (o.disabled || o.invalid) {
if (this.options.disabled) {
this.setEnable(false);
}
if (this.options.invalid) {
this.setValid(false);
}
}
},
_initState: function () {
this._isMounted = false;
},
_initElement: function () {
var self = this;
var els = this.render && this.render();
if (BI.isPlainObject(els)) {
els = [els];
}
if (BI.isArray(els)) {
BI.each(els, function (i, el) {
BI.createWidget(el, {
element: self
});
});
}
// if (this._isRoot === true || !(this instanceof BI.Layout)) {
this._mount();
// }
},
_setParent: function (parent) {
this._parent = parent;
},
/**
*
* @param force 是否强制挂载子节点
* @param deep 子节点是否也是按照当前force处理
* @param lifeHook 生命周期钩子触不触发,默认触发
* @param predicate 递归每个widget的回调
* @returns {boolean}
* @private
*/
_mount: function (force, deep, lifeHook, predicate) {
var self = this;
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
lifeHook !== false && this.beforeMount && this.beforeMount();
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false);
!self.isValid() && widget._setValid(false);
widget._mount && widget._mount(deep ? force : false, deep, lifeHook, predicate);
});
lifeHook !== false && this.mounted && this.mounted();
this.fireEvent(BI.Events.MOUNT);
predicate && predicate(this);
return true;
},
_mountChildren: null,
isMounted: function () {
return this._isMounted;
},
setWidth: function (w) {
this.options.width = w;
this._initElementWidth();
},
setHeight: function (h) {
this.options.height = h;
this._initElementHeight();
},
_setEnable: function (enable) {
if (enable === true) {
this.options.disabled = false;
} else if (enable === false) {
this.options.disabled = true;
}
// 递归将所有子组件使能
BI.each(this._children, function (i, child) {
!child._manualSetEnable && child._setEnable && child._setEnable(enable);
});
},
_setValid: function (valid) {
if (valid === true) {
this.options.invalid = false;
} else if (valid === false) {
this.options.invalid = true;
}
// 递归将所有子组件使有效
BI.each(this._children, function (i, child) {
!child._manualSetValid && child._setValid && child._setValid(valid);
});
},
_setVisible: function (visible) {
if (visible === true) {
this.options.invisible = false;
} else if (visible === false) {
this.options.invisible = true;
}
},
setEnable: function (enable) {
this._manualSetEnable = true;
this._setEnable(enable);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
},
setVisible: function (visible) {
this._setVisible(visible);
if (visible === true) {
// 用this.element.show()会把display属性改成block
this.element.css("display", "");
this._mount();
} else if (visible === false) {
this.element.css("display", "none");
}
this.fireEvent(BI.Events.VIEW, visible);
},
setValid: function (valid) {
this._manualSetValid = true;
this._setValid(valid);
if (valid === true) {
this.element.removeClass("base-invalid invalid");
} else if (valid === false) {
this.element.addClass("base-invalid invalid");
}
},
doBehavior: function () {
var args = arguments;
// 递归将所有子组件使有效
BI.each(this._children, function (i, child) {
child.doBehavior && child.doBehavior.apply(child, args);
});
},
getWidth: function () {
return this.options.width;
},
getHeight: function () {
return this.options.height;
},
isValid: function () {
return !this.options.invalid;
},
addWidget: function (name, widget) {
var self = this;
if (name instanceof BI.Widget) {
widget = name;
name = widget.getName();
}
if (BI.isKey(name)) {
name = name + "";
}
name = name || widget.getName() || BI.uniqueId("widget");
if (this._children[name]) {
throw new Error("name has already been existed");
}
widget._setParent && widget._setParent(this);
widget.on(BI.Events.DESTROY, function () {
BI.remove(self._children, this);
});
return (this._children[name] = widget);
},
getWidgetByName: function (name) {
if (!BI.isKey(name) || name === this.getName()) {
return this;
}
name = name + "";
var widget = void 0, other = {};
BI.any(this._children, function (i, wi) {
if (i === name) {
widget = wi;
return true;
}
other[i] = wi;
});
if (!widget) {
BI.any(other, function (i, wi) {
return (widget = wi.getWidgetByName(i));
});
}
return widget;
},
removeWidget: function (nameOrWidget) {
var self = this;
if (BI.isWidget(nameOrWidget)) {
BI.remove(this._children, nameOrWidget);
} else {
delete this._children[nameOrWidget];
}
},
hasWidget: function (name) {
return this._children[name] != null;
},
getName: function () {
return this.widgetName;
},
setTag: function (tag) {
this.options.tag = tag;
},
getTag: function () {
return this.options.tag;
},
attr: function (key, value) {
var self = this;
if (BI.isPlainObject(key)) {
BI.each(key, function (k, v) {
self.attr(k, v);
});
return;
}
if (BI.isNotNull(value)) {
return this.options[key] = value;
}
return this.options[key];
},
css: function (name, value) {
return this.element.css(name, value);
},
getText: function () {
},
setText: function (text) {
},
getValue: function () {
},
setValue: function (value) {
},
isEnabled: function () {
return !this.options.disabled;
},
isVisible: function () {
return !this.options.invisible;
},
disable: function () {
this.setEnable(false);
},
enable: function () {
this.setEnable(true);
},
valid: function () {
this.setValid(true);
},
invalid: function () {
this.setValid(false);
},
invisible: function () {
this.setVisible(false);
},
visible: function () {
this.setVisible(true);
},
__d: function () {
this.beforeDestroy && this.beforeDestroy();
this.beforeDestroy = null;
BI.each(this._children, function (i, widget) {
widget && widget._unMount && widget._unMount();
});
this._children = {};
this._parent = null;
this._isMounted = false;
this.destroyed && this.destroyed();
this.destroyed = null;
},
_unMount: function () {
this.__d();
this.fireEvent(BI.Events.UNMOUNT);
this.purgeListeners();
},
isolate: function () {
if (this._parent) {
this._parent.removeWidget(this);
}
BI.DOM.hang([this]);
},
empty: function () {
BI.each(this._children, function (i, widget) {
widget && widget._unMount && widget._unMount();
});
this._children = {};
this.element.empty();
},
_destroy: function () {
this.__d();
this.element.destroy();
this.purgeListeners();
},
destroy: function () {
this.__d();
this.element.destroy();
this.fireEvent(BI.Events.DESTROY);
this._purgeRef();
this.purgeListeners();
}
});
BI.Widget.registerRenderEngine = function (engine) {
BI.Widget._renderEngine = engine;
};
BI.Widget.registerRenderEngine({
createElement: function (widget) {
if (BI.isWidget(widget)) {
var o = widget.options;
if (o.element) {
return BI.$(o.element);
}
return BI.$(document.createElement(o.tagName));
}
return BI.$(widget);
},
createFragment: function () {
return document.createDocumentFragment();
}
});
BI.mount = function (widget, container, predicate, hydrate) {
if (hydrate === true) {
// 将widget的element元素都挂载好,并建立相互关系
widget.element.data("__widgets", [widget]);
var res = widget._mount(true, false, false, function (w) {
BI.each(w._children, function (i, child) {
var ws = child.element.data("__widgets");
if (!ws) {
ws = [];
}
ws.push(child);
child.element.data("__widgets", ws);
});
predicate && predicate.apply(this, arguments);
});
// 将新的dom树属性(事件等)patch到已存在的dom上
var c = BI.Widget._renderEngine.createElement;
BI.DOM.patchProps(widget.element, c(c(container).children()[0]));
var triggerLifeHook = function (w) {
w.beforeMount && w.beforeMount();
w.mounted && w.mounted();
BI.each(w._children, function (i, child) {
triggerLifeHook(child);
});
};
// 最后触发组件树生命周期函数
triggerLifeHook(widget);
return res;
}
if (container) {
BI.Widget._renderEngine.createElement(container).append(widget.element);
}
return widget._mount(true, false, false, predicate);
};
})();
/***/ }),
/* 302 */
/***/ (function(module, exports) {
(function () {
var kv = {};
BI.shortcut = BI.component = function (xtype, cls) {
if (kv[xtype] != null) {
_global.console && console.error("shortcut:[" + xtype + "] has been registed");
}
kv[xtype] = cls;
};
// 根据配置属性生成widget
var createWidget = function (config) {
var cls = kv[config.type];
if(!cls){
throw new Error("组件"+config.type +"未定义");
}
var widget = new cls();
widget._initProps(config);
widget._init();
widget._initRef();
return widget;
};
BI.createWidget = function (item, options, context) {
// 先把准备环境准备好
BI.init();
var el, w;
item || (item = {});
if (BI.isWidget(options)) {
context = options;
options = {};
} else {
options || (options = {});
}
if (BI.isEmpty(item) && BI.isEmpty(options)) {
return BI.createWidget({
type: "bi.layout"
});
}
if (BI.isWidget(item)) {
return item;
}
if (item.type || options.type) {
el = BI.extend({}, options, item);
w = BI.Plugin.getWidget(el.type, el);
w.listeners = (w.listeners || []).concat([{
eventName: BI.Events.MOUNT,
action: function () {
BI.Plugin.getObject(el.type, this);
}
}]);
return w.type === el.type ? createWidget(w) : BI.createWidget(BI.extend({}, item, {type: w.type}, options));
}
if (item.el && (item.el.type || options.type)) {
el = BI.extend({}, options, item.el);
w = BI.Plugin.getWidget(el.type, el);
w.listeners = (w.listeners || []).concat([{
eventName: BI.Events.MOUNT,
action: function () {
BI.Plugin.getObject(el.type, this);
}
}]);
return w.type === el.type ? createWidget(w) : BI.createWidget(BI.extend({}, item, {type: w.type}, options));
}
if (BI.isWidget(item.el)) {
return item.el;
}
throw new Error("无法根据item创建组件");
};
BI.createElement = function () {
var widget = BI.createWidget.apply(this, arguments);
return widget.element;
};
})();
/***/ }),
/* 303 */
/***/ (function(module, exports) {
!(function () {
var cancelAnimationFrame =
_global.cancelAnimationFrame ||
_global.webkitCancelAnimationFrame ||
_global.mozCancelAnimationFrame ||
_global.oCancelAnimationFrame ||
_global.msCancelAnimationFrame ||
_global.clearTimeout;
var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
BI.MouseMoveTracker = function (onMove, onMoveEnd, domNode) {
this._isDragging = false;
this._animationFrameID = null;
this._domNode = domNode;
this._onMove = onMove;
this._onMoveEnd = onMoveEnd;
this._onMouseMove = BI.bind(this._onMouseMove, this);
this._onMouseUp = BI.bind(this._onMouseUp, this);
this._didMouseMove = BI.bind(this._didMouseMove, this);
};
BI.MouseMoveTracker.prototype = {
constructor: BI.MouseMoveTracker,
captureMouseMoves: function (/* object*/ event) {
if (!this._eventMoveToken && !this._eventUpToken) {
this._eventMoveToken = BI.EventListener.listen(
this._domNode,
"mousemove",
this._onMouseMove
);
this._eventUpToken = BI.EventListener.listen(
this._domNode,
"mouseup",
this._onMouseUp
);
}
if (!this._isDragging) {
this._deltaX = 0;
this._deltaY = 0;
this._isDragging = true;
this._x = event.clientX;
this._y = event.clientY;
}
event.preventDefault ? event.preventDefault() : (event.returnValue = false);
},
releaseMouseMoves: function () {
if (this._eventMoveToken && this._eventUpToken) {
this._eventMoveToken.remove();
this._eventMoveToken = null;
this._eventUpToken.remove();
this._eventUpToken = null;
}
if (this._animationFrameID !== null) {
cancelAnimationFrame(this._animationFrameID);
this._animationFrameID = null;
}
if (this._isDragging) {
this._isDragging = false;
this._x = null;
this._y = null;
}
},
isDragging: function () /* boolean*/ {
return this._isDragging;
},
_onMouseMove: function (/* object*/ event) {
var x = event.clientX;
var y = event.clientY;
this._deltaX += (x - this._x);
this._deltaY += (y - this._y);
if (this._animationFrameID === null) {
// The mouse may move faster then the animation frame does.
// Use `requestAnimationFrame` to avoid over-updating.
this._animationFrameID =
requestAnimationFrame(this._didMouseMove);
}
this._x = x;
this._y = y;
event.preventDefault ? event.preventDefault() : (event.returnValue = false);
},
_didMouseMove: function () {
this._animationFrameID = null;
this._onMove(this._deltaX, this._deltaY);
this._deltaX = 0;
this._deltaY = 0;
},
_onMouseUp: function () {
if (this._animationFrameID) {
this._didMouseMove();
}
this._onMoveEnd();
}
};
})();
/***/ }),
/* 304 */
/***/ (function(module, exports) {
!(function () {
var PIXEL_STEP = 10;
var LINE_HEIGHT = 40;
var PAGE_HEIGHT = 800;
var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
function normalizeWheel (/* object*/event) /* object*/ {
var sX = 0,
sY = 0,
// spinX, spinY
pX = 0,
pY = 0; // pixelX, pixelY
// Legacy
if ("detail" in event) {
sY = event.detail;
}
if ("wheelDelta" in event) {
sY = -event.wheelDelta / 120;
}
if ("wheelDeltaY" in event) {
sY = -event.wheelDeltaY / 120;
}
if ("wheelDeltaX" in event) {
sX = -event.wheelDeltaX / 120;
}
// side scrolling on FF with DOMMouseScroll
if ("axis" in event && event.axis === event.HORIZONTAL_AXIS) {
sX = sY;
sY = 0;
}
pX = sX * PIXEL_STEP;
pY = sY * PIXEL_STEP;
if ("deltaY" in event) {
pY = event.deltaY;
}
if ("deltaX" in event) {
pX = event.deltaX;
}
if ((pX || pY) && event.deltaMode) {
if (event.deltaMode === 1) {
// delta in LINE units
pX *= LINE_HEIGHT;
pY *= LINE_HEIGHT;
} else {
// delta in PAGE units
pX *= PAGE_HEIGHT;
pY *= PAGE_HEIGHT;
}
}
// Fall-back if spin cannot be determined
if (pX && !sX) {
sX = pX < 1 ? -1 : 1;
}
if (pY && !sY) {
sY = pY < 1 ? -1 : 1;
}
return {
spinX: sX,
spinY: sY,
pixelX: pX,
pixelY: pY
};
}
BI.WheelHandler = function (onWheel, handleScrollX, handleScrollY, stopPropagation) {
this._animationFrameID = null;
this._deltaX = 0;
this._deltaY = 0;
this._didWheel = BI.bind(this._didWheel, this);
if (typeof handleScrollX !== "function") {
handleScrollX = handleScrollX ?
function () {
return true;
} :
function () {
return false;
};
}
if (typeof handleScrollY !== "function") {
handleScrollY = handleScrollY ?
function () {
return true;
} :
function () {
return false;
};
}
if (typeof stopPropagation !== "function") {
stopPropagation = stopPropagation ?
function () {
return true;
} :
function () {
return false;
};
}
this._handleScrollX = handleScrollX;
this._handleScrollY = handleScrollY;
this._stopPropagation = stopPropagation;
this._onWheelCallback = onWheel;
this.onWheel = BI.bind(this.onWheel, this);
};
BI.WheelHandler.prototype = {
constructor: BI.WheelHandler,
onWheel: function (/* object*/ event) {
var normalizedEvent = normalizeWheel(event);
var deltaX = this._deltaX + normalizedEvent.pixelX;
var deltaY = this._deltaY + normalizedEvent.pixelY;
var handleScrollX = this._handleScrollX(deltaX, deltaY);
var handleScrollY = this._handleScrollY(deltaY, deltaX);
if (!handleScrollX && !handleScrollY) {
return;
}
this._deltaX += handleScrollX ? normalizedEvent.pixelX : 0;
this._deltaY += handleScrollY ? normalizedEvent.pixelY : 0;
event.preventDefault ? event.preventDefault() : (event.returnValue = false);
var changed;
if (this._deltaX !== 0 || this._deltaY !== 0) {
if (this._stopPropagation()) {
event.stopPropagation ? event.stopPropagation() : (event.cancelBubble = true);
}
changed = true;
}
if (changed === true && this._animationFrameID === null) {
this._animationFrameID = requestAnimationFrame(this._didWheel);
}
},
_didWheel: function () {
this._animationFrameID = null;
this._onWheelCallback(this._deltaX, this._deltaY);
this._deltaX = 0;
this._deltaY = 0;
}
};
})();
/***/ }),
/* 305 */
/***/ (function(module, exports) {
BI.BehaviorFactory = {
createBehavior: function (key, options) {
var behavior;
switch (key) {
case "highlight":
behavior = BI.HighlightBehavior;
break;
case "redmark":
behavior = BI.RedMarkBehavior;
break;
}
return new behavior(options);
}
};
/**
* guy
* 行为控件
* @class BI.Behavior
* @extends BI.OB
*/
BI.Behavior = BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.Behavior.superclass._defaultConfig.apply(this, arguments), {
rule: function () {return true;}
});
},
_init: function () {
BI.Behavior.superclass._init.apply(this, arguments);
},
doBehavior: function () {
}
});
/***/ }),
/* 306 */
/***/ (function(module, exports) {
/**
* 布局容器类
* @class BI.Layout
* @extends BI.Widget
*
* @cfg {JSON} options 配置属性
* @cfg {Boolean} [options.scrollable=false] 子组件超出容器边界之后是否会出现滚动条
* @cfg {Boolean} [options.scrollx=false] 子组件超出容器边界之后是否会出现横向滚动条
* @cfg {Boolean} [options.scrolly=false] 子组件超出容器边界之后是否会出现纵向滚动条
*/
BI.Layout = BI.inherit(BI.Widget, {
props: function () {
return {
scrollable: null, // true, false, null
scrollx: false, // true, false
scrolly: false, // true, false
items: []
};
},
render: function () {
this._init4Margin();
this._init4Scroll();
},
_init4Margin: function () {
if (this.options.top) {
this.element.css("top", this.options.top);
}
if (this.options.left) {
this.element.css("left", this.options.left);
}
if (this.options.bottom) {
this.element.css("bottom", this.options.bottom);
}
if (this.options.right) {
this.element.css("right", this.options.right);
}
},
_init4Scroll: function () {
switch (this.options.scrollable) {
case true:
this.element.css("overflow", "auto");
break;
case false:
this.element.css("overflow", "hidden");
break;
default :
break;
}
if (this.options.scrollx) {
this.element.css({
"overflow-x": "auto",
"overflow-y": "hidden"
});
}
if (this.options.scrolly) {
this.element.css({
"overflow-x": "hidden",
"overflow-y": "auto"
});
}
},
appendFragment: function (frag) {
this.element.append(frag);
},
_mountChildren: function () {
var self = this;
var frag = BI.Widget._renderEngine.createFragment();
var hasChild = false;
BI.each(this._children, function (i, widget) {
if (widget.element !== self.element) {
frag.appendChild(widget.element[0]);
hasChild = true;
}
});
if (hasChild === true) {
this.appendFragment(frag);
}
},
_getChildName: function (index) {
return index + "";
},
_addElement: function (i, item, context) {
var self = this, w;
if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
BI.remove(self._children, child);
self.removeItemAt(name | 0);
}
});
});
this.addWidget(this._getChildName(i), w);
} else {
w = this.getWidgetByName(this._getChildName(i));
}
return w;
},
_getOptions: function (item) {
if (item instanceof BI.Widget) {
item = item.options;
}
item = BI.stripEL(item);
if (item instanceof BI.Widget) {
item = item.options;
}
return item;
},
_compare: function (item1, item2) {
var self = this;
return eq(item1, item2);
// 不比较函数
function eq (a, b, aStack, bStack) {
if (a === b) {
return a !== 0 || 1 / a === 1 / b;
}
if (a == null || b == null) {
return a === b;
}
var className = Object.prototype.toString.call(a);
switch (className) {
case "[object RegExp]":
case "[object String]":
return "" + a === "" + b;
case "[object Number]":
if (+a !== +a) {
return +b !== +b;
}
return +a === 0 ? 1 / +a === 1 / b : +a === +b;
case "[object Date]":
case "[object Boolean]":
return +a === +b;
}
var areArrays = className === "[object Array]";
if (!areArrays) {
if (BI.isFunction(a) && BI.isFunction(b)) {
return true;
}
a = self._getOptions(a);
b = self._getOptions(b);
}
aStack = aStack || [];
bStack = bStack || [];
var length = aStack.length;
while (length--) {
if (aStack[length] === a) {
return bStack[length] === b;
}
}
aStack.push(a);
bStack.push(b);
if (areArrays) {
length = a.length;
if (length !== b.length) {
return false;
}
while (length--) {
if (!eq(a[length], b[length], aStack, bStack)) {
return false;
}
}
} else {
var keys = _.keys(a), key;
length = keys.length;
if (_.keys(b).length !== length) {
return false;
}
while (length--) {
key = keys[length];
if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) {
return false;
}
}
}
aStack.pop();
bStack.pop();
return true;
}
},
_getWrapper: function () {
return this.element;
},
_addItemAt: function (index, item) {
for (var i = this.options.items.length; i > index; i--) {
this._children[this._getChildName(i)] = this._children[this._getChildName(i - 1)];
}
delete this._children[this._getChildName(index)];
this.options.items.splice(index, 0, item);
},
_removeItemAt: function (index) {
for (var i = index; i < this.options.items.length - 1; i++) {
this._children[this._getChildName(i)] = this._children[this._getChildName(i + 1)];
}
delete this._children[this._getChildName(this.options.items.length - 1)];
this.options.items.splice(index, 1);
},
/**
* 添加一个子组件到容器中
* @param {JSON/BI.Widget} item 子组件
*/
addItem: function (item) {
return this.addItemAt(this.options.items.length, item);
},
prependItem: function (item) {
return this.addItemAt(0, item);
},
addItemAt: function (index, item) {
if (index < 0 || index > this.options.items.length) {
return;
}
this._addItemAt(index, item);
var w = this._addElement(index, item);
if (index > 0) {
this._children[this._getChildName(index - 1)].element.after(w.element);
} else {
w.element.prependTo(this._getWrapper());
}
w._mount();
return w;
},
removeItemAt: function (indexes) {
indexes = BI.isArray(indexes) ? indexes : [indexes];
var deleted = [];
var newItems = [], newChildren = {};
for (var i = 0, len = this.options.items.length; i < len; i++) {
var child = this._children[this._getChildName(i)];
if (BI.contains(indexes, i)) {
child && deleted.push(child);
} else {
newChildren[this._getChildName(newItems.length)] = child;
newItems.push(this.options.items[i]);
}
}
this.options.items = newItems;
this._children = newChildren;
BI.each(deleted, function (i, c) {
c._destroy();
});
},
shouldUpdateItem: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
return false;
}
var child = this._children[this._getChildName(index)];
if (!child.shouldUpdate) {
return null;
}
return child.shouldUpdate(this._getOptions(item)) === true;
},
updateItemAt: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
return;
}
var child = this._children[this._getChildName(index)];
var updated;
if (updated = child.update(this._getOptions(item))) {
return updated;
}
var del = this._children[this._getChildName(index)];
delete this._children[this._getChildName(index)];
this.options.items.splice(index, 1);
var w = this._addElement(index, item);
this.options.items.splice(index, 0, item);
this._children[this._getChildName(index)] = w;
if (index > 0) {
this._children[this._getChildName(index - 1)].element.after(w.element);
} else {
w.element.prependTo(this._getWrapper());
}
del._destroy();
w._mount();
},
addItems: function (items, context) {
var self = this, o = this.options;
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item, context);
self._children[self._getChildName(o.items.length)] = w;
o.items.push(item);
added.push(w);
fragment.appendChild(w.element[0]);
});
if (this._isMounted) {
this._getWrapper().append(fragment);
BI.each(added, function (i, w) {
w._mount();
});
}
},
prependItems: function (items, context) {
var self = this;
items = items || [];
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
var w = this._addElement(0, items[i], context);
self._children[self._getChildName(0)] = w;
this.options.items.unshift(items[i]);
added.push(w);
fragment.appendChild(w.element[0]);
}
if (this._isMounted) {
this._getWrapper().prepend(fragment);
BI.each(added, function (i, w) {
w._mount();
});
}
},
getValue: function () {
var self = this, value = [], child;
BI.each(this.options.items, function (i) {
if (child = self._children[self._getChildName(i)]) {
var v = child.getValue();
v = BI.isArray(v) ? v : [v];
value = value.concat(v);
}
});
return value;
},
setValue: function (v) {
var self = this, child;
BI.each(this.options.items, function (i) {
if (child = self._children[self._getChildName(i)]) {
child.setValue(v);
}
});
},
setText: function (v) {
var self = this, child;
BI.each(this.options.items, function (i) {
if (child = self._children[self._getChildName(i)]) {
child.setText(v);
}
});
},
patchItem: function (oldVnode, vnode, index) {
var shouldUpdate = this.shouldUpdateItem(index, vnode);
if (shouldUpdate === true || (shouldUpdate === null && !this._compare(oldVnode, vnode))) {
return this.updateItemAt(index, vnode);
}
},
updateChildren: function (oldCh, newCh) {
var self = this;
var oldStartIdx = 0, newStartIdx = 0;
var oldEndIdx = oldCh.length - 1;
var oldStartVnode = oldCh[0];
var oldEndVnode = oldCh[oldEndIdx];
var newEndIdx = newCh.length - 1;
var newStartVnode = newCh[0];
var newEndVnode = newCh[newEndIdx];
var before;
var updated;
var children = {};
BI.each(oldCh, function (i, child) {
child = self._getOptions(child);
var key = child.key == null ? i : child.key;
if (BI.isKey(key)) {
children[key] = self._children[self._getChildName(i)];
}
});
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
if (BI.isNull(oldStartVnode)) {
oldStartVnode = oldCh[++oldStartIdx];
} else if (BI.isNull(oldEndVnode)) {
oldEndVnode = oldCh[--oldEndIdx];
} else if (sameVnode(oldStartVnode, newStartVnode, oldStartIdx, newStartIdx)) {
updated = this.patchItem(oldStartVnode, newStartVnode, oldStartIdx) || updated;
children[oldStartVnode.key == null ? this._getChildName(oldStartIdx) : oldStartVnode.key] = this._children[this._getChildName(oldStartIdx)];
oldStartVnode = oldCh[++oldStartIdx];
newStartVnode = newCh[++newStartIdx];
} else if (sameVnode(oldEndVnode, newEndVnode, oldEndIdx, newEndIdx)) {
updated = this.patchItem(oldEndVnode, newEndVnode, oldEndIdx) || updated;
children[oldEndVnode.key == null ? this._getChildName(oldEndIdx) : oldEndVnode.key] = this._children[this._getChildName(oldEndIdx)];
oldEndVnode = oldCh[--oldEndIdx];
newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldStartVnode, newEndVnode)) {
updated = this.patchItem(oldStartVnode, newEndVnode, oldStartIdx) || updated;
children[oldStartVnode.key == null ? this._getChildName(oldStartIdx) : oldStartVnode.key] = this._children[this._getChildName(oldStartIdx)];
insertBefore(oldStartVnode, oldEndVnode, true);
oldStartVnode = oldCh[++oldStartIdx];
newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldEndVnode, newStartVnode)) {
updated = this.patchItem(oldEndVnode, newStartVnode, oldEndIdx) || updated;
children[oldEndVnode.key == null ? this._getChildName(oldEndIdx) : oldEndVnode.key] = this._children[this._getChildName(oldEndIdx)];
insertBefore(oldEndVnode, oldStartVnode);
oldEndVnode = oldCh[--oldEndIdx];
newStartVnode = newCh[++newStartIdx];
} else {
var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx);
if (BI.isNull(sameOldVnode)) { // 不存在就把新的放到左边
var node = addNode(newStartVnode);
insertBefore(node, oldStartVnode);
newStartVnode = newCh[++newStartIdx];
} else { // 如果新节点在就旧节点区间中存在就复用一下
BI.each(oldCh, function (index, child) {
if (child && sameVnode(child, newStartVnode)) {
updated = self.patchItem(sameOldVnode, newStartVnode, index) || updated;
children[sameOldVnode.key == null ? self._getChildName(index) : sameOldVnode.key] = self._children[self._getChildName(index)];
oldCh[index] = undefined;
insertBefore(sameOldVnode, oldStartVnode);
}
});
newStartVnode = newCh[++newStartIdx];
}
}
}
if (oldStartIdx > oldEndIdx) {
before = BI.isNull(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1];
addVnodes(before, newCh, newStartIdx, newEndIdx);
} else if (newStartIdx > newEndIdx) {
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
}
this._children = {};
BI.each(newCh, function (i, child) {
var node = self._getOptions(child);
var key = node.key == null ? self._getChildName(i) : node.key;
children[key]._mount();
self._children[self._getChildName(i)] = children[key];
});
function sameVnode (vnode1, vnode2, oldIndex, newIndex) {
vnode1 = self._getOptions(vnode1);
vnode2 = self._getOptions(vnode2);
if (BI.isKey(vnode1.key)) {
return vnode1.key === vnode2.key;
}
if (oldIndex >= 0) {
return oldIndex === newIndex;
}
}
function addNode (vnode, index) {
var opt = self._getOptions(vnode);
var key = opt.key == null ? self._getChildName(index) : opt.key;
return children[key] = self._addElement(key, vnode);
}
function addVnodes (before, vnodes, startIdx, endIdx) {
for (; startIdx <= endIdx; ++startIdx) {
var node = addNode(vnodes[startIdx], startIdx);
insertBefore(node, before, false, startIdx);
}
}
function removeVnodes (vnodes, startIdx, endIdx) {
for (; startIdx <= endIdx; ++startIdx) {
var ch = vnodes[startIdx];
if (BI.isNotNull(ch)) {
var node = self._getOptions(ch);
var key = node.key == null ? self._getChildName(startIdx) : node.key;
delete self._children[self._getChildName(key)];
children[key]._destroy();
}
}
}
function insertBefore (insert, before, isNext, index) {
insert = self._getOptions(insert);
before = before && self._getOptions(before);
var insertKey = BI.isKey(insert.key) ? insert.key : self._getChildName(index);
if (before && children[before.key]) {
var beforeKey = BI.isKey(before.key) ? before.key : self._getChildName(index);
var next;
if (isNext) {
next = children[beforeKey].element.next();
} else {
next = children[beforeKey].element;
}
if (next.length > 0) {
next.before(children[insertKey].element);
} else {
self._getWrapper().append(children[insertKey].element);
}
} else {
self._getWrapper().append(children[insertKey].element);
}
}
function findOldVnode (vnodes, vNode, beginIdx, endIdx) {
var i, found;
for (i = beginIdx; i <= endIdx; ++i) {
if (vnodes[i] && sameVnode(vnodes[i], vNode)) {
found = vnodes[i];
}
}
return found;
}
return updated;
},
update: function (opt) {
var o = this.options;
var items = opt.items || [];
var updated = this.updateChildren(o.items, items);
this.options.items = items;
return updated;
// var updated, i, len;
// for (i = 0, len = Math.min(o.items.length, items.length); i < len; i++) {
// if (!this._compare(o.items[i], items[i])) {
// updated = this.updateItemAt(i, items[i]) || updated;
// }
// }
// if (o.items.length > items.length) {
// var deleted = [];
// for (i = items.length; i < o.items.length; i++) {
// deleted.push(this._children[this._getChildName(i)]);
// delete this._children[this._getChildName(i)];
// }
// o.items.splice(items.length);
// BI.each(deleted, function (i, w) {
// w._destroy();
// })
// } else if (items.length > o.items.length) {
// for (i = o.items.length; i < items.length; i++) {
// this.addItemAt(i, items[i]);
// }
// }
// return updated;
},
stroke: function (items) {
var self = this;
BI.each(items, function (i, item) {
if (item) {
self._addElement(i, item);
}
});
},
removeWidget: function (nameOrWidget) {
var removeIndex;
if (BI.isWidget(nameOrWidget)) {
BI.each(this._children, function (name, child) {
if (child === nameOrWidget) {
removeIndex = name;
}
});
} else {
removeIndex = nameOrWidget;
}
if (removeIndex) {
this._removeItemAt(removeIndex | 0);
}
},
empty: function () {
BI.Layout.superclass.empty.apply(this, arguments);
this.options.items = [];
},
destroy: function () {
BI.Layout.superclass.destroy.apply(this, arguments);
this.options.items = [];
},
populate: function (items) {
var self = this, o = this.options;
items = items || [];
if (this._isMounted) {
this.update({items: items});
return;
}
this.options.items = items;
this.stroke(items);
},
resize: function () {
}
});
BI.shortcut("bi.layout", BI.Layout);
/***/ }),
/* 307 */
/***/ (function(module, exports) {
BI.Plugin = BI.Plugin || {};
!(function () {
var _WidgetsPlugin = {};
var _ObjectPlugin = {};
var _ConfigPlugin = {};
var _GlobalWidgetConfigFns = [];
var __GlobalObjectConfigFns = [];
BI.extend(BI.Plugin, {
getWidget: function (type, options) {
if (_GlobalWidgetConfigFns.length > 0) {
var fns = _GlobalWidgetConfigFns.slice(0);
for (var i = fns.length - 1; i >= 0; i--) {
fns[i](type, options);
}
}
var res;
if (_ConfigPlugin[type]) {
for (var i = _ConfigPlugin[type].length - 1; i >= 0; i--) {
if (res = _ConfigPlugin[type][i](options)) {
options = res;
}
}
}
// Deprecated
if (_WidgetsPlugin[type]) {
for (var i = _WidgetsPlugin[type].length - 1; i >= 0; i--) {
if (res = _WidgetsPlugin[type][i](options)) {
return res;
}
}
}
return options;
},
config: function (widgetConfigFn, objectConfigFn) {
_GlobalWidgetConfigFns = _GlobalWidgetConfigFns.concat(_.isArray(widgetConfigFn) ? widgetConfigFn : [widgetConfigFn]);
__GlobalObjectConfigFns = __GlobalObjectConfigFns.concat(_.isArray(objectConfigFn) ? objectConfigFn : [objectConfigFn]);
},
configWidget: function (type, fn) {
if (!_ConfigPlugin[type]) {
_ConfigPlugin[type] = [];
}
_ConfigPlugin[type].push(fn);
},
registerWidget: function (type, fn) {
if (!_WidgetsPlugin[type]) {
_WidgetsPlugin[type] = [];
}
if (_WidgetsPlugin[type].length > 0) {
console.log("组件已经注册过了!");
}
_WidgetsPlugin[type].push(fn);
},
relieveWidget: function (type) {
delete _WidgetsPlugin[type];
},
getObject: function (type, object) {
if (__GlobalObjectConfigFns.length > 0) {
var fns = __GlobalObjectConfigFns.slice(0);
for (var i = fns.length - 1; i >= 0; i--) {
fns[i](type, object);
}
}
if (_ObjectPlugin[type]) {
var res;
for (var i = 0, len = _ObjectPlugin[type].length; i < len; i++) {
if (res = _ObjectPlugin[type][i](object)) {
object = res;
}
}
}
return res || object;
},
registerObject: function (type, fn) {
if (!_ObjectPlugin[type]) {
_ObjectPlugin[type] = [];
}
if (_ObjectPlugin[type].length > 0) {
console.log("对象已经注册过了!");
}
_ObjectPlugin[type].push(fn);
},
relieveObject: function (type) {
delete _ObjectPlugin[type];
}
});
})();
/***/ }),
/* 308 */
/***/ (function(module, exports) {
/**
* guy
* 由一个元素切换到另一个元素的行为
* @class BI.Action
* @extends BI.OB
* @abstract
*/
BI.Action = BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.Action.superclass._defaultConfig.apply(this, arguments), {
src: null,
tar: null
});
},
_init: function () {
BI.Action.superclass._init.apply(this, arguments);
},
actionPerformed: function (src, tar, callback) {
},
actionBack: function (tar, src, callback) {
}
});
BI.ActionFactory = {
createAction: function (key, options) {
var action;
switch (key) {
case "show":
action = BI.ShowAction;
break;
}
return new action(options);
}
};
/***/ }),
/* 309 */
/***/ (function(module, exports) {
/**
* guy
* 由一个元素切换到另一个元素的行为
* @class BI.ShowAction
* @extends BI.Action
*/
BI.ShowAction = BI.inherit(BI.Action, {
_defaultConfig: function () {
return BI.extend(BI.ShowAction.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.ShowAction.superclass._init.apply(this, arguments);
},
actionPerformed: function (src, tar, callback) {
tar = tar || this.options.tar;
tar.setVisible(true);
callback && callback();
},
actionBack: function (tar, src, callback) {
tar = tar || this.options.tar;
tar.setVisible(false);
callback && callback();
}
});
/***/ }),
/* 310 */
/***/ (function(module, exports) {
/**
* guy
*
* @class BI.HighlightBehavior
* @extends BI.Behavior
*/
BI.HighlightBehavior = BI.inherit(BI.Behavior, {
_defaultConfig: function () {
return BI.extend(BI.HighlightBehavior.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.HighlightBehavior.superclass._init.apply(this, arguments);
},
doBehavior: function (items) {
var args = Array.prototype.slice.call(arguments, 1),
o = this.options;
BI.each(items, function (i, item) {
if (item instanceof BI.Single) {
var rule = o.rule(item.getValue(), item);
function doBe (run) {
if (run === true) {
item.doHighLight && item.doHighLight.apply(item, args);
} else {
item.unHighLight && item.unHighLight.apply(item, args);
}
}
if (BI.isFunction(rule)) {
rule(doBe);
} else {
doBe(rule);
}
} else {
item.doBehavior && item.doBehavior.apply(item, args);
}
});
}
});
/***/ }),
/* 311 */
/***/ (function(module, exports) {
/**
* guy
* 标红行为
* @class BI.RedMarkBehavior
* @extends BI.Behavior
*/
BI.RedMarkBehavior = BI.inherit(BI.Behavior, {
_defaultConfig: function () {
return BI.extend(BI.RedMarkBehavior.superclass._defaultConfig.apply(this, arguments), {
});
},
_init: function () {
BI.RedMarkBehavior.superclass._init.apply(this, arguments);
},
doBehavior: function (items) {
var args = Array.prototype.slice.call(arguments, 1),
o = this.options;
BI.each(items, function (i, item) {
if(item instanceof BI.Single) {
if (o.rule(item.getValue(), item)) {
item.doRedMark && item.doRedMark.apply(item, args);
} else {
item.doRedMark && item.unRedMark.apply(item, args);
}
} else {
item.doBehavior && item.doBehavior.apply(item, args);
}
});
}
});
/***/ }),
/* 312 */
/***/ (function(module, exports) {
/**
* guy
* 控制器
* Controller层超类
* @class BI.Controller
* @extends BI.OB
* @abstract
*/
BI.Controller = BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.Controller.superclass._defaultConfig.apply(this, arguments), {
});
},
_init: function () {
BI.Controller.superclass._init.apply(this, arguments);
},
destroy: function () {
}
});
BI.Controller.EVENT_CHANGE = "__EVENT_CHANGE__";
/***/ }),
/* 313 */
/***/ (function(module, exports) {
/**
* 广播
*
* Created by GUY on 2015/12/23.
* @class
*/
BI.BroadcastController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.BroadcastController.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.BroadcastController.superclass._init.apply(this, arguments);
this._broadcasts = {};
},
on: function (name, fn) {
var self = this;
if (!this._broadcasts[name]) {
this._broadcasts[name] = [];
}
this._broadcasts[name].push(fn);
return function () {
self.remove(name, fn);
};
},
send: function (name) {
var args = [].slice.call(arguments, 1);
BI.each(this._broadcasts[name], function (i, fn) {
fn.apply(null, args);
});
},
remove: function (name, fn) {
var self = this;
if (fn) {
BI.remove(this._broadcasts[name], function (idx) {
return self._broadcasts[name].indexOf(fn) === idx;
});
this._broadcasts[name].remove(fn);
if (this._broadcasts[name].length === 0) {
delete this._broadcasts[name];
}
} else {
delete this._broadcasts[name];
}
return this;
}
});
/***/ }),
/* 314 */
/***/ (function(module, exports) {
/**
* 气泡图控制器
* 控制气泡图的显示方向
*
* Created by GUY on 2015/8/21.
* @class
*/
BI.BubblesController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.BubblesController.superclass._defaultConfig.apply(this, arguments), {});
},
_const: {
bubbleHeight: 18
},
_init: function () {
BI.BubblesController.superclass._init.apply(this, arguments);
var self = this;
this.bubblesManager = {};
this.storeBubbles = {};
BI.Resizers.add("bubbleController" + BI.uniqueId(), function () {
BI.each(self.bubblesManager, function (name) {
self.remove(name);
});
self.bubblesManager = {};
self.storeBubbles = {};
});
},
_createBubble: function (direct, text, level, height) {
return BI.createWidget({
type: "bi.bubble",
text: text,
level: level,
height: height || 18,
direction: direct
});
},
_getOffsetLeft: function (name, context, offsetStyle) {
var left = 0;
if ("center" === offsetStyle) {
left = context.element.offset().left + (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
if (left < 0) {
left = 0;
}
return left;
}
if ("right" === offsetStyle) {
left = context.element.offset().left + context.element.bounds().width - this.get(name).element.bounds().width;
if (left < 0) {
left = 0;
}
return left;
}
return context.element.offset().left;
},
_getOffsetTop: function (name, context, offsetStyle) {
var top = 0;
if ("center" === offsetStyle) {
top = context.element.offset().top + (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
if (top < 0) {
top = 0;
}
return top;
} else if ("right" === offsetStyle) {
top = context.element.offset().top + context.element.bounds().height - this.get(name).element.bounds().height;
if (top < 0) {
top = 0;
}
return top;
}
return context.element.offset().top;
},
_getLeftPosition: function (name, context, offsetStyle) {
var position = BI.DOM.getLeftPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
_getBottomPosition: function (name, context, offsetStyle) {
var position = BI.DOM.getBottomPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getTopPosition: function (name, context, offsetStyle) {
var position = BI.DOM.getTopPosition(context, this.get(name));
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getRightPosition: function (name, context, offsetStyle) {
var position = BI.DOM.getRightPosition(context, this.get(name));
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
/**
*
* @param name
* @param text
* @param context
* @param offsetStyle center, left, right三种类型, 默认left
* @returns {BI.BubblesController}
*/
show: function (name, text, context, opt) {
opt || (opt = {});
var container = opt.container || context;
var offsetStyle = opt.offsetStyle || {};
var level = opt.level || "error";
var adjustYOffset = opt.adjustYOffset || 0;
var adjustXOffset = opt.adjustXOffset || 0;
if (!this.storeBubbles[name]) {
this.storeBubbles[name] = {};
}
if (!this.storeBubbles[name]["top"]) {
this.storeBubbles[name]["top"] = this._createBubble("top", text, level);
}
BI.createWidget({
type: "bi.absolute",
element: container,
items: [{
el: this.storeBubbles[name]["top"]
}]
});
this.set(name, this.storeBubbles[name]["top"]);
var position = this._getTopPosition(name, context, offsetStyle);
this.get(name).element.css({left: position.left + adjustXOffset, top: position.top - adjustYOffset});
this.get(name).invisible();
if (!BI.DOM.isTopSpaceEnough(context, this.get(name), adjustYOffset)) {
if (!this.storeBubbles[name]["left"]) {
this.storeBubbles[name]["left"] = this._createBubble("left", text, level, 30);
}
BI.createWidget({
type: "bi.absolute",
element: container,
items: [{
el: this.storeBubbles[name]["left"]
}]
});
this.set(name, this.storeBubbles[name]["left"]);
var position = this._getLeftPosition(name, context, offsetStyle);
this.get(name).element.css({left: position.left - adjustXOffset, top: position.top - adjustYOffset});
this.get(name).invisible();
if (!BI.DOM.isLeftSpaceEnough(context, this.get(name), adjustXOffset)) {
if (!this.storeBubbles[name]["right"]) {
this.storeBubbles[name]["right"] = this._createBubble("right", text, level, 30);
}
BI.createWidget({
type: "bi.absolute",
element: container,
items: [{
el: this.storeBubbles[name]["right"]
}]
});
this.set(name, this.storeBubbles[name]["right"]);
var position = this._getRightPosition(name, context, offsetStyle);
this.get(name).element.css({left: position.left + adjustXOffset, top: position.top - adjustYOffset});
this.get(name).invisible();
if (!BI.DOM.isRightSpaceEnough(context, this.get(name), adjustXOffset)) {
if (!this.storeBubbles[name]["bottom"]) {
this.storeBubbles[name]["bottom"] = this._createBubble("bottom", text, level);
}
BI.createWidget({
type: "bi.absolute",
element: container,
items: [{
el: this.storeBubbles[name]["bottom"]
}]
});
this.set(name, this.storeBubbles[name]["bottom"]);
var position = this._getBottomPosition(name, context, offsetStyle);
this.get(name).element.css({left: position.left + adjustXOffset, top: position.top + adjustYOffset});
this.get(name).invisible();
}
}
}
this.get(name).setText(text);
this.get(name).visible();
return this;
},
hide: function (name) {
if (!this.has(name)) {
return this;
}
this.get(name).invisible();
return this;
},
add: function (name, bubble) {
if (this.has(name)) {
return this;
}
this.set(name, bubble);
return this;
},
get: function (name) {
return this.bubblesManager[name];
},
set: function (name, bubble) {
this.bubblesManager[name] = bubble;
},
has: function (name) {
return this.bubblesManager[name] != null;
},
remove: function (name) {
if (!this.has(name)) {
return this;
}
BI.each(this.storeBubbles[name], function (dir, bubble) {
bubble.destroy();
});
delete this.storeBubbles[name];
delete this.bubblesManager[name];
return this;
}
});
/***/ }),
/* 315 */
/***/ (function(module, exports) {
/**
* 弹出层面板控制器, z-index在10w层级
*
* Created by GUY on 2015/6/24.
* @class
*/
BI.LayerController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.LayerController.superclass._defaultConfig.apply(this, arguments), {
render: "body"
});
},
_init: function () {
BI.LayerController.superclass._init.apply(this, arguments);
this.layerManager = {};
this.layouts = {};
this.zindex = BI.zIndex_layer;
BI.Resizers.add("layerController" + BI.uniqueId(), BI.bind(this._resize, this));
},
_resize: function () {
BI.each(this.layouts, function (i, layer) {
if (layer.element.is(":visible")) {
layer.element.trigger("__resize__");
}
});
},
make: function (name, container, op, context) {
if (BI.isWidget(container)) {
op = op || {};
op.container = container;
} else {
context = op;
op = container;
}
return this.create(name, null, op, context);
},
create: function (name, from, op, context) {
if (this.has(name)) {
return this.get(name);
}
op || (op = {});
var offset = op.offset || {};
var w = from;
if (BI.isWidget(from)) {
w = from.element;
}
if (BI.isNotEmptyString(w)) {
w = BI.Widget._renderEngine.createElement(w);
}
if (this.has(name)) {
return this.get(name);
}
var widget = BI.createWidget((op.render || {}), BI.extend({
type: "bi.layout"
}, op), context);
var layout = BI.createWidget({
type: "bi.absolute",
invisible: true,
items: [{
el: widget,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
}, context);
BI.createWidget({
type: "bi.absolute",
element: op.container || this.options.render,
items: [{
el: layout,
left: offset.left || 0,
right: offset.right || 0,
top: offset.top || 0,
bottom: offset.bottom || 0
}]
});
if (w) {
layout.element.addClass("bi-popup-view");
layout.element.css({
left: w.offset().left + (offset.left || 0),
top: w.offset().top + (offset.top || 0),
width: offset.width || (w.outerWidth() - (offset.left || 0) - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || ""
});
layout.element.on("__resize__", function () {
w.is(":visible") &&
layout.element.css({
left: w.offset().left + (offset.left || 0),
top: w.offset().top + (offset.top || 0),
width: offset.width || (w.outerWidth() - (offset.left || 0) - (offset.right || 0)) || "",
height: offset.height || (w.outerHeight() - (offset.top || 0) - (offset.bottom || 0)) || ""
});
});
}
this.add(name, widget, layout);
return widget;
},
hide: function (name, callback) {
if (!this.has(name)) {
return this;
}
this._getLayout(name).invisible();
this._getLayout(name).element.hide(0, callback);
return this;
},
show: function (name, callback) {
if (!this.has(name)) {
return this;
}
this._getLayout(name).visible();
this._getLayout(name).element.css("z-index", this.zindex++).show(0, callback).trigger("__resize__");
return this;
},
isVisible: function (name) {
return this.has(name) && this._getLayout(name).isVisible();
},
add: function (name, layer, layout) {
if (this.has(name)) {
throw new Error("name is already exist");
}
layout.setVisible(false);
this.layerManager[name] = layer;
this.layouts[name] = layout;
layout.element.css("z-index", this.zindex++);
return this;
},
_getLayout: function (name) {
return this.layouts[name];
},
get: function (name) {
return this.layerManager[name];
},
has: function (name) {
return this.layerManager[name] != null;
},
remove: function (name) {
if (!this.has(name)) {
return this;
}
this.layerManager[name].destroy();
this.layouts[name].destroy();
delete this.layerManager[name];
delete this.layouts[name];
return this;
},
removeAll: function () {
var self = this;
BI.each(BI.keys(this.layerManager), function (index, name) {
self.layerManager[name].destroy();
self.layouts[name].destroy();
});
this.layerManager = {};
this.layouts = {};
return this;
}
});
/***/ }),
/* 316 */
/***/ (function(module, exports) {
/**
* 遮罩面板, z-index在1亿层级
*
* Created by GUY on 2015/6/24.
* @class
*/
BI.MaskersController = BI.inherit(BI.LayerController, {
_defaultConfig: function () {
return BI.extend(BI.MaskersController.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.MaskersController.superclass._init.apply(this, arguments);
this.zindex = BI.zIndex_masker;
}
});
/***/ }),
/* 317 */
/***/ (function(module, exports) {
/**
* guy
* popover弹出层控制器, z-index在100w层级
* @class BI.popoverController
* @extends BI.Controller
*/
BI.PopoverController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.PopoverController.superclass._defaultConfig.apply(this, arguments), {
modal: true, // 模态窗口
render: "body"
});
},
_init: function () {
BI.PopoverController.superclass._init.apply(this, arguments);
this.modal = this.options.modal;
this.floatManager = {};
this.floatLayer = {};
this.floatContainer = {};
this.floatOpened = {};
this.zindex = BI.zIndex_popover;
this.zindexMap = {};
},
_check: function (name) {
return BI.isNotNull(this.floatManager[name]);
},
create: function (name, options, context) {
if (this._check(name)) {
return this;
}
var popover = BI.createWidget(options || {}, {
type: "bi.popover"
}, context);
this.add(name, popover, options, context);
return this;
},
add: function (name, popover, options, context) {
var self = this;
options || (options = {});
if (this._check(name)) {
return this;
}
this.floatContainer[name] = BI.createWidget({
type: "bi.absolute",
cls: "bi-popup-view",
items: [{
el: (this.floatLayer[name] = BI.createWidget({
type: "bi.absolute",
items: [popover]
}, context)),
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.floatManager[name] = popover;
(function (key) {
popover.on(BI.Popover.EVENT_CLOSE, function () {
self.close(key);
});
})(name);
BI.createWidget({
type: "bi.absolute",
element: options.container || this.options.render,
items: [{
el: this.floatContainer[name],
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
return this;
},
open: function (name) {
if (!this._check(name)) {
return this;
}
if (!this.floatOpened[name]) {
this.floatOpened[name] = true;
var container = this.floatContainer[name];
container.element.css("zIndex", this.zindex++);
this.modal && container.element.__hasZIndexMask__(this.zindexMap[name]) && container.element.__releaseZIndexMask__(this.zindexMap[name]);
this.zindexMap[name] = this.zindex;
this.modal && container.element.__buildZIndexMask__(this.zindex++);
this.get(name).setZindex(this.zindex++);
this.floatContainer[name].visible();
var popover = this.get(name);
popover.show && popover.show();
var W = BI.Widget._renderEngine.createElement(this.options.render).width(), H = BI.Widget._renderEngine.createElement(this.options.render).height();
var w = popover.element.width(), h = popover.element.height();
var left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) {
left = 0;
}
if (top < 0) {
top = 0;
}
popover.element.css({
left: left + "px",
top: top + "px"
});
}
return this;
},
close: function (name) {
if (!this._check(name)) {
return this;
}
if (this.floatOpened[name]) {
delete this.floatOpened[name];
this.floatContainer[name].invisible();
this.modal && this.floatContainer[name].element.__releaseZIndexMask__(this.zindexMap[name]);
}
return this;
},
get: function (name) {
return this.floatManager[name];
},
remove: function (name) {
if (!this._check(name)) {
return this;
}
this.floatContainer[name].destroy();
this.modal && this.floatContainer[name].element.__releaseZIndexMask__(this.zindexMap[name]);
delete this.floatManager[name];
delete this.floatLayer[name];
delete this.zindexMap[name];
delete this.floatContainer[name];
delete this.floatOpened[name];
return this;
},
removeAll: function () {
var self = this;
BI.each(this.floatContainer, function (name, container) {
container.destroy();
self.modal && self.floatContainer[name].element.__releaseZIndexMask__(self.zindexMap[name]);
});
this.floatManager = {};
this.floatLayer = {};
this.floatContainer = {};
this.floatOpened = {};
this.zindexMap = {};
return this;
}
});
/***/ }),
/* 318 */
/***/ (function(module, exports) {
/**
* window.resize 控制器
*
* Created by GUY on 2015/6/24.
* @class
*/
BI.ResizeController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.ResizeController.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.ResizeController.superclass._init.apply(this, arguments);
var self = this;
this.resizerManger = {};
var fn = BI.debounce(function (ev) {
// if (BI.isWindow(ev.target)) {
self._resize(ev);
// }
}, 30);
BI.Widget._renderEngine.createElement(_global).resize(fn);
},
_resize: function (ev) {
BI.each(this.resizerManger, function (key, resizer) {
if (resizer instanceof BI.$) {
if (resizer.is(":visible")) {
resizer.trigger("__resize__");
}
return;
}
if (resizer instanceof BI.Layout) {
resizer.resize();
return;
}
if (BI.isFunction(resizer)) {
resizer(ev);
return;
}
});
},
add: function (name, resizer) {
var self = this;
if (this.has(name)) {
return this;
}
this.resizerManger[name] = resizer;
return function () {
self.remove(name);
};
},
get: function (name) {
return this.resizerManger[name];
},
has: function (name) {
return this.resizerManger[name] != null;
},
remove: function (name) {
if (!this.has(name)) {
return this;
}
delete this.resizerManger[name];
return this;
}
});
/***/ }),
/* 319 */
/***/ (function(module, exports) {
/**
* tooltip控制器
* 控制tooltip的显示, 且页面中只有一个tooltip显示
*
* Created by GUY on 2015/9/8.
* @class BI.TooltipsController
* @extends BI.Controller
*/
BI.TooltipsController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.TooltipsController.superclass._defaultConfig.apply(this, arguments), {});
},
_const: {
height: 18
},
_init: function () {
BI.TooltipsController.superclass._init.apply(this, arguments);
this.tooltipsManager = {};
this.showingTips = {};// 存储正在显示的tooltip
},
_createTooltip: function (text, level) {
return BI.createWidget({
type: "bi.tooltip",
text: text,
level: level,
stopEvent: true
});
},
hide: function (name, callback) {
if (!this.has(name)) {
return this;
}
delete this.showingTips[name];
this.get(name).element.hide(0, callback);
this.get(name).invisible();
return this;
},
create: function (name, text, level, context) {
if (!this.has(name)) {
var tooltip = this._createTooltip(text, level);
this.add(name, tooltip);
BI.createWidget({
type: "bi.absolute",
element: context || "body",
items: [{
el: tooltip
}]
});
tooltip.invisible();
}
return this.get(name);
},
// opt: {container: '', belowMouse: false}
show: function (e, name, text, level, context, opt) {
opt || (opt = {});
var self = this;
BI.each(this.showingTips, function (i, tip) {
self.hide(i);
});
this.showingTips = {};
if (!this.has(name)) {
this.create(name, text, level, opt.container || "body");
}
if (!opt.belowMouse) {
var offset = context.element.offset();
var bounds = context.element.bounds();
if (bounds.height === 0 || bounds.width === 0) {
return;
}
var top = offset.top + bounds.height + 5;
}
var tooltip = this.get(name);
tooltip.setText(text);
tooltip.element.css({
left: "0px",
top: "0px"
});
tooltip.visible();
tooltip.element.height(tooltip.element[0].scrollHeight);
this.showingTips[name] = true;
// scale影响要计算在内
// var scale = context.element.offset().left / context.element.get(0).getBoundingClientRect().left;
// var x = (e.pageX || e.clientX) * scale + 15, y = (e.pageY || e.clientY) * scale + 15;
var x = (e.pageX || e.clientX) + 15, y = (e.pageY || e.clientY) + 15;
if (x + tooltip.element.outerWidth() > BI.Widget._renderEngine.createElement("body").outerWidth()) {
x -= tooltip.element.outerWidth() + 15;
}
var bodyHeight = BI.Widget._renderEngine.createElement("body").outerHeight();
if (y + tooltip.element.outerHeight() > bodyHeight || top + tooltip.element.outerHeight() > bodyHeight) {
y -= tooltip.element.outerHeight() + 15;
!opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5));
} else {
!opt.belowMouse && (y = Math.max(y, top));
}
tooltip.element.css({
left: x < 0 ? 0 : x + "px",
top: y < 0 ? 0 : y + "px"
});
tooltip.element.hover(function () {
self.remove(name);
context.element.trigger("mouseleave.title" + context.getName());
});
return this;
},
add: function (name, bubble) {
if (this.has(name)) {
return this;
}
this.set(name, bubble);
return this;
},
get: function (name) {
return this.tooltipsManager[name];
},
set: function (name, bubble) {
this.tooltipsManager[name] = bubble;
},
has: function (name) {
return this.tooltipsManager[name] != null;
},
remove: function (name) {
if (!this.has(name)) {
return this;
}
this.tooltipsManager[name].destroy();
delete this.tooltipsManager[name];
return this;
}
});
/***/ }),
/* 320 */
/***/ (function(module, exports) {
/**
* 事件集合
* @class BI.Events
*/
_.extend(BI, {
Events: {
/**
* @static
* @property keydown事件
*/
KEYDOWN: "_KEYDOWN",
/**
* @static
* @property 回撤事件
*/
BACKSPACE: "_BACKSPACE",
/**
* @static
* @property 空格事件
*/
SPACE: "_SPACE",
/**
* @static
* @property 回车事件
*/
ENTER: "_ENTER",
/**
* @static
* @property 确定事件
*/
CONFIRM: "_CONFIRM",
/**
* @static
* @property 错误事件
*/
ERROR: "_ERROR",
/**
* @static
* @property 暂停事件
*/
PAUSE: "_PAUSE",
/**
* @static
* @property destroy事件
*/
DESTROY: "_DESTROY",
/**
* @static
* @property 挂载事件
*/
MOUNT: "_MOUNT",
/**
* @static
* @property 取消挂载事件
*/
UNMOUNT: "_UNMOUNT",
/**
* @static
* @property 清除选择
*/
CLEAR: "_CLEAR",
/**
* @static
* @property 添加数据
*/
ADD: "_ADD",
/**
* @static
* @property 正在编辑状态事件
*/
EDITING: "_EDITING",
/**
* @static
* @property 空状态事件
*/
EMPTY: "_EMPTY",
/**
* @static
* @property 显示隐藏事件
*/
VIEW: "_VIEW",
/**
* @static
* @property 窗体改变大小
*/
RESIZE: "_RESIZE",
/**
* @static
* @property 编辑前事件
*/
BEFOREEDIT: "_BEFOREEDIT",
/**
* @static
* @property 编辑后事件
*/
AFTEREDIT: "_AFTEREDIT",
/**
* @static
* @property 开始编辑事件
*/
STARTEDIT: "_STARTEDIT",
/**
* @static
* @property 停止编辑事件
*/
STOPEDIT: "_STOPEDIT",
/**
* @static
* @property 值改变事件
*/
CHANGE: "_CHANGE",
/**
* @static
* @property 下拉弹出菜单事件
*/
EXPAND: "_EXPAND",
/**
* @static
* @property 关闭下拉菜单事件
*/
COLLAPSE: "_COLLAPSE",
/**
* @static
* @property 回调事件
*/
CALLBACK: "_CALLBACK",
/**
* @static
* @property 点击事件
*/
CLICK: "_CLICK",
/**
* @static
* @property 状态改变事件,一般是用在复选按钮和单选按钮
*/
STATECHANGE: "_STATECHANGE",
/**
* @static
* @property 状态改变前事件
*/
BEFORESTATECHANGE: "_BEFORESTATECHANGE",
/**
* @static
* @property 初始化事件
*/
INIT: "_INIT",
/**
* @static
* @property 初始化后事件
*/
AFTERINIT: "_AFTERINIT",
/**
* @static
* @property 滚动条滚动事件
*/
SCROLL: "_SCROLL",
/**
* @static
* @property 开始加载事件
*/
STARTLOAD: "_STARTLOAD",
/**
* @static
* @property 加载后事件
*/
AFTERLOAD: "_AFTERLOAD",
/**
* @static
* @property 提交前事件
*/
BS: "beforesubmit",
/**
* @static
* @property 提交后事件
*/
AS: "aftersubmit",
/**
* @static
* @property 提交完成事件
*/
SC: "submitcomplete",
/**
* @static
* @property 提交失败事件
*/
SF: "submitfailure",
/**
* @static
* @property 提交成功事件
*/
SS: "submitsuccess",
/**
* @static
* @property 校验提交前事件
*/
BVW: "beforeverifywrite",
/**
* @static
* @property 校验提交后事件
*/
AVW: "afterverifywrite",
/**
* @static
* @property 校验后事件
*/
AV: "afterverify",
/**
* @static
* @property 填报前事件
*/
BW: "beforewrite",
/**
* @static
* @property 填报后事件
*/
AW: "afterwrite",
/**
* @static
* @property 填报成功事件
*/
WS: "writesuccess",
/**
* @static
* @property 填报失败事件
*/
WF: "writefailure",
/**
* @static
* @property 添加行前事件
*/
BA: "beforeappend",
/**
* @static
* @property 添加行后事件
*/
AA: "afterappend",
/**
* @static
* @property 删除行前事件
*/
BD: "beforedelete",
/**
* @static
* @property 删除行后事件
*/
AD: "beforedelete",
/**
* @static
* @property 未提交离开事件
*/
UC: "unloadcheck",
/**
* @static
* @property PDF导出前事件
*/
BTOPDF: "beforetopdf",
/**
* @static
* @property PDF导出后事件
*/
ATOPDF: "aftertopdf",
/**
* @static
* @property Excel导出前事件
*/
BTOEXCEL: "beforetoexcel",
/**
* @static
* @property Excel导出后事件
*/
ATOEXCEL: "aftertoexcel",
/**
* @static
* @property Word导出前事件
*/
BTOWORD: "beforetoword",
/**
* @static
* @property Word导出后事件
*/
ATOWORD: "aftertoword",
/**
* @static
* @property 图片导出前事件
*/
BTOIMAGE: "beforetoimage",
/**
* @static
* @property 图片导出后事件
*/
ATOIMAGE: "aftertoimage",
/**
* @static
* @property HTML导出前事件
*/
BTOHTML: "beforetohtml",
/**
* @static
* @property HTML导出后事件
*/
ATOHTML: "aftertohtml",
/**
* @static
* @property Excel导入前事件
*/
BIMEXCEL: "beforeimportexcel",
/**
* @static
* @property Excel导出后事件
*/
AIMEXCEL: "afterimportexcel",
/**
* @static
* @property PDF打印前事件
*/
BPDFPRINT: "beforepdfprint",
/**
* @static
* @property PDF打印后事件
*/
APDFPRINT: "afterpdfprint",
/**
* @static
* @property Flash打印前事件
*/
BFLASHPRINT: "beforeflashprint",
/**
* @static
* @property Flash打印后事件
*/
AFLASHPRINT: "afterflashprint",
/**
* @static
* @property Applet打印前事件
*/
BAPPLETPRINT: "beforeappletprint",
/**
* @static
* @property Applet打印后事件
*/
AAPPLETPRINT: "afterappletprint",
/**
* @static
* @property 服务器打印前事件
*/
BSEVERPRINT: "beforeserverprint",
/**
* @static
* @property 服务器打印后事件
*/
ASERVERPRINT: "afterserverprint",
/**
* @static
* @property 邮件发送前事件
*/
BEMAIL: "beforeemail",
/**
* @static
* @property 邮件发送后事件
*/
AEMAIL: "afteremail"
}
});
/***/ }),
/* 321 */
/***/ (function(module, exports) {
BI.prepares.push(function () {
BI.Date = BI.Date || {};
// 牵扯到国际化这些常量在页面加载后再生效
// full day names
BI.Date._DN = [BI.i18nText("BI-Basic_Sunday"),
BI.i18nText("BI-Basic_Monday"),
BI.i18nText("BI-Basic_Tuesday"),
BI.i18nText("BI-Basic_Wednesday"),
BI.i18nText("BI-Basic_Thursday"),
BI.i18nText("BI-Basic_Friday"),
BI.i18nText("BI-Basic_Saturday"),
BI.i18nText("BI-Basic_Sunday")];
// short day names
BI.Date._SDN = [BI.i18nText("BI-Basic_Simple_Sunday"),
BI.i18nText("BI-Basic_Simple_Monday"),
BI.i18nText("BI-Basic_Simple_Tuesday"),
BI.i18nText("BI-Basic_Simple_Wednesday"),
BI.i18nText("BI-Basic_Simple_Thursday"),
BI.i18nText("BI-Basic_Simple_Friday"),
BI.i18nText("BI-Basic_Simple_Saturday"),
BI.i18nText("BI-Basic_Simple_Sunday")];
// Monday first, etc.
BI.Date._FD = 1;
// full month namesdat
BI.Date._MN = [
BI.i18nText("BI-Basic_January"),
BI.i18nText("BI-Basic_February"),
BI.i18nText("BI-Basic_March"),
BI.i18nText("BI-Basic_April"),
BI.i18nText("BI-Basic_May"),
BI.i18nText("BI-Basic_June"),
BI.i18nText("BI-Basic_July"),
BI.i18nText("BI-Basic_August"),
BI.i18nText("BI-Basic_September"),
BI.i18nText("BI-Basic_October"),
BI.i18nText("BI-Basic_November"),
BI.i18nText("BI-Basic_December")];
// short month names
BI.Date._SMN = [0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11];
BI.Date._QN = ["", BI.i18nText("BI-Quarter_1"),
BI.i18nText("BI-Quarter_2"),
BI.i18nText("BI-Quarter_3"),
BI.i18nText("BI-Quarter_4")];
/** Adds the number of days array to the Date object. */
BI.Date._MD = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
// 实际上无论周几作为一周的第一天,周初周末都是在-6-0间做偏移,用一个数组就可以
BI.Date._OFFSET = [0, -1, -2, -3, -4, -5, -6];
});
/***/ }),
/* 322 */
/***/ (function(module, exports) {
/**
* guy
* 检测某个Widget的EventChange事件然后去show某个card
* @type {*|void|Object}
* @class BI.ShowListener
* @extends BI.OB
*/
BI.ShowListener = BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.ShowListener.superclass._defaultConfig.apply(this, arguments), {
eventObj: BI.createWidget(),
cardLayout: null,
cardNameCreator: function (v) {
return v;
},
cardCreator: BI.emptyFn,
afterCardCreated: BI.emptyFn,
afterCardShow: BI.emptyFn
});
},
_init: function () {
BI.ShowListener.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (o.eventObj) {
o.eventObj.on(BI.Controller.EVENT_CHANGE, function (type, v, ob) {
if (type === BI.Events.CLICK) {
v = v || o.eventObj.getValue();
v = BI.isArray(v) ? (v.length > 1 ? v.toString() : v[0]) : v;
if (BI.isNull(v)) {
throw new Error("value cannot be null");
}
var cardName = o.cardNameCreator(v);
if (!o.cardLayout.isCardExisted(cardName)) {
var card = o.cardCreator(cardName);
o.cardLayout.addCardByName(cardName, card);
o.afterCardCreated(cardName);
}
o.cardLayout.showCardByName(cardName);
BI.nextTick(function () {
o.afterCardShow(cardName);
self.fireEvent(BI.ShowListener.EVENT_CHANGE, cardName);
});
}
});
}
}
});
BI.ShowListener.EVENT_CHANGE = "EVENT_CHANGE";
/***/ }),
/* 323 */
/***/ (function(module, exports) {
/**
* style加载管理器
*
* Created by GUY on 2015/9/7.
* @class
*/
BI.StyleLoaderManager = BI.inherit(BI.OB, {
_defaultConfig: function () {
return BI.extend(BI.StyleLoaderManager.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.StyleLoaderManager.superclass._init.apply(this, arguments);
this.stylesManager = {};
},
loadStyle: function (name, styleString) {
if(!_global.document) {
return;
}
var d = document, styles = d.createElement("style");
d.getElementsByTagName("head")[0].appendChild(styles);
styles.setAttribute("type", "text/css");
if (styles.styleSheet) {
styles.styleSheet.cssText = styleString;
} else {
styles.appendChild(document.createTextNode(styleString));
}
this.stylesManager[name] = styles;
return this;
},
get: function (name) {
return this.stylesManager[name];
},
has: function (name) {
return this.stylesManager[name] != null;
},
removeStyle: function (name) {
if (!this.has(name)) {
return this;
}
this.stylesManager[name].parentNode.removeChild(this.stylesManager[name]);
delete this.stylesManager[name];
return this;
}
});
/***/ }),
/* 324 */
/***/ (function(module, exports) {
/**
* @class BI.Logic
* @extends BI.OB
*/
BI.Logic = BI.inherit(BI.OB, {
createLogic: function () {
return this.options || {};
}
});
BI.LogicFactory = {
Type: {
Vertical: "vertical",
Horizontal: "horizontal",
Table: "table",
HorizontalFill: "horizontal_fill"
},
createLogic: function (key, options) {
var logic;
switch (key) {
case BI.LogicFactory.Type.Vertical:
logic = BI.VerticalLayoutLogic;
break;
case BI.LogicFactory.Type.Horizontal:
logic = BI.HorizontalLayoutLogic;
break;
case BI.LogicFactory.Type.Table:
logic = BI.TableLayoutLogic;
break;
case BI.LogicFactory.Type.HorizontalFill:
logic = BI.HorizontalFillLayoutLogic;
break;
default :
logic = BI.Logic;
break;
}
return new logic(options).createLogic();
},
createLogicTypeByDirection: function (direction) {
switch (direction) {
case BI.Direction.Top:
case BI.Direction.Bottom:
case BI.Direction.Custom:
return BI.LogicFactory.Type.Vertical;
break;
case BI.Direction.Left:
case BI.Direction.Right:
return BI.LogicFactory.Type.Horizontal;
}
},
createLogicItemsByDirection: function (direction) {
var layout;
var items = Array.prototype.slice.call(arguments, 1);
items = BI.map(items, function (i, item) {
if (BI.isWidget(item)) {
return {
el: item,
width: item.options.width,
height: item.options.height
};
}
return item;
});
switch (direction) {
case BI.Direction.Bottom:
layout = BI.LogicFactory.Type.Vertical;
items.reverse();
break;
case BI.Direction.Right:
layout = BI.LogicFactory.Type.Horizontal;
items.reverse();
break;
case BI.Direction.Custom:
items = items.slice(1);
break;
}
return items;
}
};
/***/ }),
/* 325 */
/***/ (function(module, exports) {
/**
* guy
* 上下布局逻辑
* 上下布局的时候要考虑到是动态布局还是静态布局
*
* @class BI.VerticalLayoutLogic
* @extends BI.Logic
*/
BI.VerticalLayoutLogic = BI.inherit(BI.Logic, {
_defaultConfig: function () {
return BI.extend(BI.VerticalLayoutLogic.superclass._defaultConfig.apply(this, arguments), {
dynamic: false,
scrollable: null,
scrolly: false,
scrollx: false,
items: [],
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
createLogic: function () {
var layout, o = this.options;
if (o.dynamic) {
layout = "bi.vertical";
} else {
layout = "bi.vtape";
}
return {
type: layout,
scrollable: o.scrollable,
scrolly: o.scrolly,
scrollx: o.scrollx,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
items: o.items
};
},
_init: function () {
BI.VerticalLayoutLogic.superclass._init.apply(this, arguments);
}
});
/**
* guy
* 左右布局逻辑
* 左右布局的时候要考虑到是动态布局还是静态布局
*
* @class BI.HorizontalLayoutLogic
* @extends BI.Logic
*/
BI.HorizontalLayoutLogic = BI.inherit(BI.Logic, {
_defaultConfig: function () {
return BI.extend(BI.HorizontalLayoutLogic.superclass._defaultConfig.apply(this, arguments), {
dynamic: false,
scrollable: null,
scrolly: false,
scrollx: false,
items: [],
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
createLogic: function () {
var layout, o = this.options;
if (o.dynamic) {
layout = "bi.vertical_adapt";
} else {
layout = "bi.htape";
}
return {
type: layout,
scrollable: o.scrollable,
scrolly: o.scrolly,
scrollx: o.scrollx,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
items: o.items
};
},
_init: function () {
BI.HorizontalLayoutLogic.superclass._init.apply(this, arguments);
}
});
/**
* guy
* 表格布局逻辑
* 表格布局的时候要考虑到是动态布局还是静态布局
*
* @class BI.TableLayoutLogic
* @extends BI.OB
*/
BI.TableLayoutLogic = BI.inherit(BI.Logic, {
_defaultConfig: function () {
return BI.extend(BI.TableLayoutLogic.superclass._defaultConfig.apply(this, arguments), {
dynamic: false,
scrollable: null,
scrolly: false,
scrollx: false,
columns: 0,
rows: 0,
columnSize: [],
rowSize: [],
hgap: 0,
vgap: 0,
items: []
});
},
createLogic: function () {
var layout, o = this.options;
if (o.dynamic) {
layout = "bi.table";
} else {
layout = "bi.window";
}
return {
type: layout,
scrollable: o.scrollable,
scrolly: o.scrolly,
scrollx: o.scrollx,
columns: o.columns,
rows: o.rows,
columnSize: o.columnSize,
rowSize: o.rowSize,
hgap: o.hgap,
vgap: o.vgap,
items: o.items
};
},
_init: function () {
BI.TableLayoutLogic.superclass._init.apply(this, arguments);
}
});
/**
* guy
* 左右充满布局逻辑
*
* @class BI.HorizontalFillLayoutLogic
* @extends BI.Logic
*/
BI.HorizontalFillLayoutLogic = BI.inherit(BI.Logic, {
_defaultConfig: function () {
return BI.extend(BI.HorizontalFillLayoutLogic.superclass._defaultConfig.apply(this, arguments), {
dynamic: false,
scrollable: null,
scrolly: false,
scrollx: false,
items: [],
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
createLogic: function () {
var layout, o = this.options;
var columnSize = [];
BI.each(o.items, function (i, item) {
columnSize.push(item.width || 0);
});
if (o.dynamic) {
layout = "bi.horizontal_adapt";
} else {
layout = "bi.htape";
}
return {
type: layout,
columnSize: columnSize,
scrollable: o.scrollable,
scrolly: o.scrolly,
scrollx: o.scrollx,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
items: o.items
};
},
_init: function () {
BI.HorizontalFillLayoutLogic.superclass._init.apply(this, arguments);
}
});
/***/ }),
/* 326 */
/***/ (function(module, exports) {
if (!Number.prototype.toFixed || (0.00008).toFixed(3) !== "0.000" ||
(0.9).toFixed(0) === "0" || (1.255).toFixed(2) !== "1.25" ||
(1000000000000000128).toFixed(0) !== "1000000000000000128") {
(function () {
var base, size, data, i;
base = 1e7;
size = 6;
data = [0, 0, 0, 0, 0, 0];
function multiply (n, c) {
var i = -1;
while (++i < size) {
c += n * data[i];
data[i] = c % base;
c = Math.floor(c / base);
}
}
function divide (n) {
var i = size, c = 0;
while (--i >= 0) {
c += data[i];
data[i] = Math.floor(c / n);
c = (c % n) * base;
}
}
function toString () {
var i = size;
var s = "";
while (--i >= 0) {
if (s !== "" || i === 0 || data[i] !== 0) {
var t = String(data[i]);
if (s === "") {
s = t;
} else {
s += "0000000".slice(0, 7 - t.length) + t;
}
}
}
return s;
}
function pow (x, n, acc) {
return (n === 0 ? acc : (n % 2 === 1 ? pow(x, n - 1, acc * x)
: pow(x * x, n / 2, acc)));
}
function log (x) {
var n = 0;
while (x >= 4096) {
n += 12;
x /= 4096;
}
while (x >= 2) {
n += 1;
x /= 2;
}
return n;
}
Number.prototype.toFixed = function (fractionDigits) {
var f, x, s, m, e, z, j, k;
f = Number(fractionDigits);
f = f !== f ? 0 : Math.floor(f);
if (f < 0 || f > 20) {
throw new RangeError("Number.toFixed called with invalid number of decimals");
}
x = Number(this);
if (x !== x) {
return "NaN";
}
if (x <= -1e21 || x > 1e21) {
return String(x);
}
s = "";
if (x < 0) {
s = "-";
x = -x;
}
m = "0";
if (x > 1e-21) {
// 1e-21<x<1e21
// -70<log2(x)<70
e = log(x * pow(2, 69, 1)) - 69;
z = (e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1));
z *= 0x10000000000000;// Math.pow(2,52);
e = 52 - e;
// -18<e<122
// x=z/2^e
if (e > 0) {
multiply(0, z);
j = f;
while (j >= 7) {
multiply(1e7, 0);
j -= 7;
}
multiply(pow(10, j, 1), 0);
j = e - 1;
while (j >= 23) {
divide(1 << 23);
j -= 23;
}
divide(1 << j);
multiply(1, 1);
divide(2);
m = toString();
} else {
multiply(0, z);
multiply(1 << (-e), 0);
m = toString() + "0.00000000000000000000".slice(2, 2 + f);
}
}
if (f > 0) {
k = m.length;
if (k <= f) {
m = s + "0.0000000000000000000".slice(0, f - k + 2) + m;
} else {
m = s + m.slice(0, k - f) + "." + m.slice(k - f);
}
} else {
m = s + m;
}
return m;
};
})();
}
/***/ }),
/* 327 */
/***/ (function(module, exports) {
BI.version = "2.0";
/***/ }),
/* 328 */
/***/ (function(module, exports) {
/**
* absolute实现的居中布局
* @class BI.AbsoluteCenterLayout
* @extends BI.Layout
*/
BI.AbsoluteCenterLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.AbsoluteCenterLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-absolute-center-layout",
hgap: 0,
lgap: 0,
rgap: 0,
vgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.AbsoluteCenterLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.AbsoluteCenterLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "absolute",
left: o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0),
right: o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0),
top: o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0),
bottom: o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0),
margin: "auto"
});
return w;
},
resize: function () {
// console.log("absolute_center_adapt布局不需要resize");
},
populate: function (items) {
BI.AbsoluteCenterLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.absolute_center_adapt", BI.AbsoluteCenterLayout);
/***/ }),
/* 329 */
/***/ (function(module, exports) {
/**
* absolute实现的居中布局
* @class BI.AbsoluteHorizontalLayout
* @extends BI.Layout
*/
BI.AbsoluteHorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.AbsoluteHorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-absolute-horizontal-layout",
hgap: 0,
lgap: 0,
rgap: 0,
vgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.AbsoluteHorizontalLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.AbsoluteHorizontalLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "absolute",
left: o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0),
right: o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0),
margin: "auto"
});
if (o.vgap + o.tgap + (item.vgap || 0) + (item.tgap || 0) !== 0) {
w.element.css("top", o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0));
}
if (o.vgap + o.bgap + (item.vgap || 0) + (item.bgap || 0) !== 0) {
w.element.css("bottom", o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0));
}
return w;
},
resize: function () {
// console.log("absolute_horizontal_adapt布局不需要resize");
},
populate: function (items) {
BI.AbsoluteHorizontalLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.absolute_horizontal_adapt", BI.AbsoluteHorizontalLayout);
/***/ }),
/* 330 */
/***/ (function(module, exports) {
/**
* absolute实现的居中布局
* @class BI.AbsoluteVerticalLayout
* @extends BI.Layout
*/
BI.AbsoluteVerticalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.AbsoluteVerticalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-absolute-vertical-layout",
hgap: 0,
lgap: 0,
rgap: 0,
vgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.AbsoluteVerticalLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.AbsoluteVerticalLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "absolute",
left: item.lgap,
right: item.rgap,
top: o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0),
bottom: o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0),
margin: "auto"
});
if (o.hgap + o.lgap + (item.hgap || 0) + (item.lgap || 0) !== 0) {
w.element.css("left", o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0));
}
if (o.hgap + o.rgap + (item.hgap || 0) + (item.rgap || 0) !== 0) {
w.element.css("right", o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0));
}
return w;
},
resize: function () {
// console.log("absolute_vertical_adapt布局不需要resize");
},
populate: function (items) {
BI.AbsoluteVerticalLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.absolute_vertical_adapt", BI.AbsoluteVerticalLayout);
/***/ }),
/* 331 */
/***/ (function(module, exports) {
/**
* 自适应水平和垂直方向都居中容器
* @class BI.CenterAdaptLayout
* @extends BI.Layout
*/
BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-adapt-layout",
horizontalAlign: BI.HorizontalAlign.Center,
columnSize: [],
scrollx: false,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
var o = this.options, self = this;
BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
return {
type: "bi.horizontal",
verticalAlign: BI.VerticalAlign.Middle,
horizontalAlign: o.horizontalAlign,
columnSize: o.columnSize,
scrollx: o.scrollx,
items: o.items,
ref: function (_ref) {
self.layout = _ref;
},
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
};
},
resize: function () {
// console.log("center_adapt布局不需要resize");
},
populate: function (items) {
this.layout.populate.apply(this, arguments);
}
});
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);
/***/ }),
/* 332 */
/***/ (function(module, exports) {
/**
* 水平方向居中容器
* @class BI.HorizontalAdaptLayout
* @extends BI.Layout
*/
BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-adapt-layout",
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Center,
columnSize: [],
scrollx: false,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
var self = this, o = this.options;
BI.HorizontalAdaptLayout.superclass.render.apply(this, arguments);
return {
type: "bi.horizontal",
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: o.horizontalAlign,
columnSize: o.columnSize,
items: o.items,
scrollx: o.scrollx,
ref: function (_ref) {
self.layout = _ref;
},
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
};
},
resize: function () {
// console.log("horizontal_adapt布局不需要resize");
},
populate: function (items) {
this.layout.populate.apply(this, arguments);
}
});
BI.shortcut("bi.horizontal_adapt", BI.HorizontalAdaptLayout);
/***/ }),
/* 333 */
/***/ (function(module, exports) {
/**
* 左右分离,垂直方向居中容器
* items:{
left: [{el:{type:"bi.button"}}],
right:[{el:{type:"bi.button"}}]
}
* @class BI.LeftRightVerticalAdaptLayout
* @extends BI.Layout
*/
BI.LeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-left-right-vertical-adapt-layout",
items: {},
llgap: 0,
lrgap: 0,
lhgap: 0,
rlgap: 0,
rrgap: 0,
rhgap: 0
});
},
render: function () {
var o = this.options, self = this;
BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this, arguments);
var layoutArray = [];
if ("left" in o.items) {
layoutArray.push({
type: "bi.left",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.left,
hgap: o.lhgap,
lgap: o.llgap,
rgap: o.lrgap
}
}]
});
}
if ("right" in o.items) {
layoutArray.push({
type: "bi.right",
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items.right,
textAlign: "right",
hgap: o.rhgap,
lgap: o.rlgap,
rgap: o.rrgap
}
}]
});
}
return layoutArray;
},
resize: function () {
// console.log("left_right_vertical_adapt布局不需要resize");
},
addItem: function () {
// do nothing
throw new Error("cannot be added");
},
populate: function (items) {
BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.left_right_vertical_adapt", BI.LeftRightVerticalAdaptLayout);
BI.LeftVerticalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-left-vertical-adapt-layout",
items: [],
lgap: 0,
rgap: 0,
hgap: 0
});
},
render: function () {
var o = this.options, self = this;
BI.LeftVerticalAdaptLayout.superclass.render.apply(this, arguments);
return {
type: "bi.left",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}
}]
};
},
resize: function () {
// console.log("left_vertical_adapt布局不需要resize");
},
addItem: function () {
// do nothing
throw new Error("cannot be added");
},
populate: function (items) {
this.layout.populate.apply(this, arguments);
}
});
BI.shortcut("bi.left_vertical_adapt", BI.LeftVerticalAdaptLayout);
BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.RightVerticalAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-right-vertical-adapt-layout",
items: [],
lgap: 0,
rgap: 0,
hgap: 0
});
},
render: function () {
var o = this.options, self = this;
BI.RightVerticalAdaptLayout.superclass.render.apply(this, arguments);
return {
type: "bi.right",
ref: function (_ref) {
self.layout = _ref;
},
items: [{
el: {
type: "bi.vertical_adapt",
height: "100%",
textAlign: "right",
items: o.items,
lgap: o.lgap,
hgap: o.hgap,
rgap: o.rgap
}
}]
};
},
resize: function () {
},
addItem: function () {
// do nothing
throw new Error("cannot be added");
},
populate: function (items) {
this.layout.populate.apply(this, arguments);
}
});
BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout);
/***/ }),
/* 334 */
/***/ (function(module, exports) {
/**
* 使用display:table和display:table-cell实现的horizontal布局
* @class BI.TableAdaptLayout
* @extends BI.Layout
*/
BI.TableAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.TableAdaptLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-table-center-adapt-layout",
columnSize: [],
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Left,
scrollx: true,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
var o = this.options;
BI.TableAdaptLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<div>").css({
position: "relative",
display: "table",
height: o.verticalAlign === BI.VerticalAlign.Middle ? "100%" : "auto",
width: o.horizontalAlign === BI.HorizontalAlign.Center ? "100%" : "auto",
"white-space": "nowrap"
});
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
width: width,
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.width(width);
}
// 对于表现为td的元素设置最大宽度,有几点需要注意
// 1、由于直接对td设置最大宽度是在规范中未定义的, 所以要使用类似td:firstChild来迂回实现
// 2、不能给多个td设置最大宽度,这样只会平分宽度
// 3、多百分比宽度就算了
td.element.css({"max-width": o.columnSize[i] <= 1 ? width : width + "px"});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
display: "table-cell",
"vertical-align": o.verticalAlign,
margin: "0",
padding: "0",
height: "100%"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$table.append(frag);
this.element.append(this.$table);
},
resize: function () {
// console.log("center_adapt布局不需要resize");
},
populate: function (items) {
BI.TableAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.table_adapt", BI.TableAdaptLayout);
/***/ }),
/* 335 */
/***/ (function(module, exports) {
/**
* 垂直方向居中容器
* @class BI.VerticalAdaptLayout
* @extends BI.Layout
*/
BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
props: {
baseCls: "bi-vertical-adapt-layout",
horizontalAlign: BI.HorizontalAlign.Left,
columnSize: [],
scrollx: false,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
},
render: function () {
var self = this, o = this.options;
BI.VerticalAdaptLayout.superclass.render.apply(this, arguments);
return {
type: "bi.horizontal",
verticalAlign: BI.VerticalAlign.Middle,
horizontalAlign: o.horizontalAlign,
columnSize: o.columnSize,
items: o.items,
scrollx: o.scrollx,
ref: function (_ref) {
self.layout = _ref;
},
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
};
},
resize: function () {
// console.log("vertical_adapt布局不需要resize");
},
populate: function (items) {
this.layout.populate.apply(this, arguments);
}
});
BI.shortcut("bi.vertical_adapt", BI.VerticalAdaptLayout);
/***/ }),
/* 336 */
/***/ (function(module, exports) {
/**
* 水平方向居中自适应容器
* @class BI.HorizontalAutoLayout
* @extends BI.Layout
*/
BI.HorizontalAutoLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalAutoLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizon-auto-layout",
hgap: 0,
lgap: 0,
rgap: 0,
vgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.HorizontalAutoLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.HorizontalAutoLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "relative",
margin: "0px auto"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": (i === 0 ? o.vgap : 0) + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return w;
},
resize: function () {
// console.log("horizontal_adapt布局不需要resize");
},
populate: function (items) {
BI.HorizontalAutoLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.horizontal_auto", BI.HorizontalAutoLayout);
/***/ }),
/* 337 */
/***/ (function(module, exports) {
/**
* 浮动的水平居中布局
*/
BI.FloatHorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FloatHorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-float-horizontal-adapt-layout",
items: [],
hgap: 0,
vgap: 0,
tgap: 0,
bgap: 0,
lgap: 0,
rgap: 0
});
},
render: function () {
BI.FloatHorizontalLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
resize: function () {
// console.log("float_horizontal_adapt布局不需要resize");
},
mounted: function () {
var self = this;
var width = this.left.element.width(),
height = this.left.element.height();
this.left.element.width(width).height(height).css("float", "none");
BI.remove(this._children, function (i, wi) {
if (wi === self.container) {
delete self._children[i];
}
});
BI.createWidget({
type: "bi.horizontal_auto",
element: this,
items: [this.left]
});
},
_addElement: function (i, item) {
var self = this, o = this.options;
this.left = BI.createWidget({
type: "bi.vertical",
items: [item],
hgap: o.hgap,
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
lgap: o.lgap,
rgap: o.rgap
});
this.container = BI.createWidget({
type: "bi.left",
element: this,
items: [this.left]
});
return this.left;
},
populate: function (items) {
BI.HorizontalAutoLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.horizontal_float", BI.FloatHorizontalLayout);
/***/ }),
/* 338 */
/***/ (function(module, exports) {
/**
* 内联布局
* @class BI.InlineCenterAdaptLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.InlineCenterAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.InlineLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-inline-center-adapt-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.InlineCenterAdaptLayout.superclass.render.apply(this, arguments);
this.element.css({
whiteSpace: "nowrap",
textAlign: "center"
});
this.populate(this.options.items);
},
_addElement: function (i, item, length) {
var o = this.options;
var w = BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "relative",
"vertical-align": "middle"
});
w.element.addClass("inline-center-adapt-item");
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return w;
},
resize: function () {
this.stroke(this.options.items);
},
addItem: function (item) {
throw new Error("不能添加元素");
},
stroke: function (items) {
var self = this;
BI.each(items, function (i, item) {
if (item) {
self._addElement(i, item, items.length);
}
});
},
populate: function (items) {
BI.InlineCenterAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.inline_center_adapt", BI.InlineCenterAdaptLayout);
/***/ }),
/* 339 */
/***/ (function(module, exports) {
/**
* 内联布局
* @class BI.InlineVerticalAdaptLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.InlineLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-inline-vertical-adapt-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
textAlign: "left"
});
},
render: function () {
BI.InlineVerticalAdaptLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.element.css({
whiteSpace: "nowrap",
textAlign: o.textAlign
});
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "relative",
"vertical-align": "middle"
});
w.element.addClass("inline-vertical-adapt-item");
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return w;
},
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) {
BI.InlineVerticalAdaptLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.inline_vertical_adapt", BI.InlineVerticalAdaptLayout);
/***/ }),
/* 340 */
/***/ (function(module, exports) {
/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*
* @class BI.FlexCenterLayout
* @extends BI.Layout
*/
BI.FlexCenterLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexCenterLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-flex-center-adapt-layout",
hgap: 0,
vgap: 0
});
},
render: function () {
BI.FlexCenterLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.FlexCenterLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "relative",
"flex-shrink": "0",
"margin-left": (i === 0 ? o.hgap : 0) + "px",
"margin-right": o.hgap + "px",
"margin-top": o.vgap + "px",
"margin-bottom": o.vgap + "px"
});
return w;
},
resize: function () {
// console.log("flex_center_adapt布局不需要resize");
},
populate: function (items) {
BI.FlexCenterLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.flex_center_adapt", BI.FlexCenterLayout);
/***/ }),
/* 341 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2016/12/2.
*
* @class BI.FlexHorizontalCenter
* @extends BI.Layout
*/
BI.FlexHorizontalCenter = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexHorizontalCenter.superclass.props.apply(this, arguments), {
baseCls: "bi-flex-horizontal-center-adapt-layout",
verticalAlign: BI.VerticalAlign.Top,
rowSize: [],
scrolly: false,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.flex_vertical",
ref: function (_ref) {
self.wrapper = _ref;
},
horizontalAlign: BI.HorizontalAlign.Center,
verticalAlign: o.verticalAlign,
rowSize: o.rowSize,
scrollx: o.scrollx,
scrolly: o.scrolly,
scrollable: o.scrollable,
hgap: o.hgap,
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
items: o.items
};
},
resize: function () {
// console.log("flex_vertical_center_adapt布局不需要resize");
},
update: function (opt) {
return this.wrapper.update(opt);
},
populate: function (items) {
this.wrapper.populate(items);
}
});
BI.shortcut("bi.flex_horizontal_adapt", BI.FlexHorizontalCenter);
BI.shortcut("bi.flex_horizontal_center_adapt", BI.FlexHorizontalCenter);
/***/ }),
/* 342 */
/***/ (function(module, exports) {
/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*
* @class BI.FlexHorizontalLayout
* @extends BI.Layout
*/
BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexHorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-flex-horizontal-layout",
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Left,// 如果只有一个子元素且想让该子元素横向撑满,设置成Stretch
columnSize: [],
scrollx: true,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.FlexHorizontalLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.element.addClass("v-" + o.verticalAlign).addClass("h-" + o.horizontalAlign);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.FlexHorizontalLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "relative",
"flex-shrink": "0"
});
if (o.columnSize[i] > 0) {
w.element.width(o.columnSize[i]);
}
if (o.columnSize[i] === "fill") {
w.element.css("flex", "1");
}
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return w;
},
resize: function () {
// console.log("flex_horizontal布局不需要resize");
},
populate: function (items) {
BI.FlexHorizontalLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.flex_horizontal", BI.FlexHorizontalLayout);
/***/ }),
/* 343 */
/***/ (function(module, exports) {
/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*
* @class BI.FlexVerticalCenter
* @extends BI.Layout
*/
BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexVerticalCenter.superclass.props.apply(this, arguments), {
baseCls: "bi-flex-vertical-center-adapt-layout",
horizontalAlign: BI.HorizontalAlign.Left,
columnSize: [],
scrollx: false,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.flex_horizontal",
ref: function (_ref) {
self.wrapper = _ref;
},
verticalAlign: BI.VerticalAlign.Middle,
horizontalAlign: o.horizontalAlign,
columnSize: o.columnSize,
scrollx: o.scrollx,
scrolly: o.scrolly,
scrollable: o.scrollable,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
hgap: o.hgap,
items: o.items
};
},
resize: function () {
// console.log("flex_vertical_center_adapt布局不需要resize");
},
update: function (opt) {
return this.wrapper.update(opt);
},
populate: function (items) {
this.wrapper.populate(items);
}
});
BI.shortcut("bi.flex_vertical_adapt", BI.FlexVerticalCenter);
BI.shortcut("bi.flex_vertical_center_adapt", BI.FlexVerticalCenter);
/***/ }),
/* 344 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2016/12/2.
*
* @class BI.FlexVerticalLayout
* @extends BI.Layout
*/
BI.FlexVerticalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexVerticalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-flex-vertical-layout",
horizontalAlign: BI.HorizontalAlign.Left,
verticalAlign: BI.VerticalAlign.Top,
rowSize: [],
scrolly: true,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.FlexVerticalLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.element.addClass("h-" + o.horizontalAlign).addClass("v-" + o.verticalAlign);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var w = BI.FlexVerticalLayout.superclass._addElement.apply(this, arguments);
var o = this.options;
w.element.css({
position: "relative",
"flex-shrink": "0"
});
if (o.rowSize[i] > 0) {
w.element.height(o.rowSize[i]);
}
if (o.rowSize[i] === "fill") {
w.element.css("flex", "1");
}
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": (i === 0 ? o.vgap : 0) + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return w;
},
resize: function () {
// console.log("flex_vertical布局不需要resize");
},
populate: function (items) {
BI.FlexVerticalLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.flex_vertical", BI.FlexVerticalLayout);
/***/ }),
/* 345 */
/***/ (function(module, exports) {
/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*
* @class BI.FlexWrapperCenterLayout
* @extends BI.Layout
*/
BI.FlexWrapperCenterLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexWrapperCenterLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-flex-scrollable-center-adapt-layout clearfix",
scrollable: true
});
},
render: function () {
BI.FlexWrapperCenterLayout.superclass.render.apply(this, arguments);
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-scrollable-center-adapt-layout-wrapper");
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.FlexWrapperCenterLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "relative",
"margin-left": (i === 0 ? o.hgap : 0) + "px",
"margin-right": o.hgap + "px",
"margin-top": o.vgap + "px",
"margin-bottom": o.vgap + "px"
});
return w;
},
appendFragment: function (frag) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
},
_getWrapper: function () {
return this.$wrapper;
},
resize: function () {
// console.log("flex_center_adapt布局不需要resize");
},
populate: function (items) {
BI.FlexWrapperCenterLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.flex_scrollable_center_adapt", BI.FlexWrapperCenterLayout);
/***/ }),
/* 346 */
/***/ (function(module, exports) {
/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*
* @class BI.FlexVerticalCenter
* @extends BI.Layout
*/
BI.FlexWrapperHorizontalCenter = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexWrapperHorizontalCenter.superclass.props.apply(this, arguments), {
baseCls: "bi-flex-scrollable-vertical-center-adapt-layout clearfix",
verticalAlign: BI.VerticalAlign.Top,
rowSize: [],
scrollable: true,
scrolly: false,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.flex_scrollable_vertical",
ref: function (_ref) {
self.wrapper = _ref;
},
horizontalAlign: BI.HorizontalAlign.Center,
verticalAlign: o.verticalAlign,
rowSize: o.rowSize,
scrollx: o.scrollx,
scrolly: o.scrolly,
scrollable: o.scrollable,
hgap: o.hgap,
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
items: o.items
};
},
update: function (opt) {
return this.wrapper.update(opt);
},
populate: function (items) {
this.wrapper.populate(items);
}
});
BI.shortcut("bi.flex_scrollable_horizontal_adapt", BI.FlexWrapperHorizontalCenter);
BI.shortcut("bi.flex_scrollable_horizontal_center_adapt", BI.FlexWrapperHorizontalCenter);
/***/ }),
/* 347 */
/***/ (function(module, exports) {
/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*
* @class BI.FlexHorizontalLayout
* @extends BI.Layout
*/
BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexWrapperHorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-flex-scrollable-horizontal-layout clearfix",
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Left,
columnSize: [],
scrollable: null,
scrollx: true,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.FlexWrapperHorizontalLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-scrollable-horizontal-layout-wrapper v-" + o.verticalAlign).addClass("h-" + o.horizontalAlign);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.FlexWrapperHorizontalLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "relative",
"flex-shrink": "0"
});
if (o.columnSize[i] > 0) {
w.element.width(o.columnSize[i]);
}
if (o.columnSize[i] === "fill") {
w.element.css("flex", "1");
}
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return w;
},
appendFragment: function (frag) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
},
_getWrapper: function () {
return this.$wrapper;
},
resize: function () {
// console.log("flex_wrapper_horizontal布局不需要resize");
},
populate: function (items) {
BI.FlexWrapperHorizontalLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.flex_scrollable_horizontal", BI.FlexWrapperHorizontalLayout);
/***/ }),
/* 348 */
/***/ (function(module, exports) {
/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*
* @class BI.FlexVerticalCenter
* @extends BI.Layout
*/
BI.FlexWrapperVerticalCenter = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexWrapperVerticalCenter.superclass.props.apply(this, arguments), {
baseCls: "bi-flex-scrollable-vertical-center-adapt-layout clearfix",
horizontalAlign: BI.HorizontalAlign.Left,
columnSize: [],
scrollx: false,
scrollable: true,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.flex_scrollable_horizontal",
ref: function (_ref) {
self.wrapper = _ref;
},
verticalAlign: BI.VerticalAlign.Middle,
horizontalAlign: o.horizontalAlign,
columnSize: o.columnSize,
scrollx: o.scrollx,
scrolly: o.scrolly,
scrollable: o.scrollable,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
items: o.items
};
},
update: function (opt) {
return this.wrapper.update(opt);
},
populate: function (items) {
this.wrapper.populate(items);
}
});
BI.shortcut("bi.flex_scrollable_vertical_adapt", BI.FlexWrapperVerticalCenter);
BI.shortcut("bi.flex_scrollable_vertical_center_adapt", BI.FlexWrapperVerticalCenter);
/***/ }),
/* 349 */
/***/ (function(module, exports) {
/**
*自适应水平和垂直方向都居中容器
* Created by GUY on 2016/12/2.
*
* @class BI.FlexWrapperVerticalLayout
* @extends BI.Layout
*/
BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexWrapperVerticalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-flex-scrollable-vertical-layout clearfix",
horizontalAlign: BI.HorizontalAlign.Left,
verticalAlign: BI.VerticalAlign.Top,
rowSize: [],
scrollable: null,
scrolly: true,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.FlexWrapperVerticalLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$wrapper = BI.Widget._renderEngine.createElement("<div>").addClass("flex-scrollable-vertical-layout-wrapper h-" + o.horizontalAlign).addClass("v-" + o.verticalAlign);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "relative",
"flex-shrink": "0"
});
if (o.rowSize[i] > 0) {
w.element.height(o.rowSize[i]);
}
if (o.rowSize[i] === "fill") {
w.element.css("flex", "1");
}
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": (i === 0 ? o.vgap : 0) + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return w;
},
appendFragment: function (frag) {
this.$wrapper.append(frag);
this.element.append(this.$wrapper);
},
_getWrapper: function () {
return this.$wrapper;
},
resize: function () {
// console.log("flex_wrapper_vertical布局不需要resize");
},
populate: function (items) {
BI.FlexWrapperVerticalLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.flex_scrollable_vertical", BI.FlexWrapperVerticalLayout);
/***/ }),
/* 350 */
/***/ (function(module, exports) {
/**
* 固定子组件上下左右的布局容器
* @class BI.AbsoluteLayout
* @extends BI.Layout
*/
BI.AbsoluteLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.AbsoluteLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-absolute-layout",
hgap: null,
vgap: null,
lgap: null,
rgap: null,
tgap: null,
bgap: null
});
},
render: function () {
BI.AbsoluteLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.AbsoluteLayout.superclass._addElement.apply(this, arguments);
var left = 0, right = 0, top = 0, bottom = 0;
if (BI.isNotNull(item.left)) {
w.element.css({left: item.left});
left += item.left;
}
if (BI.isNotNull(item.right)) {
w.element.css({right: item.right});
right += item.right;
}
if (BI.isNotNull(item.top)) {
w.element.css({top: item.top});
top += item.top;
}
if (BI.isNotNull(item.bottom)) {
w.element.css({bottom: item.bottom});
bottom += item.bottom;
}
if (BI.isNotNull(o.hgap)) {
left += o.hgap;
w.element.css({left: left});
right += o.hgap;
w.element.css({right: right});
}
if (BI.isNotNull(o.vgap)) {
top += o.vgap;
w.element.css({top: top});
bottom += o.vgap;
w.element.css({bottom: bottom});
}
if (BI.isNotNull(o.lgap)) {
left += o.lgap;
w.element.css({left: left});
}
if (BI.isNotNull(o.rgap)) {
right += o.rgap;
w.element.css({right: right});
}
if (BI.isNotNull(o.tgap)) {
top += o.tgap;
w.element.css({top: top});
}
if (BI.isNotNull(o.bgap)) {
bottom += o.bgap;
w.element.css({bottom: bottom});
}
if (BI.isNotNull(item.width)) {
w.element.css({width: item.width});
}
if (BI.isNotNull(item.height)) {
w.element.css({height: item.height});
}
w.element.css({position: "absolute"});
return w;
},
resize: function () {
this.stroke(this.options.items);
},
stroke: function (items) {
this.options.items = items || [];
var self = this;
BI.each(items, function (i, item) {
if (item) {
if (!BI.isWidget(item) && !item.el) {
throw new Error("el must be exist");
}
self._addElement(i, item);
}
});
},
populate: function (items) {
BI.AbsoluteLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.absolute", BI.AbsoluteLayout);
/***/ }),
/* 351 */
/***/ (function(module, exports) {
BI.AdaptiveLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.AdaptiveLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-adaptive-layout",
hgap: null,
vgap: null,
lgap: null,
rgap: null,
tgap: null,
bgap: null
});
},
render: function () {
BI.AdaptiveLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.AdaptiveLayout.superclass._addElement.apply(this, arguments);
w.element.css({position: "relative"});
var left = 0, right = 0, top = 0, bottom = 0;
if (BI.isNotNull(item.left)) {
w.element.css({
left: item.left
});
}
if (BI.isNotNull(item.right)) {
w.element.css({
right: item.right
});
}
if (BI.isNotNull(item.top)) {
w.element.css({
top: item.top
});
}
if (BI.isNotNull(item.bottom)) {
w.element.css({
bottom: item.bottom
});
}
if (BI.isNotNull(o.hgap)) {
left += o.hgap;
w.element.css({"margin-left": left});
right += o.hgap;
w.element.css({"margin-right": right});
}
if (BI.isNotNull(o.vgap)) {
top += o.vgap;
w.element.css({"margin-top": top});
bottom += o.vgap;
w.element.css({"margin-bottom": bottom});
}
if (BI.isNotNull(o.lgap)) {
left += o.lgap;
w.element.css({"margin-left": left});
}
if (BI.isNotNull(o.rgap)) {
right += o.rgap;
w.element.css({"margin-right": right});
}
if (BI.isNotNull(o.tgap)) {
top += o.tgap;
w.element.css({"margin-top": top});
}
if (BI.isNotNull(o.bgap)) {
bottom += o.bgap;
w.element.css({"margin-bottom": bottom});
}
if (BI.isNotNull(item.width)) {
w.element.css({width: item.width});
}
if (BI.isNotNull(item.height)) {
w.element.css({height: item.height});
}
return w;
},
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) {
BI.AbsoluteLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.adaptive", BI.AdaptiveLayout);
/***/ }),
/* 352 */
/***/ (function(module, exports) {
/**
* 上下的高度固定/左右的宽度固定,中间的高度/宽度自适应
*
* @class BI.BorderLayout
* @extends BI.Layout
*/
BI.BorderLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.BorderLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-border-layout",
items: {}
});
},
render: function () {
BI.BorderLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
resize: function () {
this.stroke(this.options.items);
},
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
},
stroke: function (regions) {
var item;
var top = 0;
var bottom = 0;
var left = 0;
var right = 0;
if ("north" in regions) {
item = regions["north"];
if (item != null) {
if (item.el) {
if (!this.hasWidget(this.getName() + "north")) {
var w = BI.createWidget(item);
this.addWidget(this.getName() + "north", w);
}
this.getWidgetByName(this.getName() + "north").element.height(item.height)
.css({
position: "absolute",
top: (item.top || 0),
left: (item.left || 0),
right: (item.right || 0),
bottom: "initial"
});
}
top = (item.height || 0) + (item.top || 0) + (item.bottom || 0);
}
}
if ("south" in regions) {
item = regions["south"];
if (item != null) {
if (item.el) {
if (!this.hasWidget(this.getName() + "south")) {
var w = BI.createWidget(item);
this.addWidget(this.getName() + "south", w);
}
this.getWidgetByName(this.getName() + "south").element.height(item.height)
.css({
position: "absolute",
bottom: (item.bottom || 0),
left: (item.left || 0),
right: (item.right || 0),
top: "initial"
});
}
bottom = (item.height || 0) + (item.top || 0) + (item.bottom || 0);
}
}
if ("west" in regions) {
item = regions["west"];
if (item != null) {
if (item.el) {
if (!this.hasWidget(this.getName() + "west")) {
var w = BI.createWidget(item);
this.addWidget(this.getName() + "west", w);
}
this.getWidgetByName(this.getName() + "west").element.width(item.width)
.css({
position: "absolute",
left: (item.left || 0),
top: top,
bottom: bottom,
right: "initial"
});
}
left = (item.width || 0) + (item.left || 0) + (item.right || 0);
}
}
if ("east" in regions) {
item = regions["east"];
if (item != null) {
if (item.el) {
if (!this.hasWidget(this.getName() + "east")) {
var w = BI.createWidget(item);
this.addWidget(this.getName() + "east", w);
}
this.getWidgetByName(this.getName() + "east").element.width(item.width)
.css({
position: "absolute",
right: (item.right || 0),
top: top,
bottom: bottom,
left: "initial"
});
}
right = (item.width || 0) + (item.left || 0) + (item.right || 0);
}
}
if ("center" in regions) {
item = regions["center"];
if (item != null) {
if (!this.hasWidget(this.getName() + "center")) {
var w = BI.createWidget(item);
this.addWidget(this.getName() + "center", w);
}
this.getWidgetByName(this.getName() + "center").element
.css({position: "absolute", top: top, bottom: bottom, left: left, right: right});
}
}
},
update: function (opt) {
},
populate: function (items) {
BI.BorderLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.border", BI.BorderLayout);
/***/ }),
/* 353 */
/***/ (function(module, exports) {
/**
* 卡片布局,可以做到当前只显示一个组件,其他的都隐藏
* @class BI.CardLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {String} options.defaultShowName 默认展示的子组件名
*/
BI.CardLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.CardLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-card-layout",
items: []
});
},
render: function () {
BI.CardLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
resize: function () {
// console.log("default布局不需要resize");
},
stroke: function (items) {
var self = this, o = this.options;
this.showIndex = void 0;
BI.each(items, function (i, item) {
if (item) {
if (!self.hasWidget(item.cardName)) {
var w = BI.createWidget(item);
w.on(BI.Events.DESTROY, function () {
var index = BI.findIndex(o.items, function (i, tItem) {
return tItem.cardName == item.cardName;
});
if (index > -1) {
o.items.splice(index, 1);
}
});
self.addWidget(item.cardName, w);
} else {
var w = self.getWidgetByName(item.cardName);
}
w.element.css({position: "absolute", top: "0", right: "0", bottom: "0", left: "0"});
w.setVisible(false);
}
});
},
update: function () {
},
empty: function () {
BI.CardLayout.superclass.empty.apply(this, arguments);
this.options.items = [];
},
populate: function (items) {
BI.CardLayout.superclass.populate.apply(this, arguments);
this._mount();
this.options.defaultShowName && this.showCardByName(this.options.defaultShowName);
},
isCardExisted: function (cardName) {
return BI.some(this.options.items, function (i, item) {
return item.cardName == cardName && item.el;
});
},
getCardByName: function (cardName) {
if (!this.isCardExisted(cardName)) {
throw new Error("cardName is not exist");
}
return this._children[cardName];
},
_deleteCardByName: function (cardName) {
delete this._children[cardName];
var index = BI.findIndex(this.options.items, function (i, item) {
return item.cardName == cardName;
});
if (index > -1) {
this.options.items.splice(index, 1);
}
},
deleteCardByName: function (cardName) {
if (!this.isCardExisted(cardName)) {
throw new Error("cardName is not exist");
}
var child = this._children[cardName];
this._deleteCardByName(cardName);
child && child._destroy();
},
addCardByName: function (cardName, cardItem) {
if (this.isCardExisted(cardName)) {
throw new Error("cardName is already exist");
}
var widget = BI.createWidget(cardItem, this);
widget.element.css({
position: "relative",
top: "0",
left: "0",
width: "100%",
height: "100%"
}).appendTo(this.element);
widget.invisible();
this.addWidget(cardName, widget);
this.options.items.push({el: cardItem, cardName: cardName});
return widget;
},
showCardByName: function (name, action, callback) {
var self = this;
// name不存在的时候全部隐藏
var exist = this.isCardExisted(name);
if (this.showIndex != null) {
this.lastShowIndex = this.showIndex;
}
this.showIndex = name;
var flag = false;
BI.each(this.options.items, function (i, item) {
var el = self._children[item.cardName];
if (el) {
if (name != item.cardName) {
// 动画效果只有在全部都隐藏的时候才有意义,且只要执行一次动画操作就够了
!flag && !exist && (BI.Action && action instanceof BI.Action) ? (action.actionBack(el), flag = true) : el.invisible();
} else {
(BI.Action && action instanceof BI.Action) ? action.actionPerformed(void 0, el, callback) : (el.visible(), callback && callback());
}
}
});
},
showLastCard: function () {
var self = this;
this.showIndex = this.lastShowIndex;
BI.each(this.options.items, function (i, item) {
self._children[item.cardName].setVisible(self.showIndex == i);
});
},
setDefaultShowName: function (name) {
this.options.defaultShowName = name;
return this;
},
getDefaultShowName: function () {
return this.options.defaultShowName;
},
getAllCardNames: function () {
return BI.map(this.options.items, function (i, item) {
return item.cardName;
});
},
getShowingCard: function () {
if (!BI.isKey(this.showIndex)) {
return void 0;
}
return this.getWidgetByName(this.showIndex);
},
deleteAllCard: function () {
var self = this;
BI.each(this.getAllCardNames(), function (i, name) {
self.deleteCardByName(name);
});
},
hideAllCard: function () {
var self = this;
BI.each(this.options.items, function (i, item) {
self._children[item.cardName].invisible();
});
},
isAllCardHide: function () {
var self = this;
var flag = true;
BI.some(this.options.items, function (i, item) {
if (self._children[item.cardName].isVisible()) {
flag = false;
return false;
}
});
return flag;
},
removeWidget: function (nameOrWidget) {
var removeName;
if (BI.isWidget(nameOrWidget)) {
BI.each(this._children, function (name, child) {
if (child === nameOrWidget) {
removeName = name;
}
});
} else {
removeName = nameOrWidget;
}
if (removeName) {
this._deleteCardByName(removeName);
}
}
});
BI.shortcut("bi.card", BI.CardLayout);
/***/ }),
/* 354 */
/***/ (function(module, exports) {
/**
* 默认的布局方式
*
* @class BI.DefaultLayout
* @extends BI.Layout
*/
BI.DefaultLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.DefaultLayout.superclass.props.apply(this, arguments), {
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
items: []
});
},
render: function () {
BI.DefaultLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.DefaultLayout.superclass._addElement.apply(this, arguments);
if (o.vgap + o.tgap + (item.tgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) !== 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + "px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + "px"
});
}
return w;
},
resize: function () {
// console.log("default布局不需要resize")
},
populate: function (items) {
BI.DefaultLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.default", BI.DefaultLayout);
/***/ }),
/* 355 */
/***/ (function(module, exports) {
/**
* 分隔容器的控件,按照宽度和高度所占比平分整个容器
*
* @class BI.DivisionLayout
* @extends BI.Layout
*/
BI.DivisionLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.DivisionLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-division-layout",
columns: null,
rows: null,
items: []
// [
// {
// column: 0,
// row: 0,
// width: 0.25,
// height: 0.33,
// el: {type: 'bi.button', text: 'button1'}
// },
// {
// column: 1,
// row: 1,
// width: 0.25,
// height: 0.33,
// el: {type: 'bi.button', text: 'button2'}
// },
// {
// column: 3,
// row: 2,
// width: 0.25,
// height: 0.33,
// el: {type: 'bi.button', text: 'button3'}
// }
// ]
});
},
render: function () {
BI.DivisionLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
resize: function () {
this.stroke(this.opitons.items);
},
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
},
stroke: function (items) {
var o = this.options;
var rows = o.rows || o.items.length, columns = o.columns || ((o.items[0] && o.items[0].length) | 0);
var map = BI.makeArray(rows), widths = {}, heights = {};
function firstElement (item, row, col) {
if (row === 0) {
item.addClass("first-row");
}
if (col === 0) {
item.addClass("first-col");
}
item.addClass(BI.isOdd(row + 1) ? "odd-row" : "even-row");
item.addClass(BI.isOdd(col + 1) ? "odd-col" : "even-col");
item.addClass("center-element");
}
function firstObject (item, row, col) {
var cls = "";
if (row === 0) {
cls += " first-row";
}
if (col === 0) {
cls += " first-col";
}
BI.isOdd(row + 1) ? (cls += " odd-row") : (cls += " even-row");
BI.isOdd(col + 1) ? (cls += " odd-col") : (cls += " even-col");
item.cls = (item.cls || "") + cls + " center-element";
}
function first (item, row, col) {
if (item instanceof BI.Widget) {
firstElement(item.element, row, col);
} else if (item.el instanceof BI.Widget) {
firstElement(item.el.element, row, col);
} else if (item.el) {
firstObject(item.el, row, col);
} else {
firstObject(item, row, col);
}
}
BI.each(map, function (i) {
map[i] = BI.makeArray(columns);
});
BI.each(items, function (i, item) {
if (BI.isArray(item)) {
BI.each(item, function (j, el) {
widths[i] = (widths[i] || 0) + item.width;
heights[j] = (heights[j] || 0) + item.height;
map[i][j] = el;
});
return;
}
widths[item.row] = (widths[item.row] || 0) + item.width;
heights[item.column] = (heights[item.column] || 0) + item.height;
map[item.row][item.column] = item;
});
for (var i = 0; i < rows; i++) {
var totalW = 0;
for (var j = 0; j < columns; j++) {
if (!map[i][j]) {
throw new Error("item be required");
}
if (!this.hasWidget(this.getName() + i + "_" + j)) {
var w = BI.createWidget(map[i][j]);
this.addWidget(this.getName() + i + "_" + j, w);
} else {
w = this.getWidgetByName(this.getName() + i + "_" + j);
}
var left = totalW * 100 / widths[i];
w.element.css({position: "absolute", left: left + "%"});
if (j > 0) {
var lastW = this.getWidgetByName(this.getName() + i + "_" + (j - 1));
lastW.element.css({right: (100 - left) + "%"});
}
if (j == o.columns - 1) {
w.element.css({right: "0%"});
}
first(w, i, j);
totalW += map[i][j].width;
}
}
for (var j = 0; j < o.columns; j++) {
var totalH = 0;
for (var i = 0; i < o.rows; i++) {
var w = this.getWidgetByName(this.getName() + i + "_" + j);
var top = totalH * 100 / heights[j];
w.element.css({top: top + "%"});
if (i > 0) {
var lastW = this.getWidgetByName(this.getName() + (i - 1) + "_" + j);
lastW.element.css({bottom: (100 - top) + "%"});
}
if (i == o.rows - 1) {
w.element.css({bottom: "0%"});
}
totalH += map[i][j].height;
}
}
},
update: function () {
},
populate: function (items) {
BI.DivisionLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.division", BI.DivisionLayout);
/***/ }),
/* 356 */
/***/ (function(module, exports) {
/**
* 靠左对齐的自由浮动布局
* @class BI.FloatLeftLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.FloatLeftLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FloatLeftLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-float-left-layout clearfix",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.FloatLeftLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.FloatLeftLayout.superclass._addElement.apply(this, arguments);
w.element.css({position: "relative", float: "left"});
if (BI.isNotNull(item.left)) {
w.element.css({left: item.left});
}
if (BI.isNotNull(item.right)) {
w.element.css({right: item.right});
}
if (BI.isNotNull(item.top)) {
w.element.css({top: item.top});
}
if (BI.isNotNull(item.bottom)) {
w.element.css({bottom: item.bottom});
}
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return w;
},
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) {
BI.FloatLeftLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.left", BI.FloatLeftLayout);
/**
* 靠右对齐的自由浮动布局
* @class BI.FloatRightLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.FloatRightLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FloatRightLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-float-right-layout clearfix",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.FloatRightLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.FloatRightLayout.superclass._addElement.apply(this, arguments);
w.element.css({position: "relative", float: "right"});
if (BI.isNotNull(item.left)) {
w.element.css({left: item.left});
}
if (BI.isNotNull(item.right)) {
w.element.css({right: item.right});
}
if (BI.isNotNull(item.top)) {
w.element.css({top: item.top});
}
if (BI.isNotNull(item.bottom)) {
w.element.css({bottom: item.bottom});
}
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": (i === 0 ? o.hgap : 0) + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return w;
},
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) {
BI.FloatRightLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.right", BI.FloatRightLayout);
/***/ }),
/* 357 */
/***/ (function(module, exports) {
/**
* 上下的高度固定/左右的宽度固定,中间的高度/宽度自适应
*
* @class BI.BorderLayout
* @extends BI.Layout
*/
BI.GridLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.GridLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-grid-layout",
columns: null,
rows: null,
items: []
/* [
{
column: 0,
row: 0,
el: {type: 'bi.button', text: 'button1'}
},
{
column: 1,
row: 1,
el: {type: 'bi.button', text: 'button2'}
},
{
column: 3,
row: 2,
el: {type: 'bi.button', text: 'button3'}
}
]*/
});
},
render: function () {
BI.GridLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
resize: function () {
// console.log("grid布局不需要resize")
},
addItem: function () {
// do nothing
throw new Error("cannot be added");
},
stroke: function (items) {
var self = this, o = this.options;
var rows = o.rows || o.items.length, columns = o.columns || ((o.items[0] && o.items[0].length) | 0);
var width = 100 / columns, height = 100 / rows;
var els = [];
for (var i = 0; i < rows; i++) {
els[i] = [];
}
function firstElement (item, row, col) {
if (row === 0) {
item.addClass("first-row");
}
if (col === 0) {
item.addClass("first-col");
}
item.addClass(BI.isOdd(row + 1) ? "odd-row" : "even-row");
item.addClass(BI.isOdd(col + 1) ? "odd-col" : "even-col");
item.addClass("center-element");
}
function firstObject (item, row, col) {
var cls = "";
if (row === 0) {
cls += " first-row";
}
if (col === 0) {
cls += " first-col";
}
BI.isOdd(row + 1) ? (cls += " odd-row") : (cls += " even-row");
BI.isOdd(col + 1) ? (cls += " odd-col") : (cls += " even-col");
item.cls = (item.cls || "") + cls + " center-element";
}
function first (item, row, col) {
if (item instanceof BI.Widget) {
firstElement(item.element, row, col);
} else if (item.el instanceof BI.Widget) {
firstElement(item.el.element, row, col);
} else if (item.el) {
firstObject(item.el, row, col);
} else {
firstObject(item, row, col);
}
}
BI.each(items, function (i, item) {
if (BI.isArray(item)) {
BI.each(item, function (j, el) {
els[i][j] = BI.createWidget(el);
});
return;
}
els[item.row][item.column] = BI.createWidget(item);
});
for (var i = 0; i < rows; i++) {
for (var j = 0; j < columns; j++) {
if (!els[i][j]) {
els[i][j] = BI.createWidget({
type: "bi.layout"
});
}
first(els[i][j], i, j);
els[i][j].element.css({
position: "absolute",
top: height * i + "%",
left: width * j + "%",
right: (100 - (width * (j + 1))) + "%",
bottom: (100 - (height * (i + 1))) + "%"
});
this.addWidget(els[i][j]);
}
}
},
update: function () {
},
populate: function (items) {
BI.GridLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.grid", BI.GridLayout);
/***/ }),
/* 358 */
/***/ (function(module, exports) {
/**
* 水平布局
* @class BI.HorizontalLayout
* @extends BI.Layout
*/
BI.HorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-layout",
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Left,
columnSize: [],
scrollx: true,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
var o = this.options;
BI.HorizontalLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
"white-space": "nowrap",
height: o.verticalAlign === BI.VerticalAlign.Middle ? "100%" : "auto",
width: (o.horizontalAlign === BI.HorizontalAlign.Center || o.horizontalAlign === BI.HorizontalAlign.Stretch) ? "100%" : "auto",
"border-spacing": "0px",
border: "none",
"border-collapse": "separate"
});
this.$tr = BI.Widget._renderEngine.createElement("<tr>");
this.$tr.appendTo(this.$table);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var td;
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i];
if (!this.hasWidget(this._getChildName(i))) {
var w = BI.createWidget(item);
w.element.css({position: "relative", margin: "0px auto"});
td = BI.createWidget({
type: "bi.default",
tagName: "td",
attributes: {
width: width
},
items: [w]
});
this.addWidget(this._getChildName(i), td);
} else {
td = this.getWidgetByName(this._getChildName(i));
td.element.attr("width", width);
}
// 对于表现为td的元素设置最大宽度,有几点需要注意
// 1、由于直接对td设置最大宽度是在规范中未定义的, 所以要使用类似td:firstChild来迂回实现
// 2、不能给多个td设置最大宽度,这样只会平分宽度
// 3、多百分比宽度就算了
td.element.css({"max-width": o.columnSize[i] <= 1 ? width : width + "px"});
if (i === 0) {
td.element.addClass("first-element");
}
td.element.css({
position: "relative",
"vertical-align": o.verticalAlign,
margin: "0",
padding: "0",
border: "none"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return td;
},
appendFragment: function (frag) {
this.$tr.append(frag);
this.element.append(this.$table);
},
resize: function () {
// console.log("horizontal layout do not need to resize");
},
_getWrapper: function () {
return this.$tr;
},
populate: function (items) {
BI.HorizontalLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.horizontal", BI.HorizontalLayout);
/**
* 水平布局
* @class BI.HorizontalCellLayout
* @extends BI.Layout
*/
BI.HorizontalCellLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalCellLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-cell-layout",
scrollable: true,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.HorizontalCellLayout.superclass.render.apply(this, arguments);
this.element.css({display: "table", "vertical-align": "top"});
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.HorizontalCellLayout.superclass._addElement.apply(this, arguments);
w.element.css({position: "relative", display: "table-cell", "vertical-align": "middle"});
if (o.hgap + o.lgap > 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + "px"
});
}
if (o.hgap + o.rgap > 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + "px"
});
}
if (o.vgap + o.tgap > 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + "px"
});
}
if (o.vgap + o.bgap > 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + "px"
});
}
return w;
},
resize: function () {
// console.log("horizontal do not need to resize");
},
populate: function (items) {
BI.HorizontalCellLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.horizontal_cell", BI.HorizontalCellLayout);
/***/ }),
/* 359 */
/***/ (function(module, exports) {
/**
* 内联布局
* @class BI.InlineLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.InlineLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.InlineLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-inline-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.InlineLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.InlineLayout.superclass._addElement.apply(this, arguments);
w.element.css({"position": "relative", display: "inline-block", "*display": "inline", "*zoom": 1});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return w;
},
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) {
BI.InlineLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.inline", BI.InlineLayout);
/***/ }),
/* 360 */
/***/ (function(module, exports) {
/**
* 靠左对齐的自由浮动布局
* @class BI.LatticeLayout
* @extends BI.Layout
*
* @cfg {JSON} options 配置属性
* @cfg {Number} [hgap=0] 水平间隙
* @cfg {Number} [vgap=0] 垂直间隙
*/
BI.LatticeLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.LatticeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-lattice-layout clearfix"
// columnSize: [0.2, 0.2, 0.6],
});
},
render: function () {
BI.LatticeLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.LatticeLayout.superclass._addElement.apply(this, arguments);
if (o.columnSize && o.columnSize[i]) {
var width = o.columnSize[i] / BI.sum(o.columnSize) * 100 + "%";
} else {
var width = 1 / this.options.items.length * 100 + "%";
}
w.element.css({position: "relative", float: "left", width: width});
return w;
},
addItem: function (item) {
var w = BI.LatticeLayout.superclass.addItem.apply(this, arguments);
this.resize();
return w;
},
addItemAt: function (item) {
var w = BI.LatticeLayout.superclass.addItemAt.apply(this, arguments);
this.resize();
return w;
},
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) {
BI.LatticeLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.lattice", BI.LatticeLayout);
/***/ }),
/* 361 */
/***/ (function(module, exports) {
/**
* 上下的高度固定/左右的宽度固定,中间的高度/宽度自适应
*
* @class BI.TableLayout
* @extends BI.Layout
*/
BI.TableLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.TableLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-table-layout",
scrolly: true,
columnSize: [200, 200, "fill"],
rowSize: 30, // or [30,30,30]
hgap: 0,
vgap: 0,
items: [[
{
el: {text: "label1"}
},
{
el: {text: "label2"}
},
{
el: {text: "label3"}
}
]]
});
},
render: function () {
BI.TableLayout.superclass.render.apply(this, arguments);
this.rows = 0;
this.populate(this.options.items);
},
_addElement: function (idx, arr) {
var o = this.options;
var abs = [], left = 0, right = 0, i, j;
function firstElement (item, row, col) {
if (row === 0) {
item.addClass("first-row");
}
if (col === 0) {
item.addClass("first-col");
}
item.addClass(BI.isOdd(row + 1) ? "odd-row" : "even-row");
item.addClass(BI.isOdd(col + 1) ? "odd-col" : "even-col");
item.addClass("center-element");
}
function firstObject (item, row, col) {
var cls = "";
if (row === 0) {
cls += " first-row";
}
if (col === 0) {
cls += " first-col";
}
BI.isOdd(row + 1) ? (cls += " odd-row") : (cls += " even-row");
BI.isOdd(col + 1) ? (cls += " odd-col") : (cls += " even-col");
item.cls = (item.cls || "") + cls + " center-element";
}
function first (item, row, col) {
if (item instanceof BI.Widget) {
firstElement(item.element, row, col);
} else if (item.el instanceof BI.Widget) {
firstElement(item.el.element, row, col);
} else if (item.el) {
firstObject(item.el, row, col);
} else {
firstObject(item, row, col);
}
}
for (i = 0; i < arr.length; i++) {
if (BI.isNumber(o.columnSize[i])) {
first(arr[i], this.rows, i);
abs.push(BI.extend({
top: 0,
bottom: 0,
left: o.columnSize[i] <= 1 ? left * 100 + "%" : left,
width: o.columnSize[i] <= 1 ? o.columnSize[i] * 100 + "%" : o.columnSize[i]
}, arr[i]));
left += o.columnSize[i] + (o.columnSize[i] < 1 ? 0 : o.hgap);
} else {
break;
}
}
for (j = arr.length - 1; j > i; j--) {
if (BI.isNumber(o.columnSize[j])) {
first(arr[j], this.rows, j);
abs.push(BI.extend({
top: 0,
bottom: 0,
right: o.columnSize[j] <= 1 ? right * 100 + "%" : right,
width: o.columnSize[j] <= 1 ? o.columnSize[j] * 100 + "%" : o.columnSize[j]
}, arr[j]));
right += o.columnSize[j] + (o.columnSize[j] < 1 ? 0 : o.hgap);
} else {
throw new Error("item with fill can only be one");
}
}
if (i >= 0 && i < arr.length) {
first(arr[i], this.rows, i);
abs.push(BI.extend({
top: 0,
bottom: 0,
left: left <= 1 ? left * 100 + "%" : left,
right: right <= 1 ? right * 100 + "%" : right
}, arr[i]));
}
var w = BI.createWidget({
type: "bi.absolute",
height: BI.isArray(o.rowSize) ? o.rowSize[this.rows] : o.rowSize,
items: abs
});
if (this.rows > 0) {
this.getWidgetByName(this.getName() + (this.rows - 1)).element.css({
"margin-bottom": o.vgap
});
}
w.element.css({
position: "relative"
});
this.addWidget(this.getName() + (this.rows++), w);
return w;
},
resize: function () {
// console.log("table布局不需要resize");
},
addItem: function (arr) {
if (!BI.isArray(arr)) {
throw new Error("item must be array");
}
return BI.TableLayout.superclass.addItem.apply(this, arguments);
},
update: function () {
},
populate: function (items) {
BI.TableLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.table", BI.TableLayout);
/***/ }),
/* 362 */
/***/ (function(module, exports) {
/**
* 水平tape布局
* @class BI.HTapeLayout
* @extends BI.Layout
*/
BI.HTapeLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HTapeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-h-tape-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
items: [
{
width: 100,
el: {type: "bi.button", text: "button1"}
},
{
width: "fill",
el: {type: "bi.button", text: "button2"}
},
{
width: 200,
el: {type: "bi.button", text: "button3"}
}
]
});
},
render: function () {
BI.HTapeLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
resize: function () {
this.stroke(this.options.items);
},
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
},
stroke: function (items) {
var self = this, o = this.options;
items = BI.compact(items);
BI.each(items, function (i, item) {
if (!self.hasWidget(self.getName() + i + "")) {
var w = BI.createWidget(item);
self.addWidget(self.getName() + i + "", w);
} else {
w = self.getWidgetByName(self.getName() + i + "");
}
w.element.css({position: "absolute", top: (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap + "px", bottom: (item.bgap || 0) + (item.vgap || 0) + o.vgap + o.bgap + "px"});
});
var left = {}, right = {};
left[0] = 0;
right[items.length - 1] = 0;
BI.any(items, function (i, item) {
var w = self.getWidgetByName(self.getName() + i + "");
if (BI.isNull(left[i])) {
left[i] = left[i - 1] + items[i - 1].width + (items[i - 1].lgap || 0) + 2 * (items[i - 1].hgap || 0) + o.hgap + o.lgap + o.rgap;
}
if (item.width < 1 && item.width >= 0) {
w.element.css({left: left[i] * 100 + "%", width: item.width * 100 + "%"});
} else {
w.element.css({
left: left[i] + (item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap + "px",
width: BI.isNumber(item.width) ? item.width : ""
});
}
if (!BI.isNumber(item.width)) {
return true;
}
});
BI.backAny(items, function (i, item) {
var w = self.getWidgetByName(self.getName() + i + "");
if (BI.isNull(right[i])) {
right[i] = right[i + 1] + items[i + 1].width + (items[i + 1].rgap || 0) + 2 * (items[i + 1].hgap || 0) + o.hgap + o.lgap + o.rgap;
}
if (item.width < 1 && item.width >= 0) {
w.element.css({right: right[i] * 100 + "%", width: item.width * 100 + "%"});
} else {
w.element.css({
right: right[i] + (item.rgap || 0) + (item.hgap || 0) + o.hgap + o.rgap + "px",
width: BI.isNumber(item.width) ? item.width : ""
});
}
if (!BI.isNumber(item.width)) {
return true;
}
});
},
update: function () {
var updated;
BI.each(this._children, function (i, child) {
updated = child.update() || updated;
});
return updated;
},
populate: function (items) {
BI.HTapeLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.htape", BI.HTapeLayout);
/**
* 垂直tape布局
* @class BI.VTapeLayout
* @extends BI.Layout
*/
BI.VTapeLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.VTapeLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-v-tape-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
items: [
{
height: 100,
el: {type: "bi.button", text: "button1"}
},
{
height: "fill",
el: {type: "bi.button", text: "button2"}
},
{
height: 200,
el: {type: "bi.button", text: "button3"}
}
]
});
},
render: function () {
BI.VTapeLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
resize: function () {
this.stroke(this.options.items);
},
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
},
stroke: function (items) {
var self = this, o = this.options;
items = BI.compact(items);
BI.each(items, function (i, item) {
if (!self.hasWidget(self.getName() + i + "")) {
var w = BI.createWidget(item);
self.addWidget(self.getName() + i + "", w);
} else {
w = self.getWidgetByName(self.getName() + i + "");
}
w.element.css({position: "absolute", left: (item.lgap || 0) + (item.hgap || 0) + o.hgap + o.lgap + "px", right: + (item.hgap || 0) + (item.rgap || 0) + o.hgap + o.rgap + "px"});
});
var top = {}, bottom = {};
top[0] = 0;
bottom[items.length - 1] = 0;
BI.any(items, function (i, item) {
var w = self.getWidgetByName(self.getName() + i + "");
if (BI.isNull(top[i])) {
top[i] = top[i - 1] + items[i - 1].height + (items[i - 1].tgap || 0) + 2 * (items[i - 1].vgap || 0) + o.vgap + o.tgap + o.bgap;
}
if (item.height < 1 && item.height >= 0) {
w.element.css({top: top[i] * 100 + "%", height: item.height * 100 + "%"});
} else {
w.element.css({
top: top[i] + (item.vgap || 0) + (item.tgap || 0) + o.vgap + o.tgap + "px",
height: BI.isNumber(item.height) ? item.height : ""
});
}
if (!BI.isNumber(item.height)) {
return true;
}
});
BI.backAny(items, function (i, item) {
var w = self.getWidgetByName(self.getName() + i + "");
if (BI.isNull(bottom[i])) {
bottom[i] = bottom[i + 1] + items[i + 1].height + (items[i + 1].bgap || 0) + 2 * (items[i + 1].vgap || 0) + o.vgap + o.tgap + o.bgap;
}
if (item.height < 1 && item.height >= 0) {
w.element.css({bottom: bottom[i] * 100 + "%", height: item.height * 100 + "%"});
} else {
w.element.css({
bottom: bottom[i] + (item.vgap || 0) + (item.bgap || 0) + o.vgap + o.bgap + "px",
height: BI.isNumber(item.height) ? item.height : ""
});
}
if (!BI.isNumber(item.height)) {
return true;
}
});
},
update: function () {
},
populate: function (items) {
BI.VTapeLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.vtape", BI.VTapeLayout);
/***/ }),
/* 363 */
/***/ (function(module, exports) {
/**
* td布局
* @class BI.TdLayout
* @extends BI.Layout
*/
BI.TdLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.TdLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-td-layout",
columnSize: [200, 200, 200],
hgap: 0,
vgap: 0,
items: [[
{
el: {text: "label1"}
},
{
el: {text: "label2"}
},
{
el: {text: "label3"}
}
]]
});
},
render: function () {
BI.TdLayout.superclass.render.apply(this, arguments);
this.$table = BI.Widget._renderEngine.createElement("<table>").attr({cellspacing: 0, cellpadding: 0}).css({
position: "relative",
width: "100%",
height: "100%",
"border-spacing": "0px",
border: "none",
"border-collapse": "separate"
});
this.rows = 0;
this.populate(this.options.items);
},
_addElement: function (idx, arr) {
var o = this.options;
function firstElement (item, row, col) {
if (row === 0) {
item.addClass("first-row");
}
if (col === 0) {
item.addClass("first-col");
}
item.addClass(BI.isOdd(row + 1) ? "odd-row" : "even-row");
item.addClass(BI.isOdd(col + 1) ? "odd-col" : "even-col");
item.addClass("center-element");
}
function firstObject (item, row, col) {
var cls = "";
if (row === 0) {
cls += " first-row";
}
if (col === 0) {
cls += " first-col";
}
BI.isOdd(row + 1) ? (cls += " odd-row") : (cls += " even-row");
BI.isOdd(col + 1) ? (cls += " odd-col") : (cls += " even-col");
item.cls = (item.cls || "") + cls + " center-element";
}
function first (item, row, col) {
if (item instanceof BI.Widget) {
firstElement(item.element, row, col);
} else if (item.el instanceof BI.Widget) {
firstElement(item.el.element, row, col);
} else if (item.el) {
firstObject(item.el, row, col);
} else {
firstObject(item, row, col);
}
}
var tr = BI.createWidget({
type: "bi.default",
tagName: "tr"
});
for (var i = 0; i < arr.length; i++) {
var w = BI.createWidget(arr[i]);
w.element.css({position: "relative", top: "0", left: "0", margin: "0px auto"});
if (arr[i].lgap) {
w.element.css({"margin-left": arr[i].lgap + "px"});
}
if (arr[i].rgap) {
w.element.css({"margin-right": arr[i].rgap + "px"});
}
if (arr[i].tgap) {
w.element.css({"margin-top": arr[i].tgap + "px"});
}
if (arr[i].bgap) {
w.element.css({"margin-bottom": arr[i].bgap + "px"});
}
first(w, this.rows++, i);
var td = BI.createWidget({
type: "bi.default",
attributes: {
width: o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]
},
tagName: "td",
items: [w]
});
td.element.css({
position: "relative",
"vertical-align": "middle",
margin: "0",
padding: "0",
border: "none"
});
tr.addItem(td);
}
this.addWidget(this.getName() + idx, tr);
return tr;
},
appendFragment: function (frag) {
this.$table.append(frag);
this.element.append(this.$table);
},
resize: function () {
// console.log("td布局不需要resize");
},
addItem: function (arr) {
if (!BI.isArray(arr)) {
throw new Error("item must be array");
}
return BI.TdLayout.superclass.addItem.apply(this, arguments);
},
update: function () {
},
populate: function (items) {
BI.TdLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.td", BI.TdLayout);
/***/ }),
/* 364 */
/***/ (function(module, exports) {
/**
* 垂直布局
* @class BI.VerticalLayout
* @extends BI.Layout
*/
BI.VerticalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.VerticalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-vertical-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
scrolly: true
});
},
render: function () {
BI.VerticalLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.VerticalLayout.superclass._addElement.apply(this, arguments);
w.element.css({
position: "relative"
});
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": (i === 0 ? o.vgap : 0) + o.tgap + (item.tgap || 0) + (item.vgap || 0) + "px"
});
}
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-left": o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px"
});
}
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) {
w.element.css({
"margin-right": o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) + "px"
});
}
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-bottom": o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) + "px"
});
}
return w;
},
resize: function () {
this.stroke(this.options.items);
},
populate: function (items) {
BI.VerticalLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.vertical", BI.VerticalLayout);
/***/ }),
/* 365 */
/***/ (function(module, exports) {
/**
*
* @class BI.WindowLayout
* @extends BI.Layout
*/
BI.WindowLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.WindowLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-window-layout",
columns: 3,
rows: 2,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
columnSize: [100, "fill", 200],
rowSize: [100, "fill"],
items: [[
{
el: {type: "bi.button", text: "button1"}
},
{
el: {type: "bi.button", text: "button2"}
},
{
el: {type: "bi.button", text: "button3"}
}
]]
});
},
render: function () {
BI.WindowLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items);
},
resize: function () {
this.stroke(this.options.items);
},
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
},
stroke: function (items) {
var o = this.options;
if (BI.isNumber(o.rowSize)) {
o.rowSize = BI.makeArray(o.items.length, 1 / o.items.length);
}
if (BI.isNumber(o.columnSize)) {
o.columnSize = BI.makeArray(o.items[0].length, 1 / o.items[0].length);
}
function firstElement (item, row, col) {
if (row === 0) {
item.addClass("first-row");
}
if (col === 0) {
item.addClass("first-col");
}
item.addClass(BI.isOdd(row + 1) ? "odd-row" : "even-row");
item.addClass(BI.isOdd(col + 1) ? "odd-col" : "even-col");
item.addClass("center-element");
}
function firstObject (item, row, col) {
var cls = "";
if (row === 0) {
cls += " first-row";
}
if (col === 0) {
cls += " first-col";
}
BI.isOdd(row + 1) ? (cls += " odd-row") : (cls += " even-row");
BI.isOdd(col + 1) ? (cls += " odd-col") : (cls += " even-col");
item.cls = (item.cls || "") + cls + " center-element";
}
function first (item, row, col) {
if (item instanceof BI.Widget) {
firstElement(item.element, row, col);
} else if (item.el instanceof BI.Widget) {
firstElement(item.el.element, row, col);
} else if (item.el) {
firstObject(item.el, row, col);
} else {
firstObject(item, row, col);
}
}
for (var i = 0; i < o.rows; i++) {
for (var j = 0; j < o.columns; j++) {
if (!o.items[i][j]) {
throw new Error("item be required");
}
if (!this.hasWidget(this.getName() + i + "_" + j)) {
var w = BI.createWidget(o.items[i][j]);
w.element.css({position: "absolute"});
this.addWidget(this.getName() + i + "_" + j, w);
}
}
}
var left = {}, right = {}, top = {}, bottom = {};
left[0] = 0;
top[0] = 0;
right[o.columns - 1] = 0;
bottom[o.rows - 1] = 0;
// 从上到下
for (var i = 0; i < o.rows; i++) {
for (var j = 0; j < o.columns; j++) {
var wi = this.getWidgetByName(this.getName() + i + "_" + j);
if (BI.isNull(top[i])) {
top[i] = top[i - 1] + (o.rowSize[i - 1] < 1 ? o.rowSize[i - 1] : o.rowSize[i - 1] + o.vgap + o.bgap);
}
var t = top[i] <= 1 ? top[i] * 100 + "%" : top[i] + o.vgap + o.tgap + "px", h = "";
if (BI.isNumber(o.rowSize[i])) {
h = o.rowSize[i] <= 1 ? o.rowSize[i] * 100 + "%" : o.rowSize[i] + "px";
}
wi.element.css({top: t, height: h});
first(wi, i, j);
}
if (!BI.isNumber(o.rowSize[i])) {
break;
}
}
// 从下到上
for (var i = o.rows - 1; i >= 0; i--) {
for (var j = 0; j < o.columns; j++) {
var wi = this.getWidgetByName(this.getName() + i + "_" + j);
if (BI.isNull(bottom[i])) {
bottom[i] = bottom[i + 1] + (o.rowSize[i + 1] < 1 ? o.rowSize[i + 1] : o.rowSize[i + 1] + o.vgap + o.tgap);
}
var b = bottom[i] <= 1 ? bottom[i] * 100 + "%" : bottom[i] + o.vgap + o.bgap + "px", h = "";
if (BI.isNumber(o.rowSize[i])) {
h = o.rowSize[i] <= 1 ? o.rowSize[i] * 100 + "%" : o.rowSize[i] + "px";
}
wi.element.css({bottom: b, height: h});
first(wi, i, j);
}
if (!BI.isNumber(o.rowSize[i])) {
break;
}
}
// 从左到右
for (var j = 0; j < o.columns; j++) {
for (var i = 0; i < o.rows; i++) {
var wi = this.getWidgetByName(this.getName() + i + "_" + j);
if (BI.isNull(left[j])) {
left[j] = left[j - 1] + (o.columnSize[j - 1] < 1 ? o.columnSize[j - 1] : o.columnSize[j - 1] + o.hgap + o.rgap);
}
var l = left[j] <= 1 ? left[j] * 100 + "%" : left[j] + o.hgap + o.lgap + "px", w = "";
if (BI.isNumber(o.columnSize[j])) {
w = o.columnSize[j] <= 1 ? o.columnSize[j] * 100 + "%" : o.columnSize[j] + "px";
}
wi.element.css({left: l, width: w});
first(wi, i, j);
}
if (!BI.isNumber(o.columnSize[j])) {
break;
}
}
// 从右到左
for (var j = o.columns - 1; j >= 0; j--) {
for (var i = 0; i < o.rows; i++) {
var wi = this.getWidgetByName(this.getName() + i + "_" + j);
if (BI.isNull(right[j])) {
right[j] = right[j + 1] + (o.columnSize[j + 1] < 1 ? o.columnSize[j + 1] : o.columnSize[j + 1] + o.hgap + o.lgap);
}
var r = right[j] <= 1 ? right[j] * 100 + "%" : right[j] + o.hgap + o.rgap + "px", w = "";
if (BI.isNumber(o.columnSize[j])) {
w = o.columnSize[j] <= 1 ? o.columnSize[j] * 100 + "%" : o.columnSize[j] + "px";
}
wi.element.css({right: r, width: w});
first(wi, i, j);
}
if (!BI.isNumber(o.columnSize[j])) {
break;
}
}
},
update: function () {
},
populate: function (items) {
BI.WindowLayout.superclass.populate.apply(this, arguments);
this._mount();
}
});
BI.shortcut("bi.window", BI.WindowLayout);
/***/ }),
/* 366 */
/***/ (function(module, exports) {
/**
* 水平和垂直方向都居中容器, 非自适应,用于宽度高度固定的面板
* @class BI.CenterLayout
* @extends BI.Layout
*/
BI.CenterLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.CenterLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-center-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.CenterLayout.superclass.render.apply(this, arguments);
var self = this, o = this.options;
var list = [], items = o.items;
BI.each(items, function (i) {
list.push({
column: i,
row: 0,
el: BI.createWidget({
type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
})
});
});
BI.each(items, function (i, item) {
if (item) {
var w = BI.createWidget(item);
w.element.css({
position: "absolute",
left: o.hgap + o.lgap,
right: o.hgap + o.rgap,
top: o.vgap + o.tgap,
bottom: o.vgap + o.bgap,
width: "auto",
height: "auto"
});
list[i].el.addItem(w);
}
});
return {
type: "bi.grid",
ref: function (_ref) {
self.wrapper = _ref;
},
columns: list.length,
rows: 1,
items: list
};
},
resize: function () {
// console.log("center布局不需要resize");
},
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
},
update: function (opt) {
return this.wrapper.update(opt);
},
populate: function (items) {
this.wrapper.populate.apply(this.wrapper, arguments);
}
});
BI.shortcut("bi.center", BI.CenterLayout);
/***/ }),
/* 367 */
/***/ (function(module, exports) {
/**
* 浮动布局实现的居中容器
* @class BI.FloatCenterLayout
* @extends BI.Layout
*/
BI.FloatCenterLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FloatCenterLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-float-center-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.FloatCenterLayout.superclass.render.apply(this, arguments);
var self = this, o = this.options, items = o.items;
var list = [], width = 100 / items.length;
BI.each(items, function (i) {
var widget = BI.createWidget({
type: "bi.default"
});
widget.element.addClass("center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")).css({
width: width + "%",
height: "100%"
});
list.push({
el: widget
});
});
BI.each(items, function (i, item) {
if (item) {
var w = BI.createWidget(item);
w.element.css({
position: "absolute",
left: o.hgap + o.lgap,
right: o.hgap + o.rgap,
top: o.vgap + o.tgap,
bottom: o.vgap + o.bgap,
width: "auto",
height: "auto"
});
list[i].el.addItem(w);
}
});
return {
type: "bi.left",
ref: function (_ref) {
self.wrapper = _ref;
},
items: list
};
},
resize: function () {
// console.log("floatcenter布局不需要resize");
},
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
},
update: function (opt) {
return this.wrapper.update(opt);
},
populate: function (items) {
this.wrapper.populate.apply(this.wrapper, arguments);
}
});
BI.shortcut("bi.float_center", BI.FloatCenterLayout);
/***/ }),
/* 368 */
/***/ (function(module, exports) {
/**
* 水平和垂直方向都居中容器, 非自适应,用于宽度高度固定的面板
* @class BI.HorizontalCenterLayout
* @extends BI.Layout
*/
BI.HorizontalCenterLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.HorizontalCenterLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-horizontal-center-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.HorizontalCenterLayout.superclass.render.apply(this, arguments);
var self = this, o = this.options, items = o.items;
var list = [];
BI.each(items, function (i) {
list.push({
column: i,
row: 0,
el: BI.createWidget({
type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
})
});
});
BI.each(items, function (i, item) {
if (item) {
var w = BI.createWidget(item);
w.element.css({
position: "absolute",
left: o.hgap + o.lgap,
right: o.hgap + o.rgap,
top: o.vgap + o.tgap,
bottom: o.vgap + o.bgap,
width: "auto"
});
list[i].el.addItem(w);
}
});
return {
type: "bi.grid",
ref: function (_ref) {
self.wrapper = _ref;
},
columns: list.length,
rows: 1,
items: list
};
},
resize: function () {
// console.log("horizontal_center布局不需要resize");
},
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
},
update: function (opt) {
return this.wrapper.update(opt);
},
populate: function (items) {
this.wrapper.populate.apply(this.wrapper, arguments);
}
});
BI.shortcut("bi.horizontal_center", BI.HorizontalCenterLayout);
/***/ }),
/* 369 */
/***/ (function(module, exports) {
/**
* 垂直方向都居中容器, 非自适应,用于高度不固定的面板
* @class BI.VerticalCenterLayout
* @extends BI.Layout
*/
BI.VerticalCenterLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.VerticalCenterLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-vertical-center-layout",
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
render: function () {
BI.VerticalCenterLayout.superclass.render.apply(this, arguments);
var self = this, o = this.options, items = o.items;
var list = [];
BI.each(items, function (i) {
list.push({
column: 0,
row: i,
el: BI.createWidget({
type: "bi.default",
cls: "center-element " + (i === 0 ? "first-element " : "") + (i === items.length - 1 ? "last-element" : "")
})
});
});
BI.each(items, function (i, item) {
if (item) {
var w = BI.createWidget(item);
w.element.css({
position: "absolute",
left: o.hgap + o.lgap,
right: o.hgap + o.rgap,
top: o.vgap + o.tgap,
bottom: o.vgap + o.bgap,
height: "auto"
});
list[i].el.addItem(w);
}
});
return {
type: "bi.grid",
ref: function (_ref) {
self.wrapper = _ref;
},
columns: 1,
rows: list.length,
items: list
};
},
resize: function () {
// console.log("vertical_center布局不需要resize");
},
addItem: function (item) {
// do nothing
throw new Error("cannot be added");
},
update: function (opt) {
return this.wrapper.update(opt);
},
populate: function (items) {
this.wrapper.populate.apply(this.wrapper, arguments);
}
});
BI.shortcut("bi.vertical_center", BI.VerticalCenterLayout);
/***/ }),
/* 370 */
/***/ (function(module, exports) {
/**
* 当没有元素时有提示信息的view
*
* Created by GUY on 2015/9/8.
* @class BI.Pane
* @extends BI.Widget
* @abstract
*/
BI.Pane = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Pane.superclass._defaultConfig.apply(this, arguments), {
_baseCls: "bi-pane",
tipText: BI.i18nText("BI-No_Selected_Item"),
overlap: true,
onLoaded: BI.emptyFn
});
},
_assertTip: function () {
var o = this.options;
if (!this._tipText) {
this._tipText = BI.createWidget({
type: "bi.label",
cls: "bi-tips",
text: o.tipText,
height: 25
});
BI.createWidget({
type: "bi.absolute_center_adapt",
element: this,
items: [this._tipText]
});
}
},
loading: function () {
var self = this, o = this.options;
var isIE = BI.isIE();
var loadingAnimation = BI.createWidget({
type: "bi.horizontal",
cls: "bi-loading-widget" + (isIE ? " wave-loading hack" : ""),
height: 30,
width: 30,
hgap: 5,
vgap: 2.5,
items: isIE ? [] : [{
type: "bi.layout",
cls: "animate-rect rect1",
height: 25,
width: 3
}, {
type: "bi.layout",
cls: "animate-rect rect2",
height: 25,
width: 3
}, {
type: "bi.layout",
cls: "animate-rect rect3",
height: 25,
width: 3
}]
});
// pane在同步方式下由items决定tipText的显示与否
// loading的异步情况下由loaded后对面板的populate的时机决定
this.setTipVisible(false);
if (o.overlap === true) {
if (!BI.Layers.has(this.getName())) {
BI.createWidget({
type: "bi.absolute_center_adapt",
cls: "loading-container",
items: [{
el: loadingAnimation
}],
element: BI.Layers.make(this.getName(), this)
});
}
BI.Layers.show(self.getName());
} else if (BI.isNull(this._loading)) {
this._loading = loadingAnimation;
this._loading.element.css("zIndex", 1);
BI.createWidget({
type: "bi.absolute_center_adapt",
element: this,
cls: "loading-container",
items: [{
el: this._loading,
left: 0,
right: 0,
top: 0
}]
});
}
this.element.addClass("loading-status");
},
loaded: function () {
var self = this, o = this.options;
BI.Layers.remove(self.getName());
this._loading && this._loading.destroy();
this._loading && (this._loading = null);
o.onLoaded();
self.fireEvent(BI.Pane.EVENT_LOADED);
this.element.removeClass("loading-status");
},
check: function () {
this.setTipVisible(BI.isEmpty(this.options.items));
},
setTipVisible: function (b) {
if (b === true) {
this._assertTip();
this._tipText.setVisible(true);
} else {
this._tipText && this._tipText.setVisible(false);
}
},
populate: function (items) {
this.options.items = items || [];
this.check();
},
empty: function () {
}
});
BI.Pane.EVENT_LOADED = "EVENT_LOADED";
/***/ }),
/* 371 */
/***/ (function(module, exports) {
/**
* guy
* 这仅仅只是一个超类, 所有简单控件的基类
* 1、类的控制,
* 2、title的控制
* 3、文字超过边界显示3个点
* 4、cursor默认pointor
* @class BI.Single
* @extends BI.Widget
* @abstract
*/
BI.Single = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.Single.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-single",
readonly: false,
title: null,
warningTitle: null,
tipType: null, // success或warning
value: null,
belowMouse: false // title是否跟随鼠标
});
},
_showToolTip: function (e, opt) {
opt || (opt = {});
var self = this, o = this.options;
var type = this.getTipType() || (this.isEnabled() ? "success" : "warning");
var title = type === "success" ? this.getTitle() : (this.getWarningTitle() || this.getTitle());
if (BI.isKey(title)) {
BI.Tooltips.show(e, this.getName(), title, type, this, opt);
if (o.action) {
BI.Actions.runAction(o.action, "hover", o, this);
}
BI.Actions.runGlobalAction("hover", o, this);
}
},
_hideTooltip: function () {
var self = this;
var tooltip = BI.Tooltips.get(this.getName());
if (BI.isNotNull(tooltip)) {
tooltip.element.fadeOut(200, function () {
BI.Tooltips.remove(self.getName());
});
}
},
_init: function () {
BI.Single.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (BI.isKey(o.title) || BI.isKey(o.warningTitle)
|| BI.isFunction(o.title) || BI.isFunction(o.warningTitle)) {
this.enableHover({
belowMouse: o.belowMouse,
container: o.container
});
}
},
_clearTimeOut: function () {
if (BI.isNotNull(this.showTimeout)) {
clearTimeout(this.showTimeout);
this.showTimeout = null;
}
if (BI.isNotNull(this.hideTimeout)) {
clearTimeout(this.hideTimeout);
this.hideTimeout = null;
}
},
enableHover: function (opt) {
opt || (opt = {});
var self = this;
if (!this._hoverBinded) {
this.element.on("mouseenter.title" + this.getName(), function (e) {
self._e = e;
if (self.getTipType() === "warning" || (BI.isKey(self.getWarningTitle()) && !self.isEnabled())) {
self.showTimeout = BI.delay(function () {
if (BI.isNotNull(self.showTimeout)) {
self._showToolTip(self._e || e, opt);
}
}, 200);
} else if (self.getTipType() === "success" || self.isEnabled()) {
self.showTimeout = BI.delay(function () {
if (BI.isNotNull(self.showTimeout)) {
self._showToolTip(self._e || e, opt);
}
}, 500);
}
});
this.element.on("mousemove.title" + this.getName(), function (e) {
self._e = e;
if (BI.isNotNull(self.showTimeout)) {
clearTimeout(self.showTimeout);
self.showTimeout = null;
}
if(BI.isNull(self.hideTimeout)) {
self.hideTimeout = BI.delay(function () {
if (BI.isNotNull(self.hideTimeout)) {
self._hideTooltip();
}
}, 500);
}
self.showTimeout = BI.delay(function () {
// DEC-5321 IE下如果回调已经进入事件队列,clearTimeout将不会起作用
if (BI.isNotNull(self.showTimeout)) {
if (BI.isNotNull(self.hideTimeout)) {
clearTimeout(self.hideTimeout);
self.hideTimeout = null;
}
// CHART-10611 在拖拽的情况下, 鼠标拖拽着元素离开了拖拽元素的容器,但是子元素在dom结构上仍然属于容器
// 这样会认为鼠标仍然在容器中, 500ms内放开的话,会在容器之外显示鼠标停留处显示容器的title
if (self.element.__isMouseInBounds__(self._e || e)) {
self._showToolTip(self._e || e, opt);
}
}
}, 500);
});
this.element.on("mouseleave.title" + this.getName(), function (e) {
self._e = null;
self._clearTimeOut();
self._hideTooltip();
});
this._hoverBinded = true;
}
},
disabledHover: function () {
// 取消hover事件
this._clearTimeOut();
this._hideTooltip();
this.element.unbind("mouseenter.title" + this.getName())
.unbind("mousemove.title" + this.getName())
.unbind("mouseleave.title" + this.getName());
this._hoverBinded = false;
},
populate: function (items) {
this.items = items || [];
},
// opt: {container: '', belowMouse: false}
setTitle: function (title, opt) {
this.options.title = title;
if (BI.isKey(title) || BI.isFunction(title)) {
this.enableHover(opt);
} else {
this.disabledHover();
}
},
setWarningTitle: function (title, opt) {
this.options.warningTitle = title;
if (BI.isKey(title) || BI.isFunction(title)) {
this.enableHover(opt);
} else {
this.disabledHover();
}
},
setTipType: function (type) {
this.options.tipType = type;
},
getTipType: function () {
return this.options.tipType;
},
isReadOnly: function () {
return !!this.options.readonly;
},
getTitle: function () {
var title = this.options.title;
if(BI.isFunction(title)) {
return title();
}
return title;
},
getWarningTitle: function () {
var title = this.options.warningTitle;
if(BI.isFunction(title)) {
return title();
}
return title;
},
setValue: function (val) {
if (!this.options.readonly) {
this.options.value = val;
}
},
getValue: function () {
return this.options.value;
},
_unMount: function () {
BI.Single.superclass._unMount.apply(this, arguments);
if(BI.isNotNull(this.showTimeout)) {
clearTimeout(this.showTimeout);
this.showTimeout = null;
}
BI.Tooltips.remove(this.getName());
}
});
/***/ }),
/* 372 */
/***/ (function(module, exports) {
/**
* guy 表示一行数据,通过position来定位位置的数据
* @class BI.Text
* @extends BI.Single
*/
BI.Text = BI.inherit(BI.Single, {
props: {
baseCls: "bi-text",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
py: "",
highLight: false
},
render: function () {
var self = this, o = this.options;
if (o.hgap + o.lgap > 0) {
this.element.css({
"padding-left": o.hgap + o.lgap + "px"
});
}
if (o.hgap + o.rgap > 0) {
this.element.css({
"padding-right": o.hgap + o.rgap + "px"
});
}
if (o.vgap + o.tgap > 0) {
this.element.css({
"padding-top": o.vgap + o.tgap + "px"
});
}
if (o.vgap + o.bgap > 0) {
this.element.css({
"padding-bottom": o.vgap + o.bgap + "px"
});
}
if (BI.isNumber(o.height)) {
this.element.css({lineHeight: o.height + "px"});
}
if (BI.isNumber(o.lineHeight)) {
this.element.css({lineHeight: o.lineHeight + "px"});
}
if (BI.isWidthOrHeight(o.maxWidth)) {
this.element.css({maxWidth: o.maxWidth});
}
this.element.css({
textAlign: o.textAlign,
whiteSpace: this._getTextWrap(),
textOverflow: o.whiteSpace === "nowrap" ? "ellipsis" : "",
overflow: o.whiteSpace === "nowrap" ? "" : (BI.isWidthOrHeight(o.height) ? "auto" : "")
});
if (o.handler) {
this.text = BI.createWidget({
type: "bi.layout",
tagName: "span"
});
this.text.element.click(function () {
o.handler(self.getValue());
});
BI.createWidget({
type: "bi.default",
element: this,
items: [this.text]
});
} else {
this.text = this;
}
var text = this._getShowText();
if (BI.isKey(text)) {
this.setText(text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
}
if (BI.isKey(o.keyword)) {
this.doRedMark(o.keyword);
}
if (o.highLight) {
this.doHighLight();
}
},
_getTextWrap: function () {
var o = this.options;
switch (o.whiteSpace) {
case "nowrap":
return "pre";
case "normal":
default:
return "pre-wrap";
}
},
_getShowText: function () {
var o = this.options;
return BI.isFunction(o.text) ? o.text() : o.text;
},
doRedMark: function (keyword) {
var o = this.options;
// render之后做的doredmark,这个时候虽然标红了,但是之后text mounted执行的时候并没有keyword
o.keyword = keyword;
this.text.element.__textKeywordMarked__(this._getShowText() || o.value, keyword, o.py);
},
unRedMark: function () {
var o = this.options;
o.keyword = "";
this.text.element.__textKeywordMarked__(this._getShowText() || o.value, "", o.py);
},
doHighLight: function () {
this.text.element.addClass("bi-high-light");
},
unHighLight: function () {
this.text.element.removeClass("bi-high-light");
},
setValue: function (text) {
BI.Text.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.setText(text);
}
},
setStyle: function (css) {
this.text.element.css(css);
},
setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments);
// 为textContext赋值为undefined时在ie和edge下会真的显示undefined
this.options.text = BI.isNotNull(text) ? text : "";
if (BI.isIE9Below()) {
this.text.element.html(BI.htmlEncode(this._getShowText()));
return;
}
// textContent性能更好,并且原生防xss
this.text.element[0].textContent = this._getShowText();
BI.isKey(this.options.keyword) && this.doRedMark(this.options.keyword);
}
});
BI.shortcut("bi.text", BI.Text);
/***/ }),
/* 373 */
/***/ (function(module, exports) {
/**
* guy
* @class BI.BasicButton
* @extends BI.Single
*
* 一般的button父级
*/
BI.BasicButton = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.BasicButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-basic-button" + (conf.invalid ? "" : " cursor-pointer") + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
value: "",
text: "",
stopEvent: false,
stopPropagation: false,
selected: false,
once: false, // 点击一次选中有效,再点无效
forceSelected: false, // 点击即选中, 选中了就不会被取消,与once的区别是forceSelected不影响事件的触发
forceNotSelected: false, // 无论怎么点击都不会被选中
disableSelected: false, // 使能选中
shadow: false,
isShadowShowingOnSelected: false, // 选中状态下是否显示阴影
trigger: null,
handler: BI.emptyFn,
bubble: null
});
},
_init: function () {
BI.BasicButton.superclass._init.apply(this, arguments);
var opts = this.options;
if (opts.selected === true) {
BI.nextTick(BI.bind(function () {
this.setSelected(opts.selected);
}, this));
}
BI.nextTick(BI.bind(this.bindEvent, this));
if (opts.shadow) {
this._createShadow();
}
if (opts.level) {
this.element.addClass("button-" + opts.level);
}
},
_createShadow: function () {
var self = this, o = this.options;
var assertMask = function () {
if (!self.$mask) {
self.$mask = BI.createWidget(BI.isObject(o.shadow) ? o.shadow : {}, {
type: "bi.layout",
cls: "bi-button-mask"
});
self.$mask.invisible();
BI.createWidget({
type: "bi.absolute",
element: self,
items: [{
el: self.$mask,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
}
};
this.element.mouseup(function () {
if (!self._hover && !o.isShadowShowingOnSelected) {
assertMask();
self.$mask.invisible();
}
});
this.element.on("mouseenter." + this.getName(), function (e) {
if (self.element.__isMouseInBounds__(e)) {
if (self.isEnabled() && !self._hover && (o.isShadowShowingOnSelected || !self.isSelected())) {
assertMask();
self.$mask.visible();
}
}
});
this.element.on("mousemove." + this.getName(), function (e) {
if (!self.element.__isMouseInBounds__(e)) {
if (self.isEnabled() && !self._hover) {
assertMask();
self.$mask.invisible();
}
}
});
this.element.on("mouseleave." + this.getName(), function () {
if (self.isEnabled() && !self._hover) {
assertMask();
self.$mask.invisible();
}
});
},
bindEvent: function () {
var self = this;
var o = this.options, hand = this.handle();
if (!hand) {
return;
}
hand = hand.element;
var triggerArr = (o.trigger || "").split(",");
BI.each(triggerArr, function (idx, trigger) {
switch (trigger) {
case "mouseup":
var mouseDown = false;
hand.mousedown(function () {
mouseDown = true;
});
hand.mouseup(function (e) {
if (mouseDown === true) {
clk(e);
}
mouseDown = false;
ev(e);
});
break;
case "mousedown":
var mouseDown = false;
var selected = false;
hand.mousedown(function (e) {
// if (e.button === 0) {
BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function (e) {
// if (e.button === 0) {
if (BI.DOM.isExist(self) && !hand.__isMouseInBounds__(e) && mouseDown === true && !selected) {
// self.setSelected(!self.isSelected());
self._trigger();
}
mouseDown = false;
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
// }
});
if (mouseDown === true) {
return;
}
if (self.isSelected()) {
selected = true;
} else {
clk(e);
}
mouseDown = true;
ev(e);
// }
});
hand.mouseup(function (e) {
// if (e.button === 0) {
if (BI.DOM.isExist(self) && mouseDown === true && selected === true) {
clk(e);
}
mouseDown = false;
selected = false;
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
// }
});
break;
case "dblclick":
hand.dblclick(clk);
break;
case "lclick":
var mouseDown = false;
var interval;
hand.mousedown(function (e) {
BI.Widget._renderEngine.createElement(document).bind("mouseup." + self.getName(), function (e) {
interval && clearInterval(interval);
interval = null;
mouseDown = false;
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + self.getName());
});
if (mouseDown === true) {
return;
}
if (!self.isEnabled() || (self.isOnce() && self.isSelected())) {
return;
}
interval = setInterval(function () {
if (self.isEnabled()) {
self.doClick();
}
}, 180);
mouseDown = true;
ev(e);
});
break;
default:
if (o.stopEvent || o.stopPropagation) {
hand.mousedown(function (e) {
ev(e);
});
}
hand.click(clk);
break;
}
});
// 之后的300ms点击无效
var onClick = BI.debounce(this._doClick, BI.EVENT_RESPONSE_TIME, {
"leading": true,
"trailing": false
});
function ev (e) {
if (o.stopEvent) {
e.stopEvent();
}
if (o.stopPropagation) {
e.stopPropagation();
}
}
function clk (e) {
ev(e);
if (!self.isEnabled() || (self.isOnce() && self.isSelected())) {
return;
}
if (BI.isKey(o.bubble) || BI.isFunction(o.bubble)) {
if (BI.isNull(self.combo)) {
var popup;
BI.createWidget({
type: "bi.absolute",
element: self,
items: [{
el: {
type: "bi.bubble_combo",
trigger: "",
// bubble的提示不需要一直存在在界面上
destroyWhenHide: true,
ref: function () {
self.combo = this;
},
el: {
type: "bi.layout",
height: "100%"
},
popup: {
type: "bi.text_bubble_bar_popup_view",
text: getBubble(),
ref: function () {
popup = this;
},
listeners: [{
eventName: BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,
action: function (v) {
self.combo.hideView();
if (v) {
onClick.apply(self, arguments);
}
}
}]
},
listeners: [{
eventName: BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
popup.populate(getBubble());
}
}]
},
left: 0,
right: 0,
bottom: 0,
top: 0
}]
});
}
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
return;
}
onClick.apply(self, arguments);
}
function getBubble () {
var bubble = self.options.bubble;
if (BI.isFunction(bubble)) {
return bubble();
}
return bubble;
}
},
_trigger: function (e) {
var o = this.options;
if (!this.isEnabled()) {
return;
}
if (!this.isDisableSelected()) {
this.isForceSelected() ? this.setSelected(true) :
(this.isForceNotSelected() ? this.setSelected(false) :
this.setSelected(!this.isSelected()));
}
if (this.isValid()) {
o.handler.call(this, this.getValue(), this, e);
var v = this.getValue();
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, v, this, e);
this.fireEvent(BI.BasicButton.EVENT_CHANGE, v, this);
if (o.action) {
BI.Actions.runAction(o.action, "click", o, this);
}
BI.Actions.runGlobalAction("click", o, this);
}
},
_doClick: function (e) {
if (this.isValid()) {
this.beforeClick(e);
}
this._trigger(e);
if (this.isValid()) {
this.doClick(e);
}
},
beforeClick: function () {
},
doClick: function () {
},
handle: function () {
return this;
},
hover: function () {
this._hover = true;
this.handle().element.addClass("hover");
if (this.options.shadow) {
this.$mask && this.$mask.setVisible(true);
}
},
dishover: function () {
this._hover = false;
this.handle().element.removeClass("hover");
if (this.options.shadow) {
this.$mask && this.$mask.setVisible(false);
}
},
setSelected: function (b) {
var o = this.options;
o.selected = b;
if (b) {
this.handle().element.addClass("active");
} else {
this.handle().element.removeClass("active");
}
if (o.shadow && !o.isShadowShowingOnSelected) {
this.$mask && this.$mask.setVisible(false);
}
},
isSelected: function () {
return this.options.selected;
},
isOnce: function () {
return this.options.once;
},
isForceSelected: function () {
return this.options.forceSelected;
},
isForceNotSelected: function () {
return this.options.forceNotSelected;
},
isDisableSelected: function () {
return this.options.disableSelected;
},
setText: function (text) {
this.options.text = text;
},
getText: function () {
return this.options.text;
},
_setEnable: function (enable) {
BI.BasicButton.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
if (!enable) {
if (this.options.shadow) {
this.$mask && this.$mask.setVisible(false);
}
}
},
empty: function () {
BI.Widget._renderEngine.createElement(document).unbind("mouseup." + this.getName());
BI.BasicButton.superclass.empty.apply(this, arguments);
},
destroy: function () {
BI.BasicButton.superclass.destroy.apply(this, arguments);
}
});
BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE";
/***/ }),
/* 374 */
/***/ (function(module, exports) {
/**
* 表示一个可以展开的节点, 不仅有选中状态而且有展开状态
*
* Created by GUY on 2015/9/9.
* @class BI.NodeButton
* @extends BI.BasicButton
* @abstract
*/
BI.NodeButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.NodeButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend( conf, {
_baseCls: (conf._baseCls || "") + " bi-node",
open: false
});
},
_init: function () {
BI.NodeButton.superclass._init.apply(this, arguments);
var self = this;
BI.nextTick(function () {
self.setOpened(self.isOpened());
});
},
doClick: function () {
BI.NodeButton.superclass.doClick.apply(this, arguments);
this.setOpened(!this.isOpened());
},
isOnce: function () {
return false;
},
isOpened: function () {
return !!this.options.open;
},
setOpened: function (b) {
this.options.open = !!b;
},
triggerCollapse: function () {
if(this.isOpened()) {
this.setOpened(false);
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, this.getValue(), this);
}
},
triggerExpand: function () {
if(!this.isOpened()) {
this.setOpened(true);
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, this.getValue(), this);
}
}
});
/***/ }),
/* 375 */
/***/ (function(module, exports) {
/**
* guy
* tip提示
* zIndex在10亿级别
* @class BI.Tip
* @extends BI.Single
* @abstract
*/
BI.Tip = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Tip.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-tip",
zIndex: BI.zIndex_tip
});
},
_init: function () {
BI.Tip.superclass._init.apply(this, arguments);
this.element.css({zIndex: this.options.zIndex});
}
});
/***/ }),
/* 376 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/6/26.
* @class BI.ButtonGroup
* @extends BI.Widget
*/
BI.ButtonGroup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ButtonGroup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-button-group",
behaviors: {},
items: [],
value: "",
chooseType: BI.Selection.Single,
layouts: [{
type: "bi.center",
hgap: 0,
vgap: 0
}]
});
},
_init: function () {
BI.ButtonGroup.superclass._init.apply(this, arguments);
var o = this.options;
var behaviors = {};
BI.each(o.behaviors, function (key, rule) {
behaviors[key] = BI.BehaviorFactory.createBehavior(key, {
rule: rule
});
});
this.behaviors = behaviors;
this.populate(o.items);
if(BI.isKey(o.value) || BI.isNotEmptyArray(o.value)){
this.setValue(o.value);
}
},
_createBtns: function (items) {
var o = this.options;
return BI.createWidgets(BI.createItems(items, {
type: "bi.text_button"
}));
},
_btnsCreator: function (items) {
var self = this, args = Array.prototype.slice.call(arguments), o = this.options;
var buttons = this._createBtns(items);
args[0] = buttons;
BI.each(this.behaviors, function (i, behavior) {
behavior.doBehavior.apply(behavior, args);
});
BI.each(buttons, function (i, btn) {
btn.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (type === BI.Events.CLICK) {
switch (o.chooseType) {
case BI.ButtonGroup.CHOOSE_TYPE_SINGLE:
self.setValue(btn.getValue());
break;
case BI.ButtonGroup.CHOOSE_TYPE_NONE:
self.setValue([]);
break;
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.ButtonGroup.EVENT_CHANGE, value, obj);
} else {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
});
btn.on(BI.Events.DESTROY, function () {
BI.remove(self.buttons, btn);
});
});
return buttons;
},
_packageBtns: function (btns) {
var o = this.options;
for (var i = o.layouts.length - 1; i > 0; i--) {
btns = BI.map(btns, function (k, it) {
return BI.extend({}, o.layouts[i], {
items: [
BI.extend({}, o.layouts[i].el, {
el: it
})
]
});
});
}
return btns;
},
_packageSimpleItems: function (btns) {
var o = this.options;
return BI.map(o.items, function (i, item) {
if (BI.stripEL(item) === item) {
return btns[i];
}
return BI.extend({}, item, {
el: btns[i]
});
});
},
_packageItems: function (items, packBtns) {
return BI.createItems(BI.makeArrayByArray(items, {}), BI.clone(packBtns));
},
_packageLayout: function (items) {
var o = this.options, layout = BI.deepClone(o.layouts[0]);
var lay = BI.formatEL(layout).el;
while (lay && lay.items && !BI.isEmpty(lay.items)) {
lay = BI.formatEL(lay.items[0]).el;
}
lay.items = items;
return layout;
},
// 如果是一个简单的layout
_isSimpleLayout: function () {
var o = this.options;
return o.layouts.length === 1 && !BI.isArray(o.items[0]);
},
doBehavior: function () {
var args = Array.prototype.slice.call(arguments);
args.unshift(this.buttons);
BI.each(this.behaviors, function (i, behavior) {
behavior.doBehavior.apply(behavior, args);
});
},
prependItems: function (items) {
var o = this.options;
var btns = this._btnsCreator.apply(this, arguments);
this.buttons = BI.concat(btns, this.buttons);
if (this._isSimpleLayout() && this.layouts && this.layouts.prependItems) {
this.layouts.prependItems(btns);
return;
}
items = this._packageItems(items, this._packageBtns(btns));
this.layouts.prependItems(this._packageLayout(items).items);
},
addItems: function (items) {
var o = this.options;
var btns = this._btnsCreator.apply(this, arguments);
this.buttons = BI.concat(this.buttons, btns);
// 如果是一个简单的layout
if (this._isSimpleLayout() && this.layouts && this.layouts.addItems) {
this.layouts.addItems(btns);
return;
}
items = this._packageItems(items, this._packageBtns(btns));
this.layouts.addItems(this._packageLayout(items).items);
},
removeItemAt: function (indexes) {
BI.removeAt(this.buttons, indexes);
this.layouts.removeItemAt(indexes);
},
removeItems: function (values) {
values = BI.isArray(values) ? values : [values];
var deleted = [];
BI.each(this.buttons, function (i, button) {
if (BI.deepContains(values, button.getValue())) {
deleted.push(i);
}
});
BI.removeAt(this.buttons, deleted);
this.layouts.removeItemAt(deleted);
},
populate: function (items) {
items = items || [];
this.empty();
this.options.items = items;
this.buttons = this._btnsCreator.apply(this, arguments);
if (this._isSimpleLayout()) {
items = this._packageSimpleItems(this.buttons);
} else {
items = this._packageItems(items, this._packageBtns(this.buttons));
}
this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items)));
},
setNotSelectedValue: function (v) {
v = BI.isArray(v) ? v : [v];
BI.each(this.buttons, function (i, item) {
if (BI.deepContains(v, item.getValue())) {
item.setSelected && item.setSelected(false);
} else {
item.setSelected && item.setSelected(true);
}
});
},
setEnabledValue: function (v) {
v = BI.isArray(v) ? v : [v];
BI.each(this.buttons, function (i, item) {
if (BI.deepContains(v, item.getValue())) {
item.setEnable(true);
} else {
item.setEnable(false);
}
});
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
BI.each(this.buttons, function (i, item) {
if (BI.deepContains(v, item.getValue())) {
item.setSelected && item.setSelected(true);
} else {
item.setSelected && item.setSelected(false);
}
});
},
getNotSelectedValue: function () {
var v = [];
BI.each(this.buttons, function (i, item) {
if (item.isEnabled() && !(item.isSelected && item.isSelected())) {
v.push(item.getValue());
}
});
return v;
},
getValue: function () {
var v = [];
BI.each(this.buttons, function (i, item) {
if (item.isEnabled() && item.isSelected && item.isSelected()) {
v.push(item.getValue());
}
});
return v;
},
getAllButtons: function () {
return this.buttons;
},
getAllLeaves: function () {
return this.buttons;
},
getSelectedButtons: function () {
var btns = [];
BI.each(this.buttons, function (i, item) {
if (item.isSelected && item.isSelected()) {
btns.push(item);
}
});
return btns;
},
getNotSelectedButtons: function () {
var btns = [];
BI.each(this.buttons, function (i, item) {
if (item.isSelected && !item.isSelected()) {
btns.push(item);
}
});
return btns;
},
getIndexByValue: function (value) {
var index = -1;
BI.any(this.buttons, function (i, item) {
if (item.isEnabled() && item.getValue() === value) {
index = i;
return true;
}
});
return index;
},
getNodeById: function (id) {
var node;
BI.any(this.buttons, function (i, item) {
if (item.isEnabled() && item.options.id === id) {
node = item;
return true;
}
});
return node;
},
getNodeByValue: function (value) {
var node;
BI.any(this.buttons, function (i, item) {
if (item.isEnabled() && item.getValue() === value) {
node = item;
return true;
}
});
return node;
},
empty: function () {
BI.ButtonGroup.superclass.empty.apply(this, arguments);
this.options.items = [];
},
destroy: function () {
BI.ButtonGroup.superclass.destroy.apply(this, arguments);
this.options.items = [];
}
});
BI.extend(BI.ButtonGroup, {
CHOOSE_TYPE_SINGLE: BI.Selection.Single,
CHOOSE_TYPE_MULTI: BI.Selection.Multi,
CHOOSE_TYPE_ALL: BI.Selection.All,
CHOOSE_TYPE_NONE: BI.Selection.None,
CHOOSE_TYPE_DEFAULT: BI.Selection.Default
});
BI.ButtonGroup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.button_group", BI.ButtonGroup);
/***/ }),
/* 377 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/8/10.
* @class BI.ButtonTree
* @extends BI.ButtonGroup
*/
BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
_defaultConfig: function () {
return BI.extend(BI.ButtonTree.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-button-tree"
});
},
_init: function () {
BI.ButtonTree.superclass._init.apply(this, arguments);
},
setNotSelectedValue: function (v) {
v = BI.isArray(v) ? v : [v];
BI.each(this.buttons, function (i, item) {
if (!BI.isFunction(item.setSelected)) {
item.setNotSelectedValue(v);
return;
}
if (BI.deepContains(v, item.getValue())) {
item.setSelected(false);
} else {
item.setSelected(true);
}
});
},
setEnabledValue: function (v) {
v = BI.isArray(v) ? v : [v];
BI.each(this.buttons, function (i, item) {
if (BI.isFunction(item.setEnabledValue)) {
item.setEnabledValue(v);
return;
}
if (BI.deepContains(v, item.getValue())) {
item.setEnable(true);
} else {
item.setEnable(false);
}
});
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
BI.each(this.buttons, function (i, item) {
if (!BI.isFunction(item.setSelected)) {
item.setValue(v);
return;
}
if (BI.deepContains(v, item.getValue())) {
item.setSelected(true);
} else {
item.setSelected(false);
}
});
},
getNotSelectedValue: function () {
var v = [];
BI.each(this.buttons, function (i, item) {
if (item.isEnabled() && !BI.isFunction(item.setSelected)) {
v = BI.concat(v, item.getNotSelectedValue());
return;
}
if (item.isEnabled() && item.isSelected && !item.isSelected()) {
v.push(item.getValue());
}
});
return v;
},
getValue: function () {
var v = [];
BI.each(this.buttons, function (i, item) {
if (item.isEnabled() && !BI.isFunction(item.setSelected)) {
v = BI.concat(v, item.getValue());
return;
}
if (item.isEnabled() && item.isSelected && item.isSelected()) {
v.push(item.getValue());
}
});
return v;
},
getSelectedButtons: function () {
var btns = [];
BI.each(this.buttons, function (i, item) {
if (item.isEnabled() && !BI.isFunction(item.setSelected)) {
btns = btns.concat(item.getSelectedButtons());
return;
}
if (item.isSelected && item.isSelected()) {
btns.push(item);
}
});
return btns;
},
getNotSelectedButtons: function () {
var btns = [];
BI.each(this.buttons, function (i, item) {
if (item.isEnabled() && !BI.isFunction(item.setSelected)) {
btns = btns.concat(item.getNotSelectedButtons());
return;
}
if (item.isSelected && !item.isSelected()) {
btns.push(item);
}
});
return btns;
},
// 获取所有的叶子节点
getAllLeaves: function () {
var leaves = [];
BI.each(this.buttons, function (i, item) {
if (item.isEnabled() && !BI.isFunction(item.setSelected)) {
leaves = leaves.concat(item.getAllLeaves());
return;
}
if (item.isEnabled()) {
leaves.push(item);
}
});
return leaves;
},
getIndexByValue: function (value) {
var index = -1;
BI.any(this.buttons, function (i, item) {
var vs = item.getValue();
if (item.isEnabled() && (vs === value || BI.contains(vs, value))) {
index = i;
return true;
}
});
return index;
},
getNodeById: function (id) {
var node;
BI.any(this.buttons, function (i, item) {
if (item.isEnabled()) {
if (item.attr("id") === id) {
node = item;
return true;
} else if (BI.isFunction(item.getNodeById)) {
if (node = item.getNodeById(id)) {
return true;
}
}
}
});
return node;
},
getNodeByValue: function (value) {
var node;
BI.any(this.buttons, function (i, item) {
if (item.isEnabled()) {
if (BI.isFunction(item.getNodeByValue)) {
if (node = item.getNodeByValue(value)) {
return true;
}
} else if (item.attr("value") === value) {
node = item;
return true;
}
}
});
return node;
}
});
BI.ButtonTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.button_tree", BI.ButtonTree);
/***/ }),
/* 378 */
/***/ (function(module, exports) {
BI.prepares.push(function () {
BI.Resizers = new BI.ResizeController();
BI.Layers = new BI.LayerController();
BI.Maskers = new BI.MaskersController();
BI.Bubbles = new BI.BubblesController();
BI.Tooltips = new BI.TooltipsController();
BI.Popovers = new BI.PopoverController();
BI.Broadcasts = new BI.BroadcastController();
BI.StyleLoaders = new BI.StyleLoaderManager();
});
/***/ }),
/* 379 */
/***/ (function(module, exports) {
/**
* CollectionView
*
* Created by GUY on 2016/1/15.
* @class BI.CollectionView
* @extends BI.Widget
*/
BI.CollectionView = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.CollectionView.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-collection",
// width: 400, //必设
// height: 300, //必设
overflowX: true,
overflowY: true,
cellSizeAndPositionGetter: BI.emptyFn,
horizontalOverscanSize: 0,
verticalOverscanSize: 0,
scrollLeft: 0,
scrollTop: 0,
items: []
});
},
_init: function () {
BI.CollectionView.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.renderedCells = [];
this.renderedKeys = [];
this.renderRange = {};
this._scrollLock = false;
this._debounceRelease = BI.debounce(function () {
self._scrollLock = false;
}, 1000 / 60);
this.container = BI.createWidget({
type: "bi.absolute"
});
this.element.scroll(function () {
if (self._scrollLock === true) {
return;
}
o.scrollLeft = self.element.scrollLeft();
o.scrollTop = self.element.scrollTop();
self._calculateChildrenToRender();
self.fireEvent(BI.CollectionView.EVENT_SCROLL, {
scrollLeft: o.scrollLeft,
scrollTop: o.scrollTop
});
});
BI.createWidget({
type: "bi.vertical",
element: this,
scrollable: o.overflowX === true && o.overflowY === true,
scrolly: o.overflowX === false && o.overflowY === true,
scrollx: o.overflowX === true && o.overflowY === false,
items: [this.container]
});
if (o.items.length > 0) {
this._calculateSizeAndPositionData();
this._populate();
}
},
mounted: function () {
var o = this.options;
if (o.scrollLeft !== 0 || o.scrollTop !== 0) {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
}
},
_calculateSizeAndPositionData: function () {
var o = this.options;
var cellMetadata = [];
var sectionManager = new BI.SectionManager();
var height = 0;
var width = 0;
for (var index = 0, len = o.items.length; index < len; index++) {
var cellMetadatum = o.cellSizeAndPositionGetter(index);
if (cellMetadatum.height == null || isNaN(cellMetadatum.height) ||
cellMetadatum.width == null || isNaN(cellMetadatum.width) ||
cellMetadatum.x == null || isNaN(cellMetadatum.x) ||
cellMetadatum.y == null || isNaN(cellMetadatum.y)) {
throw Error();
}
height = Math.max(height, cellMetadatum.y + cellMetadatum.height);
width = Math.max(width, cellMetadatum.x + cellMetadatum.width);
cellMetadatum.index = index;
cellMetadata[index] = cellMetadatum;
sectionManager.registerCell(cellMetadatum, index);
}
this._cellMetadata = cellMetadata;
this._sectionManager = sectionManager;
this._height = height;
this._width = width;
},
_cellRenderers: function (height, width, x, y) {
this._lastRenderedCellIndices = this._sectionManager.getCellIndices(height, width, x, y);
return this._cellGroupRenderer();
},
_cellGroupRenderer: function () {
var self = this, o = this.options;
var rendered = [];
BI.each(this._lastRenderedCellIndices, function (i, index) {
var cellMetadata = self._sectionManager.getCellMetadata(index);
rendered.push(cellMetadata);
});
return rendered;
},
_calculateChildrenToRender: function () {
var self = this, o = this.options;
var scrollLeft = BI.clamp(o.scrollLeft, 0, this._getMaxScrollLeft());
var scrollTop = BI.clamp(o.scrollTop, 0, this._getMaxScrollTop());
var left = Math.max(0, scrollLeft - o.horizontalOverscanSize);
var top = Math.max(0, scrollTop - o.verticalOverscanSize);
var right = Math.min(this._width, scrollLeft + o.width + o.horizontalOverscanSize);
var bottom = Math.min(this._height, scrollTop + o.height + o.verticalOverscanSize);
if (right > 0 && bottom > 0) {
// 如果滚动的区间并没有超出渲染的范围
if (top >= this.renderRange.minY && bottom <= this.renderRange.maxY && left >= this.renderRange.minX && right <= this.renderRange.maxX) {
return;
}
var childrenToDisplay = this._cellRenderers(bottom - top, right - left, left, top);
var renderedCells = [], renderedKeys = {}, renderedWidgets = {};
// 存储所有的left和top
var lefts = {}, tops = {};
for (var i = 0, len = childrenToDisplay.length; i < len; i++) {
var datum = childrenToDisplay[i];
lefts[datum.x] = datum.x;
lefts[datum.x + datum.width] = datum.x + datum.width;
tops[datum.y] = datum.y;
tops[datum.y + datum.height] = datum.y + datum.height;
}
lefts = BI.toArray(lefts);
tops = BI.toArray(tops);
var leftMap = BI.invert(lefts);
var topMap = BI.invert(tops);
// 存储上下左右四个边界
var leftBorder = {}, rightBorder = {}, topBorder = {}, bottomBorder = {};
var assertMinBorder = function (border, offset) {
if (border[offset] == null) {
border[offset] = Number.MAX_VALUE;
}
};
var assertMaxBorder = function (border, offset) {
if (border[offset] == null) {
border[offset] = 0;
}
};
for (var i = 0, len = childrenToDisplay.length; i < len; i++) {
var datum = childrenToDisplay[i];
var index = this.renderedKeys[datum.index] && this.renderedKeys[datum.index][1];
var child;
if (index >= 0) {
if (datum.width !== this.renderedCells[index]._width) {
this.renderedCells[index]._width = datum.width;
this.renderedCells[index].el.setWidth(datum.width);
}
if (datum.height !== this.renderedCells[index]._height) {
this.renderedCells[index]._height = datum.height;
this.renderedCells[index].el.setHeight(datum.height);
}
if (this.renderedCells[index]._left !== datum.x) {
this.renderedCells[index].el.element.css("left", datum.x + "px");
}
if (this.renderedCells[index]._top !== datum.y) {
this.renderedCells[index].el.element.css("top", datum.y + "px");
}
renderedCells.push(child = this.renderedCells[index]);
} else {
child = BI.createWidget(BI.extend({
type: "bi.label",
width: datum.width,
height: datum.height
}, o.items[datum.index], {
cls: (o.items[datum.index].cls || "") + " container-cell" + (datum.y === 0 ? " first-row" : "") + (datum.x === 0 ? " first-col" : ""),
_left: datum.x,
_top: datum.y
}));
renderedCells.push({
el: child,
left: datum.x,
top: datum.y,
_left: datum.x,
_top: datum.y,
_width: datum.width,
_height: datum.height
});
}
var startTopIndex = topMap[datum.y] | 0;
var endTopIndex = topMap[datum.y + datum.height] | 0;
for (var k = startTopIndex; k <= endTopIndex; k++) {
var t = tops[k];
assertMinBorder(leftBorder, t);
assertMaxBorder(rightBorder, t);
leftBorder[t] = Math.min(leftBorder[t], datum.x);
rightBorder[t] = Math.max(rightBorder[t], datum.x + datum.width);
}
var startLeftIndex = leftMap[datum.x] | 0;
var endLeftIndex = leftMap[datum.x + datum.width] | 0;
for (var k = startLeftIndex; k <= endLeftIndex; k++) {
var l = lefts[k];
assertMinBorder(topBorder, l);
assertMaxBorder(bottomBorder, l);
topBorder[l] = Math.min(topBorder[l], datum.y);
bottomBorder[l] = Math.max(bottomBorder[l], datum.y + datum.height);
}
renderedKeys[datum.index] = [datum.index, i];
renderedWidgets[i] = child;
}
// 已存在的, 需要添加的和需要删除的
var existSet = {}, addSet = {}, deleteArray = [];
BI.each(renderedKeys, function (i, key) {
if (self.renderedKeys[i]) {
existSet[i] = key;
} else {
addSet[i] = key;
}
});
BI.each(this.renderedKeys, function (i, key) {
if (existSet[i]) {
return;
}
if (addSet[i]) {
return;
}
deleteArray.push(key[1]);
});
BI.each(deleteArray, function (i, index) {
// 性能优化,不调用destroy方法防止触发destroy事件
self.renderedCells[index].el._destroy();
});
var addedItems = [];
BI.each(addSet, function (index, key) {
addedItems.push(renderedCells[key[1]]);
});
this.container.addItems(addedItems);
// 拦截父子级关系
this.container._children = renderedWidgets;
this.container.attr("items", renderedCells);
this.renderedCells = renderedCells;
this.renderedKeys = renderedKeys;
// Todo 左右比较特殊
var minX = BI.min(leftBorder);
var maxX = BI.max(rightBorder);
var minY = BI.max(topBorder);
var maxY = BI.min(bottomBorder);
this.renderRange = {minX: minX, minY: minY, maxX: maxX, maxY: maxY};
}
},
_getMaxScrollLeft: function () {
return Math.max(0, this._width - this.options.width + (this.options.overflowX ? BI.DOM.getScrollWidth() : 0));
},
_getMaxScrollTop: function () {
return Math.max(0, this._height - this.options.height + (this.options.overflowY ? BI.DOM.getScrollWidth() : 0));
},
_populate: function (items) {
var o = this.options;
this._reRange();
if (items && items !== this.options.items) {
this.options.items = items;
this._calculateSizeAndPositionData();
}
if (o.items.length > 0) {
this.container.setWidth(this._width);
this.container.setHeight(this._height);
this._calculateChildrenToRender();
// 元素未挂载时不能设置scrollTop
try {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
} catch (e) {
}
}
},
setScrollLeft: function (scrollLeft) {
if (this.options.scrollLeft === scrollLeft) {
return;
}
this._scrollLock = true;
this.options.scrollLeft = BI.clamp(scrollLeft || 0, 0, this._getMaxScrollLeft());
this._debounceRelease();
this._calculateChildrenToRender();
this.element.scrollLeft(this.options.scrollLeft);
},
setScrollTop: function (scrollTop) {
if (this.options.scrollTop === scrollTop) {
return;
}
this._scrollLock = true;
this.options.scrollTop = BI.clamp(scrollTop || 0, 0, this._getMaxScrollTop());
this._debounceRelease();
this._calculateChildrenToRender();
this.element.scrollTop(this.options.scrollTop);
},
setOverflowX: function (b) {
var self = this;
if (this.options.overflowX !== !!b) {
this.options.overflowX = !!b;
BI.nextTick(function () {
self.element.css({overflowX: b ? "auto" : "hidden"});
});
}
},
setOverflowY: function (b) {
var self = this;
if (this.options.overflowY !== !!b) {
this.options.overflowY = !!b;
BI.nextTick(function () {
self.element.css({overflowY: b ? "auto" : "hidden"});
});
}
},
getScrollLeft: function () {
return this.options.scrollLeft;
},
getScrollTop: function () {
return this.options.scrollTop;
},
getMaxScrollLeft: function () {
return this._getMaxScrollLeft();
},
getMaxScrollTop: function () {
return this._getMaxScrollTop();
},
// 重新计算children
_reRange: function () {
this.renderRange = {};
},
_clearChildren: function () {
this.container._children = {};
this.container.attr("items", []);
},
restore: function () {
BI.each(this.renderedCells, function (i, cell) {
cell.el._destroy();
});
this._clearChildren();
this.renderedCells = [];
this.renderedKeys = [];
this.renderRange = {};
this._scrollLock = false;
},
populate: function (items) {
if (items && items !== this.options.items) {
this.restore();
}
this._populate(items);
}
});
BI.CollectionView.EVENT_SCROLL = "EVENT_SCROLL";
BI.shortcut("bi.collection_view", BI.CollectionView);
/***/ }),
/* 380 */
/***/ (function(module, exports) {
/**
* @class BI.Combo
* @extends BI.Widget
*/
BI.Combo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.Combo.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-combo",
trigger: "click",
toggle: true,
direction: "bottom", // top||bottom||left||right||top,left||top,right||bottom,left||bottom,right||right,innerRight||right,innerLeft||innerRight||innerLeft
logic: {
dynamic: true
},
container: null, // popupview放置的容器,默认为this.element
isDefaultInit: false,
destroyWhenHide: false,
isNeedAdjustHeight: true, // 是否需要高度调整
isNeedAdjustWidth: true,
stopEvent: false,
stopPropagation: false,
adjustLength: 0, // 调整的距离
adjustXOffset: 0,
adjustYOffset: 0,
hideChecker: BI.emptyFn,
offsetStyle: "left", // left,right,center
el: {},
popup: {},
comboClass: "bi-combo-popup",
hoverClass: "bi-combo-hover"
});
},
_init: function () {
BI.Combo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this._initCombo();
this._initPullDownAction();
this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) {
self._popupView();
}
if (type === BI.Events.COLLAPSE) {
self._hideView();
}
if (type === BI.Events.EXPAND) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.Combo.EVENT_EXPAND);
}
if (type === BI.Events.COLLAPSE) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.isViewVisible() && self.fireEvent(BI.Combo.EVENT_COLLAPSE);
}
if (type === BI.Events.CLICK) {
self.fireEvent(BI.Combo.EVENT_TRIGGER_CHANGE, obj);
}
}
});
self.element.on("mouseenter." + self.getName(), function (e) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) {
self.element.addClass(o.hoverClass);
}
});
self.element.on("mouseleave." + self.getName(), function (e) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) {
self.element.removeClass(o.hoverClass);
}
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("vertical", BI.extend(o.logic, {
items: [
{ el: this.combo }
]
}))));
o.isDefaultInit && (this._assertPopupView());
BI.Resizers.add(this.getName(), BI.bind(function () {
if (this.isViewVisible()) {
this._hideView();
}
}, this));
},
_toggle: function () {
this._assertPopupViewRender();
if (this.popupView.isVisible()) {
this._hideView();
} else {
if (this.isEnabled()) {
this._popupView();
}
}
},
_initPullDownAction: function () {
var self = this, o = this.options;
var evs = (this.options.trigger || "").split(",");
var st = function (e) {
if (o.stopEvent) {
e.stopEvent();
}
if (o.stopPropagation) {
e.stopPropagation();
}
};
var enterPopup = false;
function hide () {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid() && o.toggle === true) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
}
self.popupView && self.popupView.element.off("mouseenter." + self.getName()).off("mouseleave." + self.getName());
enterPopup = false;
}
BI.each(evs, function (i, ev) {
switch (ev) {
case "hover":
self.element.on("mouseenter." + self.getName(), function (e) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) {
self._popupView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo);
self.fireEvent(BI.Combo.EVENT_EXPAND);
}
});
self.element.on("mouseleave." + self.getName(), function (e) {
if (self.popupView) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
}
});
break;
case "click":
var debounce = BI.debounce(function (e) {
if (self.combo.element.__isMouseInBounds__(e)) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) {
// if (!o.toggle && self.isViewVisible()) {
// return;
// }
o.toggle ? self._toggle() : self._popupView();
if (self.isViewVisible()) {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo);
self.fireEvent(BI.Combo.EVENT_EXPAND);
} else {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.combo);
self.fireEvent(BI.Combo.EVENT_COLLAPSE);
}
}
}
}, BI.EVENT_RESPONSE_TIME, {
"leading": true,
"trailing": false
});
self.element.off(ev + "." + self.getName()).on(ev + "." + self.getName(), function (e) {
debounce(e);
st(e);
});
break;
case "click-hover":
var debounce = BI.debounce(function (e) {
if (self.combo.element.__isMouseInBounds__(e)) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) {
// if (self.isViewVisible()) {
// return;
// }
self._popupView();
if (self.isViewVisible()) {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo);
self.fireEvent(BI.Combo.EVENT_EXPAND);
}
}
}
}, BI.EVENT_RESPONSE_TIME, {
"leading": true,
"trailing": false
});
self.element.off("click." + self.getName()).on("click." + self.getName(), function (e) {
debounce(e);
st(e);
});
self.element.on("mouseleave." + self.getName(), function (e) {
if (self.popupView) {
self.popupView.element.on("mouseenter." + self.getName(), function (e) {
enterPopup = true;
self.popupView.element.on("mouseleave." + self.getName(), function (e) {
hide();
});
self.popupView.element.off("mouseenter." + self.getName());
});
BI.defer(function () {
if (!enterPopup) {
hide();
}
}, 50);
}
});
break;
}
});
},
_initCombo: function () {
this.combo = BI.createWidget(this.options.el, {
value: this.options.value
});
},
_assertPopupView: function () {
var self = this, o = this.options;
if (this.popupView == null) {
this.popupView = BI.createWidget(this.options.popup, {
type: "bi.popup_view",
value: o.value
}, this);
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (type === BI.Events.CLICK) {
self.combo.setValue(self.getValue());
self.fireEvent(BI.Combo.EVENT_CHANGE, value, obj);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.popupView.setVisible(false);
BI.nextTick(function () {
self.fireEvent(BI.Combo.EVENT_AFTER_INIT);
});
}
},
_assertPopupViewRender: function () {
this._assertPopupView();
if (!this._rendered) {
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this.options.container || this,
items: [
{el: this.popupView}
]
});
this._rendered = true;
}
},
_hideIf: function (e) {
// if (this.element.__isMouseInBounds__(e) || (this.popupView && this.popupView.element.__isMouseInBounds__(e))) {
// return;
// }
// BI-10290 公式combo双击公式内容会收起
if ((this.element.find(e.target).length > 0)
|| (this.popupView && this.popupView.element.find(e.target).length > 0)
|| e.target.className === "CodeMirror-cursor" || BI.Widget._renderEngine.createElement(e.target).closest(".CodeMirror-hints").length > 0) {// BI-9887 CodeMirror的公式弹框需要特殊处理下
var directions = this.options.direction.split(",");
if (BI.contains(directions, "innerLeft") || BI.contains(directions, "innerRight")) {
// popup可以出现的trigger内部的combo,滚动时不需要消失,而是调整位置
this.adjustWidth();
this.adjustHeight();
}
return;
}
var isHide = this.options.hideChecker.apply(this, [e]);
if (isHide === false) {
return;
}
this._hideView();
},
_hideView: function () {
this.fireEvent(BI.Combo.EVENT_BEFORE_HIDEVIEW);
if (this.options.destroyWhenHide === true) {
this.popupView && this.popupView.destroy();
this.popupView = null;
this._rendered = false;
} else {
this.popupView && this.popupView.invisible();
}
this.element.removeClass(this.options.comboClass);
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
},
_popupView: function (e) {
this._assertPopupViewRender();
this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW);
this.popupView.visible();
this.adjustWidth(e);
this.adjustHeight(e);
this.element.addClass(this.options.comboClass);
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.Widget._renderEngine.createElement(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this));
this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW);
},
adjustWidth: function (e) {
var o = this.options;
if (!this.popupView) {
return;
}
if (o.isNeedAdjustWidth === true) {
this.resetListWidth("");
var width = this.popupView.element.outerWidth();
var maxW = this.element.outerWidth() || o.width;
if (width > maxW + 80) {
maxW = maxW + 80;
} else if (width > maxW) {
maxW = width;
}
this.resetListWidth(maxW < 100 ? 100 : maxW);
}
},
adjustHeight: function (e) {
var o = this.options, p = {};
if (!this.popupView) {
return;
}
var isVisible = this.popupView.isVisible();
this.popupView.visible();
var combo = BI.isNotNull(e) ? {
element: {
offset: function () {
return {
left: e.pageX,
top: e.pageY
};
},
bounds: function () {
// offset为其相对于父定位元素的偏移
return {
x: e.offsetX,
y: e.offsetY,
width: 0,
height: 24
};
},
outerWidth: function () {
return 0;
},
outerHeight: function () {
return 24;
}
}
} : this.combo;
switch (o.direction) {
case "bottom":
case "bottom,right":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle);
break;
case "top":
case "top,right":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle);
break;
case "left":
case "left,bottom":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle);
break;
case "right":
case "right,bottom":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle);
break;
case "top,left":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle);
break;
case "bottom,left":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle);
break;
case "left,top":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle);
break;
case "right,top":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle);
break;
case "right,innerRight":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerRight", "innerLeft", "bottom", "top"], o.offsetStyle);
break;
case "right,innerLeft":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "innerLeft", "innerRight", "bottom", "top"], o.offsetStyle);
break;
case "innerRight":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["innerRight", "innerLeft", "right", "left", "bottom", "top"], o.offsetStyle);
break;
case "innerLeft":
p = BI.DOM.getComboPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["innerLeft", "innerRight", "left", "right", "bottom", "top"], o.offsetStyle);
break;
case "top,custom":
case "custom,top":
p = BI.DOM.getTopAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight);
break;
case "custom,bottom":
case "bottom,custom":
p = BI.DOM.getBottomAdaptPosition(combo, this.popupView, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight);
break;
case "left,custom":
case "custom,left":
p = BI.DOM.getLeftAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength);
delete p.top;
delete p.adaptHeight;
break;
case "custom,right":
case "right,custom":
p = BI.DOM.getRightAdaptPosition(combo, this.popupView, o.adjustXOffset || o.adjustLength);
delete p.top;
delete p.adaptHeight;
break;
}
if ("adaptHeight" in p) {
this.resetListHeight(p["adaptHeight"]);
}
if ("left" in p) {
this.popupView.element.css({
left: p.left
});
}
if ("top" in p) {
this.popupView.element.css({
top: p.top
});
}
this.position = p;
this.popupView.setVisible(isVisible);
},
resetListHeight: function (h) {
this._assertPopupView();
this.popupView.resetHeight && this.popupView.resetHeight(h);
},
resetListWidth: function (w) {
this._assertPopupView();
this.popupView.resetWidth && this.popupView.resetWidth(w);
},
populate: function (items) {
this._assertPopupView();
this.popupView.populate.apply(this.popupView, arguments);
this.combo.populate.apply(this.combo, arguments);
},
_setEnable: function (arg) {
BI.Combo.superclass._setEnable.apply(this, arguments);
if (arg === true) {
this.element.removeClass("base-disabled disabled");
} else if (arg === false) {
this.element.addClass("base-disabled disabled");
}
!arg && this.element.removeClass(this.options.hoverClass);
!arg && this.isViewVisible() && this._hideView();
},
setValue: function (v) {
this.combo.setValue(v);
if (BI.isNull(this.popupView)) {
this.options.popup.value = v;
} else {
this.popupView.setValue(v);
}
},
getValue: function () {
if (BI.isNull(this.popupView)) {
return this.options.popup.value;
} else {
return this.popupView.getValue();
}
},
isViewVisible: function () {
return this.isEnabled() && this.combo.isEnabled() && !!this.popupView && this.popupView.isVisible();
},
showView: function (e) {
// 减少popup 调整宽高的次数
if (this.isEnabled() && this.combo.isEnabled() && !this.isViewVisible()) {
this._popupView(e);
}
},
hideView: function () {
this._hideView();
},
getView: function () {
return this.popupView;
},
getPopupPosition: function () {
return this.position;
},
toggle: function () {
this._toggle();
},
destroyed: function () {
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName())
.unbind("mousewheel." + this.getName())
.unbind("mouseenter." + this.getName())
.unbind("mousemove." + this.getName())
.unbind("mouseleave." + this.getName());
BI.Resizers.remove(this.getName());
this.popupView && this.popupView._destroy();
}
});
BI.Combo.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";
BI.Combo.EVENT_CHANGE = "EVENT_CHANGE";
BI.Combo.EVENT_EXPAND = "EVENT_EXPAND";
BI.Combo.EVENT_COLLAPSE = "EVENT_COLLAPSE";
BI.Combo.EVENT_AFTER_INIT = "EVENT_AFTER_INIT";
BI.Combo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.Combo.EVENT_AFTER_POPUPVIEW = "EVENT_AFTER_POPUPVIEW";
BI.Combo.EVENT_BEFORE_HIDEVIEW = "EVENT_BEFORE_HIDEVIEW";
BI.Combo.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.shortcut("bi.combo", BI.Combo);
/***/ }),
/* 381 */
/***/ (function(module, exports) {
/**
*
* 某个可以展开的节点
*
* Created by GUY on 2015/9/10.
* @class BI.Expander
* @extends BI.Widget
*/
BI.Expander = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Expander.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-expander",
trigger: "click",
toggle: true,
// direction: "bottom", //top,bottom四个方向
isDefaultInit: false, // 是否默认初始化子节点
el: {},
popup: {},
expanderClass: "bi-expander-popup",
hoverClass: "bi-expander-hover"
});
},
_init: function () {
BI.Expander.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this._expanded = !!o.el.open;
this._initExpander();
this._initPullDownAction();
this.expander.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) {
self._popupView();
}
if (type === BI.Events.COLLAPSE) {
self._hideView();
}
if (type === BI.Events.EXPAND) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.Expander.EVENT_EXPAND);
}
if (type === BI.Events.COLLAPSE) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.isViewVisible() && self.fireEvent(BI.Expander.EVENT_COLLAPSE);
}
if (type === BI.Events.CLICK) {
self.fireEvent(BI.Expander.EVENT_TRIGGER_CHANGE, value, obj);
}
}
});
this.element.hover(function () {
if (self.isEnabled() && self.isValid() && self.expander.isEnabled() && self.expander.isValid()) {
self.element.addClass(o.hoverClass);
}
}, function () {
if (self.isEnabled() && self.isValid() && self.expander.isEnabled() && self.expander.isValid()) {
self.element.removeClass(o.hoverClass);
}
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [
{el: this.expander}
]
});
o.isDefaultInit && this._assertPopupView();
if (this.expander.isOpened() === true) {
this._popupView();
}
},
_toggle: function () {
this._assertPopupViewRender();
if (this.popupView.isVisible()) {
this._hideView();
} else {
if (this.isEnabled()) {
this._popupView();
}
}
},
_initPullDownAction: function () {
var self = this, o = this.options;
var evs = this.options.trigger.split(",");
BI.each(evs, function (i, e) {
switch (e) {
case "hover":
self.element[e](function (e) {
if (self.isEnabled() && self.isValid() && self.expander.isEnabled() && self.expander.isValid()) {
self._popupView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.expander);
self.fireEvent(BI.Expander.EVENT_EXPAND);
}
}, function () {
if (self.isEnabled() && self.isValid() && self.expander.isEnabled() && self.expander.isValid() && o.toggle) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.expander);
self.fireEvent(BI.Expander.EVENT_COLLAPSE);
}
});
break;
case "click":
if (e) {
self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) {
if (self.expander.element.__isMouseInBounds__(e)) {
if (self.isEnabled() && self.isValid() && self.expander.isEnabled() && self.expander.isValid()) {
o.toggle ? self._toggle() : self._popupView();
if (self.isExpanded()) {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.expander);
self.fireEvent(BI.Expander.EVENT_EXPAND);
} else {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.expander);
self.fireEvent(BI.Expander.EVENT_COLLAPSE);
}
}
}
}, BI.EVENT_RESPONSE_TIME, {
"leading": true,
"trailing": false
}));
}
break;
}
});
},
_initExpander: function () {
this.expander = BI.createWidget(this.options.el);
},
_assertPopupView: function () {
var self = this, o = this.options;
if (this.popupView == null) {
this.popupView = BI.createWidget(this.options.popup, {
type: "bi.button_group",
cls: "expander-popup",
layouts: [{
type: "bi.vertical",
hgap: 0,
vgap: 0
}],
value: o.value
}, this);
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
// self.setValue(self.getValue());
self.fireEvent(BI.Expander.EVENT_CHANGE, value, obj);
}
});
this.popupView.setVisible(this.isExpanded());
BI.nextTick(function () {
self.fireEvent(BI.Expander.EVENT_AFTER_INIT);
});
}
},
_assertPopupViewRender: function () {
this._assertPopupView();
if (!this._rendered) {
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [
{el: this.popupView}
]
});
this._rendered = true;
}
},
_hideView: function () {
this.fireEvent(BI.Expander.EVENT_BEFORE_HIDEVIEW);
this._expanded = false;
this.expander.setOpened(false);
this.popupView && this.popupView.invisible();
this.element.removeClass(this.options.expanderClass);
this.fireEvent(BI.Expander.EVENT_AFTER_HIDEVIEW);
},
_popupView: function () {
this._assertPopupViewRender();
this.fireEvent(BI.Expander.EVENT_BEFORE_POPUPVIEW);
this._expanded = true;
this.expander.setOpened(true);
this.popupView.visible();
this.element.addClass(this.options.expanderClass);
this.fireEvent(BI.Expander.EVENT_AFTER_POPUPVIEW);
},
populate: function (items) {
// this._assertPopupView();
this.popupView && this.popupView.populate.apply(this.popupView, arguments);
this.expander.populate.apply(this.expander, arguments);
},
_setEnable: function (arg) {
BI.Expander.superclass._setEnable.apply(this, arguments);
!arg && this.element.removeClass(this.options.hoverClass);
!arg && this.isViewVisible() && this._hideView();
},
setValue: function (v) {
this.expander.setValue(v);
if (BI.isNull(this.popupView)) {
this.options.popup.value = v;
} else {
this.popupView.setValue(v);
}
},
getValue: function () {
if (BI.isNull(this.popupView)) {
return this.options.popup.value;
} else {
return this.popupView.getValue();
}
},
isViewVisible: function () {
return this.isEnabled() && this.expander.isEnabled() && !!this.popupView && this.popupView.isVisible();
},
isExpanded: function () {
return this._expanded;
},
showView: function () {
if (this.isEnabled() && this.expander.isEnabled()) {
this._popupView();
}
},
hideView: function () {
this._hideView();
},
getView: function () {
return this.popupView;
},
getAllLeaves: function () {
return this.popupView && this.popupView.getAllLeaves();
},
getNodeById: function (id) {
if (this.expander.options.id === id) {
return this.expander;
}
return this.popupView && this.popupView.getNodeById(id);
},
getNodeByValue: function (value) {
if (this.expander.getValue() === value) {
return this.expander;
}
return this.popupView && this.popupView.getNodeByValue(value);
},
destroy: function () {
BI.Expander.superclass.destroy.apply(this, arguments);
}
});
BI.Expander.EVENT_EXPAND = "EVENT_EXPAND";
BI.Expander.EVENT_COLLAPSE = "EVENT_COLLAPSE";
BI.Expander.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";
BI.Expander.EVENT_CHANGE = "EVENT_CHANGE";
BI.Expander.EVENT_AFTER_INIT = "EVENT_AFTER_INIT";
BI.Expander.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.Expander.EVENT_AFTER_POPUPVIEW = "EVENT_AFTER_POPUPVIEW";
BI.Expander.EVENT_BEFORE_HIDEVIEW = "EVENT_BEFORE_HIDEVIEW";
BI.Expander.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.shortcut("bi.expander", BI.Expander);
/***/ }),
/* 382 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/8/10.
*/
BI.ComboGroup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-combo-group bi-list-item",
// 以下这些属性对每一个combo都是公用的
trigger: "click,hover",
direction: "right",
adjustLength: 0,
isDefaultInit: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: {type: "bi.text_button", text: "", value: ""},
children: [],
popup: {
el: {
type: "bi.button_tree",
chooseType: 0,
layouts: [{
type: "bi.vertical"
}]
}
}
});
},
_init: function () {
BI.ComboGroup.superclass._init.apply(this, arguments);
this._populate(this.options.el);
},
_populate: function (item) {
var self = this, o = this.options;
var children = o.children;
if (BI.isEmpty(children)) {
throw new Error("ComboGroup构造错误");
}
BI.each(children, function (i, ch) {
var son = BI.formatEL(ch).el.children;
ch = BI.formatEL(ch).el;
if (!BI.isEmpty(son)) {
ch.el = BI.clone(ch);
ch.children = son;
ch.type = "bi.combo_group";
ch.action = o.action;
ch.height = o.height;
ch.direction = o.direction;
ch.isDefaultInit = o.isDefaultInit;
ch.isNeedAdjustHeight = o.isNeedAdjustHeight;
ch.isNeedAdjustWidth = o.isNeedAdjustWidth;
ch.adjustLength = o.adjustLength;
ch.popup = o.popup;
}
});
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
container: o.container,
height: o.height,
trigger: o.trigger,
direction: o.direction,
isDefaultInit: o.isDefaultInit,
isNeedAdjustWidth: o.isNeedAdjustWidth,
isNeedAdjustHeight: o.isNeedAdjustHeight,
adjustLength: o.adjustLength,
el: item,
popup: BI.extend({}, o.popup, {
el: BI.extend({
items: children
}, o.popup.el)
})
});
this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.ComboGroup.EVENT_CHANGE, obj);
}
});
},
getValue: function () {
return this.combo.getValue();
},
setValue: function (v) {
this.combo.setValue(v);
}
});
BI.ComboGroup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.combo_group", BI.ComboGroup);
/***/ }),
/* 383 */
/***/ (function(module, exports) {
BI.VirtualGroup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.VirtualGroup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-virtual-group",
items: [],
layouts: [{
type: "bi.center",
hgap: 0,
vgap: 0
}]
});
},
render: function () {
var o = this.options;
this.populate(o.items);
if (BI.isKey(o.value)) {
this.setValue(o.value);
}
},
_packageBtns: function (items) {
var o = this.options;
var map = this.buttonMap = {};
for (var i = o.layouts.length - 1; i > 0; i--) {
items = BI.map(items, function (k, it) {
var el = BI.stripEL(it);
return BI.extend({}, o.layouts[i], {
items: [
BI.extend({}, o.layouts[i].el, {
el: BI.extend({
ref: function (_ref) {
if (BI.isKey(map[el.value])) {
map[el.value] = _ref;
}
}
}, el)
})
]
});
});
}
return items;
},
_packageLayout: function (items) {
var o = this.options, layout = BI.deepClone(o.layouts[0]);
var lay = BI.formatEL(layout).el;
while (lay && lay.items && !BI.isEmpty(lay.items)) {
lay = BI.formatEL(lay.items[0]).el;
}
lay.items = items;
return layout;
},
addItems: function (items) {
this.layouts.addItems(items);
},
prependItems: function (items) {
this.layouts.prependItems(items);
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
BI.each(this.buttonMap, function (key, item) {
if (item) {
if (v.deepContains(key)) {
item.setSelected && item.setSelected(true);
} else {
item.setSelected && item.setSelected(false);
}
}
});
},
getNotSelectedValue: function () {
var v = [];
BI.each(this.buttonMap, function (i, item) {
if (item) {
if (item.isEnabled() && !(item.isSelected && item.isSelected())) {
v.push(item.getValue());
}
}
});
return v;
},
getValue: function () {
var v = [];
BI.each(this.buttonMap, function (i, item) {
if (item) {
if (item.isEnabled() && item.isSelected && item.isSelected()) {
v.push(item.getValue());
}
}
});
return v;
},
populate: function (items) {
var self = this;
items = items || [];
this.options.items = items;
items = this._packageBtns(items);
if (!this.layouts) {
this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items)));
} else {
this.layouts.populate(items);
}
}
});
BI.VirtualGroup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.virtual_group", BI.VirtualGroup);
/***/ }),
/* 384 */
/***/ (function(module, exports) {
/**
* 加载控件
*
* Created by GUY on 2015/8/31.
* @class BI.Loader
* @extends BI.Widget
*/
BI.Loader = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Loader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-loader",
direction: "top",
isDefaultInit: true, // 是否默认初始化数据
logic: {
dynamic: true,
scrolly: true
},
// 下面是button_group的属性
el: {
type: "bi.button_group"
},
items: [],
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn,
// 下面是分页信息
count: false,
prev: false,
next: {},
hasPrev: BI.emptyFn,
hasNext: BI.emptyFn
});
},
_prevLoad: function () {
var self = this, o = this.options;
this.prev.setLoading();
o.itemsCreator.apply(this, [{times: --this.times}, function () {
self.prev.setLoaded();
self.prependItems.apply(self, arguments);
}]);
},
_nextLoad: function () {
var self = this, o = this.options;
this.next.setLoading();
o.itemsCreator.apply(this, [{times: ++this.times}, function () {
self.next.setLoaded();
self.addItems.apply(self, arguments);
}]);
},
_init: function () {
BI.Loader.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (o.itemsCreator === false) {
o.prev = false;
o.next = false;
}
if (o.prev !== false) {
this.prev = BI.createWidget(BI.extend({
type: "bi.loading_bar"
}, o.prev));
this.prev.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
self._prevLoad();
}
});
}
this.button_group = BI.createWidget(o.el, {
type: "bi.button_group",
chooseType: 0,
items: o.items,
behaviors: {},
layouts: [{
type: "bi.vertical"
}],
value: o.value
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.Loader.EVENT_CHANGE, obj);
}
});
if (o.next !== false) {
this.next = BI.createWidget(BI.extend({
type: "bi.loading_bar"
}, o.next));
this.next.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
self._nextLoad();
}
});
}
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({
scrolly: true
}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.prev, this.button_group, this.next)
}))));
o.isDefaultInit && BI.isEmpty(o.items) && BI.nextTick(BI.bind(function () {
o.isDefaultInit && BI.isEmpty(o.items) && this._populate();
}, this));
if (BI.isNotEmptyArray(o.items)) {
this._populate(o.items);
}
},
hasPrev: function () {
var o = this.options;
if (BI.isNumber(o.count)) {
return this.count < o.count;
}
return !!o.hasPrev.apply(this, [{
times: this.times,
count: this.count
}]);
},
hasNext: function () {
var o = this.options;
if (BI.isNumber(o.count)) {
return this.count < o.count;
}
return !!o.hasNext.apply(this, [{
times: this.times,
count: this.count
}]);
},
prependItems: function (items) {
this.count += items.length;
if (this.next !== false) {
if (this.hasPrev()) {
this.options.items = this.options.items.concat(items);
this.prev.setLoaded();
} else {
this.prev.setEnd();
}
}
this.button_group.prependItems.apply(this.button_group, arguments);
},
addItems: function (items) {
this.count += items.length;
if (BI.isObject(this.next)) {
if (this.hasNext()) {
this.options.items = this.options.items.concat(items);
this.next.setLoaded();
} else {
this.next.setEnd();
}
}
this.button_group.addItems.apply(this.button_group, arguments);
},
_populate: function (items) {
var self = this, o = this.options;
if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) {
o.itemsCreator.apply(this, [{times: 1}, function () {
if (arguments.length === 0) {
throw new Error("arguments can not be null!!!");
}
self.populate.apply(self, arguments);
o.onLoaded();
}]);
return false;
}
this.options.items = items;
this.times = 1;
this.count = 0;
this.count += items.length;
if (BI.isObject(this.next)) {
if (this.hasNext()) {
this.next.setLoaded();
} else {
this.next.invisible();
}
}
if (BI.isObject(this.prev)) {
if (this.hasPrev()) {
this.prev.setLoaded();
} else {
this.prev.invisible();
}
}
return true;
},
populate: function () {
this._populate.apply(this, arguments) && this.button_group.populate.apply(this.button_group, arguments);
},
setNotSelectedValue: function () {
this.button_group.setNotSelectedValue.apply(this.button_group, arguments);
},
getNotSelectedValue: function () {
return this.button_group.getNotSelectedValue();
},
setValue: function () {
this.button_group.setValue.apply(this.button_group, arguments);
},
getValue: function () {
return this.button_group.getValue.apply(this.button_group, arguments);
},
getAllButtons: function () {
return this.button_group.getAllButtons();
},
getAllLeaves: function () {
return this.button_group.getAllLeaves();
},
getSelectedButtons: function () {
return this.button_group.getSelectedButtons();
},
getNotSelectedButtons: function () {
return this.button_group.getNotSelectedButtons();
},
getIndexByValue: function (value) {
return this.button_group.getIndexByValue(value);
},
getNodeById: function (id) {
return this.button_group.getNodeById(id);
},
getNodeByValue: function (value) {
return this.button_group.getNodeByValue(value);
},
empty: function () {
this.button_group.empty();
BI.each([this.prev, this.next], function (i, ob) {
ob && ob.setVisible(false);
});
},
destroy: function () {
BI.Loader.superclass.destroy.apply(this, arguments);
}
});
BI.Loader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.loader", BI.Loader);
/***/ }),
/* 385 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/6/26.
*/
BI.Navigation = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Navigation.superclass._defaultConfig.apply(this, arguments), {
direction: "bottom", // top, bottom, left, right, custom
logic: {
dynamic: false
},
single: false,
showIndex: false,
tab: false,
cardCreator: function (v) {
return BI.createWidget();
},
afterCardCreated: BI.emptyFn,
afterCardShow: BI.emptyFn
});
},
render: function () {
var self = this, o = this.options;
this.tab = BI.createWidget(this.options.tab, {type: "bi.button_group"});
this.cardMap = {};
this.showIndex = 0;
this.layout = BI.createWidget({
type: "bi.card"
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.tab, this.layout)
}))));
new BI.ShowListener({
eventObj: this.tab,
cardLayout: this.layout,
cardNameCreator: function (v) {
return self.showIndex + v;
},
cardCreator: function (v) {
var card = o.cardCreator(v);
self.cardMap[v] = card;
return card;
},
afterCardCreated: BI.bind(this.afterCardCreated, this),
afterCardShow: BI.bind(this.afterCardShow, this)
});
},
mounted: function () {
var o = this.options;
if (o.showIndex !== false) {
this.setSelect(o.showIndex);
}
},
_deleteOtherCards: function (currCardName) {
var self = this, o = this.options;
if (o.single === true) {
BI.each(this.cardMap, function (name, card) {
if (name !== (currCardName + "")) {
self.layout.deleteCardByName(name);
delete self.cardMap[name];
}
});
}
},
afterCardCreated: function (v) {
var self = this;
this.cardMap[v].on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.Navigation.EVENT_CHANGE, obj);
}
});
this.options.afterCardCreated.apply(this, arguments);
},
afterCardShow: function (v) {
this.showIndex = v;
this._deleteOtherCards(v);
this.options.afterCardShow.apply(this, arguments);
},
populate: function () {
var card = this.layout.getShowingCard();
if (card) {
return card.populate.apply(card, arguments);
}
},
_assertCard: function (v) {
if (!this.layout.isCardExisted(v)) {
var card = this.options.cardCreator(v);
this.cardMap[v] = card;
this.layout.addCardByName(v, card);
this.afterCardCreated(v);
}
},
setSelect: function (v) {
this._assertCard(v);
this.layout.showCardByName(v);
this._deleteOtherCards(v);
if (this.showIndex !== v) {
this.showIndex = v;
BI.nextTick(BI.bind(this.afterCardShow, this, v));
}
},
getSelect: function () {
return this.showIndex;
},
getSelectedCard: function () {
if (BI.isKey(this.showIndex)) {
return this.cardMap[this.showIndex];
}
},
/**
* @override
*/
setValue: function (v) {
var card = this.layout.getShowingCard();
if (card) {
card.setValue(v);
}
},
/**
* @override
*/
getValue: function () {
var card = this.layout.getShowingCard();
if (card) {
return card.getValue();
}
},
empty: function () {
this.layout.deleteAllCard();
this.cardMap = {};
},
destroy: function () {
BI.Navigation.superclass.destroy.apply(this, arguments);
}
});
BI.Navigation.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.navigation", BI.Navigation);
/***/ }),
/* 386 */
/***/ (function(module, exports) {
/**
* 搜索逻辑控件
*
* Created by GUY on 2015/9/28.
* @class BI.Searcher
* @extends BI.Widget
*/
BI.Searcher = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Searcher.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-searcher",
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
vgap: 0,
hgap: 0,
isDefaultInit: false,
isAutoSearch: true, // 是否自动搜索
isAutoSync: true, // 是否自动同步数据, 即是否保持搜索面板和adapter面板状态值的统一
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
allowSearchBlank: true, // 是否能够搜索包含空格的字符串
// isAutoSearch为false时启用
onSearch: function (op, callback) {
callback([]);
},
el: {
type: "bi.search_editor"
},
popup: {
type: "bi.searcher_view"
},
adapter: null,
masker: { // masker层
offset: {}
}
});
},
_init: function () {
BI.Searcher.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.search_editor"
});
BI.createWidget({
type: "bi.vertical",
element: this,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
vgap: o.vgap,
hgap: o.hgap,
items: [this.editor]
});
o.isDefaultInit && (this._assertPopupView());
var search = BI.debounce(BI.bind(this._search, this), BI.EVENT_RESPONSE_TIME, {
"leading": true,
"trailing": false
});
this.editor.on(BI.Controller.EVENT_CHANGE, function (type) {
switch (type) {
case BI.Events.STARTEDIT:
self._startSearch();
break;
case BI.Events.EMPTY:
self._stopSearch();
break;
case BI.Events.CHANGE:
search();
break;
case BI.Events.PAUSE:
self._pauseSearch();
break;
}
});
},
_assertPopupView: function () {
var self = this, o = this.options;
if ((o.masker && !BI.Maskers.has(this.getName())) || (o.masker === false && !this.popupView)) {
this.popupView = BI.createWidget(o.popup, {
type: "bi.searcher_view",
chooseType: o.chooseType
});
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
if (o.isAutoSync) {
var values = o.adapter && o.adapter.getValue();
if (!obj.isSelected()) {
o.adapter && o.adapter.setValue(BI.deepWithout(values, obj.getValue()));
} else {
switch (o.chooseType) {
case BI.ButtonGroup.CHOOSE_TYPE_SINGLE:
o.adapter && o.adapter.setValue([obj.getValue()]);
break;
case BI.ButtonGroup.CHOOSE_TYPE_MULTI:
values.push(obj.getValue());
o.adapter && o.adapter.setValue(values);
break;
}
}
}
self.fireEvent(BI.Searcher.EVENT_CHANGE, value, obj);
}
});
BI.nextTick(function () {
self.fireEvent(BI.Searcher.EVENT_AFTER_INIT);
});
}
if (o.masker && !BI.Maskers.has(this.getName())) {
BI.Maskers.create(this.getName(), o.adapter, BI.extend({
container: this,
render: this.popupView
}, o.masker), this);
}
},
_startSearch: function () {
this._assertPopupView();
this._stop = false;
this._isSearching = true;
this.fireEvent(BI.Searcher.EVENT_START);
this.popupView.startSearch && this.popupView.startSearch();
// 搜索前先清空dom
// BI.Maskers.get(this.getName()).empty();
BI.nextTick(function (name) {
BI.Maskers.show(name);
}, this.getName());
},
_pauseSearch: function () {
var o = this.options, name = this.getName();
this._stop = true;
BI.nextTick(function (name) {
BI.Maskers.hide(name);
}, this.getName());
if (this._isSearching === true) {
this.popupView && this.popupView.pauseSearch && this.popupView.pauseSearch();
this.fireEvent(BI.Searcher.EVENT_PAUSE);
}
this._isSearching = false;
},
_stopSearch: function () {
var o = this.options, name = this.getName();
this._stop = true;
BI.Maskers.hide(name);
if (this._isSearching === true) {
this.popupView && this.popupView.stopSearch && this.popupView.stopSearch();
this.fireEvent(BI.Searcher.EVENT_STOP);
}
this._isSearching = false;
},
_search: function () {
var self = this, o = this.options, keyword = o.allowSearchBlank ? this.editor.getValue() : this._getLastSearchKeyword();
if (keyword === "" || this._stop) {
return;
}
if (o.isAutoSearch) {
var items = (o.adapter && ((o.adapter.getItems && o.adapter.getItems()) || o.adapter.attr("items"))) || [];
var finding = BI.Func.getSearchResult(items, keyword);
var match = finding.match, find = finding.find;
this.popupView.populate(find, match, keyword);
o.isAutoSync && o.adapter && o.adapter.getValue && this.popupView.setValue(o.adapter.getValue());
self.fireEvent(BI.Searcher.EVENT_SEARCHING);
return;
}
this.popupView.loading && this.popupView.loading();
o.onSearch({
times: 1,
keyword: keyword,
selectedValues: o.adapter && o.adapter.getValue()
}, function (searchResult, matchResult) {
if (!self._stop) {
var args = [].slice.call(arguments);
if (args.length > 0) {
args.push(keyword);
}
BI.Maskers.show(self.getName());
self.popupView.populate.apply(self.popupView, args);
o.isAutoSync && o.adapter && o.adapter.getValue && self.popupView.setValue(o.adapter.getValue());
self.popupView.loaded && self.popupView.loaded();
self.fireEvent(BI.Searcher.EVENT_SEARCHING);
}
});
},
_getLastSearchKeyword: function () {
if (this.isValid()) {
var res = this.editor.getValue().match(/[\S]+/g);
return BI.isNull(res) ? "" : res[res.length - 1];
}
},
setAdapter: function (adapter) {
this.options.adapter = adapter;
BI.Maskers.remove(this.getName());
},
doSearch: function () {
if (this.isSearching()) {
this._search();
}
},
stopSearch: function () {
this._stopSearch();// 先停止搜索,然后再去设置editor为空
// important:停止搜索必须退出编辑状态,这里必须加上try(input框不显示时blur会抛异常)
try {
this.editor.blur();
} catch (e) {
if (!this.editor.blur) {
throw new Error("editor没有实现blur方法");
}
} finally {
this.editor.setValue("");
}
},
isSearching: function () {
return this._isSearching;
},
isViewVisible: function () {
return this.editor.isEnabled() && BI.Maskers.isVisible(this.getName());
},
getView: function () {
return this.popupView;
},
hasMatched: function () {
this._assertPopupView();
return this.popupView.hasMatched();
},
adjustHeight: function () {
if (BI.Maskers.has(this.getName()) && BI.Maskers.get(this.getName()).isVisible()) {
BI.Maskers.show(this.getName());
}
},
adjustView: function () {
this.isViewVisible() && BI.Maskers.show(this.getName());
},
setValue: function (v) {
if (BI.isNull(this.popupView)) {
this.options.popup.value = v;
} else {
this.popupView.setValue(v);
}
},
getKeyword: function () {
return this._getLastSearchKeyword();
},
getKeywords: function () {
return this.editor.getKeywords();
},
getValue: function () {
var o = this.options;
if (o.isAutoSync && o.adapter && o.adapter.getValue) {
return o.adapter.getValue();
}
if (this.isSearching()) {
return this.popupView.getValue();
} else if (o.adapter && o.adapter.getValue) {
return o.adapter.getValue();
}
if (BI.isNull(this.popupView)) {
return o.popup.value;
}
return this.popupView.getValue();
},
populate: function (result, searchResult, keyword) {
var o = this.options;
this._assertPopupView();
this.popupView.populate.apply(this.popupView, arguments);
if (o.isAutoSync && o.adapter && o.adapter.getValue) {
this.popupView.setValue(o.adapter.getValue());
}
},
empty: function () {
this.popupView && this.popupView.empty();
},
destroyed: function () {
BI.Maskers.remove(this.getName());
}
});
BI.Searcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.Searcher.EVENT_START = "EVENT_START";
BI.Searcher.EVENT_STOP = "EVENT_STOP";
BI.Searcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.Searcher.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.Searcher.EVENT_AFTER_INIT = "EVENT_AFTER_INIT";
BI.shortcut("bi.searcher", BI.Searcher);
/***/ }),
/* 387 */
/***/ (function(module, exports) {
/**
*
* 切换显示或隐藏面板
*
* Created by GUY on 2015/11/2.
* @class BI.Switcher
* @extends BI.Widget
*/
BI.Switcher = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Switcher.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-switcher",
direction: BI.Direction.Top,
trigger: "click",
toggle: true,
el: {},
popup: {},
adapter: null,
masker: {},
switcherClass: "bi-switcher-popup",
hoverClass: "bi-switcher-hover"
});
},
_init: function () {
BI.Switcher.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this._initSwitcher();
this._initPullDownAction();
this.switcher.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) {
self._popupView();
}
if (type === BI.Events.COLLAPSE) {
self._hideView();
}
if (type === BI.Events.EXPAND) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.Switcher.EVENT_EXPAND);
}
if (type === BI.Events.COLLAPSE) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.isViewVisible() && self.fireEvent(BI.Switcher.EVENT_COLLAPSE);
}
if (type === BI.Events.CLICK) {
self.fireEvent(BI.Switcher.EVENT_TRIGGER_CHANGE, value, obj);
}
}
});
this.element.hover(function () {
if (self.isEnabled() && self.switcher.isEnabled()) {
self.element.addClass(o.hoverClass);
}
}, function () {
if (self.isEnabled() && self.switcher.isEnabled()) {
self.element.removeClass(o.hoverClass);
}
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [
{el: this.switcher}
]
});
o.isDefaultInit && (this._assertPopupView());
},
_toggle: function () {
this._assertPopupView();
if (this.isExpanded()) {
this._hideView();
} else {
if (this.isEnabled()) {
this._popupView();
}
}
},
_initPullDownAction: function () {
var self = this, o = this.options;
var evs = this.options.trigger.split(",");
BI.each(evs, function (i, e) {
switch (e) {
case "hover":
self.element[e](function (e) {
if (self.isEnabled() && self.switcher.isEnabled()) {
self._popupView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.switcher);
self.fireEvent(BI.Switcher.EVENT_EXPAND);
}
}, function () {
if (self.isEnabled() && self.switcher.isEnabled() && o.toggle) {
self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.switcher);
self.fireEvent(BI.Switcher.EVENT_COLLAPSE);
}
});
break;
default :
if (e) {
self.element.off(e + "." + self.getName()).on(e + "." + self.getName(), BI.debounce(function (e) {
if (self.switcher.element.__isMouseInBounds__(e)) {
if (self.isEnabled() && self.switcher.isEnabled()) {
o.toggle ? self._toggle() : self._popupView();
if (self.isExpanded()) {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.switcher);
self.fireEvent(BI.Switcher.EVENT_EXPAND);
} else {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.switcher);
self.fireEvent(BI.Switcher.EVENT_COLLAPSE);
}
}
}
}, BI.EVENT_RESPONSE_TIME, {
"leading": true,
"trailing": false
}));
}
break;
}
});
},
_initSwitcher: function () {
this.switcher = BI.createWidget(this.options.el, {
value: this.options.value
});
},
_assertPopupView: function () {
var self = this, o = this.options;
if (!this._created) {
this.popupView = BI.createWidget(o.popup, {
type: "bi.button_group",
element: o.adapter && BI.Maskers.create(this.getName(), o.adapter, BI.extend({container: this}, o.masker)),
cls: "switcher-popup",
layouts: [{
type: "bi.vertical",
hgap: 0,
vgap: 0
}],
value: o.value
}, this);
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.Switcher.EVENT_CHANGE, value, obj);
}
});
if (o.direction !== BI.Direction.Custom && !o.adapter) {
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [
{el: this.popupView}
]
});
}
this._created = true;
BI.nextTick(function () {
self.fireEvent(BI.Switcher.EVENT_AFTER_INIT);
});
}
},
_hideView: function () {
this.fireEvent(BI.Switcher.EVENT_BEFORE_HIDEVIEW);
var self = this, o = this.options;
o.adapter ? BI.Maskers.hide(self.getName()) : (self.popupView && self.popupView.setVisible(false));
BI.nextTick(function () {
o.adapter ? BI.Maskers.hide(self.getName()) : (self.popupView && self.popupView.setVisible(false));
self.element.removeClass(o.switcherClass);
self.fireEvent(BI.Switcher.EVENT_AFTER_HIDEVIEW);
});
},
_popupView: function () {
var self = this, o = this.options;
this._assertPopupView();
this.fireEvent(BI.Switcher.EVENT_BEFORE_POPUPVIEW);
o.adapter ? BI.Maskers.show(this.getName()) : self.popupView.setVisible(true);
BI.nextTick(function (name) {
o.adapter ? BI.Maskers.show(name) : self.popupView.setVisible(true);
self.element.addClass(o.switcherClass);
self.fireEvent(BI.Switcher.EVENT_AFTER_POPUPVIEW);
}, this.getName());
},
populate: function (items) {
this._assertPopupView();
this.popupView.populate.apply(this.popupView, arguments);
this.switcher.populate.apply(this.switcher, arguments);
},
_setEnable: function (arg) {
BI.Switcher.superclass._setEnable.apply(this, arguments);
!arg && this.isViewVisible() && this._hideView();
},
setValue: function (v) {
this.switcher.setValue(v);
if (BI.isNull(this.popupView)) {
this.options.popup.value = v;
} else {
this.popupView.setValue(v);
}
},
getValue: function () {
if (BI.isNull(this.popupView)) {
return this.options.popup.value;
} else {
return this.popupView.getValue();
}
},
setAdapter: function (adapter) {
this.options.adapter = adapter;
BI.Maskers.remove(this.getName());
},
isViewVisible: function () {
return this.isEnabled() && this.switcher.isEnabled() &&
(this.options.adapter ? BI.Maskers.isVisible(this.getName()) : (this.popupView && this.popupView.isVisible()));
},
isExpanded: function () {
return this.isViewVisible();
},
showView: function () {
if (this.isEnabled() && this.switcher.isEnabled()) {
this._popupView();
}
},
hideView: function () {
this._hideView();
},
getView: function () {
return this.popupView;
},
adjustView: function () {
this.isViewVisible() && BI.Maskers.show(this.getName());
},
getAllLeaves: function () {
return this.popupView && this.popupView.getAllLeaves();
},
getNodeById: function (id) {
if (this.switcher.attr("id") === id) {
return this.switcher;
}
return this.popupView && this.popupView.getNodeById(id);
},
getNodeByValue: function (value) {
if (this.switcher.getValue() === value) {
return this.switcher;
}
return this.popupView && this.popupView.getNodeByValue(value);
},
empty: function () {
this.popupView && this.popupView.empty();
}
});
BI.Switcher.EVENT_EXPAND = "EVENT_EXPAND";
BI.Switcher.EVENT_COLLAPSE = "EVENT_COLLAPSE";
BI.Switcher.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";
BI.Switcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.Switcher.EVENT_AFTER_INIT = "EVENT_AFTER_INIT";
BI.Switcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.Switcher.EVENT_AFTER_POPUPVIEW = "EVENT_AFTER_POPUPVIEW";
BI.Switcher.EVENT_BEFORE_HIDEVIEW = "EVENT_BEFORE_HIDEVIEW";
BI.Switcher.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.shortcut("bi.switcher", BI.Switcher);
/***/ }),
/* 388 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/6/26.
*/
BI.Tab = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Tab.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-tab",
direction: "top", // top, bottom, left, right, custom
single: false, // 是不是单页面
logic: {
dynamic: false
},
showIndex: false,
tab: false,
cardCreator: function (v) {
return BI.createWidget();
}
});
},
render: function () {
var self = this, o = this.options;
if (BI.isObject(o.tab)) {
this.tab = BI.createWidget(this.options.tab, {type: "bi.button_group"});
this.tab.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
}
this.cardMap = {};
this.layout = BI.createWidget({
type: "bi.card"
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.tab, this.layout)
}))));
var listener = new BI.ShowListener({
eventObj: this.tab,
cardLayout: this.layout,
cardCreator: function (v) {
var card = o.cardCreator.apply(self, arguments);
self.cardMap[v] = card;
return card;
},
afterCardShow: function (v) {
self._deleteOtherCards(v);
self.curr = v;
}
});
listener.on(BI.ShowListener.EVENT_CHANGE, function (value) {
self.fireEvent(BI.Tab.EVENT_CHANGE, value, self);
});
},
_deleteOtherCards: function (currCardName) {
var self = this, o = this.options;
if (o.single === true) {
BI.each(this.cardMap, function (name, card) {
if (name !== (currCardName + "")) {
self.layout.deleteCardByName(name);
delete self.cardMap[name];
}
});
}
},
_assertCard: function (v) {
if (!this.layout.isCardExisted(v)) {
var card = this.options.cardCreator(v);
this.cardMap[v] = card;
this.layout.addCardByName(v, card);
}
},
mounted: function () {
var o = this.options;
if (o.showIndex !== false) {
this.setSelect(o.showIndex);
}
},
setSelect: function (v) {
this.tab && this.tab.setValue(v);
this._assertCard(v);
this.layout.showCardByName(v);
this._deleteOtherCards(v);
if (this.curr !== v) {
this.curr = v;
}
},
removeTab: function (cardname) {
var self = this, o = this.options;
BI.any(this.cardMap, function (name, card) {
if (BI.isEqual(name, (cardname + ""))) {
self.layout.deleteCardByName(name);
delete self.cardMap[name];
return true;
}
});
},
getSelect: function () {
return this.curr;
},
getSelectedTab: function () {
return this.layout.getShowingCard();
},
getTab: function (v) {
this._assertCard(v);
return this.layout.getCardByName(v);
},
setValue: function (v) {
var card = this.layout.getShowingCard();
if (card) {
card.setValue(v);
}
},
getValue: function () {
var card = this.layout.getShowingCard();
if (card) {
return card.getValue();
}
},
populate: function () {
var card = this.layout.getShowingCard();
if (card) {
return card.populate && card.populate.apply(card, arguments);
}
},
empty: function () {
this.layout.deleteAllCard();
this.cardMap = {};
},
destroy: function () {
this.cardMap = {};
BI.Tab.superclass.destroy.apply(this, arguments);
}
});
BI.Tab.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.tab", BI.Tab);
/***/ }),
/* 389 */
/***/ (function(module, exports) {
/**
* 表示当前对象
*
* Created by GUY on 2015/9/7.
* @class BI.EL
* @extends BI.Widget
*/
BI.EL = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.EL.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-el",
el: {},
layout: {}
});
},
_init: function () {
BI.EL.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.ele = BI.createWidget(o.el);
BI.createWidget(o.layout, {
type: "bi.adaptive",
element: this,
items: [this.ele]
});
this.ele.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
},
setValue: function (v) {
this.ele.setValue(v);
},
getValue: function () {
return this.ele.getValue();
},
populate: function () {
this.ele.populate.apply(this, arguments);
}
});
BI.shortcut("bi.el", BI.EL);
/***/ }),
/* 390 */
/***/ (function(module, exports) {
/**
* z-index在1亿层级
* 弹出提示消息框,用于模拟阻塞操作(通过回调函数实现)
* @class BI.Msg
*/
BI.Msg = function () {
var $mask, $pop;
var messageShows = [];
var toastStack = [];
return {
alert: function (title, message, callback) {
this._show(false, title, message, callback);
},
confirm: function (title, message, callback) {
this._show(true, title, message, callback);
},
prompt: function (title, message, value, callback, min_width) {
// BI.Msg.prompt(title, message, value, callback, min_width);
},
toast: function (message, options, context) {
options = options || {};
context = context || BI.Widget._renderEngine.createElement("body");
var level = options.level || "normal";
var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose;
var callback = BI.isFunction(options.callback) ? options.callback : BI.emptyFn;
var toast = BI.createWidget({
type: "bi.toast",
cls: "bi-message-animate bi-message-leave",
level: level,
autoClose: autoClose,
text: message,
listeners: [{
eventName: BI.Toast.EVENT_DESTORY,
action: function () {
BI.remove(toastStack, toast.element);
var _height = 10;
BI.each(toastStack, function (i, element) {
element.css({"top": _height});
_height += element.outerHeight() + 10;
});
callback();
}
}]
});
var height = 10;
BI.each(toastStack, function (i, element) {
height += element.outerHeight() + 10;
});
BI.createWidget({
type: "bi.absolute",
element: context,
items: [{
el: toast,
left: "50%",
top: height
}]
});
toastStack.push(toast.element);
toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2});
toast.element.removeClass("bi-message-leave").addClass("bi-message-enter");
autoClose && BI.delay(function () {
toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
toast.destroy();
}, 5000);
},
_show: function (hasCancel, title, message, callback) {
BI.isNull($mask) && ($mask = BI.Widget._renderEngine.createElement("<div class=\"bi-z-index-mask\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 2,
top: 0,
left: 0,
right: 0,
bottom: 0,
opacity: 0.5
}).appendTo("body"));
$pop = BI.Widget._renderEngine.createElement("<div class=\"bi-message-depend\">").css({
position: "absolute",
zIndex: BI.zIndex_tip - 1,
top: 0,
left: 0,
right: 0,
bottom: 0
}).appendTo("body");
var close = function () {
messageShows[messageShows.length - 1].destroy();
messageShows.pop();
if (messageShows.length === 0) {
$mask.remove();
$mask = null;
}
};
var controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"),
level: "ignore",
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
}
});
}
controlItems.push({
el: {
type: "bi.button",
text: BI.i18nText("BI-Basic_OK"),
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [true]);
}
}
}
});
var conf = {
element: $pop,
type: "bi.center_adapt",
items: [
{
type: "bi.border",
cls: "bi-card",
items: {
north: {
el: {
type: "bi.border",
cls: "bi-message-title bi-background",
items: {
center: {
el: {
type: "bi.label",
cls: "bi-font-bold",
text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: "left",
hgap: 20,
height: 40
}
},
east: {
el: {
type: "bi.icon_button",
cls: "bi-message-close close-font",
// height: 50,
handler: function () {
close();
if (BI.isFunction(callback)) {
callback.apply(null, [false]);
}
}
},
width: 60
}
}
},
height: 40
},
center: {
el: {
type: "bi.label",
vgap: 10,
hgap: 20,
whiteSpace: "normal",
text: message
}
},
south: {
el: {
type: "bi.absolute",
items: [{
el: {
type: "bi.right_vertical_adapt",
lgap: 10,
items: controlItems
},
top: 0,
left: 20,
right: 20,
bottom: 0
}]
},
height: 44
}
},
width: 450,
height: 200
}
]
};
messageShows[messageShows.length] = BI.createWidget(conf);
}
};
}();
/***/ }),
/* 391 */
/***/ (function(module, exports) {
/**
* GridView
*
* Created by GUY on 2016/1/11.
* @class BI.GridView
* @extends BI.Widget
*/
BI.GridView = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.GridView.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-grid-view",
// width: 400, //必设
// height: 300, //必设
overflowX: true,
overflowY: true,
overscanColumnCount: 0,
overscanRowCount: 0,
rowHeightGetter: BI.emptyFn, // number类型或function类型
columnWidthGetter: BI.emptyFn, // number类型或function类型
// estimatedColumnSize: 100, //columnWidthGetter为function时必设
// estimatedRowSize: 30, //rowHeightGetter为function时必设
scrollLeft: 0,
scrollTop: 0,
items: []
});
},
_init: function () {
BI.GridView.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.renderedCells = [];
this.renderedKeys = [];
this.renderRange = {};
this._scrollLock = false;
this._debounceRelease = BI.debounce(function () {
self._scrollLock = false;
}, 1000 / 60);
this.container = BI.createWidget({
type: "bi.absolute"
});
this.element.scroll(function () {
if (self._scrollLock === true) {
return;
}
o.scrollLeft = self.element.scrollLeft();
o.scrollTop = self.element.scrollTop();
self._calculateChildrenToRender();
self.fireEvent(BI.GridView.EVENT_SCROLL, {
scrollLeft: o.scrollLeft,
scrollTop: o.scrollTop
});
});
BI.createWidget({
type: "bi.vertical",
element: this,
scrollable: o.overflowX === true && o.overflowY === true,
scrolly: o.overflowX === false && o.overflowY === true,
scrollx: o.overflowX === true && o.overflowY === false,
items: [this.container]
});
if (o.items.length > 0) {
this._populate();
}
},
mounted: function () {
var o = this.options;
if (o.scrollLeft !== 0 || o.scrollTop !== 0) {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
}
},
_getOverscanIndices: function (cellCount, overscanCellsCount, startIndex, stopIndex) {
return {
overscanStartIndex: Math.max(0, startIndex - overscanCellsCount),
overscanStopIndex: Math.min(cellCount - 1, stopIndex + overscanCellsCount)
};
},
_calculateChildrenToRender: function () {
var self = this, o = this.options;
var width = o.width, height = o.height, scrollLeft = BI.clamp(o.scrollLeft, 0, this._getMaxScrollLeft()),
scrollTop = BI.clamp(o.scrollTop, 0, this._getMaxScrollTop()),
overscanColumnCount = o.overscanColumnCount, overscanRowCount = o.overscanRowCount;
if (height > 0 && width > 0) {
var visibleColumnIndices = this._columnSizeAndPositionManager.getVisibleCellRange(width, scrollLeft);
var visibleRowIndices = this._rowSizeAndPositionManager.getVisibleCellRange(height, scrollTop);
if (BI.isEmpty(visibleColumnIndices) || BI.isEmpty(visibleRowIndices)) {
return;
}
var horizontalOffsetAdjustment = this._columnSizeAndPositionManager.getOffsetAdjustment(width, scrollLeft);
var verticalOffsetAdjustment = this._rowSizeAndPositionManager.getOffsetAdjustment(height, scrollTop);
this._renderedColumnStartIndex = visibleColumnIndices.start;
this._renderedColumnStopIndex = visibleColumnIndices.stop;
this._renderedRowStartIndex = visibleRowIndices.start;
this._renderedRowStopIndex = visibleRowIndices.stop;
var overscanColumnIndices = this._getOverscanIndices(this.columnCount, overscanColumnCount, this._renderedColumnStartIndex, this._renderedColumnStopIndex);
var overscanRowIndices = this._getOverscanIndices(this.rowCount, overscanRowCount, this._renderedRowStartIndex, this._renderedRowStopIndex);
var columnStartIndex = overscanColumnIndices.overscanStartIndex;
var columnStopIndex = overscanColumnIndices.overscanStopIndex;
var rowStartIndex = overscanRowIndices.overscanStartIndex;
var rowStopIndex = overscanRowIndices.overscanStopIndex;
// 算区间size
var minRowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStartIndex);
var minColumnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStartIndex);
var maxRowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStopIndex);
var maxColumnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStopIndex);
var top = minRowDatum.offset + verticalOffsetAdjustment;
var left = minColumnDatum.offset + horizontalOffsetAdjustment;
var bottom = maxRowDatum.offset + verticalOffsetAdjustment + maxRowDatum.size;
var right = maxColumnDatum.offset + horizontalOffsetAdjustment + maxColumnDatum.size;
// 如果滚动的区间并没有超出渲染的范围
if (top >= this.renderRange.minY && bottom <= this.renderRange.maxY && left >= this.renderRange.minX && right <= this.renderRange.maxX) {
return;
}
var renderedCells = [], renderedKeys = {}, renderedWidgets = {};
var minX = this._getMaxScrollLeft(), minY = this._getMaxScrollTop(), maxX = 0, maxY = 0;
var count = 0;
for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
var rowDatum = this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex);
for (var columnIndex = columnStartIndex; columnIndex <= columnStopIndex; columnIndex++) {
var key = rowIndex + "-" + columnIndex;
var columnDatum = this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex);
var index = this.renderedKeys[key] && this.renderedKeys[key][2];
var child;
if (index >= 0) {
if (columnDatum.size !== this.renderedCells[index]._width) {
this.renderedCells[index]._width = columnDatum.size;
this.renderedCells[index].el.setWidth(columnDatum.size);
}
if (rowDatum.size !== this.renderedCells[index]._height) {
this.renderedCells[index]._height = rowDatum.size;
this.renderedCells[index].el.setHeight(rowDatum.size);
}
if (this.renderedCells[index]._left !== columnDatum.offset + horizontalOffsetAdjustment) {
this.renderedCells[index].el.element.css("left", (columnDatum.offset + horizontalOffsetAdjustment) + "px");
}
if (this.renderedCells[index]._top !== rowDatum.offset + verticalOffsetAdjustment) {
this.renderedCells[index].el.element.css("top", (rowDatum.offset + verticalOffsetAdjustment) + "px");
}
renderedCells.push(child = this.renderedCells[index]);
} else {
child = BI.createWidget(BI.extend({
type: "bi.label",
width: columnDatum.size,
height: rowDatum.size
}, o.items[rowIndex][columnIndex], {
cls: (o.items[rowIndex][columnIndex].cls || "") + " grid-cell" + (rowIndex === 0 ? " first-row" : "") + (columnIndex === 0 ? " first-col" : ""),
_rowIndex: rowIndex,
_columnIndex: columnIndex,
_left: columnDatum.offset + horizontalOffsetAdjustment,
_top: rowDatum.offset + verticalOffsetAdjustment
}), this);
renderedCells.push({
el: child,
left: columnDatum.offset + horizontalOffsetAdjustment,
top: rowDatum.offset + verticalOffsetAdjustment,
_left: columnDatum.offset + horizontalOffsetAdjustment,
_top: rowDatum.offset + verticalOffsetAdjustment,
_width: columnDatum.size,
_height: rowDatum.size
});
}
minX = Math.min(minX, columnDatum.offset + horizontalOffsetAdjustment);
maxX = Math.max(maxX, columnDatum.offset + horizontalOffsetAdjustment + columnDatum.size);
minY = Math.min(minY, rowDatum.offset + verticalOffsetAdjustment);
maxY = Math.max(maxY, rowDatum.offset + verticalOffsetAdjustment + rowDatum.size);
renderedKeys[key] = [rowIndex, columnIndex, count];
renderedWidgets[count] = child;
count++;
}
}
// 已存在的, 需要添加的和需要删除的
var existSet = {}, addSet = {}, deleteArray = [];
BI.each(renderedKeys, function (i, key) {
if (self.renderedKeys[i]) {
existSet[i] = key;
} else {
addSet[i] = key;
}
});
BI.each(this.renderedKeys, function (i, key) {
if (existSet[i]) {
return;
}
if (addSet[i]) {
return;
}
deleteArray.push(key[2]);
});
BI.each(deleteArray, function (i, index) {
// 性能优化,不调用destroy方法防止触发destroy事件
self.renderedCells[index].el._destroy();
});
var addedItems = [];
BI.each(addSet, function (index, key) {
addedItems.push(renderedCells[key[2]]);
});
// 与listview一样, 给上下文
this.container.addItems(addedItems, this);
// 拦截父子级关系
this.container._children = renderedWidgets;
this.container.attr("items", renderedCells);
this.renderedCells = renderedCells;
this.renderedKeys = renderedKeys;
this.renderRange = {minX: minX, minY: minY, maxX: maxX, maxY: maxY};
}
},
/**
* 获取真实的可滚动的最大宽度
* 对于grid_view如果没有全部渲染过,this._columnSizeAndPositionManager.getTotalSize获取的宽度是不准确的
* 因此在调用setScrollLeft等函数时会造成没法移动到最右端(预估可移动具体太短)
*/
_getRealMaxScrollLeft: function () {
var o = this.options;
var totalWidth = 0;
BI.count(0, this.columnCount, function (index) {
totalWidth += o.columnWidthGetter(index);
});
return Math.max(0, totalWidth - this.options.width + (this.options.overflowX ? BI.DOM.getScrollWidth() : 0));
},
_getMaxScrollLeft: function () {
return Math.max(0, this._columnSizeAndPositionManager.getTotalSize() - this.options.width + (this.options.overflowX ? BI.DOM.getScrollWidth() : 0));
},
_getMaxScrollTop: function () {
return Math.max(0, this._rowSizeAndPositionManager.getTotalSize() - this.options.height + (this.options.overflowY ? BI.DOM.getScrollWidth() : 0));
},
_populate: function (items) {
var self = this, o = this.options;
this._reRange();
this.columnCount = 0;
this.rowCount = 0;
if (items && items !== this.options.items) {
this.options.items = items;
}
if (BI.isNumber(o.columnCount)) {
this.columnCount = o.columnCount;
} else if (o.items.length > 0) {
this.columnCount = o.items[0].length;
}
if (BI.isNumber(o.rowCount)) {
this.rowCount = o.rowCount;
} else {
this.rowCount = o.items.length;
}
this.container.setWidth(this.columnCount * o.estimatedColumnSize);
this.container.setHeight(this.rowCount * o.estimatedRowSize);
this._columnSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.columnCount, o.columnWidthGetter, o.estimatedColumnSize);
this._rowSizeAndPositionManager = new BI.ScalingCellSizeAndPositionManager(this.rowCount, o.rowHeightGetter, o.estimatedRowSize);
this._calculateChildrenToRender();
// 元素未挂载时不能设置scrollTop
try {
this.element.scrollTop(o.scrollTop);
this.element.scrollLeft(o.scrollLeft);
} catch (e) {
}
},
setScrollLeft: function (scrollLeft) {
if (this.options.scrollLeft === scrollLeft) {
return;
}
this._scrollLock = true;
this.options.scrollLeft = BI.clamp(scrollLeft || 0, 0, this._getRealMaxScrollLeft());
this._debounceRelease();
this._calculateChildrenToRender();
this.element.scrollLeft(this.options.scrollLeft);
},
setScrollTop: function (scrollTop) {
if (this.options.scrollTop === scrollTop) {
return;
}
this._scrollLock = true;
this.options.scrollTop = BI.clamp(scrollTop || 0, 0, this._getMaxScrollTop());
this._debounceRelease();
this._calculateChildrenToRender();
this.element.scrollTop(this.options.scrollTop);
},
setColumnCount: function (columnCount) {
this.options.columnCount = columnCount;
},
setRowCount: function (rowCount) {
this.options.rowCount = rowCount;
},
setOverflowX: function (b) {
var self = this;
if (this.options.overflowX !== !!b) {
this.options.overflowX = !!b;
BI.nextTick(function () {
self.element.css({overflowX: b ? "auto" : "hidden"});
});
}
},
setOverflowY: function (b) {
var self = this;
if (this.options.overflowY !== !!b) {
this.options.overflowY = !!b;
BI.nextTick(function () {
self.element.css({overflowY: b ? "auto" : "hidden"});
});
}
},
getScrollLeft: function () {
return this.options.scrollLeft;
},
getScrollTop: function () {
return this.options.scrollTop;
},
getMaxScrollLeft: function () {
return this._getMaxScrollLeft();
},
getMaxScrollTop: function () {
return this._getMaxScrollTop();
},
setEstimatedColumnSize: function (width) {
this.options.estimatedColumnSize = width;
},
setEstimatedRowSize: function (height) {
this.options.estimatedRowSize = height;
},
// 重新计算children
_reRange: function () {
this.renderRange = {};
},
_clearChildren: function () {
this.container._children = {};
this.container.attr("items", []);
},
restore: function () {
BI.each(this.renderedCells, function (i, cell) {
cell.el._destroy();
});
this._clearChildren();
this.renderedCells = [];
this.renderedKeys = [];
this.renderRange = {};
this._scrollLock = false;
},
populate: function (items) {
if (items && items !== this.options.items) {
this.restore();
}
this._populate(items);
}
});
BI.GridView.EVENT_SCROLL = "EVENT_SCROLL";
BI.shortcut("bi.grid_view", BI.GridView);
/***/ }),
/* 392 */
/***/ (function(module, exports) {
/**
* Popover弹出层,
* @class BI.Popover
* @extends BI.Widget
*/
BI.Popover = BI.inherit(BI.Widget, {
_constant: {
SIZE: {
SMALL: "small",
NORMAL: "normal",
BIG: "big"
},
HEADER_HEIGHT: 40
},
_defaultConfig: function () {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popover bi-card bi-border-radius",
// width: 600,
// height: 500,
size: "normal", // small, normal, big
logic: {
dynamic: false
},
header: null,
body: null,
footer: null,
closable: true // BI-40839 是否显示右上角的关闭按钮
});
},
render: function () {
var self = this, o = this.options;
this.startX = 0;
this.startY = 0;
this.tracker = new BI.MouseMoveTracker(function (deltaX, deltaY) {
var size = self._calculateSize();
var W = BI.Widget._renderEngine.createElement("body").width(), H = BI.Widget._renderEngine.createElement("body").height();
self.startX += deltaX;
self.startY += deltaY;
self.element.css({
left: BI.clamp(self.startX, 0, W - self.element.width()) + "px",
top: BI.clamp(self.startY, 0, H - self.element.height()) + "px"
});
// BI-12134 没有什么特别好的方法
BI.Resizers._resize();
}, function () {
self.tracker.releaseMouseMoves();
}, _global);
var items = [{
el: {
type: "bi.htape",
cls: "bi-message-title bi-header-background",
ref: function (_ref) {
self.dragger = _ref;
},
items: [{
type: "bi.absolute",
items: [{
el: BI.isPlainObject(o.header) ? BI.createWidget(o.header, {
extraCls: "bi-font-bold"
}) : {
type: "bi.label",
cls: "bi-font-bold",
height: this._constant.HEADER_HEIGHT,
text: o.header,
title: o.header,
textAlign: "left"
},
left: 20,
top: 0,
right: 0,
bottom: 0
}]
}, {
el: o.closable ? {
type: "bi.icon_button",
cls: "bi-message-close close-font",
height: this._constant.HEADER_HEIGHT,
handler: function () {
self.close();
}
} : {
type: "bi.layout"
},
width: 56
}],
height: this._constant.HEADER_HEIGHT
},
height: this._constant.HEADER_HEIGHT
}, {
el: o.logic.dynamic ? {
type: "bi.vertical",
scrolly: false,
cls: "popover-body",
ref: function () {
self.body = this;
},
hgap: 20,
tgap: 10,
items: [{
el: BI.createWidget(o.body)
}]
} : {
type: "bi.absolute",
items: [{
el: BI.createWidget(o.body),
left: 20,
top: 10,
right: 20,
bottom: 0
}]
}
}];
if (o.footer) {
items.push({
el: {
type: "bi.absolute",
items: [{
el: BI.createWidget(o.footer),
left: 20,
top: 0,
right: 20,
bottom: 0
}],
height: 44
},
height: 44
});
}
var size = this._calculateSize();
return BI.extend({
type: o.logic.dynamic ? "bi.vertical" : "bi.vtape",
items: items,
width: size.width
}, o.logic.dynamic ? {
type: "bi.vertical",
scrolly: false
} : {
type: "bi.vtape",
height: size.height
});
},
mounted: function () {
var self = this, o = this.options;
this.dragger.element.mousedown(function (e) {
var pos = self.element.offset();
self.startX = pos.left;
self.startY = pos.top;
self.tracker.captureMouseMoves(e);
});
if (o.logic.dynamic) {
var size = this._calculateSize();
var height = this.element.height();
var compareHeight = BI.clamp(height, size.height, 600) - (o.footer ? 84 : 44);
this.body.element.height(compareHeight);
}
},
_calculateSize: function () {
var o = this.options;
var size = {};
if (BI.isNotNull(o.size)) {
switch (o.size) {
case this._constant.SIZE.SMALL:
size.width = 450;
size.height = 200;
break;
case this._constant.SIZE.BIG:
size.width = 900;
size.height = 500;
break;
default:
size.width = 550;
size.height = 500;
}
}
return {
width: o.width || size.width,
height: o.height || size.height
};
},
hide: function () {
},
open: function () {
this.show();
this.fireEvent(BI.Popover.EVENT_OPEN, arguments);
},
close: function () {
this.hide();
this.fireEvent(BI.Popover.EVENT_CLOSE, arguments);
},
setZindex: function (zindex) {
this.element.css({"z-index": zindex});
},
destroyed: function () {
}
});
BI.shortcut("bi.popover", BI.Popover);
BI.BarPopover = BI.inherit(BI.Popover, {
_defaultConfig: function () {
return BI.extend(BI.BarPopover.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText("BI-Basic_Sure"), BI.i18nText("BI-Basic_Cancel")]
});
},
beforeCreate: function () {
var self = this, o = this.options;
o.footer || (o.footer = {
type: "bi.right_vertical_adapt",
lgap: 10,
items: [{
type: "bi.button",
text: this.options.btns[1],
value: 1,
level: "ignore",
handler: function (v) {
self.fireEvent(BI.Popover.EVENT_CANCEL, v);
self.close(v);
}
}, {
type: "bi.button",
text: this.options.btns[0],
warningTitle: o.warningTitle,
value: 0,
handler: function (v) {
self.fireEvent(BI.Popover.EVENT_CONFIRM, v);
self.close(v);
}
}]
});
}
});
BI.shortcut("bi.bar_popover", BI.BarPopover);
BI.Popover.EVENT_CLOSE = "EVENT_CLOSE";
BI.Popover.EVENT_OPEN = "EVENT_OPEN";
BI.Popover.EVENT_CANCEL = "EVENT_CANCEL";
BI.Popover.EVENT_CONFIRM = "EVENT_CONFIRM";
/***/ }),
/* 393 */
/***/ (function(module, exports) {
/**
* 下拉框弹出层, zIndex在1000w
* @class BI.PopupView
* @extends BI.Widget
*/
BI.PopupView = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this, arguments), {
_baseCls: "bi-popup-view",
maxWidth: "auto",
minWidth: 100,
// maxHeight: 200,
minHeight: 24,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
vgap: 0,
hgap: 0,
innerVGap: 0,
direction: BI.Direction.Top, // 工具栏的方向
stopEvent: false, // 是否停止mousedown、mouseup事件
stopPropagation: false, // 是否停止mousedown、mouseup向上冒泡
logic: {
dynamic: true
},
tool: false, // 自定义工具栏
tabs: [], // 导航栏
buttons: [], // toolbar栏
el: {
type: "bi.button_group",
items: [],
chooseType: 0,
behaviors: {},
layouts: [{
type: "bi.vertical"
}]
}
});
},
_init: function () {
BI.PopupView.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var fn = function (e) {
e.stopPropagation();
}, stop = function (e) {
e.stopEvent();
return false;
};
this.element.css({
"z-index": BI.zIndex_popup,
"min-width": o.minWidth + "px",
"max-width": o.maxWidth + "px"
}).bind({click: fn});
this.element.bind("mousewheel", fn);
o.stopPropagation && this.element.bind({mousedown: fn, mouseup: fn, mouseover: fn});
o.stopEvent && this.element.bind({mousedown: stop, mouseup: stop, mouseover: stop});
this.tool = this._createTool();
this.tab = this._createTab();
this.view = this._createView();
this.toolbar = this._createToolBar();
this.view.on(BI.Controller.EVENT_CHANGE, function (type) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.PopupView.EVENT_CHANGE);
}
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, {
scrolly: false,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
vgap: o.vgap,
hgap: o.hgap,
items: BI.LogicFactory.createLogicItemsByDirection(o.direction,
BI.extend({
cls: "list-view-outer bi-card list-view-shadow"
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.tool, this.tab, this.view, this.toolbar)
})))
)
}))));
},
_createView: function () {
var o = this.options;
this.button_group = BI.createWidget(o.el, {type: "bi.button_group", value: o.value});
this.button_group.element.css({"min-height": o.minHeight + "px", "padding-top": o.innerVGap + "px", "padding-bottom": o.innerVGap + "px"});
return this.button_group;
},
_createTool: function () {
var o = this.options;
if (false === o.tool) {
return;
}
return BI.createWidget(o.tool);
},
_createTab: function () {
var o = this.options;
if (o.tabs.length === 0) {
return;
}
return BI.createWidget({
type: "bi.center",
cls: "list-view-tab",
height: 25,
items: o.tabs,
value: o.value
});
},
_createToolBar: function () {
var o = this.options;
if (o.buttons.length === 0) {
return;
}
return BI.createWidget({
type: "bi.center",
cls: "list-view-toolbar bi-high-light bi-split-top",
height: 24,
items: BI.createItems(o.buttons, {
once: false,
shadow: true,
isShadowShowingOnSelected: true
})
});
},
getView: function () {
return this.view;
},
populate: function (items) {
this.view.populate.apply(this.view, arguments);
},
resetWidth: function (w) {
this.options.width = w;
this.element.width(w);
},
resetHeight: function (h) {
var tbHeight = this.toolbar ? (this.toolbar.attr("height") || 24) : 0,
tabHeight = this.tab ? (this.tab.attr("height") || 24) : 0,
toolHeight = ((this.tool && this.tool.attr("height")) || 24) * ((this.tool && this.tool.isVisible()) ? 1 : 0);
var resetHeight = h - tbHeight - tabHeight - toolHeight - 2 * this.options.innerVGap;
this.view.resetHeight ? this.view.resetHeight(resetHeight) :
this.view.element.css({"max-height": resetHeight + "px"});
},
setValue: function (selectedValues) {
this.tab && this.tab.setValue(selectedValues);
this.view.setValue(selectedValues);
},
getValue: function () {
return this.view.getValue();
}
});
BI.PopupView.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.popup_view", BI.PopupView);
/***/ }),
/* 394 */
/***/ (function(module, exports) {
/**
* 搜索面板
*
* Created by GUY on 2015/9/28.
* @class BI.SearcherView
* @extends BI.Pane
*/
BI.SearcherView = BI.inherit(BI.Pane, {
_defaultConfig: function () {
var conf = BI.SearcherView.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-searcher-view bi-card",
tipText: BI.i18nText("BI-No_Select"),
chooseType: BI.Selection.Single,
matcher: {// 完全匹配的构造器
type: "bi.button_group",
behaviors: {
redmark: function () {
return true;
}
},
items: [],
layouts: [{
type: "bi.vertical"
}]
},
searcher: {
type: "bi.button_group",
behaviors: {
redmark: function () {
return true;
}
},
items: [],
layouts: [{
type: "bi.vertical"
}]
}
});
},
_init: function () {
BI.SearcherView.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.matcher = BI.createWidget(o.matcher, {
type: "bi.button_group",
chooseType: o.chooseType,
behaviors: {
redmark: function () {
return true;
}
},
layouts: [{
type: "bi.vertical"
}],
value: o.value
});
this.matcher.on(BI.Controller.EVENT_CHANGE, function (type, val, ob) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.SearcherView.EVENT_CHANGE, val, ob);
}
});
this.spliter = BI.createWidget({
type: "bi.vertical",
height: 1,
hgap: 10,
items: [{
type: "bi.layout",
height: 1,
cls: "searcher-view-spliter bi-background"
}]
});
this.searcher = BI.createWidget(o.searcher, {
type: "bi.button_group",
chooseType: o.chooseType,
behaviors: {
redmark: function () {
return true;
}
},
layouts: [{
type: "bi.vertical"
}],
value: o.value
});
this.searcher.on(BI.Controller.EVENT_CHANGE, function (type, val, ob) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.SearcherView.EVENT_CHANGE, val, ob);
}
});
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.matcher, this.spliter, this.searcher]
});
},
startSearch: function () {
},
stopSearch: function () {
},
setValue: function (v) {
this.matcher.setValue(v);
this.searcher.setValue(v);
},
getValue: function () {
return this.matcher.getValue().concat(this.searcher.getValue());
},
populate: function (searchResult, matchResult, keyword) {
searchResult || (searchResult = []);
matchResult || (matchResult = []);
this.setTipVisible(searchResult.length + matchResult.length === 0);
this.spliter.setVisible(BI.isNotEmptyArray(matchResult) && BI.isNotEmptyArray(searchResult));
this.matcher.populate(matchResult, keyword);
this.searcher.populate(searchResult, keyword);
},
empty: function () {
this.searcher.empty();
this.matcher.empty();
},
hasMatched: function () {
return this.matcher.getAllButtons().length > 0;
}
});
BI.SearcherView.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.searcher_view", BI.SearcherView);
/***/ }),
/* 395 */
/***/ (function(module, exports) {
/**
* 表示当前对象
*
* Created by GUY on 2017/5/23.
* @class BI.ListView
* @extends BI.Widget
*/
BI.ListView = BI.inherit(BI.Widget, {
props: function () {
return {
baseCls: "bi-list-view",
overscanHeight: 100,
blockSize: 10,
scrollTop: 0,
el: {},
items: []
};
},
init: function () {
var self = this;
this.renderedIndex = -1;
this.cache = {};
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vertical",
items: [BI.extend({
type: "bi.vertical",
scrolly: false,
ref: function () {
self.container = this;
}
}, o.el)],
element: this
};
},
mounted: function () {
var self = this, o = this.options;
this._populate();
this.element.scroll(function (e) {
o.scrollTop = self.element.scrollTop();
self._calculateBlocksToRender();
});
var lastWidth = this.element.width(),
lastHeight = this.element.height();
BI.ResizeDetector.addResizeListener(this, function () {
var width = self.element.width(),
height = self.element.height();
if (width !== lastWidth || height !== lastHeight) {
lastWidth = width;
lastHeight = height;
self._calculateBlocksToRender();
}
});
},
_renderMoreIf: function () {
var self = this, o = this.options;
var height = this.element.height();
var minContentHeight = o.scrollTop + height + o.overscanHeight;
var index = (this.cache[this.renderedIndex] && (this.cache[this.renderedIndex].index + o.blockSize)) || 0,
cnt = this.renderedIndex + 1;
var lastHeight;
var getElementHeight = function () {
return self.container.element.height();
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
scrollTop: lastHeight,
height: addedHeight
};
this.renderedIndex = cnt;
cnt++;
index += o.blockSize;
}
},
_calculateBlocksToRender: function () {
var o = this.options;
this._renderMoreIf();
},
_populate: function (items) {
var o = this.options;
if (items && this.options.items !== items) {
this.options.items = items;
}
this._calculateBlocksToRender();
this.element.scrollTop(o.scrollTop);
},
restore: function () {
this.renderedIndex = -1;
this.container.empty();
this.cache = {};
},
populate: function (items) {
if (items && this.options.items !== items) {
this.restore();
}
this._populate(items);
},
destroyed: function () {
this.restore();
}
});
BI.shortcut("bi.list_view", BI.ListView);
/***/ }),
/* 396 */
/***/ (function(module, exports) {
/**
* 表示当前对象
*
* Created by GUY on 2017/5/22.
* @class BI.VirtualList
* @extends BI.Widget
*/
BI.VirtualList = BI.inherit(BI.Widget, {
props: function () {
return {
baseCls: "bi-virtual-list",
overscanHeight: 100,
blockSize: 10,
scrollTop: 0,
items: []
};
},
init: function () {
var self = this;
this.renderedIndex = -1;
this.cache = {};
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vertical",
items: [{
type: "bi.layout",
ref: function () {
self.topBlank = this;
}
}, {
type: "bi.vertical",
scrolly: false,
ref: function () {
self.container = this;
}
}, {
type: "bi.layout",
ref: function () {
self.bottomBlank = this;
}
}],
element: this
};
},
mounted: function () {
var self = this, o = this.options;
this._populate();
this.element.scroll(function (e) {
o.scrollTop = self.element.scrollTop();
self._calculateBlocksToRender();
});
BI.ResizeDetector.addResizeListener(this, function () {
self._calculateBlocksToRender();
});
},
_renderMoreIf: function () {
var self = this, o = this.options;
var height = this.element.height();
var minContentHeight = o.scrollTop + height + o.overscanHeight;
var index = (this.cache[this.renderedIndex] && (this.cache[this.renderedIndex].index + o.blockSize)) || 0,
cnt = this.renderedIndex + 1;
var lastHeight;
var getElementHeight = function () {
return self.container.element.height() + self.topBlank.element.height() + self.bottomBlank.element.height();
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
scrollTop: lastHeight,
height: addedHeight
};
this.tree.set(cnt, addedHeight);
this.renderedIndex = cnt;
cnt++;
index += o.blockSize;
}
},
_calculateBlocksToRender: function () {
var o = this.options;
this._renderMoreIf();
var height = this.element.height();
var minContentHeightFrom = o.scrollTop - o.overscanHeight;
var minContentHeightTo = o.scrollTop + height + o.overscanHeight;
var start = this.tree.greatestLowerBound(minContentHeightFrom);
var end = this.tree.leastUpperBound(minContentHeightTo);
var needDestroyed = [];
for (var i = 0; i < start; i++) {
var index = this.cache[i].index;
if (!this.cache[i].destroyed) {
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) {
needDestroyed.push(this.container._children[j]);
this.container._children[j] = null;
}
this.cache[i].destroyed = true;
}
}
for (var i = end + 1; i <= this.renderedIndex; i++) {
var index = this.cache[i].index;
if (!this.cache[i].destroyed) {
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) {
needDestroyed.push(this.container._children[j]);
this.container._children[j] = null;
}
this.cache[i].destroyed = true;
}
}
var firstFragment = BI.Widget._renderEngine.createFragment(),
lastFragment = BI.Widget._renderEngine.createFragment();
var currentFragment = firstFragment;
for (var i = (start < 0 ? 0 : start); i <= end && i <= this.renderedIndex; i++) {
var index = this.cache[i].index;
if (!this.cache[i].destroyed) {
currentFragment = lastFragment;
}
if (this.cache[i].destroyed === true) {
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) {
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])), this);
currentFragment.appendChild(w.element[0]);
}
this.cache[i].destroyed = false;
}
}
this.container.element.prepend(firstFragment);
this.container.element.append(lastFragment);
this.topBlank.setHeight(this.tree.sumTo(Math.max(-1, start - 1)));
this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex) - this.tree.sumTo(Math.min(end, this.renderedIndex)));
BI.each(needDestroyed, function (i, child) {
child && child._destroy();
});
},
_populate: function (items) {
var o = this.options;
if (items && this.options.items !== items) {
this.options.items = items;
}
this.tree = BI.PrefixIntervalTree.empty(Math.ceil(o.items.length / o.blockSize));
this._calculateBlocksToRender();
try {
this.element.scrollTop(o.scrollTop);
} catch (e) {
}
},
_clearChildren: function () {
BI.each(this.container._children, function (i, cell) {
cell && cell._destroy();
});
this.container._children = {};
this.container.attr("items", []);
},
restore: function () {
this.renderedIndex = -1;
this._clearChildren();
this.cache = {};
this.options.scrollTop = 0;
// 依赖于cache的占位元素也要初始化
this.topBlank.setHeight(0);
this.bottomBlank.setHeight(0);
},
populate: function (items) {
if (items && this.options.items !== items) {
this.restore();
}
this._populate(items);
},
destroyed: function () {
this.restore();
}
});
BI.shortcut("bi.virtual_list", BI.VirtualList);
/***/ }),
/* 397 */
/***/ (function(module, exports) {
/**
* 分页控件
*
* Created by GUY on 2015/8/31.
* @class BI.Pager
* @extends BI.Widget
*/
BI.Pager = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Pager.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-pager",
behaviors: {},
layouts: [{
type: "bi.horizontal",
hgap: 10,
vgap: 0
}],
dynamicShow: true, // 是否动态显示上一页、下一页、首页、尾页, 若为false,则指对其设置使能状态
// dynamicShow为false时以下两个有用
dynamicShowFirstLast: false, // 是否动态显示首页、尾页
dynamicShowPrevNext: false, // 是否动态显示上一页、下一页
pages: false, // 总页数
curr: function () {
return 1;
}, // 初始化当前页
groups: 0, // 连续显示分页数
jump: BI.emptyFn, // 分页的回调函数
first: false, // 是否显示首页
last: false, // 是否显示尾页
prev: "上一页",
next: "下一页",
firstPage: 1,
lastPage: function () { // 在万不得已时才会调用这个函数获取最后一页的页码, 主要作用于setValue方法
return 1;
},
hasPrev: BI.emptyFn, // pages不可用时有效
hasNext: BI.emptyFn // pages不可用时有效
});
},
_init: function () {
BI.Pager.superclass._init.apply(this, arguments);
var self = this;
this.currPage = BI.result(this.options, "curr");
// 翻页太灵敏
// this._lock = false;
// this._debouce = BI.debounce(function () {
// self._lock = false;
// }, 300);
this._populate();
},
_populate: function () {
var self = this, o = this.options, view = [], dict = {};
this.empty();
var pages = BI.result(o, "pages");
var curr = BI.result(this, "currPage");
var groups = BI.result(o, "groups");
var first = BI.result(o, "first");
var last = BI.result(o, "last");
var prev = BI.result(o, "prev");
var next = BI.result(o, "next");
if (pages === false) {
groups = 0;
first = false;
last = false;
} else {
groups > pages && (groups = pages);
}
// 计算当前组
dict.index = Math.ceil((curr + ((groups > 1 && groups !== pages) ? 1 : 0)) / (groups === 0 ? 1 : groups));
// 当前页非首页,则输出上一页
if (((!o.dynamicShow && !o.dynamicShowPrevNext) || curr > 1) && prev !== false) {
if (BI.isKey(prev)) {
view.push({
text: prev,
value: "prev",
disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false)
});
} else {
view.push(BI.extend({
disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false)
}, prev));
}
}
// 当前组非首组,则输出首页
if (((!o.dynamicShow && !o.dynamicShowFirstLast) || (dict.index > 1 && groups !== 0)) && first) {
view.push({
text: first,
value: "first",
disabled: !(dict.index > 1 && groups !== 0)
});
if (dict.index > 1 && groups !== 0) {
view.push({
type: "bi.label",
cls: "page-ellipsis",
text: "\u2026"
});
}
}
// 输出当前页组
dict.poor = Math.floor((groups - 1) / 2);
dict.start = dict.index > 1 ? curr - dict.poor : 1;
dict.end = dict.index > 1 ? (function () {
var max = curr + (groups - dict.poor - 1);
return max > pages ? pages : max;
}()) : groups;
if (dict.end - dict.start < groups - 1) { // 最后一组状态
dict.start = dict.end - groups + 1;
}
var s = dict.start, e = dict.end;
if (first && last && (dict.index > 1 && groups !== 0) && (pages > groups && dict.end < pages && groups !== 0)) {
s++;
e--;
}
for (; s <= e; s++) {
if (s === curr) {
view.push({
text: s,
value: s,
selected: true
});
} else {
view.push({
text: s,
value: s
});
}
}
// 总页数大于连续分页数,且当前组最大页小于总页,输出尾页
if (((!o.dynamicShow && !o.dynamicShowFirstLast) || (pages > groups && dict.end < pages && groups !== 0)) && last) {
if (pages > groups && dict.end < pages && groups !== 0) {
view.push({
type: "bi.label",
cls: "page-ellipsis",
text: "\u2026"
});
}
view.push({
text: last,
value: "last",
disabled: !(pages > groups && dict.end < pages && groups !== 0)
});
}
// 当前页不为尾页时,输出下一页
dict.flow = !prev && groups === 0;
if (((!o.dynamicShow && !o.dynamicShowPrevNext) && next) || (curr !== pages && next || dict.flow)) {
view.push((function () {
if (BI.isKey(next)) {
if (pages === false) {
return {text: next, value: "next", disabled: o.hasNext(curr) === false};
}
return (dict.flow && curr === pages)
?
{text: next, value: "next", disabled: true}
:
{text: next, value: "next", disabled: !(curr !== pages && next || dict.flow)};
}
return BI.extend({
disabled: pages === false ? o.hasNext(curr) === false : !(curr !== pages && next || dict.flow)
}, next);
}()));
}
this.button_group = BI.createWidget({
type: "bi.button_group",
element: this,
items: BI.createItems(view, {
cls: "bi-list-item-select bi-border-radius",
height: 23,
hgap: 10
}),
behaviors: o.behaviors,
layouts: o.layouts
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
// if (self._lock === true) {
// return;
// }
// self._lock = true;
// self._debouce();
if (type === BI.Events.CLICK) {
var v = self.button_group.getValue()[0];
switch (v) {
case "first":
self.currPage = 1;
break;
case "last":
self.currPage = pages;
break;
case "prev":
self.currPage--;
break;
case "next":
self.currPage++;
break;
default:
self.currPage = v;
break;
}
o.jump.apply(self, [{
pages: pages,
curr: self.currPage
}]);
self._populate();
self.fireEvent(BI.Pager.EVENT_CHANGE, obj);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.fireEvent(BI.Pager.EVENT_AFTER_POPULATE);
},
getCurrentPage: function () {
return this.currPage;
},
setAllPages: function (pages) {
this.options.pages = pages;
},
hasPrev: function (v) {
v || (v = 1);
var o = this.options;
var pages = this.options.pages;
return pages === false ? o.hasPrev(v) : v > 1;
},
hasNext: function (v) {
v || (v = 1);
var o = this.options;
var pages = this.options.pages;
return pages === false ? o.hasNext(v) : v < pages;
},
setValue: function (v) {
var o = this.options;
v = v || 0;
v = v < 1 ? 1 : v;
if (o.pages === false) {
var lastPage = BI.result(o, "lastPage"), firstPage = 1;
this.currPage = v > lastPage ? lastPage : ((firstPage = BI.result(o, "firstPage")), (v < firstPage ? firstPage : v));
} else {
v = v > o.pages ? o.pages : v;
this.currPage = v;
}
this._populate();
},
getValue: function () {
var val = this.button_group.getValue()[0];
switch (val) {
case "prev":
return -1;
case "next":
return 1;
case "first":
return BI.MIN;
case "last":
return BI.MAX;
default :
return val;
}
},
attr: function (key, value) {
BI.Pager.superclass.attr.apply(this, arguments);
if (key === "curr") {
this.currPage = BI.result(this.options, "curr");
}
},
populate: function () {
this._populate();
}
});
BI.Pager.EVENT_CHANGE = "EVENT_CHANGE";
BI.Pager.EVENT_AFTER_POPULATE = "EVENT_AFTER_POPULATE";
BI.shortcut("bi.pager", BI.Pager);
/***/ }),
/* 398 */
/***/ (function(module, exports) {
/**
* 超链接
*
* Created by GUY on 2015/9/9.
* @class BI.A
* @extends BI.Text
* @abstract
*/
BI.A = BI.inherit(BI.Text, {
_defaultConfig: function () {
var conf = BI.A.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-a display-block",
href: "",
target: "_blank",
el: null,
tagName: "a"
});
},
_init: function () {
var o = this.options;
BI.A.superclass._init.apply(this, arguments);
this.element.attr({href: o.href, target: o.target});
if (o.el) {
BI.createWidget(o.el, {
element: this
});
}
}
});
BI.shortcut("bi.a", BI.A);
/***/ }),
/* 399 */
/***/ (function(module, exports) {
/**
* guy
* 加载条
* @type {*|void|Object}
*/
BI.LoadingBar = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.LoadingBar.superclass._defaultConfig.apply(this, arguments);
return BI.extend( conf, {
baseCls: (conf.baseCls || "") + " bi-loading-bar bi-tips",
height: 30,
handler: BI.emptyFn
});
},
_init: function () {
BI.LoadingBar.superclass._init.apply(this, arguments);
var self = this;
this.loaded = BI.createWidget({
type: "bi.text_button",
cls: "loading-text bi-list-item-simple",
text: BI.i18nText("BI-Load_More"),
width: 120,
handler: this.options.handler
});
this.loaded.on(BI.Controller.EVENT_CHANGE, function (type) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.loading = BI.createWidget({
type: "bi.layout",
width: this.options.height,
height: this.options.height,
cls: "loading-background cursor-default"
});
var loaded = BI.createWidget({
type: "bi.center_adapt",
items: [this.loaded]
});
var loading = BI.createWidget({
type: "bi.center_adapt",
items: [this.loading]
});
this.cardLayout = BI.createWidget({
type: "bi.card",
element: this,
items: [{
el: loaded,
cardName: "loaded"
}, {
el: loading,
cardName: "loading"
}]
});
this.invisible();
},
_reset: function () {
this.visible();
this.loaded.setText(BI.i18nText("BI-Load_More"));
this.loaded.enable();
},
setLoaded: function () {
this._reset();
this.cardLayout.showCardByName("loaded");
},
setEnd: function () {
this.setLoaded();
this.loaded.setText(BI.i18nText("BI-No_More_Data"));
this.loaded.disable();
},
setLoading: function () {
this._reset();
this.cardLayout.showCardByName("loading");
}
});
BI.shortcut("bi.loading_bar", BI.LoadingBar);
/***/ }),
/* 400 */
/***/ (function(module, exports) {
/**
* @class BI.IconButton
* @extends BI.BasicButton
* 图标的button
*/
BI.IconButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.IconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-icon-button horizon-center",
iconWidth: null,
iconHeight: null
});
},
_init: function () {
BI.IconButton.superclass._init.apply(this, arguments);
var o = this.options;
this.element.css({
textAlign: "center"
});
this.icon = BI.createWidget({
type: "bi.icon",
width: o.iconWidth,
height: o.iconHeight
});
if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) {
this.element.css("lineHeight", o.height + "px");
BI.createWidget({
type: "bi.default",
element: this,
items: [this.icon]
});
} else {
this.element.css("lineHeight", "1");
BI.createWidget({
element: this,
type: "bi.center_adapt",
items: [this.icon]
});
}
},
doClick: function () {
BI.IconButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.IconButton.EVENT_CHANGE, this);
}
}
});
BI.IconButton.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_button", BI.IconButton);
/***/ }),
/* 401 */
/***/ (function(module, exports) {
/**
* 图片的button
*
* Created by GUY on 2016/1/27.
* @class BI.ImageButton
* @extends BI.BasicButton
*/
BI.ImageButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.ImageButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-image-button",
src: "",
iconWidth: "100%",
iconHeight: "100%"
});
},
_init: function () {
BI.ImageButton.superclass._init.apply(this, arguments);
var o = this.options;
this.image = BI.createWidget({
type: "bi.img",
width: o.iconWidth,
height: o.iconHeight,
src: o.src
});
if (BI.isNumber(o.iconWidth) || BI.isNumber(o.iconHeight)) {
BI.createWidget({
type: "bi.center_adapt",
element: this,
items: [this.image]
});
} else {
BI.createWidget({
type: "bi.adaptive",
element: this,
items: [this.image],
scrollable: false
});
}
},
setWidth: function (w) {
BI.ImageButton.superclass.setWidth.apply(this, arguments);
this.options.width = w;
},
setHeight: function (h) {
BI.ImageButton.superclass.setHeight.apply(this, arguments);
this.options.height = h;
},
setImageWidth: function (w) {
this.image.setWidth(w);
},
setImageHeight: function (h) {
this.image.setHeight(h);
},
getImageWidth: function () {
return this.image.element.width();
},
getImageHeight: function () {
return this.image.element.height();
},
setSrc: function (src) {
this.options.src = src;
this.image.setSrc(src);
},
getSrc: function () {
return this.image.getSrc();
},
doClick: function () {
BI.ImageButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.ImageButton.EVENT_CHANGE, this);
}
}
});
BI.ImageButton.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.image_button", BI.ImageButton);
/***/ }),
/* 402 */
/***/ (function(module, exports) {
/**
* 文字类型的按钮
* @class BI.Button
* @extends BI.BasicButton
*
* @cfg {JSON} options 配置属性
* @cfg {'common'/'success'/'warning'/'ignore'} [options.level='common'] 按钮类型,用不同颜色强调不同的场景
*/
BI.Button = BI.inherit(BI.BasicButton, {
_const: {
iconWidth: 18
},
_defaultConfig: function (props) {
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-button" + ((BI.isIE() && BI.isIE9Below()) ? " hack" : ""),
minWidth: (props.block === true || props.clear === true) ? 0 : 80,
height: 24,
shadow: props.clear !== true,
isShadowShowingOnSelected: true,
readonly: true,
iconCls: "",
level: "common",
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制
clear: false, // 是否去掉边框和背景
ghost: false, // 是否幽灵显示, 即正常状态无背景
textAlign: "center",
whiteSpace: "nowrap",
textWidth: null,
textHeight: null,
hgap: props.clear ? 0 : 10,
vgap: 0,
tgap: 0,
bgap: 0,
lgap: 0,
rgap: 0
});
},
_init: function () {
BI.Button.superclass._init.apply(this, arguments);
var o = this.options, self = this;
if (BI.isNumber(o.height) && !o.clear && !o.block) {
this.element.css({height: o.height + "px", lineHeight: (o.height - 2) + "px"});
} else if (o.clear || o.block) {
this.element.css({lineHeight: o.height + "px"});
} else {
this.element.css({lineHeight: (o.height - 2) + "px"});
}
if (BI.isKey(o.iconCls)) {
this.icon = BI.createWidget({
type: "bi.icon_label",
cls: o.iconCls,
width: this._const.iconWidth,
height: o.height - 2,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
this.text = BI.createWidget({
type: "bi.label",
text: o.text,
textWidth: BI.isNotNull(o.textWidth) ? o.textWidth - this._const.iconWidth : null,
textHeight: o.textHeight,
value: o.value,
height: o.height - 2
});
BI.createWidget({
type: "bi.center_adapt",
element: this,
hgap: o.hgap,
vgap: o.vgap,
items: [{
type: "bi.horizontal",
items: [this.icon, this.text]
}]
});
} else {
this.text = BI.createWidget({
type: "bi.label",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textWidth: o.textWidth,
textHeight: o.textHeight,
hgap: o.hgap,
vgap: o.vgap,
tgap: o.tgap,
bgap: o.bgap,
lgap: o.lgap,
rgap: o.rgap,
element: this,
text: o.text,
value: o.value
});
}
if (o.block === true) {
this.element.addClass("block");
}
if (o.clear === true) {
this.element.addClass("clear");
}
if (o.ghost === true) {
this.element.addClass("ghost");
}
if (o.minWidth > 0) {
this.element.css({"min-width": o.minWidth + "px"});
}
},
doClick: function () {
BI.Button.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.Button.EVENT_CHANGE, this);
}
},
setText: function (text) {
BI.Button.superclass.setText.apply(this, arguments);
this.text.setText(text);
},
setValue: function (text) {
BI.Button.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(text);
}
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
destroy: function () {
BI.Button.superclass.destroy.apply(this, arguments);
}
});
BI.shortcut("bi.button", BI.Button);
BI.Button.EVENT_CHANGE = "EVENT_CHANGE";
/***/ }),
/* 403 */
/***/ (function(module, exports) {
/**
* guy
* 可以点击的一行文字
* @class BI.TextButton
* @extends BI.BasicButton
* 文字button
*/
BI.TextButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.TextButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-button",
textAlign: "center",
whiteSpace: "nowrap",
textWidth: null,
textHeight: null,
hgap: 0,
lgap: 0,
rgap: 0,
vgap: 0,
text: "",
py: ""
});
},
_init: function () {
BI.TextButton.superclass._init.apply(this, arguments);
var o = this.options;
this.text = BI.createWidget({
type: "bi.label",
element: this,
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textWidth: o.textWidth,
textHeight: o.textHeight,
width: o.width,
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword
});
},
doClick: function () {
BI.TextButton.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.TextButton.EVENT_CHANGE, this.getValue(), this);
}
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (text) {
BI.TextButton.superclass.setText.apply(this, arguments);
text = BI.isArray(text) ? text.join(",") : text;
this.text.setText(text);
},
setStyle: function (style) {
this.text.setStyle(style);
},
setValue: function (text) {
BI.TextButton.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
text = BI.isArray(text) ? text.join(",") : text;
this.text.setValue(text);
}
}
});
BI.TextButton.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_button", BI.TextButton);
/***/ }),
/* 404 */
/***/ (function(module, exports) {
/**
* 带有一个占位
*
* Created by GUY on 2015/9/11.
* @class BI.BlankIconIconTextItem
* @extends BI.BasicButton
*/
BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.BlankIconIconTextItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item",
logic: {
dynamic: false
},
iconCls1: "close-ha-font",
iconCls2: "close-ha-font",
blankWidth: 0,
iconHeight: null,
iconWidth: null,
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0
});
},
_init: function () {
BI.BlankIconIconTextItem.superclass._init.apply(this, arguments);
var o = this.options, c = this._const;
var blank = BI.createWidget({
type: "bi.layout",
width: o.blankWidth,
height: o.height
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon1 = BI.createWidget({
type: "bi.icon_button",
cls: o.iconCls1,
forceNotSelected: true,
width: o.height,
height: o.height
});
this.icon2 = BI.createWidget({
type: "bi.icon_button",
cls: o.iconCls2,
forceNotSelected: true,
width: o.height,
height: o.height
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", blank, this.icon1, this.icon2, this.text)
}))));
},
doClick: function () {
BI.BlankIconIconTextItem.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.BlankIconIconTextItem.EVENT_CHANGE, this.getValue(), this);
}
},
setSelected: function (b) {
BI.BlankIconIconTextItem.superclass.setSelected.apply(this, arguments);
this.icon1.setSelected(b);
this.icon2.setSelected(b);
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
getValue: function () {
return this.text.getValue();
},
setText: function () {
this.text.setText.apply(this.text, arguments);
},
getText: function () {
return this.text.getText();
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
}
});
BI.BlankIconIconTextItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.blank_icon_icon_text_item", BI.BlankIconIconTextItem);
/***/ }),
/* 405 */
/***/ (function(module, exports) {
/**
* guy
* 一个占位符和两个icon和一行数 组成的一行listitem
*
* Created by GUY on 2015/9/15.
* @class BI.BlankIconTextIconItem
* @extends BI.BasicButton
*/
BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.BlankIconTextIconItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-blank-icon-text-icon-item",
logic: {
dynamic: false
},
iconCls1: "close-ha-font",
iconCls2: "close-ha-font",
blankWidth: 0,
iconHeight: null,
iconWidth: null,
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0
});
},
_init: function () {
BI.BlankIconTextIconItem.superclass._init.apply(this, arguments);
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
var icon1 = BI.createWidget({
type: "bi.icon_label",
cls: o.iconCls1,
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
},
top: 0,
bottom: 0,
right: 0
}]
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
type: "bi.layout",
width: o.blankWidth
}, icon1, this.text, {
type: "bi.layout",
width: o.height
})
}))));
},
doClick: function () {
BI.BlankIconTextIconItem.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.BlankIconTextIconItem.EVENT_CHANGE, this.getValue(), this);
}
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
getValue: function () {
return this.text.getValue();
},
setText: function () {
this.text.setText.apply(this.text, arguments);
},
getText: function () {
return this.text.getText();
}
});
BI.BlankIconTextIconItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.blank_icon_text_icon_item", BI.BlankIconTextIconItem);
/***/ }),
/* 406 */
/***/ (function(module, exports) {
/**
* 带有一个占位
*
* Created by GUY on 2015/9/11.
* @class BI.BlankIconTextItem
* @extends BI.BasicButton
*/
BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.BlankIconTextItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-blank-icon-text-item",
logic: {
dynamic: false
},
cls: "close-ha-font",
blankWidth: 0,
iconHeight: null,
iconWidth: null,
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0
});
},
_init: function () {
BI.BlankIconTextItem.superclass._init.apply(this, arguments);
var o = this.options, c = this._const;
var blank = BI.createWidget({
type: "bi.layout",
width: o.blankWidth
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
type: "bi.icon_label",
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", blank, this.icon, this.text)
}))));
},
doClick: function () {
BI.BlankIconTextItem.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.BlankIconTextItem.EVENT_CHANGE, this.getValue(), this);
}
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
getValue: function () {
return this.text.getValue();
},
setText: function () {
this.text.setText.apply(this.text, arguments);
},
getText: function () {
return this.text.getText();
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
}
});
BI.BlankIconTextItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.blank_icon_text_item", BI.BlankIconTextItem);
/***/ }),
/* 407 */
/***/ (function(module, exports) {
/**
* guy
* 两个icon和一行数 组成的一行listitem
*
* Created by GUY on 2015/9/9.
* @class BI.IconTextIconItem
* @extends BI.BasicButton
*/
BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.IconTextIconItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-icon-item",
logic: {
dynamic: false
},
iconCls1: "close-ha-font",
iconCls2: "close-ha-font",
iconHeight: null,
iconWidth: null,
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0
});
},
_init: function () {
BI.IconTextIconItem.superclass._init.apply(this, arguments);
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
var icon1 = BI.createWidget({
type: "bi.icon_label",
cls: o.iconCls1,
width: o.leftIconWrapperWidth,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
var blank = BI.createWidget({
type: "bi.layout",
width: o.height
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.rightIconWrapperWidth,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
},
top: 0,
bottom: 0,
right: 0
}]
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", icon1, this.text, blank)
}))));
},
doClick: function () {
BI.IconTextIconItem.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.IconTextIconItem.EVENT_CHANGE, this.getValue(), this);
}
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
getValue: function () {
return this.text.getValue();
},
setText: function () {
this.text.setText.apply(this.text, arguments);
},
getText: function () {
return this.text.getText();
}
});
BI.IconTextIconItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_icon_item", BI.IconTextIconItem);
/***/ }),
/* 408 */
/***/ (function(module, exports) {
/**
* guy
*
* Created by GUY on 2015/9/9.
* @class BI.IconTextItem
* @extends BI.BasicButton
*/
BI.IconTextItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.IconTextItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-item",
direction: BI.Direction.Left,
logic: {
dynamic: false
},
iconWrapperWidth: null,
iconHeight: null,
iconWidth: null,
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0
});
},
_init: function () {
BI.IconTextItem.superclass._init.apply(this, arguments);
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
type: "bi.icon_label",
width: o.iconWrapperWidth || o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.icon, this.text)
}))));
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
getValue: function () {
return this.text.getValue();
},
setText: function () {
this.text.setText.apply(this.text, arguments);
},
getText: function () {
return this.text.getText();
},
doClick: function () {
BI.IconTextItem.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.IconTextItem.EVENT_CHANGE, this.getValue(), this);
}
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
}
});
BI.IconTextItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_item", BI.IconTextItem);
/***/ }),
/* 409 */
/***/ (function(module, exports) {
/**
*
* 图标的button
*
* Created by GUY on 2015/9/9.
* @class BI.TextIconItem
* @extends BI.BasicButton
*/
BI.TextIconItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.TextIconItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-icon-item",
logic: {
dynamic: false
},
cls: "close-ha-font",
iconHeight: null,
iconWidth: null,
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0
});
},
_init: function () {
BI.TextIconItem.superclass._init.apply(this, arguments);
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
type: "bi.icon_label",
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", this.text, this.icon)
}))));
},
doClick: function () {
BI.TextIconItem.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.TextIconItem.EVENT_CHANGE, this.getValue(), this);
}
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
getValue: function () {
return this.text.getValue();
},
setText: function () {
this.text.setText.apply(this.text, arguments);
},
getText: function () {
return this.text.getText();
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
}
});
BI.TextIconItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_icon_item", BI.TextIconItem);
/***/ }),
/* 410 */
/***/ (function(module, exports) {
/**
* guy
* 一个button和一行数 组成的一行listitem
*
* Created by GUY on 2015/9/9.
* @class BI.TextItem
* @extends BI.BasicButton
*/
BI.TextItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.TextItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-item",
textAlign: "left",
whiteSpace: "nowrap",
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0
});
},
_init: function () {
BI.TextItem.superclass._init.apply(this, arguments);
var o = this.options;
this.text = BI.createWidget({
type: "bi.label",
element: this,
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textHeight: o.whiteSpace == "nowrap" ? o.height : o.textHeight,
height: o.height,
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
py: o.py
});
},
doClick: function () {
BI.TextItem.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.TextItem.EVENT_CHANGE, this.getValue(), this);
}
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
getValue: function () {
return this.text.getValue();
},
setText: function () {
this.text.setText.apply(this.text, arguments);
},
getText: function () {
return this.text.getText();
}
});
BI.TextItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_item", BI.TextItem);
/***/ }),
/* 411 */
/***/ (function(module, exports) {
/**
* guy
* Created by GUY on 2015/9/9.
* @class BI.IconTextIconNode
* @extends BI.NodeButton
*/
BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.IconTextIconNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-icon-node",
logic: {
dynamic: false
},
iconCls1: "close-ha-font",
iconCls2: "close-ha-font",
iconHeight: null,
iconWidth: null,
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0
});
},
_init: function () {
BI.IconTextIconNode.superclass._init.apply(this, arguments);
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
var icon1 = BI.createWidget({
type: "bi.icon_label",
cls: o.iconCls1,
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
var blank = BI.createWidget({
type: "bi.layout",
width: o.height,
height: o.height
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.icon_label",
cls: o.iconCls2,
width: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
},
top: 0,
bottom: 0,
right: 0
}]
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", icon1, this.text, blank)
}))));
},
doClick: function () {
BI.IconTextIconNode.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.IconTextIconNode.EVENT_CHANGE, this.getValue(), this);
}
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
getValue: function () {
return this.text.getValue();
},
setText: function () {
this.text.setText.apply(this.text, arguments);
},
getText: function () {
return this.text.getText();
}
});
BI.IconTextIconNode.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_icon_node", BI.IconTextIconNode);
/***/ }),
/* 412 */
/***/ (function(module, exports) {
/**
* guy
* Created by GUY on 2015/9/9.
* @class BI.IconTextNode
* @extends BI.NodeButton
*/
BI.IconTextNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.IconTextNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-text-node",
logic: {
dynamic: false
},
cls: "close-ha-font",
iconHeight: null,
iconWidth: null,
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0
});
},
_init: function () {
BI.IconTextNode.superclass._init.apply(this, arguments);
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
type: "bi.icon_label",
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", this.icon, this.text)
}))));
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
getValue: function () {
return this.text.getValue();
},
setText: function () {
this.text.setText.apply(this.text, arguments);
},
getText: function () {
return this.text.getText();
},
doClick: function () {
BI.IconTextNode.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.IconTextNode.EVENT_CHANGE, this.getValue(), this);
}
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
}
});
BI.IconTextNode.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_node", BI.IconTextNode);
/***/ }),
/* 413 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/9/9.
* @class BI.TextIconNode
* @extends BI.NodeButton
*/
BI.TextIconNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.TextIconNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-icon-node",
logic: {
dynamic: false
},
cls: "close-ha-font",
iconHeight: null,
iconWidth: null,
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0
});
},
_init: function () {
BI.TextIconNode.superclass._init.apply(this, arguments);
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
type: "bi.icon_label",
width: o.height,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", this.text, this.icon)
}))));
},
doClick: function () {
BI.TextIconNode.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.TextIconNode.EVENT_CHANGE, this.getValue(), this);
}
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
getValue: function () {
return this.text.getValue();
},
setText: function () {
this.text.setText.apply(this.text, arguments);
},
getText: function () {
return this.text.getText();
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
}
});
BI.TextIconNode.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_icon_node", BI.TextIconNode);
/***/ }),
/* 414 */
/***/ (function(module, exports) {
/**
* guy
*
* Created by GUY on 2015/9/9.
* @class BI.TextNode
* @extends BI.NodeButton
*/
BI.TextNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.TextNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-node",
textAlign: "left",
whiteSpace: "nowrap",
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0
});
},
_init: function () {
BI.TextNode.superclass._init.apply(this, arguments);
var o = this.options;
this.text = BI.createWidget({
type: "bi.label",
element: this,
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textHeight: o.whiteSpace == "nowrap" ? o.height : o.textHeight,
height: o.height,
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
py: o.py
});
},
doClick: function () {
BI.TextNode.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.TextNode.EVENT_CHANGE, this.getValue(), this);
}
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
getValue: function () {
return this.text.getValue();
},
setText: function () {
this.text.setText.apply(this.text, arguments);
},
getText: function () {
return this.text.getText();
}
});
BI.TextNode.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_node", BI.TextNode);
/***/ }),
/* 415 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/4/15.
* @class BI.Editor
* @extends BI.Single
*/
BI.Editor = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Editor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-editor bi-focus-shadow",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
// title,warningTitle这两个属性没用
tipType: "warning",
inputType: "text",
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: false,
watermark: "",
errorText: ""
});
},
_init: function () {
BI.Editor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = this.addWidget(BI.createWidget({
type: "bi.input",
element: "<input type='" + o.inputType + "'/>",
root: true,
value: o.value,
watermark: o.watermark,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank
}));
this.editor.element.css({
width: "100%",
height: "100%",
border: "none",
outline: "none",
padding: "0",
margin: "0"
});
if (BI.isKey(this.options.watermark)) {
this._assertWaterMark();
}
var _items = [];
if (this.watermark) {
_items.push({
el: this.watermark,
left: 3,
right: 3,
top: 0,
bottom: 0
});
}
_items.push({
el: this.editor,
left: 0,
right: 0,
top: 0,
bottom: 0
});
var items = [{
el: {
type: "bi.absolute",
ref: function(_ref) {
self.contentWrapper = _ref;
},
items: _items
},
left: o.hgap + o.lgap,
right: o.hgap + o.rgap,
top: o.vgap + o.tgap,
bottom: o.vgap + o.bgap
}];
BI.createWidget({
type: "bi.absolute",
element: this,
items: items
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Input.EVENT_FOCUS, function () {
self._checkError();
self.element.addClass("bi-editor-focus");
self.fireEvent(BI.Editor.EVENT_FOCUS, arguments);
});
this.editor.on(BI.Input.EVENT_BLUR, function () {
self._setErrorVisible(false);
self.element.removeClass("bi-editor-focus");
self.fireEvent(BI.Editor.EVENT_BLUR, arguments);
});
this.editor.on(BI.Input.EVENT_CLICK, function () {
self.fireEvent(BI.Editor.EVENT_CLICK, arguments);
});
this.editor.on(BI.Input.EVENT_CHANGE, function () {
self.fireEvent(BI.Editor.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Input.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.Editor.EVENT_KEY_DOWN, arguments);
});
this.editor.on(BI.Input.EVENT_QUICK_DOWN, function (e) {
// tab键就不要隐藏了
if (e.keyCode !== BI.KeyCode.TAB && self.watermark) {
self.watermark.invisible();
}
});
this.editor.on(BI.Input.EVENT_VALID, function () {
self._checkWaterMark();
self._setErrorVisible(false);
self.fireEvent(BI.Editor.EVENT_VALID, arguments);
});
this.editor.on(BI.Input.EVENT_ERROR, function () {
self._checkWaterMark();
self.fireEvent(BI.Editor.EVENT_ERROR, arguments);
self._setErrorVisible(self.isEditing());
});
this.editor.on(BI.Input.EVENT_RESTRICT, function () {
self._checkWaterMark();
var tip = self._setErrorVisible(true);
tip && tip.element.fadeOut(100, function () {
tip.element.fadeIn(100);
});
self.fireEvent(BI.Editor.EVENT_RESTRICT, arguments);
});
this.editor.on(BI.Input.EVENT_EMPTY, function () {
self._checkWaterMark();
self.fireEvent(BI.Editor.EVENT_EMPTY, arguments);
});
this.editor.on(BI.Input.EVENT_ENTER, function () {
self.fireEvent(BI.Editor.EVENT_ENTER, arguments);
});
this.editor.on(BI.Input.EVENT_SPACE, function () {
self.fireEvent(BI.Editor.EVENT_SPACE, arguments);
});
this.editor.on(BI.Input.EVENT_BACKSPACE, function () {
self.fireEvent(BI.Editor.EVENT_BACKSPACE, arguments);
});
this.editor.on(BI.Input.EVENT_REMOVE, function () {
self.fireEvent(BI.Editor.EVENT_REMOVE, arguments);
});
this.editor.on(BI.Input.EVENT_START, function () {
self.fireEvent(BI.Editor.EVENT_START, arguments);
});
this.editor.on(BI.Input.EVENT_PAUSE, function () {
self.fireEvent(BI.Editor.EVENT_PAUSE, arguments);
});
this.editor.on(BI.Input.EVENT_STOP, function () {
self.fireEvent(BI.Editor.EVENT_STOP, arguments);
});
this.editor.on(BI.Input.EVENT_CONFIRM, function () {
self.fireEvent(BI.Editor.EVENT_CONFIRM, arguments);
});
this.editor.on(BI.Input.EVENT_CHANGE_CONFIRM, function () {
self.fireEvent(BI.Editor.EVENT_CHANGE_CONFIRM, arguments);
});
this.element.click(function (e) {
e.stopPropagation();
return false;
});
if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) {
this._checkError();
this._checkWaterMark();
} else {
this._checkWaterMark();
}
},
_checkToolTip: function () {
var o = this.options;
var errorText = o.errorText;
if (BI.isFunction(errorText)) {
errorText = errorText(this.editor.getValue());
}
if (BI.isKey(errorText)) {
if (!this.isEnabled() || this.isValid() || (BI.Bubbles.has(this.getName()) && BI.Bubbles.get(this.getName()).isVisible())) {
this.setTitle("");
} else {
this.setTitle(errorText);
}
}
},
_assertWaterMark: function() {
var self = this, o = this.options;
if(BI.isNull(this.watermark)) {
this.watermark = BI.createWidget({
type: "bi.label",
cls: "bi-water-mark",
text: this.options.watermark,
height: o.height - 2 * (o.vgap + o.tgap),
whiteSpace: "nowrap",
textAlign: "left"
});
this.watermark.element.bind({
mousedown: function (e) {
if (self.isEnabled()) {
self.editor.isEditing() || self.editor.focus();
} else {
self.editor.isEditing() && self.editor.blur();
}
e.stopEvent();
}
});
this.watermark.element.bind("click", function (e) {
if (self.isEnabled()) {
self.editor.isEditing() || self.editor.focus();
} else {
self.editor.isEditing() && self.editor.blur();
}
e.stopEvent();
});
}
},
_checkError: function () {
this._setErrorVisible(this.isEnabled() && !this.isValid());
this._checkToolTip();
},
_checkWaterMark: function () {
var o = this.options;
if (!this.disabledWaterMark && this.editor.getValue() === "" && BI.isKey(o.watermark)) {
this.watermark && this.watermark.visible();
} else {
this.watermark && this.watermark.invisible();
}
},
setErrorText: function (text) {
this.options.errorText = text;
},
getErrorText: function () {
return this.options.errorText;
},
setWaterMark: function(v) {
this.options.watermark = v;
if(BI.isNull(this.watermark)) {
this._assertWaterMark();
BI.createWidget({
type: "bi.absolute",
element: this.contentWrapper,
items: [{
el: this.watermark,
left: 3,
right: 3,
top: 0,
bottom: 0
}]
})
}
BI.isKey(v) && this.watermark.setText(v);
},
_setErrorVisible: function (b) {
var o = this.options;
var errorText = o.errorText;
if (BI.isFunction(errorText)) {
errorText = errorText(BI.trim(this.editor.getValue()));
}
if (!this.disabledError && BI.isKey(errorText)) {
BI.Bubbles[b ? "show" : "hide"](this.getName(), errorText, this, {
adjustYOffset: 2
});
this._checkToolTip();
return BI.Bubbles.get(this.getName());
}
},
disableError: function () {
this.disabledError = true;
this._checkError();
},
enableError: function () {
this.disabledError = false;
this._checkError();
},
disableWaterMark: function () {
this.disabledWaterMark = true;
this._checkWaterMark();
},
enableWaterMark: function () {
this.disabledWaterMark = false;
this._checkWaterMark();
},
focus: function () {
this.element.addClass("text-editor-focus");
this.editor.focus();
},
blur: function () {
this.element.removeClass("text-editor-focus");
this.editor.blur();
},
selectAll: function () {
this.editor.selectAll();
},
onKeyDown: function (k) {
this.editor.onKeyDown(k);
},
setValue: function (v) {
BI.Editor.superclass.setValue.apply(this, arguments);
this.editor.setValue(v);
this._checkError();
this._checkWaterMark();
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
getLastChangedValue: function () {
return this.editor.getLastChangedValue();
},
getValue: function () {
if (!this.isValid()) {
return BI.trim(this.editor.getLastValidValue());
}
return BI.trim(this.editor.getValue());
},
isEditing: function () {
return this.editor.isEditing();
},
isValid: function () {
return this.editor.isValid();
},
destroyed: function () {
BI.Bubbles.remove(this.getName());
}
});
BI.Editor.EVENT_CHANGE = "EVENT_CHANGE";
BI.Editor.EVENT_FOCUS = "EVENT_FOCUS";
BI.Editor.EVENT_BLUR = "EVENT_BLUR";
BI.Editor.EVENT_CLICK = "EVENT_CLICK";
BI.Editor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.Editor.EVENT_SPACE = "EVENT_SPACE";
BI.Editor.EVENT_BACKSPACE = "EVENT_BACKSPACE";
BI.Editor.EVENT_START = "EVENT_START";
BI.Editor.EVENT_PAUSE = "EVENT_PAUSE";
BI.Editor.EVENT_STOP = "EVENT_STOP";
BI.Editor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.Editor.EVENT_CHANGE_CONFIRM = "EVENT_CHANGE_CONFIRM";
BI.Editor.EVENT_VALID = "EVENT_VALID";
BI.Editor.EVENT_ERROR = "EVENT_ERROR";
BI.Editor.EVENT_ENTER = "EVENT_ENTER";
BI.Editor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.Editor.EVENT_REMOVE = "EVENT_REMOVE";
BI.Editor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.editor", BI.Editor);
/***/ }),
/* 416 */
/***/ (function(module, exports) {
/**
* 多文件
*
* Created by GUY on 2016/4/13.
* @class BI.MultifileEditor
* @extends BI.Single
* @abstract
*/
BI.MultifileEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.MultifileEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-multifile-editor",
multiple: false,
maxSize: -1, // 1024 * 1024
accept: "",
url: ""
});
},
_init: function () {
var self = this, o = this.options;
BI.MultifileEditor.superclass._init.apply(this, arguments);
this.file = BI.createWidget({
type: "bi.file",
cls: "multifile-editor",
width: "100%",
height: "100%",
name: o.name,
url: o.url,
multiple: o.multiple,
accept: o.accept,
maxSize: o.maxSize,
title: o.title
});
this.file.on(BI.File.EVENT_CHANGE, function () {
self.fireEvent(BI.MultifileEditor.EVENT_CHANGE, arguments);
});
this.file.on(BI.File.EVENT_UPLOADSTART, function () {
self.fireEvent(BI.MultifileEditor.EVENT_UPLOADSTART, arguments);
});
this.file.on(BI.File.EVENT_ERROR, function () {
self.fireEvent(BI.MultifileEditor.EVENT_ERROR, arguments);
});
this.file.on(BI.File.EVENT_PROGRESS, function () {
self.fireEvent(BI.MultifileEditor.EVENT_PROGRESS, arguments);
});
this.file.on(BI.File.EVENT_UPLOADED, function () {
self.fireEvent(BI.MultifileEditor.EVENT_UPLOADED, arguments);
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.adaptive",
scrollable: false,
items: [this.file]
},
top: 0,
right: 0,
left: 0,
bottom: 0
}]
});
},
select: function () {
this.file.select();
},
getValue: function () {
return this.file.getValue();
},
upload: function () {
this.file.upload();
},
reset: function () {
this.file.reset();
}
});
BI.MultifileEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultifileEditor.EVENT_UPLOADSTART = "EVENT_UPLOADSTART";
BI.MultifileEditor.EVENT_ERROR = "EVENT_ERROR";
BI.MultifileEditor.EVENT_PROGRESS = "EVENT_PROGRESS";
BI.MultifileEditor.EVENT_UPLOADED = "EVENT_UPLOADED";
BI.shortcut("bi.multifile_editor", BI.MultifileEditor);
/***/ }),
/* 417 */
/***/ (function(module, exports) {
/**
*
* Created by GUY on 2016/1/18.
* @class BI.TextAreaEditor
* @extends BI.Single
*/
BI.TextAreaEditor = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.TextAreaEditor.superclass._defaultConfig.apply(), {
baseCls: "bi-textarea-editor",
value: ""
});
},
render: function() {
var o = this.options, self = this;
this.content = BI.createWidget({
type: "bi.layout",
tagName: "textarea",
width: "100%",
height: "100%",
cls: "bi-textarea textarea-editor-content display-block"
});
this.content.element.css({resize: "none"});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.adaptive",
items: [this.content]
},
left: 4,
right: 4,
top: 4,
bottom: 4
}]
});
this.content.element.on("input propertychange", function (e) {
self._checkWaterMark();
self.fireEvent(BI.TextAreaEditor.EVENT_CHANGE);
});
this.content.element.focus(function () {
if (self.isValid()) {
self._focus();
self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS);
}
BI.Widget._renderEngine.createElement(document).bind("mousedown." + self.getName(), function (e) {
if (BI.DOM.isExist(self) && !self.element.__isMouseInBounds__(e)) {
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + self.getName());
self.content.element.blur();
}
});
});
this.content.element.blur(function () {
if (self.isValid()) {
self._blur();
self.fireEvent(BI.TextAreaEditor.EVENT_BLUR);
}
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + self.getName());
});
if (BI.isKey(o.value)) {
this.setValue(o.value);
}
if (BI.isNotNull(o.style)) {
this.setStyle(o.style);
}
this._checkWaterMark();
},
_checkWaterMark: function () {
var self = this, o = this.options;
var val = this.getValue();
if (BI.isNotEmptyString(val)) {
this.watermark && this.watermark.destroy();
this.watermark = null;
} else {
if (BI.isNotEmptyString(o.watermark)) {
if (!this.watermark) {
this.watermark = BI.createWidget({
type: "bi.text_button",
cls: "bi-water-mark cursor-default textarea-watermark",
textAlign: "left",
whiteSpace: "normal",
text: o.watermark,
invalid: o.invalid,
disabled: o.disabled,
hgap: 4,
vgap: 4
});
this.watermark.on(BI.TextButton.EVENT_CHANGE, function () {
self.focus();
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.watermark,
left: 0,
top: 0,
right: 0
}]
});
} else {
this.watermark.setText(o.watermark);
this.watermark.setValid(!o.invalid);
this.watermark.setEnable(!o.disabled);
}
}
}
},
_focus: function () {
this.content.element.addClass("textarea-editor-focus");
this._checkWaterMark();
},
_blur: function () {
this.content.element.removeClass("textarea-editor-focus");
this._checkWaterMark();
},
focus: function () {
this._focus();
this.content.element.focus();
},
blur: function () {
this._blur();
this.content.element.blur();
},
getValue: function () {
return this.content.element.val();
},
setValue: function (value) {
this.content.element.val(value);
this._checkWaterMark();
},
setStyle: function (style) {
this.style = style;
this.element.css(style);
this.content.element.css(BI.extend({}, style, {
color: style.color || BI.DOM.getContrastColor(BI.DOM.isRGBColor(style.backgroundColor) ? BI.DOM.rgb2hex(style.backgroundColor) : style.backgroundColor)
}));
},
getStyle: function () {
return this.style;
},
_setValid: function (b) {
BI.TextAreaEditor.superclass._setValid.apply(this, arguments);
// this.content.setValid(b);
// this.watermark && this.watermark.setValid(b);
},
_setEnable: function (b) {
BI.TextAreaEditor.superclass._setEnable.apply(this, [b]);
this.content && (this.content.element[0].disabled = !b);
}
});
BI.TextAreaEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.TextAreaEditor.EVENT_BLUR = "EVENT_BLUR";
BI.TextAreaEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.shortcut("bi.textarea_editor", BI.TextAreaEditor);
/***/ }),
/* 418 */
/***/ (function(module, exports) {
/**
* guy 表示一行数据,通过position来定位位置的数据
* @class BI.Html
* @extends BI.Single
*/
BI.Html = BI.inherit(BI.Single, {
props: {
baseCls: "bi-html",
textAlign: "left",
whiteSpace: "normal",
lineHeight: null,
handler: null, // 如果传入handler,表示处理文字的点击事件,不是区域的
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false
},
render: function () {
var self = this, o = this.options;
if (o.hgap + o.lgap > 0) {
this.element.css({
"padding-left": o.hgap + o.lgap + "px"
});
}
if (o.hgap + o.rgap > 0) {
this.element.css({
"padding-right": o.hgap + o.rgap + "px"
});
}
if (o.vgap + o.tgap > 0) {
this.element.css({
"padding-top": o.vgap + o.tgap + "px"
});
}
if (o.vgap + o.bgap > 0) {
this.element.css({
"padding-bottom": o.vgap + o.bgap + "px"
});
}
if (BI.isNumber(o.height)) {
this.element.css({lineHeight: o.height + "px"});
}
if (BI.isNumber(o.lineHeight)) {
this.element.css({lineHeight: o.lineHeight + "px"});
}
if (BI.isWidthOrHeight(o.maxWidth)) {
this.element.css({maxWidth: o.maxWidth});
}
this.element.css({
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
textOverflow: o.whiteSpace === 'nowrap' ? "ellipsis" : "",
overflow: o.whiteSpace === "nowrap" ? "" : "auto"
});
if (o.handler) {
this.text = BI.createWidget({
type: "bi.layout",
tagName: "span"
});
this.text.element.click(function () {
o.handler(self.getValue());
});
BI.createWidget({
type: "bi.default",
element: this,
items: [this.text]
});
} else {
this.text = this;
}
if (BI.isKey(o.text)) {
this.setText(o.text);
} else if (BI.isKey(o.value)) {
this.setText(o.value);
}
if (o.highLight) {
this.doHighLight();
}
},
doHighLight: function () {
this.text.element.addClass("bi-high-light");
},
unHighLight: function () {
this.text.element.removeClass("bi-high-light");
},
setValue: function (text) {
BI.Html.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.setText(text);
}
},
setStyle: function (css) {
this.text.element.css(css);
},
setText: function (text) {
BI.Html.superclass.setText.apply(this, arguments);
this.options.text = text;
this.text.element.html(text);
}
});
BI.shortcut("bi.html", BI.Html);
/***/ }),
/* 419 */
/***/ (function(module, exports) {
/**
* guy 图标
* @class BI.Icon
* @extends BI.Single
*/
BI.Icon = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Icon.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
tagName: "i",
baseCls: (conf.baseCls || "") + " x-icon b-font horizon-center display-block"
});
},
_init: function () {
BI.Icon.superclass._init.apply(this, arguments);
if (BI.isIE9Below && BI.isIE9Below()) {
this.element.addClass("hack");
}
}
});
BI.shortcut("bi.icon", BI.Icon);
/***/ }),
/* 420 */
/***/ (function(module, exports) {
/**
* @class BI.Iframe
* @extends BI.Single
* @abstract
* Created by GameJian on 2016/3/2.
*/
BI.Iframe = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Iframe.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
tagName: "iframe",
baseCls: (conf.baseCls || "") + " bi-iframe",
src: "",
name: "",
attributes: {},
width: "100%",
height: "100%"
});
},
_init: function () {
var o = this.options;
o.attributes.frameborder = "0";
o.attributes.src = o.src;
o.attributes.name = o.name;
BI.Iframe.superclass._init.apply(this, arguments);
},
setSrc: function (src) {
this.options.src = src;
this.element.attr("src", src);
},
getSrc: function () {
return this.options.src;
},
setName: function (name) {
this.options.name = name;
this.element.attr("name", name);
},
getName: function () {
return this.options.name;
}
});
BI.shortcut("bi.iframe", BI.Iframe);
/***/ }),
/* 421 */
/***/ (function(module, exports) {
/**
* ͼƬ
*
* Created by GUY on 2016/1/26.
* @class BI.Img
* @extends BI.Single
* @abstract
*/
BI.Img = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Img.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
tagName: "img",
baseCls: (conf.baseCls || "") + " bi-img display-block",
src: "",
attributes: {},
width: "100%",
height: "100%"
});
},
_init: function () {
var o = this.options;
o.attributes.src = o.src;
BI.Img.superclass._init.apply(this, arguments);
},
setSrc: function (src) {
this.options.src = src;
this.element.attr("src", src);
},
getSrc: function () {
return this.options.src;
}
});
BI.shortcut("bi.img", BI.Img);
/***/ }),
/* 422 */
/***/ (function(module, exports) {
/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.ImageCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
var conf = BI.ImageCheckbox.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-image-checkbox check-box-icon",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 16,
iconHeight: 16
});
}
});
BI.ImageCheckbox.EVENT_CHANGE = BI.IconButton.EVENT_CHANGE;
BI.shortcut("bi.image_checkbox", BI.ImageCheckbox);
/***/ }),
/* 423 */
/***/ (function(module, exports) {
/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Checkbox = BI.inherit(BI.BasicButton, {
props: {
baseCls: "bi-checkbox",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 16,
iconHeight: 16
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.center_adapt",
items: [{
type: "bi.default",
ref: function (_ref) {
self.checkbox = _ref;
},
cls: "checkbox-content",
width: o.iconWidth - 2,
height: o.iconHeight - 2
}]
};
},
_setEnable: function (enable) {
BI.Checkbox.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.checkbox.element.removeClass("base-disabled disabled");
} else {
this.checkbox.element.addClass("base-disabled disabled");
}
},
doClick: function () {
BI.Checkbox.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.Checkbox.EVENT_CHANGE);
}
},
setSelected: function (b) {
BI.Checkbox.superclass.setSelected.apply(this, arguments);
if (b) {
this.checkbox.element.addClass("bi-high-light-background");
} else {
this.checkbox.element.removeClass("bi-high-light-background");
}
}
});
BI.Checkbox.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.checkbox", BI.Checkbox);
/***/ }),
/* 424 */
/***/ (function(module, exports) {
/**
* guy
* @class BI.Input 一个button和一行数 组成的一行listitem
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Input = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Input.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-input display-block overflow-dot",
tagName: "input",
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn, // 按确定键能否退出编辑
allowBlank: false
});
},
_init: function () {
BI.Input.superclass._init.apply(this, arguments);
var self = this;
var ctrlKey = false;
var keyCode = null;
var inputEventValid = false;
var _keydown = BI.debounce(function (keyCode) {
self.onKeyDown(keyCode, ctrlKey);
self._keydown_ = false;
}, 300);
var _clk = BI.debounce(BI.bind(this._click, this), BI.EVENT_RESPONSE_TIME, {
"leading": true,
"trailing": false
});
this._focusDebounce = BI.debounce(BI.bind(this._focus, this), BI.EVENT_RESPONSE_TIME, {
"leading": true,
"trailing": false
});
this._blurDebounce = BI.debounce(BI.bind(this._blur, this), BI.EVENT_RESPONSE_TIME, {
"leading": true,
"trailing": false
});
this.element
.keydown(function (e) {
inputEventValid = false;
ctrlKey = e.ctrlKey || e.metaKey; // mac的cmd支持一下
keyCode = e.keyCode;
self.fireEvent(BI.Input.EVENT_QUICK_DOWN, arguments);
})
.keyup(function (e) {
keyCode = null;
if (!(inputEventValid && e.keyCode === BI.KeyCode.ENTER)) {
self._keydown_ = true;
_keydown(e.keyCode);
}
})
.on("input propertychange", function (e) {
// 输入内容全选并直接删光,如果按键没放开就失去焦点不会触发keyup,被focusout覆盖了
// 其中propertychange在元素属性发生改变的时候就会触发 是为了兼容IE8
// 通过keyCode判断会漏掉输入法点击输入(右键粘贴暂缓)
var originalEvent = e.originalEvent;
if (BI.isNull(originalEvent.propertyName) || originalEvent.propertyName === "value") {
inputEventValid = true;
self._keydown_ = true;
_keydown(keyCode);
keyCode = null;
}
})
.click(function (e) {
e.stopPropagation();
_clk();
})
.mousedown(function (e) {
self.element.val(self.element.val());
})
.focus(function (e) { // 可以不用冒泡
self._focusDebounce();
})
.focusout(function (e) {
self._blurDebounce();
});
if (BI.isKey(this.options.value) || BI.isEmptyString(this.options.value)) {
this.setValue(this.options.value);
}
},
_focus: function () {
this.element.addClass("bi-input-focus");
this._checkValidationOnValueChange();
this._isEditing = true;
if (this.getValue() == "") {
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this);
this.fireEvent(BI.Input.EVENT_EMPTY);
}
this.fireEvent(BI.Input.EVENT_FOCUS);
},
_blur: function () {
var self = this;
if (self._keydown_ === true) {
BI.delay(blur, 300);
} else {
blur();
}
function blur () {
if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) {
self.element.val(self._lastValidValue ? self._lastValidValue : "");
self._checkValidationOnValueChange();
self._defaultState();
}
self.element.removeClass("bi-input-focus");
self._isEditing = false;
self._start = false;
if (self.isValid()) {
var lastValidValue = self._lastValidValue;
self._lastValidValue = self.getValue();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CONFIRM, self.getValue(), self);
self.fireEvent(BI.Input.EVENT_CONFIRM);
if (self._lastValidValue !== lastValidValue) {
self.fireEvent(BI.Input.EVENT_CHANGE_CONFIRM);
}
}
self.fireEvent(BI.Input.EVENT_BLUR);
}
},
_click: function () {
if (this._isEditing !== true) {
this.selectAll();
this.fireEvent(BI.Input.EVENT_CLICK);
}
},
onClick: function () {
this._click();
},
onKeyDown: function (keyCode, ctrlKey) {
if (!this.isValid() || BI.trim(this._lastChangedValue) !== BI.trim(this.getValue())) {
this._checkValidationOnValueChange();
}
if (this.isValid() && BI.trim(this.getValue()) !== "") {
if (BI.trim(this.getValue()) !== this._lastValue && (!this._start || this._lastValue == null || this._lastValue === "")
|| (this._pause === true && !/(\s|\u00A0)$/.test(this.getValue()))) {
this._start = true;
this._pause = false;
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STARTEDIT, this.getValue(), this);
this.fireEvent(BI.Input.EVENT_START);
}
}
if (keyCode == BI.KeyCode.ENTER) {
if (this.isValid() || this.options.quitChecker.apply(this, [BI.trim(this.getValue())]) !== false) {
this.blur();
this.fireEvent(BI.Input.EVENT_ENTER);
} else {
this.fireEvent(BI.Input.EVENT_RESTRICT);
}
}
if (keyCode == BI.KeyCode.SPACE) {
this.fireEvent(BI.Input.EVENT_SPACE);
}
if (keyCode == BI.KeyCode.BACKSPACE && this._lastValue == "") {
this.fireEvent(BI.Input.EVENT_REMOVE);
}
if (keyCode == BI.KeyCode.BACKSPACE || keyCode == BI.KeyCode.DELETE) {
this.fireEvent(BI.Input.EVENT_BACKSPACE);
}
this.fireEvent(BI.Input.EVENT_KEY_DOWN, arguments);
// _valueChange中会更新_lastValue, 这边缓存用以后续STOP事件服务
var lastValue = this._lastValue;
if(BI.trim(this.getValue()) !== BI.trim(this._lastValue || "")){
this._valueChange();
}
if (BI.isEndWithBlank(this.getValue())) {
this._pause = true;
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.PAUSE, "", this);
this.fireEvent(BI.Input.EVENT_PAUSE);
this._defaultState();
} else if ((keyCode === BI.KeyCode.BACKSPACE || keyCode === BI.KeyCode.DELETE) &&
BI.trim(this.getValue()) === "" && (lastValue !== null && BI.trim(lastValue) !== "")) {
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT, this.getValue(), this);
this.fireEvent(BI.Input.EVENT_STOP);
}
},
// 初始状态
_defaultState: function () {
if (this.getValue() == "") {
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this);
this.fireEvent(BI.Input.EVENT_EMPTY);
}
this._lastValue = this.getValue();
this._lastSubmitValue = null;
},
_valueChange: function () {
if (this.isValid() && BI.trim(this.getValue()) !== this._lastSubmitValue) {
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CHANGE, this.getValue(), this);
this.fireEvent(BI.Input.EVENT_CHANGE);
this._lastSubmitValue = BI.trim(this.getValue());
}
if (this.getValue() == "") {
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EMPTY, this.getValue(), this);
this.fireEvent(BI.Input.EVENT_EMPTY);
}
this._lastValue = this.getValue();
},
_checkValidationOnValueChange: function () {
var o = this.options;
var v = this.getValue();
this.setValid(
(o.allowBlank === true && BI.trim(v) == "") || (
BI.isNotEmptyString(BI.trim(v)) && o.validationChecker.apply(this, [BI.trim(v)]) !== false
)
);
},
focus: function () {
if (!this.element.is(":visible")) {
throw new Error("input输入框在不可见下不能focus");
}
if (!this._isEditing === true) {
this.element.focus();
this.selectAll();
}
},
blur: function () {
if (!this.element.is(":visible")) {
throw new Error("input输入框在不可见下不能blur");
}
if (this._isEditing === true) {
this.element.blur();
this._blurDebounce();
}
},
selectAll: function () {
if (!this.element.is(":visible")) {
throw new Error("input输入框在不可见下不能select");
}
this.element.select();
this._isEditing = true;
},
setValue: function (textValue) {
this.element.val(textValue);
BI.nextTick(BI.bind(function () {
this._checkValidationOnValueChange();
this._defaultState();
if (this.isValid()) {
this._lastValidValue = this._lastSubmitValue = this.getValue();
}
}, this));
},
getValue: function () {
return this.element.val() || "";
},
isEditing: function () {
return this._isEditing;
},
getLastValidValue: function () {
return this._lastValidValue;
},
getLastChangedValue: function () {
return this._lastChangedValue;
},
_setValid: function () {
BI.Input.superclass._setValid.apply(this, arguments);
if (this.isValid()) {
this._lastChangedValue = this.getValue();
this.element.removeClass("bi-input-error");
this.fireEvent(BI.Input.EVENT_VALID, BI.trim(this.getValue()), this);
} else {
if (this._lastChangedValue === this.getValue()) {
this._lastChangedValue = null;
}
this.element.addClass("bi-input-error");
this.fireEvent(BI.Input.EVENT_ERROR, BI.trim(this.getValue()), this);
}
},
_setEnable: function (b) {
BI.Input.superclass._setEnable.apply(this, [b]);
this.element[0].disabled = !b;
}
});
BI.Input.EVENT_CHANGE = "EVENT_CHANGE";
BI.Input.EVENT_FOCUS = "EVENT_FOCUS";
BI.Input.EVENT_CLICK = "EVENT_CLICK";
BI.Input.EVENT_BLUR = "EVENT_BLUR";
BI.Input.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.Input.EVENT_QUICK_DOWN = "EVENT_QUICK_DOWN";
BI.Input.EVENT_SPACE = "EVENT_SPACE";
BI.Input.EVENT_BACKSPACE = "EVENT_BACKSPACE";
BI.Input.EVENT_START = "EVENT_START";
BI.Input.EVENT_PAUSE = "EVENT_PAUSE";
BI.Input.EVENT_STOP = "EVENT_STOP";
BI.Input.EVENT_CHANGE_CONFIRM = "EVENT_CHANGE_CONFIRM";
BI.Input.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.Input.EVENT_REMOVE = "EVENT_REMOVE";
BI.Input.EVENT_EMPTY = "EVENT_EMPTY";
BI.Input.EVENT_VALID = "EVENT_VALID";
BI.Input.EVENT_ERROR = "EVENT_ERROR";
BI.Input.EVENT_ENTER = "EVENT_ENTER";
BI.Input.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.shortcut("bi.input", BI.Input);
/***/ }),
/* 425 */
/***/ (function(module, exports) {
/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.ImageRadio = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
var conf = BI.ImageRadio.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-radio radio-icon",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 16,
iconHeight: 16
});
},
_init: function () {
BI.ImageRadio.superclass._init.apply(this, arguments);
},
doClick: function () {
BI.ImageRadio.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.ImageRadio.EVENT_CHANGE);
}
}
});
BI.ImageRadio.EVENT_CHANGE = BI.IconButton.EVENT_CHANGE;
BI.shortcut("bi.image_radio", BI.ImageRadio);
/***/ }),
/* 426 */
/***/ (function(module, exports) {
/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.Radio = BI.inherit(BI.BasicButton, {
props: {
baseCls: "bi-radio",
selected: false,
handler: BI.emptyFn,
width: 16,
height: 16,
iconWidth: 14,
iconHeight: 14
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "radio-content",
ref: function (_ref) {
self.radio = _ref;
},
width: o.iconWidth,
height: o.iconHeight
}]
};
},
_setEnable: function (enable) {
BI.Radio.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.radio.element.removeClass("base-disabled disabled");
} else {
this.radio.element.addClass("base-disabled disabled");
}
},
doClick: function () {
BI.Radio.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.Radio.EVENT_CHANGE);
}
},
setSelected: function (b) {
BI.Radio.superclass.setSelected.apply(this, arguments);
if (b) {
this.radio.element.addClass("bi-high-light-background");
} else {
this.radio.element.removeClass("bi-high-light-background");
}
}
});
BI.Radio.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.radio", BI.Radio);
/***/ }),
/* 427 */
/***/ (function(module, exports) {
/**
* Created by dailer on 2019/6/19.
*/
BI.AbstractLabel = BI.inherit(BI.Single, {
_defaultConfig: function (props) {
var conf = BI.AbstractLabel.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
textAlign: "center",
whiteSpace: "nowrap", // normal or nowrap
textWidth: null,
textHeight: null,
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
text: "",
highLight: false
});
},
_createJson: function () {
var o = this.options;
return {
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword,
highLight: o.highLight
};
},
_init: function () {
BI.AbstractLabel.superclass._init.apply(this, arguments);
if (this.options.textAlign === "center") {
this._createCenterEl();
} else {
this._createNotCenterEl();
}
},
_createCenterEl: function () {
var o = this.options;
var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.maxWidth = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 1.1
BI.createWidget({
type: "bi.center_adapt",
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 1.2
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.3
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.4
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, { // 1.5
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
maxWidth: "100%"
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { // 1.6
json.maxWidth = o.textWidth;
BI.createWidget({
type: "bi.center_adapt",
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (o.whiteSpace == "normal") { // 1.7
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(json);
BI.createWidget({
type: "bi.center_adapt",
scrollable: true,
element: this,
items: [this.text]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 1.8
this.element.css({
"line-height": o.height + "px"
});
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: "bi.center_adapt",
element: this,
items: [this.text]
});
},
_createNotCenterEl: function () {
var o = this.options;
var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt";
var json = this._createJson();
if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
if (BI.isNumber(o.height) && o.height > 0) { // 2.1
BI.createWidget({
type: adaptLayout,
height: o.height,
scrollable: o.whiteSpace === "normal",
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
BI.createWidget({ // 2.2
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) { // 2.3
this.text = BI.createWidget(BI.extend(json, {
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
return;
}
json.width = o.width - 2 * o.hgap - o.lgap - o.rgap;
BI.createWidget({ // 2.4
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [{
el: (this.text = BI.createWidget(json))
}]
});
return;
}
if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth;
BI.createWidget({ // 2.5
type: adaptLayout,
scrollable: o.whiteSpace === "normal",
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
element: this,
items: [
{
el: (this.text = BI.createWidget(json))
}
]
});
return;
}
if (BI.isNumber(o.height) && o.height > 0) {
if (o.whiteSpace !== "normal") {
this.element.css({
"line-height": o.height - (o.vgap * 2) + "px"
});
}
this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
}));
return;
}
BI.extend(json, {
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
});
this.text = BI.createWidget(BI.extend(json, {
maxWidth: "100%"
}));
BI.createWidget({
type: adaptLayout,
element: this,
scrollable: o.whiteSpace === "normal",
items: [this.text]
});
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setText: function (v) {
this.options.text = v;
this.text.setText(v);
},
getText: function () {
return this.options.text;
},
setStyle: function (css) {
this.text.setStyle(css);
},
setValue: function (v) {
BI.AbstractLabel.superclass.setValue.apply(this, arguments);
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.AbstractLabel.superclass.populate.apply(this, arguments);
}
});
/***/ }),
/* 428 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/6/26.
*/
BI.HtmlLabel = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-html-label"
},
_createJson: function () {
var o = this.options;
return {
type: "bi.html",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value
};
}
});
BI.shortcut("bi.html_label", BI.HtmlLabel);
/***/ }),
/* 429 */
/***/ (function(module, exports) {
/**
* @class BI.IconButton
* @extends BI.BasicButton
* 图标标签
*/
BI.IconLabel = BI.inherit(BI.Single, {
props: {
baseCls: "bi-icon-label horizon-center",
iconWidth: null,
iconHeight: null
},
_init: function () {
BI.IconLabel.superclass._init.apply(this, arguments);
var o = this.options;
this.element.css({
textAlign: "center"
});
this.icon = BI.createWidget({
type: "bi.icon",
width: o.iconWidth,
height: o.iconHeight
});
if (BI.isNumber(o.height) && o.height > 0 && BI.isNull(o.iconWidth) && BI.isNull(o.iconHeight)) {
this.element.css("lineHeight", o.height + "px");
BI.createWidget({
type: "bi.default",
element: this,
items: [this.icon]
});
} else {
this.element.css("lineHeight", "1");
BI.createWidget({
element: this,
type: "bi.center_adapt",
items: [this.icon]
});
}
}
});
BI.shortcut("bi.icon_label", BI.IconLabel);
/***/ }),
/* 430 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/6/26.
*/
BI.Label = BI.inherit(BI.AbstractLabel, {
props: {
baseCls: "bi-label",
py: "",
keyword: ""
},
_createJson: function () {
var o = this.options;
return {
type: "bi.text",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword,
highLight: o.highLight
};
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
}
});
BI.shortcut("bi.label", BI.Label);
/***/ }),
/* 431 */
/***/ (function(module, exports) {
/**
* guy a元素
* @class BI.Link
* @extends BI.Text
*/
BI.Link = BI.inherit(BI.Label, {
_defaultConfig: function () {
var conf = BI.Link.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-link display-block",
tagName: "a",
href: "",
target: "_blank"
});
},
_createJson: function () {
var o = this.options;
return {
type: "bi.a",
textAlign: o.textAlign,
whiteSpace: o.whiteSpace,
lineHeight: o.textHeight,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py,
href: o.href,
target: o.target
};
},
_init: function () {
BI.Link.superclass._init.apply(this, arguments);
}
});
BI.shortcut("bi.link", BI.Link);
/***/ }),
/* 432 */
/***/ (function(module, exports) {
/**
* guy
* 气泡提示
* @class BI.Bubble
* @extends BI.Tip
* @type {*|void|Object}
*/
BI.Bubble = BI.inherit(BI.Tip, {
_defaultConfig: function () {
return BI.extend(BI.Bubble.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-bubble",
direction: "top",
text: "",
level: "error",
height: 18
});
},
_init: function () {
BI.Bubble.superclass._init.apply(this, arguments);
var fn = function (e) {
e.stopPropagation();
e.stopEvent();
return false;
};
this.element.bind({click: fn, mousedown: fn, mouseup: fn, mouseover: fn, mouseenter: fn, mouseleave: fn, mousemove: fn});
BI.createWidget({
type: "bi.left",
element: this,
items: [this["_" + this.options.direction]()]
});
},
_createBubbleText: function () {
var o = this.options;
return (this.text = BI.createWidget({
type: "bi.label",
cls: "bubble-text" + (" bubble-" + o.level),
text: o.text,
hgap: 5,
height: 18
}));
},
_top: function () {
return BI.createWidget({
type: "bi.vertical",
items: [{
el: this._createBubbleText(),
height: 18
}, {
el: {
type: "bi.layout"
},
height: 3
}]
});
},
_bottom: function () {
return BI.createWidget({
type: "bi.vertical",
items: [{
el: {
type: "bi.layout"
},
height: 3
}, {
el: this._createBubbleText(),
height: 18
}]
});
},
_left: function () {
return BI.createWidget({
type: "bi.right",
items: [{
el: {
type: "bi.layout",
width: 3,
height: 18
}
}, {
el: this._createBubbleText()
}]
});
},
_right: function () {
return BI.createWidget({
type: "bi.left",
items: [{
el: {
type: "bi.layout",
width: 3,
height: 18
}
}, {
el: this._createBubbleText()
}]
});
},
setText: function (text) {
this.text.setText(text);
}
});
BI.shortcut("bi.bubble", BI.Bubble);
/***/ }),
/* 433 */
/***/ (function(module, exports) {
/**
* toast提示
*
* Created by GUY on 2015/9/7.
* @class BI.Toast
* @extends BI.Tip
*/
BI.Toast = BI.inherit(BI.Tip, {
_const: {
minWidth: 200,
hgap: 10
},
_defaultConfig: function () {
return BI.extend(BI.Toast.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-toast",
text: "",
level: "success" // success或warning
});
},
_init: function () {
BI.Toast.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.element.css({
minWidth: this._const.minWidth + "px"
});
this.element.addClass("toast-" + o.level);
var fn = function (e) {
e.stopPropagation();
e.stopEvent();
return false;
};
this.element.bind({click: fn, mousedown: fn, mouseup: fn, mouseover: fn, mouseenter: fn, mouseleave: fn, mousemove: fn});
var cls = "close-font";
switch(o.level) {
case "success":
cls = "toast-success-font";
break;
case "error":
cls = "toast-error-font";
break;
case "warning":
cls = "toast-warning-font";
break;
case "normal":
default:
cls = "toast-message-font";
break;
}
var items = [{
type: "bi.icon_label",
cls: cls + " toast-icon",
width: 36
}, {
el: {
type: "bi.label",
whiteSpace: "normal",
text: o.text,
textHeight: 16,
textAlign: "left"
},
rgap: o.autoClose ? this._const.hgap : 0
}];
var columnSize = [36, ""];
if(o.autoClose === false) {
items.push({
type: "bi.icon_button",
cls: "close-font toast-icon",
handler: function () {
self.destroy();
},
width: 36
});
columnSize.push(36);
}
this.text = BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
items: items,
vgap: 7,
columnSize: columnSize
});
},
setText: function (text) {
this.text.setText(text);
},
beforeDestroy: function () {
this.fireEvent(BI.Toast.EVENT_DESTORY);
}
});
BI.Toast.EVENT_DESTORY = "EVENT_DESTORY";
BI.shortcut("bi.toast", BI.Toast);
/***/ }),
/* 434 */
/***/ (function(module, exports) {
/**
* title提示
*
* Created by GUY on 2015/9/7.
* @class BI.Tooltip
* @extends BI.Tip
*/
BI.Tooltip = BI.inherit(BI.Tip, {
_const: {
hgap: 5,
vgap: 3
},
_defaultConfig: function () {
return BI.extend(BI.Tooltip.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-tooltip",
text: "",
level: "success", // success或warning
stopEvent: false,
stopPropagation: false
});
},
_init: function () {
BI.Tooltip.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.element.addClass("tooltip-" + o.level);
var fn = function (e) {
o.stopPropagation && e.stopPropagation();
o.stopEvent && e.stopEvent();
};
this.element.bind({
click: fn,
mousedown: fn,
mouseup: fn,
mouseover: fn,
mouseenter: fn,
mouseleave: fn,
mousemove: fn
});
var texts = (o.text + "").split("\n");
if (texts.length > 1) {
BI.createWidget({
type: "bi.vertical",
element: this,
hgap: this._const.hgap,
items: BI.map(texts, function (i, text) {
return {
type: "bi.label",
textAlign: "left",
whiteSpace: "normal",
text: text,
textHeight: 18
};
})
});
} else {
this.text = BI.createWidget({
type: "bi.label",
element: this,
textAlign: "left",
whiteSpace: "normal",
text: o.text,
textHeight: 18,
hgap: this._const.hgap
});
}
},
setWidth: function (width) {
this.element.width(width - 2 * this._const.hgap);
},
setText: function (text) {
this.text && this.text.setText(text);
},
setLevel: function (level) {
this.element.removeClass("tooltip-success").removeClass("tooltip-warning");
this.element.addClass("tooltip-" + level);
}
});
BI.shortcut("bi.tooltip", BI.Tooltip);
/***/ }),
/* 435 */
/***/ (function(module, exports) {
/**
* 下拉
* @class BI.Trigger
* @extends BI.Single
* @abstract
*/
BI.Trigger = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.Trigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-trigger cursor-pointer",
height: 24
});
},
_init: function () {
BI.Trigger.superclass._init.apply(this, arguments);
},
setKey: function () {
},
getKey: function () {
}
});
/***/ }),
/* 436 */
/***/ (function(module, exports) {
/**
*
* 自定义树
*
* Created by GUY on 2015/9/7.
* @class BI.CustomTree
* @extends BI.Single
*/
BI.CustomTree = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.CustomTree.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-custom-tree",
expander: {
el: {},
popup: {
type: "bi.custom_tree"
}
},
items: [],
itemsCreator: BI.emptyFn,
el: {
type: "bi.button_tree",
chooseType: 0,
layouts: [{
type: "bi.vertical"
}]
}
});
},
_init: function () {
BI.CustomTree.superclass._init.apply(this, arguments);
this.initTree(this.options.items);
},
_formatItems: function (nodes) {
var self = this, o = this.options;
nodes = BI.Tree.transformToTreeFormat(nodes);
var items = [];
BI.each(nodes, function (i, node) {
if (BI.isNotEmptyArray(node.children) || node.isParent === true) {
var item = BI.extend({
type: "bi.expander",
el: {
value: node.value
},
popup: {type: "bi.custom_tree"}
}, BI.deepClone(o.expander), {
id: node.id,
pId: node.pId
});
var el = BI.stripEL(node);
if (!BI.isWidget(el)) {
el = BI.clone(el);
delete el.children;
BI.extend(item.el, el);
} else {
item.el = el;
}
item.popup.expander = BI.deepClone(o.expander);
item.items = item.popup.items = node.children;
item.itemsCreator = item.popup.itemsCreator = function (op) {
if (BI.isNotNull(op.node)) {// 从子节点传过来的itemsCreator直接向上传递
return o.itemsCreator.apply(self, arguments);
}
var args = Array.prototype.slice.call(arguments, 0);
args[0].node = node;
return o.itemsCreator.apply(self, args);
};
BI.isNull(item.popup.el) && (item.popup.el = BI.deepClone(o.el));
items.push(item);
} else {
items.push(node);
}
});
return items;
},
// 构造树结构,
initTree: function (nodes) {
var self = this, o = this.options;
this.tree = BI.createWidget(o.el, {
element: this,
items: this._formatItems(nodes),
itemsCreator: function (op, callback) {
o.itemsCreator.apply(this, [op, function (items) {
var args = Array.prototype.slice.call(arguments, 0);
args[0] = self._formatItems(items);
callback.apply(null, args);
}]);
},
value: o.value
});
this.tree.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.CustomTree.EVENT_CHANGE, val, obj);
}
});
},
// 生成树方法
stroke: function (nodes) {
this.populate.apply(this, arguments);
},
populate: function (nodes) {
var args = Array.prototype.slice.call(arguments, 0);
if (arguments.length > 0) {
args[0] = this._formatItems(nodes);
}
this.tree.populate.apply(this.tree, args);
},
setValue: function (v) {
this.tree && this.tree.setValue(v);
},
getValue: function () {
return this.tree ? this.tree.getValue() : [];
},
getAllButtons: function () {
return this.tree ? this.tree.getAllButtons() : [];
},
getAllLeaves: function () {
return this.tree ? this.tree.getAllLeaves() : [];
},
getNodeById: function (id) {
return this.tree && this.tree.getNodeById(id);
},
getNodeByValue: function (id) {
return this.tree && this.tree.getNodeByValue(id);
},
empty: function () {
this.tree.empty();
}
});
BI.CustomTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.custom_tree", BI.CustomTree);
/***/ }),
/* 437 */
/***/ (function(module, exports) {
/**
* 可以改变图标的button
*
* Created by GUY on 2016/2/2.
*
* @class BI.IconChangeButton
* @extends BI.Single
*/
BI.IconChangeButton = BI.inherit(BI.Single, {
_defaultConfig: function () {
var conf = BI.IconChangeButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-icon-change-button",
iconCls: "",
iconWidth: null,
iconHeight: null,
stopEvent: false,
stopPropagation: false,
selected: false,
once: false, // 点击一次选中有效,再点无效
forceSelected: false, // 点击即选中, 选中了就不会被取消
forceNotSelected: false, // 无论怎么点击都不会被选中
disableSelected: false, // 使能选中
shadow: false,
isShadowShowingOnSelected: false, // 选中状态下是否显示阴影
trigger: null,
handler: BI.emptyFn
});
},
_init: function () {
BI.IconChangeButton.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.button = BI.createWidget({
type: "bi.icon_button",
element: this,
cls: o.iconCls,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight,
stopEvent: o.stopEvent,
stopPropagation: o.stopPropagation,
selected: o.selected,
once: o.once,
forceSelected: o.forceSelected,
forceNotSelected: o.forceNotSelected,
disableSelected: o.disableSelected,
shadow: o.shadow,
isShadowShowingOnSelected: o.isShadowShowingOnSelected,
trigger: o.trigger,
handler: o.handler
});
this.button.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.button.on(BI.IconButton.EVENT_CHANGE, function () {
self.fireEvent(BI.IconChangeButton.EVENT_CHANGE, arguments);
});
},
isSelected: function () {
return this.button.isSelected();
},
setSelected: function (b) {
this.button.setSelected(b);
},
setIcon: function (cls) {
var o = this.options;
if (o.iconCls !== cls) {
this.element.removeClass(o.iconCls).addClass(cls);
o.iconCls = cls;
}
}
});
BI.IconChangeButton.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_change_button", BI.IconChangeButton);
/***/ }),
/* 438 */
/***/ (function(module, exports) {
/**
* 统一的trigger图标按钮
*
* Created by GUY on 2015/9/16.
* @class BI.TriggerIconButton
* @extends BI.IconButton
*/
BI.TriggerIconButton = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
var conf = BI.TriggerIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-trigger-icon-button",
extraCls: "pull-down-font"
});
}
});
BI.TriggerIconButton.EVENT_CHANGE = BI.IconButton.EVENT_CHANGE;
BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton);
/***/ }),
/* 439 */
/***/ (function(module, exports) {
/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.HalfIconButton = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
var conf = BI.HalfIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-half-icon-button check-half-select-icon",
height: 16,
width: 16,
iconWidth: 16,
iconHeight: 16,
selected: false
});
}
});
BI.HalfIconButton.EVENT_CHANGE = BI.IconButton.EVENT_CHANGE;
BI.shortcut("bi.half_icon_button", BI.HalfIconButton);
/***/ }),
/* 440 */
/***/ (function(module, exports) {
/**
* guy
* @extends BI.Single
* @type {*|void|Object}
*/
BI.HalfButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.HalfIconButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-half-button bi-high-light-border",
height: 14,
width: 14,
selected: false
});
},
_init: function () {
BI.HalfButton.superclass._init.apply(this, arguments);
BI.createWidget({
type: "bi.center_adapt",
element: this.element,
items: [{
type: "bi.layout",
cls: "bi-high-light-background",
width: 8,
height: 8
}]
});
},
doClick: function () {
BI.HalfButton.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.HalfButton.EVENT_CHANGE);
}
}
});
BI.HalfButton.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.half_button", BI.HalfButton);
/***/ }),
/* 441 */
/***/ (function(module, exports) {
/**
* guy
* 复选框item
* @type {*|void|Object}
*/
BI.MultiSelectItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-multi-select-item",
height: 24,
logic: {
dynamic: false
},
iconWrapperWidth: 26
});
},
_init: function () {
BI.MultiSelectItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.checkbox = BI.createWidget({
type: "bi.checkbox"
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
rgap: o.rgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
self.setSelected(self.isSelected());
}
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
type: "bi.center_adapt",
items: [this.checkbox],
width: o.iconWrapperWidth
}, this.text)
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.MultiSelectItem.superclass.doClick.apply(this, arguments);
this.checkbox.setSelected(this.isSelected());
if (this.isValid()) {
this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE, this.getValue(), this);
}
},
setSelected: function (v) {
BI.MultiSelectItem.superclass.setSelected.apply(this, arguments);
this.checkbox.setSelected(v);
}
});
BI.MultiSelectItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_item", BI.MultiSelectItem);
/***/ }),
/* 442 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2016/2/2.
*
* @class BI.SingleSelectIconTextItem
* @extends BI.BasicButton
*/
BI.SingleSelectIconTextItem = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectIconTextItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-single-select-icon-text-item bi-list-item-active",
iconCls: "",
height: 24
});
},
_init: function () {
BI.SingleSelectIconTextItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.text = BI.createWidget({
type: "bi.icon_text_item",
element: this,
cls: o.iconCls,
once: o.once,
iconWrapperWidth: o.iconWrapperWidth,
selected: o.selected,
height: o.height,
iconHeight: o.iconHeight,
iconWidth: o.iconWidth,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
});
this.text.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
},
isSelected: function () {
return this.text.isSelected();
},
setSelected: function (b) {
this.text.setSelected(b);
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.SingleSelectIconTextItem.superclass.doClick.apply(this, arguments);
}
});
BI.shortcut("bi.single_select_icon_text_item", BI.SingleSelectIconTextItem);
/***/ }),
/* 443 */
/***/ (function(module, exports) {
BI.SingleSelectItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-single-select-item bi-list-item-active",
hgap: 10,
height: 24,
textAlign: "left"
});
},
_init: function () {
BI.SingleSelectItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.text = BI.createWidget({
type: "bi.label",
element: this,
textAlign: o.textAlign,
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
title: o.title || o.text,
warningTitle: o.warningTitle,
py: o.py
});
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.SingleSelectItem.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.SingleSelectItem.EVENT_CHANGE, this.isSelected(), this);
}
},
setSelected: function (v) {
BI.SingleSelectItem.superclass.setSelected.apply(this, arguments);
}
});
BI.SingleSelectItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_select_item", BI.SingleSelectItem);
/***/ }),
/* 444 */
/***/ (function(module, exports) {
/**
* guy
* 单选框item
* @type {*|void|Object}
*/
BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectRadioItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-single-select-radio-item",
logic: {
dynamic: false
},
hgap: 10,
height: 24
});
},
_init: function () {
BI.SingleSelectRadioItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.radio = BI.createWidget({
type: "bi.radio",
once: o.once
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
type: "bi.center_adapt",
items: [this.radio],
width: 16
}, this.text)
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.SingleSelectRadioItem.superclass.doClick.apply(this, arguments);
this.radio.setSelected(this.isSelected());
if (this.isValid()) {
this.fireEvent(BI.SingleSelectRadioItem.EVENT_CHANGE, this.isSelected(), this);
}
},
setSelected: function (v) {
BI.SingleSelectRadioItem.superclass.setSelected.apply(this, arguments);
this.radio.setSelected(v);
}
});
BI.SingleSelectRadioItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_select_radio_item", BI.SingleSelectRadioItem);
/***/ }),
/* 445 */
/***/ (function(module, exports) {
/**
* Created by roy on 15/10/16.
*/
BI.ArrowNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.ArrowNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-arrow-group-node bi-list-item",
logic: {
dynamic: false
},
id: "",
pId: "",
open: false,
height: 24,
iconWrapperWidth: 16
});
},
_init: function () {
var self = this, o = this.options;
BI.ArrowNode.superclass._init.apply(this, arguments);
this.checkbox = BI.createWidget({
type: "bi.arrow_group_node_checkbox"
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
self.setSelected(self.isSelected());
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: o.iconWrapperWidth,
el: this.checkbox
}, this.text);
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.ArrowNode.superclass.doClick.apply(this, arguments);
this.checkbox.setSelected(this.isOpened());
},
setText: function (text) {
BI.ArrowNode.superclass.setText.apply(this, arguments);
this.text.setText(text);
},
setOpened: function (v) {
BI.ArrowNode.superclass.setOpened.apply(this, arguments);
this.checkbox.setSelected(v);
}
});
BI.shortcut("bi.arrow_group_node", BI.ArrowNode);
/***/ }),
/* 446 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
* Created by GUY on 2015/9/6.
* @class BI.FirstPlusGroupNode
* @extends BI.NodeButton
*/
BI.FirstPlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.FirstPlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-first-plus-group-node bi-list-item",
logic: {
dynamic: false
},
id: "",
pId: "",
open: false,
height: 24
});
},
_init: function () {
BI.FirstPlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.checkbox = BI.createWidget({
type: "bi.first_tree_node_checkbox",
stopPropagation: true
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
if (this.isSelected()) {
self.triggerExpand();
} else {
self.triggerCollapse();
}
}
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 24,
el: this.checkbox
}, this.text);
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.FirstPlusGroupNode.superclass.doClick.apply(this, arguments);
this.checkbox.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.FirstPlusGroupNode.superclass.setOpened.apply(this, arguments);
if (BI.isNotNull(this.checkbox)) {
this.checkbox.setSelected(v);
}
}
});
BI.shortcut("bi.first_plus_group_node", BI.FirstPlusGroupNode);
/***/ }),
/* 447 */
/***/ (function(module, exports) {
/**
* Created by User on 2016/3/31.
*/
/**
* > + icon + 文本
* @class BI.IconArrowNode
* @extends BI.NodeButton
*/
BI.IconArrowNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.IconArrowNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-icon-arrow-node bi-list-item",
logic: {
dynamic: false
},
id: "",
pId: "",
open: false,
height: 24,
iconHeight: 12,
iconWidth: 12,
iconCls: "",
iconWrapperWidth: 16
});
},
_init: function () {
BI.IconArrowNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.checkbox = BI.createWidget({
type: "bi.arrow_group_node_checkbox",
width: 24,
stopPropagation: true
});
var icon = BI.createWidget({
type: "bi.icon_label",
width: 24,
cls: o.iconCls,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
if (this.isSelected()) {
self.triggerExpand();
} else {
self.triggerCollapse();
}
}
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: o.iconWrapperWidth,
el: this.checkbox
}, {
width: 16,
el: icon
}, this.text);
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items,
rgap: 5
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.IconArrowNode.superclass.doClick.apply(this, arguments);
this.checkbox.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.IconArrowNode.superclass.setOpened.apply(this, arguments);
if (BI.isNotNull(this.checkbox)) {
this.checkbox.setSelected(v);
}
}
});
BI.shortcut("bi.icon_arrow_node", BI.IconArrowNode);
/***/ }),
/* 448 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
* Created by GUY on 2015/9/6.
* @class BI.LastPlusGroupNode
* @extends BI.NodeButton
*/
BI.LastPlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.LastPlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-last-plus-group-node bi-list-item",
logic: {
dynamic: false
},
id: "",
pId: "",
open: false,
height: 24
});
},
_init: function () {
BI.LastPlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.checkbox = BI.createWidget({
type: "bi.last_tree_node_checkbox",
stopPropagation: true
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if(type === BI.Events.CLICK) {
if (this.isSelected()) {
self.triggerExpand();
} else {
self.triggerCollapse();
}
}
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 24,
el: this.checkbox
}, this.text);
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.LastPlusGroupNode.superclass.doClick.apply(this, arguments);
this.checkbox.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.LastPlusGroupNode.superclass.setOpened.apply(this, arguments);
if (BI.isNotNull(this.checkbox)) {
this.checkbox.setSelected(v);
}
}
});
BI.shortcut("bi.last_plus_group_node", BI.LastPlusGroupNode);
/***/ }),
/* 449 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
* Created by GUY on 2015/9/6.
* @class BI.MidPlusGroupNode
* @extends BI.NodeButton
*/
BI.MidPlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.MidPlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-mid-plus-group-node bi-list-item",
logic: {
dynamic: false
},
id: "",
pId: "",
open: false,
height: 24
});
},
_init: function () {
BI.MidPlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.checkbox = BI.createWidget({
type: "bi.mid_tree_node_checkbox",
stopPropagation: true
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
if (this.isSelected()) {
self.triggerExpand();
} else {
self.triggerCollapse();
}
}
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 24,
el: this.checkbox
}, this.text);
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.MidPlusGroupNode.superclass.doClick.apply(this, arguments);
this.checkbox.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.MidPlusGroupNode.superclass.setOpened.apply(this, arguments);
if (BI.isNotNull(this.checkbox)) {
this.checkbox.setSelected(v);
}
}
});
BI.shortcut("bi.mid_plus_group_node", BI.MidPlusGroupNode);
/***/ }),
/* 450 */
/***/ (function(module, exports) {
BI.MultiLayerIconArrowNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.MultiLayerIconArrowNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-multilayer-icon-arrow-node bi-list-item",
layer: 0, // 第几层级
id: "",
pId: "",
open: false,
height: 24,
iconHeight: 16,
iconWidth: 16,
iconCls: ""
});
},
_init: function () {
BI.MultiLayerIconArrowNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.node = BI.createWidget({
type: "bi.icon_arrow_node",
iconCls: o.iconCls,
cls: "bi-list-item-none",
id: o.id,
pId: o.pId,
open: o.open,
height: o.height,
iconHeight: o.iconHeight,
iconWidth: o.iconWidth,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
});
this.node.on(BI.Controller.EVENT_CHANGE, function (type) {
self.setSelected(self.isSelected());
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
var items = [];
BI.count(0, o.layer, function () {
items.push({
type: "bi.layout",
width: 15,
height: o.height
});
});
items.push(this.node);
BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
columnSize: BI.makeArray(o.layer, 15),
items: items
});
},
isOnce: function () {
return true;
},
doRedMark: function () {
this.node.doRedMark.apply(this.node, arguments);
},
unRedMark: function () {
this.node.unRedMark.apply(this.node, arguments);
},
isSelected: function () {
return this.node.isSelected();
},
setSelected: function (b) {
BI.MultiLayerIconArrowNode.superclass.setSelected.apply(this, arguments);
this.node.setSelected(b);
},
doClick: function () {
BI.NodeButton.superclass.doClick.apply(this, arguments);
this.node.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.MultiLayerIconArrowNode.superclass.setOpened.apply(this, arguments);
this.node.setOpened(v);
}
});
BI.shortcut("bi.multilayer_icon_arrow_node", BI.MultiLayerIconArrowNode);
/***/ }),
/* 451 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
* Created by GUY on 2015/9/6.
* @class BI.PlusGroupNode
* @extends BI.NodeButton
*/
BI.PlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.PlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-plus-group-node bi-list-item",
logic: {
dynamic: false
},
id: "",
pId: "",
open: false,
height: 24
});
},
_init: function () {
BI.PlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.checkbox = BI.createWidget({
type: "bi.tree_node_checkbox"
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
keyword: o.keyword,
py: o.py
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
self.setSelected(self.isSelected());
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 24,
el: this.checkbox
}, this.text);
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.PlusGroupNode.superclass.doClick.apply(this, arguments);
this.checkbox.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.PlusGroupNode.superclass.setOpened.apply(this, arguments);
if (this.checkbox) {
this.checkbox.setSelected(v);
}
}
});
BI.shortcut("bi.plus_group_node", BI.PlusGroupNode);
/***/ }),
/* 452 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2018/2/1.
*/
BI.Switch = BI.inherit(BI.BasicButton, {
props: {
extraCls: "bi-switch",
height: 22,
width: 44,
logic: {
dynamic: false
}
},
render: function () {
var self = this;
return {
type: "bi.absolute",
ref: function () {
self.layout = this;
},
items: [{
el: {
type: "bi.text_button",
cls: "circle-button bi-card"
},
width: 18,
height: 18,
top: 2,
left: this.options.selected ? 24 : 2
}]
};
},
setSelected: function (v) {
BI.Switch.superclass.setSelected.apply(this, arguments);
this.layout.attr("items")[0].left = v ? 24 : 2;
this.layout.resize();
},
doClick: function () {
BI.Switch.superclass.doClick.apply(this, arguments);
this.fireEvent(BI.Switch.EVENT_CHANGE);
}
});
BI.Switch.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.switch", BI.Switch);
/***/ }),
/* 453 */
/***/ (function(module, exports) {
BI.FirstTreeLeafItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.FirstTreeLeafItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-first-tree-leaf-item bi-list-item-active",
logic: {
dynamic: false
},
id: "",
pId: "",
layer: 0,
height: 24
});
},
_init: function () {
BI.FirstTreeLeafItem.superclass._init.apply(this, arguments);
var o = this.options;
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, ((o.layer === 0) ? "" : {
width: 12,
el: {
type: "bi.layout",
cls: (o.pNode && o.pNode.isLastNode) ? "" : "base-line-conn-background",
width: 12,
height: o.height
}
}), {
width: 24,
el: {
type: "bi.layout",
cls: "first-line-conn-background",
width: 24,
height: o.height
}
}, {
el: this.text
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
getId: function () {
return this.options.id;
},
getPId: function () {
return this.options.pId;
}
});
BI.shortcut("bi.first_tree_leaf_item", BI.FirstTreeLeafItem);
/***/ }),
/* 454 */
/***/ (function(module, exports) {
BI.IconTreeLeafItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.IconTreeLeafItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-tree-leaf-item bi-list-item-active",
logic: {
dynamic: false
},
height: 24,
iconWidth: 16,
iconHeight: 16,
iconCls: ""
});
},
_init: function () {
BI.IconTreeLeafItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var icon = BI.createWidget({
type: "bi.center_adapt",
width: 24,
cls: o.iconCls,
items: [{
type: "bi.icon",
width: o.iconWidth,
height: o.iconHeight
}]
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 16,
el: icon
}, {
el: this.text
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items,
hgap: 5
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
getId: function () {
return this.options.id;
},
getPId: function () {
return this.options.pId;
}
});
BI.shortcut("bi.icon_tree_leaf_item", BI.IconTreeLeafItem);
/***/ }),
/* 455 */
/***/ (function(module, exports) {
BI.LastTreeLeafItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.LastTreeLeafItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-last-tree-leaf-item bi-list-item-active",
logic: {
dynamic: false
},
id: "",
pId: "",
layer: 0,
height: 24
});
},
_init: function () {
BI.LastTreeLeafItem.superclass._init.apply(this, arguments);
var o = this.options;
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, ((o.layer === 0) ? "" : {
width: 12,
el: {
type: "bi.layout",
cls: (o.pNode && o.pNode.isLastNode) ? "" : "base-line-conn-background",
width: 12,
height: o.height
}
}), {
width: 24,
el: {
type: "bi.layout",
cls: "last-line-conn-background",
width: 24,
height: o.height
}
}, {
el: this.text
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
getId: function () {
return this.options.id;
},
getPId: function () {
return this.options.pId;
}
});
BI.shortcut("bi.last_tree_leaf_item", BI.LastTreeLeafItem);
/***/ }),
/* 456 */
/***/ (function(module, exports) {
BI.MidTreeLeafItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.MidTreeLeafItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-mid-tree-leaf-item bi-list-item-active",
logic: {
dynamic: false
},
id: "",
pId: "",
layer: 0,
height: 24
});
},
_init: function () {
BI.MidTreeLeafItem.superclass._init.apply(this, arguments);
var o = this.options;
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, ((o.layer === 0) ? "" : {
width: 12,
el: {
type: "bi.layout",
cls: (o.pNode && o.pNode.isLastNode) ? "" : "base-line-conn-background",
width: 12,
height: o.height
}
}), {
width: 24,
el: {
type: "bi.layout",
cls: "mid-line-conn-background",
width: 24,
height: o.height
}
}, {
el: this.text
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
getId: function () {
return this.options.id;
},
getPId: function () {
return this.options.pId;
}
});
BI.shortcut("bi.mid_tree_leaf_item", BI.MidTreeLeafItem);
/***/ }),
/* 457 */
/***/ (function(module, exports) {
/**
* @class BI.MultiLayerIconTreeLeafItem
* @extends BI.BasicButton
*/
BI.MultiLayerIconTreeLeafItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.MultiLayerIconTreeLeafItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-multilayer-icon-tree-leaf-item bi-list-item-active",
layer: 0,
height: 24,
iconCls: "",
iconHeight: 16,
iconWidth: 16
});
},
_init: function () {
BI.MultiLayerIconTreeLeafItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.item = BI.createWidget({
type: "bi.icon_tree_leaf_item",
cls: "bi-list-item-none",
iconCls: o.iconCls,
id: o.id,
pId: o.pId,
isFront: true,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight
});
this.item.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {// 本身实现click功能
return;
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
var items = [];
BI.count(0, o.layer, function () {
items.push({
type: "bi.layout",
width: 15,
height: o.height
});
});
items.push(this.item);
BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
columnSize: BI.makeArray(o.layer, 15),
items: items
});
},
doRedMark: function () {
this.item.doRedMark.apply(this.item, arguments);
},
unRedMark: function () {
this.item.unRedMark.apply(this.item, arguments);
},
doHighLight: function () {
this.item.doHighLight.apply(this.item, arguments);
},
unHighLight: function () {
this.item.unHighLight.apply(this.item, arguments);
},
getId: function () {
return this.options.id;
},
getPId: function () {
return this.options.pId;
},
doClick: function () {
BI.MultiLayerIconTreeLeafItem.superclass.doClick.apply(this, arguments);
this.item.setSelected(this.isSelected());
},
setSelected: function (v) {
BI.MultiLayerIconTreeLeafItem.superclass.setSelected.apply(this, arguments);
this.item.setSelected(v);
},
getValue: function () {
return this.options.value;
}
});
BI.shortcut("bi.multilayer_icon_tree_leaf_item", BI.MultiLayerIconTreeLeafItem);
/***/ }),
/* 458 */
/***/ (function(module, exports) {
/**
* 树叶子节点
* Created by GUY on 2015/9/6.
* @class BI.TreeTextLeafItem
* @extends BI.BasicButton
*/
BI.TreeTextLeafItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.TreeTextLeafItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-tree-text-leaf-item bi-list-item-active",
id: "",
pId: "",
height: 24,
hgap: 0,
lgap: 0,
rgap: 0
});
},
_init: function () {
BI.TreeTextLeafItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
lgap: o.lgap,
rgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [{
el: this.text
}]
});
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
getId: function () {
return this.options.id;
},
getPId: function () {
return this.options.pId;
}
});
BI.shortcut("bi.tree_text_leaf_item", BI.TreeTextLeafItem);
/***/ }),
/* 459 */
/***/ (function(module, exports) {
/**
* 专门为calendar的视觉加的button,作为私有button,不能配置任何属性,也不要用这个玩意
*/
BI.CalendarDateItem = BI.inherit(BI.BasicButton, {
render: function () {
var self = this, o = this.options;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.text_item",
cls: "bi-list-item-select",
textAlign: "center",
whiteSpace: "normal",
text: o.text,
value: o.value,
ref: function () {
self.text = this;
}
},
left: o.lgap,
right: o.rgap,
top: 0,
bottom: 0
}]
};
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
setSelected: function (b) {
BI.CalendarDateItem.superclass.setSelected.apply(this, arguments);
this.text.setSelected(b);
},
getValue: function () {
return this.text.getValue();
}
});
BI.shortcut("bi.calendar_date_item", BI.CalendarDateItem);
/***/ }),
/* 460 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/8/28.
* @class BI.Calendar
* @extends BI.Widget
*/
BI.Calendar = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.Calendar.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-calendar",
logic: {
dynamic: false
},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
year: 2015,
month: 8,
day: 25
});
},
_dateCreator: function (Y, M, D) {
var self = this, o = this.options, log = {}, De = BI.getDate();
var mins = o.min.match(/\d+/g);
var maxs = o.max.match(/\d+/g);
Y < (mins[0] | 0) && (Y = (mins[0] | 0));
Y > (maxs[0] | 0) && (Y = (maxs[0] | 0));
De.setFullYear(Y, M, D);
log.ymd = [De.getFullYear(), De.getMonth(), De.getDate()];
var MD = BI.Date._MD.slice(0);
MD[1] = BI.isLeapYear(log.ymd[0]) ? 29 : 28;
// 日期所在月第一天
De.setFullYear(log.ymd[0], log.ymd[1], 1);
// 是周几
log.FDay = De.getDay();
// 当前BI.StartOfWeek与周日对齐后的FDay是周几
var offSetFDay = (7 - BI.StartOfWeek + log.FDay) % 7;
// 当前月页第一天是几号
log.PDay = MD[M === 0 ? 11 : M - 1] - offSetFDay + 1;
log.NDay = 1;
var items = [];
BI.each(BI.range(42), function (i) {
var td = {}, YY = log.ymd[0], MM = log.ymd[1] + 1, DD;
// 上个月的日期
if (i < offSetFDay) {
td.lastMonth = true;
DD = i + log.PDay;
// 上一年
MM === 1 && (YY -= 1);
MM = MM === 1 ? 12 : MM - 1;
} else if (i >= offSetFDay && i < offSetFDay + MD[log.ymd[1]]) {
DD = i - offSetFDay + 1;
if (i - offSetFDay + 1 === log.ymd[2]) {
td.currentDay = true;
}
} else {
td.nextMonth = true;
DD = log.NDay++;
MM === 12 && (YY += 1);
MM = MM === 12 ? 1 : MM + 1;
}
if (BI.checkDateVoid(YY, MM, DD, mins, maxs)[0]) {
td.disabled = true;
}
td.text = DD;
items.push(td);
});
return items;
},
_init: function () {
BI.Calendar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var items = BI.map(this._getWeekLabel(), function (i, value) {
return {
type: "bi.label",
height: 24,
text: value
};
});
var title = BI.createWidget({
type: "bi.button_group",
height: 44,
items: items,
layouts: [{
type: "bi.center",
hgap: 5,
vgap: 10
}]
});
this.days = BI.createWidget({
type: "bi.button_group",
items: BI.createItems(this._getItems(), {}),
layouts: [BI.LogicFactory.createLogic("table", BI.extend({}, o.logic, {
columns: 7,
rows: 6,
columnSize: [1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7, 1 / 7],
rowSize: 24,
vgap: 10
}))]
});
this.days.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("vertical", BI.extend({}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("top", title, this.days)
}))));
},
_getWeekLabel: function () {
return BI.map(BI.range(0, 7), function (idx, v) {
return BI.Date._SDN[(v + BI.StartOfWeek) % 7];
});
},
isFrontDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = BI.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = BI.getOffsetDate(De, -1 * (day + 1));
return !!BI.checkDateVoid(newDate.getFullYear(), newDate.getMonth(), newDate.getDate(), o.min, o.max)[0];
},
isFinalDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = BI.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = BI.getOffsetDate(De, 42 - day);
return !!BI.checkDateVoid(newDate.getFullYear(), newDate.getMonth(), newDate.getDate(), o.min, o.max)[0];
},
_getItems: function () {
var o = this.options;
var days = this._dateCreator(o.year, o.month - 1, o.day);
var items = [];
items.push(days.slice(0, 7));
items.push(days.slice(7, 14));
items.push(days.slice(14, 21));
items.push(days.slice(21, 28));
items.push(days.slice(28, 35));
items.push(days.slice(35, 42));
return BI.map(items, function (i, item) {
return BI.map(item, function (j, td) {
var month = td.lastMonth ? o.month - 1 : (td.nextMonth ? o.month + 1 : o.month);
return BI.extend(td, {
type: "bi.calendar_date_item",
textAlign: "center",
whiteSpace: "normal",
once: false,
forceSelected: true,
height: 24,
value: o.year + "-" + month + "-" + td.text,
disabled: td.lastMonth || td.nextMonth || td.disabled,
lgap: 5,
rgap: 5
// selected: td.currentDay
});
});
});
},
_populate: function() {
this.days.populate(this._getItems());
},
setMinDate: function (minDate) {
var o = this.options;
if (BI.isNotEmptyString(o.min)) {
o.min = minDate;
this._populate();
}
},
setMaxDate: function (maxDate) {
var o = this.options;
if (BI.isNotEmptyString(o.max)) {
o.max = maxDate;
this._populate();
}
},
setValue: function (ob) {
this.days.setValue([ob.year + "-" + ob.month + "-" + ob.day]);
},
getValue: function () {
var date = this.days.getValue()[0].match(/\d+/g);
return {
year: date[0] | 0,
month: date[1] | 0,
day: date[2] | 0
};
}
});
BI.extend(BI.Calendar, {
getPageByDateJSON: function (json) {
var year = BI.getDate().getFullYear();
var month = BI.getDate().getMonth();
var page = (json.year - year) * 12;
page += json.month - 1 - month;
return page;
},
getDateJSONByPage: function (v) {
var months = BI.getDate().getMonth();
var page = v;
// 对当前page做偏移,使到当前年初
page = page + months;
var year = BI.parseInt(page / 12);
if(page < 0 && page % 12 !== 0) {
year--;
}
var month = page >= 0 ? (page % 12) : ((12 + page % 12) % 12);
return {
year: BI.getDate().getFullYear() + year,
month: month + 1
};
}
});
BI.shortcut("bi.calendar", BI.Calendar);
/***/ }),
/* 461 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/8/28.
* @class BI.YearCalendar
* @extends BI.Widget
*/
BI.YearCalendar = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.YearCalendar.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-year-calendar",
behaviors: {},
logic: {
dynamic: false
},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
year: null
});
},
_yearCreator: function (Y) {
var o = this.options;
Y = Y | 0;
var start = BI.YearCalendar.getStartYear(Y);
var items = [];
// 对于年控件来说,只要传入的minDate和maxDate的year区间包含v就是合法的
var startDate = BI.parseDateTime(o.min, "%Y-%X-%d");
var endDate = BI.parseDateTime(o.max, "%Y-%X-%d");
BI.each(BI.range(BI.YearCalendar.INTERVAL), function (i) {
var td = {};
if (BI.checkDateVoid(start + i, 1, 1, BI.print(BI.getDate(startDate.getFullYear(), 0, 1), "%Y-%X-%d"), BI.print(BI.getDate(endDate.getFullYear(), 0, 1), "%Y-%X-%d"))[0]) {
td.disabled = true;
}
td.text = start + i;
items.push(td);
});
return items;
},
_init: function () {
BI.YearCalendar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.currentYear = BI.getDate().getFullYear();
this.years = BI.createWidget({
type: "bi.button_group",
behaviors: o.behaviors,
items: BI.createItems(this._getItems(), {}),
layouts: [BI.LogicFactory.createLogic("table", BI.extend({}, o.logic, {
columns: 2,
rows: 6,
columnSize: [1 / 2, 1 / 2],
rowSize: 24
})), {
type: "bi.center_adapt",
vgap: 1
}]
});
this.years.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("vertical", BI.extend({}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("top", this.years)
}))));
},
isFrontYear: function () {
var o = this.options;
var Y = o.year;
Y = Y | 0;
return !!BI.checkDateVoid(BI.YearCalendar.getStartYear(Y) - 1, 1, 1, o.min, o.max)[0];
},
isFinalYear: function () {
var o = this.options, c = this._const;
var Y = o.year;
Y = Y | 0;
return !!BI.checkDateVoid(BI.YearCalendar.getEndYear(Y) + 1, 1, 1, o.min, o.max)[0];
},
_getItems: function () {
var o = this.options;
var years = this._yearCreator(o.year || this.currentYear);
// 纵向排列年
var len = years.length, tyears = BI.makeArray(len, "");
var map = [0, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11];
BI.each(years, function (i, y) {
tyears[i] = years[map[i]];
});
var items = [];
items.push(tyears.slice(0, 2));
items.push(tyears.slice(2, 4));
items.push(tyears.slice(4, 6));
items.push(tyears.slice(6, 8));
items.push(tyears.slice(8, 10));
items.push(tyears.slice(10, 12));
return BI.map(items, function (i, item) {
return BI.map(item, function (j, td) {
return BI.extend(td, {
type: "bi.text_item",
cls: "bi-list-item-select",
textAlign: "center",
whiteSpace: "normal",
once: false,
forceSelected: true,
height: 24,
width: 45,
value: td.text,
disabled: td.disabled
});
});
});
},
_populate: function () {
this.years.populate(this._getItems());
},
setMinDate: function (minDate) {
var o = this.options;
if (BI.isNotEmptyString(o.min)) {
o.min = minDate;
this._populate();
}
},
setMaxDate: function (maxDate) {
var o = this.options;
if (BI.isNotEmptyString(this.options.max)) {
o.max = maxDate;
this._populate();
}
},
setValue: function (val) {
this.years.setValue([val]);
},
getValue: function () {
return this.years.getValue()[0];
}
});
// 类方法
BI.extend(BI.YearCalendar, {
INTERVAL: 12,
// 获取显示的第一年
getStartYear: function (year) {
var cur = BI.getDate().getFullYear();
return year - ((year - cur + 3) % BI.YearCalendar.INTERVAL + 12) % BI.YearCalendar.INTERVAL;
},
getEndYear: function (year) {
return BI.YearCalendar.getStartYear(year) + BI.YearCalendar.INTERVAL - 1;
},
getPageByYear: function (year) {
var cur = BI.getDate().getFullYear();
year = BI.YearCalendar.getStartYear(year);
return (year - cur + 3) / BI.YearCalendar.INTERVAL;
}
});
BI.shortcut("bi.year_calendar", BI.YearCalendar);
/***/ }),
/* 462 */
/***/ (function(module, exports) {
/**
* Created by roy on 15/10/16.
* 右与下箭头切换的树节点
*/
BI.ArrowTreeGroupNodeCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
return BI.extend(BI.ArrowTreeGroupNodeCheckbox.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-arrow-group-node-checkbox"
});
},
setSelected: function (v) {
BI.ArrowTreeGroupNodeCheckbox.superclass.setSelected.apply(this, arguments);
if(v) {
this.element.removeClass("expander-right-font").addClass("expander-down-font");
} else {
this.element.removeClass("expander-down-font").addClass("expander-right-font");
}
}
});
BI.shortcut("bi.arrow_group_node_checkbox", BI.ArrowTreeGroupNodeCheckbox);
/***/ }),
/* 463 */
/***/ (function(module, exports) {
/**
* 十字型的树节点
* @class BI.CheckingMarkNode
* @extends BI.IconButton
*/
BI.CheckingMarkNode = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
return BI.extend( BI.CheckingMarkNode.superclass._defaultConfig.apply(this, arguments), {
extraCls: "check-mark-font"
});
},
_init: function () {
BI.CheckingMarkNode.superclass._init.apply(this, arguments);
this.setSelected(this.options.selected);
},
setSelected: function (v) {
BI.CheckingMarkNode.superclass.setSelected.apply(this, arguments);
if(v === true) {
this.element.addClass("check-mark-font");
} else {
this.element.removeClass("check-mark-font");
}
}
});
BI.shortcut("bi.checking_mark_node", BI.CheckingMarkNode);
/***/ }),
/* 464 */
/***/ (function(module, exports) {
/**
* 十字型的树节点
* @class BI.FirstTreeNodeCheckbox
* @extends BI.IconButton
*/
BI.FirstTreeNodeCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
return BI.extend( BI.FirstTreeNodeCheckbox.superclass._defaultConfig.apply(this, arguments), {
extraCls: "tree-collapse-icon-type2",
iconWidth: 24,
iconHeight: 24
});
},
setSelected: function (v) {
BI.FirstTreeNodeCheckbox.superclass.setSelected.apply(this, arguments);
if(v === true) {
this.element.addClass("tree-expand-icon-type2");
} else {
this.element.removeClass("tree-expand-icon-type2");
}
}
});
BI.shortcut("bi.first_tree_node_checkbox", BI.FirstTreeNodeCheckbox);
/***/ }),
/* 465 */
/***/ (function(module, exports) {
/**
* 十字型的树节点
* @class BI.LastTreeNodeCheckbox
* @extends BI.IconButton
*/
BI.LastTreeNodeCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
return BI.extend(BI.LastTreeNodeCheckbox.superclass._defaultConfig.apply(this, arguments), {
extraCls: "tree-collapse-icon-type4",
iconWidth: 24,
iconHeight: 24
});
},
setSelected: function (v) {
BI.LastTreeNodeCheckbox.superclass.setSelected.apply(this, arguments);
if (v === true) {
this.element.addClass("tree-expand-icon-type4");
} else {
this.element.removeClass("tree-expand-icon-type4");
}
}
});
BI.shortcut("bi.last_tree_node_checkbox", BI.LastTreeNodeCheckbox);
/***/ }),
/* 466 */
/***/ (function(module, exports) {
/**
* 十字型的树节点
* @class BI.MidTreeNodeCheckbox
* @extends BI.IconButton
*/
BI.MidTreeNodeCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
return BI.extend( BI.MidTreeNodeCheckbox.superclass._defaultConfig.apply(this, arguments), {
extraCls: "tree-collapse-icon-type3",
iconWidth: 24,
iconHeight: 24
});
},
setSelected: function (v) {
BI.MidTreeNodeCheckbox.superclass.setSelected.apply(this, arguments);
if(v === true) {
this.element.addClass("tree-expand-icon-type3");
} else {
this.element.removeClass("tree-expand-icon-type3");
}
}
});
BI.shortcut("bi.mid_tree_node_checkbox", BI.MidTreeNodeCheckbox);
/***/ }),
/* 467 */
/***/ (function(module, exports) {
/**
* 十字型的树节点
* @class BI.TreeNodeCheckbox
* @extends BI.IconButton
*/
BI.TreeNodeCheckbox = BI.inherit(BI.IconButton, {
_defaultConfig: function () {
return BI.extend( BI.TreeNodeCheckbox.superclass._defaultConfig.apply(this, arguments), {
extraCls: "tree-collapse-icon-type1",
iconWidth: 24,
iconHeight: 24
});
},
setSelected: function (v) {
BI.TreeNodeCheckbox.superclass.setSelected.apply(this, arguments);
if(v) {
this.element.addClass("tree-expand-icon-type1");
} else {
this.element.removeClass("tree-expand-icon-type1");
}
}
});
BI.shortcut("bi.tree_node_checkbox", BI.TreeNodeCheckbox);
/***/ }),
/* 468 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2017/2/8.
*
* @class BI.BubbleCombo
* @extends BI.Widget
*/
BI.BubbleCombo = BI.inherit(BI.Widget, {
_const: {
TRIANGLE_LENGTH: 6
},
_defaultConfig: function () {
return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-bubble-combo",
trigger: "click",
toggle: true,
direction: "bottom,left", // top||bottom||left||right||top,left||top,right||bottom,left||bottom,right
isDefaultInit: false,
destroyWhenHide: false,
isNeedAdjustHeight: true, // 是否需要高度调整
isNeedAdjustWidth: true,
stopPropagation: false,
adjustLength: 0, // 调整的距离
// adjustXOffset: 0,
// adjustYOffset: 10,
hideChecker: BI.emptyFn,
offsetStyle: "left", // left,right,center
el: {},
popup: {}
});
},
_init: function () {
BI.BubbleCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
trigger: o.trigger,
toggle: o.toggle,
container: o.container,
direction: o.direction,
isDefaultInit: o.isDefaultInit,
destroyWhenHide: o.destroyWhenHide,
isNeedAdjustHeight: o.isNeedAdjustHeight,
isNeedAdjustWidth: o.isNeedAdjustWidth,
adjustLength: this._getAdjustLength(),
stopPropagation: o.stopPropagation,
adjustXOffset: 0,
adjustYOffset: 0,
hideChecker: o.hideChecker,
offsetStyle: o.offsetStyle,
el: o.el,
popup: BI.extend({
type: "bi.bubble_popup_view"
}, o.popup)
});
this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE, arguments);
});
this.combo.on(BI.Combo.EVENT_CHANGE, function () {
self.fireEvent(BI.BubbleCombo.EVENT_CHANGE, arguments);
});
this.combo.on(BI.Combo.EVENT_EXPAND, function () {
self.fireEvent(BI.BubbleCombo.EVENT_EXPAND, arguments);
});
this.combo.on(BI.Combo.EVENT_COLLAPSE, function () {
self.fireEvent(BI.BubbleCombo.EVENT_COLLAPSE, arguments);
});
this.combo.on(BI.Combo.EVENT_AFTER_INIT, function () {
self.fireEvent(BI.BubbleCombo.EVENT_AFTER_INIT, arguments);
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW, arguments);
});
this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW, function () {
self._showTriangle();
self.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW, arguments);
});
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
self._hideTriangle();
self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW, arguments);
});
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
self.fireEvent(BI.BubbleCombo.EVENT_AFTER_HIDEVIEW, arguments);
});
},
_getAdjustLength: function () {
return this._const.TRIANGLE_LENGTH + this.options.adjustLength;
},
_createTriangle: function (direction) {
var pos = {}, op = {};
var adjustLength = this.options.adjustLength;
var offset = this.element.offset();
var left = offset.left, right = offset.left + this.element.outerWidth();
var top = offset.top, bottom = offset.top + this.element.outerHeight();
switch (direction) {
case "left":
pos = {
top: top,
height: this.element.outerHeight(),
left: left - adjustLength - this._const.TRIANGLE_LENGTH
};
op = {width: this._const.TRIANGLE_LENGTH};
break;
case "right":
pos = {
top: top,
height: this.element.outerHeight(),
left: right + adjustLength
};
op = {width: this._const.TRIANGLE_LENGTH};
break;
case "top":
pos = {
left: left,
width: this.element.outerWidth(),
top: top - adjustLength - this._const.TRIANGLE_LENGTH
};
op = {height: this._const.TRIANGLE_LENGTH};
break;
case "bottom":
pos = {
left: left,
width: this.element.outerWidth(),
top: bottom + adjustLength
};
op = {height: this._const.TRIANGLE_LENGTH};
break;
default:
break;
}
this.triangle && this.triangle.destroy();
this.triangle = BI.createWidget(op, {
type: "bi.center_adapt",
cls: "button-combo-triangle-wrapper",
items: [{
type: "bi.layout",
cls: "bubble-combo-triangle-" + direction
}]
});
pos.el = this.triangle;
BI.createWidget({
type: "bi.absolute",
element: this,
items: [pos]
});
},
_createLeftTriangle: function () {
this._createTriangle("left");
},
_createRightTriangle: function () {
this._createTriangle("right");
},
_createTopTriangle: function () {
this._createTriangle("top");
},
_createBottomTriangle: function () {
this._createTriangle("bottom");
},
_showTriangle: function () {
var pos = this.combo.getPopupPosition();
switch (pos.dir) {
case "left,top":
case "left,bottom":
this._createLeftTriangle();
break;
case "right,top":
case "right,bottom":
this._createRightTriangle();
break;
case "top,left":
case "top,right":
this._createTopTriangle();
break;
case "bottom,left":
case "bottom,right":
this._createBottomTriangle();
break;
}
},
_hideTriangle: function () {
this.triangle && this.triangle.destroy();
this.triangle = null;
},
hideView: function () {
this._hideTriangle();
this.combo && this.combo.hideView();
},
showView: function () {
this.combo && this.combo.showView();
},
isViewVisible: function () {
return this.combo.isViewVisible();
}
});
BI.BubbleCombo.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";
BI.BubbleCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.BubbleCombo.EVENT_EXPAND = "EVENT_EXPAND";
BI.BubbleCombo.EVENT_COLLAPSE = "EVENT_COLLAPSE";
BI.BubbleCombo.EVENT_AFTER_INIT = "EVENT_AFTER_INIT";
BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.BubbleCombo.EVENT_AFTER_POPUPVIEW = "EVENT_AFTER_POPUPVIEW";
BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW = "EVENT_BEFORE_HIDEVIEW";
BI.BubbleCombo.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.shortcut("bi.bubble_combo", BI.BubbleCombo);
/***/ }),
/* 469 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2017/2/8.
*
* @class BI.BubblePopupView
* @extends BI.PopupView
*/
BI.BubblePopupView = BI.inherit(BI.PopupView, {
_defaultConfig: function () {
var config = BI.BubblePopupView.superclass._defaultConfig.apply(this, arguments);
return BI.extend(config, {
baseCls: config.baseCls + " bi-bubble-popup-view",
minWidth: 220,
maxWidth: 300,
minHeight: 90
});
},
_init: function () {
BI.BubblePopupView.superclass._init.apply(this, arguments);
}
});
BI.shortcut("bi.bubble_popup_view", BI.BubblePopupView);
/**
* Created by GUY on 2017/2/8.
*
* @class BI.BubblePopupBarView
* @extends BI.BubblePopupView
*/
BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
_defaultConfig: function () {
return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-bubble-bar-popup-view",
buttons: [{
value: false,
text: BI.i18nText("BI-Basic_Cancel"),
ghost: true
}, {
text: BI.i18nText(BI.i18nText("BI-Basic_Sure")),
value: true
}]
});
},
_init: function () {
BI.BubblePopupBarView.superclass._init.apply(this, arguments);
},
_createToolBar: function () {
var o = this.options, self = this;
var items = [];
BI.each(o.buttons, function (i, buttonOpt) {
if (BI.isWidget(buttonOpt)) {
items.push(buttonOpt);
} else {
items.push(BI.extend({
type: "bi.button",
height: 24,
handler: function (v) {
self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, v);
}
}, buttonOpt));
}
});
return BI.createWidget({
type: "bi.center",
height: 44,
rgap: 15,
items: [{
type: "bi.right_vertical_adapt",
lgap: 10,
items: items
}]
});
},
_createView: function () {
var o = this.options;
var button = BI.createWidget({
type: "bi.button_group",
items: [o.el],
layouts: [{
type: "bi.vertical",
cls: "bar-popup-container",
hgap: 15,
tgap: 10
}]
});
button.element.css("min-height", o.minHeight - 44);
return button;
}
});
BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON = "EVENT_CLICK_TOOLBAR_BUTTON";
BI.shortcut("bi.bubble_bar_popup_view", BI.BubblePopupBarView);
/**
* Created by Windy on 2018/2/2.
*
* @class BI.TextBubblePopupBarView
* @extends BI.BubblePopupView
*/
BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
props: function () {
return {
baseCls: "bi-text-bubble-bar-popup-view",
text: "",
buttons: [{
level: "ignore",
value: false,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Cancel")
}, {
value: true,
stopPropagation: true,
text: BI.i18nText("BI-Basic_Sure")
}]
};
},
render: function () {
var self = this, o = this.options;
var buttons = BI.map(o.buttons, function (index, buttonOpt) {
if (BI.isWidget(buttonOpt)) {
return buttonOpt;
}
return BI.extend({
type: "bi.button",
height: 24,
handler: function (v) {
self.fireEvent(BI.TextBubblePopupBarView.EVENT_CHANGE, v);
}
}, buttonOpt);
});
return {
type: "bi.bubble_bar_popup_view",
minWidth: o.minWidth,
maxWidth: o.maxWidth,
minHeight: o.minHeight,
ref: function () {
self.popup = this;
},
el: {
type: "bi.label",
text: o.text,
whiteSpace: "normal",
textAlign: "left",
ref: function () {
self.text = this;
}
},
buttons: buttons
};
},
populate: function (v) {
this.text.setText(v || this.options.text);
}
});
BI.TextBubblePopupBarView.EVENT_CHANGE = "EVENT_CLICK_TOOLBAR_BUTTON";
BI.shortcut("bi.text_bubble_bar_popup_view", BI.TextBubblePopupBarView);
/***/ }),
/* 470 */
/***/ (function(module, exports) {
/**
* Created by Young's on 2016/4/28.
*/
BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this, arguments), {
baseClass: "bi-check-editor-combo",
width: 100,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: true,
watermark: "",
errorText: ""
});
},
_init: function () {
BI.EditorIconCheckCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.editor_trigger",
items: o.items,
height: o.height,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText,
value: o.value
});
this.trigger.on(BI.EditorTrigger.EVENT_CHANGE, function () {
self.popup.setValue(this.getValue());
self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE, arguments);
});
this.trigger.on(BI.EditorTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.EditorIconCheckCombo.EVENT_FOCUS, arguments);
});
this.trigger.on(BI.EditorTrigger.EVENT_EMPTY, function () {
self.fireEvent(BI.EditorIconCheckCombo.EVENT_EMPTY, arguments);
});
this.trigger.on(BI.EditorTrigger.EVENT_VALID, function () {
self.fireEvent(BI.EditorIconCheckCombo.EVENT_VALID, arguments);
});
this.trigger.on(BI.EditorTrigger.EVENT_ERROR, function () {
self.fireEvent(BI.EditorIconCheckCombo.EVENT_ERROR, arguments);
});
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.editorIconCheckCombo.hideView();
self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE);
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editorIconCheckCombo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
popup: {
el: this.popup,
maxHeight: 300
}
});
},
setValue: function (v) {
this.editorIconCheckCombo.setValue(v);
},
getValue: function () {
return this.trigger.getValue();
},
populate: function (items) {
this.options.items = items;
this.editorIconCheckCombo.populate(items);
}
});
BI.EditorIconCheckCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.EditorIconCheckCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.EditorIconCheckCombo.EVENT_EMPTY = "EVENT_EMPTY";
BI.EditorIconCheckCombo.EVENT_VALID = "EVENT_VALID";
BI.EditorIconCheckCombo.EVENT_ERROR = "EVENT_ERROR";
BI.shortcut("bi.editor_icon_check_combo", BI.EditorIconCheckCombo);
/***/ }),
/* 471 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2016/2/2.
*
* @class BI.IconCombo
* @extend BI.Widget
*/
BI.IconCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.IconCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-icon-combo",
width: 24,
height: 24,
el: {},
popup: {},
minWidth: 100,
maxWidth: "auto",
maxHeight: 300,
direction: "bottom",
adjustLength: 3, // 调整的距离
adjustXOffset: 0,
adjustYOffset: 0,
offsetStyle: "left",
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE
});
},
_init: function () {
BI.IconCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
type: "bi.icon_combo_trigger",
iconCls: o.iconCls,
title: o.title,
items: o.items,
width: o.width,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight,
value: o.value
});
this.popup = BI.createWidget(o.popup, {
type: "bi.icon_combo_popup",
chooseType: o.chooseType,
items: o.items,
value: o.value
});
this.popup.on(BI.IconComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.iconCombo.hideView();
self.fireEvent(BI.IconCombo.EVENT_CHANGE);
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.iconCombo = BI.createWidget({
type: "bi.combo",
element: this,
direction: o.direction,
trigger: o.trigger,
container: o.container,
adjustLength: o.adjustLength,
adjustXOffset: o.adjustXOffset,
adjustYOffset: o.adjustYOffset,
offsetStyle: o.offsetStyle,
el: this.trigger,
popup: {
el: this.popup,
maxWidth: o.maxWidth,
maxHeight: o.maxHeight,
minWidth: o.minWidth
}
});
},
showView: function () {
this.iconCombo.showView();
},
hideView: function () {
this.iconCombo.hideView();
},
setValue: function (v) {
this.trigger.setValue(v);
this.popup.setValue(v);
},
getValue: function () {
var value = this.popup.getValue();
return BI.isNull(value) ? [] : (BI.isArray(value) ? value : [value]);
},
populate: function (items) {
this.options.items = items;
this.iconCombo.populate(items);
}
});
BI.IconCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_combo", BI.IconCombo);
/***/ }),
/* 472 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2016/2/2.
*
* @class BI.IconComboPopup
* @extend BI.Pane
*/
BI.IconComboPopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.IconComboPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi.icon-combo-popup",
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE
});
},
_init: function () {
BI.IconComboPopup.superclass._init.apply(this, arguments);
var o = this.options, self = this;
this.popup = BI.createWidget({
type: "bi.button_group",
items: BI.createItems(o.items, {
type: "bi.single_select_icon_text_item",
height: 24
}),
chooseType: o.chooseType,
layouts: [{
type: "bi.vertical"
}],
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.IconComboPopup.EVENT_CHANGE, val, obj);
}
});
BI.createWidget({
type: "bi.vertical",
element: this,
vgap: 5,
items: [this.popup]
});
},
populate: function (items) {
BI.IconComboPopup.superclass.populate.apply(this, arguments);
items = BI.createItems(items, {
type: "bi.single_select_icon_text_item",
height: 24
});
this.popup.populate(items);
},
getValue: function () {
return this.popup.getValue();
},
setValue: function (v) {
this.popup.setValue(v);
}
});
BI.IconComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_combo_popup", BI.IconComboPopup);
/***/ }),
/* 473 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2016/2/2.
*
* @class BI.IconComboTrigger
* @extend BI.Widget
*/
BI.IconComboTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.IconComboTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-icon-combo-trigger",
el: {},
items: [],
iconCls: "",
width: 24,
height: 24,
isShowDown: true,
value: ""
});
},
_init: function () {
BI.IconComboTrigger.superclass._init.apply(this, arguments);
var o = this.options, self = this;
var iconCls = "";
if(BI.isKey(o.value)){
iconCls = this._digest(o.value, o.items);
}
this.button = BI.createWidget(o.el, {
type: "bi.icon_change_button",
cls: "icon-combo-trigger-icon",
iconCls: iconCls,
disableSelected: true,
width: o.isShowDown ? o.width - 12 : o.width,
height: o.height,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight,
selected: BI.isNotEmptyString(iconCls)
});
this.down = BI.createWidget({
type: "bi.icon_button",
disableSelected: true,
cls: "icon-combo-down-icon trigger-triangle-font font-size-12",
width: 12,
height: 8,
selected: BI.isNotEmptyString(iconCls)
});
this.down.setVisible(o.isShowDown);
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.button,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: this.down,
right: 3,
bottom: 0
}]
});
},
_digest: function (v, items) {
var iconCls = "";
v = BI.isArray(v) ? v[0] : v;
BI.any(items, function (i, item) {
if (v === item.value) {
iconCls = item.iconCls;
return true;
}
});
return iconCls;
},
populate: function (items) {
var o = this.options;
this.options.items = items || [];
this.button.setIcon(o.iconCls);
this.button.setSelected(false);
this.down.setSelected(false);
},
setValue: function (v) {
BI.IconComboTrigger.superclass.setValue.apply(this, arguments);
var o = this.options;
var iconCls = this._digest(v, this.options.items);
v = BI.isArray(v) ? v[0] : v;
if (BI.isNotEmptyString(iconCls)) {
this.button.setIcon(iconCls);
this.button.setSelected(true);
this.down.setSelected(true);
} else {
this.button.setIcon(o.iconCls);
this.button.setSelected(false);
this.down.setSelected(false);
}
}
});
BI.IconComboTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_combo_trigger", BI.IconComboTrigger);
/***/ }),
/* 474 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2017/12/12.
* combo : icon + text + icon, popup : icon + text
*/
BI.IconTextValueCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-icon-text-value-combo",
height: 24,
iconHeight: null,
iconWidth: null,
value: "",
attributes: {
tabIndex: 0
}
});
},
_init: function () {
BI.IconTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.select_icon_text_trigger",
cls: "icon-text-value-trigger",
items: o.items,
height: o.height,
text: o.text,
iconCls: o.iconCls,
value: o.value,
iconHeight: o.iconHeight,
iconWidth: o.iconWidth,
iconWrapperWidth: o.iconWrapperWidth,
title: o.title,
warningTitle: o.warningTitle
});
this.popup = BI.createWidget({
type: "bi.icon_text_value_combo_popup",
items: o.items,
value: o.value,
iconHeight: o.iconHeight,
iconWidth: o.iconWidth,
iconWrapperWidth: o.iconWrapperWidth
});
this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.textIconCombo.hideView();
self.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE, arguments);
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.textIconCombo = BI.createWidget({
type: "bi.combo",
element: this,
container: o.container,
adjustLength: 2,
el: this.trigger,
popup: {
el: this.popup,
maxHeight: 240,
minHeight: 25
}
});
if (BI.isKey(o.value)) {
this.setValue(o.value);
}
},
_checkError: function (v) {
if(BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) {
this.trigger.options.tipType = "success";
this.element.removeClass("combo-error");
} else {
v = BI.isArray(v) ? v : [v];
var result = BI.find(this.options.items, function (idx, item) {
return BI.contains(v, item.value);
});
if (BI.isNull(result)) {
this.trigger.options.tipType = "warning";
this.element.removeClass("combo-error").addClass("combo-error");
} else {
this.trigger.options.tipType = "success";
this.element.removeClass("combo-error");
}
}
},
setValue: function (v) {
this.trigger.setValue(v);
this.popup.setValue(v);
this._checkError(v);
},
getValue: function () {
var value = this.popup.getValue();
return BI.isNull(value) ? [] : (BI.isArray(value) ? value : [value]);
},
populate: function (items) {
this.options.items = items;
this.textIconCombo.populate(items);
}
});
BI.IconTextValueCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo", BI.IconTextValueCombo);
/***/ }),
/* 475 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2017/12/12.
*/
BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-icon-text-icon-popup",
behaviors: {
redmark: function () {
return true;
}
}
});
},
_init: function () {
BI.IconTextValueComboPopup.superclass._init.apply(this, arguments);
var o = this.options, self = this;
this.popup = BI.createWidget({
type: "bi.button_group",
items: BI.createItems(o.items, {
type: "bi.single_select_icon_text_item",
height: 24,
iconHeight: o.iconHeight,
iconWidth: o.iconWidth,
iconWrapperWidth: o.iconWrapperWidth
}),
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
layouts: [{
type: "bi.vertical"
}],
behaviors: o.behaviors,
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE, val, obj);
}
});
this.check();
BI.createWidget({
type: "bi.vertical",
element: this,
vgap: 5,
items: [this.popup]
});
},
populate: function (items, keyword) {
BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments);
var o = this.options;
items = BI.createItems(items, {
type: "bi.single_select_icon_text_item",
height: 24,
iconWrapperWidth: o.iconWrapperWidth,
iconHeight: o.iconHeight,
iconWidth: o.iconWidth
});
this.popup.populate(items, keyword);
},
getValue: function () {
return this.popup.getValue();
},
setValue: function (v) {
this.popup.setValue(v);
}
});
BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);
/***/ }),
/* 476 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2018/2/2.
*/
BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-search-text-value-combo",
height: 24,
text: "",
items: [],
tipType: "",
warningTitle: "",
attributes: {
tabIndex: 0
}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
container: o.container,
adjustLength: 2,
toggle: false,
ref: function () {
self.combo = this;
},
el: {
type: "bi.search_text_value_trigger",
cls: "search-text-value-trigger",
ref: function () {
self.trigger = this;
},
items: o.items,
height: o.height - 2,
text: o.text,
value: o.value,
tipType: o.tipType,
warningTitle: o.warningTitle,
title: o.title,
listeners: [{
eventName: BI.SearchTextValueTrigger.EVENT_CHANGE,
action: function () {
self.setValue(this.getValue());
self.combo.hideView();
self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE);
}
}]
},
popup: {
el: {
type: "bi.text_value_combo_popup",
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
value: o.value,
items: o.items,
ref: function () {
self.popup = this;
self.trigger.getSearcher().setAdapter(self.popup);
},
listeners: [{
eventName: BI.TextValueComboPopup.EVENT_CHANGE,
action: function () {
self.setValue(this.getValue());
self.combo.hideView();
self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE);
}
}]
},
value: o.value,
maxHeight: 252,
minHeight: 25
},
listeners: [{
eventName: BI.Combo.EVENT_AFTER_HIDEVIEW,
action: function () {
self.trigger.stopEditing();
}
}, {
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW);
}
}],
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
}
},
left: 0,
right: 0,
bottom: 0,
top: 0
}, {
el: {
type: "bi.trigger_icon_button",
cls: "trigger-icon-button",
ref: function () {
self.triggerBtn = this;
},
width: o.height,
height: o.height,
handler: function () {
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
}
},
right: 0,
bottom: 0,
top: 0
}]
};
},
mounted: function () {
var o = this.options;
if(BI.isKey(o.value)) {
this._checkError(o.value);
}
},
_checkError: function (v) {
if(BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) {
this.trigger.options.tipType = "success";
this.element.removeClass("combo-error");
} else {
v = BI.isArray(v) ? v : [v];
var result = BI.find(this.options.items, function (idx, item) {
return BI.contains(v, item.value);
});
if (BI.isNull(result)) {
this.element.removeClass("combo-error").addClass("combo-error");
this.trigger.attr("tipType", "warning");
} else {
this.element.removeClass("combo-error");
this.trigger.attr("tipType", "success");
}
}
},
populate: function (items) {
this.options.items = items;
this.combo.populate(items);
},
setValue: function (v) {
this.combo.setValue(v);
this._checkError(v);
},
getValue: function () {
var value = this.combo.getValue();
return BI.isNull(value) ? [] : (BI.isArray(value) ? value : [value]);
}
});
BI.SearchTextValueCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.search_text_value_combo", BI.SearchTextValueCombo);
/***/ }),
/* 477 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2018/2/5.
*/
BI.SearchTextValueComboPopup = BI.inherit(BI.Pane, {
props: {
baseCls: "bi-search-text-value-popup"
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vertical",
vgap: 5,
items: [{
type: "bi.button_group",
ref: function () {
self.popup = this;
},
items: BI.createItems(o.items, {
type: "bi.single_select_item",
textAlign: o.textAlign,
height: 24
}),
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
layouts: [{
type: "bi.vertical"
}],
behaviors: {
redmark: function () {
return true;
}
},
value: o.value,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function (type, val, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.SearchTextValueComboPopup.EVENT_CHANGE, val, obj);
}
}
}]
}]
};
},
mounted: function() {
this.check();
},
populate: function (find, match, keyword) {
var items = BI.concat(find, match);
BI.SearchTextValueComboPopup.superclass.populate.apply(this, items);
items = BI.createItems(items, {
type: "bi.single_select_item",
height: 24
});
this.popup.populate(items, keyword);
},
getValue: function () {
return this.popup.getValue();
},
setValue: function (v) {
this.popup.setValue(v);
}
});
BI.SearchTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.search_text_value_combo_popup", BI.SearchTextValueComboPopup);
/***/ }),
/* 478 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2018/2/2.
*/
BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
props: {
extraCls: "bi-search-text-value-trigger bi-border",
height: 24
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.htape",
items: [
{
el: {
type: "bi.searcher",
ref: function () {
self.searcher = this;
},
isAutoSearch: false,
el: {
type: "bi.state_editor",
ref: function () {
self.editor = this;
},
defaultText: o.text,
text: this._digest(o.value, o.items),
value: o.value,
height: o.height,
tipText: ""
},
popup: {
type: "bi.search_text_value_combo_popup",
cls: "bi-card",
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE
},
onSearch: function (obj, callback) {
var keyword = obj.keyword;
var finding = BI.Func.getSearchResult(o.items, keyword);
var matched = finding.match, find = finding.find;
callback(find, matched);
},
listeners: [{
eventName: BI.Searcher.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.SearchTextValueTrigger.EVENT_CHANGE);
}
}]
}
}, {
el: {
type: "bi.layout",
width: 24
},
width: 24
}
]
};
},
_setState: function (v) {
this.editor.setState(v);
},
_digest: function(vals, items){
var o = this.options;
vals = BI.isArray(vals) ? vals : [vals];
var result = [];
var formatItems = BI.Tree.transformToArrayFormat(items);
BI.each(formatItems, function (i, item) {
if (BI.deepContains(vals, item.value) && !BI.contains(result, item.text || item.value)) {
result.push(item.text || item.value);
}
});
if (result.length > 0) {
return result.join(",");
} else {
return BI.isFunction(o.text) ? o.text() : o.text;
}
},
stopEditing: function () {
this.searcher.stopSearch();
},
getSearcher: function () {
return this.searcher;
},
populate: function (items) {
this.options.items = items;
},
setValue: function (vals) {
this._setState(this._digest(vals, this.options.items));
},
getValue: function () {
return this.searcher.getValue();
}
});
BI.SearchTextValueTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.SearchTextValueTrigger.EVENT_STOP = "EVENT_STOP";
BI.SearchTextValueTrigger.EVENT_START = "EVENT_START";
BI.SearchTextValueTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.search_text_value_trigger", BI.SearchTextValueTrigger);
/***/ }),
/* 479 */
/***/ (function(module, exports) {
/**
* @class BI.TextValueCheckCombo
* @extend BI.Widget
* combo : text + icon, popup : check + text
*/
BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-text-value-check-combo",
width: 100,
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
value: "",
attributes: {
tabIndex: 0
}
});
},
_init: function () {
BI.TextValueCheckCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
cls: "text-value-trigger",
items: o.items,
height: o.height,
text: o.text,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.text_value_check_combo_popup",
chooseType: o.chooseType,
items: o.items,
value: o.value
});
this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.textIconCheckCombo.hideView();
self.fireEvent(BI.TextValueCheckCombo.EVENT_CHANGE);
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.textIconCheckCombo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
popup: {
el: this.popup,
maxHeight: 300
}
});
if (BI.isKey(o.value)) {
this.setValue(o.value);
}
},
setTitle: function (title) {
this.trigger.setTitle(title);
},
setValue: function (v) {
this.trigger.setValue(v);
this.popup.setValue(v);
},
setWarningTitle: function (title) {
this.trigger.setWarningTitle(title);
},
getValue: function () {
var value = this.popup.getValue();
return BI.isNull(value) ? [] : (BI.isArray(value) ? value : [value]);
},
populate: function (items) {
this.options.items = items;
this.textIconCheckCombo.populate(items);
}
});
BI.TextValueCheckCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_value_check_combo", BI.TextValueCheckCombo);
/***/ }),
/* 480 */
/***/ (function(module, exports) {
BI.TextValueCheckComboPopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-text-icon-popup",
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE
});
},
_init: function () {
BI.TextValueCheckComboPopup.superclass._init.apply(this, arguments);
var o = this.options, self = this;
this.popup = BI.createWidget({
type: "bi.button_group",
items: this._formatItems(o.items),
chooseType: o.chooseType,
layouts: [{
type: "bi.vertical"
}],
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.TextValueCheckComboPopup.EVENT_CHANGE, val, obj);
}
});
BI.createWidget({
type: "bi.vertical",
element: this,
vgap: 5,
items: [this.popup]
});
},
_formatItems: function (items) {
return BI.map(items, function (i, item) {
return BI.extend({
type: "bi.single_select_item",
cls: "bi-list-item",
height: 24
}, item);
});
},
populate: function (items) {
BI.TextValueCheckComboPopup.superclass.populate.apply(this, arguments);
this.popup.populate(this._formatItems(items));
},
getValue: function () {
return this.popup.getValue();
},
setValue: function (v) {
this.popup.setValue(v);
}
});
BI.TextValueCheckComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_value_check_combo_popup", BI.TextValueCheckComboPopup);
/***/ }),
/* 481 */
/***/ (function(module, exports) {
/**
* @class BI.TextValueCombo
* @extend BI.Widget
* combo : text + icon, popup : text
* 参见场景dashboard布局方式选择
*/
BI.TextValueCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-text-value-combo",
height: 24,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
text: "",
value: "",
attributes: {
tabIndex: 0
}
});
},
_init: function () {
BI.TextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
cls: "text-value-trigger",
items: o.items,
height: o.height,
text: o.text,
value: o.value,
warningTitle: o.warningTitle
});
this.popup = BI.createWidget({
type: "bi.text_value_combo_popup",
chooseType: o.chooseType,
value: o.value,
items: o.items
});
this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.textIconCombo.hideView();
self.fireEvent(BI.TextValueCombo.EVENT_CHANGE, arguments);
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.textIconCombo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
popup: {
el: this.popup,
maxHeight: 240,
minHeight: 25
}
});
if(BI.isKey(o.value)) {
this._checkError(o.value);
}
},
_checkError: function (v) {
if(BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) {
this.trigger.options.tipType = "success";
this.element.removeClass("combo-error");
} else {
v = BI.isArray(v) ? v : [v];
var result = BI.find(this.options.items, function (idx, item) {
return BI.contains(v, item.value);
});
if (BI.isNull(result)) {
this.trigger.setTipType("warning");
this.element.removeClass("combo-error").addClass("combo-error");
} else {
this.trigger.setTipType("success");
this.element.removeClass("combo-error");
}
}
},
setValue: function (v) {
this.trigger.setValue(v);
this.popup.setValue(v);
this._checkError(v);
},
getValue: function () {
var value = this.popup.getValue();
return BI.isNull(value) ? [] : (BI.isArray(value) ? value : [value]);
},
populate: function (items) {
this.options.items = items;
this.textIconCombo.populate(items);
}
});
BI.TextValueCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_value_combo", BI.TextValueCombo);
/***/ }),
/* 482 */
/***/ (function(module, exports) {
/**
* @class BI.SmallTextValueCombo
* @extend BI.Widget
* combo : text + icon, popup : text
* 参见场景dashboard布局方式选择
*/
BI.SmallTextValueCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SmallTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
width: 100,
height: 20,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
el: {},
text: ""
});
},
_init: function () {
BI.SmallTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el, {
type: "bi.small_select_text_trigger",
items: o.items,
height: o.height,
text: o.text
});
this.popup = BI.createWidget({
type: "bi.text_value_combo_popup",
chooseType: o.chooseType,
items: o.items
});
this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.SmallTextValueCombo.hideView();
self.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE);
});
this.popup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.SmallTextValueCombo = BI.createWidget({
type: "bi.combo",
element: this,
container: o.container,
adjustLength: 2,
el: this.trigger,
popup: {
el: this.popup,
maxHeight: 240,
minHeight: 25
}
});
},
setValue: function (v) {
this.trigger.setValue(v);
this.popup.setValue(v);
},
getValue: function () {
return this.popup.getValue();
},
populate: function (items) {
this.options.items = items;
this.SmallTextValueCombo.populate(items);
}
});
BI.SmallTextValueCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.small_text_value_combo", BI.SmallTextValueCombo);
/***/ }),
/* 483 */
/***/ (function(module, exports) {
BI.TextValueComboPopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-text-icon-popup",
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE
});
},
_init: function () {
BI.TextValueComboPopup.superclass._init.apply(this, arguments);
var o = this.options, self = this;
this.popup = BI.createWidget({
type: "bi.button_group",
items: BI.createItems(o.items, {
type: "bi.single_select_item",
textAlign: o.textAlign,
height: 24
}),
chooseType: o.chooseType,
layouts: [{
type: "bi.vertical"
}],
value: o.value
});
this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val, obj);
}
});
this.check();
BI.createWidget({
type: "bi.vertical",
element: this,
vgap: 5,
items: [this.popup]
});
},
populate: function (items) {
BI.TextValueComboPopup.superclass.populate.apply(this, arguments);
items = BI.createItems(items, {
type: "bi.single_select_item",
height: 24
});
this.popup.populate(items);
},
getValue: function () {
return this.popup.getValue();
},
setValue: function (v) {
this.popup.setValue(v);
}
});
BI.TextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_value_combo_popup", BI.TextValueComboPopup);
/***/ }),
/* 484 */
/***/ (function(module, exports) {
/**
* 有清楚按钮的文本框
* Created by GUY on 2015/9/29.
* @class BI.SmallTextEditor
* @extends BI.SearchEditor
*/
BI.ClearEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.ClearEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-clear-editor",
height: 24,
errorText: "",
watermark: "",
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn
});
},
_init: function () {
BI.ClearEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.editor",
height: o.height,
watermark: o.watermark,
allowBlank: true,
errorText: o.errorText,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
value: o.value
});
this.clear = BI.createWidget({
type: "bi.icon_button",
stopEvent: true,
cls: "search-close-h-font"
});
this.clear.on(BI.IconButton.EVENT_CHANGE, function () {
self.setValue("");
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT);
self.fireEvent(BI.ClearEditor.EVENT_CLEAR);
});
BI.createWidget({
element: this,
type: "bi.htape",
items: [
{
el: this.editor
},
{
el: this.clear,
width: 24
}]
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_FOCUS, function () {
self.fireEvent(BI.ClearEditor.EVENT_FOCUS);
});
this.editor.on(BI.Editor.EVENT_BLUR, function () {
self.fireEvent(BI.ClearEditor.EVENT_BLUR);
});
this.editor.on(BI.Editor.EVENT_CLICK, function () {
self.fireEvent(BI.ClearEditor.EVENT_CLICK);
});
this.editor.on(BI.Editor.EVENT_CHANGE, function () {
self._checkClear();
self.fireEvent(BI.ClearEditor.EVENT_CHANGE);
});
this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.ClearEditor.EVENT_KEY_DOWN, v);
});
this.editor.on(BI.Editor.EVENT_SPACE, function () {
self.fireEvent(BI.ClearEditor.EVENT_SPACE);
});
this.editor.on(BI.Editor.EVENT_BACKSPACE, function () {
self.fireEvent(BI.ClearEditor.EVENT_BACKSPACE);
});
this.editor.on(BI.Editor.EVENT_VALID, function () {
self.fireEvent(BI.ClearEditor.EVENT_VALID);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self.fireEvent(BI.ClearEditor.EVENT_ERROR);
});
this.editor.on(BI.Editor.EVENT_ENTER, function () {
self.fireEvent(BI.ClearEditor.EVENT_ENTER);
});
this.editor.on(BI.Editor.EVENT_RESTRICT, function () {
self.fireEvent(BI.ClearEditor.EVENT_RESTRICT);
});
this.editor.on(BI.Editor.EVENT_EMPTY, function () {
self._checkClear();
self.fireEvent(BI.ClearEditor.EVENT_EMPTY);
});
this.editor.on(BI.Editor.EVENT_REMOVE, function () {
self.fireEvent(BI.ClearEditor.EVENT_REMOVE);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self.fireEvent(BI.ClearEditor.EVENT_CONFIRM);
});
this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM, function () {
self.fireEvent(BI.ClearEditor.EVENT_CHANGE_CONFIRM);
});
this.editor.on(BI.Editor.EVENT_START, function () {
self.fireEvent(BI.ClearEditor.EVENT_START);
});
this.editor.on(BI.Editor.EVENT_PAUSE, function () {
self.fireEvent(BI.ClearEditor.EVENT_PAUSE);
});
this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.ClearEditor.EVENT_STOP);
});
if (BI.isKey(o.value)) {
this.clear.visible();
} else {
this.clear.invisible();
}
},
_checkClear: function () {
if (!this.getValue()) {
this.clear.invisible();
} else {
this.clear.visible();
}
},
setWaterMark: function (v) {
this.options.watermark = v;
this.editor.setWaterMark(v);
},
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.blur();
},
getValue: function () {
if (this.isValid()) {
return this.editor.getValue();
}
},
setValue: function (v) {
this.editor.setValue(v);
if (BI.isKey(v)) {
this.clear.visible();
}
},
isValid: function () {
return this.editor.isValid();
}
});
BI.ClearEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.ClearEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.ClearEditor.EVENT_BLUR = "EVENT_BLUR";
BI.ClearEditor.EVENT_CLICK = "EVENT_CLICK";
BI.ClearEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.ClearEditor.EVENT_SPACE = "EVENT_SPACE";
BI.ClearEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE";
BI.ClearEditor.EVENT_CLEAR = "EVENT_CLEAR";
BI.ClearEditor.EVENT_START = "EVENT_START";
BI.ClearEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.ClearEditor.EVENT_STOP = "EVENT_STOP";
BI.ClearEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.ClearEditor.EVENT_CHANGE_CONFIRM = "EVENT_CHANGE_CONFIRM";
BI.ClearEditor.EVENT_VALID = "EVENT_VALID";
BI.ClearEditor.EVENT_ERROR = "EVENT_ERROR";
BI.ClearEditor.EVENT_ENTER = "EVENT_ENTER";
BI.ClearEditor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.ClearEditor.EVENT_REMOVE = "EVENT_REMOVE";
BI.ClearEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.clear_editor", BI.ClearEditor);
/***/ }),
/* 485 */
/***/ (function(module, exports) {
/**
* 带标记的文本框
* Created by GUY on 2016/1/25.
* @class BI.ShelterEditor
* @extends BI.Widget
*/
BI.ShelterEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.ShelterEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-shelter-editor",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: true,
watermark: "",
errorText: "",
height: 24,
textAlign: "left"
});
},
_init: function () {
BI.ShelterEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.editor",
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
});
this.text = BI.createWidget({
type: "bi.text_button",
cls: "shelter-editor-text",
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType,
textAlign: o.textAlign,
height: o.height,
hgap: o.hgap
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.text.on(BI.Controller.EVENT_CHANGE, function () {
arguments[2] = self;
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.text.on(BI.TextButton.EVENT_CHANGE, function () {
self.fireEvent(BI.ShelterEditor.EVENT_CLICK_LABEL);
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_FOCUS, function () {
self.fireEvent(BI.ShelterEditor.EVENT_FOCUS, arguments);
});
this.editor.on(BI.Editor.EVENT_BLUR, function () {
self.fireEvent(BI.ShelterEditor.EVENT_BLUR, arguments);
});
this.editor.on(BI.Editor.EVENT_CLICK, function () {
self.fireEvent(BI.ShelterEditor.EVENT_CLICK, arguments);
});
this.editor.on(BI.Editor.EVENT_CHANGE, function () {
self.fireEvent(BI.ShelterEditor.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.ShelterEditor.EVENT_KEY_DOWN, arguments);
});
this.editor.on(BI.Editor.EVENT_VALID, function () {
self.fireEvent(BI.ShelterEditor.EVENT_VALID, arguments);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self._showHint();
self._checkText();
self.fireEvent(BI.ShelterEditor.EVENT_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM, function () {
self._showHint();
self._checkText();
self.fireEvent(BI.ShelterEditor.EVENT_CHANGE_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_START, function () {
self.fireEvent(BI.ShelterEditor.EVENT_START, arguments);
});
this.editor.on(BI.Editor.EVENT_PAUSE, function () {
self.fireEvent(BI.ShelterEditor.EVENT_PAUSE, arguments);
});
this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.ShelterEditor.EVENT_STOP, arguments);
});
this.editor.on(BI.Editor.EVENT_SPACE, function () {
self.fireEvent(BI.ShelterEditor.EVENT_SPACE, arguments);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self._checkText();
self.fireEvent(BI.ShelterEditor.EVENT_ERROR, arguments);
});
this.editor.on(BI.Editor.EVENT_ENTER, function () {
self.fireEvent(BI.ShelterEditor.EVENT_ENTER, arguments);
});
this.editor.on(BI.Editor.EVENT_RESTRICT, function () {
self.fireEvent(BI.ShelterEditor.EVENT_RESTRICT, arguments);
});
this.editor.on(BI.Editor.EVENT_EMPTY, function () {
self.fireEvent(BI.ShelterEditor.EVENT_EMPTY, arguments);
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [this.editor]
});
this._showHint();
self._checkText();
},
_checkText: function () {
var o = this.options;
if (this.editor.getValue() === "") {
this.text.setValue(o.watermark || "");
this.text.element.addClass("bi-water-mark");
} else {
this.text.setValue(this.editor.getValue());
this.text.element.removeClass("bi-water-mark");
}
BI.isKey(o.keyword) && this.text.doRedMark(o.keyword);
},
_showInput: function () {
this.editor.visible();
this.text.invisible();
},
_showHint: function () {
this.editor.invisible();
this.text.visible();
},
setWaterMark: function (v) {
this.options.watermark = v;
this.editor.setWaterMark(v);
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
focus: function () {
this._showInput();
this.editor.focus();
},
blur: function () {
this.editor.blur();
this._showHint();
this._checkText();
},
doRedMark: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
isEditing: function () {
return this.editor.isEditing();
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
getLastChangedValue: function () {
return this.editor.getLastChangedValue();
},
setTextStyle: function (style) {
this.text.setStyle(style);
},
setValue: function (k) {
var o = this.options;
this.editor.setValue(k);
this._checkText();
},
getValue: function () {
return this.editor.getValue();
},
getState: function () {
return this.text.getValue();
},
setState: function (v) {
this._showHint();
this.text.setValue(v);
}
});
BI.ShelterEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.ShelterEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.ShelterEditor.EVENT_BLUR = "EVENT_BLUR";
BI.ShelterEditor.EVENT_CLICK = "EVENT_CLICK";
BI.ShelterEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.ShelterEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL";
BI.ShelterEditor.EVENT_START = "EVENT_START";
BI.ShelterEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.ShelterEditor.EVENT_STOP = "EVENT_STOP";
BI.ShelterEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.ShelterEditor.EVENT_CHANGE_CONFIRM = "EVENT_CHANGE_CONFIRM";
BI.ShelterEditor.EVENT_VALID = "EVENT_VALID";
BI.ShelterEditor.EVENT_ERROR = "EVENT_ERROR";
BI.ShelterEditor.EVENT_ENTER = "EVENT_ENTER";
BI.ShelterEditor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.ShelterEditor.EVENT_SPACE = "EVENT_SPACE";
BI.ShelterEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.shelter_editor", BI.ShelterEditor);
/***/ }),
/* 486 */
/***/ (function(module, exports) {
/**
* 带标记的文本框
* Created by GUY on 2015/8/28.
* @class BI.SignEditor
* @extends BI.Widget
*/
BI.SignEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SignEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-sign-editor",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: true,
watermark: "",
errorText: "",
height: 24
});
},
_init: function () {
BI.SignEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.editor",
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
});
this.text = BI.createWidget({
type: "bi.text_button",
cls: "sign-editor-text",
title: o.title,
warningTitle: o.warningTitle,
tipType: o.tipType,
textAlign: "left",
height: o.height,
hgap: o.hgap,
handler: function () {
self._showInput();
self.editor.focus();
self.editor.selectAll();
}
});
this.text.on(BI.TextButton.EVENT_CHANGE, function () {
BI.nextTick(function () {
self.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL);
});
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_FOCUS, function () {
self.fireEvent(BI.SignEditor.EVENT_FOCUS, arguments);
});
this.editor.on(BI.Editor.EVENT_BLUR, function () {
self.fireEvent(BI.SignEditor.EVENT_BLUR, arguments);
});
this.editor.on(BI.Editor.EVENT_CLICK, function () {
self.fireEvent(BI.SignEditor.EVENT_CLICK, arguments);
});
this.editor.on(BI.Editor.EVENT_CHANGE, function () {
self.fireEvent(BI.SignEditor.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.SignEditor.EVENT_KEY_DOWN, arguments);
});
this.editor.on(BI.Editor.EVENT_VALID, function () {
self.fireEvent(BI.SignEditor.EVENT_VALID, arguments);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self._showHint();
self._checkText();
self.fireEvent(BI.SignEditor.EVENT_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM, function () {
self._showHint();
self._checkText();
self.fireEvent(BI.SignEditor.EVENT_CHANGE_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_START, function () {
self.fireEvent(BI.SignEditor.EVENT_START, arguments);
});
this.editor.on(BI.Editor.EVENT_PAUSE, function () {
self.fireEvent(BI.SignEditor.EVENT_PAUSE, arguments);
});
this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.SignEditor.EVENT_STOP, arguments);
});
this.editor.on(BI.Editor.EVENT_SPACE, function () {
self.fireEvent(BI.SignEditor.EVENT_SPACE, arguments);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self._checkText();
self.fireEvent(BI.SignEditor.EVENT_ERROR, arguments);
});
this.editor.on(BI.Editor.EVENT_ENTER, function () {
self.fireEvent(BI.SignEditor.EVENT_ENTER, arguments);
});
this.editor.on(BI.Editor.EVENT_RESTRICT, function () {
self.fireEvent(BI.SignEditor.EVENT_RESTRICT, arguments);
});
this.editor.on(BI.Editor.EVENT_EMPTY, function () {
self.fireEvent(BI.SignEditor.EVENT_EMPTY, arguments);
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [this.editor]
});
this._showHint();
self._checkText();
},
_checkText: function () {
var o = this.options;
BI.nextTick(BI.bind(function () {
if (this.editor.getValue() === "") {
this.text.setValue(o.watermark || "");
this.text.element.addClass("bi-water-mark");
} else {
this.text.setValue(this.editor.getValue());
this.text.element.removeClass("bi-water-mark");
BI.isKey(o.keyword) && this.text.doRedMark(o.keyword);
}
}, this));
},
_showInput: function () {
this.editor.visible();
this.text.invisible();
},
_showHint: function () {
this.editor.invisible();
this.text.visible();
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
setWaterMark: function (v) {
this.options.watermark = v;
this.editor.setWaterMark(v);
},
focus: function () {
this._showInput();
this.editor.focus();
},
blur: function () {
this.editor.blur();
this._showHint();
this._checkText();
},
doRedMark: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
isEditing: function () {
return this.editor.isEditing();
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
getLastChangedValue: function () {
return this.editor.getLastChangedValue();
},
setValue: function (k) {
this.editor.setValue(k);
this._checkText();
},
getValue: function () {
return this.editor.getValue();
},
getState: function () {
return this.text.getValue();
},
setState: function (v) {
this._showHint();
this.text.setValue(v);
}
});
BI.SignEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.SignEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.SignEditor.EVENT_BLUR = "EVENT_BLUR";
BI.SignEditor.EVENT_CLICK = "EVENT_CLICK";
BI.SignEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.SignEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL";
BI.SignEditor.EVENT_START = "EVENT_START";
BI.SignEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.SignEditor.EVENT_STOP = "EVENT_STOP";
BI.SignEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.SignEditor.EVENT_CHANGE_CONFIRM = "EVENT_CHANGE_CONFIRM";
BI.SignEditor.EVENT_VALID = "EVENT_VALID";
BI.SignEditor.EVENT_ERROR = "EVENT_ERROR";
BI.SignEditor.EVENT_ENTER = "EVENT_ENTER";
BI.SignEditor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.SignEditor.EVENT_SPACE = "EVENT_SPACE";
BI.SignEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.sign_editor", BI.SignEditor);
/***/ }),
/* 487 */
/***/ (function(module, exports) {
/**
* guy
* 记录状态的输入框
* @class BI.StateEditor
* @extends BI.Single
*/
BI.StateEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.StateEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-state-editor",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: true,
watermark: "",
errorText: "",
height: 24,
defaultText: "", // 默认显示值,默认显示值与显示值的区别是默认显示值标记灰色
text: BI.i18nText("BI-Basic_Unrestricted") // 显示值
});
},
_init: function () {
BI.StateEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.editor",
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
});
this.text = BI.createWidget({
type: "bi.text_button",
cls: "bi-water-mark tip-text-style",
textAlign: "left",
height: o.height,
text: o.text,
hgap: o.hgap,
handler: function () {
self._showInput();
self.editor.focus();
self.editor.setValue("");
},
title: BI.isNotNull(o.tipText) ? o.tipText : function () {
var title = "";
if (BI.isString(self.stateValue)) {
title = self.stateValue;
}
if (BI.isArray(self.stateValue) && self.stateValue.length === 1) {
title = self.stateValue[0];
}
return title;
},
warningTitle: o.warningTitle,
tipType: o.tipType
});
this.text.on(BI.TextButton.EVENT_CHANGE, function () {
BI.nextTick(function () {
self.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL);
});
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_FOCUS, function () {
self.fireEvent(BI.StateEditor.EVENT_FOCUS, arguments);
});
this.editor.on(BI.Editor.EVENT_BLUR, function () {
self.fireEvent(BI.StateEditor.EVENT_BLUR, arguments);
});
this.editor.on(BI.Editor.EVENT_CLICK, function () {
self.fireEvent(BI.StateEditor.EVENT_CLICK, arguments);
});
this.editor.on(BI.Editor.EVENT_CHANGE, function () {
self.fireEvent(BI.StateEditor.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.StateEditor.EVENT_KEY_DOWN, arguments);
});
this.editor.on(BI.Editor.EVENT_VALID, function () {
self.fireEvent(BI.StateEditor.EVENT_VALID, arguments);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self._showHint();
self.fireEvent(BI.StateEditor.EVENT_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM, function () {
self._showHint();
self.fireEvent(BI.StateEditor.EVENT_CHANGE_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_START, function () {
self.fireEvent(BI.StateEditor.EVENT_START, arguments);
});
this.editor.on(BI.Editor.EVENT_PAUSE, function () {
self.fireEvent(BI.StateEditor.EVENT_PAUSE, arguments);
});
this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.StateEditor.EVENT_STOP, arguments);
});
this.editor.on(BI.Editor.EVENT_SPACE, function () {
self.fireEvent(BI.StateEditor.EVENT_SPACE, arguments);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self.fireEvent(BI.StateEditor.EVENT_ERROR, arguments);
});
this.editor.on(BI.Editor.EVENT_ENTER, function () {
self.fireEvent(BI.StateEditor.EVENT_ENTER, arguments);
});
this.editor.on(BI.Editor.EVENT_RESTRICT, function () {
self.fireEvent(BI.StateEditor.EVENT_RESTRICT, arguments);
});
this.editor.on(BI.Editor.EVENT_EMPTY, function () {
self.fireEvent(BI.StateEditor.EVENT_EMPTY, arguments);
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [this.editor]
});
this._showHint();
if (BI.isNotNull(o.text)) {
this.setState(o.text);
}
},
setWaterMark: function (v) {
this.options.watermark = v;
this.editor.setWaterMark(v);
},
doRedMark: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
focus: function () {
if (this.options.disabled === false) {
this._showInput();
this.editor.focus();
}
},
blur: function () {
this.editor.blur();
this._showHint();
},
_showInput: function () {
this.editor.visible();
this.text.invisible();
},
_showHint: function () {
this.editor.invisible();
this.text.visible();
},
_setText: function (v) {
this.text.setText(v);
this.text.setTitle(v);
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
isEditing: function () {
return this.editor.isEditing();
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
getLastChangedValue: function () {
return this.editor.getLastChangedValue();
},
setValue: function (k) {
this.editor.setValue(k);
},
getValue: function () {
return this.editor.getValue();
},
getState: function () {
return this.editor.getValue().match(/[^\s]+/g);
},
setState: function (v) {
var o = this.options;
BI.StateEditor.superclass.setValue.apply(this, arguments);
this.stateValue = v;
if (BI.isNumber(v)) {
if (v === BI.Selection.All) {
this._setText(BI.i18nText("BI-Select_All"));
this.text.element.removeClass("bi-water-mark");
} else if (v === BI.Selection.Multi) {
this._setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark");
} else {
this._setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
}
return;
}
if (BI.isString(v)) {
this._setText(v);
// 配置了defaultText才判断标灰,其他情况不标灰
(BI.isKey(o.defaultText) && o.defaultText === v) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
return;
}
if (BI.isArray(v)) {
if (BI.isEmpty(v)) {
this._setText(BI.isKey(o.defaultText) ? o.defaultText : o.text);
BI.isKey(o.defaultText) ? this.text.element.addClass("bi-water-mark") : this.text.element.removeClass("bi-water-mark");
} else if (v.length === 1) {
this._setText(v[0]);
this.text.element.removeClass("bi-water-mark");
} else {
this._setText(BI.i18nText("BI-Select_Part"));
this.text.element.removeClass("bi-water-mark");
}
}
},
setTipType: function (v) {
this.text.options.tipType = v;
},
getText: function () {
return this.text.getText();
}
});
BI.StateEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.StateEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.StateEditor.EVENT_BLUR = "EVENT_BLUR";
BI.StateEditor.EVENT_CLICK = "EVENT_CLICK";
BI.StateEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.StateEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL";
BI.StateEditor.EVENT_START = "EVENT_START";
BI.StateEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.StateEditor.EVENT_STOP = "EVENT_STOP";
BI.StateEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.StateEditor.EVENT_CHANGE_CONFIRM = "EVENT_CHANGE_CONFIRM";
BI.StateEditor.EVENT_VALID = "EVENT_VALID";
BI.StateEditor.EVENT_ERROR = "EVENT_ERROR";
BI.StateEditor.EVENT_ENTER = "EVENT_ENTER";
BI.StateEditor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.StateEditor.EVENT_SPACE = "EVENT_SPACE";
BI.StateEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.state_editor", BI.StateEditor);
/***/ }),
/* 488 */
/***/ (function(module, exports) {
/**
* 无限制-已选择状态输入框
* Created by GUY on 2016/5/18.
* @class BI.SimpleStateEditor
* @extends BI.Single
*/
BI.SimpleStateEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SimpleStateEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-simple-state-editor",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
mouseOut: false,
allowBlank: true,
watermark: "",
errorText: "",
height: 24,
text: BI.i18nText("BI-Basic_Unrestricted")
});
},
_init: function () {
BI.SimpleStateEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.editor",
height: o.height,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
});
this.text = BI.createWidget({
type: "bi.text_button",
cls: "bi-water-mark",
textAlign: "left",
text: o.text,
height: o.height,
hgap: o.hgap,
handler: function () {
self._showInput();
self.editor.focus();
self.editor.setValue("");
}
});
this.text.on(BI.TextButton.EVENT_CHANGE, function () {
BI.nextTick(function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_CLICK_LABEL);
});
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_FOCUS, function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_FOCUS, arguments);
});
this.editor.on(BI.Editor.EVENT_BLUR, function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_BLUR, arguments);
});
this.editor.on(BI.Editor.EVENT_CLICK, function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_CLICK, arguments);
});
this.editor.on(BI.Editor.EVENT_CHANGE, function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.SimpleStateEditor.EVENT_KEY_DOWN, arguments);
});
this.editor.on(BI.Editor.EVENT_VALID, function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_VALID, arguments);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self._showHint();
self.fireEvent(BI.SimpleStateEditor.EVENT_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM, function () {
self._showHint();
self.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_START, function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_START, arguments);
});
this.editor.on(BI.Editor.EVENT_PAUSE, function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_PAUSE, arguments);
});
this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_STOP, arguments);
});
this.editor.on(BI.Editor.EVENT_SPACE, function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_SPACE, arguments);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_ERROR, arguments);
});
this.editor.on(BI.Editor.EVENT_ENTER, function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_ENTER, arguments);
});
this.editor.on(BI.Editor.EVENT_RESTRICT, function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_RESTRICT, arguments);
});
this.editor.on(BI.Editor.EVENT_EMPTY, function () {
self.fireEvent(BI.SimpleStateEditor.EVENT_EMPTY, arguments);
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [this.editor]
});
this._showHint();
if(BI.isNotNull(o.text)){
this.setState(o.text);
}
},
setWaterMark: function (v) {
this.options.watermark = v;
this.editor.setWaterMark(v);
},
doRedMark: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
focus: function () {
this._showInput();
this.editor.focus();
},
blur: function () {
this.editor.blur();
this._showHint();
},
_showInput: function () {
this.editor.visible();
this.text.invisible();
},
_showHint: function () {
this.editor.invisible();
this.text.visible();
},
_setText: function (v) {
this.text.setText(v);
this.text.setTitle(v);
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
isEditing: function () {
return this.editor.isEditing();
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
getLastChangedValue: function () {
return this.editor.getLastChangedValue();
},
setValue: function (k) {
this.editor.setValue(k);
},
getValue: function () {
return this.editor.getValue();
},
getState: function () {
return this.editor.getValue().match(/[^\s]+/g);
},
setState: function (v) {
var o = this.options;
BI.SimpleStateEditor.superclass.setValue.apply(this, arguments);
if (BI.isNumber(v)) {
if (v === BI.Selection.All) {
this._setText(BI.i18nText("BI-Already_Selected"));
this.text.element.removeClass("bi-water-mark");
} else if (v === BI.Selection.Multi) {
this._setText(BI.i18nText("BI-Already_Selected"));
this.text.element.removeClass("bi-water-mark");
} else {
this._setText(o.text);
this.text.element.addClass("bi-water-mark");
}
return;
}
if (!BI.isArray(v) || v.length === 1) {
this._setText(v);
this.text.element.removeClass("bi-water-mark");
} else if (BI.isEmpty(v)) {
this._setText(o.text);
this.text.element.addClass("bi-water-mark");
} else {
this._setText(BI.i18nText("BI-Already_Selected"));
this.text.element.removeClass("bi-water-mark");
}
},
getText: function () {
return this.text.getText();
}
});
BI.SimpleStateEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.SimpleStateEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.SimpleStateEditor.EVENT_BLUR = "EVENT_BLUR";
BI.SimpleStateEditor.EVENT_CLICK = "EVENT_CLICK";
BI.SimpleStateEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.SimpleStateEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL";
BI.SimpleStateEditor.EVENT_START = "EVENT_START";
BI.SimpleStateEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.SimpleStateEditor.EVENT_STOP = "EVENT_STOP";
BI.SimpleStateEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.SimpleStateEditor.EVENT_CHANGE_CONFIRM = "EVENT_CHANGE_CONFIRM";
BI.SimpleStateEditor.EVENT_VALID = "EVENT_VALID";
BI.SimpleStateEditor.EVENT_ERROR = "EVENT_ERROR";
BI.SimpleStateEditor.EVENT_ENTER = "EVENT_ENTER";
BI.SimpleStateEditor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.SimpleStateEditor.EVENT_SPACE = "EVENT_SPACE";
BI.SimpleStateEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.simple_state_editor", BI.SimpleStateEditor);
/***/ }),
/* 489 */
/***/ (function(module, exports) {
/**
* 下拉框弹出层的多选版本,toolbar带有若干按钮, zIndex在1000w
* @class BI.MultiPopupView
* @extends BI.Widget
*/
BI.MultiPopupView = BI.inherit(BI.PopupView, {
_defaultConfig: function () {
var conf = BI.MultiPopupView.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
_baseCls: (conf._baseCls || "") + " bi-multi-list-view",
buttons: [BI.i18nText("BI-Basic_Sure")]
});
},
_init: function () {
BI.MultiPopupView.superclass._init.apply(this, arguments);
},
_createToolBar: function () {
var o = this.options, self = this;
if (o.buttons.length === 0) {
return;
}
var text = []; // 构造[{text:content},……]
BI.each(o.buttons, function (idx, item) {
text.push({
text: item,
value: idx
});
});
this.buttongroup = BI.createWidget({
type: "bi.button_group",
cls: "list-view-toolbar bi-high-light bi-split-top",
height: 24,
items: BI.createItems(text, {
type: "bi.text_button",
once: false,
shadow: true,
isShadowShowingOnSelected: true
}),
layouts: [{
type: "bi.center",
hgap: 0,
vgap: 0
}]
});
this.buttongroup.on(BI.ButtonGroup.EVENT_CHANGE, function (value, obj) {
self.fireEvent(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON, value, obj);
});
return this.buttongroup;
}
});
BI.MultiPopupView.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON = "EVENT_CLICK_TOOLBAR_BUTTON";
BI.shortcut("bi.multi_popup_view", BI.MultiPopupView);
/***/ }),
/* 490 */
/***/ (function(module, exports) {
/**
* 可以理解为MultiPopupView和Panel两个面板的结合体
* @class BI.PopupPanel
* @extends BI.MultiPopupView
*/
BI.PopupPanel = BI.inherit(BI.MultiPopupView, {
_defaultConfig: function () {
var conf = BI.PopupPanel.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-popup-panel",
title: ""
});
},
_init: function () {
BI.PopupPanel.superclass._init.apply(this, arguments);
},
_createTool: function () {
var self = this, o = this.options;
var close = BI.createWidget({
type: "bi.icon_button",
cls: "close-h-font",
width: 25,
height: 25
});
close.on(BI.IconButton.EVENT_CHANGE, function () {
self.setVisible(false);
self.fireEvent(BI.PopupPanel.EVENT_CLOSE);
});
return BI.createWidget({
type: "bi.htape",
cls: "popup-panel-title bi-header-background",
height: 25,
items: [{
el: {
type: "bi.label",
textAlign: "left",
text: o.title,
height: 25,
lgap: 10
}
}, {
el: close,
width: 25
}]
});
}
});
BI.PopupPanel.EVENT_CHANGE = "EVENT_CHANGE";
BI.PopupPanel.EVENT_CLOSE = "EVENT_CLOSE";
BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON = "EVENT_CLICK_TOOLBAR_BUTTON";
BI.shortcut("bi.popup_panel", BI.PopupPanel);
/***/ }),
/* 491 */
/***/ (function(module, exports) {
/**
* list面板
*
* Created by GUY on 2015/10/30.
* @class BI.ListPane
* @extends BI.Pane
*/
BI.ListPane = BI.inherit(BI.Pane, {
_defaultConfig: function () {
var conf = BI.ListPane.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-list-pane",
logic: {
dynamic: true
},
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
vgap: 0,
hgap: 0,
items: [],
itemsCreator: BI.emptyFn,
hasNext: BI.emptyFn,
onLoaded: BI.emptyFn,
el: {
type: "bi.button_group"
}
});
},
_init: function () {
BI.ListPane.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.button_group = BI.createWidget(o.el, {
type: "bi.button_group",
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
behaviors: {},
items: o.items,
itemsCreator: function (op, calback) {
if (op.times === 1) {
self.empty();
BI.nextTick(function () {
self.loading();
});
}
o.itemsCreator(op, function () {
calback.apply(self, arguments);
op.times === 1 && BI.nextTick(function () {
self.loaded();
// callback可能在loading之前执行, check保证显示正确
self.check();
});
});
},
hasNext: o.hasNext,
layouts: [{
type: "bi.vertical"
}]
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.ListPane.EVENT_CHANGE, value, obj);
}
});
this.check();
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top), BI.extend({
scrolly: true,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
vgap: o.vgap,
hgap: o.hgap
}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top, this.button_group)
}))));
},
hasPrev: function () {
return this.button_group.hasPrev && this.button_group.hasPrev();
},
hasNext: function () {
return this.button_group.hasNext && this.button_group.hasNext();
},
prependItems: function (items) {
this.options.items = items.concat(this.options.items);
this.button_group.prependItems.apply(this.button_group, arguments);
this.check();
},
addItems: function (items) {
this.options.items = this.options.items.concat(items);
this.button_group.addItems.apply(this.button_group, arguments);
this.check();
},
removeItemAt: function (indexes) {
indexes = indexes || [];
BI.removeAt(this.options.items, indexes);
this.button_group.removeItemAt.apply(this.button_group, arguments);
this.check();
},
populate: function (items) {
var self = this, o = this.options;
if (arguments.length === 0 && (BI.isFunction(this.button_group.attr("itemsCreator")))) {// 接管loader的populate方法
this.button_group.attr("itemsCreator").apply(this, [{times: 1}, function () {
if (arguments.length === 0) {
throw new Error("参数不能为空");
}
self.populate.apply(self, arguments);
}]);
return;
}
BI.ListPane.superclass.populate.apply(this, arguments);
this.button_group.populate.apply(this.button_group, arguments);
},
empty: function () {
this.button_group.empty();
},
setNotSelectedValue: function () {
this.button_group.setNotSelectedValue.apply(this.button_group, arguments);
},
getNotSelectedValue: function () {
return this.button_group.getNotSelectedValue();
},
setValue: function () {
this.button_group.setValue.apply(this.button_group, arguments);
},
getValue: function () {
return this.button_group.getValue.apply(this.button_group, arguments);
},
getAllButtons: function () {
return this.button_group.getAllButtons();
},
getAllLeaves: function () {
return this.button_group.getAllLeaves();
},
getSelectedButtons: function () {
return this.button_group.getSelectedButtons();
},
getNotSelectedButtons: function () {
return this.button_group.getNotSelectedButtons();
},
getIndexByValue: function (value) {
return this.button_group.getIndexByValue(value);
},
getNodeById: function (id) {
return this.button_group.getNodeById(id);
},
getNodeByValue: function (value) {
return this.button_group.getNodeByValue(value);
}
});
BI.ListPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.list_pane", BI.ListPane);
/***/ }),
/* 492 */
/***/ (function(module, exports) {
/**
* 带有标题栏的pane
* @class BI.Panel
* @extends BI.Widget
*/
BI.Panel = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Panel.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-panel bi-border",
title: "",
titleButtons: [],
el: {},
logic: {
dynamic: false
}
});
},
_init: function () {
BI.Panel.superclass._init.apply(this, arguments);
var o = this.options;
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("vertical", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("top", this._createTitle()
, this.options.el)
}))));
},
_createTitle: function () {
var self = this, o = this.options;
this.text = BI.createWidget({
type: "bi.label",
cls: "panel-title-text",
text: o.title,
height: 30
});
this.button_group = BI.createWidget({
type: "bi.button_group",
items: o.titleButtons,
layouts: [{
type: "bi.center_adapt",
lgap: 10
}]
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.button_group.on(BI.ButtonGroup.EVENT_CHANGE, function (value, obj) {
self.fireEvent(BI.Panel.EVENT_CHANGE, value, obj);
});
return {
el: {
type: "bi.left_right_vertical_adapt",
cls: "panel-title bi-header-background bi-border-bottom",
height: 29,
items: {
left: [this.text],
right: [this.button_group]
},
lhgap: 10,
rhgap: 10
},
height: 29
};
},
setTitle: function (title) {
this.text.setValue(title);
}
});
BI.Panel.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.panel", BI.Panel);
/***/ }),
/* 493 */
/***/ (function(module, exports) {
BI.LinearSegmentButton = BI.inherit(BI.BasicButton, {
props: {
extraCls: "bi-line-segment-button bi-list-item-effect",
once: true,
readonly: true,
hgap: 10,
height: 25
},
render: function () {
var self = this, o = this.options;
return [{
type: "bi.label",
text: o.text,
height: o.height,
value: o.value,
hgap: o.hgap,
ref: function () {
self.text = this;
}
}, {
type: "bi.absolute",
items: [{
el: {
type: "bi.layout",
cls: "line-segment-button-line",
height: 2,
ref: function () {
self.line = this;
}
},
left: 0,
right: 0,
bottom: 0
}]
}];
},
setSelected: function (v) {
BI.LinearSegmentButton.superclass.setSelected.apply(this, arguments);
if (v) {
this.line.element.addClass("bi-high-light-background");
} else {
this.line.element.removeClass("bi-high-light-background");
}
},
setText: function (text) {
this.text.setText(text);
}
});
BI.shortcut("bi.linear_segment_button", BI.LinearSegmentButton);
/***/ }),
/* 494 */
/***/ (function(module, exports) {
BI.LinearSegment = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-linear-segment bi-split-bottom",
items: [],
layouts: [{
type: "bi.center"
}],
height: 29
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.button_group",
items: BI.createItems(o.items, {
type: "bi.linear_segment_button",
height: o.height - 1
}),
layouts: o.layouts,
listeners: [{
eventName: "__EVENT_CHANGE__",
action: function () {
self.fireEvent("__EVENT_CHANGE__", arguments);
}
}, {
eventName: "EVENT_CHANGE",
action: function () {
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {
self.buttonGroup = this;
}
};
},
setValue: function (v) {
this.buttonGroup.setValue(v);
},
setEnabledValue: function (v) {
this.buttonGroup.setEnabledValue(v);
},
getValue: function () {
return this.buttonGroup.getValue();
}
});
BI.shortcut("bi.linear_segment", BI.LinearSegment);
/***/ }),
/* 495 */
/***/ (function(module, exports) {
/**
* 选择列表
*
* Created by GUY on 2015/11/1.
* @class BI.SelectList
* @extends BI.Widget
*/
BI.SelectList = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SelectList.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-list",
direction: BI.Direction.Top, // toolbar的位置
logic: {
dynamic: true
},
items: [],
itemsCreator: BI.emptyFn,
hasNext: BI.emptyFn,
onLoaded: BI.emptyFn,
toolbar: {
type: "bi.multi_select_bar",
iconWrapperWidth: 36
},
el: {
type: "bi.list_pane"
}
});
},
_init: function () {
BI.SelectList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
// 全选
this.toolbar = BI.createWidget(o.toolbar);
this.allSelected = false;
this.toolbar.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.allSelected = this.isSelected();
if (type === BI.Events.CLICK) {
self.setAllSelected(self.allSelected);
self.fireEvent(BI.SelectList.EVENT_CHANGE, value, obj);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.list = BI.createWidget(o.el, {
type: "bi.list_pane",
items: o.items,
itemsCreator: function (op, callback) {
op.times === 1 && self.toolbar.setVisible(false);
o.itemsCreator(op, function (items) {
callback.apply(self, arguments);
if (op.times === 1) {
self.toolbar.setVisible(items && items.length > 0);
self.toolbar.setEnable(self.isEnabled() && items && items.length > 0);
}
self._checkAllSelected();
});
},
onLoaded: o.onLoaded,
hasNext: o.hasNext
});
this.list.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (type === BI.Events.CLICK) {
self._checkAllSelected();
self.fireEvent(BI.SelectList.EVENT_CHANGE, value, obj);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({
scrolly: true
}, o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(o.direction, this.toolbar, this.list)
}))));
if (o.items.length <= 0) {
this.toolbar.setVisible(false);
this.toolbar.setEnable(false);
}
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
_checkAllSelected: function () {
var selectLength = this.list.getValue().length;
var notSelectLength = this.getAllLeaves().length - selectLength;
var hasNext = this.list.hasNext();
var isAlreadyAllSelected = this.toolbar.isSelected();
var isHalf = selectLength > 0 && (notSelectLength > 0 || (!isAlreadyAllSelected && hasNext));
isHalf = isHalf || (notSelectLength > 0 && hasNext && isAlreadyAllSelected);
this.toolbar.setHalfSelected(isHalf);
!isHalf && this.toolbar.setSelected(selectLength > 0 && notSelectLength <= 0 && (!hasNext || isAlreadyAllSelected));
},
setAllSelected: function (v) {
BI.each(this.getAllButtons(), function (i, btn) {
(btn.setSelected || btn.setAllSelected).apply(btn, [v]);
});
this.allSelected = !!v;
this.toolbar.setSelected(v);
this.toolbar.setHalfSelected(false);
},
setToolBarVisible: function (b) {
this.toolbar.setVisible(b);
},
isAllSelected: function () {
return this.allSelected;
// return this.toolbar.isSelected();
},
hasPrev: function () {
return this.list.hasPrev();
},
hasNext: function () {
return this.list.hasNext();
},
prependItems: function (items) {
this.list.prependItems.apply(this.list, arguments);
},
addItems: function (items) {
this.list.addItems.apply(this.list, arguments);
},
setValue: function (data) {
var selectAll = data.type === BI.ButtonGroup.CHOOSE_TYPE_ALL;
this.setAllSelected(selectAll);
this.list[selectAll ? "setNotSelectedValue" : "setValue"](data.value);
this._checkAllSelected();
},
getValue: function () {
if (this.isAllSelected() === false) {
return {
type: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
value: this.list.getValue(),
assist: this.list.getNotSelectedValue()
};
}
return {
type: BI.ButtonGroup.CHOOSE_TYPE_ALL,
value: this.list.getNotSelectedValue(),
assist: this.list.getValue()
};
},
empty: function () {
this.list.empty();
},
populate: function (items) {
this.toolbar.setVisible(!BI.isEmptyArray(items));
this.toolbar.setEnable(this.isEnabled() && !BI.isEmptyArray(items));
this.list.populate.apply(this.list, arguments);
this._checkAllSelected();
},
_setEnable: function (enable) {
BI.SelectList.superclass._setEnable.apply(this, arguments);
this.toolbar.setEnable(enable);
},
resetHeight: function (h) {
var toolHeight = ( this.toolbar.element.outerHeight() || 25) * ( this.toolbar.isVisible() ? 1 : 0);
this.list.resetHeight ? this.list.resetHeight(h - toolHeight) :
this.list.element.css({"max-height": h - toolHeight + "px"});
},
setNotSelectedValue: function () {
this.list.setNotSelectedValue.apply(this.list, arguments);
this._checkAllSelected();
},
getNotSelectedValue: function () {
return this.list.getNotSelectedValue();
},
getAllButtons: function () {
return this.list.getAllButtons();
},
getAllLeaves: function () {
return this.list.getAllLeaves();
},
getSelectedButtons: function () {
return this.list.getSelectedButtons();
},
getNotSelectedButtons: function () {
return this.list.getNotSelectedButtons();
},
getIndexByValue: function (value) {
return this.list.getIndexByValue(value);
},
getNodeById: function (id) {
return this.list.getNodeById(id);
},
getNodeByValue: function (value) {
return this.list.getNodeByValue(value);
}
});
BI.SelectList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.select_list", BI.SelectList);
/***/ }),
/* 496 */
/***/ (function(module, exports) {
/**
* Created by roy on 15/11/6.
*/
BI.LazyLoader = BI.inherit(BI.Widget, {
_const: {
PAGE: 100
},
_defaultConfig: function () {
return BI.extend(BI.LazyLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-lazy-loader",
el: {},
items: []
});
},
_init: function () {
var self = this, o = this.options;
BI.LazyLoader.superclass._init.apply(this, arguments);
var all = o.items.length;
this.loader = BI.createWidget({
type: "bi.loader",
element: this,
// 下面是button_group的属性
el: o.el,
itemsCreator: function (options, populate) {
populate(self._getNextItems(options));
},
hasNext: function (option) {
return option.count < all;
}
});
this.loader.on(BI.Loader.EVENT_CHANGE, function (obj) {
self.fireEvent(BI.LazyLoader.EVENT_CHANGE, obj);
});
},
_getNextItems: function (options) {
var self = this, o = this.options;
var lastNum = o.items.length - this._const.PAGE * (options.times - 1);
var lastItems = BI.takeRight(o.items, lastNum);
var nextItems = BI.take(lastItems, this._const.PAGE);
return nextItems;
},
populate: function (items) {
this.loader.populate(items);
},
addItems: function (items) {
this.loader.addItems(items);
},
empty: function () {
this.loader.empty();
},
setNotSelectedValue: function () {
this.loader.setNotSelectedValue.apply(this.loader, arguments);
},
getNotSelectedValue: function () {
return this.loader.getNotSelectedValue();
},
setValue: function () {
this.loader.setValue.apply(this.loader, arguments);
},
getValue: function () {
return this.loader.getValue.apply(this.loader, arguments);
},
getAllButtons: function () {
return this.loader.getAllButtons();
},
getAllLeaves: function () {
return this.loader.getAllLeaves();
},
getSelectedButtons: function () {
return this.loader.getSelectedButtons();
},
getNotSelectedButtons: function () {
return this.loader.getNotSelectedButtons();
},
getIndexByValue: function (value) {
return this.loader.getIndexByValue(value);
},
getNodeById: function (id) {
return this.loader.getNodeById(id);
},
getNodeByValue: function (value) {
return this.loader.getNodeByValue(value);
}
});
BI.LazyLoader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.lazy_loader", BI.LazyLoader);
/***/ }),
/* 497 */
/***/ (function(module, exports) {
/**
* 恶心的加载控件, 为解决排序问题引入的控件
*
* Created by GUY on 2015/11/12.
* @class BI.ListLoader
* @extends BI.Widget
*/
BI.ListLoader = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ListLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-list-loader",
isDefaultInit: true, // 是否默认初始化数据
// 下面是button_group的属性
el: {
type: "bi.button_group"
},
items: [],
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn,
// 下面是分页信息
count: false,
next: {},
hasNext: BI.emptyFn
});
},
_nextLoad: function () {
var self = this, o = this.options;
this.next.setLoading();
o.itemsCreator.apply(this, [{times: ++this.times}, function () {
self.next.setLoaded();
self.addItems.apply(self, arguments);
}]);
},
_init: function () {
BI.ListLoader.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (o.itemsCreator === false) {
o.next = false;
}
this.button_group = BI.createWidget(o.el, {
type: "bi.button_group",
element: this,
chooseType: 0,
items: o.items,
behaviors: {},
layouts: [{
type: "bi.vertical"
}]
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.ListLoader.EVENT_CHANGE, obj);
}
});
if (o.next !== false) {
this.next = BI.createWidget(BI.extend({
type: "bi.loading_bar"
}, o.next));
this.next.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
self._nextLoad();
}
});
}
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.next]
});
o.isDefaultInit && BI.isEmpty(o.items) && BI.nextTick(BI.bind(function () {
this.populate();
}, this));
if (BI.isNotEmptyArray(o.items)) {
this.populate(o.items);
}
},
hasNext: function () {
var o = this.options;
if (BI.isNumber(o.count)) {
return this.count < o.count;
}
return !!o.hasNext.apply(this, [{
times: this.times,
count: this.count
}]);
},
addItems: function (items) {
this.count += items.length;
if (BI.isObject(this.next)) {
this.options.items = this.options.items.concat(items);
if (this.hasNext()) {
this.next.setLoaded();
} else {
this.next.setEnd();
}
}
this.button_group.addItems.apply(this.button_group, arguments);
this.next.element.appendTo(this.element);
},
populate: function (items) {
var self = this, o = this.options;
if (arguments.length === 0 && (BI.isFunction(o.itemsCreator))) {
o.itemsCreator.apply(this, [{times: 1}, function () {
if (arguments.length === 0) {
throw new Error("参数不能为空");
}
self.populate.apply(self, arguments);
o.onLoaded();
}]);
return;
}
this.options.items = items;
this.times = 1;
this.count = 0;
this.count += items.length;
if (BI.isObject(this.next)) {
if (this.hasNext()) {
this.next.setLoaded();
} else {
this.next.invisible();
}
}
BI.DOM.hang([this.next]);
this.button_group.populate.apply(this.button_group, arguments);
this.next.element.appendTo(this.element);
},
empty: function () {
BI.DOM.hang([this.next]);
this.button_group.empty();
this.next.element.appendTo(this.element);
BI.each([this.next], function (i, ob) {
ob && ob.setVisible(false);
});
},
setNotSelectedValue: function () {
this.button_group.setNotSelectedValue.apply(this.button_group, arguments);
},
getNotSelectedValue: function () {
return this.button_group.getNotSelectedValue();
},
setValue: function () {
this.button_group.setValue.apply(this.button_group, arguments);
},
getValue: function () {
return this.button_group.getValue.apply(this.button_group, arguments);
},
getAllButtons: function () {
return this.button_group.getAllButtons();
},
getAllLeaves: function () {
return this.button_group.getAllLeaves();
},
getSelectedButtons: function () {
return this.button_group.getSelectedButtons();
},
getNotSelectedButtons: function () {
return this.button_group.getNotSelectedButtons();
},
getIndexByValue: function (value) {
return this.button_group.getIndexByValue(value);
},
getNodeById: function (id) {
return this.button_group.getNodeById(id);
},
getNodeByValue: function (value) {
return this.button_group.getNodeByValue(value);
}
});
BI.ListLoader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.list_loader", BI.ListLoader);
/***/ }),
/* 498 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2016/4/29.
*
* @class BI.SortList
* @extends BI.Widget
*/
BI.SortList = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SortList.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-sort-list",
isDefaultInit: true, // 是否默认初始化数据
// 下面是button_group的属性
el: {
type: "bi.button_group"
},
items: [],
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn,
// 下面是分页信息
count: false,
next: {},
hasNext: BI.emptyFn
// containment: this.element,
// connectWith: ".bi-sort-list",
});
},
_init: function () {
BI.SortList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.loader = BI.createWidget({
type: "bi.list_loader",
element: this,
isDefaultInit: o.isDefaultInit,
el: o.el,
items: this._formatItems(o.items),
itemsCreator: function (op, callback) {
o.itemsCreator(op, function (items) {
callback(self._formatItems(items));
});
},
onLoaded: o.onLoaded,
count: o.count,
next: o.next,
hasNext: o.hasNext
});
this.loader.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.SortList.EVENT_CHANGE, value, obj);
}
});
this.loader.element.sortable({
containment: o.containment || this.element,
connectWith: o.connectWith || ".bi-sort-list",
items: ".sort-item",
cursor: o.cursor || "drag",
tolerance: o.tolerance || "intersect",
placeholder: {
element: function ($currentItem) {
var holder = BI.createWidget({
type: "bi.layout",
cls: "bi-sortable-holder",
height: $currentItem.outerHeight()
});
holder.element.css({
"margin-left": $currentItem.css("margin-left"),
"margin-right": $currentItem.css("margin-right"),
"margin-top": $currentItem.css("margin-top"),
"margin-bottom": $currentItem.css("margin-bottom"),
margin: $currentItem.css("margin")
});
return holder.element;
},
update: function () {
}
},
start: function (event, ui) {
},
stop: function (event, ui) {
self.fireEvent(BI.SortList.EVENT_CHANGE);
},
over: function (event, ui) {
}
});
},
_formatItems: function (items) {
BI.each(items, function (i, item) {
item = BI.stripEL(item);
item.cls = item.cls ? item.cls + " sort-item" : "sort-item";
item.attributes = {
sorted: item.value
};
});
return items;
},
hasNext: function () {
return this.loader.hasNext();
},
addItems: function (items) {
this.loader.addItems(items);
},
populate: function (items) {
if (items) {
arguments[0] = this._formatItems(items);
}
this.loader.populate.apply(this.loader, arguments);
},
empty: function () {
this.loader.empty();
},
setNotSelectedValue: function () {
this.loader.setNotSelectedValue.apply(this.loader, arguments);
},
getNotSelectedValue: function () {
return this.loader.getNotSelectedValue();
},
setValue: function () {
this.loader.setValue.apply(this.loader, arguments);
},
getValue: function () {
return this.loader.getValue();
},
getAllButtons: function () {
return this.loader.getAllButtons();
},
getAllLeaves: function () {
return this.loader.getAllLeaves();
},
getSelectedButtons: function () {
return this.loader.getSelectedButtons();
},
getNotSelectedButtons: function () {
return this.loader.getNotSelectedButtons();
},
getIndexByValue: function (value) {
return this.loader.getIndexByValue(value);
},
getNodeById: function (id) {
return this.loader.getNodeById(id);
},
getNodeByValue: function (value) {
return this.loader.getNodeByValue(value);
},
getSortedValues: function () {
return this.loader.element.sortable("toArray", {attribute: "sorted"});
}
});
BI.SortList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.sort_list", BI.SortList);
/***/ }),
/* 499 */
/***/ (function(module, exports) {
/**
* author: young
* createdDate: 2018/12/18
* description:
*/
BI.LoadingPane = BI.inherit(BI.Pane, {
_mount: function () {
var isMounted = BI.Pane.superclass._mount.apply(this, arguments);
if (isMounted) {
if (this.beforeInit) {
this.__asking = true;
this.loading();
this.beforeInit(BI.bind(this.__loaded, this));
}
}
},
_initRender: function () {
if (this.beforeInit) {
this.__async = true;
} else {
this._render();
}
},
__loaded: function () {
this.__asking = false;
this.loaded();
this._render();
}
});
/***/ }),
/* 500 */
/***/ (function(module, exports) {
/**
* 有总页数和总行数的分页控件
* Created by Young's on 2016/10/13.
*/
BI.AllCountPager = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.AllCountPager.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-all-count-pager",
pagerDirection: "vertical", // 翻页按钮方向,可选值:vertical/horizontal
height: 24,
pages: 1, // 必选项
curr: 1, // 初始化当前页, pages为数字时可用,
count: 1 // 总行数
});
},
_init: function () {
BI.AllCountPager.superclass._init.apply(this, arguments);
var self = this, o = this.options, pagerIconCls = this._getPagerIconCls();
this.editor = BI.createWidget({
type: "bi.small_text_editor",
cls: "pager-editor bi-border-radius",
validationChecker: function (v) {
return (self.rowCount.getValue() === 0 && v === "0") || BI.isPositiveInteger(v);
},
hgap: 4,
vgap: 0,
value: o.curr,
errorText: BI.i18nText("BI-Please_Input_Positive_Integer"),
width: 40,
height: 24,
invisible: o.pages <= 1
});
this.pager = BI.createWidget({
type: "bi.pager",
width: 58,
layouts: [{
type: "bi.horizontal",
lgap: 5
}],
dynamicShow: false,
pages: o.pages,
curr: o.curr,
groups: 0,
first: false,
last: false,
prev: {
type: "bi.icon_button",
value: "prev",
title: BI.i18nText("BI-Previous_Page"),
warningTitle: BI.i18nText("BI-Current_Is_First_Page"),
height: 22,
width: 22,
cls: "bi-border bi-border-radius all-pager-prev bi-list-item-select2 " + pagerIconCls.preCls
},
next: {
type: "bi.icon_button",
value: "next",
title: BI.i18nText("BI-Next_Page"),
warningTitle: BI.i18nText("BI-Current_Is_Last_Page"),
height: 22,
width: 22,
cls: "bi-border bi-border-radius all-pager-next bi-list-item-select2 " + pagerIconCls.nextCls
},
hasPrev: o.hasPrev,
hasNext: o.hasNext,
firstPage: o.firstPage,
lastPage: o.lastPage,
invisible: o.pages <= 1
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.pager.setValue(BI.parseInt(self.editor.getValue()));
self.fireEvent(BI.AllCountPager.EVENT_CHANGE);
});
this.pager.on(BI.Pager.EVENT_CHANGE, function () {
self.fireEvent(BI.AllCountPager.EVENT_CHANGE);
});
this.pager.on(BI.Pager.EVENT_AFTER_POPULATE, function () {
self.editor.setValue(self.pager.getCurrentPage());
});
this.allPages = BI.createWidget({
type: "bi.label",
title: o.pages,
text: "/" + o.pages,
lgap: 5,
invisible: o.pages <= 1
});
this.rowCount = BI.createWidget({
type: "bi.label",
cls: "row-count",
height: o.height,
hgap: 5,
text: o.count,
title: o.count
});
var count = BI.createWidget({
type: "bi.left",
height: o.height,
scrollable: false,
items: [{
type: "bi.label",
height: o.height,
text: BI.i18nText("BI-Basic_Total"),
width: 15
}, this.rowCount, {
type: "bi.label",
height: o.height,
text: BI.i18nText("BI-Tiao_Data"),
width: 50,
textAlign: "left"
}]
});
BI.createWidget({
type: "bi.left_right_vertical_adapt",
element: this,
items: {
left: [count],
right: [this.editor, this.allPages, this.pager]
}
});
},
alwaysShowPager: true,
_getPagerIconCls: function () {
var o = this.options;
switch (o.pagerDirection) {
case "horizontal":
return {
preCls: "row-pre-page-h-font ",
nextCls: "row-next-page-h-font "
};
case "vertical":
default:
return {
preCls: "column-pre-page-h-font ",
nextCls: "column-next-page-h-font "
};
}
},
setAllPages: function (v) {
this.allPages.setText("/" + v);
this.allPages.setTitle(v);
this.options.pages = v;
this.pager.setAllPages(v);
this.editor.setEnable(v >= 1);
this.setPagerVisible(v > 1);
},
setValue: function (v) {
this.pager.setValue(v);
},
setVPage: function (v) {
this.pager.setValue(v);
},
setCount: function (count) {
this.rowCount.setText(count);
this.rowCount.setTitle(count);
},
getCurrentPage: function () {
return this.pager.getCurrentPage();
},
hasPrev: function () {
return this.pager.hasPrev();
},
hasNext: function () {
return this.pager.hasNext();
},
setPagerVisible: function (b) {
this.editor.setVisible(b);
this.allPages.setVisible(b);
this.pager.setVisible(b);
},
populate: function () {
this.pager.populate();
this.setPagerVisible(this.options.pages > 1);
}
});
BI.AllCountPager.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.all_count_pager", BI.AllCountPager);
/***/ }),
/* 501 */
/***/ (function(module, exports) {
/**
* 显示页码的分页控件
*
* Created by GUY on 2016/6/30.
* @class BI.DirectionPager
* @extends BI.Widget
*/
BI.DirectionPager = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.DirectionPager.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-direction-pager",
height: 24,
horizontal: {
pages: false, // 总页数
curr: 1, // 初始化当前页, pages为数字时可用
hasPrev: BI.emptyFn,
hasNext: BI.emptyFn,
firstPage: 1,
lastPage: BI.emptyFn
},
vertical: {
pages: false, // 总页数
curr: 1, // 初始化当前页, pages为数字时可用
hasPrev: BI.emptyFn,
hasNext: BI.emptyFn,
firstPage: 1,
lastPage: BI.emptyFn
}
});
},
_init: function () {
BI.DirectionPager.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var v = o.vertical, h = o.horizontal;
this._createVPager();
this._createHPager();
this.layout = BI.createWidget({
type: "bi.absolute",
scrollable: false,
element: this,
items: [{
el: this.vpager,
top: 0,
right: 86
}, {
el: this.vlabel,
top: 0,
right: 110
}, {
el: this.hpager,
top: 0,
right: 0
}, {
el: this.hlabel,
top: 0,
right: 24
}]
});
},
_createVPager: function () {
var self = this, o = this.options;
var v = o.vertical;
this.vlabel = BI.createWidget({
type: "bi.label",
width: 24,
height: 24,
value: v.curr,
title: v.curr,
invisible: true
});
this.vpager = BI.createWidget({
type: "bi.pager",
width: 72,
layouts: [{
type: "bi.horizontal",
scrollx: false,
rgap: 24
}],
invisible: true,
dynamicShow: false,
pages: v.pages,
curr: v.curr,
groups: 0,
first: false,
last: false,
prev: {
type: "bi.icon_button",
value: "prev",
title: BI.i18nText("BI-Up_Page"),
warningTitle: BI.i18nText("BI-Current_Is_First_Page"),
height: 22,
width: 22,
cls: "bi-border bi-border-radius direction-pager-prev column-pre-page-h-font bi-list-item-select2"
},
next: {
type: "bi.icon_button",
value: "next",
title: BI.i18nText("BI-Down_Page"),
warningTitle: BI.i18nText("BI-Current_Is_Last_Page"),
height: 22,
width: 22,
cls: "bi-border bi-border-radius direction-pager-next column-next-page-h-font bi-list-item-select2"
},
hasPrev: v.hasPrev,
hasNext: v.hasNext,
firstPage: v.firstPage,
lastPage: v.lastPage
});
this.vpager.on(BI.Pager.EVENT_CHANGE, function () {
self.fireEvent(BI.DirectionPager.EVENT_CHANGE);
});
this.vpager.on(BI.Pager.EVENT_AFTER_POPULATE, function () {
self.vlabel.setValue(this.getCurrentPage());
self.vlabel.setTitle(this.getCurrentPage());
});
},
_createHPager: function () {
var self = this, o = this.options;
var h = o.horizontal;
this.hlabel = BI.createWidget({
type: "bi.label",
width: 24,
height: 24,
value: h.curr,
title: h.curr,
invisible: true
});
this.hpager = BI.createWidget({
type: "bi.pager",
width: 72,
layouts: [{
type: "bi.horizontal",
scrollx: false,
rgap: 24
}],
invisible: true,
dynamicShow: false,
pages: h.pages,
curr: h.curr,
groups: 0,
first: false,
last: false,
prev: {
type: "bi.icon_button",
value: "prev",
title: BI.i18nText("BI-Left_Page"),
warningTitle: BI.i18nText("BI-Current_Is_First_Page"),
height: 22,
width: 22,
cls: "bi-border bi-border-radius direction-pager-prev row-pre-page-h-font bi-list-item-select2"
},
next: {
type: "bi.icon_button",
value: "next",
title: BI.i18nText("BI-Right_Page"),
warningTitle: BI.i18nText("BI-Current_Is_Last_Page"),
height: 22,
width: 22,
cls: "bi-border bi-border-radius direction-pager-next row-next-page-h-font bi-list-item-select2"
},
hasPrev: h.hasPrev,
hasNext: h.hasNext,
firstPage: h.firstPage,
lastPage: h.lastPage
});
this.hpager.on(BI.Pager.EVENT_CHANGE, function () {
self.fireEvent(BI.DirectionPager.EVENT_CHANGE);
});
this.hpager.on(BI.Pager.EVENT_AFTER_POPULATE, function () {
self.hlabel.setValue(this.getCurrentPage());
self.hlabel.setTitle(this.getCurrentPage());
});
},
getVPage: function () {
return this.vpager.getCurrentPage();
},
getHPage: function () {
return this.hpager.getCurrentPage();
},
setVPage: function (v) {
this.vpager.setValue(v);
this.vlabel.setValue(v);
this.vlabel.setTitle(v);
},
setHPage: function (v) {
this.hpager.setValue(v);
this.hlabel.setValue(v);
this.hlabel.setTitle(v);
},
hasVNext: function () {
return this.vpager.hasNext();
},
hasHNext: function () {
return this.hpager.hasNext();
},
hasVPrev: function () {
return this.vpager.hasPrev();
},
hasHPrev: function () {
return this.hpager.hasPrev();
},
setHPagerVisible: function (b) {
this.hpager.setVisible(b);
this.hlabel.setVisible(b);
},
setVPagerVisible: function (b) {
this.vpager.setVisible(b);
this.vlabel.setVisible(b);
},
populate: function () {
this.vpager.populate();
this.hpager.populate();
var vShow = false, hShow = false;
if (!this.hasHNext() && !this.hasHPrev()) {
this.setHPagerVisible(false);
} else {
this.setHPagerVisible(true);
hShow = true;
}
if (!this.hasVNext() && !this.hasVPrev()) {
this.setVPagerVisible(false);
} else {
this.setVPagerVisible(true);
vShow = true;
}
this.setVisible(hShow || vShow);
var num = [86, 110, 0, 24];
var items = this.layout.attr("items");
if (vShow === true && hShow === true) {
items[0].right = num[0];
items[1].right = num[1];
items[2].right = num[2];
items[3].right = num[3];
} else if (vShow === true) {
items[0].right = num[2];
items[1].right = num[3];
} else if (hShow === true) {
items[2].right = num[2];
items[3].right = num[3];
}
this.layout.attr("items", items);
this.layout.resize();
},
clear: function () {
this.vpager.attr("curr", 1);
this.hpager.attr("curr", 1);
}
});
BI.DirectionPager.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.direction_pager", BI.DirectionPager);
/***/ }),
/* 502 */
/***/ (function(module, exports) {
/**
* 分页控件
*
* Created by GUY on 2015/8/31.
* @class BI.DetailPager
* @extends BI.Widget
*/
BI.DetailPager = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.DetailPager.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-detail-pager",
behaviors: {},
layouts: [{
type: "bi.horizontal",
hgap: 10,
vgap: 0
}],
dynamicShow: true, // 是否动态显示上一页、下一页、首页、尾页, 若为false,则指对其设置使能状态
// dynamicShow为false时以下两个有用
dynamicShowFirstLast: false, // 是否动态显示首页、尾页
dynamicShowPrevNext: false, // 是否动态显示上一页、下一页
pages: false, // 总页数
curr: function () {
return 1;
}, // 初始化当前页
groups: 0, // 连续显示分页数
jump: BI.emptyFn, // 分页的回调函数
first: false, // 是否显示首页
last: false, // 是否显示尾页
prev: "上一页",
next: "下一页",
firstPage: 1,
lastPage: function () { // 在万不得已时才会调用这个函数获取最后一页的页码, 主要作用于setValue方法
return 1;
},
hasPrev: BI.emptyFn, // pages不可用时有效
hasNext: BI.emptyFn // pages不可用时有效
});
},
_init: function () {
BI.DetailPager.superclass._init.apply(this, arguments);
var self = this;
this.currPage = BI.result(this.options, "curr");
// 翻页太灵敏
this._lock = false;
this._debouce = BI.debounce(function () {
self._lock = false;
}, 300);
this._populate();
},
_populate: function () {
var self = this, o = this.options, view = [], dict = {};
this.empty();
var pages = BI.result(o, "pages");
var curr = BI.result(this, "currPage");
var groups = BI.result(o, "groups");
var first = BI.result(o, "first");
var last = BI.result(o, "last");
var prev = BI.result(o, "prev");
var next = BI.result(o, "next");
if (pages === false) {
groups = 0;
first = false;
last = false;
} else {
groups > pages && (groups = pages);
}
// 计算当前组
dict.index = Math.ceil((curr + ((groups > 1 && groups !== pages) ? 1 : 0)) / (groups === 0 ? 1 : groups));
// 当前页非首页,则输出上一页
if (((!o.dynamicShow && !o.dynamicShowPrevNext) || curr > 1) && prev !== false) {
if (BI.isKey(prev)) {
view.push({
text: prev,
value: "prev",
disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false)
});
} else {
view.push(BI.extend({
disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false)
}, prev));
}
}
// 当前组非首组,则输出首页
if (((!o.dynamicShow && !o.dynamicShowFirstLast) || (dict.index > 1 && groups !== 0)) && first) {
view.push({
text: first,
value: "first",
disabled: !(dict.index > 1 && groups !== 0)
});
if (dict.index > 1 && groups !== 0) {
view.push({
type: "bi.label",
cls: "page-ellipsis",
text: "\u2026"
});
}
}
// 输出当前页组
dict.poor = Math.floor((groups - 1) / 2);
dict.start = dict.index > 1 ? curr - dict.poor : 1;
dict.end = dict.index > 1 ? (function () {
var max = curr + (groups - dict.poor - 1);
return max > pages ? pages : max;
}()) : groups;
if (dict.end - dict.start < groups - 1) { // 最后一组状态
dict.start = dict.end - groups + 1;
}
var s = dict.start, e = dict.end;
if (first && last && (dict.index > 1 && groups !== 0) && (pages > groups && dict.end < pages && groups !== 0)) {
s++;
e--;
}
for (; s <= e; s++) {
if (s === curr) {
view.push({
text: s,
value: s,
selected: true
});
} else {
view.push({
text: s,
value: s
});
}
}
// 总页数大于连续分页数,且当前组最大页小于总页,输出尾页
if (((!o.dynamicShow && !o.dynamicShowFirstLast) || (pages > groups && dict.end < pages && groups !== 0)) && last) {
if (pages > groups && dict.end < pages && groups !== 0) {
view.push({
type: "bi.label",
cls: "page-ellipsis",
text: "\u2026"
});
}
view.push({
text: last,
value: "last",
disabled: !(pages > groups && dict.end < pages && groups !== 0)
});
}
// 当前页不为尾页时,输出下一页
dict.flow = !prev && groups === 0;
if (((!o.dynamicShow && !o.dynamicShowPrevNext) && next) || (curr !== pages && next || dict.flow)) {
view.push((function () {
if (BI.isKey(next)) {
if (pages === false) {
return {text: next, value: "next", disabled: o.hasNext(curr) === false};
}
return (dict.flow && curr === pages)
?
{text: next, value: "next", disabled: true}
:
{text: next, value: "next", disabled: !(curr !== pages && next || dict.flow)};
}
return BI.extend({
disabled: pages === false ? o.hasNext(curr) === false : !(curr !== pages && next || dict.flow)
}, next);
}()));
}
this.button_group = BI.createWidget({
type: "bi.button_group",
element: this,
items: BI.createItems(view, {
cls: "page-item bi-border bi-list-item-active",
height: 23,
hgap: 10
}),
behaviors: o.behaviors,
layouts: o.layouts
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self._lock === true) {
return;
}
self._lock = true;
self._debouce();
if (type === BI.Events.CLICK) {
var v = self.button_group.getValue()[0];
switch (v) {
case "first":
self.currPage = 1;
break;
case "last":
self.currPage = pages;
break;
case "prev":
self.currPage--;
break;
case "next":
self.currPage++;
break;
default:
self.currPage = v;
break;
}
o.jump.apply(self, [{
pages: pages,
curr: self.currPage
}]);
self._populate();
self.fireEvent(BI.DetailPager.EVENT_CHANGE, obj);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.fireEvent(BI.DetailPager.EVENT_AFTER_POPULATE);
},
getCurrentPage: function () {
return this.currPage;
},
setAllPages: function (pages) {
this.options.pages = pages;
},
hasPrev: function (v) {
v || (v = 1);
var o = this.options;
var pages = this.options.pages;
return pages === false ? o.hasPrev(v) : v > 1;
},
hasNext: function (v) {
v || (v = 1);
var o = this.options;
var pages = this.options.pages;
return pages === false ? o.hasNext(v) : v < pages;
},
setValue: function (v) {
var o = this.options;
v = v || 0;
v = v < 1 ? 1 : v;
if (o.pages === false) {
var lastPage = BI.result(o, "lastPage"), firstPage = 1;
this.currPage = v > lastPage ? lastPage : ((firstPage = BI.result(o, "firstPage")), (v < firstPage ? firstPage : v));
} else {
v = v > o.pages ? o.pages : v;
this.currPage = v;
}
this._populate();
},
getValue: function () {
var val = this.button_group.getValue()[0];
switch (val) {
case "prev":
return -1;
case "next":
return 1;
case "first":
return BI.MIN;
case "last":
return BI.MAX;
default :
return val;
}
},
attr: function (key, value) {
BI.DetailPager.superclass.attr.apply(this, arguments);
if (key === "curr") {
this.currPage = BI.result(this.options, "curr");
}
},
populate: function () {
this._populate();
}
});
BI.DetailPager.EVENT_CHANGE = "EVENT_CHANGE";
BI.DetailPager.EVENT_AFTER_POPULATE = "EVENT_AFTER_POPULATE";
BI.shortcut("bi.detail_pager", BI.DetailPager);
/***/ }),
/* 503 */
/***/ (function(module, exports) {
/**
* 分段控件使用的button
*
* Created by GUY on 2015/9/7.
* @class BI.SegmentButton
* @extends BI.BasicButton
*/
BI.SegmentButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.SegmentButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-segment-button bi-list-item-select",
shadow: true,
readonly: true,
hgap: 5
});
},
_init: function () {
BI.SegmentButton.superclass._init.apply(this, arguments);
var opts = this.options, self = this;
// if (BI.isNumber(opts.height) && BI.isNull(opts.lineHeight)) {
// this.element.css({lineHeight : (opts.height - 2) + 'px'});
// }
this.text = BI.createWidget({
type: "bi.label",
element: this,
textHeight: opts.height,
whiteSpace: opts.whiteSpace,
text: opts.text,
value: opts.value,
hgap: opts.hgap
});
},
setSelected: function () {
BI.SegmentButton.superclass.setSelected.apply(this, arguments);
},
setText: function (text) {
BI.SegmentButton.superclass.setText.apply(this, arguments);
this.text.setText(text);
},
destroy: function () {
BI.SegmentButton.superclass.destroy.apply(this, arguments);
}
});
BI.shortcut("bi.segment_button", BI.SegmentButton);
/***/ }),
/* 504 */
/***/ (function(module, exports) {
/**
* 单选按钮组
*
* Created by GUY on 2015/9/7.
* @class BI.Segment
* @extends BI.Widget
*/
BI.Segment = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Segment.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-segment",
items: [],
height: 24
});
},
_init: function () {
BI.Segment.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.buttonGroup = BI.createWidget({
element: this,
type: "bi.button_group",
value: o.value,
items: BI.createItems(o.items, {
type: "bi.segment_button",
height: o.height - 2,
whiteSpace: o.whiteSpace
}),
layout: [
{
type: "bi.center"
}
]
});
this.buttonGroup.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.buttonGroup.on(BI.ButtonGroup.EVENT_CHANGE, function (value, obj) {
self.fireEvent(BI.Segment.EVENT_CHANGE, value, obj);
});
},
_setEnable: function (enable) {
BI.Segment.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
},
setValue: function (v) {
this.buttonGroup.setValue(v);
},
setEnabledValue: function (v) {
this.buttonGroup.setEnabledValue(v);
},
getValue: function () {
return this.buttonGroup.getValue();
}
});
BI.Segment.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.segment", BI.Segment);
/***/ }),
/* 505 */
/***/ (function(module, exports) {
/**
* guy
* 复选导航条
* Created by GUY on 2015/8/25.
* @class BI.MultiSelectBar
* @extends BI.BasicButton
*/
BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectBar.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-multi-select-bar",
height: 25,
text: BI.i18nText("BI-Select_All"),
isAllCheckedBySelectedValue: BI.emptyFn,
// 手动控制选中
disableSelected: true,
isHalfCheckedBySelectedValue: function (selectedValues) {
return selectedValues.length > 0;
},
halfSelected: false,
iconWrapperWidth: 26
});
},
_init: function () {
BI.MultiSelectBar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var isSelect = o.selected === true;
var isHalfSelect = !o.selected && o.halfSelected;
this.checkbox = BI.createWidget({
type: "bi.checkbox",
stopPropagation: true,
handler: function () {
self.setSelected(self.isSelected());
},
selected: isSelect,
invisible: isHalfSelect
});
this.half = BI.createWidget({
type: "bi.half_icon_button",
stopPropagation: true,
handler: function () {
self.setSelected(true);
},
invisible: isSelect || !isHalfSelect
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self);
});
this.checkbox.on(BI.Checkbox.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self);
});
this.half.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, self.isSelected(), self);
});
this.half.on(BI.HalfIconButton.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, self.isSelected(), self);
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [{
width: o.iconWrapperWidth,
el: {
type: "bi.center_adapt",
items: [this.checkbox, this.half]
}
}, {
el: this.text
}]
});
},
_setSelected: function (v) {
this.checkbox.setSelected(!!v);
},
// 自己手动控制选中
beforeClick: function () {
var isHalf = this.isHalfSelected(), isSelected = this.isSelected();
if (isHalf === true) {
this.setSelected(true);
} else {
this.setSelected(!isSelected);
}
},
setSelected: function (v) {
this.checkbox.setSelected(v);
this.setHalfSelected(false);
},
setHalfSelected: function (b) {
this.halfSelected = !!b;
if (b === true) {
this.checkbox.setSelected(false);
this.half.visible();
this.checkbox.invisible();
} else {
this.half.invisible();
this.checkbox.visible();
}
},
isHalfSelected: function () {
return !this.isSelected() && !!this.halfSelected;
},
isSelected: function () {
return this.checkbox.isSelected();
},
setValue: function (selectedValues) {
BI.MultiSelectBar.superclass.setValue.apply(this, arguments);
var isAllChecked = this.options.isAllCheckedBySelectedValue.apply(this, arguments);
this._setSelected(isAllChecked);
!isAllChecked && this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this, arguments));
},
doClick: function () {
BI.MultiSelectBar.superclass.doClick.apply(this, arguments);
if(this.isValid()) {
this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE, this.isSelected(), this);
}
}
});
BI.MultiSelectBar.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_bar", BI.MultiSelectBar);
/***/ }),
/* 506 */
/***/ (function(module, exports) {
/**
* guy
* 二级树
* @class BI.LevelTree
* @extends BI.Single
*/
BI.LevelTree = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-level-tree",
el: {
chooseType: 0
},
expander: {},
items: [],
value: ""
});
},
_init: function () {
BI.LevelTree.superclass._init.apply(this, arguments);
this.initTree(this.options.items);
},
_formatItems: function (nodes, layer, pNode) {
var self = this;
BI.each(nodes, function (i, node) {
var extend = {layer: layer};
if (!BI.isKey(node.id)) {
node.id = BI.UUID();
}
extend.pNode = pNode;
if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) {
extend.type = "bi.mid_plus_group_node";
if (i === nodes.length - 1) {
extend.type = "bi.last_plus_group_node";
extend.isLastNode = true;
}
if (i === 0 && !pNode) {
extend.type = "bi.first_plus_group_node"
}
if (i === 0 && i === nodes.length - 1) { // 根
extend.type = "bi.plus_group_node";
}
BI.defaults(node, extend);
self._formatItems(node.children, layer + 1, node);
} else {
extend.type = "bi.mid_tree_leaf_item";
if (i === 0 && !pNode) {
extend.type = "bi.first_tree_leaf_item"
}
if (i === nodes.length - 1) {
extend.type = "bi.last_tree_leaf_item";
}
BI.defaults(node, extend);
}
});
return nodes;
},
_assertId: function (sNodes) {
BI.each(sNodes, function (i, node) {
if (!BI.isKey(node.id)) {
node.id = BI.UUID();
}
});
},
// 构造树结构,
initTree: function (nodes) {
var self = this, o = this.options;
this.empty();
this._assertId(nodes);
this.tree = BI.createWidget({
type: "bi.custom_tree",
element: this,
expander: BI.extend({
el: {},
popup: {
type: "bi.custom_tree"
}
}, o.expander),
items: this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0),
value: o.value,
el: BI.extend({
type: "bi.button_tree",
chooseType: 0,
layouts: [{
type: "bi.vertical"
}]
}, o.el)
});
this.tree.on(BI.Controller.EVENT_CHANGE, function (type, value, ob) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.LevelTree.EVENT_CHANGE, value, ob);
}
});
},
// 生成树方法
stroke: function (nodes) {
this.tree.stroke.apply(this.tree, arguments);
},
populate: function (items, keyword) {
items = this._formatItems(BI.Tree.transformToTreeFormat(items), 0);
this.tree.populate(items, keyword);
},
setValue: function (v) {
this.tree.setValue(v);
},
getValue: function () {
return this.tree.getValue();
},
getAllLeaves: function () {
return this.tree.getAllLeaves();
},
getNodeById: function (id) {
return this.tree.getNodeById(id);
},
getNodeByValue: function (id) {
return this.tree.getNodeByValue(id);
}
});
BI.LevelTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.level_tree", BI.LevelTree);
/***/ }),
/* 507 */
/***/ (function(module, exports) {
/**
* 文本输入框trigger
*
* Created by GUY on 2015/9/15.
* @class BI.EditorTrigger
* @extends BI.Trigger
*/
BI.EditorTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4
},
_defaultConfig: function () {
var conf = BI.EditorTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-editor-trigger bi-border",
height: 24,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: false,
watermark: "",
errorText: ""
});
},
_init: function () {
this.options.height -= 2;
BI.EditorTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options, c = this._const;
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
value: o.value,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText,
title: function () {
return self.getValue();
}
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.SignEditor.EVENT_CHANGE, function () {
self.fireEvent(BI.EditorTrigger.EVENT_CHANGE, arguments);
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.EditorTrigger.EVENT_FOCUS, arguments);
});
this.editor.on(BI.SignEditor.EVENT_EMPTY, function () {
self.fireEvent(BI.EditorTrigger.EVENT_EMPTY, arguments);
});
this.editor.on(BI.SignEditor.EVENT_VALID, function () {
self.fireEvent(BI.EditorTrigger.EVENT_VALID, arguments);
});
this.editor.on(BI.SignEditor.EVENT_ERROR, function () {
self.fireEvent(BI.EditorTrigger.EVENT_ERROR, arguments);
});
BI.createWidget({
element: this,
type: "bi.htape",
items: [
{
el: this.editor
}, {
el: {
type: "bi.trigger_icon_button",
width: o.triggerWidth || o.height
},
width: o.triggerWidth || o.height
}
]
});
},
getValue: function () {
return this.editor.getValue();
},
setValue: function (value) {
this.editor.setValue(value);
},
setText: function (text) {
this.editor.setState(text);
}
});
BI.EditorTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.EditorTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.EditorTrigger.EVENT_EMPTY = "EVENT_EMPTY";
BI.EditorTrigger.EVENT_VALID = "EVENT_VALID";
BI.EditorTrigger.EVENT_ERROR = "EVENT_ERROR";
BI.shortcut("bi.editor_trigger", BI.EditorTrigger);
/***/ }),
/* 508 */
/***/ (function(module, exports) {
/**
* 图标按钮trigger
*
* Created by GUY on 2015/10/8.
* @class BI.IconTrigger
* @extends BI.Trigger
*/
BI.IconTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-icon-trigger",
extraCls: "pull-down-font",
el: {},
height: 24
});
},
_init: function () {
var o = this.options;
BI.IconTrigger.superclass._init.apply(this, arguments);
this.iconButton = BI.createWidget(o.el, {
type: "bi.trigger_icon_button",
element: this,
width: o.width,
height: o.height,
extraCls: o.extraCls
});
}
});
BI.shortcut("bi.icon_trigger", BI.IconTrigger);
/***/ }),
/* 509 */
/***/ (function(module, exports) {
/**
* 文字trigger
*
* Created by GUY on 2015/9/15.
* @class BI.IconTextTrigger
* @extends BI.Trigger
*/
BI.IconTextTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4
},
_defaultConfig: function () {
var conf = BI.IconTextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 24,
iconHeight: null,
iconWidth: null,
textCls: ""
});
},
_init: function () {
BI.IconTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""),
textAlign: "left",
height: o.height,
text: o.text
});
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.triggerWidth || o.height
});
BI.createWidget({
element: this,
type: "bi.htape",
ref: function (_ref) {
self.wrapper = _ref;
},
items: [{
el: {
type: "bi.icon_change_button",
cls: "icon-combo-trigger-icon",
iconCls: o.iconCls,
ref: function (_ref) {
self.icon = _ref;
},
iconHeight: o.iconHeight,
iconWidth: o.iconWidth,
disableSelected: true
},
width: BI.isEmptyString(o.iconCls) ? 0 : (o.iconWrapperWidth || o.height)
},
{
el: this.text,
lgap: BI.isEmptyString(o.iconCls) ? 5 : 0
}, {
el: this.trigerButton,
width: o.triggerWidth || o.height
}
]
});
},
setValue: function (value) {
this.text.setValue(value);
},
setIcon: function (iconCls) {
var o = this.options;
this.icon.setIcon(iconCls);
var iconItem = this.wrapper.attr("items")[0];
var textItem = this.wrapper.attr("items")[1];
if(BI.isNull(iconCls) || BI.isEmptyString(iconCls)) {
if(iconItem.width !== 0) {
iconItem.width = 0;
textItem.lgap = 5;
this.wrapper.resize();
}
}else{
if(iconItem.width !== (o.iconWrapperWidth || o.height)) {
iconItem.width = (o.iconWrapperWidth || o.height);
textItem.lgap = 0;
this.wrapper.resize();
}
}
},
setTextCls: function(cls) {
var o = this.options;
var oldCls = o.textCls;
o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
},
setText: function (text) {
this.text.setText(text);
}
});
BI.shortcut("bi.icon_text_trigger", BI.IconTextTrigger);
/***/ }),
/* 510 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2017/12/12.
*/
BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-text-trigger bi-border",
height: 24,
iconHeight: null,
iconWidth: null,
iconCls: ""
});
},
_init: function () {
this.options.height -= 2;
BI.SelectIconTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var obj = this._digist(o.value, o.items);
this.trigger = BI.createWidget({
type: "bi.icon_text_trigger",
element: this,
text: obj.text,
textCls: obj.textCls,
iconCls: obj.iconCls,
height: o.height,
iconHeight: o.iconHeight,
iconWidth: o.iconWidth,
iconWrapperWidth: o.iconWrapperWidth
});
},
_digist: function (vals, items) {
var o = this.options;
vals = BI.isArray(vals) ? vals : [vals];
var result;
var formatItems = BI.Tree.transformToArrayFormat(items);
BI.any(formatItems, function (i, item) {
if (BI.deepContains(vals, item.value)) {
result = {
text: item.text || item.value,
iconCls: item.iconCls
};
return true;
}
});
if (BI.isNotNull(result)) {
return {
text: result.text,
textCls: "",
iconCls: result.iconCls
};
} else {
return {
text: BI.isFunction(o.text) ? o.text() : o.text,
textCls: "bi-water-mark",
iconCls: o.iconCls
};
}
},
setValue: function (vals) {
var obj = this._digist(vals, this.options.items);
this.trigger.setText(obj.text);
this.trigger.setIcon(obj.iconCls);
this.trigger.setTextCls(obj.textCls);
},
populate: function (items) {
this.options.items = items;
}
});
BI.shortcut("bi.select_icon_text_trigger", BI.SelectIconTextTrigger);
/***/ }),
/* 511 */
/***/ (function(module, exports) {
/**
* 文字trigger
*
* Created by GUY on 2015/9/15.
* @class BI.TextTrigger
* @extends BI.Trigger
*/
BI.TextTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4
},
_defaultConfig: function () {
var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 24,
textCls: ""
});
},
_init: function () {
BI.TextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""),
textAlign: "left",
height: o.height,
text: o.text,
title: function () {
return self.text.getText();
},
tipType: o.tipType,
warningTitle: o.warningTitle,
hgap: c.hgap,
readonly: o.readonly
});
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.triggerWidth || o.height
});
BI.createWidget({
element: this,
type: "bi.htape",
items: [
{
el: this.text
}, {
el: this.trigerButton,
width: o.triggerWidth || o.height
}
]
});
},
setTextCls: function(cls) {
var o = this.options;
var oldCls = o.textCls;
o.textCls = cls;
this.text.element.removeClass(oldCls).addClass(cls);
},
setText: function (text) {
this.text.setText(text);
},
setTipType: function (v) {
this.text.options.tipType = v;
}
});
BI.shortcut("bi.text_trigger", BI.TextTrigger);
/***/ }),
/* 512 */
/***/ (function(module, exports) {
/**
* 选择字段trigger
*
* Created by GUY on 2015/9/15.
* @class BI.SelectTextTrigger
* @extends BI.Trigger
*/
BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-text-trigger bi-border bi-focus-shadow",
height: 24
});
},
_init: function () {
this.options.height -= 2;
BI.SelectTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var obj = this._digest(o.value, o.items);
this.trigger = BI.createWidget({
type: "bi.text_trigger",
element: this,
height: o.height,
readonly: o.readonly,
text: obj.text,
textCls: obj.textCls,
tipType: o.tipType,
warningTitle: o.warningTitle
});
},
_digest: function(vals, items){
var o = this.options;
vals = BI.isArray(vals) ? vals : [vals];
var result = [];
var formatItems = BI.Tree.transformToArrayFormat(items);
BI.each(formatItems, function (i, item) {
if (BI.deepContains(vals, item.value) && !BI.contains(result, item.text || item.value)) {
result.push(item.text || item.value);
}
});
if (result.length > 0) {
return {
textCls: "",
text: result.join(",")
}
} else {
return {
textCls: "bi-water-mark",
text: BI.isFunction(o.text) ? o.text() : o.text
}
}
},
setValue: function (vals) {
var formatValue = this._digest(vals, this.options.items);
this.trigger.setTextCls(formatValue.textCls);
this.trigger.setText(formatValue.text);
},
setTipType: function (v) {
this.trigger.setTipType(v);
},
populate: function (items) {
this.options.items = items;
}
});
BI.shortcut("bi.select_text_trigger", BI.SelectTextTrigger);
/***/ }),
/* 513 */
/***/ (function(module, exports) {
/**
* 选择字段trigger小一号的
*
* @class BI.SmallSelectTextTrigger
* @extends BI.Trigger
*/
BI.SmallSelectTextTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-small-select-text-trigger bi-border",
height: 20
});
},
_init: function () {
this.options.height -= 2;
BI.SmallSelectTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var obj = this._digest(o.value, o.items);
this.trigger = BI.createWidget({
type: "bi.small_text_trigger",
element: this,
height: o.height - 2,
text: obj.text,
cls: obj.cls
});
},
_digest: function(vals, items){
var o = this.options;
vals = BI.isArray(vals) ? vals : [vals];
var result = [];
var formatItems = BI.Tree.transformToArrayFormat(items);
BI.each(formatItems, function (i, item) {
if (BI.deepContains(vals, item.value) && !BI.contains(result, item.text || item.value)) {
result.push(item.text || item.value);
}
});
if (result.length > 0) {
return {
cls: "",
text: result.join(",")
}
} else {
return {
cls: "bi-water-mark",
text: o.text
}
}
},
setValue: function (vals) {
var formatValue = this._digest(vals, this.options.items);
this.trigger.element.removeClass("bi-water-mark").addClass(formatValue.cls);
this.trigger.setText(formatValue.text);
},
populate: function (items) {
this.options.items = items;
}
});
BI.shortcut("bi.small_select_text_trigger", BI.SmallSelectTextTrigger);
/***/ }),
/* 514 */
/***/ (function(module, exports) {
/**
* 文字trigger(右边小三角小一号的) ==
*
* @class BI.SmallTextTrigger
* @extends BI.Trigger
*/
BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4
},
_defaultConfig: function () {
var conf = BI.SmallTextTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-text-trigger",
height: 20
});
},
_init: function () {
BI.SmallTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
height: o.height,
text: o.text,
hgap: c.hgap
});
this.trigerButton = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.triggerWidth || o.height
});
BI.createWidget({
element: this,
type: "bi.htape",
items: [
{
el: this.text
}, {
el: this.trigerButton,
width: o.triggerWidth || o.height
}
]
});
},
setValue: function (value) {
this.text.setValue(value);
},
setText: function (text) {
this.text.setText(text);
}
});
BI.shortcut("bi.small_text_trigger", BI.SmallTextTrigger);
/***/ }),
/* 515 */
/***/ (function(module, exports) {
/**
* 日期控件中的月份下拉框
*
* Created by GUY on 2015/9/7.
* @class BI.MonthDateCombo
* @extends BI.Trigger
*/
BI.MonthDateCombo = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend( BI.MonthDateCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-month-combo",
height: 24,
container: null
});
},
_init: function () {
BI.MonthDateCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.date_triangle_trigger"
});
this.popup = BI.createWidget({
type: "bi.month_popup",
behaviors: o.behaviors
});
this.popup.on(BI.YearPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
});
this.combo = BI.createWidget({
type: "bi.combo",
offsetStyle: "center",
container: o.container,
element: this,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
popup: {
minWidth: 85,
stopPropagation: false,
el: this.popup
}
});
this.combo.on(BI.Combo.EVENT_CHANGE, function () {
self.combo.hideView();
self.fireEvent(BI.MonthDateCombo.EVENT_CHANGE);
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.doBehavior();
});
},
setValue: function (v) {
this.trigger.setValue(v);
this.popup.setValue(v);
},
getValue: function () {
return this.popup.getValue();
}
});
BI.MonthDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.month_date_combo", BI.MonthDateCombo);
/***/ }),
/* 516 */
/***/ (function(module, exports) {
/**
* 年份下拉框
*
* Created by GUY on 2015/9/7.
* @class BI.YearDateCombo
* @extends BI.Trigger
*/
BI.YearDateCombo = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend( BI.YearDateCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-combo",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
behaviors: {},
height: 24,
container: null
});
},
_init: function () {
BI.YearDateCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.date_triangle_trigger"
});
this.popup = BI.createWidget({
type: "bi.year_popup",
behaviors: o.behaviors,
min: o.min,
max: o.max
});
this.popup.on(BI.YearPopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.YearDateCombo.EVENT_CHANGE);
});
this.combo = BI.createWidget({
type: "bi.combo",
offsetStyle: "center",
element: this,
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
popup: {
minWidth: 100,
stopPropagation: false,
el: this.popup
}
});
this.combo.on(BI.Combo.EVENT_CHANGE, function () {
self.fireEvent(BI.YearDateCombo.EVENT_CHANGE);
});
// BI-22551 popup未初始化传入的behavior无效
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.doBehavior();
});
},
setMinDate: function (minDate) {
this.popup.setMinDate(minDate);
},
setMaxDate: function (maxDate) {
this.popup.setMaxDate(maxDate);
},
setValue: function (v) {
this.trigger.setValue(v);
this.popup.setValue(v);
},
getValue: function () {
return this.popup.getValue();
}
});
BI.YearDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.year_date_combo", BI.YearDateCombo);
/***/ }),
/* 517 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/9/7.
* @class BI.DatePicker
* @extends BI.Widget
*/
BI.DatePicker = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.DatePicker.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-date-picker",
height: 40,
min: "1900-01-01", // 最小日期
max: "2099-12-31" // 最大日期
});
},
_init: function () {
BI.DatePicker.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this._year = BI.getDate().getFullYear();
this._month = BI.getDate().getMonth() + 1;
this.left = BI.createWidget({
type: "bi.icon_button",
cls: "pre-page-h-font",
width: 24,
height: 24
});
this.left.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 1) {
self.setValue({
year: self.year.getValue() - 1,
month: 12
});
} else {
self.setValue({
year: self.year.getValue(),
month: self.month.getValue() - 1
});
}
self.fireEvent(BI.DatePicker.EVENT_CHANGE);
self._checkLeftValid();
self._checkRightValid();
});
this.right = BI.createWidget({
type: "bi.icon_button",
cls: "next-page-h-font",
width: 24,
height: 24
});
this.right.on(BI.IconButton.EVENT_CHANGE, function () {
if (self._month === 12) {
self.setValue({
year: self.year.getValue() + 1,
month: 1
});
} else {
self.setValue({
year: self.year.getValue(),
month: self.month.getValue() + 1
});
}
self.fireEvent(BI.DatePicker.EVENT_CHANGE);
self._checkLeftValid();
self._checkRightValid();
});
this.year = BI.createWidget({
type: "bi.year_date_combo",
behaviors: o.behaviors,
min: o.min,
max: o.max
});
this.year.on(BI.YearDateCombo.EVENT_CHANGE, function () {
self.setValue({
year: self.year.getValue(),
month: self.month.getValue()
});
self.fireEvent(BI.DatePicker.EVENT_CHANGE);
});
this.month = BI.createWidget({
type: "bi.month_date_combo",
behaviors: o.behaviors
});
this.month.on(BI.MonthDateCombo.EVENT_CHANGE, function () {
self.setValue({
year: self.year.getValue(),
month: self.month.getValue()
});
self.fireEvent(BI.DatePicker.EVENT_CHANGE);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [{
el: {
type: "bi.center_adapt",
items: [this.left]
},
width: 24
}, {
type: "bi.center_adapt",
items: [{
el: {
type: "bi.horizontal",
width: 120,
rgap: 10,
items: [{
el: this.year,
lgap: 10
}, this.month]
}
}]
}, {
el: {
type: "bi.center_adapt",
items: [this.right]
},
width: 24
}]
});
this.setValue({
year: this._year,
month: this._month
});
},
_checkLeftValid: function () {
var o = this.options;
var valid = !(this._month === 1 && this._year === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear());
this.left.setEnable(valid);
return valid;
},
_checkRightValid: function () {
var o = this.options;
var valid = !(this._month === 12 && this._year === BI.parseDateTime(o.max, "%Y-%X-%d").getFullYear());
this.right.setEnable(valid);
return valid;
},
setMinDate: function (minDate) {
this.year.setMinDate(minDate);
},
setMaxDate: function (maxDate) {
this.year.setMaxDate(maxDate);
},
setValue: function (ob) {
this._year = BI.parseInt(ob.year);
this._month = BI.parseInt(ob.month);
this.year.setValue(ob.year);
this.month.setValue(ob.month);
this._checkLeftValid();
this._checkRightValid();
},
getValue: function () {
return {
year: this.year.getValue(),
month: this.month.getValue()
};
}
});
BI.DatePicker.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.date_picker", BI.DatePicker);
/***/ }),
/* 518 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/9/7.
* @class BI.YearPicker
* @extends BI.Widget
*/
BI.YearPicker = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.YearPicker.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-year-picker",
behaviors: {},
height: 40,
min: "1900-01-01", // 最小日期
max: "2099-12-31" // 最大日期
});
},
_init: function () {
BI.YearPicker.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this._year = BI.getDate().getFullYear();
this.left = BI.createWidget({
type: "bi.icon_button",
cls: "pre-page-h-font",
width: 25,
height: 25
});
this.left.on(BI.IconButton.EVENT_CHANGE, function () {
self.setValue(self.year.getValue() - 1);
self.fireEvent(BI.YearPicker.EVENT_CHANGE);
self._checkLeftValid();
self._checkRightValid();
});
this.right = BI.createWidget({
type: "bi.icon_button",
cls: "next-page-h-font",
width: 25,
height: 25
});
this.right.on(BI.IconButton.EVENT_CHANGE, function () {
self.setValue(self.year.getValue() + 1);
self.fireEvent(BI.YearPicker.EVENT_CHANGE);
self._checkLeftValid();
self._checkRightValid();
});
this.year = BI.createWidget({
type: "bi.year_date_combo",
min: o.min,
behaviors: o.behaviors,
max: o.max,
width: 50
});
this.year.on(BI.YearDateCombo.EVENT_CHANGE, function () {
self.setValue(self.year.getValue());
self.fireEvent(BI.YearPicker.EVENT_CHANGE);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [{
el: {
type: "bi.center_adapt",
items: [this.left]
},
width: 25
}, {
type: "bi.center_adapt",
items: [{
el: this.year
}]
}, {
el: {
type: "bi.center_adapt",
items: [this.right]
},
width: 25
}]
});
this.setValue({
year: this._year
});
},
_checkLeftValid: function () {
var o = this.options;
var valid = !(this._year === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear());
this.left.setEnable(valid);
return valid;
},
_checkRightValid: function () {
var o = this.options;
var valid = !(this._year === BI.parseDateTime(o.max, "%Y-%X-%d").getFullYear());
this.right.setEnable(valid);
return valid;
},
setMinDate: function (minDate) {
this.options.min = minDate;
this.year.setMinDate(minDate);
this._checkLeftValid();
this._checkRightValid();
},
setMaxDate: function (maxDate) {
this.options.max = maxDate;
this.year.setMaxDate(maxDate);
this._checkLeftValid();
this._checkRightValid();
},
setValue: function (v) {
this._year = v;
this.year.setValue(v);
this._checkLeftValid();
this._checkRightValid();
},
getValue: function () {
return this.year.getValue();
}
});
BI.YearPicker.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.year_picker", BI.YearPicker);
/***/ }),
/* 519 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2015/9/7.
* @class BI.DateCalendarPopup
* @extends BI.Widget
*/
BI.DateCalendarPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.DateCalendarPopup.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-date-calendar-popup",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
selectedTime: null
});
},
_createNav: function (v) {
var date = BI.Calendar.getDateJSONByPage(v);
var calendar = BI.createWidget({
type: "bi.calendar",
logic: {
dynamic: true
},
min: this.options.min,
max: this.options.max,
year: date.year,
month: date.month,
// BI-45616 此处为确定当前应该展示哪个年月对应的Calendar, day不是关键数据, 给1号就可
day: 1
});
return calendar;
},
_init: function () {
BI.DateCalendarPopup.superclass._init.apply(this, arguments);
var self = this,
o = this.options;
this.today = BI.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth() + 1;
this._day = this.today.getDate();
this.selectedTime = o.selectedTime || {
year: this._year,
month: this._month,
day: this._day
};
this.datePicker = BI.createWidget({
type: "bi.date_picker",
behaviors: o.behaviors,
min: o.min,
max: o.max
});
this.calendar = BI.createWidget({
direction: "top",
logic: {
dynamic: true
},
type: "bi.navigation",
tab: this.datePicker,
cardCreator: BI.bind(this._createNav, this),
afterCardCreated: function () {
},
afterCardShow: function () {
this.setValue(self.selectedTime);
}
});
this.datePicker.on(BI.DatePicker.EVENT_CHANGE, function () {
self.selectedTime = self.datePicker.getValue();
self.selectedTime.day = 1;
self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime));
});
this.calendar.on(BI.Navigation.EVENT_CHANGE, function () {
self.selectedTime = self.calendar.getValue();
self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.calendar,
left: 5,
right: 5
}, {
el: {
type: "bi.layout",
cls: "bi-split-top"
},
height: 1,
top: 40,
left: 0,
right: 0
}]
});
},
_checkMin: function () {
var calendar = this.calendar.getSelectedCard();
if (BI.isNotNull(calendar)) {
calendar.setMinDate(this.options.min);
}
},
_checkMax: function () {
var calendar = this.calendar.getSelectedCard();
if (BI.isNotNull(calendar)) {
calendar.setMaxDate(this.options.max);
}
},
setMinDate: function (minDate) {
if (BI.isNotEmptyString(this.options.min)) {
this.options.min = minDate;
this.datePicker.setMinDate(minDate);
this._checkMin();
}
},
setMaxDate: function (maxDate) {
if (BI.isNotEmptyString(this.options.max)) {
this.options.max = maxDate;
this.datePicker.setMaxDate(maxDate);
this._checkMax();
}
},
setValue: function (timeOb) {
this.datePicker.setValue(timeOb);
this.calendar.setSelect(BI.Calendar.getPageByDateJSON(timeOb));
this.calendar.setValue(timeOb);
this.selectedTime = timeOb;
},
getValue: function () {
return this.selectedTime;
}
});
BI.DateCalendarPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.date_calendar_popup", BI.DateCalendarPopup);
/***/ }),
/* 520 */
/***/ (function(module, exports) {
/**
* 月份展示面板
*
* Created by GUY on 2015/9/2.
* @class BI.MonthPopup
* @extends BI.Trigger
*/
BI.MonthPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MonthPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-month-popup",
behaviors: {}
});
},
_init: function () {
BI.MonthPopup.superclass._init.apply(this, arguments);
var self = this, o = this.options;
// 纵向排列月
var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12];
var items = [];
items.push(month.slice(0, 2));
items.push(month.slice(2, 4));
items.push(month.slice(4, 6));
items.push(month.slice(6, 8));
items.push(month.slice(8, 10));
items.push(month.slice(10, 12));
items = BI.map(items, function (i, item) {
return BI.map(item, function (j, td) {
return {
type: "bi.text_item",
cls: "bi-list-item-select",
textAlign: "center",
whiteSpace: "nowrap",
once: false,
forceSelected: true,
height: 23,
width: 38,
value: td,
text: td
};
});
});
this.month = BI.createWidget({
type: "bi.button_group",
element: this,
behaviors: o.behaviors,
items: BI.createItems(items, {}),
layouts: [BI.LogicFactory.createLogic("table", BI.extend({
dynamic: true
}, {
columns: 2,
rows: 6,
columnSize: [1 / 2, 1 / 2],
rowSize: 25
})), {
type: "bi.center_adapt",
vgap: 1,
hgap: 2
}],
value: o.value
});
this.month.on(BI.Controller.EVENT_CHANGE, function (type) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.fireEvent(BI.MonthPopup.EVENT_CHANGE);
}
});
},
getValue: function () {
return this.month.getValue()[0];
},
setValue: function (v) {
v = BI.parseInt(v);
this.month.setValue([v]);
}
});
BI.MonthPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.month_popup", BI.MonthPopup);
/***/ }),
/* 521 */
/***/ (function(module, exports) {
/**
* 年份展示面板
*
* Created by GUY on 2015/9/2.
* @class BI.YearPopup
* @extends BI.Trigger
*/
BI.YearPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.YearPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-popup",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31" // 最大日期
});
},
_createYearCalendar: function (v) {
var o = this.options, y = this._year;
var calendar = BI.createWidget({
type: "bi.year_calendar",
behaviors: o.behaviors,
min: o.min,
max: o.max,
logic: {
dynamic: true
},
year: y + v * 12
});
calendar.setValue(this._year);
return calendar;
},
_init: function () {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.selectedYear = this._year = BI.getDate().getFullYear();
this.backBtn = BI.createWidget({
type: "bi.icon_button",
cls: "pre-page-h-font",
width: 24,
height: 24,
value: -1
});
this.preBtn = BI.createWidget({
type: "bi.icon_button",
cls: "next-page-h-font",
width: 24,
height: 24,
value: 1
});
this.navigation = BI.createWidget({
type: "bi.navigation",
element: this,
single: true,
logic: {
dynamic: true
},
tab: {
cls: "year-popup-navigation bi-high-light bi-split-top",
height: 24,
items: [this.backBtn, this.preBtn]
},
cardCreator: BI.bind(this._createYearCalendar, this),
afterCardShow: function () {
this.setValue(self.selectedYear);
var calendar = this.getSelectedCard();
calendar && self.backBtn.setEnable(!calendar.isFrontYear());
calendar && self.preBtn.setEnable(!calendar.isFinalYear());
}
});
this.navigation.on(BI.Navigation.EVENT_CHANGE, function () {
self.selectedYear = this.getValue();
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.YearPopup.EVENT_CHANGE, self.selectedYear);
});
if(BI.isKey(o.value)){
this.setValue(o.value);
}
},
_checkMin: function () {
var calendar = this.navigation.getSelectedCard();
if (BI.isNotNull(calendar)) {
calendar.setMinDate(this.options.min);
this.backBtn.setEnable(!calendar.isFrontYear());
this.preBtn.setEnable(!calendar.isFinalYear());
}
},
_checkMax: function () {
var calendar = this.navigation.getSelectedCard();
if (BI.isNotNull(calendar)) {
calendar.setMaxDate(this.options.max);
this.backBtn.setEnable(!calendar.isFrontYear());
this.preBtn.setEnable(!calendar.isFinalYear());
}
},
setMinDate: function (minDate) {
if (BI.isNotEmptyString(this.options.min)) {
this.options.min = minDate;
this._checkMin();
}
},
setMaxDate: function (maxDate) {
if (BI.isNotEmptyString(this.options.max)) {
this.options.max = maxDate;
this._checkMax();
}
},
getValue: function () {
return this.selectedYear;
},
setValue: function (v) {
var o = this.options;
v = BI.parseInt(v);
// 对于年控件来说,只要传入的minDate和maxDate的year区间包含v就是合法的
var startDate = BI.parseDateTime(o.min, "%Y-%X-%d");
var endDate = BI.parseDateTime(o.max, "%Y-%X-%d");
if (BI.checkDateVoid(v, 1, 1, BI.print(BI.getDate(startDate.getFullYear(), 0, 1), "%Y-%X-%d"), BI.print(BI.getDate(endDate.getFullYear(), 0, 1), "%Y-%X-%d"))[0]) {
v = BI.getDate().getFullYear();
this.selectedYear = "";
this.navigation.setSelect(BI.YearCalendar.getPageByYear(v));
this.navigation.setValue("");
} else {
this.selectedYear = v;
this.navigation.setSelect(BI.YearCalendar.getPageByYear(v));
this.navigation.setValue(v);
}
}
});
BI.YearPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.year_popup", BI.YearPopup);
/***/ }),
/* 522 */
/***/ (function(module, exports) {
/**
* 日期控件中的年份或月份trigger
*
* Created by GUY on 2015/9/7.
* @class BI.DateTriangleTrigger
* @extends BI.Trigger
*/
BI.DateTriangleTrigger = BI.inherit(BI.Trigger, {
_const: {
height: 24,
iconWidth: 12,
iconHeight: 12
},
_defaultConfig: function () {
return BI.extend( BI.DateTriangleTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-date-triangle-trigger pull-down-ha-font cursor-pointer",
height: 24
});
},
_init: function () {
BI.DateTriangleTrigger.superclass._init.apply(this, arguments);
var o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "right",
text: o.text,
value: o.value,
height: c.height
});
BI.createWidget({
type: "bi.vertical_adapt",
element: this,
items: [{
el: this.text,
rgap: 5
}, {
type: "bi.icon_label",
width: 16
}]
});
},
setValue: function (v) {
this.text.setValue(v);
},
getValue: function () {
return this.text.getValue();
},
setText: function (v) {
this.text.setText(v);
},
getText: function () {
return this.item.getText();
},
getKey: function () {
}
});
BI.shortcut("bi.date_triangle_trigger", BI.DateTriangleTrigger);
/***/ }),
/* 523 */
/***/ (function(module, exports) {
/**
* Created by zcf on 2017/2/20.
*/
BI.StaticDatePaneCard = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.StaticDatePaneCard.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-date-pane",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
selectedTime: null
});
},
_init: function () {
BI.StaticDatePaneCard.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.today = BI.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth() + 1;
this.selectedTime = o.selectedTime || {
year: this._year,
month: this._month
};
this.datePicker = BI.createWidget({
type: "bi.date_picker",
behaviors: o.behaviors,
min: o.min,
max: o.max
});
this.datePicker.on(BI.DatePicker.EVENT_CHANGE, function () {
var value = self.datePicker.getValue();
var monthDay = BI.getMonthDays(BI.getDate(value.year, value.month - 1, 1));
var day = self.selectedTime.day || 0;
if (day > monthDay) {
day = monthDay;
}
self.selectedTime = {
year: value.year,
month: value.month
};
day !== 0 && (self.selectedTime.day = day);
self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime));
self.calendar.setValue(self.selectedTime);
day !== 0 && self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
this.calendar = BI.createWidget({
direction: "custom",
// logic: {
// dynamic: false
// },
type: "bi.navigation",
tab: this.datePicker,
cardCreator: BI.bind(this._createNav, this)
});
this.calendar.on(BI.Navigation.EVENT_CHANGE, function () {
self.selectedTime = self.calendar.getValue();
self.calendar.empty();
self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
this.setValue(o.selectedTime);
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.datePicker,
height: 40
}, this.calendar],
hgap: 10
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.layout",
cls: "bi-split-top"
},
height: 1,
top: 40,
left: 0,
right: 0
}]
});
},
_createNav: function (v) {
var date = BI.Calendar.getDateJSONByPage(v);
var calendar = BI.createWidget({
type: "bi.calendar",
logic: {
dynamic: false
},
min: this.options.min,
max: this.options.max,
year: date.year,
month: date.month,
day: this.selectedTime.day
});
return calendar;
},
_getNewCurrentDate: function () {
var today = BI.getDate();
return {
year: today.getFullYear(),
month: today.getMonth() + 1
};
},
_setCalenderValue: function (date) {
this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date));
this.calendar.setValue(date);
this.selectedTime = date;
},
_setDatePicker: function (timeOb) {
if (BI.isNull(timeOb) || BI.isNull(timeOb.year) || BI.isNull(timeOb.month)) {
this.datePicker.setValue(this._getNewCurrentDate());
} else {
this.datePicker.setValue(timeOb);
}
},
_setCalendar: function (timeOb) {
if (BI.isNull(timeOb) || BI.isNull(timeOb.day)) {
this.calendar.empty();
this._setCalenderValue(this._getNewCurrentDate());
} else {
this._setCalenderValue(timeOb);
}
},
setValue: function (timeOb) {
this._setDatePicker(timeOb);
this._setCalendar(timeOb);
},
getValue: function () {
return this.selectedTime;
}
});
BI.shortcut("bi.static_date_pane_card", BI.StaticDatePaneCard);
/***/ }),
/* 524 */
/***/ (function(module, exports) {
BI.DynamicDatePane = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-dynamic-date-pane"
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vtape",
items: [{
el: {
type: "bi.linear_segment",
cls: "bi-split-bottom",
height: 30,
items: BI.createItems([{
text: BI.i18nText("BI-Multi_Date_YMD"),
value: BI.DynamicDatePane.Static
}, {
text: BI.i18nText("BI-Basic_Dynamic_Title"),
value: BI.DynamicDatePane.Dynamic
}], {
textAlign: "center"
}),
listeners: [{
eventName: BI.ButtonGroup.EVENT_CHANGE,
action: function () {
var value = this.getValue()[0];
self.dateTab.setSelect(value);
switch (value) {
case BI.DynamicDatePane.Static:
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate()
});
break;
case BI.DynamicDatePane.Dynamic:
self.dynamicPane.setValue({
year: 0
});
break;
default:
break;
}
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {
self.switcher = this;
}
},
height: 30
}, {
type: "bi.tab",
ref: function () {
self.dateTab = this;
},
showIndex: BI.DynamicDatePane.Static,
cardCreator: function (v) {
switch (v) {
case BI.DynamicDatePane.Static:
return {
type: "bi.static_date_pane_card",
behaviors: o.behaviors,
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {
self.ymd = this;
}
};
case BI.DynamicDatePane.Dynamic:
default:
return {
type: "bi.dynamic_date_card",
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
if(self._checkValue(self.getValue())) {
self.fireEvent("EVENT_CHANGE");
}
}
}],
ref: function () {
self.dynamicPane = this;
}
};
}
}
}]
};
},
mounted: function () {
this.setValue(this.options.value);
},
_checkValueValid: function (value) {
return BI.isNull(value) || BI.isEmptyObject(value) || BI.isEmptyString(value);
},
_checkValue: function (v) {
switch (v.type) {
case BI.DynamicDateCombo.Dynamic:
return BI.isNotEmptyObject(v.value);
case BI.DynamicDateCombo.Static:
default:
return true;
}
},
setValue: function (v) {
v = v || {};
var type = v.type || BI.DynamicDateCombo.Static;
var value = v.value || v;
this.switcher.setValue(type);
this.dateTab.setSelect(type);
switch (type) {
case BI.DynamicDateCombo.Dynamic:
this.dynamicPane.setValue(value);
break;
case BI.DynamicDateCombo.Static:
default:
if (this._checkValueValid(value)) {
var date = BI.getDate();
this.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth() + 1
});
} else {
this.ymd.setValue(value);
}
break;
}
},
getValue: function () {
return {
type: this.dateTab.getSelect(),
value: this.dateTab.getValue()
};
}
});
BI.shortcut("bi.dynamic_date_pane", BI.DynamicDatePane);
BI.extend(BI.DynamicDatePane, {
Static: 1,
Dynamic: 2
});
/***/ }),
/* 525 */
/***/ (function(module, exports) {
/**
* Created by Urthur on 2017/7/14.
*/
BI.DateTimeCombo = BI.inherit(BI.Single, {
constants: {
popupHeight: 290,
popupWidth: 270,
comboAdjustHeight: 1,
border: 1
},
_defaultConfig: function () {
return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-date-time-combo bi-border bi-border-radius",
width: 200,
height: 24,
minDate: "1900-01-01",
maxDate: "2099-12-31"
});
},
_init: function () {
BI.DateTimeCombo.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var date = BI.getDate();
this.storeValue = BI.isNotNull(opts.value) ? opts.value : {
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate(),
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
};
this.trigger = BI.createWidget({
type: "bi.date_time_trigger",
min: opts.minDate,
max: opts.maxDate,
value: opts.value
});
this.popup = BI.createWidget({
type: "bi.date_time_popup",
behaviors: opts.behaviors,
min: opts.minDate,
max: opts.maxDate,
value: opts.value
});
self.setValue(this.storeValue);
this.popup.on(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE, function () {
self.setValue(self.storeValue);
self.hidePopupView();
self.fireEvent(BI.DateTimeCombo.EVENT_CANCEL);
});
this.popup.on(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE, function () {
self.storeValue = self.popup.getValue();
self.setValue(self.storeValue);
self.hidePopupView();
self.fireEvent(BI.DateTimeCombo.EVENT_CONFIRM);
});
this.combo = BI.createWidget({
type: "bi.combo",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: this.popup,
width: this.constants.popupWidth,
stopPropagation: false
},
// DEC-4250 和复选下拉一样,点击不收起
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW);
});
var triggerBtn = BI.createWidget({
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-font",
width: 24,
height: 24
});
triggerBtn.on(BI.IconButton.EVENT_CHANGE, function () {
if (self.combo.isViewVisible()) {
// self.combo.hideView();
} else {
self.combo.showView();
}
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [{
type: "bi.absolute",
items: [{
el: this.combo,
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: triggerBtn,
top: 0,
right: 0
}]
}]
});
},
setValue: function (v) {
this.storeValue = v;
this.popup.setValue(v);
this.trigger.setValue(v);
},
getValue: function () {
return this.storeValue;
},
hidePopupView: function () {
this.combo.hideView();
}
});
BI.DateTimeCombo.EVENT_CANCEL = "EVENT_CANCEL";
BI.DateTimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DateTimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.date_time_combo", BI.DateTimeCombo);
/***/ }),
/* 526 */
/***/ (function(module, exports) {
/**
* Created by Urthur on 2017/7/14.
*/
BI.DateTimePopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.DateTimePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-date-time-popup",
width: 268,
height: 374
});
},
_init: function () {
BI.DateTimePopup.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.cancelButton = BI.createWidget({
type: "bi.text_button",
cls: "multidate-popup-button bi-border-top bi-border-right",
shadow: true,
text: BI.i18nText("BI-Basic_Cancel")
});
this.cancelButton.on(BI.TextButton.EVENT_CHANGE, function () {
self.fireEvent(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE);
});
this.okButton = BI.createWidget({
type: "bi.text_button",
cls: "multidate-popup-button bi-border-top",
shadow: true,
text: BI.i18nText("BI-Basic_OK")
});
this.okButton.on(BI.TextButton.EVENT_CHANGE, function () {
self.fireEvent(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE);
});
this.dateCombo = BI.createWidget({
type: "bi.date_calendar_popup",
behaviors: opts.behaviors,
min: self.options.min,
max: self.options.max
});
self.dateCombo.on(BI.DateCalendarPopup.EVENT_CHANGE, function () {
self.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE);
});
this.dateButton = BI.createWidget({
type: "bi.grid",
items: [[this.cancelButton, this.okButton]]
});
BI.createWidget({
element: this,
type: "bi.vtape",
items: [{
el: this.dateCombo
}, {
el: {
type: "bi.center_adapt",
cls: "bi-split-top",
items: [{
type: "bi.dynamic_date_time_select",
ref: function (_ref) {
self.timeSelect = _ref;
}
}]
},
height: 50
}, {
el: this.dateButton,
height: 30
}]
});
this.setValue(opts.value);
},
setValue: function (v) {
var value = v, date;
if (BI.isNull(value)) {
date = BI.getDate();
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate()
});
this.timeSelect.setValue({
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
});
} else {
this.dateCombo.setValue({
year: value.year,
month: value.month,
day: value.day
});
this.timeSelect.setValue({
hour: value.hour,
minute: value.minute,
second: value.second
});
}
},
getValue: function () {
return BI.extend({
year: this.dateCombo.getValue().year,
month: this.dateCombo.getValue().month,
day: this.dateCombo.getValue().day
}, this.timeSelect.getValue());
}
});
BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE = "BUTTON_CANCEL_EVENT_CHANGE";
BI.DateTimePopup.CALENDAR_EVENT_CHANGE = "CALENDAR_EVENT_CHANGE";
BI.shortcut("bi.date_time_popup", BI.DateTimePopup);
/***/ }),
/* 527 */
/***/ (function(module, exports) {
/**
* Created by Urthur on 2017/7/14.
*/
BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4
},
_defaultConfig: function () {
return BI.extend(BI.DateTimeTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-date-time-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 24,
width: 200
});
},
_init: function () {
BI.DateTimeTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options, c = this._const;
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
height: o.height,
width: o.width,
hgap: c.hgap
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [{
el: this.text
},{
el: BI.createWidget(),
width: o.height
}]
});
this.setValue(o.value);
},
_printTime: function (v) {
return v < 10 ? "0" + v : v;
},
setValue: function (v) {
var self = this;
var value = v, dateStr;
if(BI.isNull(value)) {
value = BI.getDate();
dateStr = BI.print(value, "%Y-%X-%d %H:%M:%S");
} else {
var date = BI.getDate(value.year, value.month - 1, value.day, value.hour, value.minute, value.second);
dateStr = BI.print(date, "%Y-%X-%d %H:%M:%S");
}
this.text.setText(dateStr);
this.text.setTitle(dateStr);
}
});
BI.shortcut("bi.date_time_trigger", BI.DateTimeTrigger);
/***/ }),
/* 528 */
/***/ (function(module, exports) {
BI.StaticDateTimePaneCard = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.StaticDateTimePaneCard.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-date-time-pane",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
selectedTime: null
});
},
_init: function () {
BI.StaticDateTimePaneCard.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.today = BI.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth() + 1;
this.selectedTime = o.selectedTime || {
year: this._year,
month: this._month
};
this.datePicker = BI.createWidget({
type: "bi.date_picker",
behaviors: o.behaviors,
min: o.min,
max: o.max
});
this.datePicker.on(BI.DatePicker.EVENT_CHANGE, function () {
var value = self.datePicker.getValue();
var monthDay = BI.getMonthDays(BI.getDate(value.year, value.month - 1, 1));
var day = self.selectedTime.day || 0;
if (day > monthDay) {
day = monthDay;
}
self.selectedTime = BI.extend(self.selectedTime, {
year: value.year,
month: value.month
});
day !== 0 && (self.selectedTime.day = day);
self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime));
self.calendar.setValue(self.selectedTime);
day !== 0 && self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
this.calendar = BI.createWidget({
direction: "custom",
// logic: {
// dynamic: false
// },
type: "bi.navigation",
tab: this.datePicker,
cardCreator: BI.bind(this._createNav, this)
});
this.calendar.on(BI.Navigation.EVENT_CHANGE, function () {
self.selectedTime = BI.extend(self.calendar.getValue(), self.timeSelect.getValue());
self.calendar.empty();
self.setValue(self.selectedTime);
self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE);
});
BI.createWidget({
type: "bi.vtape",
element: this,
hgap: 10,
items: [{
el: this.datePicker,
height: 40
}, this.calendar, {
el: {
type: "bi.dynamic_date_time_select",
cls: "bi-split-top",
ref: function () {
self.timeSelect = this;
},
listeners: [{
eventName: BI.DynamicDateTimeSelect.EVENT_CONFIRM,
action: function () {
self.selectedTime = BI.extend(self.calendar.getValue(), self.timeSelect.getValue());
self.fireEvent("EVENT_CHANGE");
}
}]
},
height: 40
}]
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.layout",
cls: "bi-split-top"
},
height: 1,
top: 40,
left: 0,
right: 0
}]
});
this.setValue(o.selectedTime);
},
_createNav: function (v) {
var date = BI.Calendar.getDateJSONByPage(v);
var calendar = BI.createWidget({
type: "bi.calendar",
logic: {
dynamic: false
},
min: this.options.min,
max: this.options.max,
year: date.year,
month: date.month,
day: this.selectedTime.day
});
return calendar;
},
_getNewCurrentDate: function () {
var today = BI.getDate();
return {
year: today.getFullYear(),
month: today.getMonth() + 1
};
},
_setCalenderValue: function (date) {
this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date));
this.calendar.setValue(date);
this.selectedTime = BI.extend({}, this.timeSelect.getValue(), date);
},
_setDatePicker: function (timeOb) {
if (BI.isNull(timeOb) || BI.isNull(timeOb.year) || BI.isNull(timeOb.month)) {
this.datePicker.setValue(this._getNewCurrentDate());
} else {
this.datePicker.setValue(timeOb);
}
},
_setCalendar: function (timeOb) {
if (BI.isNull(timeOb) || BI.isNull(timeOb.day)) {
this.calendar.empty();
this._setCalenderValue(this._getNewCurrentDate());
} else {
this._setCalenderValue(timeOb);
}
},
setValue: function (timeOb) {
timeOb = timeOb || {};
this._setDatePicker(timeOb);
this._setCalendar(timeOb);
this.timeSelect.setValue({
hour: timeOb.hour,
minute: timeOb.minute,
second: timeOb.second
});
},
getValue: function () {
return this.selectedTime;
}
});
BI.shortcut("bi.static_date_time_pane_card", BI.StaticDateTimePaneCard);
/***/ }),
/* 529 */
/***/ (function(module, exports) {
BI.DynamicDateTimePane = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-dynamic-date-pane"
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vtape",
items: [{
el: {
type: "bi.linear_segment",
cls: "bi-split-bottom",
height: 30,
items: BI.createItems([{
text: BI.i18nText("BI-Multi_Date_YMD"),
value: BI.DynamicDateTimePane.Static
}, {
text: BI.i18nText("BI-Basic_Dynamic_Title"),
value: BI.DynamicDateTimePane.Dynamic
}], {
textAlign: "center"
}),
listeners: [{
eventName: BI.ButtonGroup.EVENT_CHANGE,
action: function () {
var value = this.getValue()[0];
self.dateTab.setSelect(value);
switch (value) {
case BI.DynamicDateTimePane.Static:
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate()
});
break;
case BI.DynamicDateTimePane.Dynamic:
self.dynamicPane.setValue({
year: 0
});
break;
default:
break;
}
}
}],
ref: function () {
self.switcher = this;
}
},
height: 30
}, {
type: "bi.tab",
ref: function () {
self.dateTab = this;
},
showIndex: BI.DynamicDateTimePane.Static,
cardCreator: function (v) {
switch (v) {
case BI.DynamicDateTimePane.Static:
return {
type: "bi.static_date_time_pane_card",
behaviors: o.behaviors,
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self.fireEvent("EVENT_CHANGE");
}
}],
ref: function () {
self.ymd = this;
}
};
case BI.DynamicDateTimePane.Dynamic:
default:
return {
type: "bi.dynamic_date_card",
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
if(self._checkValue(self.getValue())) {
self.fireEvent("EVENT_CHANGE");
}
}
}],
ref: function () {
self.dynamicPane = this;
}
};
}
}
}]
};
},
mounted: function () {
this.setValue(this.options.value);
},
_checkValueValid: function (value) {
return BI.isNull(value) || BI.isEmptyObject(value) || BI.isEmptyString(value);
},
_checkValue: function (v) {
switch (v.type) {
case BI.DynamicDateCombo.Dynamic:
return BI.isNotEmptyObject(v.value);
case BI.DynamicDateCombo.Static:
default:
return true;
}
},
setValue: function (v) {
v = v || {};
var type = v.type || BI.DynamicDateTimePane.Static;
var value = v.value || v;
this.switcher.setValue(type);
this.dateTab.setSelect(type);
switch (type) {
case BI.DynamicDateTimePane.Dynamic:
this.dynamicPane.setValue(value);
break;
case BI.DynamicDateTimePane.Static:
default:
if (this._checkValueValid(value)) {
var date = BI.getDate();
this.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth() + 1
});
} else {
this.ymd.setValue(value);
}
break;
}
},
getValue: function () {
return {
type: this.dateTab.getSelect(),
value: this.dateTab.getValue()
};
}
});
BI.shortcut("bi.dynamic_date_time_pane", BI.DynamicDateTimePane);
BI.extend(BI.DynamicDateTimePane, {
Static: 1,
Dynamic: 2
});
/***/ }),
/* 530 */
/***/ (function(module, exports) {
/**
* Created by roy on 15/8/14.
*/
BI.DownListCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-down-list-combo",
height: 24,
items: [],
adjustLength: 0,
direction: "bottom",
trigger: "click",
container: null,
stopPropagation: false,
el: {}
});
},
_init: function () {
BI.DownListCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.popupview = BI.createWidget({
type: "bi.down_list_popup",
items: o.items,
chooseType: o.chooseType,
value: o.value
});
this.popupview.on(BI.DownListPopup.EVENT_CHANGE, function (value) {
self.fireEvent(BI.DownListCombo.EVENT_CHANGE, value);
self.downlistcombo.hideView();
});
this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE, function (value, fatherValue) {
self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, value, fatherValue);
self.downlistcombo.hideView();
});
this.downlistcombo = BI.createWidget({
element: this,
type: "bi.combo",
trigger: o.trigger,
isNeedAdjustWidth: false,
container: o.container,
adjustLength: o.adjustLength,
direction: o.direction,
stopPropagation: o.stopPropagation,
el: BI.createWidget(o.el, {
type: "bi.icon_trigger",
extraCls: o.iconCls,
width: o.width,
height: o.height
}),
popup: {
el: this.popupview,
stopPropagation: o.stopPropagation,
maxHeight: 1000,
minWidth: 140
}
});
this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW);
});
},
hideView: function () {
this.downlistcombo.hideView();
},
showView: function (e) {
this.downlistcombo.showView(e);
},
populate: function (items) {
this.popupview.populate(items);
},
setValue: function (v) {
this.popupview.setValue(v);
},
getValue: function () {
return this.popupview.getValue();
}
});
BI.DownListCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DownListCombo.EVENT_SON_VALUE_CHANGE = "EVENT_SON_VALUE_CHANGE";
BI.DownListCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.down_list_combo", BI.DownListCombo);
/***/ }),
/* 531 */
/***/ (function(module, exports) {
/**
* Created by roy on 15/9/6.
*/
BI.DownListGroup = BI.inherit(BI.Widget, {
constants: {
iconCls: "check-mark-ha-font"
},
_defaultConfig: function () {
return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-down-list-group",
items: [
{
el: {}
}
]
});
},
_init: function () {
BI.DownListGroup.superclass._init.apply(this, arguments);
var o = this.options, self = this;
this.downlistgroup = BI.createWidget({
element: this,
type: "bi.button_tree",
items: o.items,
chooseType: 0, // 0单选,1多选
layouts: [{
type: "bi.vertical",
hgap: 0,
vgap: 0
}],
value: o.value
});
this.downlistgroup.on(BI.Controller.EVENT_CHANGE, function (type) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if(type === BI.Events.CLICK) {
self.fireEvent(BI.DownListGroup.EVENT_CHANGE, arguments);
}
});
},
getValue: function () {
return this.downlistgroup.getValue();
},
setValue: function (v) {
this.downlistgroup.setValue(v);
}
});
BI.DownListGroup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.down_list_group", BI.DownListGroup);
/***/ }),
/* 532 */
/***/ (function(module, exports) {
BI.DownListItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.DownListItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-down-list-item bi-list-item-active",
cls: "",
height: 24,
logic: {
dynamic: true
},
selected: false,
iconHeight: null,
iconWidth: null,
textHgap: 0,
textVgap: 0,
textLgap: 0,
textRgap: 0
});
},
_init: function () {
BI.DownListItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
hgap: o.textHgap,
vgap: o.textVgap,
lgap: o.textLgap,
rgap: o.textRgap,
text: o.text,
value: o.value,
keyword: o.keyword,
height: o.height
});
this.icon = BI.createWidget({
type: "bi.center_adapt",
width: 36,
height: o.height,
items: [{
el: {
type: "bi.icon",
width: o.iconWidth,
height: o.iconHeight
}
}]
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left), BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, this.icon, this.text)
}))));
},
setValue: function () {
if (!this.isReadOnly()) {
this.text.setValue.apply(this.text, arguments);
}
},
getValue: function () {
return this.text.getValue();
},
setText: function () {
this.text.setText.apply(this.text, arguments);
},
getText: function () {
return this.text.getText();
},
doClick: function () {
BI.DownListItem.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.DownListItem.EVENT_CHANGE, this.getValue(), this);
}
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
}
});
BI.DownListItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.down_list_item", BI.DownListItem);
/***/ }),
/* 533 */
/***/ (function(module, exports) {
BI.DownListGroupItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.DownListGroupItem.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-down-list-group-item",
logic: {
dynamic: false
},
// invalid: true,
iconCls1: "dot-e-font",
iconCls2: "pull-right-e-font"
});
},
_init: function () {
BI.DownListGroupItem.superclass._init.apply(this, arguments);
var o = this.options;
var self = this;
this.text = BI.createWidget({
type: "bi.label",
cls: "list-group-item-text",
textAlign: "left",
text: o.text,
value: o.value,
height: o.height
});
this.icon1 = BI.createWidget({
type: "bi.icon_button",
cls: o.iconCls1,
width: 36,
disableSelected: true,
selected: this._digest(o.value)
});
this.icon2 = BI.createWidget({
type: "bi.icon_button",
cls: o.iconCls2,
width: 24,
forceNotSelected: true
});
var blank = BI.createWidget({
type: "bi.layout",
width: 24
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.icon2,
top: 0,
bottom: 0,
right: 0
}]
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", this.icon1, this.text, blank)
}))));
this.element.hover(function () {
if (self.isEnabled()) {
self.hover();
}
}, function () {
if (self.isEnabled()) {
self.dishover();
}
});
},
_digest: function (v) {
var self = this, o = this.options;
v = BI.isArray(v) ? v : [v];
return BI.any(v, function (idx, value) {
return BI.contains(o.childValues, value);
});
},
hover: function () {
BI.DownListGroupItem.superclass.hover.apply(this, arguments);
this.icon1.element.addClass("hover");
this.icon2.element.addClass("hover");
},
dishover: function () {
BI.DownListGroupItem.superclass.dishover.apply(this, arguments);
this.icon1.element.removeClass("hover");
this.icon2.element.removeClass("hover");
},
doClick: function () {
BI.DownListGroupItem.superclass.doClick.apply(this, arguments);
if (this.isValid()) {
this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE, this.getValue());
}
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
setValue: function (v) {
this.icon1.setSelected(this._digest(v));
}
});
BI.DownListGroupItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.down_list_group_item", BI.DownListGroupItem);
/***/ }),
/* 534 */
/***/ (function(module, exports) {
/**
* Created by roy on 15/9/8.
* 处理popup中的item分组样式
* 一个item分组中的成员大于一时,该分组设置为单选,并且默认状态第一个成员设置为已选择项
*/
BI.DownListPopup = BI.inherit(BI.Pane, {
constants: {
nextIcon: "pull-right-e-font",
height: 24,
iconHeight: 12,
iconWidth: 12,
hgap: 0,
vgap: 0,
border: 1
},
_defaultConfig: function () {
var conf = BI.DownListPopup.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-down-list-popup",
items: [],
chooseType: BI.Selection.Multi
});
},
_init: function () {
BI.DownListPopup.superclass._init.apply(this, arguments);
this.singleValues = [];
this.childValueMap = {};
this.fatherValueMap = {};
this.items = BI.deepClone(this.options.items);
var self = this, o = this.options, children = this._createChildren(this.items);
this.popup = BI.createWidget({
type: "bi.button_tree",
items: BI.createItems(children,
{}, {
adjustLength: -2
}
),
layouts: [{
type: "bi.vertical",
hgap: this.constants.hgap,
vgap: this.constants.vgap
}],
value: this._digest(o.value),
chooseType: o.chooseType
});
this.popup.on(BI.ButtonTree.EVENT_CHANGE, function (value, object) {
var changedValue = value;
if (BI.isNotNull(self.childValueMap[value])) {
changedValue = self.childValueMap[value];
self.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE, changedValue, self.fatherValueMap[value]);
} else {
self.fireEvent(BI.DownListPopup.EVENT_CHANGE, changedValue, object);
}
if (!BI.contains(self.singleValues, changedValue)) {
var item = self.getValue();
var result = [];
BI.each(item, function (i, valueObject) {
if (valueObject.value != changedValue) {
result.push(valueObject);
}
});
self.setValue(result);
}
});
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.popup],
vgap: 5
});
},
_createChildren: function (items) {
var self = this, result = [];
// 不能修改populate进来的item的引用
BI.each(items, function (i, it) {
var item_done = {
type: "bi.down_list_group",
items: []
};
BI.each(it, function (i, item) {
if (BI.isNotEmptyArray(item.children) && !BI.isEmpty(item.el)) {
item.type = "bi.combo_group";
// popup未初始化返回的是options中的value, 在经过buttontree的getValue concat之后,无法区分值来自options
// 还是item自身, 这边控制defaultInit为true来避免这个问题
item.isDefaultInit = true;
item.cls = "down-list-group";
item.trigger = "hover";
item.isNeedAdjustWidth = false;
item.el.title = item.el.title || item.el.text;
item.el.type = "bi.down_list_group_item";
item.el.logic = {
dynamic: true
};
item.el.height = self.constants.height;
item.el.iconCls2 = self.constants.nextIcon;
item.popup = {
lgap: 1,
el: {
type: "bi.button_tree",
chooseType: 0,
layouts: [{
type: "bi.vertical"
}]
},
innerVGap: 5,
maxHeight: 378
};
item.el.childValues = [];
BI.each(item.children, function (i, child) {
var fatherValue = BI.deepClone(item.el.value);
var childValue = BI.deepClone(child.value);
self.singleValues.push(child.value);
child.type = "bi.down_list_item";
child.extraCls = " child-down-list-item";
child.title = child.title || child.text;
child.textRgap = 10;
child.isNeedAdjustWidth = false;
child.logic = {
dynamic: true
};
child.father = fatherValue;
self.fatherValueMap[self._createChildValue(fatherValue, childValue)] = fatherValue;
self.childValueMap[self._createChildValue(fatherValue, childValue)] = childValue;
child.value = self._createChildValue(fatherValue, childValue);
item.el.childValues.push(child.value);
});
} else {
item.type = "bi.down_list_item";
item.title = item.title || item.text;
item.textRgap = 10;
item.isNeedAdjustWidth = false;
item.logic = {
dynamic: true
};
}
var el_done = {};
el_done.el = item;
item_done.items.push(el_done);
});
if (self._isGroup(item_done.items)) {
BI.each(item_done.items, function (i, item) {
self.singleValues.push(item.el.value);
});
}
result.push(item_done);
if (self._needSpliter(i, items.length)) {
var spliter_container = BI.createWidget({
type: "bi.vertical",
items: [{
el: {
type: "bi.layout",
cls: "bi-down-list-spliter bi-split-top cursor-pointer",
height: 0
}
}],
cls: "bi-down-list-spliter-container cursor-pointer",
vgap: 5,
lgap: 10,
rgap: 0
});
result.push(spliter_container);
}
});
return result;
},
_isGroup: function (i) {
return i.length > 1;
},
_needSpliter: function (i, itemLength) {
return i < itemLength - 1;
},
_createChildValue: function (fatherValue, childValue) {
return fatherValue + "_" + childValue;
},
_digest: function (valueItem) {
var self = this;
var valueArray = [];
BI.each(valueItem, function (i, item) {
var value;
if (BI.isNotNull(item.childValue)) {
value = self._createChildValue(item.value, item.childValue);
} else {
value = item.value;
}
valueArray.push(value);
}
);
return valueArray;
},
_checkValues: function (values) {
var value = [];
BI.each(this.items, function (idx, itemGroup) {
BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)) {
var childValues = BI.map(item.children, "value");
var v = joinValue(childValues, values[idx]);
if(BI.isNotEmptyString(v)) {
value.push(v);
}
}else{
if(item.value === values[idx][0]) {
value.push(values[idx][0]);
}
}
});
});
return value;
function joinValue (sources, targets) {
var value = "";
BI.some(sources, function (idx, s) {
return BI.some(targets, function (id, t) {
if(s === t) {
value = s;
return true;
}
});
});
return value;
}
},
populate: function (items) {
BI.DownListPopup.superclass.populate.apply(this, arguments);
this.items = BI.deepClone(items);
this.childValueMap = {};
this.fatherValueMap = {};
this.singleValues = [];
var children = this._createChildren(this.items);
var popupItem = BI.createItems(children,
{}, {
adjustLength: -2
}
);
this.popup.populate(popupItem);
},
setValue: function (valueItem) {
this.popup.setValue(this._digest(valueItem));
},
_getValue: function () {
var v = [];
BI.each(this.popup.getAllButtons(), function (i, item) {
i % 2 === 0 && v.push(item.getValue());
});
return v;
},
getValue: function () {
var self = this, result = [];
var values = this._checkValues(this._getValue());
BI.each(values, function (i, value) {
var valueItem = {};
if (BI.isNotNull(self.childValueMap[value])) {
var fartherValue = self.fatherValueMap[value];
valueItem.childValue = self.childValueMap[value];
valueItem.value = fartherValue;
} else {
valueItem.value = value;
}
result.push(valueItem);
});
return result;
}
});
BI.DownListPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.DownListPopup.EVENT_SON_VALUE_CHANGE = "EVENT_SON_VALUE_CHANGE";
BI.shortcut("bi.down_list_popup", BI.DownListPopup);
/***/ }),
/* 535 */
/***/ (function(module, exports) {
!(function () {
BI.DynamicDateHelper = {};
BI.extend(BI.DynamicDateHelper, {
getCalculation: function (obj) {
var date = BI.getDate();
return this.getCalculationByDate(date, obj);
},
getCalculationByDate: function (date, obj) {
if (BI.isNotNull(obj.year)) {
date = BI.getDate((date.getFullYear() + BI.parseInt(obj.year)), date.getMonth(), date.getDate());
}
if (BI.isNotNull(obj.quarter)) {
date = BI.getOffsetQuarter(date, BI.parseInt(obj.quarter));
}
if (BI.isNotNull(obj.month)) {
date = BI.getOffsetMonth(date, BI.parseInt(obj.month));
}
if (BI.isNotNull(obj.week)) {
date = BI.getOffsetDate(date, BI.parseInt(obj.week) * 7);
}
if (BI.isNotNull(obj.day)) {
date = BI.getOffsetDate(date, BI.parseInt(obj.day));
}
if (BI.isNotNull(obj.workDay)) {
// 配置了节假日就按照节假日计算工作日偏移,否则按正常的天去算
if(BI.isNotNull(BI.holidays)) {
var count = Math.abs(obj.workDay);
for (var i = 0; i < count; i++) {
date = BI.getOffsetDate(date, obj.workDay < 0 ? -1 : 1);
if(BI.isNotNull(BI.holidays[BI.print(date, "%Y-%X-%d")])) {
i--;
}
}
} else {
date = BI.getOffsetDate(date, BI.parseInt(obj.workDay));
}
}
if (BI.isNotNull(obj.position) && obj.position !== BI.DynamicDateCard.OFFSET.CURRENT) {
date = this.getBeginDate(date, obj);
}
return BI.getDate(date.getFullYear(), date.getMonth(), date.getDate());
},
getBeginDate: function (date, obj) {
if (BI.isNotNull(obj.day)) {
return obj.position === BI.DynamicDateCard.OFFSET.BEGIN ? BI.getDate(date.getFullYear(), date.getMonth(), 1) : BI.getDate(date.getFullYear(), date.getMonth(), (BI.getLastDateOfMonth(date)).getDate());
}
if (BI.isNotNull(obj.week)) {
return obj.position === BI.DynamicDateCard.OFFSET.BEGIN ? BI.getWeekStartDate(date) : BI.getWeekEndDate(date);
}
if (BI.isNotNull(obj.month)) {
return obj.position === BI.DynamicDateCard.OFFSET.BEGIN ? BI.getDate(date.getFullYear(), date.getMonth(), 1) : BI.getDate(date.getFullYear(), date.getMonth(), (BI.getLastDateOfMonth(date)).getDate());
}
if (BI.isNotNull(obj.quarter)) {
return obj.position === BI.DynamicDateCard.OFFSET.BEGIN ? BI.getQuarterStartDate(date) : BI.getQuarterEndDate(date);
}
if (BI.isNotNull(obj.year)) {
return obj.position === BI.DynamicDateCard.OFFSET.BEGIN ? BI.getDate(date.getFullYear(), 0, 1) : BI.getDate(date.getFullYear(), 11, 31);
}
return date;
}
});
})();
/***/ }),
/* 536 */
/***/ (function(module, exports) {
BI.DynamicDateCard = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-dynamic-date-card"
},
render: function () {
var self = this;
this.position = BI.DynamicDateCard.OFFSET.CURRENT;
return {
type: "bi.vertical",
items: [{
el: {
type: "bi.label",
text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"),
textAlign: "left",
height: 12,
lgap: 10
},
tgap: 10,
bgap: 5
}, {
type: "bi.button_group",
ref: function () {
self.checkgroup = this;
},
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
lgap: 4,
value: [BI.DynamicDateCard.TYPE.YEAR],
items: BI.createItems([{
text: BI.i18nText("BI-Basic_Year"),
value: BI.DynamicDateCard.TYPE.YEAR
}, {
text: BI.i18nText("BI-Basic_Single_Quarter"),
value: BI.DynamicDateCard.TYPE.QUARTER
}, {
text: BI.i18nText("BI-Basic_Month"),
value: BI.DynamicDateCard.TYPE.MONTH
}, {
text: BI.i18nText("BI-Basic_Week"),
value: BI.DynamicDateCard.TYPE.WEEK
}, {
text: BI.i18nText("BI-Basic_Day"),
value: BI.DynamicDateCard.TYPE.DAY
}], {
type: "bi.multi_select_item",
logic: {
dynamic: true
}
}),
layouts: [{
type: "bi.left",
rgap: 4
}],
listeners: [{
eventName: BI.ButtonGroup.EVENT_CHANGE,
action: function () {
var value = self.checkgroup.getValue();
if(value.length !== 0) {
self.workDayBox.setSelected(false);
}
var plainValue = {};
BI.each(self.resultPane.getAllButtons(), function (idx, button) {
var value = button.getValue();
if(BI.isNotNull(value.dateType)) {
plainValue[value.dateType] = {
value: value.value,
offset: value.offset
};
}
});
self.resultPane.populate(self._getParamJson(BI.map(self.checkgroup.getValue(), function (idx, v) {
var obj = {
dateType: v
};
if(BI.has(plainValue, v)) {
obj.value = plainValue[v].value;
obj.offset = plainValue[v].offset;
}
return obj;
})));
self.position = BI.DynamicDateCard.OFFSET.CURRENT;
self.fireEvent("EVENT_CHANGE");
}
}]
}, {
type: "bi.vertical_adapt",
lgap: 2,
items: [{
el: {
type: "bi.multi_select_item",
ref: function () {
self.workDayBox = this;
},
logic: {
dynamic: true
},
text: BI.i18nText("BI-Basic_Work_Day"),
value: BI.DynamicDateCard.TYPE.WORK_DAY,
listeners: [{
eventName: BI.MultiSelectItem.EVENT_CHANGE,
action: function () {
if(this.isSelected()) {
self.checkgroup.setValue();
}
self.resultPane.populate(this.isSelected() ? self._getParamJson([{
dateType: BI.DynamicDateCard.TYPE.WORK_DAY
}]) : []);
self.position = BI.DynamicDateCard.OFFSET.CURRENT;
self.fireEvent("EVENT_CHANGE");
}
}]
}
}],
ref: function () {
self.workDay = this;
}
}, {
type: "bi.button_group",
items: this._getParamJson([{
dateType: BI.DynamicDateCard.TYPE.YEAR
}]),
ref: function () {
self.resultPane = this;
},
layouts: [{
type: "bi.vertical",
bgap: 10,
hgap: 10
}]
}]
};
},
_getParamJson: function (values, positionValue) {
var self = this;
var items = BI.map(values, function (idx, value) {
return {
el: {
type: "bi.dynamic_date_param_item",
dateType: value.dateType,
value: value.value,
offset: value.offset,
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self.fireEvent("EVENT_CHANGE");
}
}]
},
tgap: idx === 0 ? 5 : 0
};
});
if(values.length === 1 && values[0].dateType === BI.DynamicDateCard.TYPE.DAY) {
var comboItems = this._getText(BI.DynamicDateCard.TYPE.MONTH);
comboItems[0].text = BI.i18nText("BI-Basic_Empty");
items.push({
type: "bi.text_value_combo",
height: 24,
items: comboItems,
container: null,
value: positionValue || BI.DynamicDateCard.OFFSET.CURRENT,
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self.position = this.getValue()[0];
self.fireEvent("EVENT_CHANGE");
}
}]
});
}else{
if(values.length !== 0 && BI.last(values).dateType !== BI.DynamicDateCard.TYPE.DAY && BI.last(values).dateType !== BI.DynamicDateCard.TYPE.WORK_DAY) {
items.push({
type: "bi.text_value_combo",
height: 24,
container: null,
items: this._getText(BI.last(values).dateType),
value: positionValue || BI.DynamicDateCard.OFFSET.CURRENT,
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self.position = this.getValue()[0];
self.fireEvent("EVENT_CHANGE");
}
}]
});
}
}
return items;
},
_getText: function (lastValue) {
switch (lastValue) {
case BI.DynamicDateCard.TYPE.YEAR:
return [{
text: BI.i18nText("BI-Basic_Current_Day"),
value: BI.DynamicDateCard.OFFSET.CURRENT
}, {
text: BI.i18nText("BI-Basic_Year_Begin"),
value: BI.DynamicDateCard.OFFSET.BEGIN
}, {
text: BI.i18nText("BI-Basic_Year_End"),
value: BI.DynamicDateCard.OFFSET.END
}];
case BI.DynamicDateCard.TYPE.QUARTER:
return [{
text: BI.i18nText("BI-Basic_Current_Day"),
value: BI.DynamicDateCard.OFFSET.CURRENT
}, {
text: BI.i18nText("BI-Basic_Quarter_Begin"),
value: BI.DynamicDateCard.OFFSET.BEGIN
}, {
text: BI.i18nText("BI-Basic_Quarter_End"),
value: BI.DynamicDateCard.OFFSET.END
}];
case BI.DynamicDateCard.TYPE.MONTH:
return [{
text: BI.i18nText("BI-Basic_Current_Day"),
value: BI.DynamicDateCard.OFFSET.CURRENT
}, {
text: BI.i18nText("BI-Basic_Month_Begin"),
value: BI.DynamicDateCard.OFFSET.BEGIN
}, {
text: BI.i18nText("BI-Basic_Month_End"),
value: BI.DynamicDateCard.OFFSET.END
}];
case BI.DynamicDateCard.TYPE.WEEK:
default:
return [{
text: BI.i18nText("BI-Basic_Current_Day"),
value: BI.DynamicDateCard.OFFSET.CURRENT
}, {
text: BI.i18nText("BI-Basic_Week_Begin"),
value: BI.DynamicDateCard.OFFSET.BEGIN
}, {
text: BI.i18nText("BI-Basic_Week_End"),
value: BI.DynamicDateCard.OFFSET.END
}];
}
},
_createValue: function (type, v) {
return {
dateType: type,
value: Math.abs(v),
offset: v > 0 ? 1 : 0
};
},
setValue: function (v) {
v = v || {};
this.position = v.position || BI.DynamicDateCard.OFFSET.CURRENT;
var values = [];
var valuesItems = [];
if(BI.isNotNull(v.year)) {
values.push(BI.DynamicDateCard.TYPE.YEAR);
valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.YEAR, v.year));
}
if(BI.isNotNull(v.quarter)) {
values.push(BI.DynamicDateCard.TYPE.QUARTER);
valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.QUARTER, v.quarter));
}
if(BI.isNotNull(v.month)) {
values.push(BI.DynamicDateCard.TYPE.MONTH);
valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.MONTH, v.month));
}
if(BI.isNotNull(v.week)) {
values.push(BI.DynamicDateCard.TYPE.WEEK);
valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.WEEK, v.week));
}
if(BI.isNotNull(v.day)) {
values.push(BI.DynamicDateCard.TYPE.DAY);
valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.DAY, v.day));
}
if(BI.isNotNull(v.workDay)) {
values.push(BI.DynamicDateCard.TYPE.WORK_DAY);
valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.WORK_DAY, v.workDay));
}
this.checkgroup.setValue(values);
this.workDayBox.setSelected(BI.isNotNull(v.workDay));
this.resultPane.populate(this._getParamJson(valuesItems, v.position));
},
getValue: function () {
var self = this;
var valueMap = {};
var selectValues = this.checkgroup.getValue();
var buttons = this.resultPane.getAllButtons();
if(selectValues.length !== 0) {
BI.each(buttons, function (idx, button) {
var value = button.getValue();
switch (value.dateType) {
case BI.DynamicDateCard.TYPE.YEAR:
valueMap.year = (value.offset === 0 ? -value.value : value.value);
break;
case BI.DynamicDateCard.TYPE.QUARTER:
valueMap.quarter = (value.offset === 0 ? -value.value : value.value);
break;
case BI.DynamicDateCard.TYPE.MONTH:
valueMap.month = (value.offset === 0 ? -value.value : value.value);
break;
case BI.DynamicDateCard.TYPE.WEEK:
valueMap.week = (value.offset === 0 ? -value.value : value.value);
break;
case BI.DynamicDateCard.TYPE.DAY:
valueMap.day = (value.offset === 0 ? -value.value : value.value);
break;
default:
break;
}
if(BI.isNull(value.dateType)) {
valueMap.position = self.position || BI.DynamicDateCard.OFFSET.CURRENT;
}
});
}
if(this.workDayBox.isSelected()) {
var value = buttons[0].getValue();
valueMap.workDay = (value.offset === 0 ? -value.value : value.value);
}
return valueMap;
}
});
BI.shortcut("bi.dynamic_date_card", BI.DynamicDateCard);
BI.extend(BI.DynamicDateCard, {
TYPE: {
YEAR: 1,
QUARTER: 2,
MONTH: 3,
WEEK: 4,
DAY: 5,
WORK_DAY: 6
},
OFFSET: {
CURRENT: 1,
BEGIN: 2,
END: 3
}
});
/***/ }),
/* 537 */
/***/ (function(module, exports) {
BI.DynamicDateCombo = BI.inherit(BI.Single, {
constants: {
popupHeight: 259,
popupWidth: 270,
comboAdjustHeight: 1,
border: 1
},
props: {
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",
height: 22,
minDate: "1900-01-01",
maxDate: "2099-12-31",
format: "",
allowEdit: true
},
render: function () {
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = BI.getDate();
this.storeValue = opts.value;
return {
type: "bi.htape",
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: opts.height,
height: opts.height,
ref: function () {
self.changeIcon = this;
}
},
width: opts.height
}, {
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
container: opts.container,
ref: function () {
self.combo = this;
},
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
destroyWhenHide: true,
el: {
type: "bi.dynamic_date_trigger",
min: opts.minDate,
max: opts.maxDate,
format: opts.format,
allowEdit: opts.allowEdit,
watermark: opts.watermark,
height: opts.height,
value: opts.value,
ref: function () {
self.trigger = this;
},
listeners: [{
eventName: BI.DynamicDateTrigger.EVENT_KEY_DOWN,
action: function () {
if (self.combo.isViewVisible()) {
self.combo.hideView();
}
self.fireEvent(BI.DynamicDateCombo.EVENT_KEY_DOWN, arguments);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_STOP,
action: function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_FOCUS,
action: function () {
self.storeTriggerValue = self.trigger.getKey();
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_ERROR,
action: function () {
self.storeValue = {
type: BI.DynamicDateCombo.Static,
value: {
year: date.getFullYear(),
month: date.getMonth() + 1
}
};
self.fireEvent(BI.DynamicDateCombo.EVENT_ERROR);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_VALID,
action: function () {
self.fireEvent(BI.DynamicDateCombo.EVENT_VALID);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicDateCombo.EVENT_CHANGE);
}
}, {
eventName: BI.DynamicDateTrigger.EVENT_CONFIRM,
action: function () {
if (self.combo.isViewVisible()) {
return;
}
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
} else if (BI.isEmptyString(dateObj)) {
self.storeValue = null;
self.trigger.setValue();
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}]
},
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: {
type: "bi.dynamic_date_popup",
behaviors: opts.behaviors,
min: opts.minDate,
max: opts.maxDate,
ref: function () {
self.popup = this;
},
listeners: [{
eventName: BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () {
var date = BI.getDate();
self.setValue({
type: BI.DynamicDateCombo.Static,
value: {
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate()
}
});
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
var value = self.popup.getValue();
if(self._checkValue(value)) {
self.setValue(value);
}
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicDatePopup.EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}]
},
stopPropagation: false
},
// DEC-4250 和复选下拉一样,点击triggerBtn不默认收起
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
},
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.setValue(self.storeValue);
self.popup.setMinDate(opts.minDate);
self.popup.setMaxDate(opts.maxDate);
self.fireEvent(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW);
}
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-font",
width: opts.height,
height: opts.height,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
if (self.combo.isViewVisible()) {
// self.combo.hideView();
} else {
self.combo.showView();
}
}
}],
ref: function () {
self.triggerBtn = this;
}
},
top: 0,
right: 0
}]
}],
ref: function (_ref) {
self.comboWrapper = _ref;
}
};
},
mounted: function () {
this._checkDynamicValue(this.storeValue);
},
_checkDynamicValue: function (v) {
var o = this.options;
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicDateCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = o.height;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
_checkValue: function (v) {
switch (v.type) {
case BI.DynamicDateCombo.Dynamic:
return BI.isNotEmptyObject(v.value);
case BI.DynamicDateCombo.Static:
default:
return true;
}
},
_defaultState: function () {
},
setMinDate: function (minDate) {
var o = this.options;
o.minDate = minDate;
this.trigger.setMinDate(minDate);
this.popup && this.popup.setMinDate(minDate);
},
setMaxDate: function (maxDate) {
var o = this.options;
o.maxDate = maxDate;
this.trigger.setMaxDate(maxDate);
this.popup && this.popup.setMaxDate(maxDate);
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {
return this.storeValue;
},
getKey: function () {
return this.trigger.getKey();
},
hidePopupView: function () {
this.combo.hideView();
}
});
BI.DynamicDateCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateCombo.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.dynamic_date_combo", BI.DynamicDateCombo);
BI.extend(BI.DynamicDateCombo, {
Static: 1,
Dynamic: 2
});
/***/ }),
/* 538 */
/***/ (function(module, exports) {
BI.DynamicDateParamItem = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-dynamic-date-param-item",
dateType: BI.DynamicDateCard.TYPE.YEAR,
value: 0,
offset: 0,
height: 24
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.htape",
items: [{
el: {
type: "bi.sign_editor",
cls: "bi-border",
height: 22,
validationChecker: function (v) {
return BI.isNaturalNumber(v);
},
value: o.value,
ref: function () {
self.editor = this;
},
errorText: function (v) {
if(BI.isEmptyString(v)) {
return BI.i18nText("BI-Basic_Please_Input_Content");
}
return BI.i18nText("BI-Please_Input_Natural_Number");
},
allowBlank: false,
listeners: [{
eventName: BI.SignEditor.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE);
}
}]
},
width: 60
}, {
el: {
type: "bi.label",
height: 24,
text: this._getText()
},
width: o.dateType === BI.DynamicDateCard.TYPE.WORK_DAY ? 60 : 20
}, {
type: "bi.text_value_combo",
height: 24,
items: [{
text: BI.i18nText("BI-Basic_Front"),
value: 0
}, {
text: BI.i18nText("BI-Basic_Behind"),
value: 1
}],
ref: function () {
self.offsetCombo = this;
},
container: null,
value: o.offset,
listeners: [{
eventName: BI.TextValueCombo.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE);
}
}]
}]
};
},
_getText: function () {
var text = "";
switch (this.options.dateType) {
case BI.DynamicDateCard.TYPE.YEAR:
text = BI.i18nText("BI-Basic_Year");
break;
case BI.DynamicDateCard.TYPE.QUARTER:
text = BI.i18nText("BI-Basic_Single_Quarter");
break;
case BI.DynamicDateCard.TYPE.MONTH:
text = BI.i18nText("BI-Basic_Month");
break;
case BI.DynamicDateCard.TYPE.WEEK:
text = BI.i18nText("BI-Basic_Week");
break;
case BI.DynamicDateCard.TYPE.DAY:
text = BI.i18nText("BI-Basic_Day");
break;
case BI.DynamicDateCard.TYPE.WORK_DAY:
default:
text = BI.i18nText("BI-Basic_Work_Day");
break;
}
return text;
},
setValue: function (v) {
v = v || {};
v.value = v.value || 0;
v.offset = v.offset || 0;
this.editor.setValue(v.value);
this.offsetCombo.setValue(v.offset);
},
getValue: function () {
return {
dateType: this.options.dateType,
value: this.editor.getValue(),
offset: this.offsetCombo.getValue()[0]
};
}
});
BI.DynamicDateParamItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.dynamic_date_param_item", BI.DynamicDateParamItem);
/***/ }),
/* 539 */
/***/ (function(module, exports) {
BI.DynamicDatePopup = BI.inherit(BI.Widget, {
constants: {
tabHeight: 30,
buttonHeight: 24
},
props: {
baseCls: "bi-dynamic-date-popup",
width: 248,
height: 344
},
_init: function () {
BI.DynamicDatePopup.superclass._init.apply(this, arguments);
var self = this, opts = this.options, c = this.constants;
this.storeValue = {type: BI.DynamicDateCombo.Static};
BI.createWidget({
element: this,
type: "bi.vtape",
items: [{
el: this._getTabJson()
}, {
el: {
type: "bi.grid",
items: [[{
type: "bi.text_button",
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Clear"),
textHeight: c.buttonHeight - 1,
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
shadow: true,
textHeight: c.buttonHeight - 1,
text: BI.i18nText("BI-Multi_Date_Today"),
ref: function () {
self.textButton = this;
},
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
cls: "bi-high-light bi-split-top",
textHeight: c.buttonHeight - 1,
shadow: true,
text: BI.i18nText("BI-Basic_OK"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]
});
this.setValue(opts.value);
},
_getTabJson: function () {
var self = this, o = this.options;
return {
type: "bi.tab",
ref: function () {
self.dateTab = this;
},
tab: {
type: "bi.linear_segment",
cls: "bi-split-bottom",
height: this.constants.tabHeight,
items: BI.createItems([{
text: BI.i18nText("BI-Multi_Date_YMD"),
value: BI.DynamicDateCombo.Static
}, {
text: BI.i18nText("BI-Basic_Dynamic_Title"),
value: BI.DynamicDateCombo.Dynamic
}], {
textAlign: "center"
})
},
cardCreator: function (v) {
switch (v) {
case BI.DynamicDateCombo.Dynamic:
return {
type: "bi.dynamic_date_card",
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self._setInnerValue(self.year, v);
}
}],
ref: function () {
self.dynamicPane = this;
}
};
case BI.DynamicDateCombo.Static:
default:
return {
type: "bi.date_calendar_popup",
behaviors: o.behaviors,
min: self.options.min,
max: self.options.max,
listeners: [{
eventName: BI.DateCalendarPopup.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE);
}
}],
ref: function () {
self.ymd = this;
}
};
}
},
listeners: [{
eventName: BI.Tab.EVENT_CHANGE,
action: function () {
var v = self.dateTab.getSelect();
switch (v) {
case BI.DynamicDateCombo.Static:
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate()
});
self._setInnerValue();
break;
case BI.DynamicDateCombo.Dynamic:
default:
if(self.storeValue && self.storeValue.type === BI.DynamicDateCombo.Dynamic) {
self.dynamicPane.setValue(self.storeValue.value);
}else{
self.dynamicPane.setValue({
year: 0
});
}
self._setInnerValue();
break;
}
}
}]
};
},
_setInnerValue: function () {
if (this.dateTab.getSelect() === BI.DynamicDateCombo.Static) {
this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));
this.textButton.setEnable(true);
} else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());
date = BI.print(date, "%Y-%X-%d");
this.textButton.setValue(date);
this.textButton.setEnable(false);
}
},
_checkValueValid: function (value) {
return BI.isNull(value) || BI.isEmptyObject(value) || BI.isEmptyString(value);
},
setMinDate: function (minDate) {
if (this.options.min !== minDate) {
this.options.min = minDate;
this.ymd.setMinDate(minDate);
}
},
setMaxDate: function (maxDate) {
if (this.options.max !== maxDate) {
this.options.max = maxDate;
this.ymd.setMaxDate(maxDate);
}
},
setValue: function (v) {
this.storeValue = v;
var self = this;
var type, value;
v = v || {};
type = v.type || BI.DynamicDateCombo.Static;
value = v.value || v;
this.dateTab.setSelect(type);
switch (type) {
case BI.DynamicDateCombo.Dynamic:
this.dynamicPane.setValue(value);
self._setInnerValue();
break;
case BI.DynamicDateCombo.Static:
default:
if (this._checkValueValid(value)) {
var date = BI.getDate();
this.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate()
});
this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));
} else {
this.ymd.setValue(value);
this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));
}
this.textButton.setEnable(true);
break;
}
},
getValue: function () {
return {
type: this.dateTab.getSelect(),
value: this.dateTab.getValue()
};
}
});
BI.DynamicDatePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE = "BUTTON_lABEL_EVENT_CHANGE";
BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);
/***/ }),
/* 540 */
/***/ (function(module, exports) {
BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
yearLength: 4,
yearMonthLength: 6,
yearFullMonthLength: 7,
compareFormat: "%Y-%X-%d"
},
props: {
extraCls: "bi-date-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 24,
format: "", // 显示的日期格式化方式
allowEdit: true, // 是否允许编辑
watermark: ""
},
_init: function () {
BI.DynamicDateTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options, c = this._const;
this.storeTriggerValue = "";
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
var formatStr = self._getStandardDateStr(v);
var date = formatStr.match(/\d+/g);
!BI.isKey(o.format) && self._autoAppend(v, date);
return self._dateCheck(formatStr) && BI.checkDateLegal(formatStr) && self._checkVoid({
year: date[0] | 0,
month: date[1] | 0,
day: date[2] | 0
});
},
quitChecker: function () {
return false;
},
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true,
watermark: BI.isKey(o.watermark) ? o.watermark : BI.i18nText("BI-Basic_Unrestricted"),
errorText: function () {
var str = "";
if (!BI.isKey(o.format)) {
str = self.editor.isEditing() ? BI.i18nText("BI-Date_Trigger_Error_Text") : BI.i18nText("BI-Year_Trigger_Invalid_Text");
}
return str;
},
title: BI.bind(this._getTitle, this)
});
this.editor.on(BI.SignEditor.EVENT_KEY_DOWN, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_KEY_DOWN, arguments);
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP);
});
this.editor.on(BI.SignEditor.EVENT_VALID, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_VALID);
});
this.editor.on(BI.SignEditor.EVENT_ERROR, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_ERROR);
});
this.editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
var value = self.editor.getValue();
if (BI.isNotNull(value)) {
self.editor.setState(value);
}
if (BI.isNotEmptyString(value) && !BI.isEqual(self.storeTriggerValue, self.getKey())) {
var formatStr = self._getStandardDateStr(value);
var date = formatStr.match(/\d+/g);
self.storeValue = {
type: BI.DynamicDateCombo.Static,
value: {
year: date[0] | 0,
month: date[1] | 0,
day: date[2] | 0
}
};
}
self.fireEvent(BI.DynamicDateTrigger.EVENT_CONFIRM);
});
this.editor.on(BI.SignEditor.EVENT_SPACE, function () {
if (self.editor.isValid()) {
self.editor.blur();
}
});
this.editor.on(BI.SignEditor.EVENT_START, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_START);
});
this.editor.on(BI.SignEditor.EVENT_CHANGE, function () {
self.fireEvent(BI.DynamicDateTrigger.EVENT_CHANGE);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [{
el: this.editor
}, {
el: BI.createWidget(),
width: 24
}]
});
!o.allowEdit && BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.text",
title: BI.bind(this._getTitle, this)
},
left: 0,
right: 24,
top: 0,
bottom: 0
}]
});
this.setValue(o.value);
},
_getTitle: function () {
var storeValue = this.storeValue || {};
var type = storeValue.type || BI.DynamicDateCombo.Static;
var value = storeValue.value;
switch (type) {
case BI.DynamicDateCombo.Dynamic:
var text = this._getText(value);
var date = BI.getDate();
date = BI.DynamicDateHelper.getCalculation(value);
var dateStr = BI.print(date, this._getFormatString());
return BI.isEmptyString(text) ? dateStr : (text + ":" + dateStr);
case BI.DynamicDateCombo.Static:
default:
if (BI.isNull(value) || BI.isNull(value.day)) {
return "";
}
return BI.print(BI.getDate(value.year, (value.month - 1), value.day), this._getFormatString());
}
},
_getStandardDateStr: function (v) {
var c = this._const;
var result = [0, 1, 2];
var formatArray = this._getFormatString().match(/%./g);
BI.each(formatArray, function (idx, v) {
switch (v) {
case "%Y":
case "%y":
result[0] = idx;
break;
case "%X":
case "%x":
result[1] = idx;
break;
case "%d":
case "%e":
default:
result[2] = idx;
break;
}
});
// 这边不能直接用\d+去切日期, 因为format格式可能是20190607这样的没有分割符的 = =
// 先看一下是否是合法的, 如果合法就变成标准格式的走原来的流程, 不合法不关心
var date = BI.parseDateTime(v, this._getFormatString());
if(BI.print(date, this._getFormatString()) === v) {
v = BI.print(date, c.compareFormat);
result = [0, 1, 2];
}
var dateArray = v.match(/\d+/g);
var newArray = [];
BI.each(dateArray, function (idx) {
newArray[idx] = dateArray[result[idx]];
});
// 这边之所以不直接返回join结果是因为年的格式可能只有2位,所以需要format一下
if(newArray.length === result.length && newArray[0].length === 2) {
return BI.print(BI.parseDateTime(newArray.join("-"), c.compareFormat), c.compareFormat);
}
// 这边format成-20-也没关系, 反正都是不合法的
return newArray.join("-");
},
_getFormatString: function () {
return this.options.format || this._const.compareFormat;
},
_dateCheck: function (date) {
return BI.print(BI.parseDateTime(date, "%Y-%x-%d"), "%Y-%x-%d") === date ||
BI.print(BI.parseDateTime(date, "%Y-%X-%d"), "%Y-%X-%d") === date ||
BI.print(BI.parseDateTime(date, "%Y-%x-%e"), "%Y-%x-%e") === date ||
BI.print(BI.parseDateTime(date, "%Y-%X-%e"), "%Y-%X-%e") === date;
},
_checkVoid: function (obj) {
return !BI.checkDateVoid(obj.year, obj.month, obj.day, this.options.min, this.options.max)[0];
},
_autoAppend: function (v, dateObj) {
if (BI.isNotNull(dateObj) && BI.checkDateLegal(v)) {
switch (v.length) {
case this._const.yearLength:
if (this._yearCheck(v)) {
this.editor.setValue(v + "-");
}
break;
case this._const.yearMonthLength:
case this._const.yearFullMonthLength:
var splitMonth = v.split("-")[1];
if ((BI.isNotNull(splitMonth) && splitMonth.length === 2) || this._monthCheck(v)) {
this.editor.setValue(v + "-");
}
break;
}
}
},
_yearCheck: function (v) {
var date = BI.print(BI.parseDateTime(v, this._getFormatString()), this._const.compareFormat);
return BI.print(BI.parseDateTime(v, "%Y"), "%Y") === v && date >= this.options.min && date <= this.options.max;
},
_monthCheck: function (v) {
var date = BI.parseDateTime(v, this._getFormatString());
var dateStr = BI.print(date, this._const.compareFormat);
return (date.getMonth() >= 0 && (BI.print(BI.parseDateTime(v, "%Y-%X"), "%Y-%X") === v ||
BI.print(BI.parseDateTime(v, "%Y-%x"), "%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
},
_setInnerValue: function (date) {
var dateStr = BI.print(date, this._getFormatString());
this.editor.setState(dateStr);
this.editor.setValue(dateStr);
},
_getText: function (obj) {
var value = "";
var endText = "";
if(BI.isNotNull(obj.year)) {
if(BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.quarter)) {
if(BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
}
if(BI.isNotNull(obj.month)) {
if(BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
}
if(BI.isNotNull(obj.week)) {
if(BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
}
if(BI.isNotNull(obj.day)) {
if(BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
}
if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value + endText;
function getPositionText (baseText, position) {
switch (position) {
case BI.DynamicDateCard.OFFSET.BEGIN:
return baseText + BI.i18nText("BI-Basic_Begin_Start");
case BI.DynamicDateCard.OFFSET.END:
return baseText + BI.i18nText("BI-Basic_End_Stop");
case BI.DynamicDateCard.OFFSET.CURRENT:
default:
return BI.i18nText("BI-Basic_Current_Day");
}
}
},
setValue: function (v) {
var type, value, self = this;
var date = BI.getDate();
this.storeValue = v;
if (BI.isNotNull(v)) {
type = v.type || BI.DynamicDateCombo.Static;
value = v.value || v;
}
switch (type) {
case BI.DynamicDateCombo.Dynamic:
var text = this._getText(value);
date = BI.DynamicDateHelper.getCalculation(value);
this._setInnerValue(date, text);
break;
case BI.DynamicDateCombo.Static:
default:
if (BI.isNull(value) || BI.isNull(value.day)) {
this.editor.setState("");
this.editor.setValue("");
} else {
var dateStr = BI.print(BI.getDate(value.year, (value.month - 1), value.day), this._getFormatString());
this.editor.setState(dateStr);
this.editor.setValue(dateStr);
}
break;
}
},
setMinDate: function (minDate) {
if (BI.isNotEmptyString(this.options.min)) {
this.options.min = minDate;
}
},
setMaxDate: function (maxDate) {
if (BI.isNotEmptyString(this.options.max)) {
this.options.max = maxDate;
}
},
getKey: function () {
return this.editor.getValue();
},
getValue: function () {
return this.storeValue;
}
});
BI.DynamicDateTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTrigger.EVENT_STOP = "EVENT_STOP";
BI.DynamicDateTrigger.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTrigger.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTrigger.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK = "EVENT_TRIGGER_CLICK";
BI.DynamicDateTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.shortcut("bi.dynamic_date_trigger", BI.DynamicDateTrigger);
/***/ }),
/* 541 */
/***/ (function(module, exports) {
BI.DynamicDateTimeCombo = BI.inherit(BI.Single, {
constants: {
popupHeight: 259,
popupWidth: 270,
comboAdjustHeight: 1,
border: 1
},
props: {
baseCls: "bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",
height: 22,
minDate: "1900-01-01",
maxDate: "2099-12-31",
format: "",
allowEdit: true
},
render: function () {
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = BI.getDate();
this.storeValue = opts.value;
return {
type: "bi.htape",
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: opts.height,
height: opts.height,
ref: function () {
self.changeIcon = this;
}
},
width: opts.height
}, {
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
destroyWhenHide: true,
container: opts.container,
ref: function () {
self.combo = this;
},
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: {
type: "bi.dynamic_date_time_trigger",
min: opts.minDate,
max: opts.maxDate,
allowEdit: opts.allowEdit,
watermark: opts.watermark,
format: opts.format,
height: opts.height,
value: opts.value,
ref: function () {
self.trigger = this;
},
listeners: [{
eventName: BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,
action: function () {
if (self.combo.isViewVisible()) {
self.combo.hideView();
}
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_KEY_DOWN, arguments);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_STOP,
action: function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK,
action: function () {
self.combo.toggle();
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_FOCUS,
action: function () {
self.storeTriggerValue = self.trigger.getKey();
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_ERROR,
action: function () {
self.storeValue = {
type: BI.DynamicDateTimeCombo.Static,
value: {
year: date.getFullYear(),
month: date.getMonth() + 1
}
};
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_ERROR);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_VALID,
action: function () {
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_VALID);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CHANGE);
}
}, {
eventName: BI.DynamicDateTimeTrigger.EVENT_CONFIRM,
action: function () {
if (self.combo.isViewVisible()) {
return;
}
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
} else if (BI.isEmptyString(dateObj)) {
self.storeValue = null;
self.trigger.setValue();
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM);
}
}]
},
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: {
type: "bi.dynamic_date_time_popup",
behaviors: opts.behaviors,
min: opts.minDate,
max: opts.maxDate,
ref: function () {
self.popup = this;
},
listeners: [{
eventName: BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.combo.hideView();
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () {
var date = BI.getDate();
self.setValue({
type: BI.DynamicDateTimeCombo.Static,
value: {
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate(),
hour: 0,
minute: 0,
second: 0
}
});
self.combo.hideView();
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
var value = self.popup.getValue();
if(self._checkValue(value)) {
self.setValue(value);
}
self.combo.hideView();
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicDateTimePopup.EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM);
}
}]
},
stopPropagation: false
},
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.setValue(self.storeValue);
self.popup.setMinDate(opts.minDate);
self.popup.setMaxDate(opts.maxDate);
self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW);
}
}],
// DEC-4250 和复选下拉一样,点击不收起
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
}
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-font",
width: opts.height,
height: opts.height,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
if (self.combo.isViewVisible()) {
// self.combo.hideView();
} else {
self.combo.showView();
}
}
}],
ref: function () {
self.triggerBtn = this;
}
},
top: 0,
right: 0
}]
}],
ref: function (_ref) {
self.comboWrapper = _ref;
}
};
},
mounted: function () {
this._checkDynamicValue(this.storeValue);
},
_checkDynamicValue: function (v) {
var o = this.options;
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicDateTimeCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = o.height;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
_checkValue: function (v) {
switch (v.type) {
case BI.DynamicDateCombo.Dynamic:
return BI.isNotEmptyObject(v.value);
case BI.DynamicDateCombo.Static:
default:
return true;
}
},
setMinDate: function (minDate) {
var o = this.options;
o.minDate = minDate;
this.trigger.setMinDate(minDate);
this.popup && this.popup.setMinDate(minDate);
},
setMaxDate: function (maxDate) {
var o = this.options;
o.maxDate = maxDate;
this.trigger.setMaxDate(maxDate);
this.popup && this.popup.setMaxDate(maxDate);
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {
return this.storeValue;
},
getKey: function () {
return this.trigger.getKey();
},
hidePopupView: function () {
this.combo.hideView();
},
isValid: function () {
return this.trigger.isValid();
}
});
BI.DynamicDateTimeCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicDateTimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateTimeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimeCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTimeCombo.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.dynamic_date_time_combo", BI.DynamicDateTimeCombo);
BI.extend(BI.DynamicDateTimeCombo, {
Static: 1,
Dynamic: 2
});
/***/ }),
/* 542 */
/***/ (function(module, exports) {
BI.DynamicDateTimePopup = BI.inherit(BI.Widget, {
constants: {
tabHeight: 30,
buttonHeight: 24
},
props: {
baseCls: "bi-dynamic-date-time-popup",
width: 248,
height: 385
},
_init: function () {
BI.DynamicDateTimePopup.superclass._init.apply(this, arguments);
var self = this, opts = this.options, c = this.constants;
this.storeValue = {type: BI.DynamicDateCombo.Static};
BI.createWidget({
element: this,
type: "bi.vtape",
items: [{
el: this._getTabJson()
}, {
el: {
type: "bi.grid",
items: [[{
type: "bi.text_button",
cls: "bi-high-light bi-split-top",
textHeight: c.buttonHeight - 1,
shadow: true,
text: BI.i18nText("BI-Basic_Clear"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
textHeight: c.buttonHeight - 1,
shadow: true,
text: BI.i18nText("BI-Multi_Date_Today"),
ref: function () {
self.textButton = this;
},
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
cls: "bi-high-light bi-split-top",
textHeight: c.buttonHeight - 1,
shadow: true,
text: BI.i18nText("BI-Basic_OK"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]
});
this.setValue(opts.value);
},
_getTabJson: function () {
var self = this, o = this.options;
return {
type: "bi.tab",
ref: function () {
self.dateTab = this;
},
tab: {
type: "bi.linear_segment",
cls: "bi-split-bottom",
height: this.constants.tabHeight,
items: BI.createItems([{
text: BI.i18nText("BI-Multi_Date_YMD"),
value: BI.DynamicDateCombo.Static
}, {
text: BI.i18nText("BI-Basic_Dynamic_Title"),
value: BI.DynamicDateCombo.Dynamic
}], {
textAlign: "center"
})
},
cardCreator: function (v) {
switch (v) {
case BI.DynamicDateCombo.Dynamic:
return {
type: "bi.dynamic_date_card",
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self._setInnerValue(self.year, v);
}
}],
ref: function () {
self.dynamicPane = this;
}
};
case BI.DynamicDateCombo.Static:
default:
return {
type: "bi.vtape",
items: [{
type: "bi.date_calendar_popup",
behaviors: o.behaviors,
min: self.options.min,
max: self.options.max,
ref: function () {
self.ymd = this;
}
}, {
el: {
type: "bi.dynamic_date_time_select",
cls: "bi-split-top",
ref: function () {
self.timeSelect = this;
}
},
height: 40
}]
};
}
},
listeners: [{
eventName: BI.Tab.EVENT_CHANGE,
action: function () {
var v = self.dateTab.getSelect();
switch (v) {
case BI.DynamicDateCombo.Static:
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate()
});
self.timeSelect.setValue();
self._setInnerValue();
break;
case BI.DynamicDateCombo.Dynamic:
default:
if(self.storeValue && self.storeValue.type === BI.DynamicDateCombo.Dynamic) {
self.dynamicPane.setValue(self.storeValue.value);
}else{
self.dynamicPane.setValue({
year: 0
});
}
self._setInnerValue();
break;
}
}
}]
};
},
_setInnerValue: function () {
if (this.dateTab.getSelect() === BI.DynamicDateCombo.Static) {
this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));
this.textButton.setEnable(true);
} else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());
date = BI.print(date, "%Y-%X-%d");
this.textButton.setValue(date);
this.textButton.setEnable(false);
}
},
_checkValueValid: function (value) {
return BI.isNull(value) || BI.isEmptyObject(value) || BI.isEmptyString(value);
},
setMinDate: function (minDate) {
if (this.options.min !== minDate) {
this.options.min = minDate;
this.ymd.setMinDate(minDate);
}
},
setMaxDate: function (maxDate) {
if (this.options.max !== maxDate) {
this.options.max = maxDate;
this.ymd.setMaxDate(maxDate);
}
},
setValue: function (v) {
this.storeValue = v;
var self = this;
var type, value;
v = v || {};
type = v.type || BI.DynamicDateCombo.Static;
value = v.value || v;
this.dateTab.setSelect(type);
switch (type) {
case BI.DynamicDateCombo.Dynamic:
this.dynamicPane.setValue(value);
self._setInnerValue();
break;
case BI.DynamicDateCombo.Static:
default:
if (this._checkValueValid(value)) {
var date = BI.getDate();
this.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth() + 1,
day: date.getDate()
});
this.timeSelect.setValue();
this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));
} else {
this.ymd.setValue(value);
this.timeSelect.setValue({
hour: value.hour,
minute: value.minute,
second: value.second
});
this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));
}
this.textButton.setEnable(true);
break;
}
},
getValue: function () {
var type = this.dateTab.getSelect();
return {
type: type,
value: type === BI.DynamicDateTimeCombo.Static ? BI.extend(this.ymd.getValue(), this.timeSelect.getValue()) : this.dynamicPane.getValue()
};
}
});
BI.DynamicDateTimePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE = "BUTTON_lABEL_EVENT_CHANGE";
BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.shortcut("bi.dynamic_date_time_popup", BI.DynamicDateTimePopup);
/***/ }),
/* 543 */
/***/ (function(module, exports) {
BI.DynamicDateTimeSelect = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-date-time-select"
},
render: function () {
var self = this;
return {
type: "bi.center_adapt",
items: [{
type: "bi.vertical_adapt",
items: [{
el: {
type: "bi.number_editor",
ref: function () {
self.hour = this;
},
validationChecker: function (v) {
return BI.isNaturalNumber(v) && BI.parseInt(v) < 24;
},
errorText: function (v) {
if(BI.isNumeric(v)) {
return BI.i18nText("BI-Basic_Input_From_To_Number", "\"00-23\"");
}
return BI.i18nText("BI-Numerical_Interval_Input_Data");
},
listeners: [{
eventName: BI.SignEditor.EVENT_CONFIRM,
action: function () {
var value = this.getValue();
self._checkHour(value);
this.setValue(self._formatValueToDoubleDigit(value));
self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM);
}
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.HOUR);
this.setValue(value);
}
}],
width: 60,
height: 24
}
}, {
type: "bi.label",
text: ":",
width: 20
}, {
type: "bi.number_editor",
ref: function () {
self.minute = this;
},
validationChecker: function (v) {
return BI.isNaturalNumber(v) && BI.parseInt(v) < 60;
},
errorText: function (v) {
if(BI.isNumeric(v)) {
return BI.i18nText("BI-Basic_Input_From_To_Number", "\"00-59\"");
}
return BI.i18nText("BI-Numerical_Interval_Input_Data");
},
listeners: [{
eventName: BI.SignEditor.EVENT_CONFIRM,
action: function () {
var value = this.getValue();
self._checkMinute(value);
this.setValue(self._formatValueToDoubleDigit(value), BI.DynamicDateTimeSelect.MINUTE);
self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM);
}
}, {
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
var value = self._autoSwitch(this.getValue(), BI.DynamicDateTimeSelect.MINUTE);
this.setValue(value);
}
}],
width: 60,
height: 24
}, {
type: "bi.label",
text: ":",
width: 20
}, {
type: "bi.number_editor",
ref: function () {
self.second = this;
},
validationChecker: function (v) {
return BI.isNaturalNumber(v) && BI.parseInt(v) < 60;
},
errorText: function (v) {
if(BI.isNumeric(v)) {
return BI.i18nText("BI-Basic_Input_From_To_Number", "\"00-59\"");
}
return BI.i18nText("BI-Numerical_Interval_Input_Data");
},
listeners: [{
eventName: BI.SignEditor.EVENT_CONFIRM,
action: function () {
var value = this.getValue();
self._checkSecond(value);
this.setValue(self._formatValueToDoubleDigit(value));
self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM);
}
}],
width: 60,
height: 24
}]
}]
};
},
_checkBorder: function (v) {
v = v || {};
this._checkHour(v.hour);
this._checkMinute(v.minute);
this._checkSecond(v.second);
},
_checkHour: function (value) {
this.hour.setDownEnable(BI.parseInt(value) > 0);
this.hour.setUpEnable(BI.parseInt(value) < 23);
},
_checkMinute: function (value) {
this.minute.setDownEnable(BI.parseInt(value) > 0);
this.minute.setUpEnable(BI.parseInt(value) < 59);
},
_checkSecond: function (value) {
this.second.setDownEnable(BI.parseInt(value) > 0);
this.second.setUpEnable(BI.parseInt(value) < 59);
},
_autoSwitch: function (v, type) {
var limit = 0;
var value = v + "";
switch (type) {
case BI.DynamicDateTimeSelect.HOUR:
limit = 2;
break;
case BI.DynamicDateTimeSelect.MINUTE:
limit = 5;
break;
default:
break;
}
if(value.length === 1 && BI.parseInt(value) > limit) {
value = "0" + value;
}
if (value.length === 2) {
switch (type) {
case BI.DynamicDateTimeSelect.HOUR:
this.hour.isEditing() && this.minute.focus();
break;
case BI.DynamicDateTimeSelect.MINUTE:
this.minute.isEditing() && this.second.focus();
break;
case BI.DynamicDateTimeSelect.SECOND:
default:
break;
}
}
return value;
},
_formatValueToDoubleDigit: function (v) {
if(BI.isNull(v) || BI.isEmptyString(v)) {
v = 0;
}
var value = BI.parseInt(v);
if(value < 10) {
value = "0" + value;
}
return value;
},
_assertValue: function (v) {
v = v || {};
v.hour = this._formatValueToDoubleDigit(v.hour) || "00";
v.minute = this._formatValueToDoubleDigit(v.minute) || "00";
v.second = this._formatValueToDoubleDigit(v.second) || "00";
return v;
},
getValue: function () {
return {
hour: BI.parseInt(this.hour.getValue()),
minute: BI.parseInt(this.minute.getValue()),
second: BI.parseInt(this.second.getValue())
};
},
setValue: function (v) {
v = this._assertValue(v);
this.hour.setValue(v.hour);
this.minute.setValue(v.minute);
this.second.setValue(v.second);
this._checkBorder(v);
}
});
BI.DynamicDateTimeSelect.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.dynamic_date_time_select", BI.DynamicDateTimeSelect);
BI.extend(BI.DynamicDateTimeSelect, {
HOUR: 1,
MINUTE: 2,
SECOND: 3
});
/***/ }),
/* 544 */
/***/ (function(module, exports) {
BI.DynamicDateTimeTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2,
yearLength: 4,
yearMonthLength: 6,
yearFullMonthLength: 7,
compareFormat: "%Y-%X-%d %H:%M:%S"
},
props: {
extraCls: "bi-date-time-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 24,
format: "", // 显示的日期格式化方式
allowEdit: true, // 是否允许编辑
watermark: ""
},
_init: function () {
BI.DynamicDateTimeTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options, c = this._const;
this.storeTriggerValue = "";
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
var formatStr = self._getStandardDateStr(v);
var date = formatStr.match(/\d+/g);
!BI.isKey(o.format) && self._autoAppend(v, date);
return self._dateCheck(formatStr) && BI.checkDateLegal(formatStr) && self._checkVoid({
year: date[0] | 0,
month: date[1] | 0,
day: date[2] | 0
});
},
quitChecker: function () {
return false;
},
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true,
watermark: BI.isKey(o.watermark) ? o.watermark : BI.i18nText("BI-Basic_Unrestricted"),
errorText: function () {
var str = "";
if (!BI.isKey(o.format)) {
str = self.editor.isEditing() ? BI.i18nText("BI-Basic_Date_Time_Error_Text") : BI.i18nText("BI-Year_Trigger_Invalid_Text");
}
return str;
},
title: BI.bind(this._getTitle, this)
});
this.editor.on(BI.SignEditor.EVENT_KEY_DOWN, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN, arguments);
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.storeTriggerValue = self.getKey();
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_BLUR, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP);
});
this.editor.on(BI.SignEditor.EVENT_VALID, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_VALID);
});
this.editor.on(BI.SignEditor.EVENT_ERROR, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_ERROR);
});
this.editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
var value = self.editor.getValue();
if (BI.isNotNull(value)) {
self.editor.setState(value);
}
if (BI.isNotEmptyString(value) && !BI.isEqual(self.storeTriggerValue, self.getKey())) {
var formatStr = self._getStandardDateStr(value);
var date = formatStr.match(/\d+/g);
self.storeValue = {
type: BI.DynamicDateCombo.Static,
value: {
year: date[0] | 0,
month: date[1] | 0,
day: date[2] | 0,
hour: date[3] | 0,
minute: date[4] | 0,
second: date[5] | 0
}
};
}
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CONFIRM);
});
this.editor.on(BI.SignEditor.EVENT_START, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_START);
});
this.editor.on(BI.SignEditor.EVENT_CHANGE, function () {
self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CHANGE);
});
BI.createWidget({
type: "bi.htape",
element: this,
items: [{
el: this.editor
}, {
el: BI.createWidget(),
width: 24
}]
});
!o.allowEdit && BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.text",
title: BI.bind(this._getTitle, this)
},
left: 0,
right: 24,
top: 0,
bottom: 0
}]
});
this.setValue(o.value);
},
_getTitle: function () {
var storeValue = this.storeValue || {};
var type = storeValue.type || BI.DynamicDateCombo.Static;
var value = storeValue.value;
switch (type) {
case BI.DynamicDateCombo.Dynamic:
var text = this._getText(value);
var date = BI.DynamicDateHelper.getCalculation(value);
var dateStr = BI.print(date, this._getFormatString());
return BI.isEmptyString(text) ? dateStr : (text + ":" + dateStr);
case BI.DynamicDateCombo.Static:
default:
if (BI.isNull(value) || BI.isNull(value.day)) {
return "";
}
return BI.print(BI.getDate(value.year, (value.month - 1), value.day, value.hour || 0, value.minute || 0,
value.second || 0), this._getFormatString());
}
},
_getStandardDateStr: function (v) {
var c = this._const;
var result = [];
var hasSecond = false;
var formatArray = this._getFormatString().match(/%./g);
BI.each(formatArray, function (idx, v) {
switch (v) {
case "%Y":
case "%y":
result[0] = idx;
break;
case "%X":
case "%x":
result[1] = idx;
break;
case "%d":
case "%e":
result[2] = idx;
break;
case "%S":
hasSecond = true;
break;
default:
break;
}
});
// 这边不能直接用\d+去切日期, 因为format格式可能是20190607这样的没有分割符的 = =
// 先看一下是否是合法的, 如果合法就变成标准格式的走原来的流程, 不合法不关心
var date = BI.parseDateTime(v, this._getFormatString());
if(BI.print(date, this._getFormatString()) === v) {
v = BI.print(date, c.compareFormat);
result = [0, 1, 2];
}
var dateArray = v.match(/\d+/g) || [];
var newArray = [];
// 处理乱序的年月日
BI.each(dateArray.slice(0, 3), function (idx) {
newArray[idx] = dateArray[result[idx]];
});
// 拼接时分秒和pm
var suffixArray = dateArray.slice(3);
// 时分秒补0
BI.each(suffixArray, function (idx, v) {
BI.isNumeric(v) && v.length === 1 && (suffixArray[idx] = "0" + v);
});
// hh:mm
if(suffixArray.length === 2 && !hasSecond) {
suffixArray.push("00");
}
var suffixString = suffixArray.join(":");
var dateString = newArray.slice(0, 3).join("-");
if (BI.isNotEmptyString(suffixString)) {
dateString += " " + suffixString;
}
return dateString;
},
_getFormatString: function () {
return this.options.format || this._const.compareFormat;
},
_dateCheck: function (date) {
return BI.print(BI.parseDateTime(date, "%Y-%x-%d %H:%M:%S"), "%Y-%x-%d %H:%M:%S") === date ||
BI.print(BI.parseDateTime(date, "%Y-%X-%d %H:%M:%S"), "%Y-%X-%d %H:%M:%S") === date ||
BI.print(BI.parseDateTime(date, "%Y-%x-%e %H:%M:%S"), "%Y-%x-%e %H:%M:%S") === date ||
BI.print(BI.parseDateTime(date, "%Y-%X-%e %H:%M:%S"), "%Y-%X-%e %H:%M:%S") === date ||
BI.print(BI.parseDateTime(date, "%Y-%x-%d"), "%Y-%x-%d") === date ||
BI.print(BI.parseDateTime(date, "%Y-%X-%d"), "%Y-%X-%d") === date ||
BI.print(BI.parseDateTime(date, "%Y-%x-%e"), "%Y-%x-%e") === date ||
BI.print(BI.parseDateTime(date, "%Y-%X-%e"), "%Y-%X-%e") === date;
},
_checkVoid: function (obj) {
return !BI.checkDateVoid(obj.year, obj.month, obj.day, this.options.min, this.options.max)[0];
},
_autoAppend: function (v, dateObj) {
if (BI.isNotNull(dateObj) && BI.checkDateLegal(v)) {
switch (v.length) {
case this._const.yearLength:
if (this._yearCheck(v)) {
this.editor.setValue(v + "-");
}
break;
case this._const.yearMonthLength:
case this._const.yearFullMonthLength:
var splitMonth = v.split("-")[1];
if ((BI.isNotNull(splitMonth) && splitMonth.length === 2) || this._monthCheck(v)) {
this.editor.setValue(v + "-");
}
break;
}
}
},
_yearCheck: function (v) {
var date = BI.print(BI.parseDateTime(v, "%Y-%X-%d"), "%Y-%X-%d");
return BI.print(BI.parseDateTime(v, "%Y"), "%Y") === v && date >= this.options.min && date <= this.options.max;
},
_monthCheck: function (v) {
var date = BI.parseDateTime(v, "%Y-%X-%d");
var dateStr = BI.print(date, "%Y-%X-%d");
return (date.getMonth() > 0 && (BI.print(BI.parseDateTime(v, "%Y-%X"), "%Y-%X") === v ||
BI.print(BI.parseDateTime(v, "%Y-%x"), "%Y-%x") === v)) && dateStr >= this.options.min && dateStr <= this.options.max;
},
_setInnerValue: function (date) {
var dateStr = BI.print(date, this._getFormatString());
this.editor.setState(dateStr);
this.editor.setValue(dateStr);
},
_getText: function (obj) {
var value = "";
var endText = "";
if(BI.isNotNull(obj.year)) {
if(BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.quarter)) {
if(BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
}
if(BI.isNotNull(obj.month)) {
if(BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
}
if(BI.isNotNull(obj.week)) {
if(BI.parseInt(obj.week) !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
}
if(BI.isNotNull(obj.day)) {
if(BI.parseInt(obj.day) !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
}
if(BI.isNotNull(obj.workDay) && BI.parseInt(obj.workDay) !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value + endText;
function getPositionText (baseText, position) {
switch (position) {
case BI.DynamicDateCard.OFFSET.BEGIN:
return baseText + BI.i18nText("BI-Basic_Begin_Start");
case BI.DynamicDateCard.OFFSET.END:
return baseText + BI.i18nText("BI-Basic_End_Stop");
case BI.DynamicDateCard.OFFSET.CURRENT:
default:
return BI.i18nText("BI-Basic_Current_Day");
}
}
},
setMinDate: function (minDate) {
if (BI.isNotEmptyString(this.options.min)) {
this.options.min = minDate;
}
},
setMaxDate: function (maxDate) {
if (BI.isNotEmptyString(this.options.max)) {
this.options.max = maxDate;
}
},
setValue: function (v) {
var type, value, self = this;
var date = BI.getDate();
this.storeValue = v;
if (BI.isNotNull(v)) {
type = v.type || BI.DynamicDateCombo.Static;
value = v.value || v;
}
switch (type) {
case BI.DynamicDateCombo.Dynamic:
var text = this._getText(value);
date = BI.DynamicDateHelper.getCalculation(value);
this._setInnerValue(date, text);
break;
case BI.DynamicDateCombo.Static:
default:
if (BI.isNull(value) || BI.isNull(value.day)) {
this.editor.setState("");
this.editor.setValue("");
} else {
var dateStr = BI.print(BI.getDate(value.year, (value.month - 1), value.day, value.hour || 0, value.minute || 0,
value.second || 0), this._getFormatString());
this.editor.setState(dateStr);
this.editor.setValue(dateStr);
}
break;
}
},
getKey: function () {
return this.editor.getValue();
},
getValue: function () {
return this.storeValue;
},
isValid: function () {
return this.editor.isValid();
}
});
BI.DynamicDateTimeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.DynamicDateTimeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicDateTimeTrigger.EVENT_START = "EVENT_START";
BI.DynamicDateTimeTrigger.EVENT_STOP = "EVENT_STOP";
BI.DynamicDateTimeTrigger.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicDateTimeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.DynamicDateTimeTrigger.EVENT_VALID = "EVENT_VALID";
BI.DynamicDateTimeTrigger.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK = "EVENT_TRIGGER_CLICK";
BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.shortcut("bi.dynamic_date_time_trigger", BI.DynamicDateTimeTrigger);
/***/ }),
/* 545 */
/***/ (function(module, exports) {
/**
* Created by roy on 15/9/14.
*/
BI.SearchEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SearchEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-search-editor bi-border bi-focus-shadow",
height: 24,
errorText: "",
watermark: BI.i18nText("BI-Basic_Search"),
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn
});
},
_init: function () {
this.options.height -= 2;
BI.SearchEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.editor",
height: o.height,
watermark: o.watermark,
allowBlank: true,
hgap: 1,
errorText: o.errorText,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
value: o.value
});
this.clear = BI.createWidget({
type: "bi.icon_button",
stopEvent: true,
cls: "close-font"
});
this.clear.on(BI.IconButton.EVENT_CHANGE, function () {
self.setValue("");
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.STOPEDIT);
// 从有内容到无内容的清空也是一次change
self.fireEvent(BI.SearchEditor.EVENT_CHANGE);
self.fireEvent(BI.SearchEditor.EVENT_CLEAR);
});
BI.createWidget({
element: this,
type: "bi.htape",
items: [
{
el: {
type: "bi.icon_label",
cls: "search-font"
},
width: 24
},
{
el: self.editor
},
{
el: this.clear,
width: 24
}
]
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_FOCUS, function () {
self.fireEvent(BI.SearchEditor.EVENT_FOCUS);
});
this.editor.on(BI.Editor.EVENT_BLUR, function () {
self.fireEvent(BI.SearchEditor.EVENT_BLUR);
});
this.editor.on(BI.Editor.EVENT_CLICK, function () {
self.fireEvent(BI.SearchEditor.EVENT_CLICK);
});
this.editor.on(BI.Editor.EVENT_CHANGE, function () {
self._checkClear();
self.fireEvent(BI.SearchEditor.EVENT_CHANGE);
});
this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN, v);
});
this.editor.on(BI.Editor.EVENT_SPACE, function () {
self.fireEvent(BI.SearchEditor.EVENT_SPACE);
});
this.editor.on(BI.Editor.EVENT_BACKSPACE, function () {
self.fireEvent(BI.SearchEditor.EVENT_BACKSPACE);
});
this.editor.on(BI.Editor.EVENT_VALID, function () {
self.fireEvent(BI.SearchEditor.EVENT_VALID);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self.fireEvent(BI.SearchEditor.EVENT_ERROR);
});
this.editor.on(BI.Editor.EVENT_ENTER, function () {
self.fireEvent(BI.SearchEditor.EVENT_ENTER);
});
this.editor.on(BI.Editor.EVENT_RESTRICT, function () {
self.fireEvent(BI.SearchEditor.EVENT_RESTRICT);
});
this.editor.on(BI.Editor.EVENT_EMPTY, function () {
self._checkClear();
self.fireEvent(BI.SearchEditor.EVENT_EMPTY);
});
this.editor.on(BI.Editor.EVENT_REMOVE, function () {
self.fireEvent(BI.SearchEditor.EVENT_REMOVE);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self.fireEvent(BI.SearchEditor.EVENT_CONFIRM);
});
this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM, function () {
self.fireEvent(BI.SearchEditor.EVENT_CHANGE_CONFIRM);
});
this.editor.on(BI.Editor.EVENT_START, function () {
self.fireEvent(BI.SearchEditor.EVENT_START);
});
this.editor.on(BI.Editor.EVENT_PAUSE, function () {
self.fireEvent(BI.SearchEditor.EVENT_PAUSE);
});
this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.SearchEditor.EVENT_STOP);
});
this.clear.invisible();
},
_checkClear: function () {
if (!this.getValue()) {
this.clear.invisible();
} else {
this.clear.visible();
}
},
setWaterMark: function (v) {
this.options.watermark = v;
this.editor.setWaterMark(v);
},
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.blur();
},
getValue: function () {
if (this.isValid()) {
return this.editor.getValue();
}
},
getKeywords: function () {
var val = this.editor.getLastChangedValue();
var keywords = val.match(/[\S]+/g);
if (BI.isEndWithBlank(val)) {
return keywords.concat([" "]);
}
return keywords;
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
getLastChangedValue: function () {
return this.editor.getLastChangedValue();
},
setValue: function (v) {
this.editor.setValue(v);
if (BI.isKey(v)) {
this.clear.visible();
}
},
isEditing: function () {
return this.editor.isEditing();
},
isValid: function () {
return this.editor.isValid();
}
});
BI.SearchEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.SearchEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.SearchEditor.EVENT_BLUR = "EVENT_BLUR";
BI.SearchEditor.EVENT_CLICK = "EVENT_CLICK";
BI.SearchEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.SearchEditor.EVENT_SPACE = "EVENT_SPACE";
BI.SearchEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE";
BI.SearchEditor.EVENT_CLEAR = "EVENT_CLEAR";
BI.SearchEditor.EVENT_START = "EVENT_START";
BI.SearchEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.SearchEditor.EVENT_STOP = "EVENT_STOP";
BI.SearchEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.SearchEditor.EVENT_CHANGE_CONFIRM = "EVENT_CHANGE_CONFIRM";
BI.SearchEditor.EVENT_VALID = "EVENT_VALID";
BI.SearchEditor.EVENT_ERROR = "EVENT_ERROR";
BI.SearchEditor.EVENT_ENTER = "EVENT_ENTER";
BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE";
BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.search_editor", BI.SearchEditor);
/***/ }),
/* 546 */
/***/ (function(module, exports) {
/**
* 小号搜索框
* Created by GUY on 2015/9/29.
* @class BI.SmallSearchEditor
* @extends BI.SearchEditor
*/
BI.SmallSearchEditor = BI.inherit(BI.SearchEditor, {
_defaultConfig: function () {
var conf = BI.SmallSearchEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-small-search-editor",
height: 20
});
},
_init: function () {
BI.SmallSearchEditor.superclass._init.apply(this, arguments);
}
});
BI.shortcut("bi.small_search_editor", BI.SmallSearchEditor);
/***/ }),
/* 547 */
/***/ (function(module, exports) {
/**
* guy
* @class BI.TextEditor
* @extends BI.Single
*/
BI.TextEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.TextEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-text-editor bi-border bi-focus-shadow",
hgap: 4,
vgap: 2,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0,
validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn,
allowBlank: false,
watermark: "",
errorText: "",
height: 24
});
},
_init: function () {
BI.TextEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (BI.isNumber(o.height)) {
this.element.css({height: o.height - 2});
}
if (BI.isNumber(o.width)) {
this.element.css({width: o.width - 2});
}
this.editor = BI.createWidget({
type: "bi.editor",
height: o.height - 2,
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap,
value: o.value,
title: o.title,
tipType: o.tipType,
validationChecker: o.validationChecker,
quitChecker: o.quitChecker,
allowBlank: o.allowBlank,
watermark: o.watermark,
errorText: o.errorText
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_FOCUS, function () {
self.fireEvent(BI.TextEditor.EVENT_FOCUS);
});
this.editor.on(BI.Editor.EVENT_BLUR, function () {
self.fireEvent(BI.TextEditor.EVENT_BLUR);
});
this.editor.on(BI.Editor.EVENT_CLICK, function () {
self.fireEvent(BI.TextEditor.EVENT_CLICK);
});
this.editor.on(BI.Editor.EVENT_CHANGE, function () {
self.fireEvent(BI.TextEditor.EVENT_CHANGE);
});
this.editor.on(BI.Editor.EVENT_KEY_DOWN, function (v) {
self.fireEvent(BI.TextEditor.EVENT_KEY_DOWN);
});
this.editor.on(BI.Editor.EVENT_SPACE, function (v) {
self.fireEvent(BI.TextEditor.EVENT_SPACE);
});
this.editor.on(BI.Editor.EVENT_BACKSPACE, function (v) {
self.fireEvent(BI.TextEditor.EVENT_BACKSPACE);
});
this.editor.on(BI.Editor.EVENT_VALID, function () {
self.fireEvent(BI.TextEditor.EVENT_VALID);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self.fireEvent(BI.TextEditor.EVENT_CONFIRM);
});
this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM, function () {
self.fireEvent(BI.TextEditor.EVENT_CHANGE_CONFIRM);
});
this.editor.on(BI.Editor.EVENT_REMOVE, function (v) {
self.fireEvent(BI.TextEditor.EVENT_REMOVE);
});
this.editor.on(BI.Editor.EVENT_START, function () {
self.fireEvent(BI.TextEditor.EVENT_START);
});
this.editor.on(BI.Editor.EVENT_PAUSE, function () {
self.fireEvent(BI.TextEditor.EVENT_PAUSE);
});
this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.TextEditor.EVENT_STOP);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self.fireEvent(BI.TextEditor.EVENT_ERROR, arguments);
});
this.editor.on(BI.Editor.EVENT_ENTER, function () {
self.fireEvent(BI.TextEditor.EVENT_ENTER);
});
this.editor.on(BI.Editor.EVENT_RESTRICT, function () {
self.fireEvent(BI.TextEditor.EVENT_RESTRICT);
});
this.editor.on(BI.Editor.EVENT_EMPTY, function () {
self.fireEvent(BI.TextEditor.EVENT_EMPTY);
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [this.editor]
});
},
setWaterMark: function (v) {
this.options.watermark = v;
this.editor.setWaterMark(v);
},
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.blur();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
isValid: function () {
return this.editor.isValid();
},
setValue: function (v) {
this.editor.setValue(v);
},
getValue: function () {
return this.editor.getValue();
}
});
BI.TextEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.TextEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.TextEditor.EVENT_BLUR = "EVENT_BLUR";
BI.TextEditor.EVENT_CLICK = "EVENT_CLICK";
BI.TextEditor.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.TextEditor.EVENT_SPACE = "EVENT_SPACE";
BI.TextEditor.EVENT_BACKSPACE = "EVENT_BACKSPACE";
BI.TextEditor.EVENT_START = "EVENT_START";
BI.TextEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.TextEditor.EVENT_STOP = "EVENT_STOP";
BI.TextEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TextEditor.EVENT_CHANGE_CONFIRM = "EVENT_CHANGE_CONFIRM";
BI.TextEditor.EVENT_VALID = "EVENT_VALID";
BI.TextEditor.EVENT_ERROR = "EVENT_ERROR";
BI.TextEditor.EVENT_ENTER = "EVENT_ENTER";
BI.TextEditor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.TextEditor.EVENT_REMOVE = "EVENT_REMOVE";
BI.TextEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.text_editor", BI.TextEditor);
/***/ }),
/* 548 */
/***/ (function(module, exports) {
/**
* 小号搜索框
* Created by GUY on 2015/9/29.
* @class BI.SmallTextEditor
* @extends BI.SearchEditor
*/
BI.SmallTextEditor = BI.inherit(BI.TextEditor, {
_defaultConfig: function () {
var conf = BI.SmallTextEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-small-text-editor",
height: 20
});
},
_init: function () {
BI.SmallTextEditor.superclass._init.apply(this, arguments);
}
});
BI.shortcut("bi.small_text_editor", BI.SmallTextEditor);
/***/ }),
/* 549 */
/***/ (function(module, exports) {
/**
* Created by zcf on 2016/9/26.
*/
BI.IntervalSlider = BI.inherit(BI.Single, {
_constant: {
EDITOR_WIDTH: 58,
EDITOR_R_GAP: 60,
EDITOR_HEIGHT: 30,
SLIDER_WIDTH_HALF: 15,
SLIDER_WIDTH: 30,
SLIDER_HEIGHT: 30,
TRACK_HEIGHT: 24
},
props: {
baseCls: "bi-interval-slider bi-slider-track",
digit: false,
unit: ""
},
render: function () {
var self = this;
var c = this._constant;
this.enable = false;
this.valueOne = "";
this.valueTwo = "";
this.calculation = new BI.AccurateCalculationModel();
// this.backgroundTrack = BI.createWidget({
// type: "bi.layout",
// cls: "background-track",
// height: c.TRACK_HEIGHT
// });
this.grayTrack = BI.createWidget({
type: "bi.layout",
cls: "gray-track",
height: 6
});
this.blueTrack = BI.createWidget({
type: "bi.layout",
cls: "blue-track bi-high-light-background",
height: 6
});
this.track = this._createTrackWrapper();
this.labelOne = BI.createWidget({
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: this.options.unit,
allowBlank: false,
width: c.EDITOR_WIDTH,
validationChecker: function (v) {
return self._checkValidation(v);
}
});
this.labelOne.element.hover(function () {
self.labelOne.element.removeClass("bi-border").addClass("bi-border");
}, function () {
self.labelOne.element.removeClass("bi-border");
});
this.labelOne.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueOne = self.valueOne;
var v = BI.parseFloat(this.getValue());
self.valueOne = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));// 分成1000份
self._setSliderOnePosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(oldValueOne, self.valueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
this.labelTwo = BI.createWidget({
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: this.options.unit,
allowBlank: false,
width: c.EDITOR_WIDTH,
validationChecker: function (v) {
return self._checkValidation(v);
}
});
this.labelTwo.element.hover(function () {
self.labelTwo.element.removeClass("bi-border").addClass("bi-border");
}, function () {
self.labelTwo.element.removeClass("bi-border");
});
this.labelTwo.on(BI.Editor.EVENT_CONFIRM, function () {
var oldValueTwo = self.valueTwo;
var v = BI.parseFloat(this.getValue());
self.valueTwo = v;
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setSliderTwoPosition(significantPercent);
self._setBlueTrack();
self._checkLabelPosition(self.valueOne, oldValueTwo, self.valueOne, self.valueTwo);
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
});
this.sliderOne = BI.createWidget({
type: "bi.single_slider_button"
});
this.sliderTwo = BI.createWidget({
type: "bi.single_slider_button"
});
this._draggable(this.sliderOne, true);
this._draggable(this.sliderTwo, false);
this._setVisible(false);
return {
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [{
el: this.track,
width: "100%",
height: c.TRACK_HEIGHT
}]
}],
hgap: 7,
height: c.TRACK_HEIGHT
},
top: 23,
left: 0,
width: "100%"
},
this._createLabelWrapper(),
this._createSliderWrapper()
]
};
},
_rePosBySizeAfterMove: function (size, isLeft) {
var o = this.options;
var percent = size * 100 / (this._getGrayTrackLength());
var significantPercent = BI.parseFloat(percent.toFixed(1));
var v = this._getValueByPercent(significantPercent);
v = this._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
var oldValueOne = this.valueOne, oldValueTwo = this.valueTwo;
if(isLeft) {
this._setSliderOnePosition(significantPercent);
this.labelOne.setValue(v);
this.valueOne = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, v, this.valueTwo);
}else{
this._setSliderTwoPosition(significantPercent);
this.labelTwo.setValue(v);
this.valueTwo = v;
this._checkLabelPosition(oldValueOne, oldValueTwo, this.valueOne, v);
}
this._setBlueTrack();
},
_rePosBySizeAfterStop: function (size, isLeft) {
var percent = size * 100 / (this._getGrayTrackLength());
var significantPercent = BI.parseFloat(percent.toFixed(1));
isLeft ? this._setSliderOnePosition(significantPercent) : this._setSliderTwoPosition(significantPercent);
},
_draggable: function (widget, isLeft) {
var self = this, o = this.options;
var startDrag = false;
var size = 0, offset = 0, defaultSize = 0;
var mouseMoveTracker = new BI.MouseMoveTracker(function (deltaX) {
if (mouseMoveTracker.isDragging()) {
startDrag = true;
offset += deltaX;
size = optimizeSize(defaultSize + offset);
widget.element.addClass("dragging");
self._rePosBySizeAfterMove(size, isLeft);
}
}, function () {
if (startDrag === true) {
size = optimizeSize(size);
self._rePosBySizeAfterStop(size, isLeft);
size = 0;
offset = 0;
defaultSize = size;
startDrag = false;
}
widget.element.removeClass("dragging");
mouseMoveTracker.releaseMouseMoves();
self.fireEvent(BI.IntervalSlider.EVENT_CHANGE);
}, window);
widget.element.on("mousedown", function (event) {
if(!widget.isEnabled()) {
return;
}
defaultSize = this.offsetLeft;
optimizeSize(defaultSize);
mouseMoveTracker.captureMouseMoves(event);
});
function optimizeSize (s) {
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
_createLabelWrapper: function () {
var c = this._constant;
return {
el: {
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [{
el: this.labelOne,
top: 0,
left: "0%"
}]
}, {
type: "bi.absolute",
items: [{
el: this.labelTwo,
top: 0,
left: "100%"
}]
}],
rgap: c.EDITOR_R_GAP,
height: c.SLIDER_HEIGHT
},
top: 0,
left: 0,
width: "100%"
};
},
_createSliderWrapper: function () {
var c = this._constant;
return {
el: {
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [{
el: this.sliderOne,
top: 0,
left: "0%"
}]
}, {
type: "bi.absolute",
items: [{
el: this.sliderTwo,
top: 0,
left: "100%"
}]
}],
hgap: c.SLIDER_WIDTH_HALF,
height: c.SLIDER_HEIGHT
},
top: 20,
left: 0,
width: "100%"
};
},
_createTrackWrapper: function () {
return BI.createWidget({
type: "bi.absolute",
items: [{
el: {
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [{
el: this.grayTrack,
top: 0,
left: 0,
width: "100%"
}, {
el: this.blueTrack,
top: 0,
left: 0,
width: "0%"
}]
}],
hgap: 8,
height: 8
},
top: 8,
left: 0,
width: "100%"
}]
});
},
_checkValidation: function (v) {
var o = this.options;
var valid = false;
// 像90.这样的既不属于整数又不属于小数,是不合法的值
var dotText = (v + "").split(".")[1];
if (BI.isEmptyString(dotText)) {
}else{
if (BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max)) {
// 虽然规定了所填写的小数位数,但是我们认为所有的整数都是满足设置的小数位数的
// 100等价于100.0 100.00 100.000
if(o.digit === false || BI.isInteger(v)) {
valid = true;
}else{
dotText = dotText || "";
valid = (dotText.length === o.digit);
}
}
}
return valid;
},
_checkOverlap: function () {
var labelOneLeft = this.labelOne.element[0].offsetLeft;
var labelTwoLeft = this.labelTwo.element[0].offsetLeft;
if (labelOneLeft <= labelTwoLeft) {
if ((labelTwoLeft - labelOneLeft) < 90) {
this.labelTwo.element.css({top: 40});
} else {
this.labelTwo.element.css({top: 0});
}
} else {
if ((labelOneLeft - labelTwoLeft) < 90) {
this.labelTwo.element.css({top: 40});
} else {
this.labelTwo.element.css({top: 0});
}
}
},
_checkLabelPosition: function (oldValueOne, oldValueTwo, valueOne, valueTwo, isLeft) {
oldValueOne = BI.parseFloat(oldValueOne);
oldValueTwo = BI.parseFloat(oldValueTwo);
valueOne = BI.parseFloat(valueOne);
valueTwo = BI.parseFloat(valueTwo);
if((oldValueOne <= oldValueTwo && valueOne > valueTwo) || (oldValueOne >= oldValueTwo && valueOne < valueTwo)) {
var isSliderOneLeft = BI.parseFloat(this.sliderOne.element[0].style.left) < BI.parseFloat(this.sliderTwo.element[0].style.left);
this._resetLabelPosition(!isSliderOneLeft);
}
},
_resetLabelPosition: function(needReverse) {
this.labelOne.element.css({left: needReverse ? "100%" : "0%"});
this.labelTwo.element.css({left: needReverse ? "0%" : "100%"});
},
_setSliderOnePosition: function (percent) {
this.sliderOne.element.css({left: percent + "%"});
},
_setSliderTwoPosition: function (percent) {
this.sliderTwo.element.css({left: percent + "%"});
},
_setBlueTrackLeft: function (percent) {
this.blueTrack.element.css({left: percent + "%"});
},
_setBlueTrackWidth: function (percent) {
this.blueTrack.element.css({width: percent + "%"});
},
_setBlueTrack: function () {
var percentOne = this._getPercentByValue(this.labelOne.getValue());
var percentTwo = this._getPercentByValue(this.labelTwo.getValue());
if (percentOne <= percentTwo) {
this._setBlueTrackLeft(percentOne);
this._setBlueTrackWidth(percentTwo - percentOne);
} else {
this._setBlueTrackLeft(percentTwo);
this._setBlueTrackWidth(percentOne - percentTwo);
}
},
_setAllPosition: function (one, two) {
this._setSliderOnePosition(one);
this._setSliderTwoPosition(two);
this._setBlueTrack();
},
_setVisible: function (visible) {
this.sliderOne.setVisible(visible);
this.sliderTwo.setVisible(visible);
this.labelOne.setVisible(visible);
this.labelTwo.setVisible(visible);
},
_setErrorText: function () {
var errorText = BI.i18nText("BI-Basic_Please_Enter_Number_Between", this.min, this.max);
this.labelOne.setErrorText(errorText);
this.labelTwo.setErrorText(errorText);
},
_getGrayTrackLength: function () {
return this.grayTrack.element[0].scrollWidth;
},
// 其中取max-min后保留4为有效数字后的值的小数位数为最终value的精度
// 端点处的值有可能因为min,max相差量级很大(precision很大)而丢失精度,此时直接返回端点值即可
_getValueByPercent: function (percent) {// return (((max-min)*percent)/100+min)
if (percent === 0) {
return this.min;
}
if (percent === 100) {
return this.max;
}
var sub = this.calculation.accurateSubtraction(this.max, this.min);
var mul = this.calculation.accurateMultiplication(sub, percent);
var div = this.calculation.accurateDivisionTenExponent(mul, 2);
if(this.precision < 0) {
var value = BI.parseFloat(this.calculation.accurateAddition(div, this.min));
var reduceValue = Math.round(this.calculation.accurateDivisionTenExponent(value, -this.precision));
return this.calculation.accurateMultiplication(reduceValue, Math.pow(10, -this.precision));
}
return BI.parseFloat(this.calculation.accurateAddition(div, this.min).toFixed(this.precision));
},
_getPercentByValue: function (v) {
return (v - this.min) * 100 / (this.max - this.min);
},
_setDraggableEnable: function (enable) {
this.sliderOne.setEnable(enable);
this.sliderTwo.setEnable(enable);
},
_getPrecision: function () {
// 计算每一份值的精度(最大值和最小值的差值保留4为有效数字后的精度)
// 如果差值的整数位数大于4,toPrecision(4)得到的是科学计数法123456 => 1.235e+5
// 返回非负值: 保留的小数位数
// 返回负值: 保留的10^n精度中的n
var sub = this.calculation.accurateSubtraction(this.max, this.min);
var pre = sub.toPrecision(4);
// 科学计数法
var eIndex = pre.indexOf("e");
var arr = [];
if(eIndex > -1) {
arr = pre.split("e");
var decimalPartLength = BI.size(arr[0].split(".")[1]);
var sciencePartLength = BI.parseInt(arr[1].substring(1));
return decimalPartLength - sciencePartLength;
}
arr = pre.split(".");
return arr.length > 1 ? arr[1].length : 0;
},
_assertValue: function (value) {
if(value <= this.min) {
return this.min;
}
if(value >= this.max) {
return this.max;
}
return value;
},
_setEnable: function (b) {
BI.IntervalSlider.superclass._setEnable.apply(this, [b]);
if(b) {
this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track");
} else {
this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track");
}
},
getValue: function () {
if (this.valueOne <= this.valueTwo) {
return {min: this.valueOne, max: this.valueTwo};
}
return {min: this.valueTwo, max: this.valueOne};
},
setMinAndMax: function (v) {
var minNumber = BI.parseFloat(v.min);
var maxNumber = BI.parseFloat(v.max);
if ((!isNaN(minNumber)) && (!isNaN(maxNumber)) && (maxNumber >= minNumber )) {
this.min = minNumber;
this.max = maxNumber;
this.valueOne = minNumber;
this.valueTwo = maxNumber;
this.precision = this._getPrecision();
this._setDraggableEnable(true);
}
if (maxNumber === minNumber) {
this._setDraggableEnable(false);
}
},
setValue: function (v) {
var o = this.options;
var valueOne = BI.parseFloat(v.min);
var valueTwo = BI.parseFloat(v.max);
valueOne = o.digit === false ? valueOne : BI.parseFloat(valueOne.toFixed(o.digit));
valueTwo = o.digit === false ? valueTwo : BI.parseFloat(valueTwo.toFixed(o.digit));
if (!isNaN(valueOne) && !isNaN(valueTwo)) {
if (this._checkValidation(valueOne)) {
this.valueOne = (this.valueOne <= this.valueTwo ? valueOne : valueTwo);
}
if (this._checkValidation(valueTwo)) {
this.valueTwo = (this.valueOne <= this.valueTwo ? valueTwo : valueOne);
}
if (valueOne < this.min) {
this.valueOne = this.min;
}
if (valueTwo > this.max) {
this.valueTwo = this.max;
}
}
},
reset: function () {
this._setVisible(false);
this.enable = false;
this.valueOne = "";
this.valueTwo = "";
this.min = NaN;
this.max = NaN;
this._setBlueTrackWidth(0);
},
populate: function () {
var o = this.options;
if (!isNaN(this.min) && !isNaN(this.max)) {
this.enable = true;
this._setVisible(true);
this._setErrorText();
if ((BI.isNumeric(this.valueOne) || BI.isNotEmptyString(this.valueOne)) && (BI.isNumeric(this.valueTwo) || BI.isNotEmptyString(this.valueTwo))) {
this.labelOne.setValue(o.digit === false ? this.valueOne : BI.parseFloat(this.valueOne).toFixed(o.digit));
this.labelTwo.setValue(o.digit === false ? this.valueTwo : BI.parseFloat(this.valueTwo).toFixed(o.digit));
this._setAllPosition(this._getPercentByValue(this.valueOne), this._getPercentByValue(this.valueTwo));
} else {
this.labelOne.setValue(this.min);
this.labelTwo.setValue(this.max);
this._setAllPosition(0, 100);
}
this._resetLabelPosition(this.valueOne > this.valueTwo);
}
}
});
BI.IntervalSlider.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.interval_slider", BI.IntervalSlider);
/***/ }),
/* 550 */
/***/ (function(module, exports) {
/**
* Created by zcf on 2017/3/1.
* 万恶的IEEE-754
* 使用字符串精确计算含小数加法、减法、乘法和10的指数倍除法,支持负数
*/
BI.AccurateCalculationModel = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.AccurateCalculationModel.superclass._defaultConfig.apply(this, arguments), {
baseCls: ""
});
},
_init: function () {
BI.AccurateCalculationModel.superclass._init.apply(this, arguments);
},
_getMagnitude: function (n) {
var magnitude = "1";
for (var i = 0; i < n; i++) {
magnitude += "0";
}
return BI.parseInt(magnitude);
},
_formatDecimal: function (stringNumber1, stringNumber2) {
if (stringNumber1.numDecimalLength === stringNumber2.numDecimalLength) {
return;
}
var magnitudeDiff = stringNumber1.numDecimalLength - stringNumber2.numDecimalLength;
if (magnitudeDiff > 0) {
var needAddZero = stringNumber2;
} else {
var needAddZero = stringNumber1;
magnitudeDiff = (0 - magnitudeDiff);
}
for (var i = 0; i < magnitudeDiff; i++) {
if (needAddZero.numDecimal === "0" && i === 0) {
continue;
}
needAddZero.numDecimal += "0";
}
},
_stringNumberFactory: function (num) {
var strNum = num.toString();
var numStrArray = strNum.split(".");
var numInteger = numStrArray[0];
if (numStrArray.length === 1) {
var numDecimal = "0";
var numDecimalLength = 0;
} else {
var numDecimal = numStrArray[1];
var numDecimalLength = numStrArray[1].length;
}
return {
numInteger: numInteger,
numDecimal: numDecimal,
numDecimalLength: numDecimalLength
};
},
_accurateSubtraction: function (num1, num2) {// num1-num2 && num1>num2
var stringNumber1 = this._stringNumberFactory(num1);
var stringNumber2 = this._stringNumberFactory(num2);
// 整数部分计算
var integerResult = BI.parseInt(stringNumber1.numInteger) - BI.parseInt(stringNumber2.numInteger);
// 小数部分
this._formatDecimal(stringNumber1, stringNumber2);
var decimalMaxLength = getDecimalMaxLength(stringNumber1, stringNumber2);
if (BI.parseInt(stringNumber1.numDecimal) >= BI.parseInt(stringNumber2.numDecimal)) {
var decimalResultTemp = (BI.parseInt(stringNumber1.numDecimal) - BI.parseInt(stringNumber2.numDecimal)).toString();
var decimalResult = addZero(decimalResultTemp, decimalMaxLength);
} else {// 否则借位
integerResult--;
var borrow = this._getMagnitude(decimalMaxLength);
var decimalResultTemp = (borrow + BI.parseInt(stringNumber1.numDecimal) - BI.parseInt(stringNumber2.numDecimal)).toString();
var decimalResult = addZero(decimalResultTemp, decimalMaxLength);
}
var result = integerResult + "." + decimalResult;
return BI.parseFloat(result);
function getDecimalMaxLength (num1, num2) {
if (num1.numDecimal.length >= num2.numDecimal.length) {
return num1.numDecimal.length;
}
return num2.numDecimal.length;
}
function addZero (resultTemp, length) {
var diff = length - resultTemp.length;
for (var i = 0; i < diff; i++) {
resultTemp = "0" + resultTemp;
}
return resultTemp;
}
},
_accurateAddition: function (num1, num2) {// 加法结合律
var stringNumber1 = this._stringNumberFactory(num1);
var stringNumber2 = this._stringNumberFactory(num2);
// 整数部分计算
var integerResult = BI.parseInt(stringNumber1.numInteger) + BI.parseInt(stringNumber2.numInteger);
// 小数部分
this._formatDecimal(stringNumber1, stringNumber2);
var decimalResult = (BI.parseInt(stringNumber1.numDecimal) + BI.parseInt(stringNumber2.numDecimal)).toString();
if (decimalResult !== "0") {
if (decimalResult.length <= stringNumber1.numDecimal.length) {
decimalResult = addZero(decimalResult, stringNumber1.numDecimal.length);
} else {
integerResult++;// 进一
decimalResult = decimalResult.slice(1);
}
}
var result = integerResult + "." + decimalResult;
return BI.parseFloat(result);
function addZero (resultTemp, length) {
var diff = length - resultTemp.length;
for (var i = 0; i < diff; i++) {
resultTemp = "0" + resultTemp;
}
return resultTemp;
}
},
_accurateMultiplication: function (num1, num2) {// 乘法分配律
var stringNumber1 = this._stringNumberFactory(num1);
var stringNumber2 = this._stringNumberFactory(num2);
// 整数部分计算
var integerResult = BI.parseInt(stringNumber1.numInteger) * BI.parseInt(stringNumber2.numInteger);
// num1的小数和num2的整数
var dec1Int2 = this._accurateDivisionTenExponent(BI.parseInt(stringNumber1.numDecimal) * BI.parseInt(stringNumber2.numInteger), stringNumber1.numDecimalLength);
// num1的整数和num2的小数
var int1dec2 = this._accurateDivisionTenExponent(BI.parseInt(stringNumber1.numInteger) * BI.parseInt(stringNumber2.numDecimal), stringNumber2.numDecimalLength);
// 小数*小数
var dec1dec2 = this._accurateDivisionTenExponent(BI.parseInt(stringNumber1.numDecimal) * BI.parseInt(stringNumber2.numDecimal), (stringNumber1.numDecimalLength + stringNumber2.numDecimalLength));
return this._accurateAddition(this._accurateAddition(this._accurateAddition(integerResult, dec1Int2), int1dec2), dec1dec2);
},
_accurateDivisionTenExponent: function (num, n) {// num/10^n && n>0
var stringNumber = this._stringNumberFactory(num);
if (stringNumber.numInteger.length > n) {
var integerResult = stringNumber.numInteger.slice(0, (stringNumber.numInteger.length - n));
var partDecimalResult = stringNumber.numInteger.slice(-n);
} else {
var integerResult = "0";
var partDecimalResult = addZero(stringNumber.numInteger, n);
}
var result = integerResult + "." + partDecimalResult + stringNumber.numDecimal;
return BI.parseFloat(result);
function addZero (resultTemp, length) {
var diff = length - resultTemp.length;
for (var i = 0; i < diff; i++) {
resultTemp = "0" + resultTemp;
}
return resultTemp;
}
},
accurateSubtraction: function (num1, num2) {
if (num1 >= 0 && num2 >= 0) {
if (num1 >= num2) {
return this._accurateSubtraction(num1, num2);
}
return -this._accurateSubtraction(num2, num1);
}
if (num1 >= 0 && num2 < 0) {
return this._accurateAddition(num1, -num2);
}
if (num1 < 0 && num2 >= 0) {
return -this._accurateAddition(-num1, num2);
}
if (num1 < 0 && num2 < 0) {
if (num1 >= num2) {
return this._accurateSubtraction(-num2, -num1);
}
return this._accurateSubtraction(-num1, -num2);
}
},
accurateAddition: function (num1, num2) {
if (num1 >= 0 && num2 >= 0) {
return this._accurateAddition(num1, num2);
}
if (num1 >= 0 && num2 < 0) {
return this.accurateSubtraction(num1, -num2);
}
if (num1 < 0 && num2 >= 0) {
return this.accurateSubtraction(num2, -num1);
}
if (num1 < 0 && num2 < 0) {
return -this._accurateAddition(-num1, -num2);
}
},
accurateMultiplication: function (num1, num2) {
if (num1 >= 0 && num2 >= 0) {
return this._accurateMultiplication(num1, num2);
}
if (num1 >= 0 && num2 < 0) {
return -this._accurateMultiplication(num1, -num2);
}
if (num1 < 0 && num2 >= 0) {
return -this._accurateMultiplication(-num1, num2);
}
if (num1 < 0 && num2 < 0) {
return this._accurateMultiplication(-num1, -num2);
}
},
accurateDivisionTenExponent: function (num1, n) {
if (num1 >= 0) {
return this._accurateDivisionTenExponent(num1, n);
}
return -this._accurateDivisionTenExponent(-num1, n);
}
});
/***/ }),
/* 551 */
/***/ (function(module, exports) {
/**
* Created by roy on 15/8/14.
*/
BI.DownListCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multilayer-down-list-combo",
height: 24,
items: [],
adjustLength: 0,
direction: "bottom",
trigger: "click",
container: null,
stopPropagation: false,
el: {}
});
},
_init: function () {
BI.DownListCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.popupview = BI.createWidget({
type: "bi.multi_layer_down_list_popup",
items: o.items,
chooseType: o.chooseType,
value: o.value
});
this.popupview.on(BI.DownListPopup.EVENT_CHANGE, function (value) {
self.fireEvent(BI.DownListCombo.EVENT_CHANGE, value);
self.downlistcombo.hideView();
});
this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE, function (value, fatherValue) {
self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, value, fatherValue);
self.downlistcombo.hideView();
});
this.downlistcombo = BI.createWidget({
element: this,
type: "bi.combo",
trigger: o.trigger,
isNeedAdjustWidth: false,
container: o.container,
adjustLength: o.adjustLength,
direction: o.direction,
stopPropagation: o.stopPropagation,
el: BI.createWidget(o.el, {
type: "bi.icon_trigger",
extraCls: o.iconCls ? o.iconCls : "pull-down-font",
width: o.width,
height: o.height
}),
popup: {
el: this.popupview,
stopPropagation: o.stopPropagation,
maxHeight: 1000
}
});
this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW);
});
},
hideView: function () {
this.downlistcombo.hideView();
},
showView: function (e) {
this.downlistcombo.showView(e);
},
populate: function (items) {
this.popupview.populate(items);
},
setValue: function (v) {
this.popupview.setValue(v);
},
getValue: function () {
return this.popupview.getValue();
}
});
BI.DownListCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.DownListCombo.EVENT_SON_VALUE_CHANGE = "EVENT_SON_VALUE_CHANGE";
BI.DownListCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multi_layer_down_list_combo", BI.DownListCombo);
/***/ }),
/* 552 */
/***/ (function(module, exports) {
/**
* Created by roy on 15/9/8.
* 处理popup中的item分组样式
* 一个item分组中的成员大于一时,该分组设置为单选,并且默认状态第一个成员设置为已选择项
*/
BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
constants: {
nextIcon: "pull-right-e-font",
height: 25,
iconHeight: 12,
iconWidth: 12,
hgap: 0,
vgap: 0,
border: 1
},
_defaultConfig: function () {
var conf = BI.MultiLayerDownListPopup.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: "bi-down-list-popup",
items: [],
chooseType: BI.Selection.Multi
});
},
_init: function () {
BI.MultiLayerDownListPopup.superclass._init.apply(this, arguments);
this.singleValues = [];
this.childValueMap = {};
this.fatherValueMap = {};
var self = this, o = this.options, children = this._createPopupItems(o.items);
this.popup = BI.createWidget({
type: "bi.button_tree",
items: BI.createItems(children,
{}, {
adjustLength: -2
}
),
layouts: [{
type: "bi.vertical",
hgap: this.constants.hgap,
vgap: this.constants.vgap
}],
value: this._digest(o.value),
chooseType: o.chooseType
});
this.popup.on(BI.ButtonTree.EVENT_CHANGE, function (value, object) {
var changedValue = value;
if (BI.isNotNull(self.childValueMap[value])) {
changedValue = self.childValueMap[value];
var fatherValue = self.fatherValueMap[value];
var fatherArrayValue = (fatherValue + "").split("_");
self.fireEvent(BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE, changedValue, fatherArrayValue.length > 1 ? fatherArrayValue : fatherValue);
} else {
self.fireEvent(BI.MultiLayerDownListPopup.EVENT_CHANGE, changedValue, object);
}
if (!BI.contains(self.singleValues, changedValue)) {
var item = self.getValue();
var result = [];
BI.each(item, function (i, valueObject) {
if (valueObject.value != changedValue) {
result.push(valueObject);
}
});
self.setValue(result);
}
});
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.popup],
vgap: 5
});
},
_createPopupItems: function (items) {
var self = this, result = [];
BI.each(items, function (i, it) {
var item_done = {
type: "bi.down_list_group",
items: []
};
BI.each(it, function (i, item) {
if (BI.isNotEmptyArray(item.children) && !BI.isEmpty(item.el)) {
item.type = "bi.combo_group";
item.cls = "down-list-group";
item.trigger = "hover";
item.isNeedAdjustWidth = false;
item.el.title = item.el.title || item.el.text;
item.el.type = "bi.down_list_group_item";
item.el.logic = {
dynamic: true
};
item.el.height = self.constants.height;
item.el.iconCls2 = self.constants.nextIcon;
item.popup = {
lgap: 1,
el: {
type: "bi.button_tree",
chooseType: 0,
layouts: [{
type: "bi.vertical"
}]
},
innerVGap: 5
};
item.el.childValues = [];
BI.each(item.children, function (i, child) {
child = child.el ? BI.extend(child.el, {children: child.children}) : child;
var fatherValue = BI.deepClone(item.el.value);
var childValue = BI.deepClone(child.value);
self.singleValues.push(child.value);
child.type = "bi.down_list_item";
child.extraCls = " child-down-list-item";
child.title = child.title || child.text;
child.textRgap = 10;
child.isNeedAdjustWidth = false;
child.logic = {
dynamic: true
};
child.father = fatherValue;
self.fatherValueMap[self._createChildValue(fatherValue, childValue)] = fatherValue;
self.childValueMap[self._createChildValue(fatherValue, childValue)] = childValue;
child.value = self._createChildValue(fatherValue, childValue);
item.el.childValues.push(child.value);
if (BI.isNotEmptyArray(child.children)) {
child.type = "bi.down_list_group_item";
self._createChildren(child);
child.height = self.constants.height;
child.iconCls2 = self.constants.nextIcon;
item.el.childValues = BI.concat(item.el.childValues, child.childValues);
}
});
} else {
item.type = "bi.down_list_item";
item.title = item.title || item.text;
item.textRgap = 10;
item.isNeedAdjustWidth = false;
item.logic = {
dynamic: true
};
}
var el_done = {};
el_done.el = item;
item_done.items.push(el_done);
});
if (self._isGroup(item_done.items)) {
BI.each(item_done.items, function (i, item) {
self.singleValues.push(item.el.value);
});
}
result.push(item_done);
if (self._needSpliter(i, items.length)) {
var spliter_container = BI.createWidget({
type: "bi.vertical",
items: [{
el: {
type: "bi.layout",
cls: "bi-down-list-spliter bi-border-top cursor-pointer",
height: 0
}
}],
cls: "bi-down-list-spliter-container cursor-pointer",
vgap: 5,
lgap: 10
});
result.push(spliter_container);
}
});
return result;
},
_createChildren: function (child) {
var self = this;
child.childValues = [];
BI.each(child.children, function (i, c) {
var fatherValue = BI.deepClone(child.value);
var childValue = BI.deepClone(c.value);
c.type = "bi.down_list_item";
c.title = c.title || c.text;
c.textRgap = 10;
c.isNeedAdjustWidth = false;
c.logic = {
dynamic: true
};
c.father = fatherValue;
self.fatherValueMap[self._createChildValue(fatherValue, childValue)] = fatherValue;
self.childValueMap[self._createChildValue(fatherValue, childValue)] = childValue;
c.value = self._createChildValue(fatherValue, childValue);
child.childValues.push(c.value);
});
},
_isGroup: function (i) {
return i.length > 1;
},
_needSpliter: function (i, itemLength) {
return i < itemLength - 1;
},
_createChildValue: function (fatherValue, childValue) {
var fValue = fatherValue;
if(BI.isArray(fatherValue)) {
fValue = fatherValue.join("_");
}
return fValue + "_" + childValue;
},
_digest: function (valueItem) {
var self = this;
var valueArray = [];
BI.each(valueItem, function (i, item) {
var value;
if (BI.isNotNull(item.childValue)) {
value = self._createChildValue(item.value, item.childValue);
} else {
value = item.value;
}
valueArray.push(value);
}
);
return valueArray;
},
_checkValues: function (values) {
var self = this, o = this.options;
var value = [];
BI.each(o.items, function (idx, itemGroup) {
BI.each(itemGroup, function (id, item) {
if(BI.isNotNull(item.children)) {
var childValues = getChildrenValue(item);
var v = joinValue(childValues, values[idx]);
if(BI.isNotEmptyString(v)) {
value.push(v);
}
}else{
if(item.value === values[idx][0]) {
value.push(values[idx][0]);
}
}
});
});
return value;
function joinValue (sources, targets) {
var value = "";
BI.some(sources, function (idx, s) {
return BI.some(targets, function (id, t) {
if(s === t) {
value = s;
return true;
}
});
});
return value;
}
function getChildrenValue (item) {
var children = [];
if(BI.isNotNull(item.children)) {
BI.each(item.children, function (idx, child) {
children = BI.concat(children, getChildrenValue(child));
});
} else {
children.push(item.value);
}
return children;
}
},
populate: function (items) {
BI.MultiLayerDownListPopup.superclass.populate.apply(this, arguments);
var self = this;
self.childValueMap = {};
self.fatherValueMap = {};
self.singleValues = [];
var children = self._createPopupItems(items);
var popupItem = BI.createItems(children,
{}, {
adjustLength: -2
}
);
self.popup.populate(popupItem);
},
setValue: function (valueItem) {
this.popup.setValue(this._digest(valueItem));
},
_getValue: function () {
var v = [];
BI.each(this.popup.getAllButtons(), function (i, item) {
i % 2 === 0 && v.push(item.getValue());
});
return v;
},
getValue: function () {
var self = this, result = [];
var values = this._checkValues(this._getValue());
BI.each(values, function (i, value) {
var valueItem = {};
if (BI.isNotNull(self.childValueMap[value])) {
var fartherValue = self.fatherValueMap[value];
valueItem.childValue = self.childValueMap[value];
var fatherArrayValue = (fartherValue + "").split("_");
valueItem.value = fatherArrayValue.length > 1 ? fatherArrayValue : fartherValue;
} else {
valueItem.value = value;
}
result.push(valueItem);
});
return result;
}
});
BI.MultiLayerDownListPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE = "EVENT_SON_VALUE_CHANGE";
BI.shortcut("bi.multi_layer_down_list_popup", BI.MultiLayerDownListPopup);
/***/ }),
/* 553 */
/***/ (function(module, exports) {
/**
* @class BI.MultiLayerSelectTreeCombo
* @extends BI.Widget
*/
BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiLayerSelectTreeCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multilayer-select-tree-combo",
isDefaultInit: false,
height: 24,
text: "",
itemsCreator: BI.emptyFn,
items: [],
value: "",
attributes: {
tabIndex: 0
},
allowEdit: false,
allowSearchValue: false,
allowInsertValue: false,
isNeedAdjustWidth: true
});
},
render: function () {
var self = this, o = this.options;
var combo = (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig();
return (!o.allowEdit && o.itemsCreator === BI.emptyFn) ? combo : {
type: "bi.absolute",
items: [{
el: combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.trigger_icon_button",
cls: "trigger-icon-button",
ref: function (_ref) {
self.triggerBtn = _ref;
},
width: o.height,
height: o.height,
handler: function () {
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
}
},
right: 0,
bottom: 0,
top: 0
}]
};
},
_getBaseConfig: function () {
var self = this, o = this.options;
return {
type: "bi.combo",
container: o.container,
destroyWhenHide: o.destroyWhenHide,
adjustLength: 2,
ref: function (_ref) {
self.combo = _ref;
},
popup: {
el: {
type: "bi.multilayer_select_tree_popup",
isDefaultInit: o.isDefaultInit,
itemsCreator: o.itemsCreator,
items: o.items,
ref: function (_ref) {
self.trigger && self.trigger.getSearcher().setAdapter(_ref);
},
listeners: [{
eventName: BI.MultiLayerSelectTreePopup.EVENT_CHANGE,
action: function () {
self.setValue(this.getValue());
self.combo.hideView();
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE);
}
}],
onLoaded: function () {
BI.nextTick(function () {
self.combo.adjustWidth();
self.combo.adjustHeight();
});
}
},
value: o.value,
maxHeight: 400,
maxWidth: o.isNeedAdjustWidth ? "auto" : 500,
minHeight: 240
},
isNeedAdjustWidth: o.isNeedAdjustWidth,
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW);
}
}]
};
},
_getSearchConfig: function() {
var self = this, o = this.options;
return {
el: {
type: "bi.multilayer_select_tree_trigger",
container: o.container,
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit,
cls: "multilayer-select-tree-trigger",
ref: function (_ref) {
self.trigger = _ref;
},
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
height: o.height - 2,
text: o.text,
value: o.value,
tipType: o.tipType,
warningTitle: o.warningTitle,
title: o.title,
listeners: [{
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE,
action: function () {
self.setValue(this.getValue());
self.combo.hideView();
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE);
}
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING,
action: function () {
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();
}
}]
},
toggle: !o.allowEdit,
hideChecker: function (e) {
// 新增传配置container后对应hideChecker的修改
// IE11下,popover(position: fixed)下放置下拉控件(position: fixed), 滚动的时候会异常卡顿
// 通过container参数将popup放置于popover之外解决此问题, 其他下拉控件由于元素少或者有分页,所以
// 卡顿不明显, 先在此做尝试, 并在FineUI特殊处理待解决文档中标记跟踪
return (o.container && self.trigger.getSearcher().isSearching() && self.trigger.getSearcher().getView().element.find(e.target).length > 0) ? false : self.triggerBtn.element.find(e.target).length === 0;
},
listeners: [{
eventName: BI.Combo.EVENT_AFTER_HIDEVIEW,
action: function () {
self.trigger.stopEditing();
}
}, {
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW);
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
},
getValue: function () {
return this.combo.getValue();
},
populate: function (items) {
this.combo.populate(items);
}
});
BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);
/***/ }),
/* 554 */
/***/ (function(module, exports) {
/**
* 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);
/***/ }),
/* 555 */
/***/ (function(module, exports) {
/**
* guy
* 二级树
* @class BI.MultiLayerSelectLevelTree
* @extends BI.Pane
*/
BI.MultiLayerSelectLevelTree = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.MultiLayerSelectLevelTree.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multilayer-select-level-tree",
isDefaultInit: false,
items: [],
itemsCreator: BI.emptyFn,
keywordGetter: BI.emptyFn,
value: "",
scrollable: true
});
},
_init: function () {
var o = this.options;
BI.MultiLayerSelectLevelTree.superclass._init.apply(this, arguments);
this.storeValue = o.value;
this.initTree(this.options.items);
this.check();
},
_formatItems: function (nodes, layer, pNode) {
var self = this, o = this.options;
var keyword = o.keywordGetter();
BI.each(nodes, function (i, node) {
var extend = {};
node.layer = layer;
if (!BI.isKey(node.id)) {
node.id = BI.UUID();
}
node.keyword = node.keyword || keyword;
extend.pNode = pNode;
if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) {
extend.type = "bi.multilayer_select_tree_mid_plus_group_node";
if (i === nodes.length - 1) {
extend.type = "bi.multilayer_select_tree_last_plus_group_node";
extend.isLastNode = true;
}
if (i === 0 && !pNode) {
extend.type = "bi.multilayer_select_tree_first_plus_group_node";
}
if (i === 0 && i === nodes.length - 1 && !pNode) { // 根
extend.type = "bi.multilayer_select_tree_plus_group_node";
}
BI.defaults(node, extend);
self._formatItems(node.children, layer + 1, node);
} else {
extend.type = "bi.multilayer_single_tree_mid_tree_leaf_item";
if (i === 0 && !pNode) {
extend.type = "bi.multilayer_single_tree_first_tree_leaf_item";
}
if (i === nodes.length - 1) {
extend.type = "bi.multilayer_single_tree_last_tree_leaf_item";
}
BI.defaults(node, extend);
}
});
return nodes;
},
_assertId: function (sNodes) {
BI.each(sNodes, function (i, node) {
node.id = node.id || BI.UUID();
});
},
// 构造树结构,
initTree: function (nodes) {
var self = this, o = this.options;
var hasNext = false;
this.empty();
this._assertId(nodes);
this.tree = BI.createWidget({
type: "bi.custom_tree",
cls: "tree-view display-table",
expander: {
type: "bi.select_tree_expander",
isDefaultInit: o.isDefaultInit,
el: {},
popup: {
type: "bi.custom_tree"
}
},
items: this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0),
itemsCreator: function (op, callback) {
(op.times === 1 && !op.node) && BI.nextTick(function () {
self.loading();
});
o.itemsCreator(op, function (ob) {
hasNext = ob.hasNext;
(op.times === 1 && !op.node) && self._populate(ob.items);
callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items), op.node ? op.node.layer + 1 : 0, op.node));
self.setValue(self.storeValue);
(op.times === 1 && !op.node) && BI.nextTick(function () {
self.loaded();
});
});
},
value: o.value,
el: {
type: "bi.loader",
isDefaultInit: o.itemsCreator !== BI.emptyFn,
el: {
type: "bi.button_tree",
chooseType: o.chooseType,
behaviors: o.behaviors,
layouts: [{
type: "bi.vertical"
}]
},
hasNext: function () {
return hasNext;
}
}
});
this.tree.on(BI.Controller.EVENT_CHANGE, function (type, value) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.setValue(value);
self.fireEvent(BI.MultiLayerSelectLevelTree.EVENT_CHANGE, arguments);
}
});
BI.createWidget({
type: "bi.adaptive",
element: this,
scrollable: o.scrollable,
items: [this.tree]
});
},
_populate: function () {
BI.MultiLayerSelectLevelTree.superclass.populate.apply(this, arguments);
},
populate: function (nodes) {
this._populate(nodes);
BI.isNull(nodes) ? this.tree.populate() : this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0));
},
setValue: function (v) {
// getValue依赖于storeValue, 那么不选的时候就不要更新storeValue了
if(this.options.chooseType === BI.Selection.None) {
} else {
this.storeValue = v;
this.tree.setValue(v);
}
},
getValue: function () {
return BI.isArray(this.storeValue) ?
this.storeValue : BI.isNull(this.storeValue) ?
[] : [this.storeValue];
},
getAllLeaves: function () {
return this.tree.getAllLeaves();
},
getNodeById: function (id) {
return this.tree.getNodeById(id);
},
getNodeByValue: function (id) {
return this.tree.getNodeByValue(id);
}
});
BI.MultiLayerSelectLevelTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_level_tree", BI.MultiLayerSelectLevelTree);
/***/ }),
/* 556 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSelectTreePopup
* @extends BI.Pane
*/
BI.MultiLayerSelectTreePopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiLayerSelectTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multilayer-select-tree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
value: "",
onLoaded: BI.emptyFn,
minHeight: 240
});
},
_init: function () {
BI.MultiLayerSelectTreePopup.superclass._init.apply(this, arguments);
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,
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
onLoaded: function () {
self.tree.check();
o.onLoaded();
}
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
scrollable: true,
element: this,
vgap: 5,
items: [this.tree]
});
this.tree.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.tree.on(BI.MultiLayerSelectLevelTree.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiLayerSelectTreePopup.EVENT_CHANGE);
});
this.tree.css("min-height", o.minHeight - 10);
},
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.MultiLayerSelectTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_popup", BI.MultiLayerSelectTreePopup);
/***/ }),
/* 557 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2018/2/2.
*/
BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
props: function() {
return {
extraCls: "bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow bi-border-radius",
height: 24,
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search"),
allowSearchValue: false,
title: BI.bind(this._getShowText, this)
};
},
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this._initData();
}
var content = {
type: "bi.htape",
items: [
{
el: {
type: "bi.searcher",
ref: function () {
self.searcher = this;
},
masker: BI.isNotNull(o.container) ? {
offset: {},
container: o.container
} : {
offset: {}
},
isAutoSearch: false,
el: {
type: "bi.state_editor",
ref: function () {
self.editor = this;
},
defaultText: o.text,
text: this._digest(o.value),
value: o.value,
height: o.height,
tipText: "",
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS);
}
}, {
eventName: BI.StateEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_BLUR);
}
}, {
eventName: BI.StateEditor.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING);
}
}]
},
popup: {
type: o.allowInsertValue ? "bi.multilayer_select_tree_insert_search_pane" : "bi.multilayer_select_tree_popup",
itemsCreator: o.itemsCreator === BI.emptyFn ? BI.emptyFn : function (op, callback) {
op.keyword = self.editor.getValue();
o.itemsCreator(op, callback);
},
keywordGetter: function () {
return self.editor.getValue();
},
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) {
var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else {
callback();
}
},
listeners: [{
eventName: BI.Searcher.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE);
}
}]
}
}, {
el: {
type: "bi.layout",
width: 24
},
width: 24
}
]
};
return o.allowEdit ? content : {
type: "bi.absolute",
items: [{
el: content,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.layout"
},
left: 0,
right: 24,
top: 0,
bottom: 0
}]
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var self = this, o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
var items = [];
this.tree.traverse(function (node) {
var find = BI.Func.getSearchResult(self.tree.isRoot(node) ? [] : BI.concat([node.text], (o.allowSearchValue ? [node.value] : [])), keyword);
if(find.find.length > 0 || find.match.length > 0) {
items.push(node);
return true;
}
});
return this._fillTreeStructure4Search(items, "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) {
var self = this;
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)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
pNode.open = true;
queue.push({pId: pNode.pId});
result.push(pNode);
}
}
return BI.uniqBy(BI.map(result, function (idx, node) {
return self._createJson(node, node.open);
}), "id");
},
_digest: function (v) {
var o = this.options;
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);
},
_getShowText: function () {
return this.editor.getText();
},
stopEditing: function () {
this.searcher.stopSearch();
},
getSearcher: function () {
return this.searcher;
},
populate: function (items) {
this.options.items = items;
this._initData(items);
},
setValue: function (v) {
this.editor.setState(this._digest(v[0]));
},
getValue: function () {
return this.searcher.getValue();
}
});
BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_select_tree_trigger", BI.MultiLayerSelectTreeTrigger);
/***/ }),
/* 558 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
*
* Created by GUY on 2016/1/27.
* @class BI.MultiLayerSelectTreeFirstPlusGroupNode
* @extends BI.NodeButton
*/
BI.MultiLayerSelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",
layer: 0, // 第几层级
id: "",
pId: "",
readonly: true,
open: false,
height: 24
});
},
_init: function () {
BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.node = BI.createWidget({
type: "bi.select_tree_first_plus_group_node",
cls: "bi-list-item-none",
stopPropagation: true,
logic: {
dynamic: true
},
id: o.id,
pId: o.pId,
keyword: o.keyword,
open: o.open,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
});
this.node.on(BI.Controller.EVENT_CHANGE, function (type) {
self.setSelected(self.isSelected());
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
var needBlankLayers = [];
var pNode = o.pNode;
while (pNode) {
if (pNode.isLastNode) {
needBlankLayers.push(pNode.layer)
}
pNode = pNode.pNode;
}
var items = [];
BI.count(0, o.layer, function (index) {
items.push({
type: "bi.layout",
cls: BI.contains(needBlankLayers, index) ? "" : "base-line-conn-background",
width: 12,
height: o.height
});
});
items.push(this.node);
BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
columnSize: BI.makeArray(o.layer, 12),
items: items
});
},
isOnce: function () {
return true;
},
doRedMark: function () {
this.node.doRedMark.apply(this.node, arguments);
},
unRedMark: function () {
this.node.unRedMark.apply(this.node, arguments);
},
isSelected: function () {
return this.node.isSelected();
},
setSelected: function (b) {
BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setSelected.apply(this, arguments);
this.node.setSelected(b);
},
doClick: function () {
BI.NodeButton.superclass.doClick.apply(this, arguments);
this.node.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this, arguments);
this.node.setOpened(v);
}
});
BI.shortcut("bi.multilayer_select_tree_first_plus_group_node", BI.MultiLayerSelectTreeFirstPlusGroupNode);
/***/ }),
/* 559 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
*
* Created by GUY on 2016/1/27.
* @class BI.MultiLayerSelectTreeLastPlusGroupNode
* @extends BI.NodeButton
*/
BI.MultiLayerSelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-multilayer-select-tree-last-plus-group-node bi-list-item-active",
layer: 0, // 第几层级
id: "",
pId: "",
readonly: true,
open: false,
height: 24
});
},
_init: function () {
BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.node = BI.createWidget({
type: "bi.select_tree_last_plus_group_node",
cls: "bi-list-item-none",
stopPropagation: true,
logic: {
dynamic: true
},
id: o.id,
pId: o.pId,
keyword: o.keyword,
open: o.open,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
});
this.node.on(BI.Controller.EVENT_CHANGE, function (type) {
self.setSelected(self.isSelected());
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
var needBlankLayers = [];
var pNode = o.pNode;
while (pNode) {
if (pNode.isLastNode) {
needBlankLayers.push(pNode.layer)
}
pNode = pNode.pNode;
}
var items = [];
BI.count(0, o.layer, function (index) {
items.push({
type: "bi.layout",
cls: BI.contains(needBlankLayers, index) ? "" : "base-line-conn-background",
width: 12,
height: o.height
});
});
items.push(this.node);
BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
columnSize: BI.makeArray(o.layer, 12),
items: items
});
},
doRedMark: function () {
this.node.doRedMark.apply(this.node, arguments);
},
unRedMark: function () {
this.node.unRedMark.apply(this.node, arguments);
},
isSelected: function () {
return this.node.isSelected();
},
setSelected: function (b) {
BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setSelected.apply(this, arguments);
this.node.setSelected(b);
},
doClick: function () {
BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.doClick.apply(this, arguments);
this.node.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setOpened.apply(this, arguments);
this.node.setOpened(v);
}
});
BI.shortcut("bi.multilayer_select_tree_last_plus_group_node", BI.MultiLayerSelectTreeLastPlusGroupNode);
/***/ }),
/* 560 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
*
* Created by GUY on 2016/1/27.
* @class BI.MultiLayerSelectTreeMidPlusGroupNode
* @extends BI.NodeButton
*/
BI.MultiLayerSelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-multilayer-select-tree-mid-plus-group-node bi-list-item-active",
layer: 0, // 第几层级
id: "",
pId: "",
readonly: true,
open: false,
height: 24
});
},
_init: function () {
BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.node = BI.createWidget({
type: "bi.select_tree_mid_plus_group_node",
cls: "bi-list-item-none",
stopPropagation: true,
logic: {
dynamic: true
},
id: o.id,
pId: o.pId,
keyword: o.keyword,
open: o.open,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
});
this.node.on(BI.Controller.EVENT_CHANGE, function (type) {
self.setSelected(self.isSelected());
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
var needBlankLayers = [];
var pNode = o.pNode;
while (pNode) {
if (pNode.isLastNode) {
needBlankLayers.push(pNode.layer)
}
pNode = pNode.pNode;
}
var items = [];
BI.count(0, o.layer, function (index) {
items.push({
type: "bi.layout",
cls: BI.contains(needBlankLayers, index) ? "" : "base-line-conn-background",
width: 12,
height: o.height
});
});
items.push(this.node);
BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
columnSize: BI.makeArray(o.layer, 12),
items: items
});
},
doRedMark: function () {
this.node.doRedMark.apply(this.node, arguments);
},
unRedMark: function () {
this.node.unRedMark.apply(this.node, arguments);
},
isSelected: function () {
return this.node.isSelected();
},
setSelected: function (b) {
BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setSelected.apply(this, arguments);
this.node.setSelected(b);
},
doClick: function () {
BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.doClick.apply(this, arguments);
this.node.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setOpened.apply(this, arguments);
this.node.setOpened(v);
}
});
BI.shortcut("bi.multilayer_select_tree_mid_plus_group_node", BI.MultiLayerSelectTreeMidPlusGroupNode);
/***/ }),
/* 561 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
*
* Created by GUY on 2016/1/27.
* @class BI.MultiLayerSelectTreePlusGroupNode
* @extends BI.NodeButton
*/
BI.MultiLayerSelectTreePlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.MultiLayerSelectTreePlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",
layer: 0, // 第几层级
id: "",
pId: "",
readonly: true,
open: false,
height: 24
});
},
_init: function () {
BI.MultiLayerSelectTreePlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.node = BI.createWidget({
type: "bi.select_tree_plus_group_node",
cls: "bi-list-item-none",
stopPropagation: true,
logic: {
dynamic: true
},
id: o.id,
pId: o.pId,
keyword: o.keyword,
open: o.open,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py
});
this.node.on(BI.Controller.EVENT_CHANGE, function (type) {
self.setSelected(self.isSelected());
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
var needBlankLayers = [];
var pNode = o.pNode;
while (pNode) {
if (pNode.isLastNode) {
needBlankLayers.push(pNode.layer)
}
pNode = pNode.pNode;
}
var items = [];
BI.count(0, o.layer, function (index) {
items.push({
type: "bi.layout",
cls: BI.contains(needBlankLayers, index) ? "" : "base-line-conn-background",
width: 12,
height: o.height
});
});
items.push(this.node);
BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
columnSize: BI.makeArray(o.layer, 12),
items: items
});
},
isOnce: function () {
return true;
},
doRedMark: function () {
this.node.doRedMark.apply(this.node, arguments);
},
unRedMark: function () {
this.node.unRedMark.apply(this.node, arguments);
},
isSelected: function () {
return this.node.isSelected();
},
setSelected: function (b) {
BI.MultiLayerSelectTreePlusGroupNode.superclass.setSelected.apply(this, arguments);
this.node.setSelected(b);
},
doClick: function () {
BI.NodeButton.superclass.doClick.apply(this, arguments);
this.node.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.MultiLayerSelectTreePlusGroupNode.superclass.setOpened.apply(this, arguments);
this.node.setOpened(v);
}
});
BI.shortcut("bi.multilayer_select_tree_plus_group_node", BI.MultiLayerSelectTreePlusGroupNode);
/***/ }),
/* 562 */
/***/ (function(module, exports) {
/**
* 多层级下拉单选树
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSingleTreeCombo
* @extends BI.Widget
*/
BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiLayerSingleTreeCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multilayer-single-tree-combo",
isDefaultInit: false,
height: 24,
text: "",
itemsCreator: BI.emptyFn,
items: [],
value: "",
attributes: {
tabIndex: 0
},
allowEdit: false,
allowSearchValue: false,
allowInsertValue: false,
isNeedAdjustWidth: true
});
},
render: function () {
var self = this, o = this.options;
var combo = (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig();
return (!o.allowEdit && o.itemsCreator === BI.emptyFn) ? combo : {
type: "bi.absolute",
items: [{
el: combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.trigger_icon_button",
cls: "trigger-icon-button",
ref: function (_ref) {
self.triggerBtn = _ref;
},
width: o.height,
height: o.height,
handler: function () {
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
}
},
right: 0,
bottom: 0,
top: 0
}]
};
},
_getBaseConfig: function () {
var self = this, o = this.options;
return {
type: "bi.combo",
container: o.container,
destroyWhenHide: o.destroyWhenHide,
adjustLength: 2,
ref: function (_ref) {
self.combo = _ref;
},
popup: {
el: {
type: "bi.multilayer_single_tree_popup",
isDefaultInit: o.isDefaultInit,
itemsCreator: o.itemsCreator,
items: o.items,
ref: function (_ref) {
self.trigger && self.trigger.getSearcher().setAdapter(_ref);
},
listeners: [{
eventName: BI.MultiLayerSingleTreePopup.EVENT_CHANGE,
action: function () {
self.setValue(this.getValue());
self.combo.hideView();
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE);
}
}],
onLoaded: function () {
BI.nextTick(function () {
self.combo.adjustWidth();
self.combo.adjustHeight();
});
}
},
value: o.value,
maxHeight: 400,
maxWidth: o.isNeedAdjustWidth ? "auto" : 500,
minHeight: 240
},
isNeedAdjustWidth: o.isNeedAdjustWidth,
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW);
}
}]
};
},
_getSearchConfig: function() {
var self = this, o = this.options;
return {
el: {
type: "bi.multilayer_single_tree_trigger",
container: o.container,
allowInsertValue: o.allowInsertValue,
allowSearchValue: o.allowSearchValue,
allowEdit: o.allowEdit,
cls: "multilayer-single-tree-trigger",
ref: function (_ref) {
self.trigger = _ref;
},
watermark: o.watermark,
items: o.items,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
height: o.height - 2,
text: o.text,
value: o.value,
tipType: o.tipType,
warningTitle: o.warningTitle,
title: o.title,
listeners: [{
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE,
action: function () {
self.setValue(this.getValue());
self.combo.hideView();
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE);
}
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING,
action: function () {
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();
}
}]
},
toggle: !o.allowEdit,
hideChecker: function (e) {
// 新增传配置container后对应hideChecker的修改
// IE11下,popover(position: fixed)下放置下拉控件(position: fixed), 滚动的时候会异常卡顿
// 通过container参数将popup放置于popover之外解决此问题, 其他下拉控件由于元素少或者有分页,所以
// 卡顿不明显, 先在此做尝试, 并在FineUI特殊处理待解决文档中标记跟踪
return (o.container && self.trigger.getSearcher().isSearching() && self.trigger.getSearcher().getView().element.find(e.target).length > 0) ? false : self.triggerBtn.element.find(e.target).length === 0
},
listeners: [{
eventName: BI.Combo.EVENT_AFTER_HIDEVIEW,
action: function () {
self.trigger.stopEditing();
}
}, {
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW);
}
}]
}
},
_getSyncConfig: function () {
var o = this.options;
var baseConfig = this._getBaseConfig();
return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : {
el: {
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}
});
},
_getAsyncConfig: function () {
var config = this._getBaseConfig();
return BI.extend(config, this._getSearchConfig());
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.combo.setValue(v);
},
getValue: function () {
return this.combo.getValue();
},
populate: function (items) {
this.combo.populate(items);
}
});
BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);
/***/ }),
/* 563 */
/***/ (function(module, exports) {
/**
* 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_single_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);
/***/ }),
/* 564 */
/***/ (function(module, exports) {
/**
* guy
* 二级树
* @class BI.MultiLayerSingleLevelTree
* @extends BI.Single
*/
BI.MultiLayerSingleLevelTree = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.MultiLayerSingleLevelTree.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multilayer-single-level-tree",
isDefaultInit: false,
items: [],
itemsCreator: BI.emptyFn,
keywordGetter: BI.emptyFn,
chooseType: BI.Selection.Single,
scrollable: true
});
},
_init: function () {
var o = this.options;
BI.MultiLayerSingleLevelTree.superclass._init.apply(this, arguments);
this.storeValue = o.value;
this.initTree(this.options.items);
this.check();
},
_formatItems: function (nodes, layer, pNode) {
var self = this, o = this.options;
var keyword = o.keywordGetter();
BI.each(nodes, function (i, node) {
var extend = {};
node.layer = layer;
if (!BI.isKey(node.id)) {
node.id = BI.UUID();
}
node.keyword = node.keyword || keyword;
extend.pNode = pNode;
if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) {
extend.type = "bi.multilayer_single_tree_mid_plus_group_node";
if (i === nodes.length - 1) {
extend.type = "bi.multilayer_single_tree_last_plus_group_node";
extend.isLastNode = true;
}
if (i === 0 && !pNode) {
extend.type = "bi.multilayer_single_tree_first_plus_group_node";
}
if (i === 0 && i === nodes.length - 1 && !pNode) { // 根
extend.type = "bi.multilayer_single_tree_plus_group_node";
}
BI.defaults(node, extend);
self._formatItems(node.children, layer + 1, node);
} else {
extend.type = "bi.multilayer_single_tree_mid_tree_leaf_item";
if (i === 0 && !pNode) {
extend.type = "bi.multilayer_single_tree_first_tree_leaf_item";
}
if (i === nodes.length - 1) {
extend.type = "bi.multilayer_single_tree_last_tree_leaf_item";
}
BI.defaults(node, extend);
}
});
return nodes;
},
_assertId: function (sNodes) {
BI.each(sNodes, function (i, node) {
node.id = node.id || BI.UUID();
});
},
// 构造树结构,
initTree: function (nodes) {
var self = this, o = this.options;
var hasNext = false;
this.empty();
this._assertId(nodes);
this.tree = BI.createWidget({
type: "bi.custom_tree",
cls: "tree-view display-table",
expander: {
isDefaultInit: o.isDefaultInit,
el: {},
popup: {
type: "bi.custom_tree"
}
},
items: this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0),
value: o.value,
itemsCreator: function (op, callback) {
(op.times === 1 && !op.node) && BI.nextTick(function () {
self.loading();
});
o.itemsCreator(op, function (ob) {
hasNext = ob.hasNext;
(op.times === 1 && !op.node) && self._populate(ob.items);
callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items), op.node ? op.node.layer + 1 : 0, op.node));
self.setValue(self.storeValue);
(op.times === 1 && !op.node) && BI.nextTick(function () {
self.loaded();
});
});
},
el: {
type: "bi.loader",
isDefaultInit: o.itemsCreator !== BI.emptyFn,
el: {
type: "bi.button_tree",
chooseType: o.chooseType,
behaviors: o.behaviors,
layouts: [{
type: "bi.vertical"
}]
},
hasNext: function () {
return hasNext;
}
}
});
this.tree.on(BI.Controller.EVENT_CHANGE, function (type, v) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) {
self.setValue(v);
self.fireEvent(BI.MultiLayerSingleLevelTree.EVENT_CHANGE, v);
}
});
BI.createWidget({
type: "bi.adaptive",
element: this,
scrollable: o.scrollable,
items: [this.tree]
});
},
_populate: function () {
BI.MultiLayerSelectLevelTree.superclass.populate.apply(this, arguments);
},
populate: function (nodes) {
this._populate(nodes);
BI.isNull(nodes) ? this.tree.populate() : this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes), 0));
},
setValue: function (v) {
// getValue依赖于storeValue, 那么不选的时候就不要更新storeValue了
if(this.options.chooseType === BI.Selection.None) {
} else {
this.storeValue = v;
this.tree.setValue(v);
}
},
getValue: function () {
return BI.isArray(this.storeValue) ?
this.storeValue : BI.isNull(this.storeValue) ?
[] : [this.storeValue];
},
getAllLeaves: function () {
return this.tree.getAllLeaves();
},
getNodeById: function (id) {
return this.tree.getNodeById(id);
},
getNodeByValue: function (id) {
return this.tree.getNodeByValue(id);
}
});
BI.MultiLayerSingleLevelTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_level_tree", BI.MultiLayerSingleLevelTree);
/***/ }),
/* 565 */
/***/ (function(module, exports) {
/**
* Created by GUY on 2016/1/26.
*
* @class BI.MultiLayerSingleTreePopup
* @extends BI.Pane
*/
BI.MultiLayerSingleTreePopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiLayerSingleTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multilayer-singletree-popup",
tipText: BI.i18nText("BI-No_Selected_Item"),
isDefaultInit: false,
itemsCreator: BI.emptyFn,
items: [],
onLoaded: BI.emptyFn,
minHeight: 240
});
},
_init: function () {
BI.MultiLayerSingleTreePopup.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.multilayer_single_level_tree",
isDefaultInit: o.isDefaultInit,
items: o.items,
itemsCreator: o.itemsCreator,
keywordGetter: o.keywordGetter,
value: o.value,
scrollable: null,
onLoaded: function () {
self.tree.check();
o.onLoaded();
}
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
scrollable: true,
element: this,
vgap: 5,
items: [this.tree]
});
this.tree.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.tree.on(BI.MultiLayerSingleLevelTree.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiLayerSingleTreePopup.EVENT_CHANGE);
});
this.tree.css("min-height", o.minHeight - 10);
},
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.MultiLayerSingleTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_popup", BI.MultiLayerSingleTreePopup);
/***/ }),
/* 566 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2018/2/2.
*/
BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
props: function() {
return {
extraCls: "bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow bi-border-radius",
height: 24,
valueFormatter: function (v) {
return v;
},
itemsCreator: BI.emptyFn,
watermark: BI.i18nText("BI-Basic_Search"),
allowSearchValue: false,
title: BI.bind(this._getShowText, this)
};
},
render: function () {
var self = this, o = this.options;
if(o.itemsCreator === BI.emptyFn) {
this._initData();
}
var content = {
type: "bi.htape",
items: [
{
el: {
type: "bi.searcher",
ref: function () {
self.searcher = this;
},
masker: BI.isNotNull(o.container) ? {
offset: {},
container: o.container
} : {
offset: {}
},
isAutoSearch: false,
el: {
type: "bi.state_editor",
ref: function () {
self.editor = this;
},
defaultText: o.text,
text: this._digest(o.value),
value: o.value,
height: o.height,
tipText: "",
watermark: o.watermark,
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS);
}
}, {
eventName: BI.StateEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_BLUR);
}
}, {
eventName: BI.StateEditor.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING);
}
}]
},
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) {
op.keyword = self.editor.getValue();
o.itemsCreator(op, callback);
},
keywordGetter: function () {
return self.editor.getValue();
},
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) {
var keyword = obj.keyword;
if(o.itemsCreator === BI.emptyFn) {
callback(self._getSearchItems(keyword));
o.allowInsertValue && self.popup.setKeyword(keyword);
} else {
callback();
}
},
listeners: [{
eventName: BI.Searcher.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE);
}
}]
}
}, {
el: {
type: "bi.layout",
width: 24
},
width: 24
}
]
};
return o.allowEdit ? content : {
type: "bi.absolute",
items: [{
el: content,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.layout"
},
left: 0,
right: 24,
top: 0,
bottom: 0
}]
};
},
_initData: function() {
var o = this.options;
this.tree = new BI.Tree();
this.nodes = BI.Tree.treeFormat(BI.deepClone(o.items));
this.tree.initTree(this.nodes);
},
_getSearchItems: function(keyword) {
var self = this, o = this.options;
// 把数组搜索换成用BI.tree搜索节点, 搜到了就不再往下搜索
var items = [];
this.tree.traverse(function (node) {
var find = BI.Func.getSearchResult(self.tree.isRoot(node) ? [] : BI.concat([node.text], (o.allowSearchValue ? [node.value] : [])), keyword);
if(find.find.length > 0 || find.match.length > 0) {
items.push(node);
return true;
}
});
return this._fillTreeStructure4Search(items, "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) {
var self = this;
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)) {
var node = queue.pop();
var pNode = this.tree.search(this.tree.getRoot(), node.pId, "id");
if (pNode != null) {
pNode.open = true;
queue.push({pId: pNode.pId});
result.push(pNode);
}
}
return BI.uniqBy(BI.map(result, function (idx, node) {
return self._createJson(node, node.open);
}), "id");
},
_digest: function (v) {
var o = this.options;
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);
},
_getShowText: function () {
return this.editor.getText();
},
stopEditing: function () {
this.searcher.stopSearch();
},
getSearcher: function () {
return this.searcher;
},
populate: function (items) {
this.options.items = items;
this._initData();
},
setValue: function (v) {
this.editor.setState(this._digest(v[0]));
},
getValue: function () {
return this.searcher.getValue();
}
});
BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START";
BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multilayer_single_tree_trigger", BI.MultiLayerSingleTreeTrigger);
/***/ }),
/* 567 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
*
* Created by GUY on 2016/1/27.
* @class BI.MultiLayerSingleTreeFirstPlusGroupNode
* @extends BI.NodeButton
*/
BI.MultiLayerSingleTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-multilayer-single-tree-first-plus-group-node bi-list-item",
layer: 0, // 第几层级
id: "",
pId: "",
open: false,
height: 24
});
},
_init: function () {
BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.node = this._createNode();
var needBlankLayers = [];
var pNode = o.pNode;
while (pNode) {
if (pNode.isLastNode) {
needBlankLayers.push(pNode.layer)
}
pNode = pNode.pNode;
}
var items = [];
BI.count(0, o.layer, function (index) {
items.push({
type: "bi.layout",
cls: BI.contains(needBlankLayers, index) ? "" : "base-line-conn-background",
width: 12,
height: o.height
});
});
items.push(this.node);
BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
columnSize: BI.makeArray(o.layer, 12),
items: items
});
},
doRedMark: function () {
this.node.doRedMark.apply(this.node, arguments);
},
unRedMark: function () {
this.node.unRedMark.apply(this.node, arguments);
},
doClick: function () {
BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass.doClick.apply(this, arguments);
this.node.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass.setOpened.apply(this, arguments);
if (BI.isNotNull(this.node)) {
this.node.setOpened(v);
}
},
_createNode: function () {
var self = this, o = this.options;
return BI.createWidget({
type: "bi.first_plus_group_node",
cls: "bi-list-item-none",
logic: {
dynamic: true
},
id: o.id,
pId: o.pId,
open: o.open,
isLastNode: o.isLastNode,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function (type) {
if (type === BI.Events.CLICK) {// 本身实现click功能
return;
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}]
});
}
});
BI.shortcut("bi.multilayer_single_tree_first_plus_group_node", BI.MultiLayerSingleTreeFirstPlusGroupNode);
/***/ }),
/* 568 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
*
* Created by GUY on 2016/1/27.
* @class BI.MultiLayerSingleTreeLastPlusGroupNode
* @extends BI.NodeButton
*/
BI.MultiLayerSingleTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-multilayer-single-tree-last-plus-group-node bi-list-item",
layer: 0, // 第几层级
id: "",
pId: "",
open: false,
height: 24
});
},
_init: function () {
BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.node = this._createNode();
var needBlankLayers = [];
var pNode = o.pNode;
while (pNode) {
if (pNode.isLastNode) {
needBlankLayers.push(pNode.layer)
}
pNode = pNode.pNode;
}
var items = [];
BI.count(0, o.layer, function (index) {
items.push({
type: "bi.layout",
cls: BI.contains(needBlankLayers, index) ? "" : "base-line-conn-background",
width: 12,
height: o.height
});
});
items.push(this.node);
BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
columnSize: BI.makeArray(o.layer, 12),
items: items
});
},
doRedMark: function () {
this.node.doRedMark.apply(this.node, arguments);
},
unRedMark: function () {
this.node.unRedMark.apply(this.node, arguments);
},
doClick: function () {
BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.doClick.apply(this, arguments);
this.node.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.setOpened.apply(this, arguments);
if (BI.isNotNull(this.node)) {
this.node.setOpened(v);
}
},
_createNode: function () {
var self = this, o = this.options;
return BI.createWidget({
type: "bi.last_plus_group_node",
cls: "bi-list-item-none",
logic: {
dynamic: true
},
id: o.id,
pId: o.pId,
open: o.open,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function (type) {
if (type === BI.Events.CLICK) {// 本身实现click功能
return;
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}]
});
}
});
BI.shortcut("bi.multilayer_single_tree_last_plus_group_node", BI.MultiLayerSingleTreeLastPlusGroupNode);
/***/ }),
/* 569 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
*
* Created by GUY on 2016/1/27.
* @class BI.MultiLayerSingleTreeMidPlusGroupNode
* @extends BI.NodeButton
*/
BI.MultiLayerSingleTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.MultiLayerSingleTreeMidPlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-multilayer-single-tree-mid-plus-group-node bi-list-item",
layer: 0, // 第几层级
id: "",
pId: "",
open: false,
height: 24
});
},
_init: function () {
BI.MultiLayerSingleTreeMidPlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.node = this._createNode();
var needBlankLayers = [];
var pNode = o.pNode;
while (pNode) {
if (pNode.isLastNode) {
needBlankLayers.push(pNode.layer)
}
pNode = pNode.pNode;
}
var items = [];
BI.count(0, o.layer, function (index) {
items.push({
type: "bi.layout",
cls: BI.contains(needBlankLayers, index) ? "" : "base-line-conn-background",
width: 12,
height: o.height
});
});
items.push(this.node);
BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
columnSize: BI.makeArray(o.layer, 12),
items: items
});
},
doRedMark: function () {
this.node.doRedMark.apply(this.node, arguments);
},
unRedMark: function () {
this.node.unRedMark.apply(this.node, arguments);
},
doClick: function () {
BI.MultiLayerSingleTreeMidPlusGroupNode.superclass.doClick.apply(this, arguments);
this.node.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.MultiLayerSingleTreeMidPlusGroupNode.superclass.setOpened.apply(this, arguments);
if (BI.isNotNull(this.node)) {
this.node.setOpened(v);
}
},
_createNode: function () {
var self = this, o = this.options;
return BI.createWidget({
type: "bi.mid_plus_group_node",
cls: "bi-list-item-none",
logic: {
dynamic: true
},
id: o.id,
pId: o.pId,
open: o.open,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function (type) {
if (type === BI.Events.CLICK) {// 本身实现click功能
return;
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}]
});
}
});
BI.shortcut("bi.multilayer_single_tree_mid_plus_group_node", BI.MultiLayerSingleTreeMidPlusGroupNode);
/***/ }),
/* 570 */
/***/ (function(module, exports) {
/**
*@desc 根节点,既是第一个又是最后一个
*@author dailer
*@date 2018/09/16
*/
BI.MultiLayerSingleTreePlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.MultiLayerSingleTreePlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-multilayer-single-tree-plus-group-node bi-list-item",
layer: 0, // 第几层级
id: "",
pId: "",
open: false,
height: 24
});
},
_init: function () {
BI.MultiLayerSingleTreePlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.node = this._createNode();
var needBlankLayers = [];
var pNode = o.pNode;
while (pNode) {
if (pNode.isLastNode) {
needBlankLayers.push(pNode.layer)
}
pNode = pNode.pNode;
}
var items = [];
BI.count(0, o.layer, function (index) {
items.push({
type: "bi.layout",
cls: BI.contains(needBlankLayers, index) ? "" : "base-line-conn-background",
width: 12,
height: o.height
});
});
items.push(this.node);
BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
columnSize: BI.makeArray(o.layer, 12),
items: items
});
},
doRedMark: function () {
this.node.doRedMark.apply(this.node, arguments);
},
unRedMark: function () {
this.node.unRedMark.apply(this.node, arguments);
},
doClick: function () {
BI.MultiLayerSingleTreePlusGroupNode.superclass.doClick.apply(this, arguments);
this.node.setSelected(this.isSelected());
},
setOpened: function (v) {
BI.MultiLayerSingleTreePlusGroupNode.superclass.setOpened.apply(this, arguments);
if (BI.isNotNull(this.node)) {
this.node.setOpened(v);
}
},
_createNode: function () {
var self = this, o = this.options;
return BI.createWidget({
type: "bi.plus_group_node",
cls: "bi-list-item-none",
logic: {
dynamic: true
},
id: o.id,
pId: o.pId,
open: o.open,
isLastNode: o.isLastNode,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function (type) {
if (type === BI.Events.CLICK) {// 本身实现click功能
return;
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}]
});
}
});
BI.shortcut("bi.multilayer_single_tree_plus_group_node", BI.MultiLayerSingleTreePlusGroupNode);
/***/ }),
/* 571 */
/***/ (function(module, exports) {
/**
*
* Created by GUY on 2016/1/27.
* @class BI.MultiLayerSingleTreeFirstTreeLeafItem
* @extends BI.BasicButton
*/
BI.MultiLayerSingleTreeFirstTreeLeafItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-multilayer-single-tree-first-tree-leaf-item bi-list-item-active",
logic: {
dynamic: false
},
layer: 0,
id: "",
pId: "",
height: 24
});
},
_init: function () {
BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.item = BI.createWidget({
type: "bi.first_tree_leaf_item",
cls: "bi-list-item-none",
logic: {
dynamic: true
},
id: o.id,
pId: o.pId,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword
});
this.item.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {// 本身实现click功能
return;
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
var needBlankLayers = [];
var pNode = o.pNode;
while (pNode) {
if (pNode.isLastNode) {
needBlankLayers.push(pNode.layer)
}
pNode = pNode.pNode;
}
var items = [];
BI.count(0, o.layer, function (index) {
items.push({
type: "bi.layout",
cls: BI.contains(needBlankLayers, index) ? "" : "base-line-conn-background",
width: 12,
height: o.height
});
});
items.push(this.item);
BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
columnSize: BI.makeArray(o.layer, 12),
items: items
});
},
doHighLight: function () {
this.item.doHighLight.apply(this.item, arguments);
},
unHighLight: function () {
this.item.unHighLight.apply(this.item, arguments);
},
getId: function () {
return this.options.id;
},
getPId: function () {
return this.options.pId;
},
doClick: function () {
BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.doClick.apply(this, arguments);
this.item.setSelected(this.isSelected());
},
setSelected: function (v) {
BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.setSelected.apply(this, arguments);
this.item.setSelected(v);
}
});
BI.shortcut("bi.multilayer_single_tree_first_tree_leaf_item", BI.MultiLayerSingleTreeFirstTreeLeafItem);
/***/ }),
/* 572 */
/***/ (function(module, exports) {
/**
*
* Created by GUY on 2016/1/27.
* @class BI.MultiLayerSingleTreeLastTreeLeafItem
* @extends BI.BasicButton
*/
BI.MultiLayerSingleTreeLastTreeLeafItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-multilayer-single-tree-last-tree-leaf-item bi-list-item-active",
logic: {
dynamic: false
},
layer: 0,
id: "",
pId: "",
height: 24
});
},
_init: function () {
BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.item = BI.createWidget({
type: "bi.last_tree_leaf_item",
cls: "bi-list-item-none",
logic: {
dynamic: true
},
id: o.id,
pId: o.pId,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword
});
this.item.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {// 本身实现click功能
return;
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
var needBlankLayers = [];
var pNode = o.pNode;
while (pNode) {
if (pNode.isLastNode) {
needBlankLayers.push(pNode.layer)
}
pNode = pNode.pNode;
}
var items = [];
BI.count(0, o.layer, function (index) {
items.push({
type: "bi.layout",
cls: BI.contains(needBlankLayers, index) ? "" : "base-line-conn-background",
width: 12,
height: o.height
});
});
items.push(this.item);
BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
columnSize: BI.makeArray(o.layer, 12),
items: items
});
},
doHighLight: function () {
this.item.doHighLight.apply(this.item, arguments);
},
unHighLight: function () {
this.item.unHighLight.apply(this.item, arguments);
},
getId: function () {
return this.options.id;
},
getPId: function () {
return this.options.pId;
},
doClick: function () {
BI.MultiLayerSingleTreeLastTreeLeafItem.superclass.doClick.apply(this, arguments);
this.item.setSelected(this.isSelected());
},
setSelected: function (v) {
BI.MultiLayerSingleTreeLastTreeLeafItem.superclass.setSelected.apply(this, arguments);
this.item.setSelected(v);
}
});
BI.shortcut("bi.multilayer_single_tree_last_tree_leaf_item", BI.MultiLayerSingleTreeLastTreeLeafItem);
/***/ }),
/* 573 */
/***/ (function(module, exports) {
/**
*
* Created by GUY on 2016/1/27.
* @class BI.MultiLayerSingleTreeMidTreeLeafItem
* @extends BI.BasicButton
*/
BI.MultiLayerSingleTreeMidTreeLeafItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.MultiLayerSingleTreeMidTreeLeafItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-multilayer-single-tree-mid-tree-leaf-item bi-list-item-active",
logic: {
dynamic: false
},
layer: 0,
id: "",
pId: "",
height: 24
});
},
_init: function () {
BI.MultiLayerSingleTreeMidTreeLeafItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.item = BI.createWidget({
type: "bi.mid_tree_leaf_item",
cls: "bi-list-item-none",
logic: {
dynamic: true
},
id: o.id,
pId: o.pId,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword
});
this.item.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {// 本身实现click功能
return;
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
var needBlankLayers = [];
var pNode = o.pNode;
while (pNode) {
if (pNode.isLastNode) {
needBlankLayers.push(pNode.layer)
}
pNode = pNode.pNode;
}
var items = [];
BI.count(0, o.layer, function (index) {
items.push({
type: "bi.layout",
cls: BI.contains(needBlankLayers, index) ? "" : "base-line-conn-background",
width: 12,
height: o.height
});
});
items.push(this.item);
BI.createWidget({
type: "bi.horizontal_adapt",
element: this,
columnSize: BI.makeArray(o.layer, 12),
items: items
});
},
doHighLight: function () {
this.item.doHighLight.apply(this.item, arguments);
},
unHighLight: function () {
this.item.unHighLight.apply(this.item, arguments);
},
getId: function () {
return this.options.id;
},
getPId: function () {
return this.options.pId;
},
doClick: function () {
BI.MultiLayerSingleTreeMidTreeLeafItem.superclass.doClick.apply(this, arguments);
this.item.setSelected(this.isSelected());
},
setSelected: function (v) {
BI.MultiLayerSingleTreeMidTreeLeafItem.superclass.setSelected.apply(this, arguments);
this.item.setSelected(v);
}
});
BI.shortcut("bi.multilayer_single_tree_mid_tree_leaf_item", BI.MultiLayerSingleTreeMidTreeLeafItem);
/***/ }),
/* 574 */
/***/ (function(module, exports) {
/**
*
* @class BI.MultiSelectCheckPane
* @extends BI.Widget
*/
BI.MultiSelectCheckPane = BI.inherit(BI.Widget, {
constants: {
height: 12,
lgap: 10,
tgap: 10,
bgap: 5
},
_defaultConfig: function () {
return BI.extend(BI.MultiSelectCheckPane.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-check-pane bi-background",
items: [],
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
onClickContinueSelect: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectCheckPane.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.storeValue = opts.value || {};
this.display = BI.createWidget({
type: "bi.display_selected_list",
items: opts.items,
itemsCreator: function (op, callback) {
op = BI.extend(op || {}, {
selectedValues: self.storeValue.value
});
if (self.storeValue.type === BI.Selection.Multi) {
callback({
items: BI.map(self.storeValue.value, function (i, v) {
var txt = opts.valueFormatter(v) || v;
return {
text: txt,
value: v,
title: txt
};
})
});
return;
}
opts.itemsCreator(op, callback);
}
});
this.continueSelect = BI.createWidget({
type: "bi.text_button",
text: BI.i18nText("BI-Continue_Select"),
cls: "multi-select-check-selected bi-high-light"
});
this.continueSelect.on(BI.TextButton.EVENT_CHANGE, function () {
opts.onClickContinueSelect();
});
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
height: this.constants.height,
el: {
type: "bi.vertical_adapt",
cls: "multi-select-continue-select",
items: [
{
el: {
type: "bi.label",
text: BI.i18nText("BI-Selected_Data")
},
lgap: this.constants.lgap
},
{
el: this.continueSelect,
lgap: this.constants.lgap
}]
},
tgap: this.constants.tgap
}, {
height: "fill",
el: this.display,
tgap: this.constants.bgap
}]
});
},
setValue: function (v) {
this.storeValue = v || {};
},
empty: function () {
this.display.empty();
},
populate: function () {
this.display.populate.apply(this.display, arguments);
}
});
BI.shortcut("bi.multi_select_check_pane", BI.MultiSelectCheckPane);
/***/ }),
/* 575 */
/***/ (function(module, exports) {
/**
*
*
* 查看已选弹出层的展示面板
* @class BI.DisplaySelectedList
* @extends BI.Widget
*/
BI.DisplaySelectedList = BI.inherit(BI.Pane, {
constants: {
height: 24,
lgap: 10
},
_defaultConfig: function () {
return BI.extend(BI.DisplaySelectedList.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-display-list",
itemsCreator: BI.emptyFn,
items: []
});
},
_init: function () {
BI.DisplaySelectedList.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.hasNext = false;
this.button_group = BI.createWidget({
type: "bi.list_pane",
element: this,
el: {
type: "bi.loader",
isDefaultInit: false,
logic: {
dynamic: true,
scrolly: true
},
items: this._createItems(opts.items),
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
type: "bi.vertical",
lgap: 10
}]
},
itemsCreator: function (options, callback) {
opts.itemsCreator(options, function (ob) {
self.hasNext = !!ob.hasNext;
callback(self._createItems(ob.items));
});
},
hasNext: function () {
return self.hasNext;
}
});
},
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.icon_text_item",
cls: "cursor-default check-font icon-size-12 display-list-item bi-tips",
once: true,
invalid: true,
selected: true,
height: this.constants.height,
logic: {
dynamic: true
}
});
},
empty: function () {
this.button_group.empty();
},
populate: function (items) {
if (arguments.length === 0) {
this.button_group.populate();
} else {
this.button_group.populate(this._createItems(items));
}
}
});
BI.shortcut("bi.display_selected_list", BI.DisplaySelectedList);
/***/ }),
/* 576 */
/***/ (function(module, exports) {
/**
*
* @class BI.MultiSelectCombo
* @extends BI.Single
*/
BI.MultiSelectCombo = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-combo",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
attributes: {
tabIndex: 0
},
allowEdit: true
});
},
_init: function () {
BI.MultiSelectCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var assertShowValue = function () {
if (BI.isKey(self._startValue)) {
if (self.storeValue.type === BI.Selection.All) {
BI.remove(self.storeValue.value, self._startValue);
self.storeValue.assist = self.storeValue.assist || [];
self.storeValue.assist.pushDistinct(self._startValue);
} else {
BI.pushDistinct(self.storeValue.value, self._startValue);
BI.remove(self.storeValue.assist, self._startValue);
}
}
self.trigger.getSearcher().setState(self.storeValue);
self.numberCounter.setButtonChecked(self.storeValue);
};
this.storeValue = o.value || {};
this._assertValue(this.storeValue);
// 标记正在请求数据
this.requesting = false;
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
allowEdit: o.allowEdit,
height: o.height,
text: o.text,
// adapter: this.popup,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
value: this.storeValue
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectCombo.EVENT_FOCUS);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.MultiSelectCombo.EVENT_BLUR);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self._setStartValue("");
this.getSearcher().setValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self._setStartValue("");
self.fireEvent(BI.MultiSelectCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword();
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue("");
});
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();
self._setStartValue("");
} else {
self.combo.setValue(self.storeValue);
assertShowValue();
}
});
}
self.fireEvent(BI.MultiSelectCombo.EVENT_SEARCHING);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function (value, obj) {
if (obj instanceof BI.MultiSelectBar) {
self._joinAll(this.getValue(), function () {
assertShowValue();
});
} else {
self._join(this.getValue(), function () {
assertShowValue();
});
}
self.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () {
// counter的值随点击项的改变而改变, 点击counter的时候不需要setValue(counter会请求刷新计数)
// 只需要更新查看面板的selectedValue用以请求已选数据
self.numberCounter.updateSelectedValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.combo = BI.createWidget({
type: "bi.combo",
toggle: !o.allowEdit,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
type: "bi.multi_select_popup_view",
ref: function () {
self.popup = this;
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
action: function () {
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
});
self.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,
action: function () {
self._defaultState();
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,
action: function () {
self.setValue();
self._defaultState();
}
}],
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
onLoaded: function () {
BI.nextTick(function () {
self.combo.adjustWidth();
self.combo.adjustHeight();
self.numberCounter.adjustView();
self.trigger.getSearcher().adjustView();
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 && self.numberCounter.element.find(e.target).length === 0;
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
this.setValue(self.storeValue);
BI.nextTick(function () {
self._populate();
});
});
// 当退出的时候如果还在处理请求,则等请求结束后再对外发确定事件
this.wants2Quit = false;
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
// important:关闭弹出时又可能没有退出编辑状态
self._stopEditing();
if (self.requesting === true) {
self.wants2Quit = true;
} else {
self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM);
}
});
var triggerBtn = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.height,
height: o.height,
cls: "multi-select-trigger-icon-button"
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.numberCounter.hideView();
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
});
this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher",
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
value: this.storeValue
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
this.updateSelectedValue(self.storeValue);
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height,
}]
});
},
_itemsCreator4Trigger: function(op, callback) {
var self = this, o = this.options;
o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(BI.deepClone(self.getValue()));
}
callback.apply(self, arguments);
});
},
_stopEditing: function() {
this.trigger.stopEditing();
this.numberCounter.hideView();
},
_defaultState: function () {
this._stopEditing();
this.combo.hideView();
},
_assertValue: function (val) {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
},
_makeMap: function (values) {
return BI.makeObject(values || []);
},
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val);
}
});
self._adjust(callback);
}
},
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];
BI.each(items, function (i, item) {
if (BI.isNotNull(selectedMap[items[i]])) {
self.storeValue.assist && self.storeValue.assist.push(selectedMap[items[i]]);
delete selectedMap[items[i]];
}
if (BI.isNull(notSelectedMap[items[i]])) {
BI.remove(self.storeValue.assist, item);
newItems.push(item);
}
});
self.storeValue.value = newItems.concat(BI.values(selectedMap));
self._adjust(callback);
});
},
_adjust: function (callback) {
var self = this, o = this.options;
adjust();
callback();
function adjust () {
if (self.wants2Quit === true) {
self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM);
self.wants2Quit = false;
}
self.requesting = false;
}
},
_join: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this._assertValue(this.storeValue);
if (this.storeValue.type === res.type) {
var map = this._makeMap(this.storeValue.value);
BI.each(res.value, function (i, v) {
if (!map[v]) {
self.storeValue.value.push(v);
BI.remove(self.storeValue.assist, v);
map[v] = v;
}
});
var change = false;
BI.each(res.assist, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
this._joinAll(res, callback);
},
_setStartValue: function (value) {
this._startValue = value;
this.popup.setStartValue(value);
},
_populate: function () {
this.combo.populate.apply(this.combo, arguments);
},
setValue: function (v) {
this.storeValue = v || {};
this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue);
this.numberCounter.setValue(this.storeValue);
},
getValue: function () {
return BI.deepClone(this.storeValue);
},
populate: function () {
this._populate.apply(this, arguments);
this.numberCounter.populateSwitcher.apply(this.numberCounter, arguments);
}
});
BI.extend(BI.MultiSelectCombo, {
REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1
});
BI.MultiSelectCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiSelectCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiSelectCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.multi_select_combo", BI.MultiSelectCombo);
/***/ }),
/* 577 */
/***/ (function(module, exports) {
/**
*
* @class BI.MultiSelectNoBarCombo
* @extends BI.Single
*/
BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectNoBarCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-combo-no-bar",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
attributes: {
tabIndex: 0
}
});
},
_init: function () {
BI.MultiSelectNoBarCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var assertShowValue = function () {
if (BI.isKey(self._startValue)) {
if (self.storeValue.type === BI.Selection.All) {
BI.remove(self.storeValue.value, self._startValue);
self.storeValue.assist = self.storeValue.assist || [];
self.storeValue.assist.pushDistinct(self._startValue);
} else {
BI.pushDistinct(self.storeValue.value, self._startValue);
BI.remove(self.storeValue.assist, self._startValue);
}
}
self.trigger.getSearcher().setState(self.storeValue);
self.numberCounter.setButtonChecked(self.storeValue);
};
this.storeValue = {
type: BI.Selection.Multi,
value: o.value || []
};
// 标记正在请求数据
this.requesting = false;
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
height: o.height,
text: o.text,
// adapter: this.popup,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
value: {
type: BI.Selection.Multi,
value: o.value
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectNoBarCombo.EVENT_FOCUS);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.MultiSelectNoBarCombo.EVENT_BLUR);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self._setStartValue("");
this.getSearcher().setValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self._setStartValue("");
self.fireEvent(BI.MultiSelectNoBarCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();
self._setStartValue("");
} else {
self.combo.setValue(self.storeValue);
assertShowValue();
}
});
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function (value, obj) {
if (obj instanceof BI.MultiSelectBar) {
self._joinAll(this.getValue(), function () {
assertShowValue();
});
} else {
self._join(this.getValue(), function () {
assertShowValue();
});
}
self.fireEvent(BI.MultiSelectNoBarCombo.EVENT_CLICK_ITEM);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () {
// counter的值随点击项的改变而改变, 点击counter的时候不需要setValue(counter会请求刷新计数)
// 只需要更新查看面板的selectedValue用以请求已选数据
self.numberCounter.updateSelectedValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.combo = BI.createWidget({
type: "bi.combo",
toggle: false,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
type: "bi.multi_select_no_bar_popup_view",
ref: function () {
self.popup = this;
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
action: function () {
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
});
self.fireEvent(BI.MultiSelectNoBarCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,
action: function () {
self._defaultState();
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,
action: function () {
self.setValue();
self._defaultState();
}
}],
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
onLoaded: function () {
BI.nextTick(function () {
self.combo.adjustWidth();
self.combo.adjustHeight();
self.numberCounter.adjustView();
self.trigger.getSearcher().adjustView();
});
}
},
value: {
type: BI.Selection.Multi,
value: o.value
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
this.setValue(self.storeValue);
BI.nextTick(function () {
self._populate();
});
});
// 当退出的时候如果还在处理请求,则等请求结束后再对外发确定事件
this.wants2Quit = false;
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
// important:关闭弹出时又可能没有退出编辑状态
self._stopEditing();
if (self.requesting === true) {
self.wants2Quit = true;
} else {
self.fireEvent(BI.MultiSelectNoBarCombo.EVENT_CONFIRM);
}
});
var triggerBtn = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.height,
height: o.height,
cls: "multi-select-trigger-icon-button"
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.numberCounter.hideView();
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
});
this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher",
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
value: {
type: BI.Selection.Multi,
value: o.value
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
this.updateSelectedValue(self.storeValue);
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height
}]
});
},
_itemsCreator4Trigger: function (op, callback) {
var self = this, o = this.options;
o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(BI.deepClone(self.storeValue));
}
callback.apply(self, arguments);
});
},
_stopEditing: function () {
this.trigger.stopEditing();
this.numberCounter.hideView();
},
_defaultState: function () {
this._stopEditing();
this.combo.hideView();
},
_assertValue: function (val) {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
},
_makeMap: function (values) {
return BI.makeObject(values || []);
},
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectNoBarCombo.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest(items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val);
}
});
self._adjust(callback);
}
},
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectNoBarCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];
BI.each(items, function (i, item) {
if (BI.isNotNull(selectedMap[items[i]])) {
self.storeValue.assist && self.storeValue.assist.push(selectedMap[items[i]]);
delete selectedMap[items[i]];
}
if (BI.isNull(notSelectedMap[items[i]])) {
BI.remove(self.storeValue.assist, item);
newItems.push(item);
}
});
self.storeValue.value = newItems.concat(BI.values(selectedMap));
self._adjust(callback);
});
},
_adjust: function (callback) {
var self = this, o = this.options;
adjust();
callback();
function adjust() {
if (self.wants2Quit === true) {
self.fireEvent(BI.MultiSelectNoBarCombo.EVENT_CONFIRM);
self.wants2Quit = false;
}
self.requesting = false;
}
},
_join: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this._assertValue(this.storeValue);
if (this.storeValue.type === res.type) {
var map = this._makeMap(this.storeValue.value);
BI.each(res.value, function (i, v) {
if (!map[v]) {
self.storeValue.value.push(v);
BI.remove(self.storeValue.assist, v);
map[v] = v;
}
});
var change = false;
BI.each(res.assist, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
this._joinAll(res, callback);
},
_setStartValue: function (value) {
this._startValue = value;
this.popup.setStartValue(value);
},
_populate: function () {
this.combo.populate.apply(this.combo, arguments);
},
setValue: function (v) {
this.storeValue = {
type: BI.Selection.Multi,
value: v || []
};
this.combo.setValue(this.storeValue);
this.numberCounter.setValue(this.storeValue);
},
getValue: function () {
return BI.deepClone(this.storeValue.value);
},
populate: function () {
this._populate.apply(this, arguments);
this.numberCounter.populateSwitcher.apply(this.numberCounter, arguments);
}
});
BI.extend(BI.MultiSelectNoBarCombo, {
REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1
});
BI.MultiSelectNoBarCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiSelectNoBarCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectNoBarCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectNoBarCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectNoBarCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiSelectNoBarCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.multi_select_no_bar_combo", BI.MultiSelectNoBarCombo);
/***/ }),
/* 578 */
/***/ (function(module, exports) {
/**
*
* @class BI.MultiSelectInsertCombo
* @extends BI.Single
*/
BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectInsertCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-insert-combo",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
attributes: {
tabIndex: 0
},
allowEdit: true
});
},
_init: function () {
BI.MultiSelectInsertCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var assertShowValue = function () {
if (BI.isKey(self._startValue)) {
if(self.storeValue.type === BI.Selection.All) {
BI.remove(self.storeValue.value, self._startValue);
self.storeValue.assist = self.storeValue.assist || [];
self.storeValue.assist.pushDistinct(self._startValue);
} else {
BI.pushDistinct(self.storeValue.value, self._startValue);
BI.remove(self.storeValue.assist, self._startValue);
}
}
self.trigger.getSearcher().setState(self.storeValue);
self.numberCounter.setButtonChecked(self.storeValue);
};
this.storeValue = o.value || {};
// 标记正在请求数据
this.requesting = false;
this.trigger = BI.createWidget({
type: "bi.multi_select_insert_trigger",
allowEdit: o.allowEdit,
height: o.height,
text: o.text,
watermark: o.watermark,
// adapter: this.popup,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
value: o.value
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_FOCUS);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_BLUR);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_START, function () {
self._setStartValue("");
this.getSearcher().setValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_STOP, function () {
self._setStartValue("");
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
self._addItem(assertShowValue);
}
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM, function () {
if (!this.getSearcher().hasMatched()) {
self._addItem(assertShowValue);
var addedValue = this.getSearcher().getKeyword();
self._stopEditing();
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_ADD_ITEM, addedValue);
}
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();
self._setStartValue("");
} else {
self.combo.setValue(self.storeValue);
assertShowValue();
}
});
}
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_SEARCHING);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_CHANGE, function (value, obj) {
if (obj instanceof BI.MultiSelectBar) {
self._joinAll(this.getValue(), function () {
assertShowValue();
});
} else {
self._join(this.getValue(), function () {
assertShowValue();
});
}
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () {
// counter的值随点击项的改变而改变, 点击counter的时候不需要setValue(counter会请求刷新计数)
// 只需要更新查看面板的selectedValue用以请求已选数据
self.numberCounter.updateSelectedValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.combo = BI.createWidget({
type: "bi.combo",
toggle: !o.allowEdit,
el: this.trigger,
adjustLength: 1,
container: o.container,
popup: {
type: "bi.multi_select_popup_view",
ref: function () {
self.popup = this;
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
action: function () {
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
});
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,
action: function () {
self._defaultState();
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,
action: function () {
self.setValue();
self._defaultState();
}
}],
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
onLoaded: function () {
BI.nextTick(function () {
self.combo.adjustWidth();
self.combo.adjustHeight();
self.numberCounter.adjustView();
self.trigger.getSearcher().adjustView();
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
this.setValue(self.storeValue);
BI.nextTick(function () {
self._populate();
});
});
// 当退出的时候如果还在处理请求,则等请求结束后再对外发确定事件
this.wants2Quit = false;
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
// important:关闭弹出时又可能没有退出编辑状态
self._stopEditing();
if (self.requesting === true) {
self.wants2Quit = true;
} else {
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM);
}
});
var triggerBtn = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.height,
height: o.height,
cls: "multi-select-trigger-icon-button"
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.numberCounter.hideView();
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
});
this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher",
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
this.updateSelectedValue(self.storeValue);
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height,
}]
});
},
_itemsCreator4Trigger: function(op, callback) {
var self = this, o = this.options;
o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(BI.deepClone(self.getValue()));
}
callback.apply(self, arguments);
});
},
_addItem: function (assertShowValue) {
var self = this;
var keyword = this.trigger.getSearcher().getKeyword();
this._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
// 如果在不选的状态下直接把该值添加进来
if (self.storeValue.type === BI.Selection.Multi) {
BI.pushDistinct(self.storeValue.value, keyword);
}
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue("");
});
},
_stopEditing: function() {
this.trigger.stopEditing();
this.numberCounter.hideView();
},
_defaultState: function () {
this._stopEditing();
this.combo.hideView();
},
_assertValue: function (val) {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
},
_makeMap: function (values) {
return BI.makeObject(values || []);
},
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val);
}
});
self._adjust(callback);
}
},
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];
BI.each(items, function (i, item) {
if (BI.isNotNull(selectedMap[items[i]])) {
self.storeValue.assist && self.storeValue.assist.push(selectedMap[items[i]]);
delete selectedMap[items[i]];
}
if (BI.isNull(notSelectedMap[items[i]])) {
BI.remove(self.storeValue.assist, item);
newItems.push(item);
}
});
self.storeValue.value = newItems.concat(BI.values(selectedMap));
self._adjust(callback);
});
},
_adjust: function (callback) {
var self = this, o = this.options;
adjust();
callback();
function adjust () {
if (self.wants2Quit === true) {
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM);
self.wants2Quit = false;
}
self.requesting = false;
}
},
_join: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this._assertValue(this.storeValue);
if (this.storeValue.type === res.type) {
var map = this._makeMap(this.storeValue.value);
BI.each(res.value, function (i, v) {
if (!map[v]) {
self.storeValue.value.push(v);
// value更新的时候assist也需要更新
BI.remove(self.storeValue.assist, v);
map[v] = v;
}
});
var change = false;
BI.each(res.assist, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
this._joinAll(res, callback);
},
_setStartValue: function (value) {
this._startValue = value;
this.popup.setStartValue(value);
},
_populate: function () {
this.combo.populate.apply(this.combo, arguments);
},
setValue: function (v) {
this.storeValue = v || {};
this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue);
this.numberCounter.setValue(this.storeValue);
},
getValue: function () {
return BI.deepClone(this.storeValue);
},
populate: function () {
this._populate.apply(this, arguments);
this.numberCounter.populateSwitcher.apply(this.numberCounter, arguments);
}
});
BI.extend(BI.MultiSelectInsertCombo, {
REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1
});
BI.MultiSelectInsertCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectInsertCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiSelectInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MultiSelectInsertCombo.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multi_select_insert_combo", BI.MultiSelectInsertCombo);
/***/ }),
/* 579 */
/***/ (function(module, exports) {
/**
*
* @class BI.MultiSelectInsertCombo
* @extends BI.Single
*/
BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectInsertNoBarCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-insert-combo-no-bar",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
attributes: {
tabIndex: 0
}
});
},
_init: function () {
BI.MultiSelectInsertNoBarCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var assertShowValue = function () {
if (BI.isKey(self._startValue)) {
if (self.storeValue.type === BI.Selection.All) {
BI.remove(self.storeValue.value, self._startValue);
self.storeValue.assist = self.storeValue.assist || [];
self.storeValue.assist.pushDistinct(self._startValue);
} else {
BI.pushDistinct(self.storeValue.value, self._startValue);
BI.remove(self.storeValue.assist, self._startValue);
}
}
self.trigger.getSearcher().setState(self.storeValue);
self.numberCounter.setButtonChecked(self.storeValue);
};
this.storeValue = {
type: BI.Selection.Multi,
value: o.value || []
};
// 标记正在请求数据
this.requesting = false;
this.trigger = BI.createWidget({
type: "bi.multi_select_insert_trigger",
height: o.height,
text: o.text,
// adapter: this.popup,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
value: {
type: BI.Selection.Multi,
value: o.value
}
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_START, function () {
self._setStartValue("");
this.getSearcher().setValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_STOP, function () {
self._setStartValue("");
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
self._addItem(assertShowValue);
}
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM, function () {
if (!this.getSearcher().hasMatched()) {
self._addItem(assertShowValue);
var addedValue = this.getSearcher().getKeyword();
self._stopEditing();
self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_ADD_ITEM, addedValue);
}
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();
self._setStartValue("");
} else {
self.combo.setValue(self.storeValue);
assertShowValue();
}
});
}
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_CHANGE, function (value, obj) {
if (obj instanceof BI.MultiSelectBar) {
self._joinAll(this.getValue(), function () {
assertShowValue();
});
} else {
self._join(this.getValue(), function () {
assertShowValue();
});
}
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () {
// counter的值随点击项的改变而改变, 点击counter的时候不需要setValue(counter会请求刷新计数)
// 只需要更新查看面板的selectedValue用以请求已选数据
self.numberCounter.updateSelectedValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.combo = BI.createWidget({
type: "bi.combo",
toggle: false,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
type: "bi.multi_select_no_bar_popup_view",
ref: function () {
self.popup = this;
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
action: function () {
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
});
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,
action: function () {
self._defaultState();
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,
action: function () {
self.setValue();
self._defaultState();
}
}],
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
onLoaded: function () {
BI.nextTick(function () {
self.combo.adjustWidth();
self.combo.adjustHeight();
self.numberCounter.adjustView();
self.trigger.getSearcher().adjustView();
});
}
},
value: {
type: BI.Selection.Multi,
value: o.value
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
this.setValue(self.storeValue);
BI.nextTick(function () {
self._populate();
});
});
// 当退出的时候如果还在处理请求,则等请求结束后再对外发确定事件
this.wants2Quit = false;
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
// important:关闭弹出时又可能没有退出编辑状态
self._stopEditing();
if (self.requesting === true) {
self.wants2Quit = true;
} else {
self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM);
}
});
var triggerBtn = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.height,
height: o.height,
cls: "multi-select-trigger-icon-button"
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.numberCounter.hideView();
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
});
this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher",
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
valueFormatter: o.valueFormatter,
itemsCreator: BI.bind(this._itemsCreator4Trigger, this),
value: {
type: BI.Selection.Multi,
value: o.value
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
this.updateSelectedValue(self.storeValue);
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height
}]
});
},
_itemsCreator4Trigger: function(op, callback) {
var self = this, o = this.options;
o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(BI.deepClone(self.storeValue));
}
callback.apply(self, arguments);
});
},
_addItem: function (assertShowValue) {
var self = this;
var keyword = this.trigger.getSearcher().getKeyword();
this._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
// 如果在不选的状态下直接把该值添加进来
if (self.storeValue.type === BI.Selection.Multi) {
BI.pushDistinct(self.storeValue.value, keyword);
}
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue("");
});
},
_stopEditing: function() {
this.trigger.stopEditing();
this.numberCounter.hideView();
},
_defaultState: function () {
this._stopEditing();
this.combo.hideView();
},
_assertValue: function (val) {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
},
_makeMap: function (values) {
return BI.makeObject(values || []);
},
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val);
}
});
self._adjust(callback);
}
},
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];
BI.each(items, function (i, item) {
if (BI.isNotNull(selectedMap[items[i]])) {
self.storeValue.assist && self.storeValue.assist.push(selectedMap[items[i]]);
delete selectedMap[items[i]];
}
if (BI.isNull(notSelectedMap[items[i]])) {
BI.remove(self.storeValue.assist, item);
newItems.push(item);
}
});
self.storeValue.value = newItems.concat(BI.values(selectedMap));
self._adjust(callback);
});
},
_adjust: function (callback) {
var self = this, o = this.options;
adjust();
callback();
function adjust () {
if (self.wants2Quit === true) {
self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM);
self.wants2Quit = false;
}
self.requesting = false;
}
},
_join: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this._assertValue(this.storeValue);
if (this.storeValue.type === res.type) {
var map = this._makeMap(this.storeValue.value);
BI.each(res.value, function (i, v) {
if (!map[v]) {
self.storeValue.value.push(v);
BI.remove(self.storeValue.assist, v);
map[v] = v;
}
});
var change = false;
BI.each(res.assist, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
this._joinAll(res, callback);
},
_setStartValue: function (value) {
this._startValue = value;
this.popup.setStartValue(value);
},
_populate: function () {
this.combo.populate.apply(this.combo, arguments);
},
setValue: function (v) {
this.storeValue = {
type: BI.Selection.Multi,
value: v || []
};
this.combo.setValue(this.storeValue);
this.numberCounter.setValue(this.storeValue);
},
getValue: function () {
return BI.deepClone(this.storeValue.value);
},
populate: function () {
this._populate.apply(this, arguments);
this.numberCounter.populateSwitcher.apply(this.numberCounter, arguments);
}
});
BI.extend(BI.MultiSelectInsertNoBarCombo, {
REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1
});
BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MultiSelectInsertNoBarCombo.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multi_select_insert_no_bar_combo", BI.MultiSelectInsertNoBarCombo);
/***/ }),
/* 580 */
/***/ (function(module, exports) {
/**
*
* 复选下拉框
* @class BI.MultiSelectInsertTrigger
* @extends BI.Trigger
*/
BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
constants: {
height: 14,
rgap: 4,
lgap: 4
},
_defaultConfig: function () {
return BI.extend(BI.MultiSelectInsertTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-trigger bi-border bi-border-radius",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
searcher: {},
switcher: {},
adapter: null,
masker: {},
allowEdit: true
});
},
_init: function () {
BI.MultiSelectInsertTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (o.height) {
this.setHeight(o.height - 2);
}
this.searcher = BI.createWidget(o.searcher, {
type: "bi.multi_select_insert_searcher",
height: o.height,
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
value: o.value
});
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_START, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_START);
});
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM);
});
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_PAUSE, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_PAUSE);
});
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_SEARCHING, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_SEARCHING, arguments);
});
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_STOP, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_STOP);
});
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_CHANGE, arguments);
});
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_BLUR, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_BLUR);
});
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_FOCUS);
});
this.wrapNumberCounter = BI.createWidget({
type: "bi.layout"
});
this.wrapper = BI.createWidget({
type: "bi.htape",
element: this,
items: [
{
el: this.searcher,
width: "fill"
}, {
el: this.wrapNumberCounter,
width: 0
}, {
el: BI.createWidget(),
width: 24
}]
});
!o.allowEdit && BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.text",
title: function () {
return self.searcher.getState();
}
},
left: 0,
right: 24,
top: 0,
bottom: 0
}]
});
},
/**
* 重新调整numberCounter的空白占位符
*/
refreshPlaceHolderWidth: function(width) {
this.wrapper.attr("items")[1].width = width;
this.wrapper.resize();
},
getSearcher: function () {
return this.searcher;
},
stopEditing: function () {
this.searcher.stopSearch();
},
setAdapter: function (adapter) {
this.searcher.setAdapter(adapter);
},
setValue: function (ob) {
this.searcher.setValue(ob);
},
getKey: function () {
return this.searcher.getKey();
},
getValue: function () {
return this.searcher.getValue();
}
});
BI.MultiSelectInsertTrigger.EVENT_TRIGGER_CLICK = "EVENT_TRIGGER_CLICK";
BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK = "EVENT_COUNTER_CLICK";
BI.MultiSelectInsertTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiSelectInsertTrigger.EVENT_START = "EVENT_START";
BI.MultiSelectInsertTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectInsertTrigger.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiSelectInsertTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW = "EVENT_BEFORE_COUNTER_POPUPVIEW";
BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiSelectInsertTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectInsertTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.shortcut("bi.multi_select_insert_trigger", BI.MultiSelectInsertTrigger);
/***/ }),
/* 581 */
/***/ (function(module, exports) {
/**
* 多选加载数据面板
* Created by guy on 15/11/2.
* @class BI.MultiSelectLoader
* @extends Widget
*/
BI.MultiSelectLoader = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-loader",
logic: {
dynamic: true
},
el: {
height: 400
},
valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectLoader.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = opts.value || {};
this._assertValue(this.storeValue);
this.button_group = BI.createWidget({
type: "bi.select_list",
logic: opts.logic,
toolbar: {
type: "bi.multi_select_bar",
cls: "bi-list-item-active",
iconWrapperWidth: 36
},
el: BI.extend({
onLoaded: opts.onLoaded,
el: {
type: "bi.loader",
isDefaultInit: false,
logic: {
dynamic: true,
scrolly: true
},
el: {
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
behaviors: {
redmark: function () {
return true;
}
},
layouts: [{
type: "bi.vertical"
}]
}
}
}, opts.el),
itemsCreator: function (op, callback) {
var startValue = self._startValue;
self.storeValue && (op = BI.extend(op || {}, {
selectedValues: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi
? self.storeValue.value.concat(startValue) : self.storeValue.value
}));
opts.itemsCreator(op, function (ob) {
hasNext = ob.hasNext;
var firstItems = [];
if (op.times === 1 && self.storeValue) {
var json = BI.map(self.storeValue.value, function (i, v) {
var txt = opts.valueFormatter(v) || v;
return {
text: txt,
value: v,
title: txt,
selected: self.storeValue.type === BI.Selection.Multi
};
});
if (BI.isKey(self._startValue) && !BI.contains(self.storeValue.value, self._startValue)) {
var txt = opts.valueFormatter(startValue) || startValue;
json.unshift({
text: txt,
value: startValue,
title: txt,
selected: true
});
}
firstItems = self._createItems(json);
}
callback(firstItems.concat(self._createItems(ob.items)), ob.keyword || "");
if (op.times === 1 && self.storeValue) {
BI.isKey(startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, startValue) : BI.pushDistinct(self.storeValue.value, startValue));
self.setValue(self.storeValue);
}
(op.times === 1) && self._scrollToTop();
});
},
hasNext: function () {
return hasNext;
},
value: this.storeValue
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top), BI.extend({
scrolly: true,
vgap: 5
}, opts.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top, this.button_group)
}))));
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.button_group.on(BI.SelectList.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectLoader.EVENT_CHANGE, arguments);
});
},
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.multi_select_item",
logic: this.options.logic,
cls: "bi-list-item-active",
height: 24,
selected: this.isAllSelected(),
iconWrapperWidth: 36
});
},
_scrollToTop: function () {
var self = this;
BI.delay(function () {
self.button_group.element.scrollTop(0);
}, 30);
},
isAllSelected: function () {
return this.button_group.isAllSelected();
},
_assertValue: function (val) {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
},
setStartValue: function (v) {
this._startValue = v;
},
setValue: function (v) {
this.storeValue = v || {};
this._assertValue(this.storeValue);
this.button_group.setValue(this.storeValue);
},
getValue: function () {
return this.button_group.getValue();
},
getAllButtons: function () {
return this.button_group.getAllButtons();
},
empty: function () {
this.button_group.empty();
},
populate: function (items) {
arguments[0] = this._createItems(items);
this.button_group.populate.apply(this.button_group, arguments);
},
resetHeight: function (h) {
this.button_group.resetHeight(h - 10);
},
resetWidth: function (w) {
this.button_group.resetWidth(w);
}
});
BI.MultiSelectLoader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_loader", BI.MultiSelectLoader);
/***/ }),
/* 582 */
/***/ (function(module, exports) {
/**
* 多选加载数据面板
* Created by guy on 15/11/2.
* @class BI.MultiSelectNoBarLoader
* @extends Widget
*/
BI.MultiSelectNoBarLoader = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectNoBarLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-loader",
logic: {
dynamic: true
},
el: {
height: 400
},
valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectNoBarLoader.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = opts.value || {};
this._assertValue(this.storeValue);
this.button_group = BI.createWidget(BI.extend({
type: "bi.list_pane",
onLoaded: opts.onLoaded,
el: {
type: "bi.loader",
isDefaultInit: false,
logic: {
dynamic: true,
scrolly: true
},
el: {
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
behaviors: {
redmark: function () {
return true;
}
},
layouts: [{
type: "bi.vertical"
}]
}
},
itemsCreator: function (op, callback) {
var startValue = self._startValue;
self.storeValue && (op = BI.extend(op || {}, {
selectedValues: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi
? self.storeValue.value.concat(startValue) : self.storeValue.value
}));
opts.itemsCreator(op, function (ob) {
hasNext = ob.hasNext;
var firstItems = [];
if (op.times === 1 && self.storeValue) {
var json = BI.map(self.storeValue.value, function (i, v) {
var txt = opts.valueFormatter(v) || v;
return {
text: txt,
value: v,
title: txt,
selected: self.storeValue.type === BI.Selection.Multi
};
});
if (BI.isKey(self._startValue) && !BI.contains(self.storeValue.value, self._startValue)) {
var txt = opts.valueFormatter(startValue) || startValue;
json.unshift({
text: txt,
value: startValue,
title: txt,
selected: true
});
}
firstItems = self._createItems(json);
}
callback(firstItems.concat(self._createItems(ob.items)), ob.keyword || "");
if (op.times === 1 && self.storeValue) {
BI.isKey(startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, startValue) : BI.pushDistinct(self.storeValue.value, startValue));
self.setValue(self.storeValue);
}
(op.times === 1) && self._scrollToTop();
});
},
hasNext: function () {
return hasNext;
},
value: this.storeValue
}, opts.el));
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.button_group],
vgap: 5
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.button_group.on(BI.SelectList.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectNoBarLoader.EVENT_CHANGE, arguments);
});
},
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.multi_select_item",
cls: "bi-list-item-active",
logic: this.options.logic,
height: 24,
iconWrapperWidth: 36
});
},
_scrollToTop: function () {
var self = this;
BI.delay(function () {
self.button_group.element.scrollTop(0);
}, 30);
},
_assertValue: function (val) {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
},
setStartValue: function (v) {
this._startValue = v;
},
setValue: function (v) {
this.storeValue = v || {};
this._assertValue(this.storeValue);
this.button_group.setValue(this.storeValue.value);
},
getValue: function () {
return {
type: BI.Selection.Multi,
value: this.button_group.getValue()
};
},
getAllButtons: function () {
return this.button_group.getAllButtons();
},
empty: function () {
this.button_group.empty();
},
populate: function (items) {
arguments[0] = this._createItems(items);
this.button_group.populate.apply(this.button_group, arguments);
},
resetHeight: function (h) {
this.button_group.element.css({"max-height": h + "px"});
},
resetWidth: function () {
}
});
BI.MultiSelectNoBarLoader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_no_bar_loader", BI.MultiSelectNoBarLoader);
/***/ }),
/* 583 */
/***/ (function(module, exports) {
/**
* 带加载的多选下拉面板
* @class BI.MultiSelectPopupView
* @extends Widget
*/
BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectPopupView.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-popup-view",
maxWidth: "auto",
minWidth: 135,
maxHeight: 400,
valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectPopupView.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.loader = BI.createWidget({
type: "bi.multi_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
type: "bi.multi_popup_view",
stopPropagation: false,
maxWidth: opts.maxWidth,
minWidth: opts.minWidth,
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectPopupView.EVENT_CHANGE);
});
this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON, function (index) {
switch (index) {
case 0:
self.fireEvent(BI.MultiSelectPopupView.EVENT_CLICK_CLEAR);
break;
case 1:
self.fireEvent(BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM);
break;
}
});
},
isAllSelected: function () {
return this.loader.isAllSelected();
},
setStartValue: function (v) {
this.loader.setStartValue(v);
},
setValue: function (v) {
this.popupView.setValue(v);
},
getValue: function () {
return this.popupView.getValue();
},
populate: function (items) {
this.popupView.populate.apply(this.popupView, arguments);
},
resetHeight: function (h) {
this.popupView.resetHeight(h);
},
resetWidth: function (w) {
this.popupView.resetWidth(w);
}
});
BI.MultiSelectPopupView.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM";
BI.MultiSelectPopupView.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR";
BI.shortcut("bi.multi_select_popup_view", BI.MultiSelectPopupView);
/***/ }),
/* 584 */
/***/ (function(module, exports) {
/**
* 带加载的多选下拉面板
* @class BI.MultiSelectPopupView
* @extends Widget
*/
BI.MultiSelectNoBarPopupView = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectNoBarPopupView.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-popup-view",
maxWidth: "auto",
minWidth: 135,
maxHeight: 400,
valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectNoBarPopupView.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.loader = BI.createWidget({
type: "bi.multi_select_no_bar_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
type: "bi.multi_popup_view",
stopPropagation: false,
maxWidth: opts.maxWidth,
minWidth: opts.minWidth,
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CHANGE);
});
this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON, function (index) {
switch (index) {
case 0:
self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CLICK_CLEAR);
break;
case 1:
self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CLICK_CONFIRM);
break;
}
});
},
setStartValue: function (v) {
this.loader.setStartValue(v);
},
setValue: function (v) {
this.popupView.setValue(v);
},
getValue: function () {
return this.popupView.getValue();
},
populate: function (items) {
this.popupView.populate.apply(this.popupView, arguments);
},
resetHeight: function (h) {
this.popupView.resetHeight(h);
},
resetWidth: function (w) {
this.popupView.resetWidth(w);
}
});
BI.MultiSelectNoBarPopupView.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiSelectNoBarPopupView.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM";
BI.MultiSelectNoBarPopupView.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR";
BI.shortcut("bi.multi_select_no_bar_popup_view", BI.MultiSelectNoBarPopupView);
/***/ }),
/* 585 */
/***/ (function(module, exports) {
/**
*
* 复选下拉框
* @class BI.MultiSelectTrigger
* @extends BI.Trigger
*/
BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
constants: {
height: 14,
rgap: 4,
lgap: 4
},
_defaultConfig: function () {
return BI.extend(BI.MultiSelectTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-trigger bi-border bi-border-radius",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
searcher: {},
switcher: {},
adapter: null,
masker: {},
allowEdit: true
});
},
_init: function () {
BI.MultiSelectTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (o.height) {
this.setHeight(o.height - 2);
}
this.searcher = BI.createWidget(o.searcher, {
type: "bi.multi_select_searcher",
height: o.height,
text: o.text,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
watermark: o.watermark,
popup: {},
adapter: o.adapter,
masker: o.masker,
value: o.value
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_START);
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_PAUSE, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_PAUSE);
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_SEARCHING, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_SEARCHING, arguments);
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_STOP, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_STOP);
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_CHANGE, arguments);
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_BLUR, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_BLUR);
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_FOCUS);
});
this.wrapNumberCounter = BI.createWidget({
type: "bi.layout"
});
this.wrapper = BI.createWidget({
type: "bi.htape",
element: this,
items: [
{
el: this.searcher,
width: "fill"
}, {
el: this.wrapNumberCounter,
width: 0
}, {
el: BI.createWidget(),
width: 24
}]
});
!o.allowEdit && BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.text",
title: function () {
return self.searcher.getState();
}
},
left: 0,
right: 24,
top: 0,
bottom: 0
}]
});
},
/**
* 重新调整numberCounter的空白占位符
*/
refreshPlaceHolderWidth: function(width) {
this.wrapper.attr("items")[1].width = width;
this.wrapper.resize();
},
getSearcher: function () {
return this.searcher;
},
stopEditing: function () {
this.searcher.stopSearch();
},
setAdapter: function (adapter) {
this.searcher.setAdapter(adapter);
},
setValue: function (ob) {
this.searcher.setValue(ob);
},
getKey: function () {
return this.searcher.getKey();
},
getValue: function () {
return this.searcher.getValue();
}
});
BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK = "EVENT_TRIGGER_CLICK";
BI.MultiSelectTrigger.EVENT_COUNTER_CLICK = "EVENT_COUNTER_CLICK";
BI.MultiSelectTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiSelectTrigger.EVENT_START = "EVENT_START";
BI.MultiSelectTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectTrigger.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiSelectTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW = "EVENT_BEFORE_COUNTER_POPUPVIEW";
BI.MultiSelectTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.MultiSelectTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.shortcut("bi.multi_select_trigger", BI.MultiSelectTrigger);
/***/ }),
/* 586 */
/***/ (function(module, exports) {
/**
*
* 在搜索框中输入文本弹出的面板
* @class BI.MultiSelectSearchInsertPane
* @extends Widget
*/
BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, {
constants: {
height: 24,
lgap: 10,
tgap: 5
},
_defaultConfig: function () {
return BI.extend(BI.MultiSelectSearchInsertPane.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-search-pane bi-card",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
keywordGetter: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectSearchInsertPane.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.tooltipClick = BI.createWidget({
type: "bi.label",
invisible: true,
text: BI.i18nText("BI-Click_Blank_To_Select"),
cls: "multi-select-toolbar",
height: this.constants.height
});
this.addNotMatchTip = BI.createWidget({
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: this.constants.height,
cls: "bi-high-light",
hgap: 5,
handler: function () {
self.fireEvent(BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM, o.keywordGetter());
}
});
this.loader = BI.createWidget({
type: "bi.multi_select_search_loader",
keywordGetter: o.keywordGetter,
valueFormatter: o.valueFormatter,
itemsCreator: function (op, callback) {
o.itemsCreator.apply(self, [op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.resizer = BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
type: "bi.vertical",
items: [this.tooltipClick, this.addNotMatchTip],
height: this.constants.height
}, {
el: this.loader
}]
});
},
setKeyword: function (keyword) {
var o = this.options;
var hasSameValue = BI.some(this.loader.getAllButtons(), function (idx, btn) {
return keyword === (o.valueFormatter(btn.getValue()) || btn.getValue());
});
var isMatchTipVisible = this.loader.getAllButtons().length > 0 && hasSameValue;
this.tooltipClick.setVisible(isMatchTipVisible);
this.addNotMatchTip.setVisible(!isMatchTipVisible);
!isMatchTipVisible && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
isAllSelected: function () {
return this.loader.isAllSelected();
},
hasMatched: function () {
return this.tooltipClick.isVisible();
},
setValue: function (v) {
this.loader.setValue(v);
},
getValue: function () {
return this.loader.getValue();
},
empty: function () {
this.loader.empty();
},
populate: function (items) {
this.loader.populate.apply(this.loader, arguments);
}
});
BI.MultiSelectSearchInsertPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multi_select_search_insert_pane", BI.MultiSelectSearchInsertPane);
/***/ }),
/* 587 */
/***/ (function(module, exports) {
/**
* 多选加载数据搜索loader面板
* Created by guy on 15/11/4.
* @class BI.MultiSelectSearchLoader
* @extends Widget
*/
BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectSearchLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-search-loader",
itemsCreator: BI.emptyFn,
keywordGetter: BI.emptyFn,
valueFormatter: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectSearchLoader.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = BI.deepClone(opts.value);
this.button_group = BI.createWidget({
type: "bi.select_list",
toolbar: {
type: "bi.multi_select_bar",
cls: "bi-list-item-active",
iconWrapperWidth: 36
},
element: this,
logic: {
dynamic: false
},
value: opts.value,
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {
type: "bi.loader",
isDefaultInit: false,
logic: {
dynamic: true,
scrolly: true
},
el: {
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
behaviors: {
redmark: function () {
return true;
}
},
layouts: [{
type: "bi.vertical"
}]
}
}
},
itemsCreator: function (op, callback) {
self.storeValue && (op = BI.extend(op || {}, {
selectedValues: self.storeValue.value
}));
opts.itemsCreator(op, function (ob) {
var keyword = ob.keyword = opts.keywordGetter();
hasNext = ob.hasNext;
var firstItems = [];
if (op.times === 1 && self.storeValue) {
var json = self._filterValues(self.storeValue);
firstItems = self._createItems(json);
}
callback(firstItems.concat(self._createItems(ob.items)), keyword);
if (op.times === 1 && self.storeValue) {
self.setValue(self.storeValue);
}
});
},
hasNext: function () {
return hasNext;
}
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.button_group.on(BI.SelectList.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, arguments);
});
},
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.multi_select_item",
logic: {
dynamic: false
},
height: 24,
selected: this.isAllSelected(),
cls: "bi-list-item-active",
iconWrapperWidth: 36
});
},
isAllSelected: function () {
return this.button_group.isAllSelected();
},
_filterValues: function (src) {
var o = this.options;
var keyword = o.keywordGetter();
var values = BI.deepClone(src.value) || [];
var newValues = BI.map(values, function (i, v) {
return {
text: o.valueFormatter(v) || v,
value: v
};
});
if (BI.isKey(keyword)) {
var search = BI.Func.getSearchResult(newValues, keyword);
values = search.match.concat(search.find);
}
return BI.map(values, function (i, v) {
return {
text: v.text,
title: v.text,
value: v.value,
selected: src.type === BI.Selection.All
};
});
},
setValue: function (v) {
// 暂存的值一定是新的值,不然v改掉后,storeValue也跟着改了
this.storeValue = BI.deepClone(v);
this.button_group.setValue(v);
},
getValue: function () {
return this.button_group.getValue();
},
getAllButtons: function () {
return this.button_group.getAllButtons();
},
empty: function () {
this.button_group.empty();
},
populate: function (items) {
this.button_group.populate.apply(this.button_group, arguments);
},
resetHeight: function (h) {
this.button_group.resetHeight(h);
},
resetWidth: function (w) {
this.button_group.resetWidth(w);
}
});
BI.MultiSelectSearchLoader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_search_loader", BI.MultiSelectSearchLoader);
/***/ }),
/* 588 */
/***/ (function(module, exports) {
/**
*
* 在搜索框中输入文本弹出的面板
* @class BI.MultiSelectSearchPane
* @extends Widget
*/
BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
constants: {
height: 24,
lgap: 10,
tgap: 5
},
_defaultConfig: function () {
return BI.extend(BI.MultiSelectSearchPane.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-search-pane bi-card",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
keywordGetter: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectSearchPane.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.tooltipClick = BI.createWidget({
type: "bi.label",
invisible: true,
text: BI.i18nText("BI-Click_Blank_To_Select"),
cls: "multi-select-toolbar",
height: this.constants.height
});
this.loader = BI.createWidget({
type: "bi.multi_select_search_loader",
keywordGetter: o.keywordGetter,
valueFormatter: o.valueFormatter,
itemsCreator: function (op, callback) {
o.itemsCreator.apply(self, [op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.resizer = BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.tooltipClick,
height: 0
}, {
el: this.loader
}]
});
this.tooltipClick.setVisible(false);
},
setKeyword: function (keyword) {
var btn, o = this.options;
var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === (o.valueFormatter(btn.getValue()) || btn.getValue()));
if (isVisible !== this.tooltipClick.isVisible()) {
this.tooltipClick.setVisible(isVisible);
this.resizer.attr("items")[0].height = (isVisible ? this.constants.height : 0);
this.resizer.resize();
}
},
isAllSelected: function () {
return this.loader.isAllSelected();
},
hasMatched: function () {
return this.tooltipClick.isVisible();
},
setValue: function (v) {
this.loader.setValue(v);
},
getValue: function () {
return this.loader.getValue();
},
empty: function () {
this.loader.empty();
},
populate: function (items) {
this.loader.populate.apply(this.loader, arguments);
}
});
BI.MultiSelectSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_search_pane", BI.MultiSelectSearchPane);
/***/ }),
/* 589 */
/***/ (function(module, exports) {
/**
* 查看已选按钮
* Created by guy on 15/11/3.
* @class BI.MultiSelectCheckSelectedButton
* @extends BI.Single
*/
BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectCheckSelectedButton.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-check-selected-button",
itemsCreator: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectCheckSelectedButton.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.numberCounter = BI.createWidget({
type: "bi.text_button",
element: this,
hgap: 4,
text: "0",
textAlign: "center",
textHeight: 16,
cls: "bi-high-light-background count-tip"
});
this.numberCounter.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.numberCounter.on(BI.TextButton.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectCheckSelectedButton.EVENT_CHANGE, arguments);
});
this.numberCounter.element.hover(function () {
self.numberCounter.setTag(self.numberCounter.getText());
self.numberCounter.setText(BI.i18nText("BI-Check_Selected"));
}, function () {
self.numberCounter.setText(self.numberCounter.getTag());
});
this.setVisible(false);
if(BI.isNotNull(o.value)){
this.setValue(o.value);
}
},
_populate: function (ob) {
var self = this, o = this.options;
if (ob.type === BI.Selection.All) {
o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH
}, function (res) {
var length = res.count - ob.value.length;
BI.nextTick(function () {
self.numberCounter.setText(length);
self.setVisible(length > 0);
});
});
return;
}
BI.nextTick(function () {
self.numberCounter.setText(ob.value.length);
self.setVisible(ob.value.length > 0);
});
},
_assertValue: function (ob) {
ob || (ob = {});
ob.type || (ob.type = BI.Selection.Multi);
ob.value || (ob.value = []);
return ob;
},
setValue: function (ob) {
ob = this._assertValue(ob);
this.options.value = ob;
this._populate(ob);
},
populate: function () {
this._populate(this._assertValue(this.options.value));
},
getValue: function () {
}
});
BI.MultiSelectCheckSelectedButton.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_check_selected_button", BI.MultiSelectCheckSelectedButton);
/***/ }),
/* 590 */
/***/ (function(module, exports) {
/**
* 多选输入框
* Created by guy on 15/11/3.
* @class BI.MultiSelectEditor
* @extends Widget
*/
BI.MultiSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-editor",
el: {},
watermark: BI.i18nText("BI-Basic_Search")
});
},
_init: function () {
BI.MultiSelectEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.state_editor",
element: this,
height: o.height,
watermark: o.watermark,
allowBlank: true,
value: o.value,
defaultText: o.text,
text: o.text,
tipType: o.tipType,
warningTitle: o.warningTitle,
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.StateEditor.EVENT_PAUSE, function () {
self.fireEvent(BI.MultiSelectEditor.EVENT_PAUSE);
});
this.editor.on(BI.StateEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectEditor.EVENT_FOCUS);
});
this.editor.on(BI.StateEditor.EVENT_BLUR, function () {
self.fireEvent(BI.MultiSelectEditor.EVENT_BLUR);
});
},
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.blur();
},
setState: function (state) {
this.editor.setState(state);
},
setValue: function (v) {
this.editor.setValue(v);
},
setTipType: function (v) {
this.editor.setTipType(v);
},
getValue: function () {
var v = this.editor.getState();
if (BI.isArray(v) && v.length > 0) {
return v[v.length - 1];
}
return "";
},
getState: function () {
return this.editor.getText();
},
getKeywords: function () {
var val = this.editor.getLastChangedValue();
var keywords = val.match(/[\S]+/g);
if (BI.isEndWithBlank(val)) {
return keywords.concat([" "]);
}
return keywords;
},
populate: function (items) {
}
});
BI.MultiSelectEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectEditor.EVENT_BLUR = "EVENT_BLUR";
BI.MultiSelectEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.shortcut("bi.multi_select_editor", BI.MultiSelectEditor);
/***/ }),
/* 591 */
/***/ (function(module, exports) {
/**
* searcher
* Created by guy on 15/11/3.
* @class BI.MultiSelectInsertSearcher
* @extends Widget
*/
BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectInsertSearcher.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-searcher",
itemsCreator: BI.emptyFn,
el: {},
popup: {},
valueFormatter: BI.emptyFn,
adapter: null,
masker: {},
text: BI.i18nText("BI-Basic_Please_Select")
});
},
_init: function () {
BI.MultiSelectInsertSearcher.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
text: o.text,
listeners: [{
eventName: BI.MultiSelectEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_BLUR);
}
}]
});
this.searcher = BI.createWidget({
type: "bi.searcher",
allowSearchBlank: false,
element: this,
height: o.height,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
callback();
},
el: this.editor,
popup: BI.extend({
type: "bi.multi_select_search_insert_pane",
valueFormatter: o.valueFormatter,
keywordGetter: function () {
return self.editor.getValue();
},
itemsCreator: function (op, callback) {
var keyword = self.editor.getValue();
op.keywords = [keyword];
this.setKeyword(keyword);
o.itemsCreator(op, callback);
},
value: o.value,
listeners: [{
eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,
action: function () {
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM);
}
}]
}, o.popup),
adapter: o.adapter,
masker: o.masker
});
this.searcher.on(BI.Searcher.EVENT_START, function () {
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_START);
});
this.searcher.on(BI.Searcher.EVENT_PAUSE, function () {
if (this.hasMatched()) {
}
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_PAUSE);
});
this.searcher.on(BI.Searcher.EVENT_STOP, function () {
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_STOP);
});
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_CHANGE, arguments);
});
this.searcher.on(BI.Searcher.EVENT_SEARCHING, function () {
var keywords = this.getKeywords();
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_SEARCHING, keywords);
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
}
},
adjustView: function () {
this.searcher.adjustView();
},
isSearching: function () {
return this.searcher.isSearching();
},
stopSearch: function () {
this.searcher.stopSearch();
},
getKeyword: function () {
return this.editor.getValue();
},
hasMatched: function () {
return this.searcher.hasMatched();
},
hasChecked: function () {
return this.searcher.getView() && this.searcher.getView().hasChecked();
},
setAdapter: function (adapter) {
this.searcher.setAdapter(adapter);
},
setState: function (ob) {
var o = this.options;
ob || (ob = {});
ob.value || (ob.value = []);
if (ob.type === BI.Selection.All) {
if (ob.value.length === 0) {
this.editor.setState(BI.Selection.All);
} else if (BI.size(ob.assist) <= 20) {
var state = "";
BI.each(ob.assist, function (i, v) {
if (i === 0) {
state += "" + (o.valueFormatter(v + "") || v);
} else {
state += "," + (o.valueFormatter(v + "") || v);
}
});
this.editor.setState(state);
} else {
this.editor.setState(BI.Selection.Multi);
}
} else {
if (ob.value.length === 0) {
this.editor.setState(BI.Selection.None);
} else if (BI.size(ob.value) <= 20) {
var state = "";
BI.each(ob.value, function (i, v) {
if (i === 0) {
state += "" + (o.valueFormatter(v + "") || v);
} else {
state += "," + (o.valueFormatter(v + "") || v);
}
});
this.editor.setState(state);
} else {
this.editor.setState(BI.Selection.Multi);
}
}
},
getState: function() {
return this.editor.getState();
},
setValue: function (ob) {
this.setState(ob);
this.searcher.setValue(ob);
},
getKey: function () {
return this.editor.getValue();
},
getValue: function () {
return this.searcher.getValue();
},
populate: function (items) {
this.searcher.populate.apply(this.searcher, arguments);
}
});
BI.MultiSelectInsertSearcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.MultiSelectInsertSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiSelectInsertSearcher.EVENT_START = "EVENT_START";
BI.MultiSelectInsertSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectInsertSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiSelectInsertSearcher.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiSelectInsertSearcher.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectInsertSearcher.EVENT_BLUR = "EVENT_BLUR";
BI.shortcut("bi.multi_select_insert_searcher", BI.MultiSelectInsertSearcher);
/***/ }),
/* 592 */
/***/ (function(module, exports) {
/**
* searcher
* Created by guy on 15/11/3.
* @class BI.MultiSelectSearcher
* @extends Widget
*/
BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectSearcher.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-searcher",
itemsCreator: BI.emptyFn,
el: {},
popup: {},
valueFormatter: BI.emptyFn,
adapter: null,
masker: {},
text: BI.i18nText("BI-Basic_Please_Select")
});
},
_init: function () {
BI.MultiSelectSearcher.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
height: o.height,
text: o.text,
watermark: o.watermark,
listeners: [{
eventName: BI.MultiSelectEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR);
}
}]
});
this.searcher = BI.createWidget({
type: "bi.searcher",
allowSearchBlank: false,
element: this,
height: o.height,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
callback();
},
el: this.editor,
popup: BI.extend({
type: "bi.multi_select_search_pane",
valueFormatter: o.valueFormatter,
keywordGetter: function () {
return self.editor.getValue();
},
itemsCreator: function (op, callback) {
var keyword = self.editor.getValue();
op.keywords = [keyword];
this.setKeyword(keyword);
o.itemsCreator(op, callback);
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker
});
this.searcher.on(BI.Searcher.EVENT_START, function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_START);
});
this.searcher.on(BI.Searcher.EVENT_PAUSE, function () {
if (this.hasMatched()) {
}
self.fireEvent(BI.MultiSelectSearcher.EVENT_PAUSE);
});
this.searcher.on(BI.Searcher.EVENT_STOP, function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_STOP);
});
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_CHANGE, arguments);
});
this.searcher.on(BI.Searcher.EVENT_SEARCHING, function () {
var keywords = this.getKeywords();
self.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING, keywords);
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
}
},
adjustView: function () {
this.searcher.adjustView();
},
isSearching: function () {
return this.searcher.isSearching();
},
stopSearch: function () {
this.searcher.stopSearch();
},
getKeyword: function () {
return this.editor.getValue();
},
hasMatched: function () {
return this.searcher.hasMatched();
},
hasChecked: function () {
return this.searcher.getView() && this.searcher.getView().hasChecked();
},
setAdapter: function (adapter) {
this.searcher.setAdapter(adapter);
},
setState: function (ob) {
var o = this.options;
ob || (ob = {});
ob.value || (ob.value = []);
if (ob.type === BI.Selection.All) {
if (ob.value.length === 0) {
this.editor.setState(BI.Selection.All);
} else if (BI.size(ob.assist) <= 20) {
var state = "";
BI.each(ob.assist, function (i, v) {
if (i === 0) {
state += "" + (o.valueFormatter(v + "") || v);
} else {
state += "," + (o.valueFormatter(v + "") || v);
}
});
this.editor.setState(state);
} else {
this.editor.setState(BI.Selection.Multi);
}
} else {
if (ob.value.length === 0) {
this.editor.setState(BI.Selection.None);
} else if (BI.size(ob.value) <= 20) {
var state = "";
BI.each(ob.value, function (i, v) {
if (i === 0) {
state += "" + (o.valueFormatter(v + "") || v);
} else {
state += "," + (o.valueFormatter(v + "") || v);
}
});
this.editor.setState(state);
} else {
this.editor.setState(BI.Selection.Multi);
}
}
},
getState: function() {
return this.editor.getState();
},
setValue: function (ob) {
this.setState(ob);
this.searcher.setValue(ob);
},
getKey: function () {
return this.editor.getValue();
},
getValue: function () {
return this.searcher.getValue();
},
populate: function (items) {
this.searcher.populate.apply(this.searcher, arguments);
}
});
BI.MultiSelectSearcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.MultiSelectSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiSelectSearcher.EVENT_START = "EVENT_START";
BI.MultiSelectSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiSelectSearcher.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectSearcher.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectSearcher.EVENT_BLUR = "EVENT_BLUR";
BI.shortcut("bi.multi_select_searcher", BI.MultiSelectSearcher);
/***/ }),
/* 593 */
/***/ (function(module, exports) {
/**
* 查看已选switcher
* Created by guy on 15/11/3.
* @class BI.MultiSelectCheckSelectedSwitcher
* @extends Widget
*/
BI.MultiSelectCheckSelectedSwitcher = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectCheckSelectedSwitcher.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-check-selected-switcher",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
el: {},
popup: {},
adapter: null,
masker: {}
});
},
_init: function () {
BI.MultiSelectCheckSelectedSwitcher.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.button = BI.createWidget(o.el, {
type: "bi.multi_select_check_selected_button",
itemsCreator: o.itemsCreator,
value: o.value
});
this.button.on(BI.Events.VIEW, function () {
self.fireEvent(BI.Events.VIEW, arguments);
});
this.switcher = BI.createWidget({
type: "bi.switcher",
toggle: false,
element: this,
el: this.button,
popup: BI.extend({
type: "bi.multi_select_check_pane",
valueFormatter: o.valueFormatter,
itemsCreator: o.itemsCreator,
onClickContinueSelect: function () {
self.switcher.hideView();
},
ref: function (_ref) {
self.checkPane = _ref;
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker
});
this.switcher.on(BI.Switcher.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE);
});
this.switcher.on(BI.Switcher.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW);
});
this.switcher.on(BI.Switcher.EVENT_AFTER_POPUPVIEW, function () {
var me = this;
BI.nextTick(function () {
me.populate();
});
});
},
adjustView: function () {
this.switcher.adjustView();
},
hideView: function () {
this.switcher.empty();
this.switcher.hideView();
},
setAdapter: function (adapter) {
this.switcher.setAdapter(adapter);
},
setValue: function (v) {
this.switcher.setValue(v);
},
// 与setValue的区别是只更新查看已选面板的的selectedValue, 不会更新按钮的计数
updateSelectedValue: function (v) {
this.checkPane.setValue(v);
},
setButtonChecked: function (v) {
this.button.setValue(v);
},
getValue: function () {
},
populate: function (items) {
this.switcher.populate.apply(this.switcher, arguments);
},
populateSwitcher: function () {
this.button.populate.apply(this.button, arguments);
}
});
BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";
BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multi_select_check_selected_switcher", BI.MultiSelectCheckSelectedSwitcher);
/***/ }),
/* 594 */
/***/ (function(module, exports) {
/**
* Created by zcf_1 on 2017/5/2.
*/
BI.MultiSelectInsertList = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectInsertList.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-insert-list",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectInsertList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value || {};
var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));
// self.trigger.setValue(self.storeValue);
};
this.adapter = BI.createWidget({
type: "bi.multi_select_loader",
cls: "popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
logic: {
dynamic: true
},
// onLoaded: o.onLoaded,
el: {},
value: o.value
});
this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE, function () {
self.storeValue = this.getValue();
assertShowValue();
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
this.searcherPane = BI.createWidget({
type: "bi.multi_select_search_insert_pane",
cls: "bi-border-left bi-border-right bi-border-bottom",
valueFormatter: o.valueFormatter,
keywordGetter: function () {
return self.trigger.getKeyword();
},
itemsCreator: function (op, callback) {
var keyword = self.trigger.getKeyword();
if (BI.isNotEmptyString(keyword)) {
op.keywords = [keyword];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
},
listeners: [{
eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,
action: function () {
var keyword = self.trigger.getKeyword();
if (!self.trigger.hasMatched()) {
if (self.storeValue.type === BI.Selection.Multi) {
BI.pushDistinct(self.storeValue.value, keyword);
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self.adapter.populate();
if (self.storeValue.type === BI.Selection.Multi) {
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
}
}
}
}]
});
this.searcherPane.setVisible(false);
this.trigger = BI.createWidget({
type: "bi.searcher",
allowSearchBlank: false,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
callback();
},
adapter: this.adapter,
popup: this.searcherPane,
height: 200,
masker: false,
listeners: [{
eventName: BI.Searcher.EVENT_START,
action: function () {
self._showSearcherPane();
self._setStartValue("");
this.setValue(BI.deepClone(self.storeValue));
}
}, {
eventName: BI.Searcher.EVENT_STOP,
action: function () {
self._showAdapter();
self._setStartValue("");
self.adapter.setValue(self.storeValue);
// 需要刷新回到初始界面,否则搜索的结果不能放在最前面
self.adapter.populate();
}
}, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
var keyword = this.getKeyword();
if (this.hasMatched()) {
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
if (self.storeValue.type === BI.Selection.Multi) {
BI.pushDistinct(self.storeValue.value, keyword);
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
self._showAdapter();
}
}, {
eventName: BI.Searcher.EVENT_SEARCHING,
action: function () {
var keywords = this.getKeywords();
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.adapter.setValue(self.storeValue);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
} else {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
}
}, {
eventName: BI.Searcher.EVENT_CHANGE,
action: function (value, obj) {
if (obj instanceof BI.MultiSelectBar) {
self._joinAll(this.getValue(), function () {
assertShowValue();
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
} else {
self._join(this.getValue(), function () {
assertShowValue();
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
}
}
}],
value: o.value
});
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.trigger,
height: 24
}, {
el: this.adapter,
height: "fill"
}]
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.searcherPane,
top: 30,
bottom: 0,
left: 0,
right: 0
}]
});
},
_showAdapter: function () {
this.adapter.setVisible(true);
this.searcherPane.setVisible(false);
},
_showSearcherPane: function () {
this.searcherPane.setVisible(true);
this.adapter.setVisible(false);
},
_defaultState: function () {
this.trigger.stopEditing();
},
_assertValue: function (val) {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
},
_makeMap: function (values) {
return BI.makeObject(values || []);
},
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val);
}
});
callback();
}
},
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: [self.trigger.getKeyword()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
callback();
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];
BI.each(items, function (i, item) {
if (BI.isNotNull(selectedMap[items[i]])) {
delete selectedMap[items[i]];
}
if (BI.isNull(notSelectedMap[items[i]])) {
newItems.push(item);
}
});
self.storeValue.value = newItems.concat(BI.values(selectedMap));
callback();
});
},
_join: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this._assertValue(this.storeValue);
if (this.storeValue.type === res.type) {
var map = this._makeMap(this.storeValue.value);
BI.each(res.value, function (i, v) {
if (!map[v]) {
self.storeValue.value.push(v);
map[v] = v;
}
});
var change = false;
BI.each(res.assist, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
callback();
return;
}
this._joinAll(res, callback);
},
_setStartValue: function (value) {
this._startValue = value;
this.adapter.setStartValue(value);
},
isAllSelected: function () {
return this.adapter.isAllSelected();
},
resize: function () {
// this.trigger.getCounter().adjustView();
// this.trigger.adjustView();
},
setValue: function (v) {
this.storeValue = v || {};
this._assertValue(this.storeValue);
this.adapter.setValue(this.storeValue);
this.trigger.setValue(this.storeValue);
},
getValue: function () {
return BI.deepClone(this.storeValue);
},
populate: function () {
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
});
BI.extend(BI.MultiSelectInsertList, {
REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1
});
BI.MultiSelectInsertList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_insert_list", BI.MultiSelectInsertList);
/***/ }),
/* 595 */
/***/ (function(module, exports) {
/**
* Created by zcf_1 on 2017/5/2.
*/
BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectInsertNoBarList.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-insert-list",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectInsertNoBarList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = {
type: BI.Selection.Multi,
value: o.value || []
};
var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));
// self.trigger.setValue(self.storeValue);
};
this.adapter = BI.createWidget({
type: "bi.multi_select_no_bar_loader",
cls: "popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
logic: {
dynamic: false
},
// onLoaded: o.onLoaded,
el: {},
value: {
type: BI.Selection.Multi,
value: o.value || []
}
});
this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE, function () {
self.storeValue = this.getValue();
assertShowValue();
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
this.searcherPane = BI.createWidget({
type: "bi.multi_select_search_insert_pane",
cls: "bi-border-left bi-border-right bi-border-bottom",
valueFormatter: o.valueFormatter,
keywordGetter: function () {
return self.trigger.getKeyword();
},
itemsCreator: function (op, callback) {
var keyword = self.trigger.getKeyword();
if (BI.isNotEmptyString(keyword)) {
op.keywords = [keyword];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
},
listeners: [{
eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,
action: function () {
var keyword = self.trigger.getKeyword();
if (!self.trigger.hasMatched()) {
if (self.storeValue.type === BI.Selection.Multi) {
BI.pushDistinct(self.storeValue.value, keyword);
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self.adapter.populate();
if (self.storeValue.type === BI.Selection.Multi) {
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
}
}
}
}]
});
this.searcherPane.setVisible(false);
this.trigger = BI.createWidget({
type: "bi.searcher",
allowSearchBlank: false,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
callback();
},
adapter: this.adapter,
popup: this.searcherPane,
height: 200,
masker: false,
listeners: [{
eventName: BI.Searcher.EVENT_START,
action: function () {
self._showSearcherPane();
self._setStartValue("");
this.setValue(BI.deepClone(self.storeValue));
}
}, {
eventName: BI.Searcher.EVENT_STOP,
action: function () {
self._showAdapter();
self._setStartValue("");
self.adapter.setValue(self.storeValue);
// 需要刷新回到初始界面,否则搜索的结果不能放在最前面
self.adapter.populate();
}
}, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
var keyword = this.getKeyword();
if (this.hasMatched()) {
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
if (self.storeValue.type === BI.Selection.Multi) {
BI.pushDistinct(self.storeValue.value, keyword);
}
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
}
}, {
eventName: BI.Searcher.EVENT_SEARCHING,
action: function () {
var keywords = this.getKeywords();
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.adapter.setValue(self.storeValue);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
} else {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
}
}, {
eventName: BI.Searcher.EVENT_CHANGE,
action: function (value, obj) {
if (obj instanceof BI.MultiSelectBar) {
self._joinAll(this.getValue(), function () {
assertShowValue();
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
} else {
self._join(this.getValue(), function () {
assertShowValue();
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
}
}
}],
value: {
type: BI.Selection.Multi,
value: o.value || []
}
});
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.trigger,
height: 24
}, {
el: this.adapter,
height: "fill"
}]
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.searcherPane,
top: 30,
bottom: 0,
left: 0,
right: 0
}]
});
},
_showAdapter: function () {
this.adapter.setVisible(true);
this.searcherPane.setVisible(false);
},
_showSearcherPane: function () {
this.searcherPane.setVisible(true);
this.adapter.setVisible(false);
},
_defaultState: function () {
this.trigger.stopEditing();
},
_assertValue: function (val) {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
},
_makeMap: function (values) {
return BI.makeObject(values || []);
},
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val);
}
});
callback();
}
},
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: [self.trigger.getKeyword()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
callback();
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];
BI.each(items, function (i, item) {
if (BI.isNotNull(selectedMap[items[i]])) {
delete selectedMap[items[i]];
}
if (BI.isNull(notSelectedMap[items[i]])) {
newItems.push(item);
}
});
self.storeValue.value = newItems.concat(BI.values(selectedMap));
callback();
});
},
_join: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this._assertValue(this.storeValue);
if (this.storeValue.type === res.type) {
var map = this._makeMap(this.storeValue.value);
BI.each(res.value, function (i, v) {
if (!map[v]) {
self.storeValue.value.push(v);
map[v] = v;
}
});
var change = false;
BI.each(res.assist, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
callback();
return;
}
this._joinAll(res, callback);
},
_setStartValue: function (value) {
this._startValue = value;
this.adapter.setStartValue(value);
},
isAllSelected: function () {
return this.adapter.isAllSelected();
},
resize: function () {
// this.trigger.getCounter().adjustView();
// this.trigger.adjustView();
},
setValue: function (v) {
this.storeValue = {
type: BI.Selection.Multi,
value: v || []
};
this.adapter.setValue(this.storeValue);
this.trigger.setValue(this.storeValue);
},
getValue: function () {
return BI.deepClone(this.storeValue.value);
},
populate: function () {
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
});
BI.extend(BI.MultiSelectInsertNoBarList, {
REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1
});
BI.MultiSelectInsertNoBarList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_insert_no_bar_list", BI.MultiSelectInsertNoBarList);
/***/ }),
/* 596 */
/***/ (function(module, exports) {
/**
* Created by zcf_1 on 2017/5/2.
*/
BI.MultiSelectList = BI.inherit(BI.Widget, {
_constant: {
EDITOR_HEIGHT: 24
},
_defaultConfig: function () {
return BI.extend(BI.MultiSelectList.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-list",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = {};
var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));
// self.trigger.setValue(self.storeValue);
};
this.adapter = BI.createWidget({
type: "bi.multi_select_loader",
cls: "popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
logic: {
dynamic: false
},
// onLoaded: o.onLoaded,
el: {}
});
this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE, function () {
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
});
this.searcherPane = BI.createWidget({
type: "bi.multi_select_search_pane",
cls: "bi-border-left bi-border-right bi-border-bottom",
valueFormatter: o.valueFormatter,
keywordGetter: function () {
return self.trigger.getKeyword();
},
itemsCreator: function (op, callback) {
var keyword = self.trigger.getKeyword();
if (BI.isNotEmptyString(keyword)) {
op.keywords = [keyword];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
}
}
});
this.searcherPane.setVisible(false);
this.trigger = BI.createWidget({
type: "bi.searcher",
allowSearchBlank: false,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
callback();
},
adapter: this.adapter,
popup: this.searcherPane,
height: 200,
masker: false,
listeners: [{
eventName: BI.Searcher.EVENT_START,
action: function () {
self._showSearcherPane();
self._setStartValue("");
this.setValue(BI.deepClone(self.storeValue));
}
}, {
eventName: BI.Searcher.EVENT_STOP,
action: function () {
self._showAdapter();
self._setStartValue("");
self.adapter.setValue(self.storeValue);
// 需要刷新回到初始界面,否则搜索的结果不能放在最前面
self.adapter.populate();
}
}, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
var keyword = this.getKeyword();
if (this.hasMatched()) {
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
}
}
}, {
eventName: BI.Searcher.EVENT_SEARCHING,
action: function () {
var keywords = this.getKeyword();
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.adapter.setValue(self.storeValue);
assertShowValue();
self.adapter.populate();
self._setStartValue("");
} else {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
}
}
}, {
eventName: BI.Searcher.EVENT_CHANGE,
action: function (value, obj) {
if (obj instanceof BI.MultiSelectBar) {
self._joinAll(this.getValue(), function () {
assertShowValue();
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
} else {
self._join(this.getValue(), function () {
assertShowValue();
self.fireEvent(BI.MultiSelectList.EVENT_CHANGE);
});
}
}
}]
});
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.trigger,
height: this._constant.EDITOR_HEIGHT
}, {
el: this.adapter,
height: "fill"
}]
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.searcherPane,
top: this._constant.EDITOR_HEIGHT,
bottom: 0,
left: 0,
right: 0
}]
});
},
_showAdapter: function () {
this.adapter.setVisible(true);
this.searcherPane.setVisible(false);
},
_showSearcherPane: function () {
this.searcherPane.setVisible(true);
this.adapter.setVisible(false);
},
_defaultState: function () {
this.trigger.stopEditing();
},
_assertValue: function (val) {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
},
_makeMap: function (values) {
return BI.makeObject(values || []);
},
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
// 和复选下拉框同步,allData做缓存是会爆炸的
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val);
}
});
self._adjust(callback);
}
},
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];
BI.each(items, function (i, item) {
if (BI.isNotNull(selectedMap[items[i]])) {
delete selectedMap[items[i]];
}
if (BI.isNull(notSelectedMap[items[i]])) {
newItems.push(item);
}
});
self.storeValue.value = newItems.concat(BI.values(selectedMap));
self._adjust(callback);
});
},
_adjust: function (callback) {
var self = this, o = this.options;
if (!this._count) {
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_DATA_LENGTH
}, function (res) {
self._count = res.count;
adjust();
callback();
});
} else {
adjust();
callback();
}
function adjust () {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.Multi,
value: []
};
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.All,
value: []
};
}
}
},
_join: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this._assertValue(this.storeValue);
if (this.storeValue.type === res.type) {
var map = this._makeMap(this.storeValue.value);
BI.each(res.value, function (i, v) {
if (!map[v]) {
self.storeValue.value.push(v);
map[v] = v;
}
});
var change = false;
BI.each(res.assist, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
this._joinAll(res, callback);
},
_setStartValue: function (value) {
this._startValue = value;
this.adapter.setStartValue(value);
},
isAllSelected: function () {
return this.adapter.isAllSelected();
},
resize: function () {
// this.trigger.getCounter().adjustView();
// this.trigger.adjustView();
},
setValue: function (v) {
this.storeValue = v || {};
this._assertValue(this.storeValue);
this.adapter.setValue(this.storeValue);
this.trigger.setValue(this.storeValue);
},
getValue: function () {
return BI.deepClone(this.storeValue);
},
populate: function () {
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
});
BI.extend(BI.MultiSelectList, {
REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1
});
BI.MultiSelectList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_list", BI.MultiSelectList);
/***/ }),
/* 597 */
/***/ (function(module, exports) {
/**
* Created by zcf_1 on 2017/5/11.
*/
BI.MultiSelectTree = BI.inherit(BI.Single, {
_constant: {
EDITOR_HEIGHT: 24
},
_defaultConfig: function () {
return BI.extend(BI.MultiSelectTree.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-tree",
itemsCreator: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectTree.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = {value: {}};
this.adapter = BI.createWidget({
type: "bi.multi_select_tree_popup",
itemsCreator: o.itemsCreator
});
this.adapter.on(BI.MultiSelectTreePopup.EVENT_CHANGE, function () {
if (self.searcher.isSearching()) {
self.storeValue = {value: self.searcherPane.getValue()};
} else {
self.storeValue = {value: self.adapter.getValue()};
}
self.setSelectedValue(self.storeValue.value);
self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE);
});
// 搜索中的时候用的是parttree,同adapter中的synctree不一样
this.searcherPane = BI.createWidget({
type: "bi.multi_tree_search_pane",
cls: "bi-border-left bi-border-right bi-border-bottom",
keywordGetter: function () {
return self.searcher.getKeyword();
},
itemsCreator: function (op, callback) {
op.keyword = self.searcher.getKeyword();
o.itemsCreator(op, callback);
}
});
this.searcherPane.setVisible(false);
this.searcher = BI.createWidget({
type: "bi.searcher",
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
callback({
keyword: self.searcher.getKeyword()
});
},
adapter: this.adapter,
popup: this.searcherPane,
masker: false,
listeners: [{
eventName: BI.Searcher.EVENT_START,
action: function () {
self._showSearcherPane();
// self.storeValue = {value: self.adapter.getValue()};
// self.searcherPane.setSelectedValue(self.storeValue.value);
}
}, {
eventName: BI.Searcher.EVENT_STOP,
action: function () {
self._showAdapter();
// self.storeValue = {value: self.searcherPane.getValue()};
// self.adapter.setSelectedValue(self.storeValue.value);
BI.nextTick(function () {
self.adapter.populate();
});
}
}, {
eventName: BI.Searcher.EVENT_CHANGE,
action: function () {
if (self.searcher.isSearching()) {
self.storeValue = {value: self.searcherPane.getValue()};
} else {
self.storeValue = {value: self.adapter.getValue()};
}
self.setSelectedValue(self.storeValue.value);
self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE);
}
}, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
self._showAdapter();
// BI-64732 pause 和stop一致, 都应该刷新adapter
BI.nextTick(function () {
self.adapter.populate();
});
}
}]
});
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.searcher,
height: this._constant.EDITOR_HEIGHT
}, {
el: this.adapter,
height: "fill"
}]
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.searcherPane,
top: this._constant.EDITOR_HEIGHT,
bottom: 0,
left: 0,
right: 0
}]
});
},
_showAdapter: function () {
this.adapter.setVisible(true);
this.searcherPane.setVisible(false);
},
_showSearcherPane: function () {
this.searcherPane.setVisible(true);
this.adapter.setVisible(false);
},
resize: function () {
},
setSelectedValue: function (v) {
this.storeValue.value = v || {};
this.adapter.setSelectedValue(v);
this.searcherPane.setSelectedValue(v);
this.searcher.setValue({
value: v || {}
});
},
setValue: function (v) {
this.adapter.setValue(v);
},
stopSearch: function () {
this.searcher.stopSearch();
},
updateValue: function (v) {
this.adapter.updateValue(v);
},
getValue: function () {
return this.storeValue.value;
},
populate: function () {
this.searcher.populate.apply(this.searcher, arguments);
this.adapter.populate.apply(this.adapter, arguments);
}
});
BI.MultiSelectTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_tree", BI.MultiSelectTree);
/***/ }),
/* 598 */
/***/ (function(module, exports) {
/**
* Created by zcf on 2016/12/21.
*/
BI.MultiSelectTreePopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiSelectTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-tree-popup bi-border-left bi-border-right bi-border-bottom",
itemsCreator: BI.emptyFn
});
},
_init: function () {
BI.MultiSelectTreePopup.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.popup = BI.createWidget({
type: "bi.async_tree",
element: this,
itemsCreator: o.itemsCreator
});
this.popup.on(BI.TreeView.EVENT_AFTERINIT, function () {
self.fireEvent(BI.MultiSelectTreePopup.EVENT_AFTER_INIT);
});
this.popup.on(BI.TreeView.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectTreePopup.EVENT_CHANGE);
});
},
hasChecked: function () {
return this.popup.hasChecked();
},
getValue: function () {
return this.popup.getValue();
},
setValue: function (v) {
v || (v = {});
this.popup.setValue(v);
},
setSelectedValue: function (v) {
v || (v = {});
this.popup.setSelectedValue(v);
},
updateValue: function (v) {
this.popup.updateValue(v);
this.popup.refresh();
},
populate: function (config) {
this.popup.stroke(config);
}
});
BI.MultiSelectTreePopup.EVENT_AFTER_INIT = "EVENT_AFTER_INIT";
BI.MultiSelectTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_tree_popup", BI.MultiSelectTreePopup);
/***/ }),
/* 599 */
/***/ (function(module, exports) {
/**
*
* @class BI.MultiTreeCheckPane
* @extends BI.Pane
*/
BI.MultiTreeCheckPane = BI.inherit(BI.Pane, {
constants: {
height: 25,
lgap: 10,
tgap: 5
},
_defaultConfig: function () {
return BI.extend(BI.MultiTreeCheckPane.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-tree-check-pane bi-background",
onClickContinueSelect: BI.emptyFn,
el: {
type: "bi.display_tree"
}
});
},
_init: function () {
BI.MultiTreeCheckPane.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.selectedValues = {};
var continueSelect = BI.createWidget({
type: "bi.text_button",
text: BI.i18nText("BI-Continue_Select"),
cls: "multi-tree-check-selected"
});
continueSelect.on(BI.TextButton.EVENT_CHANGE, function () {
opts.onClickContinueSelect();
BI.nextTick(function () {
self.empty();
});
});
var backToPopup = BI.createWidget({
type: "bi.left",
cls: "multi-tree-continue-select",
items: [
{
el: {
type: "bi.label",
text: BI.i18nText("BI-Selected_Data")
},
lgap: this.constants.lgap,
tgap: this.constants.tgap
},
{
el: continueSelect,
lgap: this.constants.lgap,
tgap: this.constants.tgap
}]
});
this.display = BI.createWidget(opts.el, {
type: "bi.display_tree",
cls: "bi-multi-tree-display",
itemsCreator: function (op, callback) {
op.type = BI.TreeView.REQ_TYPE_GET_SELECTED_DATA;
opts.itemsCreator(op, callback);
},
value: (opts.value || {}).value
});
this.display.on(BI.Events.AFTERINIT, function () {
self.fireEvent(BI.Events.AFTERINIT);
});
this.display.on(BI.TreeView.EVENT_INIT, function () {
backToPopup.setVisible(false);
});
this.display.on(BI.TreeView.EVENT_AFTERINIT, function () {
backToPopup.setVisible(true);
});
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
height: this.constants.height,
el: backToPopup
}, {
height: "fill",
el: this.display
}]
});
},
empty: function () {
this.display.empty();
},
populate: function (configs) {
this.display.stroke(configs);
},
setValue: function (v) {
v || (v = {});
this.display.setSelectedValue(v.value);
},
getValue: function () {
}
});
BI.MultiTreeCheckPane.EVENT_CONTINUE_CLICK = "EVENT_CONTINUE_CLICK";
BI.shortcut("bi.multi_tree_check_pane", BI.MultiTreeCheckPane);
/***/ }),
/* 600 */
/***/ (function(module, exports) {
/**
*
* @class BI.MultiTreeCombo
* @extends BI.Single
*/
BI.MultiTreeCombo = BI.inherit(BI.Single, {
constants: {
offset: {
top: 0,
left: 0,
right: 0,
bottom: 25
}
},
_defaultConfig: function () {
return BI.extend(BI.MultiTreeCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-tree-combo",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true,
isNeedAdjustWidth: true,
});
},
_init: function () {
BI.MultiTreeCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var isInit = false;
var want2showCounter = false;
this.storeValue = {value: o.value || {}};
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
allowEdit: o.allowEdit,
height: o.height,
valueFormatter: o.valueFormatter,
text: o.text,
watermark: o.watermark,
// adapter: this.popup,
masker: {
offset: this.constants.offset
},
searcher: {
type: "bi.multi_tree_searcher",
itemsCreator: o.itemsCreator
},
value: {value: o.value || {}}
});
this.combo = BI.createWidget({
type: "bi.combo",
toggle: !o.allowEdit,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
type: "bi.multi_tree_popup_view",
ref: function () {
self.popup = this;
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [{
eventName: BI.MultiTreePopup.EVENT_AFTERINIT,
action: function () {
self.numberCounter.adjustView();
isInit = true;
if (want2showCounter === true) {
showCounter();
}
}
}, {
eventName: BI.MultiTreePopup.EVENT_CHANGE,
action: function () {
change = true;
var val = {
type: BI.Selection.Multi,
value: this.hasChecked() ? this.getValue() : {}
};
self.trigger.getSearcher().setState(val);
self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM, self.combo.getValue());
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
action: function () {
self.combo.hideView();
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR,
action: function () {
clear = true;
self.setValue();
self._defaultState();
}
}],
itemsCreator: o.itemsCreator,
onLoaded: function () {
BI.nextTick(function () {
self.numberCounter.adjustView();
self.trigger.getSearcher().adjustView();
});
},
maxWidth: o.isNeedAdjustWidth ? "auto" : 500,
},
isNeedAdjustWidth: o.isNeedAdjustWidth,
value: {value: o.value || {}},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
}
});
var change = false;
var clear = false; // 标识当前是否点击了清空
var isSearching = function () {
return self.trigger.getSearcher().isSearching();
};
var isPopupView = function () {
return self.combo.isViewVisible();
};
this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiTreeCombo.EVENT_FOCUS);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.MultiTreeCombo.EVENT_BLUR);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self.storeValue = {value: self.combo.getValue()};
this.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self.storeValue = {value: this.getValue()};
self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
BI.nextTick(function () {
if (isPopupView()) {
self.combo.populate();
}
});
self.fireEvent(BI.MultiTreeCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function () {
self.fireEvent(BI.MultiTreeCombo.EVENT_SEARCHING);
});
function showCounter () {
if (isSearching()) {
self.storeValue = {value: self.trigger.getValue()};
} else if (isPopupView()) {
self.storeValue = {value: self.combo.getValue()};
}
self.trigger.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
}
this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK, function () {
self.combo.toggle();
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function () {
var checked = this.getSearcher().hasChecked();
var val = {
type: BI.Selection.Multi,
value: checked ? {1: 1} : {}
};
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM, self.combo.getValue());
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
if (isSearching()) {
return;
}
if (change === true) {
self.storeValue = {value: self.combo.getValue()};
change = false;
}
self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
self.populate();
self.fireEvent(BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW);
});
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
if (isSearching()) {
self._stopEditing();
self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM);
} else {
if (isPopupView()) {
self._stopEditing();
self.storeValue = {value: self.combo.getValue()};
if (clear === true) {
self.storeValue = {value: {}};
}
self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM);
}
}
clear = false;
change = false;
});
var triggerBtn = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.height,
height: o.height,
cls: "multi-select-trigger-icon-button"
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.numberCounter.hideView();
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
});
this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher",
el: {
type: "bi.multi_tree_check_selected_button"
},
popup: {
type: "bi.multi_tree_check_pane"
},
masker: {
offset: this.constants.offset
},
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
value: {value: o.value || {}}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
if (want2showCounter === false) {
want2showCounter = true;
}
if (isInit === true) {
want2showCounter = null;
showCounter();
}
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height,
}]
});
},
_stopEditing: function() {
this.trigger.stopEditing();
this.numberCounter.hideView();
},
_defaultState: function () {
this._stopEditing();
this.combo.hideView();
},
setValue: function (v) {
this.storeValue.value = v || {};
this.combo.setValue({
value: v || {}
});
this.numberCounter.setValue({
value: v || {}
});
},
getValue: function () {
return BI.deepClone(this.storeValue.value);
},
populate: function () {
this.combo.populate.apply(this.combo, arguments);
}
});
BI.MultiTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiTreeCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiTreeCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiTreeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multi_tree_combo", BI.MultiTreeCombo);
/***/ }),
/* 601 */
/***/ (function(module, exports) {
/**
* 可以往当前选中节点下添加新值的下拉树
* @class BI.MultiTreeInsertCombo
* @extends BI.Single
*/
BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
constants: {
offset: {
top: 0,
left: 0,
right: 0,
bottom: 25
}
},
_defaultConfig: function () {
return BI.extend(BI.MultiTreeInsertCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-tree-insert-combo",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true,
isNeedAdjustWidth: true
});
},
_init: function () {
BI.MultiTreeInsertCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var isInit = false;
var want2showCounter = false;
this.storeValue = {value: o.value || {}};
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
allowEdit: o.allowEdit,
height: o.height,
valueFormatter: o.valueFormatter,
// adapter: this.popup,
masker: {
offset: this.constants.offset
},
searcher: {
type: "bi.multi_tree_searcher",
text: o.text,
watermark: o.watermark,
itemsCreator: o.itemsCreator,
popup: {
type: "bi.multi_tree_search_insert_pane",
listeners: [{
eventName: BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,
action: function () {
self.storeValue.value[self.trigger.getSearcher().getKeyword()] = {};
self._assertShowValue();
// setValue以更新paras.value, 之后从search popup中拿到的就能有add的值了
self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
self._stopEditing();
}
}]
}
},
value: {value: o.value || {}}
});
this.combo = BI.createWidget({
type: "bi.combo",
toggle: !o.allowEdit,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
type: "bi.multi_tree_popup_view",
ref: function () {
self.popup = this;
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
listeners: [{
eventName: BI.MultiTreePopup.EVENT_AFTERINIT,
action: function () {
self.numberCounter.adjustView();
isInit = true;
if (want2showCounter === true) {
showCounter();
}
}
}, {
eventName: BI.MultiTreePopup.EVENT_CHANGE,
action: function () {
change = true;
var val = {
type: BI.Selection.Multi,
value: this.hasChecked() ? this.getValue() : {}
};
self.trigger.getSearcher().setState(val);
self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue());
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
action: function () {
self.combo.hideView();
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR,
action: function () {
clear = true;
self.setValue();
self._defaultState();
}
}],
itemsCreator: o.itemsCreator,
onLoaded: function () {
BI.nextTick(function () {
self.numberCounter.adjustView();
self.trigger.getSearcher().adjustView();
});
},
maxWidth: o.isNeedAdjustWidth ? "auto" : 500,
},
isNeedAdjustWidth: o.isNeedAdjustWidth,
value: {value: o.value || {}},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
}
});
var change = false;
var clear = false; // 标识当前是否点击了清空
var isSearching = function () {
return self.trigger.getSearcher().isSearching();
};
var isPopupView = function () {
return self.combo.isViewVisible();
};
this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_FOCUS);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_BLUR);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self.storeValue = {value: self.combo.getValue()};
this.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self.storeValue = {value: this.getValue()};
self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
BI.nextTick(function () {
if (isPopupView()) {
self.combo.populate();
}
});
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function () {
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_SEARCHING);
});
function showCounter () {
if (isSearching()) {
self.storeValue = {value: self.trigger.getValue()};
} else if (isPopupView()) {
self.storeValue = {value: self.combo.getValue()};
}
self.trigger.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
}
this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK, function () {
self.combo.toggle();
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function () {
var checked = this.getSearcher().hasChecked();
var val = {
type: BI.Selection.Multi,
value: checked ? {1: 1} : {}
};
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue());
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
if (isSearching()) {
return;
}
if (change === true) {
self.storeValue = {value: self.combo.getValue()};
change = false;
}
self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
self.populate();
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_BEFORE_POPUPVIEW);
});
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
if (isSearching()) {
self._stopEditing();
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM);
} else {
if (isPopupView()) {
self._stopEditing();
self.storeValue = {value: self.combo.getValue()};
if (clear === true) {
self.storeValue = {value: {}};
}
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM);
}
}
clear = false;
change = false;
});
var triggerBtn = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.height,
height: o.height,
cls: "multi-select-trigger-icon-button"
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.numberCounter.hideView();
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
});
this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher",
el: {
type: "bi.multi_tree_check_selected_button"
},
popup: {
type: "bi.multi_tree_check_pane"
},
itemsCreator: o.itemsCreator,
masker: {
offset: this.constants.offset
},
valueFormatter: o.valueFormatter,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
if (want2showCounter === false) {
want2showCounter = true;
}
if (isInit === true) {
want2showCounter = null;
showCounter();
}
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height,
}]
});
},
_assertShowValue: function () {
this.trigger.getSearcher().setState(this.storeValue);
this.numberCounter.setButtonChecked(this.storeValue);
},
_stopEditing: function() {
this.trigger.stopEditing();
this.numberCounter.hideView();
},
_defaultState: function () {
this._stopEditing();
this.combo.hideView();
},
setValue: function (v) {
this.storeValue.value = v || {};
this.combo.setValue({
value: v || {}
});
this.numberCounter.setValue({
value: v || {}
});
},
getValue: function () {
return BI.deepClone(this.storeValue.value);
},
populate: function () {
this.combo.populate.apply(this.combo, arguments);
}
});
BI.MultiTreeInsertCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiTreeInsertCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiTreeInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiTreeInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiTreeInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MultiTreeInsertCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multi_tree_insert_combo", BI.MultiTreeInsertCombo);
/***/ }),
/* 602 */
/***/ (function(module, exports) {
/**
* 选中节点不影响父子节点状态的下拉树
* @class BI.MultiTreeListCombo
* @extends BI.Single
*/
BI.MultiTreeListCombo = BI.inherit(BI.Single, {
constants: {
offset: {
top: 0,
left: 0,
right: 0,
bottom: 25
}
},
_defaultConfig: function () {
return BI.extend(BI.MultiTreeListCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-tree-list-combo",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true,
allowInsertValue: true,
isNeedAdjustWidth: true
});
},
_init: function () {
BI.MultiTreeListCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var isInit = false;
var want2showCounter = false;
this.storeValue = {value: o.value || []};
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
allowEdit: o.allowEdit,
text: o.text,
watermark: o.watermark,
height: o.height,
valueFormatter: o.valueFormatter,
// adapter: this.popup,
masker: {
offset: this.constants.offset
},
searcher: {
type: "bi.multi_list_tree_searcher",
itemsCreator: o.itemsCreator,
popup: {
type: o.allowInsertValue ? "bi.multi_tree_search_insert_pane" : "bi.multi_tree_search_pane",
el: {
type: "bi.list_part_tree"
},
listeners: [{
eventName: BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,
action: function () {
self.storeValue.value.unshift([self.trigger.getSearcher().getKeyword()]);
self._assertShowValue();
// setValue以更新paras.value, 之后从search popup中拿到的就能有add的值了
self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
self._stopEditing();
}
}]
}
},
switcher: {
el: {
type: "bi.multi_tree_check_selected_button"
},
popup: {
type: "bi.multi_tree_check_pane",
el: {
type: "bi.list_display_tree"
},
itemsCreator: o.itemsCreator
}
},
value: {value: o.value || {}}
});
this.combo = BI.createWidget({
type: "bi.combo",
toggle: !o.allowEdit,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
type: "bi.multi_tree_popup_view",
ref: function () {
self.popup = this;
self.trigger.setAdapter(this);
self.numberCounter.setAdapter(this);
},
el: {
type: "bi.list_async_tree"
},
listeners: [{
eventName: BI.MultiTreePopup.EVENT_AFTERINIT,
action: function () {
self.numberCounter.adjustView();
isInit = true;
if (want2showCounter === true) {
showCounter();
}
}
}, {
eventName: BI.MultiTreePopup.EVENT_CHANGE,
action: function () {
change = true;
var val = {
type: BI.Selection.Multi,
value: this.hasChecked() ? this.getValue() : []
};
self.trigger.getSearcher().setState(val);
self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue());
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
action: function () {
self.combo.hideView();
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR,
action: function () {
clear = true;
self.setValue();
self._defaultState();
}
}],
itemsCreator: o.itemsCreator,
onLoaded: function () {
BI.nextTick(function () {
self.numberCounter.adjustView();
self.trigger.getSearcher().adjustView();
});
},
maxWidth: o.isNeedAdjustWidth ? "auto" : 500,
},
isNeedAdjustWidth: o.isNeedAdjustWidth,
value: {value: o.value || {}},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0;
}
});
var change = false;
var clear = false; // 标识当前是否点击了清空
var isSearching = function () {
return self.trigger.getSearcher().isSearching();
};
var isPopupView = function () {
return self.combo.isViewVisible();
};
this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiTreeListCombo.EVENT_FOCUS);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.MultiTreeListCombo.EVENT_BLUR);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self.storeValue = {value: self.combo.getValue()};
this.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self.storeValue = {value: this.getValue()};
self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
BI.nextTick(function () {
if (isPopupView()) {
self.combo.populate();
}
});
self.fireEvent(BI.MultiTreeListCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function () {
self.fireEvent(BI.MultiTreeListCombo.EVENT_SEARCHING);
});
function showCounter () {
if (isSearching()) {
self.storeValue = {value: self.trigger.getValue()};
} else if (isPopupView()) {
self.storeValue = {value: self.combo.getValue()};
}
self.trigger.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
}
this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK, function () {
self.combo.toggle();
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function () {
var checked = this.getSearcher().hasChecked();
var val = {
type: BI.Selection.Multi,
value: checked ? {1: 1} : {}
};
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
self.numberCounter.setButtonChecked(val);
self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue());
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
if (isSearching()) {
return;
}
if (change === true) {
self.storeValue = {value: self.combo.getValue()};
change = false;
}
self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue);
self.populate();
self.fireEvent(BI.MultiTreeListCombo.EVENT_BEFORE_POPUPVIEW);
});
this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW, function () {
if (isSearching()) {
self.trigger.stopEditing();
self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM);
} else {
if (isPopupView()) {
self._stopEditing();
self.storeValue = {value: self.combo.getValue()};
if (clear === true) {
self.storeValue = {value: []};
}
self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM);
}
}
clear = false;
change = false;
});
var triggerBtn = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.height,
height: o.height,
cls: "multi-select-trigger-icon-button"
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.numberCounter.hideView();
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
});
this.numberCounter = BI.createWidget({
type: "bi.multi_select_check_selected_switcher",
el: {
type: "bi.multi_tree_check_selected_button"
},
popup: {
type: "bi.multi_tree_check_pane"
},
itemsCreator: o.itemsCreator,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
valueFormatter: o.valueFormatter,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
if (want2showCounter === false) {
want2showCounter = true;
}
if (isInit === true) {
want2showCounter = null;
showCounter();
}
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
self.trigger.refreshPlaceHolderWidth((b === true ? self.numberCounter.element.outerWidth() + 8 : 0));
});
});
this.trigger.element.click(function (e) {
if (self.trigger.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.vertical_adapt",
items: [this.numberCounter]
},
right: o.height,
top: 0,
height: o.height,
}]
});
},
_assertShowValue: function () {
this.trigger.getSearcher().setState(this.storeValue);
this.numberCounter.setButtonChecked(this.storeValue);
},
_stopEditing: function() {
this.trigger.stopEditing();
this.numberCounter.hideView();
},
_defaultState: function () {
this._stopEditing();
this.combo.hideView();
},
setValue: function (v) {
this.storeValue.value = v || [];
this.combo.setValue({
value: v || []
});
this.numberCounter.setValue({
value: v || []
});
},
getValue: function () {
return BI.deepClone(this.storeValue.value);
},
populate: function () {
this.combo.populate.apply(this.combo, arguments);
}
});
BI.MultiTreeListCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiTreeListCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiTreeListCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeListCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiTreeListCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiTreeListCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.MultiTreeListCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.multi_tree_list_combo", BI.MultiTreeListCombo);
/***/ }),
/* 603 */
/***/ (function(module, exports) {
/**
* 带加载的多选下拉面板
* @class BI.MultiTreePopup
* @extends BI.Pane
*/
BI.MultiTreePopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.MultiTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-tree-popup",
maxWidth: "auto",
minWidth: 140,
maxHeight: 400,
onLoaded: BI.emptyFn,
el: {
type: "bi.async_tree"
}
});
},
_init: function () {
BI.MultiTreePopup.superclass._init.apply(this, arguments);
var self = this, opts = this.options, v = opts.value;
this.selectedValues = {};
this.tree = BI.createWidget(opts.el, {
type: "bi.async_tree",
height: 400,
cls: "popup-view-tree",
itemsCreator: opts.itemsCreator,
onLoaded: opts.onLoaded,
value: v.value || {}
});
this.popupView = BI.createWidget({
type: "bi.multi_popup_view",
element: this,
stopPropagation: false,
maxWidth: opts.maxWidth,
minWidth: opts.minWidth,
maxHeight: opts.maxHeight,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.tree
});
this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON, function (index) {
switch (index) {
case 0:
self.fireEvent(BI.MultiTreePopup.EVENT_CLICK_CLEAR);
break;
case 1:
self.fireEvent(BI.MultiTreePopup.EVENT_CLICK_CONFIRM);
break;
}
});
this.tree.on(BI.TreeView.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiTreePopup.EVENT_CHANGE);
});
this.tree.on(BI.TreeView.EVENT_AFTERINIT, function () {
self.fireEvent(BI.MultiTreePopup.EVENT_AFTERINIT);
});
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v || (v = {});
this.tree.setSelectedValue(v.value);
},
populate: function (config) {
this.tree.stroke(config);
},
hasChecked: function () {
return this.tree.hasChecked();
},
resetHeight: function (h) {
this.popupView.resetHeight(h);
},
resetWidth: function (w) {
this.popupView.resetWidth(w);
}
});
BI.MultiTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreePopup.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM";
BI.MultiTreePopup.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR";
BI.MultiTreePopup.EVENT_AFTERINIT = "EVENT_AFTERINIT";
BI.shortcut("bi.multi_tree_popup_view", BI.MultiTreePopup);
/***/ }),
/* 604 */
/***/ (function(module, exports) {
/**
* 查看已选按钮
* Created by guy on 15/11/3.
* @class BI.MultiTreeCheckSelectedButton
* @extends BI.Single
*/
BI.MultiTreeCheckSelectedButton = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.MultiTreeCheckSelectedButton.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-tree-check-selected-button",
itemsCreator: BI.emptyFn
});
},
_init: function () {
BI.MultiTreeCheckSelectedButton.superclass._init.apply(this, arguments);
var self = this;
this.indicator = BI.createWidget({
type: "bi.icon_button",
cls: "check-font trigger-check-selected icon-size-12",
width: 15,
height: 15,
stopPropagation: true
});
this.checkSelected = BI.createWidget({
type: "bi.text_button",
cls: "trigger-check-selected",
invisible: true,
hgap: 4,
text: BI.i18nText("BI-Check_Selected"),
textAlign: "center",
textHeight: 15
});
this.checkSelected.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.checkSelected.on(BI.TextButton.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectCheckSelectedButton.EVENT_CHANGE, arguments);
});
BI.createWidget({
type: "bi.horizontal",
element: this,
items: [this.indicator, this.checkSelected]
});
this.element.hover(function () {
self.indicator.setVisible(false);
self.checkSelected.setVisible(true);
}, function () {
self.indicator.setVisible(true);
self.checkSelected.setVisible(false);
});
this.setVisible(false);
},
setValue: function (v) {
v || (v = {});
var show = BI.size(v.value) > 0;
this.setVisible(show);
}
});
BI.MultiTreeCheckSelectedButton.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_tree_check_selected_button", BI.MultiTreeCheckSelectedButton);
/***/ }),
/* 605 */
/***/ (function(module, exports) {
/**
*
* 在搜索框中输入文本弹出的面板
* @class BI.MultiTreeSearchInsertPane
* @extends BI.Pane
*/
BI.MultiTreeSearchInsertPane = BI.inherit(BI.Widget, {
constants: {
height: 24,
},
props: {
baseCls: "bi-multi-tree-search-insert-pane bi-card",
itemsCreator: BI.emptyFn,
keywordGetter: BI.emptyFn,
el: {
type: "bi.part_tree"
}
},
render: function () {
var self = this, opts = this.options;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.text_button",
invisible: true,
ref: function (_ref) {
self.addTip = _ref;
},
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: this.constants.height,
cls: "bi-high-light",
handler: function () {
self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM, opts.keywordGetter());
}
},
top: 5,
left: 0,
right: 0
}, {
el: BI.extend({
type: "bi.part_tree",
tipText: BI.i18nText("BI-No_Select"),
itemsCreator: function (op, callback) {
op.keyword = opts.keywordGetter();
opts.itemsCreator(op, function (res) {
callback(res);
self.setKeyword(opts.keywordGetter(), res.items);
});
},
ref: function (_ref) {
self.partTree = _ref;
},
value: opts.value,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.TreeView.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CHANGE);
}
}]
}, opts.el),
left: 0,
top: 0,
bottom: 0,
right: 0
}]
};
},
setKeyword: function (keyword, nodes) {
var isAddTipVisible = BI.isEmptyArray(nodes);
this.addTip.setVisible(isAddTipVisible);
this.partTree.setVisible(!isAddTipVisible);
isAddTipVisible && this.addTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
hasChecked: function () {
return this.partTree.hasChecked();
},
setValue: function (v) {
this.setSelectedValue(v.value);
},
setSelectedValue: function (v) {
v || (v = {});
this.partTree.setSelectedValue(v);
},
getValue: function () {
return this.partTree.getValue();
},
empty: function () {
this.partTree.empty();
},
populate: function (op) {
this.partTree.stroke.apply(this.partTree, arguments);
}
});
BI.MultiTreeSearchInsertPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearchInsertPane.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM";
BI.MultiTreeSearchInsertPane.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR";
BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.multi_tree_search_insert_pane", BI.MultiTreeSearchInsertPane);
/***/ }),
/* 606 */
/***/ (function(module, exports) {
/**
*
* 在搜索框中输入文本弹出的面板
* @class BI.MultiTreeSearchPane
* @extends BI.Pane
*/
BI.MultiTreeSearchPane = BI.inherit(BI.Pane, {
props: {
baseCls: "bi-multi-tree-search-pane bi-card",
itemsCreator: BI.emptyFn,
keywordGetter: BI.emptyFn
},
render: function () {
var self = this, opts = this.options;
return BI.extend({
type: "bi.part_tree",
element: this,
tipText: BI.i18nText("BI-No_Select"),
itemsCreator: function (op, callback) {
op.keyword = opts.keywordGetter();
opts.itemsCreator(op, callback);
},
value: opts.value,
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.TreeView.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiTreeSearchPane.EVENT_CHANGE);
}
}],
ref: function (_ref) {
self.partTree = _ref;
}
}, opts.el);
},
hasChecked: function () {
return this.partTree.hasChecked();
},
setValue: function (v) {
this.setSelectedValue(v.value);
},
setSelectedValue: function (v) {
v || (v = {});
this.partTree.setSelectedValue(v);
},
getValue: function () {
return this.partTree.getValue();
},
empty: function () {
this.partTree.empty();
},
populate: function (op) {
this.partTree.stroke.apply(this.partTree, arguments);
}
});
BI.MultiTreeSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearchPane.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM";
BI.MultiTreeSearchPane.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR";
BI.shortcut("bi.multi_tree_search_pane", BI.MultiTreeSearchPane);
/***/ }),
/* 607 */
/***/ (function(module, exports) {
/**
* searcher
* Created by guy on 15/11/3.
* @class BI.MultiListTreeSearcher
* @extends Widget
*/
BI.MultiListTreeSearcher = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiListTreeSearcher.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-tree-searcher",
itemsCreator: BI.emptyFn,
valueFormatter: function (v) {
return v;
},
popup: {},
adapter: null,
masker: {}
});
},
_init: function () {
BI.MultiListTreeSearcher.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.multi_select_editor",
height: o.height,
text: o.text,
watermark: o.watermark,
el: {
type: "bi.simple_state_editor",
height: o.height
}
});
this.searcher = BI.createWidget({
type: "bi.searcher",
element: this,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
callback({
keyword: self.editor.getValue()
});
},
el: this.editor,
popup: BI.extend({
type: "bi.multi_tree_search_pane",
keywordGetter: function () {
return self.editor.getValue();
},
itemsCreator: function (op, callback) {
op.keyword = self.editor.getValue();
o.itemsCreator(op, callback);
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker
});
this.searcher.on(BI.Searcher.EVENT_START, function () {
self.fireEvent(BI.MultiListTreeSearcher.EVENT_START);
});
this.searcher.on(BI.Searcher.EVENT_PAUSE, function () {
if (this.hasMatched()) {
}
self.fireEvent(BI.MultiListTreeSearcher.EVENT_PAUSE);
});
this.searcher.on(BI.Searcher.EVENT_STOP, function () {
self.fireEvent(BI.MultiListTreeSearcher.EVENT_STOP);
});
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiListTreeSearcher.EVENT_CHANGE, arguments);
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
}
},
adjustView: function () {
this.searcher.adjustView();
},
setAdapter: function (adapter) {
this.searcher.setAdapter(adapter);
},
isSearching: function () {
return this.searcher.isSearching();
},
stopSearch: function () {
this.searcher.stopSearch();
},
getKeyword: function () {
return this.editor.getValue();
},
hasMatched: function () {
return this.searcher.hasMatched();
},
hasChecked: function () {
return this.searcher.getView() && this.searcher.getView().hasChecked();
},
setState: function (ob) {
var o = this.options;
ob || (ob = {});
ob.value || (ob.value = []);
var count = 0;
if (BI.isNumber(ob)) {
this.editor.setState(ob);
} else if (BI.size(ob.value) === 0) {
this.editor.setState(BI.Selection.None);
} else {
var text = "";
BI.each(ob.value, function (idx, path) {
var childValue = BI.last(path);
text += (o.valueFormatter(childValue + "") || childValue) + "; ";
count++;
});
if (count > 20) {
this.editor.setState(BI.Selection.Multi);
} else {
this.editor.setState(text);
}
}
},
getState: function() {
return this.editor.getState();
},
setValue: function (ob) {
this.setState(ob);
this.searcher.setValue(ob);
},
getKey: function () {
return this.editor.getValue();
},
getValue: function () {
return this.searcher.getValue();
},
populate: function (items) {
this.searcher.populate.apply(this.searcher, arguments);
}
});
BI.MultiListTreeSearcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.MultiListTreeSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiListTreeSearcher.EVENT_START = "EVENT_START";
BI.MultiListTreeSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiListTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.shortcut("bi.multi_list_tree_searcher", BI.MultiListTreeSearcher);
/***/ }),
/* 608 */
/***/ (function(module, exports) {
/**
* searcher
* Created by guy on 15/11/3.
* @class BI.MultiTreeSearcher
* @extends Widget
*/
BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.MultiTreeSearcher.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-tree-searcher",
itemsCreator: BI.emptyFn,
valueFormatter: function (v) {
return v;
},
popup: {},
adapter: null,
masker: {},
});
},
_init: function () {
BI.MultiTreeSearcher.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.multi_select_editor",
watermark: o.watermark,
height: o.height,
el: {
type: "bi.simple_state_editor",
text: o.text,
height: o.height
},
listeners: [{
eventName: BI.MultiSelectEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR);
}
}]
});
this.searcher = BI.createWidget({
type: "bi.searcher",
element: this,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
callback({
keyword: self.editor.getValue()
});
},
el: this.editor,
popup: BI.extend({
type: "bi.multi_tree_search_pane",
keywordGetter: function () {
return self.editor.getValue();
},
itemsCreator: function (op, callback) {
op.keyword = self.editor.getValue();
o.itemsCreator(op, callback);
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker
});
this.searcher.on(BI.Searcher.EVENT_START, function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_START);
});
this.searcher.on(BI.Searcher.EVENT_PAUSE, function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_PAUSE);
});
this.searcher.on(BI.Searcher.EVENT_STOP, function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_STOP);
});
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE, arguments);
});
this.searcher.on(BI.Searcher.EVENT_SEARCHING, function () {
var keywords = this.getKeywords();
self.fireEvent(BI.MultiTreeSearcher.EVENT_SEARCHING, keywords);
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
}
},
adjustView: function () {
this.searcher.adjustView();
},
setAdapter: function (adapter) {
this.searcher.setAdapter(adapter);
},
isSearching: function () {
return this.searcher.isSearching();
},
stopSearch: function () {
this.searcher.stopSearch();
},
getKeyword: function () {
return this.editor.getValue();
},
hasMatched: function () {
return this.searcher.hasMatched();
},
hasChecked: function () {
return this.searcher.getView() && this.searcher.getView().hasChecked();
},
setState: function (ob) {
var o = this.options;
ob || (ob = {});
ob.value || (ob.value = {});
var count = 0;
if (BI.isNumber(ob)) {
this.editor.setState(ob);
} else if (BI.size(ob.value) === 0) {
this.editor.setState(BI.Selection.None);
} else {
var text = "";
BI.each(ob.value, function (name, children) {
var childNodes = getChildrenNode(children);
text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + "; ";
if (childNodes === "") {
count++;
}
});
if (count > 20) {
this.editor.setState(BI.Selection.Multi);
} else {
this.editor.setState(text);
}
}
function getChildrenNode (ob) {
var text = "";
var index = 0, size = BI.size(ob);
BI.each(ob, function (name, children) {
index++;
var childNodes = getChildrenNode(children);
text += (o.valueFormatter(name + "") || name) + (childNodes === "" ? "" : (":" + childNodes)) + (index === size ? "" : ",");
if (childNodes === "") {
count++;
}
});
return text;
}
},
getState: function() {
return this.editor.getState();
},
setValue: function (ob) {
this.setState(ob);
this.searcher.setValue(ob);
},
getKey: function () {
return this.editor.getValue();
},
getValue: function () {
return this.searcher.getValue();
},
populate: function (items) {
this.searcher.populate.apply(this.searcher, arguments);
}
});
BI.MultiTreeSearcher.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiTreeSearcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.MultiTreeSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearcher.EVENT_START = "EVENT_START";
BI.MultiTreeSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.shortcut("bi.multi_tree_searcher", BI.MultiTreeSearcher);
/***/ }),
/* 609 */
/***/ (function(module, exports) {
/**
* Created by windy on 2017/3/13.
* 数值微调器
*/
BI.NumberEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-number-editor bi-border bi-focus-shadow",
validationChecker: function () {
return true;
},
valueFormatter: function (v) {
return v;
},
value: 0,
allowBlank: false,
errorText: "",
step: 1
});
},
_init: function () {
BI.NumberEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height - 2,
allowBlank: o.allowBlank,
value: o.valueFormatter(o.value),
validationChecker: o.validationChecker,
errorText: o.errorText
});
this.editor.on(BI.TextEditor.EVENT_CHANGE, function () {
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
});
this.editor.on(BI.TextEditor.EVENT_ERROR, function () {
o.value = BI.parseFloat(this.getLastValidValue());
});
this.editor.on(BI.TextEditor.EVENT_VALID, function () {
o.value = BI.parseFloat(this.getValue());
});
this.editor.on(BI.TextEditor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.topBtn = BI.createWidget({
type: "bi.icon_button",
forceNotSelected: true,
trigger: "lclick,",
cls: "add-up-font top-button bi-border-left bi-list-item-active2 icon-size-12"
});
this.topBtn.on(BI.IconButton.EVENT_CHANGE, function () {
self._finetuning(o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
this.bottomBtn = BI.createWidget({
type: "bi.icon_button",
trigger: "lclick,",
forceNotSelected: true,
cls: "minus-down-font bottom-button bi-border-left bi-list-item-active2 icon-size-12"
});
this.bottomBtn.on(BI.IconButton.EVENT_CHANGE, function () {
self._finetuning(-o.step);
self.fireEvent(BI.NumberEditor.EVENT_CHANGE);
self.fireEvent(BI.NumberEditor.EVENT_CONFIRM);
});
BI.createWidget({
type: "bi.htape",
height: o.height - 2,
element: this,
items: [this.editor, {
el: {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this.topBtn
}, {
column: 0,
row: 1,
el: this.bottomBtn
}]
},
width: 23
}]
});
},
focus: function () {
this.editor.focus();
},
isEditing: function () {
return this.editor.isEditing();
},
// 微调
_finetuning: function (add) {
var v = BI.parseFloat(this.getValue());
this.setValue(BI.add(v, add));
},
setUpEnable: function (v) {
this.topBtn.setEnable(!!v);
},
setDownEnable: function (v) {
this.bottomBtn.setEnable(!!v);
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
getLastChangedValue: function () {
return this.editor.getLastChangedValue();
},
getValue: function () {
return this.options.value;
},
setValue: function (v) {
var o = this.options;
o.value = v;
this.editor.setValue(o.valueFormatter(v));
}
});
BI.NumberEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.NumberEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.number_editor", BI.NumberEditor);
/***/ }),
/* 610 */
/***/ (function(module, exports) {
// 小于号的值为:0,小于等于号的值为:1
// closeMIn:最小值的符号,closeMax:最大值的符号
/**
* Created by roy on 15/9/17.
*
*/
BI.NumberInterval = BI.inherit(BI.Single, {
constants: {
typeError: "typeBubble",
numberError: "numberBubble",
signalError: "signalBubble",
editorWidth: 114,
columns: 5,
width: 24,
rows: 1,
numberErrorCls: "number-error",
border: 1,
less: 0,
less_equal: 1,
numTip: "",
adjustYOffset: 2
},
_defaultConfig: function () {
var conf = BI.NumberInterval.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-number-interval" + ((BI.isIE() && BI.getIEVersion() < 10) ? " hack" : ""),
height: 24,
validation: "valid",
closeMin: true,
allowBlank: true,
watermark: BI.i18nText("BI-Basic_Unrestricted")
});
},
_init: function () {
var self = this, c = this.constants, o = this.options;
BI.NumberInterval.superclass._init.apply(this, arguments);
this.smallEditor = BI.createWidget({
type: "bi.number_interval_single_editor",
height: o.height - 2,
watermark: o.watermark,
allowBlank: o.allowBlank,
value: o.min,
level: "warning",
tipType: "success",
title: function () {
return self.smallEditor && self.smallEditor.getValue();
},
quitChecker: function () {
return false;
},
validationChecker: function (v) {
if (!BI.isNumeric(v)) {
self.smallEditorBubbleType = c.typeError;
return false;
}
return true;
},
cls: "number-interval-small-editor bi-border"
});
this.smallTip = BI.createWidget({
type: "bi.label",
text: o.numTip,
height: o.height - 2,
invisible: true
});
BI.createWidget({
type: "bi.absolute",
element: this.smallEditor.element,
items: [{
el: this.smallTip,
top: 0,
right: 5
}]
});
this.bigEditor = BI.createWidget({
type: "bi.number_interval_single_editor",
height: o.height - 2,
watermark: o.watermark,
allowBlank: o.allowBlank,
value: o.max,
title: function () {
return self.bigEditor && self.bigEditor.getValue();
},
quitChecker: function () {
return false;
},
validationChecker: function (v) {
if (!BI.isNumeric(v)) {
self.bigEditorBubbleType = c.typeError;
return false;
}
return true;
},
cls: "number-interval-big-editor bi-border"
});
this.bigTip = BI.createWidget({
type: "bi.label",
text: o.numTip,
height: o.height - 2,
invisible: true
});
BI.createWidget({
type: "bi.absolute",
element: this.bigEditor.element,
items: [{
el: this.bigTip,
top: 0,
right: 5
}]
});
this.smallCombo = BI.createWidget({
type: "bi.icon_combo",
cls: "number-interval-small-combo bi-border-top bi-border-bottom bi-border-right",
height: o.height - 2,
items: [{
text: "(" + BI.i18nText("BI-Less_Than") + ")",
iconCls: "less-font",
value: 0
}, {
text: "(" + BI.i18nText("BI-Less_And_Equal") + ")",
value: 1,
iconCls: "less-equal-font"
}]
});
if (o.closeMin === true) {
this.smallCombo.setValue(1);
} else {
this.smallCombo.setValue(0);
}
this.bigCombo = BI.createWidget({
type: "bi.icon_combo",
cls: "number-interval-big-combo bi-border-top bi-border-bottom bi-border-left",
height: o.height - 2,
items: [{
text: "(" + BI.i18nText("BI-Less_Than") + ")",
iconCls: "less-font",
value: 0
}, {
text: "(" + BI.i18nText("BI-Less_And_Equal") + ")",
value: 1,
iconCls: "less-equal-font"
}]
});
if (o.closeMax === true) {
this.bigCombo.setValue(1);
} else {
this.bigCombo.setValue(0);
}
this.label = BI.createWidget({
type: "bi.label",
text: BI.i18nText("BI-Basic_Value"),
textHeight: o.height - c.border * 2,
width: c.width - c.border * 2,
height: o.height - c.border * 2,
level: "warning",
tipType: "warning"
});
this.left = BI.createWidget({
type: "bi.htape",
items: [{
el: self.smallEditor
}, {
el: self.smallCombo,
width: c.width - c.border
}]
});
this.right = BI.createWidget({
type: "bi.htape",
items: [{
el: self.bigCombo,
width: c.width - c.border
}, {
el: self.bigEditor,
// BI-23883 间距考虑边框
lgap: 1
}]
});
BI.createWidget({
element: self,
type: "bi.center",
hgap: 15,
height: o.height,
items: [
{
type: "bi.absolute",
items: [{
el: self.left,
left: -15,
right: 0,
top: 0,
bottom: 0
}]
}, {
type: "bi.absolute",
items: [{
el: self.right,
left: 0,
right: -15,
top: 0,
bottom: 0
}]
}
]
});
BI.createWidget({
element: self,
type: "bi.horizontal_auto",
items: [
self.label
]
});
self._setValidEvent(self.bigEditor, c.bigEditor);
self._setValidEvent(self.smallEditor, c.smallEditor);
self._setErrorEvent(self.bigEditor, c.bigEditor);
self._setErrorEvent(self.smallEditor, c.smallEditor);
self._setBlurEvent(self.bigEditor);
self._setBlurEvent(self.smallEditor);
self._setFocusEvent(self.bigEditor);
self._setFocusEvent(self.smallEditor);
self._setComboValueChangedEvent(self.bigCombo);
self._setComboValueChangedEvent(self.smallCombo);
self._setEditorValueChangedEvent(self.bigEditor);
self._setEditorValueChangedEvent(self.smallEditor);
self._checkValidation();
},
_checkValidation: function () {
var self = this, c = this.constants, o = this.options;
self._setTitle("");
BI.Bubbles.hide(c.typeError);
BI.Bubbles.hide(c.numberError);
BI.Bubbles.hide(c.signalError);
if (!self.smallEditor.isValid() || !self.bigEditor.isValid()) {
self.element.removeClass("number-error");
o.validation = "invalid";
return c.typeError;
}
if (BI.isEmptyString(self.smallEditor.getValue()) || BI.isEmptyString(self.bigEditor.getValue())) {
self.element.removeClass("number-error");
o.validation = "valid";
return "";
}
var smallValue = parseFloat(self.smallEditor.getValue()), bigValue = parseFloat(self.bigEditor.getValue()),
bigComboValue = self.bigCombo.getValue(), smallComboValue = self.smallCombo.getValue();
if (bigComboValue[0] === c.less_equal && smallComboValue[0] === c.less_equal) {
if (smallValue > bigValue) {
self.element.addClass("number-error");
o.validation = "invalid";
return c.numberError;
}
self.element.removeClass("number-error");
o.validation = "valid";
return "";
}
if (smallValue > bigValue) {
self.element.addClass("number-error");
o.validation = "invalid";
return c.numberError;
} else if (smallValue === bigValue) {
self.element.addClass("number-error");
o.validation = "invalid";
return c.signalError;
}
self.element.removeClass("number-error");
o.validation = "valid";
return "";
},
_setTitle: function (v) {
this.label.setTitle(v);
},
_setFocusEvent: function (w) {
var self = this, c = this.constants;
w.on(BI.NumberIntervalSingleEidtor.EVENT_FOCUS, function () {
self._setTitle("");
switch (self._checkValidation()) {
case c.typeError:
BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
});
break;
case c.numberError:
BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
});
break;
case c.signalError:
BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
});
break;
default :
return;
}
});
},
_setBlurEvent: function (w) {
var c = this.constants, self = this;
w.on(BI.NumberIntervalSingleEidtor.EVENT_BLUR, function () {
BI.Bubbles.hide(c.typeError);
BI.Bubbles.hide(c.numberError);
BI.Bubbles.hide(c.signalError);
switch (self._checkValidation()) {
case c.typeError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data"));
break;
case c.numberError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value"));
break;
case c.signalError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value"));
break;
default:
self._setTitle("");
}
});
},
_setErrorEvent: function (w) {
var c = this.constants, self = this;
w.on(BI.NumberIntervalSingleEidtor.EVENT_ERROR, function () {
self._checkValidation();
BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
});
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
});
},
_setValidEvent: function (w) {
var self = this, c = this.constants;
w.on(BI.NumberIntervalSingleEidtor.EVENT_VALID, function () {
switch (self._checkValidation()) {
case c.numberError:
BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
});
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.signalError:
BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
});
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
default:
self.fireEvent(BI.NumberInterval.EVENT_VALID);
}
});
},
_setEditorValueChangedEvent: function (w) {
var self = this, c = this.constants;
w.on(BI.NumberIntervalSingleEidtor.EVENT_CHANGE, function () {
switch (self._checkValidation()) {
case c.typeError:
BI.Bubbles.show(c.typeError, BI.i18nText("BI-Numerical_Interval_Input_Data"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
});
break;
case c.numberError:
BI.Bubbles.show(c.numberError, BI.i18nText("BI-Numerical_Interval_Number_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
});
break;
case c.signalError:
BI.Bubbles.show(c.signalError, BI.i18nText("BI-Numerical_Interval_Signal_Value"), self, {
offsetStyle: "left",
adjustYOffset: c.adjustYOffset
});
break;
default :
break;
}
self.fireEvent(BI.NumberInterval.EVENT_CHANGE);
});
w.on(BI.NumberIntervalSingleEidtor.EVENT_CONFIRM, function () {
self.fireEvent(BI.NumberInterval.EVENT_CONFIRM);
});
},
_setComboValueChangedEvent: function (w) {
var self = this, c = this.constants;
w.on(BI.IconCombo.EVENT_CHANGE, function () {
switch (self._checkValidation()) {
case c.typeError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data"));
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.numberError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value"));
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
case c.signalError:
self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value"));
self.fireEvent(BI.NumberInterval.EVENT_ERROR);
break;
default :
self.fireEvent(BI.NumberInterval.EVENT_CHANGE);
self.fireEvent(BI.NumberInterval.EVENT_CONFIRM);
self.fireEvent(BI.NumberInterval.EVENT_VALID);
}
});
},
isStateValid: function () {
return this.options.validation === "valid";
},
setMinEnable: function (b) {
this.smallEditor.setEnable(b);
},
setCloseMinEnable: function (b) {
this.smallCombo.setEnable(b);
},
setMaxEnable: function (b) {
this.bigEditor.setEnable(b);
},
setCloseMaxEnable: function (b) {
this.bigCombo.setEnable(b);
},
showNumTip: function () {
this.smallTip.setVisible(true);
this.bigTip.setVisible(true);
},
hideNumTip: function () {
this.smallTip.setVisible(false);
this.bigTip.setVisible(false);
},
setNumTip: function (numTip) {
this.smallTip.setText(numTip);
this.bigTip.setText(numTip);
},
getNumTip: function () {
return this.smallTip.getText();
},
setValue: function (data) {
data = data || {};
var self = this, combo_value;
if (BI.isNumeric(data.min) || BI.isEmptyString(data.min)) {
self.smallEditor.setValue(data.min);
}
if (!BI.isNotNull(data.min)) {
self.smallEditor.setValue("");
}
if (BI.isNumeric(data.max) || BI.isEmptyString(data.max)) {
self.bigEditor.setValue(data.max);
}
if (!BI.isNotNull(data.max)) {
self.bigEditor.setValue("");
}
if (!BI.isNull(data.closeMin)) {
if (data.closeMin === true) {
combo_value = 1;
} else {
combo_value = 0;
}
self.smallCombo.setValue(combo_value);
}
if (!BI.isNull(data.closeMax)) {
if (data.closeMax === true) {
combo_value = 1;
} else {
combo_value = 0;
}
self.bigCombo.setValue(combo_value);
}
this._checkValidation();
},
getValue: function () {
var self = this, value = {}, minComboValue = self.smallCombo.getValue(), maxComboValue = self.bigCombo.getValue();
value.min = self.smallEditor.getValue();
value.max = self.bigEditor.getValue();
if (minComboValue[0] === 0) {
value.closeMin = false;
} else {
value.closeMin = true;
}
if (maxComboValue[0] === 0) {
value.closeMax = false;
} else {
value.closeMax = true;
}
return value;
},
destroyed: function () {
var c = this.constants;
BI.Bubbles.remove(c.typeError);
BI.Bubbles.remove(c.numberError);
BI.Bubbles.remove(c.signalError);
}
});
BI.NumberInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.NumberInterval.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.NumberInterval.EVENT_VALID = "EVENT_VALID";
BI.NumberInterval.EVENT_ERROR = "EVENT_ERROR";
BI.shortcut("bi.number_interval", BI.NumberInterval);
/***/ }),
/* 611 */
/***/ (function(module, exports) {
BI.NumberIntervalSingleEidtor = BI.inherit(BI.Single, {
props: {
baseCls: "bi-number-interval-single-editor",
tipType: "success",
title: ""
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vertical",
items: [{
type: "bi.editor",
ref: function (_ref) {
self.editor = _ref;
},
height: o.height - 2,
watermark: o.watermark,
allowBlank: o.allowBlank,
value: o.value,
quitChecker: o.quitChecker,
validationChecker: o.validationChecker,
listeners: [{
eventName: BI.Editor.EVENT_ERROR,
action: function () {
self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_ERROR, arguments);
}
}, {
eventName: BI.Editor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_FOCUS, arguments);
}
}, {
eventName: BI.Editor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_BLUR, arguments);
}
}, {
eventName: BI.Editor.EVENT_VALID,
action: function () {
self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_VALID, arguments);
}
}, {
eventName: BI.Editor.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CHANGE, arguments);
}
}, {
eventName: BI.Editor.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CONFIRM, arguments);
}
}, {
eventName: BI.Editor.EVENT_CHANGE_CONFIRM,
action: function () {
self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CHANGE_CONFIRM, arguments);
}
}]
}]
};
},
isValid: function () {
return this.editor.isValid();
},
getValue: function () {
return this.editor.getValue();
},
setValue: function (v) {
return this.editor.setValue(v);
}
});
BI.NumberIntervalSingleEidtor.EVENT_FOCUS = "EVENT_FOCUS";
BI.NumberIntervalSingleEidtor.EVENT_BLUR = "EVENT_BLUR";
BI.NumberIntervalSingleEidtor.EVENT_ERROR = "EVENT_ERROR";
BI.NumberIntervalSingleEidtor.EVENT_VALID = "EVENT_VALID";
BI.NumberIntervalSingleEidtor.EVENT_CHANGE = "EVENT_CHANGE";
BI.NumberIntervalSingleEidtor.EVENT_CHANGE_CONFIRM = "EVENT_CHANGE_CONFIRM";
BI.NumberIntervalSingleEidtor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.number_interval_single_editor", BI.NumberIntervalSingleEidtor);
/***/ }),
/* 612 */
/***/ (function(module, exports) {
/**
*
* @class BI.SearchMultiTextValueCombo
* @extends BI.Single
*/
BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.SearchMultiTextValueCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-combo bi-search-multi-text-value-combo",
height: 24,
items: []
});
},
_init: function () {
BI.SearchMultiTextValueCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));
self._updateAllValue();
self._checkError();
self.trigger.getSearcher().setState(self.storeValue);
self.trigger.getCounter().setButtonChecked(self.storeValue);
};
this.storeValue = BI.deepClone(o.value || {});
this._updateAllValue();
this._assertValue(this.storeValue);
this._checkError();
// 标记正在请求数据
this.requesting = false;
this.trigger = BI.createWidget({
type: "bi.search_multi_select_trigger",
text: o.text,
height: o.height,
// adapter: this.popup,
masker: {
offset: {
left: 0,
top: 0,
right: 0,
bottom: 25
}
},
allValueGetter: function () {
return self.allValue;
},
valueFormatter: o.valueFormatter,
itemsCreator: function (op, callback) {
self._itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(BI.deepClone(self.getValue()));
}
callback.apply(self, arguments);
});
},
value: this.storeValue,
warningTitle: o.warningTitle
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self._setStartValue("");
this.getSearcher().setValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self._setStartValue("");
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword();
self._join({
type: BI.Selection.Multi,
value: [keyword]
}, function () {
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self._populate();
self._setStartValue("");
});
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();
self._setStartValue("");
} else {
self.combo.setValue(self.storeValue);
assertShowValue();
}
});
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function (value, obj) {
if (obj instanceof BI.MultiSelectBar) {
self._joinAll(this.getValue(), function () {
assertShowValue();
});
} else {
self._join(this.getValue(), function () {
assertShowValue();
});
}
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () {
this.getCounter().setValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.combo = BI.createWidget({
type: "bi.combo",
toggle: false,
container: o.container,
el: this.trigger,
adjustLength: 1,
popup: {
type: "bi.search_multi_select_popup_view",
ref: function () {
self.popup = this;
self.trigger.setAdapter(this);
},
listeners: [{
eventName: BI.MultiSelectPopupView.EVENT_CHANGE,
action: function () {
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
});
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,
action: function () {
self._defaultState();
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,
action: function () {
self.setValue();
self._defaultState();
}
}],
itemsCreator: BI.bind(self._itemsCreator, this),
valueFormatter: o.valueFormatter,
onLoaded: function () {
BI.nextTick(function () {
self.combo.adjustWidth();
self.combo.adjustHeight();
self.trigger.getCounter().adjustView();
self.trigger.getSearcher().adjustView();
});
}
},
value: o.value,
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
this.setValue(self.storeValue);
BI.nextTick(function () {
self._populate();
});
});
// 当退出的时候如果还在处理请求,则等请求结束后再对外发确定事件
this.wants2Quit = false;
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
// important:关闭弹出时又可能没有退出编辑状态
self.trigger.stopEditing();
if (self.requesting === true) {
self.wants2Quit = true;
} else {
/**
* 在存在标红的情况,如果popover没有发生改变就确认需要同步trigger的值,否则对外value值和trigger样式不统一
*/
assertShowValue();
self.fireEvent(BI.SearchMultiTextValueCombo.EVENT_CONFIRM);
}
});
var triggerBtn = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.height,
height: o.height,
cls: "multi-select-trigger-icon-button"
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
self.trigger.getCounter().hideView();
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}]
});
this._checkError();
},
_defaultState: function () {
this.trigger.stopEditing();
this.combo.hideView();
},
_assertValue: function (val) {
var o = this.options;
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
BI.remove(val.value, function (idx, value) {
return !BI.contains(BI.map(o.items, "value"), value);
});
},
_makeMap: function (values) {
return BI.makeObject(values || []);
},
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
this.requesting = true;
this._itemsCreator({
type: BI.SearchMultiTextValueCombo.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val);
}
});
self._adjust(callback);
}
},
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this.requesting = true;
this._itemsCreator({
type: BI.SearchMultiTextValueCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];
BI.each(items, function (i, item) {
if (BI.isNotNull(selectedMap[items[i]])) {
self.storeValue.assist && self.storeValue.assist.push(selectedMap[items[i]]);
delete selectedMap[items[i]];
}
if (BI.isNull(notSelectedMap[items[i]])) {
BI.remove(self.storeValue.assist, item);
newItems.push(item);
}
});
self.storeValue.value = newItems.concat(BI.values(selectedMap));
self._adjust(callback);
});
},
_adjust: function (callback) {
var self = this, o = this.options;
if (!this._count) {
this._itemsCreator({
type: BI.SearchMultiTextValueCombo.REQ_GET_DATA_LENGTH
}, function (res) {
self._count = res.count;
adjust();
callback();
});
} else {
adjust();
callback();
}
function adjust () {
if (self.storeValue.type === BI.Selection.All && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.Multi,
value: []
};
} else if (self.storeValue.type === BI.Selection.Multi && self.storeValue.value.length >= self._count) {
self.storeValue = {
type: BI.Selection.All,
value: []
};
}
self._updateAllValue();
self._checkError();
if (self.wants2Quit === true) {
self.fireEvent(BI.SearchMultiTextValueCombo.EVENT_CONFIRM);
self.wants2Quit = false;
}
self.requesting = false;
}
},
_join: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
this._assertValue(this.storeValue);
if (this.storeValue.type === res.type) {
var map = this._makeMap(this.storeValue.value);
BI.each(res.value, function (i, v) {
if (!map[v]) {
self.storeValue.value.push(v);
BI.remove(self.storeValue.assist, v);
map[v] = v;
}
});
var change = false;
BI.each(res.assist, function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
self.storeValue.assist && self.storeValue.assist.push(map[v]);
delete map[v];
}
});
change && (this.storeValue.value = BI.values(map));
self._adjust(callback);
return;
}
this._joinAll(res, callback);
},
_setStartValue: function (value) {
this._startValue = value;
this.popup.setStartValue(value);
},
_getItemsByTimes: function (items, times) {
var res = [];
for (var i = (times - 1) * 100; items[i] && i < times * 100; i++) {
res.push(items[i]);
}
return res;
},
_hasNextByTimes: function (items, times) {
return times * 100 < items.length;
},
_itemsCreator: function (options, callback) {
var self = this, o = this.options;
var items = o.items;
var keywords = (options.keywords || []).slice();
if (options.keyword) {
keywords.push(options.keyword);
}
BI.each(keywords, function (i, kw) {
var search = BI.Func.getSearchResult(items, kw);
items = search.match.concat(search.find);
});
if (options.selectedValues) {// 过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});
}
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: items
});
return;
}
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}
callback({
items: self._getItemsByTimes(items, options.times),
hasNext: self._hasNextByTimes(items, options.times)
});
},
_checkError: function () {
var v = this.storeValue.value || [];
if(BI.isNotEmptyArray(v)) {
v = BI.isArray(v) ? v : [v];
var result = BI.find(this.allValue, function (idx, value) {
return !BI.contains(v, value);
});
if (BI.isNull(result)) {
BI.isNotNull(this.trigger) && (this.trigger.setTipType("success"));
this.element.removeClass("combo-error");
} else {
BI.isNotNull(this.trigger) && (this.trigger.setTipType("warning"));
this.element.addClass("combo-error");
}
} else {
if(v.length === this.allValue.length){
BI.isNotNull(this.trigger) && (this.trigger.setTipType("success"));
this.element.removeClass("combo-error");
}else {
BI.isNotNull(this.trigger) && (this.trigger.setTipType("warning"));
this.element.addClass("combo-error");
}
}
},
_updateAllValue: function () {
this.storeValue = this.storeValue || {};
this.allValue = BI.deepClone(this.storeValue.value || []);
},
setValue: function (v) {
this.storeValue = BI.deepClone(v || {});
this._updateAllValue();
this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue);
this._checkError();
},
getValue: function () {
return BI.deepClone(this.storeValue);
},
_populate: function () {
this._count = null;
this.combo.populate();
},
populate: function (items) {
this.options.items = items;
this._populate();
}
});
BI.extend(BI.SearchMultiTextValueCombo, {
REQ_GET_DATA_LENGTH: 1,
REQ_GET_ALL_DATA: -1
});
BI.SearchMultiTextValueCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.search_multi_text_value_combo", BI.SearchMultiTextValueCombo);
/***/ }),
/* 613 */
/***/ (function(module, exports) {
BI.SearchMultiSelectTrigger = BI.inherit(BI.Trigger, {
constants: {
height: 14,
rgap: 4,
lgap: 4
},
_defaultConfig: function () {
return BI.extend(BI.SearchMultiSelectTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-trigger bi-border",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
searcher: {},
switcher: {},
adapter: null,
masker: {}
});
},
_init: function () {
BI.SearchMultiSelectTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (o.height) {
this.setHeight(o.height - 2);
}
this.searcher = BI.createWidget(o.searcher, {
type: "bi.search_multi_select_searcher",
height: o.height,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
allValueGetter: o.allValueGetter,
popup: {},
adapter: o.adapter,
masker: o.masker,
value: o.value,
text: o.text,
tipType: o.tipType,
warningTitle: o.warningTitle
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.SearchMultiSelectTrigger.EVENT_START);
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_PAUSE, function () {
self.fireEvent(BI.SearchMultiSelectTrigger.EVENT_PAUSE);
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_SEARCHING, function () {
self.fireEvent(BI.SearchMultiSelectTrigger.EVENT_SEARCHING, arguments);
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_STOP, function () {
self.fireEvent(BI.SearchMultiSelectTrigger.EVENT_STOP);
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_CHANGE, function () {
self.fireEvent(BI.SearchMultiSelectTrigger.EVENT_CHANGE, arguments);
});
this.numberCounter = BI.createWidget(o.switcher, {
type: "bi.multi_select_check_selected_switcher",
valueFormatter: o.valueFormatter,
itemsCreator: o.itemsCreator,
adapter: o.adapter,
masker: o.masker,
value: o.value
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE, function () {
self.fireEvent(BI.SearchMultiSelectTrigger.EVENT_COUNTER_CLICK);
});
this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.SearchMultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW);
});
var wrapNumberCounter = BI.createWidget({
type: "bi.right_vertical_adapt",
hgap: 4,
items: [{
el: this.numberCounter
}]
});
var wrapper = BI.createWidget({
type: "bi.htape",
element: this,
items: [
{
el: this.searcher,
width: "fill"
}, {
el: wrapNumberCounter,
width: 0
}, {
el: BI.createWidget(),
width: 24
}]
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
wrapper.attr("items")[1].width = (b === true ? self.numberCounter.element.outerWidth() + 8 : 0);
wrapper.resize();
});
});
this.element.click(function (e) {
if (self.element.find(e.target).length > 0) {
self.numberCounter.hideView();
}
});
},
getCounter: function () {
return this.numberCounter;
},
getSearcher: function () {
return this.searcher;
},
stopEditing: function () {
this.searcher.stopSearch();
this.numberCounter.hideView();
},
setAdapter: function (adapter) {
this.searcher.setAdapter(adapter);
this.numberCounter.setAdapter(adapter);
},
setValue: function (ob) {
this.searcher.setValue(ob);
this.numberCounter.setValue(ob);
},
setTipType: function (v) {
this.searcher.setTipType(v);
},
getKey: function () {
return this.searcher.getKey();
},
getValue: function () {
return this.searcher.getValue();
}
});
BI.SearchMultiSelectTrigger.EVENT_TRIGGER_CLICK = "EVENT_TRIGGER_CLICK";
BI.SearchMultiSelectTrigger.EVENT_COUNTER_CLICK = "EVENT_COUNTER_CLICK";
BI.SearchMultiSelectTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.SearchMultiSelectTrigger.EVENT_START = "EVENT_START";
BI.SearchMultiSelectTrigger.EVENT_STOP = "EVENT_STOP";
BI.SearchMultiSelectTrigger.EVENT_PAUSE = "EVENT_PAUSE";
BI.SearchMultiSelectTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.SearchMultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW = "EVENT_BEFORE_COUNTER_POPUPVIEW";
BI.shortcut("bi.search_multi_select_trigger", BI.SearchMultiSelectTrigger);
/***/ }),
/* 614 */
/***/ (function(module, exports) {
/**
* 多选加载数据面板
* Created by guy on 15/11/2.
* @class BI.SearchMultiSelectLoader
* @extends Widget
*/
BI.SearchMultiSelectLoader = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SearchMultiSelectLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-loader",
logic: {
dynamic: true
},
el: {
height: 400
},
valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn
});
},
_init: function () {
BI.SearchMultiSelectLoader.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = opts.value || {};
this._assertValue(this.storeValue);
this.button_group = BI.createWidget({
type: "bi.select_list",
element: this,
logic: opts.logic,
el: BI.extend({
onLoaded: opts.onLoaded,
el: {
type: "bi.loader",
isDefaultInit: false,
logic: {
dynamic: true,
scrolly: true
},
el: {
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
behaviors: {
redmark: function () {
return true;
}
},
layouts: [{
type: "bi.vertical"
}]
}
}
}, opts.el),
itemsCreator: function (op, callback) {
var startValue = self._startValue;
self.storeValue && (op = BI.extend(op || {}, {
selectedValues: BI.isKey(startValue) && self.storeValue.type === BI.Selection.Multi
? self.storeValue.value.concat(startValue) : self.storeValue.value
}));
opts.itemsCreator(op, function (ob) {
hasNext = ob.hasNext;
var firstItems = [];
if (op.times === 1 && self.storeValue) {
var json = BI.map(self.storeValue.value, function (i, v) {
var txt = opts.valueFormatter(v) || v;
return {
text: txt,
value: v,
title: txt,
selected: self.storeValue.type === BI.Selection.Multi
};
});
if (BI.isKey(self._startValue) && !BI.contains(self.storeValue.value, self._startValue)) {
var txt = opts.valueFormatter(startValue) || startValue;
json.unshift({
text: txt,
value: startValue,
title: txt,
selected: true
});
}
firstItems = self._createItems(json);
}
callback(firstItems.concat(self._createItems(ob.items)), ob.keyword || "");
if (op.times === 1 && self.storeValue) {
BI.isKey(startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, startValue) : BI.pushDistinct(self.storeValue.value, startValue));
self.setValue(self.storeValue);
}
(op.times === 1) && self._scrollToTop();
});
},
hasNext: function () {
return hasNext;
},
value: this.storeValue
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.button_group.on(BI.SelectList.EVENT_CHANGE, function () {
self.fireEvent(BI.SearchMultiSelectLoader.EVENT_CHANGE, arguments);
});
},
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.multi_select_item",
logic: this.options.logic,
cls: "bi-list-item-active",
height: 24,
selected: this.isAllSelected(),
iconWrapperWidth: 36
});
},
_scrollToTop: function () {
var self = this;
BI.delay(function () {
self.button_group.element.scrollTop(0);
}, 30);
},
isAllSelected: function () {
return this.button_group.isAllSelected();
},
_assertValue: function (val) {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
},
setStartValue: function (v) {
this._startValue = v;
},
setValue: function (v) {
this.storeValue = v || {};
this._assertValue(this.storeValue);
this.button_group.setValue(this.storeValue);
},
getValue: function () {
return this.button_group.getValue();
},
getAllButtons: function () {
return this.button_group.getAllButtons();
},
empty: function () {
this.button_group.empty();
},
populate: function (items) {
arguments[0] = this._createItems(items);
this.button_group.populate.apply(this.button_group, arguments);
},
resetHeight: function (h) {
this.button_group.resetHeight(h);
},
resetWidth: function (w) {
this.button_group.resetWidth(w);
}
});
BI.SearchMultiSelectLoader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.search_multi_select_loader", BI.SearchMultiSelectLoader);
/***/ }),
/* 615 */
/***/ (function(module, exports) {
BI.SearchMultiSelectPopupView = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SearchMultiSelectPopupView.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-popup-view",
maxWidth: "auto",
minWidth: 135,
maxHeight: 400,
valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn
});
},
_init: function () {
BI.SearchMultiSelectPopupView.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.loader = BI.createWidget({
type: "bi.search_multi_select_loader",
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
type: "bi.multi_popup_view",
stopPropagation: false,
maxWidth: opts.maxWidth,
minWidth: opts.minWidth,
maxHeight: opts.maxHeight,
element: this,
buttons: [BI.i18nText("BI-Basic_Clears"), BI.i18nText("BI-Basic_Sure")],
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {
self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CHANGE);
});
this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON, function (index) {
switch (index) {
case 0:
self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CLICK_CLEAR);
break;
case 1:
self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CLICK_CONFIRM);
break;
}
});
},
isAllSelected: function () {
return this.loader.isAllSelected();
},
setStartValue: function (v) {
this.loader.setStartValue(v);
},
setValue: function (v) {
this.popupView.setValue(v);
},
getValue: function () {
return this.popupView.getValue();
},
populate: function (items) {
this.popupView.populate.apply(this.popupView, arguments);
},
resetHeight: function (h) {
this.popupView.resetHeight(h);
},
resetWidth: function (w) {
this.popupView.resetWidth(w);
}
});
BI.SearchMultiSelectPopupView.EVENT_CHANGE = "EVENT_CHANGE";
BI.SearchMultiSelectPopupView.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM";
BI.SearchMultiSelectPopupView.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR";
BI.shortcut("bi.search_multi_select_popup_view", BI.SearchMultiSelectPopupView);
/***/ }),
/* 616 */
/***/ (function(module, exports) {
BI.SearchMultiSelectSearcher = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SearchMultiSelectSearcher.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-searcher",
itemsCreator: BI.emptyFn,
el: {},
popup: {},
valueFormatter: BI.emptyFn,
adapter: null,
masker: {}
});
},
_init: function () {
BI.SearchMultiSelectSearcher.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
height: o.height,
text: o.text,
tipType: o.tipType,
warningTitle: o.warningTitle
});
this.searcher = BI.createWidget({
type: "bi.searcher",
allowSearchBlank: false,
element: this,
height: o.height,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
callback();
},
el: this.editor,
popup: BI.extend({
type: "bi.multi_select_search_pane",
valueFormatter: o.valueFormatter,
keywordGetter: function () {
return self.editor.getValue();
},
itemsCreator: function (op, callback) {
var keyword = self.editor.getValue();
op.keywords = [keyword];
this.setKeyword(keyword);
o.itemsCreator(op, callback);
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker
});
this.searcher.on(BI.Searcher.EVENT_START, function () {
self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_START);
});
this.searcher.on(BI.Searcher.EVENT_PAUSE, function () {
if (this.hasMatched()) {
}
self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_PAUSE);
});
this.searcher.on(BI.Searcher.EVENT_STOP, function () {
self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_STOP);
});
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_CHANGE, arguments);
});
this.searcher.on(BI.Searcher.EVENT_SEARCHING, function () {
var keywords = this.getKeywords();
self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_SEARCHING, keywords);
});
if(BI.isNotNull(o.value)) {
this.setState(o.value);
}
},
adjustView: function () {
this.searcher.adjustView();
},
isSearching: function () {
return this.searcher.isSearching();
},
stopSearch: function () {
this.searcher.stopSearch();
},
getKeyword: function () {
return this.editor.getValue();
},
hasMatched: function () {
return this.searcher.hasMatched();
},
hasChecked: function () {
return this.searcher.getView() && this.searcher.getView().hasChecked();
},
setAdapter: function (adapter) {
this.searcher.setAdapter(adapter);
},
setState: function (obj) {
var o = this.options;
var ob = {};
ob.type = obj.type;
ob.value = o.allValueGetter() || [];
ob.assist = obj.assist;
if (ob.type === BI.Selection.All) {
if (ob.value.length === 0) {
this.editor.setState(BI.Selection.All);
} else if (BI.size(ob.assist) <= 20) {
var state = "";
BI.each(ob.assist, function (i, v) {
if (i === 0) {
state += "" + (o.valueFormatter(v + "") || v);
} else {
state += "," + (o.valueFormatter(v + "") || v);
}
});
this.editor.setState(state);
} else {
this.editor.setState(BI.Selection.Multi);
}
} else {
if (ob.value.length === 0) {
this.editor.setState(BI.Selection.None);
} else if (BI.size(ob.value) <= 20) {
var state = "";
BI.each(ob.value, function (i, v) {
if (i === 0) {
state += "" + (o.valueFormatter(v + "") || v);
} else {
state += "," + (o.valueFormatter(v + "") || v);
}
});
this.editor.setState(state);
} else {
this.editor.setState(BI.Selection.Multi);
}
}
},
setTipType: function (v) {
this.editor.setTipType(v);
},
setValue: function (ob) {
this.setState(ob);
this.searcher.setValue(ob);
},
getKey: function () {
return this.editor.getValue();
},
getValue: function () {
return this.searcher.getValue();
},
populate: function (items) {
this.searcher.populate.apply(this.searcher, arguments);
}
});
BI.SearchMultiSelectSearcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.SearchMultiSelectSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.SearchMultiSelectSearcher.EVENT_START = "EVENT_START";
BI.SearchMultiSelectSearcher.EVENT_STOP = "EVENT_STOP";
BI.SearchMultiSelectSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.SearchMultiSelectSearcher.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.shortcut("bi.search_multi_select_searcher", BI.SearchMultiSelectSearcher);
/***/ }),
/* 617 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
* Created by GUY on 2015/9/6.
* @class BI.SelectTreeFirstPlusGroupNode
* @extends BI.NodeButton
*/
BI.SelectTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.SelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-select-tree-first-plus-group-node bi-list-item-active",
logic: {
dynamic: false
},
id: "",
pId: "",
readonly: true,
open: false,
height: 24
});
},
_init: function () {
BI.SelectTreeFirstPlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.checkbox = BI.createWidget({
type: "bi.first_tree_node_checkbox",
stopPropagation: true
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
keyword: o.keyword,
py: o.py
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
if (this.isSelected()) {
self.triggerExpand();
} else {
self.triggerCollapse();
}
}
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 24,
el: this.checkbox
}, this.text);
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
},
isOnce: function () {
return true;
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.NodeButton.superclass.doClick.apply(this, arguments);
},
setOpened: function (v) {
BI.SelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this, arguments);
if (BI.isNotNull(this.checkbox)) {
this.checkbox.setSelected(v);
}
}
});
BI.shortcut("bi.select_tree_first_plus_group_node", BI.SelectTreeFirstPlusGroupNode);
/***/ }),
/* 618 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
* Created by GUY on 2015/9/6.
* @class BI.SelectTreeLastPlusGroupNode
* @extends BI.NodeButton
*/
BI.SelectTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.SelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-select-tree-last-plus-group-node bi-list-item-active",
logic: {
dynamic: false
},
id: "",
pId: "",
readonly: true,
open: false,
height: 24
});
},
_init: function () {
BI.SelectTreeLastPlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.checkbox = BI.createWidget({
type: "bi.last_tree_node_checkbox",
stopPropagation: true
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
keyword: o.keyword,
py: o.py
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
if (this.isSelected()) {
self.triggerExpand();
} else {
self.triggerCollapse();
}
}
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 24,
el: this.checkbox
}, this.text);
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
},
isOnce: function () {
return true;
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.NodeButton.superclass.doClick.apply(this, arguments);
},
setOpened: function (v) {
BI.SelectTreeLastPlusGroupNode.superclass.setOpened.apply(this, arguments);
if (BI.isNotNull(this.checkbox)) {
this.checkbox.setSelected(v);
}
}
});
BI.shortcut("bi.select_tree_last_plus_group_node", BI.SelectTreeLastPlusGroupNode);
/***/ }),
/* 619 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
* Created by GUY on 2015/9/6.
* @class BI.SelectTreeMidPlusGroupNode
* @extends BI.NodeButton
*/
BI.SelectTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.SelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-select-tree-mid-plus-group-node bi-list-item-active",
logic: {
dynamic: false
},
id: "",
pId: "",
readonly: true,
open: false,
height: 24
});
},
_init: function () {
BI.SelectTreeMidPlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.checkbox = BI.createWidget({
type: "bi.mid_tree_node_checkbox",
stopPropagation: true
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
keyword: o.keyword,
py: o.py
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
if (this.isSelected()) {
self.triggerExpand();
} else {
self.triggerCollapse();
}
}
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 24,
el: this.checkbox
}, this.text);
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
},
isOnce: function () {
return true;
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.NodeButton.superclass.doClick.apply(this, arguments);
},
setOpened: function (v) {
BI.SelectTreeMidPlusGroupNode.superclass.setOpened.apply(this, arguments);
if (BI.isNotNull(this.checkbox)) {
this.checkbox.setSelected(v);
}
}
});
BI.shortcut("bi.select_tree_mid_plus_group_node", BI.SelectTreeMidPlusGroupNode);
/***/ }),
/* 620 */
/***/ (function(module, exports) {
/**
* 加号表示的组节点
* Created by GUY on 2015/9/6.
* @class BI.SelectTreePlusGroupNode
* @extends BI.NodeButton
*/
BI.SelectTreePlusGroupNode = BI.inherit(BI.NodeButton, {
_defaultConfig: function () {
var conf = BI.SelectTreePlusGroupNode.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-select-tree-plus-group-node bi-list-item-active",
logic: {
dynamic: false
},
id: "",
pId: "",
readonly: true,
open: false,
height: 24
});
},
_init: function () {
BI.SelectTreePlusGroupNode.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.checkbox = BI.createWidget({
type: "bi.tree_node_checkbox",
stopPropagation: true
});
this.text = BI.createWidget({
type: "bi.label",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
keyword: o.keyword,
py: o.py
});
this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
if (this.isSelected()) {
self.triggerExpand();
} else {
self.triggerCollapse();
}
}
});
var type = BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left);
var items = BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left, {
width: 24,
el: this.checkbox
}, this.text);
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(type, BI.extend(o.logic, {
items: items
}))));
},
isOnce: function () {
return true;
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.NodeButton.superclass.doClick.apply(this, arguments);
},
setOpened: function (v) {
BI.SelectTreePlusGroupNode.superclass.setOpened.apply(this, arguments);
if (BI.isNotNull(this.checkbox)) {
this.checkbox.setSelected(v);
}
}
});
BI.shortcut("bi.select_tree_plus_group_node", BI.SelectTreePlusGroupNode);
/***/ }),
/* 621 */
/***/ (function(module, exports) {
/**
* @class BI.SelectTreeCombo
* @extends BI.Widget
*/
BI.SelectTreeCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SelectTreeCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-tree-combo",
height: 24,
text: "",
items: [],
value: "",
attributes: {
tabIndex: 0
}
});
},
_init: function () {
BI.SelectTreeCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
});
this.popup = BI.createWidget({
type: "bi.select_level_tree",
items: o.items,
value: o.value
});
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
popup: {
el: this.popup
}
});
this.combo.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.popup.on(BI.SingleTreePopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
});
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.trigger.setValue(v);
this.popup.setValue(v);
},
getValue: function () {
return this.popup.getValue();
},
populate: function (items) {
this.combo.populate(items);
}
});
BI.shortcut("bi.select_tree_combo", BI.SelectTreeCombo);
/***/ }),
/* 622 */
/***/ (function(module, exports) {
/**
* @class BI.SelectTreeExpander
* @extends BI.Widget
*/
BI.SelectTreeExpander = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SelectTreeExpander.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-tree-expander",
trigger: "",
toggle: true,
direction: "bottom",
isDefaultInit: true,
el: {},
popup: {}
});
},
_init: function () {
BI.SelectTreeExpander.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(o.el);
this.trigger.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
if (this.isSelected()) {
self.expander.setValue([]);
}
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.expander = BI.createWidget({
type: "bi.expander",
element: this,
trigger: o.trigger,
toggle: o.toggle,
direction: o.direction,
isDefaultInit: o.isDefaultInit,
el: this.trigger,
popup: o.popup
});
this.expander.on(BI.Controller.EVENT_CHANGE, function (type) {
if (type === BI.Events.CLICK) {
self.trigger.setSelected(false);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
},
getAllLeaves: function () {
return this.expander.getAllLeaves();
},
setValue: function (v) {
if (BI.contains(v, this.trigger.getValue())) {
this.trigger.setSelected(true);
this.expander.setValue([]);
} else {
this.trigger.setSelected(false);
this.expander.setValue(v);
}
},
getValue: function () {
if (this.trigger.isSelected()) {
return [this.trigger.getValue()];
}
return this.expander.getValue();
},
populate: function (items) {
this.expander.populate(items);
}
});
BI.shortcut("bi.select_tree_expander", BI.SelectTreeExpander);
/***/ }),
/* 623 */
/***/ (function(module, exports) {
/**
* @class BI.SelectTreePopup
* @extends BI.Pane
*/
BI.SelectTreePopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.SelectTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-level-tree",
tipText: BI.i18nText("BI-No_Selected_Item"),
items: [],
value: ""
});
},
_formatItems: function (nodes, layer, pNode) {
var self = this;
BI.each(nodes, function (i, node) {
var extend = {layer: layer};
node.id = node.id || BI.UUID();
extend.pNode = pNode;
if (node.isParent === true || node.parent === true || BI.isNotEmptyArray(node.children)) {
extend.type = "bi.select_tree_mid_plus_group_node";
if (i === nodes.length - 1) {
extend.type = "bi.select_tree_last_plus_group_node";
extend.isLastNode = true;
}
if (i === 0 && !pNode) {
extend.type = "bi.select_tree_first_plus_group_node"
}
if (i === 0 && i === nodes.length - 1) { // 根
extend.type = "bi.select_tree_plus_group_node";
}
BI.defaults(node, extend);
self._formatItems(node.children, layer + 1, node);
} else {
extend.type = "bi.mid_tree_leaf_item";
if (i === 0 && !pNode) {
extend.type = "bi.first_tree_leaf_item"
}
if (i === nodes.length - 1) {
extend.type = "bi.last_tree_leaf_item";
}
BI.defaults(node, extend);
}
});
return nodes;
},
_init: function () {
BI.SelectTreePopup.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.level_tree",
expander: {
type: "bi.select_tree_expander",
isDefaultInit: true
},
items: this._formatItems(BI.Tree.transformToTreeFormat(o.items), 0),
value: o.value,
chooseType: BI.Selection.Single
});
BI.createWidget({
type: "bi.vertical",
element: this,
vgap: 5,
items: [this.tree]
});
this.tree.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.tree.on(BI.LevelTree.EVENT_CHANGE, function () {
self.fireEvent(BI.SelectTreePopup.EVENT_CHANGE);
});
this.check();
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
BI.SelectTreePopup.superclass.populate.apply(this, arguments);
this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(items)));
}
});
BI.SelectTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.select_level_tree", BI.SelectTreePopup);
/***/ }),
/* 624 */
/***/ (function(module, exports) {
/**
* 单选加载数据搜索loader面板
* Created by guy on 15/11/4.
* @class BI.SingleSelectSearchLoader
* @extends Widget
*/
BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectSearchLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-search-loader",
allowNoSelect: false,
itemsCreator: BI.emptyFn,
keywordGetter: BI.emptyFn,
valueFormatter: BI.emptyFn
});
},
_init: function () {
BI.SingleSelectSearchLoader.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var hasNext = false;
this.button_group = BI.createWidget({
type: "bi.single_select_list",
allowNoSelect: opts.allowNoSelect,
element: this,
logic: {
dynamic: false
},
value: opts.value,
el: {
tipText: BI.i18nText("BI-No_Select"),
el: {
type: "bi.loader",
isDefaultInit: false,
logic: {
dynamic: true,
scrolly: true
},
el: {
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
behaviors: {
redmark: function () {
return true;
}
},
layouts: [{
type: "bi.vertical"
}]
}
}
},
itemsCreator: function (op, callback) {
self.storeValue && (op = BI.extend(op || {}, {
selectedValues: [self.storeValue]
}));
opts.itemsCreator(op, function (ob) {
var keyword = ob.keyword = opts.keywordGetter();
hasNext = ob.hasNext;
var firstItems = [];
if (op.times === 1 && BI.isNotNull(self.storeValue)) {
var json = self._filterValues(self.storeValue);
firstItems = self._createItems(json);
}
callback(firstItems.concat(self._createItems(ob.items)), keyword || "");
if (op.times === 1 && self.storeValue) {
self.setValue(self.storeValue);
}
});
},
hasNext: function () {
return hasNext;
}
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.button_group.on(BI.SingleSelectList.EVENT_CHANGE, function () {
self.fireEvent(BI.SingleSelectSearchLoader.EVENT_CHANGE, arguments);
});
},
_createItems: function (items) {
return BI.createItems(items, {
type: this.options.allowNoSelect ? "bi.single_select_item" : "bi.single_select_combo_item",
cls: "bi-list-item-active",
logic: {
dynamic: false
},
height: 25,
selected: false
});
},
_filterValues: function (src) {
var o = this.options;
var keyword = o.keywordGetter();
var values = src || [];
var newValues = BI.map(BI.isArray(values) ? values : [values], function (i, v) {
return {
text: o.valueFormatter(v) || v,
value: v
};
});
if (BI.isKey(keyword)) {
var search = BI.Func.getSearchResult(newValues, keyword);
values = search.match.concat(search.find);
}
return BI.map(values, function (i, v) {
return {
text: v.text,
title: v.text,
value: v.value,
selected: false
};
});
},
setValue: function (v) {
// 暂存的值一定是新的值,不然v改掉后,storeValue也跟着改了
this.storeValue = v;
this.button_group.setValue(v);
},
getValue: function () {
return this.button_group.getValue();
},
getAllButtons: function () {
return this.button_group.getAllButtons();
},
empty: function () {
this.button_group.empty();
},
populate: function (items) {
this.button_group.populate.apply(this.button_group, arguments);
},
resetHeight: function (h) {
this.button_group.resetHeight(h);
},
resetWidth: function (w) {
this.button_group.resetWidth(w);
}
});
BI.SingleSelectSearchLoader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_select_search_loader", BI.SingleSelectSearchLoader);
/***/ }),
/* 625 */
/***/ (function(module, exports) {
/**
*
* 在搜索框中输入文本弹出的面板
* @class BI.SingleSelectSearchInsertPane
* @extends Widget
*/
BI.SingleSelectSearchInsertPane = BI.inherit(BI.Widget, {
constants: {
height: 25,
lgap: 10,
tgap: 5
},
_defaultConfig: function () {
return BI.extend(BI.SingleSelectSearchInsertPane.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-search-pane bi-card",
allowNoSelect: false,
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
keywordGetter: BI.emptyFn
});
},
_init: function () {
BI.SingleSelectSearchInsertPane.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.tooltipClick = BI.createWidget({
type: "bi.label",
invisible: true,
text: BI.i18nText("BI-Click_Blank_To_Select"),
cls: "single-select-toolbar",
height: this.constants.height
});
this.addNotMatchTip = BI.createWidget({
type: "bi.text_button",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: this.constants.height,
cls: "bi-high-light",
hgap: 5,
handler: function () {
self.fireEvent(BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM, o.keywordGetter());
}
});
this.loader = BI.createWidget({
type: "bi.single_select_search_loader",
allowNoSelect: o.allowNoSelect,
keywordGetter: o.keywordGetter,
valueFormatter: o.valueFormatter,
itemsCreator: function (op, callback) {
o.itemsCreator.apply(self, [op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.resizer = BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
type: "bi.vertical",
items: [this.tooltipClick, this.addNotMatchTip],
height: this.constants.height
}, {
el: this.loader
}]
});
},
setKeyword: function (keyword) {
var o = this.options;
var hasSameValue = BI.some(this.loader.getAllButtons(), function (idx, btn) {
return keyword === (o.valueFormatter(btn.getValue()) || btn.getValue());
});
var isMatchTipVisible = this.loader.getAllButtons().length > 0 && hasSameValue;
this.tooltipClick.setVisible(isMatchTipVisible);
this.addNotMatchTip.setVisible(!isMatchTipVisible);
!isMatchTipVisible && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
hasMatched: function () {
return this.tooltipClick.isVisible();
},
setValue: function (v) {
this.loader.setValue(v);
},
getValue: function () {
return this.loader.getValue();
},
empty: function () {
this.loader.empty();
},
populate: function (items) {
this.loader.populate.apply(this.loader, arguments);
}
});
BI.SingleSelectSearchInsertPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.shortcut("bi.single_select_search_insert_pane", BI.SingleSelectSearchInsertPane);
/***/ }),
/* 626 */
/***/ (function(module, exports) {
/**
*
* 在搜索框中输入文本弹出的面板
* @class BI.SingleSelectSearchPane
* @extends Widget
*/
BI.SingleSelectSearchPane = BI.inherit(BI.Widget, {
constants: {
height: 25,
lgap: 10,
tgap: 5
},
_defaultConfig: function () {
return BI.extend(BI.SingleSelectSearchPane.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-search-pane bi-card",
allowNoSelect: false,
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
keywordGetter: BI.emptyFn
});
},
_init: function () {
BI.SingleSelectSearchPane.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.tooltipClick = BI.createWidget({
type: "bi.label",
invisible: true,
text: BI.i18nText("BI-Click_Blank_To_Select"),
cls: "single-select-toolbar",
height: this.constants.height
});
this.loader = BI.createWidget({
type: "bi.single_select_search_loader",
allowNoSelect: o.allowNoSelect,
keywordGetter: o.keywordGetter,
valueFormatter: o.valueFormatter,
itemsCreator: function (op, callback) {
o.itemsCreator.apply(self, [op, function (res) {
callback(res);
self.setKeyword(o.keywordGetter());
}]);
},
value: o.value
});
this.loader.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.resizer = BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.tooltipClick,
height: 0
}, {
el: this.loader
}]
});
this.tooltipClick.setVisible(false);
},
setKeyword: function (keyword) {
var btn, o = this.options;
var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === (o.valueFormatter(btn.getValue()) || btn.getValue()));
if (isVisible !== this.tooltipClick.isVisible()) {
this.tooltipClick.setVisible(isVisible);
this.resizer.attr("items")[0].height = (isVisible ? this.constants.height : 0);
this.resizer.resize();
}
},
hasMatched: function () {
return this.tooltipClick.isVisible();
},
setValue: function (v) {
this.loader.setValue(v);
},
getValue: function () {
return this.loader.getValue();
},
empty: function () {
this.loader.empty();
},
populate: function (items) {
this.loader.populate.apply(this.loader, arguments);
}
});
BI.SingleSelectSearchPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_select_search_pane", BI.SingleSelectSearchPane);
/***/ }),
/* 627 */
/***/ (function(module, exports) {
/**
*
* @class BI.SingleSelectCombo
* @extends BI.Single
*/
BI.SingleSelectCombo = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-combo",
allowNoSelect: false,
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
attributes: {
tabIndex: 0
},
allowEdit: true
});
},
_init: function () {
BI.SingleSelectCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue = self._startValue);
self.trigger.getSearcher().setState(self.storeValue);
};
this.storeValue = o.value;
// 标记正在请求数据
this.requesting = false;
this.trigger = BI.createWidget({
type: "bi.single_select_trigger",
height: o.height,
// adapter: this.popup,
allowNoSelect: o.allowNoSelect,
allowEdit: o.allowEdit,
valueFormatter: o.valueFormatter,
itemsCreator: function (op, callback) {
o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(self.getValue());
}
callback.apply(self, arguments);
});
},
text: o.text,
value: this.storeValue
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.SingleSelectCombo.EVENT_FOCUS);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.SingleSelectCombo.EVENT_BLUR);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_START, function () {
self._setStartValue();
this.getSearcher().setValue(self.storeValue);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP, function () {
self._setStartValue();
self.fireEvent(BI.SingleSelectCombo.EVENT_STOP);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword();
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue();
}
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();
self._setStartValue();
} else {
self.combo.setValue(self.storeValue);
assertShowValue();
}
});
}
self.fireEvent(BI.SingleSelectCombo.EVENT_SEARCHING);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE, function (value, obj) {
self.storeValue = this.getValue();
assertShowValue();
self._defaultState();
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
toggle: false,
el: this.trigger,
adjustLength: 1,
popup: {
type: "bi.single_select_popup_view",
allowNoSelect: o.allowNoSelect,
ref: function () {
self.popup = this;
self.trigger.setAdapter(this);
},
listeners: [{
eventName: BI.SingleSelectPopupView.EVENT_CHANGE,
action: function () {
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
self._defaultState();
});
self.fireEvent(BI.SingleSelectCombo.EVENT_CLICK_ITEM);
}
}],
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
onLoaded: function () {
BI.nextTick(function () {
self.combo.adjustWidth();
self.combo.adjustHeight();
self.trigger.getSearcher().adjustView();
});
}
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
},
value: o.value
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
this.setValue(self.storeValue);
BI.nextTick(function () {
self.populate();
});
});
// 当退出的时候如果还在处理请求,则等请求结束后再对外发确定事件
this.wants2Quit = false;
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
// important:关闭弹出时又可能没有退出编辑状态
self.trigger.stopEditing();
if (self.requesting === true) {
self.wants2Quit = true;
} else {
self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM);
}
});
var triggerBtn = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.height,
height: o.height,
cls: "single-select-trigger-icon-button"
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}]
});
},
_defaultState: function () {
this.trigger.stopEditing();
this.combo.hideView();
},
_assertValue: function (val) {},
_makeMap: function (values) {
return BI.makeObject(values || []);
},
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
this.requesting = true;
o.itemsCreator({
type: BI.SingleSelectCombo.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
BI.remove(self.storeValue.value, val);
}
});
self._adjust(callback);
}
},
_adjust: function (callback) {
var self = this, o = this.options;
if (!this._count) {
o.itemsCreator({
type: BI.SingleSelectCombo.REQ_GET_DATA_LENGTH
}, function (res) {
self._count = res.count;
adjust();
callback();
});
} else {
adjust();
callback();
}
function adjust () {
if (self.wants2Quit === true) {
self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM);
self.wants2Quit = false;
}
self.requesting = false;
}
},
_setStartValue: function (value) {
this._startValue = value;
this.popup.setStartValue(value);
},
setValue: function (v) {
this.storeValue = v;
this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue);
},
getValue: function () {
return this.storeValue;
},
populate: function () {
this._count = null;
this.combo.populate.apply(this.combo, arguments);
}
});
BI.extend(BI.SingleSelectCombo, {
REQ_GET_DATA_LENGTH: 0,
REQ_GET_ALL_DATA: -1
});
BI.SingleSelectCombo.EVENT_BLUR = "EVENT_BLUR";
BI.SingleSelectCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.SingleSelectCombo.EVENT_STOP = "EVENT_STOP";
BI.SingleSelectCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.SingleSelectCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.SingleSelectCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.single_select_combo", BI.SingleSelectCombo);
/***/ }),
/* 628 */
/***/ (function(module, exports) {
/**
*
* @class BI.SingleSelectInsertCombo
* @extends BI.Single
*/
BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectInsertCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-combo",
allowNoSelect: false,
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
attributes: {
tabIndex: 0
},
allowEdit: true
});
},
_init: function () {
BI.SingleSelectInsertCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue = self._startValue);
self.trigger.getSearcher().setState(self.storeValue);
};
this.storeValue = o.value;
// 标记正在请求数据
this.requesting = false;
this.trigger = BI.createWidget({
type: "bi.single_select_trigger",
height: o.height,
allowNoSelect: o.allowNoSelect,
allowEdit: o.allowEdit,
// adapter: this.popup,
valueFormatter: o.valueFormatter,
itemsCreator: function (op, callback) {
o.itemsCreator(op, function (res) {
if (op.times === 1 && BI.isNotNull(op.keywords)) {
// 预防trigger内部把当前的storeValue改掉
self.trigger.setValue(self.getValue());
}
callback.apply(self, arguments);
});
},
text: o.text,
value: this.storeValue,
searcher: {
popup: {
type: "bi.single_select_search_insert_pane",
listeners: [{
eventName: BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,
action: function () {
if (!self.trigger.getSearcher().hasMatched()) {
self.storeValue = self.trigger.getSearcher().getKeyword();
assertShowValue();
self._defaultState();
}
}
}]
}
}
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_FOCUS);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_BLUR);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_START, function () {
self._setStartValue();
this.getSearcher().setValue(self.storeValue);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP, function () {
self._setStartValue();
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_STOP);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
var keyword = this.getSearcher().getKeyword();
self.storeValue = keyword;
self.combo.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.populate();
self._setStartValue();
}
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING, function (keywords) {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.combo.setValue(self.storeValue);
assertShowValue();
self.combo.populate();
self._setStartValue();
} else {
self.combo.setValue(self.storeValue);
assertShowValue();
}
});
}
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_SEARCHING);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE, function (value, obj) {
self.storeValue = this.getValue();
assertShowValue();
self._defaultState();
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK, function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
});
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
toggle: false,
el: this.trigger,
adjustLength: 1,
popup: {
type: "bi.single_select_popup_view",
allowNoSelect: o.allowNoSelect,
ref: function () {
self.popup = this;
self.trigger.setAdapter(this);
},
listeners: [{
eventName: BI.SingleSelectPopupView.EVENT_CHANGE,
action: function () {
self.storeValue = this.getValue();
self._adjust(function () {
assertShowValue();
self._defaultState();
});
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM);
}
}],
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
onLoaded: function () {
BI.nextTick(function () {
self.combo.adjustWidth();
self.combo.adjustHeight();
self.trigger.getSearcher().adjustView();
});
}
},
hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0;
},
value: o.value
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
this.setValue(self.storeValue);
BI.nextTick(function () {
self.populate();
});
});
// 当退出的时候如果还在处理请求,则等请求结束后再对外发确定事件
this.wants2Quit = false;
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
// important:关闭弹出时又可能没有退出编辑状态
self.trigger.stopEditing();
if (self.requesting === true) {
self.wants2Quit = true;
} else {
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM);
}
});
var triggerBtn = BI.createWidget({
type: "bi.trigger_icon_button",
width: o.height,
height: o.height,
cls: "single-select-trigger-icon-button"
});
triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE, function () {
if (self.combo.isViewVisible()) {
self.combo.hideView();
} else {
self.combo.showView();
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.combo,
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: triggerBtn,
right: 0,
top: 0,
bottom: 0
}]
});
},
_defaultState: function () {
this.trigger.stopEditing();
this.combo.hideView();
},
_assertValue: function (val) {
},
_makeMap: function (values) {
return BI.makeObject(values || []);
},
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
this.requesting = true;
o.itemsCreator({
type: BI.SingleSelectInsertCombo.REQ_GET_ALL_DATA,
keywords: keywords
}, function (ob) {
var values = BI.map(ob.items, "value");
digest(values);
});
function digest (items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
BI.remove(self.storeValue.value, val);
}
});
self._adjust(callback);
}
},
_adjust: function (callback) {
var self = this, o = this.options;
adjust();
callback();
function adjust () {
if (self.wants2Quit === true) {
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM);
self.wants2Quit = false;
}
self.requesting = false;
}
},
_setStartValue: function (value) {
this._startValue = value;
this.popup.setStartValue(value);
},
setValue: function (v) {
this.storeValue = v;
this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue);
},
getValue: function () {
return this.storeValue;
},
populate: function () {
this.combo.populate.apply(this.combo, arguments);
}
});
BI.extend(BI.SingleSelectInsertCombo, {
REQ_GET_DATA_LENGTH: 0,
REQ_GET_ALL_DATA: -1
});
BI.SingleSelectInsertCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.SingleSelectInsertCombo.EVENT_BLUR = "EVENT_BLUR";
BI.SingleSelectInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.SingleSelectInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.SingleSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.single_select_insert_combo", BI.SingleSelectInsertCombo);
/***/ }),
/* 629 */
/***/ (function(module, exports) {
BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectComboItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-single-select-radio-item",
logic: {
dynamic: false
},
height: 24
});
},
_init: function () {
BI.SingleSelectComboItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.radio = BI.createWidget({
type: "bi.radio"
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
type: "bi.center_adapt",
items: [this.radio],
width: 26
}, this.text)
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.SingleSelectComboItem.superclass.doClick.apply(this, arguments);
this.radio.setSelected(this.isSelected());
if (this.isValid()) {
this.fireEvent(BI.SingleSelectComboItem.EVENT_CHANGE, this.isSelected(), this);
}
},
setSelected: function (v) {
BI.SingleSelectComboItem.superclass.setSelected.apply(this, arguments);
this.radio.setSelected(v);
}
});
BI.SingleSelectComboItem.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_select_combo_item", BI.SingleSelectComboItem);
/***/ }),
/* 630 */
/***/ (function(module, exports) {
/**
* 选择列表
*
* Created by GUY on 2015/11/1.
* @class BI.SingleSelectList
* @extends BI.Widget
*/
BI.SingleSelectList = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectList.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-list",
direction: BI.Direction.Top, // toolbar的位置
logic: {
dynamic: true
},
items: [],
itemsCreator: BI.emptyFn,
hasNext: BI.emptyFn,
onLoaded: BI.emptyFn,
el: {
type: "bi.list_pane"
},
allowNoSelect: false
});
},
_init: function () {
BI.SingleSelectList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.list = BI.createWidget(o.el, {
type: "bi.list_pane",
items: o.items,
itemsCreator: function (op, callback) {
op.times === 1 && self.toolbar && self.toolbar.setVisible(false);
o.itemsCreator(op, function (items) {
callback.apply(self, arguments);
if (op.times === 1) {
self.toolbar && self.toolbar.setVisible(items && items.length > 0);
self.toolbar && self.toolbar.setEnable(items && items.length > 0);
}
});
},
onLoaded: o.onLoaded,
hasNext: o.hasNext,
value: o.value
});
this.list.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (type === BI.Events.CLICK) {
self.fireEvent(BI.SingleSelectList.EVENT_CHANGE, value, obj);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction), BI.extend({
scrolly: true
}, o.logic, {
items: o.allowNoSelect ? BI.LogicFactory.createLogicItemsByDirection(o.direction, {
type: "bi.single_select_item",
cls: "bi-list-item-active",
height: 24,
forceNotSelected: true,
text: BI.i18nText("BI-Basic_No_Select"),
ref: function (_ref) {
self.toolbar = _ref;
},
listeners: [{
eventName: BI.Controller.EVENT_CHANGE,
action: function (type) {
if (type === BI.Events.CLICK) {
self.list.setValue();
self.fireEvent(BI.SingleSelectList.EVENT_CHANGE);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}
}]
}, this.list) : BI.LogicFactory.createLogicItemsByDirection(o.direction, this.list)
}))));
},
hasPrev: function () {
return this.list.hasPrev();
},
hasNext: function () {
return this.list.hasNext();
},
prependItems: function (items) {
this.list.prependItems.apply(this.list, arguments);
},
addItems: function (items) {
this.list.addItems.apply(this.list, arguments);
},
setValue: function (v) {
this.list.setValue([v]);
},
getValue: function () {
return this.list.getValue()[0];
},
empty: function () {
this.list.empty();
},
populate: function (items) {
this.list.populate.apply(this.list, arguments);
},
resetHeight: function (h) {
this.list.resetHeight ? this.list.resetHeight(h) :
this.list.element.css({"max-height": h + "px"});
},
setNotSelectedValue: function () {
this.list.setNotSelectedValue.apply(this.list, arguments);
},
getNotSelectedValue: function () {
return this.list.getNotSelectedValue();
},
getAllButtons: function () {
return this.list.getAllButtons();
},
getAllLeaves: function () {
return this.list.getAllLeaves();
},
getSelectedButtons: function () {
return this.list.getSelectedButtons();
},
getNotSelectedButtons: function () {
return this.list.getNotSelectedButtons();
},
getIndexByValue: function (value) {
return this.list.getIndexByValue(value);
},
getNodeById: function (id) {
return this.list.getNodeById(id);
},
getNodeByValue: function (value) {
return this.list.getNodeByValue(value);
}
});
BI.SingleSelectList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_select_list", BI.SingleSelectList);
/***/ }),
/* 631 */
/***/ (function(module, exports) {
/**
* 单选加载数据面板
* Created by guy on 15/11/2.
* @class BI.SingleSelectLoader
* @extends Widget
*/
BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-loader",
logic: {
dynamic: true
},
el: {
height: 400
},
allowNoSelect: false,
valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn
});
},
_init: function () {
BI.SingleSelectLoader.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var hasNext = false;
this.storeValue = opts.value;
this.button_group = BI.createWidget({
type: "bi.single_select_list",
allowNoSelect: opts.allowNoSelect,
logic: opts.logic,
el: BI.extend({
onLoaded: opts.onLoaded,
el: {
type: "bi.loader",
isDefaultInit: false,
logic: {
dynamic: true,
scrolly: true
},
el: {
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
behaviors: {
redmark: function () {
return true;
}
},
layouts: [{
type: "bi.vertical"
}]
}
}
}, opts.el),
itemsCreator: function (op, callback) {
var startValue = self._startValue;
BI.isNotNull(self.storeValue) && (op = BI.extend(op || {}, {
selectedValues: [self.storeValue]
}));
opts.itemsCreator(op, function (ob) {
hasNext = ob.hasNext;
var firstItems = [];
if (op.times === 1 && BI.isNotNull(self.storeValue)) {
var json = BI.map([self.storeValue], function (i, v) {
var txt = opts.valueFormatter(v) || v;
return {
text: txt,
value: v,
title: txt,
selected: true
};
});
firstItems = self._createItems(json);
}
callback(firstItems.concat(self._createItems(ob.items)), ob.keyword || "");
if (op.times === 1 && self.storeValue) {
BI.isKey(startValue) && (self.storeValue = startValue);
self.setValue(self.storeValue);
}
(op.times === 1) && self._scrollToTop();
});
},
hasNext: function () {
return hasNext;
},
value: this.storeValue
});
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.button_group],
vgap: 5
});
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.button_group.on(BI.SingleSelectList.EVENT_CHANGE, function () {
self.fireEvent(BI.SingleSelectLoader.EVENT_CHANGE, arguments);
});
},
_createItems: function (items) {
return BI.createItems(items, {
type: this.options.allowNoSelect ? "bi.single_select_item" : "bi.single_select_combo_item",
logic: this.options.logic,
cls: "bi-list-item-active",
height: 24,
selected: false
});
},
_scrollToTop: function () {
var self = this;
BI.delay(function () {
self.button_group.element.scrollTop(0);
}, 30);
},
_assertValue: function (val) {},
setStartValue: function (v) {
this._startValue = v;
},
setValue: function (v) {
this.storeValue = v;
this._assertValue(this.storeValue);
this.button_group.setValue(this.storeValue);
},
getValue: function () {
return this.button_group.getValue();
},
getAllButtons: function () {
return this.button_group.getAllButtons();
},
empty: function () {
this.button_group.empty();
},
populate: function (items) {
this.button_group.populate.apply(this.button_group, arguments);
},
resetHeight: function (h) {
this.button_group.resetHeight(h);
},
resetWidth: function (w) {
this.button_group.resetWidth(w);
}
});
BI.SingleSelectLoader.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_select_loader", BI.SingleSelectLoader);
/***/ }),
/* 632 */
/***/ (function(module, exports) {
/**
* 带加载的单选下拉面板
* @class BI.SingleSelectPopupView
* @extends Widget
*/
BI.SingleSelectPopupView = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectPopupView.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-popup-view",
allowNoSelect: false,
maxWidth: "auto",
minWidth: 135,
maxHeight: 400,
valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn,
onLoaded: BI.emptyFn
});
},
_init: function () {
BI.SingleSelectPopupView.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.loader = BI.createWidget({
type: "bi.single_select_loader",
allowNoSelect: opts.allowNoSelect,
itemsCreator: opts.itemsCreator,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded,
value: opts.value
});
this.popupView = BI.createWidget({
type: "bi.popup_view",
stopPropagation: false,
maxWidth: opts.maxWidth,
minWidth: opts.minWidth,
maxHeight: opts.maxHeight,
element: this,
el: this.loader,
value: opts.value
});
this.popupView.on(BI.MultiPopupView.EVENT_CHANGE, function () {
self.fireEvent(BI.SingleSelectPopupView.EVENT_CHANGE);
});
},
setStartValue: function (v) {
this.loader.setStartValue(v);
},
setValue: function (v) {
this.popupView.setValue(v);
},
getValue: function () {
return this.popupView.getValue();
},
populate: function (items) {
this.popupView.populate.apply(this.popupView, arguments);
},
resetHeight: function (h) {
this.popupView.resetHeight(h);
},
resetWidth: function (w) {
this.popupView.resetWidth(w);
}
});
BI.SingleSelectPopupView.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_select_popup_view", BI.SingleSelectPopupView);
/***/ }),
/* 633 */
/***/ (function(module, exports) {
/**
*
* 单选下拉框
* @class BI.SingleSelectTrigger
* @extends BI.Trigger
*/
BI.SingleSelectTrigger = BI.inherit(BI.Trigger, {
constants: {
height: 14,
rgap: 4,
lgap: 4
},
_defaultConfig: function () {
return BI.extend(BI.SingleSelectTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-trigger bi-border bi-border-radius",
allowNoSelect: false,
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
searcher: {},
switcher: {},
adapter: null,
masker: {},
allowEdit: true
});
},
_init: function () {
BI.SingleSelectTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (o.height) {
this.setHeight(o.height - 2);
}
this.searcher = BI.createWidget(o.searcher, {
type: "bi.single_select_searcher",
allowNoSelect: o.allowNoSelect,
text: o.text,
height: o.height,
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
popup: {},
adapter: o.adapter,
masker: o.masker,
value: o.value
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_START, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_START);
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_PAUSE, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_PAUSE);
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_SEARCHING, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_SEARCHING, arguments);
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_STOP, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_STOP);
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_CHANGE, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_CHANGE, arguments);
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_FOCUS, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_FOCUS);
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_BLUR, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_BLUR, arguments);
});
var wrapper = BI.createWidget({
type: "bi.htape",
element: this,
items: [
{
el: this.searcher,
width: "fill"
}, {
el: BI.createWidget(),
width: 24
}]
});
!o.allowEdit && BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.text",
title: function () {
return self.searcher.getState();
}
},
left: 0,
right: 24,
top: 0,
bottom: 0
}]
});
},
getSearcher: function () {
return this.searcher;
},
stopEditing: function () {
this.searcher.stopSearch();
},
setAdapter: function (adapter) {
this.searcher.setAdapter(adapter);
},
setValue: function (v) {
this.searcher.setValue(v);
},
getKey: function () {
return this.searcher.getKey();
},
getValue: function () {
return this.searcher.getValue();
}
});
BI.SingleSelectTrigger.EVENT_TRIGGER_CLICK = "EVENT_TRIGGER_CLICK";
BI.SingleSelectTrigger.EVENT_COUNTER_CLICK = "EVENT_COUNTER_CLICK";
BI.SingleSelectTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.SingleSelectTrigger.EVENT_START = "EVENT_START";
BI.SingleSelectTrigger.EVENT_STOP = "EVENT_STOP";
BI.SingleSelectTrigger.EVENT_PAUSE = "EVENT_PAUSE";
BI.SingleSelectTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.SingleSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW = "EVENT_BEFORE_COUNTER_POPUPVIEW";
BI.SingleSelectTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.SingleSelectTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.shortcut("bi.single_select_trigger", BI.SingleSelectTrigger);
/***/ }),
/* 634 */
/***/ (function(module, exports) {
/**
* @author: Teller
* @createdAt: 2018/3/28
* @Description
*/
BI.SingleSelectInsertList = BI.inherit(BI.Single, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectInsertList.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-select-insert-list",
allowNoSelect: false,
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn
});
},
_init: function () {
BI.SingleSelectInsertList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value;
var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue = self._startValue);
// self.trigger.setValue(self.storeValue);
};
this.adapter = BI.createWidget({
type: "bi.single_select_loader",
allowNoSelect: o.allowNoSelect,
cls: "popup-single-select-list bi-border-left bi-border-right bi-border-bottom",
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
logic: {
dynamic: true
},
// onLoaded: o.onLoaded,
el: {},
value: o.value
});
this.adapter.on(BI.SingleSelectLoader.EVENT_CHANGE, function () {
self.storeValue = this.getValue();
assertShowValue();
self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE);
});
this.searcherPane = BI.createWidget({
type: "bi.single_select_search_insert_pane",
allowNoSelect: o.allowNoSelect,
cls: "bi-border-left bi-border-right bi-border-bottom",
valueFormatter: o.valueFormatter,
keywordGetter: function () {
return self.trigger.getKeyword();
},
itemsCreator: function (op, callback) {
op.keywords = [self.trigger.getKeyword()];
this.setKeyword(op.keywords[0]);
o.itemsCreator(op, callback);
},
listeners: [{
eventName: BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,
action: function () {
var keyword = self.trigger.getKeyword();
if (!self.trigger.hasMatched()) {
self.storeValue = keyword;
self._showAdapter();
self.adapter.setValue(self.storeValue);
self.adapter.populate();
self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE);
}
}
}]
});
this.searcherPane.setVisible(false);
this.trigger = BI.createWidget({
type: "bi.searcher",
allowSearchBlank: false,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
callback();
},
adapter: this.adapter,
popup: this.searcherPane,
height: 200,
masker: false,
value: o.value,
listeners: [{
eventName: BI.Searcher.EVENT_START,
action: function () {
self._showSearcherPane();
self._setStartValue();
this.setValue(BI.deepClone(self.storeValue));
}
}, {
eventName: BI.Searcher.EVENT_STOP,
action: function () {
self._showAdapter();
self._setStartValue();
self.adapter.setValue(self.storeValue);
// 需要刷新回到初始界面,否则搜索的结果不能放在最前面
self.adapter.populate();
}
}, {
eventName: BI.Searcher.EVENT_PAUSE,
action: function () {
var keyword = this.getKeyword();
if (this.hasMatched()) {
self.storeValue = keyword;
self._showAdapter();
self.adapter.setValue(self.storeValue);
self._setStartValue(keyword);
assertShowValue();
self.adapter.populate();
self._setStartValue();
self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE);
} else {
self._showAdapter();
}
}
}, {
eventName: BI.Searcher.EVENT_SEARCHING,
action: function () {
var keywords = this.getKeyword();
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords, function () {
if (BI.isEndWithBlank(last)) {
self.adapter.setValue(self.storeValue);
assertShowValue();
self.adapter.populate();
self._setStartValue();
} else {
self.adapter.setValue(self.storeValue);
assertShowValue();
}
});
}
}
}, {
eventName: BI.Searcher.EVENT_CHANGE,
action: function () {
self.storeValue = this.getValue();
self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE);
}
}]
});
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: this.trigger,
height: 24
}, {
el: this.adapter,
height: "fill"
}]
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.searcherPane,
top: 24,
bottom: 0,
left: 0,
right: 0
}]
});
},
_showAdapter: function () {
this.adapter.setVisible(true);
this.searcherPane.setVisible(false);
},
_showSearcherPane: function () {
this.searcherPane.setVisible(true);
this.adapter.setVisible(false);
},
_defaultState: function () {
this.trigger.stopEditing();
},
_assertValue: function () {},
_makeMap: function (values) {
return BI.makeObject(values || []);
},
_joinKeywords: function (keywords, callback) {
var self = this, o = this.options;
this._assertValue(this.storeValue);
if (!this._allData) {
o.itemsCreator({
type: BI.SingleSelectInsertList.REQ_GET_ALL_DATA
}, function (ob) {
self._allData = BI.map(ob.items, "value");
digest(self._allData);
});
} else {
digest(this._allData);
}
function digest (items) {
var selectedMap = self._makeMap(items);
BI.each(keywords, function (i, val) {
if (BI.isNotNull(selectedMap[val])) {
BI.pushDistinct(self.storeValue.value, val)
}
});
callback();
}
},
_setStartValue: function (value) {
this._startValue = value;
this.adapter.setStartValue(value);
},
isAllSelected: function () {
return this.adapter.isAllSelected();
},
resize: function () {
// this.trigger.getCounter().adjustView();
// this.trigger.adjustView();
},
setValue: function (v) {
this.storeValue = v;
this.adapter.setValue(this.storeValue);
this.trigger.setValue(this.storeValue);
},
getValue: function () {
return BI.deepClone(this.storeValue);
},
populate: function () {
this._count = null;
this._allData = null;
this.adapter.populate.apply(this.adapter, arguments);
this.trigger.populate.apply(this.trigger, arguments);
}
});
BI.extend(BI.SingleSelectInsertList, {
REQ_GET_DATA_LENGTH: 0,
REQ_GET_ALL_DATA: -1
});
BI.SingleSelectInsertList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_select_insert_list", BI.SingleSelectInsertList);
/***/ }),
/* 635 */
/***/ (function(module, exports) {
/**
* 单选输入框
* Created by guy on 15/11/3.
* @class BI.SingleSelectEditor
* @extends Widget
*/
BI.SingleSelectEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-editor",
el: {},
text: BI.i18nText("BI-Basic_Please_Select")
});
},
_init: function () {
BI.SingleSelectEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.state_editor",
element: this,
height: o.height,
watermark: BI.i18nText("BI-Basic_Search"),
allowBlank: true,
value: o.value,
defaultText: o.text,
text: o.text,
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.StateEditor.EVENT_PAUSE, function () {
self.fireEvent(BI.SingleSelectEditor.EVENT_PAUSE);
});
this.editor.on(BI.StateEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.SingleSelectEditor.EVENT_FOCUS);
});
this.editor.on(BI.StateEditor.EVENT_BLUR, function () {
self.fireEvent(BI.SingleSelectEditor.EVENT_BLUR);
});
},
focus: function () {
this.editor.focus();
},
blur: function () {
this.editor.blur();
},
setState: function (state) {
this.editor.setState(state);
},
setValue: function (v) {
this.editor.setValue(v);
},
getValue: function () {
var v = this.editor.getState();
if (BI.isArray(v) && v.length > 0) {
return v[v.length - 1];
}
return "";
},
getKeywords: function () {
var val = this.editor.getLastChangedValue();
var keywords = val.match(/[\S]+/g);
if (BI.isEndWithBlank(val)) {
return keywords.concat([" "]);
}
return keywords;
},
populate: function (items) {
}
});
BI.SingleSelectEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.SingleSelectEditor.EVENT_BLUR = "EVENT_BLUR";
BI.SingleSelectEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.shortcut("bi.single_select_editor", BI.SingleSelectEditor);
/***/ }),
/* 636 */
/***/ (function(module, exports) {
/**
* searcher
* Created by guy on 15/11/3.
* @class BI.SingleSelectSearcher
* @extends Widget
*/
BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectSearcher.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-searcher",
itemsCreator: BI.emptyFn,
el: {},
popup: {},
valueFormatter: BI.emptyFn,
adapter: null,
masker: {},
allowNoSelect: false
});
},
_init: function () {
BI.SingleSelectSearcher.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget(o.el, {
type: "bi.single_select_editor",
height: o.height,
text: o.text,
listeners: [{
eventName: BI.SingleSelectEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.SingleSelectSearcher.EVENT_FOCUS);
}
}, {
eventName: BI.SingleSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.SingleSelectSearcher.EVENT_BLUR);
}
}]
});
this.searcher = BI.createWidget({
type: "bi.searcher",
allowSearchBlank: false,
element: this,
height: o.height,
isAutoSearch: false,
isAutoSync: false,
onSearch: function (op, callback) {
callback();
},
el: this.editor,
popup: BI.extend({
type: "bi.single_select_search_pane",
allowNoSelect: o.allowNoSelect,
valueFormatter: o.valueFormatter,
keywordGetter: function () {
return self.editor.getValue();
},
itemsCreator: function (op, callback) {
var keyword = self.editor.getValue();
op.keywords = [keyword];
this.setKeyword(keyword);
o.itemsCreator(op, callback);
},
value: o.value
}, o.popup),
adapter: o.adapter,
masker: o.masker
});
this.searcher.on(BI.Searcher.EVENT_START, function () {
self.fireEvent(BI.SingleSelectSearcher.EVENT_START);
});
this.searcher.on(BI.Searcher.EVENT_PAUSE, function () {
if (this.hasMatched()) {
}
self.fireEvent(BI.SingleSelectSearcher.EVENT_PAUSE);
});
this.searcher.on(BI.Searcher.EVENT_STOP, function () {
self.fireEvent(BI.SingleSelectSearcher.EVENT_STOP);
});
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.SingleSelectSearcher.EVENT_CHANGE, arguments);
});
this.searcher.on(BI.Searcher.EVENT_SEARCHING, function () {
var keywords = this.getKeywords();
self.fireEvent(BI.SingleSelectSearcher.EVENT_SEARCHING, keywords);
});
if(BI.isNotNull(o.value)){
this.setState(o.value);
}
},
adjustView: function () {
this.searcher.adjustView();
},
isSearching: function () {
return this.searcher.isSearching();
},
stopSearch: function () {
this.searcher.stopSearch();
},
getKeyword: function () {
return this.editor.getValue();
},
hasMatched: function () {
return this.searcher.hasMatched();
},
hasChecked: function () {
return this.searcher.getView() && this.searcher.getView().hasChecked();
},
setAdapter: function (adapter) {
this.searcher.setAdapter(adapter);
},
setState: function (v) {
var o = this.options;
if (BI.isNull(v)) {
this.editor.setState(BI.Selection.None);
} else {
this.editor.setState(o.valueFormatter(v + "") || (v + ""));
}
},
setValue: function (ob) {
this.setState(ob);
this.searcher.setValue(ob);
},
getKey: function () {
return this.editor.getValue();
},
getValue: function () {
return this.searcher.getValue();
},
populate: function (items) {
this.searcher.populate.apply(this.searcher, arguments);
}
});
BI.SingleSelectSearcher.EVENT_FOCUS = "EVENT_FOCUS";
BI.SingleSelectSearcher.EVENT_BLUR = "EVENT_BLUR";
BI.SingleSelectSearcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.SingleSelectSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.SingleSelectSearcher.EVENT_START = "EVENT_START";
BI.SingleSelectSearcher.EVENT_STOP = "EVENT_STOP";
BI.SingleSelectSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.SingleSelectSearcher.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.shortcut("bi.single_select_searcher", BI.SingleSelectSearcher);
/***/ }),
/* 637 */
/***/ (function(module, exports) {
BI.SignTextEditor = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.SignTextEditor.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-sign-initial-editor",
validationChecker: BI.emptyFn,
text: "",
height: 24
});
},
_init: function () {
BI.SignTextEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget({
type: "bi.editor",
height: o.height,
hgap: 4,
vgap: 2,
value: o.value,
validationChecker: o.validationChecker,
allowBlank: false
});
this.text = BI.createWidget({
type: "bi.text_button",
cls: "sign-editor-text",
title: function () {
return self.getValue();
},
textAlign: o.textAlign,
height: o.height,
hgap: 4,
handler: function () {
self._showInput();
self.editor.focus();
self.editor.selectAll();
}
});
this.text.on(BI.TextButton.EVENT_CHANGE, function () {
BI.nextTick(function () {
self.fireEvent(BI.SignTextEditor.EVENT_CLICK_LABEL);
});
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.text,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.editor.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.editor.on(BI.Editor.EVENT_CONFIRM, function () {
self._showHint();
self._checkText();
self.fireEvent(BI.SignTextEditor.EVENT_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM, function () {
self._showHint();
self._checkText();
self.fireEvent(BI.SignTextEditor.EVENT_CHANGE_CONFIRM, arguments);
});
this.editor.on(BI.Editor.EVENT_ERROR, function () {
self._checkText();
});
BI.createWidget({
type: "bi.vertical",
scrolly: false,
element: this,
items: [this.editor]
});
this._showHint();
self._checkText();
},
_checkText: function () {
var o = this.options;
BI.nextTick(BI.bind(function () {
if (this.editor.getValue() === "") {
this.text.setValue(o.watermark || "");
this.text.element.addClass("bi-water-mark");
} else {
var v = this.editor.getValue();
v = (BI.isEmpty(v) || v == o.text) ? o.text : v + o.text;
this.text.setValue(v);
this.text.element.removeClass("bi-water-mark");
}
}, this));
},
_showInput: function () {
this.editor.visible();
this.text.invisible();
},
_showHint: function () {
this.editor.invisible();
this.text.visible();
},
setTitle: function (title) {
this.text.setTitle(title);
},
setWarningTitle: function (title) {
this.text.setWarningTitle(title);
},
focus: function () {
this._showInput();
this.editor.focus();
},
blur: function () {
this.editor.blur();
this._showHint();
this._checkText();
},
doRedMark: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doHighLight: function () {
if (this.editor.getValue() === "" && BI.isKey(this.options.watermark)) {
return;
}
this.text.doHighLight.apply(this.text, arguments);
},
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
isValid: function () {
return this.editor.isValid();
},
setErrorText: function (text) {
this.editor.setErrorText(text);
},
getErrorText: function () {
return this.editor.getErrorText();
},
isEditing: function () {
return this.editor.isEditing();
},
getLastValidValue: function () {
return this.editor.getLastValidValue();
},
getLastChangedValue: function () {
return this.editor.getLastChangedValue();
},
setValue: function (v) {
this.editor.setValue(v);
this._checkText();
},
getValue: function () {
return this.editor.getValue();
},
getState: function () {
return this.text.getValue();
},
setState: function (v) {
var o = this.options;
this._showHint();
v = (BI.isEmpty(v) || v == o.text) ? o.text : v + o.text;
this.text.setValue(v);
}
});
BI.SignTextEditor.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.SignTextEditor.EVENT_CHANGE_CONFIRM = "EVENT_CHANGE_CONFIRM";
BI.SignTextEditor.EVENT_CLICK_LABEL = "EVENT_CLICK_LABEL";
BI.shortcut("bi.sign_text_editor", BI.SignTextEditor);
/***/ }),
/* 638 */
/***/ (function(module, exports) {
/**
* Created by zcf on 2016/9/22.
*/
BI.SliderIconButton = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-single-slider-button"
},
constants: {
LARGE_SIZE: 16,
NORMAL_SIZE: 12,
LARGE_OFFSET: 4,
NORMAL_OFFSET: 6
},
render: function () {
var self = this;
return {
type: "bi.absolute",
ref: function () {
self.wrapper = this;
},
items: [{
el: {
type: "bi.text_button",
cls: "slider-button bi-high-light-border",
ref: function () {
self.slider = this;
}
}
}]
};
}
});
BI.shortcut("bi.single_slider_button", BI.SliderIconButton);
/***/ }),
/* 639 */
/***/ (function(module, exports) {
/**
* Created by zcf on 2016/9/22.
*/
BI.SingleSlider = BI.inherit(BI.Single, {
_constant: {
EDITOR_WIDTH: 90,
EDITOR_HEIGHT: 30,
SLIDER_WIDTH_HALF: 15,
SLIDER_WIDTH: 30,
SLIDER_HEIGHT: 30,
TRACK_HEIGHT: 24,
TRACK_GAP_HALF: 7,
TRACK_GAP: 14
},
props: {
baseCls: "bi-single-slider bi-slider-track",
digit: false,
unit: ""
},
render: function () {
var self = this, o = this.options;
var c = this._constant;
this.enable = false;
this.value = "";
this.grayTrack = BI.createWidget({
type: "bi.layout",
cls: "gray-track",
height: 6
});
this.blueTrack = BI.createWidget({
type: "bi.layout",
cls: "blue-track bi-high-light-background",
height: 6
});
this.track = this._createTrackWrapper();
this.slider = BI.createWidget({
type: "bi.single_slider_button"
});
this._draggable(this.slider);
var sliderVertical = BI.createWidget({
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [this.slider]
}],
hgap: c.SLIDER_WIDTH_HALF,
height: c.SLIDER_HEIGHT
});
// 这边其实是有问题的,拖拽区域是个圆,在圆的边缘拖拽后放开,这边计算出来的蓝条宽度实际上会比放开时长一点或者短一点
sliderVertical.element.click(function (e) {
if (self.enable && self.isEnabled() && sliderVertical.element[0] === e.originalEvent.target) {
var offset = e.clientX - self.element.offset().left - c.SLIDER_WIDTH_HALF;
var trackLength = self.track.element[0].scrollWidth - c.TRACK_GAP;
var percent = 0;
if (offset < 0) {
percent = 0;
}
if (offset > 0 && offset < trackLength) {
percent = offset * 100 / self._getGrayTrackLength();
}
if (offset >= trackLength) {
percent = 100;
}
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setAllPosition(significantPercent);
var v = self._getValueByPercent(significantPercent);
v = o.digit === false ? v : v.toFixed(o.digit);
self.label.setValue(v);
self.value = v;
self.fireEvent(BI.SingleSlider.EVENT_CHANGE);
}
});
this.label = BI.createWidget({
type: "bi.sign_text_editor",
cls: "slider-editor-button",
text: o.unit,
width: c.EDITOR_WIDTH - 2,
allowBlank: false,
textAlign: "center",
validationChecker: function (v) {
return self._checkValidation(v);
}
});
this.label.element.hover(function () {
self.label.element.removeClass("bi-border").addClass("bi-border");
}, function () {
self.label.element.removeClass("bi-border");
});
this.label.on(BI.SignEditor.EVENT_CONFIRM, function () {
var v = BI.parseFloat(this.getValue());
var percent = self._getPercentByValue(v);
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setAllPosition(significantPercent);
this.setValue(v);
self.value = v;
self.fireEvent(BI.SingleSlider.EVENT_CHANGE);
});
this._setVisible(false);
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [{
el: this.track,
width: "100%",
height: c.TRACK_HEIGHT
}]
}],
hgap: c.TRACK_GAP_HALF,
height: c.TRACK_HEIGHT
},
top: 23,
left: 0,
width: "100%"
}, {
el: sliderVertical,
top: 20,
left: 0,
width: "100%"
}, {
el: {
type: "bi.vertical",
items: [{
type: "bi.horizontal_auto",
items: [this.label]
}],
height: c.EDITOR_HEIGHT
},
top: 0,
left: 0,
width: "100%"
}]
};
},
_draggable: function (widget) {
var self = this, o = this.options;
var startDrag = false;
var size = 0, offset = 0, defaultSize = 0;
var mouseMoveTracker = new BI.MouseMoveTracker(function (deltaX) {
if (mouseMoveTracker.isDragging()) {
startDrag = true;
offset += deltaX;
size = optimizeSize(defaultSize + offset);
widget.element.addClass("dragging");
var percent = size * 100 / (self._getGrayTrackLength());
var significantPercent = BI.parseFloat(percent.toFixed(1));// 直接对计算出来的百分数保留到小数点后一位,相当于分成了1000份。
self._setBlueTrack(significantPercent);
self._setLabelPosition(significantPercent);
self._setSliderPosition(significantPercent);
var v = self._getValueByPercent(significantPercent);
v = o.digit === false ? v : v.toFixed(o.digit);
self.label.setValue(v);
self.value = v;
}
}, function () {
if (startDrag === true) {
size = optimizeSize(size);
var percent = size * 100 / (self._getGrayTrackLength());
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setSliderPosition(significantPercent);
size = 0;
offset = 0;
defaultSize = size;
startDrag = false;
}
widget.element.removeClass("dragging");
mouseMoveTracker.releaseMouseMoves();
self.fireEvent(BI.SingleSlider.EVENT_CHANGE);
}, window);
widget.element.on("mousedown", function (event) {
if(!widget.isEnabled()) {
return;
}
defaultSize = this.offsetLeft;
optimizeSize(defaultSize);
mouseMoveTracker.captureMouseMoves(event);
});
function optimizeSize (s) {
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
_createTrackWrapper: function () {
return BI.createWidget({
type: "bi.absolute",
items: [{
el: {
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [{
el: this.grayTrack,
top: 0,
left: 0,
width: "100%"
}, {
el: this.blueTrack,
top: 0,
left: 0,
width: "0%"
}]
}],
hgap: 8,
height: 8
},
top: 8,
left: 0,
width: "100%"
}]
});
},
_checkValidation: function (v) {
var o = this.options;
var valid = false;
if (BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max)) {
if(o.digit === false) {
valid = true;
}else{
var dotText = (v + "").split(".")[1] || "";
valid = (dotText.length === o.digit);
}
}
return valid;
},
_setBlueTrack: function (percent) {
this.blueTrack.element.css({width: percent + "%"});
},
_setLabelPosition: function (percent) {
// this.label.element.css({left: percent + "%"});
},
_setSliderPosition: function (percent) {
this.slider.element.css({left: percent + "%"});
},
_setAllPosition: function (percent) {
this._setSliderPosition(percent);
this._setLabelPosition(percent);
this._setBlueTrack(percent);
},
_setVisible: function (visible) {
this.slider.setVisible(visible);
this.label.setVisible(visible);
},
_getGrayTrackLength: function () {
return this.grayTrack.element[0].scrollWidth;
},
_getValueByPercent: function (percent) {
var thousandth = BI.parseInt(percent * 10);
return (((this.max - this.min) * thousandth) / 1000 + this.min);
},
_getPercentByValue: function (v) {
return (v - this.min) * 100 / (this.max - this.min);
},
getValue: function () {
return this.value;
},
setValue: function (v) {
var o = this.options;
v = BI.parseFloat(v);
v = o.digit === false ? v : v.toFixed(o.digit);
if ((!isNaN(v))) {
if (this._checkValidation(v)) {
this.value = v;
}
if (v > this.max) {
this.value = this.max;
}
if (v < this.min) {
this.value = this.min;
}
}
},
_setEnable: function (b) {
BI.SingleSlider.superclass._setEnable.apply(this, [b]);
if(b) {
this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track");
} else {
this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track");
}
},
setMinAndMax: function (v) {
var minNumber = BI.parseFloat(v.min);
var maxNumber = BI.parseFloat(v.max);
if ((!isNaN(minNumber)) && (!isNaN(maxNumber)) && (maxNumber > minNumber )) {
this.min = minNumber;
this.max = maxNumber;
}
},
reset: function () {
this._setVisible(false);
this.enable = false;
this.value = "";
this.min = 0;
this.max = 0;
this._setBlueTrack(0);
},
populate: function () {
if (!isNaN(this.min) && !isNaN(this.max)) {
this._setVisible(true);
this.enable = true;
this.label.setErrorText(BI.i18nText("BI-Basic_Please_Enter_Number_Between", this.min, this.max));
if (BI.isNumeric(this.value) || BI.isNotEmptyString(this.value)) {
this.label.setValue(this.value);
this._setAllPosition(this._getPercentByValue(this.value));
} else {
this.label.setValue(this.max);
this._setAllPosition(100);
}
}
}
});
BI.SingleSlider.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_slider", BI.SingleSlider);
/***/ }),
/* 640 */
/***/ (function(module, exports) {
/**
* Created by Urthur on 2017/9/12.
*/
BI.SingleSliderLabel = BI.inherit(BI.Single, {
_constant: {
EDITOR_WIDTH: 90,
EDITOR_HEIGHT: 20,
HEIGHT: 20,
SLIDER_WIDTH_HALF: 15,
SLIDER_WIDTH: 30,
SLIDER_HEIGHT: 30,
TRACK_HEIGHT: 24,
TRACK_GAP_HALF: 7,
TRACK_GAP: 14
},
_defaultConfig: function () {
return BI.extend(BI.SingleSliderLabel.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-slider-label bi-slider-track",
digit: false,
unit: ""
});
},
_init: function () {
BI.SingleSliderLabel.superclass._init.apply(this, arguments);
var self = this, o = this.options;
var c = this._constant;
this.enable = false;
this.value = "";
this.grayTrack = BI.createWidget({
type: "bi.layout",
cls: "gray-track",
height: 6
});
this.blueTrack = BI.createWidget({
type: "bi.layout",
cls: "blue-track bi-high-light-background",
height: 6
});
this.track = this._createTrackWrapper();
this.slider = BI.createWidget({
type: "bi.single_slider_button"
});
this._draggable(this.slider);
var sliderVertical = BI.createWidget({
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [this.slider]
}],
hgap: c.SLIDER_WIDTH_HALF,
height: c.SLIDER_HEIGHT
});
sliderVertical.element.click(function (e) {
if (self.enable && self.isEnabled() && sliderVertical.element[0] === e.originalEvent.target) {
var offset = e.clientX - self.element.offset().left - c.SLIDER_WIDTH_HALF;
var trackLength = self.track.element[0].scrollWidth - c.TRACK_GAP;
var percent = 0;
if (offset < 0) {
percent = 0;
}
if (offset > 0 && offset < trackLength) {
percent = offset * 100 / self._getGrayTrackLength();
}
if (offset >= trackLength) {
percent = 100;
}
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setAllPosition(significantPercent);
var v = self._getValueByPercent(significantPercent);
v = o.digit === false ? v : v.toFixed(o.digit);
self.label.setText(v + o.unit);
self.value = v;
self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE);
}
});
this.label = BI.createWidget({
type: "bi.label",
height: c.HEIGHT,
width: c.EDITOR_WIDTH - 2
});
this._setVisible(false);
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [{
el: this.track,
width: "100%",
height: c.TRACK_HEIGHT
}]
}],
hgap: c.TRACK_GAP_HALF,
height: c.TRACK_HEIGHT
},
top: 13,
left: 0,
width: "100%"
}, {
el: sliderVertical,
top: 10,
left: 0,
width: "100%"
}, {
el: {
type: "bi.vertical",
items: [{
type: "bi.horizontal_auto",
items: [this.label]
}],
height: c.EDITOR_HEIGHT
},
top: 0,
left: 0,
width: "100%"
}]
});
},
_draggable: function (widget) {
var self = this, o = this.options;
var startDrag = false;
var size = 0, offset = 0, defaultSize = 0;
var mouseMoveTracker = new BI.MouseMoveTracker(function (deltaX) {
if (mouseMoveTracker.isDragging()) {
startDrag = true;
offset += deltaX;
size = optimizeSize(defaultSize + offset);
widget.element.addClass("dragging");
var percent = size * 100 / (self._getGrayTrackLength());
var significantPercent = BI.parseFloat(percent.toFixed(1));// 直接对计算出来的百分数保留到小数点后一位,相当于分成了1000份。
self._setBlueTrack(significantPercent);
self._setLabelPosition(significantPercent);
self._setSliderPosition(significantPercent);
var v = self._getValueByPercent(significantPercent);
v = o.digit === false ? v : v.toFixed(o.digit);
self.label.setValue(v + o.unit);
self.value = v;
self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE);
}
}, function () {
if (startDrag === true) {
size = optimizeSize(size);
var percent = size * 100 / (self._getGrayTrackLength());
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setSliderPosition(significantPercent);
size = 0;
offset = 0;
defaultSize = size;
startDrag = false;
}
widget.element.removeClass("dragging");
mouseMoveTracker.releaseMouseMoves();
self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE);
}, window);
widget.element.on("mousedown", function (event) {
if(!widget.isEnabled()) {
return;
}
defaultSize = this.offsetLeft;
optimizeSize(defaultSize);
mouseMoveTracker.captureMouseMoves(event);
});
function optimizeSize (s) {
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
_createTrackWrapper: function () {
return BI.createWidget({
type: "bi.absolute",
items: [{
el: {
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [{
el: this.grayTrack,
top: 0,
left: 0,
width: "100%"
}, {
el: this.blueTrack,
top: 0,
left: 0,
width: "0%"
}]
}],
hgap: 8,
height: 8
},
top: 8,
left: 0,
width: "100%"
}]
});
},
_checkValidation: function (v) {
return BI.isNumeric(v) && !(BI.isNull(v) || v < this.min || v > this.max);
},
_setBlueTrack: function (percent) {
this.blueTrack.element.css({width: percent + "%"});
},
_setLabelPosition: function (percent) {
// this.label.element.css({left: percent + "%"});
},
_setSliderPosition: function (percent) {
this.slider.element.css({left: percent + "%"});
},
_setAllPosition: function (percent) {
this._setSliderPosition(percent);
this._setLabelPosition(percent);
this._setBlueTrack(percent);
},
_setVisible: function (visible) {
this.slider.setVisible(visible);
this.label.setVisible(visible);
},
_getGrayTrackLength: function () {
return this.grayTrack.element[0].scrollWidth;
},
_getValueByPercent: function (percent) {
var thousandth = BI.parseInt(percent * 10);
return (((this.max - this.min) * thousandth) / 1000 + this.min);
},
_getPercentByValue: function (v) {
return (v - this.min) * 100 / (this.max - this.min);
},
_setEnable: function (b) {
BI.SingleSliderLabel.superclass._setEnable.apply(this, [b]);
if(b) {
this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track");
} else {
this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track");
}
},
getValue: function () {
return this.value;
},
setValue: function (v) {
var o = this.options;
v = BI.parseFloat(v);
v = o.digit === false ? v : v.toFixed(o.digit);
if ((!isNaN(v))) {
if (this._checkValidation(v)) {
this.value = v;
}
if (v > this.max) {
this.value = this.max;
}
if (v < this.min) {
this.value = this.min;
}
}
},
setMinAndMax: function (v) {
var minNumber = BI.parseFloat(v.min);
var maxNumber = BI.parseFloat(v.max);
if ((!isNaN(minNumber)) && (!isNaN(maxNumber)) && (maxNumber > minNumber )) {
this.min = minNumber;
this.max = maxNumber;
}
},
reset: function () {
this._setVisible(false);
this.enable = false;
this.value = "";
this.min = 0;
this.max = 0;
this._setBlueTrack(0);
},
populate: function () {
var o = this.options;
if (!isNaN(this.min) && !isNaN(this.max)) {
this._setVisible(true);
this.enable = true;
if (BI.isNumeric(this.value) || BI.isNotEmptyString(this.value)) {
this.label.setValue(this.value + o.unit);
this._setAllPosition(this._getPercentByValue(this.value));
} else {
this.label.setValue(this.max + o.unit);
this._setAllPosition(100);
}
}
}
});
BI.SingleSliderLabel.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_slider_label", BI.SingleSliderLabel);
/***/ }),
/* 641 */
/***/ (function(module, exports) {
/**
* normal single slider
* Created by Young on 2017/6/21.
*/
BI.SingleSliderNormal = BI.inherit(BI.Single, {
_constant: {
HEIGHT: 28,
SLIDER_WIDTH_HALF: 15,
SLIDER_WIDTH: 30,
SLIDER_HEIGHT: 30,
TRACK_HEIGHT: 24,
TRACK_GAP_HALF: 7,
TRACK_GAP: 14
},
props: {
baseCls: "bi-single-slider-normal bi-slider-track",
minMax: {
min: 0,
max: 100
}
// color: "#3f8ce8"
},
render: function () {
var self = this;
var c = this._constant;
var track = this._createTrack();
this.slider = BI.createWidget({
type: "bi.single_slider_button"
});
this._draggable(this.slider);
var sliderVertical = BI.createWidget({
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [this.slider]
}],
hgap: c.SLIDER_WIDTH_HALF,
height: c.SLIDER_HEIGHT
});
sliderVertical.element.click(function (e) {
if (self.enable && self.isEnabled() && sliderVertical.element[0] === e.originalEvent.target) {
var offset = e.clientX - self.element.offset().left - c.SLIDER_WIDTH_HALF;
var trackLength = self.track.element[0].scrollWidth - c.TRACK_GAP;
var percent = 0;
if (offset < 0) {
percent = 0;
}
if (offset > 0 && offset < trackLength) {
percent = offset * 100 / self._getGrayTrackLength();
}
if (offset >= trackLength) {
percent = 100;
}
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setAllPosition(significantPercent);
var v = self._getValueByPercent(significantPercent);
self.value = v;
self.fireEvent(BI.SingleSlider.EVENT_CHANGE);
}
});
return {
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [{
el: track,
width: "100%",
height: c.TRACK_HEIGHT
}]
}],
hgap: c.TRACK_GAP_HALF,
height: c.TRACK_HEIGHT
},
top: 3,
left: 0,
width: "100%"
}, {
el: sliderVertical,
top: 0,
left: 0,
width: "100%"
}]
};
},
_draggable: function (widget) {
var self = this, o = this.options;
var startDrag = false;
var size = 0, offset = 0, defaultSize = 0;
var mouseMoveTracker = new BI.MouseMoveTracker(function (deltaX) {
if (mouseMoveTracker.isDragging()) {
startDrag = true;
offset += deltaX;
size = optimizeSize(defaultSize + offset);
widget.element.addClass("dragging");
var percent = size * 100 / (self._getGrayTrackLength());
var significantPercent = BI.parseFloat(percent.toFixed(1));// 直接对计算出来的百分数保留到小数点后一位,相当于分成了1000份。
self._setBlueTrack(significantPercent);
self._setSliderPosition(significantPercent);
var v = self._getValueByPercent(significantPercent);
v = o.digit === false ? v : v.toFixed(o.digit);
self.value = v;
self.fireEvent(BI.SingleSliderNormal.EVENT_DRAG, v);
}
}, function () {
if (startDrag === true) {
size = optimizeSize(size);
var percent = size * 100 / (self._getGrayTrackLength());
var significantPercent = BI.parseFloat(percent.toFixed(1));
self._setSliderPosition(significantPercent);
size = 0;
offset = 0;
defaultSize = size;
startDrag = false;
}
widget.element.removeClass("dragging");
mouseMoveTracker.releaseMouseMoves();
self.fireEvent(BI.SingleSlider.EVENT_CHANGE);
}, window);
widget.element.on("mousedown", function (event) {
if(!widget.isEnabled()) {
return;
}
defaultSize = this.offsetLeft;
optimizeSize(defaultSize);
mouseMoveTracker.captureMouseMoves(event);
});
function optimizeSize (s) {
return BI.clamp(s, 0, self._getGrayTrackLength());
}
},
_createTrack: function () {
var self = this;
var c = this._constant;
this.grayTrack = BI.createWidget({
type: "bi.layout",
cls: "gray-track",
height: 6
});
this.blueTrack = BI.createWidget({
type: "bi.layout",
cls: "blue-track bi-high-light-background",
height: 6
});
if (this.options.color) {
this.blueTrack.element.css({"background-color": this.options.color});
}
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.vertical",
items: [{
type: "bi.absolute",
items: [{
el: this.grayTrack,
top: 0,
left: 0,
width: "100%"
}, {
el: this.blueTrack,
top: 0,
left: 0,
width: "0%"
}]
}],
hgap: 8,
height: 8
},
top: 8,
left: 0,
width: "100%"
}],
ref: function (ref) {
self.track = ref;
}
};
},
_checkValidation: function (v) {
return !(BI.isNull(v) || v < this.min || v > this.max);
},
_setBlueTrack: function (percent) {
this.blueTrack.element.css({width: percent + "%"});
},
_setSliderPosition: function (percent) {
this.slider.element.css({left: percent + "%"});
},
_setAllPosition: function (percent) {
this._setSliderPosition(percent);
this._setBlueTrack(percent);
},
_setVisible: function (visible) {
this.slider.setVisible(visible);
},
_getGrayTrackLength: function () {
return this.grayTrack.element[0].scrollWidth;
},
_getValueByPercent: function (percent) {
var thousandth = BI.parseInt(percent * 10);
return (((this.max - this.min) * thousandth) / 1000 + this.min);
},
_getPercentByValue: function (v) {
return (v - this.min) * 100 / (this.max - this.min);
},
_setEnable: function (b) {
BI.SingleSliderNormal.superclass._setEnable.apply(this, [b]);
if(b) {
this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track");
} else {
this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track");
}
},
getValue: function () {
return this.value;
},
setValue: function (v) {
var value = BI.parseFloat(v);
if ((!isNaN(value))) {
if (this._checkValidation(value)) {
this.value = value;
}
if (value > this.max) {
this.value = this.max;
}
if (value < this.min) {
this.value = this.min;
}
}
},
setMinAndMax: function (v) {
var minNumber = BI.parseFloat(v.min);
var maxNumber = BI.parseFloat(v.max);
if ((!isNaN(minNumber)) && (!isNaN(maxNumber)) && (maxNumber > minNumber )) {
this.min = minNumber;
this.max = maxNumber;
}
},
reset: function () {
this._setVisible(false);
this.enable = false;
this.value = "";
this.min = 0;
this.max = 0;
this._setBlueTrack(0);
},
populate: function () {
if (!isNaN(this.min) && !isNaN(this.max)) {
this._setVisible(true);
this.enable = true;
if (BI.isNumeric(this.value) || BI.isNotEmptyString(this.value)) {
this._setAllPosition(this._getPercentByValue(this.value));
} else {
this._setAllPosition(100);
}
}
}
});
BI.SingleSliderNormal.EVENT_DRAG = "EVENT_DRAG";
BI.shortcut("bi.single_slider_normal", BI.SingleSliderNormal);
/***/ }),
/* 642 */
/***/ (function(module, exports) {
/**
* @class BI.SingleTreeCombo
* @extends BI.Widget
*/
BI.SingleTreeCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SingleTreeCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-combo",
trigger: {},
height: 24,
text: "",
items: [],
value: "",
attributes: {
tabIndex: 0
}
});
},
_init: function () {
BI.SingleTreeCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget(BI.extend({
type: "bi.single_tree_trigger",
text: o.text,
height: o.height,
items: o.items,
value: o.value
}, o.trigger));
this.popup = BI.createWidget({
type: "bi.single_level_tree",
items: o.items,
value: o.value
});
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
element: this,
adjustLength: 2,
el: this.trigger,
popup: {
el: this.popup
}
});
this.combo.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.fireEvent(BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW, arguments);
});
this.popup.on(BI.SingleTreePopup.EVENT_CHANGE, function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.SingleTreeCombo.EVENT_CHANGE);
});
},
populate: function (items) {
this.combo.populate(items);
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.trigger.setValue(v);
this.popup.setValue(v);
},
getValue: function () {
return this.popup.getValue();
}
});
BI.SingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.single_tree_combo", BI.SingleTreeCombo);
/***/ }),
/* 643 */
/***/ (function(module, exports) {
/**
* @class BI.SingleTreePopup
* @extends BI.Pane
*/
BI.SingleTreePopup = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.SingleTreePopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-level-tree",
tipText: BI.i18nText("BI-No_Selected_Item"),
items: [],
value: ""
});
},
_init: function () {
BI.SingleTreePopup.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.tree = BI.createWidget({
type: "bi.level_tree",
expander: {
isDefaultInit: true
},
items: o.items,
value: o.value,
chooseType: BI.Selection.Single
});
BI.createWidget({
type: "bi.vertical",
element: this,
vgap: 5,
items: [this.tree]
});
this.tree.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.tree.on(BI.LevelTree.EVENT_CHANGE, function () {
self.fireEvent(BI.SingleTreePopup.EVENT_CHANGE);
});
this.check();
},
getValue: function () {
return this.tree.getValue();
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.tree.setValue(v);
},
populate: function (items) {
BI.SingleTreePopup.superclass.populate.apply(this, arguments);
this.tree.populate(items);
}
});
BI.SingleTreePopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.single_level_tree", BI.SingleTreePopup);
/***/ }),
/* 644 */
/***/ (function(module, exports) {
/**
* @class BI.SingleTreeTrigger
* @extends BI.Trigger
*/
BI.SingleTreeTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.SingleTreeTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-tree-trigger",
height: 24,
text: "",
items: [],
value: ""
});
},
_init: function () {
BI.SingleTreeTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
element: this,
text: o.text,
items: o.items,
height: o.height,
value: o.value
});
},
_checkTitle: function () {
var self = this, val = this.getValue();
BI.any(this.options.items, function (i, item) {
if (BI.contains(val, item.value)) {
self.trigger.setTitle(item.text || item.value);
return true;
}
});
},
setValue: function (v) {
v = BI.isArray(v) ? v : [v];
this.options.value = v;
this.trigger.setValue(v);
this._checkTitle();
},
getValue: function () {
return this.options.value || [];
},
populate: function (items) {
BI.SingleTreeTrigger.superclass.populate.apply(this, arguments);
this.trigger.populate(items);
}
});
BI.shortcut("bi.single_tree_trigger", BI.SingleTreeTrigger);
/***/ }),
/* 645 */
/***/ (function(module, exports) {
/**
* @class BI.TextValueDownListCombo
* @extend BI.Widget
*/
BI.TextValueDownListCombo = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-text-value-down-list-combo",
height: 24,
attributes: {
tabIndex: 0
}
});
},
_init: function () {
BI.TextValueDownListCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this._createValueMap();
var value;
if(BI.isNotNull(o.value)) {
value = this._digest(o.value);
}
this.trigger = BI.createWidget({
type: "bi.down_list_select_text_trigger",
cls: "text-value-down-list-trigger",
height: o.height,
items: o.items,
text: o.text,
value: value
});
this.combo = BI.createWidget({
type: "bi.down_list_combo",
element: this,
chooseType: BI.Selection.Single,
adjustLength: 2,
height: o.height,
el: this.trigger,
value: BI.isNull(value) ? [] : [value],
items: BI.deepClone(o.items)
});
this.combo.on(BI.DownListCombo.EVENT_CHANGE, function () {
var currentVal = self.combo.getValue()[0].value;
if (currentVal !== self.value) {
self.setValue(currentVal);
self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE);
}
});
this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function () {
var currentVal = self.combo.getValue()[0].childValue;
if (currentVal !== self.value) {
self.setValue(currentVal);
self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE);
}
});
},
_createValueMap: function () {
var self = this;
this.valueMap = {};
BI.each(BI.flatten(this.options.items), function (idx, item) {
if (BI.has(item, "el")) {
BI.each(item.children, function (id, it) {
self.valueMap[it.value] = {value: item.el.value, childValue: it.value};
});
} else {
self.valueMap[item.value] = {value: item.value};
}
});
},
_digest: function (v) {
this.value = v;
return this.valueMap[v];
},
setValue: function (v) {
v = this._digest(v);
this.combo.setValue([v]);
this.trigger.setValue(v);
},
getValue: function () {
var v = this.combo.getValue()[0];
return [v.childValue || v.value];
},
populate: function (items) {
this.options.items = BI.flatten(items);
this.combo.populate(items);
this._createValueMap();
}
});
BI.TextValueDownListCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.text_value_down_list_combo", BI.TextValueDownListCombo);
/***/ }),
/* 646 */
/***/ (function(module, exports) {
/**
* 选择字段trigger, downlist专用
* 显示形式为 父亲值(儿子值)
*
* @class BI.DownListSelectTextTrigger
* @extends BI.Trigger
*/
BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
return BI.extend(BI.DownListSelectTextTrigger.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-down-list-select-text-trigger",
height: 24,
text: ""
});
},
_init: function () {
BI.DownListSelectTextTrigger.superclass._init.apply(this, arguments);
var o = this.options;
this.trigger = BI.createWidget({
type: "bi.select_text_trigger",
element: this,
height: o.height,
items: this._formatItemArray(o.items),
text: o.text,
value: BI.isNull(o.value) ? "" : o.value.childValue || o.value.value
});
},
_formatItemArray: function () {
var sourceArray = BI.flatten(BI.deepClone(this.options.items));
var targetArray = [];
BI.each(sourceArray, function (idx, item) {
if(BI.has(item, "el")) {
BI.each(item.children, function (id, it) {
it.text = item.el.text + "(" + it.text + ")";
});
targetArray = BI.concat(targetArray, item.children);
}else{
targetArray.push(item);
}
});
return targetArray;
},
setValue: function (vals) {
this.trigger.setValue(vals.childValue || vals.value);
},
populate: function (items) {
this.trigger.populate(this._formatItemArray(items));
}
});
BI.shortcut("bi.down_list_select_text_trigger", BI.DownListSelectTextTrigger);
/***/ }),
/* 647 */
/***/ (function(module, exports) {
!(function () {
BI.TimePopup = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-date-time-popup",
height: 68
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vtape",
items: [{
el: {
type: "bi.center_adapt",
cls: "bi-split-top",
items: [{
type: "bi.dynamic_date_time_select",
value: o.value,
ref: function (_ref) {
self.timeSelect = _ref;
}
}]
},
hgap: 10,
height: 44
}, {
el: {
type: "bi.grid",
items: [[{
type: "bi.text_button",
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Clears"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Now"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_NOW_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
cls: "bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_OK"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]
};
},
setValue: function (value) {
if (this._checkValueValid(value)) {
this.timeSelect.setValue();
} else {
this.timeSelect.setValue({
hour: value.hour,
minute: value.minute,
second: value.second
});
}
},
getValue: function () {
return this.timeSelect.getValue();
},
_checkValueValid: function (value) {
return BI.isNull(value) || BI.isEmptyObject(value) || BI.isEmptyString(value);
}
});
BI.TimePopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.TimePopup.BUTTON_NOW_EVENT_CHANGE = "BUTTON_NOW_EVENT_CHANGE";
BI.TimePopup.CALENDAR_EVENT_CHANGE = "CALENDAR_EVENT_CHANGE";
BI.shortcut("bi.time_popup", BI.TimePopup);
})();
/***/ }),
/* 648 */
/***/ (function(module, exports) {
/**
* 时间选择
* qcc
* 2019/2/28
*/
!(function () {
BI.TimeCombo = BI.inherit(BI.Single, {
constants: {
popupHeight: 80,
popupWidth: 240,
comboAdjustHeight: 1,
border: 1
},
props: {
baseCls: "bi-time-combo bi-border bi-border-radius bi-focus-shadow",
width: 78,
height: 22,
format: "",
allowEdit: false
},
render: function () {
var self = this, opts = this.options;
this.storeTriggerValue = "";
this.storeValue = opts.value;
var popup = {
type: "bi.time_popup",
value: opts.value,
listeners: [{
eventName: BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.TimePopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.hidePopupView();
self.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.TimePopup.BUTTON_NOW_EVENT_CHANGE,
action: function () {
self._setNowTime();
}
}],
ref: function (_ref) {
self.popup = _ref;
}
};
return {
type: "bi.htape",
items: [{
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
container: opts.container,
toggle: false,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: {
type: "bi.time_trigger",
height: opts.height,
allowEdit: opts.allowEdit,
watermark: opts.watermark,
format: opts.format,
value: opts.value,
ref: function (_ref) {
self.trigger = _ref;
},
listeners: [{
eventName: "EVENT_KEY_DOWN",
action: function () {
if (self.combo.isViewVisible()) {
self.combo.hideView();
}
self.fireEvent(BI.TimeCombo.EVENT_KEY_DOWN, arguments);
}
}, {
eventName: "EVENT_STOP",
action: function () {
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
}
}, {
eventName: "EVENT_FOCUS",
action: function () {
self.storeTriggerValue = self.trigger.getKey();
if (!self.combo.isViewVisible()) {
self.combo.showView();
}
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_ERROR",
action: function () {
var date = BI.getDate();
self.storeValue = {
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
};
self.fireEvent("EVENT_ERROR");
}
}, {
eventName: "EVENT_VALID",
action: function () {
self.fireEvent("EVENT_VALID");
}
}, {
eventName: "EVENT_CHANGE",
action: function () {
self.fireEvent("EVENT_CHANGE");
}
}, {
eventName: "EVENT_CONFIRM",
action: function () {
if (self.combo.isViewVisible()) {
return;
}
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
} else if (BI.isEmptyString(dateObj)) {
self.storeValue = null;
self.trigger.setValue();
}
self.fireEvent("EVENT_CONFIRM");
}
}]
},
adjustLength: this.constants.comboAdjustHeight,
popup: {
el: popup,
width: this.constants.popupWidth,
stopPropagation: false
},
hideChecker: function (e) {
return self.triggerBtn.element.find(e.target).length === 0;
},
listeners: [{
eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW);
}
}],
ref: function (_ref) {
self.combo = _ref;
}
},
top: 0,
left: 0,
right: 22,
bottom: 0
}, {
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button time-font icon-size-16",
width: 22,
height: 22,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
if (self.combo.isViewVisible()) {
// self.combo.hideView();
} else {
self.combo.showView();
}
}
}],
ref: function (_ref) {
self.triggerBtn = _ref;
}
},
top: 0,
right: 0
}]
}]
};
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
},
getValue: function () {
return this.storeValue;
},
hidePopupView: function () {
this.combo.hideView();
},
_setNowTime: function () {
var date = BI.getDate();
var nowTome = {
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
};
this.setValue(nowTome);
this.hidePopupView();
this.fireEvent(BI.TimeCombo.EVENT_CONFIRM);
}
});
BI.TimeCombo.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.TimeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.TimeCombo.EVENT_VALID = "EVENT_VALID";
BI.TimeCombo.EVENT_ERROR = "EVENT_ERROR";
BI.TimeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.time_combo", BI.TimeCombo);
})();
/***/ }),
/* 649 */
/***/ (function(module, exports) {
!(function () {
BI.TimeTrigger = BI.inherit(BI.Trigger, {
_const: {
COMPARE_FORMAT: "%H:%M:%S",
COMPLETE_COMPARE_FORMAT: "%Y-%M-%d %H:%M:%S %P",
FORMAT_ARRAY: [
"%H:%M:%S", // HH:mm:ss
"%I:%M:%S", // hh:mm:ss
"%l:%M:%S", // h:mm:ss
"%k:%M:%S", // H:mm:ss
"%l:%M:%S %p", // h:mm:ss a
"%l:%M:%S %P", // h:mm:ss a
"%H:%M:%S %p", // HH:mm:ss a
"%H:%M:%S %P", // HH:mm:ss a
"%l:%M", // h:mm
"%k:%M", // H:mm
"%I:%M", // hh:mm
"%H:%M", // HH:mm
"%M:%S" // mm:ss
],
DEFAULT_DATE_STRING: "2000-01-01",
DEFAULT_HOUR: "00"
},
props: {
extraCls: "bi-time-trigger",
value: {},
format: "",
allowEdit: false
},
render: function () {
var self = this, o = this.options;
this.storeTriggerValue = "";
this.storeValue = o.value;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
return self._dateCheck(v);
},
quitChecker: function () {
return false;
},
ref: function (_ref) {
self.editor = _ref;
},
value: this._formatValue(o.value),
hgap: 4,
allowBlank: true,
watermark: BI.isKey(o.watermark) ? o.watermark : BI.i18nText("BI-Basic_Unrestricted"),
title: BI.bind(this._getTitle, this),
listeners: [{
eventName: "EVENT_KEY_DOWN",
action: function () {
self.fireEvent("EVENT_KEY_DOWN", arguments);
}
}, {
eventName: "EVENT_FOCUS",
action: function () {
self.storeTriggerValue = self.getKey();
self.fireEvent("EVENT_FOCUS");
}
}, {
eventName: "EVENT_BLUR",
action: function () {
self.fireEvent("EVENT_BLUR");
}
}, {
eventName: "EVENT_STOP",
action: function () {
self.fireEvent("EVENT_STOP");
}
}, {
eventName: "EVENT_VALID",
action: function () {
self.fireEvent("EVENT_VALID");
}
}, {
eventName: "EVENT_ERROR",
action: function () {
self.fireEvent("EVENT_ERROR");
}
}, {
eventName: "EVENT_CONFIRM",
action: function () {
var value = self.editor.getValue();
if (BI.isNotNull(value)) {
self.editor.setState(value);
}
if (BI.isNotEmptyString(value) && !BI.isEqual(self.storeTriggerValue, self.getKey())) {
var date = value.match(/\d+/g);
self.storeValue = {
hour: date[0] | 0,
minute: date[1] | 0,
second: date[2] | 0
};
}
self.fireEvent("EVENT_CONFIRM");
}
}, {
eventName: "EVENT_START",
action: function () {
self.fireEvent("EVENT_START");
}
}, {
eventName: "EVENT_CHANGE",
action: function () {
self.fireEvent("EVENT_CHANGE");
}
}]
},
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.text",
invisible: o.allowEdit,
cls: "show-text",
title: BI.bind(this._getTitle, this),
hgap: 4
},
left: 0,
right: 0,
top: 0,
bottom: 0
}]
};
},
_dateCheck: function (date) {
var c = this._const;
var self = this;
return BI.any(c.FORMAT_ARRAY, function (idx, format) {
return BI.print(BI.parseDateTime(c.DEFAULT_DATE_STRING + " " + self._getCompleteHMS(date, format), c.COMPLETE_COMPARE_FORMAT), format) === date;
});
},
_getCompleteHMS: function (str, format) {
var c = this._const;
switch (format) {
case "%M:%S":
str = c.DEFAULT_HOUR + ":" + str;
break;
default:
break;
}
return str;
},
_getTitle: function () {
var storeValue = this.storeValue || {};
var date = BI.getDate();
return BI.print(BI.getDate(date.getFullYear(), 0, 1, storeValue.hour, storeValue.minute, storeValue.second), this._getFormatString());
},
_getFormatString: function () {
return this.options.format || this._const.COMPARE_FORMAT;
},
_formatValue: function (v) {
var now = BI.getDate();
return BI.isNotEmptyObject(v) ? BI.print(BI.getDate(now.getFullYear(), now.getMonth(), now.getDay(), v.hour, v.minute, v.second), this._getFormatString()) : "";
},
getKey: function () {
return this.editor.getValue();
},
setValue: function (v) {
this.storeValue = v;
this.editor.setValue(this._formatValue(v));
},
getValue: function () {
return this.storeValue;
}
});
BI.shortcut("bi.time_trigger", BI.TimeTrigger);
})();
/***/ }),
/* 650 */
/***/ (function(module, exports) {
/**
* Created by Baron on 2015/10/19.
*/
BI.DateInterval = BI.inherit(BI.Single, {
constants: {
height: 24,
width: 24,
lgap: 15,
offset: 0,
timeErrorCls: "time-error"
},
_defaultConfig: function () {
var conf = BI.DateInterval.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-date-interval",
minDate: "1900-01-01",
maxDate: "2099-12-31"
});
},
_init: function () {
var self = this, o = this.options;
BI.DateInterval.superclass._init.apply(this, arguments);
o.value = o.value || {};
this.left = this._createCombo(o.value.start);
this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({
type: "bi.label",
height: this.constants.height,
width: this.constants.width,
text: "-"
});
BI.createWidget({
element: self,
type: "bi.center",
height: this.constants.height,
items: [{
type: "bi.absolute",
items: [{
el: self.left,
left: this.constants.offset,
right: this.constants.width / 2,
top: 0,
bottom: 0
}]
}, {
type: "bi.absolute",
items: [{
el: self.right,
left: this.constants.width / 2,
right: this.constants.offset,
top: 0,
bottom: 0
}]
}]
});
BI.createWidget({
type: "bi.horizontal_auto",
element: this,
items: [
self.label
]
});
},
_createCombo: function (v) {
var self = this, o = this.options;
var combo = BI.createWidget({
type: "bi.dynamic_date_combo",
behaviors: o.behaviors,
value: v
});
combo.on(BI.DynamicDateCombo.EVENT_ERROR, function () {
self._clearTitle();
BI.Bubbles.hide("error");
self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.DateInterval.EVENT_ERROR);
});
combo.on(BI.DynamicDateCombo.EVENT_VALID, function () {
BI.Bubbles.hide("error");
var smallDate = self.left.getKey(), bigDate = self.right.getKey();
if (self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) {
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text"));
self.element.addClass(self.constants.timeErrorCls);
BI.Bubbles.show("error", BI.i18nText("BI-Time_Interval_Error_Text"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.DateInterval.EVENT_ERROR);
} else {
self._clearTitle();
self.element.removeClass(self.constants.timeErrorCls);
}
});
combo.on(BI.DynamicDateCombo.EVENT_FOCUS, function () {
BI.Bubbles.hide("error");
var smallDate = self.left.getKey(), bigDate = self.right.getKey();
if (self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) {
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text"));
self.element.addClass(self.constants.timeErrorCls);
BI.Bubbles.show("error", BI.i18nText("BI-Time_Interval_Error_Text"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.DateInterval.EVENT_ERROR);
} else {
self._clearTitle();
self.element.removeClass(self.constants.timeErrorCls);
}
});
// combo.on(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW, function () {
// self.left.hidePopupView();
// self.right.hidePopupView();
// });
combo.on(BI.DynamicDateCombo.EVENT_CONFIRM, function () {
BI.Bubbles.hide("error");
var smallDate = self.left.getKey(), bigDate = self.right.getKey();
if (self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) {
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text"));
self.element.addClass(self.constants.timeErrorCls);
self.fireEvent(BI.DateInterval.EVENT_ERROR);
}else{
self._clearTitle();
self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.DateInterval.EVENT_CHANGE);
}
});
return combo;
},
_dateCheck: function (date) {
return BI.print(BI.parseDateTime(date, "%Y-%x-%d"), "%Y-%x-%d") === date ||
BI.print(BI.parseDateTime(date, "%Y-%X-%d"), "%Y-%X-%d") === date ||
BI.print(BI.parseDateTime(date, "%Y-%x-%e"), "%Y-%x-%e") === date ||
BI.print(BI.parseDateTime(date, "%Y-%X-%e"), "%Y-%X-%e") === date;
},
_checkVoid: function (obj) {
var o = this.options;
return !BI.checkDateVoid(obj.year, obj.month, obj.day, o.minDate, o.maxDate)[0];
},
_check: function (smallDate, bigDate) {
var smallObj = smallDate.match(/\d+/g), bigObj = bigDate.match(/\d+/g);
return this._dateCheck(smallDate) && BI.checkDateLegal(smallDate) && this._checkVoid({
year: smallObj[0],
month: smallObj[1],
day: smallObj[2]
}) && this._dateCheck(bigDate) && BI.checkDateLegal(bigDate) && this._checkVoid({
year: bigObj[0],
month: bigObj[1],
day: bigObj[2]
});
},
_compare: function (smallDate, bigDate) {
smallDate = BI.print(BI.parseDateTime(smallDate, "%Y-%X-%d"), "%Y-%X-%d");
bigDate = BI.print(BI.parseDateTime(bigDate, "%Y-%X-%d"), "%Y-%X-%d");
return BI.isNotNull(smallDate) && BI.isNotNull(bigDate) && smallDate > bigDate;
},
_setTitle: function (v) {
this.left.setTitle(v);
this.right.setTitle(v);
this.label.setTitle(v);
},
_clearTitle: function () {
this.left.setTitle("");
this.right.setTitle("");
this.label.setTitle("");
},
setValue: function (date) {
date = date || {};
this.left.setValue(date.start);
this.right.setValue(date.end);
},
getValue: function () {
return {start: this.left.getValue(), end: this.right.getValue()};
}
});
BI.DateInterval.EVENT_VALID = "EVENT_VALID";
BI.DateInterval.EVENT_ERROR = "EVENT_ERROR";
BI.DateInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.date_interval", BI.DateInterval);
/***/ }),
/* 651 */
/***/ (function(module, exports) {
/**
* Created by Baron on 2015/10/19.
*/
BI.TimeInterval = BI.inherit(BI.Single, {
constants: {
height: 24,
width: 24,
lgap: 15,
offset: 0,
timeErrorCls: "time-error"
},
_defaultConfig: function () {
var conf = BI.TimeInterval.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
extraCls: "bi-time-interval",
minDate: "1900-01-01",
maxDate: "2099-12-31"
});
},
_init: function () {
var self = this, o = this.options;
BI.TimeInterval.superclass._init.apply(this, arguments);
o.value = o.value || {};
this.left = this._createCombo(o.value.start);
this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({
type: "bi.label",
height: this.constants.height,
width: this.constants.width,
text: "-"
});
BI.createWidget({
element: self,
type: "bi.center",
height: this.constants.height,
items: [{
type: "bi.absolute",
items: [{
el: self.left,
left: this.constants.offset,
right: this.constants.width / 2,
top: 0,
bottom: 0
}]
}, {
type: "bi.absolute",
items: [{
el: self.right,
left: this.constants.width / 2,
right: this.constants.offset,
top: 0,
bottom: 0
}]
}]
});
BI.createWidget({
type: "bi.horizontal_auto",
element: this,
items: [
self.label
]
});
},
_createCombo: function (v) {
var self = this, o = this.options;
var combo = BI.createWidget({
type: "bi.dynamic_date_time_combo",
behaviors: o.behaviors,
value: v
});
combo.on(BI.DynamicDateTimeCombo.EVENT_ERROR, function () {
self._clearTitle();
BI.Bubbles.hide("error");
self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.TimeInterval.EVENT_ERROR);
});
combo.on(BI.DynamicDateTimeCombo.EVENT_VALID, function () {
BI.Bubbles.hide("error");
var smallDate = self.left.getKey(), bigDate = self.right.getKey();
if (self.left.isValid() && self.right.isValid() && self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) {
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text"));
self.element.addClass(self.constants.timeErrorCls);
BI.Bubbles.show("error", BI.i18nText("BI-Time_Interval_Error_Text"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.TimeInterval.EVENT_ERROR);
} else {
self._clearTitle();
self.element.removeClass(self.constants.timeErrorCls);
}
});
combo.on(BI.DynamicDateTimeCombo.EVENT_FOCUS, function () {
BI.Bubbles.hide("error");
var smallDate = self.left.getKey(), bigDate = self.right.getKey();
if (self.left.isValid() && self.right.isValid() && self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) {
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text"));
self.element.addClass(self.constants.timeErrorCls);
BI.Bubbles.show("error", BI.i18nText("BI-Time_Interval_Error_Text"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.TimeInterval.EVENT_ERROR);
} else {
self._clearTitle();
self.element.removeClass(self.constants.timeErrorCls);
}
});
// 不知道干啥的,先注释掉
// combo.on(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW, function () {
// self.left.hidePopupView();
// self.right.hidePopupView();
// });
combo.on(BI.DynamicDateTimeCombo.EVENT_CONFIRM, function () {
BI.Bubbles.hide("error");
var smallDate = self.left.getKey(), bigDate = self.right.getKey();
if (self.left.isValid() && self.right.isValid() && self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) {
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text"));
self.element.addClass(self.constants.timeErrorCls);
self.fireEvent(BI.TimeInterval.EVENT_ERROR);
}else{
self._clearTitle();
self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.TimeInterval.EVENT_CHANGE);
}
});
return combo;
},
_dateCheck: function (date) {
return BI.print(BI.parseDateTime(date, "%Y-%x-%d %H:%M:%S"), "%Y-%x-%d %H:%M:%S") === date ||
BI.print(BI.parseDateTime(date, "%Y-%X-%d %H:%M:%S"), "%Y-%X-%d %H:%M:%S") === date ||
BI.print(BI.parseDateTime(date, "%Y-%x-%e %H:%M:%S"), "%Y-%x-%e %H:%M:%S") === date ||
BI.print(BI.parseDateTime(date, "%Y-%X-%e %H:%M:%S"), "%Y-%X-%e %H:%M:%S") === date;
},
_checkVoid: function (obj) {
var o = this.options;
return !BI.checkDateVoid(obj.year, obj.month, obj.day, o.minDate, o.maxDate)[0];
},
_check: function (smallDate, bigDate) {
var smallObj = smallDate.match(/\d+/g), bigObj = bigDate.match(/\d+/g);
return this._dateCheck(smallDate) && BI.checkDateLegal(smallDate) && this._checkVoid({
year: smallObj[0],
month: smallObj[1],
day: smallObj[2]
}) && this._dateCheck(bigDate) && BI.checkDateLegal(bigDate) && this._checkVoid({
year: bigObj[0],
month: bigObj[1],
day: bigObj[2]
});
},
_compare: function (smallDate, bigDate) {
smallDate = BI.print(BI.parseDateTime(smallDate, "%Y-%X-%d %H:%M:%S"), "%Y-%X-%d %H:%M:%S");
bigDate = BI.print(BI.parseDateTime(bigDate, "%Y-%X-%d %H:%M:%S"), "%Y-%X-%d %H:%M:%S");
return BI.isNotNull(smallDate) && BI.isNotNull(bigDate) && smallDate > bigDate;
},
_setTitle: function (v) {
this.left.setTitle(v);
this.right.setTitle(v);
this.label.setTitle(v);
},
_clearTitle: function () {
this.left.setTitle("");
this.right.setTitle("");
this.label.setTitle("");
},
setValue: function (date) {
date = date || {};
this.left.setValue(date.start);
this.right.setValue(date.end);
},
getValue: function () {
return {start: this.left.getValue(), end: this.right.getValue()};
}
});
BI.TimeInterval.EVENT_VALID = "EVENT_VALID";
BI.TimeInterval.EVENT_ERROR = "EVENT_ERROR";
BI.TimeInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_interval", BI.TimeInterval);
/***/ }),
/* 652 */
/***/ (function(module, exports) {
/**
* 时间区间
* qcc
* 2019/2/28
*/
!(function () {
BI.TimePeriods = BI.inherit(BI.Single, {
constants: {
height: 24,
width: 24,
lgap: 15,
offset: 0
},
props: {
extraCls: "bi-time-interval",
value: {}
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.absolute",
height: this.constants.height,
items: [{
el: {
type: "bi.horizontal_auto",
items: [{
type: "bi.label",
height: this.constants.height,
width: this.constants.width,
text: "-",
ref: function (_ref) {
self.label = _ref;
}
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}, {
el: {
type: "bi.center",
height: this.constants.height,
items: [{
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.left = _ref;
}
}, this._createCombo(o.value.start)),
left: this.constants.offset,
right: this.constants.width / 2,
top: 0,
bottom: 0
}]
}, {
type: "bi.absolute",
items: [{
el: BI.extend({
ref: function (_ref) {
self.right = _ref;
}
}, this._createCombo(o.value.end)),
left: this.constants.width / 2,
right: this.constants.offset,
top: 0,
bottom: 0
}]
}]
},
top: 0,
left: 0,
right: 0,
bottom: 0
}]
};
},
_createCombo: function (v) {
var self = this;
return {
type: "bi.time_combo",
value: v,
listeners: [{
eventName: BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.left.hidePopupView();
self.right.hidePopupView();
}
}, {
eventName: BI.TimeCombo.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CHANGE);
}
}, {
eventName: BI.TimeCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.TimePeriods.EVENT_CONFIRM);
}
}]
};
},
setValue: function (date) {
date = date || {};
this.left.setValue(date.start);
this.right.setValue(date.end);
},
getValue: function () {
return {start: this.left.getValue(), end: this.right.getValue()};
}
});
BI.TimePeriods.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TimePeriods.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.time_periods", BI.TimePeriods);
})();
/***/ }),
/* 653 */
/***/ (function(module, exports) {
/**
* 年份展示面板
*
* Created by GUY on 2015/9/2.
* @class BI.YearCard
* @extends BI.Trigger
*/
BI.DynamicYearCard = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-card"
},
render: function () {
var self = this;
return {
type: "bi.vertical",
items: [{
type: "bi.label",
text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"),
textAlign: "left",
height: 24
}, {
type: "bi.dynamic_date_param_item",
ref: function () {
self.item = this;
},
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self.fireEvent("EVENT_CHANGE");
}
}]
}],
vgap: 10,
hgap: 10
};
},
_createValue: function (type, v) {
return {
dateType: type,
value: Math.abs(v),
offset: v > 0 ? 1 : 0
};
},
setValue: function (v) {
v = v || {year: 0};
this.item.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR, v.year));
},
getValue: function () {
var value = this.item.getValue();
return {
year: (value.offset === 0 ? -value.value : value.value)
};
}
});
BI.DynamicYearCard.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.dynamic_year_card", BI.DynamicYearCard);
/***/ }),
/* 654 */
/***/ (function(module, exports) {
/**
* 年份展示面板
*
* Created by GUY on 2015/9/2.
* @class BI.StaticYearCard
* @extends BI.Trigger
*/
BI.StaticYearCard = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.StaticYearCard.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-year-card",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31" // 最大日期
});
},
_createYearCalendar: function (v) {
var o = this.options, y = this._year;
var calendar = BI.createWidget({
type: "bi.year_calendar",
behaviors: o.behaviors,
min: o.min,
max: o.max,
logic: {
dynamic: true
},
year: y + v * 12
});
calendar.setValue(this._year);
return calendar;
},
_init: function () {
BI.StaticYearCard.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.selectedYear = this._year = BI.getDate().getFullYear();
this.backBtn = BI.createWidget({
type: "bi.icon_button",
cls: "pre-page-h-font",
width: 25,
height: 25,
value: -1,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
self.navigation.setSelect(self.navigation.getSelect() - 1);
self._checkLeftValid();
self._checkRightValid();
}
}]
});
this.preBtn = BI.createWidget({
type: "bi.icon_button",
cls: "next-page-h-font",
width: 25,
height: 25,
value: 1,
listeners: [{
eventName: BI.IconButton.EVENT_CHANGE,
action: function () {
self.navigation.setSelect(self.navigation.getSelect() + 1);
self._checkLeftValid();
self._checkRightValid();
}
}]
});
this.navigation = BI.createWidget({
type: "bi.navigation",
direction: "top",
element: this,
single: true,
logic: {
dynamic: true
},
tab: {
type: "bi.htape",
cls: "bi-split-top bi-split-bottom",
height: 30,
items: [{
el: {
type: "bi.center_adapt",
items: [self.backBtn]
},
width: 25
}, {
type: "bi.layout"
}, {
el: {
type: "bi.center_adapt",
items: [self.preBtn]
},
width: 25
}]
},
cardCreator: BI.bind(this._createYearCalendar, this),
afterCardShow: function () {
this.setValue(self.selectedYear);
var calendar = this.getSelectedCard();
self.backBtn.setEnable(!calendar.isFrontYear());
self.preBtn.setEnable(!calendar.isFinalYear());
}
});
this.navigation.on(BI.Navigation.EVENT_CHANGE, function () {
self.selectedYear = this.getValue();
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.StaticYearCard.EVENT_CHANGE, self.selectedYear);
});
if(BI.isKey(o.value)){
this.setValue(o.value);
}
},
_checkLeftValid: function () {
var o = this.options;
var valid = true;
this.backBtn.setEnable(valid);
return valid;
},
_checkRightValid: function () {
var o = this.options;
var valid = true;
this.preBtn.setEnable(valid);
return valid;
},
getValue: function () {
return {
year: this.selectedYear
};
},
setValue: function (obj) {
var o = this.options;
obj = obj || {};
var v = obj.year;
if (BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]) {
v = BI.getDate().getFullYear();
this.selectedYear = "";
this.navigation.setSelect(BI.YearCalendar.getPageByYear(v));
this.navigation.setValue("");
} else {
this.selectedYear = BI.parseInt(v);
this.navigation.setSelect(BI.YearCalendar.getPageByYear(v));
this.navigation.setValue(this.selectedYear);
}
this._checkLeftValid();
this._checkRightValid();
}
});
BI.StaticYearCard.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.static_year_card", BI.StaticYearCard);
/***/ }),
/* 655 */
/***/ (function(module, exports) {
BI.DynamicYearCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-combo bi-border bi-border-radius bi-focus-shadow",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 22
},
_init: function () {
BI.DynamicYearCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value;
this.trigger = BI.createWidget({
type: "bi.dynamic_year_trigger",
min: o.min,
max: o.max,
height: o.height,
value: o.value || ""
});
this.trigger.on(BI.DynamicYearTrigger.EVENT_KEY_DOWN, function () {
if (self.combo.isViewVisible()) {
self.combo.hideView();
}
});
this.trigger.on(BI.DynamicYearTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = this.getKey();
});
this.trigger.on(BI.DynamicYearTrigger.EVENT_START, function () {
self.combo.isViewVisible() && self.combo.hideView();
});
this.trigger.on(BI.DynamicYearTrigger.EVENT_STOP, function () {
self.combo.showView();
});
this.trigger.on(BI.DynamicYearTrigger.EVENT_ERROR, function () {
self.combo.isViewVisible() && self.combo.hideView();
});
this.trigger.on(BI.DynamicYearTrigger.EVENT_CONFIRM, function () {
if (self.combo.isViewVisible()) {
return;
}
if (this.getKey() && this.getKey() !== self.storeTriggerValue) {
self.storeValue = self.trigger.getValue();
self.setValue(self.storeValue);
} else if (!this.getKey()) {
self.storeValue = null;
self.setValue();
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM);
});
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
popup: {
minWidth: 85,
stopPropagation: false,
el: {
type: "bi.dynamic_year_popup",
ref: function () {
self.popup = this;
},
listeners: [{
eventName: BI.DynamicYearPopup.EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.combo.hideView();
self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () {
var date = BI.getDate();
self.setValue({type: BI.DynamicYearCombo.Static, value: {year: date.getFullYear()}});
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}],
behaviors: o.behaviors,
min: o.min,
max: o.max
},
value: o.value || ""
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.htape",
element: this,
ref: function () {
self.comboWrapper = this;
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 24
}, this.combo]
});
this._checkDynamicValue(o.value);
},
_checkDynamicValue: function (v) {
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicYearCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = 24;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {
return this.storeValue;
}
});
BI.DynamicYearCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.dynamic_year_combo", BI.DynamicYearCombo);
BI.extend(BI.DynamicYearCombo, {
Static: 1,
Dynamic: 2
});
/***/ }),
/* 656 */
/***/ (function(module, exports) {
/**
* 年份展示面板
*
* Created by GUY on 2015/9/2.
* @class BI.DynamicYearPopup
* @extends BI.Trigger
*/
BI.DynamicYearPopup = BI.inherit(BI.Widget, {
constants: {
tabHeight: 30,
buttonHeight: 24
},
props: {
baseCls: "bi-year-popup",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期,
width: 180,
height: 240
},
render: function () {
var self = this, opts = this.options, c = this.constants;
this.storeValue = {type: BI.DynamicYearCombo.Static};
return {
type: "bi.vtape",
items: [{
el: this._getTabJson()
}, {
el: {
type: "bi.grid",
items: [[{
type: "bi.text_button",
cls: "bi-split-top bi-high-light",
textHeight: c.buttonHeight - 1,
shadow: true,
text: BI.i18nText("BI-Basic_Clear"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
textHeight: c.buttonHeight - 1,
cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
shadow: true,
text: BI.i18nText("BI-Basic_Current_Year"),
ref: function () {
self.textButton = this;
},
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
cls: "bi-split-top bi-high-light",
textHeight: c.buttonHeight - 1,
shadow: true,
text: BI.i18nText("BI-Basic_OK"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]
};
},
_setInnerValue: function () {
if (this.dateTab.getSelect() === BI.DynamicDateCombo.Static) {
this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year"));
this.textButton.setEnable(true);
} else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());
date = BI.print(date, "%Y");
this.textButton.setValue(date);
this.textButton.setEnable(false);
}
},
_getTabJson: function () {
var self = this, o = this.options;
return {
type: "bi.tab",
ref: function () {
self.dateTab = this;
},
tab: {
type: "bi.linear_segment",
cls: "bi-split-bottom",
height: this.constants.tabHeight,
items: BI.createItems([{
text: BI.i18nText("BI-Basic_Year_Fen"),
value: BI.DynamicYearCombo.Static
}, {
text: BI.i18nText("BI-Basic_Dynamic_Title"),
value: BI.DynamicYearCombo.Dynamic
}], {
textAlign: "center"
})
},
cardCreator: function (v) {
switch (v) {
case BI.DynamicYearCombo.Dynamic:
return {
type: "bi.dynamic_year_card",
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self._setInnerValue(self.year, v);
}
}],
ref: function () {
self.dynamicPane = this;
}
};
case BI.DynamicYearCombo.Static:
default:
return {
type: "bi.static_year_card",
behaviors: o.behaviors,
min: self.options.min,
max: self.options.max,
listeners: [{
eventName: BI.StaticYearCard.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicYearPopup.EVENT_CHANGE);
}
}],
ref: function () {
self.year = this;
}
};
}
},
listeners: [{
eventName: BI.Tab.EVENT_CHANGE,
action: function () {
var v = self.dateTab.getSelect();
switch (v) {
case BI.DynamicYearCombo.Static:
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.year.setValue({year: date.getFullYear()});
self._setInnerValue();
break;
case BI.DynamicYearCombo.Dynamic:
default:
if(self.storeValue && self.storeValue.type === BI.DynamicYearCombo.Dynamic) {
self.dynamicPane.setValue(self.storeValue.value);
}else{
self.dynamicPane.setValue({
year: 0
});
}
self._setInnerValue();
break;
}
}
}]
};
},
setValue: function (v) {
this.storeValue = v;
var self = this;
var type, value;
v = v || {};
type = v.type || BI.DynamicDateCombo.Static;
value = v.value || v;
this.dateTab.setSelect(type);
switch (type) {
case BI.DynamicDateCombo.Dynamic:
this.dynamicPane.setValue(value);
self._setInnerValue();
break;
case BI.DynamicDateCombo.Static:
default:
this.year.setValue(value);
this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year"));
this.textButton.setEnable(true);
break;
}
},
getValue: function () {
return {
type: this.dateTab.getSelect(),
value: this.dateTab.getValue()
};
}
});
BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE = "BUTTON_lABEL_EVENT_CHANGE";
BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.DynamicYearPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.dynamic_year_popup", BI.DynamicYearPopup);
/***/ }),
/* 657 */
/***/ (function(module, exports) {
BI.DynamicYearTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2
},
_defaultConfig: function () {
return BI.extend(BI.DynamicYearTrigger.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-year-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 24
});
},
beforeInit: function (callback) {
var o = this.options;
o.title = BI.bind(this._titleCreator, this);
callback();
},
_init: function () {
BI.DynamicYearTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options, c = this._const;
this.editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
},
quitChecker: function (v) {
return false;
},
hgap: c.hgap,
vgap: c.vgap,
watermark: BI.i18nText("BI-Basic_Unrestricted"),
allowBlank: true,
errorText: function () {
return BI.i18nText("BI-Year_Trigger_Invalid_Text");
}
});
this.editor.on(BI.SignEditor.EVENT_KEY_DOWN, function () {
self.fireEvent(BI.DynamicYearTrigger.EVENT_KEY_DOWN, arguments);
});
this.editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.DynamicYearTrigger.EVENT_FOCUS);
});
this.editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicYearTrigger.EVENT_STOP);
});
this.editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
var value = self.editor.getValue();
if (BI.isNotNull(value)) {
self.editor.setValue(value);
}
if (BI.isNotEmptyString(value)) {
self.storeValue = {
type: BI.DynamicDateCombo.Static,
value: {
year: value
}
};
}
self.fireEvent(BI.DynamicYearTrigger.EVENT_CONFIRM);
});
this.editor.on(BI.SignEditor.EVENT_SPACE, function () {
if (self.editor.isValid()) {
self.editor.blur();
}
});
this.editor.on(BI.SignEditor.EVENT_START, function () {
self.fireEvent(BI.DynamicYearTrigger.EVENT_START);
});
this.editor.on(BI.SignEditor.EVENT_ERROR, function () {
self.fireEvent(BI.DynamicYearTrigger.EVENT_ERROR);
});
BI.createWidget({
element: this,
type: "bi.htape",
items: [{
el: this.editor
}, {
el: {
type: "bi.text_button",
baseCls: "bi-trigger-year-text",
text: BI.i18nText("BI-Multi_Date_Year"),
width: o.height
},
width: o.height
}, {
el: {
type: "bi.trigger_icon_button",
width: o.height
},
width: o.height
}]
});
this.setValue(o.value);
},
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;
},
_setInnerValue: function (date, text) {
var dateStr = BI.print(date, "%Y");
this.editor.setState(dateStr);
this.editor.setValue(dateStr);
},
_titleCreator: function () {
var storeValue = this.storeValue || {};
var type = storeValue.type || BI.DynamicDateCombo.Static;
var value = storeValue.value;
if(!this.editor.isValid()) {
return "";
}
switch (type) {
case BI.DynamicDateCombo.Dynamic:
var text = this._getText(value);
var date = BI.getDate();
date = BI.DynamicDateHelper.getCalculation(value);
var dateStr = BI.print(date, "%Y");
return BI.isEmptyString(text) ? dateStr : (text + ":" + dateStr);
case BI.DynamicDateCombo.Static:
default:
value = value || {};
return value.year;
}
},
setValue: function (v) {
var type, value;
var date = BI.getDate();
this.storeValue = v;
if (BI.isNotNull(v)) {
type = v.type || BI.DynamicDateCombo.Static;
value = v.value || v;
}
switch (type) {
case BI.DynamicDateCombo.Dynamic:
var text = this._getText(value);
date = BI.DynamicDateHelper.getCalculation(value);
this._setInnerValue(date, text);
break;
case BI.DynamicDateCombo.Static:
default:
value = value || {};
this.editor.setState(value.year);
this.editor.setValue(value.year);
break;
}
},
getValue: function () {
return this.storeValue;
},
getKey: function () {
return this.editor.getValue() | 0;
}
});
BI.DynamicYearTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.DynamicYearTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicYearTrigger.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicYearTrigger.EVENT_START = "EVENT_START";
BI.DynamicYearTrigger.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicYearTrigger.EVENT_STOP = "EVENT_STOP";
BI.shortcut("bi.dynamic_year_trigger", BI.DynamicYearTrigger);
/***/ }),
/* 658 */
/***/ (function(module, exports) {
/**
* 年月展示面板
*
* Created by GUY on 2015/9/2.
* @class BI.YearCard
* @extends BI.Trigger
*/
BI.DynamicYearMonthCard = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-month-card"
},
render: function () {
var self = this;
return {
type: "bi.vertical",
items: [{
type: "bi.label",
text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"),
textAlign: "left",
height: 24
}, {
type: "bi.dynamic_date_param_item",
ref: function () {
self.year = this;
},
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self.fireEvent("EVENT_CHANGE");
}
}]
}, {
type: "bi.dynamic_date_param_item",
dateType: BI.DynamicDateCard.TYPE.MONTH,
ref: function () {
self.month = this;
},
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self.fireEvent("EVENT_CHANGE");
}
}]
}],
vgap: 10,
hgap: 10
};
},
_createValue: function (type, v) {
return {
dateType: type,
value: Math.abs(v),
offset: v > 0 ? 1 : 0
};
},
setValue: function (v) {
v = v || {year: 0, month: 0};
this.year.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR, v.year));
this.month.setValue(this._createValue(BI.DynamicDateCard.TYPE.MONTH, v.month));
},
getValue: function () {
var year = this.year.getValue();
var month = this.month.getValue();
return {
year: (year.offset === 0 ? -year.value : year.value),
month: (month.offset === 0 ? -month.value : month.value)
};
}
});
BI.DynamicYearMonthCard.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.dynamic_year_month_card", BI.DynamicYearMonthCard);
/***/ }),
/* 659 */
/***/ (function(module, exports) {
BI.StaticYearMonthCard = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-static-year-month-card",
behaviors: {}
},
_createMonths: function () {
var self = this;
// 纵向排列月
var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12];
var items = [];
items.push(month.slice(0, 2));
items.push(month.slice(2, 4));
items.push(month.slice(4, 6));
items.push(month.slice(6, 8));
items.push(month.slice(8, 10));
items.push(month.slice(10, 12));
return BI.map(items, function (i, item) {
return BI.map(item, function (j, td) {
return {
type: "bi.text_item",
cls: "bi-list-item-select",
textAlign: "center",
whiteSpace: "nowrap",
once: false,
forceSelected: true,
height: 23,
width: 38,
value: td,
text: td,
ref: function (_ref) {
self.monthMap[j === 0 ? i : i + 6] = _ref;
}
};
});
});
},
render: function () {
var self = this, o = this.options;
this.monthMap = {};
return {
type: "bi.vertical",
items: [{
type: "bi.year_picker",
min: o.min,
max: o.max,
ref: function () {
self.yearPicker = this;
},
behaviors: o.behaviors,
height: 30,
listeners: [{
eventName: BI.YearPicker.EVENT_CHANGE,
action: function () {
var value = this.getValue();
self._checkMonthStatus(value);
self.setValue({
year: value,
month: self.selectedMonth
});
}
}]
}, {
type: "bi.button_group",
cls: "bi-split-top",
behaviors: o.behaviors,
ref: function () {
self.month = this;
},
items: this._createMonths(),
layouts: [BI.LogicFactory.createLogic("table", BI.extend({
dynamic: true
}, {
columns: 2,
rows: 6,
columnSize: [1 / 2, 1 / 2],
rowSize: 25
})), {
type: "bi.center_adapt",
vgap: 1,
hgap: 2
}],
value: o.value,
listeners: [{
eventName: BI.ButtonGroup.EVENT_CHANGE,
action: function () {
self.selectedYear = self.yearPicker.getValue();
self.selectedMonth = this.getValue()[0];
self.fireEvent(BI.StaticYearMonthCard.EVENT_CHANGE);
}
}]
}]
};
},
mounted: function() {
this._checkMonthStatus(this.selectedYear);
},
_checkMonthStatus: function (year) {
var o = this.options;
var minDate = BI.parseDateTime(o.min, "%Y-%X-%d"), maxDate = BI.parseDateTime(o.max, "%Y-%X-%d");
var minYear = minDate.getFullYear(), maxYear = maxDate.getFullYear();
var minMonth = 0; var maxMonth = 11;
minYear === year && (minMonth = minDate.getMonth());
maxYear === year && (maxMonth = maxDate.getMonth());
var yearInvalid = year < minYear || year > maxYear;
BI.each(this.monthMap, function (month, obj) {
var monthInvalid = month < minMonth || month > maxMonth;
obj.setEnable(!yearInvalid && !monthInvalid);
});
},
setMinDate: function (minDate) {
if (this.options.min !== minDate) {
this.options.min = minDate;
this.yearPicker.setMinDate(minDate);
this._checkMonthStatus(this.selectedYear);
}
},
setMaxDate: function (maxDate) {
if (this.options.max !== maxDate) {
this.options.max = maxDate;
this.yearPicker.setMaxDate(maxDate);
this._checkMonthStatus(this.selectedYear);
}
},
getValue: function () {
return {
year: this.selectedYear,
month: this.selectedMonth
};
},
setValue: function (obj) {
var o = this.options;
var newObj = {};
newObj.year = obj.year || 0;
newObj.month = obj.month || 0;
if (newObj.year === 0 || newObj.month === 0 || BI.checkDateVoid(newObj.year, newObj.month, 1, o.min, o.max)[0]) {
var year = newObj.year || BI.getDate().getFullYear();
this.selectedYear = year;
this.selectedMonth = "";
this.yearPicker.setValue(year);
this.month.setValue();
} else {
this.selectedYear = BI.parseInt(newObj.year);
this.selectedMonth = BI.parseInt(newObj.month);
this.yearPicker.setValue(this.selectedYear);
this.month.setValue(this.selectedMonth);
}
}
});
BI.StaticYearMonthCard.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.static_year_month_card", BI.StaticYearMonthCard);
/***/ }),
/* 660 */
/***/ (function(module, exports) {
BI.DynamicYearMonthCombo = BI.inherit(BI.Single, {
props: {
baseCls: "bi-year-month-combo bi-border bi-border-radius bi-focus-shadow",
behaviors: {},
minDate: "1900-01-01", // 最小日期
maxDate: "2099-12-31", // 最大日期
height: 22
},
_init: function () {
BI.DynamicYearMonthCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value;
this.storeTriggerValue = "";
this.trigger = BI.createWidget({
type: "bi.dynamic_year_month_trigger",
min: o.minDate,
max: o.maxDate,
height: o.height,
value: o.value || ""
});
this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN, function () {
self.combo.isViewVisible() && self.combo.hideView();
});
this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_START, function () {
self.combo.isViewVisible() && self.combo.hideView();
});
this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_STOP, function () {
self.combo.showView();
});
this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_ERROR, function () {
self.combo.isViewVisible() && self.combo.hideView();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_ERROR);
});
this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_VALID, function () {
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_VALID);
});
this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_CONFIRM, function () {
// 没看出来干啥的,先去掉
// if (self.combo.isViewVisible()) {
// return;
// }
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
});
this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS);
});
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
popup: {
minWidth: 100,
stopPropagation: false,
el: {
type: "bi.dynamic_year_month_popup",
ref: function () {
self.popup = this;
},
listeners: [{
eventName: BI.DynamicYearMonthPopup.EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.combo.hideView();
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () {
var date = BI.getDate();
self.setValue({type: BI.DynamicYearMonthCombo.Static, value: {year: date.getFullYear(), month: date.getMonth() + 1}});
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}],
behaviors: o.behaviors,
min: o.minDate,
max: o.maxDate
},
value: o.value || ""
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.htape",
element: this,
ref: function () {
self.comboWrapper = this;
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 24
}, this.combo]
});
this._checkDynamicValue(o.value);
},
_checkDynamicValue: function (v) {
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicYearMonthCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = 24;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
hideView: function () {
this.combo.hideView();
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {
return this.storeValue;
},
getKey: function () {
return this.trigger.getKey();
},
isValid: function () {
return this.trigger.isValid();
}
});
BI.DynamicYearMonthCombo.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicYearMonthCombo.EVENT_VALID = "EVENT_VALID";
BI.DynamicYearMonthCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicYearMonthCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.dynamic_year_month_combo", BI.DynamicYearMonthCombo);
BI.extend(BI.DynamicYearMonthCombo, {
Static: 1,
Dynamic: 2
});
/***/ }),
/* 661 */
/***/ (function(module, exports) {
/**
* 年月
*
* Created by GUY on 2015/9/2.
* @class BI.DynamicYearMonthPopup
* @extends BI.Trigger
*/
BI.DynamicYearMonthPopup = BI.inherit(BI.Widget, {
constants: {
tabHeight: 30,
buttonHeight: 24
},
props: {
baseCls: "bi-year-month-popup",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期,
width: 180,
height: 240
},
render: function () {
var self = this, opts = this.options, c = this.constants;
this.storeValue = {type: BI.DynamicYearMonthCombo.Static};
return {
type: "bi.vtape",
items: [{
el: this._getTabJson()
}, {
el: {
type: "bi.grid",
items: [[{
type: "bi.text_button",
cls: "bi-split-top bi-high-light",
textHeight: c.buttonHeight - 1,
shadow: true,
text: BI.i18nText("BI-Basic_Clear"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
textHeight: c.buttonHeight - 1,
shadow: true,
text: BI.i18nText("BI-Basic_Current_Month"),
ref: function () {
self.textButton = this;
},
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
cls: "bi-split-top bi-high-light",
textHeight: c.buttonHeight - 1,
shadow: true,
text: BI.i18nText("BI-Basic_OK"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]
};
},
_setInnerValue: function () {
if (this.dateTab.getSelect() === BI.DynamicDateCombo.Static) {
this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month"));
this.textButton.setEnable(true);
} else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());
date = BI.print(date, "%Y-%x");
this.textButton.setValue(date);
this.textButton.setEnable(false);
}
},
_getTabJson: function () {
var self = this, o = this.options;
return {
type: "bi.tab",
ref: function () {
self.dateTab = this;
},
tab: {
type: "bi.linear_segment",
cls: "bi-split-bottom",
height: this.constants.tabHeight,
items: BI.createItems([{
text: BI.i18nText("BI-Basic_Year_Month"),
value: BI.DynamicYearCombo.Static
}, {
text: BI.i18nText("BI-Basic_Dynamic_Title"),
value: BI.DynamicYearCombo.Dynamic
}], {
textAlign: "center"
})
},
cardCreator: function (v) {
switch (v) {
case BI.DynamicYearCombo.Dynamic:
return {
type: "bi.dynamic_year_month_card",
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self._setInnerValue(self.year, v);
}
}],
ref: function () {
self.dynamicPane = this;
}
};
case BI.DynamicYearCombo.Static:
default:
return {
type: "bi.static_year_month_card",
behaviors: o.behaviors,
min: self.options.min,
max: self.options.max,
listeners: [{
eventName: BI.StaticYearMonthCard.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicYearMonthPopup.EVENT_CHANGE);
}
}],
ref: function () {
self.year = this;
}
};
}
},
listeners: [{
eventName: BI.Tab.EVENT_CHANGE,
action: function () {
var v = self.dateTab.getSelect();
switch (v) {
case BI.DynamicYearCombo.Static:
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.year.setValue({year: date.getFullYear(), month: date.getMonth() + 1});
self._setInnerValue();
break;
case BI.DynamicYearCombo.Dynamic:
default:
if(self.storeValue && self.storeValue.type === BI.DynamicYearCombo.Dynamic) {
self.dynamicPane.setValue(self.storeValue.value);
}else{
self.dynamicPane.setValue({
year: 0
});
}
self._setInnerValue();
break;
}
}
}]
};
},
setMinDate: function (minDate) {
if (this.options.min !== minDate) {
this.options.min = minDate;
this.year.setMinDate(minDate);
}
},
setMaxDate: function (maxDate) {
if (this.options.max !== maxDate) {
this.options.max = maxDate;
this.year.setMaxDate(maxDate);
}
},
setValue: function (v) {
this.storeValue = v;
var self = this;
var type, value;
v = v || {};
type = v.type || BI.DynamicDateCombo.Static;
value = v.value || v;
this.dateTab.setSelect(type);
switch (type) {
case BI.DynamicDateCombo.Dynamic:
this.dynamicPane.setValue(value);
self._setInnerValue();
break;
case BI.DynamicDateCombo.Static:
default:
this.year.setValue(value);
this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month"));
this.textButton.setEnable(true);
break;
}
},
getValue: function () {
return {
type: this.dateTab.getSelect(),
value: this.dateTab.getValue()
};
}
});
BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE = "BUTTON_lABEL_EVENT_CHANGE";
BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.DynamicYearMonthPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.dynamic_year_month_popup", BI.DynamicYearMonthPopup);
/***/ }),
/* 662 */
/***/ (function(module, exports) {
BI.DynamicYearMonthTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2
},
props: {
extraCls: "bi-year-month-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 22
},
beforeInit: function (callback) {
var o = this.options;
o.title = BI.bind(this._titleCreator, this);
callback();
},
_init: function () {
BI.DynamicYearMonthTrigger.superclass._init.apply(this, arguments);
var o = this.options;
this.yearEditor = this._createEditor(true);
this.monthEditor = this._createEditor(false);
BI.createWidget({
element: this,
type: "bi.htape",
items: [{
type: "bi.center",
items: [{
type: "bi.htape",
items: [this.yearEditor, {
el: {
type: "bi.text_button",
text: BI.i18nText("BI-Multi_Date_Year"),
width: o.height
},
width: o.height
}]
}, {
type: "bi.htape",
items: [this.monthEditor, {
el: {
type: "bi.text_button",
text: BI.i18nText("BI-Multi_Date_Month"),
width: o.height
},
width: o.height}]
}]
}, {
el: {
type: "bi.trigger_icon_button",
width: o.height
},
width: o.height
}]
});
this.setValue(o.value);
},
_createEditor: function (isYear) {
var self = this, o = this.options, c = this._const;
var minDate = BI.parseDateTime(o.min, "%Y-%X-%d");
var editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, v === minDate.getFullYear() ? minDate.getMonth() + 1 : 1, 1, o.min, o.max)[0]);
}
return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 12) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
},
watermark: BI.i18nText("BI-Basic_Unrestricted"),
errorText: function (v) {
return BI.i18nText("BI-Year_Trigger_Invalid_Text");
},
hgap: c.hgap,
vgap: c.vgap,
allowBlank: true
});
editor.on(BI.SignEditor.EVENT_KEY_DOWN, function () {
self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN);
});
editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_FOCUS);
});
editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_STOP);
});
editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
self._doEditorConfirm(editor);
self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM);
});
editor.on(BI.SignEditor.EVENT_SPACE, function () {
if (editor.isValid()) {
editor.blur();
}
});
editor.on(BI.SignEditor.EVENT_START, function () {
self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_START);
});
editor.on(BI.SignEditor.EVENT_ERROR, function () {
self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_ERROR);
});
editor.on(BI.SignEditor.EVENT_VALID, function () {
var year = self.yearEditor.getValue();
var month = self.monthEditor.getValue();
if(BI.isNotEmptyString(year) && BI.isNotEmptyString(month)) {
if(BI.isPositiveInteger(year) && month >= 1 && month <= 12 && !BI.checkDateVoid(year, month, 1, o.min, o.max)[0]) {
self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_VALID);
}
}
});
editor.on(BI.SignEditor.EVENT_CHANGE, function () {
if(isYear) {
self._autoSwitch(editor);
}
});
return editor;
},
_titleCreator: function () {
var storeValue = this.storeValue || {};
var type = storeValue.type || BI.DynamicDateCombo.Static;
var value = storeValue.value;
if(!this.monthEditor.isValid() || !this.yearEditor.isValid()) {
return "";
}
switch (type) {
case BI.DynamicDateCombo.Dynamic:
var text = this._getText(value);
var date = BI.getDate();
date = BI.DynamicDateHelper.getCalculation(value);
var dateStr = BI.print(date, "%Y-%x");
return BI.isEmptyString(text) ? dateStr : (text + ":" + dateStr);
case BI.DynamicDateCombo.Static:
default:
value = value || {};
return this._getStaticTitle(value);
}
},
_doEditorConfirm: function (editor) {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var monthValue = this.monthEditor.getValue();
this.storeValue = {
type: BI.DynamicDateCombo.Static,
value: {
year: this.yearEditor.getValue(),
month: BI.isEmptyString(this.monthEditor.getValue()) ? "" : monthValue
}
};
},
_yearCheck: function (v) {
var date = BI.print(BI.parseDateTime(v, "%Y-%X-%d"), "%Y-%X-%d");
return BI.print(BI.parseDateTime(v, "%Y"), "%Y") === v && date >= this.options.min && date <= this.options.max;
},
_autoSwitch: function (editor) {
var v = editor.getValue();
if (BI.isNotEmptyString(v) && BI.checkDateLegal(v)) {
if (v.length === 4 && this._yearCheck(v)) {
this._doEditorConfirm(editor);
this.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM);
this.monthEditor.focus();
}
}
},
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
if(BI.isNotNull(obj.month) && BI.parseInt(obj.month) !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;
},
_setInnerValue: function (date, text) {
this.yearEditor.setValue(date.getFullYear());
this.monthEditor.setValue(date.getMonth() + 1);
},
_getStaticTitle: function (value) {
value = value || {};
var hasYear = !(BI.isNull(value.year) || BI.isEmptyString(value.year));
var hasMonth = !(BI.isNull(value.month) || BI.isEmptyString(value.month));
switch ((hasYear << 1) | hasMonth) {
// !hasYear && !hasMonth
case 0:
return "";
// !hasYear && hasMonth
case 1:
return value.month;
// hasYear && !hasMonth
case 2:
return value.year;
// hasYear && hasMonth
case 3:
default:
return value.year + "-" + value.month;
}
},
setValue: function (v) {
var type, value;
var date = BI.getDate();
this.storeValue = v;
if (BI.isNotNull(v)) {
type = v.type || BI.DynamicDateCombo.Static;
value = v.value || v;
}
switch (type) {
case BI.DynamicDateCombo.Dynamic:
var text = this._getText(value);
date = BI.DynamicDateHelper.getCalculation(value);
this._setInnerValue(date, text);
break;
case BI.DynamicDateCombo.Static:
default:
value = value || {};
var month = BI.isNull(value.month) ? null : value.month;
this.yearEditor.setValue(value.year);
this.monthEditor.setValue(month);
break;
}
},
getValue: function () {
return this.storeValue;
},
getKey: function () {
return this.yearEditor.getValue() + "-" + this.monthEditor.getValue();
},
isValid: function () {
return this.yearEditor.isValid() && this.monthEditor.isValid();
}
});
BI.DynamicYearMonthTrigger.EVENT_VALID = "EVENT_VALID";
BI.DynamicYearMonthTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicYearMonthTrigger.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicYearMonthTrigger.EVENT_START = "EVENT_START";
BI.DynamicYearMonthTrigger.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicYearMonthTrigger.EVENT_STOP = "EVENT_STOP";
BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.shortcut("bi.dynamic_year_month_trigger", BI.DynamicYearMonthTrigger);
/***/ }),
/* 663 */
/***/ (function(module, exports) {
BI.YearMonthInterval = BI.inherit(BI.Single, {
constants: {
height: 24,
width: 25,
lgap: 15,
offset: -15,
timeErrorCls: "time-error"
},
props: {
extraCls: "bi-year-month-interval",
minDate: "1900-01-01",
maxDate: "2099-12-31"
},
_init: function () {
var self = this, o = this.options;
BI.YearMonthInterval.superclass._init.apply(this, arguments);
o.value = o.value || {};
this.left = this._createCombo(o.value.start);
this.right = this._createCombo(o.value.end);
this.label = BI.createWidget({
type: "bi.label",
height: this.constants.height,
width: this.constants.width,
text: "-"
});
BI.createWidget({
element: self,
type: "bi.center",
hgap: 15,
height: this.constants.height,
items: [{
type: "bi.absolute",
items: [{
el: self.left,
left: this.constants.offset,
right: 0,
top: 0,
bottom: 0
}]
}, {
type: "bi.absolute",
items: [{
el: self.right,
left: 0,
right: this.constants.offset,
top: 0,
bottom: 0
}]
}]
});
BI.createWidget({
type: "bi.horizontal_auto",
element: this,
items: [
self.label
]
});
},
_createCombo: function (v) {
var self = this, o = this.options;
var combo = BI.createWidget({
type: "bi.dynamic_year_month_combo",
behaviors: o.behaviors,
value: v,
listeners: [{
eventName: BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW);
}
}]
});
combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR, function () {
self._clearTitle();
BI.Bubbles.hide("error");
self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.YearMonthInterval.EVENT_ERROR);
});
combo.on(BI.DynamicYearMonthCombo.EVENT_VALID, function () {
self._checkValid();
});
combo.on(BI.DynamicYearMonthCombo.EVENT_FOCUS, function () {
self._checkValid();
});
combo.on(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW, function () {
self.left.hideView();
self.right.hideView();
});
combo.on(BI.DynamicYearMonthCombo.EVENT_CONFIRM, function () {
BI.Bubbles.hide("error");
var smallDate = self.left.getKey(), bigDate = self.right.getKey();
if (self.left.isValid() && self.right.isValid() && self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) {
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text"));
self.element.addClass(self.constants.timeErrorCls);
self.fireEvent(BI.YearMonthInterval.EVENT_ERROR);
}else{
self._clearTitle();
self.element.removeClass(self.constants.timeErrorCls);
self.fireEvent(BI.YearMonthInterval.EVENT_CHANGE);
}
});
return combo;
},
_dateCheck: function (date) {
return BI.print(BI.parseDateTime(date, "%Y-%x"), "%Y-%x") === date || BI.print(BI.parseDateTime(date, "%Y-%X"), "%Y-%X") === date;
},
// 判是否在最大最小之间
_checkVoid: function (obj) {
var o = this.options;
return !BI.checkDateVoid(obj.year, obj.month, 1, o.minDate, o.maxDate)[0];
},
// 判格式合法
_check: function (smallDate, bigDate) {
var smallObj = smallDate.match(/\d+/g), bigObj = bigDate.match(/\d+/g);
var smallDate4Check = "";
if (BI.isNotNull(smallObj)) {
smallDate4Check = (smallObj[0] || "") + "-" + (smallObj[1] || 1);
}
var bigDate4Check = "";
if (BI.isNotNull(bigObj)) {
bigDate4Check = (bigObj[0] || "") + "-" + (bigObj[1] || 1);
}
return this._dateCheck(smallDate4Check) && BI.checkDateLegal(smallDate4Check) && this._checkVoid({
year: smallObj[0],
month: smallObj[1] || 1,
day: 1
}) && this._dateCheck(bigDate4Check) && BI.checkDateLegal(bigDate4Check) && this._checkVoid({
year: bigObj[0],
month: bigObj[1] || 1,
day: 1
});
},
_compare: function (smallDate, bigDate) {
smallDate = BI.print(BI.parseDateTime(smallDate, "%Y-%X"), "%Y-%X");
bigDate = BI.print(BI.parseDateTime(bigDate, "%Y-%X"), "%Y-%X");
return BI.isNotNull(smallDate) && BI.isNotNull(bigDate) && smallDate > bigDate;
},
_setTitle: function (v) {
this.setTitle(v);
},
_clearTitle: function () {
this.setTitle("");
},
_checkValid: function () {
var self = this;
BI.Bubbles.hide("error");
var smallDate = self.left.getKey(), bigDate = self.right.getKey();
if (self.left.isValid() && self.right.isValid() && self._check(smallDate, bigDate) && self._compare(smallDate, bigDate)) {
self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text"));
self.element.addClass(self.constants.timeErrorCls);
BI.Bubbles.show("error", BI.i18nText("BI-Time_Interval_Error_Text"), self, {
offsetStyle: "center"
});
self.fireEvent(BI.YearMonthInterval.EVENT_ERROR);
} else {
self._clearTitle();
self.element.removeClass(self.constants.timeErrorCls);
}
},
setValue: function (date) {
date = date || {};
this.left.setValue(date.start);
this.right.setValue(date.end);
this._checkValid();
},
getValue: function () {
return {start: this.left.getValue(), end: this.right.getValue()};
}
});
BI.YearMonthInterval.EVENT_VALID = "EVENT_VALID";
BI.YearMonthInterval.EVENT_ERROR = "EVENT_ERROR";
BI.YearMonthInterval.EVENT_CHANGE = "EVENT_CHANGE";
BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.year_month_interval", BI.YearMonthInterval);
/***/ }),
/* 664 */
/***/ (function(module, exports) {
/**
* 年季度展示面板
*
* Created by GUY on 2015/9/2.
* @class BI.YearCard
* @extends BI.Trigger
*/
BI.DynamicYearQuarterCard = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-month-card"
},
render: function () {
var self = this;
return {
type: "bi.vertical",
items: [{
type: "bi.label",
text: BI.i18nText("BI-Multi_Date_Relative_Current_Time"),
textAlign: "left",
height: 24
}, {
type: "bi.dynamic_date_param_item",
ref: function () {
self.year = this;
},
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self.fireEvent("EVENT_CHANGE");
}
}]
}, {
type: "bi.dynamic_date_param_item",
dateType: BI.DynamicDateCard.TYPE.QUARTER,
ref: function () {
self.quarter = this;
},
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self.fireEvent("EVENT_CHANGE");
}
}]
}],
vgap: 10,
hgap: 10
};
},
_createValue: function (type, v) {
return {
dateType: type,
value: Math.abs(v),
offset: v > 0 ? 1 : 0
};
},
setValue: function (v) {
v = v || {year: 0, month: 0};
this.year.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR, v.year));
this.quarter.setValue(this._createValue(BI.DynamicDateCard.TYPE.QUARTER, v.quarter));
},
getValue: function () {
var year = this.year.getValue();
var quarter = this.quarter.getValue();
return {
year: (year.offset === 0 ? -year.value : year.value),
quarter: (quarter.offset === 0 ? -quarter.value : quarter.value)
};
}
});
BI.DynamicYearQuarterCard.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.dynamic_year_quarter_card", BI.DynamicYearQuarterCard);
/***/ }),
/* 665 */
/***/ (function(module, exports) {
BI.StaticYearQuarterCard = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-static-year-quarter-card",
behaviors: {}
},
_createQuarter: function () {
var items = [{
text: BI.Date._QN[1],
value: 1
}, {
text: BI.Date._QN[2],
value: 2
}, {
text: BI.Date._QN[3],
value: 3
}, {
text: BI.Date._QN[4],
value: 4
}];
return BI.map(items, function (j, item) {
return BI.extend(item, {
type: "bi.text_item",
cls: "bi-list-item-select",
textAlign: "center",
whiteSpace: "nowrap",
once: false,
forceSelected: true,
height: 24
});
});
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.vertical",
items: [{
type: "bi.year_picker",
ref: function () {
self.yearPicker = this;
},
behaviors: o.behaviors,
height: 30,
listeners: [{
eventName: BI.YearPicker.EVENT_CHANGE,
action: function () {
var value = this.getValue();
self.setValue({
year: value,
quarter: self.selectedQuarter
});
}
}]
}, {
type: "bi.button_group",
behaviors: o.behaviors,
ref: function () {
self.quarter = this;
},
items: this._createQuarter(),
layouts: [{
type: "bi.vertical",
vgap: 10
}],
value: o.value,
listeners: [{
eventName: BI.ButtonGroup.EVENT_CHANGE,
action: function () {
self.selectedYear = self.yearPicker.getValue();
self.selectedQuarter = this.getValue()[0];
self.fireEvent(BI.StaticYearQuarterCard.EVENT_CHANGE);
}
}]
}]
};
},
getValue: function () {
return {
year: this.selectedYear,
quarter: this.selectedQuarter
};
},
setValue: function (obj) {
var o = this.options;
var newObj = {};
newObj.year = obj.year || 0;
newObj.quarter = obj.quarter || 0;
if (newObj.quarter === 0 || newObj.year === 0 || BI.checkDateVoid(newObj.year, newObj.quarter, 1, o.min, o.max)[0]) {
var year = newObj.year || BI.getDate().getFullYear();
this.selectedYear = year;
this.selectedQuarter = "";
this.yearPicker.setValue(year);
this.quarter.setValue();
} else {
this.selectedYear = BI.parseInt(newObj.year);
this.selectedQuarter = BI.parseInt(newObj.quarter);
this.yearPicker.setValue(this.selectedYear);
this.quarter.setValue(this.selectedQuarter);
}
}
});
BI.StaticYearQuarterCard.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.static_year_quarter_card", BI.StaticYearQuarterCard);
/***/ }),
/* 666 */
/***/ (function(module, exports) {
BI.DynamicYearQuarterCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-year-quarter-combo bi-border bi-border-radius bi-focus-shadow",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 22
},
_init: function () {
BI.DynamicYearQuarterCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value;
self.storeTriggerValue = "";
this.trigger = BI.createWidget({
type: "bi.dynamic_year_quarter_trigger",
min: o.min,
max: o.max,
height: o.height,
value: o.value || ""
});
this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN, function () {
self.combo.isViewVisible() && self.combo.hideView();
});
this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_START, function () {
self.combo.isViewVisible() && self.combo.hideView();
});
this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_STOP, function () {
self.combo.showView();
});
this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_ERROR, function () {
self.combo.isViewVisible() && self.combo.hideView();
});
this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM, function () {
// 没看出来干啥的,先去掉
// if (self.combo.isViewVisible()) {
// return;
// }
var dateStore = self.storeTriggerValue;
var dateObj = self.trigger.getKey();
if (BI.isNotEmptyString(dateObj) && !BI.isEqual(dateObj, dateStore)) {
self.storeValue = self.trigger.getValue();
self.setValue(self.trigger.getValue());
}
self._checkDynamicValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
});
this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_FOCUS, function () {
self.storeTriggerValue = self.trigger.getKey();
});
this.combo = BI.createWidget({
type: "bi.combo",
container: o.container,
isNeedAdjustHeight: false,
isNeedAdjustWidth: false,
el: this.trigger,
popup: {
minWidth: 85,
stopPropagation: false,
el: {
type: "bi.dynamic_year_quarter_popup",
ref: function () {
self.popup = this;
},
listeners: [{
eventName: BI.DynamicYearQuarterPopup.EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE,
action: function () {
self.setValue();
self.combo.hideView();
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE,
action: function () {
var date = BI.getDate();
self.setValue({type: BI.DynamicYearMonthCombo.Static, value: {year: date.getFullYear(), quarter: BI.getQuarter(date)}});
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE,
action: function () {
self.setValue(self.popup.getValue());
self.combo.hideView();
self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM);
}
}],
behaviors: o.behaviors,
min: o.min,
max: o.max
},
value: o.value || ""
}
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
self.popup.setValue(self.storeValue);
self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW);
});
BI.createWidget({
type: "bi.htape",
element: this,
ref: function () {
self.comboWrapper = this;
},
items: [{
el: {
type: "bi.icon_button",
cls: "bi-trigger-icon-button date-change-h-font",
width: 24,
height: 24,
ref: function () {
self.changeIcon = this;
}
},
width: 24
}, this.combo]
});
this._checkDynamicValue(o.value);
},
_checkDynamicValue: function (v) {
var type = null;
if (BI.isNotNull(v)) {
type = v.type;
}
switch (type) {
case BI.DynamicYearQuarterCombo.Dynamic:
this.changeIcon.setVisible(true);
this.comboWrapper.attr("items")[0].width = 24;
this.comboWrapper.resize();
break;
default:
this.comboWrapper.attr("items")[0].width = 0;
this.comboWrapper.resize();
this.changeIcon.setVisible(false);
break;
}
},
setValue: function (v) {
this.storeValue = v;
this.trigger.setValue(v);
this._checkDynamicValue(v);
},
getValue: function () {
return this.storeValue;
}
});
BI.DynamicYearQuarterCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.dynamic_year_quarter_combo", BI.DynamicYearQuarterCombo);
BI.extend(BI.DynamicYearQuarterCombo, {
Static: 1,
Dynamic: 2
});
/***/ }),
/* 667 */
/***/ (function(module, exports) {
BI.DynamicYearQuarterPopup = BI.inherit(BI.Widget, {
constants: {
tabHeight: 30,
buttonHeight: 24
},
props: {
baseCls: "bi-year-quarter-popup",
behaviors: {},
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期,
width: 180,
height: 240
},
render: function () {
var self = this, opts = this.options, c = this.constants;
this.storeValue = {type: BI.DynamicYearQuarterCombo.Static};
return {
type: "bi.vtape",
items: [{
el: this._getTabJson()
}, {
el: {
type: "bi.grid",
items: [[{
type: "bi.text_button",
cls: "bi-split-top bi-high-light",
shadow: true,
textHeight: c.buttonHeight - 1,
text: BI.i18nText("BI-Basic_Clear"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
cls: "bi-split-left bi-split-right bi-high-light bi-split-top",
textHeight: c.buttonHeight - 1,
shadow: true,
text: BI.i18nText("BI-Basic_Current_Quarter"),
ref: function () {
self.textButton = this;
},
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE);
}
}]
}, {
type: "bi.text_button",
cls: "bi-split-top bi-high-light",
shadow: true,
textHeight: c.buttonHeight - 1,
text: BI.i18nText("BI-Basic_OK"),
listeners: [{
eventName: BI.TextButton.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE);
}
}]
}]]
},
height: 24
}]
};
},
_setInnerValue: function () {
if (this.dateTab.getSelect() === BI.DynamicYearQuarterCombo.Static) {
this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter"));
this.textButton.setEnable(true);
} else {
var date = BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());
date = BI.print(date, "%Y-%Q");
this.textButton.setValue(date);
this.textButton.setEnable(false);
}
},
_getTabJson: function () {
var self = this, o = this.options;
return {
type: "bi.tab",
ref: function () {
self.dateTab = this;
},
tab: {
type: "bi.linear_segment",
cls: "bi-split-bottom",
height: this.constants.tabHeight,
items: BI.createItems([{
text: BI.i18nText("BI-Basic_Year_Quarter"),
value: BI.DynamicYearQuarterCombo.Static
}, {
text: BI.i18nText("BI-Basic_Dynamic_Title"),
value: BI.DynamicYearQuarterCombo.Dynamic
}], {
textAlign: "center"
})
},
cardCreator: function (v) {
switch (v) {
case BI.DynamicYearQuarterCombo.Dynamic:
return {
type: "bi.dynamic_year_quarter_card",
listeners: [{
eventName: "EVENT_CHANGE",
action: function () {
self._setInnerValue(self.year, v);
}
}],
ref: function () {
self.dynamicPane = this;
}
};
case BI.DynamicYearQuarterCombo.Static:
default:
return {
type: "bi.static_year_quarter_card",
behaviors: o.behaviors,
min: self.options.min,
max: self.options.max,
listeners: [{
eventName: BI.DynamicYearCard.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.DynamicYearQuarterPopup.EVENT_CHANGE);
}
}],
ref: function () {
self.year = this;
}
};
}
},
listeners: [{
eventName: BI.Tab.EVENT_CHANGE,
action: function () {
var v = self.dateTab.getSelect();
switch (v) {
case BI.DynamicYearQuarterCombo.Static:
var date = BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());
self.year.setValue({year: date.getFullYear(), quarter: BI.getQuarter(date)});
self._setInnerValue();
break;
case BI.DynamicYearQuarterCombo.Dynamic:
default:
if(self.storeValue && self.storeValue.type === BI.DynamicYearQuarterCombo.Dynamic) {
self.dynamicPane.setValue(self.storeValue.value);
}else{
self.dynamicPane.setValue({
year: 0
});
}
self._setInnerValue();
break;
}
}
}]
};
},
setValue: function (v) {
this.storeValue = v;
var self = this;
var type, value;
v = v || {};
type = v.type || BI.DynamicDateCombo.Static;
value = v.value || v;
this.dateTab.setSelect(type);
switch (type) {
case BI.DynamicDateCombo.Dynamic:
this.dynamicPane.setValue(value);
self._setInnerValue();
break;
case BI.DynamicDateCombo.Static:
default:
this.year.setValue(value);
this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter"));
this.textButton.setEnable(true);
break;
}
},
getValue: function () {
return {
type: this.dateTab.getSelect(),
value: this.dateTab.getValue()
};
}
});
BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE = "BUTTON_CLEAR_EVENT_CHANGE";
BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE = "BUTTON_lABEL_EVENT_CHANGE";
BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE = "BUTTON_OK_EVENT_CHANGE";
BI.DynamicYearQuarterPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.dynamic_year_quarter_popup", BI.DynamicYearQuarterPopup);
/***/ }),
/* 668 */
/***/ (function(module, exports) {
BI.DynamicYearQuarterTrigger = BI.inherit(BI.Trigger, {
_const: {
hgap: 4,
vgap: 2
},
props: {
extraCls: "bi-year-quarter-trigger",
min: "1900-01-01", // 最小日期
max: "2099-12-31", // 最大日期
height: 22
},
_init: function () {
BI.DynamicYearQuarterTrigger.superclass._init.apply(this, arguments);
var o = this.options;
this.yearEditor = this._createEditor(true);
this.quarterEditor = this._createEditor(false);
BI.createWidget({
element: this,
type: "bi.htape",
items: [{
type: "bi.center",
items: [{
type: "bi.htape",
items: [this.yearEditor, {
el: {
type: "bi.text_button",
text: BI.i18nText("BI-Multi_Date_Year"),
width: o.height
},
width: o.height
}]
}, {
type: "bi.htape",
items: [this.quarterEditor, {
el: {
type: "bi.text_button",
text: BI.i18nText("BI-Multi_Date_Quarter"),
width: 24
},
width: 24}]
}]
}, {
el: {
type: "bi.trigger_icon_button",
width: o.height
},
width: o.height
}]
});
this.setValue(o.value);
},
_createEditor: function (isYear) {
var self = this, o = this.options, c = this._const;
var editor = BI.createWidget({
type: "bi.sign_editor",
height: o.height,
validationChecker: function (v) {
if(isYear) {
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
}
return v === "" || ((BI.isPositiveInteger(v) && v >= 1 && v <= 4) && !BI.checkDateVoid(BI.getDate().getFullYear(), v, 1, o.min, o.max)[0]);
},
quitChecker: function () {
return false;
},
errorText: function (v) {
return BI.i18nText("BI-Year_Trigger_Invalid_Text");
},
watermark: BI.i18nText("BI-Basic_Unrestricted"),
hgap: c.hgap,
vgap: c.vgap,
title: "",
allowBlank: true
});
editor.on(BI.SignEditor.EVENT_KEY_DOWN, function () {
self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN);
});
editor.on(BI.SignEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_FOCUS);
});
editor.on(BI.SignEditor.EVENT_STOP, function () {
self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_STOP);
});
editor.on(BI.SignEditor.EVENT_CONFIRM, function () {
self._doEditorConfirm(editor);
self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM);
});
editor.on(BI.SignEditor.EVENT_SPACE, function () {
if (editor.isValid()) {
editor.blur();
}
});
editor.on(BI.SignEditor.EVENT_START, function () {
self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_START);
});
editor.on(BI.SignEditor.EVENT_ERROR, function () {
self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_ERROR);
});
editor.on(BI.SignEditor.EVENT_CHANGE, function () {
if(isYear) {
self._autoSwitch(editor);
}
});
return editor;
},
_doEditorConfirm: function (editor) {
var value = editor.getValue();
if (BI.isNotNull(value)) {
editor.setValue(value);
}
var quarterValue = this.quarterEditor.getValue();
this.storeValue = {
type: BI.DynamicYearQuarterCombo.Static,
value: {
year: this.yearEditor.getValue(),
quarter: BI.isEmptyString(this.quarterEditor.getValue()) ? "" : quarterValue
}
};
this.setTitle(this._getStaticTitle(this.storeValue.value));
},
_yearCheck: function (v) {
var date = BI.print(BI.parseDateTime(v, "%Y-%X-%d"), "%Y-%X-%d");
return BI.print(BI.parseDateTime(v, "%Y"), "%Y") === v && date >= this.options.min && date <= this.options.max;
},
_autoSwitch: function (editor) {
var v = editor.getValue();
if (BI.isNotEmptyString(v) && BI.checkDateLegal(v)) {
if (v.length === 4 && this._yearCheck(v)) {
this._doEditorConfirm(editor);
this.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM);
this.quarterEditor.focus();
}
}
},
_getStaticTitle: function (value) {
value = value || {};
var hasYear = !(BI.isNull(value.year) || BI.isEmptyString(value.year));
var hasMonth = !(BI.isNull(value.quarter) || BI.isEmptyString(value.quarter));
switch ((hasYear << 1) | hasMonth) {
// !hasYear && !hasMonth
case 0:
return "";
// !hasYear && hasMonth
case 1:
return value.quarter;
// hasYear && !hasMonth
case 2:
return value.year;
// hasYear && hasMonth
case 3:
default:
return value.year + "-" + value.quarter;
}
},
_getText: function (obj) {
var value = "";
if(BI.isNotNull(obj.year) && BI.parseInt(obj.year) !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
if(BI.isNotNull(obj.quarter) && BI.parseInt(obj.quarter) !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;
},
_setInnerValue: function (date, text) {
var dateStr = BI.print(date, "%Y-%Q");
this.yearEditor.setValue(date.getFullYear());
this.quarterEditor.setValue(BI.getQuarter(date));
this.setTitle(BI.isEmptyString(text) ? dateStr : (text + ":" + dateStr));
},
setValue: function (v) {
var type, value;
var date = BI.getDate();
this.storeValue = v;
if (BI.isNotNull(v)) {
type = v.type || BI.DynamicYearQuarterCombo.Static;
value = v.value || v;
}
switch (type) {
case BI.DynamicYearQuarterCombo.Dynamic:
var text = this._getText(value);
date = BI.DynamicDateHelper.getCalculation(value);
this._setInnerValue(date, text);
break;
case BI.DynamicYearQuarterCombo.Static:
default:
value = value || {};
var quarter = BI.isNull(value.quarter) ? null : value.quarter;
this.yearEditor.setValue(value.year);
this.yearEditor.setTitle(value.year);
this.quarterEditor.setValue(quarter);
this.quarterEditor.setTitle(quarter);
this.setTitle(this._getStaticTitle(value));
break;
}
},
getValue: function () {
return this.storeValue;
},
getKey: function () {
return this.yearEditor.getValue() + "-" + this.quarterEditor.getValue();
}
});
BI.DynamicYearQuarterTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.DynamicYearQuarterTrigger.EVENT_ERROR = "EVENT_ERROR";
BI.DynamicYearQuarterTrigger.EVENT_START = "EVENT_START";
BI.DynamicYearQuarterTrigger.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.DynamicYearQuarterTrigger.EVENT_STOP = "EVENT_STOP";
BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN";
BI.shortcut("bi.dynamic_year_quarter_trigger", BI.DynamicYearQuarterTrigger);
/***/ }),
/* 669 */
/***/ (function(module, exports) {
/**
* 简单的复选下拉框控件, 适用于数据量少的情况, 与valuechooser的区别是allvaluechooser setValue和getValue返回的是所有值
* 封装了字段处理逻辑
*
* Created by GUY on 2015/10/29.
* @class BI.AbstractAllValueChooser
* @extends BI.Widget
*/
BI.AbstractAllValueChooser = BI.inherit(BI.Widget, {
_const: {
perPage: 100
},
_defaultConfig: function () {
return BI.extend(BI.AbstractAllValueChooser.superclass._defaultConfig.apply(this, arguments), {
width: 200,
height: 30,
items: null,
itemsCreator: BI.emptyFn,
cache: true
});
},
_valueFormatter: function (v) {
var text = v;
if (BI.isNotNull(this.items)) {
BI.some(this.items, function (i, item) {
// 把value都换成字符串
// 需要考虑到value也可能是数字
if (item.value === v || item.value + "" === v) {
text = item.text;
return true;
}
});
}
return text;
},
_itemsCreator: function (options, callback) {
var self = this, o = this.options;
if (!o.cache || !this.items) {
o.itemsCreator({}, function (items) {
self.items = items;
call(items);
});
} else {
call(this.items);
}
function call (items) {
var keywords = (options.keywords || []).slice();
if (options.keyword) {
keywords.push(options.keyword);
}
var resultItems = items;
if(BI.isNotEmptyArray(keywords)) {
resultItems = [];
BI.each(keywords, function (i, kw) {
var search = BI.Func.getSearchResult(items, kw);
resultItems = resultItems.concat(search.match).concat(search.find);
});
resultItems = BI.uniq(resultItems);
}
if (options.selectedValues) {// 过滤
var filter = BI.makeObject(options.selectedValues, true);
resultItems = BI.filter(resultItems, function (i, ob) {
return !filter[ob.value];
});
}
if (options.type === BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: resultItems
});
return;
}
if (options.type === BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: resultItems.length});
return;
}
callback({
items: resultItems,
hasNext: false
});
}
}
});
/***/ }),
/* 670 */
/***/ (function(module, exports) {
/**
* 简单的复选下拉框控件, 适用于数据量少的情况, 与valuechooser的区别是allvaluechooser setValue和getValue返回的是所有值
* 封装了字段处理逻辑
*
* Created by GUY on 2015/10/29.
* @class BI.AllValueChooserCombo
* @extends BI.AbstractAllValueChooser
*/
BI.AllValueChooserCombo = BI.inherit(BI.AbstractAllValueChooser, {
_defaultConfig: function () {
return BI.extend(BI.AllValueChooserCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-all-value-chooser-combo",
width: 200,
height: 24,
items: null,
itemsCreator: BI.emptyFn,
cache: true
});
},
_init: function () {
BI.AllValueChooserCombo.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_combo",
text: o.text,
element: this,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height,
value: {
type: BI.Selection.Multi,
value: o.value || []
}
});
this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {
self.fireEvent(BI.AllValueChooserCombo.EVENT_CONFIRM);
});
},
setValue: function (v) {
this.combo.setValue({
type: BI.Selection.Multi,
value: v || []
});
},
getValue: function () {
var val = this.combo.getValue() || {};
if (val.type === BI.Selection.All) {
return val.assist;
}
return val.value || [];
},
populate: function (items) {
// 直接用combo的populate不会作用到AbstractValueChooser上
this.items = items;
this.combo.populate.apply(this.combo, arguments);
}
});
BI.AllValueChooserCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.all_value_chooser_combo", BI.AllValueChooserCombo);
/***/ }),
/* 671 */
/***/ (function(module, exports) {
/**
* 简单的复选面板, 适用于数据量少的情况, 与valuechooser的区别是allvaluechooser setValue和getValue返回的是所有值
* 封装了字段处理逻辑
*
* Created by GUY on 2015/10/29.
* @class BI.AllValueChooserPane
* @extends BI.AbstractAllValueChooser
*/
BI.AllValueChooserPane = BI.inherit(BI.AbstractAllValueChooser, {
_defaultConfig: function () {
return BI.extend(BI.AllValueChooserPane.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-all-value-chooser-pane",
width: 200,
height: 30,
items: null,
itemsCreator: BI.emptyFn,
cache: true
});
},
_init: function () {
BI.AllValueChooserPane.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (BI.isNotNull(o.items)) {
this.items = o.items;
}
this.list = BI.createWidget({
type: "bi.multi_select_list",
element: this,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height
});
this.list.on(BI.MultiSelectList.EVENT_CHANGE, function () {
self.fireEvent(BI.AllValueChooserPane.EVENT_CHANGE);
});
},
setValue: function (v) {
this.list.setValue({
type: BI.Selection.Multi,
value: v || []
});
},
getValue: function () {
var val = this.list.getValue() || {};
if (val.type === BI.Selection.All) {
return val.assist;
}
return val.value || [];
},
populate: function (items) {
// 直接用combo的populate不会作用到AbstractValueChooser上
this.items = items;
this.list.populate.apply(this.list, arguments);
}
});
BI.AllValueChooserPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.all_value_chooser_pane", BI.AllValueChooserPane);
/***/ }),
/* 672 */
/***/ (function(module, exports) {
BI.AllValueMultiTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-all-value-multi-text-value-combo",
width: 200,
height: 24,
items: []
},
render: function () {
var self = this, o = this.options;
var value = this._digestValue(o.value);
return {
type: "bi.search_multi_text_value_combo",
text: o.text,
height: o.height,
items: o.items,
value: value,
numOfPage: 100,
valueFormatter: o.valueFormatter,
warningTitle: o.warningTitle,
listeners: [{
eventName: BI.SearchMultiTextValueCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.AllValueMultiTextValueCombo.EVENT_CONFIRM);
}
}],
ref: function () {
self.combo = this;
}
};
},
setValue: function (v) {
var value = this._digestValue(v);
this.combo.setValue(value);
},
getValue: function () {
var obj = this.combo.getValue() || {};
obj.value = obj.value || [];
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(obj.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value || [];
},
populate: function (items) {
this.options.items = items;
this.combo.populate.apply(this.combo, arguments);
},
_digestValue: function (v) {
return {
type: BI.Selection.Multi,
value: v || []
};
}
});
BI.AllValueMultiTextValueCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.all_value_multi_text_value_combo", BI.AllValueMultiTextValueCombo);
/***/ }),
/* 673 */
/***/ (function(module, exports) {
BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
_const: {
perPage: 100
},
_defaultConfig: function () {
return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this, arguments), {
items: null,
itemsCreator: BI.emptyFn,
open: false
});
},
_valueFormatter: function (v) {
var text = v;
if (BI.isNotNull(this.items)) {
BI.some(this.items, function (i, item) {
if (item.value === v || item.value + "" === v) {
text = item.text;
return true;
}
});
}
return text;
},
_initData: function (items) {
this.items = items;
var nodes = BI.Tree.treeFormat(items);
this.tree = new BI.Tree();
this.tree.initTree(nodes);
},
_itemsCreator: function (options, callback) {
var self = this, o = this.options;
if (!this.items) {
o.itemsCreator({}, function (items) {
self._initData(items);
call();
});
} else {
call();
}
function call() {
switch (options.type) {
case BI.TreeView.REQ_TYPE_INIT_DATA:
self._reqInitTreeNode(options, callback);
break;
case BI.TreeView.REQ_TYPE_ADJUST_DATA:
self._reqAdjustTreeNode(options, callback);
break;
case BI.TreeView.REQ_TYPE_SELECT_DATA:
self._reqSelectedTreeNode(options, callback);
break;
case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:
self._reqDisplayTreeNode(options, callback);
break;
default :
self._reqTreeNode(options, callback);
break;
}
}
},
_reqDisplayTreeNode: function (op, callback) {
var self = this;
var result = [];
var selectedValues = op.selectedValues;
if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({});
return;
}
doCheck([], this.tree.getRoot(), selectedValues);
callback({
items: result
});
function doCheck(parentValues, node, selected) {
if (selected == null || BI.isEmpty(selected)) {
BI.each(node.getChildren(), function (i, child) {
var newParents = BI.clone(parentValues);
newParents.push(child.value);
var llen = self._getChildCount(newParents);
createOneJson(child, node.id, llen);
doCheck(newParents, child, {});
});
return;
}
BI.each(selected, function (k) {
var node = self._getTreeNode(parentValues, k);
// 找不到就是新增值
if(BI.isNull(node)) {
createOneJson({
id: BI.UUID(),
text: k,
value: k
}, BI.UUID(), 0);
} else {
var newParents = BI.clone(parentValues);
newParents.push(node.value);
createOneJson(node, node.parent && node.parent.id, getCount(selected[k], newParents));
doCheck(newParents, node, selected[k]);
}
});
}
function getCount(jo, parentValues) {
if (jo == null) {
return 0;
}
if (BI.isEmpty(jo)) {
return self._getChildCount(parentValues);
}
return BI.size(jo);
}
function createOneJson(node, pId, llen) {
result.push({
id: node.id,
pId: pId,
text: node.text + (llen > 0 ? ("(" + BI.i18nText("BI-Basic_Altogether") + llen + BI.i18nText("BI-Basic_Count") + ")") : ""),
value: node.value,
open: true
});
}
},
_reqSelectedTreeNode: function (op, callback) {
var self = this;
var selectedValues = BI.deepClone(op.selectedValues);
var notSelectedValue = op.notSelectedValue || {};
var keyword = op.keyword || "";
var parentValues = op.parentValues || [];
if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({});
return;
}
dealWithSelectedValues(selectedValues);
callback(selectedValues);
function dealWithSelectedValues(selectedValues) {
var p = parentValues.concat(notSelectedValue);
// 存储的值中存在这个值就把它删掉
// 例如选中了中国-江苏-南京, 取消中国或江苏或南京
// p长度不大于selectedValues的情况才可能找到,这样可以直接删除selectedValues的节点
if (canFindKey(selectedValues, p)) {
// 如果搜索的值在父亲链中
if (isSearchValueInParent(p)) {
// 例如选中了 中国-江苏, 搜索江苏, 取消江苏(干掉了江苏)
self._deleteNode(selectedValues, p);
} else {
var searched = [];
// 要找到所有以notSelectedValue为叶子节点的链路
var find = search(parentValues, notSelectedValue, [], searched);
if (find && BI.isNotEmptyArray(searched)) {
BI.each(searched, function (i, arr) {
var node = self._getNode(selectedValues, arr);
if (node) {
// 例如选中了 中国-江苏, 搜索江苏, 取消中国(实际上只想删除中国-江苏,因为搜的是江苏)
// 例如选中了 中国-江苏-南京,搜索南京,取消中国(实际上只想删除中国-江苏-南京,因为搜的是南京)
self._deleteNode(selectedValues, arr);
} else {
// 例如选中了 中国-江苏,搜索南京,取消中国(实际上只想删除中国-江苏-南京,因为搜的是南京)
expandSelectedValue(selectedValues, arr, BI.last(arr));
}
});
}
}
}
// 存储的值中不存在这个值,但父亲节点是全选的情况
// 例如选中了中国-江苏,取消南京
// important 选中了中国-江苏,取消了江苏,但是搜索的是南京
if (isChild(selectedValues, p)) {
var result = [], find = false;
// 如果parentValues中有匹配的值,说明搜索结果不在当前值下
if (isSearchValueInParent(p)) {
find = true;
} else {
// 从当前值开始搜
find = search(parentValues, notSelectedValue, result);
p = parentValues;
}
if (find === true) {
// 去掉点击的节点之后的结果集
expandSelectedValue(selectedValues, p, notSelectedValue);
// 添加去掉搜索的结果集
if (result.length > 0) {
BI.each(result, function (i, strs) {
self._buildTree(selectedValues, strs);
});
}
}
}
}
function expandSelectedValue(selectedValues, parents, notSelectedValue) {
var next = selectedValues;
var childrenCount = [];
var path = [];
// 去掉点击的节点之后的结果集
BI.some(parents, function (i, v) {
var t = next[v];
if (t == null) {
if (i === 0) {
return true;
}
if (BI.isEmpty(next)) {
var split = parents.slice(0, i);
var expanded = self._getChildren(split);
path.push(split);
childrenCount.push(expanded.length);
// 如果只有一个值且取消的就是这个值
if (i === parents.length - 1 && expanded.length === 1 && expanded[0].value === notSelectedValue) {
for (var j = childrenCount.length - 1; j >= 0; j--) {
if (childrenCount[j] === 1) {
self._deleteNode(selectedValues, path[j]);
} else {
break;
}
}
} else {
BI.each(expanded, function (m, child) {
if (i === parents.length - 1 && child.value === notSelectedValue) {
return true;
}
next[child.value] = {};
});
}
next = next[v];
} else {
return true;
// next = {};
// next[v] = {};
}
} else {
next = t;
}
});
}
function search(parents, current, result, searched) {
var newParents = BI.clone(parents);
newParents.push(current);
if (self._isMatch(parents, current, keyword)) {
searched && searched.push(newParents);
return true;
}
var children = self._getChildren(newParents);
var notSearch = [];
var can = false;
BI.each(children, function (i, child) {
if (search(newParents, child.value, result, searched)) {
can = true;
} else {
notSearch.push(child.value);
}
});
if (can === true) {
BI.each(notSearch, function (i, v) {
var next = BI.clone(newParents);
next.push(v);
result.push(next);
});
}
return can;
}
function isSearchValueInParent(parentValues) {
for (var i = 0, len = parentValues.length; i < len; i++) {
if (self._isMatch(parentValues.slice(0, i), parentValues[i], keyword)) {
return true;
}
}
return false;
}
function canFindKey(selectedValues, parents) {
var t = selectedValues;
for (var i = 0; i < parents.length; i++) {
var v = parents[i];
t = t[v];
if (t == null) {
return false;
}
}
return true;
}
function isChild(selectedValues, parents) {
var t = selectedValues;
for (var i = 0; i < parents.length; i++) {
var v = parents[i];
if (!BI.has(t, v)) {
return false;
}
t = t[v];
if (BI.isEmpty(t)) {
return true;
}
}
return false;
}
},
_reqAdjustTreeNode: function (op, callback) {
var self = this;
var result = [];
var selectedValues = op.selectedValues;
if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({});
return;
}
BI.each(selectedValues, function (k, v) {
result.push([k]);
});
dealWithSelectedValues(selectedValues, []);
var jo = {};
BI.each(result, function (i, strs) {
self._buildTree(jo, strs);
});
callback(jo);
function dealWithSelectedValues(selected, parents) {
if (selected == null || BI.isEmpty(selected)) {
return true;
}
var can = true;
BI.each(selected, function (k, v) {
var p = BI.clone(parents);
p.push(k);
if (!dealWithSelectedValues(selected[k], p)) {
BI.each(selected[k], function (nk, nv) {
var t = BI.clone(p);
t.push(nk);
result.push(t);
});
can = false;
}
});
return can && isAllSelected(selected, parents);
}
function isAllSelected(selected, parents) {
return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected);
}
},
_reqInitTreeNode: function (op, callback) {
var self = this;
var result = [];
var keyword = op.keyword || "";
var selectedValues = op.selectedValues;
var lastSearchValue = op.lastSearchValue || ""; // 一次请求100个,但是搜索是拿全部的,lastSearchValue是上一次遍历到的节点索引
var output = search();
BI.nextTick(function () {
callback({
hasNext: output.length > self._const.perPage,
items: result,
lastSearchValue: BI.last(output)
});
});
function search() {
var children = self._getChildren([]);
var start = children.length;
if (lastSearchValue !== "") {
for (var j = 0, len = start; j < len; j++) {
if (children[j].value === lastSearchValue) {
start = j + 1;
break;
}
}
} else {
start = 0;
}
var output = [];
for (var i = start, len = children.length; i < len; i++) {
if (output.length < self._const.perPage) {
var find = nodeSearch(1, [], children[i].value, false, result);
} else if (output.length === self._const.perPage) {
var find = nodeSearch(1, [], children[i].value, false, []);
}
if (find[0] === true) {
output.push(children[i].value);
}
if (output.length > self._const.perPage) {
break;
}
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
if (op.times === 1) {
var nodes = self._getAddedValueNode([], selectedValues);
result = BI.concat(BI.filter(nodes, function (idx, node) {
var find = BI.Func.getSearchResult([node.text || node.value], keyword);
return find.find.length > 0 || find.match.length > 0;
}), result);
}
return output;
}
function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(parentValues, current, keyword)) {
var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
return [true, checked];
}
var newParents = BI.clone(parentValues);
newParents.push(current);
var children = self._getChildren(newParents);
var can = false, checked = false;
var isCurAllSelected = isAllSelect || isAllSelected(parentValues, current);
BI.each(children, function (i, child) {
var state = nodeSearch(deep + 1, newParents, child.value, isCurAllSelected, result);
// 当前节点的子节点是否选中,并不确定全选还是半选
if (state[1] === true) {
checked = true;
}
// 当前节点的子节点要不要加入到结果集中
if (state[0] === true) {
can = true;
}
});
// 子节点匹配, 补充父节点
if (can === true) {
checked = isCurAllSelected || (isSelected(parentValues, current) && checked);
createOneJson(parentValues, current, true, checked, false, false, result);
}
return [can, checked];
}
function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self._getTreeNode(parentValues, value);
result.push({
id: node.id,
pId: node.pId,
text: node.text,
value: node.value,
title: node.title,
isParent: node.getChildrenLength() > 0,
open: isOpen,
checked: checked,
halfCheck: half,
flag: flag
});
}
function isHalf(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return null;
}
return BI.any(find, function (v, ob) {
if (v === value) {
if (ob != null && !BI.isEmpty(ob)) {
return true;
}
}
});
}
function isAllSelected(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return null;
}
return BI.any(find, function (v, ob) {
if (v === value) {
if (ob != null && BI.isEmpty(ob)) {
return true;
}
}
});
}
function isSelected(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return false;
}
return BI.any(find, function (v) {
if (v === value) {
return true;
}
});
}
function findSelectedObj(parentValues) {
var find = selectedValues;
if (find == null) {
return null;
}
BI.every(parentValues, function (i, v) {
find = find[v];
if (find == null) {
return false;
}
return true;
});
return find;
}
},
_reqTreeNode: function (op, callback) {
var self = this, o = this.options;
var result = [];
var times = op.times;
var checkState = op.checkState || {};
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues || {};
var valueMap = {};
// if (judgeState(parentValues, selectedValues, checkState)) {
valueMap = dealWithSelectedValue(parentValues, selectedValues);
// }
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var state = getCheckState(nodes[i].value, parentValues, valueMap, checkState);
result.push({
id: nodes[i].id,
pId: nodes[i].pId,
value: nodes[i].value,
text: nodes[i].text,
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1],
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var valueMap = dealWithSelectedValue(node.parentValues, selectedValues);
// REPORT-24409 fix: 设置节点全部展开,添加的节点没有给状态
var parentCheckState = {};
var find = BI.find(result, function (idx, pNode) {
return pNode.id === node.pId;
});
if (find) {
parentCheckState.checked = find.halfCheck ? false : find.checked;
parentCheckState.half = find.halfCheck;
}
var state = getCheckState(node.value, node.parentValues, valueMap, parentCheckState);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: state[0],
halfCheck: state[1],
open: self.options.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
if (parentValues.length === 0 && times === 1) {
result = BI.concat(self._getAddedValueNode(parentValues, selectedValues), result);
}
BI.nextTick(function () {
callback({
items: result,
hasNext: nodes.length > times * self._const.perPage
});
});
function judgeState(parentValues, selected_value, checkState) {
var checked = checkState.checked, half = checkState.half;
if (parentValues.length > 0 && !checked) {
return false;
}
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
}
function dealWithSelectedValue(parentValues, selectedValues) {
var valueMap = {};
BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {};
});
BI.each(selectedValues, function (value, obj) {
if (BI.isNull(obj)) {
valueMap[value] = [0, 0];
return;
}
if (BI.isEmpty(obj)) {
valueMap[value] = [2, 0];
return;
}
var nextNames = {};
BI.each(obj, function (t, o) {
if (BI.isNull(o) || BI.isEmpty(o)) {
nextNames[t] = true;
}
});
// valueMap的数组第一个参数为不选: 0, 半选: 1, 全选:2, 第二个参数为改节点下选中的子节点个数(子节点全选或者不存在)
valueMap[value] = [1, BI.size(nextNames)];
});
return valueMap;
}
function getCheckState(current, parentValues, valueMap, checkState) {
// 节点本身的checked和half优先级最高
var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) {
// 可能是半选
if (valueMap[current][0] === 1) {
var values = BI.clone(parentValues);
values.push(current);
var childCount = self._getChildCount(values);
if (childCount > 0 && childCount !== valueMap[current][1]) {
halfCheck = true;
}
} else if (valueMap[current][0] === 2) {
tempCheck = true;
}
}
var check;
// 展开的节点checked为false 且没有明确得出当前子节点是半选或者全选, 则check状态取决于valueMap
if (!checked && !halfCheck && !tempCheck) {
check = BI.has(valueMap, current);
} else {
// 不是上面那种情况就先看在节点没有带有明确半选的时候,通过节点自身的checked和valueMap的状态能都得到选中信息
check = ((tempCheck || checked) && !half) || BI.has(valueMap, current);
}
return [check, halfCheck];
}
},
_getAddedValueNode: function (parentValues, selectedValues) {
var nodes = this._getChildren(parentValues);
return BI.map(BI.difference(BI.keys(selectedValues), BI.map(nodes, "value")), function (idx, v) {
return {
id: BI.UUID(),
pId: nodes.length > 0 ? nodes[0].pId : BI.UUID(),
value: v,
text: v,
times: 1,
isParent: false,
checked: true,
halfCheck: false
};
});
},
_getNode: function (selectedValues, parentValues) {
var pNode = selectedValues;
for (var i = 0, len = parentValues.length; i < len; i++) {
if (pNode == null) {
return null;
}
pNode = pNode[parentValues[i]];
}
return pNode;
},
_deleteNode: function (selectedValues, values) {
var name = values[values.length - 1];
var p = values.slice(0, values.length - 1);
var pNode = this._getNode(selectedValues, p);
if (pNode != null && pNode[name]) {
delete pNode[name];
// 递归删掉空父节点
while (p.length > 0 && BI.isEmpty(pNode)) {
name = p[p.length - 1];
p = p.slice(0, p.length - 1);
pNode = this._getNode(selectedValues, p);
if (pNode != null) {
delete pNode[name];
}
}
}
},
_buildTree: function (jo, values) {
var t = jo;
BI.each(values, function (i, v) {
if (!BI.has(t, v)) {
t[v] = {};
}
t = t[v];
});
},
_isMatch: function (parentValues, value, keyword) {
var o = this.options;
var node = this._getTreeNode(parentValues, value);
if (!node) {
return false;
}
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;
},
_getTreeNode: function (parentValues, v) {
var self = this;
var findParentNode;
var index = 0;
this.tree.traverse(function (node) {
if (self.tree.isRoot(node)) {
return;
}
if (index > parentValues.length) {
return false;
}
if (index === parentValues.length && node.value === v) {
findParentNode = node;
return false;
}
if (node.value === parentValues[index]) {
index++;
return;
}
return true;
});
return findParentNode;
},
_getChildren: function (parentValues) {
if (parentValues.length > 0) {
var value = BI.last(parentValues);
var parent = this._getTreeNode(parentValues.slice(0, parentValues.length - 1), value);
} else {
var parent = this.tree.getRoot();
}
return parent.getChildren();
},
_getAllChildren: function(parentValues) {
var children = this._getChildren(parentValues);
var nodes = [].concat(children);
BI.each(nodes, function (idx, node) {
node.parentValues = parentValues;
});
var queue = BI.map(children, function (idx, node) {
return {
parentValues: parentValues,
value: node.value
};
});
while (BI.isNotEmptyArray(queue)) {
var node = queue.shift();
var pValues = (node.parentValues).concat(node.value);
var childNodes = this._getChildren(pValues);
BI.each(childNodes, function (idx, node) {
node.parentValues = pValues;
});
queue = queue.concat(childNodes);
nodes = nodes.concat(childNodes);
}
return nodes;
},
_getChildCount: function (parentValues) {
return this._getChildren(parentValues).length;
}
});
/***/ }),
/* 674 */
/***/ (function(module, exports) {
BI.AbstractListTreeValueChooser = BI.inherit(BI.AbstractTreeValueChooser, {
_reqDisplayTreeNode: function (op, callback) {
var self = this;
var result = {};
var selectedValues = op.selectedValues;
if (selectedValues == null || BI.isEmpty(selectedValues)) {
callback({});
return;
}
doCheck([], this.tree.getRoot(), selectedValues);
callback({
items: BI.values(result)
});
function doCheck(parentValues, node, selected) {
BI.each(selected, function (idx, path) {
BI.each(path, function (id, value) {
var nodeValue = value;
var node = self._getTreeNode(path.slice(0, id), nodeValue);
// 找不到就是新增值
if (BI.isNull(node)) {
createOneJson({
id: BI.UUID(),
text: nodeValue,
value: nodeValue,
isLeaf: true
}, BI.UUID());
} else {
if(!BI.has(result, node.id)) {
createOneJson(node, node.parent && node.parent.id);
}
result[node.id].isLeaf !== true && (result[node.id].isLeaf = id === path.length - 1);
}
});
});
}
function createOneJson(node, pId) {
result[node.id] = {
id: node.id,
pId: pId,
text: node.text,
value: node.value,
open: true,
isLeaf: node.isLeaf
};
}
},
_reqInitTreeNode: function (op, callback) {
var self = this;
var result = [];
var keyword = op.keyword || "";
var selectedValues = op.selectedValues;
var lastSearchValue = op.lastSearchValue || ""; // 一次请求100个,但是搜索是拿全部的,lastSearchValue是上一次遍历到的节点索引
var output = search();
BI.nextTick(function () {
callback({
hasNext: output.length > self._const.perPage,
items: result,
lastSearchValue: BI.last(output)
});
});
function search() {
var children = self._getChildren([]);
var start = children.length;
if (lastSearchValue !== "") {
for (var j = 0, len = start; j < len; j++) {
if (children[j].value === lastSearchValue) {
start = j + 1;
break;
}
}
} else {
start = 0;
}
var output = [];
for (var i = start, len = children.length; i < len; i++) {
if (output.length < self._const.perPage) {
var find = nodeSearch(1, [], children[i].value, result);
} else if (output.length === self._const.perPage) {
var find = nodeSearch(1, [], children[i].value, []);
}
if (find[0] === true) {
output.push(children[i].value);
}
if (output.length > self._const.perPage) {
break;
}
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
if (op.times === 1) {
var nodes = self._getAddedValueNode([], selectedValues);
result = BI.concat(BI.filter(nodes, function (idx, node) {
var find = BI.Func.getSearchResult([node.text || node.value], keyword);
return find.find.length > 0 || find.match.length > 0;
}), result);
}
return output;
}
function nodeSearch(deep, parentValues, current, result) {
if (self._isMatch(parentValues, current, keyword)) {
var checked = isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, true, result);
return [true, checked];
}
var newParents = BI.clone(parentValues);
newParents.push(current);
var children = self._getChildren(newParents);
var can = false, checked = false;
BI.each(children, function (i, child) {
var state = nodeSearch(deep + 1, newParents, child.value, result);
if (state[1] === true) {
checked = true;
}
if (state[0] === true) {
can = true;
}
});
if (can === true) {
checked = isSelected(parentValues, current);
createOneJson(parentValues, current, true, checked, false, result);
}
return [can, checked];
}
function createOneJson(parentValues, value, isOpen, checked, flag, result) {
var node = self._getTreeNode(parentValues, value);
result.push({
id: node.id,
pId: node.pId,
text: node.text,
value: node.value,
title: node.title,
isParent: node.getChildrenLength() > 0,
open: isOpen,
checked: checked,
halfCheck: false,
flag: flag
});
}
function isHalf(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return null;
}
return BI.any(find, function (v, ob) {
if (v === value) {
if (ob != null && !BI.isEmpty(ob)) {
return true;
}
}
});
}
function isAllSelected(parentValues, value) {
var find = findSelectedObj(parentValues);
if (find == null) {
return null;
}
return BI.any(find, function (v, ob) {
if (v === value) {
if (ob != null && BI.isEmpty(ob)) {
return true;
}
}
});
}
function isSelected(parentValues, value) {
return BI.any(selectedValues, function (idx, array) {
return BI.isEqual(parentValues, array.slice(0, parentValues.length)) && BI.last(array) === value;
});
}
function findSelectedObj(parentValues) {
var find = selectedValues;
if (find == null) {
return null;
}
BI.every(parentValues, function (i, v) {
find = find[v];
if (find == null) {
return false;
}
return true;
});
return find;
}
},
_reqTreeNode: function (op, callback) {
var self = this, o = this.options;
var result = [];
var times = op.times;
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues || [];
var valueMap = dealWithSelectedValue(parentValues, selectedValues);
var nodes = this._getChildren(parentValues);
for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
var checked = BI.has(valueMap, nodes[i].value);
result.push({
id: nodes[i].id,
pId: nodes[i].pId,
value: nodes[i].value,
text: nodes[i].text,
times: 1,
isParent: nodes[i].getChildrenLength() > 0,
checked: checked,
halfCheck: false,
open: o.open
});
}
// 如果指定节点全部打开
if (o.open) {
var allNodes = [];
// 获取所有节点
BI.each(nodes, function (idx, node) {
allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
});
BI.each(allNodes, function (idx, node) {
var valueMap = dealWithSelectedValue(node.parentValues, selectedValues);
var checked = BI.has(valueMap, node.value);
result.push({
id: node.id,
pId: node.pId,
value: node.value,
text: node.text,
times: 1,
isParent: node.getChildrenLength() > 0,
checked: checked,
halfCheck: false,
open: o.open
});
});
}
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
if (parentValues.length === 0 && times === 1) {
result = BI.concat(self._getAddedValueNode(parentValues, selectedValues), result);
}
BI.nextTick(function () {
callback({
items: result,
hasNext: nodes.length > times * self._const.perPage
});
});
function dealWithSelectedValue(parentValues, selectedValues) {
var valueMap = {};
BI.each(selectedValues, function (idx, v) {
if (BI.isEqual(parentValues, v.slice(0, parentValues.length))) {
valueMap[BI.last(v)] = [2, 0];
}
});
return valueMap;
}
},
_getAddedValueNode: function (parentValues, selectedValues) {
var nodes = this._getChildren(parentValues);
var values = BI.flatten(BI.filter(selectedValues, function (idx, array) {
return array.length === 1;
}));
return BI.map(BI.difference(values, BI.map(nodes, "value")), function (idx, v) {
return {
id: BI.UUID(),
pId: nodes.length > 0 ? nodes[0].pId : BI.UUID(),
value: v,
text: v,
times: 1,
isParent: false,
checked: true,
halfCheck: false
};
});
}
});
/***/ }),
/* 675 */
/***/ (function(module, exports) {
/**
* 简单的复选下拉树控件, 适用于数据量少的情况, 可以自增值
*
* Created by GUY on 2015/10/29.
* @class BI.ListTreeValueChooserInsertCombo
* @extends BI.Widget
*/
BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, {
_defaultConfig: function () {
return BI.extend(BI.ListTreeValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-list-tree-value-chooser-insert-combo",
width: 200,
height: 24,
items: null,
itemsCreator: BI.emptyFn,
isNeedAdjustWidth: true,
});
},
_init: function () {
BI.ListTreeValueChooserInsertCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (BI.isNotNull(o.items)) {
this._initData(o.items);
}
this.combo = BI.createWidget({
type: "bi.multi_tree_list_combo",
isNeedAdjustWidth: o.isNeedAdjustWidth,
element: this,
text: o.text,
value: o.value,
watermark: o.watermark,
allowInsertValue: o.allowInsertValue,
allowEdit: o.allowEdit,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height,
listeners: [{
eventName: BI.MultiTreeListCombo.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiTreeListCombo.EVENT_BLUR,
action: function () {
self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiTreeListCombo.EVENT_STOP,
action: function () {
self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_STOP);
}
}, {
eventName: BI.MultiTreeListCombo.EVENT_CLICK_ITEM,
action: function (v) {
self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM, v);
}
}, {
eventName: BI.MultiTreeListCombo.EVENT_SEARCHING,
action: function () {
self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING);
}
}, {
eventName: BI.MultiTreeListCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_BEFORE_POPUPVIEW);
}
}]
});
},
setValue: function (v) {
this.combo.setValue(v);
},
getValue: function () {
return this.combo.getValue();
},
populate: function (items) {
this._initData(items);
this.combo.populate.apply(this.combo, arguments);
}
});
BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.ListTreeValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR";
BI.ListTreeValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.ListTreeValueChooserInsertCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.list_tree_value_chooser_insert_combo", BI.ListTreeValueChooserInsertCombo);
/***/ }),
/* 676 */
/***/ (function(module, exports) {
/**
* 简单的复选下拉树控件, 适用于数据量少的情况, 可以自增值
*
* Created by GUY on 2015/10/29.
* @class BI.TreeValueChooserInsertCombo
* @extends BI.Widget
*/
BI.TreeValueChooserInsertCombo = BI.inherit(BI.AbstractTreeValueChooser, {
_defaultConfig: function () {
return BI.extend(BI.TreeValueChooserInsertCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-tree-value-chooser-insert-combo",
width: 200,
height: 24,
items: null,
itemsCreator: BI.emptyFn,
isNeedAdjustWidth: true
});
},
_init: function () {
BI.TreeValueChooserInsertCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (BI.isNotNull(o.items)) {
this._initData(o.items);
}
this.combo = BI.createWidget({
type: "bi.multi_tree_insert_combo",
isNeedAdjustWidth: o.isNeedAdjustWidth,
allowEdit: o.allowEdit,
text: o.text,
value: o.value,
watermark: o.watermark,
element: this,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height,
listeners: [{
eventName: BI.MultiTreeInsertCombo.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiTreeInsertCombo.EVENT_BLUR,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiTreeInsertCombo.EVENT_STOP,
action: function () {
self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_STOP);
}
}, {
eventName: BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,
action: function (v) {
self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM, v);
}
}, {
eventName: BI.MultiTreeInsertCombo.EVENT_SEARCHING,
action: function () {
self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_SEARCHING);
}
}, {
eventName: BI.MultiTreeInsertCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_BEFORE_POPUPVIEW);
}
}]
});
},
setValue: function (v) {
this.combo.setValue(v);
},
getValue: function () {
return this.combo.getValue();
},
populate: function (items) {
this._initData(items);
this.combo.populate.apply(this.combo, arguments);
}
});
BI.TreeValueChooserInsertCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.TreeValueChooserInsertCombo.EVENT_BLUR = "EVENT_BLUR";
BI.TreeValueChooserInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.TreeValueChooserInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.TreeValueChooserInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TreeValueChooserInsertCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.shortcut("bi.tree_value_chooser_insert_combo", BI.TreeValueChooserInsertCombo);
/***/ }),
/* 677 */
/***/ (function(module, exports) {
/**
* 简单的复选下拉树控件, 适用于数据量少的情况
*
* Created by GUY on 2015/10/29.
* @class BI.TreeValueChooserCombo
* @extends BI.Widget
*/
BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, {
_defaultConfig: function () {
return BI.extend(BI.TreeValueChooserCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-tree-value-chooser-combo",
width: 200,
height: 24,
items: null,
itemsCreator: BI.emptyFn,
isNeedAdjustWidth: true
});
},
_init: function () {
BI.TreeValueChooserCombo.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (BI.isNotNull(o.items)) {
this._initData(o.items);
}
this.combo = BI.createWidget({
type: "bi.multi_tree_combo",
text: o.text,
allowEdit: o.allowEdit,
value: o.value,
watermark: o.watermark,
element: this,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height,
isNeedAdjustWidth: o.isNeedAdjustWidth,
listeners: [{
eventName: BI.MultiTreeCombo.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiTreeCombo.EVENT_BLUR,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiTreeCombo.EVENT_STOP,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_STOP);
}
}, {
eventName: BI.MultiTreeCombo.EVENT_CLICK_ITEM,
action: function (v) {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_CLICK_ITEM, v);
}
}, {
eventName: BI.MultiTreeCombo.EVENT_SEARCHING,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_SEARCHING);
}
}, {
eventName: BI.MultiTreeCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM);
}
}, {
eventName: BI.MultiTreeCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.fireEvent(BI.TreeValueChooserCombo.EVENT_BEFORE_POPUPVIEW);
}
}]
});
},
setValue: function (v) {
this.combo.setValue(v);
},
getValue: function () {
return this.combo.getValue();
},
populate: function (items) {
this._initData(items);
this.combo.populate.apply(this.combo, arguments);
}
});
BI.TreeValueChooserCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.TreeValueChooserCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.TreeValueChooserCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.TreeValueChooserCombo.EVENT_BLUR = "EVENT_BLUR";
BI.TreeValueChooserCombo.EVENT_STOP = "EVENT_STOP";
BI.TreeValueChooserCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.TreeValueChooserCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.shortcut("bi.tree_value_chooser_combo", BI.TreeValueChooserCombo);
/***/ }),
/* 678 */
/***/ (function(module, exports) {
/**
* 简单的树面板, 适用于数据量少的情况
*
* Created by GUY on 2015/10/29.
* @class BI.TreeValueChooserPane
* @extends BI.AbstractTreeValueChooser
*/
BI.TreeValueChooserPane = BI.inherit(BI.AbstractTreeValueChooser, {
_defaultConfig: function () {
return BI.extend(BI.TreeValueChooserPane.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-tree-value-chooser-pane",
items: null,
itemsCreator: BI.emptyFn
});
},
_init: function () {
BI.TreeValueChooserPane.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.pane = BI.createWidget({
type: "bi.multi_select_tree",
element: this,
itemsCreator: BI.bind(this._itemsCreator, this)
});
this.pane.on(BI.MultiSelectTree.EVENT_CHANGE, function () {
self.fireEvent(BI.TreeValueChooserPane.EVENT_CHANGE);
});
if (BI.isNotNull(o.items)) {
this._initData(o.items);
this.populate();
}
},
setSelectedValue: function (v) {
this.pane.setSelectedValue(v);
},
setValue: function (v) {
this.pane.setValue(v);
},
getValue: function () {
return this.pane.getValue();
},
populate: function () {
this.pane.populate.apply(this.pane, arguments);
}
});
BI.TreeValueChooserPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.tree_value_chooser_pane", BI.TreeValueChooserPane);
/***/ }),
/* 679 */
/***/ (function(module, exports) {
/**
* 简单的复选下拉框控件, 适用于数据量少的情况
* 封装了字段处理逻辑
*
* Created by GUY on 2015/10/29.
* @class BI.AbstractValueChooser
* @extends BI.Widget
*/
BI.AbstractValueChooser = BI.inherit(BI.Widget, {
_const: {
perPage: 100
},
_defaultConfig: function () {
return BI.extend(BI.AbstractValueChooser.superclass._defaultConfig.apply(this, arguments), {
items: null,
itemsCreator: BI.emptyFn,
cache: true
});
},
_valueFormatter: function (v) {
var text = v;
if (BI.isNotNull(this.items)) {
BI.some(this.items, function (i, item) {
// 把value都换成字符串
if (item.value === v || item.value + "" === v) {
text = item.text;
return true;
}
});
}
return text;
},
_getItemsByTimes: function (items, times) {
var res = [];
for (var i = (times - 1) * this._const.perPage; items[i] && i < times * this._const.perPage; i++) {
res.push(items[i]);
}
return res;
},
_hasNextByTimes: function (items, times) {
return times * this._const.perPage < items.length;
},
_itemsCreator: function (options, callback) {
var self = this, o = this.options;
if (!o.cache || !this.items) {
o.itemsCreator({}, function (items) {
self.items = items;
call(items);
});
} else {
call(this.items);
}
function call (items) {
var keywords = (options.keywords || []).slice();
var resultItems = items;
if(BI.isNotEmptyArray(keywords)) {
resultItems = [];
BI.each(keywords, function (i, kw) {
var search = BI.Func.getSearchResult(items, kw);
resultItems = resultItems.concat(search.match).concat(search.find);
});
resultItems = BI.uniq(resultItems);
}
if (options.selectedValues) {// 过滤
var filter = BI.makeObject(options.selectedValues, true);
resultItems = BI.filter(resultItems, function (i, ob) {
return !filter[ob.value];
});
}
if (options.type === BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: resultItems
});
return;
}
if (options.type === BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: resultItems.length});
return;
}
callback({
items: self._getItemsByTimes(resultItems, options.times),
hasNext: self._hasNextByTimes(resultItems, options.times)
});
}
}
});
/***/ }),
/* 680 */
/***/ (function(module, exports) {
/**
* 简单的复选下拉框控件, 适用于数据量少的情况
* 封装了字段处理逻辑
*/
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,
allowEdit: o.allowEdit,
text: o.text,
value: o.value,
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.combo, 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);
/***/ }),
/* 681 */
/***/ (function(module, exports) {
/**
* 简单的复选下拉框控件, 适用于数据量少的情况
* 封装了字段处理逻辑
*
* Created by GUY on 2015/10/29.
* @class BI.ValueChooserCombo
* @extends BI.Widget
*/
BI.ValueChooserCombo = BI.inherit(BI.AbstractValueChooser, {
_defaultConfig: function () {
return BI.extend(BI.ValueChooserCombo.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-value-chooser-combo",
width: 200,
height: 24,
items: null,
itemsCreator: BI.emptyFn,
cache: true
});
},
_init: function () {
BI.ValueChooserCombo.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_combo",
element: this,
allowEdit: o.allowEdit,
text: o.text,
value: o.value,
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.ValueChooserCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_BLUR,
action: function () {
self.fireEvent(BI.ValueChooserCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_STOP,
action: function () {
self.fireEvent(BI.ValueChooserCombo.EVENT_STOP);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_CLICK_ITEM,
action: function () {
self.fireEvent(BI.ValueChooserCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_SEARCHING,
action: function () {
self.fireEvent(BI.ValueChooserCombo.EVENT_SEARCHING);
}
}, {
eventName: BI.MultiSelectCombo.EVENT_CONFIRM,
action: function () {
self.fireEvent(BI.ValueChooserCombo.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.combo, arguments);
}
});
BI.ValueChooserCombo.EVENT_BLUR = "EVENT_BLUR";
BI.ValueChooserCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.ValueChooserCombo.EVENT_STOP = "EVENT_STOP";
BI.ValueChooserCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.ValueChooserCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.ValueChooserCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.value_chooser_combo", BI.ValueChooserCombo);
/***/ }),
/* 682 */
/***/ (function(module, exports) {
/**
* 简单的复选面板, 适用于数据量少的情况
* 封装了字段处理逻辑
*
* Created by GUY on 2015/10/29.
* @class BI.ValueChooserPane
* @extends BI.Widget
*/
BI.ValueChooserPane = BI.inherit(BI.AbstractValueChooser, {
_defaultConfig: function () {
return BI.extend(BI.ValueChooserPane.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-value-chooser-pane",
items: null,
itemsCreator: BI.emptyFn,
cache: true
});
},
_init: function () {
BI.ValueChooserPane.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.list = BI.createWidget({
type: "bi.multi_select_list",
element: this,
value: o.value,
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this)
});
this.list.on(BI.MultiSelectList.EVENT_CHANGE, function () {
self.fireEvent(BI.ValueChooserPane.EVENT_CHANGE);
});
if (BI.isNotNull(o.items)) {
this.items = o.items;
this.list.populate();
}
},
setValue: function (v) {
this.list.setValue(v);
},
getValue: function () {
var val = this.list.getValue() || {};
return {
type: val.type,
value: val.value
};
},
populate: function (items) {
// 直接用combo的populate不会作用到AbstractValueChooser上
items && (this.items = items);
this.list.populate.apply(this.list, arguments);
}
});
BI.ValueChooserPane.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);
/***/ }),
/* 683 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _index = _interopRequireDefault(__webpack_require__(684));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
BI.extend(BI, _index["default"]);
/***/ }),
/* 684 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var decorator = _interopRequireWildcard(__webpack_require__(685));
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var _default = {
Decorators: decorator
};
exports["default"] = _default;
/***/ }),
/* 685 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.shortcut = shortcut;
exports.provider = provider;
exports.model = model;
exports.store = store;
exports.Model = void 0;
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
/**
* 注册widget
*/
function shortcut() {
return function decorator(Target) {
BI.shortcut(Target.xtype, Target);
};
}
/**
* 注册provider
*/
function provider() {
return function decorator(Target) {
BI.provider(Target.xtype, Target);
};
}
/**
* 注册model
*/
function model() {
return function decorator(Target) {
BI.model(Target.xtype, Target);
};
}
/**
* 类注册_store属性
* @param Model model类
* @param opts 额外条件
*/
function store(Model) {
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return function classDecorator(constructor) {
return /*#__PURE__*/function (_constructor) {
_inheritsLoose(_class, _constructor);
function _class() {
return _constructor.apply(this, arguments) || this;
}
var _proto = _class.prototype;
_proto._store = function _store() {
var props = opts.props ? opts.props.apply(this) : undefined;
return BI.Models.getModel(Model.xtype, props);
};
return _class;
}(constructor);
};
}
/**
* Model基类
*/
var Model = /*#__PURE__*/function (_Fix$Model) {
_inheritsLoose(Model, _Fix$Model);
function Model() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _Fix$Model.call.apply(_Fix$Model, [this].concat(args)) || this;
_defineProperty(_assertThisInitialized(_this), "model", void 0);
_defineProperty(_assertThisInitialized(_this), "store", void 0);
_defineProperty(_assertThisInitialized(_this), "context", void 0);
_defineProperty(_assertThisInitialized(_this), "actions", void 0);
_defineProperty(_assertThisInitialized(_this), "childContext", void 0);
_defineProperty(_assertThisInitialized(_this), "TYPE", void 0);
_defineProperty(_assertThisInitialized(_this), "computed", void 0);
return _this;
}
var _proto2 = Model.prototype;
_proto2.state = function state() {
return {};
};
return Model;
}(Fix.Model);
/* 分享一段很好看的代码
// union to intersection of functions
type UnionToIoF<U> =
(U extends any ? (k: (x: U) => void) => void : never) extends
((k: infer I) => void) ? I : never
// return last element from Union
type UnionPop<U> = UnionToIoF<U> extends { (a: infer A): void; } ? A : never;
// prepend an element to a tuple.
type Prepend<U, T extends ReadonlyArray<any>> =
((a: U, ...r: T) => void) extends (...r: infer R) => void ? R : never;
type UnionToTupleRecursively<Union, Result extends ReadonlyArray<any>> = {
1: Result;
0: UnionToTupleRecursively_<Union, UnionPop<Union>, Result>;
// 0: UnionToTupleRecursively<Exclude<Union, UnionPop<Union>>, Prepend<UnionPop<Union>, Result>>
}[[Union] extends [never] ? 1 : 0];
type UnionToTupleRecursively_<Union, Element, Result extends ReadonlyArray<any>> =
UnionToTupleRecursively<Exclude<Union, Element>, Prepend<Element, Result>>;
type UnionToTuple<U> = UnionToTupleRecursively<U, []>;
*/
exports.Model = Model;
/***/ }),
/* 686 */
/***/ (function(module, exports) {
// Production steps of ECMA-262, Edition 5, 15.4.4.14
// Reference: http://es5.github.io/#x15.4.4.14
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement, fromIndex) {
var k;
// 1. Let o be the result of calling ToObject passing
// the this value as the argument.
if (this == null) {
throw new TypeError("\"this\" is null or not defined");
}
var o = Object(this);
// 2. Let lenValue be the result of calling the Get
// internal method of o with the argument "length".
// 3. Let len be ToUint32(lenValue).
var len = o.length >>> 0;
// 4. If len is 0, return -1.
if (len === 0) {
return -1;
}
// 5. If argument fromIndex was passed let n be
// ToInteger(fromIndex); else let n be 0.
var n = fromIndex | 0;
// 6. If n >= len, return -1.
if (n >= len) {
return -1;
}
// 7. If n >= 0, then Let k be n.
// 8. Else, n<0, Let k be len - abs(n).
// If k is less than 0, then let k be 0.
k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
// 9. Repeat, while k < len
while (k < len) {
// a. Let Pk be ToString(k).
// This is implicit for LHS operands of the in operator
// b. Let kPresent be the result of calling the
// HasProperty internal method of o with argument Pk.
// This step can be combined with c
// c. If kPresent is true, then
// i. Let elementK be the result of calling the Get
// internal method of o with the argument ToString(k).
// ii. Let same be the result of applying the
// Strict Equality Comparison Algorithm to
// searchElement and elementK.
// iii. If same is true, return k.
if (k in o && o[k] === searchElement) {
return k;
}
k++;
}
return -1;
};
}
if (!Array.prototype.lastIndexOf) {
Array.prototype.lastIndexOf = function (searchElement /* , fromIndex*/) {
"use strict";
if (this === void 0 || this === null) {
throw new TypeError();
}
var n, k,
t = Object(this),
len = t.length >>> 0;
if (len === 0) {
return -1;
}
n = len - 1;
if (arguments.length > 1) {
n = Number(arguments[1]);
if (n != n) {
n = 0;
} else if (n != 0 && n != (1 / 0) && n != -(1 / 0)) {
n = (n > 0 || -1) * Math.floor(Math.abs(n));
}
}
for (k = n >= 0
? Math.min(n, len - 1)
: len - Math.abs(n); k >= 0; k--) {
if (k in t && t[k] === searchElement) {
return k;
}
}
return -1;
};
}
/***/ }),
/* 687 */
/***/ (function(module, exports) {
/**
* 特殊情况
* Created by wang on 15/6/23.
*/
// 解决console未定义问题 guy
_global.console = _global.console || (function () {
var c = {};
c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile
= c.clear = c.exception = c.trace = c.assert = function () {
};
return c;
})();
/***/ }),
/* 688 */
/***/ (function(module, exports) {
/*
* 前端缓存
*/
_global.localStorage || (_global.localStorage = {
items: {},
setItem: function (k, v) {
BI.Cache.addCookie(k, v);
},
getItem: function (k) {
return BI.Cache.getCookie(k);
},
removeItem: function (k) {
BI.Cache.deleteCookie(k);
},
key: function () {
},
clear: function () {
this.items = {};
}
});
/***/ }),
/* 689 */
/***/ (function(module, exports) {
if (!Object.keys) {
Object.keys = function(o) {
if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object');
}
// fix的问题
var falsy;
var skipArray = {
__ob__: falsy,
$accessors: falsy,
$vbthis: falsy,
$vbsetter: falsy
};
var k = [], p;
for (p in o) {
if (!(p in skipArray)) {
if (Object.prototype.hasOwnProperty.call(o, p)) {
k.push(p);
}
}
}
return k;
};
}
if (!Array.isArray) {
Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
}
/* 统一采用core-js的polyfill,此块暂去
// https://stackoverflow.com/questions/10919915/ie8-getprototypeof-method
if (typeof Object.getPrototypeOf !== "function") {
Object.getPrototypeOf = "".__proto__ === String.prototype
? function (object) {
return object.__proto__;
}
: function (object) {
// May break if the constructor has been tampered with
return object.constructor.prototype;
};
}
*/
if(!Date.now) {
Date.now = function () {
return new Date().valueOf();
};
}
/***/ }),
/* 690 */
/***/ (function(module, exports) {
if (typeof Set !== "undefined" && Set.toString().match(/native code/)) {
} else {
Set = function () {
this.set = {};
};
Set.prototype.has = function (key) {
return this.set[key] !== undefined;
};
Set.prototype.add = function (key) {
this.set[key] = 1;
};
Set.prototype.clear = function () {
this.set = {};
};
}
/***/ }),
/* 691 */
/***/ (function(module, exports) {
// 修复ie9下sort方法的bug
// IE的sort 需要显示声明返回-1, 0, 1三种比较结果才可正常工作,而Chrome, Firefox中可以直接返回true, false等
// BI-36544 sort提供的参数就可以自定义返回值,不需要特别控制。这边使用冒泡相较于快排可能慢了点。
// 这边先将webkit的限制去掉
!function (window) {
var ua = window.navigator.userAgent.toLowerCase(),
reg = /msie/;
if (reg.test(ua)) {
var _sort = Array.prototype.sort;
Array.prototype.sort = function (fn) {
if (!!fn && typeof fn === "function") {
if (this.length < 2) {
return this;
}
var i = 0, j = i + 1, l = this.length, tmp, r = false, t = 0;
for (; i < l; i++) {
for (j = i + 1; j < l; j++) {
t = fn.call(this, this[i], this[j]);
r = (typeof t === "number" ? t :
t ? 1 : 0) > 0;
if (r === true) {
tmp = this[i];
this[i] = this[j];
this[j] = tmp;
}
}
}
return this;
}
return _sort.call(this);
};
}
}(window);
/***/ }),
/* 692 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 693 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 694 */
/***/ (function(module, exports) {
// 工程配置
BI.prepares.push(function () {
// 注册布局
// adapt类布局优先级规则
// 1、在非IE且支持flex的浏览器下使用flex布局
// 2、IE或者不支持flex的浏览器下使用inline布局
// 3、在2的情况下如果布局的items大于1的话使用display:table的布局
// 4、在3的情况下如果IE版本低于8使用table标签布局
var _isSupportFlex;
var isSupportFlex = function () {
if (_isSupportFlex == null) {
_isSupportFlex = !!(BI.isSupportCss3 && BI.isSupportCss3("flex"));
}
return _isSupportFlex;
};
BI.Plugin.registerWidget("bi.horizontal", function (ob) {
var isIE = BI.isIE(), supportFlex = isSupportFlex(), isLessIE8 = isIE && BI.getIEVersion() < 8;
// center_adapt
if (ob.verticalAlign === BI.VerticalAlign.Middle && ob.horizontalAlign === BI.HorizontalAlign.Center) {
if (isLessIE8) {
return ob;
}
return BI.extend(ob, {type: "bi.table_adapt"});
}
// vertical_adapt
if (ob.verticalAlign === BI.VerticalAlign.Middle && ob.horizontalAlign === BI.HorizontalAlign.Left) {
if (isLessIE8) {
return ob;
}
return BI.extend(ob, {type: "bi.table_adapt"});
}
// horizontal_adapt
if (ob.verticalAlign === BI.VerticalAlign.Top && ob.horizontalAlign === BI.HorizontalAlign.Center) {
if (isLessIE8) {
return ob;
}
return BI.extend(ob, {type: "bi.table_adapt"});
}
if (!isIE) {
if (supportFlex) {
return BI.extend(ob, {type: "bi.flex_horizontal"});
}
return BI.extend(ob, {type: "bi.table_adapt"});
}
return ob;
});
BI.Plugin.registerWidget("bi.center_adapt", function (ob) {
var isIE = BI.isIE(), supportFlex = isSupportFlex(), justOneItem = (ob.items && ob.items.length <= 1);
if (!isIE && supportFlex && justOneItem) {
// 有滚动条的情况下需要用到flex_scrollable_center_adapt布局
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) {
// 不是IE用flex_scrollable_center_adapt布局
return BI.extend(ob, {type: "bi.flex_scrollable_center_adapt"});
}
return BI.extend(ob, {type: "bi.flex_center_adapt"});
}
// 一个item的情况下inline布局睥睨天下
if (justOneItem) {
return BI.extend(ob, {type: "bi.inline_center_adapt"});
}
return ob;
});
BI.Plugin.registerWidget("bi.vertical_adapt", function (ob) {
var isIE = BI.isIE(), supportFlex = isSupportFlex();
if (!isIE && supportFlex) {
// 有滚动条的情况下需要用到flex_scrollable_center_adapt布局
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) {
// 不是IE用flex__scrollable_center_adapt布局
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_center_adapt"});
}
return BI.extend(ob, {type: "bi.flex_vertical_center_adapt"});
}
return BI.extend(ob, {type: "bi.inline_vertical_adapt"});
});
BI.Plugin.registerWidget("bi.horizontal_adapt", function (ob) {
if (ob.items && ob.items.length <= 1) {
return BI.extend(ob, {type: "bi.horizontal_auto"});
}
return ob;
});
BI.Plugin.registerWidget("bi.float_center_adapt", function (ob) {
if (!BI.isIE() && isSupportFlex()) {
// 有滚动条的情况下需要用到flex_scrollable_center_adapt布局
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) {
// 不是IE用flex_scrollable_center_adapt布局
return BI.extend({}, ob, {type: "bi.flex_scrollable_center_adapt"});
}
return BI.extend(ob, {type: "bi.flex_center_adapt"});
}
return BI.extend(ob, {type: "bi.inline_center_adapt"});
});
BI.Plugin.registerWidget("bi.flex_horizontal", function (ob) {
if (ob.scrollable === true || ob.scrolly === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal"});
}
});
BI.Plugin.registerWidget("bi.flex_vertical", function (ob) {
if (ob.scrollable === true || ob.scrollx === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical"});
}
});
BI.Plugin.registerWidget("bi.flex_horizontal_adapt", function (ob) {
if (ob.scrollable === true || ob.scrollx === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"});
}
});
BI.Plugin.registerWidget("bi.flex_vertical_adapt", function (ob) {
if (ob.scrollable === true || ob.scrolly === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"});
}
});
BI.Plugin.registerWidget("bi.flex_horizontal_center_adapt", function (ob) {
if (ob.scrollable === true || ob.scrollx === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"});
}
});
BI.Plugin.registerWidget("bi.flex_vertical_center_adapt", function (ob) {
if (ob.scrollable === true || ob.scrolly === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"});
}
});
BI.Plugin.registerWidget("bi.flex_center_adapt", function (ob) {
if (ob.scrollable === true || ob.scrolly === true || ob.scrollx === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_center_adapt"});
}
});
BI.Plugin.registerWidget("bi.radio", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_radio"});
}
return ob;
});
BI.Plugin.registerWidget("bi.checkbox", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return BI.extend(ob, {type: "bi.image_checkbox"});
}
return ob;
});
BI.Plugin.registerWidget("bi.half_icon_button", function (ob) {
if (BI.isIE() && BI.getIEVersion() < 9) {
return ob;
}
return BI.extend(ob, {type: "bi.half_button"});
});
});
/***/ }),
/* 695 */
/***/ (function(module, exports) {
/**
* Detect Element Resize.
* Forked in order to guard against unsafe 'window' and 'document' references.
*
* https://github.com/sdecima/javascript-detect-element-resize
* Sebastian Decima
*
* version: 0.5.3
**/
!(function () {
var attachEvent = _global.document && _global.document.attachEvent,
stylesCreated = false;
if (_global.document && !attachEvent) {
var requestFrame = (function () {
var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return _global.setTimeout(fn, 20); };
return function (fn) { return raf(fn); };
})();
var cancelFrame = (function () {
var cancel = _global.cancelAnimationFrame || _global.mozCancelAnimationFrame || _global.webkitCancelAnimationFrame ||
_global.clearTimeout;
return function (id) { return cancel(id); };
})();
var resetTriggers = function (element) {
var triggers = element.__resizeTriggers__,
expand = triggers.firstElementChild,
contract = triggers.lastElementChild,
expandChild = expand.firstElementChild;
contract.scrollLeft = contract.scrollWidth;
contract.scrollTop = contract.scrollHeight;
expandChild.style.width = expand.offsetWidth + 1 + "px";
expandChild.style.height = expand.offsetHeight + 1 + "px";
expand.scrollLeft = expand.scrollWidth;
expand.scrollTop = expand.scrollHeight;
};
var checkTriggers = function (element) {
return element.offsetWidth !== element.__resizeLast__.width ||
element.offsetHeight !== element.__resizeLast__.height;
};
var scrollListener = function (e) {
var element = this;
resetTriggers(this);
if (this.__resizeRAF__) cancelFrame(this.__resizeRAF__);
this.__resizeRAF__ = requestFrame(function () {
if (checkTriggers(element)) {
element.__resizeLast__.width = element.offsetWidth;
element.__resizeLast__.height = element.offsetHeight;
element.__resizeListeners__.forEach(function (fn) {
fn.call(element, e);
});
}
});
};
/* Detect CSS Animations support to detect element display/re-attach */
var animation = false,
animationstring = "animation",
keyframeprefix = "",
animationstartevent = "animationstart",
domPrefixes = "Webkit Moz O ms".split(" "),
startEvents = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),
pfx = "";
{
var elm = document.createElement("fakeelement");
if (elm.style.animationName !== undefined) {
animation = true;
}
if (animation === false) {
for (var i = 0; i < domPrefixes.length; i++) {
if (elm.style[domPrefixes[i] + "AnimationName"] !== undefined) {
pfx = domPrefixes[i];
animationstring = pfx + "Animation";
keyframeprefix = "-" + pfx.toLowerCase() + "-";
animationstartevent = startEvents[i];
animation = true;
break;
}
}
}
}
var animationName = "resizeanim";
var animationKeyframes = "@" + keyframeprefix + "keyframes " + animationName + " { from { opacity: 0; } to { opacity: 0; } } ";
var animationStyle = keyframeprefix + "animation: 1ms " + animationName + "; ";
}
var createStyles = function () {
if (!stylesCreated) {
// opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360
var css = (animationKeyframes ? animationKeyframes : "") +
".resize-triggers { " + (animationStyle ? animationStyle : "") + "visibility: hidden; opacity: 0; } " +
".resize-triggers, .resize-triggers > div, .contract-trigger:before { content: \" \"; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }",
head = document.head || document.getElementsByTagName("head")[0],
style = document.createElement("style");
style.type = "text/css";
if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
head.appendChild(style);
stylesCreated = true;
}
};
var addResizeListener = function (element, fn) {
if (attachEvent) {
element.attachEvent("onresize", fn);
BI.nextTick(fn);
} else {
if (!element.__resizeTriggers__) {
if (getComputedStyle(element).position === "static") element.style.position = "relative";
createStyles();
element.__resizeLast__ = {};
element.__resizeListeners__ = [];
(element.__resizeTriggers__ = document.createElement("div")).className = "resize-triggers";
element.__resizeTriggers__.innerHTML = "<div class=\"expand-trigger\"><div></div></div>" +
"<div class=\"contract-trigger\"></div>";
element.appendChild(element.__resizeTriggers__);
resetTriggers(element);
element.addEventListener("scroll", scrollListener, true);
/* Listen for a css animation to detect element display/re-attach */
animationstartevent && element.__resizeTriggers__.addEventListener(animationstartevent, function (e) {
if (e.animationName === animationName) {resetTriggers(element);}
});
}
element.__resizeListeners__.push(fn);
}
};
var removeResizeListener = function (element, fn) {
if (attachEvent) element.detachEvent("onresize", fn);
else {
element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
if (!element.__resizeListeners__.length) {
element.removeEventListener("scroll", scrollListener);
element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);
}
}
};
BI.ResizeDetector = {
addResizeListener: function (widget, fn) {
addResizeListener(widget.element[0], fn);
return function () {
removeResizeListener(widget.element[0], fn);
};
},
removeResizeListener: function (widget, fn) {
removeResizeListener(widget.element[0], fn);
}
};
})();
/***/ }),
/* 696 */
/***/ (function(module, exports) {
/**
* 对DOM操作的通用函数
* @type {{}}
*/
!(function () {
BI.DOM = {};
BI.extend(BI.DOM, {
ready: function (fn) {
BI.Widget._renderEngine.createElement(document).ready(fn);
}
});
BI.extend(BI.DOM, {
patchProps: function (fromElement, toElement) {
var elemData = BI.jQuery._data(fromElement[0]);
var events = elemData.events;
BI.each(events, function (eventKey, event) {
BI.each(event, function (i, handler) {
toElement.on(eventKey + (handler.namespace ? ("." + handler.namespace) : ""), handler);
});
});
var fromChildren = fromElement.children(), toChildren = toElement.children();
if (fromChildren.length !== toChildren.length) {
throw new Error("不匹配");
}
BI.each(fromChildren, function (i, child) {
BI.DOM.patchProps(BI.jQuery(child), BI.jQuery(toChildren[i]));
});
BI.each(fromElement.data("__widgets"), function (i, widget) {
widget.element = toElement;
});
},
/**
* 把dom数组或元素悬挂起来,使其不对html产生影响
* @param dom
*/
hang: function (doms) {
if (BI.isEmpty(doms)) {
return;
}
var frag = BI.Widget._renderEngine.createFragment();
BI.each(doms, function (i, dom) {
dom instanceof BI.Widget && (dom = dom.element);
dom instanceof BI.$ && dom[0] && frag.appendChild(dom[0]);
});
return frag;
},
isExist: function (obj) {
return BI.Widget._renderEngine.createElement("body").find(obj.element).length > 0;
},
// 预加载图片
preloadImages: function (srcArray, onload) {
var count = 0, images = [];
function complete () {
count++;
if (count >= srcArray.length) {
onload();
}
}
BI.each(srcArray, function (i, src) {
images[i] = new Image();
images[i].src = src;
images[i].onload = function () {
complete();
};
images[i].onerror = function () {
complete();
};
});
},
getTextSizeWidth: function (text, fontSize) {
var span = BI.Widget._renderEngine.createElement("<span></span>").addClass("text-width-span").appendTo("body");
if (fontSize == null) {
fontSize = 12;
}
fontSize = fontSize + "px";
span.css("font-size", fontSize).text(text);
var width = span.width();
span.remove();
return width;
},
getTextSizeHeight: function (text, fontSize) {
var span = BI.Widget._renderEngine.createElement("<span></span>").addClass("text-width-span").appendTo("body");
if (fontSize == null) {
fontSize = 12;
}
fontSize = fontSize + "px";
span.css("font-size", fontSize).text(text);
var height = span.height();
span.remove();
return height;
},
// 获取滚动条的宽度,页面display: none时候获取到的为0
getScrollWidth: function () {
if (BI.isNull(this._scrollWidth) || this._scrollWidth === 0) {
var ul = BI.Widget._renderEngine.createElement("<div>").width(50).height(50).css({
position: "absolute",
top: "-9999px",
overflow: "scroll"
}).appendTo("body");
this._scrollWidth = ul[0].offsetWidth - ul[0].clientWidth;
ul.destroy();
}
return this._scrollWidth;
},
getImage: function (param, fillStyle, backgroundColor) {
var canvas = document.createElement("canvas");
var ratio = 2;
BI.Widget._renderEngine.createElement("body").append(canvas);
var ctx = canvas.getContext("2d");
ctx.font = "12px Georgia";
var w = ctx.measureText(param).width + 4;
canvas.width = w * ratio;
canvas.height = 16 * ratio;
ctx.font = 12 * ratio + "px Georgia";
ctx.fillStyle = fillStyle || "#3685f2";
ctx.textBaseline = "middle";
// ctx.fillStyle = "#EAF2FD";
ctx.fillText(param, 2 * ratio, 9 * ratio);
BI.Widget._renderEngine.createElement(canvas).destroy();
var backColor = backgroundColor || "rgba(54, 133, 242, 0.1)";
// IE可以放大缩小所以要固定最大最小宽高
return {
width: w,
height: 16,
src: canvas.toDataURL("image/png"),
style: "background-color: " + backColor + ";vertical-align: middle; margin: 0 1px; width:" + w + "px;height: 16px; max-width:" + w + "px;max-height: 16px; min-width:" + w + "px;min-height: 16px",
param: param
};
}
});
BI.extend(BI.DOM, {
isColor: function (color) {
return color && (this.isRGBColor(color) || this.isHexColor(color));
},
isRGBColor: function (color) {
if (!color) {
return false;
}
return color.substr(0, 3) === "rgb";
},
isHexColor: function (color) {
if (!color) {
return false;
}
return color[0] === "#" && color.length === 7;
},
isDarkColor: function (hex) {
if (!hex || !this.isHexColor(hex)) {
return false;
}
var rgb = this.rgb2json(this.hex2rgb(hex));
var grayLevel = Math.round(rgb.r * 0.299 + rgb.g * 0.587 + rgb.b * 0.114);
if (grayLevel < 192/** 网上给的是140**/) {
return true;
}
return false;
},
// 获取对比颜色
getContrastColor: function (color) {
if (!color || !this.isColor(color)) {
return "";
}
if (this.isDarkColor(color)) {
return "#ffffff";
}
return "#1a1a1a";
},
rgb2hex: function (rgbColour) {
if (!rgbColour || rgbColour.substr(0, 3) != "rgb") {
return "";
}
var rgbValues = rgbColour.match(/\d+(\.\d+)?/g);
var red = BI.parseInt(rgbValues[0]);
var green = BI.parseInt(rgbValues[1]);
var blue = BI.parseInt(rgbValues[2]);
var hexColour = "#" + this.int2hex(red) + this.int2hex(green) + this.int2hex(blue);
return hexColour;
},
rgb2json: function (rgbColour) {
if (!rgbColour) {
return {};
}
if (!this.isRGBColor(rgbColour)) {
return {};
}
var rgbValues = rgbColour.match(/\d+(\.\d+)?/g);
return {
r: BI.parseInt(rgbValues[0]),
g: BI.parseInt(rgbValues[1]),
b: BI.parseInt(rgbValues[2])
};
},
rgba2json: function (rgbColour) {
if (!rgbColour) {
return {};
}
var rgbValues = rgbColour.match(/\d+(\.\d+)?/g);
return {
r: BI.parseInt(rgbValues[0]),
g: BI.parseInt(rgbValues[1]),
b: BI.parseInt(rgbValues[2]),
a: BI.parseFloat(rgbValues[3])
};
},
json2rgb: function (rgb) {
if (!BI.isKey(rgb.r) || !BI.isKey(rgb.g) || !BI.isKey(rgb.b)) {
return "";
}
return "rgb(" + rgb.r + "," + rgb.g + "," + rgb.b + ")";
},
json2rgba: function (rgba) {
if (!BI.isKey(rgba.r) || !BI.isKey(rgba.g) || !BI.isKey(rgba.b)) {
return "";
}
return "rgba(" + rgba.r + "," + rgba.g + "," + rgba.b + "," + rgba.a + ")";
},
int2hex: function (strNum) {
var hexdig = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
return hexdig[strNum >>> 4] + "" + hexdig[strNum & 15];
},
hex2rgb: function (color) {
if (!color) {
return "";
}
if (!this.isHexColor(color)) {
return color;
}
var tempValue = "rgb(", colorArray;
if (color.length === 7) {
colorArray = [BI.parseInt("0x" + color.substring(1, 3)),
BI.parseInt("0x" + color.substring(3, 5)),
BI.parseInt("0x" + color.substring(5, 7))];
} else if (color.length === 4) {
colorArray = [BI.parseInt("0x" + color.substring(1, 2)),
BI.parseInt("0x" + color.substring(2, 3)),
BI.parseInt("0x" + color.substring(3, 4))];
}
tempValue += colorArray[0] + ",";
tempValue += colorArray[1] + ",";
tempValue += colorArray[2] + ")";
return tempValue;
},
rgba2rgb: function (rgbColor, bgColor) {
if (BI.isNull(bgColor)) {
bgColor = 1;
}
if (rgbColor.substr(0, 4) != "rgba") {
return "";
}
var rgbValues = rgbColor.match(/\d+(\.\d+)?/g);
if (rgbValues.length < 4) {
return "";
}
var R = BI.parseFloat(rgbValues[0]);
var G = BI.parseFloat(rgbValues[1]);
var B = BI.parseFloat(rgbValues[2]);
var A = BI.parseFloat(rgbValues[3]);
return "rgb(" + Math.floor(255 * (bgColor * (1 - A)) + R * A) + "," +
Math.floor(255 * (bgColor * (1 - A)) + G * A) + "," +
Math.floor(255 * (bgColor * (1 - A)) + B * A) + ")";
}
});
BI.extend(BI.DOM, {
getLeftPosition: function (combo, popup, extraWidth) {
return {
left: combo.element.offset().left - popup.element.outerWidth() - (extraWidth || 0)
};
},
getInnerLeftPosition: function (combo, popup, extraWidth) {
return {
left: combo.element.offset().left + (extraWidth || 0)
};
},
getRightPosition: function (combo, popup, extraWidth) {
var el = combo.element;
return {
left: el.offset().left + el.outerWidth() + (extraWidth || 0)
};
},
getInnerRightPosition: function (combo, popup, extraWidth) {
var el = combo.element, viewBounds = popup.element.bounds();
return {
left: el.offset().left + el.outerWidth() - viewBounds.width - (extraWidth || 0)
};
},
getTopPosition: function (combo, popup, extraHeight) {
return {
top: combo.element.offset().top - popup.element.outerHeight() - (extraHeight || 0)
};
},
getBottomPosition: function (combo, popup, extraHeight) {
var el = combo.element;
return {
top: el.offset().top + el.outerHeight() + (extraHeight || 0)
};
},
isLeftSpaceEnough: function (combo, popup, extraWidth) {
return BI.DOM.getLeftPosition(combo, popup, extraWidth).left >= 0;
},
isInnerLeftSpaceEnough: function (combo, popup, extraWidth) {
var viewBounds = popup.element.bounds(),windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
return BI.DOM.getInnerLeftPosition(combo, popup, extraWidth).left + viewBounds.width <= windowBounds.width;
},
isRightSpaceEnough: function (combo, popup, extraWidth) {
var viewBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
return BI.DOM.getRightPosition(combo, popup, extraWidth).left + viewBounds.width <= windowBounds.width;
},
isInnerRightSpaceEnough: function (combo, popup, extraWidth) {
return BI.DOM.getInnerRightPosition(combo, popup, extraWidth).left >= 0;
},
isTopSpaceEnough: function (combo, popup, extraHeight) {
return BI.DOM.getTopPosition(combo, popup, extraHeight).top >= 0;
},
isBottomSpaceEnough: function (combo, popup, extraHeight) {
var viewBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
return BI.DOM.getBottomPosition(combo, popup, extraHeight).top + viewBounds.height <= windowBounds.height;
},
isRightSpaceLarger: function (combo) {
var windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
return windowBounds.width - combo.element.offset().left - combo.element.bounds().width >= combo.element.offset().left;
},
isBottomSpaceLarger: function (combo) {
var windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
return windowBounds.height - combo.element.offset().top - combo.element.bounds().height >= combo.element.offset().top;
},
getLeftAlignPosition: function (combo, popup, extraWidth) {
var viewBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
var left = combo.element.offset().left + extraWidth;
if (left + viewBounds.width > windowBounds.width) {
left = windowBounds.width - viewBounds.width;
}
if (left < 0) {
left = 0;
}
return {
left: left
};
},
getLeftAdaptPosition: function (combo, popup, extraWidth) {
if (BI.DOM.isLeftSpaceEnough(combo, popup, extraWidth)) {
return BI.DOM.getLeftPosition(combo, popup, extraWidth);
}
return {
left: 0
};
},
getRightAlignPosition: function (combo, popup, extraWidth) {
var comboBounds = combo.element.bounds(), viewBounds = popup.element.bounds();
var left = combo.element.offset().left + comboBounds.width - viewBounds.width - extraWidth;
if (left < 0) {
left = 0;
}
return {
left: left
};
},
getRightAdaptPosition: function (combo, popup, extraWidth) {
if (BI.DOM.isRightSpaceEnough(combo, popup, extraWidth)) {
return BI.DOM.getRightPosition(combo, popup, extraWidth);
}
return {
left: BI.Widget._renderEngine.createElement("body").bounds().width - popup.element.bounds().width
};
},
getTopAlignPosition: function (combo, popup, extraHeight, needAdaptHeight) {
var comboOffset = combo.element.offset();
var comboBounds = combo.element.bounds(), popupBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
var top, adaptHeight;
if (BI.DOM.isBottomSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) {
top = comboOffset.top + extraHeight;
} else if (needAdaptHeight) {
top = comboOffset.top + extraHeight;
adaptHeight = windowBounds.height - top;
} else {
top = windowBounds.height - popupBounds.height;
if (top < extraHeight) {
adaptHeight = windowBounds.height - extraHeight;
}
}
if (top < extraHeight) {
top = extraHeight;
}
return adaptHeight ? {
top: top,
adaptHeight: adaptHeight
} : {
top: top
};
},
getTopAdaptPosition: function (combo, popup, extraHeight, needAdaptHeight) {
var popupBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
if (BI.DOM.isTopSpaceEnough(combo, popup, extraHeight)) {
return BI.DOM.getTopPosition(combo, popup, extraHeight);
}
if (needAdaptHeight) {
return {
top: 0,
adaptHeight: combo.element.offset().top - extraHeight
};
}
if (popupBounds.height + extraHeight > windowBounds.height) {
return {
top: 0,
adaptHeight: windowBounds.height - extraHeight
};
}
return {
top: 0
};
},
getBottomAlignPosition: function (combo, popup, extraHeight, needAdaptHeight) {
var comboOffset = combo.element.offset();
var comboBounds = combo.element.bounds(), popupBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
var top, adaptHeight;
if (BI.DOM.isTopSpaceEnough(combo, popup, -1 * comboBounds.height + extraHeight)) {
top = comboOffset.top + comboBounds.height - popupBounds.height - extraHeight;
} else if (needAdaptHeight) {
top = 0;
adaptHeight = comboOffset.top + comboBounds.height - extraHeight;
} else {
top = 0;
if (popupBounds.height + extraHeight > windowBounds.height) {
adaptHeight = windowBounds.height - extraHeight;
}
}
if (top < 0) {
top = 0;
}
return adaptHeight ? {
top: top,
adaptHeight: adaptHeight
} : {
top: top
};
},
getBottomAdaptPosition: function (combo, popup, extraHeight, needAdaptHeight) {
var comboOffset = combo.element.offset();
var comboBounds = combo.element.bounds(), popupBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
if (BI.DOM.isBottomSpaceEnough(combo, popup, extraHeight)) {
return BI.DOM.getBottomPosition(combo, popup, extraHeight);
}
if (needAdaptHeight) {
return {
top: comboOffset.top + comboBounds.height + extraHeight,
adaptHeight: windowBounds.height - comboOffset.top - comboBounds.height - extraHeight
};
}
if (popupBounds.height + extraHeight > windowBounds.height) {
return {
top: extraHeight,
adaptHeight: windowBounds.height - extraHeight
};
}
return {
top: windowBounds.height - popupBounds.height - extraHeight
};
},
getCenterAdaptPosition: function (combo, popup) {
var comboOffset = combo.element.offset();
var comboBounds = combo.element.bounds(), popupBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
var left;
if (comboOffset.left + comboBounds.width / 2 + popupBounds.width / 2 > windowBounds.width) {
left = windowBounds.width - popupBounds.width;
} else {
left = comboOffset.left + comboBounds.width / 2 - popupBounds.width / 2;
}
if (left < 0) {
left = 0;
}
return {
left: left
};
},
getMiddleAdaptPosition: function (combo, popup) {
var comboOffset = combo.element.offset();
var comboBounds = combo.element.bounds(), popupBounds = popup.element.bounds(),
windowBounds = BI.Widget._renderEngine.createElement("body").bounds();
var top;
if (comboOffset.top + comboBounds.height / 2 + popupBounds.height / 2 > windowBounds.height) {
top = windowBounds.height - popupBounds.height;
} else {
top = comboOffset.top + comboBounds.height / 2 - popupBounds.height / 2;
}
if (top < 0) {
top = 0;
}
return {
top: top
};
},
getComboPositionByDirections: function (combo, popup, extraWidth, extraHeight, needAdaptHeight, directions) {
extraWidth || (extraWidth = 0);
extraHeight || (extraHeight = 0);
var i, direct;
var leftRight = [], topBottom = [], innerLeftRight = [];
var isNeedAdaptHeight = false, tbFirst = false, lrFirst = false;
var left, top, pos, firstDir = directions[0];
for (i = 0; i < directions.length; i++) {
direct = directions[i];
switch (direct) {
case "left":
leftRight.push(direct);
break;
case "right":
leftRight.push(direct);
break;
case "top":
topBottom.push(direct);
break;
case "bottom":
topBottom.push(direct);
break;
case "innerLeft":
innerLeftRight.push(direct);
break;
case "innerRight":
innerLeftRight.push(direct);
break;
}
}
for (i = 0; i < directions.length; i++) {
direct = directions[i];
switch (direct) {
case "left":
if (!isNeedAdaptHeight) {
var tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? 0 : extraHeight;
if (BI.DOM.isLeftSpaceEnough(combo, popup, tW)) {
left = BI.DOM.getLeftPosition(combo, popup, tW).left;
if (topBottom[0] === "bottom") {
pos = BI.DOM.getTopAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "left,bottom";
} else {
pos = BI.DOM.getBottomAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "left,top";
}
if (tbFirst) {
pos.change = "left";
}
pos.left = left;
return pos;
}
}
lrFirst = true;
break;
case "right":
if (!isNeedAdaptHeight) {
var tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? extraWidth : extraHeight;
if (BI.DOM.isRightSpaceEnough(combo, popup, tW)) {
left = BI.DOM.getRightPosition(combo, popup, tW).left;
if (topBottom[0] === "bottom") {
pos = BI.DOM.getTopAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "right,bottom";
} else {
pos = BI.DOM.getBottomAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "right,top";
}
if (tbFirst) {
pos.change = "right";
}
pos.left = left;
return pos;
}
}
lrFirst = true;
break;
case "top":
var tW = lrFirst ? extraHeight : extraWidth, tH = lrFirst ? extraWidth : extraHeight;
if (BI.DOM.isTopSpaceEnough(combo, popup, tH)) {
top = BI.DOM.getTopPosition(combo, popup, tH).top;
if (leftRight[0] === "right") {
pos = BI.DOM.getLeftAlignPosition(combo, popup, tW, needAdaptHeight);
pos.dir = "top,right";
} else {
pos = BI.DOM.getRightAlignPosition(combo, popup, tW);
pos.dir = "top,left";
}
if (lrFirst) {
pos.change = "top";
}
pos.top = top;
return pos;
}
if (needAdaptHeight) {
isNeedAdaptHeight = true;
}
tbFirst = true;
break;
case "bottom":
var tW = lrFirst ? extraHeight : extraWidth, tH = lrFirst ? extraWidth : extraHeight;
if (BI.DOM.isBottomSpaceEnough(combo, popup, tH)) {
top = BI.DOM.getBottomPosition(combo, popup, tH).top;
if (leftRight[0] === "right") {
pos = BI.DOM.getLeftAlignPosition(combo, popup, tW, needAdaptHeight);
pos.dir = "bottom,right";
} else {
pos = BI.DOM.getRightAlignPosition(combo, popup, tW);
pos.dir = "bottom,left";
}
if (lrFirst) {
pos.change = "bottom";
}
pos.top = top;
return pos;
}
if (needAdaptHeight) {
isNeedAdaptHeight = true;
}
tbFirst = true;
break;
case "innerLeft":
if (!isNeedAdaptHeight) {
var tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? 0 : extraHeight;
if (BI.DOM.isInnerLeftSpaceEnough(combo, popup, tW)) {
left = BI.DOM.getInnerLeftPosition(combo, popup, tW).left;
if (topBottom[0] === "bottom") {
pos = BI.DOM.getTopAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "innerLeft,bottom";
} else {
pos = BI.DOM.getBottomAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "innerLeft,top";
}
if (tbFirst) {
pos.change = "innerLeft";
}
pos.left = left;
return pos;
}
}
lrFirst = true;
break;
case "innerRight":
if (!isNeedAdaptHeight) {
var tW = tbFirst ? extraHeight : extraWidth, tH = tbFirst ? extraWidth : extraHeight;
if (BI.DOM.isInnerRightSpaceEnough(combo, popup, tW)) {
left = BI.DOM.getInnerRightPosition(combo, popup, tW).left;
if (topBottom[0] === "bottom") {
pos = BI.DOM.getTopAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "innerRight,bottom";
} else {
pos = BI.DOM.getBottomAlignPosition(combo, popup, tH, needAdaptHeight);
pos.dir = "innerRight,top";
}
if (tbFirst) {
pos.change = "innerRight";
}
pos.left = left;
return pos;
}
}
break;
}
}
// 此处为四个方向放不下时挑空间最大的方向去放置, 也就是说我设置了弹出方向为"bottom,left",
// 最后发现实际弹出方向可能是"top,left",那么此时外界获取popup的方向应该是"top,left"
switch (directions[0]) {
case "left":
case "right":
if (BI.DOM.isRightSpaceLarger(combo)) {
left = BI.DOM.getRightAdaptPosition(combo, popup, extraWidth).left;
firstDir = "right";
} else {
left = BI.DOM.getLeftAdaptPosition(combo, popup, extraWidth).left;
firstDir = "left";
}
if (topBottom[0] === "bottom") {
pos = BI.DOM.getTopAlignPosition(combo, popup, extraHeight, needAdaptHeight);
pos.left = left;
pos.dir = firstDir + ",bottom";
return pos;
}
pos = BI.DOM.getBottomAlignPosition(combo, popup, extraHeight, needAdaptHeight);
pos.left = left;
pos.dir = firstDir + ",top";
return pos;
default :
if (BI.DOM.isBottomSpaceLarger(combo)) {
pos = BI.DOM.getBottomAdaptPosition(combo, popup, extraHeight, needAdaptHeight);
firstDir = "bottom";
} else {
pos = BI.DOM.getTopAdaptPosition(combo, popup, extraHeight, needAdaptHeight);
firstDir = "top";
}
if (leftRight[0] === "right") {
left = BI.DOM.getLeftAlignPosition(combo, popup, extraWidth, needAdaptHeight).left;
pos.left = left;
pos.dir = firstDir + ",right";
return pos;
}
left = BI.DOM.getRightAlignPosition(combo, popup, extraWidth).left;
pos.left = left;
pos.dir = firstDir + ",left";
return pos;
}
},
getComboPosition: function (combo, popup, extraWidth, extraHeight, needAdaptHeight, directions, offsetStyle) {
extraWidth || (extraWidth = 0);
extraHeight || (extraHeight = 0);
var bodyHeight = BI.Widget._renderEngine.createElement("body").bounds().height - extraHeight;
var maxHeight = Math.min(popup.attr("maxHeight") || bodyHeight, bodyHeight);
popup.resetHeight && popup.resetHeight(maxHeight);
var position = BI.DOM.getComboPositionByDirections(combo, popup, extraWidth, extraHeight, needAdaptHeight, directions || ["bottom", "top", "right", "left"]);
switch (offsetStyle) {
case "center":
if (position.change) {
var p = BI.DOM.getMiddleAdaptPosition(combo, popup);
position.top = p.top;
} else {
var p = BI.DOM.getCenterAdaptPosition(combo, popup);
position.left = p.left;
}
break;
case "middle":
if (position.change) {
var p = BI.DOM.getCenterAdaptPosition(combo, popup);
position.left = p.left;
} else {
var p = BI.DOM.getMiddleAdaptPosition(combo, popup);
position.top = p.top;
}
break;
}
if (needAdaptHeight === true) {
popup.resetHeight && popup.resetHeight(Math.min(bodyHeight - position.top, maxHeight));
}
return position;
}
});
})();
/***/ }),
/* 697 */
/***/ (function(module, exports) {
BI.EventListener = {
listen: function listen (target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, false);
return {
remove: function remove () {
target.removeEventListener(eventType, callback, false);
}
};
} else if (target.attachEvent) {
target.attachEvent("on" + eventType, callback);
return {
remove: function remove () {
target.detachEvent("on" + eventType, callback);
}
};
}
},
capture: function capture (target, eventType, callback) {
if (target.addEventListener) {
target.addEventListener(eventType, callback, true);
return {
remove: function remove () {
target.removeEventListener(eventType, callback, true);
}
};
}
return {
remove: BI.emptyFn
};
},
registerDefault: function registerDefault () {
}
};
/***/ }),
/* 698 */
/***/ (function(module, exports) {
// 浏览器相关方法
_.extend(BI, {
isIE: function () {
if(!_global.navigator) {
return false;
}
if (this.__isIE == null) {
this.__isIE = /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
}
return this.__isIE;
},
getIEVersion: function () {
if(!_global.navigator) {
return 0;
}
if (this.__IEVersion != null) {
return this.__IEVersion;
}
var version = 0;
var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/);
var v2 = agent.match(/(?:trident.*rv:([\w.]+))/);
if (v1 && v2 && v1[1] && v2[1]) {
version = Math.max(v1[1] * 1, v2[1] * 1);
} else if (v1 && v1[1]) {
version = v1[1] * 1;
} else if (v2 && v2[1]) {
version = v2[1] * 1;
} else {
version = 0;
}
return this.__IEVersion = version;
},
isIE9Below: function () {
if (!BI.isIE()) {
return false;
}
return this.getIEVersion() < 9;
},
isEdge: function () {
if(!_global.navigator) {
return false;
}
return /edge/i.test(navigator.userAgent.toLowerCase());
},
isChrome: function () {
if(!_global.navigator) {
return false;
}
return /chrome/i.test(navigator.userAgent.toLowerCase());
},
isFireFox: function () {
if(!_global.navigator) {
return false;
}
return /firefox/i.test(navigator.userAgent.toLowerCase());
},
isOpera: function () {
if(!_global.navigator) {
return false;
}
return /opera/i.test(navigator.userAgent.toLowerCase());
},
isSafari: function () {
if(!_global.navigator) {
return false;
}
return /safari/i.test(navigator.userAgent.toLowerCase()) && !/chrome/i.test(navigator.userAgent.toLowerCase());
},
isKhtml: function () {
if(!_global.navigator) {
return false;
}
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
},
isMac: function () {
if(!_global.navigator) {
return false;
}
return /macintosh|mac os x/i.test(navigator.userAgent);
},
isWindows: function () {
if(!_global.navigator) {
return false;
}
return /windows|win32/i.test(navigator.userAgent);
},
isSupportCss3: function (style) {
if(!_global.document) {
return false;
}
var prefix = ["webkit", "Moz", "ms", "o"],
i, len,
humpString = [],
htmlStyle = document.documentElement.style,
_toHumb = function (string) {
if (!BI.isString(string)) {
return "";
}
return string.replace(/-(\w)/g, function ($0, $1) {
return $1.toUpperCase();
});
};
for ( i = 0; i < prefix.length; i++) {
humpString.push(_toHumb(prefix[i] + "-" + style));
}
humpString.push(_toHumb(style));
for (i = 0, len = humpString.length; i < len; i++) {
if (humpString[i] in htmlStyle) {
return true;
}
}
return false;
}
});
/***/ }),
/* 699 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
* jQuery JavaScript Library v1.9.1
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2013-2-4
*/
(function( window, undefined ) {
// Can't do this because several apps including ASP.NET trace
// the stack via arguments.caller.callee and Firefox dies if
// you try to trace through "use strict" call chains. (#13335)
// Support: Firefox 18+
//"use strict";
var
// The deferred used on DOM ready
readyList,
// A central reference to the root jQuery(document)
rootjQuery,
// Support: IE<9
// For `typeof node.method` instead of `node.method !== undefined`
core_strundefined = typeof undefined,
// Use the correct document accordingly with window argument (sandbox)
document = window.document,
location = window.location,
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// [[Class]] -> type pairs
class2type = {},
// List of deleted data cache ids, so we can reuse them
core_deletedIds = [],
core_version = "1.12.4",
// Save a reference to some core methods
core_concat = core_deletedIds.concat,
core_push = core_deletedIds.push,
core_slice = core_deletedIds.slice,
core_indexOf = core_deletedIds.indexOf,
core_toString = class2type.toString,
core_hasOwn = class2type.hasOwnProperty,
core_trim = core_version.trim,
// Define a local copy of jQuery
jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
},
// Used for matching numbers
core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
// Used for splitting on whitespace
core_rnotwhite = /\S+/g,
// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
// A simple way to check for HTML strings
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
// Strict HTML recognition (#11290: must start with <)
rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
// Match a standalone tag
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
// JSON RegExp
rvalidchars = /^[\],:{}\s]*$/,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
// Matches dashed string for camelizing
rmsPrefix = /^-ms-/,
rdashAlpha = /-([\da-z])/gi,
// Used by jQuery.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
return letter.toUpperCase();
},
// The ready event handler
completed = function( event ) {
// readyState === "complete" is good enough for us to call the dom ready in oldIE
if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
detach();
jQuery.ready();
}
},
// Clean-up method for dom ready events
detach = function() {
if ( document.addEventListener ) {
document.removeEventListener( "DOMContentLoaded", completed, false );
window.removeEventListener( "load", completed, false );
} else {
document.detachEvent( "onreadystatechange", completed );
window.detachEvent( "onload", completed );
}
};
jQuery.fn = jQuery.prototype = {
// The current version of jQuery being used
jquery: core_version,
constructor: jQuery,
init: function( selector, context, rootjQuery ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
return this;
}
// Handle HTML strings
if ( typeof selector === "string" ) {
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
// Assume that strings that start and end with <> are HTML and skip the regex check
match = [ null, selector, null ];
} else {
match = rquickExpr.exec( selector );
}
// Match html or make sure no context is specified for #id
if ( match && (match[1] || !context) ) {
// HANDLE: $(html) -> $(array)
if ( match[1] ) {
context = context instanceof jQuery ? context[0] : context;
// scripts is true for back-compat
jQuery.merge( this, jQuery.parseHTML(
match[1],
context && context.nodeType ? context.ownerDocument || context : document,
true
) );
// HANDLE: $(html, props)
if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
for ( match in context ) {
// Properties of context are called as methods if possible
if ( jQuery.isFunction( this[ match ] ) ) {
this[ match ]( context[ match ] );
// ...and otherwise set as attributes
} else {
this.attr( match, context[ match ] );
}
}
}
return this;
// HANDLE: $(#id)
} else {
elem = document.getElementById( match[2] );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id !== match[2] ) {
return rootjQuery.find( selector );
}
// Otherwise, we inject the element directly into the jQuery object
this.length = 1;
this[0] = elem;
}
this.context = document;
this.selector = selector;
return this;
}
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return ( context || rootjQuery ).find( selector );
// HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr)
} else {
return this.constructor( context ).find( selector );
}
// HANDLE: $(DOMElement)
} else if ( selector.nodeType ) {
this.context = this[0] = selector;
this.length = 1;
return this;
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return rootjQuery.ready( selector );
}
if ( selector.selector !== undefined ) {
this.selector = selector.selector;
this.context = selector.context;
}
return jQuery.makeArray( selector, this );
},
// Start with an empty selector
selector: "",
// The default length of a jQuery object is 0
length: 0,
// The number of elements contained in the matched element set
size: function() {
return this.length;
},
toArray: function() {
return core_slice.call( this );
},
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
return num == null ?
// Return a 'clean' array
this.toArray() :
// Return just the object
( num < 0 ? this[ this.length + num ] : this[ num ] );
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems ) {
// Build a new jQuery matched element set
var ret = jQuery.merge( this.constructor(), elems );
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
ret.context = this.context;
// Return the newly-formed element set
return ret;
},
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)
each: function( callback, args ) {
return jQuery.each( this, callback, args );
},
ready: function( fn ) {
// Add the callback
jQuery.ready.promise().done( fn );
return this;
},
slice: function() {
return this.pushStack( core_slice.apply( this, arguments ) );
},
first: function() {
return this.eq( 0 );
},
last: function() {
return this.eq( -1 );
},
eq: function( i ) {
var len = this.length,
j = +i + ( i < 0 ? len : 0 );
return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
},
map: function( callback ) {
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
}));
},
end: function() {
return this.prevObject || this.constructor(null);
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: core_push,
sort: [].sort,
splice: [].splice
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
jQuery.extend = jQuery.fn.extend = function() {
var src, copyIsArray, copy, name, options, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
target = {};
}
// extend jQuery itself if only one argument is passed
if ( length === i ) {
target = this;
--i;
}
for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( name in options ) {
src = target[ name ];
copy = options[ name ];
// Prevent never-ending loop
if ( target === copy ) {
continue;
}
// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray(src) ? src : [];
} else {
clone = src && jQuery.isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
};
jQuery.extend({
noConflict: function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
}
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQuery;
}
return jQuery;
},
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
// A counter to track how many items to wait for before
// the ready event fires. See #6781
readyWait: 1,
// Hold (or release) the ready event
holdReady: function( hold ) {
if ( hold ) {
jQuery.readyWait++;
} else {
jQuery.ready( true );
}
},
// Handle when the DOM is ready
ready: function( wait ) {
// Abort if there are pending holds or we're already ready
if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
return;
}
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( jQuery.ready );
}
// Remember that the DOM is ready
jQuery.isReady = true;
// If a normal DOM Ready event fired, decrement, and wait if need be
if ( wait !== true && --jQuery.readyWait > 0 ) {
return;
}
// If there are functions bound, to execute
readyList.resolveWith( document, [ jQuery ] );
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger("ready").off("ready");
}
},
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( obj ) {
return jQuery.type(obj) === "function";
},
isArray: Array.isArray || function( obj ) {
return jQuery.type(obj) === "array";
},
isWindow: function( obj ) {
return obj != null && obj == obj.window;
},
isNumeric: function( obj ) {
return !isNaN( parseFloat(obj) ) && isFinite( obj );
},
type: function( obj ) {
if ( obj == null ) {
return String( obj );
}
return typeof obj === "object" || typeof obj === "function" ?
class2type[ core_toString.call(obj) ] || "object" :
typeof obj;
},
isPlainObject: function( obj ) {
// Must be an Object.
// Because of IE, we also have to check the presence of the constructor property.
// Make sure that DOM nodes and window objects don't pass through, as well
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
return false;
}
try {
// Not own constructor property must be Object
if ( obj.constructor &&
!core_hasOwn.call(obj, "constructor") &&
!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
return false;
}
} catch ( e ) {
// IE8,9 Will throw exceptions on certain host objects #9897
return false;
}
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
var key;
for ( key in obj ) {}
return key === undefined || core_hasOwn.call( obj, key );
},
isEmptyObject: function( obj ) {
var name;
for ( name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw new Error( msg );
},
// data: string of html
// context (optional): If specified, the fragment will be created in this context, defaults to document
// keepScripts (optional): If true, will include scripts passed in the html string
parseHTML: function( data, context, keepScripts ) {
if ( !data || typeof data !== "string" ) {
return null;
}
if ( typeof context === "boolean" ) {
keepScripts = context;
context = false;
}
context = context || document;
var parsed = rsingleTag.exec( data ),
scripts = !keepScripts && [];
// Single tag
if ( parsed ) {
return [ context.createElement( parsed[1] ) ];
}
parsed = jQuery.buildFragment( [ data ], context, scripts );
if ( scripts ) {
jQuery( scripts ).remove();
}
return jQuery.merge( [], parsed.childNodes );
},
parseJSON: function( data ) {
// Attempt to parse using the native JSON parser first
if ( window.JSON && window.JSON.parse ) {
return window.JSON.parse( data );
}
if ( data === null ) {
return data;
}
if ( typeof data === "string" ) {
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
if ( data ) {
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
.replace( rvalidtokens, "]" )
.replace( rvalidbraces, "")) ) {
return ( new Function( "return " + data ) )();
}
}
}
jQuery.error( "Invalid JSON: " + data );
},
// Cross-browser xml parsing
parseXML: function( data ) {
var xml, tmp;
if ( !data || typeof data !== "string" ) {
return null;
}
try {
if ( window.DOMParser ) { // Standard
tmp = new DOMParser();
xml = tmp.parseFromString( data , "text/xml" );
} else { // IE
xml = new ActiveXObject( "Microsoft.XMLDOM" );
xml.async = "false";
xml.loadXML( data );
}
} catch( e ) {
xml = undefined;
}
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
jQuery.error( "Invalid XML: " + data );
}
return xml;
},
noop: function() {},
// Evaluates a script in a global context
// Workarounds based on findings by Jim Driscoll
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
globalEval: function( data ) {
if ( data && jQuery.trim( data ) ) {
// We use execScript on Internet Explorer
// We use an anonymous function so that context is window
// rather than jQuery in Firefox
( window.execScript || function( data ) {
window[ "eval" ].call( window, data );
} )( data );
}
},
// Convert dashed to camelCase; used by the css and data modules
// Microsoft forgot to hump their vendor prefix (#9572)
camelCase: function( string ) {
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
},
nodeName: function( elem, name ) {
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
},
// args is for internal usage only
each: function( obj, callback, args ) {
var value,
i = 0,
length = obj.length,
isArray = isArraylike( obj );
if ( args ) {
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback.apply( obj[ i ], args );
if ( value === false ) {
break;
}
}
} else {
for ( i in obj ) {
value = callback.apply( obj[ i ], args );
if ( value === false ) {
break;
}
}
}
// A special, fast, case for the most common use of each
} else {
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback.call( obj[ i ], i, obj[ i ] );
if ( value === false ) {
break;
}
}
} else {
for ( i in obj ) {
value = callback.call( obj[ i ], i, obj[ i ] );
if ( value === false ) {
break;
}
}
}
}
return obj;
},
// Use native String.trim function wherever possible
trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
function( text ) {
return text == null ?
"" :
core_trim.call( text );
} :
// Otherwise use our own trimming functionality
function( text ) {
return text == null ?
"" :
( text + "" ).replace( rtrim, "" );
},
// results is for internal usage only
makeArray: function( arr, results ) {
var ret = results || [];
if ( arr != null ) {
if ( isArraylike( Object(arr) ) ) {
jQuery.merge( ret,
typeof arr === "string" ?
[ arr ] : arr
);
} else {
core_push.call( ret, arr );
}
}
return ret;
},
inArray: function( elem, arr, i ) {
var len;
if ( arr ) {
if ( core_indexOf ) {
return core_indexOf.call( arr, elem, i );
}
len = arr.length;
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
for ( ; i < len; i++ ) {
// Skip accessing in sparse arrays
if ( i in arr && arr[ i ] === elem ) {
return i;
}
}
}
return -1;
},
merge: function( first, second ) {
var l = second.length,
i = first.length,
j = 0;
if ( typeof l === "number" ) {
for ( ; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
} else {
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
}
}
first.length = i;
return first;
},
grep: function( elems, callback, inv ) {
var retVal,
ret = [],
i = 0,
length = elems.length;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
for ( ; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
}
}
return ret;
},
// arg is for internal usage only
map: function( elems, callback, arg ) {
var value,
i = 0,
length = elems.length,
isArray = isArraylike( elems ),
ret = [];
// Go through the array, translating each of the items to their
if ( isArray ) {
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
// Go through every key on the object,
} else {
for ( i in elems ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;
}
}
}
// Flatten any nested arrays
return core_concat.apply( [], ret );
},
// A global GUID counter for objects
guid: 1,
// Bind a function to a context, optionally partially applying any
// arguments.
proxy: function( fn, context ) {
var args, proxy, tmp;
if ( typeof context === "string" ) {
tmp = fn[ context ];
context = fn;
fn = tmp;
}
// Quick check to determine if target is callable, in the spec
// this throws a TypeError, but we will just return undefined.
if ( !jQuery.isFunction( fn ) ) {
return undefined;
}
// Simulated bind
args = core_slice.call( arguments, 2 );
proxy = function() {
return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
};
// Set the guid of unique handler to the same of original handler, so it can be removed
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
return proxy;
},
// Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function
access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
var i = 0,
length = elems.length,
bulk = key == null;
// Sets many values
if ( jQuery.type( key ) === "object" ) {
chainable = true;
for ( i in key ) {
jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
}
// Sets one value
} else if ( value !== undefined ) {
chainable = true;
if ( !jQuery.isFunction( value ) ) {
raw = true;
}
if ( bulk ) {
// Bulk operations run against the entire set
if ( raw ) {
fn.call( elems, value );
fn = null;
// ...except when executing function values
} else {
bulk = fn;
fn = function( elem, key, value ) {
return bulk.call( jQuery( elem ), value );
};
}
}
if ( fn ) {
for ( ; i < length; i++ ) {
fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
}
}
}
return chainable ?
elems :
// Gets
bulk ?
fn.call( elems ) :
length ? fn( elems[0], key ) : emptyGet;
},
now: function() {
return ( new Date() ).getTime();
}
});
jQuery.ready.promise = function( obj ) {
if ( !readyList ) {
readyList = jQuery.Deferred();
// Catch cases where $(document).ready() is called after the browser event has already occurred.
// we once tried to use readyState "interactive" here, but it caused issues like the one
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
setTimeout( jQuery.ready );
// Standards-based browsers support DOMContentLoaded
} else if ( document.addEventListener ) {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", completed, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", completed, false );
// If IE event model is used
} else {
// Ensure firing before onload, maybe late but safe also for iframes
document.attachEvent( "onreadystatechange", completed );
// A fallback to window.onload, that will always work
window.attachEvent( "onload", completed );
// If IE and not a frame
// continually check to see if the document is ready
var top = false;
try {
top = window.frameElement == null && document.documentElement;
} catch(e) {}
if ( top && top.doScroll ) {
(function doScrollCheck() {
if ( !jQuery.isReady ) {
try {
// Use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
top.doScroll("left");
} catch(e) {
return setTimeout( doScrollCheck, 50 );
}
// detach all dom ready events
detach();
// and execute any waiting functions
jQuery.ready();
}
})();
}
}
}
return readyList.promise( obj );
};
// Populate the class2type map
jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
class2type[ "[object " + name + "]" ] = name.toLowerCase();
});
function isArraylike( obj ) {
var length = obj.length,
type = jQuery.type( obj );
if ( jQuery.isWindow( obj ) ) {
return false;
}
if ( obj.nodeType === 1 && length ) {
return true;
}
return type === "array" || type !== "function" &&
( length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj );
}
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// String to Object options format cache
var optionsCache = {};
// Convert String-formatted options into Object-formatted ones and store in cache
function createOptions( options ) {
var object = optionsCache[ options ] = {};
jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
object[ flag ] = true;
});
return object;
}
/*
* Create a callback list using the following parameters:
*
* options: an optional list of space-separated options that will change how
* the callback list behaves or a more traditional option object
*
* By default a callback list will act like an event callback list and can be
* "fired" multiple times.
*
* Possible options:
*
* once: will ensure the callback list can only be fired once (like a Deferred)
*
* memory: will keep track of previous values and will call any callback added
* after the list has been fired right away with the latest "memorized"
* values (like a Deferred)
*
* unique: will ensure a callback can only be added once (no duplicate in the list)
*
* stopOnFalse: interrupt callings when a callback returns false
*
*/
jQuery.Callbacks = function( options ) {
// Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
options = typeof options === "string" ?
( optionsCache[ options ] || createOptions( options ) ) :
jQuery.extend( {}, options );
var // Flag to know if list is currently firing
firing,
// Last fire value (for non-forgettable lists)
memory,
// Flag to know if list was already fired
fired,
// End of the loop when firing
firingLength,
// Index of currently firing callback (modified by remove if needed)
firingIndex,
// First callback to fire (used internally by add and fireWith)
firingStart,
// Actual callback list
list = [],
// Stack of fire calls for repeatable lists
stack = !options.once && [],
// Fire callbacks
fire = function( data ) {
memory = options.memory && data;
fired = true;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
firing = true;
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
memory = false; // To prevent further calls using add
break;
}
}
firing = false;
if ( list ) {
if ( stack ) {
if ( stack.length ) {
fire( stack.shift() );
}
} else if ( memory ) {
list = [];
} else {
self.disable();
}
}
},
// Actual Callbacks object
self = {
// Add a callback or a collection of callbacks to the list
add: function() {
if ( list ) {
// First, we save the current length
var start = list.length;
(function add( args ) {
jQuery.each( args, function( _, arg ) {
var type = jQuery.type( arg );
if ( type === "function" ) {
if ( !options.unique || !self.has( arg ) ) {
list.push( arg );
}
} else if ( arg && arg.length && type !== "string" ) {
// Inspect recursively
add( arg );
}
});
})( arguments );
// Do we need to add the callbacks to the
// current firing batch?
if ( firing ) {
firingLength = list.length;
// With memory, if we're not firing then
// we should call right away
} else if ( memory ) {
firingStart = start;
fire( memory );
}
}
return this;
},
// Remove a callback from the list
remove: function() {
if ( list ) {
jQuery.each( arguments, function( _, arg ) {
var index;
while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
list.splice( index, 1 );
// Handle firing indexes
if ( firing ) {
if ( index <= firingLength ) {
firingLength--;
}
if ( index <= firingIndex ) {
firingIndex--;
}
}
}
});
}
return this;
},
// Check if a given callback is in the list.
// If no argument is given, return whether or not list has callbacks attached.
has: function( fn ) {
return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
},
// Remove all callbacks from the list
empty: function() {
list = [];
return this;
},
// Have the list do nothing anymore
disable: function() {
list = stack = memory = undefined;
return this;
},
// Is it disabled?
disabled: function() {
return !list;
},
// Lock the list in its current state
lock: function() {
stack = undefined;
if ( !memory ) {
self.disable();
}
return this;
},
// Is it locked?
locked: function() {
return !stack;
},
// Call all callbacks with the given context and arguments
fireWith: function( context, args ) {
args = args || [];
args = [ context, args.slice ? args.slice() : args ];
if ( list && ( !fired || stack ) ) {
if ( firing ) {
stack.push( args );
} else {
fire( args );
}
}
return this;
},
// Call all the callbacks with the given arguments
fire: function() {
self.fireWith( this, arguments );
return this;
},
// To know if the callbacks have already been called at least once
fired: function() {
return !!fired;
}
};
return self;
};
jQuery.extend({
Deferred: function( func ) {
var tuples = [
// action, add listener, listener list, final state
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
[ "notify", "progress", jQuery.Callbacks("memory") ]
],
state = "pending",
promise = {
state: function() {
return state;
},
always: function() {
deferred.done( arguments ).fail( arguments );
return this;
},
then: function( /* fnDone, fnFail, fnProgress */ ) {
var fns = arguments;
return jQuery.Deferred(function( newDefer ) {
jQuery.each( tuples, function( i, tuple ) {
var action = tuple[ 0 ],
fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
// deferred[ done | fail | progress ] for forwarding actions to newDefer
deferred[ tuple[1] ](function() {
var returned = fn && fn.apply( this, arguments );
if ( returned && jQuery.isFunction( returned.promise ) ) {
returned.promise()
.done( newDefer.resolve )
.fail( newDefer.reject )
.progress( newDefer.notify );
} else {
newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
}
});
});
fns = null;
}).promise();
},
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
return obj != null ? jQuery.extend( obj, promise ) : promise;
}
},
deferred = {};
// Keep pipe for back-compat
promise.pipe = promise.then;
// Add list-specific methods
jQuery.each( tuples, function( i, tuple ) {
var list = tuple[ 2 ],
stateString = tuple[ 3 ];
// promise[ done | fail | progress ] = list.add
promise[ tuple[1] ] = list.add;
// Handle state
if ( stateString ) {
list.add(function() {
// state = [ resolved | rejected ]
state = stateString;
// [ reject_list | resolve_list ].disable; progress_list.lock
}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
}
// deferred[ resolve | reject | notify ]
deferred[ tuple[0] ] = function() {
deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
return this;
};
deferred[ tuple[0] + "With" ] = list.fireWith;
});
// Make the deferred a promise
promise.promise( deferred );
// Call given func if any
if ( func ) {
func.call( deferred, deferred );
}
// All done!
return deferred;
},
// Deferred helper
when: function( subordinate /* , ..., subordinateN */ ) {
var i = 0,
resolveValues = core_slice.call( arguments ),
length = resolveValues.length,
// the count of uncompleted subordinates
remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
// the master Deferred. If resolveValues consist of only a single Deferred, just use that.
deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
// Update function for both resolve and progress values
updateFunc = function( i, contexts, values ) {
return function( value ) {
contexts[ i ] = this;
values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
if( values === progressValues ) {
deferred.notifyWith( contexts, values );
} else if ( !( --remaining ) ) {
deferred.resolveWith( contexts, values );
}
};
},
progressValues, progressContexts, resolveContexts;
// add listeners to Deferred subordinates; treat others as resolved
if ( length > 1 ) {
progressValues = new Array( length );
progressContexts = new Array( length );
resolveContexts = new Array( length );
for ( ; i < length; i++ ) {
if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
resolveValues[ i ].promise()
.done( updateFunc( i, resolveContexts, resolveValues ) )
.fail( deferred.reject )
.progress( updateFunc( i, progressContexts, progressValues ) );
} else {
--remaining;
}
}
}
// if we're not waiting on anything, resolve the master
if ( !remaining ) {
deferred.resolveWith( resolveContexts, resolveValues );
}
return deferred.promise();
}
});
jQuery.support = (function() {
var support, all, a,
input, select, fragment,
opt, eventName, isSupported, i,
div = document.createElement("div");
// Setup
div.setAttribute( "className", "t" );
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
// Support tests won't run in some limited or non-browser environments
all = div.getElementsByTagName("*");
a = div.getElementsByTagName("a")[ 0 ];
if ( !all || !a || !all.length ) {
return {};
}
// First batch of tests
select = document.createElement("select");
opt = select.appendChild( document.createElement("option") );
input = div.getElementsByTagName("input")[ 0 ];
a.style.cssText = "top:1px;float:left;opacity:.5";
support = {
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute: div.className !== "t",
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: div.firstChild.nodeType === 3,
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName("tbody").length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName("link").length,
// Get the style information from getAttribute
// (IE uses .cssText instead)
style: /top/.test( a.getAttribute("style") ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: a.getAttribute("href") === "/a",
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: /^0.5/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: !!a.style.cssFloat,
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
checkOn: !!input.value,
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: opt.selected,
// Tests for enctype support on a form (#6743)
enctype: !!document.createElement("form").enctype,
// Makes sure cloning an html5 element does not cause problems
// Where outerHTML is undefined, this still works
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
boxModel: document.compatMode === "CSS1Compat",
// Will be defined later
deleteExpando: true,
noCloneEvent: true,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableMarginRight: true,
boxSizingReliable: true,
pixelPosition: false
};
// Make sure checked status is properly cloned
input.checked = true;
support.noCloneChecked = input.cloneNode( true ).checked;
// Make sure that the options inside disabled selects aren't marked as disabled
// (WebKit marks them as disabled)
select.disabled = true;
support.optDisabled = !opt.disabled;
// Support: IE<9
try {
delete div.test;
} catch( e ) {
support.deleteExpando = false;
}
// Check if we can trust getAttribute("value")
input = document.createElement("input");
input.setAttribute( "value", "" );
support.input = input.getAttribute( "value" ) === "";
// Check if an input maintains its value after becoming a radio
input.value = "t";
input.setAttribute( "type", "radio" );
support.radioValue = input.value === "t";
// #11217 - WebKit loses check when the name is after the checked attribute
input.setAttribute( "checked", "t" );
input.setAttribute( "name", "t" );
fragment = document.createDocumentFragment();
fragment.appendChild( input );
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
support.appendChecked = input.checked;
// WebKit doesn't clone checked state correctly in fragments
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
// Support: IE<9
// Opera does not clone events (and typeof div.attachEvent === undefined).
// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
if ( div.attachEvent ) {
div.attachEvent( "onclick", function() {
support.noCloneEvent = false;
});
div.cloneNode( true ).click();
}
// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
for ( i in { submit: true, change: true, focusin: true }) {
div.setAttribute( eventName = "on" + i, "t" );
support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
}
div.style.backgroundClip = "content-box";
div.cloneNode( true ).style.backgroundClip = "";
support.clearCloneStyle = div.style.backgroundClip === "content-box";
// Run tests that need a body at doc ready
jQuery(function() {
var container, marginDiv, tds,
divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
body = document.getElementsByTagName("body")[0];
if ( !body ) {
// Return for frameset docs that don't have a body
return;
}
container = document.createElement("div");
container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
body.appendChild( container ).appendChild( div );
// Support: IE8
// Check if table cells still have offsetWidth/Height when they are set
// to display:none and there are still other visible table cells in a
// table row; if so, offsetWidth/Height are not reliable for use when
// determining if an element has been hidden directly using
// display:none (it is still safe to use offsets if a parent element is
// hidden; don safety goggles and see bug #4512 for more information).
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
tds = div.getElementsByTagName("td");
tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
isSupported = ( tds[ 0 ].offsetHeight === 0 );
tds[ 0 ].style.display = "";
tds[ 1 ].style.display = "none";
// Support: IE8
// Check if empty table cells still have offsetWidth/Height
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
// Check box-sizing and margin behavior
div.innerHTML = "";
div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
support.boxSizing = ( div.offsetWidth === 4 );
support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
// Use window.getComputedStyle because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. (#3333)
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
marginDiv = div.appendChild( document.createElement("div") );
marginDiv.style.cssText = div.style.cssText = divReset;
marginDiv.style.marginRight = marginDiv.style.width = "0";
div.style.width = "1px";
support.reliableMarginRight =
!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
}
if ( typeof div.style.zoom !== core_strundefined ) {
// Support: IE<8
// Check if natively block-level elements act like inline-block
// elements when setting their display to 'inline' and giving
// them layout
div.innerHTML = "";
div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
// Support: IE6
// Check if elements with layout shrink-wrap their children
div.style.display = "block";
div.innerHTML = "<div></div>";
div.firstChild.style.width = "5px";
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
if ( support.inlineBlockNeedsLayout ) {
// Prevent IE 6 from affecting layout for positioned elements #11048
// Prevent IE from shrinking the body in IE 7 mode #12869
// Support: IE<8
body.style.zoom = 1;
}
}
body.removeChild( container );
// Null elements to avoid leaks in IE
container = div = tds = marginDiv = null;
});
// Null elements to avoid leaks in IE
all = select = fragment = opt = a = input = null;
return support;
})();
var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
rmultiDash = /([A-Z])/g;
function internalData( elem, name, data, pvt /* Internal Use Only */ ){
if ( !jQuery.acceptData( elem ) ) {
return;
}
var thisCache, ret,
internalKey = jQuery.expando,
getByName = typeof name === "string",
// We have to handle DOM nodes and JS objects differently because IE6-7
// can't GC object references properly across the DOM-JS boundary
isNode = elem.nodeType,
// Only DOM nodes need the global jQuery cache; JS object data is
// attached directly to the object so GC can occur automatically
cache = isNode ? jQuery.cache : elem,
// Only defining an ID for JS objects if its cache already exists allows
// the code to shortcut on the same path as a DOM node with no cache
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
// Avoid doing any more work than we need to when trying to get data on an
// object that has no data at all
if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
return;
}
if ( !id ) {
// Only DOM nodes need a new unique ID for each element since their data
// ends up in the global cache
if ( isNode ) {
elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
} else {
id = internalKey;
}
}
if ( !cache[ id ] ) {
cache[ id ] = {};
// Avoids exposing jQuery metadata on plain JS objects when the object
// is serialized using JSON.stringify
if ( !isNode ) {
cache[ id ].toJSON = jQuery.noop;
}
}
// An object can be passed to jQuery.data instead of a key/value pair; this gets
// shallow copied over onto the existing cache
if ( typeof name === "object" || typeof name === "function" ) {
if ( pvt ) {
cache[ id ] = jQuery.extend( cache[ id ], name );
} else {
cache[ id ].data = jQuery.extend( cache[ id ].data, name );
}
}
thisCache = cache[ id ];
// jQuery data() is stored in a separate object inside the object's internal data
// cache in order to avoid key collisions between internal data and user-defined
// data.
if ( !pvt ) {
if ( !thisCache.data ) {
thisCache.data = {};
}
thisCache = thisCache.data;
}
if ( data !== undefined ) {
thisCache[ jQuery.camelCase( name ) ] = data;
}
// Check for both converted-to-camel and non-converted data property names
// If a data property was specified
if ( getByName ) {
// First Try to find as-is property data
ret = thisCache[ name ];
// Test for null|undefined property data
if ( ret == null ) {
// Try to find the camelCased property
ret = thisCache[ jQuery.camelCase( name ) ];
}
} else {
ret = thisCache;
}
return ret;
}
function internalRemoveData( elem, name, pvt ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var i, l, thisCache,
isNode = elem.nodeType,
// See jQuery.data for more information
cache = isNode ? jQuery.cache : elem,
id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
// If there is already no cache entry for this object, there is no
// purpose in continuing
if ( !cache[ id ] ) {
return;
}
if ( name ) {
thisCache = pvt ? cache[ id ] : cache[ id ].data;
if ( thisCache ) {
// Support array or space separated string names for data keys
if ( !jQuery.isArray( name ) ) {
// try the string as a key before any manipulation
if ( name in thisCache ) {
name = [ name ];
} else {
// split the camel cased version by spaces unless a key with the spaces exists
name = jQuery.camelCase( name );
if ( name in thisCache ) {
name = [ name ];
} else {
name = name.split(" ");
}
}
} else {
// If "name" is an array of keys...
// When data is initially created, via ("key", "val") signature,
// keys will be converted to camelCase.
// Since there is no way to tell _how_ a key was added, remove
// both plain key and camelCase key. #12786
// This will only penalize the array argument path.
name = name.concat( jQuery.map( name, jQuery.camelCase ) );
}
for ( i = 0, l = name.length; i < l; i++ ) {
delete thisCache[ name[i] ];
}
// If there is no data left in the cache, we want to continue
// and let the cache object itself get destroyed
if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
return;
}
}
}
// See jQuery.data for more information
if ( !pvt ) {
delete cache[ id ].data;
// Don't destroy the parent cache unless the internal data object
// had been the only thing left in it
if ( !isEmptyDataObject( cache[ id ] ) ) {
return;
}
}
// Destroy the cache
if ( isNode ) {
jQuery.cleanData( [ elem ], true );
// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
delete cache[ id ];
// When all else fails, null
} else {
cache[ id ] = null;
}
}
jQuery.extend({
cache: {},
// Unique for each copy of jQuery on the page
// Non-digits removed to match rinlinejQuery
expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
// Ban all objects except for Flash (which handle expandos)
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"applet": true
},
hasData: function( elem ) {
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
return !!elem && !isEmptyDataObject( elem );
},
data: function( elem, name, data ) {
return internalData( elem, name, data );
},
removeData: function( elem, name ) {
return internalRemoveData( elem, name );
},
// For internal use only.
_data: function( elem, name, data ) {
return internalData( elem, name, data, true );
},
_removeData: function( elem, name ) {
return internalRemoveData( elem, name, true );
},
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
// Do not set data on non-element because it will not be cleared (#8335).
if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
return false;
}
var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
// nodes accept data unless otherwise specified; rejection can be conditional
return !noData || noData !== true && elem.getAttribute("classid") === noData;
}
});
jQuery.fn.extend({
data: function( key, value ) {
var attrs, name,
elem = this[0],
i = 0,
data = null;
// Gets all values
if ( key === undefined ) {
if ( this.length ) {
data = jQuery.data( elem );
if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
attrs = elem.attributes;
for ( ; i < attrs.length; i++ ) {
name = attrs[i].name;
if ( !name.indexOf( "data-" ) ) {
name = jQuery.camelCase( name.slice(5) );
dataAttr( elem, name, data[ name ] );
}
}
jQuery._data( elem, "parsedAttrs", true );
}
}
return data;
}
// Sets multiple values
if ( typeof key === "object" ) {
return this.each(function() {
jQuery.data( this, key );
});
}
return jQuery.access( this, function( value ) {
if ( value === undefined ) {
// Try to fetch any internally stored data first
return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
}
this.each(function() {
jQuery.data( this, key, value );
});
}, null, value, arguments.length > 1, null, true );
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
function dataAttr( elem, key, data ) {
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
data = elem.getAttribute( name );
if ( typeof data === "string" ) {
try {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
// Only convert to a number if it doesn't change the string
+data + "" === data ? +data :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}
// Make sure we set the data so it isn't changed later
jQuery.data( elem, key, data );
} else {
data = undefined;
}
}
return data;
}
// checks a cache object for emptiness
function isEmptyDataObject( obj ) {
var name;
for ( name in obj ) {
// if the public data object is empty, the private is still empty
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
continue;
}
if ( name !== "toJSON" ) {
return false;
}
}
return true;
}
jQuery.extend({
queue: function( elem, type, data ) {
var queue;
if ( elem ) {
type = ( type || "fx" ) + "queue";
queue = jQuery._data( elem, type );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( data ) {
if ( !queue || jQuery.isArray(data) ) {
queue = jQuery._data( elem, type, jQuery.makeArray(data) );
} else {
queue.push( data );
}
}
return queue || [];
}
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ),
startLength = queue.length,
fn = queue.shift(),
hooks = jQuery._queueHooks( elem, type ),
next = function() {
jQuery.dequeue( elem, type );
};
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
startLength--;
}
hooks.cur = fn;
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift( "inprogress" );
}
// clear up the last queue stop function
delete hooks.stop;
fn.call( elem, next, hooks );
}
if ( !startLength && hooks ) {
hooks.empty.fire();
}
},
// not intended for public consumption - generates a queueHooks object, or returns the current one
_queueHooks: function( elem, type ) {
var key = type + "queueHooks";
return jQuery._data( elem, key ) || jQuery._data( elem, key, {
empty: jQuery.Callbacks("once memory").add(function() {
jQuery._removeData( elem, type + "queue" );
jQuery._removeData( elem, key );
})
});
}
});
jQuery.fn.extend({
queue: function( type, data ) {
var setter = 2;
if ( typeof type !== "string" ) {
data = type;
type = "fx";
setter--;
}
if ( arguments.length < setter ) {
return jQuery.queue( this[0], type );
}
return data === undefined ?
this :
this.each(function() {
var queue = jQuery.queue( this, type, data );
// ensure a hooks for this queue
jQuery._queueHooks( this, type );
if ( type === "fx" && queue[0] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
});
},
dequeue: function( type ) {
return this.each(function() {
jQuery.dequeue( this, type );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
delay: function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
type = type || "fx";
return this.queue( type, function( next, hooks ) {
var timeout = setTimeout( next, time );
hooks.stop = function() {
clearTimeout( timeout );
};
});
},
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
},
// Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
promise: function( type, obj ) {
var tmp,
count = 1,
defer = jQuery.Deferred(),
elements = this,
i = this.length,
resolve = function() {
if ( !( --count ) ) {
defer.resolveWith( elements, [ elements ] );
}
};
if ( typeof type !== "string" ) {
obj = type;
type = undefined;
}
type = type || "fx";
while( i-- ) {
tmp = jQuery._data( elements[ i ], type + "queueHooks" );
if ( tmp && tmp.empty ) {
count++;
tmp.empty.add( resolve );
}
}
resolve();
return defer.promise( obj );
}
});
var nodeHook, boolHook,
rclass = /[\t\r\n]/g,
rreturn = /\r/g,
rfocusable = /^(?:input|select|textarea|button|object)$/i,
rclickable = /^(?:a|area)$/i,
rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
ruseDefault = /^(?:checked|selected)$/i,
getSetAttribute = jQuery.support.getSetAttribute,
getSetInput = jQuery.support.input;
jQuery.fn.extend({
attr: function( name, value ) {
return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
},
removeAttr: function( name ) {
return this.each(function() {
jQuery.removeAttr( this, name );
});
},
prop: function( name, value ) {
return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
},
removeProp: function( name ) {
name = jQuery.propFix[ name ] || name;
return this.each(function() {
// try/catch handles cases where IE balks (such as removing a property on window)
try {
this[ name ] = undefined;
delete this[ name ];
} catch( e ) {}
});
},
addClass: function( value ) {
var classes, elem, cur, clazz, j,
i = 0,
len = this.length,
proceed = typeof value === "string" && value;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).addClass( value.call( this, j, this.className ) );
});
}
if ( proceed ) {
// The disjunction here is for better compressibility (see removeClass)
classes = ( value || "" ).match( core_rnotwhite ) || [];
for ( ; i < len; i++ ) {
elem = this[ i ];
cur = elem.nodeType === 1 && ( elem.className ?
( " " + elem.className + " " ).replace( rclass, " " ) :
" "
);
if ( cur ) {
j = 0;
while ( (clazz = classes[j++]) ) {
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
cur += clazz + " ";
}
}
elem.className = jQuery.trim( cur );
}
}
}
return this;
},
removeClass: function( value ) {
var classes, elem, cur, clazz, j,
i = 0,
len = this.length,
proceed = arguments.length === 0 || typeof value === "string" && value;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).removeClass( value.call( this, j, this.className ) );
});
}
if ( proceed ) {
classes = ( value || "" ).match( core_rnotwhite ) || [];
for ( ; i < len; i++ ) {
elem = this[ i ];
// This expression is here for better compressibility (see addClass)
cur = elem.nodeType === 1 && ( elem.className ?
( " " + elem.className + " " ).replace( rclass, " " ) :
""
);
if ( cur ) {
j = 0;
while ( (clazz = classes[j++]) ) {
// Remove *all* instances
while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
cur = cur.replace( " " + clazz + " ", " " );
}
}
elem.className = value ? jQuery.trim( cur ) : "";
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
return this.each(function( i ) {
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
});
}
return this.each(function() {
if ( type === "string" ) {
// toggle individual class names
var className,
i = 0,
self = jQuery( this ),
state = stateVal,
classNames = value.match( core_rnotwhite ) || [];
while ( (className = classNames[ i++ ]) ) {
// check each className given, space separated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
// Toggle whole class name
} else if ( type === core_strundefined || type === "boolean" ) {
if ( this.className ) {
// store className if set
jQuery._data( this, "__className__", this.className );
}
// If the element has a class name or if we're passed "false",
// then remove the whole classname (if there was one, the above saved it).
// Otherwise bring back whatever was previously saved (if anything),
// falling back to the empty string if nothing was stored.
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
}
});
},
hasClass: function( selector ) {
var className = " " + selector + " ",
i = 0,
l = this.length;
for ( ; i < l; i++ ) {
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
return true;
}
}
return false;
},
val: function( value ) {
var ret, hooks, isFunction,
elem = this[0];
if ( !arguments.length ) {
if ( elem ) {
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
return ret;
}
ret = elem.value;
return typeof ret === "string" ?
// handle most common string cases
ret.replace(rreturn, "") :
// handle cases where value is null/undef or number
ret == null ? "" : ret;
}
return;
}
isFunction = jQuery.isFunction( value );
return this.each(function( i ) {
var val,
self = jQuery(this);
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call( this, i, self.val() );
} else {
val = value;
}
// Treat null/undefined as ""; convert numbers to string
if ( val == null ) {
val = "";
} else if ( typeof val === "number" ) {
val += "";
} else if ( jQuery.isArray( val ) ) {
val = jQuery.map(val, function ( value ) {
return value == null ? "" : value + "";
});
}
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
// If set returns undefined, fall back to normal setting
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
this.value = val;
}
});
}
});
jQuery.extend({
valHooks: {
option: {
get: function( elem ) {
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var val = elem.attributes.value;
return !val || val.specified ? elem.value : elem.text;
}
},
select: {
get: function( elem ) {
var value, option,
options = elem.options,
index = elem.selectedIndex,
one = elem.type === "select-one" || index < 0,
values = one ? null : [],
max = one ? index + 1 : options.length,
i = index < 0 ?
max :
one ? index : 0;
// Loop through all the selected options
for ( ; i < max; i++ ) {
option = options[ i ];
// oldIE doesn't update selected after form reset (#2551)
if ( ( option.selected || i === index ) &&
// Don't return options that are disabled or in a disabled optgroup
( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
// Get the specific value for the option
value = jQuery( option ).val();
// We don't need an array for one selects
if ( one ) {
return value;
}
// Multi-Selects return an array
values.push( value );
}
}
return values;
},
set: function( elem, value ) {
var values = jQuery.makeArray( value );
jQuery(elem).find("option").each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
});
if ( !values.length ) {
elem.selectedIndex = -1;
}
return values;
}
}
},
attr: function( elem, name, value ) {
var hooks, notxml, ret,
nType = elem.nodeType;
// don't get/set attributes on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
}
// Fallback to prop when attributes are not supported
if ( typeof elem.getAttribute === core_strundefined ) {
return jQuery.prop( elem, name, value );
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
// All attributes are lowercase
// Grab necessary hook if one is defined
if ( notxml ) {
name = name.toLowerCase();
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
}
if ( value !== undefined ) {
if ( value === null ) {
jQuery.removeAttr( elem, name );
} else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
elem.setAttribute( name, value + "" );
return value;
}
} else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
// In IE9+, Flash objects don't have .getAttribute (#12945)
// Support: IE9+
if ( typeof elem.getAttribute !== core_strundefined ) {
ret = elem.getAttribute( name );
}
// Non-existent attributes return null, we normalize to undefined
return ret == null ?
undefined :
ret;
}
},
removeAttr: function( elem, value ) {
var name, propName,
i = 0,
attrNames = value && value.match( core_rnotwhite );
if ( attrNames && elem.nodeType === 1 ) {
while ( (name = attrNames[i++]) ) {
propName = jQuery.propFix[ name ] || name;
// Boolean attributes get special treatment (#10870)
if ( rboolean.test( name ) ) {
// Set corresponding property to false for boolean attributes
// Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
if ( !getSetAttribute && ruseDefault.test( name ) ) {
elem[ jQuery.camelCase( "default-" + name ) ] =
elem[ propName ] = false;
} else {
elem[ propName ] = false;
}
// See #9699 for explanation of this approach (setting first, then removal)
} else {
jQuery.attr( elem, name, "" );
}
elem.removeAttribute( getSetAttribute ? name : propName );
}
}
},
attrHooks: {
type: {
set: function( elem, value ) {
if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to default in case type is set after value during creation
var val = elem.value;
elem.setAttribute( "type", value );
if ( val ) {
elem.value = val;
}
return value;
}
}
}
},
propFix: {
tabindex: "tabIndex",
readonly: "readOnly",
"for": "htmlFor",
"class": "className",
maxlength: "maxLength",
cellspacing: "cellSpacing",
cellpadding: "cellPadding",
rowspan: "rowSpan",
colspan: "colSpan",
usemap: "useMap",
frameborder: "frameBorder",
contenteditable: "contentEditable"
},
prop: function( elem, name, value ) {
var ret, hooks, notxml,
nType = elem.nodeType;
// don't get/set properties on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return;
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
if ( notxml ) {
// Fix name and attach hooks
name = jQuery.propFix[ name ] || name;
hooks = jQuery.propHooks[ name ];
}
if ( value !== undefined ) {
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
return ( elem[ name ] = value );
}
} else {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
return elem[ name ];
}
}
},
propHooks: {
tabIndex: {
get: function( elem ) {
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
var attributeNode = elem.getAttributeNode("tabindex");
return attributeNode && attributeNode.specified ?
parseInt( attributeNode.value, 10 ) :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
}
}
});
// Hook for boolean attributes
boolHook = {
get: function( elem, name ) {
var
// Use .prop to determine if this attribute is understood as boolean
prop = jQuery.prop( elem, name ),
// Fetch it accordingly
attr = typeof prop === "boolean" && elem.getAttribute( name ),
detail = typeof prop === "boolean" ?
getSetInput && getSetAttribute ?
attr != null :
// oldIE fabricates an empty string for missing boolean attributes
// and conflates checked/selected into attroperties
ruseDefault.test( name ) ?
elem[ jQuery.camelCase( "default-" + name ) ] :
!!attr :
// fetch an attribute node for properties not recognized as boolean
elem.getAttributeNode( name );
return detail && detail.value !== false ?
name.toLowerCase() :
undefined;
},
set: function( elem, value, name ) {
if ( value === false ) {
// Remove boolean attributes when set to false
jQuery.removeAttr( elem, name );
} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
// IE<8 needs the *property* name
elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
// Use defaultChecked and defaultSelected for oldIE
} else {
elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
}
return name;
}
};
// fix oldIE value attroperty
if ( !getSetInput || !getSetAttribute ) {
jQuery.attrHooks.value = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
return jQuery.nodeName( elem, "input" ) ?
// Ignore the value *property* by using defaultValue
elem.defaultValue :
ret && ret.specified ? ret.value : undefined;
},
set: function( elem, value, name ) {
if ( jQuery.nodeName( elem, "input" ) ) {
// Does not return so that setAttribute is also used
elem.defaultValue = value;
} else {
// Use nodeHook if defined (#1954); otherwise setAttribute is fine
return nodeHook && nodeHook.set( elem, value, name );
}
}
};
}
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !getSetAttribute ) {
// Use this for any attribute in IE6/7
// This fixes almost every IE6/7 issue
nodeHook = jQuery.valHooks.button = {
get: function( elem, name ) {
var ret = elem.getAttributeNode( name );
return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
ret.value :
undefined;
},
set: function( elem, value, name ) {
// Set the existing or create a new attribute node
var ret = elem.getAttributeNode( name );
if ( !ret ) {
elem.setAttributeNode(
(ret = elem.ownerDocument.createAttribute( name ))
);
}
ret.value = value += "";
// Break association with cloned elements by also using setAttribute (#9646)
return name === "value" || value === elem.getAttribute( name ) ?
value :
undefined;
}
};
// Set contenteditable to false on removals(#10429)
// Setting to empty string throws an error as an invalid value
jQuery.attrHooks.contenteditable = {
get: nodeHook.get,
set: function( elem, value, name ) {
nodeHook.set( elem, value === "" ? false : value, name );
}
};
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
// This is for removals
jQuery.each([ "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
set: function( elem, value ) {
if ( value === "" ) {
elem.setAttribute( name, "auto" );
return value;
}
}
});
});
}
// Some attributes require a special call on IE
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !jQuery.support.hrefNormalized ) {
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
get: function( elem ) {
var ret = elem.getAttribute( name, 2 );
return ret == null ? undefined : ret;
}
});
});
// href/src property should get the full normalized URL (#10299/#12915)
jQuery.each([ "href", "src" ], function( i, name ) {
jQuery.propHooks[ name ] = {
get: function( elem ) {
return elem.getAttribute( name, 4 );
}
};
});
}
if ( !jQuery.support.style ) {
jQuery.attrHooks.style = {
get: function( elem ) {
// Return undefined in the case of empty string
// Note: IE uppercases css property names, but if we were to .toLowerCase()
// .cssText, that would destroy case senstitivity in URL's, like in "background"
return elem.style.cssText || undefined;
},
set: function( elem, value ) {
return ( elem.style.cssText = value + "" );
}
};
}
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( !jQuery.support.optSelected ) {
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
get: function( elem ) {
var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
// Make sure that it also works with optgroups, see #5701
if ( parent.parentNode ) {
parent.parentNode.selectedIndex;
}
}
return null;
}
});
}
// IE6/7 call enctype encoding
if ( !jQuery.support.enctype ) {
jQuery.propFix.enctype = "encoding";
}
// Radios and checkboxes getter/setter
if ( !jQuery.support.checkOn ) {
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
get: function( elem ) {
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
return elem.getAttribute("value") === null ? "on" : elem.value;
}
};
});
}
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
}
}
});
});
var rformElems = /^(?:input|select|textarea)$/i,
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
function returnTrue() {
return true;
}
function returnFalse() {
return false;
}
/*
* Helper functions for managing events -- not part of the public interface.
* Props to Dean Edwards' addEvent library for many of the ideas.
*/
jQuery.event = {
global: {},
add: function( elem, types, handler, data, selector ) {
var tmp, events, t, handleObjIn,
special, eventHandle, handleObj,
handlers, type, namespaces, origType,
elemData = jQuery._data( elem );
// Don't attach events to noData or text/comment nodes (but allow plain objects)
if ( !elemData ) {
return;
}
// Caller can pass in an object of custom data in lieu of the handler
if ( handler.handler ) {
handleObjIn = handler;
handler = handleObjIn.handler;
selector = handleObjIn.selector;
}
// Make sure that the handler has a unique ID, used to find/remove it later
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
// Init the element's event structure and main handler, if this is the first
if ( !(events = elemData.events) ) {
events = elemData.events = {};
}
if ( !(eventHandle = elemData.handle) ) {
eventHandle = elemData.handle = function( e ) {
// Discard the second event of a jQuery.event.trigger() and
// when an event is called after a page has unloaded
return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
undefined;
};
// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
eventHandle.elem = elem;
}
// Handle multiple events separated by a space
// jQuery(...).bind("mouseover mouseout", fn);
types = ( types || "" ).match( core_rnotwhite ) || [""];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || [];
type = origType = tmp[1];
namespaces = ( tmp[2] || "" ).split( "." ).sort();
// If event changes its type, use the special event handlers for the changed type
special = jQuery.event.special[ type ] || {};
// If selector defined, determine special event api type, otherwise given type
type = ( selector ? special.delegateType : special.bindType ) || type;
// Update special based on newly reset type
special = jQuery.event.special[ type ] || {};
// handleObj is passed to all event handlers
handleObj = jQuery.extend({
type: type,
origType: origType,
data: data,
handler: handler,
guid: handler.guid,
selector: selector,
needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
namespace: namespaces.join(".")
}, handleObjIn );
// Init the event handler queue if we're the first
if ( !(handlers = events[ type ]) ) {
handlers = events[ type ] = [];
handlers.delegateCount = 0;
// Only use addEventListener/attachEvent if the special events handler returns false
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
// Bind the global event handler to the element
if ( elem.addEventListener ) {
elem.addEventListener( type, eventHandle, false );
} else if ( elem.attachEvent ) {
elem.attachEvent( "on" + type, eventHandle );
}
}
}
if ( special.add ) {
special.add.call( elem, handleObj );
if ( !handleObj.handler.guid ) {
handleObj.handler.guid = handler.guid;
}
}
// Add to the element's handler list, delegates in front
if ( selector ) {
handlers.splice( handlers.delegateCount++, 0, handleObj );
} else {
handlers.push( handleObj );
}
// Keep track of which events have ever been used, for event optimization
jQuery.event.global[ type ] = true;
}
// Nullify elem to prevent memory leaks in IE
elem = null;
},
// Detach an event or set of events from an element
remove: function( elem, types, handler, selector, mappedTypes ) {
var j, handleObj, tmp,
origCount, t, events,
special, handlers, type,
namespaces, origType,
elemData = jQuery.hasData( elem ) && jQuery._data( elem );
if ( !elemData || !(events = elemData.events) ) {
return;
}
// Once for each type.namespace in types; type may be omitted
types = ( types || "" ).match( core_rnotwhite ) || [""];
t = types.length;
while ( t-- ) {
tmp = rtypenamespace.exec( types[t] ) || [];
type = origType = tmp[1];
namespaces = ( tmp[2] || "" ).split( "." ).sort();
// Unbind all events (on this namespace, if provided) for the element
if ( !type ) {
for ( type in events ) {
jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
}
continue;
}
special = jQuery.event.special[ type ] || {};
type = ( selector ? special.delegateType : special.bindType ) || type;
handlers = events[ type ] || [];
tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
// Remove matching events
origCount = j = handlers.length;
while ( j-- ) {
handleObj = handlers[ j ];
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
handlers.splice( j, 1 );
if ( handleObj.selector ) {
handlers.delegateCount--;
}
if ( special.remove ) {
special.remove.call( elem, handleObj );
}
}
}
// Remove generic event handler if we removed something and no more handlers exist
// (avoids potential for endless recursion during removal of special event handlers)
if ( origCount && !handlers.length ) {
if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
delete events[ type ];
}
}
// Remove the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
delete elemData.handle;
// removeData also checks for emptiness and clears the expando if empty
// so use it instead of delete
jQuery._removeData( elem, "events" );
}
},
trigger: function( event, data, elem, onlyHandlers ) {
var handle, ontype, cur,
bubbleType, special, tmp, i,
eventPath = [ elem || document ],
type = core_hasOwn.call( event, "type" ) ? event.type : event,
namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
cur = tmp = elem = elem || document;
// Don't do events on text and comment nodes
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
return;
}
// focus/blur morphs to focusin/out; ensure we're not firing them right now
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
return;
}
if ( type.indexOf(".") >= 0 ) {
// Namespaced trigger; create a regexp to match event type in handle()
namespaces = type.split(".");
type = namespaces.shift();
namespaces.sort();
}
ontype = type.indexOf(":") < 0 && "on" + type;
// Caller can pass in a jQuery.Event object, Object, or just an event type string
event = event[ jQuery.expando ] ?
event :
new jQuery.Event( type, typeof event === "object" && event );
event.isTrigger = true;
event.namespace = namespaces.join(".");
event.namespace_re = event.namespace ?
new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
null;
// Clean up the event in case it is being reused
event.result = undefined;
if ( !event.target ) {
event.target = elem;
}
// Clone any incoming data and prepend the event, creating the handler arg list
data = data == null ?
[ event ] :
jQuery.makeArray( data, [ event ] );
// Allow special events to draw outside the lines
special = jQuery.event.special[ type ] || {};
if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
return;
}
// Determine event propagation path in advance, per W3C events spec (#9951)
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
bubbleType = special.delegateType || type;
if ( !rfocusMorph.test( bubbleType + type ) ) {
cur = cur.parentNode;
}
for ( ; cur; cur = cur.parentNode ) {
eventPath.push( cur );
tmp = cur;
}
// Only add window if we got to document (e.g., not plain obj or detached DOM)
if ( tmp === (elem.ownerDocument || document) ) {
eventPath.push( tmp.defaultView || tmp.parentWindow || window );
}
}
// Fire handlers on the event path
i = 0;
while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
event.type = i > 1 ?
bubbleType :
special.bindType || type;
// jQuery handler
handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
if ( handle ) {
handle.apply( cur, data );
}
// Native handler
handle = ontype && cur[ ontype ];
if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
event.preventDefault();
}
}
event.type = type;
// If nobody prevented the default action, do it now
if ( !onlyHandlers && !event.isDefaultPrevented() ) {
if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
// Call a native DOM method on the target with the same name name as the event.
// Can't use an .isFunction() check here because IE6/7 fails that test.
// Don't do default actions on window, that's where global variables be (#6170)
if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
// Don't re-trigger an onFOO event when we call its FOO() method
tmp = elem[ ontype ];
if ( tmp ) {
elem[ ontype ] = null;
}
// Prevent re-triggering of the same event, since we already bubbled it above
jQuery.event.triggered = type;
try {
elem[ type ]();
} catch ( e ) {
// IE<9 dies on focus/blur to hidden element (#1486,#12518)
// only reproducible on winXP IE8 native, not IE9 in IE8 mode
}
jQuery.event.triggered = undefined;
if ( tmp ) {
elem[ ontype ] = tmp;
}
}
}
}
return event.result;
},
dispatch: function( event ) {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event );
var i, ret, handleObj, matched, j,
handlerQueue = [],
args = core_slice.call( arguments ),
handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
special = jQuery.event.special[ event.type ] || {};
// Use the fix-ed jQuery.Event rather than the (read-only) native event
args[0] = event;
event.delegateTarget = this;
// Call the preDispatch hook for the mapped type, and let it bail if desired
if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
return;
}
// Determine handlers
handlerQueue = jQuery.event.handlers.call( this, event, handlers );
// Run delegates first; they may want to stop propagation beneath us
i = 0;
while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
event.currentTarget = matched.elem;
j = 0;
while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
// Triggered event must either 1) have no namespace, or
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
event.handleObj = handleObj;
event.data = handleObj.data;
var obj = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler );
if(obj.apply){
ret = obj.apply( matched.elem, args );
}
if ( ret !== undefined ) {
if ( (event.result = ret) === false ) {
event.preventDefault();
event.stopPropagation();
}
}
}
}
}
// Call the postDispatch hook for the mapped type
if ( special.postDispatch ) {
special.postDispatch.call( this, event );
}
return event.result;
},
handlers: function( event, handlers ) {
var sel, handleObj, matches, i,
handlerQueue = [],
delegateCount = handlers.delegateCount,
cur = event.target;
// Find delegate handlers
// Black-hole SVG <use> instance trees (#13180)
// Avoid non-left-click bubbling in Firefox (#3861)
if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
for ( ; cur != this; cur = cur.parentNode || this ) {
// Don't check non-elements (#13208)
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
matches = [];
for ( i = 0; i < delegateCount; i++ ) {
handleObj = handlers[ i ];
// Don't conflict with Object.prototype properties (#13203)
sel = handleObj.selector + " ";
if ( matches[ sel ] === undefined ) {
matches[ sel ] = handleObj.needsContext ?
jQuery( sel, this ).index( cur ) >= 0 :
jQuery.find( sel, this, null, [ cur ] ).length;
}
if ( matches[ sel ] ) {
matches.push( handleObj );
}
}
if ( matches.length ) {
handlerQueue.push({ elem: cur, handlers: matches });
}
}
}
}
// Add the remaining (directly-bound) handlers
if ( delegateCount < handlers.length ) {
handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
}
return handlerQueue;
},
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
// Create a writable copy of the event object and normalize some properties
var i, prop, copy,
type = event.type,
originalEvent = event,
fixHook = this.fixHooks[ type ];
if ( !fixHook ) {
this.fixHooks[ type ] = fixHook =
rmouseEvent.test( type ) ? this.mouseHooks :
rkeyEvent.test( type ) ? this.keyHooks :
{};
}
copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
event = new jQuery.Event( originalEvent );
i = copy.length;
while ( i-- ) {
prop = copy[ i ];
event[ prop ] = originalEvent[ prop ];
}
// Support: IE<9
// Fix target property (#1925)
if ( !event.target ) {
event.target = originalEvent.srcElement || document;
}
// Support: Chrome 23+, Safari?
// Target should not be a text node (#504, #13143)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
}
// Support: IE<9
// For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
event.metaKey = !!event.metaKey;
return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
},
// Includes some event props shared by KeyEvent and MouseEvent
props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks: {},
keyHooks: {
props: "char charCode key keyCode".split(" "),
filter: function( event, original ) {
// Add which for key events
if ( event.which == null ) {
event.which = original.charCode != null ? original.charCode : original.keyCode;
}
return event;
}
},
mouseHooks: {
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
filter: function( event, original ) {
var body, eventDoc, doc,
button = original.button,
fromElement = original.fromElement;
// Calculate pageX/Y if missing and clientX/Y available
if ( event.pageX == null && original.clientX != null ) {
eventDoc = event.target.ownerDocument || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
}
// Add relatedTarget, if necessary
if ( !event.relatedTarget && fromElement ) {
event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
}
// Add which for click: 1 === left; 2 === middle; 3 === right
// Note: button is not normalized, so don't use it
if ( !event.which && button !== undefined ) {
event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
}
return event;
}
},
special: {
load: {
// Prevent triggered image.load events from bubbling to window.load
noBubble: true
},
click: {
// For checkbox, fire native event so checked state will be right
trigger: function() {
if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
this.click();
return false;
}
}
},
focus: {
// Fire native event if possible so blur/focus sequence is correct
trigger: function() {
if ( this !== document.activeElement && this.focus ) {
try {
this.focus();
return false;
} catch ( e ) {
// Support: IE<9
// If we error on focus to hidden element (#1486, #12518),
// let .trigger() run the handlers
}
}
},
delegateType: "focusin"
},
blur: {
trigger: function() {
if ( this === document.activeElement && this.blur ) {
this.blur();
return false;
}
},
delegateType: "focusout"
},
beforeunload: {
postDispatch: function( event ) {
// Even when returnValue equals to undefined Firefox will still show alert
if ( event.result !== undefined ) {
event.originalEvent.returnValue = event.result;
}
}
}
},
simulate: function( type, elem, event, bubble ) {
// Piggyback on a donor event to simulate a different one.
// Fake originalEvent to avoid donor's stopPropagation, but if the
// simulated event prevents default then we do the same on the donor.
var e = jQuery.extend(
new jQuery.Event(),
event,
{ type: type,
isSimulated: true,
originalEvent: {}
}
);
if ( bubble ) {
jQuery.event.trigger( e, null, elem );
} else {
jQuery.event.dispatch.call( elem, e );
}
if ( e.isDefaultPrevented() ) {
event.preventDefault();
}
}
};
jQuery.removeEvent = document.removeEventListener ?
function( elem, type, handle ) {
if ( elem.removeEventListener ) {
elem.removeEventListener( type, handle, false );
}
} :
function( elem, type, handle ) {
var name = "on" + type;
if ( elem.detachEvent ) {
// #8545, #7054, preventing memory leaks for custom events in IE6-8
// detachEvent needed property on element, by name of that event, to properly expose it to GC
if ( typeof elem[ name ] === core_strundefined ) {
elem[ name ] = null;
}
elem.detachEvent( name, handle );
}
};
jQuery.Event = function( src, props ) {
// Allow instantiation without the 'new' keyword
if ( !(this instanceof jQuery.Event) ) {
return new jQuery.Event( src, props );
}
// Event object
if ( src && src.type ) {
this.originalEvent = src;
this.type = src.type;
// Events bubbling up the document may have been marked as prevented
// by a handler lower down the tree; reflect the correct value.
this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
// Event type
} else {
this.type = src;
}
// Put explicitly provided properties onto the event object
if ( props ) {
jQuery.extend( this, props );
}
// Create a timestamp if incoming event doesn't have one
this.timeStamp = src && src.timeStamp || jQuery.now();
// Mark it as fixed
this[ jQuery.expando ] = true;
};
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse,
preventDefault: function() {
var e = this.originalEvent;
this.isDefaultPrevented = returnTrue;
if ( !e ) {
return;
}
// If preventDefault exists, run it on the original event
if ( e.preventDefault ) {
e.preventDefault();
// Support: IE
// Otherwise set the returnValue property of the original event to false
} else {
e.returnValue = false;
}
},
stopPropagation: function() {
var e = this.originalEvent;
this.isPropagationStopped = returnTrue;
if ( !e ) {
return;
}
// If stopPropagation exists, run it on the original event
if ( e.stopPropagation ) {
e.stopPropagation();
}
// Support: IE
// Set the cancelBubble property of the original event to true
e.cancelBubble = true;
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
}
};
// Create mouseenter/leave events using mouseover/out and event-time checks
jQuery.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function( orig, fix ) {
jQuery.event.special[ orig ] = {
delegateType: fix,
bindType: fix,
handle: function( event ) {
var ret,
target = this,
related = event.relatedTarget,
handleObj = event.handleObj;
// For mousenter/leave call the handler if related is outside the target.
// NB: No relatedTarget if the mouse left/entered the browser window
if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
event.type = handleObj.origType;
ret = handleObj.handler.apply( this, arguments );
event.type = fix;
}
return ret;
}
};
});
// IE submit delegation
if ( !jQuery.support.submitBubbles ) {
jQuery.event.special.submit = {
setup: function() {
// Only need this for delegated form submit events
if ( jQuery.nodeName( this, "form" ) ) {
return false;
}
// Lazy-add a submit handler when a descendant form may potentially be submitted
jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
// Node name check avoids a VML-related crash in IE (#9807)
var elem = e.target,
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
if ( form && !jQuery._data( form, "submitBubbles" ) ) {
jQuery.event.add( form, "submit._submit", function( event ) {
event._submit_bubble = true;
});
jQuery._data( form, "submitBubbles", true );
}
});
// return undefined since we don't need an event listener
},
postDispatch: function( event ) {
// If form was submitted by the user, bubble the event up the tree
if ( event._submit_bubble ) {
delete event._submit_bubble;
if ( this.parentNode && !event.isTrigger ) {
jQuery.event.simulate( "submit", this.parentNode, event, true );
}
}
},
teardown: function() {
// Only need this for delegated form submit events
if ( jQuery.nodeName( this, "form" ) ) {
return false;
}
// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
jQuery.event.remove( this, "._submit" );
}
};
}
// IE change delegation and checkbox/radio fix
if ( !jQuery.support.changeBubbles ) {
jQuery.event.special.change = {
setup: function() {
if ( rformElems.test( this.nodeName ) ) {
// IE doesn't fire change on a check/radio until blur; trigger it on click
// after a propertychange. Eat the blur-change in special.change.handle.
// This still fires onchange a second time for check/radio after blur.
if ( this.type === "checkbox" || this.type === "radio" ) {
jQuery.event.add( this, "propertychange._change", function( event ) {
if ( event.originalEvent.propertyName === "checked" ) {
this._just_changed = true;
}
});
jQuery.event.add( this, "click._change", function( event ) {
if ( this._just_changed && !event.isTrigger ) {
this._just_changed = false;
}
// Allow triggered, simulated change events (#11500)
jQuery.event.simulate( "change", this, event, true );
});
}
return false;
}
// Delegated event; lazy-add a change handler on descendant inputs
jQuery.event.add( this, "beforeactivate._change", function( e ) {
var elem = e.target;
if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
jQuery.event.add( elem, "change._change", function( event ) {
if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
jQuery.event.simulate( "change", this.parentNode, event, true );
}
});
jQuery._data( elem, "changeBubbles", true );
}
});
},
handle: function( event ) {
var elem = event.target;
// Swallow native change events from checkbox/radio, we already triggered them above
if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
return event.handleObj.handler.apply( this, arguments );
}
},
teardown: function() {
jQuery.event.remove( this, "._change" );
return !rformElems.test( this.nodeName );
}
};
}
// Create "bubbling" focus and blur events
if ( !jQuery.support.focusinBubbles ) {
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
// Attach a single capturing handler while someone wants focusin/focusout
var attaches = 0,
handler = function( event ) {
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
};
jQuery.event.special[ fix ] = {
setup: function() {
if ( attaches++ === 0 ) {
document.addEventListener( orig, handler, true );
}
},
teardown: function() {
if ( --attaches === 0 ) {
document.removeEventListener( orig, handler, true );
}
}
};
});
}
jQuery.fn.extend({
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
var type, origFn;
// Types can be a map of types/handlers
if ( typeof types === "object" ) {
// ( types-Object, selector, data )
if ( typeof selector !== "string" ) {
// ( types-Object, data )
data = data || selector;
selector = undefined;
}
for ( type in types ) {
this.on( type, selector, data, types[ type ], one );
}
return this;
}
if ( data == null && fn == null ) {
// ( types, fn )
fn = selector;
data = selector = undefined;
} else if ( fn == null ) {
if ( typeof selector === "string" ) {
// ( types, selector, fn )
fn = data;
data = undefined;
} else {
// ( types, data, fn )
fn = data;
data = selector;
selector = undefined;
}
}
if ( fn === false ) {
fn = returnFalse;
} else if ( !fn ) {
return this;
}
if ( one === 1 ) {
origFn = fn;
fn = function( event ) {
// Can use an empty set, since event contains the info
jQuery().off( event );
return origFn.apply( this, arguments );
};
// Use same guid so caller can remove using origFn
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
}
return this.each( function() {
jQuery.event.add( this, types, fn, data, selector );
});
},
one: function( types, selector, data, fn ) {
return this.on( types, selector, data, fn, 1 );
},
off: function( types, selector, fn ) {
var handleObj, type;
if ( types && types.preventDefault && types.handleObj ) {
// ( event ) dispatched jQuery.Event
handleObj = types.handleObj;
jQuery( types.delegateTarget ).off(
handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
handleObj.selector,
handleObj.handler
);
return this;
}
if ( typeof types === "object" ) {
// ( types-object [, selector] )
for ( type in types ) {
this.off( type, selector, types[ type ] );
}
return this;
}
if ( selector === false || typeof selector === "function" ) {
// ( types [, fn] )
fn = selector;
selector = undefined;
}
if ( fn === false ) {
fn = returnFalse;
}
return this.each(function() {
jQuery.event.remove( this, types, fn, selector );
});
},
bind: function( types, data, fn ) {
return this.on( types, null, data, fn );
},
unbind: function( types, fn ) {
return this.off( types, null, fn );
},
delegate: function( selector, types, data, fn ) {
return this.on( types, selector, data, fn );
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
},
trigger: function( type, data ) {
return this.each(function() {
jQuery.event.trigger( type, data, this );
});
},
triggerHandler: function( type, data ) {
var elem = this[0];
if ( elem ) {
return jQuery.event.trigger( type, data, elem, true );
}
}
});
/*!
* Sizzle CSS Selector Engine
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license
* http://sizzlejs.com/
*/
(function( window, undefined ) {
var i,
cachedruns,
Expr,
getText,
isXML,
compile,
hasDuplicate,
outermostContext,
// Local document vars
setDocument,
document,
docElem,
documentIsXML,
rbuggyQSA,
rbuggyMatches,
matches,
contains,
sortOrder,
// Instance-specific data
expando = "sizzle" + -(new Date()),
preferredDoc = window.document,
support = {},
dirruns = 0,
done = 0,
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
// General-purpose constants
strundefined = typeof undefined,
MAX_NEGATIVE = 1 << 31,
// Array methods
arr = [],
pop = arr.pop,
push = arr.push,
slice = arr.slice,
// Use a stripped-down indexOf if we can't use a native one
indexOf = arr.indexOf || function( elem ) {
var i = 0,
len = this.length;
for ( ; i < len; i++ ) {
if ( this[i] === elem ) {
return i;
}
}
return -1;
},
// Regular expressions
// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
whitespace = "[\\x20\\t\\r\\n\\f]",
// http://www.w3.org/TR/css3-syntax/#characters
characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
// Loosely modeled on CSS identifier characters
// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
identifier = characterEncoding.replace( "w", "w#" ),
// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
operators = "([*^$|!~]?=)",
attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
"*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
// Prefer arguments quoted,
// then not containing pseudos/brackets,
// then attribute selectors/non-parenthetical expressions,
// then anything else
// These preferences are here to reduce the number of selectors
// needing tokenize in the PSEUDO preFilter
pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ),
matchExpr = {
"ID": new RegExp( "^#(" + characterEncoding + ")" ),
"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
"NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
"ATTR": new RegExp( "^" + attributes ),
"PSEUDO": new RegExp( "^" + pseudos ),
"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
// For use in libraries implementing .is()
// We use this for POS matching in `select`
"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
},
rsibling = /[\x20\t\r\n\f]*[+~]/,
rnative = /^[^{]+\{\s*\[native code/,
// Easily-parseable/retrievable ID or TAG or CLASS selectors
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
rinputs = /^(?:input|select|textarea|button)$/i,
rheader = /^h\d$/i,
rescape = /'|\\/g,
rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
funescape = function( _, escaped ) {
var high = "0x" + escaped - 0x10000;
// NaN means non-codepoint
return high !== high ?
escaped :
// BMP codepoint
high < 0 ?
String.fromCharCode( high + 0x10000 ) :
// Supplemental Plane codepoint (surrogate pair)
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
};
// Use a stripped-down slice if we can't use a native one
try {
slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;
} catch ( e ) {
slice = function( i ) {
var elem,
results = [];
while ( (elem = this[i++]) ) {
results.push( elem );
}
return results;
};
}
/**
* For feature detection
* @param {Function} fn The function to test for native support
*/
function isNative( fn ) {
return rnative.test( fn + "" );
}
/**
* Create key-value caches of limited size
* @returns {Function(string, Object)} Returns the Object data after storing it on itself with
* property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
* deleting the oldest entry
*/
function createCache() {
var cache,
keys = [];
return (cache = function( key, value ) {
// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
if ( keys.push( key += " " ) > Expr.cacheLength ) {
// Only keep the most recent entries
delete cache[ keys.shift() ];
}
return (cache[ key ] = value);
});
}
/**
* Mark a function for special use by Sizzle
* @param {Function} fn The function to mark
*/
function markFunction( fn ) {
fn[ expando ] = true;
return fn;
}
/**
* Support testing using an element
* @param {Function} fn Passed the created div and expects a boolean result
*/
function assert( fn ) {
var div = document.createElement("div");
try {
return fn( div );
} catch (e) {
return false;
} finally {
// release memory in IE
div = null;
}
}
function Sizzle( selector, context, results, seed ) {
var match, elem, m, nodeType,
// QSA vars
i, groups, old, nid, newContext, newSelector;
if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
setDocument( context );
}
context = context || document;
results = results || [];
if ( !selector || typeof selector !== "string" ) {
return results;
}
if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
return [];
}
if ( !documentIsXML && !seed ) {
// Shortcuts
if ( (match = rquickExpr.exec( selector )) ) {
// Speed-up: Sizzle("#ID")
if ( (m = match[1]) ) {
if ( nodeType === 9 ) {
elem = context.getElementById( m );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE, Opera, and Webkit return items
// by name instead of ID
if ( elem.id === m ) {
results.push( elem );
return results;
}
} else {
return results;
}
} else {
// Context is not a document
if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
contains( context, elem ) && elem.id === m ) {
results.push( elem );
return results;
}
}
// Speed-up: Sizzle("TAG")
} else if ( match[2] ) {
push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
return results;
// Speed-up: Sizzle(".CLASS")
} else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {
push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
return results;
}
}
// QSA path
if ( support.qsa && !rbuggyQSA.test(selector) ) {
old = true;
nid = expando;
newContext = context;
newSelector = nodeType === 9 && selector;
// qSA works strangely on Element-rooted queries
// We can work around this by specifying an extra ID on the root
// and working up from there (Thanks to Andrew Dupont for the technique)
// IE 8 doesn't work on object elements
if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
groups = tokenize( selector );
if ( (old = context.getAttribute("id")) ) {
nid = old.replace( rescape, "\\$&" );
} else {
context.setAttribute( "id", nid );
}
nid = "[id='" + nid + "'] ";
i = groups.length;
while ( i-- ) {
groups[i] = nid + toSelector( groups[i] );
}
newContext = rsibling.test( selector ) && context.parentNode || context;
newSelector = groups.join(",");
}
if ( newSelector ) {
try {
push.apply( results, slice.call( newContext.querySelectorAll(
newSelector
), 0 ) );
return results;
} catch(qsaError) {
} finally {
if ( !old ) {
context.removeAttribute("id");
}
}
}
}
}
// All others
return select( selector.replace( rtrim, "$1" ), context, results, seed );
}
/**
* Detect xml
* @param {Element|Object} elem An element or a document
*/
isXML = Sizzle.isXML = function( elem ) {
// documentElement is verified for cases where it doesn't yet exist
// (such as loading iframes in IE - #4833)
var documentElement = elem && (elem.ownerDocument || elem).documentElement;
return documentElement ? documentElement.nodeName !== "HTML" : false;
};
/**
* Sets document-related variables once based on the current document
* @param {Element|Object} [doc] An element or document object to use to set the document
* @returns {Object} Returns the current document
*/
setDocument = Sizzle.setDocument = function( node ) {
var doc = node ? node.ownerDocument || node : preferredDoc;
// If no document and documentElement is available, return
if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
return document;
}
// Set our document
document = doc;
docElem = doc.documentElement;
// Support tests
documentIsXML = isXML( doc );
// Check if getElementsByTagName("*") returns only elements
support.tagNameNoComments = assert(function( div ) {
div.appendChild( doc.createComment("") );
return !div.getElementsByTagName("*").length;
});
// Check if attributes should be retrieved by attribute nodes
support.attributes = assert(function( div ) {
div.innerHTML = "<select></select>";
var type = typeof div.lastChild.getAttribute("multiple");
// IE8 returns a string for some attributes even when not present
return type !== "boolean" && type !== "string";
});
// Check if getElementsByClassName can be trusted
support.getByClassName = assert(function( div ) {
// Opera can't find a second classname (in 9.6)
div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
return false;
}
// Safari 3.2 caches class attributes and doesn't catch changes
div.lastChild.className = "e";
return div.getElementsByClassName("e").length === 2;
});
// Check if getElementById returns elements by name
// Check if getElementsByName privileges form controls or returns elements by ID
support.getByName = assert(function( div ) {
// Inject content
div.id = expando + 0;
div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
docElem.insertBefore( div, docElem.firstChild );
// Test
var pass = doc.getElementsByName &&
// buggy browsers will return fewer than the correct 2
doc.getElementsByName( expando ).length === 2 +
// buggy browsers will return more than the correct 0
doc.getElementsByName( expando + 0 ).length;
support.getIdNotName = !doc.getElementById( expando );
// Cleanup
docElem.removeChild( div );
return pass;
});
// IE6/7 return modified attributes
Expr.attrHandle = assert(function( div ) {
div.innerHTML = "<a href='#'></a>";
return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
div.firstChild.getAttribute("href") === "#";
}) ?
{} :
{
"href": function( elem ) {
return elem.getAttribute( "href", 2 );
},
"type": function( elem ) {
return elem.getAttribute("type");
}
};
// ID find and filter
if ( support.getIdNotName ) {
Expr.find["ID"] = function( id, context ) {
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
var m = context.getElementById( id );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
return m && m.parentNode ? [m] : [];
}
};
Expr.filter["ID"] = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
return elem.getAttribute("id") === attrId;
};
};
} else {
Expr.find["ID"] = function( id, context ) {
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
var m = context.getElementById( id );
return m ?
m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
[m] :
undefined :
[];
}
};
Expr.filter["ID"] = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
return node && node.value === attrId;
};
};
}
// Tag
Expr.find["TAG"] = support.tagNameNoComments ?
function( tag, context ) {
if ( typeof context.getElementsByTagName !== strundefined ) {
return context.getElementsByTagName( tag );
}
} :
function( tag, context ) {
var elem,
tmp = [],
i = 0,
results = context.getElementsByTagName( tag );
// Filter out possible comments
if ( tag === "*" ) {
while ( (elem = results[i++]) ) {
if ( elem.nodeType === 1 ) {
tmp.push( elem );
}
}
return tmp;
}
return results;
};
// Name
Expr.find["NAME"] = support.getByName && function( tag, context ) {
if ( typeof context.getElementsByName !== strundefined ) {
return context.getElementsByName( name );
}
};
// Class
Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
return context.getElementsByClassName( className );
}
};
// QSA and matchesSelector support
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
rbuggyMatches = [];
// qSa(:focus) reports false when true (Chrome 21),
// no need to also add to buggyMatches since matches checks buggyQSA
// A support test would require too much code (would include document ready)
rbuggyQSA = [ ":focus" ];
if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
// Build QSA regex
// Regex strategy adopted from Diego Perini
assert(function( div ) {
// Select is set to empty string on purpose
// This is to test IE's treatment of not explictly
// setting a boolean content attribute,
// since its presence should be enough
// http://bugs.jquery.com/ticket/12359
div.innerHTML = "<select><option selected=''></option></select>";
// IE8 - Some boolean attributes are not treated correctly
if ( !div.querySelectorAll("[selected]").length ) {
rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
}
// Webkit/Opera - :checked should return selected option elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
// IE8 throws error here and will not see later tests
if ( !div.querySelectorAll(":checked").length ) {
rbuggyQSA.push(":checked");
}
});
assert(function( div ) {
// Opera 10-12/IE8 - ^= $= *= and empty values
// Should not select anything
div.innerHTML = "<input type='hidden' i=''/>";
if ( div.querySelectorAll("[i^='']").length ) {
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
}
// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
// IE8 throws error here and will not see later tests
if ( !div.querySelectorAll(":enabled").length ) {
rbuggyQSA.push( ":enabled", ":disabled" );
}
// Opera 10-11 does not throw on post-comma invalid pseudos
div.querySelectorAll("*,:x");
rbuggyQSA.push(",.*:");
});
}
if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||
docElem.mozMatchesSelector ||
docElem.webkitMatchesSelector ||
docElem.oMatchesSelector ||
docElem.msMatchesSelector) )) ) {
assert(function( div ) {
// Check to see if it's possible to do matchesSelector
// on a disconnected node (IE 9)
support.disconnectedMatch = matches.call( div, "div" );
// This should fail with an exception
// Gecko does not error, returns false instead
matches.call( div, "[s!='']:x" );
rbuggyMatches.push( "!=", pseudos );
});
}
rbuggyQSA = new RegExp( rbuggyQSA.join("|") );
rbuggyMatches = new RegExp( rbuggyMatches.join("|") );
// Element contains another
// Purposefully does not implement inclusive descendent
// As in, an element does not contain itself
contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
function( a, b ) {
var adown = a.nodeType === 9 ? a.documentElement : a,
bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && (
adown.contains ?
adown.contains( bup ) :
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
));
} :
function( a, b ) {
if ( b ) {
while ( (b = b.parentNode) ) {
if ( b === a ) {
return true;
}
}
}
return false;
};
// Document order sorting
sortOrder = docElem.compareDocumentPosition ?
function( a, b ) {
var compare;
if ( a === b ) {
hasDuplicate = true;
return 0;
}
if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
if ( a === doc || contains( preferredDoc, a ) ) {
return -1;
}
if ( b === doc || contains( preferredDoc, b ) ) {
return 1;
}
return 0;
}
return compare & 4 ? -1 : 1;
}
return a.compareDocumentPosition ? -1 : 1;
} :
function( a, b ) {
var cur,
i = 0,
aup = a.parentNode,
bup = b.parentNode,
ap = [ a ],
bp = [ b ];
// Exit early if the nodes are identical
if ( a === b ) {
hasDuplicate = true;
return 0;
// Parentless nodes are either documents or disconnected
} else if ( !aup || !bup ) {
return a === doc ? -1 :
b === doc ? 1 :
aup ? -1 :
bup ? 1 :
0;
// If the nodes are siblings, we can do a quick check
} else if ( aup === bup ) {
return siblingCheck( a, b );
}
// Otherwise we need full lists of their ancestors for comparison
cur = a;
while ( (cur = cur.parentNode) ) {
ap.unshift( cur );
}
cur = b;
while ( (cur = cur.parentNode) ) {
bp.unshift( cur );
}
// Walk down the tree looking for a discrepancy
while ( ap[i] === bp[i] ) {
i++;
}
return i ?
// Do a sibling check if the nodes have a common ancestor
siblingCheck( ap[i], bp[i] ) :
// Otherwise nodes in our document sort first
ap[i] === preferredDoc ? -1 :
bp[i] === preferredDoc ? 1 :
0;
};
// Always assume the presence of duplicates if sort doesn't
// pass them to our comparison function (as in Google Chrome).
hasDuplicate = false;
[0, 0].sort( sortOrder );
support.detectDuplicates = hasDuplicate;
return document;
};
Sizzle.matches = function( expr, elements ) {
return Sizzle( expr, null, null, elements );
};
Sizzle.matchesSelector = function( elem, expr ) {
// Set document vars if needed
if ( ( elem.ownerDocument || elem ) !== document ) {
setDocument( elem );
}
// Make sure that attribute selectors are quoted
expr = expr.replace( rattributeQuotes, "='$1']" );
// rbuggyQSA always contains :focus, so no need for an existence check
if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {
try {
var ret = matches.call( elem, expr );
// IE 9's matchesSelector returns false on disconnected nodes
if ( ret || support.disconnectedMatch ||
// As well, disconnected nodes are said to be in a document
// fragment in IE 9
elem.document && elem.document.nodeType !== 11 ) {
return ret;
}
} catch(e) {}
}
return Sizzle( expr, document, null, [elem] ).length > 0;
};
Sizzle.contains = function( context, elem ) {
// Set document vars if needed
if ( ( context.ownerDocument || context ) !== document ) {
setDocument( context );
}
return contains( context, elem );
};
Sizzle.attr = function( elem, name ) {
var val;
// Set document vars if needed
if ( ( elem.ownerDocument || elem ) !== document ) {
setDocument( elem );
}
if ( !documentIsXML ) {
name = name.toLowerCase();
}
if ( (val = Expr.attrHandle[ name ]) ) {
return val( elem );
}
if ( documentIsXML || support.attributes ) {
return elem.getAttribute( name );
}
return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
name :
val && val.specified ? val.value : null;
};
Sizzle.error = function( msg ) {
throw new Error( "Syntax error, unrecognized expression: " + msg );
};
// Document sorting and removing duplicates
Sizzle.uniqueSort = function( results ) {
var elem,
duplicates = [],
i = 1,
j = 0;
// Unless we *know* we can detect duplicates, assume their presence
hasDuplicate = !support.detectDuplicates;
results.sort( sortOrder );
if ( hasDuplicate ) {
for ( ; (elem = results[i]); i++ ) {
if ( elem === results[ i - 1 ] ) {
j = duplicates.push( i );
}
}
while ( j-- ) {
results.splice( duplicates[ j ], 1 );
}
}
return results;
};
function siblingCheck( a, b ) {
var cur = b && a,
diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );
// Use IE sourceIndex if available on both nodes
if ( diff ) {
return diff;
}
// Check if b follows a
if ( cur ) {
while ( (cur = cur.nextSibling) ) {
if ( cur === b ) {
return -1;
}
}
}
return a ? 1 : -1;
}
// Returns a function to use in pseudos for input types
function createInputPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === type;
};
}
// Returns a function to use in pseudos for buttons
function createButtonPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return (name === "input" || name === "button") && elem.type === type;
};
}
// Returns a function to use in pseudos for positionals
function createPositionalPseudo( fn ) {
return markFunction(function( argument ) {
argument = +argument;
return markFunction(function( seed, matches ) {
var j,
matchIndexes = fn( [], seed.length, argument ),
i = matchIndexes.length;
// Match elements found at the specified indexes
while ( i-- ) {
if ( seed[ (j = matchIndexes[i]) ] ) {
seed[j] = !(matches[j] = seed[j]);
}
}
});
});
}
/**
* Utility function for retrieving the text value of an array of DOM nodes
* @param {Array|Element} elem
*/
getText = Sizzle.getText = function( elem ) {
var node,
ret = "",
i = 0,
nodeType = elem.nodeType;
if ( !nodeType ) {
// If no nodeType, this is expected to be an array
for ( ; (node = elem[i]); i++ ) {
// Do not traverse comment nodes
ret += getText( node );
}
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
// Use textContent for elements
// innerText usage removed for consistency of new lines (see #11153)
if ( typeof elem.textContent === "string" ) {
return elem.textContent;
} else {
// Traverse its children
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
ret += getText( elem );
}
}
} else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue;
}
// Do not include comment or processing instruction nodes
return ret;
};
Expr = Sizzle.selectors = {
// Can be adjusted by the user
cacheLength: 50,
createPseudo: markFunction,
match: matchExpr,
find: {},
relative: {
">": { dir: "parentNode", first: true },
" ": { dir: "parentNode" },
"+": { dir: "previousSibling", first: true },
"~": { dir: "previousSibling" }
},
preFilter: {
"ATTR": function( match ) {
match[1] = match[1].replace( runescape, funescape );
// Move the given value to match[3] whether quoted or unquoted
match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
if ( match[2] === "~=" ) {
match[3] = " " + match[3] + " ";
}
return match.slice( 0, 4 );
},
"CHILD": function( match ) {
/* matches from matchExpr["CHILD"]
1 type (only|nth|...)
2 what (child|of-type)
3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
4 xn-component of xn+y argument ([+-]?\d*n|)
5 sign of xn-component
6 x of xn-component
7 sign of y-component
8 y of y-component
*/
match[1] = match[1].toLowerCase();
if ( match[1].slice( 0, 3 ) === "nth" ) {
// nth-* requires argument
if ( !match[3] ) {
Sizzle.error( match[0] );
}
// numeric x and y parameters for Expr.filter.CHILD
// remember that false/true cast respectively to 0/1
match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
// other types prohibit arguments
} else if ( match[3] ) {
Sizzle.error( match[0] );
}
return match;
},
"PSEUDO": function( match ) {
var excess,
unquoted = !match[5] && match[2];
if ( matchExpr["CHILD"].test( match[0] ) ) {
return null;
}
// Accept quoted arguments as-is
if ( match[4] ) {
match[2] = match[4];
// Strip excess characters from unquoted arguments
} else if ( unquoted && rpseudo.test( unquoted ) &&
// Get excess from tokenize (recursively)
(excess = tokenize( unquoted, true )) &&
// advance to the next closing parenthesis
(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
// excess is a negative index
match[0] = match[0].slice( 0, excess );
match[2] = unquoted.slice( 0, excess );
}
// Return only captures needed by the pseudo filter method (type and argument)
return match.slice( 0, 3 );
}
},
filter: {
"TAG": function( nodeName ) {
if ( nodeName === "*" ) {
return function() { return true; };
}
nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
return function( elem ) {
return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
};
},
"CLASS": function( className ) {
var pattern = classCache[ className + " " ];
return pattern ||
(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
classCache( className, function( elem ) {
return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
});
},
"ATTR": function( name, operator, check ) {
return function( elem ) {
var result = Sizzle.attr( elem, name );
if ( result == null ) {
return operator === "!=";
}
if ( !operator ) {
return true;
}
result += "";
return operator === "=" ? result === check :
operator === "!=" ? result !== check :
operator === "^=" ? check && result.indexOf( check ) === 0 :
operator === "*=" ? check && result.indexOf( check ) > -1 :
operator === "$=" ? check && result.slice( -check.length ) === check :
operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
false;
};
},
"CHILD": function( type, what, argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last",
ofType = what === "of-type";
return first === 1 && last === 0 ?
// Shortcut for :nth-*(n)
function( elem ) {
return !!elem.parentNode;
} :
function( elem, context, xml ) {
var cache, outerCache, node, diff, nodeIndex, start,
dir = simple !== forward ? "nextSibling" : "previousSibling",
parent = elem.parentNode,
name = ofType && elem.nodeName.toLowerCase(),
useCache = !xml && !ofType;
if ( parent ) {
// :(first|last|only)-(child|of-type)
if ( simple ) {
while ( dir ) {
node = elem;
while ( (node = node[ dir ]) ) {
if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
return false;
}
}
// Reverse direction for :only-* (if we haven't yet done so)
start = dir = type === "only" && !start && "nextSibling";
}
return true;
}
start = [ forward ? parent.firstChild : parent.lastChild ];
// non-xml :nth-child(...) stores cache data on `parent`
if ( forward && useCache ) {
// Seek `elem` from a previously-cached index
outerCache = parent[ expando ] || (parent[ expando ] = {});
cache = outerCache[ type ] || [];
nodeIndex = cache[0] === dirruns && cache[1];
diff = cache[0] === dirruns && cache[2];
node = nodeIndex && parent.childNodes[ nodeIndex ];
while ( (node = ++nodeIndex && node && node[ dir ] ||
// Fallback to seeking `elem` from the start
(diff = nodeIndex = 0) || start.pop()) ) {
// When found, cache indexes on `parent` and break
if ( node.nodeType === 1 && ++diff && node === elem ) {
outerCache[ type ] = [ dirruns, nodeIndex, diff ];
break;
}
}
// Use previously-cached element index if available
} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
diff = cache[1];
// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
} else {
// Use the same loop as above to seek `elem` from the start
while ( (node = ++nodeIndex && node && node[ dir ] ||
(diff = nodeIndex = 0) || start.pop()) ) {
if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
// Cache the index of each encountered element
if ( useCache ) {
(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
}
if ( node === elem ) {
break;
}
}
}
}
// Incorporate the offset, then check against cycle size
diff -= last;
return diff === first || ( diff % first === 0 && diff / first >= 0 );
}
};
},
"PSEUDO": function( pseudo, argument ) {
// pseudo-class names are case-insensitive
// http://www.w3.org/TR/selectors/#pseudo-classes
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
// Remember that setFilters inherits from pseudos
var args,
fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
Sizzle.error( "unsupported pseudo: " + pseudo );
// The user may use createPseudo to indicate that
// arguments are needed to create the filter function
// just as Sizzle does
if ( fn[ expando ] ) {
return fn( argument );
}
// But maintain support for old signatures
if ( fn.length > 1 ) {
args = [ pseudo, pseudo, "", argument ];
return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
markFunction(function( seed, matches ) {
var idx,
matched = fn( seed, argument ),
i = matched.length;
while ( i-- ) {
idx = indexOf.call( seed, matched[i] );
seed[ idx ] = !( matches[ idx ] = matched[i] );
}
}) :
function( elem ) {
return fn( elem, 0, args );
};
}
return fn;
}
},
pseudos: {
// Potentially complex pseudos
"not": markFunction(function( selector ) {
// Trim the selector passed to compile
// to avoid treating leading and trailing
// spaces as combinators
var input = [],
results = [],
matcher = compile( selector.replace( rtrim, "$1" ) );
return matcher[ expando ] ?
markFunction(function( seed, matches, context, xml ) {
var elem,
unmatched = matcher( seed, null, xml, [] ),
i = seed.length;
// Match elements unmatched by `matcher`
while ( i-- ) {
if ( (elem = unmatched[i]) ) {
seed[i] = !(matches[i] = elem);
}
}
}) :
function( elem, context, xml ) {
input[0] = elem;
matcher( input, null, xml, results );
return !results.pop();
};
}),
"has": markFunction(function( selector ) {
return function( elem ) {
return Sizzle( selector, elem ).length > 0;
};
}),
"contains": markFunction(function( text ) {
return function( elem ) {
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
};
}),
// "Whether an element is represented by a :lang() selector
// is based solely on the element's language value
// being equal to the identifier C,
// or beginning with the identifier C immediately followed by "-".
// The matching of C against the element's language value is performed case-insensitively.
// The identifier C does not have to be a valid language name."
// http://www.w3.org/TR/selectors/#lang-pseudo
"lang": markFunction( function( lang ) {
// lang value must be a valid identifider
if ( !ridentifier.test(lang || "") ) {
Sizzle.error( "unsupported lang: " + lang );
}
lang = lang.replace( runescape, funescape ).toLowerCase();
return function( elem ) {
var elemLang;
do {
if ( (elemLang = documentIsXML ?
elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
elem.lang) ) {
elemLang = elemLang.toLowerCase();
return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
}
} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
return false;
};
}),
// Miscellaneous
"target": function( elem ) {
var hash = window.location && window.location.hash;
return hash && hash.slice( 1 ) === elem.id;
},
"root": function( elem ) {
return elem === docElem;
},
"focus": function( elem ) {
return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
},
// Boolean properties
"enabled": function( elem ) {
return elem.disabled === false;
},
"disabled": function( elem ) {
return elem.disabled === true;
},
"checked": function( elem ) {
// In CSS3, :checked should return both checked and selected elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
var nodeName = elem.nodeName.toLowerCase();
return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
},
"selected": function( elem ) {
// Accessing this property makes selected-by-default
// options in Safari work properly
if ( elem.parentNode ) {
elem.parentNode.selectedIndex;
}
return elem.selected === true;
},
// Contents
"empty": function( elem ) {
// http://www.w3.org/TR/selectors/#empty-pseudo
// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
// not comment, processing instructions, or others
// Thanks to Diego Perini for the nodeName shortcut
// Greater than "@" means alpha characters (specifically not starting with "#" or "?")
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
return false;
}
}
return true;
},
"parent": function( elem ) {
return !Expr.pseudos["empty"]( elem );
},
// Element/input types
"header": function( elem ) {
return rheader.test( elem.nodeName );
},
"input": function( elem ) {
return rinputs.test( elem.nodeName );
},
"button": function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === "button" || name === "button";
},
"text": function( elem ) {
var attr;
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
// use getAttribute instead to test this case
return elem.nodeName.toLowerCase() === "input" &&
elem.type === "text" &&
( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
},
// Position-in-collection
"first": createPositionalPseudo(function() {
return [ 0 ];
}),
"last": createPositionalPseudo(function( matchIndexes, length ) {
return [ length - 1 ];
}),
"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
return [ argument < 0 ? argument + length : argument ];
}),
"even": createPositionalPseudo(function( matchIndexes, length ) {
var i = 0;
for ( ; i < length; i += 2 ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"odd": createPositionalPseudo(function( matchIndexes, length ) {
var i = 1;
for ( ; i < length; i += 2 ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument;
for ( ; --i >= 0; ) {
matchIndexes.push( i );
}
return matchIndexes;
}),
"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument;
for ( ; ++i < length; ) {
matchIndexes.push( i );
}
return matchIndexes;
})
}
};
// Add button/input type pseudos
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
Expr.pseudos[ i ] = createInputPseudo( i );
}
for ( i in { submit: true, reset: true } ) {
Expr.pseudos[ i ] = createButtonPseudo( i );
}
function tokenize( selector, parseOnly ) {
var matched, match, tokens, type,
soFar, groups, preFilters,
cached = tokenCache[ selector + " " ];
if ( cached ) {
return parseOnly ? 0 : cached.slice( 0 );
}
soFar = selector;
groups = [];
preFilters = Expr.preFilter;
while ( soFar ) {
// Comma and first run
if ( !matched || (match = rcomma.exec( soFar )) ) {
if ( match ) {
// Don't consume trailing commas as valid
soFar = soFar.slice( match[0].length ) || soFar;
}
groups.push( tokens = [] );
}
matched = false;
// Combinators
if ( (match = rcombinators.exec( soFar )) ) {
matched = match.shift();
tokens.push( {
value: matched,
// Cast descendant combinators to space
type: match[0].replace( rtrim, " " )
} );
soFar = soFar.slice( matched.length );
}
// Filters
for ( type in Expr.filter ) {
if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
(match = preFilters[ type ]( match ))) ) {
matched = match.shift();
tokens.push( {
value: matched,
type: type,
matches: match
} );
soFar = soFar.slice( matched.length );
}
}
if ( !matched ) {
break;
}
}
// Return the length of the invalid excess
// if we're just parsing
// Otherwise, throw an error or return tokens
return parseOnly ?
soFar.length :
soFar ?
Sizzle.error( selector ) :
// Cache the tokens
tokenCache( selector, groups ).slice( 0 );
}
function toSelector( tokens ) {
var i = 0,
len = tokens.length,
selector = "";
for ( ; i < len; i++ ) {
selector += tokens[i].value;
}
return selector;
}
function addCombinator( matcher, combinator, base ) {
var dir = combinator.dir,
checkNonElements = base && dir === "parentNode",
doneName = done++;
return combinator.first ?
// Check against closest ancestor/preceding element
function( elem, context, xml ) {
while ( (elem = elem[ dir ]) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
return matcher( elem, context, xml );
}
}
} :
// Check against all ancestor/preceding elements
function( elem, context, xml ) {
var data, cache, outerCache,
dirkey = dirruns + " " + doneName;
// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
if ( xml ) {
while ( (elem = elem[ dir ]) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
if ( matcher( elem, context, xml ) ) {
return true;
}
}
}
} else {
while ( (elem = elem[ dir ]) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
outerCache = elem[ expando ] || (elem[ expando ] = {});
if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
if ( (data = cache[1]) === true || data === cachedruns ) {
return data === true;
}
} else {
cache = outerCache[ dir ] = [ dirkey ];
cache[1] = matcher( elem, context, xml ) || cachedruns;
if ( cache[1] === true ) {
return true;
}
}
}
}
}
};
}
function elementMatcher( matchers ) {
return matchers.length > 1 ?
function( elem, context, xml ) {
var i = matchers.length;
while ( i-- ) {
if ( !matchers[i]( elem, context, xml ) ) {
return false;
}
}
return true;
} :
matchers[0];
}
function condense( unmatched, map, filter, context, xml ) {
var elem,
newUnmatched = [],
i = 0,
len = unmatched.length,
mapped = map != null;
for ( ; i < len; i++ ) {
if ( (elem = unmatched[i]) ) {
if ( !filter || filter( elem, context, xml ) ) {
newUnmatched.push( elem );
if ( mapped ) {
map.push( i );
}
}
}
}
return newUnmatched;
}
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
postFinder = setMatcher( postFinder, postSelector );
}
return markFunction(function( seed, results, context, xml ) {
var temp, i, elem,
preMap = [],
postMap = [],
preexisting = results.length,
// Get initial elements from seed or context
elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
// Prefilter to get matcher input, preserving a map for seed-results synchronization
matcherIn = preFilter && ( seed || !selector ) ?
condense( elems, preMap, preFilter, context, xml ) :
elems,
matcherOut = matcher ?
// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
// ...intermediate processing is necessary
[] :
// ...otherwise use results directly
results :
matcherIn;
// Find primary matches
if ( matcher ) {
matcher( matcherIn, matcherOut, context, xml );
}
// Apply postFilter
if ( postFilter ) {
temp = condense( matcherOut, postMap );
postFilter( temp, [], context, xml );
// Un-match failing elements by moving them back to matcherIn
i = temp.length;
while ( i-- ) {
if ( (elem = temp[i]) ) {
matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
}
}
}
if ( seed ) {
if ( postFinder || preFilter ) {
if ( postFinder ) {
// Get the final matcherOut by condensing this intermediate into postFinder contexts
temp = [];
i = matcherOut.length;
while ( i-- ) {
if ( (elem = matcherOut[i]) ) {
// Restore matcherIn since elem is not yet a final match
temp.push( (matcherIn[i] = elem) );
}
}
postFinder( null, (matcherOut = []), temp, xml );
}
// Move matched elements from seed to results to keep them synchronized
i = matcherOut.length;
while ( i-- ) {
if ( (elem = matcherOut[i]) &&
(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
seed[temp] = !(results[temp] = elem);
}
}
}
// Add elements to results, through postFinder if defined
} else {
matcherOut = condense(
matcherOut === results ?
matcherOut.splice( preexisting, matcherOut.length ) :
matcherOut
);
if ( postFinder ) {
postFinder( null, results, matcherOut, xml );
} else {
push.apply( results, matcherOut );
}
}
});
}
function matcherFromTokens( tokens ) {
var checkContext, matcher, j,
len = tokens.length,
leadingRelative = Expr.relative[ tokens[0].type ],
implicitRelative = leadingRelative || Expr.relative[" "],
i = leadingRelative ? 1 : 0,
// The foundational matcher ensures that elements are reachable from top-level context(s)
matchContext = addCombinator( function( elem ) {
return elem === checkContext;
}, implicitRelative, true ),
matchAnyContext = addCombinator( function( elem ) {
return indexOf.call( checkContext, elem ) > -1;
}, implicitRelative, true ),
matchers = [ function( elem, context, xml ) {
return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
(checkContext = context).nodeType ?
matchContext( elem, context, xml ) :
matchAnyContext( elem, context, xml ) );
} ];
for ( ; i < len; i++ ) {
if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
} else {
matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
// Return special upon seeing a positional matcher
if ( matcher[ expando ] ) {
// Find the next relative operator (if any) for proper handling
j = ++i;
for ( ; j < len; j++ ) {
if ( Expr.relative[ tokens[j].type ] ) {
break;
}
}
return setMatcher(
i > 1 && elementMatcher( matchers ),
i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
matcher,
i < j && matcherFromTokens( tokens.slice( i, j ) ),
j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
j < len && toSelector( tokens )
);
}
matchers.push( matcher );
}
}
return elementMatcher( matchers );
}
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
// A counter to specify which element is currently being matched
var matcherCachedRuns = 0,
bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, expandContext ) {
var elem, j, matcher,
setMatched = [],
matchedCount = 0,
i = "0",
unmatched = seed && [],
outermost = expandContext != null,
contextBackup = outermostContext,
// We must always have either seed elements or context
elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
// Use integer dirruns iff this is the outermost matcher
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
if ( outermost ) {
outermostContext = context !== document && context;
cachedruns = matcherCachedRuns;
}
// Add elements passing elementMatchers directly to results
// Keep `i` a string if there are no elements so `matchedCount` will be "00" below
for ( ; (elem = elems[i]) != null; i++ ) {
if ( byElement && elem ) {
j = 0;
while ( (matcher = elementMatchers[j++]) ) {
if ( matcher( elem, context, xml ) ) {
results.push( elem );
break;
}
}
if ( outermost ) {
dirruns = dirrunsUnique;
cachedruns = ++matcherCachedRuns;
}
}
// Track unmatched elements for set filters
if ( bySet ) {
// They will have gone through all possible matchers
if ( (elem = !matcher && elem) ) {
matchedCount--;
}
// Lengthen the array for every element, matched or not
if ( seed ) {
unmatched.push( elem );
}
}
}
// Apply set filters to unmatched elements
matchedCount += i;
if ( bySet && i !== matchedCount ) {
j = 0;
while ( (matcher = setMatchers[j++]) ) {
matcher( unmatched, setMatched, context, xml );
}
if ( seed ) {
// Reintegrate element matches to eliminate the need for sorting
if ( matchedCount > 0 ) {
while ( i-- ) {
if ( !(unmatched[i] || setMatched[i]) ) {
setMatched[i] = pop.call( results );
}
}
}
// Discard index placeholder values to get only actual matches
setMatched = condense( setMatched );
}
// Add matches to results
push.apply( results, setMatched );
// Seedless set matches succeeding multiple successful matchers stipulate sorting
if ( outermost && !seed && setMatched.length > 0 &&
( matchedCount + setMatchers.length ) > 1 ) {
Sizzle.uniqueSort( results );
}
}
// Override manipulation of globals by nested matchers
if ( outermost ) {
dirruns = dirrunsUnique;
outermostContext = contextBackup;
}
return unmatched;
};
return bySet ?
markFunction( superMatcher ) :
superMatcher;
}
compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
var i,
setMatchers = [],
elementMatchers = [],
cached = compilerCache[ selector + " " ];
if ( !cached ) {
// Generate a function of recursive functions that can be used to check each element
if ( !group ) {
group = tokenize( selector );
}
i = group.length;
while ( i-- ) {
cached = matcherFromTokens( group[i] );
if ( cached[ expando ] ) {
setMatchers.push( cached );
} else {
elementMatchers.push( cached );
}
}
// Cache the compiled function
cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
}
return cached;
};
function multipleContexts( selector, contexts, results ) {
var i = 0,
len = contexts.length;
for ( ; i < len; i++ ) {
Sizzle( selector, contexts[i], results );
}
return results;
}
function select( selector, context, results, seed ) {
var i, tokens, token, type, find,
match = tokenize( selector );
if ( !seed ) {
// Try to minimize operations if there is only one group
if ( match.length === 1 ) {
// Take a shortcut and set the context if the root selector is an ID
tokens = match[0] = match[0].slice( 0 );
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
context.nodeType === 9 && !documentIsXML &&
Expr.relative[ tokens[1].type ] ) {
context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
if ( !context ) {
return results;
}
selector = selector.slice( tokens.shift().value.length );
}
// Fetch a seed set for right-to-left matching
i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
while ( i-- ) {
token = tokens[i];
// Abort if we hit a combinator
if ( Expr.relative[ (type = token.type) ] ) {
break;
}
if ( (find = Expr.find[ type ]) ) {
// Search, expanding context for leading sibling combinators
if ( (seed = find(
token.matches[0].replace( runescape, funescape ),
rsibling.test( tokens[0].type ) && context.parentNode || context
)) ) {
// If seed is empty or no tokens remain, we can return early
tokens.splice( i, 1 );
selector = seed.length && toSelector( tokens );
if ( !selector ) {
push.apply( results, slice.call( seed, 0 ) );
return results;
}
break;
}
}
}
}
}
// Compile and execute a filtering function
// Provide `match` to avoid retokenization if we modified the selector above
compile( selector, match )(
seed,
context,
documentIsXML,
results,
rsibling.test( selector )
);
return results;
}
// Deprecated
Expr.pseudos["nth"] = Expr.pseudos["eq"];
// Easy API for creating new setFilters
function setFilters() {}
Expr.filters = setFilters.prototype = Expr.pseudos;
Expr.setFilters = new setFilters();
// Initialize with the default document
setDocument();
// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.pseudos;
jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
})( window );
var runtil = /Until$/,
rparentsprev = /^(?:parents|prev(?:Until|All))/,
isSimple = /^.[^:#\[\.,]*$/,
rneedsContext = jQuery.expr.match.needsContext,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
contents: true,
next: true,
prev: true
};
jQuery.fn.extend({
find: function( selector ) {
var i, ret, self,
len = this.length;
if ( typeof selector !== "string" ) {
self = this;
return this.pushStack( jQuery( selector ).filter(function() {
for ( i = 0; i < len; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
}) );
}
ret = [];
for ( i = 0; i < len; i++ ) {
jQuery.find( selector, this[ i ], ret );
}
// Needed because $( selector, context ) becomes $( context ).find( selector )
ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
return ret;
},
has: function( target ) {
var i,
targets = jQuery( target, this ),
len = targets.length;
return this.filter(function() {
for ( i = 0; i < len; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
return true;
}
}
});
},
not: function( selector ) {
return this.pushStack( winnow(this, selector, false) );
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector, true) );
},
is: function( selector ) {
return !!selector && (
typeof selector === "string" ?
// If this is a positional/relative selector, check membership in the returned set
// so $("p:first").is("p:last") won't return true for a doc with two "p".
rneedsContext.test( selector ) ?
jQuery( selector, this.context ).index( this[0] ) >= 0 :
jQuery.filter( selector, this ).length > 0 :
this.filter( selector ).length > 0 );
},
closest: function( selectors, context ) {
var cur,
i = 0,
l = this.length,
ret = [],
pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
jQuery( selectors, context || this.context ) :
0;
for ( ; i < l; i++ ) {
cur = this[i];
while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
ret.push( cur );
break;
}
cur = cur.parentNode;
}
}
return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
},
// Determine the position of an element within
// the matched set of elements
index: function( elem ) {
// No argument, return index in parent
if ( !elem ) {
return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
}
// index in selector
if ( typeof elem === "string" ) {
return jQuery.inArray( this[0], jQuery( elem ) );
}
// Locate the position of the desired element
return jQuery.inArray(
// If it receives a jQuery object, the first element is used
elem.jquery ? elem[0] : elem, this );
},
add: function( selector, context ) {
var set = typeof selector === "string" ?
jQuery( selector, context ) :
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
all = jQuery.merge( this.get(), set );
return this.pushStack( jQuery.unique(all) );
},
addBack: function( selector ) {
return this.add( selector == null ?
this.prevObject : this.prevObject.filter(selector)
);
}
});
jQuery.fn.andSelf = jQuery.fn.addBack;
function sibling( cur, dir ) {
do {
cur = cur[ dir ];
} while ( cur && cur.nodeType !== 1 );
return cur;
}
jQuery.each({
parent: function( elem ) {
var parent = elem.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
},
parents: function( elem ) {
return jQuery.dir( elem, "parentNode" );
},
parentsUntil: function( elem, i, until ) {
return jQuery.dir( elem, "parentNode", until );
},
next: function( elem ) {
return sibling( elem, "nextSibling" );
},
prev: function( elem ) {
return sibling( elem, "previousSibling" );
},
nextAll: function( elem ) {
return jQuery.dir( elem, "nextSibling" );
},
prevAll: function( elem ) {
return jQuery.dir( elem, "previousSibling" );
},
nextUntil: function( elem, i, until ) {
return jQuery.dir( elem, "nextSibling", until );
},
prevUntil: function( elem, i, until ) {
return jQuery.dir( elem, "previousSibling", until );
},
siblings: function( elem ) {
return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
},
children: function( elem ) {
return jQuery.sibling( elem.firstChild );
},
contents: function( elem ) {
return jQuery.nodeName( elem, "iframe" ) ?
elem.contentDocument || elem.contentWindow.document :
jQuery.merge( [], elem.childNodes );
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
var ret = jQuery.map( this, fn, until );
if ( !runtil.test( name ) ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
ret = jQuery.filter( selector, ret );
}
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
if ( this.length > 1 && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
return this.pushStack( ret );
};
});
jQuery.extend({
filter: function( expr, elems, not ) {
if ( not ) {
expr = ":not(" + expr + ")";
}
return elems.length === 1 ?
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
jQuery.find.matches(expr, elems);
},
dir: function( elem, dir, until ) {
var matched = [],
cur = elem[ dir ];
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
if ( cur.nodeType === 1 ) {
matched.push( cur );
}
cur = cur[dir];
}
return matched;
},
sibling: function( n, elem ) {
var r = [];
for ( ; n; n = n.nextSibling ) {
if ( n.nodeType === 1 && n !== elem ) {
r.push( n );
}
}
return r;
}
});
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) {
// Can't pass null or undefined to indexOf in Firefox 4
// Set to 0 to skip string check
qualifier = qualifier || 0;
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
var retVal = !!qualifier.call( elem, i, elem );
return retVal === keep;
});
} else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem ) {
return ( elem === qualifier ) === keep;
});
} else if ( typeof qualifier === "string" ) {
var filtered = jQuery.grep(elements, function( elem ) {
return elem.nodeType === 1;
});
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
qualifier = jQuery.filter( qualifier, filtered );
}
}
return jQuery.grep(elements, function( elem ) {
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
});
}
function createSafeFragment( document ) {
var list = nodeNames.split( "|" ),
safeFrag = document.createDocumentFragment();
if ( safeFrag.createElement ) {
while ( list.length ) {
safeFrag.createElement(
list.pop()
);
}
}
return safeFrag;
}
var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
rleadingWhitespace = /^\s+/,
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&#?\w+;/,
rnoInnerhtml = /<(?:script|style|link)/i,
manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptType = /^$|\/(?:java|ecma)script/i,
rscriptTypeMasked = /^true\/(.*)/,
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
// We have to close these tags to support XHTML (#13200)
wrapMap = {
option: [ 1, "<select multiple='multiple'>", "</select>" ],
legend: [ 1, "<fieldset>", "</fieldset>" ],
area: [ 1, "<map>", "</map>" ],
param: [ 1, "<object>", "</object>" ],
thead: [ 1, "<table>", "</table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
// unless wrapped in a div with non-breaking characters in front of it.
_default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
},
safeFragment = createSafeFragment( document ),
fragmentDiv = safeFragment.appendChild( document.createElement("div") );
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
jQuery.fn.extend({
text: function( value ) {
return jQuery.access( this, function( value ) {
return value === undefined ?
jQuery.text( this ) :
this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
}, null, value, arguments.length );
},
wrapAll: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapAll( html.call(this, i) );
});
}
if ( this[0] ) {
// The elements to wrap the target around
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
if ( this[0].parentNode ) {
wrap.insertBefore( this[0] );
}
wrap.map(function() {
var elem = this;
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
elem = elem.firstChild;
}
return elem;
}).append( this );
}
return this;
},
wrapInner: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapInner( html.call(this, i) );
});
}
return this.each(function() {
var self = jQuery( this ),
contents = self.contents();
if ( contents.length ) {
contents.wrapAll( html );
} else {
self.append( html );
}
});
},
wrap: function( html ) {
var isFunction = jQuery.isFunction( html );
return this.each(function(i) {
jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
});
},
unwrap: function() {
return this.parent().each(function() {
if ( !jQuery.nodeName( this, "body" ) ) {
jQuery( this ).replaceWith( this.childNodes );
}
}).end();
},
append: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.appendChild( elem );
}
});
},
prepend: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
this.insertBefore( elem, this.firstChild );
}
});
},
before: function() {
return this.domManip( arguments, false, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this );
}
});
},
after: function() {
return this.domManip( arguments, false, function( elem ) {
if ( this.parentNode ) {
this.parentNode.insertBefore( elem, this.nextSibling );
}
});
},
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
var elem,
i = 0;
for ( ; (elem = this[i]) != null; i++ ) {
if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
if ( !keepData && elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem ) );
}
if ( elem.parentNode ) {
if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
setGlobalEval( getAll( elem, "script" ) );
}
elem.parentNode.removeChild( elem );
}
}
}
return this;
},
empty: function() {
var elem,
i = 0;
for ( ; (elem = this[i]) != null; i++ ) {
// Remove element nodes and prevent memory leaks
if ( elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem, false ) );
}
// Remove any remaining nodes
while ( elem.firstChild ) {
elem.removeChild( elem.firstChild );
}
// If this is a select, ensure that it displays empty (#12336)
// Support: IE<9
if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
elem.options.length = 0;
}
}
return this;
},
clone: function( dataAndEvents, deepDataAndEvents ) {
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
return this.map( function () {
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
});
},
html: function( value ) {
return jQuery.access( this, function( value ) {
var elem = this[0] || {},
i = 0,
l = this.length;
if ( value === undefined ) {
return elem.nodeType === 1 ?
elem.innerHTML.replace( rinlinejQuery, "" ) :
undefined;
}
// See if we can take a shortcut and just use innerHTML
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
!wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
value = value.replace( rxhtmlTag, "<$1></$2>" );
try {
for (; i < l; i++ ) {
// Remove element nodes and prevent memory leaks
elem = this[i] || {};
if ( elem.nodeType === 1 ) {
jQuery.cleanData( getAll( elem, false ) );
elem.innerHTML = value;
}
}
elem = 0;
// If using innerHTML throws an exception, use the fallback method
} catch(e) {}
}
if ( elem ) {
this.empty().append( value );
}
}, null, value, arguments.length );
},
replaceWith: function( value ) {
var isFunc = jQuery.isFunction( value );
// Make sure that the elements are removed from the DOM before they are inserted
// this can help fix replacing a parent with child elements
if ( !isFunc && typeof value !== "string" ) {
value = jQuery( value ).not( this ).detach();
}
return this.domManip( [ value ], true, function( elem ) {
var next = this.nextSibling,
parent = this.parentNode;
if ( parent ) {
jQuery( this ).remove();
parent.insertBefore( elem, next );
}
});
},
detach: function( selector ) {
return this.remove( selector, true );
},
domManip: function( args, table, callback ) {
// Flatten any nested arrays
args = core_concat.apply( [], args );
var first, node, hasScripts,
scripts, doc, fragment,
i = 0,
l = this.length,
set = this,
iNoClone = l - 1,
value = args[0],
isFunction = jQuery.isFunction( value );
// We can't cloneNode fragments that contain checked, in WebKit
if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
return this.each(function( index ) {
var self = set.eq( index );
if ( isFunction ) {
args[0] = value.call( this, index, table ? self.html() : undefined );
}
self.domManip( args, table, callback );
});
}
if ( l ) {
fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
first = fragment.firstChild;
if ( fragment.childNodes.length === 1 ) {
fragment = first;
}
if ( first ) {
table = table && jQuery.nodeName( first, "tr" );
scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
hasScripts = scripts.length;
// Use the original fragment for the last item instead of the first because it can end up
// being emptied incorrectly in certain situations (#8070).
for ( ; i < l; i++ ) {
node = fragment;
if ( i !== iNoClone ) {
node = jQuery.clone( node, true, true );
// Keep references to cloned scripts for later restoration
if ( hasScripts ) {
jQuery.merge( scripts, getAll( node, "script" ) );
}
}
callback.call(
table && jQuery.nodeName( this[i], "table" ) ?
findOrAppend( this[i], "tbody" ) :
this[i],
node,
i
);
}
if ( hasScripts ) {
doc = scripts[ scripts.length - 1 ].ownerDocument;
// Reenable scripts
jQuery.map( scripts, restoreScript );
// Evaluate executable scripts on first document insertion
for ( i = 0; i < hasScripts; i++ ) {
node = scripts[ i ];
if ( rscriptType.test( node.type || "" ) &&
!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
if ( node.src ) {
// Hope ajax is available...
jQuery.ajax({
url: node.src,
type: "GET",
dataType: "script",
async: false,
global: false,
"throws": true
});
} else {
jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
}
}
}
}
// Fix #11809: Avoid leaking memory
fragment = first = null;
}
}
return this;
}
});
function findOrAppend( elem, tag ) {
return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
}
// Replace/restore the type attribute of script elements for safe DOM manipulation
function disableScript( elem ) {
var attr = elem.getAttributeNode("type");
elem.type = ( attr && attr.specified ) + "/" + elem.type;
return elem;
}
function restoreScript( elem ) {
var match = rscriptTypeMasked.exec( elem.type );
if ( match ) {
elem.type = match[1];
} else {
elem.removeAttribute("type");
}
return elem;
}
// Mark scripts as having already been evaluated
function setGlobalEval( elems, refElements ) {
var elem,
i = 0;
for ( ; (elem = elems[i]) != null; i++ ) {
jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
}
}
function cloneCopyEvent( src, dest ) {
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
return;
}
var type, i, l,
oldData = jQuery._data( src ),
curData = jQuery._data( dest, oldData ),
events = oldData.events;
if ( events ) {
delete curData.handle;
curData.events = {};
for ( type in events ) {
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
jQuery.event.add( dest, type, events[ type ][ i ] );
}
}
}
// make the cloned public data object a copy from the original
if ( curData.data ) {
curData.data = jQuery.extend( {}, curData.data );
}
}
function fixCloneNodeIssues( src, dest ) {
var nodeName, e, data;
// We do not need to do anything for non-Elements
if ( dest.nodeType !== 1 ) {
return;
}
nodeName = dest.nodeName.toLowerCase();
// IE6-8 copies events bound via attachEvent when using cloneNode.
if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
data = jQuery._data( dest );
for ( e in data.events ) {
jQuery.removeEvent( dest, e, data.handle );
}
// Event data gets referenced instead of copied if the expando gets copied too
dest.removeAttribute( jQuery.expando );
}
// IE blanks contents when cloning scripts, and tries to evaluate newly-set text
if ( nodeName === "script" && dest.text !== src.text ) {
disableScript( dest ).text = src.text;
restoreScript( dest );
// IE6-10 improperly clones children of object elements using classid.
// IE10 throws NoModificationAllowedError if parent is null, #12132.
} else if ( nodeName === "object" ) {
if ( dest.parentNode ) {
dest.outerHTML = src.outerHTML;
}
// This path appears unavoidable for IE9. When cloning an object
// element in IE9, the outerHTML strategy above is not sufficient.
// If the src has innerHTML and the destination does not,
// copy the src.innerHTML into the dest.innerHTML. #10324
if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
dest.innerHTML = src.innerHTML;
}
} else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
// IE6-8 fails to persist the checked state of a cloned checkbox
// or radio button. Worse, IE6-7 fail to give the cloned element
// a checked appearance if the defaultChecked value isn't also set
dest.defaultChecked = dest.checked = src.checked;
// IE6-7 get confused and end up setting the value of a cloned
// checkbox/radio button to an empty string instead of "on"
if ( dest.value !== src.value ) {
dest.value = src.value;
}
// IE6-8 fails to return the selected option to the default selected
// state when cloning options
} else if ( nodeName === "option" ) {
dest.defaultSelected = dest.selected = src.defaultSelected;
// IE6-8 fails to set the defaultValue to the correct value when
// cloning other types of input fields
} else if ( nodeName === "input" || nodeName === "textarea" ) {
dest.defaultValue = src.defaultValue;
}
}
jQuery.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
var elems,
i = 0,
ret = [],
insert = jQuery( selector ),
last = insert.length - 1;
for ( ; i <= last; i++ ) {
elems = i === last ? this : this.clone(true);
jQuery( insert[i] )[ original ]( elems );
// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
core_push.apply( ret, elems.get() );
}
return this.pushStack( ret );
};
});
function getAll( context, tag ) {
var elems, elem,
i = 0,
found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
undefined;
if ( !found ) {
for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
if ( !tag || jQuery.nodeName( elem, tag ) ) {
found.push( elem );
} else {
jQuery.merge( found, getAll( elem, tag ) );
}
}
}
return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
jQuery.merge( [ context ], found ) :
found;
}
// Used in buildFragment, fixes the defaultChecked property
function fixDefaultChecked( elem ) {
if ( manipulation_rcheckableType.test( elem.type ) ) {
elem.defaultChecked = elem.checked;
}
}
jQuery.extend({
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var destElements, node, clone, i, srcElements,
inPage = jQuery.contains( elem.ownerDocument, elem );
if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
clone = elem.cloneNode( true );
// IE<=8 does not properly clone detached, unknown element nodes
} else {
fragmentDiv.innerHTML = elem.outerHTML;
fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
}
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
destElements = getAll( clone );
srcElements = getAll( elem );
// Fix all IE cloning issues
for ( i = 0; (node = srcElements[i]) != null; ++i ) {
// Ensure that the destination node is not null; Fixes #9587
if ( destElements[i] ) {
fixCloneNodeIssues( node, destElements[i] );
}
}
}
// Copy the events from the original to the clone
if ( dataAndEvents ) {
if ( deepDataAndEvents ) {
srcElements = srcElements || getAll( elem );
destElements = destElements || getAll( clone );
for ( i = 0; (node = srcElements[i]) != null; i++ ) {
cloneCopyEvent( node, destElements[i] );
}
} else {
cloneCopyEvent( elem, clone );
}
}
// Preserve script evaluation history
destElements = getAll( clone, "script" );
if ( destElements.length > 0 ) {
setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
}
destElements = srcElements = node = null;
// Return the cloned set
return clone;
},
buildFragment: function( elems, context, scripts, selection ) {
var j, elem, contains,
tmp, tag, tbody, wrap,
l = elems.length,
// Ensure a safe fragment
safe = createSafeFragment( context ),
nodes = [],
i = 0;
for ( ; i < l; i++ ) {
elem = elems[ i ];
if ( elem || elem === 0 ) {
// Add nodes directly
if ( jQuery.type( elem ) === "object" ) {
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
// Convert non-html into a text node
} else if ( !rhtml.test( elem ) ) {
nodes.push( context.createTextNode( elem ) );
// Convert html into DOM nodes
} else {
tmp = tmp || safe.appendChild( context.createElement("div") );
// Deserialize a standard representation
tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
wrap = wrapMap[ tag ] || wrapMap._default;
tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
// Descend through wrappers to the right content
j = wrap[0];
while ( j-- ) {
tmp = tmp.lastChild;
}
// Manually add leading whitespace removed by IE
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
}
// Remove IE's autoinserted <tbody> from table fragments
if ( !jQuery.support.tbody ) {
// String was a <table>, *may* have spurious <tbody>
elem = tag === "table" && !rtbody.test( elem ) ?
tmp.firstChild :
// String was a bare <thead> or <tfoot>
wrap[1] === "<table>" && !rtbody.test( elem ) ?
tmp :
0;
j = elem && elem.childNodes.length;
while ( j-- ) {
if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
elem.removeChild( tbody );
}
}
}
jQuery.merge( nodes, tmp.childNodes );
// Fix #12392 for WebKit and IE > 9
tmp.textContent = "";
// Fix #12392 for oldIE
while ( tmp.firstChild ) {
tmp.removeChild( tmp.firstChild );
}
// Remember the top-level container for proper cleanup
tmp = safe.lastChild;
}
}
}
// Fix #11356: Clear elements from fragment
if ( tmp ) {
safe.removeChild( tmp );
}
// Reset defaultChecked for any radios and checkboxes
// about to be appended to the DOM in IE 6/7 (#8060)
if ( !jQuery.support.appendChecked ) {
jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
}
i = 0;
while ( (elem = nodes[ i++ ]) ) {
// #4087 - If origin and destination elements are the same, and this is
// that element, do not do anything
if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
continue;
}
contains = jQuery.contains( elem.ownerDocument, elem );
// Append to fragment
tmp = getAll( safe.appendChild( elem ), "script" );
// Preserve script evaluation history
if ( contains ) {
setGlobalEval( tmp );
}
// Capture executables
if ( scripts ) {
j = 0;
while ( (elem = tmp[ j++ ]) ) {
if ( rscriptType.test( elem.type || "" ) ) {
scripts.push( elem );
}
}
}
}
tmp = null;
return safe;
},
cleanData: function( elems, /* internal */ acceptData ) {
var elem, type, id, data,
i = 0,
internalKey = jQuery.expando,
cache = jQuery.cache,
deleteExpando = jQuery.support.deleteExpando,
special = jQuery.event.special;
for ( ; (elem = elems[i]) != null; i++ ) {
if ( acceptData || jQuery.acceptData( elem ) ) {
id = elem[ internalKey ];
data = id && cache[ id ];
if ( data ) {
if ( data.events ) {
for ( type in data.events ) {
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
// This is a shortcut to avoid jQuery.event.remove's overhead
} else {
jQuery.removeEvent( elem, type, data.handle );
}
}
}
// Remove cache only if it was not already removed by jQuery.event.remove
if ( cache[ id ] ) {
delete cache[ id ];
// IE does not allow us to delete expando properties from nodes,
// nor does it have a removeAttribute function on Document nodes;
// we must handle all of these cases
if ( deleteExpando ) {
delete elem[ internalKey ];
} else if ( typeof elem.removeAttribute !== core_strundefined ) {
elem.removeAttribute( internalKey );
} else {
elem[ internalKey ] = null;
}
core_deletedIds.push( id );
}
}
}
}
}
});
var iframe, getStyles, curCSS,
ralpha = /alpha\([^)]*\)/i,
ropacity = /opacity\s*=\s*([^)]*)/,
rposition = /^(top|right|bottom|left)$/,
// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
rmargin = /^margin/,
rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
elemdisplay = { BODY: "block" },
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = {
letterSpacing: 0,
fontWeight: 400
},
cssExpand = [ "Top", "Right", "Bottom", "Left" ],
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
// return a css property mapped to a potentially vendor prefixed property
function vendorPropName( style, name ) {
// shortcut for names that are not vendor prefixed
if ( name in style ) {
return name;
}
// check for vendor prefixed names
var capName = name.charAt(0).toUpperCase() + name.slice(1),
origName = name,
i = cssPrefixes.length;
while ( i-- ) {
name = cssPrefixes[ i ] + capName;
if ( name in style ) {
return name;
}
}
return origName;
}
function isHidden( elem, el ) {
// isHidden might be called from jQuery#filter function;
// in that case, element will be second argument
elem = el || elem;
return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
}
function showHide( elements, show ) {
var display, elem, hidden,
values = [],
index = 0,
length = elements.length;
for ( ; index < length; index++ ) {
elem = elements[ index ];
if ( !elem.style ) {
continue;
}
values[ index ] = jQuery._data( elem, "olddisplay" );
display = elem.style.display;
if ( show ) {
// Reset the inline display of this element to learn if it is
// being hidden by cascaded rules or not
if ( !values[ index ] && display === "none" ) {
elem.style.display = "";
}
// Set elements which have been overridden with display: none
// in a stylesheet to whatever the default browser style is
// for such an element
if ( elem.style.display === "" && isHidden( elem ) ) {
values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
}
} else {
if ( !values[ index ] ) {
hidden = isHidden( elem );
if ( display && display !== "none" || !hidden ) {
jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
}
}
}
}
// Set the display of most of the elements in a second loop
// to avoid the constant reflow
for ( index = 0; index < length; index++ ) {
elem = elements[ index ];
if ( !elem.style ) {
continue;
}
if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
elem.style.display = show ? values[ index ] || "" : "none";
}
}
return elements;
}
jQuery.fn.extend({
css: function( name, value ) {
return jQuery.access( this, function( elem, name, value ) {
var len, styles,
map = {},
i = 0;
if ( jQuery.isArray( name ) ) {
styles = getStyles( elem );
len = name.length;
for ( ; i < len; i++ ) {
map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
}
return map;
}
return value !== undefined ?
jQuery.style( elem, name, value ) :
jQuery.css( elem, name );
}, name, value, arguments.length > 1 );
},
show: function() {
return showHide( this, true );
},
hide: function() {
return showHide( this );
},
toggle: function( state ) {
var bool = typeof state === "boolean";
return this.each(function() {
if ( bool ? state : isHidden( this ) ) {
jQuery( this ).show();
} else {
jQuery( this ).hide();
}
});
}
});
jQuery.extend({
// Add in style property hooks for overriding the default
// behavior of getting and setting a style property
cssHooks: {
opacity: {
get: function( elem, computed ) {
if ( computed ) {
// We should always get a number back from opacity
var ret = curCSS( elem, "opacity" );
return ret === "" ? "1" : ret;
}
}
}
},
// Exclude the following css properties to add px
cssNumber: {
"columnCount": true,
"fillOpacity": true,
"fontWeight": true,
"lineHeight": true,
"opacity": true,
"orphans": true,
"widows": true,
"zIndex": true,
"zoom": true
},
// Add in properties whose names you wish to fix before
// setting or getting the value
cssProps: {
// normalize float css property
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
},
// Get and set the style property on a DOM Node
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
// Make sure that we're working with the right name
var ret, type, hooks,
origName = jQuery.camelCase( name ),
style = elem.style;
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
// gets hook for the prefixed version
// followed by the unprefixed version
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
// Check if we're setting a value
if ( value !== undefined ) {
type = typeof value;
// convert relative number strings (+= or -=) to relative numbers. #7345
if ( type === "string" && (ret = rrelNum.exec( value )) ) {
value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
// Fixes bug #9237
type = "number";
}
// Make sure that NaN and null values aren't set. See: #7116
if ( value == null || type === "number" && isNaN( value ) ) {
return;
}
// If a number was passed in, add 'px' to the (except for certain CSS properties)
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
value += "px";
}
// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
// but it would mean to define eight (for every problematic property) identical functions
if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
style[ name ] = "inherit";
}
// If a hook was provided, use that value, otherwise just set the specified value
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
// Fixes bug #5509
try {
style[ name ] = value;
} catch(e) {}
}
} else {
// If a hook was provided get the non-computed value from there
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
return ret;
}
// Otherwise just get the value from the style object
return style[ name ];
}
},
css: function( elem, name, extra, styles ) {
var num, val, hooks,
origName = jQuery.camelCase( name );
// Make sure that we're working with the right name
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
// gets hook for the prefixed version
// followed by the unprefixed version
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
// If a hook was provided get the computed value from there
if ( hooks && "get" in hooks ) {
val = hooks.get( elem, true, extra );
}
// Otherwise, if a way to get the computed value exists, use that
if ( val === undefined ) {
val = curCSS( elem, name, styles );
}
//convert "normal" to computed value
if ( val === "normal" && name in cssNormalTransform ) {
val = cssNormalTransform[ name ];
}
// Return, converting to number if forced or a qualifier was provided and val looks numeric
if ( extra === "" || extra ) {
num = parseFloat( val );
return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
}
return val;
},
// A method for quickly swapping in/out CSS properties to get correct calculations
swap: function( elem, options, callback, args ) {
var ret, name,
old = {};
// Remember the old values, and insert the new ones
for ( name in options ) {
old[ name ] = elem.style[ name ];
elem.style[ name ] = options[ name ];
}
ret = callback.apply( elem, args || [] );
// Revert the old values
for ( name in options ) {
elem.style[ name ] = old[ name ];
}
return ret;
}
});
// NOTE: we've included the "window" in window.getComputedStyle
// because jsdom on node.js will break without it.
if ( window.getComputedStyle ) {
getStyles = function( elem ) {
return window.getComputedStyle( elem, null );
};
curCSS = function( elem, name, _computed ) {
var width, minWidth, maxWidth,
computed = _computed || getStyles( elem ),
// getPropertyValue is only needed for .css('filter') in IE9, see #12537
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
style = elem.style;
if ( computed ) {
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
ret = jQuery.style( elem, name );
}
// A tribute to the "awesome hack by Dean Edwards"
// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
// Remember the original values
width = style.width;
minWidth = style.minWidth;
maxWidth = style.maxWidth;
// Put in the new values to get a computed value out
style.minWidth = style.maxWidth = style.width = ret;
ret = computed.width;
// Revert the changed values
style.width = width;
style.minWidth = minWidth;
style.maxWidth = maxWidth;
}
}
return ret;
};
} else if ( document.documentElement.currentStyle ) {
getStyles = function( elem ) {
return elem.currentStyle;
};
curCSS = function( elem, name, _computed ) {
var left, rs, rsLeft,
computed = _computed || getStyles( elem ),
ret = computed ? computed[ name ] : undefined,
style = elem.style;
// Avoid setting ret to empty string here
// so we don't default to auto
if ( ret == null && style && style[ name ] ) {
ret = style[ name ];
}
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
// but not position css attributes, as those are proportional to the parent element instead
// and we can't measure the parent instead because it might trigger a "stacking dolls" problem
if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
// Remember the original values
left = style.left;
rs = elem.runtimeStyle;
rsLeft = rs && rs.left;
// Put in the new values to get a computed value out
if ( rsLeft ) {
rs.left = elem.currentStyle.left;
}
style.left = name === "fontSize" ? "1em" : ret;
ret = style.pixelLeft + "px";
// Revert the changed values
style.left = left;
if ( rsLeft ) {
rs.left = rsLeft;
}
}
return ret === "" ? "auto" : ret;
};
}
function setPositiveNumber( elem, value, subtract ) {
var matches = rnumsplit.exec( value );
return matches ?
// Guard against undefined "subtract", e.g., when used as in cssHooks
Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
value;
}
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
var i = extra === ( isBorderBox ? "border" : "content" ) ?
// If we already have the right measurement, avoid augmentation
4 :
// Otherwise initialize for horizontal or vertical properties
name === "width" ? 1 : 0,
val = 0;
for ( ; i < 4; i += 2 ) {
// both box models exclude margin, so add it if we want it
if ( extra === "margin" ) {
val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
}
if ( isBorderBox ) {
// border-box includes padding, so remove it if we want content
if ( extra === "content" ) {
val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
}
// at this point, extra isn't border nor margin, so remove border
if ( extra !== "margin" ) {
val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
}
} else {
// at this point, extra isn't content, so add padding
val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
// at this point, extra isn't content nor padding, so add border
if ( extra !== "padding" ) {
val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
}
}
}
return val;
}
function getWidthOrHeight( elem, name, extra ) {
// Start with offset property, which is equivalent to the border-box value
var valueIsBorderBox = true,
val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
styles = getStyles( elem ),
isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
// some non-html elements return undefined for offsetWidth, so check for null/undefined
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
if ( val <= 0 || val == null ) {
// Fall back to computed then uncomputed css if necessary
val = curCSS( elem, name, styles );
if ( val < 0 || val == null ) {
val = elem.style[ name ];
}
// Computed unit is not pixels. Stop here and return.
if ( rnumnonpx.test(val) ) {
return val;
}
// we need the check for style in case a browser which returns unreliable values
// for getComputedStyle silently falls back to the reliable elem.style
valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
// Normalize "", auto, and prepare for extra
val = parseFloat( val ) || 0;
}
// use the active box-sizing model to add/subtract irrelevant styles
return ( val +
augmentWidthOrHeight(
elem,
name,
extra || ( isBorderBox ? "border" : "content" ),
valueIsBorderBox,
styles
)
) + "px";
}
// Try to determine the default display value of an element
function css_defaultDisplay( nodeName ) {
var doc = document,
display = elemdisplay[ nodeName ];
if ( !display ) {
display = actualDisplay( nodeName, doc );
// If the simple way fails, read from inside an iframe
if ( display === "none" || !display ) {
// Use the already-created iframe if possible
iframe = ( iframe ||
jQuery("<iframe frameborder='0' width='0' height='0'/>")
.css( "cssText", "display:block !important" )
).appendTo( doc.documentElement );
// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
doc.write("<!doctype html><html><body>");
doc.close();
display = actualDisplay( nodeName, doc );
iframe.detach();
}
// Store the correct default display
elemdisplay[ nodeName ] = display;
}
return display;
}
// Called ONLY from within css_defaultDisplay
function actualDisplay( name, doc ) {
var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
display = jQuery.css( elem[0], "display" );
elem.remove();
return display;
}
jQuery.each([ "height", "width" ], function( i, name ) {
jQuery.cssHooks[ name ] = {
get: function( elem, computed, extra ) {
if ( computed ) {
// certain elements can have dimension info if we invisibly show them
// however, it must have a current display style that would benefit from this
return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
jQuery.swap( elem, cssShow, function() {
return getWidthOrHeight( elem, name, extra );
}) :
getWidthOrHeight( elem, name, extra );
}
},
set: function( elem, value, extra ) {
var styles = extra && getStyles( elem );
return setPositiveNumber( elem, value, extra ?
augmentWidthOrHeight(
elem,
name,
extra,
jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
styles
) : 0
);
}
};
});
if ( !jQuery.support.opacity ) {
jQuery.cssHooks.opacity = {
get: function( elem, computed ) {
// IE uses filters for opacity
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
computed ? "1" : "";
},
set: function( elem, value ) {
var style = elem.style,
currentStyle = elem.currentStyle,
opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
filter = currentStyle && currentStyle.filter || style.filter || "";
// IE has trouble with opacity if it does not have layout
// Force it by setting the zoom level
style.zoom = 1;
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
// if value === "", then remove inline opacity #12685
if ( ( value >= 1 || value === "" ) &&
jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
style.removeAttribute ) {
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
// if "filter:" is present at all, clearType is disabled, we want to avoid this
// style.removeAttribute is IE Only, but so apparently is this code path...
style.removeAttribute( "filter" );
// if there is no filter style applied in a css rule or unset inline opacity, we are done
if ( value === "" || currentStyle && !currentStyle.filter ) {
return;
}
}
// otherwise, set new filter values
style.filter = ralpha.test( filter ) ?
filter.replace( ralpha, opacity ) :
filter + " " + opacity;
}
};
}
// These hooks cannot be added until DOM ready because the support test
// for it is not run until after DOM ready
jQuery(function() {
if ( !jQuery.support.reliableMarginRight ) {
jQuery.cssHooks.marginRight = {
get: function( elem, computed ) {
if ( computed ) {
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
// Work around by temporarily setting element display to inline-block
return jQuery.swap( elem, { "display": "inline-block" },
curCSS, [ elem, "marginRight" ] );
}
}
};
}
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
// getComputedStyle returns percent when specified for top/left/bottom/right
// rather than make the css module depend on the offset module, we just check for it here
if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
jQuery.each( [ "top", "left" ], function( i, prop ) {
jQuery.cssHooks[ prop ] = {
get: function( elem, computed ) {
if ( computed ) {
computed = curCSS( elem, prop );
// if curCSS returns percentage, fallback to offset
return rnumnonpx.test( computed ) ?
jQuery( elem ).position()[ prop ] + "px" :
computed;
}
}
};
});
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
// Support: Opera <= 12.12
// Opera reports offsetWidths and offsetHeights less than zero on some elements
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
(!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
};
}
// These hooks are used by animate to expand properties
jQuery.each({
margin: "",
padding: "",
border: "Width"
}, function( prefix, suffix ) {
jQuery.cssHooks[ prefix + suffix ] = {
expand: function( value ) {
var i = 0,
expanded = {},
// assumes a single number if not a string
parts = typeof value === "string" ? value.split(" ") : [ value ];
for ( ; i < 4; i++ ) {
expanded[ prefix + cssExpand[ i ] + suffix ] =
parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
}
return expanded;
}
};
if ( !rmargin.test( prefix ) ) {
jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
}
});
var r20 = /%20/g,
rbracket = /\[\]$/,
rCRLF = /\r?\n/g,
rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
rsubmittable = /^(?:input|select|textarea|keygen)/i;
jQuery.fn.extend({
serialize: function() {
return jQuery.param( this.serializeArray() );
},
serializeArray: function() {
return this.map(function(){
// Can add propHook for "elements" to filter or add form elements
var elements = jQuery.prop( this, "elements" );
return elements ? jQuery.makeArray( elements ) : this;
})
.filter(function(){
var type = this.type;
// Use .is(":disabled") so that fieldset[disabled] works
return this.name && !jQuery( this ).is( ":disabled" ) &&
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
( this.checked || !manipulation_rcheckableType.test( type ) );
})
.map(function( i, elem ){
var val = jQuery( this ).val();
return val == null ?
null :
jQuery.isArray( val ) ?
jQuery.map( val, function( val ){
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}) :
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
}).get();
}
});
//Serialize an array of form elements or a set of
//key/values into a query string
jQuery.param = function( a, traditional ) {
var prefix,
s = [],
add = function( key, value ) {
// If value is a function, invoke it and return its value
value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
};
// Set traditional to true for jQuery <= 1.3.2 behavior.
if ( traditional === undefined ) {
traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
}
// If an array was passed in, assume that it is an array of form elements.
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
// Serialize the form elements
jQuery.each( a, function() {
add( this.name, this.value );
});
} else {
// If traditional, encode the "old" way (the way 1.3.2 or older
// did it), otherwise encode params recursively.
for ( prefix in a ) {
buildParams( prefix, a[ prefix ], traditional, add );
}
}
// Return the resulting serialization
return s.join( "&" ).replace( r20, "+" );
};
function buildParams( prefix, obj, traditional, add ) {
var name;
if ( jQuery.isArray( obj ) ) {
// Serialize array item.
jQuery.each( obj, function( i, v ) {
if ( traditional || rbracket.test( prefix ) ) {
// Treat each array item as a scalar.
add( prefix, v );
} else {
// Item is non-scalar (array or object), encode its numeric index.
buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
}
});
} else if ( !traditional && jQuery.type( obj ) === "object" ) {
// Serialize object item.
for ( name in obj ) {
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
}
} else {
// Serialize scalar item.
add( prefix, obj );
}
}
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
// Handle event binding
jQuery.fn[ name ] = function( data, fn ) {
return arguments.length > 0 ?
this.on( name, null, data, fn ) :
this.trigger( name );
};
});
jQuery.fn.hover = function( fnOver, fnOut ) {
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
};
var
// Document location
ajaxLocParts,
ajaxLocation,
ajax_nonce = jQuery.now(),
ajax_rquery = /\?/,
rhash = /#.*$/,
rts = /([?&])_=[^&]*/,
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
// #7653, #8125, #8152: local protocol detection
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
rnoContent = /^(?:GET|HEAD)$/,
rprotocol = /^\/\//,
rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
// Keep a copy of the old load method
_load = jQuery.fn.load,
/* Prefilters
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
* 2) These are called:
* - BEFORE asking for a transport
* - AFTER param serialization (s.data is a string if s.processData is true)
* 3) key is the dataType
* 4) the catchall symbol "*" can be used
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
*/
prefilters = {},
/* Transports bindings
* 1) key is the dataType
* 2) the catchall symbol "*" can be used
* 3) selection will start with transport dataType and THEN go to "*" if needed
*/
transports = {},
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
allTypes = "*/".concat("*");
// #8138, IE may throw an exception when accessing
// a field from window.location if document.domain has been set
try {
ajaxLocation = location.href;
} catch( e ) {
// Use the href attribute of an A element
// since IE will modify it given document.location
ajaxLocation = document.createElement( "a" );
ajaxLocation.href = "";
ajaxLocation = ajaxLocation.href;
}
// Segment location into parts
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
function addToPrefiltersOrTransports( structure ) {
// dataTypeExpression is optional and defaults to "*"
return function( dataTypeExpression, func ) {
if ( typeof dataTypeExpression !== "string" ) {
func = dataTypeExpression;
dataTypeExpression = "*";
}
var dataType,
i = 0,
dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
if ( jQuery.isFunction( func ) ) {
// For each dataType in the dataTypeExpression
while ( (dataType = dataTypes[i++]) ) {
// Prepend if requested
if ( dataType[0] === "+" ) {
dataType = dataType.slice( 1 ) || "*";
(structure[ dataType ] = structure[ dataType ] || []).unshift( func );
// Otherwise append
} else {
(structure[ dataType ] = structure[ dataType ] || []).push( func );
}
}
}
};
}
// Base inspection function for prefilters and transports
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
var inspected = {},
seekingTransport = ( structure === transports );
function inspect( dataType ) {
var selected;
inspected[ dataType ] = true;
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
options.dataTypes.unshift( dataTypeOrTransport );
inspect( dataTypeOrTransport );
return false;
} else if ( seekingTransport ) {
return !( selected = dataTypeOrTransport );
}
});
return selected;
}
return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
}
// A special extend for ajax options
// that takes "flat" options (not to be deep extended)
// Fixes #9887
function ajaxExtend( target, src ) {
var deep, key,
flatOptions = jQuery.ajaxSettings.flatOptions || {};
for ( key in src ) {
if ( src[ key ] !== undefined ) {
( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
}
}
if ( deep ) {
jQuery.extend( true, target, deep );
}
return target;
}
jQuery.fn.load = function( url, params, callback ) {
if ( typeof url !== "string" && _load ) {
return _load.apply( this, arguments );
}
var selector, response, type,
self = this,
off = url.indexOf(" ");
if ( off >= 0 ) {
selector = url.slice( off, url.length );
url = url.slice( 0, off );
}
// If it's a function
if ( jQuery.isFunction( params ) ) {
// We assume that it's the callback
callback = params;
params = undefined;
// Otherwise, build a param string
} else if ( params && typeof params === "object" ) {
type = "POST";
}
// If we have elements to modify, make the request
if ( self.length > 0 ) {
jQuery.ajax({
url: url,
// if "type" variable is undefined, then "GET" method will be used
type: type,
dataType: "html",
data: params
}).done(function( responseText ) {
// Save response for use in complete callback
response = arguments;
self.html( selector ?
// If a selector was specified, locate the right elements in a dummy div
// Exclude scripts to avoid IE 'Permission Denied' errors
jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
// Otherwise use the full result
responseText );
}).complete( callback && function( jqXHR, status ) {
self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
});
}
return this;
};
// Attach a bunch of functions for handling common AJAX events
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
jQuery.fn[ type ] = function( fn ){
return this.on( type, fn );
};
});
jQuery.each( [ "get", "post" ], function( i, method ) {
jQuery[ method ] = function( url, data, callback, type ) {
// shift arguments if data argument was omitted
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
data = undefined;
}
return jQuery.ajax({
url: url,
type: method,
dataType: type,
data: data,
success: callback
});
};
});
jQuery.extend({
// Counter for holding the number of active queries
active: 0,
// Last-Modified header cache for next request
lastModified: {},
etag: {},
ajaxSettings: {
url: ajaxLocation,
type: "GET",
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
global: true,
processData: true,
async: true,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
/*
timeout: 0,
data: null,
dataType: null,
username: null,
password: null,
cache: null,
throws: false,
traditional: false,
headers: {},
*/
accepts: {
"*": allTypes,
text: "text/plain",
html: "text/html",
xml: "application/xml, text/xml",
json: "application/json, text/javascript"
},
contents: {
xml: /xml/,
html: /html/,
json: /json/
},
responseFields: {
xml: "responseXML",
text: "responseText"
},
// Data converters
// Keys separate source (or catchall "*") and destination types with a single space
converters: {
// Convert anything to text
"* text": window.String,
// Text to html (true = no transformation)
"text html": true,
// Evaluate text as a json expression
"text json": jQuery.parseJSON,
// Parse text as xml
"text xml": jQuery.parseXML
},
// For options that shouldn't be deep extended:
// you can add your own custom options here if
// and when you create one that shouldn't be
// deep extended (see ajaxExtend)
flatOptions: {
url: true,
context: true
}
},
// Creates a full fledged settings object into target
// with both ajaxSettings and settings fields.
// If target is omitted, writes into ajaxSettings.
ajaxSetup: function( target, settings ) {
return settings ?
// Building a settings object
ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
// Extending ajaxSettings
ajaxExtend( jQuery.ajaxSettings, target );
},
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
ajaxTransport: addToPrefiltersOrTransports( transports ),
// Main method
ajax: function( url, options ) {
// If url is an object, simulate pre-1.5 signature
if ( typeof url === "object" ) {
options = url;
url = undefined;
}
// Force options to be an object
options = options || {};
var // Cross-domain detection vars
parts,
// Loop variable
i,
// URL without anti-cache param
cacheURL,
// Response headers as string
responseHeadersString,
// timeout handle
timeoutTimer,
// To know if global events are to be dispatched
fireGlobals,
transport,
// Response headers
responseHeaders,
// Create the final options object
s = jQuery.ajaxSetup( {}, options ),
// Callbacks context
callbackContext = s.context || s,
// Context for global events is callbackContext if it is a DOM node or jQuery collection
globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
jQuery( callbackContext ) :
jQuery.event,
// Deferreds
deferred = jQuery.Deferred(),
completeDeferred = jQuery.Callbacks("once memory"),
// Status-dependent callbacks
statusCode = s.statusCode || {},
// Headers (they are sent all at once)
requestHeaders = {},
requestHeadersNames = {},
// The jqXHR state
state = 0,
// Default abort message
strAbort = "canceled",
// Fake xhr
jqXHR = {
readyState: 0,
// Builds headers hashtable if needed
getResponseHeader: function( key ) {
var match;
if ( state === 2 ) {
if ( !responseHeaders ) {
responseHeaders = {};
while ( (match = rheaders.exec( responseHeadersString )) ) {
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
}
}
match = responseHeaders[ key.toLowerCase() ];
}
return match == null ? null : match;
},
// Raw string
getAllResponseHeaders: function() {
return state === 2 ? responseHeadersString : null;
},
// Caches the header
setRequestHeader: function( name, value ) {
var lname = name.toLowerCase();
if ( !state ) {
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
requestHeaders[ name ] = value;
}
return this;
},
// Overrides response content-type header
overrideMimeType: function( type ) {
if ( !state ) {
s.mimeType = type;
}
return this;
},
// Status-dependent callbacks
statusCode: function( map ) {
var code;
if ( map ) {
if ( state < 2 ) {
for ( code in map ) {
// Lazy-add the new callback in a way that preserves old ones
statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
}
} else {
// Execute the appropriate callbacks
jqXHR.always( map[ jqXHR.status ] );
}
}
return this;
},
// Cancel the request
abort: function( statusText ) {
var finalText = statusText || strAbort;
if ( transport ) {
transport.abort( finalText );
}
done( 0, finalText );
return this;
}
};
// Attach deferreds
deferred.promise( jqXHR ).complete = completeDeferred.add;
jqXHR.success = jqXHR.done;
jqXHR.error = jqXHR.fail;
// Remove hash character (#7531: and string promotion)
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
// Handle falsy url in the settings object (#10093: consistency with old signature)
// We also use the url parameter if available
s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
// Alias method option to type as per ticket #12004
s.type = options.method || options.type || s.method || s.type;
// Extract dataTypes list
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
// A cross-domain request is in order when we have a protocol:host:port mismatch
if ( s.crossDomain == null ) {
parts = rurl.exec( s.url.toLowerCase() );
s.crossDomain = !!( parts &&
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
);
}
// Convert data if not already a string
if ( s.data && s.processData && typeof s.data !== "string" ) {
s.data = jQuery.param( s.data, s.traditional );
}
// Apply prefilters
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
// If request was aborted inside a prefilter, stop there
if ( state === 2 ) {
return jqXHR;
}
// We can fire global events as of now if asked to
fireGlobals = s.global;
// Watch for a new set of requests
if ( fireGlobals && jQuery.active++ === 0 ) {
jQuery.event.trigger("ajaxStart");
}
// Uppercase the type
s.type = s.type.toUpperCase();
// Determine if request has content
s.hasContent = !rnoContent.test( s.type );
// Save the URL in case we're toying with the If-Modified-Since
// and/or If-None-Match header later on
cacheURL = s.url;
// More options handling for requests with no content
if ( !s.hasContent ) {
// If data is available, append data to url
if ( s.data ) {
cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
// #9682: remove data so that it's not used in an eventual retry
delete s.data;
}
// Add anti-cache in url if needed
if ( s.cache === false ) {
s.url = rts.test( cacheURL ) ?
// If there is already a '_' parameter, set its value
cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
// Otherwise add one to the end
cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
}
}
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
if ( jQuery.lastModified[ cacheURL ] ) {
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
}
if ( jQuery.etag[ cacheURL ] ) {
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
}
}
// Set the correct header, if data is being sent
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
jqXHR.setRequestHeader( "Content-Type", s.contentType );
}
// Set the Accepts header for the server, depending on the dataType
jqXHR.setRequestHeader(
"Accept",
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
s.accepts[ "*" ]
);
// Check for headers option
for ( i in s.headers ) {
jqXHR.setRequestHeader( i, s.headers[ i ] );
}
// Allow custom headers/mimetypes and early abort
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
// Abort if not done already and return
return jqXHR.abort();
}
// aborting is no longer a cancellation
strAbort = "abort";
// Install callbacks on deferreds
for ( i in { success: 1, error: 1, complete: 1 } ) {
jqXHR[ i ]( s[ i ] );
}
// Get transport
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
// If no transport, we auto-abort
if ( !transport ) {
done( -1, "No Transport" );
} else {
jqXHR.readyState = 1;
// Send global event
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
}
// Timeout
if ( s.async && s.timeout > 0 ) {
timeoutTimer = setTimeout(function() {
jqXHR.abort("timeout");
}, s.timeout );
}
try {
state = 1;
transport.send( requestHeaders, done );
} catch ( e ) {
// Propagate exception as error if not done
if ( state < 2 ) {
done( -1, e );
// Simply rethrow otherwise
} else {
throw e;
}
}
}
// Callback for when everything is done
function done( status, nativeStatusText, responses, headers ) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Called once
if ( state === 2 ) {
return;
}
// State is "done" now
state = 2;
// Clear timeout if it exists
if ( timeoutTimer ) {
clearTimeout( timeoutTimer );
}
// Dereference transport for early garbage collection
// (no matter how long the jqXHR object will be used)
transport = undefined;
// Cache response headers
responseHeadersString = headers || "";
// Set readyState
jqXHR.readyState = status > 0 ? 4 : 0;
// Get response data
if ( responses ) {
response = ajaxHandleResponses( s, jqXHR, responses );
}
// If successful, handle type chaining
if ( status >= 200 && status < 300 || status === 304 ) {
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
modified = jqXHR.getResponseHeader("Last-Modified");
if ( modified ) {
jQuery.lastModified[ cacheURL ] = modified;
}
modified = jqXHR.getResponseHeader("etag");
if ( modified ) {
jQuery.etag[ cacheURL ] = modified;
}
}
// if no content
if ( status === 204 ) {
isSuccess = true;
statusText = "nocontent";
// if not modified
} else if ( status === 304 ) {
isSuccess = true;
statusText = "notmodified";
// If we have data, let's convert it
} else {
isSuccess = ajaxConvert( s, response );
statusText = isSuccess.state;
success = isSuccess.data;
error = isSuccess.error;
isSuccess = !error;
}
} else {
// We extract error from statusText
// then normalize statusText and status for non-aborts
error = statusText;
if ( status || !statusText ) {
statusText = "error";
if ( status < 0 ) {
status = 0;
}
}
}
// Set data for the fake xhr object
jqXHR.status = status;
jqXHR.statusText = ( nativeStatusText || statusText ) + "";
// Success/Error
if ( isSuccess ) {
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
} else {
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
}
// Status-dependent callbacks
jqXHR.statusCode( statusCode );
statusCode = undefined;
if ( fireGlobals ) {
globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
[ jqXHR, s, isSuccess ? success : error ] );
}
// Complete
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
if ( fireGlobals ) {
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
// Handle the global AJAX counter
if ( !( --jQuery.active ) ) {
jQuery.event.trigger("ajaxStop");
}
}
}
return jqXHR;
},
getScript: function( url, callback ) {
return jQuery.get( url, undefined, callback, "script" );
},
getJSON: function( url, data, callback ) {
return jQuery.get( url, data, callback, "json" );
}
});
/* Handles responses to an ajax request:
* - sets all responseXXX fields accordingly
* - finds the right dataType (mediates between content-type and expected dataType)
* - returns the corresponding response
*/
function ajaxHandleResponses( s, jqXHR, responses ) {
var firstDataType, ct, finalDataType, type,
contents = s.contents,
dataTypes = s.dataTypes,
responseFields = s.responseFields;
// Fill responseXXX fields
for ( type in responseFields ) {
if ( type in responses ) {
jqXHR[ responseFields[type] ] = responses[ type ];
}
}
// Remove auto dataType and get content-type in the process
while( dataTypes[ 0 ] === "*" ) {
dataTypes.shift();
if ( ct === undefined ) {
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
}
}
// Check if we're dealing with a known content-type
if ( ct ) {
for ( type in contents ) {
if ( contents[ type ] && contents[ type ].test( ct ) ) {
dataTypes.unshift( type );
break;
}
}
}
// Check to see if we have a response for the expected dataType
if ( dataTypes[ 0 ] in responses ) {
finalDataType = dataTypes[ 0 ];
} else {
// Try convertible dataTypes
for ( type in responses ) {
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
finalDataType = type;
break;
}
if ( !firstDataType ) {
firstDataType = type;
}
}
// Or just use first one
finalDataType = finalDataType || firstDataType;
}
// If we found a dataType
// We add the dataType to the list if needed
// and return the corresponding response
if ( finalDataType ) {
if ( finalDataType !== dataTypes[ 0 ] ) {
dataTypes.unshift( finalDataType );
}
return responses[ finalDataType ];
}
}
// Chain conversions given the request and the original response
function ajaxConvert( s, response ) {
var conv2, current, conv, tmp,
converters = {},
i = 0,
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice(),
prev = dataTypes[ 0 ];
// Apply the dataFilter if provided
if ( s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
}
// Create converters map with lowercased keys
if ( dataTypes[ 1 ] ) {
for ( conv in s.converters ) {
converters[ conv.toLowerCase() ] = s.converters[ conv ];
}
}
// Convert to each sequential dataType, tolerating list modification
for ( ; (current = dataTypes[++i]); ) {
// There's only work to do if current dataType is non-auto
if ( current !== "*" ) {
// Convert response if prev dataType is non-auto and differs from current
if ( prev !== "*" && prev !== current ) {
// Seek a direct converter
conv = converters[ prev + " " + current ] || converters[ "* " + current ];
// If none found, seek a pair
if ( !conv ) {
for ( conv2 in converters ) {
// If conv2 outputs current
tmp = conv2.split(" ");
if ( tmp[ 1 ] === current ) {
// If prev can be converted to accepted input
conv = converters[ prev + " " + tmp[ 0 ] ] ||
converters[ "* " + tmp[ 0 ] ];
if ( conv ) {
// Condense equivalence converters
if ( conv === true ) {
conv = converters[ conv2 ];
// Otherwise, insert the intermediate dataType
} else if ( converters[ conv2 ] !== true ) {
current = tmp[ 0 ];
dataTypes.splice( i--, 0, current );
}
break;
}
}
}
}
// Apply converter (if not an equivalence)
if ( conv !== true ) {
// Unless errors are allowed to bubble, catch and return them
if ( conv && s["throws"] ) {
response = conv( response );
} else {
try {
response = conv( response );
} catch ( e ) {
return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
}
}
}
}
// Update prev for next iteration
prev = current;
}
}
return { state: "success", data: response };
}
// Install script dataType
jQuery.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /(?:java|ecma)script/
},
converters: {
"text script": function( text ) {
jQuery.globalEval( text );
return text;
}
}
});
// Handle cache's special case and global
jQuery.ajaxPrefilter( "script", function( s ) {
if ( s.cache === undefined ) {
s.cache = false;
}
if ( s.crossDomain ) {
s.type = "GET";
s.global = false;
}
});
// Bind script tag hack transport
jQuery.ajaxTransport( "script", function(s) {
// This transport only deals with cross domain requests
if ( s.crossDomain ) {
var script,
head = document.head || jQuery("head")[0] || document.documentElement;
return {
send: function( _, callback ) {
script = document.createElement("script");
script.async = true;
if ( s.scriptCharset ) {
script.charset = s.scriptCharset;
}
script.src = s.url;
// Attach handlers for all browsers
script.onload = script.onreadystatechange = function( _, isAbort ) {
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
// Remove the script
if ( script.parentNode ) {
script.parentNode.removeChild( script );
}
// Dereference the script
script = null;
// Callback if not abort
if ( !isAbort ) {
callback( 200, "success" );
}
}
};
// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
// Use native DOM manipulation to avoid our domManip AJAX trickery
head.insertBefore( script, head.firstChild );
},
abort: function() {
if ( script ) {
script.onload( undefined, true );
}
}
};
}
});
var oldCallbacks = [],
rjsonp = /(=)\?(?=&|$)|\?\?/;
// Default jsonp settings
jQuery.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
this[ callback ] = true;
return callback;
}
});
// Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
var callbackName, overwritten, responseContainer,
jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
"url" :
typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
);
// Handle iff the expected data type is "jsonp" or we have a parameter to set
if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
// Get callback name, remembering preexisting value associated with it
callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
s.jsonpCallback() :
s.jsonpCallback;
// Insert callback into url or form data
if ( jsonProp ) {
s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
} else if ( s.jsonp !== false ) {
s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
}
// Use data converter to retrieve json after script execution
s.converters["script json"] = function() {
if ( !responseContainer ) {
jQuery.error( callbackName + " was not called" );
}
return responseContainer[ 0 ];
};
// force json dataType
s.dataTypes[ 0 ] = "json";
// Install callback
overwritten = window[ callbackName ];
window[ callbackName ] = function() {
responseContainer = arguments;
};
// Clean-up function (fires after converters)
jqXHR.always(function() {
// Restore preexisting value
window[ callbackName ] = overwritten;
// Save back as free
if ( s[ callbackName ] ) {
// make sure that re-using the options doesn't screw things around
s.jsonpCallback = originalSettings.jsonpCallback;
// save the callback name for future use
oldCallbacks.push( callbackName );
}
// Call if it was a function and we have a response
if ( responseContainer && jQuery.isFunction( overwritten ) ) {
overwritten( responseContainer[ 0 ] );
}
responseContainer = overwritten = undefined;
});
// Delegate to script
return "script";
}
});
var xhrCallbacks, xhrSupported,
xhrId = 0,
// #5280: Internet Explorer will keep connections alive if we don't abort on unload
xhrOnUnloadAbort = window.ActiveXObject && function() {
// Abort all pending requests
var key;
for ( key in xhrCallbacks ) {
xhrCallbacks[ key ]( undefined, true );
}
};
// Functions to create xhrs
function createStandardXHR() {
try {
return new window.XMLHttpRequest();
} catch( e ) {}
}
function createActiveXHR() {
try {
return new window.ActiveXObject("Microsoft.XMLHTTP");
} catch( e ) {}
}
// Create the request object
// (This is still attached to ajaxSettings for backward compatibility)
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
/* Microsoft failed to properly
* implement the XMLHttpRequest in IE7 (can't request local files),
* so we use the ActiveXObject when it is available
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
* we need a fallback.
*/
function() {
return !this.isLocal && createStandardXHR() || createActiveXHR();
} :
// For all other browsers, use the standard XMLHttpRequest object
createStandardXHR;
// Determine support properties
xhrSupported = jQuery.ajaxSettings.xhr();
jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
xhrSupported = jQuery.support.ajax = !!xhrSupported;
// Create transport if the browser can provide an xhr
if ( xhrSupported ) {
jQuery.ajaxTransport(function( s ) {
// Cross domain only allowed if supported through XMLHttpRequest
if ( !s.crossDomain || jQuery.support.cors ) {
var callback;
return {
send: function( headers, complete ) {
// Get a new xhr
var handle, i,
xhr = s.xhr();
// Open the socket
// Passing null username, generates a login popup on Opera (#2865)
if ( s.username ) {
xhr.open( s.type, s.url, s.async, s.username, s.password );
} else {
xhr.open( s.type, s.url, s.async );
}
// Apply custom fields if provided
if ( s.xhrFields ) {
for ( i in s.xhrFields ) {
xhr[ i ] = s.xhrFields[ i ];
}
}
// Override mime type if needed
if ( s.mimeType && xhr.overrideMimeType ) {
xhr.overrideMimeType( s.mimeType );
}
// X-Requested-With header
// For cross-domain requests, seeing as conditions for a preflight are
// akin to a jigsaw puzzle, we simply never set it to be sure.
// (it can always be set on a per-request basis or even using ajaxSetup)
// For same-domain requests, won't change header if already provided.
if ( !s.crossDomain && !headers["X-Requested-With"] ) {
headers["X-Requested-With"] = "XMLHttpRequest";
}
// Need an extra try/catch for cross domain requests in Firefox 3
try {
for ( i in headers ) {
xhr.setRequestHeader( i, headers[ i ] );
}
} catch( err ) {}
// Do send the request
// This may raise an exception which is actually
// handled in jQuery.ajax (so no try/catch here)
xhr.send( ( s.hasContent && s.data ) || null );
// Listener
callback = function( _, isAbort ) {
var status, responseHeaders, statusText, responses;
// Firefox throws exceptions when accessing properties
// of an xhr when a network error occurred
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
try {
// Was never called and is aborted or complete
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
// Only called once
callback = undefined;
// Do not keep as active anymore
if ( handle ) {
xhr.onreadystatechange = jQuery.noop;
if ( xhrOnUnloadAbort ) {
delete xhrCallbacks[ handle ];
}
}
// If it's an abort
if ( isAbort ) {
// Abort it manually if needed
if ( xhr.readyState !== 4 ) {
xhr.abort();
}
} else {
responses = {};
status = xhr.status;
responseHeaders = xhr.getAllResponseHeaders();
// When requesting binary data, IE6-9 will throw an exception
// on any attempt to access responseText (#11426)
if ( typeof xhr.responseText === "string" ) {
responses.text = xhr.responseText;
}
// Firefox throws an exception when accessing
// statusText for faulty cross-domain requests
try {
statusText = xhr.statusText;
} catch( e ) {
// We normalize with Webkit giving an empty statusText
statusText = "";
}
// Filter status for non standard behaviors
// If the request is local and we have data: assume a success
// (success with no data won't get notified, that's the best we
// can do given current implementations)
if ( !status && s.isLocal && !s.crossDomain ) {
status = responses.text ? 200 : 404;
// IE - #1450: sometimes returns 1223 when it should be 204
} else if ( status === 1223 ) {
status = 204;
}
}
}
} catch( firefoxAccessException ) {
if ( !isAbort ) {
complete( -1, firefoxAccessException );
}
}
// Call complete if needed
if ( responses ) {
complete( status, statusText, responses, responseHeaders );
}
};
if ( !s.async ) {
// if we're in sync mode we fire the callback
callback();
} else if ( xhr.readyState === 4 ) {
// (IE6 & IE7) if it's in cache and has been
// retrieved directly we need to fire the callback
setTimeout( callback );
} else {
handle = ++xhrId;
if ( xhrOnUnloadAbort ) {
// Create the active xhrs callbacks list if needed
// and attach the unload handler
if ( !xhrCallbacks ) {
xhrCallbacks = {};
jQuery( window ).unload( xhrOnUnloadAbort );
}
// Add to list of active xhrs callbacks
xhrCallbacks[ handle ] = callback;
}
xhr.onreadystatechange = callback;
}
},
abort: function() {
if ( callback ) {
callback( undefined, true );
}
}
};
}
});
}
var fxNow, timerId,
rfxtypes = /^(?:toggle|show|hide)$/,
rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
rrun = /queueHooks$/,
animationPrefilters = [ defaultPrefilter ],
tweeners = {
"*": [function( prop, value ) {
var end, unit,
tween = this.createTween( prop, value ),
parts = rfxnum.exec( value ),
target = tween.cur(),
start = +target || 0,
scale = 1,
maxIterations = 20;
if ( parts ) {
end = +parts[2];
unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
// We need to compute starting value
if ( unit !== "px" && start ) {
// Iteratively approximate from a nonzero starting point
// Prefer the current property, because this process will be trivial if it uses the same units
// Fallback to end or a simple constant
start = jQuery.css( tween.elem, prop, true ) || end || 1;
do {
// If previous iteration zeroed out, double until we get *something*
// Use a string for doubling factor so we don't accidentally see scale as unchanged below
scale = scale || ".5";
// Adjust and apply
start = start / scale;
jQuery.style( tween.elem, prop, start + unit );
// Update scale, tolerating zero or NaN from tween.cur()
// And breaking the loop if scale is unchanged or perfect, or if we've just had enough
} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
}
tween.unit = unit;
tween.start = start;
// If a +=/-= token was provided, we're doing a relative animation
tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
}
return tween;
}]
};
// Animations created synchronously will run synchronously
function createFxNow() {
setTimeout(function() {
fxNow = undefined;
});
return ( fxNow = jQuery.now() );
}
function createTweens( animation, props ) {
jQuery.each( props, function( prop, value ) {
var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
index = 0,
length = collection.length;
for ( ; index < length; index++ ) {
if ( collection[ index ].call( animation, prop, value ) ) {
// we're done with this property
return;
}
}
});
}
function Animation( elem, properties, options ) {
var result,
stopped,
index = 0,
length = animationPrefilters.length,
deferred = jQuery.Deferred().always( function() {
// don't match elem in the :animated selector
delete tick.elem;
}),
tick = function() {
if ( stopped ) {
return false;
}
var currentTime = fxNow || createFxNow(),
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
temp = remaining / animation.duration || 0,
percent = 1 - temp,
index = 0,
length = animation.tweens.length;
for ( ; index < length ; index++ ) {
animation.tweens[ index ].run( percent );
}
deferred.notifyWith( elem, [ animation, percent, remaining ]);
if ( percent < 1 && length ) {
return remaining;
} else {
deferred.resolveWith( elem, [ animation ] );
return false;
}
},
animation = deferred.promise({
elem: elem,
props: jQuery.extend( {}, properties ),
opts: jQuery.extend( true, { specialEasing: {} }, options ),
originalProperties: properties,
originalOptions: options,
startTime: fxNow || createFxNow(),
duration: options.duration,
tweens: [],
createTween: function( prop, end ) {
var tween = jQuery.Tween( elem, animation.opts, prop, end,
animation.opts.specialEasing[ prop ] || animation.opts.easing );
animation.tweens.push( tween );
return tween;
},
stop: function( gotoEnd ) {
var index = 0,
// if we are going to the end, we want to run all the tweens
// otherwise we skip this part
length = gotoEnd ? animation.tweens.length : 0;
if ( stopped ) {
return this;
}
stopped = true;
for ( ; index < length ; index++ ) {
animation.tweens[ index ].run( 1 );
}
// resolve when we played the last frame
// otherwise, reject
if ( gotoEnd ) {
deferred.resolveWith( elem, [ animation, gotoEnd ] );
} else {
deferred.rejectWith( elem, [ animation, gotoEnd ] );
}
return this;
}
}),
props = animation.props;
propFilter( props, animation.opts.specialEasing );
for ( ; index < length ; index++ ) {
result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
if ( result ) {
return result;
}
}
createTweens( animation, props );
if ( jQuery.isFunction( animation.opts.start ) ) {
animation.opts.start.call( elem, animation );
}
jQuery.fx.timer(
jQuery.extend( tick, {
elem: elem,
anim: animation,
queue: animation.opts.queue
})
);
// attach callbacks from options
return animation.progress( animation.opts.progress )
.done( animation.opts.done, animation.opts.complete )
.fail( animation.opts.fail )
.always( animation.opts.always );
}
function propFilter( props, specialEasing ) {
var value, name, index, easing, hooks;
// camelCase, specialEasing and expand cssHook pass
for ( index in props ) {
name = jQuery.camelCase( index );
easing = specialEasing[ name ];
value = props[ index ];
if ( jQuery.isArray( value ) ) {
easing = value[ 1 ];
value = props[ index ] = value[ 0 ];
}
if ( index !== name ) {
props[ name ] = value;
delete props[ index ];
}
hooks = jQuery.cssHooks[ name ];
if ( hooks && "expand" in hooks ) {
value = hooks.expand( value );
delete props[ name ];
// not quite $.extend, this wont overwrite keys already present.
// also - reusing 'index' from above because we have the correct "name"
for ( index in value ) {
if ( !( index in props ) ) {
props[ index ] = value[ index ];
specialEasing[ index ] = easing;
}
}
} else {
specialEasing[ name ] = easing;
}
}
}
jQuery.Animation = jQuery.extend( Animation, {
tweener: function( props, callback ) {
if ( jQuery.isFunction( props ) ) {
callback = props;
props = [ "*" ];
} else {
props = props.split(" ");
}
var prop,
index = 0,
length = props.length;
for ( ; index < length ; index++ ) {
prop = props[ index ];
tweeners[ prop ] = tweeners[ prop ] || [];
tweeners[ prop ].unshift( callback );
}
},
prefilter: function( callback, prepend ) {
if ( prepend ) {
animationPrefilters.unshift( callback );
} else {
animationPrefilters.push( callback );
}
}
});
function defaultPrefilter( elem, props, opts ) {
/*jshint validthis:true */
var prop, index, length,
value, dataShow, toggle,
tween, hooks, oldfire,
anim = this,
style = elem.style,
orig = {},
handled = [],
hidden = elem.nodeType && isHidden( elem );
// handle queue: false promises
if ( !opts.queue ) {
hooks = jQuery._queueHooks( elem, "fx" );
if ( hooks.unqueued == null ) {
hooks.unqueued = 0;
oldfire = hooks.empty.fire;
hooks.empty.fire = function() {
if ( !hooks.unqueued ) {
oldfire();
}
};
}
hooks.unqueued++;
anim.always(function() {
// doing this makes sure that the complete handler will be called
// before this completes
anim.always(function() {
hooks.unqueued--;
if ( !jQuery.queue( elem, "fx" ).length ) {
hooks.empty.fire();
}
});
});
}
// height/width overflow pass
if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
// Make sure that nothing sneaks out
// Record all 3 overflow attributes because IE does not
// change the overflow attribute when overflowX and
// overflowY are set to the same value
opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
// Set display property to inline-block for height/width
// animations on inline elements that are having width/height animated
if ( jQuery.css( elem, "display" ) === "inline" &&
jQuery.css( elem, "float" ) === "none" ) {
// inline-level elements accept inline-block;
// block-level elements need to be inline with layout
if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
style.display = "inline-block";
} else {
style.zoom = 1;
}
}
}
if ( opts.overflow ) {
style.overflow = "hidden";
if ( !jQuery.support.shrinkWrapBlocks ) {
anim.always(function() {
style.overflow = opts.overflow[ 0 ];
style.overflowX = opts.overflow[ 1 ];
style.overflowY = opts.overflow[ 2 ];
});
}
}
// show/hide pass
for ( index in props ) {
value = props[ index ];
if ( rfxtypes.exec( value ) ) {
delete props[ index ];
toggle = toggle || value === "toggle";
if ( value === ( hidden ? "hide" : "show" ) ) {
continue;
}
handled.push( index );
}
}
length = handled.length;
if ( length ) {
dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
if ( "hidden" in dataShow ) {
hidden = dataShow.hidden;
}
// store state if its toggle - enables .stop().toggle() to "reverse"
if ( toggle ) {
dataShow.hidden = !hidden;
}
if ( hidden ) {
jQuery( elem ).show();
} else {
anim.done(function() {
jQuery( elem ).hide();
});
}
anim.done(function() {
var prop;
jQuery._removeData( elem, "fxshow" );
for ( prop in orig ) {
jQuery.style( elem, prop, orig[ prop ] );
}
});
for ( index = 0 ; index < length ; index++ ) {
prop = handled[ index ];
tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
if ( !( prop in dataShow ) ) {
dataShow[ prop ] = tween.start;
if ( hidden ) {
tween.end = tween.start;
tween.start = prop === "width" || prop === "height" ? 1 : 0;
}
}
}
}
}
function Tween( elem, options, prop, end, easing ) {
return new Tween.prototype.init( elem, options, prop, end, easing );
}
jQuery.Tween = Tween;
Tween.prototype = {
constructor: Tween,
init: function( elem, options, prop, end, easing, unit ) {
this.elem = elem;
this.prop = prop;
this.easing = easing || "swing";
this.options = options;
this.start = this.now = this.cur();
this.end = end;
this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
},
cur: function() {
var hooks = Tween.propHooks[ this.prop ];
return hooks && hooks.get ?
hooks.get( this ) :
Tween.propHooks._default.get( this );
},
run: function( percent ) {
var eased,
hooks = Tween.propHooks[ this.prop ];
if ( this.options.duration ) {
this.pos = eased = jQuery.easing[ this.easing ](
percent, this.options.duration * percent, 0, 1, this.options.duration
);
} else {
this.pos = eased = percent;
}
this.now = ( this.end - this.start ) * eased + this.start;
if ( this.options.step ) {
this.options.step.call( this.elem, this.now, this );
}
if ( hooks && hooks.set ) {
hooks.set( this );
} else {
Tween.propHooks._default.set( this );
}
return this;
}
};
Tween.prototype.init.prototype = Tween.prototype;
Tween.propHooks = {
_default: {
get: function( tween ) {
var result;
if ( tween.elem[ tween.prop ] != null &&
(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
return tween.elem[ tween.prop ];
}
// passing an empty string as a 3rd parameter to .css will automatically
// attempt a parseFloat and fallback to a string if the parse fails
// so, simple values such as "10px" are parsed to Float.
// complex values such as "rotate(1rad)" are returned as is.
result = jQuery.css( tween.elem, tween.prop, "" );
// Empty strings, null, undefined and "auto" are converted to 0.
return !result || result === "auto" ? 0 : result;
},
set: function( tween ) {
// use step hook for back compat - use cssHook if its there - use .style if its
// available and use plain properties where available
if ( jQuery.fx.step[ tween.prop ] ) {
jQuery.fx.step[ tween.prop ]( tween );
} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
} else {
tween.elem[ tween.prop ] = tween.now;
}
}
}
};
// Remove in 2.0 - this supports IE8's panic based approach
// to setting things on disconnected nodes
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
set: function( tween ) {
if ( tween.elem.nodeType && tween.elem.parentNode ) {
tween.elem[ tween.prop ] = tween.now;
}
}
};
jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
var cssFn = jQuery.fn[ name ];
jQuery.fn[ name ] = function( speed, easing, callback ) {
return speed == null || typeof speed === "boolean" ?
cssFn.apply( this, arguments ) :
this.animate( genFx( name, true ), speed, easing, callback );
};
});
jQuery.fn.extend({
fadeTo: function( speed, to, easing, callback ) {
// show any hidden elements after setting opacity to 0
return this.filter( isHidden ).css( "opacity", 0 ).show()
// animate to the value specified
.end().animate({ opacity: to }, speed, easing, callback );
},
animate: function( prop, speed, easing, callback ) {
var empty = jQuery.isEmptyObject( prop ),
optall = jQuery.speed( speed, easing, callback ),
doAnimation = function() {
// Operate on a copy of prop so per-property easing won't be lost
var anim = Animation( this, jQuery.extend( {}, prop ), optall );
doAnimation.finish = function() {
anim.stop( true );
};
// Empty animations, or finishing resolves immediately
if ( empty || jQuery._data( this, "finish" ) ) {
anim.stop( true );
}
};
doAnimation.finish = doAnimation;
return empty || optall.queue === false ?
this.each( doAnimation ) :
this.queue( optall.queue, doAnimation );
},
stop: function( type, clearQueue, gotoEnd ) {
var stopQueue = function( hooks ) {
var stop = hooks.stop;
delete hooks.stop;
stop( gotoEnd );
};
if ( typeof type !== "string" ) {
gotoEnd = clearQueue;
clearQueue = type;
type = undefined;
}
if ( clearQueue && type !== false ) {
this.queue( type || "fx", [] );
}
return this.each(function() {
var dequeue = true,
index = type != null && type + "queueHooks",
timers = jQuery.timers,
data = jQuery._data( this );
if ( index ) {
if ( data[ index ] && data[ index ].stop ) {
stopQueue( data[ index ] );
}
} else {
for ( index in data ) {
if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
stopQueue( data[ index ] );
}
}
}
for ( index = timers.length; index--; ) {
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
timers[ index ].anim.stop( gotoEnd );
dequeue = false;
timers.splice( index, 1 );
}
}
// start the next in the queue if the last step wasn't forced
// timers currently will call their complete callbacks, which will dequeue
// but only if they were gotoEnd
if ( dequeue || !gotoEnd ) {
jQuery.dequeue( this, type );
}
});
},
finish: function( type ) {
if ( type !== false ) {
type = type || "fx";
}
return this.each(function() {
var index,
data = jQuery._data( this ),
queue = data[ type + "queue" ],
hooks = data[ type + "queueHooks" ],
timers = jQuery.timers,
length = queue ? queue.length : 0;
// enable finishing flag on private data
data.finish = true;
// empty the queue first
jQuery.queue( this, type, [] );
if ( hooks && hooks.cur && hooks.cur.finish ) {
hooks.cur.finish.call( this );
}
// look for any active animations, and finish them
for ( index = timers.length; index--; ) {
if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
timers[ index ].anim.stop( true );
timers.splice( index, 1 );
}
}
// look for any animations in the old queue and finish them
for ( index = 0; index < length; index++ ) {
if ( queue[ index ] && queue[ index ].finish ) {
queue[ index ].finish.call( this );
}
}
// turn off finishing flag
delete data.finish;
});
}
});
// Generate parameters to create a standard animation
function genFx( type, includeWidth ) {
var which,
attrs = { height: type },
i = 0;
// if we include width, step value is 1 to do all cssExpand values,
// if we don't include width, step value is 2 to skip over Left and Right
includeWidth = includeWidth? 1 : 0;
for( ; i < 4 ; i += 2 - includeWidth ) {
which = cssExpand[ i ];
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
}
if ( includeWidth ) {
attrs.opacity = attrs.width = type;
}
return attrs;
}
// Generate shortcuts for custom animations
jQuery.each({
slideDown: genFx("show"),
slideUp: genFx("hide"),
slideToggle: genFx("toggle"),
fadeIn: { opacity: "show" },
fadeOut: { opacity: "hide" },
fadeToggle: { opacity: "toggle" }
}, function( name, props ) {
jQuery.fn[ name ] = function( speed, easing, callback ) {
return this.animate( props, speed, easing, callback );
};
});
jQuery.speed = function( speed, easing, fn ) {
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
complete: fn || !fn && easing ||
jQuery.isFunction( speed ) && speed,
duration: speed,
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
};
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
// normalize opt.queue - true/undefined/null -> "fx"
if ( opt.queue == null || opt.queue === true ) {
opt.queue = "fx";
}
// Queueing
opt.old = opt.complete;
opt.complete = function() {
if ( jQuery.isFunction( opt.old ) ) {
opt.old.call( this );
}
if ( opt.queue ) {
jQuery.dequeue( this, opt.queue );
}
};
return opt;
};
jQuery.easing = {
linear: function( p ) {
return p;
},
swing: function( p ) {
return 0.5 - Math.cos( p*Math.PI ) / 2;
}
};
jQuery.timers = [];
jQuery.fx = Tween.prototype.init;
jQuery.fx.tick = function() {
var timer,
timers = jQuery.timers,
i = 0;
fxNow = jQuery.now();
for ( ; i < timers.length; i++ ) {
timer = timers[ i ];
// Checks the timer has not already been removed
if ( !timer() && timers[ i ] === timer ) {
timers.splice( i--, 1 );
}
}
if ( !timers.length ) {
jQuery.fx.stop();
}
fxNow = undefined;
};
jQuery.fx.timer = function( timer ) {
if ( timer() && jQuery.timers.push( timer ) ) {
jQuery.fx.start();
}
};
jQuery.fx.interval = 13;
jQuery.fx.start = function() {
if ( !timerId ) {
timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
}
};
jQuery.fx.stop = function() {
clearInterval( timerId );
timerId = null;
};
jQuery.fx.speeds = {
slow: 600,
fast: 200,
// Default speed
_default: 400
};
// Back Compat <1.8 extension point
jQuery.fx.step = {};
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
};
}
jQuery.fn.offset = function( options ) {
if ( arguments.length ) {
return options === undefined ?
this :
this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
var docElem, win,
box = { top: 0, left: 0 },
elem = this[ 0 ],
doc = elem && elem.ownerDocument;
if ( !doc ) {
return;
}
docElem = doc.documentElement;
// Make sure it's not a disconnected DOM node
if ( !jQuery.contains( docElem, elem ) ) {
return box;
}
// If we don't have gBCR, just use 0,0 rather than error
// BlackBerry 5, iOS 3 (original iPhone)
if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
box = elem.getBoundingClientRect();
}
// 解决transform下的offset问题(先恢复)
// var el = elem,
// offsetLeft = 0,
// offsetTop = 0;
// do{
// offsetLeft += el.offsetLeft;
// offsetTop += el.offsetTop;
// el = el.offsetParent;
// } while( el );
// var elm = elem;
// do{
// offsetLeft -= elm.scrollLeft || 0;
// offsetTop -= elm.scrollTop || 0;
// elm = elm.parentNode;
// } while( elm );
win = getWindow( doc );
return {
top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
};
};
jQuery.offset = {
setOffset: function( elem, options, i ) {
var position = jQuery.css( elem, "position" );
// set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
elem.style.position = "relative";
}
var curElem = jQuery( elem ),
curOffset = curElem.offset(),
curCSSTop = jQuery.css( elem, "top" ),
curCSSLeft = jQuery.css( elem, "left" ),
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
props = {}, curPosition = {}, curTop, curLeft;
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
if ( calculatePosition ) {
curPosition = curElem.position();
curTop = curPosition.top;
curLeft = curPosition.left;
} else {
curTop = parseFloat( curCSSTop ) || 0;
curLeft = parseFloat( curCSSLeft ) || 0;
}
if ( jQuery.isFunction( options ) ) {
options = options.call( elem, i, curOffset );
}
if ( options.top != null ) {
props.top = ( options.top - curOffset.top ) + curTop;
}
if ( options.left != null ) {
props.left = ( options.left - curOffset.left ) + curLeft;
}
if ( "using" in options ) {
options.using.call( elem, props );
} else {
curElem.css( props );
}
}
};
jQuery.fn.extend({
position: function() {
if ( !this[ 0 ] ) {
return;
}
var offsetParent, offset,
parentOffset = { top: 0, left: 0 },
elem = this[ 0 ];
// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
if ( jQuery.css( elem, "position" ) === "fixed" ) {
// we assume that getBoundingClientRect is available when computed position is fixed
offset = elem.getBoundingClientRect();
} else {
// Get *real* offsetParent
offsetParent = this.offsetParent();
// Get correct offsets
offset = this.offset();
if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
parentOffset = offsetParent.offset();
}
// Add offsetParent borders
parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
}
// Subtract parent offsets and element margins
// note: when an element has margin: auto the offsetLeft and marginLeft
// are the same in Safari causing offset.left to incorrectly be 0
return {
top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
};
},
offsetParent: function() {
return this.map(function() {
var offsetParent = this.offsetParent || document.documentElement;
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent || document.documentElement;
});
}
});
// Create scrollLeft and scrollTop methods
jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
var top = /Y/.test( prop );
jQuery.fn[ method ] = function( val ) {
return jQuery.access( this, function( elem, method, val ) {
var win = getWindow( elem );
if ( val === undefined ) {
return win ? (prop in win) ? win[ prop ] :
win.document.documentElement[ method ] :
elem[ method ];
}
if ( win ) {
win.scrollTo(
!top ? val : jQuery( win ).scrollLeft(),
top ? val : jQuery( win ).scrollTop()
);
} else {
elem[ method ] = val;
}
}, method, val, arguments.length, null );
};
});
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
// margin is only for outerHeight, outerWidth
jQuery.fn[ funcName ] = function( margin, value ) {
var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
return jQuery.access( this, function( elem, type, value ) {
var doc;
if ( jQuery.isWindow( elem ) ) {
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
// isn't a whole lot we can do. See pull request at this URL for discussion:
// https://github.com/jquery/jquery/pull/764
return elem.document.documentElement[ "client" + name ];
}
// Get document width or height
if ( elem.nodeType === 9 ) {
doc = elem.documentElement;
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
return Math.max(
elem.body[ "scroll" + name ], doc[ "scroll" + name ],
elem.body[ "offset" + name ], doc[ "offset" + name ],
doc[ "client" + name ]
);
}
return value === undefined ?
// Get width or height on the element, requesting but not forcing parseFloat
jQuery.css( elem, type, extra ) :
// Set width or height on the element
jQuery.style( elem, type, value, extra );
}, type, chainable ? margin : undefined, chainable, null );
};
});
});
// Limit scope pollution from any deprecated API
// (function() {
// })();
// Expose jQuery to the global object
BI.jQuery = BI.$ = jQuery;
window.$ = window.$ || jQuery;
window.jQuery = window.jQuery || jQuery;
// Expose jQuery as an AMD module, but only for AMD loaders that
// understand the issues with loading multiple versions of jQuery
// in a page that all might call define(). The loader will indicate
// they have special allowances for multiple jQuery versions by
// specifying define.amd.jQuery = true. Register as a named module,
// since jQuery can be concatenated with other files that may use define,
// but not use a proper concatenation script that understands anonymous
// AMD modules. A named AMD is safest and most robust way to register.
// Lowercase jquery is used because AMD module names are derived from
// file names, and jQuery is normally delivered in a lowercase file name.
// Do this after creating the global so that if an AMD module wants to call
// noConflict to hide this version of jQuery, it will work.
if ( true && __webpack_require__(700).jQuery ) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return jQuery; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
})( window );
/***/ }),
/* 700 */
/***/ (function(module, exports) {
/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */
module.exports = __webpack_amd_options__;
/* WEBPACK VAR INJECTION */}.call(this, {}))
/***/ }),
/* 701 */
/***/ (function(module, exports) {
/*
* 给jQuery.Event对象添加的工具方法
*/
BI.$.extend(BI.$.Event.prototype, {
// event.stopEvent
stopEvent: function () {
this.stopPropagation();
this.preventDefault();
}
});
/***/ }),
/* 702 */
/***/ (function(module, exports) {
if (BI.jQuery) {
(function ($) {
// richer:容器在其各个边缘留出的空间
if (!$.fn.insets) {
$.fn.insets = function () {
var p = this.padding(),
b = this.border();
return {
top: p.top,
bottom: p.bottom + b.bottom + b.top,
left: p.left,
right: p.right + b.right + b.left
};
};
}
// richer:获取 && 设置jQuery元素的边界
if (!$.fn.bounds) {
$.fn.bounds = function (value) {
var tmp = {hasIgnoredBounds: true};
if (value) {
if (!isNaN(value.x)) {
tmp.left = value.x;
}
if (!isNaN(value.y)) {
tmp.top = value.y;
}
if (value.width != null) {
tmp.width = (value.width - (this.outerWidth(true) - this.width()));
tmp.width = (tmp.width >= 0) ? tmp.width : value.width;
// fix chrome
// tmp.width = (tmp.width >= 0) ? tmp.width : 0;
}
if (value.height != null) {
tmp.height = value.height - (this.outerHeight(true) - this.height());
tmp.height = (tmp.height >= 0) ? tmp.height : value.height;
// fix chrome
// tmp.height = (tmp.height >= 0) ? tmp.height : value.0;
}
this.css(tmp);
return this;
}
// richer:注意此方法只对可见元素有效
tmp = this.position();
return {
x: tmp.left,
y: tmp.top,
// richer:这里计算外部宽度和高度的时候,都不包括边框
width: this.outerWidth(),
height: this.outerHeight()
};
};
}
})(BI.jQuery);
BI.extend(BI.jQuery.fn, {
destroy: function () {
this.remove();
if (BI.isIE() === true) {
this[0].outerHTML = "";
}
},
/**
* 高亮显示
* @param text 必需
* @param keyword
* @param py
* @returns {*}
* @private
* 原理:
* 1、得到text的拼音py, 分别看是否匹配关键字keyword, 得到匹配索引tidx和pidx
* 2、比较tidx和pidx, 取大于-1且较小的索引,标红[索引,索引 + keyword.length - 1]的文本
* 3、text和py各自取tidx/pidx + keyword.length索引开始的子串作为新的text和py, 重复1, 直到text和py有一个为""
*/
__textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword) || (text + "").length > 100) {
return this.html(BI.htmlEncode(text));
}
keyword = keyword + "";
keyword = BI.toUpperCase(keyword);
var textLeft = (text || "") + "";
py = (py || BI.makeFirstPY(text, {
splitChar: "\u200b"
})) + "";
py = BI.toUpperCase(py);
this.empty();
// BI-48487 性能: makeFirstPY出来的py中包含多音字是必要的,但虽然此方法中做了限制。但是对于一个长度为60,包含14个多音字的字符串
// 获取的的py长度将达到1966080, 远超过text的长度,到后面都是在做"".substring的无用功,所以此循环应保证py和textLeft长度不为0
while (py.length > 0 && textLeft.length > 0) {
var tidx = BI.toUpperCase(textLeft).indexOf(keyword);
var pidx = py.indexOf(keyword);
if (pidx >= 0) {
pidx = (pidx - Math.floor(pidx / (textLeft.length + 1))) % textLeft.length;
}
// BI-56945 场景: 对'啊a'标红, a为keyword, 此时tidx为1, pidx为0, 此时使用tidx显然'啊'就无法标红了
if (tidx >= 0 && (pidx > tidx || pidx === -1)) {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, tidx)));
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(tidx, keyword.length))));
textLeft = textLeft.substr(tidx + keyword.length);
if (BI.isNotEmptyString(py)) {
// 每一组拼音都应该前进,而不是只是当前的
py = BI.map(py.split("\u200b"), function (idx, ps) {
return ps.slice(tidx + keyword.length);
}).join("\u200b");
}
} else if (pidx >= 0) {
// BI-56386 这边两个pid / text.length是为了防止截取的首字符串不是完整的,但光这样做还不够,即时错位了,也不能说明就不符合条件
// 标红的text未encode
this.append(BI.htmlEncode(textLeft.substr(0, pidx)));
this.append(BI.$("<span>").addClass("bi-keyword-red-mark")
.html(BI.htmlEncode(textLeft.substr(pidx, keyword.length))));
if (BI.isNotEmptyString(py)) {
// 每一组拼音都应该前进,而不是只是当前的
py = BI.map(py.split("\u200b"), function (idx, ps) {
return ps.slice(pidx + keyword.length);
}).join("\u200b");
}
textLeft = textLeft.substr(pidx + keyword.length);
} else {
// 标红的text未encode
this.append(BI.htmlEncode(textLeft));
break;
}
}
return this;
},
getDomHeight: function (parent) {
var clone = BI.$(this).clone();
clone.appendTo(BI.$(parent || "body"));
var height = clone.height();
clone.remove();
return height;
},
// 是否有竖直滚动条
hasVerticalScroll: function () {
return this.height() > 0 && this[0].clientWidth < this[0].offsetWidth;
},
// 是否有水平滚动条
hasHorizonScroll: function () {
return this.width() > 0 && this[0].clientHeight < this[0].offsetHeight;
},
// 获取计算后的样式
getStyle: function (name) {
var node = this[0];
var computedStyle = void 0;
// W3C Standard
if (_global.getComputedStyle) {
// In certain cases such as within an iframe in FF3, this returns null.
computedStyle = _global.getComputedStyle(node, null);
if (computedStyle) {
return computedStyle.getPropertyValue(BI.hyphenate(name));
}
}
// Safari
if (document.defaultView && document.defaultView.getComputedStyle) {
computedStyle = document.defaultView.getComputedStyle(node, null);
// A Safari bug causes this to return null for `display: none` elements.
if (computedStyle) {
return computedStyle.getPropertyValue(BI.hyphenate(name));
}
if (name === "display") {
return "none";
}
}
// Internet Explorer
if (node.currentStyle) {
if (name === "float") {
return node.currentStyle.cssFloat || node.currentStyle.styleFloat;
}
return node.currentStyle[BI.camelize(name)];
}
return node.style && node.style[BI.camelize(name)];
},
__isMouseInBounds__: function (e) {
var offset2Body = this.get(0).getBoundingClientRect ? this.get(0).getBoundingClientRect() : this.offset();
var width = offset2Body.width || this.outerWidth();
var height = offset2Body.height || this.outerHeight();
// offset2Body.left的值可能会有小数,导致某点出现false
return !(e.pageX < Math.floor(offset2Body.left) || e.pageX > offset2Body.left + width
|| e.pageY < Math.floor(offset2Body.top) || e.pageY > offset2Body.top + height);
},
__hasZIndexMask__: function (zindex) {
return zindex && this.zIndexMask[zindex] != null;
},
__buildZIndexMask__: function (zindex, domArray) {
this.zIndexMask = this.zIndexMask || {};// 存储z-index的mask
this.indexMask = this.indexMask || [];// 存储mask
var mask = BI.createWidget({
type: "bi.center_adapt",
cls: "bi-z-index-mask",
items: domArray
});
mask.element.css({"z-index": zindex});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: mask,
left: 0,
right: 0,
top: 0,
bottom: 0
}]
});
this.indexMask.push(mask);
zindex && (this.zIndexMask[zindex] = mask);
return mask.element;
},
__releaseZIndexMask__: function (zindex) {
if (zindex && this.zIndexMask[zindex]) {
BI.remove(this.indexMask, this.zIndexMask[zindex]);
this.zIndexMask[zindex].destroy();
return;
}
this.indexMask = this.indexMask || [];
var indexMask = this.indexMask.pop();
indexMask && indexMask.destroy();
}
});
}
/***/ }),
/* 703 */
/***/ (function(module, exports) {
_.extend(BI, {
$import: function () {
var _LOADED = {}; // alex:保存加载过的
function loadReady (src, must) {
var $scripts = BI.$("head script, body script");
BI.$.each($scripts, function (i, item) {
if (item.src.indexOf(src) != -1) {
_LOADED[src] = true;
}
});
var $links = BI.$("head link");
BI.$.each($links, function (i, item) {
if (item.href.indexOf(src) != -1 && must) {
_LOADED[src] = false;
BI.$(item).remove();
}
});
}
// must=true 强行加载
return function (src, ext, must) {
loadReady(src, must);
// alex:如果已经加载过了的,直接return
if (_LOADED[src] === true) {
return;
}
if (ext === "css") {
var link = document.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";
link.href = src;
var head = document.getElementsByTagName("head")[0];
head.appendChild(link);
_LOADED[src] = true;
} else {
// alex:这里用同步调用的方式,必须等待ajax完成
BI.$.ajax({
url: src,
dataType: "script", // alex:指定dataType为script,jquery会帮忙做globalEval的事情
async: false,
cache: true,
complete: function (res, status) {
/*
* alex:发现jquery会很智能地判断一下返回的数据类型是不是script,然后做一个globalEval
* 所以当status为success时就不需要再把其中的内容加到script里面去了
*/
if (status == "success") {
_LOADED[src] = true;
}
}
});
}
};
}()
});
/***/ }),
/* 704 */
/***/ (function(module, exports) {
(function () {
var Events = {
// Bind an event to a `callback` function. Passing `"all"` will bind
// the callback to all events fired.
on: function (name, callback, context) {
if (!eventsApi(this, "on", name, [callback, context]) || !callback) return this;
this._events || (this._events = {});
var events = this._events[name] || (this._events[name] = []);
events.push({callback: callback, context: context, ctx: context || this});
return this;
},
// Bind an event to only be triggered a single time. After the first time
// the callback is invoked, it will be removed.
once: function (name, callback, context) {
if (!eventsApi(this, "once", name, [callback, context]) || !callback) return this;
var self = this;
var once = _.once(function () {
self.off(name, once);
callback.apply(this, arguments);
});
once._callback = callback;
return this.on(name, once, context);
},
// Remove one or many callbacks. If `context` is null, removes all
// callbacks with that function. If `callback` is null, removes all
// callbacks for the event. If `name` is null, removes all bound
// callbacks for all events.
off: function (name, callback, context) {
if (!this._events || !eventsApi(this, "off", name, [callback, context])) return this;
// Remove all callbacks for all events.
if (!name && !callback && !context) {
this._events = void 0;
return this;
}
var names = name ? [name] : _.keys(this._events);
for (var i = 0, length = names.length; i < length; i++) {
name = names[i];
// Bail out if there are no events stored.
var events = this._events[name];
if (!events) continue;
// Remove all callbacks for this event.
if (!callback && !context) {
delete this._events[name];
continue;
}
// Find any remaining events.
var remaining = [];
for (var j = 0, k = events.length; j < k; j++) {
var event = events[j];
if (
callback && callback !== event.callback &&
callback !== event.callback._callback ||
context && context !== event.context
) {
remaining.push(event);
}
}
// Replace events if there are any remaining. Otherwise, clean up.
if (remaining.length) {
this._events[name] = remaining;
} else {
delete this._events[name];
}
}
return this;
},
un: function () {
this.off.apply(this, arguments);
},
// Trigger one or many events, firing all bound callbacks. Callbacks are
// passed the same arguments as `trigger` is, apart from the event name
// (unless you're listening on `"all"`, which will cause your callback to
// receive the true name of the event as the first argument).
trigger: function (name) {
if (!this._events) return this;
var args = slice.call(arguments, 1);
if (!eventsApi(this, "trigger", name, args)) return this;
var events = this._events[name];
var allEvents = this._events.all;
if (events) triggerEvents(events, args);
if (allEvents) triggerEvents(allEvents, arguments);
return this;
},
fireEvent: function () {
this.trigger.apply(this, arguments);
},
// Inversion-of-control versions of `on` and `once`. Tell *this* object to
// listen to an event in another object ... keeping track of what it's
// listening to.
listenTo: function (obj, name, callback) {
var listeningTo = this._listeningTo || (this._listeningTo = {});
var id = obj._listenId || (obj._listenId = _.uniqueId("l"));
listeningTo[id] = obj;
if (!callback && typeof name === "object") callback = this;
obj.on(name, callback, this);
return this;
},
listenToOnce: function (obj, name, callback) {
if (typeof name === "object") {
for (var event in name) this.listenToOnce(obj, event, name[event]);
return this;
}
if (eventSplitter.test(name)) {
var names = name.split(eventSplitter);
for (var i = 0, length = names.length; i < length; i++) {
this.listenToOnce(obj, names[i], callback);
}
return this;
}
if (!callback) return this;
var once = _.once(function () {
this.stopListening(obj, name, once);
callback.apply(this, arguments);
});
once._callback = callback;
return this.listenTo(obj, name, once);
},
// Tell this object to stop listening to either specific events ... or
// to every object it's currently listening to.
stopListening: function (obj, name, callback) {
var listeningTo = this._listeningTo;
if (!listeningTo) return this;
var remove = !name && !callback;
if (!callback && typeof name === "object") callback = this;
if (obj) (listeningTo = {})[obj._listenId] = obj;
for (var id in listeningTo) {
obj = listeningTo[id];
obj.off(name, callback, this);
if (remove || _.isEmpty(obj._events)) delete this._listeningTo[id];
}
return this;
}
};
// Regular expression used to split event strings.
var eventSplitter = /\s+/;
// Implement fancy features of the Events API such as multiple event
// names `"change blur"` and jQuery-style event maps `{change: action}`
// in terms of the existing API.
var eventsApi = function (obj, action, name, rest) {
if (!name) return true;
// Handle event maps.
if (typeof name === "object") {
for (var key in name) {
obj[action].apply(obj, [key, name[key]].concat(rest));
}
return false;
}
// Handle space separated event names.
if (eventSplitter.test(name)) {
var names = name.split(eventSplitter);
for (var i = 0, length = names.length; i < length; i++) {
obj[action].apply(obj, [names[i]].concat(rest));
}
return false;
}
return true;
};
// A difficult-to-believe, but optimized internal dispatch function for
// triggering events. Tries to keep the usual cases speedy (most internal
// BI events have 3 arguments).
var triggerEvents = function (events, args) {
var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
switch (args.length) {
case 0:
while (++i < l) (ev = events[i]).callback.call(ev.ctx);
return;
case 1:
while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1);
return;
case 2:
while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2);
return;
case 3:
while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3);
return;
default:
while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args);
return;
}
};
// BI.Router
// ---------------
// Routers map faux-URLs to actions, and fire events when routes are
// matched. Creating a new one sets its `routes` hash, if not set statically.
var Router = BI.Router = function (options) {
options || (options = {});
if (options.routes) this.routes = options.routes;
this._bindRoutes();
this._init.apply(this, arguments);
};
// Cached regular expressions for matching named param parts and splatted
// parts of route strings.
var optionalParam = /\((.*?)\)/g;
var namedParam = /(\(\?)?:\w+/g;
var splatParam = /\*\w+/g;
var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
// Set up all inheritable **BI.Router** properties and methods.
_.extend(Router.prototype, Events, {
// _init is an empty function by default. Override it with your own
// initialization logic.
_init: function () {
},
// Manually bind a single named route to a callback. For example:
//
// this.route('search/:query/p:num', 'search', function(query, num) {
// ...
// });
//
route: function (route, name, callback) {
if (!_.isRegExp(route)) route = this._routeToRegExp(route);
if (_.isFunction(name)) {
callback = name;
name = "";
}
if (!callback) callback = this[name];
var router = this;
BI.history.route(route, function (fragment) {
var args = router._extractParameters(route, fragment);
if (router.execute(callback, args, name) !== false) {
router.trigger.apply(router, ["route:" + name].concat(args));
router.trigger("route", name, args);
BI.history.trigger("route", router, name, args);
}
});
return this;
},
// Execute a route handler with the provided parameters. This is an
// excellent place to do pre-route setup or post-route cleanup.
execute: function (callback, args, name) {
if (callback) callback.apply(this, args);
},
// Simple proxy to `BI.history` to save a fragment into the history.
navigate: function (fragment, options) {
BI.history.navigate(fragment, options);
return this;
},
// Bind all defined routes to `BI.history`. We have to reverse the
// order of the routes here to support behavior where the most general
// routes can be defined at the bottom of the route map.
_bindRoutes: function () {
if (!this.routes) return;
this.routes = _.result(this, "routes");
var route, routes = _.keys(this.routes);
while ((route = routes.pop()) != null) {
this.route(route, this.routes[route]);
}
},
// Convert a route string into a regular expression, suitable for matching
// against the current location hash.
_routeToRegExp: function (route) {
route = route.replace(escapeRegExp, "\\$&")
.replace(optionalParam, "(?:$1)?")
.replace(namedParam, function (match, optional) {
return optional ? match : "([^/?]+)";
})
.replace(splatParam, "([^?]*?)");
return new RegExp("^" + route + "(?:\\?([\\s\\S]*))?$");
},
// Given a route, and a URL fragment that it matches, return the array of
// extracted decoded parameters. Empty or unmatched parameters will be
// treated as `null` to normalize cross-browser behavior.
_extractParameters: function (route, fragment) {
var params = route.exec(fragment).slice(1);
return _.map(params, function (param, i) {
// Don't decode the search params.
if (i === params.length - 1) return param || null;
return param ? decodeURIComponent(param) : null;
});
}
});
// History
// ----------------
// Handles cross-browser history management, based on either
// [pushState](http://diveintohtml5.info/history.html) and real URLs, or
// [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
// and URL fragments. If the browser supports neither (old IE, natch),
// falls back to polling.
var History = function () {
this.handlers = [];
this.checkUrl = _.bind(this.checkUrl, this);
// Ensure that `History` can be used outside of the browser.
if (typeof window !== "undefined") {
this.location = _global.location;
this.history = _global.history;
}
};
// Cached regex for stripping a leading hash/slash and trailing space.
var routeStripper = /^[#\/]|\s+$/g;
// Cached regex for stripping leading and trailing slashes.
var rootStripper = /^\/+|\/+$/g;
// Cached regex for stripping urls of hash.
var pathStripper = /#.*$/;
// Has the history handling already been started?
History.started = false;
// Set up all inheritable **BI.History** properties and methods.
_.extend(History.prototype, Events, {
// The default interval to poll for hash changes, if necessary, is
// twenty times a second.
interval: 50,
// Are we at the app root?
atRoot: function () {
var path = this.location.pathname.replace(/[^\/]$/, "$&/");
return path === this.root && !this.getSearch();
},
// In IE6, the hash fragment and search params are incorrect if the
// fragment contains `?`.
getSearch: function () {
var match = this.location.href.replace(/#.*/, "").match(/\?.+/);
return match ? match[0] : "";
},
// Gets the true hash value. Cannot use location.hash directly due to bug
// in Firefox where location.hash will always be decoded.
getHash: function (window) {
var match = (window || this).location.href.match(/#(.*)$/);
return match ? match[1] : "";
},
// Get the pathname and search params, without the root.
getPath: function () {
var path = decodeURI(this.location.pathname + this.getSearch());
var root = this.root.slice(0, -1);
if (!path.indexOf(root)) path = path.slice(root.length);
return path.charAt(0) === "/" ? path.slice(1) : path;
},
// Get the cross-browser normalized URL fragment from the path or hash.
getFragment: function (fragment) {
if (fragment == null) {
if (this._hasPushState || !this._wantsHashChange) {
fragment = this.getPath();
} else {
fragment = this.getHash();
}
}
return fragment.replace(routeStripper, "");
},
// Start the hash change handling, returning `true` if the current URL matches
// an existing route, and `false` otherwise.
start: function (options) {
if (History.started) throw new Error("BI.history has already been started");
History.started = true;
// Figure out the initial configuration. Do we need an iframe?
// Is pushState desired ... is it available?
this.options = _.extend({root: "/"}, this.options, options);
this.root = this.options.root;
this._wantsHashChange = this.options.hashChange !== false;
this._hasHashChange = "onhashchange" in window;
this._wantsPushState = !!this.options.pushState;
this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState);
this.fragment = this.getFragment();
// Normalize root to always include a leading and trailing slash.
this.root = ("/" + this.root + "/").replace(rootStripper, "/");
// Transition from hashChange to pushState or vice versa if both are
// requested.
if (this._wantsHashChange && this._wantsPushState) {
// If we've started off with a route from a `pushState`-enabled
// browser, but we're currently in a browser that doesn't support it...
if (!this._hasPushState && !this.atRoot()) {
var root = this.root.slice(0, -1) || "/";
this.location.replace(root + "#" + this.getPath());
// Return immediately as browser will do redirect to new url
return true;
// Or if we've started out with a hash-based route, but we're currently
// in a browser where it could be `pushState`-based instead...
} else if (this._hasPushState && this.atRoot()) {
this.navigate(this.getHash(), {replace: true});
}
}
// Proxy an iframe to handle location events if the browser doesn't
// support the `hashchange` event, HTML5 history, or the user wants
// `hashChange` but not `pushState`.
if (!this._hasHashChange && this._wantsHashChange && (!this._wantsPushState || !this._hasPushState)) {
var iframe = document.createElement("iframe");
iframe.src = "javascript:0";
iframe.style.display = "none";
iframe.tabIndex = -1;
var body = document.body;
// Using `appendChild` will throw on IE < 9 if the document is not ready.
this.iframe = body.insertBefore(iframe, body.firstChild).contentWindow;
this.iframe.document.open().close();
this.iframe.location.hash = "#" + this.fragment;
}
// Add a cross-platform `addEventListener` shim for older browsers.
var addEventListener = _global.addEventListener || function (eventName, listener) {
return attachEvent("on" + eventName, listener);
};
// Depending on whether we're using pushState or hashes, and whether
// 'onhashchange' is supported, determine how we check the URL state.
if (this._hasPushState) {
addEventListener("popstate", this.checkUrl, false);
} else if (this._wantsHashChange && this._hasHashChange && !this.iframe) {
addEventListener("hashchange", this.checkUrl, false);
} else if (this._wantsHashChange) {
this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
}
if (!this.options.silent) return this.loadUrl();
},
// Disable BI.history, perhaps temporarily. Not useful in a real app,
// but possibly useful for unit testing Routers.
stop: function () {
// Add a cross-platform `removeEventListener` shim for older browsers.
var removeEventListener = _global.removeEventListener || function (eventName, listener) {
return detachEvent("on" + eventName, listener);
};
// Remove window listeners.
if (this._hasPushState) {
removeEventListener("popstate", this.checkUrl, false);
} else if (this._wantsHashChange && this._hasHashChange && !this.iframe) {
removeEventListener("hashchange", this.checkUrl, false);
}
// Clean up the iframe if necessary.
if (this.iframe) {
document.body.removeChild(this.iframe.frameElement);
this.iframe = null;
}
// Some environments will throw when clearing an undefined interval.
if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);
History.started = false;
},
// Add a route to be tested when the fragment changes. Routes added later
// may override previous routes.
route: function (route, callback) {
this.handlers.unshift({route: route, callback: callback});
},
// remove a route match in routes
unRoute: function (route) {
var index = _.findIndex(this.handlers, function (handler) {
return handler.route.test(route);
});
if (index > -1) {
this.handlers.splice(index, 1);
}
},
// Checks the current URL to see if it has changed, and if it has,
// calls `loadUrl`, normalizing across the hidden iframe.
checkUrl: function (e) {
var current = this.getFragment();
try {
// getFragment 得到的值是编码过的,而this.fragment是没有编码过的
// 英文路径没有问题,遇上中文和空格有问题了
current = decodeURIComponent(current);
} catch(e) {
}
// If the user pressed the back button, the iframe's hash will have
// changed and we should use that for comparison.
if (current === this.fragment && this.iframe) {
current = this.getHash(this.iframe);
}
if (current === this.fragment) return false;
if (this.iframe) this.navigate(current);
this.loadUrl();
},
// Attempt to load the current URL fragment. If a route succeeds with a
// match, returns `true`. If no defined routes matches the fragment,
// returns `false`.
loadUrl: function (fragment) {
fragment = this.fragment = this.getFragment(fragment);
return _.some(this.handlers, function (handler) {
if (handler.route.test(fragment)) {
handler.callback(fragment);
return true;
}
});
},
// Save a fragment into the hash history, or replace the URL state if the
// 'replace' option is passed. You are responsible for properly URL-encoding
// the fragment in advance.
//
// The options object can contain `trigger: true` if you wish to have the
// route callback be fired (not usually desirable), or `replace: true`, if
// you wish to modify the current URL without adding an entry to the history.
navigate: function (fragment, options) {
if (!History.started) return false;
if (!options || options === true) options = {trigger: !!options};
// Normalize the fragment.
fragment = this.getFragment(fragment || "");
// Don't include a trailing slash on the root.
var root = this.root;
if (fragment === "" || fragment.charAt(0) === "?") {
root = root.slice(0, -1) || "/";
}
var url = root + fragment;
// Strip the hash and decode for matching.
fragment = decodeURI(fragment.replace(pathStripper, ""));
if (this.fragment === fragment) return;
this.fragment = fragment;
// If pushState is available, we use it to set the fragment as a real URL.
if (this._hasPushState) {
this.history[options.replace ? "replaceState" : "pushState"]({}, document.title, url);
// If hash changes haven't been explicitly disabled, update the hash
// fragment to store history.
} else if (this._wantsHashChange) {
this._updateHash(this.location, fragment, options.replace);
if (this.iframe && (fragment !== this.getHash(this.iframe))) {
// Opening and closing the iframe tricks IE7 and earlier to push a
// history entry on hash-tag change. When replace is true, we don't
// want this.
if (!options.replace) this.iframe.document.open().close();
this._updateHash(this.iframe.location, fragment, options.replace);
}
// If you've told us that you explicitly don't want fallback hashchange-
// based history, then `navigate` becomes a page refresh.
} else {
return this.location.assign(url);
}
if (options.trigger) return this.loadUrl(fragment);
},
// Update the hash location, either replacing the current entry, or adding
// a new one to the browser history.
_updateHash: function (location, fragment, replace) {
if (replace) {
var href = location.href.replace(/(javascript:|#).*$/, "");
location.replace(href + "#" + fragment);
} else {
// Some browsers require that `hash` contains a leading #.
location.hash = "#" + fragment;
}
}
});
// Create the default BI.history.
BI.history = new History;
}());
/***/ }),
/* 705 */
/***/ (function(module, exports) {
/* !
* jQuery Mousewheel 3.1.13
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*/
(function (factory) {
// Browser globals
factory(BI.jQuery);
// if ( typeof define === "function" && define.amd ) {
// // AMD. Register as an anonymous module.
// define(["../core/jquery"], factory);
// } else if (typeof exports === "object") {
// // Node/CommonJS style for Browserify
// module.exports = factory;
// } else {
// // Browser globals
// factory(BI.jQuery);
// }
}(function ($) {
var toFix = ["wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll"],
toBind = ( "onwheel" in document || document.documentMode >= 9 ) ?
["wheel"] : ["mousewheel", "DomMouseScroll", "MozMousePixelScroll"],
slice = Array.prototype.slice,
nullLowestDeltaTimeout, lowestDelta;
if ( $.event.fixHooks ) {
for ( var i = toFix.length; i; ) {
$.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
}
}
var special = $.event.special.mousewheel = {
version: "3.1.12",
setup: function () {
if ( this.addEventListener ) {
for ( var i = toBind.length; i; ) {
this.addEventListener( toBind[--i], handler, false );
}
} else {
this.onmousewheel = handler;
}
},
teardown: function () {
if ( this.removeEventListener ) {
for ( var i = toBind.length; i; ) {
this.removeEventListener( toBind[--i], handler, false );
}
} else {
this.onmousewheel = null;
}
},
settings: {
adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
normalizeOffset: true // calls getBoundingClientRect for each event
}
};
$.fn.extend({
mousewheel: function (fn) {
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
},
unmousewheel: function (fn) {
return this.unbind("mousewheel", fn);
}
});
function handler (event) {
var orgEvent = event || _global.event,
args = slice.call(arguments, 1),
delta = 0,
deltaX = 0,
deltaY = 0,
absDelta = 0,
offsetX = 0,
offsetY = 0;
event = $.event.fix(orgEvent);
event.type = "mousewheel";
// Old school scrollwheel delta
if ( "detail" in orgEvent ) { deltaY = orgEvent.detail * -1; }
if ( "wheelDelta" in orgEvent ) { deltaY = orgEvent.wheelDelta; }
if ( "wheelDeltaY" in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
if ( "wheelDeltaX" in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
// Firefox < 17 horizontal scrolling related to DOMMouseScroll event
if ( "axis" in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
deltaX = deltaY * -1;
deltaY = 0;
}
// Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
delta = deltaY === 0 ? deltaX : deltaY;
// New school wheel delta (wheel event)
if ( "deltaY" in orgEvent ) {
deltaY = orgEvent.deltaY * -1;
delta = deltaY;
}
if ( "deltaX" in orgEvent ) {
deltaX = orgEvent.deltaX;
if ( deltaY === 0 ) { delta = deltaX * -1; }
}
// No change actually happened, no reason to go any further
if ( deltaY === 0 && deltaX === 0 ) { return; }
// Need to convert lines and pages to pixels if we aren't already in pixels
// There are three delta modes:
// * deltaMode 0 is by pixels, nothing to do
// * deltaMode 1 is by lines
// * deltaMode 2 is by pages
if ( orgEvent.deltaMode === 1 ) {
var lineHeight = 40;
delta *= lineHeight;
deltaY *= lineHeight;
deltaX *= lineHeight;
} else if ( orgEvent.deltaMode === 2 ) {
var pageHeight = 800;
delta *= pageHeight;
deltaY *= pageHeight;
deltaX *= pageHeight;
}
// Store lowest absolute delta to normalize the delta values
absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
if ( !lowestDelta || absDelta < lowestDelta ) {
lowestDelta = absDelta;
// Adjust older deltas if necessary
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
lowestDelta /= 40;
}
}
// Adjust older deltas if necessary
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
// Divide all the things by 40!
delta /= 40;
deltaX /= 40;
deltaY /= 40;
}
// Get a whole, normalized value for the deltas
delta = Math[ delta >= 1 ? "floor" : "ceil" ](delta / lowestDelta);
deltaX = Math[ deltaX >= 1 ? "floor" : "ceil" ](deltaX / lowestDelta);
deltaY = Math[ deltaY >= 1 ? "floor" : "ceil" ](deltaY / lowestDelta);
// Normalise offsetX and offsetY properties
if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
var boundingRect = this.getBoundingClientRect();
offsetX = event.clientX - boundingRect.left;
offsetY = event.clientY - boundingRect.top;
}
// Add information to the event object
event.deltaX = deltaX;
event.deltaY = deltaY;
event.deltaFactor = lowestDelta;
event.offsetX = offsetX;
event.offsetY = offsetY;
// Go ahead and set deltaMode to 0 since we converted to pixels
// Although this is a little odd since we overwrite the deltaX/Y
// properties with normalized deltas.
event.deltaMode = 0;
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);
// Clearout lowestDelta after sometime to better
// handle multiple device types that give different
// a different lowestDelta
// Ex: trackpad = 3 and mouse wheel = 120
if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
return ($.event.dispatch || $.event.handle).apply(this, args);
}
function nullLowestDelta () {
lowestDelta = null;
}
function shouldAdjustOldDeltas (orgEvent, absDelta) {
// If this is an older event and the delta is divisable by 120,
// then we are assuming that the browser is treating this as an
// older mouse wheel event and that we should divide the deltas
// by 40 to try and get a more usable deltaFactor.
// Side note, this actually impacts the reported scroll distance
// in older browsers and can cause scrolling to be slower than native.
// Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
return special.settings.adjustOldDeltas && orgEvent.type === "mousewheel" && absDelta % 120 === 0;
}
}));
/***/ }),
/* 706 */
/***/ (function(module, exports) {
/**
* guy
* 异步树
* @class BI.TreeView
* @extends BI.Pane
*/
BI.TreeView = BI.inherit(BI.Pane, {
_defaultConfig: function () {
return BI.extend(BI.TreeView.superclass._defaultConfig.apply(this, arguments), {
_baseCls: "bi-tree",
paras: {
selectedValues: {}
},
itemsCreator: BI.emptyFn
});
},
_init: function () {
BI.TreeView.superclass._init.apply(this, arguments);
var o = this.options;
this._stop = false;
this._createTree();
this.tip = BI.createWidget({
type: "bi.loading_bar",
invisible: true,
handler: BI.bind(this._loadMore, this)
});
BI.createWidget({
type: "bi.vertical",
scrollable: true,
scrolly: false,
element: this,
items: [this.tip]
});
if(BI.isNotNull(o.value)) {
this.setSelectedValue(o.value);
}
if (BI.isIE9Below && BI.isIE9Below()) {
this.element.addClass("hack");
}
},
_createTree: function () {
this.id = "bi-tree" + BI.UUID();
if (this.nodes) {
this.nodes.destroy();
}
if (this.tree) {
this.tree.destroy();
}
this.tree = BI.createWidget({
type: "bi.layout",
element: "<ul id='" + this.id + "' class='ztree'></ul>"
});
BI.createWidget({
type: "bi.default",
element: this.element,
items: [this.tree]
});
},
// 选择节点触发方法
_selectTreeNode: function (treeId, treeNode) {
this.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.CLICK, treeNode, this);
this.fireEvent(BI.TreeView.EVENT_CHANGE, treeNode, this);
},
// 配置属性
_configSetting: function () {
var paras = this.options.paras;
var self = this;
var setting = {
async: {
enable: true,
url: getUrl,
autoParam: ["id", "name"], // 节点展开异步请求自动提交id和name
otherParam: BI.cjkEncodeDO(paras) // 静态参数
},
check: {
enable: true
},
data: {
key: {
title: "title",
name: "text" // 节点的name属性替换成text
},
simpleData: {
enable: true // 可以穿id,pid属性的对象数组
}
},
view: {
showIcon: false,
expandSpeed: "",
nameIsHTML: true, // 节点可以用html标签代替
dblClickExpand: false
},
callback: {
beforeExpand: beforeExpand,
onAsyncSuccess: onAsyncSuccess,
onAsyncError: onAsyncError,
beforeCheck: beforeCheck,
onCheck: onCheck,
onExpand: onExpand,
onCollapse: onCollapse,
onClick: onClick
}
};
var className = "dark", perTime = 100;
function onClick (event, treeId, treeNode) {
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
var checked = treeNode.checked;
var status = treeNode.getCheckStatus();
if(status.half === true && status.checked === true) {
checked = false;
}
// 更新此node的check状态, 影响父子关联,并调用beforeCheck和onCheck回调
self.nodes.checkNode(treeNode, !checked, true, true);
}
function getUrl (treeId, treeNode) {
var parentNode = self._getParentValues(treeNode);
treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id
+ "&times=" + (treeNode.times++)
+ "&parentValues= " + _global.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&checkState=" + _global.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
return "&" + param;
}
function beforeExpand (treeId, treeNode) {
if (!treeNode.isAjaxing) {
if (!treeNode.children) {
treeNode.times = 1;
ajaxGetNodes(treeNode, "refresh");
}
return true;
}
BI.Msg.toast("Please Wait。", "warning"); // 不展开节点,也不触发onExpand事件
return false;
}
function onAsyncSuccess (event, treeId, treeNode, msg) {
treeNode.halfCheck = false;
if (!msg || msg.length === 0 || /^<html>[\s,\S]*<\/html>$/gi.test(msg) || self._stop) {
return;
}
var zTree = self.nodes;
var totalCount = treeNode.count || 0;
// 尝试去获取下一组节点,若获取值为空数组,表示获取完成
// TODO by GUY
if (treeNode.children.length > totalCount) {
treeNode.count = treeNode.children.length;
BI.delay(function () {
ajaxGetNodes(treeNode);
}, perTime);
} else {
// treeNode.icon = "";
zTree.updateNode(treeNode);
zTree.selectNode(treeNode.children[0]);
// className = (className === "dark" ? "":"dark");
}
}
function onAsyncError (event, treeId, treeNode, XMLHttpRequest, textStatus, errorThrown) {
var zTree = self.nodes;
BI.Msg.toast("Error!", "warning");
// treeNode.icon = "";
// zTree.updateNode(treeNode);
}
function ajaxGetNodes (treeNode, reloadType) {
var zTree = self.nodes;
if (reloadType == "refresh") {
zTree.updateNode(treeNode); // 刷新一下当前节点,如果treeNode.xxx被改了的话
}
zTree.reAsyncChildNodes(treeNode, reloadType, true); // 强制加载子节点,reloadType === refresh为先清空再加载,否则为追加到现有子节点之后
}
function beforeCheck (treeId, treeNode) {
// 下面主动修改了node的halfCheck属性, 节点属性的判断依赖halfCheck,改之前就获取一下
var status = treeNode.getCheckStatus();
treeNode.halfCheck = false;
if (treeNode.checked === true) {
// 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy
// 所有的半选状态都需要取消halfCheck=true的情况
function track (children) {
BI.each(children, function (i, ch) {
if (ch.halfCheck === true) {
ch.halfCheck = false;
track(ch.children);
}
});
}
track(treeNode.children);
var treeObj = self.nodes;
var nodes = treeObj.getSelectedNodes();
BI.$.each(nodes, function (index, node) {
node.halfCheck = false;
});
}
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
if(status.half === true && status.checked === true) {
treeNode.checked = false;
}
}
function onCheck (event, treeId, treeNode) {
self._selectTreeNode(treeId, treeNode);
}
function onExpand (event, treeId, treeNode) {
treeNode.halfCheck = false;
}
function onCollapse (event, treeId, treeNode) {
}
return setting;
},
_getParentValues: function (treeNode) {
if (!treeNode.getParentNode()) {
return [];
}
var parentNode = treeNode.getParentNode();
var result = this._getParentValues(parentNode);
result = result.concat([this._getNodeValue(parentNode)]);
return result;
},
_getNodeValue: function (node) {
// 去除标红
return node.value == null ? BI.replaceAll(node.text.replace(/<[^>]+>/g, ""), "&nbsp;", " ") : node.value;
},
// 获取半选框值
_getHalfSelectedValues: function (map, node) {
var self = this;
var checkState = node.getCheckStatus();
// 将未选的去掉
if (checkState.checked === false && checkState.half === false) {
return;
}
// 如果节点已展开,并且是半选
if (BI.isNotEmptyArray(node.children) && checkState.half === true) {
var children = node.children;
BI.each(children, function (i, ch) {
self._getHalfSelectedValues(map, ch);
});
return;
}
var parent = node.parentValues || self._getParentValues(node);
var path = parent.concat(this._getNodeValue(node));
// 当前节点是全选的,因为上面的判断已经排除了不选和半选
if (BI.isNotEmptyArray(node.children) || checkState.half === false) {
this._buildTree(map, path);
return;
}
// 剩下的就是半选不展开的节点,因为不知道里面是什么情况,所以借助selectedValues(这个是完整的选中情况)
var storeValues = BI.deepClone(this.options.paras.selectedValues);
var treeNode = this._getTree(storeValues, path);
this._addTreeNode(map, parent, this._getNodeValue(node), treeNode);
},
// 获取的是以values最后一个节点为根的子树
_getTree: function (map, values) {
var cur = map;
BI.any(values, function (i, value) {
if (cur[value] == null) {
return true;
}
cur = cur[value];
});
return cur;
},
// 以values为path一路向里补充map, 并在末尾节点添加key: value节点
_addTreeNode: function (map, values, key, value) {
var cur = map;
BI.each(values, function (i, value) {
if (cur[value] == null) {
cur[value] = {};
}
cur = cur[value];
});
cur[key] = value;
},
// 构造树节点
_buildTree: function (map, values) {
var cur = map;
BI.each(values, function (i, value) {
if (cur[value] == null) {
cur[value] = {};
}
cur = cur[value];
});
},
// 获取选中的值
_getSelectedValues: function () {
var self = this;
var hashMap = {};
var rootNoots = this.nodes.getNodes();
track(rootNoots); // 可以看到这个方法没有递归调用,所以在_getHalfSelectedValues中需要关心全选的节点
function track (nodes) {
BI.each(nodes, function (i, node) {
var checkState = node.getCheckStatus();
if (checkState.checked === true || checkState.half === true) {
if (checkState.half === true) {
self._getHalfSelectedValues(hashMap, node);
} else {
var parentValues = node.parentValues || self._getParentValues(node);
var values = parentValues.concat([self._getNodeValue(node)]);
self._buildTree(hashMap, values);
}
}
});
}
return hashMap;
},
// 处理节点
_dealWidthNodes: function (nodes) {
var self = this, o = this.options;
var ns = BI.Tree.arrayFormat(nodes);
BI.each(ns, function (i, n) {
n.title = n.title || n.text || n.value;
n.isParent = n.isParent || n.parent;
// 处理标红
if (BI.isKey(o.paras.keyword)) {
n.text = BI.$("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = BI.htmlEncode(n.text + "");
}
});
return nodes;
},
_loadMore: function () {
var self = this, o = this.options;
this.tip.setLoading();
var op = BI.extend({}, o.paras, {
times: ++this.times
});
o.itemsCreator(op, function (res) {
if (self._stop === true) {
return;
}
var hasNext = !!res.hasNext, nodes = res.items || [];
if (!hasNext) {
self.tip.setEnd();
} else {
self.tip.setLoaded();
}
if (nodes.length > 0) {
self.nodes.addNodes(null, self._dealWidthNodes(nodes));
}
});
},
// 生成树内部方法
_initTree: function (setting) {
var self = this, o = this.options;
self.fireEvent(BI.Events.INIT);
this.times = 1;
var tree = this.tree;
tree.empty();
this.loading();
this.tip.setVisible(false);
var callback = function (nodes) {
if (self._stop === true) {
return;
}
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
};
var op = BI.extend({}, o.paras, {
times: 1
});
o.itemsCreator(op, function (res) {
if (self._stop === true) {
return;
}
var hasNext = !!res.hasNext, nodes = res.items || [];
if (nodes.length > 0) {
callback(self._dealWidthNodes(nodes));
}
self.setTipVisible(nodes.length <= 0);
self.loaded();
if (!hasNext) {
self.tip.invisible();
} else {
self.tip.setLoaded();
}
op.times === 1 && self.fireEvent(BI.Events.AFTERINIT);
});
},
// 构造树结构,
initTree: function (nodes, setting) {
var setting = setting || {
async: {
enable: false
},
check: {
enable: false
},
data: {
key: {
title: "title",
name: "text"
},
simpleData: {
enable: true
}
},
view: {
showIcon: false,
expandSpeed: "",
nameIsHTML: true
},
callback: {}
};
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
start: function () {
this._stop = false;
},
stop: function () {
this._stop = true;
},
// 生成树方法
stroke: function (config) {
delete this.options.keyword;
BI.extend(this.options.paras, config);
var setting = this._configSetting();
this._createTree();
this.start();
this._initTree(setting);
},
populate: function () {
this.stroke.apply(this, arguments);
},
hasChecked: function () {
var treeObj = this.nodes;
return treeObj.getCheckedNodes(true).length > 0;
},
checkAll: function (checked) {
function setNode (children) {
BI.each(children, function (i, child) {
child.halfCheck = false;
setNode(child.children);
});
}
if (!this.nodes) {
return;
}
BI.each(this.nodes.getNodes(), function (i, node) {
node.halfCheck = false;
setNode(node.children);
});
this.nodes.checkAllNodes(checked);
},
expandAll: function (flag) {
this.nodes && this.nodes.expandAll(flag);
},
// 设置树节点的状态
setValue: function (value, param) {
this.checkAll(false);
this.updateValue(value, param);
this.refresh();
},
setSelectedValue: function (value) {
this.options.paras.selectedValues = BI.deepClone(value || {});
},
updateValue: function (values, param) {
if (!this.nodes) {
return;
}
param || (param = "value");
var treeObj = this.nodes;
BI.each(values, function (v, op) {
var nodes = treeObj.getNodesByParam(param, v, null);
BI.each(nodes, function (j, node) {
BI.extend(node, {checked: true}, op);
treeObj.updateNode(node);
});
});
},
refresh: function () {
this.nodes && this.nodes.refresh();
},
getValue: function () {
if (!this.nodes) {
return null;
}
return this._getSelectedValues();
},
destroyed: function () {
this.stop();
this.nodes && this.nodes.destroy();
}
});
BI.extend(BI.TreeView, {
REQ_TYPE_INIT_DATA: 1,
REQ_TYPE_ADJUST_DATA: 2,
REQ_TYPE_SELECT_DATA: 3,
REQ_TYPE_GET_SELECTED_DATA: 4
});
BI.TreeView.EVENT_CHANGE = "EVENT_CHANGE";
BI.TreeView.EVENT_INIT = BI.Events.INIT;
BI.TreeView.EVENT_AFTERINIT = BI.Events.AFTERINIT;
BI.shortcut("bi.tree_view", BI.TreeView);
/***/ }),
/* 707 */
/***/ (function(module, exports) {
/**
* guy
* 同步树
* @class BI.AsyncTree
* @extends BI.TreeView
*/
BI.AsyncTree = BI.inherit(BI.TreeView, {
_defaultConfig: function () {
return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.AsyncTree.superclass._init.apply(this, arguments);
var self = this;
this.service = new BI.TreeRenderPageService({
subNodeListGetter: function (tId) {
// 获取待检测的子节点列表, ztree并没有获取节点列表dom的API, 此处使用BI.$获取
return BI.$("#" + self.id + " #" + tId + "_ul");
}
});
},
// 配置属性
_configSetting: function () {
var paras = this.options.paras;
var self = this;
var setting = {
async: {
enable: false, // 很明显这棵树把异步请求关掉了,所有的异步请求都是手动控制的
otherParam: BI.cjkEncodeDO(paras)
},
check: {
enable: true
},
data: {
key: {
title: "title",
name: "text"
},
simpleData: {
enable: true
}
},
view: {
showIcon: false,
expandSpeed: "",
nameIsHTML: true,
dblClickExpand: false
},
callback: {
beforeCheck: beforeCheck,
onCheck: onCheck,
beforeExpand: beforeExpand,
onExpand: onExpand,
onCollapse: onCollapse,
onClick: onClick
}
};
function onClick (event, treeId, treeNode) {
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
var checked = treeNode.checked;
var status = treeNode.getCheckStatus();
if (status.half === true && status.checked === true) {
checked = false;
}
zTree.checkNode(treeNode, !checked, true, true);
}
function beforeCheck (treeId, treeNode) {
// 下面主动修改了node的halfCheck属性, 节点属性的判断依赖halfCheck,改之前就获取一下
var status = treeNode.getCheckStatus();
treeNode.halfCheck = false;
if (treeNode.checked === true) {
// 将展开的节点halfCheck设为false,解决展开节点存在halfCheck=true的情况 guy
// 所有的半选状态都需要取消halfCheck=true的情况
function track (children) {
BI.each(children, function (i, ch) {
ch.halfCheck = false;
track(ch.children);
});
}
track(treeNode.children);
var treeObj = BI.$.fn.zTree.getZTreeObj(treeId);
var nodes = treeObj.getSelectedNodes();
BI.each(nodes, function (index, node) {
node.halfCheck = false;
});
}
// 当前点击节点的状态是半选,且为true_part, 则将其改为false_part,使得点击半选后切换到的是全选
if (status.half === true && status.checked === true) {
treeNode.checked = false;
}
}
function beforeExpand (treeId, treeNode) {
self._beforeExpandNode(treeId, treeNode);
}
function onCheck (event, treeId, treeNode) {
self._selectTreeNode(treeId, treeNode);
}
function onExpand (event, treeId, treeNode) {
treeNode.halfCheck = false;
}
function onCollapse (event, treeId, treeNode) {
treeNode.halfCheck = false;
}
return setting;
},
// 用来更新this.options.paras.selectedValues, 和ztree内部无关
_selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options;
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode);
// var values = parentValues.concat([name]);
if (treeNode.checked === true) {
this._addTreeNode(this.options.paras.selectedValues, parentValues, name, {});
} else {
var tNode = treeNode;
var pNode = this._getTree(this.options.paras.selectedValues, parentValues);
if (BI.isNotNull(pNode[name])) {
delete pNode[name];
}
while (tNode != null && BI.isEmpty(pNode)) {
parentValues = parentValues.slice(0, parentValues.length - 1);
tNode = tNode.getParentNode();
if (tNode != null) {
pNode = this._getTree(this.options.paras.selectedValues, parentValues);
name = this._getNodeValue(tNode);
delete pNode[name];
}
}
this.options.paras.selectedValues = this._getJoinValue();
}
BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments);
},
// 展开节点
_beforeExpandNode: function (treeId, treeNode) {
var self = this, o = this.options;
var complete = function (d) {
var nodes = d.items || [];
if (nodes.length > 0) {
callback(self._dealWidthNodes(nodes), !!d.hasNext);
}
};
function callback(nodes, hasNext) {
self.nodes.addNodes(treeNode, nodes);
if (hasNext) {
self.service.pushNodeList(treeNode.tId, getNodes);
} else {
self.service.removeNodeList(treeNode.tId);
}
}
function getNodes(options) {
// console.log(times);
options = options || {};
var parentValues = treeNode.parentValues || self._getParentValues(treeNode);
var op = BI.extend({}, o.paras, {
id: treeNode.id,
times: options.times,
parentValues: parentValues.concat(self._getNodeValue(treeNode)),
checkState: treeNode.getCheckStatus()
}, options);
o.itemsCreator(op, complete);
}
// 展开节点会将halfCheck置为false以开启自动计算半选, 所以第一次展开节点的时候需要在置为false之前获取配置
var checkState = treeNode.getCheckStatus();
if (!treeNode.children) {
setTimeout(function () {
getNodes({
times: 1,
checkState: checkState
});
}, 17);
}
},
// a,b 两棵树
// a->b b->a 做两次校验, 构造一个校验后的map
// e.g. 以a为基准,如果b没有此节点,则在map中添加。 如b有,且是全选的, 则在map中构造全选(为什么不添加a的值呢? 因为这次是取并集), 如果b中也有和a一样的存值,就递归
_join: function (valueA, valueB) {
var self = this;
var map = {};
track([], valueA, valueB);
track([], valueB, valueA);
function track (parent, node, compare) {
BI.each(node, function (n, item) {
if (BI.isNull(compare[n])) {
self._addTreeNode(map, parent, n, item);
} else if (BI.isEmpty(compare[n])) {
self._addTreeNode(map, parent, n, item);
} else {
track(parent.concat([n]), node[n], compare[n]);
}
});
}
return map;
},
hasChecked: function () {
return !BI.isEmpty(this.options.paras.selectedValues) || BI.AsyncTree.superclass.hasChecked.apply(this, arguments);
},
_getJoinValue: function () {
if (!this.nodes) {
return {};
}
var checkedValues = this._getSelectedValues();
if (BI.isEmpty(checkedValues)) {
return BI.deepClone(this.options.paras.selectedValues);
}
if (BI.isEmpty(this.options.paras.selectedValues)) {
return checkedValues;
}
return this._join(checkedValues, this.options.paras.selectedValues);
},
getValue: function () {
return this._getJoinValue();
},
// 生成树方法
stroke: function (config) {
delete this.options.keyword;
this.service.clear();
BI.extend(this.options.paras, config);
var setting = this._configSetting();
this._initTree(setting);
}
});
BI.shortcut("bi.async_tree", BI.AsyncTree);
/***/ }),
/* 708 */
/***/ (function(module, exports) {
/**
* guy
* 局部树,两个请求树, 第一个请求构造树,第二个请求获取节点
* @class BI.PartTree
* @extends BI.AsyncTree
*/
BI.PartTree = BI.inherit(BI.AsyncTree, {
_defaultConfig: function () {
return BI.extend(BI.PartTree.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.PartTree.superclass._init.apply(this, arguments);
},
_loadMore: function () {
var self = this, o = this.options;
var op = BI.extend({}, o.paras, {
type: BI.TreeView.REQ_TYPE_INIT_DATA,
times: ++this.times
});
this.tip.setLoading();
o.itemsCreator(op, function (d) {
var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.lastSearchValue = d.lastSearchValue;
if (self._stop === true) {
return;
}
if (!hasNext) {
self.tip.setEnd();
} else {
self.tip.setLoaded();
}
if (nodes.length > 0) {
self.nodes.addNodes(null, self._dealWidthNodes(nodes));
}
});
},
_selectTreeNode: function (treeId, treeNode) {
var self = this, o = this.options;
var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode));
var name = this._getNodeValue(treeNode);
if (treeNode.checked === true) {
this.options.paras.selectedValues = this._getUnionValue();
// this._buildTree(self.options.paras.selectedValues, BI.concat(parentValues, name));
o.itemsCreator(BI.extend({}, o.paras, {
type: BI.TreeView.REQ_TYPE_ADJUST_DATA,
curSelectedValue: name,
parentValues: parentValues
}), function (res) {
self.options.paras.selectedValues = res;
BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments);
});
} else {
// 如果选中的值中不存在该值不处理
// 因为反正是不选中,没必要管
var t = this.options.paras.selectedValues;
var p = parentValues.concat(name);
for (var i = 0, len = p.length; i < len; i++) {
t = t[p[i]];
if (t == null) {
return;
}
// 选中中国-江苏, 搜索南京,取消勾选
if (BI.isEmpty(t)) {
break;
}
}
o.itemsCreator(BI.extend({}, o.paras, {
type: BI.TreeView.REQ_TYPE_SELECT_DATA,
notSelectedValue: name,
parentValues: parentValues
}), function (new_values) {
self.options.paras.selectedValues = new_values;
BI.AsyncTree.superclass._selectTreeNode.apply(self, arguments);
});
}
},
_getSelectedValues: function () {
var self = this;
var hashMap = {};
var rootNoots = this.nodes.getNodes();
track(rootNoots);
function track (nodes) {
BI.each(nodes, function (i, node) {
var checkState = node.getCheckStatus();
if (checkState.checked === false) {
return true;
}
var parentValues = node.parentValues || self._getParentValues(node);
// 把文字中的html去掉,其实就是把文字颜色去掉
var values = parentValues.concat([self._getNodeValue(node)]);
self._buildTree(hashMap, values);
// if(checkState.checked === true && checkState.half === false && nodes[i].flag === true){
// continue;
// }
if (BI.isNotEmptyArray(node.children)) {
track(node.children);
return true;
}
if (checkState.half === true) {
self._getHalfSelectedValues(hashMap, node);
}
});
}
return hashMap;
},
_initTree: function (setting, keyword) {
var self = this, o = this.options;
this.times = 1;
var tree = this.tree;
tree.empty();
self.tip.setVisible(false);
this.loading();
var op = BI.extend({}, o.paras, {
type: BI.TreeView.REQ_TYPE_INIT_DATA,
times: this.times
});
var complete = function (d) {
if (self._stop === true || keyword != o.paras.keyword) {
return;
}
var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.lastSearchValue = d.lastSearchValue;
// 没有请求到数据也要初始化空树, 如果不初始化, 树就是上一次构造的树, 节点信息都是过期的
callback(nodes.length > 0 ? self._dealWidthNodes(nodes) : []);
self.setTipVisible(nodes.length <= 0);
self.loaded();
if (!hasNext) {
self.tip.invisible();
} else {
self.tip.setLoaded();
}
self.fireEvent(BI.Events.AFTERINIT);
};
function callback (nodes) {
if (self._stop === true) {
return;
}
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
o.itemsCreator(op, complete);
}, 100);
},
getValue: function () {
return BI.deepClone(this.options.paras.selectedValues || {});
},
_getUnionValue: function () {
if (!this.nodes) {
return {};
}
var checkedValues = this._getSelectedValues();
if (BI.isEmpty(checkedValues)) {
return BI.deepClone(this.options.paras.selectedValues);
}
if (BI.isEmpty(this.options.paras.selectedValues)) {
return checkedValues;
}
return this._union(checkedValues, this.options.paras.selectedValues);
},
_union: function (valueA, valueB) {
var self = this;
var map = {};
track([], valueA, valueB);
track([], valueB, valueA);
function track (parent, node, compare) {
BI.each(node, function (n, item) {
if (BI.isNull(compare[n])) {
self._addTreeNode(map, parent, n, item);
} else if (BI.isEmpty(compare[n])) {
self._addTreeNode(map, parent, n, {});
} else {
track(parent.concat([n]), node[n], compare[n]);
}
});
}
return map;
},
// 生成树方法
stroke: function (config) {
var o = this.options;
delete o.paras.keyword;
BI.extend(o.paras, config);
delete o.paras.lastSearchValue;
var setting = this._configSetting();
this._initTree(setting, o.paras.keyword);
}
});
BI.shortcut("bi.part_tree", BI.PartTree);
/***/ }),
/* 709 */
/***/ (function(module, exports) {
/**
* author: windy
* 继承自treeView, 此树的父子节点的勾选状态互不影响, 此树不会有半选节点
* 返回value格式为[["A"], ["A", "a"]]表示勾选了A且勾选了a
* @class BI.ListTreeView
* @extends BI.TreeView
*/
BI.ListTreeView = BI.inherit(BI.TreeView, {
_constants: {
SPLIT: "<|>"
},
_defaultConfig: function () {
return BI.extend(BI.ListTreeView.superclass._defaultConfig.apply(this, arguments), {
value: {}
});
},
_init: function () {
BI.ListTreeView.superclass._init.apply(this, arguments);
var o = this.options;
if(BI.isNotNull(o.value)) {
this.setSelectedValue(o.value);
}
},
// 配置属性
_configSetting: function () {
var paras = this.options.paras;
var self = this;
var setting = {
async: {
enable: false
},
check: {
enable: true,
chkboxType: {Y: "", N: ""}
},
data: {
key: {
title: "title",
name: "text"
},
simpleData: {
enable: true
}
},
view: {
showIcon: false,
expandSpeed: "",
nameIsHTML: true,
dblClickExpand: false
},
callback: {
onCheck: onCheck,
onClick: onClick
}
};
function onClick (event, treeId, treeNode) {
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
}
function onCheck (event, treeId, treeNode) {
self._selectTreeNode(treeId, treeNode);
}
return setting;
},
_selectTreeNode: function (treeId, treeNode) {
this._checkValue(treeNode, treeNode.checked);
BI.ListTreeView.superclass._selectTreeNode.apply(this, arguments);
},
_transArrayToMap: function (treeArrays) {
var self = this;
var map = {};
BI.each(treeArrays, function (idx, array) {
var key = array.join(self._constants.SPLIT);
map[key] = true;
});
return map;
},
_transMapToArray: function (treeMap) {
var self = this;
var array = [];
BI.each(treeMap, function (key) {
var item = key.split(self._constants.SPLIT);
array.push(item);
});
return array;
},
_checkValue: function (treeNode, checked) {
var key = BI.concat(this._getParentValues(treeNode), this._getNodeValue(treeNode)).join(this._constants.SPLIT);
if(checked) {
this.storeValue[key] = true;
} else {
delete this.storeValue[key];
}
},
setSelectedValue: function (value) {
this.options.paras.selectedValues = value || [];
this.storeValue = this._transArrayToMap(value);
},
getValue: function () {
return this._transMapToArray(this.storeValue);
}
});
BI.shortcut("bi.list_tree_view", BI.ListTreeView);
/***/ }),
/* 710 */
/***/ (function(module, exports) {
/**
* author: windy
* 继承自treeView, 此树的父子节点的勾选状态互不影响, 此树不会有半选节点
* 返回value格式为["A", ["A", "a"]]表示勾选了A且勾选了a
* @class BI.ListListAsyncTree
* @extends BI.TreeView
*/
BI.ListAsyncTree = BI.inherit(BI.ListTreeView, {
_defaultConfig: function () {
return BI.extend(BI.ListAsyncTree.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.ListAsyncTree.superclass._init.apply(this, arguments);
},
// 配置属性
_configSetting: function () {
var paras = this.options.paras;
var self = this;
var setting = {
async: {
enable: false, // 很明显这棵树把异步请求关掉了,所有的异步请求都是手动控制的
otherParam: BI.cjkEncodeDO(paras)
},
check: {
enable: true,
chkboxType: {Y: "", N: ""}
},
data: {
key: {
title: "title",
name: "text"
},
simpleData: {
enable: true
}
},
view: {
showIcon: false,
expandSpeed: "",
nameIsHTML: true,
dblClickExpand: false
},
callback: {
onCheck: onCheck,
beforeExpand: beforeExpand,
beforeCheck: beforeCheck,
onClick: onClick
}
};
function beforeCheck (treeId, treeNode) {
treeNode.half = false;
}
function onClick (event, treeId, treeNode) {
var zTree = BI.$.fn.zTree.getZTreeObj(treeId);
var checked = treeNode.checked;
self._checkValue(treeNode, !checked);
zTree.checkNode(treeNode, !checked, true, true);
}
function beforeExpand (treeId, treeNode) {
self._beforeExpandNode(treeId, treeNode);
}
function onCheck (event, treeId, treeNode) {
self._selectTreeNode(treeId, treeNode);
}
return setting;
},
// 展开节点
_beforeExpandNode: function (treeId, treeNode) {
var self = this, o = this.options;
var parentValues = treeNode.parentValues || self._getParentValues(treeNode);
var op = BI.extend({}, o.paras, {
id: treeNode.id,
times: 1,
parentValues: parentValues.concat(this._getNodeValue(treeNode))
});
var complete = function (d) {
var nodes = d.items || [];
if (nodes.length > 0) {
callback(self._dealWidthNodes(nodes), !!d.hasNext);
}
};
var times = 1;
function callback (nodes, hasNext) {
self.nodes.addNodes(treeNode, nodes);
// 展开节点是没有分页的
if (hasNext === true) {
BI.delay(function () {
times++;
op.times = times;
o.itemsCreator(op, complete);
}, 100);
}
}
if (!treeNode.children) {
setTimeout(function () {
o.itemsCreator(op, complete);
}, 17);
}
},
hasChecked: function () {
return !BI.isEmpty(this.options.paras.selectedValues) || BI.ListAsyncTree.superclass.hasChecked.apply(this, arguments);
},
// 生成树方法
stroke: function (config) {
delete this.options.keyword;
BI.extend(this.options.paras, config);
var setting = this._configSetting();
this._initTree(setting);
}
});
BI.shortcut("bi.list_async_tree", BI.ListAsyncTree);
/***/ }),
/* 711 */
/***/ (function(module, exports) {
/**
* guy
* 局部树,两个请求树, 第一个请求构造树,第二个请求获取节点
* @class BI.ListPartTree
* @extends BI.AsyncTree
*/
BI.ListPartTree = BI.inherit(BI.ListAsyncTree, {
_defaultConfig: function () {
return BI.extend(BI.ListPartTree.superclass._defaultConfig.apply(this, arguments), {});
},
_init: function () {
BI.ListPartTree.superclass._init.apply(this, arguments);
},
_loadMore: function () {
var self = this, o = this.options;
var op = BI.extend({}, o.paras, {
type: BI.TreeView.REQ_TYPE_INIT_DATA,
times: ++this.times
});
this.tip.setLoading();
o.itemsCreator(op, function (d) {
var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.lastSearchValue = d.lastSearchValue;
if (self._stop === true) {
return;
}
if (!hasNext) {
self.tip.setEnd();
} else {
self.tip.setLoaded();
}
if (nodes.length > 0) {
self.nodes.addNodes(null, self._dealWidthNodes(nodes));
}
});
},
_initTree: function (setting, keyword) {
var self = this, o = this.options;
this.times = 1;
var tree = this.tree;
tree.empty();
self.tip.setVisible(false);
this.loading();
var op = BI.extend({}, o.paras, {
type: BI.TreeView.REQ_TYPE_INIT_DATA,
times: this.times
});
var complete = function (d) {
if (self._stop === true || keyword != o.paras.keyword) {
return;
}
var hasNext = !!d.hasNext, nodes = d.items || [];
o.paras.lastSearchValue = d.lastSearchValue;
// 没有请求到数据也要初始化空树, 如果不初始化, 树就是上一次构造的树, 节点信息都是过期的
callback(nodes.length > 0 ? self._dealWidthNodes(nodes) : []);
self.setTipVisible(nodes.length <= 0);
self.loaded();
if (!hasNext) {
self.tip.invisible();
} else {
self.tip.setLoaded();
}
self.fireEvent(BI.Events.AFTERINIT);
};
function callback (nodes) {
if (self._stop === true) {
return;
}
self.nodes = BI.$.fn.zTree.init(tree.element, setting, nodes);
}
BI.delay(function () {
o.itemsCreator(op, complete);
}, 100);
},
// 生成树方法
stroke: function (config) {
var o = this.options;
delete o.paras.keyword;
BI.extend(o.paras, config);
delete o.paras.lastSearchValue;
var setting = this._configSetting();
this._initTree(setting, o.paras.keyword);
}
});
BI.shortcut("bi.list_part_tree", BI.ListPartTree);
/***/ }),
/* 712 */
/***/ (function(module, exports) {
/**
* 文件
*
* Created by GUY on 2016/1/27.
* @class BI.File
* @extends BI.Single
* @abstract
*/
(function (document) {
/**
* @description normalize input.files. create if not present, add item method if not present
* @param Object generated wrap object
* @return Object the wrap object itself
*/
var F = (function (item) {
return function (input) {
var files = input.files || [input];
if (!files.item) {
files.item = item;
}
return files;
};
})(function (i) {
return this[i];
});
var event = {
/**
* @description add an event via addEventListener or attachEvent
* @param DOMElement the element to add event
* @param String event name without "on" (e.g. "mouseover")
* @param Function the callback to associate as event
* @return Object noswfupload.event
*/
add: document.addEventListener ?
function (node, name, callback) {
node.addEventListener(name, callback, false);
return this;
} :
function (node, name, callback) {
node.attachEvent("on" + name, callback);
return this;
},
/**
* @description remove an event via removeEventListener or detachEvent
* @param DOMElement the element to remove event
* @param String event name without "on" (e.g. "mouseover")
* @param Function the callback associated as event
* @return Object noswfupload.event
*/
del: document.removeEventListener ?
function (node, name, callback) {
node.removeEventListener(name, callback, false);
return this;
} :
function (node, name, callback) {
node.detachEvent("on" + name, callback);
return this;
},
/**
* @description to block event propagation and prevent event default
* @param void generated event or undefined
* @return Boolean false
*/
stop: function (e) {
if (!e) {
if (self.event) {
event.returnValue = !(event.cancelBubble = true);
}
} else {
e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
e.preventDefault ? e.preventDefault() : e.returnValue = false;
}
return false;
}
};
var sendFile = (function (toString) {
var multipart = function (boundary, name, file) {
return "--".concat(
boundary, CRLF,
"Content-Disposition: form-data; name=\"", name, "\"; filename=\"", _global.encodeURIComponent(file.fileName), "\"", CRLF,
"Content-Type: application/octet-stream", CRLF,
CRLF,
file.getAsBinary(), CRLF,
"--", boundary, "--", CRLF
);
},
isFunction = function (Function) {
return toString.call(Function) === "[object Function]";
},
split = "onabort.onerror.onloadstart.onprogress".split("."),
length = split.length,
CRLF = "\r\n",
xhr = this.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP"),
sendFile;
// FireFox 3+, Safari 4 beta (Chrome 2 beta file is buggy and will not work)
if (xhr.upload || xhr.sendAsBinary) {
sendFile = function (handler, maxSize, width, height) {
if (-1 < maxSize && maxSize < handler.file.fileSize) {
if (isFunction(handler.onerror)) {
handler.onerror();
}
return;
}
for (var
xhr = new XMLHttpRequest,
upload = xhr.upload || {
addEventListener: function (event, callback) {
this["on" + event] = callback;
}
},
i = 0;
i < length;
i++
) {
upload.addEventListener(
split[i].substring(2),
(function (event) {
return function (rpe) {
if (isFunction(handler[event])) {
handler[event](rpe, xhr);
}
};
})(split[i]),
false
);
}
upload.addEventListener(
"load",
function (rpe) {
if (handler.onreadystatechange === false) {
if (isFunction(handler.onload)) {
handler.onload(rpe, xhr);
}
} else {
setTimeout(function () {
if (xhr.readyState === 4) {
if (isFunction(handler.onload)) {
handler.onload(rpe, xhr);
}
} else {
setTimeout(arguments.callee, 15);
}
}, 15);
}
},
false
);
xhr.open("post", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName), true);
if (!xhr.upload) {
var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true};
rpe.interval = setInterval(function () {
rpe.loaded += 1024 / 4;
if (rpe.total <= rpe.loaded) {
rpe.loaded = rpe.total;
}
upload.onprogress(rpe);
}, 100);
xhr.onabort = function () {
upload.onabort({});
};
xhr.onerror = function () {
upload.onerror({});
};
xhr.onreadystatechange = function () {
switch (xhr.readyState) {
case 2:
case 3:
if (rpe.total <= rpe.loaded) {
rpe.loaded = rpe.total;
}
upload.onprogress(rpe);
break;
case 4:
clearInterval(rpe.interval);
rpe.interval = 0;
rpe.loaded = rpe.total;
upload.onprogress(rpe);
if (199 < xhr.status && xhr.status < 400) {
upload["onload"]({});
var attachO = BI.jsonDecode(xhr.responseText);
attachO.filename = handler.file.fileName;
if (handler.file.type.indexOf("image") != -1) {
attachO.attach_type = "image";
}
handler.attach_array.push(attachO);
} else {
upload["onerror"]({});
}
break;
}
};
upload.onloadstart(rpe);
} else {
xhr.onreadystatechange = function () {
switch (xhr.readyState) {
case 4:
var attachO = BI.jsonDecode(xhr.responseText);
if (handler.file.type.indexOf("image") != -1) {
attachO.attach_type = "image";
}
attachO.filename = handler.file.fileName;
if (handler.maxlength == 1) {
handler.attach_array[0] = attachO;
// handler.attach_array.push(attachO);
} else {
handler.attach_array.push(attachO);
}
break;
}
};
if (isFunction(upload.onloadstart)) {
upload.onloadstart();
}
}
var boundary = "AjaxUploadBoundary" + (new Date).getTime();
xhr.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + boundary);
if (handler.file.getAsBinary) {
xhr[xhr.sendAsBinary ? "sendAsBinary" : "send"](multipart(boundary, handler.name, handler.file));
} else {
xhr.setRequestHeader("Content-Type", "multipart/form-data");
// xhr.setRequestHeader("X-Name", handler.name);
// xhr.setRequestHeader("X-File-Name", handler.file.fileName);
var form = new FormData();
form.append("FileData", handler.file);
xhr.send(form);
}
return handler;
};
}
// Internet Explorer, Opera, others
else {
sendFile = function (handler, maxSize, width, height) {
var url = handler.url.concat(-1 === handler.url.indexOf("?") ? "?" : "&", "AjaxUploadFrame=true"),
rpe = {
loaded: 1, total: 100, simulation: true, interval: setInterval(function () {
if (rpe.loaded < rpe.total) {
++rpe.loaded;
}
if (isFunction(handler.onprogress)) {
handler.onprogress(rpe, {});
}
}, 100)
},
onload = function () {
iframe.onreadystatechange = iframe.onload = iframe.onerror = null;
form.parentNode.removeChild(form);
form = null;
clearInterval(rpe.interval);
// rpe.loaded = rpe.total;
try {
var responseText = (iframe.contentWindow.document || iframe.contentWindow.contentDocument).body.innerHTML;
var attachO = BI.jsonDecode(responseText);
if (handler.file.type.indexOf("image") != -1) {
attachO.attach_type = "image";
}
// attachO.fileSize = responseText.length;
try {
// decodeURIComponent特殊字符可能有问题, catch一下,保证能正常上传
attachO.filename = _global.decodeURIComponent(handler.file.fileName);
} catch (e) {
attachO.filename = handler.file.fileName;
}
if (handler.maxlength == 1) {
handler.attach_array[0] = attachO;
} else {
handler.attach_array.push(attachO);
}
} catch (e) {
if (isFunction(handler.onerror)) {
handler.onerror(rpe, event || _global.event);
}
}
if (isFunction(handler.onload)) {
handler.onload(rpe, {responseText: responseText});
}
},
target = ["AjaxUpload", (new Date).getTime(), String(Math.random()).substring(2)].join("_");
try { // IE < 8 does not accept enctype attribute ...
var form = document.createElement("<form enctype=\"multipart/form-data\"></form>"),
iframe = handler.iframe || (handler.iframe = document.createElement("<iframe id=\"" + target + "\" name=\"" + target + "\" src=\"" + url + "\"></iframe>"));
} catch (e) {
var form = document.createElement("form"),
iframe = handler.iframe || (handler.iframe = document.createElement("iframe"));
form.setAttribute("enctype", "multipart/form-data");
iframe.setAttribute("name", iframe.id = target);
iframe.setAttribute("src", url);
}
iframe.style.position = "absolute";
iframe.style.left = iframe.style.top = "-10000px";
iframe.onload = onload;
iframe.onerror = function (event) {
if (isFunction(handler.onerror)) {
handler.onerror(rpe, event || _global.event);
}
};
iframe.onreadystatechange = function () {
if (/loaded|complete/i.test(iframe.readyState)) {
onload();
// wei : todo,将附件信息放到handler.attach
} else if (isFunction(handler.onloadprogress)) {
if (rpe.loaded < rpe.total) {
++rpe.loaded;
}
handler.onloadprogress(rpe, {
readyState: {
loading: 2,
interactive: 3,
loaded: 4,
complete: 4
}[iframe.readyState] || 1
});
}
};
form.setAttribute("action", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName));
form.setAttribute("target", iframe.id);
form.setAttribute("method", "post");
form.appendChild(handler.file);
form.style.display = "none";
if (isFunction(handler.onloadstart)) {
handler.onloadstart(rpe, {});
}
with (document.body || document.documentElement) {
appendChild(iframe);
appendChild(form);
form.submit();
}
return handler;
};
}
xhr = null;
return sendFile;
})(Object.prototype.toString);
var sendFiles = function (handler, maxSize, width, height) {
var length = handler.files.length,
i = 0,
onload = handler.onload,
onloadstart = handler.onloadstart;
handler.current = 0;
handler.total = 0;
handler.sent = 0;
while (handler.current < length) {
handler.total += (handler.files[handler.current].fileSize || handler.files[handler.current].size);
handler.current++;
}
handler.current = 0;
if (length && handler.files[0].fileSize !== -1) {
handler.file = handler.files[handler.current];
sendFile(handler, maxSize, width, height).onload = function (rpe, xhr) {
handler.onloadstart = null;
handler.sent += (handler.files[handler.current].fileSize || handler.files[handler.current].size);
if (++handler.current < length) {
handler.file = handler.files[handler.current];
sendFile(handler, maxSize, width, height).onload = arguments.callee;
} else if (onload) {
handler.onloadstart = onloadstart;
handler.onload = onload;
handler.onload(rpe, xhr);
}
};
} else if (length) {
handler.total = length * 100;
handler.file = handler.files[handler.current];
sendFile(handler, maxSize, width, height).onload = function (rpe, xhr) {
var callee = arguments.callee;
handler.onloadstart = null;
handler.sent += 100;
if (++handler.current < length) {
if (/\b(chrome|safari)\b/i.test(navigator.userAgent)) {
handler.iframe.parentNode.removeChild(handler.iframe);
handler.iframe = null;
}
setTimeout(function () {
handler.file = handler.files[handler.current];
sendFile(handler, maxSize, width, height).onload = callee;
}, 15);
} else if (onload) {
setTimeout(function () {
handler.iframe.parentNode.removeChild(handler.iframe);
handler.iframe = null;
handler.onloadstart = onloadstart;
handler.onload = onload;
handler.onload(rpe, xhr);
}, 15);
}
};
}
return handler;
};
BI.File = BI.inherit(BI.Widget, {
_defaultConfig: function () {
var conf = BI.File.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-file display-block",
tagName: "input",
attributes: {
type: "file"
},
name: "",
url: "",
multiple: true,
accept: "", /** '*.jpg; *.zip'**/
maxSize: -1 // 1024 * 1024
});
},
_init: function () {
var self = this, o = this.options;
BI.File.superclass._init.apply(this, arguments);
if (o.multiple === true) {
this.element.attr("multiple", "multiple");
}
this.element.attr("name", o.name || this.getName());
this.element.attr("title", o.title || "");
},
created: function () {
var self = this, o = this.options;
// create the noswfupload.wrap Object
// wrap.maxSize 文件大小限制
// wrap.maxlength 文件个数限制
var _wrap = this.wrap = this._wrap(this.element[0], o.maxSize);
// fileType could contain whatever text but filter checks *.{extension}
// if present
// handlers
_wrap.onloadstart = function (rpe, xhr) {
// BI.Msg.toast("loadstart");
self.fireEvent(BI.File.EVENT_UPLOADSTART, arguments);
};
_wrap.onprogress = function (rpe, xhr) {
// BI.Msg.toast("onprogress");
// percent for each bar
// fileSize is -1 only if browser does not support file info access
// this if splits recent browsers from others
if (this.file.fileSize !== -1) {
// simulation property indicates when the progress event is fake
if (rpe.simulation) {
} else {
}
} else {
// if fileSIze is -1 browser is using an iframe because it does
// not support
// files sent via Ajax (XMLHttpRequest)
// We can still show some information
}
self.fireEvent(BI.File.EVENT_PROGRESS, {
file: this.file,
total: rpe.total,
loaded: rpe.loaded,
simulation: rpe.simulation
});
};
// generated if there is something wrong during upload
_wrap.onerror = function () {
// just inform the user something was wrong
self.fireEvent(BI.File.EVENT_ERROR);
};
// generated when every file has been sent (one or more, it does not
// matter)
_wrap.onload = function (rpe, xhr) {
var self_ = this;
// just show everything is fine ...
// ... and after a second reset the component
setTimeout(function () {
self_.clean(); // remove files from list
self_.hide(); // hide progress bars and enable input file
if (200 > xhr.status || xhr.status > 399) {
BI.Msg.toast(BI.i18nText("BI-Upload_File_Error"), {level: "error"});
self.fireEvent(BI.File.EVENT_ERROR);
return;
}
var error = BI.some(_wrap.attach_array, function (index, attach) {
if (attach.errorCode) {
BI.Msg.toast(attach.errorMsg, {level: "error"});
self.fireEvent(BI.File.EVENT_ERROR, attach);
return true;
}
});
!error && self.fireEvent(BI.File.EVENT_UPLOADED);
// enable again the submit button/element
}, 1000);
};
_wrap.url = o.url;
_wrap.fileType = o.accept; // 文件类型限制
_wrap.attach_array = [];
_wrap.attach_names = [];
_wrap.attachNum = 0;
},
_events: function (wrap) {
var self = this;
event.add(wrap.dom.input, "change", function () {
event.del(wrap.dom.input, "change", arguments.callee);
for (var input = wrap.dom.input.cloneNode(true), i = 0, files = F(wrap.dom.input); i < files.length; i++) {
var item = files.item(i);
var tempFile = item.value || item.name;
var value = item.fileName || (item.fileName = tempFile.split("\\").pop()),
ext = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown",
size = item.fileSize || item.size;
if (wrap.fileType && -1 === wrap.fileType.indexOf("*." + ext)) {
// 文件类型不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Type_Error"), {level: "error"});
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 0,
file: item
});
} else if (wrap.maxSize !== -1 && size && wrap.maxSize < size) {
// 文件大小不支持
BI.Msg.toast(BI.i18nText("BI-Upload_File_Size_Error"), {level: "error"});
self.fireEvent(BI.File.EVENT_ERROR, {
errorType: 1,
file: item
});
} else {
wrap.files.unshift(item);
// BI.Msg.toast(value);
}
}
wrap.files.length > 0 && self.fireEvent(BI.File.EVENT_CHANGE, {
files: wrap.files
});
input.value = "";
wrap.dom.input.parentNode.replaceChild(input, wrap.dom.input);
wrap.dom.input = input;
event.add(wrap.dom.input, "change", arguments.callee);
});
return wrap;
},
_wrap: function () {
var self = this, o = this.options;
// be sure input accept multiple files
var input = this.element[0];
if (o.multiple === true) {
this.element.attr("multiple", "multiple");
}
input.value = "";
// wrap Object
return this._events({
// DOM namespace
dom: {
input: input, // input file
disabled: false // internal use, checks input file state
},
name: input.name, // name to send for each file ($_FILES[{name}] in the server)
// maxSize is the maximum amount of bytes for each file
maxSize: o.maxSize ? o.maxSize >> 0 : -1,
files: [], // file list
// remove every file from the noswfupload component
clean: function () {
this.files = [];
},
// upload one file a time (which make progress possible rather than all files in one shot)
// the handler is an object injected into the wrap one, could be the wrap itself or
// something like {onload:function(){alert("OK")},onerror:function(){alert("Error")}, etc ...}
upload: function (handler) {
if (handler) {
for (var key in handler) {
this[key] = handler[key];
}
}
sendFiles(this, this.maxSize);
return this;
},
// hide progress bar (total + current) and enable files selection
hide: function () {
if (this.dom.disabled) {
this.dom.disabled = false;
this.dom.input.removeAttribute("disabled");
}
},
// show progress bar and disable file selection (used during upload)
// total and current are pixels used to style bars
// totalProp and currentProp are properties to change, "height" by default
show: function (total, current, totalProp, currentProp) {
if (!this.dom.disabled) {
this.dom.disabled = true;
this.dom.input.setAttribute("disabled", "disabled");
}
}
});
},
select: function () {
this.wrap && BI.Widget._renderEngine.createElement(this.wrap.dom.input).click();
},
upload: function (handler) {
this.wrap && this.wrap.upload(handler);
},
getValue: function () {
return this.wrap ? this.wrap.attach_array : [];
},
reset: function () {
if (this.wrap) {
this.wrap.attach_array = [];
this.wrap.attach_names = [];
this.wrap.attachNum = 0;
}
},
_setEnable: function (enable) {
BI.File.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.attr("disabled", "disabled");
} else {
this.element.removeAttr("disabled");
}
}
});
BI.File.EVENT_CHANGE = "EVENT_CHANGE";
BI.File.EVENT_UPLOADSTART = "EVENT_UPLOADSTART";
BI.File.EVENT_ERROR = "EVENT_ERROR";
BI.File.EVENT_PROGRESS = "EVENT_PROGRESS";
BI.File.EVENT_UPLOADED = "EVENT_UPLOADED";
BI.shortcut("bi.file", BI.File);
})(_global.document || {});
/***/ }),
/* 713 */
/***/ (function(module, exports) {
/*
* JQuery zTree core v3.5.18
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
*
* Licensed same as jquery - MIT License
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2015-06-18
*/
(function($){
var settings = {}, roots = {}, caches = {},
//default consts of core
_consts = {
className: {
BUTTON: "button",
LEVEL: "level",
ICO_LOADING: "ico_loading",
SWITCH: "switch"
},
event: {
NODECREATED: "ztree_nodeCreated",
CLICK: "ztree_click",
EXPAND: "ztree_expand",
COLLAPSE: "ztree_collapse",
ASYNC_SUCCESS: "ztree_async_success",
ASYNC_ERROR: "ztree_async_error",
REMOVE: "ztree_remove",
SELECTED: "ztree_selected",
UNSELECTED: "ztree_unselected"
},
id: {
A: "_a",
ICON: "_ico",
SPAN: "_span",
SWITCH: "_switch",
UL: "_ul"
},
line: {
ROOT: "root",
ROOTS: "roots",
CENTER: "center",
BOTTOM: "bottom",
NOLINE: "noline",
LINE: "line"
},
folder: {
OPEN: "open",
CLOSE: "close",
DOCU: "docu"
},
node: {
CURSELECTED: "curSelectedNode"
}
},
//default setting of core
_setting = {
treeId: "",
treeObj: null,
view: {
addDiyDom: null,
autoCancelSelected: true,
dblClickExpand: true,
expandSpeed: "fast",
fontCss: {},
nameIsHTML: false,
selectedMulti: true,
showIcon: true,
showLine: true,
showTitle: true,
txtSelectedEnable: false
},
data: {
key: {
children: "children",
name: "name",
title: "",
url: "url"
},
simpleData: {
enable: false,
idKey: "id",
pIdKey: "pId",
rootPId: null
},
keep: {
parent: false,
leaf: false
}
},
async: {
enable: false,
contentType: "application/x-www-form-urlencoded",
type: "post",
dataType: "text",
url: "",
autoParam: [],
otherParam: [],
dataFilter: null
},
callback: {
beforeAsync:null,
beforeClick:null,
beforeDblClick:null,
beforeRightClick:null,
beforeMouseDown:null,
beforeMouseUp:null,
beforeExpand:null,
beforeCollapse:null,
beforeRemove:null,
onAsyncError:null,
onAsyncSuccess:null,
onNodeCreated:null,
onClick:null,
onDblClick:null,
onRightClick:null,
onMouseDown:null,
onMouseUp:null,
onExpand:null,
onCollapse:null,
onRemove:null
}
},
//default root of core
//zTree use root to save full data
_initRoot = function (setting) {
var r = data.getRoot(setting);
if (!r) {
r = {};
data.setRoot(setting, r);
}
r[setting.data.key.children] = [];
r.expandTriggerFlag = false;
r.curSelectedList = [];
r.noSelection = true;
r.createdNodes = [];
r.zId = 0;
r._ver = (new Date()).getTime();
},
//default cache of core
_initCache = function(setting) {
var c = data.getCache(setting);
if (!c) {
c = {};
data.setCache(setting, c);
}
c.nodes = [];
c.doms = [];
},
//default bindEvent of core
_bindEvent = function(setting) {
var o = setting.treeObj,
c = consts.event;
o.bind(c.NODECREATED, function (event, treeId, node) {
tools.apply(setting.callback.onNodeCreated, [event, treeId, node]);
});
o.bind(c.CLICK, function (event, srcEvent, treeId, node, clickFlag) {
tools.apply(setting.callback.onClick, [srcEvent, treeId, node, clickFlag]);
});
o.bind(c.EXPAND, function (event, treeId, node) {
tools.apply(setting.callback.onExpand, [event, treeId, node]);
});
o.bind(c.COLLAPSE, function (event, treeId, node) {
tools.apply(setting.callback.onCollapse, [event, treeId, node]);
});
o.bind(c.ASYNC_SUCCESS, function (event, treeId, node, msg) {
tools.apply(setting.callback.onAsyncSuccess, [event, treeId, node, msg]);
});
o.bind(c.ASYNC_ERROR, function (event, treeId, node, XMLHttpRequest, textStatus, errorThrown) {
tools.apply(setting.callback.onAsyncError, [event, treeId, node, XMLHttpRequest, textStatus, errorThrown]);
});
o.bind(c.REMOVE, function (event, treeId, treeNode) {
tools.apply(setting.callback.onRemove, [event, treeId, treeNode]);
});
o.bind(c.SELECTED, function (event, srcEvent, treeId, node) {
tools.apply(setting.callback.onSelected, [srcEvent, treeId, node]);
});
o.bind(c.UNSELECTED, function (event, srcEvent, treeId, node) {
tools.apply(setting.callback.onUnSelected, [srcEvent, treeId, node]);
});
},
_unbindEvent = function(setting) {
var o = setting.treeObj,
c = consts.event;
o.unbind(c.NODECREATED)
.unbind(c.CLICK)
.unbind(c.EXPAND)
.unbind(c.COLLAPSE)
.unbind(c.ASYNC_SUCCESS)
.unbind(c.ASYNC_ERROR)
.unbind(c.REMOVE)
.unbind(c.SELECTED)
.unbind(c.UNSELECTED);
},
//default event proxy of core
_eventProxy = function(event) {
var target = event.target,
setting = data.getSetting(event.data.treeId),
tId = "", node = null,
nodeEventType = "", treeEventType = "",
nodeEventCallback = null, treeEventCallback = null,
tmp = null;
if (tools.eqs(event.type, "mousedown")) {
treeEventType = "mousedown";
} else if (tools.eqs(event.type, "mouseup")) {
treeEventType = "mouseup";
} else if (tools.eqs(event.type, "contextmenu")) {
treeEventType = "contextmenu";
} else if (tools.eqs(event.type, "click")) {
if (tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.SWITCH) !== null) {
tId = tools.getNodeMainDom(target).id;
nodeEventType = "switchNode";
} else {
tmp = tools.getMDom(setting, target, [{tagName:"a", attrName:"treeNode"+consts.id.A}]);
if (tmp) {
tId = tools.getNodeMainDom(tmp).id;
nodeEventType = "clickNode";
}
}
} else if (tools.eqs(event.type, "dblclick")) {
treeEventType = "dblclick";
tmp = tools.getMDom(setting, target, [{tagName:"a", attrName:"treeNode"+consts.id.A}]);
if (tmp) {
tId = tools.getNodeMainDom(tmp).id;
nodeEventType = "switchNode";
}
}
if (treeEventType.length > 0 && tId.length == 0) {
tmp = tools.getMDom(setting, target, [{tagName:"a", attrName:"treeNode"+consts.id.A}]);
if (tmp) {tId = tools.getNodeMainDom(tmp).id;}
}
// event to node
if (tId.length>0) {
node = data.getNodeCache(setting, tId);
switch (nodeEventType) {
case "switchNode" :
if (!node.isParent) {
nodeEventType = "";
} else if (tools.eqs(event.type, "click")
|| (tools.eqs(event.type, "dblclick") && tools.apply(setting.view.dblClickExpand, [setting.treeId, node], setting.view.dblClickExpand))) {
nodeEventCallback = handler.onSwitchNode;
} else {
nodeEventType = "";
}
break;
case "clickNode" :
nodeEventCallback = handler.onClickNode;
break;
}
}
// event to zTree
switch (treeEventType) {
case "mousedown" :
treeEventCallback = handler.onZTreeMousedown;
break;
case "mouseup" :
treeEventCallback = handler.onZTreeMouseup;
break;
case "dblclick" :
treeEventCallback = handler.onZTreeDblclick;
break;
case "contextmenu" :
treeEventCallback = handler.onZTreeContextmenu;
break;
}
var proxyResult = {
stop: false,
node: node,
nodeEventType: nodeEventType,
nodeEventCallback: nodeEventCallback,
treeEventType: treeEventType,
treeEventCallback: treeEventCallback
};
return proxyResult
},
//default init node of core
_initNode = function(setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) {
if (!n) return;
var r = data.getRoot(setting),
childKey = setting.data.key.children;
n.level = level;
n.tId = setting.treeId + "_" + (++r.zId);
n.parentTId = parentNode ? parentNode.tId : null;
n.open = (typeof n.open == "string") ? tools.eqs(n.open, "true") : !!n.open;
if (n[childKey] && n[childKey].length > 0) {
n.isParent = true;
n.zAsync = true;
} else {
n.isParent = (typeof n.isParent == "string") ? tools.eqs(n.isParent, "true") : !!n.isParent;
n.open = (n.isParent && !setting.async.enable) ? n.open : false;
n.zAsync = !n.isParent;
}
n.isFirstNode = isFirstNode;
n.isLastNode = isLastNode;
n.getParentNode = function() {return data.getNodeCache(setting, n.parentTId);};
n.getPreNode = function() {return data.getPreNode(setting, n);};
n.getNextNode = function() {return data.getNextNode(setting, n);};
n.isAjaxing = false;
data.fixPIdKeyValue(setting, n);
},
_init = {
bind: [_bindEvent],
unbind: [_unbindEvent],
caches: [_initCache],
nodes: [_initNode],
proxys: [_eventProxy],
roots: [_initRoot],
beforeA: [],
afterA: [],
innerBeforeA: [],
innerAfterA: [],
zTreeTools: []
},
//method of operate data
data = {
addNodeCache: function(setting, node) {
data.getCache(setting).nodes[data.getNodeCacheId(node.tId)] = node;
},
getNodeCacheId: function(tId) {
return tId.substring(tId.lastIndexOf("_")+1);
},
addAfterA: function(afterA) {
_init.afterA.push(afterA);
},
addBeforeA: function(beforeA) {
_init.beforeA.push(beforeA);
},
addInnerAfterA: function(innerAfterA) {
_init.innerAfterA.push(innerAfterA);
},
addInnerBeforeA: function(innerBeforeA) {
_init.innerBeforeA.push(innerBeforeA);
},
addInitBind: function(bindEvent) {
_init.bind.push(bindEvent);
},
addInitUnBind: function(unbindEvent) {
_init.unbind.push(unbindEvent);
},
addInitCache: function(initCache) {
_init.caches.push(initCache);
},
addInitNode: function(initNode) {
_init.nodes.push(initNode);
},
addInitProxy: function(initProxy, isFirst) {
if (!!isFirst) {
_init.proxys.splice(0,0,initProxy);
} else {
_init.proxys.push(initProxy);
}
},
addInitRoot: function(initRoot) {
_init.roots.push(initRoot);
},
addNodesData: function(setting, parentNode, nodes) {
var childKey = setting.data.key.children;
if (!parentNode[childKey]) parentNode[childKey] = [];
if (parentNode[childKey].length > 0) {
parentNode[childKey][parentNode[childKey].length - 1].isLastNode = false;
view.setNodeLineIcos(setting, parentNode[childKey][parentNode[childKey].length - 1]);
}
parentNode.isParent = true;
parentNode[childKey] = parentNode[childKey].concat(nodes);
},
addSelectedNode: function(setting, node) {
var root = data.getRoot(setting);
if (!data.isSelectedNode(setting, node)) {
root.curSelectedList.push(node);
}
},
addCreatedNode: function(setting, node) {
if (!!setting.callback.onNodeCreated || !!setting.view.addDiyDom) {
var root = data.getRoot(setting);
root.createdNodes.push(node);
}
},
addZTreeTools: function(zTreeTools) {
_init.zTreeTools.push(zTreeTools);
},
exSetting: function(s) {
$.extend(true, _setting, s);
},
fixPIdKeyValue: function(setting, node) {
if (setting.data.simpleData.enable) {
node[setting.data.simpleData.pIdKey] = node.parentTId ? node.getParentNode()[setting.data.simpleData.idKey] : setting.data.simpleData.rootPId;
}
},
getAfterA: function(setting, node, array) {
for (var i=0, j=_init.afterA.length; i<j; i++) {
_init.afterA[i].apply(this, arguments);
}
},
getBeforeA: function(setting, node, array) {
for (var i=0, j=_init.beforeA.length; i<j; i++) {
_init.beforeA[i].apply(this, arguments);
}
},
getInnerAfterA: function(setting, node, array) {
for (var i=0, j=_init.innerAfterA.length; i<j; i++) {
_init.innerAfterA[i].apply(this, arguments);
}
},
getInnerBeforeA: function(setting, node, array) {
for (var i=0, j=_init.innerBeforeA.length; i<j; i++) {
_init.innerBeforeA[i].apply(this, arguments);
}
},
getCache: function(setting) {
return caches[setting.treeId];
},
getNextNode: function(setting, node) {
if (!node) return null;
var childKey = setting.data.key.children,
p = node.parentTId ? node.getParentNode() : data.getRoot(setting);
for (var i=0, l=p[childKey].length-1; i<=l; i++) {
if (p[childKey][i] === node) {
return (i==l ? null : p[childKey][i+1]);
}
}
return null;
},
getNodeByParam: function(setting, nodes, key, value) {
if (!nodes || !key) return null;
var childKey = setting.data.key.children;
for (var i = 0, l = nodes.length; i < l; i++) {
if (nodes[i][key] == value) {
return nodes[i];
}
var tmp = data.getNodeByParam(setting, nodes[i][childKey], key, value);
if (tmp) return tmp;
}
return null;
},
getNodeCache: function(setting, tId) {
if (!tId) return null;
var n = caches[setting.treeId].nodes[data.getNodeCacheId(tId)];
return n ? n : null;
},
getNodeName: function(setting, node) {
var nameKey = setting.data.key.name;
return "" + node[nameKey];
},
getNodeTitle: function(setting, node) {
var t = setting.data.key.title === "" ? setting.data.key.name : setting.data.key.title;
return "" + node[t];
},
getNodes: function(setting) {
return data.getRoot(setting)[setting.data.key.children];
},
getNodesByParam: function(setting, nodes, key, value) {
if (!nodes || !key) return [];
var childKey = setting.data.key.children,
result = [];
for (var i = 0, l = nodes.length; i < l; i++) {
if (nodes[i][key] == value) {
result.push(nodes[i]);
}
result = result.concat(data.getNodesByParam(setting, nodes[i][childKey], key, value));
}
return result;
},
getNodesByParamFuzzy: function(setting, nodes, key, value) {
if (!nodes || !key) return [];
var childKey = setting.data.key.children,
result = [];
value = value.toLowerCase();
for (var i = 0, l = nodes.length; i < l; i++) {
if (typeof nodes[i][key] == "string" && nodes[i][key].toLowerCase().indexOf(value)>-1) {
result.push(nodes[i]);
}
result = result.concat(data.getNodesByParamFuzzy(setting, nodes[i][childKey], key, value));
}
return result;
},
getNodesByFilter: function(setting, nodes, filter, isSingle, invokeParam) {
if (!nodes) return (isSingle ? null : []);
var childKey = setting.data.key.children,
result = isSingle ? null : [];
for (var i = 0, l = nodes.length; i < l; i++) {
if (tools.apply(filter, [nodes[i], invokeParam], false)) {
if (isSingle) {return nodes[i];}
result.push(nodes[i]);
}
var tmpResult = data.getNodesByFilter(setting, nodes[i][childKey], filter, isSingle, invokeParam);
if (isSingle && !!tmpResult) {return tmpResult;}
result = isSingle ? tmpResult : result.concat(tmpResult);
}
return result;
},
getPreNode: function(setting, node) {
if (!node) return null;
var childKey = setting.data.key.children,
p = node.parentTId ? node.getParentNode() : data.getRoot(setting);
for (var i=0, l=p[childKey].length; i<l; i++) {
if (p[childKey][i] === node) {
return (i==0 ? null : p[childKey][i-1]);
}
}
return null;
},
getRoot: function(setting) {
return setting ? roots[setting.treeId] : null;
},
getRoots: function() {
return roots;
},
getSetting: function(treeId) {
return settings[treeId];
},
getSettings: function() {
return settings;
},
getZTreeTools: function(treeId) {
var r = this.getRoot(this.getSetting(treeId));
return r ? r.treeTools : null;
},
initCache: function(setting) {
for (var i=0, j=_init.caches.length; i<j; i++) {
_init.caches[i].apply(this, arguments);
}
},
initNode: function(setting, level, node, parentNode, preNode, nextNode) {
for (var i=0, j=_init.nodes.length; i<j; i++) {
_init.nodes[i].apply(this, arguments);
}
},
initRoot: function(setting) {
for (var i=0, j=_init.roots.length; i<j; i++) {
_init.roots[i].apply(this, arguments);
}
},
isSelectedNode: function(setting, node) {
var root = data.getRoot(setting);
for (var i=0, j=root.curSelectedList.length; i<j; i++) {
if(node === root.curSelectedList[i]) return true;
}
return false;
},
removeNodeCache: function(setting, node) {
var childKey = setting.data.key.children;
if (node[childKey]) {
for (var i=0, l=node[childKey].length; i<l; i++) {
arguments.callee(setting, node[childKey][i]);
}
}
data.getCache(setting).nodes[data.getNodeCacheId(node.tId)] = null;
},
removeSelectedNode: function(setting, node) {
var root = data.getRoot(setting);
for (var i=0, j=root.curSelectedList.length; i<j; i++) {
if(node === root.curSelectedList[i] || !data.getNodeCache(setting, root.curSelectedList[i].tId)) {
root.curSelectedList.splice(i, 1);
i--;j--;
}
}
},
setCache: function(setting, cache) {
caches[setting.treeId] = cache;
},
setRoot: function(setting, root) {
roots[setting.treeId] = root;
},
setZTreeTools: function(setting, zTreeTools) {
for (var i=0, j=_init.zTreeTools.length; i<j; i++) {
_init.zTreeTools[i].apply(this, arguments);
}
},
transformToArrayFormat: function (setting, nodes) {
if (!nodes) return [];
var childKey = setting.data.key.children,
r = [];
if (tools.isArray(nodes)) {
for (var i=0, l=nodes.length; i<l; i++) {
r.push(nodes[i]);
if (nodes[i][childKey])
r = r.concat(data.transformToArrayFormat(setting, nodes[i][childKey]));
}
} else {
r.push(nodes);
if (nodes[childKey])
r = r.concat(data.transformToArrayFormat(setting, nodes[childKey]));
}
return r;
},
transformTozTreeFormat: function(setting, sNodes) {
var i,l,
key = setting.data.simpleData.idKey,
parentKey = setting.data.simpleData.pIdKey,
childKey = setting.data.key.children;
if (!key || key=="" || !sNodes) return [];
if (tools.isArray(sNodes)) {
var r = [];
var tmpMap = {};
for (i=0, l=sNodes.length; i<l; i++) {
tmpMap[sNodes[i][key]] = sNodes[i];
}
for (i=0, l=sNodes.length; i<l; i++) {
if (tmpMap[sNodes[i][parentKey]] && sNodes[i][key] != sNodes[i][parentKey]) {
if (!tmpMap[sNodes[i][parentKey]][childKey])
tmpMap[sNodes[i][parentKey]][childKey] = [];
tmpMap[sNodes[i][parentKey]][childKey].push(sNodes[i]);
} else {
r.push(sNodes[i]);
}
}
return r;
}else {
return [sNodes];
}
}
},
//method of event proxy
event = {
bindEvent: function(setting) {
for (var i=0, j=_init.bind.length; i<j; i++) {
_init.bind[i].apply(this, arguments);
}
},
unbindEvent: function(setting) {
for (var i=0, j=_init.unbind.length; i<j; i++) {
_init.unbind[i].apply(this, arguments);
}
},
bindTree: function(setting) {
var eventParam = {
treeId: setting.treeId
},
o = setting.treeObj;
if (!setting.view.txtSelectedEnable) {
// for can't select text
o.bind('selectstart', function(e){
var node
var n = e.originalEvent.srcElement.nodeName.toLowerCase();
return (n === "input" || n === "textarea" );
}).css({
"-moz-user-select":"-moz-none"
});
}
o.bind('click', eventParam, event.proxy);
o.bind('dblclick', eventParam, event.proxy);
o.bind('mouseover', eventParam, event.proxy);
o.bind('mouseout', eventParam, event.proxy);
o.bind('mousedown', eventParam, event.proxy);
o.bind('mouseup', eventParam, event.proxy);
o.bind('contextmenu', eventParam, event.proxy);
},
unbindTree: function(setting) {
var o = setting.treeObj;
o.unbind('click', event.proxy)
.unbind('dblclick', event.proxy)
.unbind('mouseover', event.proxy)
.unbind('mouseout', event.proxy)
.unbind('mousedown', event.proxy)
.unbind('mouseup', event.proxy)
.unbind('contextmenu', event.proxy);
},
doProxy: function(e) {
var results = [];
for (var i=0, j=_init.proxys.length; i<j; i++) {
var proxyResult = _init.proxys[i].apply(this, arguments);
results.push(proxyResult);
if (proxyResult.stop) {
break;
}
}
return results;
},
proxy: function(e) {
var setting = data.getSetting(e.data.treeId);
if (!tools.uCanDo(setting, e)) return true;
var results = event.doProxy(e),
r = true, x = false;
for (var i=0, l=results.length; i<l; i++) {
var proxyResult = results[i];
if (proxyResult.nodeEventCallback) {
x = true;
r = proxyResult.nodeEventCallback.apply(proxyResult, [e, proxyResult.node]) && r;
}
if (proxyResult.treeEventCallback) {
x = true;
r = proxyResult.treeEventCallback.apply(proxyResult, [e, proxyResult.node]) && r;
}
}
return r;
}
},
//method of event handler
handler = {
onSwitchNode: function (event, node) {
var setting = data.getSetting(event.data.treeId);
if (node.open) {
if (tools.apply(setting.callback.beforeCollapse, [setting.treeId, node], true) == false) return true;
data.getRoot(setting).expandTriggerFlag = true;
view.switchNode(setting, node);
} else {
if (tools.apply(setting.callback.beforeExpand, [setting.treeId, node], true) == false) return true;
data.getRoot(setting).expandTriggerFlag = true;
view.switchNode(setting, node);
}
return true;
},
onClickNode: function (event, node) {
var setting = data.getSetting(event.data.treeId),
clickFlag = ( (setting.view.autoCancelSelected && (event.ctrlKey || event.metaKey)) && data.isSelectedNode(setting, node)) ? 0 : (setting.view.autoCancelSelected && (event.ctrlKey || event.metaKey) && setting.view.selectedMulti) ? 2 : 1;
if (tools.apply(setting.callback.beforeClick, [setting.treeId, node, clickFlag], true) == false) return true;
if (clickFlag === 0) {
view.cancelPreSelectedNode(setting, node);
} else {
view.selectNode(setting, node, clickFlag === 2);
}
setting.treeObj.trigger(consts.event.CLICK, [event, setting.treeId, node, clickFlag]);
return true;
},
onZTreeMousedown: function(event, node) {
var setting = data.getSetting(event.data.treeId);
if (tools.apply(setting.callback.beforeMouseDown, [setting.treeId, node], true)) {
tools.apply(setting.callback.onMouseDown, [event, setting.treeId, node]);
}
return true;
},
onZTreeMouseup: function(event, node) {
var setting = data.getSetting(event.data.treeId);
if (tools.apply(setting.callback.beforeMouseUp, [setting.treeId, node], true)) {
tools.apply(setting.callback.onMouseUp, [event, setting.treeId, node]);
}
return true;
},
onZTreeDblclick: function(event, node) {
var setting = data.getSetting(event.data.treeId);
if (tools.apply(setting.callback.beforeDblClick, [setting.treeId, node], true)) {
tools.apply(setting.callback.onDblClick, [event, setting.treeId, node]);
}
return true;
},
onZTreeContextmenu: function(event, node) {
var setting = data.getSetting(event.data.treeId);
if (tools.apply(setting.callback.beforeRightClick, [setting.treeId, node], true)) {
tools.apply(setting.callback.onRightClick, [event, setting.treeId, node]);
}
return (typeof setting.callback.onRightClick) != "function";
}
},
//method of tools for zTree
tools = {
apply: function(fun, param, defaultValue) {
if ((typeof fun) == "function") {
return fun.apply(zt, param?param:[]);
}
return defaultValue;
},
canAsync: function(setting, node) {
var childKey = setting.data.key.children;
return (setting.async.enable && node && node.isParent && !(node.zAsync || (node[childKey] && node[childKey].length > 0)));
},
clone: function (obj){
if (obj === null) return null;
var o = tools.isArray(obj) ? [] : {};
for(var i in obj){
o[i] = (obj[i] instanceof Date) ? new Date(obj[i].getTime()) : (typeof obj[i] === "object" ? arguments.callee(obj[i]) : obj[i]);
}
return o;
},
eqs: function(str1, str2) {
return str1.toLowerCase() === str2.toLowerCase();
},
isArray: function(arr) {
return Object.prototype.toString.apply(arr) === "[object Array]";
},
$: function(node, exp, setting) {
if (!!exp && typeof exp != "string") {
setting = exp;
exp = "";
}
if (typeof node == "string") {
return $(node, setting ? setting.treeObj.get(0).ownerDocument : null);
} else {
return $("#" + node.tId + exp, setting ? setting.treeObj : null);
}
},
getMDom: function (setting, curDom, targetExpr) {
if (!curDom) return null;
while (curDom && curDom.id !== setting.treeId) {
for (var i=0, l=targetExpr.length; curDom.tagName && i<l; i++) {
if (tools.eqs(curDom.tagName, targetExpr[i].tagName) && curDom.getAttribute(targetExpr[i].attrName) !== null) {
return curDom;
}
}
curDom = curDom.parentNode;
}
return null;
},
getNodeMainDom:function(target) {
return ($(target).parent("li").get(0) || $(target).parentsUntil("li").parent().get(0));
},
isChildOrSelf: function(dom, parentId) {
return ( $(dom).closest("#" + parentId).length> 0 );
},
uCanDo: function(setting, e) {
return true;
}
},
//method of operate ztree dom
view = {
addNodes: function(setting, parentNode, newNodes, isSilent) {
if (setting.data.keep.leaf && parentNode && !parentNode.isParent) {
return;
}
if (!tools.isArray(newNodes)) {
newNodes = [newNodes];
}
if (setting.data.simpleData.enable) {
newNodes = data.transformTozTreeFormat(setting, newNodes);
}
if (parentNode) {
var target_switchObj = $$(parentNode, consts.id.SWITCH, setting),
target_icoObj = $$(parentNode, consts.id.ICON, setting),
target_ulObj = $$(parentNode, consts.id.UL, setting);
if (!parentNode.open) {
view.replaceSwitchClass(parentNode, target_switchObj, consts.folder.CLOSE);
view.replaceIcoClass(parentNode, target_icoObj, consts.folder.CLOSE);
parentNode.open = false;
target_ulObj.css({
"display": "none"
});
}
data.addNodesData(setting, parentNode, newNodes);
view.createNodes(setting, parentNode.level + 1, newNodes, parentNode);
if (!isSilent) {
view.expandCollapseParentNode(setting, parentNode, true);
}
} else {
data.addNodesData(setting, data.getRoot(setting), newNodes);
view.createNodes(setting, 0, newNodes, null);
}
},
appendNodes: function(setting, level, nodes, parentNode, initFlag, openFlag) {
if (!nodes) return [];
var html = [],
childKey = setting.data.key.children;
for (var i = 0, l = nodes.length; i < l; i++) {
var node = nodes[i];
if (initFlag) {
var tmpPNode = (parentNode) ? parentNode: data.getRoot(setting),
tmpPChild = tmpPNode[childKey],
isFirstNode = ((tmpPChild.length == nodes.length) && (i == 0)),
isLastNode = (i == (nodes.length - 1));
data.initNode(setting, level, node, parentNode, isFirstNode, isLastNode, openFlag);
data.addNodeCache(setting, node);
}
var childHtml = [];
if (node[childKey] && node[childKey].length > 0) {
//make child html first, because checkType
childHtml = view.appendNodes(setting, level + 1, node[childKey], node, initFlag, openFlag && node.open);
}
if (openFlag) {
view.makeDOMNodeMainBefore(html, setting, node);
view.makeDOMNodeLine(html, setting, node);
data.getBeforeA(setting, node, html);
view.makeDOMNodeNameBefore(html, setting, node);
data.getInnerBeforeA(setting, node, html);
view.makeDOMNodeIcon(html, setting, node);
data.getInnerAfterA(setting, node, html);
view.makeDOMNodeNameAfter(html, setting, node);
data.getAfterA(setting, node, html);
if (node.isParent && node.open) {
view.makeUlHtml(setting, node, html, childHtml.join(''));
}
view.makeDOMNodeMainAfter(html, setting, node);
data.addCreatedNode(setting, node);
}
}
return html;
},
appendParentULDom: function(setting, node) {
var html = [],
nObj = $$(node, setting);
if (!nObj.get(0) && !!node.parentTId) {
view.appendParentULDom(setting, node.getParentNode());
nObj = $$(node, setting);
}
var ulObj = $$(node, consts.id.UL, setting);
if (ulObj.get(0)) {
ulObj.remove();
}
var childKey = setting.data.key.children,
childHtml = view.appendNodes(setting, node.level+1, node[childKey], node, false, true);
view.makeUlHtml(setting, node, html, childHtml.join(''));
nObj.append(html.join(''));
},
asyncNode: function(setting, node, isSilent, callback) {
var i, l;
if (node && !node.isParent) {
tools.apply(callback);
return false;
} else if (node && node.isAjaxing) {
return false;
} else if (tools.apply(setting.callback.beforeAsync, [setting.treeId, node], true) == false) {
tools.apply(callback);
return false;
}
if (node) {
node.isAjaxing = true;
var icoObj = $$(node, consts.id.ICON, setting);
icoObj.attr({"style":"", "class":consts.className.BUTTON + " " + consts.className.ICO_LOADING});
}
var tmpParam = {};
for (i = 0, l = setting.async.autoParam.length; node && i < l; i++) {
var pKey = setting.async.autoParam[i].split("="), spKey = pKey;
if (pKey.length>1) {
spKey = pKey[1];
pKey = pKey[0];
}
tmpParam[spKey] = node[pKey];
}
if (tools.isArray(setting.async.otherParam)) {
for (i = 0, l = setting.async.otherParam.length; i < l; i += 2) {
tmpParam[setting.async.otherParam[i]] = setting.async.otherParam[i + 1];
}
} else {
for (var p in setting.async.otherParam) {
tmpParam[p] = setting.async.otherParam[p];
}
}
var _tmpV = data.getRoot(setting)._ver;
$.ajax({
contentType: setting.async.contentType,
cache: false,
type: setting.async.type,
url: tools.apply(setting.async.url, [setting.treeId, node], setting.async.url),
data: tmpParam,
dataType: setting.async.dataType,
success: function(msg) {
if (_tmpV != data.getRoot(setting)._ver) {
return;
}
var newNodes = [];
try {
if (!msg || msg.length == 0) {
newNodes = [];
} else if (typeof msg == "string") {
newNodes = eval("(" + msg + ")");
} else {
newNodes = msg;
}
} catch(err) {
newNodes = msg;
}
if (node) {
node.isAjaxing = null;
node.zAsync = true;
}
view.setNodeLineIcos(setting, node);
if (newNodes && newNodes !== "") {
newNodes = tools.apply(setting.async.dataFilter, [setting.treeId, node, newNodes], newNodes);
view.addNodes(setting, node, !!newNodes ? tools.clone(newNodes) : [], !!isSilent);
} else {
view.addNodes(setting, node, [], !!isSilent);
}
setting.treeObj.trigger(consts.event.ASYNC_SUCCESS, [setting.treeId, node, msg]);
tools.apply(callback);
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
if (_tmpV != data.getRoot(setting)._ver) {
return;
}
if (node) node.isAjaxing = null;
view.setNodeLineIcos(setting, node);
setting.treeObj.trigger(consts.event.ASYNC_ERROR, [setting.treeId, node, XMLHttpRequest, textStatus, errorThrown]);
}
});
return true;
},
cancelPreSelectedNode: function (setting, node, excludeNode) {
var list = data.getRoot(setting).curSelectedList,
i, n;
for (i=list.length-1; i>=0; i--) {
n = list[i];
if (node === n || (!node && (!excludeNode || excludeNode !== n))) {
$$(n, consts.id.A, setting).removeClass(consts.node.CURSELECTED);
if (node) {
data.removeSelectedNode(setting, node);
setting.treeObj.trigger(consts.event.UNSELECTED, [event, setting.treeId, n]);
break;
} else {
list.splice(i, 1);
setting.treeObj.trigger(consts.event.UNSELECTED, [event, setting.treeId, n]);
}
}
}
},
createNodeCallback: function(setting) {
if (!!setting.callback.onNodeCreated || !!setting.view.addDiyDom) {
var root = data.getRoot(setting);
while (root.createdNodes.length>0) {
var node = root.createdNodes.shift();
tools.apply(setting.view.addDiyDom, [setting.treeId, node]);
if (!!setting.callback.onNodeCreated) {
setting.treeObj.trigger(consts.event.NODECREATED, [setting.treeId, node]);
}
}
}
},
createNodes: function(setting, level, nodes, parentNode) {
if (!nodes || nodes.length == 0) return;
var root = data.getRoot(setting),
childKey = setting.data.key.children,
openFlag = !parentNode || parentNode.open || !!$$(parentNode[childKey][0], setting).get(0);
root.createdNodes = [];
var zTreeHtml = view.appendNodes(setting, level, nodes, parentNode, true, openFlag);
if (!parentNode) {
setting.treeObj.append(zTreeHtml.join(''));
} else {
var ulObj = $$(parentNode, consts.id.UL, setting);
if (ulObj.get(0)) {
ulObj.append(zTreeHtml.join(''));
}
}
view.createNodeCallback(setting);
},
destroy: function(setting) {
if (!setting) return;
data.initCache(setting);
data.initRoot(setting);
event.unbindTree(setting);
event.unbindEvent(setting);
setting.treeObj.empty();
delete settings[setting.treeId];
},
expandCollapseNode: function(setting, node, expandFlag, animateFlag, callback) {
var root = data.getRoot(setting),
childKey = setting.data.key.children;
if (!node) {
tools.apply(callback, []);
return;
}
if (root.expandTriggerFlag) {
var _callback = callback;
callback = function(){
if (_callback) _callback();
if (node.open) {
setting.treeObj.trigger(consts.event.EXPAND, [setting.treeId, node]);
} else {
setting.treeObj.trigger(consts.event.COLLAPSE, [setting.treeId, node]);
}
};
root.expandTriggerFlag = false;
}
if (!node.open && node.isParent && ((!$$(node, consts.id.UL, setting).get(0)) || (node[childKey] && node[childKey].length>0 && !$$(node[childKey][0], setting).get(0)))) {
view.appendParentULDom(setting, node);
view.createNodeCallback(setting);
}
if (node.open == expandFlag) {
tools.apply(callback, []);
return;
}
var ulObj = $$(node, consts.id.UL, setting),
switchObj = $$(node, consts.id.SWITCH, setting),
icoObj = $$(node, consts.id.ICON, setting);
if (node.isParent) {
node.open = !node.open;
if (node.iconOpen && node.iconClose) {
icoObj.attr("style", view.makeNodeIcoStyle(setting, node));
}
if (node.open) {
view.replaceSwitchClass(node, switchObj, consts.folder.OPEN);
view.replaceIcoClass(node, icoObj, consts.folder.OPEN);
if (animateFlag == false || setting.view.expandSpeed == "") {
ulObj.show();
tools.apply(callback, []);
} else {
if (node[childKey] && node[childKey].length > 0) {
ulObj.slideDown(setting.view.expandSpeed, callback);
} else {
ulObj.show();
tools.apply(callback, []);
}
}
} else {
view.replaceSwitchClass(node, switchObj, consts.folder.CLOSE);
view.replaceIcoClass(node, icoObj, consts.folder.CLOSE);
if (animateFlag == false || setting.view.expandSpeed == "" || !(node[childKey] && node[childKey].length > 0)) {
ulObj.hide();
tools.apply(callback, []);
} else {
ulObj.slideUp(setting.view.expandSpeed, callback);
}
}
} else {
tools.apply(callback, []);
}
},
expandCollapseParentNode: function(setting, node, expandFlag, animateFlag, callback) {
if (!node) return;
if (!node.parentTId) {
view.expandCollapseNode(setting, node, expandFlag, animateFlag, callback);
return;
} else {
view.expandCollapseNode(setting, node, expandFlag, animateFlag);
}
if (node.parentTId) {
view.expandCollapseParentNode(setting, node.getParentNode(), expandFlag, animateFlag, callback);
}
},
expandCollapseSonNode: function(setting, node, expandFlag, animateFlag, callback) {
var root = data.getRoot(setting),
childKey = setting.data.key.children,
treeNodes = (node) ? node[childKey]: root[childKey],
selfAnimateSign = (node) ? false : animateFlag,
expandTriggerFlag = data.getRoot(setting).expandTriggerFlag;
data.getRoot(setting).expandTriggerFlag = false;
if (treeNodes) {
for (var i = 0, l = treeNodes.length; i < l; i++) {
if (treeNodes[i]) view.expandCollapseSonNode(setting, treeNodes[i], expandFlag, selfAnimateSign);
}
}
data.getRoot(setting).expandTriggerFlag = expandTriggerFlag;
view.expandCollapseNode(setting, node, expandFlag, animateFlag, callback );
},
isSelectedNode: function (setting, node) {
if (!node) {
return false;
}
var list = data.getRoot(setting).curSelectedList,
i;
for (i=list.length-1; i>=0; i--) {
if (node === list[i]) {
return true;
}
}
return false;
},
makeDOMNodeIcon: function(html, setting, node) {
var nameStr = data.getNodeName(setting, node),
name = setting.view.nameIsHTML ? nameStr : nameStr.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
html.push("<span id='", node.tId, consts.id.ICON,
"' title='' treeNode", consts.id.ICON," class='", view.makeNodeIcoClass(setting, node),
"' style='", view.makeNodeIcoStyle(setting, node), "'></span><span id='", node.tId, consts.id.SPAN,
"'>",name,"</span>");
},
makeDOMNodeLine: function(html, setting, node) {
html.push("<span id='", node.tId, consts.id.SWITCH, "' title='' class='", view.makeNodeLineClass(setting, node), "' treeNode", consts.id.SWITCH,"></span>");
},
makeDOMNodeMainAfter: function(html, setting, node) {
html.push("</li>");
},
makeDOMNodeMainBefore: function(html, setting, node) {
html.push("<li id='", node.tId, "' class='", consts.className.LEVEL, node.level,"' tabindex='0' hidefocus='true' treenode>");
},
makeDOMNodeNameAfter: function(html, setting, node) {
html.push("</a>");
},
makeDOMNodeNameBefore: function(html, setting, node) {
var title = data.getNodeTitle(setting, node),
url = view.makeNodeUrl(setting, node),
fontcss = view.makeNodeFontCss(setting, node),
fontStyle = [];
for (var f in fontcss) {
fontStyle.push(f, ":", fontcss[f], ";");
}
html.push("<a id='", node.tId, consts.id.A, "' class='", consts.className.LEVEL, node.level,"' treeNode", consts.id.A," onclick=\"", (node.click || ''),
"\" ", ((url != null && url.length > 0) ? "href='" + url + "'" : ""), " target='",view.makeNodeTarget(node),"' style='", fontStyle.join(''),
"'");
if (tools.apply(setting.view.showTitle, [setting.treeId, node], setting.view.showTitle) && title) {html.push("title='", title.replace(/'/g,"&#39;").replace(/</g,'&lt;').replace(/>/g,'&gt;'),"'");}
html.push(">");
},
makeNodeFontCss: function(setting, node) {
var fontCss = tools.apply(setting.view.fontCss, [setting.treeId, node], setting.view.fontCss);
return (fontCss && ((typeof fontCss) != "function")) ? fontCss : {};
},
makeNodeIcoClass: function(setting, node) {
var icoCss = ["ico"];
if (!node.isAjaxing) {
icoCss[0] = (node.iconSkin ? node.iconSkin + "_" : "") + icoCss[0];
if (node.isParent) {
icoCss.push(node.open ? consts.folder.OPEN : consts.folder.CLOSE);
} else {
icoCss.push(consts.folder.DOCU);
}
}
return consts.className.BUTTON + " " + icoCss.join('_');
},
makeNodeIcoStyle: function(setting, node) {
var icoStyle = [];
if (!node.isAjaxing) {
var icon = (node.isParent && node.iconOpen && node.iconClose) ? (node.open ? node.iconOpen : node.iconClose) : node.icon;
if (icon) icoStyle.push("background:url(", icon, ") 0 0 no-repeat;");
if (setting.view.showIcon == false || !tools.apply(setting.view.showIcon, [setting.treeId, node], true)) {
icoStyle.push("width:0px;height:0px;");
}
}
return icoStyle.join('');
},
makeNodeLineClass: function(setting, node) {
var lineClass = [];
if (setting.view.showLine) {
if (node.level == 0 && node.isFirstNode && node.isLastNode) {
lineClass.push(consts.line.ROOT);
} else if (node.level == 0 && node.isFirstNode) {
lineClass.push(consts.line.ROOTS);
} else if (node.isLastNode) {
lineClass.push(consts.line.BOTTOM);
} else {
lineClass.push(consts.line.CENTER);
}
} else {
lineClass.push(consts.line.NOLINE);
}
if (node.isParent) {
lineClass.push(node.open ? consts.folder.OPEN : consts.folder.CLOSE);
} else {
lineClass.push(consts.folder.DOCU);
}
return view.makeNodeLineClassEx(node) + lineClass.join('_');
},
makeNodeLineClassEx: function(node) {
return consts.className.BUTTON + " " + consts.className.LEVEL + node.level + " " + consts.className.SWITCH + " ";
},
makeNodeTarget: function(node) {
return (node.target || "_blank");
},
makeNodeUrl: function(setting, node) {
var urlKey = setting.data.key.url;
return node[urlKey] ? node[urlKey] : null;
},
makeUlHtml: function(setting, node, html, content) {
html.push("<ul id='", node.tId, consts.id.UL, "' class='", consts.className.LEVEL, node.level, " ", view.makeUlLineClass(setting, node), "' style='display:", (node.open ? "block": "none"),"'>");
html.push(content);
html.push("</ul>");
},
makeUlLineClass: function(setting, node) {
return ((setting.view.showLine && !node.isLastNode) ? consts.line.LINE : "");
},
removeChildNodes: function(setting, node) {
if (!node) return;
var childKey = setting.data.key.children,
nodes = node[childKey];
if (!nodes) return;
for (var i = 0, l = nodes.length; i < l; i++) {
data.removeNodeCache(setting, nodes[i]);
}
data.removeSelectedNode(setting);
delete node[childKey];
if (!setting.data.keep.parent) {
node.isParent = false;
node.open = false;
var tmp_switchObj = $$(node, consts.id.SWITCH, setting),
tmp_icoObj = $$(node, consts.id.ICON, setting);
view.replaceSwitchClass(node, tmp_switchObj, consts.folder.DOCU);
view.replaceIcoClass(node, tmp_icoObj, consts.folder.DOCU);
$$(node, consts.id.UL, setting).remove();
} else {
$$(node, consts.id.UL, setting).empty();
}
},
setFirstNode: function(setting, parentNode) {
var childKey = setting.data.key.children, childLength = parentNode[childKey].length;
if ( childLength > 0) {
parentNode[childKey][0].isFirstNode = true;
}
},
setLastNode: function(setting, parentNode) {
var childKey = setting.data.key.children, childLength = parentNode[childKey].length;
if ( childLength > 0) {
parentNode[childKey][childLength - 1].isLastNode = true;
}
},
removeNode: function(setting, node) {
var root = data.getRoot(setting),
childKey = setting.data.key.children,
parentNode = (node.parentTId) ? node.getParentNode() : root;
node.isFirstNode = false;
node.isLastNode = false;
node.getPreNode = function() {return null;};
node.getNextNode = function() {return null;};
if (!data.getNodeCache(setting, node.tId)) {
return;
}
$$(node, setting).remove();
data.removeNodeCache(setting, node);
data.removeSelectedNode(setting, node);
for (var i = 0, l = parentNode[childKey].length; i < l; i++) {
if (parentNode[childKey][i].tId == node.tId) {
parentNode[childKey].splice(i, 1);
break;
}
}
view.setFirstNode(setting, parentNode);
view.setLastNode(setting, parentNode);
var tmp_ulObj,tmp_switchObj,tmp_icoObj,
childLength = parentNode[childKey].length;
//repair nodes old parent
if (!setting.data.keep.parent && childLength == 0) {
//old parentNode has no child nodes
parentNode.isParent = false;
parentNode.open = false;
tmp_ulObj = $$(parentNode, consts.id.UL, setting);
tmp_switchObj = $$(parentNode, consts.id.SWITCH, setting);
tmp_icoObj = $$(parentNode, consts.id.ICON, setting);
view.replaceSwitchClass(parentNode, tmp_switchObj, consts.folder.DOCU);
view.replaceIcoClass(parentNode, tmp_icoObj, consts.folder.DOCU);
tmp_ulObj.css("display", "none");
} else if (setting.view.showLine && childLength > 0) {
//old parentNode has child nodes
var newLast = parentNode[childKey][childLength - 1];
tmp_ulObj = $$(newLast, consts.id.UL, setting);
tmp_switchObj = $$(newLast, consts.id.SWITCH, setting);
tmp_icoObj = $$(newLast, consts.id.ICON, setting);
if (parentNode == root) {
if (parentNode[childKey].length == 1) {
//node was root, and ztree has only one root after move node
view.replaceSwitchClass(newLast, tmp_switchObj, consts.line.ROOT);
} else {
var tmp_first_switchObj = $$(parentNode[childKey][0], consts.id.SWITCH, setting);
view.replaceSwitchClass(parentNode[childKey][0], tmp_first_switchObj, consts.line.ROOTS);
view.replaceSwitchClass(newLast, tmp_switchObj, consts.line.BOTTOM);
}
} else {
view.replaceSwitchClass(newLast, tmp_switchObj, consts.line.BOTTOM);
}
tmp_ulObj.removeClass(consts.line.LINE);
}
},
replaceIcoClass: function(node, obj, newName) {
if (!obj || node.isAjaxing) return;
var tmpName = obj.attr("class");
if (tmpName == undefined) return;
var tmpList = tmpName.split("_");
switch (newName) {
case consts.folder.OPEN:
case consts.folder.CLOSE:
case consts.folder.DOCU:
tmpList[tmpList.length-1] = newName;
break;
}
obj.attr("class", tmpList.join("_"));
},
replaceSwitchClass: function(node, obj, newName) {
if (!obj) return;
var tmpName = obj.attr("class");
if (tmpName == undefined) return;
var tmpList = tmpName.split("_");
switch (newName) {
case consts.line.ROOT:
case consts.line.ROOTS:
case consts.line.CENTER:
case consts.line.BOTTOM:
case consts.line.NOLINE:
tmpList[0] = view.makeNodeLineClassEx(node) + newName;
break;
case consts.folder.OPEN:
case consts.folder.CLOSE:
case consts.folder.DOCU:
tmpList[1] = newName;
break;
}
obj.attr("class", tmpList.join("_"));
if (newName !== consts.folder.DOCU) {
obj.removeAttr("disabled");
} else {
obj.attr("disabled", "disabled");
}
},
selectNode: function(setting, node, addFlag) {
if (!addFlag) {
view.cancelPreSelectedNode(setting, null, node);
}
$$(node, consts.id.A, setting).addClass(consts.node.CURSELECTED);
data.addSelectedNode(setting, node);
setting.treeObj.trigger(consts.event.SELECTED, [event, setting.treeId, node]);
},
setNodeFontCss: function(setting, treeNode) {
var aObj = $$(treeNode, consts.id.A, setting),
fontCss = view.makeNodeFontCss(setting, treeNode);
if (fontCss) {
aObj.css(fontCss);
}
},
setNodeLineIcos: function(setting, node) {
if (!node) return;
var switchObj = $$(node, consts.id.SWITCH, setting),
ulObj = $$(node, consts.id.UL, setting),
icoObj = $$(node, consts.id.ICON, setting),
ulLine = view.makeUlLineClass(setting, node);
if (ulLine.length==0) {
ulObj.removeClass(consts.line.LINE);
} else {
ulObj.addClass(ulLine);
}
switchObj.attr("class", view.makeNodeLineClass(setting, node));
if (node.isParent) {
switchObj.removeAttr("disabled");
} else {
switchObj.attr("disabled", "disabled");
}
icoObj.removeAttr("style");
icoObj.attr("style", view.makeNodeIcoStyle(setting, node));
icoObj.attr("class", view.makeNodeIcoClass(setting, node));
},
setNodeName: function(setting, node) {
var title = data.getNodeTitle(setting, node),
nObj = $$(node, consts.id.SPAN, setting);
nObj.empty();
if (setting.view.nameIsHTML) {
nObj.html(data.getNodeName(setting, node));
} else {
nObj.text(data.getNodeName(setting, node));
}
if (tools.apply(setting.view.showTitle, [setting.treeId, node], setting.view.showTitle)) {
var aObj = $$(node, consts.id.A, setting);
aObj.attr("title", !title ? "" : title);
}
},
setNodeTarget: function(setting, node) {
var aObj = $$(node, consts.id.A, setting);
aObj.attr("target", view.makeNodeTarget(node));
},
setNodeUrl: function(setting, node) {
var aObj = $$(node, consts.id.A, setting),
url = view.makeNodeUrl(setting, node);
if (url == null || url.length == 0) {
aObj.removeAttr("href");
} else {
aObj.attr("href", url);
}
},
switchNode: function(setting, node) {
if (node.open || !tools.canAsync(setting, node)) {
view.expandCollapseNode(setting, node, !node.open);
} else if (setting.async.enable) {
if (!view.asyncNode(setting, node)) {
view.expandCollapseNode(setting, node, !node.open);
return;
}
} else if (node) {
view.expandCollapseNode(setting, node, !node.open);
}
}
};
// zTree defind
$.fn.zTree = {
consts : _consts,
_z : {
tools: tools,
view: view,
event: event,
data: data
},
getZTreeObj: function(treeId) {
var o = data.getZTreeTools(treeId);
return o ? o : null;
},
destroy: function(treeId) {
if (!!treeId && treeId.length > 0) {
view.destroy(data.getSetting(treeId));
} else {
for(var s in settings) {
view.destroy(settings[s]);
}
}
},
init: function(obj, zSetting, zNodes) {
var setting = tools.clone(_setting);
$.extend(true, setting, zSetting);
setting.treeId = obj.attr("id");
setting.treeObj = obj;
setting.treeObj.empty();
settings[setting.treeId] = setting;
//For some older browser,(e.g., ie6)
if(typeof document.body.style.maxHeight === "undefined") {
setting.view.expandSpeed = "";
}
data.initRoot(setting);
var root = data.getRoot(setting),
childKey = setting.data.key.children;
zNodes = zNodes ? tools.clone(tools.isArray(zNodes)? zNodes : [zNodes]) : [];
if (setting.data.simpleData.enable) {
root[childKey] = data.transformTozTreeFormat(setting, zNodes);
} else {
root[childKey] = zNodes;
}
data.initCache(setting);
event.unbindTree(setting);
event.bindTree(setting);
event.unbindEvent(setting);
event.bindEvent(setting);
var zTreeTools = {
setting : setting,
addNodes : function(parentNode, newNodes, isSilent) {
if (!newNodes) return null;
if (!parentNode) parentNode = null;
if (parentNode && !parentNode.isParent && setting.data.keep.leaf) return null;
var xNewNodes = tools.clone(tools.isArray(newNodes)? newNodes: [newNodes]);
function addCallback() {
view.addNodes(setting, parentNode, xNewNodes, (isSilent==true));
}
if (tools.canAsync(setting, parentNode)) {
view.asyncNode(setting, parentNode, isSilent, addCallback);
} else {
addCallback();
}
return xNewNodes;
},
cancelSelectedNode : function(node) {
view.cancelPreSelectedNode(setting, node);
},
destroy : function() {
view.destroy(setting);
},
expandAll : function(expandFlag) {
expandFlag = !!expandFlag;
view.expandCollapseSonNode(setting, null, expandFlag, true);
return expandFlag;
},
expandNode : function(node, expandFlag, sonSign, focus, callbackFlag) {
if (!node || !node.isParent) return null;
if (expandFlag !== true && expandFlag !== false) {
expandFlag = !node.open;
}
callbackFlag = !!callbackFlag;
if (callbackFlag && expandFlag && (tools.apply(setting.callback.beforeExpand, [setting.treeId, node], true) == false)) {
return null;
} else if (callbackFlag && !expandFlag && (tools.apply(setting.callback.beforeCollapse, [setting.treeId, node], true) == false)) {
return null;
}
if (expandFlag && node.parentTId) {
view.expandCollapseParentNode(setting, node.getParentNode(), expandFlag, false);
}
if (expandFlag === node.open && !sonSign) {
return null;
}
data.getRoot(setting).expandTriggerFlag = callbackFlag;
if (!tools.canAsync(setting, node) && sonSign) {
view.expandCollapseSonNode(setting, node, expandFlag, true, function() {
if (focus !== false) {try{$$(node, setting).focus().blur();}catch(e){}}
});
} else {
node.open = !expandFlag;
view.switchNode(this.setting, node);
if (focus !== false) {try{$$(node, setting).focus().blur();}catch(e){}}
}
return expandFlag;
},
getNodes : function() {
return data.getNodes(setting);
},
getNodeByParam : function(key, value, parentNode) {
if (!key) return null;
return data.getNodeByParam(setting, parentNode?parentNode[setting.data.key.children]:data.getNodes(setting), key, value);
},
getNodeByTId : function(tId) {
return data.getNodeCache(setting, tId);
},
getNodesByParam : function(key, value, parentNode) {
if (!key) return null;
return data.getNodesByParam(setting, parentNode?parentNode[setting.data.key.children]:data.getNodes(setting), key, value);
},
getNodesByParamFuzzy : function(key, value, parentNode) {
if (!key) return null;
return data.getNodesByParamFuzzy(setting, parentNode?parentNode[setting.data.key.children]:data.getNodes(setting), key, value);
},
getNodesByFilter: function(filter, isSingle, parentNode, invokeParam) {
isSingle = !!isSingle;
if (!filter || (typeof filter != "function")) return (isSingle ? null : []);
return data.getNodesByFilter(setting, parentNode?parentNode[setting.data.key.children]:data.getNodes(setting), filter, isSingle, invokeParam);
},
getNodeIndex : function(node) {
if (!node) return null;
var childKey = setting.data.key.children,
parentNode = (node.parentTId) ? node.getParentNode() : data.getRoot(setting);
for (var i=0, l = parentNode[childKey].length; i < l; i++) {
if (parentNode[childKey][i] == node) return i;
}
return -1;
},
getSelectedNodes : function() {
var r = [], list = data.getRoot(setting).curSelectedList;
for (var i=0, l=list.length; i<l; i++) {
r.push(list[i]);
}
return r;
},
isSelectedNode : function(node) {
return data.isSelectedNode(setting, node);
},
reAsyncChildNodes : function(parentNode, reloadType, isSilent) {
if (!this.setting.async.enable) return;
var isRoot = !parentNode;
if (isRoot) {
parentNode = data.getRoot(setting);
}
if (reloadType=="refresh") {
var childKey = this.setting.data.key.children;
for (var i = 0, l = parentNode[childKey] ? parentNode[childKey].length : 0; i < l; i++) {
data.removeNodeCache(setting, parentNode[childKey][i]);
}
data.removeSelectedNode(setting);
parentNode[childKey] = [];
if (isRoot) {
this.setting.treeObj.empty();
} else {
var ulObj = $$(parentNode, consts.id.UL, setting);
ulObj.empty();
}
}
view.asyncNode(this.setting, isRoot? null:parentNode, !!isSilent);
},
refresh : function() {
this.setting.treeObj.empty();
var root = data.getRoot(setting),
nodes = root[setting.data.key.children]
data.initRoot(setting);
root[setting.data.key.children] = nodes
data.initCache(setting);
view.createNodes(setting, 0, root[setting.data.key.children]);
},
removeChildNodes : function(node) {
if (!node) return null;
var childKey = setting.data.key.children,
nodes = node[childKey];
view.removeChildNodes(setting, node);
return nodes ? nodes : null;
},
removeNode : function(node, callbackFlag) {
if (!node) return;
callbackFlag = !!callbackFlag;
if (callbackFlag && tools.apply(setting.callback.beforeRemove, [setting.treeId, node], true) == false) return;
view.removeNode(setting, node);
if (callbackFlag) {
this.setting.treeObj.trigger(consts.event.REMOVE, [setting.treeId, node]);
}
},
selectNode : function(node, addFlag) {
if (!node) return;
if (tools.uCanDo(setting)) {
addFlag = setting.view.selectedMulti && addFlag;
if (node.parentTId) {
view.expandCollapseParentNode(setting, node.getParentNode(), true, false, function() {
try{$$(node, setting).focus().blur();}catch(e){}
});
} else {
try{$$(node, setting).focus().blur();}catch(e){}
}
view.selectNode(setting, node, addFlag);
}
},
transformTozTreeNodes : function(simpleNodes) {
return data.transformTozTreeFormat(setting, simpleNodes);
},
transformToArray : function(nodes) {
return data.transformToArrayFormat(setting, nodes);
},
updateNode : function(node, checkTypeFlag) {
if (!node) return;
var nObj = $$(node, setting);
if (nObj.get(0) && tools.uCanDo(setting)) {
view.setNodeName(setting, node);
view.setNodeTarget(setting, node);
view.setNodeUrl(setting, node);
view.setNodeLineIcos(setting, node);
view.setNodeFontCss(setting, node);
}
}
}
root.treeTools = zTreeTools;
data.setZTreeTools(setting, zTreeTools);
if (root[childKey] && root[childKey].length > 0) {
view.createNodes(setting, 0, root[childKey]);
} else if (setting.async.enable && setting.async.url && setting.async.url !== '') {
view.asyncNode(setting);
}
return zTreeTools;
}
};
var zt = $.fn.zTree,
$$ = tools.$,
consts = zt.consts;
})(BI.jQuery);
/***/ }),
/* 714 */
/***/ (function(module, exports) {
/*
* JQuery zTree excheck v3.5.18
* http://zTree.me/
*
* Copyright (c) 2010 Hunter.z
*
* Licensed same as jquery - MIT License
* http://www.opensource.org/licenses/mit-license.php
*
* email: hunter.z@263.net
* Date: 2015-06-18
*/
(function($){
//default consts of excheck
var _consts = {
event: {
CHECK: "ztree_check"
},
id: {
CHECK: "_check"
},
checkbox: {
STYLE: "checkbox",
DEFAULT: "chk",
DISABLED: "disable",
FALSE: "false",
TRUE: "true",
FULL: "full",
PART: "part",
FOCUS: "focus"
},
radio: {
STYLE: "radio",
TYPE_ALL: "all",
TYPE_LEVEL: "level"
}
},
//default setting of excheck
_setting = {
check: {
enable: false,
autoCheckTrigger: false,
chkStyle: _consts.checkbox.STYLE,
nocheckInherit: false,
chkDisabledInherit: false,
radioType: _consts.radio.TYPE_LEVEL,
chkboxType: {
"Y": "ps",
"N": "ps"
}
},
data: {
key: {
checked: "checked"
}
},
callback: {
beforeCheck:null,
onCheck:null
}
},
//default root of excheck
_initRoot = function (setting) {
var r = data.getRoot(setting);
r.radioCheckedList = [];
},
//default cache of excheck
_initCache = function(treeId) {},
//default bind event of excheck
_bindEvent = function(setting) {
var o = setting.treeObj,
c = consts.event;
o.bind(c.CHECK, function (event, srcEvent, treeId, node) {
event.srcEvent = srcEvent;
tools.apply(setting.callback.onCheck, [event, treeId, node]);
});
},
_unbindEvent = function(setting) {
var o = setting.treeObj,
c = consts.event;
o.unbind(c.CHECK);
},
//default event proxy of excheck
_eventProxy = function(e) {
var target = e.target,
setting = data.getSetting(e.data.treeId),
tId = "", node = null,
nodeEventType = "", treeEventType = "",
nodeEventCallback = null, treeEventCallback = null;
if (tools.eqs(e.type, "mouseover")) {
if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
tId = tools.getNodeMainDom(target).id;
nodeEventType = "mouseoverCheck";
}
} else if (tools.eqs(e.type, "mouseout")) {
if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
tId = tools.getNodeMainDom(target).id;
nodeEventType = "mouseoutCheck";
}
} else if (tools.eqs(e.type, "click")) {
if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
tId = tools.getNodeMainDom(target).id;
nodeEventType = "checkNode";
}
}
if (tId.length>0) {
node = data.getNodeCache(setting, tId);
switch (nodeEventType) {
case "checkNode" :
nodeEventCallback = _handler.onCheckNode;
break;
case "mouseoverCheck" :
nodeEventCallback = _handler.onMouseoverCheck;
break;
case "mouseoutCheck" :
nodeEventCallback = _handler.onMouseoutCheck;
break;
}
}
var proxyResult = {
stop: nodeEventType === "checkNode",
node: node,
nodeEventType: nodeEventType,
nodeEventCallback: nodeEventCallback,
treeEventType: treeEventType,
treeEventCallback: treeEventCallback
};
return proxyResult
},
//default init node of excheck
_initNode = function(setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) {
if (!n) return;
var checkedKey = setting.data.key.checked;
if (typeof n[checkedKey] == "string") n[checkedKey] = tools.eqs(n[checkedKey], "true");
n[checkedKey] = !!n[checkedKey];
n.checkedOld = n[checkedKey];
if (typeof n.nocheck == "string") n.nocheck = tools.eqs(n.nocheck, "true");
n.nocheck = !!n.nocheck || (setting.check.nocheckInherit && parentNode && !!parentNode.nocheck);
if (typeof n.chkDisabled == "string") n.chkDisabled = tools.eqs(n.chkDisabled, "true");
n.chkDisabled = !!n.chkDisabled || (setting.check.chkDisabledInherit && parentNode && !!parentNode.chkDisabled);
if (typeof n.halfCheck == "string") n.halfCheck = tools.eqs(n.halfCheck, "true");
n.halfCheck = !!n.halfCheck;
n.check_Child_State = -1;
n.check_Focus = false;
n.getCheckStatus = function() {return data.getCheckStatus(setting, n);};
if (setting.check.chkStyle == consts.radio.STYLE && setting.check.radioType == consts.radio.TYPE_ALL && n[checkedKey] ) {
var r = data.getRoot(setting);
r.radioCheckedList.push(n);
}
},
//add dom for check
_beforeA = function(setting, node, html) {
var checkedKey = setting.data.key.checked;
if (setting.check.enable) {
data.makeChkFlag(setting, node);
html.push("<span ID='", node.tId, consts.id.CHECK, "' class='", view.makeChkClass(setting, node), "' treeNode", consts.id.CHECK, (node.nocheck === true?" style='display:none;'":""),"></span>");
}
},
//update zTreeObj, add method of check
_zTreeTools = function(setting, zTreeTools) {
zTreeTools.checkNode = function(node, checked, checkTypeFlag, callbackFlag) {
var checkedKey = this.setting.data.key.checked;
if (node.chkDisabled === true) return;
if (checked !== true && checked !== false) {
checked = !node[checkedKey];
}
callbackFlag = !!callbackFlag;
if (node[checkedKey] === checked && !checkTypeFlag) {
return;
} else if (callbackFlag && tools.apply(this.setting.callback.beforeCheck, [this.setting.treeId, node], true) == false) {
return;
}
if (tools.uCanDo(this.setting) && this.setting.check.enable && node.nocheck !== true) {
node[checkedKey] = checked;
var checkObj = $$(node, consts.id.CHECK, this.setting);
if (checkTypeFlag || this.setting.check.chkStyle === consts.radio.STYLE) view.checkNodeRelation(this.setting, node);
view.setChkClass(this.setting, checkObj, node);
view.repairParentChkClassWithSelf(this.setting, node);
if (callbackFlag) {
this.setting.treeObj.trigger(consts.event.CHECK, [null, this.setting.treeId, node]);
}
}
}
zTreeTools.checkAllNodes = function(checked) {
view.repairAllChk(this.setting, !!checked);
}
zTreeTools.getCheckedNodes = function(checked) {
var childKey = this.setting.data.key.children;
checked = (checked !== false);
return data.getTreeCheckedNodes(this.setting, data.getRoot(this.setting)[childKey], checked);
}
zTreeTools.getChangeCheckedNodes = function() {
var childKey = this.setting.data.key.children;
return data.getTreeChangeCheckedNodes(this.setting, data.getRoot(this.setting)[childKey]);
}
zTreeTools.setChkDisabled = function(node, disabled, inheritParent, inheritChildren) {
disabled = !!disabled;
inheritParent = !!inheritParent;
inheritChildren = !!inheritChildren;
view.repairSonChkDisabled(this.setting, node, disabled, inheritChildren);
view.repairParentChkDisabled(this.setting, node.getParentNode(), disabled, inheritParent);
}
var _updateNode = zTreeTools.updateNode;
zTreeTools.updateNode = function(node, checkTypeFlag) {
if (_updateNode) _updateNode.apply(zTreeTools, arguments);
if (!node || !this.setting.check.enable) return;
var nObj = $$(node, this.setting);
if (nObj.get(0) && tools.uCanDo(this.setting)) {
var checkObj = $$(node, consts.id.CHECK, this.setting);
if (checkTypeFlag == true || this.setting.check.chkStyle === consts.radio.STYLE) view.checkNodeRelation(this.setting, node);
view.setChkClass(this.setting, checkObj, node);
view.repairParentChkClassWithSelf(this.setting, node);
}
}
},
//method of operate data
_data = {
getRadioCheckedList: function(setting) {
var checkedList = data.getRoot(setting).radioCheckedList;
for (var i=0, j=checkedList.length; i<j; i++) {
if(!data.getNodeCache(setting, checkedList[i].tId)) {
checkedList.splice(i, 1);
i--; j--;
}
}
return checkedList;
},
getCheckStatus: function(setting, node) {
if (!setting.check.enable || node.nocheck || node.chkDisabled) return null;
var checkedKey = setting.data.key.checked,
r = {
checked: node[checkedKey],
half: node.halfCheck ? node.halfCheck : (setting.check.chkStyle == consts.radio.STYLE ? (node.check_Child_State === 2) : (node[checkedKey] ? (node.check_Child_State > -1 && node.check_Child_State < 2) : (node.check_Child_State > 0)))
};
return r;
},
getTreeCheckedNodes: function(setting, nodes, checked, results) {
if (!nodes) return [];
var childKey = setting.data.key.children,
checkedKey = setting.data.key.checked,
onlyOne = (checked && setting.check.chkStyle == consts.radio.STYLE && setting.check.radioType == consts.radio.TYPE_ALL);
results = !results ? [] : results;
for (var i = 0, l = nodes.length; i < l; i++) {
if (nodes[i].nocheck !== true && nodes[i].chkDisabled !== true && nodes[i][checkedKey] == checked) {
results.push(nodes[i]);
if(onlyOne) {
break;
}
}
data.getTreeCheckedNodes(setting, nodes[i][childKey], checked, results);
if(onlyOne && results.length > 0) {
break;
}
}
return results;
},
getTreeChangeCheckedNodes: function(setting, nodes, results) {
if (!nodes) return [];
var childKey = setting.data.key.children,
checkedKey = setting.data.key.checked;
results = !results ? [] : results;
for (var i = 0, l = nodes.length; i < l; i++) {
if (nodes[i].nocheck !== true && nodes[i].chkDisabled !== true && nodes[i][checkedKey] != nodes[i].checkedOld) {
results.push(nodes[i]);
}
data.getTreeChangeCheckedNodes(setting, nodes[i][childKey], results);
}
return results;
},
makeChkFlag: function(setting, node) {
if (!node) return;
var childKey = setting.data.key.children,
checkedKey = setting.data.key.checked,
chkFlag = -1;
if (node[childKey]) {
for (var i = 0, l = node[childKey].length; i < l; i++) {
var cNode = node[childKey][i];
var tmp = -1;
if (setting.check.chkStyle == consts.radio.STYLE) {
if (cNode.nocheck === true || cNode.chkDisabled === true) {
tmp = cNode.check_Child_State;
} else if (cNode.halfCheck === true) {
tmp = 2;
} else if (cNode[checkedKey]) {
tmp = 2;
} else {
tmp = cNode.check_Child_State > 0 ? 2:0;
}
if (tmp == 2) {
chkFlag = 2; break;
} else if (tmp == 0){
chkFlag = 0;
}
} else if (setting.check.chkStyle == consts.checkbox.STYLE) {
if (cNode.nocheck === true || cNode.chkDisabled === true) {
tmp = cNode.check_Child_State;
} else if (cNode.halfCheck === true) {
tmp = 1;
} else if (cNode[checkedKey] ) {
tmp = (cNode.check_Child_State === -1 || cNode.check_Child_State === 2) ? 2 : 1;
} else {
tmp = (cNode.check_Child_State > 0) ? 1 : 0;
}
if (tmp === 1) {
chkFlag = 1; break;
} else if (tmp === 2 && chkFlag > -1 && i > 0 && tmp !== chkFlag) {
chkFlag = 1; break;
} else if (chkFlag === 2 && tmp > -1 && tmp < 2) {
chkFlag = 1; break;
} else if (tmp > -1) {
chkFlag = tmp;
}
}
}
}
node.check_Child_State = chkFlag;
}
},
//method of event proxy
_event = {
},
//method of event handler
_handler = {
onCheckNode: function (event, node) {
if (node.chkDisabled === true) return false;
var setting = data.getSetting(event.data.treeId),
checkedKey = setting.data.key.checked;
if (tools.apply(setting.callback.beforeCheck, [setting.treeId, node], true) == false) return true;
node[checkedKey] = !node[checkedKey];
view.checkNodeRelation(setting, node);
var checkObj = $$(node, consts.id.CHECK, setting);
view.setChkClass(setting, checkObj, node);
view.repairParentChkClassWithSelf(setting, node);
setting.treeObj.trigger(consts.event.CHECK, [event, setting.treeId, node]);
return true;
},
onMouseoverCheck: function(event, node) {
if (node.chkDisabled === true) return false;
var setting = data.getSetting(event.data.treeId),
checkObj = $$(node, consts.id.CHECK, setting);
node.check_Focus = true;
view.setChkClass(setting, checkObj, node);
return true;
},
onMouseoutCheck: function(event, node) {
if (node.chkDisabled === true) return false;
var setting = data.getSetting(event.data.treeId),
checkObj = $$(node, consts.id.CHECK, setting);
node.check_Focus = false;
view.setChkClass(setting, checkObj, node);
return true;
}
},
//method of tools for zTree
_tools = {
},
//method of operate ztree dom
_view = {
checkNodeRelation: function(setting, node) {
var pNode, i, l,
childKey = setting.data.key.children,
checkedKey = setting.data.key.checked,
r = consts.radio;
if (setting.check.chkStyle == r.STYLE) {
var checkedList = data.getRadioCheckedList(setting);
if (node[checkedKey]) {
if (setting.check.radioType == r.TYPE_ALL) {
for (i = checkedList.length-1; i >= 0; i--) {
pNode = checkedList[i];
if (pNode[checkedKey] && pNode != node) {
pNode[checkedKey] = false;
checkedList.splice(i, 1);
view.setChkClass(setting, $$(pNode, consts.id.CHECK, setting), pNode);
if (pNode.parentTId != node.parentTId) {
view.repairParentChkClassWithSelf(setting, pNode);
}
}
}
checkedList.push(node);
} else {
var parentNode = (node.parentTId) ? node.getParentNode() : data.getRoot(setting);
for (i = 0, l = parentNode[childKey].length; i < l; i++) {
pNode = parentNode[childKey][i];
if (pNode[checkedKey] && pNode != node) {
pNode[checkedKey] = false;
view.setChkClass(setting, $$(pNode, consts.id.CHECK, setting), pNode);
}
}
}
} else if (setting.check.radioType == r.TYPE_ALL) {
for (i = 0, l = checkedList.length; i < l; i++) {
if (node == checkedList[i]) {
checkedList.splice(i, 1);
break;
}
}
}
} else {
if (node[checkedKey] && (!node[childKey] || node[childKey].length==0 || setting.check.chkboxType.Y.indexOf("s") > -1)) {
view.setSonNodeCheckBox(setting, node, true);
}
if (!node[checkedKey] && (!node[childKey] || node[childKey].length==0 || setting.check.chkboxType.N.indexOf("s") > -1)) {
view.setSonNodeCheckBox(setting, node, false);
}
if (node[checkedKey] && setting.check.chkboxType.Y.indexOf("p") > -1) {
view.setParentNodeCheckBox(setting, node, true);
}
if (!node[checkedKey] && setting.check.chkboxType.N.indexOf("p") > -1) {
view.setParentNodeCheckBox(setting, node, false);
}
}
},
makeChkClass: function(setting, node) {
var checkedKey = setting.data.key.checked,
c = consts.checkbox, r = consts.radio,
checkboxType = setting.check.chkboxType;
var notEffectByOtherNode = (checkboxType.Y === "" && checkboxType.N === "");
fullStyle = "";
if (node.chkDisabled === true) {
fullStyle = c.DISABLED;
} else if (node.halfCheck) {
fullStyle = c.PART;
} else if (setting.check.chkStyle == r.STYLE) {
fullStyle = (node.check_Child_State < 1)? c.FULL:c.PART;
} else {
fullStyle = node[checkedKey] ? ((node.check_Child_State === 2 || node.check_Child_State === -1) || notEffectByOtherNode ? c.FULL:c.PART) : ((node.check_Child_State < 1 || notEffectByOtherNode)? c.FULL:c.PART);
}
var chkName = setting.check.chkStyle + "_" + (node[checkedKey] ? c.TRUE : c.FALSE) + "_" + fullStyle;
chkName = (node.check_Focus && node.chkDisabled !== true) ? chkName + "_" + c.FOCUS : chkName;
return consts.className.BUTTON + " " + c.DEFAULT + " " + chkName;
},
repairAllChk: function(setting, checked) {
if (setting.check.enable && setting.check.chkStyle === consts.checkbox.STYLE) {
var checkedKey = setting.data.key.checked,
childKey = setting.data.key.children,
root = data.getRoot(setting);
for (var i = 0, l = root[childKey].length; i<l ; i++) {
var node = root[childKey][i];
if (node.nocheck !== true && node.chkDisabled !== true) {
node[checkedKey] = checked;
}
view.setSonNodeCheckBox(setting, node, checked);
}
}
},
repairChkClass: function(setting, node) {
if (!node) return;
data.makeChkFlag(setting, node);
if (node.nocheck !== true) {
var checkObj = $$(node, consts.id.CHECK, setting);
view.setChkClass(setting, checkObj, node);
}
},
repairParentChkClass: function(setting, node) {
if (!node || !node.parentTId) return;
var pNode = node.getParentNode();
view.repairChkClass(setting, pNode);
view.repairParentChkClass(setting, pNode);
},
repairParentChkClassWithSelf: function(setting, node) {
if (!node) return;
var childKey = setting.data.key.children;
if (node[childKey] && node[childKey].length > 0) {
view.repairParentChkClass(setting, node[childKey][0]);
} else {
view.repairParentChkClass(setting, node);
}
},
repairSonChkDisabled: function(setting, node, chkDisabled, inherit) {
if (!node) return;
var childKey = setting.data.key.children;
if (node.chkDisabled != chkDisabled) {
node.chkDisabled = chkDisabled;
}
view.repairChkClass(setting, node);
if (node[childKey] && inherit) {
for (var i = 0, l = node[childKey].length; i < l; i++) {
var sNode = node[childKey][i];
view.repairSonChkDisabled(setting, sNode, chkDisabled, inherit);
}
}
},
repairParentChkDisabled: function(setting, node, chkDisabled, inherit) {
if (!node) return;
if (node.chkDisabled != chkDisabled && inherit) {
node.chkDisabled = chkDisabled;
}
view.repairChkClass(setting, node);
view.repairParentChkDisabled(setting, node.getParentNode(), chkDisabled, inherit);
},
setChkClass: function(setting, obj, node) {
if (!obj) return;
if (node.nocheck === true) {
obj.hide();
} else {
obj.show();
}
obj.attr('class', view.makeChkClass(setting, node));
},
setParentNodeCheckBox: function(setting, node, value, srcNode) {
var childKey = setting.data.key.children,
checkedKey = setting.data.key.checked,
checkObj = $$(node, consts.id.CHECK, setting);
if (!srcNode) srcNode = node;
data.makeChkFlag(setting, node);
if (node.nocheck !== true && node.chkDisabled !== true) {
node[checkedKey] = value;
view.setChkClass(setting, checkObj, node);
if (setting.check.autoCheckTrigger && node != srcNode) {
setting.treeObj.trigger(consts.event.CHECK, [null, setting.treeId, node]);
}
}
if (node.parentTId) {
var pSign = true;
if (!value) {
var pNodes = node.getParentNode()[childKey];
for (var i = 0, l = pNodes.length; i < l; i++) {
if ((pNodes[i].nocheck !== true && pNodes[i].chkDisabled !== true && pNodes[i][checkedKey])
|| ((pNodes[i].nocheck === true || pNodes[i].chkDisabled === true) && pNodes[i].check_Child_State > 0)) {
pSign = false;
break;
}
}
}
if (pSign) {
view.setParentNodeCheckBox(setting, node.getParentNode(), value, srcNode);
}
}
},
setSonNodeCheckBox: function(setting, node, value, srcNode) {
if (!node) return;
var childKey = setting.data.key.children,
checkedKey = setting.data.key.checked,
checkObj = $$(node, consts.id.CHECK, setting);
if (!srcNode) srcNode = node;
var hasDisable = false;
if (node[childKey]) {
for (var i = 0, l = node[childKey].length; i < l && node.chkDisabled !== true; i++) {
var sNode = node[childKey][i];
view.setSonNodeCheckBox(setting, sNode, value, srcNode);
if (sNode.chkDisabled === true) hasDisable = true;
}
}
if (node != data.getRoot(setting) && node.chkDisabled !== true) {
if (hasDisable && node.nocheck !== true) {
data.makeChkFlag(setting, node);
}
if (node.nocheck !== true && node.chkDisabled !== true) {
node[checkedKey] = value;
if (!hasDisable) node.check_Child_State = (node[childKey] && node[childKey].length > 0) ? (value ? 2 : 0) : -1;
} else {
node.check_Child_State = -1;
}
view.setChkClass(setting, checkObj, node);
if (setting.check.autoCheckTrigger && node != srcNode && node.nocheck !== true && node.chkDisabled !== true) {
setting.treeObj.trigger(consts.event.CHECK, [null, setting.treeId, node]);
}
}
}
},
_z = {
tools: _tools,
view: _view,
event: _event,
data: _data
};
$.extend(true, $.fn.zTree.consts, _consts);
$.extend(true, $.fn.zTree._z, _z);
var zt = $.fn.zTree,
tools = zt._z.tools,
consts = zt.consts,
view = zt._z.view,
data = zt._z.data,
event = zt._z.event,
$$ = tools.$;
data.exSetting(_setting);
data.addInitBind(_bindEvent);
data.addInitUnBind(_unbindEvent);
data.addInitCache(_initCache);
data.addInitNode(_initNode);
data.addInitProxy(_eventProxy, true);
data.addInitRoot(_initRoot);
data.addBeforeA(_beforeA);
data.addZTreeTools(_zTreeTools);
var _createNodes = view.createNodes;
view.createNodes = function(setting, level, nodes, parentNode) {
if (_createNodes) _createNodes.apply(view, arguments);
if (!nodes) return;
view.repairParentChkClassWithSelf(setting, parentNode);
}
var _removeNode = view.removeNode;
view.removeNode = function(setting, node) {
var parentNode = node.getParentNode();
if (_removeNode) _removeNode.apply(view, arguments);
if (!node || !parentNode) return;
view.repairChkClass(setting, parentNode);
view.repairParentChkClass(setting, parentNode);
}
var _appendNodes = view.appendNodes;
view.appendNodes = function(setting, level, nodes, parentNode, initFlag, openFlag) {
var html = "";
if (_appendNodes) {
html = _appendNodes.apply(view, arguments);
}
if (parentNode) {
data.makeChkFlag(setting, parentNode);
}
return html;
}
})(BI.jQuery);
/***/ }),
/* 715 */
/***/ (function(module, exports) {
/**
* @author windy
* @version 2.0
* Created by windy on 2020/1/8
* 提供节点滚动加载方式
*/
!(function () {
BI.TreeRenderScrollService = BI.inherit(BI.OB, {
_init: function () {
this.nodeLists = {};
this.id = this.options.id;
// renderService是否已经注册了滚动
this.hasBinded = false;
this.container = this.options.container;
},
_getNodeListBounds: function (tId) {
var nodeList = this.options.subNodeListGetter(tId)[0];
return {
top: nodeList.offsetTop,
left: nodeList.offsetLeft,
width: nodeList.offsetWidth,
height: nodeList.offsetHeight
}
},
_getTreeContainerBounds: function () {
var nodeList = this.container[0];
if (BI.isNotNull(nodeList)) {
return {
top: nodeList.offsetTop + nodeList.scrollTop,
left: nodeList.offsetLeft + nodeList.scrollLeft,
width: nodeList.offsetWidth,
height: nodeList.offsetHeight
};
}
return {};
},
_canNodePopulate: function (tId) {
if (this.nodeLists[tId].locked) {
return false;
}
// 获取ul, 即子节点列表的bounds
// 是否需要继续加载,只需要看子节点列表的下边界与container是否无交集
var bounds = this._getNodeListBounds(tId);
var containerBounds = this._getTreeContainerBounds(tId);
// ul底部是不是漏出来了
if (bounds.top + bounds.height < containerBounds.top + containerBounds.height) {
return true;
}
return false;
},
_isNodeInVisible: function (tId) {
var nodeList = this.options.subNodeListGetter(tId);
return nodeList.length === 0 || nodeList.css("display") === "none";
},
pushNodeList: function (tId, populate) {
var self = this;
if (!BI.has(this.nodeLists, tId)) {
this.nodeLists[tId] = {
populate: BI.debounce(populate, 0),
options: {
times: 1
},
// 在上一次请求返回前, 通过滚动再次触发加载的时候, 不应该认为是下一次分页, 需要等待上次请求返回
// 以保证顺序和请求次数的完整
locked: false
};
} else {
this.nodeLists[tId].locked = false;
}
if(!this.hasBinded) {
// console.log("绑定事件");
this.hasBinded = true;
this.container && this.container.on("scroll", BI.debounce(function () {
self.refreshAllNodes();
}, 30));
}
},
refreshAllNodes: function () {
var self = this;
BI.each(this.nodeLists, function (tId) {
// 不展开的节点就不看了
!self._isNodeInVisible(tId) && self.refreshNodes(tId);
});
},
refreshNodes: function (tId) {
if (this._canNodePopulate(tId)) {
var nodeList = this.nodeLists[tId];
nodeList.options.times++;
nodeList.locked = true;
nodeList.populate({
times: nodeList.options.times
});
}
},
removeNodeList: function (tId) {
delete this.nodeLists[tId];
if (BI.size(this.nodeLists) === 0) {
this.clear();
}
},
clear: function () {
var self = this;
BI.each(this.nodeLists, function (tId) {
self.removeNodeList(tId);
});
this.nodeLists = {};
// console.log("解绑事件");
this.container.off("scroll");
this.hasBinded = false;
}
});
})();
/***/ }),
/* 716 */
/***/ (function(module, exports) {
/**
* @author windy
* @version 2.0
* Created by windy on 2020/1/8
* 提供节点分页加载方式
*/
!(function () {
BI.TreeRenderPageService = BI.inherit(BI.OB, {
_init: function () {
this.nodeLists = {};
},
_getLoadingBar: function(tId) {
var self = this;
var tip = BI.createWidget({
type: "bi.loading_bar",
height: 25,
handler: function () {
self.refreshNodes(tId);
}
});
tip.setLoaded();
return tip;
},
pushNodeList: function (tId, populate) {
var self = this, o = this.options;
var tip = this._getLoadingBar(tId);
if (!BI.has(this.nodeLists, tId)) {
this.nodeLists[tId] = {
populate: BI.debounce(populate, 0),
options: {
times: 1
},
loadWidget: tip
};
} else {
this.nodeLists[tId].loadWidget.destroy();
this.nodeLists[tId].loadWidget = tip;
}
BI.createWidget({
type: "bi.vertical",
element: o.subNodeListGetter(tId),
items: [tip]
});
},
refreshNodes: function (tId) {
var nodeList = this.nodeLists[tId];
nodeList.options.times++;
nodeList.loadWidget.setLoading();
nodeList.populate({
times: nodeList.options.times
});
},
removeNodeList: function (tId) {
this.nodeLists[tId] && this.nodeLists[tId].loadWidget.destroy();
this.nodeLists[tId] && (this.nodeLists[tId].loadWidget = null);
delete this.nodeLists[tId];
if (BI.size(this.nodeLists) === 0) {
this.clear();
}
},
clear: function () {
var self = this;
BI.each(this.nodeLists, function (tId) {
self.removeNodeList(tId);
});
this.nodeLists = {};
}
});
})();
/***/ }),
/* 717 */
/***/ (function(module, exports) {
/**
* 自定义选色
*
* Created by GUY on 2015/11/17.
* @class BI.CustomColorChooser
* @extends BI.Widget
*/
BI.CustomColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.CustomColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-custom-color-chooser",
width: 227,
height: 245
});
},
_init: function () {
BI.CustomColorChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.editor = BI.createWidget(o.editor, {
type: "bi.simple_color_picker_editor"
});
this.editor.on(BI.ColorPickerEditor.EVENT_CHANGE, function () {
self.setValue(this.getValue());
});
this.farbtastic = BI.createWidget({
type: "bi.farbtastic"
});
this.farbtastic.on(BI.Farbtastic.EVENT_CHANGE, function () {
self.setValue(this.getValue());
});
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
type: "bi.absolute",
items: [{
el: this.editor,
left: 0,
top: 0,
right: 0
}],
height: 30
}, {
type: "bi.absolute",
items: [{
el: this.farbtastic,
left: 15,
right: 15,
top: 7
}],
height: 215
}]
});
},
setValue: function (color) {
this.editor.setValue(color);
this.farbtastic.setValue(color);
},
getValue: function () {
return this.editor.getValue();
}
});
BI.CustomColorChooser.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.custom_color_chooser", BI.CustomColorChooser);
/***/ }),
/* 718 */
/***/ (function(module, exports) {
/**
* 选色控件
*
* Created by GUY on 2015/11/17.
* @class BI.ColorChooser
* @extends BI.Widget
*/
BI.ColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser",
value: "",
height: 24
});
},
_init: function () {
BI.ColorChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
o.value = o.value || "";
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
container: o.container,
adjustLength: 1,
isNeedAdjustWidth: false,
isNeedAdjustHeight: false,
el: BI.extend({
type: o.width <= 24 ? "bi.color_chooser_trigger" : "bi.long_color_chooser_trigger",
ref: function (_ref) {
self.trigger = _ref;
},
width: o.width - 2,
height: o.height - 2
}, o.el),
popup: {
el: BI.extend({
type: "bi.color_chooser_popup",
ref: function (_ref) {
self.colorPicker = _ref;
},
listeners: [{
eventName: BI.ColorChooserPopup.EVENT_VALUE_CHANGE,
action: function () {
fn();
if (!self._isRGBColor(self.colorPicker.getValue())) {
self.combo.hideView();
}
}
}, {
eventName: BI.ColorChooserPopup.EVENT_CHANGE,
action: function () {
fn();
self.combo.hideView();
}
}]
}, o.popup),
value: o.value,
width: 230
},
value: o.value
});
var fn = function () {
var color = self.colorPicker.getValue();
self.trigger.setValue(color);
};
this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW, function () {
self.fireEvent(BI.ColorChooser.EVENT_CHANGE, arguments);
});
},
_isRGBColor: function (color) {
return BI.isNotEmptyString(color) && color !== "transparent";
},
isViewVisible: function () {
return this.combo.isViewVisible();
},
hideView: function () {
this.combo.hideView();
},
showView: function () {
this.combo.showView();
},
setValue: function (color) {
this.combo.setValue(color || "");
},
getValue: function () {
return this.combo.getValue();
}
});
BI.ColorChooser.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.color_chooser", BI.ColorChooser);
/***/ }),
/* 719 */
/***/ (function(module, exports) {
/**
* 选色控件
*
* Created by GUY on 2015/11/17.
* @class BI.ColorChooserPopup
* @extends BI.Widget
*/
BI.ColorChooserPopup = BI.inherit(BI.Widget, {
props: {
baseCls: "bi-color-chooser-popup",
width: 230,
height: 145,
simple: false // 简单模式, popup中没有自动和透明
},
render: function () {
var self = this, o = this.options;
this.colorEditor = BI.createWidget(o.editor, {
type: o.simple ? "bi.simple_color_picker_editor" : "bi.color_picker_editor",
value: o.value,
cls: "bi-header-background bi-border-bottom",
height: 30
});
this.colorEditor.on(BI.ColorPickerEditor.EVENT_CHANGE, function () {
self.setValue(this.getValue());
self._dealStoreColors();
self.fireEvent(BI.ColorChooserPopup.EVENT_VALUE_CHANGE, arguments);
});
this.storeColors = BI.createWidget({
type: "bi.color_picker",
cls: "bi-border-bottom bi-border-right",
items: [this._digestStoreColors(this._getStoreColors())],
width: 210,
height: 24,
value: o.value
});
this.storeColors.on(BI.ColorPicker.EVENT_CHANGE, function () {
self.setValue(this.getValue()[0]);
self._dealStoreColors();
self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE, arguments);
});
this.colorPicker = BI.createWidget({
type: "bi.color_picker",
width: 210,
height: 50,
value: o.value
});
this.colorPicker.on(BI.ColorPicker.EVENT_CHANGE, function () {
self.setValue(this.getValue()[0]);
self._dealStoreColors();
self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE, arguments);
});
this.customColorChooser = BI.createWidget({
type: "bi.custom_color_chooser",
editor: o.editor
});
var panel = BI.createWidget({
type: "bi.popup_panel",
buttons: [BI.i18nText("BI-Basic_Cancel"), BI.i18nText("BI-Basic_Save")],
title: BI.i18nText("BI-Custom_Color"),
el: this.customColorChooser,
stopPropagation: false,
bgap: -1,
rgap: 1,
lgap: 1,
minWidth: 227
});
this.more = BI.createWidget({
type: "bi.combo",
cls: "bi-border-top",
container: null,
direction: "right,top",
isNeedAdjustHeight: false,
el: {
type: "bi.text_item",
cls: "color-chooser-popup-more bi-list-item",
textAlign: "center",
height: 24,
textLgap: 10,
text: BI.i18nText("BI-Basic_More") + "..."
},
popup: panel
});
this.more.on(BI.Combo.EVENT_AFTER_POPUPVIEW, function () {
self.customColorChooser.setValue(self.getValue());
});
panel.on(BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON, function (index) {
switch (index) {
case 0:
self.more.hideView();
break;
case 1:
self.setValue(self.customColorChooser.getValue());
self._dealStoreColors();
self.more.hideView();
self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE, arguments);
break;
}
});
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.vtape",
items: [this.colorEditor, {
el: {
type: "bi.absolute",
items: [{
el: this.storeColors,
left: 10,
right: 10,
top: 5
}]
},
height: 29
}, {
el: {
type: "bi.absolute",
items: [{
el: this.colorPicker,
left: 10,
right: 10,
top: 5,
bottom: 5
}]
},
height: 60
}, {
el: this.more,
height: 24
}]
},
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.layout",
cls: "disable-mask",
invisible: !o.disabled,
ref: function () {
self.mask = this;
}
},
left: 0,
right: 0,
top: 0,
bottom: 0
}]
};
},
mounted: function () {
var self = this;
var o = this.options;
if (BI.isNotNull(o.value)) {
this.setValue(o.value);
}
},
_setEnable: function (enable) {
BI.ColorChooserPopup.superclass._setEnable.apply(this, arguments);
this.mask.setVisible(!enable);
},
_dealStoreColors: function () {
var color = this.getValue();
var colors = this._getStoreColors();
var que = new BI.Queue(8);
que.fromArray(colors);
que.remove(color);
que.unshift(color);
var array = que.toArray();
BI.Cache.setItem("colors", BI.array2String(array));
this.setStoreColors(array);
},
_digestStoreColors: function (colors) {
var items = BI.map(colors, function (i, color) {
return {
value: color
};
});
BI.count(colors.length, 8, function (i) {
items.push({
value: "",
disabled: true
});
});
return items;
},
_getStoreColors: function() {
var self = this, o = this.options;
var colorsArray = BI.string2Array(BI.Cache.getItem("colors") || "");
return BI.filter(colorsArray, function (idx, color) {
return o.simple ? self._isRGBColor(color) : true;
});
},
_isRGBColor: function (color) {
return BI.isNotEmptyString(color) && color !== "transparent";
},
setStoreColors: function (colors) {
if (BI.isArray(colors)) {
this.storeColors.populate([this._digestStoreColors(colors)]);
// BI-66973 选中颜色的同时选中历史
this.storeColors.setValue(this.getValue());
}
},
setValue: function (color) {
this.colorEditor.setValue(color);
this.colorPicker.setValue(color);
this.storeColors.setValue(color);
},
getValue: function () {
return this.colorEditor.getValue();
}
});
BI.ColorChooserPopup.EVENT_VALUE_CHANGE = "EVENT_VALUE_CHANGE";
BI.ColorChooserPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.color_chooser_popup", BI.ColorChooserPopup);
/***/ }),
/* 720 */
/***/ (function(module, exports) {
/**
* 选色控件
*
* Created by GUY on 2015/11/17.
* @class BI.SimpleColorChooserPopup
* @extends BI.Widget
*/
BI.SimpleColorChooserPopup = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SimpleColorChooserPopup.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-chooser-popup"
});
},
_init: function () {
BI.SimpleColorChooserPopup.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.popup = BI.createWidget({
type: "bi.color_chooser_popup",
value: o.value,
element: this,
simple: true // 是否有自动
});
this.popup.on(BI.ColorChooserPopup.EVENT_CHANGE, function () {
self.fireEvent(BI.SimpleColorChooserPopup.EVENT_CHANGE, arguments);
});
this.popup.on(BI.ColorChooserPopup.EVENT_VALUE_CHANGE, function () {
self.fireEvent(BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE, arguments);
});
},
setStoreColors: function (colors) {
this.popup.setStoreColors(colors);
},
setValue: function (color) {
this.popup.setValue(color);
},
getValue: function () {
return this.popup.getValue();
}
});
BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE = "EVENT_VALUE_CHANGE";
BI.SimpleColorChooserPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.simple_color_chooser_popup", BI.SimpleColorChooserPopup);
/***/ }),
/* 721 */
/***/ (function(module, exports) {
/**
* 简单选色控件,没有自动和透明
*
* Created by GUY on 2015/11/17.
* @class BI.SimpleColorChooser
* @extends BI.Widget
*/
BI.SimpleColorChooser = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SimpleColorChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-simple-color-chooser",
value: "#ffffff"
});
},
_init: function () {
BI.SimpleColorChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.combo = BI.createWidget({
type: "bi.color_chooser",
element: this,
container: o.container,
value: o.value,
width: o.width,
height: o.height,
popup: {
type: "bi.simple_color_chooser_popup"
}
});
this.combo.on(BI.ColorChooser.EVENT_CHANGE, function () {
self.fireEvent(BI.SimpleColorChooser.EVENT_CHANGE, arguments);
});
},
isViewVisible: function () {
return this.combo.isViewVisible();
},
hideView: function () {
this.combo.hideView();
},
showView: function () {
this.combo.showView();
},
setValue: function (color) {
this.combo.setValue(color);
},
getValue: function () {
return this.combo.getValue();
}
});
BI.SimpleColorChooser.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.simple_color_chooser", BI.SimpleColorChooser);
/***/ }),
/* 722 */
/***/ (function(module, exports) {
/**
* 选色控件
*
* Created by GUY on 2015/11/17.
* @class BI.ColorChooserTrigger
* @extends BI.Trigger
*/
BI.ColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.ColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 22
});
},
_init: function () {
BI.ColorChooserTrigger.superclass._init.apply(this, arguments);
this.colorContainer = BI.createWidget({
type: "bi.layout",
cls: "color-chooser-trigger-content" + (BI.isIE9Below && BI.isIE9Below() ? " hack" : "")
});
var down = BI.createWidget({
type: "bi.icon_button",
disableSelected: true,
cls: "icon-combo-down-icon trigger-triangle-font icon-size-12",
width: 12,
height: 8
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.colorContainer,
left: 3,
right: 3,
top: 3,
bottom: 3
}, {
el: down,
right: -1,
bottom: 1
}]
});
if (BI.isNotNull(this.options.value)) {
this.setValue(this.options.value);
}
},
setValue: function (color) {
BI.ColorChooserTrigger.superclass.setValue.apply(this, arguments);
if (color === "") {
this.colorContainer.element.css("background-color", "").removeClass("trans-color-background").addClass("auto-color-background");
} else if (color === "transparent") {
this.colorContainer.element.css("background-color", "").removeClass("auto-color-background").addClass("trans-color-background");
} else {
this.colorContainer.element.css({"background-color": color}).removeClass("auto-color-background").removeClass("trans-color-background");
}
}
});
BI.ColorChooserTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.color_chooser_trigger", BI.ColorChooserTrigger);
/***/ }),
/* 723 */
/***/ (function(module, exports) {
/**
* 选色控件
*
* Created by GUY on 2015/11/17.
* @class BI.LongColorChooserTrigger
* @extends BI.Trigger
*/
BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, {
_defaultConfig: function () {
var conf = BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-chooser-trigger bi-border",
height: 22
});
},
_init: function () {
BI.LongColorChooserTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.colorContainer = BI.createWidget({
type: "bi.htape",
cls: "color-chooser-trigger-content",
items: [{
type: "bi.icon_change_button",
ref: function (_ref) {
self.changeIcon = _ref;
},
disableSelected: true,
iconCls: "auto-color-icon",
width: 24,
iconWidth: 16,
iconHeight: 16
}, {
el: {
type: "bi.label",
ref: function (_ref) {
self.label = _ref;
},
textAlign: "left",
hgap: 5,
height: 18,
text: BI.i18nText("BI-Basic_Auto")
}
}]
});
var down = BI.createWidget({
type: "bi.icon_button",
disableSelected: true,
cls: "icon-combo-down-icon trigger-triangle-font icon-size-12",
width: 12,
height: 8
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.colorContainer,
left: 3,
right: 3,
top: 3,
bottom: 3
}, {
el: down,
right: 3,
bottom: 3
}]
});
if (this.options.value) {
this.setValue(this.options.value);
}
},
setValue: function (color) {
BI.LongColorChooserTrigger.superclass.setValue.apply(this, arguments);
if (color === "") {
this.colorContainer.element.css("background-color", "");
this.changeIcon.setVisible(true);
this.label.setVisible(true);
this.changeIcon.setIcon("auto-color-icon");
this.label.setText(BI.i18nText("BI-Basic_Auto"));
} else if (color === "transparent") {
this.colorContainer.element.css("background-color", "");
this.changeIcon.setVisible(true);
this.label.setVisible(true);
this.changeIcon.setIcon("trans-color-icon");
this.label.setText(BI.i18nText("BI-Transparent_Color"));
} else {
this.colorContainer.element.css({"background-color": color});
this.changeIcon.setVisible(false);
this.label.setVisible(false);
}
}
});
BI.LongColorChooserTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.long_color_chooser_trigger", BI.LongColorChooserTrigger);
/***/ }),
/* 724 */
/***/ (function(module, exports) {
/**
* 简单选色控件按钮
*
* Created by GUY on 2015/11/16.
* @class BI.ColorPickerButton
* @extends BI.BasicButton
*/
BI.ColorPickerButton = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
var conf = BI.ColorPickerButton.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
baseCls: (conf.baseCls || "") + " bi-color-picker-button bi-background bi-border-top bi-border-left"
});
},
_init: function () {
BI.ColorPickerButton.superclass._init.apply(this, arguments);
var self = this, o = this.options;
if (o.value) {
this.element.css("background-color", o.value);
var name = this.getName();
this.element.hover(function () {
self._createMask();
if (self.isEnabled()) {
BI.Maskers.show(name);
}
}, function () {
if (!self.isSelected()) {
BI.Maskers.hide(name);
}
});
}
},
_createMask: function () {
var o = this.options, name = this.getName();
if (this.isEnabled() && !BI.Maskers.has(name)) {
var w = BI.Maskers.make(name, this, {
offset: {
left: -1,
top: -1,
right: -1,
bottom: -1
}
});
w.element.addClass("color-picker-button-mask").css("background-color", o.value);
}
},
setSelected: function (b) {
BI.ColorPickerButton.superclass.setSelected.apply(this, arguments);
if (b) {
this._createMask();
}
BI.Maskers[b ? "show" : "hide"](this.getName());
}
});
BI.ColorPickerButton.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.color_picker_button", BI.ColorPickerButton);
/***/ }),
/* 725 */
/***/ (function(module, exports) {
/**
* 简单选色控件
*
* Created by GUY on 2015/11/16.
* @class BI.ColorPicker
* @extends BI.Widget
*/
BI.ColorPicker = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.ColorPicker.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-picker",
items: null
});
},
_items: [
[{
value: "#ffffff"
}, {
value: "#f2f2f2"
}, {
value: "#e5e5e5"
}, {
value: "#d9d9d9"
}, {
value: "#cccccc"
}, {
value: "#bfbfbf"
}, {
value: "#b2b2b2"
}, {
value: "#a6a6a6"
}, {
value: "#999999"
}, {
value: "#8c8c8c"
}, {
value: "#808080"
}, {
value: "#737373"
}, {
value: "#666666"
}, {
value: "#4d4d4d"
}, {
value: "#333333"
}, {
value: "#000000"
}],
[{
value: "#d8b5a6"
}, {
value: "#ff9e9a"
}, {
value: "#ffc17d"
}, {
value: "#f5e56b"
}, {
value: "#d8e698"
}, {
value: "#e0ebaf"
}, {
value: "#c3d825"
}, {
value: "#bbe2e7"
}, {
value: "#85d3cd"
}, {
value: "#bde1e6"
}, {
value: "#a0d8ef"
}, {
value: "#89c3eb"
}, {
value: "#bbc8e6"
}, {
value: "#bbbcde"
}, {
value: "#d6b4cc"
}, {
value: "#fbc0d3"
}],
[{
value: "#bb9581"
}, {
value: "#f37d79"
}, {
value: "#fba74f"
}, {
value: "#ffdb4f"
}, {
value: "#c7dc68"
}, {
value: "#b0ca71"
}, {
value: "#99ab4e"
}, {
value: "#84b9cb"
}, {
value: "#00a3af"
}, {
value: "#2ca9e1"
}, {
value: "#0095d9"
}, {
value: "#4c6cb3"
}, {
value: "#8491c3"
}, {
value: "#a59aca"
}, {
value: "#cc7eb1"
}, {
value: "#e89bb4"
}],
[{
value: "#9d775f"
}, {
value: "#dd4b4b"
}, {
value: "#ef8b07"
}, {
value: "#fcc800"
}, {
value: "#aacf53"
}, {
value: "#82ae46"
}, {
value: "#69821b"
}, {
value: "#59b9c6"
}, {
value: "#2a83a2"
}, {
value: "#007bbb"
}, {
value: "#19448e"
}, {
value: "#274a78"
}, {
value: "#4a488e"
}, {
value: "#7058a3"
}, {
value: "#884898"
}, {
value: "#d47596"
}]
],
_init: function () {
BI.ColorPicker.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.colors = BI.createWidget({
type: "bi.button_group",
element: this,
items: BI.createItems(o.items || this._items, {
type: "bi.color_picker_button",
once: false
}),
layouts: [{
type: "bi.grid"
}],
value: o.value
});
this.colors.on(BI.ButtonGroup.EVENT_CHANGE, function () {
self.fireEvent(BI.ColorPicker.EVENT_CHANGE, arguments);
});
},
populate: function (items) {
var args = [].slice.call(arguments);
args[0] = BI.createItems(items, {
type: "bi.color_picker_button",
once: false
});
this.colors.populate.apply(this.colors, args);
},
setValue: function (color) {
this.colors.setValue(color);
},
getValue: function () {
return this.colors.getValue();
}
});
BI.ColorPicker.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.color_picker", BI.ColorPicker);
/***/ }),
/* 726 */
/***/ (function(module, exports) {
/**
* 简单选色控件
*
* Created by GUY on 2015/11/16.
* @class BI.ColorPickerEditor
* @extends BI.Widget
*/
BI.ColorPickerEditor = BI.inherit(BI.Widget, {
constants: {
REB_WIDTH: 32
},
_defaultConfig: function () {
return BI.extend(BI.ColorPickerEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-picker-editor",
// width: 200,
height: 30
});
},
_init: function () {
BI.ColorPickerEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options, c = this.constants;
this.storeValue = {};
this.colorShow = BI.createWidget({
type: "bi.layout",
cls: "color-picker-editor-display bi-card bi-border",
height: 16,
width: 16
});
var RGB = BI.createWidgets(BI.createItems([{text: "R"}, {text: "G"}, {text: "B"}], {
type: "bi.label",
cls: "color-picker-editor-label",
width: 20,
height: 20
}));
var checker = function (v) {
return BI.isNumeric(v) && (v | 0) >= 0 && (v | 0) <= 255;
};
var Ws = BI.createWidgets([{}, {}, {}], {
type: "bi.small_text_editor",
cls: "color-picker-editor-input",
validationChecker: checker,
errorText: BI.i18nText("BI-Color_Picker_Error_Text"),
allowBlank: true,
value: 255,
width: c.REB_WIDTH,
height: 20
});
BI.each(Ws, function (i, w) {
w.on(BI.TextEditor.EVENT_CHANGE, function () {
self._checkEditors();
if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
});
});
this.R = Ws[0];
this.G = Ws[1];
this.B = Ws[2];
this.none = BI.createWidget({
type: "bi.icon_button",
cls: "auto-color-icon",
width: 16,
height: 16,
iconWidth: 16,
iconHeight: 16,
title: BI.i18nText("BI-Basic_Auto")
});
this.none.on(BI.IconButton.EVENT_CHANGE, function () {
if (this.isSelected()) {
self.lastColor = self.getValue();
self.setValue("");
} else {
self.setValue(self.lastColor || "#ffffff");
}
if ((self.R.isValid() && self.G.isValid() && self.B.isValid()) || self._isEmptyRGB()) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
});
this.transparent = BI.createWidget({
type: "bi.icon_button",
cls: "trans-color-icon",
width: 16,
height: 16,
iconWidth: 16,
iconHeight: 16,
title: BI.i18nText("BI-Transparent_Color")
});
this.transparent.on(BI.IconButton.EVENT_CHANGE, function () {
if (this.isSelected()) {
self.lastColor = self.getValue();
self.setValue("transparent");
} else {
if (self.lastColor === "transparent") {
self.lastColor = "";
}
self.setValue(self.lastColor || "#ffffff");
}
if ((self.R.isValid() && self.G.isValid() && self.B.isValid()) ||
self._isEmptyRGB()) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.vertical_adapt",
items: [{
el: this.colorShow,
width: 16
}, {
el: RGB[0],
width: 20
}, {
el: this.R,
width: c.REB_WIDTH
}, {
el: RGB[1],
width: 20
}, {
el: this.G,
width: c.REB_WIDTH
}, {
el: RGB[2],
width: 20
}, {
el: this.B,
width: c.REB_WIDTH
}, {
el: this.transparent,
width: 16,
lgap: 5
}, {
el: this.none,
width: 16,
lgap: 5
}]
},
left: 10,
right: 10,
top: 0,
bottom: 0
}]
});
},
_checkEditors: function () {
if(BI.isEmptyString(this.R.getValue())) {
this.R.setValue(0);
}
if(BI.isEmptyString(this.G.getValue())) {
this.G.setValue(0);
}
if(BI.isEmptyString(this.B.getValue())) {
this.B.setValue(0);
}
this.storeValue = {
r: this.R.getValue() || 0,
g: this.G.getValue() || 0,
b: this.B.getValue() || 0
};
},
_isEmptyRGB: function () {
return BI.isEmptyString(this.storeValue.r) && BI.isEmptyString(this.storeValue.g) && BI.isEmptyString(this.storeValue.b);
},
_showPreColor: function (color) {
if (color === "") {
this.colorShow.element.css("background-color", "").removeClass("trans-color-background").addClass("auto-color-normal-background");
} else if (color === "transparent") {
this.colorShow.element.css("background-color", "").removeClass("auto-color-normal-background").addClass("trans-color-background");
} else {
this.colorShow.element.css({"background-color": color}).removeClass("auto-color-normal-background").removeClass("trans-color-background");
}
},
_setEnable: function (enable) {
BI.ColorPickerEditor.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
},
setValue: function (color) {
if (color === "transparent") {
this.transparent.setSelected(true);
this.none.setSelected(false);
this._showPreColor("transparent");
this.R.setValue("");
this.G.setValue("");
this.B.setValue("");
this.storeValue = {
r: "",
g: "",
b: ""
};
return;
}
if (!color) {
color = "";
this.none.setSelected(true);
} else {
this.none.setSelected(false);
}
this.transparent.setSelected(false);
this._showPreColor(color);
var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color));
this.storeValue = {
r: BI.isNull(json.r) ? "" : json.r,
g: BI.isNull(json.r) ? "" : json.g,
b: BI.isNull(json.r) ? "" : json.b
};
this.R.setValue(this.storeValue.r);
this.G.setValue(this.storeValue.g);
this.B.setValue(this.storeValue.b);
},
getValue: function () {
if (this._isEmptyRGB() && this.transparent.isSelected()) {
return "transparent";
}
return BI.DOM.rgb2hex(BI.DOM.json2rgb({
r: this.storeValue.r,
g: this.storeValue.g,
b: this.storeValue.b
}));
}
});
BI.ColorPickerEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.color_picker_editor", BI.ColorPickerEditor);
/***/ }),
/* 727 */
/***/ (function(module, exports) {
/**
* 简单选色控件
*
* Created by GUY on 2015/11/16.
* @class BI.SimpleColorPickerEditor
* @extends BI.Widget
*/
BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, {
constants: {
REB_WIDTH: 32
},
_defaultConfig: function () {
return BI.extend(BI.SimpleColorPickerEditor.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-color-picker-editor",
// width: 200,
height: 30
});
},
_init: function () {
BI.SimpleColorPickerEditor.superclass._init.apply(this, arguments);
var self = this, o = this.options, c = this.constants;
this.colorShow = BI.createWidget({
type: "bi.layout",
cls: "color-picker-editor-display bi-card bi-border",
height: 16,
width: 16
});
var RGB = BI.createWidgets(BI.createItems([{text: "R"}, {text: "G"}, {text: "B"}], {
type: "bi.label",
cls: "color-picker-editor-label",
width: 20,
height: 20
}));
var checker = function (v) {
return BI.isNumeric(v) && (v | 0) >= 0 && (v | 0) <= 255;
};
var Ws = BI.createWidgets([{}, {}, {}], {
type: "bi.small_text_editor",
cls: "color-picker-editor-input",
validationChecker: checker,
errorText: BI.i18nText("BI-Color_Picker_Error_Text"),
allowBlank: true,
value: 255,
width: c.REB_WIDTH,
height: 20
});
BI.each(Ws, function (i, w) {
w.on(BI.TextEditor.EVENT_CHANGE, function () {
self._checkEditors();
if (self.R.isValid() && self.G.isValid() && self.B.isValid()) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE);
}
});
});
this.R = Ws[0];
this.G = Ws[1];
this.B = Ws[2];
BI.createWidget({
type: "bi.vertical_adapt",
element: this,
items: [{
el: this.colorShow,
width: 16,
lgap: 20,
rgap: 15
}, {
el: RGB[0],
width: 20
}, {
el: this.R,
width: c.REB_WIDTH
}, {
el: RGB[1],
width: 20
}, {
el: this.G,
width: c.REB_WIDTH
}, {
el: RGB[2],
width: 20
}, {
el: this.B,
width: c.REB_WIDTH
}]
});
},
_checkEditors: function () {
if(BI.isEmptyString(this.R.getValue())) {
this.R.setValue(0);
}
if(BI.isEmptyString(this.G.getValue())) {
this.G.setValue(0);
}
if(BI.isEmptyString(this.B.getValue())) {
this.B.setValue(0);
}
},
setValue: function (color) {
this.colorShow.element.css({"background-color": color});
var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color));
this.R.setValue(BI.isNull(json.r) ? "" : json.r);
this.G.setValue(BI.isNull(json.g) ? "" : json.g);
this.B.setValue(BI.isNull(json.b) ? "" : json.b);
},
getValue: function () {
return BI.DOM.rgb2hex(BI.DOM.json2rgb({
r: this.R.getValue(),
g: this.G.getValue(),
b: this.B.getValue()
}));
}
});
BI.SimpleColorPickerEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.simple_color_picker_editor", BI.SimpleColorPickerEditor);
/***/ }),
/* 728 */
/***/ (function(module, exports) {
BI.Farbtastic = BI.inherit(BI.BasicButton, {
constants: {
RADIUS: 84,
SQUARE: 100,
WIDTH: 194
},
props: {
baseCls: "bi-farbtastic",
width: 195,
height: 195,
stopPropagation: true,
value: "#000000"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.layout",
cls: "",
ref: function (_ref) {
self.colorWrapper = _ref;
}
},
top: 47,
left: 47,
width: 101,
height: 101
}, {
el: {
type: "bi.layout",
cls: "wheel",
ref: function (_ref) {
self.wheel = _ref;
}
},
left: 0,
right: 0,
top: 0,
bottom: 0
}, {
el: {
type: "bi.layout",
cls: "overlay",
ref: function (_ref) {
self.overlay = _ref;
}
},
top: 47,
left: 47,
width: 101,
height: 101
}, {
el: {
type: "bi.layout",
cls: "marker",
ref: function (_ref) {
self.hMarker = _ref;
},
scrollable: false,
width: 17,
height: 17
}
}, {
el: {
type: "bi.layout",
cls: "marker",
ref: function (_ref) {
self.slMarker = _ref;
},
scrollable: false,
width: 17,
height: 17
}
}]
};
},
mounted: function () {
var o = this.options;
if (BI.isKey(o.value)) {
this.setValue(o.value);
}
},
_unpack: function (color) {
if (color.length === 7) {
return [parseInt("0x" + color.substring(1, 3)) / 255,
parseInt("0x" + color.substring(3, 5)) / 255,
parseInt("0x" + color.substring(5, 7)) / 255];
} else if (color.length === 4) {
return [parseInt("0x" + color.substring(1, 2)) / 15,
parseInt("0x" + color.substring(2, 3)) / 15,
parseInt("0x" + color.substring(3, 4)) / 15];
}
},
_pack: function (rgb) {
var r = Math.round(rgb[0] * 255);
var g = Math.round(rgb[1] * 255);
var b = Math.round(rgb[2] * 255);
return "#" + (r < 16 ? "0" : "") + r.toString(16) +
(g < 16 ? "0" : "") + g.toString(16) +
(b < 16 ? "0" : "") + b.toString(16);
},
_setColor: function (color) {
var unpack = this._unpack(color);
if (this.value !== color && unpack) {
this.value = color;
this.rgb = unpack;
this.hsl = this._RGBToHSL(this.rgb);
this._updateDisplay();
}
},
_setHSL: function (hsl) {
this.hsl = hsl;
this.rgb = this._HSLToRGB(hsl);
this.value = this._pack(this.rgb);
this._updateDisplay();
return this;
},
_HSLToRGB: function (hsl) {
var m1, m2, r, g, b;
var h = hsl[0], s = hsl[1], l = hsl[2];
m2 = (l <= 0.5) ? l * (s + 1) : l + s - l * s;
m1 = l * 2 - m2;
return [this._hueToRGB(m1, m2, h + 0.33333),
this._hueToRGB(m1, m2, h),
this._hueToRGB(m1, m2, h - 0.33333)];
},
_hueToRGB: function (m1, m2, h) {
h = (h < 0) ? h + 1 : ((h > 1) ? h - 1 : h);
if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
if (h * 2 < 1) return m2;
if (h * 3 < 2) return m1 + (m2 - m1) * (0.66666 - h) * 6;
return m1;
},
_RGBToHSL: function (rgb) {
var min, max, delta, h, s, l;
var r = rgb[0], g = rgb[1], b = rgb[2];
min = Math.min(r, Math.min(g, b));
max = Math.max(r, Math.max(g, b));
delta = max - min;
l = (min + max) / 2;
s = 0;
if (l > 0 && l < 1) {
s = delta / (l < 0.5 ? (2 * l) : (2 - 2 * l));
}
h = 0;
if (delta > 0) {
if (max == r && max != g) h += (g - b) / delta;
if (max == g && max != b) h += (2 + (b - r) / delta);
if (max == b && max != r) h += (4 + (r - g) / delta);
h /= 6;
}
return [h, s, l];
},
_updateDisplay: function () {
var angle = this.hsl[0] * 6.28;
this.hMarker.element.css({
left: Math.round(Math.sin(angle) * this.constants.RADIUS + this.constants.WIDTH / 2) + "px",
top: Math.round(-Math.cos(angle) * this.constants.RADIUS + this.constants.WIDTH / 2) + "px"
});
this.slMarker.element.css({
left: Math.round(this.constants.SQUARE * (.5 - this.hsl[1]) + this.constants.WIDTH / 2) + "px",
top: Math.round(this.constants.SQUARE * (.5 - this.hsl[2]) + this.constants.WIDTH / 2) + "px"
});
// Saturation/Luminance gradient
this.colorWrapper.element.css("backgroundColor", this._pack(this._HSLToRGB([this.hsl[0], 1, 0.5])));
this.fireEvent(BI.Farbtastic.EVENT_CHANGE, this.getValue(), this);
},
_absolutePosition: function (el) {
var r = {x: el.offsetLeft, y: el.offsetTop};
// Resolve relative to offsetParent
if (el.offsetParent) {
var tmp = this._absolutePosition(el.offsetParent);
r.x += tmp.x;
r.y += tmp.y;
}
return r;
},
_widgetCoords: function (event) {
var x, y;
var el = event.target || event.srcElement;
var reference = this.wheel.element[0];
if (typeof event.offsetX !== "undefined") {
// Use offset coordinates and find common offsetParent
var pos = {x: event.offsetX, y: event.offsetY};
// Send the coordinates upwards through the offsetParent chain.
var e = el;
while (e) {
e.mouseX = pos.x;
e.mouseY = pos.y;
pos.x += e.offsetLeft;
pos.y += e.offsetTop;
e = e.offsetParent;
}
// Look for the coordinates starting from the wheel widget.
var e = reference;
var offset = {x: 0, y: 0};
while (e) {
if (typeof e.mouseX !== "undefined") {
x = e.mouseX - offset.x;
y = e.mouseY - offset.y;
break;
}
offset.x += e.offsetLeft;
offset.y += e.offsetTop;
e = e.offsetParent;
}
// Reset stored coordinates
e = el;
while (e) {
e.mouseX = undefined;
e.mouseY = undefined;
e = e.offsetParent;
}
} else {
// Use absolute coordinates
var pos = this._absolutePosition(reference);
x = (event.pageX || 0) - pos.x;
y = (event.pageY || 0) - pos.y;
}
// Subtract distance to middle
return {x: x - this.constants.WIDTH / 2, y: y - this.constants.WIDTH / 2};
},
_doMouseMove: function (event) {
var pos = this._widgetCoords(event);
// Set new HSL parameters
if (this.circleDrag) {
var hue = Math.atan2(pos.x, -pos.y) / 6.28;
if (hue < 0) hue += 1;
this._setHSL([hue, this.hsl[1], this.hsl[2]]);
} else {
var sat = Math.max(0, Math.min(1, -(pos.x / this.constants.SQUARE) + .5));
var lum = Math.max(0, Math.min(1, -(pos.y / this.constants.SQUARE) + .5));
this._setHSL([this.hsl[0], sat, lum]);
}
},
doClick: function (event) {
var pos = this._widgetCoords(event);
this.circleDrag = Math.max(Math.abs(pos.x), Math.abs(pos.y)) * 2 > this.constants.SQUARE;
// Process
this._doMouseMove(event);
return false;
},
setValue: function (color) {
this._setColor(color);
},
getValue: function () {
return this.value;
}
});
BI.Farbtastic.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.farbtastic", BI.Farbtastic);
/***/ }),
/* 729 */
/***/ (function(module, exports) {
/**
* guy
* 异步树
* @class BI.DisplayTree
* @extends BI.TreeView
*/
BI.DisplayTree = BI.inherit(BI.TreeView, {
_defaultConfig: function () {
return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-display-tree"
});
},
_init: function () {
BI.DisplayTree.superclass._init.apply(this, arguments);
},
// 配置属性
_configSetting: function () {
var setting = {
view: {
selectedMulti: false,
dblClickExpand: false,
showIcon: false,
nameIsHTML: true,
showTitle: false
},
data: {
key: {
title: "title",
name: "text"
},
simpleData: {
enable: true
}
},
callback: {
beforeCollapse: beforeCollapse
}
};
function beforeCollapse(treeId, treeNode) {
return false;
}
return setting;
},
_dealWidthNodes: function (nodes) {
nodes = BI.DisplayTree.superclass._dealWidthNodes.apply(this, arguments);
var self = this, o = this.options;
BI.each(nodes, function (i, node) {
node.isParent = node.isParent || node.parent;
if (node.text == null) {
if (node.count > 0) {
node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")";
}
}
});
return nodes;
},
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
BI.DisplayTree.superclass.destroy.apply(this, arguments);
}
});
BI.DisplayTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.display_tree", BI.DisplayTree);
/***/ }),
/* 730 */
/***/ (function(module, exports) {
/**
* guy
* 异步树
* @class BI.ListListDisplayTree
* @extends BI.TreeView
*/
BI.ListDisplayTree = BI.inherit(BI.ListTreeView, {
_defaultConfig: function () {
return BI.extend(BI.ListDisplayTree.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-list-display-tree"
});
},
_init: function () {
BI.ListDisplayTree.superclass._init.apply(this, arguments);
},
// 配置属性
_configSetting: function () {
var setting = {
view: {
selectedMulti: false,
dblClickExpand: false,
showIcon: false,
nameIsHTML: true,
showTitle: false,
fontCss: getFont
},
data: {
key: {
title: "title",
name: "text"
},
simpleData: {
enable: true
}
},
callback: {
beforeCollapse: beforeCollapse
}
};
function beforeCollapse(treeId, treeNode) {
return false;
}
function getFont(treeId, node) {
return node.isLeaf ? {} : {color: "#999999"};
}
return setting;
},
_dealWidthNodes: function (nodes) {
nodes = BI.ListDisplayTree.superclass._dealWidthNodes.apply(this, arguments);
var self = this, o = this.options;
BI.each(nodes, function (i, node) {
node.isParent = node.isParent || node.parent;
if (node.text == null) {
if (node.count > 0) {
node.text = node.value + "(" + BI.i18nText("BI-Basic_Altogether") + node.count + BI.i18nText("BI-Basic_Count") + ")";
}
}
});
return nodes;
},
initTree: function (nodes, setting) {
var setting = setting || this._configSetting();
this.nodes = BI.$.fn.zTree.init(this.tree.element, setting, nodes);
},
destroy: function () {
BI.ListDisplayTree.superclass.destroy.apply(this, arguments);
}
});
BI.ListDisplayTree.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.list_display_tree", BI.ListDisplayTree);
/***/ }),
/* 731 */
/***/ (function(module, exports) {
/**
* 简单的多选树
*
* Created by GUY on 2016/2/16.
* @class BI.SimpleTreeView
* @extends BI.Widget
*/
BI.SimpleTreeView = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-simple-tree",
itemsCreator: BI.emptyFn,
items: null
});
},
_init: function () {
BI.SimpleTreeView.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.structure = new BI.Tree();
this.tree = BI.createWidget({
type: "bi.tree_view",
element: this,
itemsCreator: function (op, callback) {
var fn = function (items) {
callback({
items: items
});
self.structure.initTree(BI.Tree.transformToTreeFormat(items));
};
if (BI.isNotNull(o.items)) {
fn(o.items);
} else {
o.itemsCreator(op, fn);
}
}
});
this.tree.on(BI.TreeView.EVENT_CHANGE, function () {
self.fireEvent(BI.SimpleTreeView.EVENT_CHANGE, arguments);
});
if (BI.isNotEmptyArray(o.items)) {
this.populate();
}
if (BI.isNotNull(o.value)) {
this.setValue(o.value);
}
},
populate: function (items, keyword) {
if (items) {
this.options.items = items;
}
this.tree.stroke({
keyword: keyword
});
},
_digest: function (v) {
v || (v = []);
var self = this, map = {};
var selected = [];
BI.each(v, function (i, val) {
var node = self.structure.search(val, "value");
if (node) {
var p = node;
p = p.getParent();
if (p) {
if (!map[p.value]) {
map[p.value] = 0;
}
map[p.value]++;
}
while (p && p.getChildrenLength() <= map[p.value]) {
selected.push(p.value);
p = p.getParent();
if (p) {
if (!map[p.value]) {
map[p.value] = 0;
}
map[p.value]++;
}
}
}
});
return BI.makeObject(v.concat(selected));
},
setValue: function (v) {
this.tree.setValue(this._digest(v));
},
_getValue: function () {
var self = this, result = [], val = this.tree.getValue();
var track = function (nodes) {
BI.each(nodes, function (key, node) {
if (BI.isEmpty(node)) {
result.push(key);
} else {
track(node);
}
});
};
track(val);
return result;
},
empty: function () {
this.tree.empty();
},
getValue: function () {
var self = this, result = [], val = this._getValue();
BI.each(val, function (i, key) {
var target = self.structure.search(key, "value");
if (target) {
self.structure._traverse(target, function (node) {
if (node.isLeaf()) {
result.push(node.value);
}
});
}
});
return result;
}
});
BI.SimpleTreeView.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.simple_tree", BI.SimpleTreeView);
/***/ }),
/* 732 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 733 */,
/* 734 */,
/* 735 */,
/* 736 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {module.exports = global["Fix"] = __webpack_require__(737);
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(13)))
/***/ }),
/* 737 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(setImmediate) {function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
(function (global, factory) {
true ? factory(exports) : undefined;
})(this, function (exports) {
'use strict';
function noop(a, b, c) {}
function isNative(Ctor) {
return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
}
var rhashcode = /\d\.\d{4}/;
//生成UUID http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
function makeHashCode(prefix) {
/* istanbul ignore next*/
prefix = prefix || 'bi';
/* istanbul ignore next*/
return String(Math.random() + Math.random()).replace(rhashcode, prefix);
}
var hasProto = '__proto__' in {};
var isIE = function isIE() {
if (typeof navigator === "undefined") {
return false;
}
return (/(msie|trident)/i.test(navigator.userAgent.toLowerCase())
);
};
var getIEVersion = function getIEVersion() {
var version = 0;
if (typeof navigator === "undefined") {
return false;
}
var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/);
var v2 = agent.match(/(?:trident.*rv:([\w.]+))/);
if (v1 && v2 && v1[1] && v2[1]) {
version = Math.max(v1[1] * 1, v2[1] * 1);
} else if (v1 && v1[1]) {
version = v1[1] * 1;
} else if (v2 && v2[1]) {
version = v2[1] * 1;
} else {
version = 0;
}
return version;
};
var isIE9Below = isIE() && getIEVersion() < 9;
var _toString = Object.prototype.toString;
function isPlainObject(obj) {
return _toString.call(obj) === '[object Object]';
}
function isConfigurable(obj, key) {
var configurable = true;
var property = Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(obj, key);
if (property && property.configurable === false) {
configurable = false;
}
return configurable;
}
function isExtensible(obj) {
if (Object.isExtensible) {
return Object.isExtensible(obj);
}
var name = '';
while (obj.hasOwnProperty(name)) {
name += '?';
}
obj[name] = true;
var returnValue = obj.hasOwnProperty(name);
delete obj[name];
return returnValue;
}
function remove(arr, item) {
if (arr && arr.length) {
var _index = arr.indexOf(item);
if (_index > -1) {
return arr.splice(_index, 1);
}
}
}
var bailRE = /[^\w.$]/;
function parsePath(path) {
if (bailRE.test(path)) {
return;
}
var segments = path.split('.');
return function (obj) {
for (var i = 0; i < segments.length; i++) {
if (!obj) return;
obj = obj[segments[i]];
}
return obj;
};
}
var nextTick = function () {
var callbacks = [];
var pending = false;
var timerFunc = void 0;
function nextTickHandler() {
pending = false;
var copies = callbacks.slice(0);
callbacks.length = 0;
for (var i = 0; i < copies.length; i++) {
copies[i]();
}
}
// An asynchronous deferring mechanism.
// In pre 2.4, we used to use microtasks (Promise/MutationObserver)
// but microtasks actually has too high a priority and fires in between
// supposedly sequential events (e.g. #4521, #6690) or even between
// bubbling of the same event (#6566). Technically setImmediate should be
// the ideal choice, but it's not available everywhere; and the only polyfill
// that consistently queues the callback after all DOM events triggered in the
// same loop is by using MessageChannel.
/* istanbul ignore if */
if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
timerFunc = function timerFunc() {
setImmediate(nextTickHandler);
};
} else if (typeof MessageChannel !== 'undefined' && (isNative(MessageChannel) ||
// PhantomJS
MessageChannel.toString() === '[object MessageChannelConstructor]')) {
var channel = new MessageChannel();
var port = channel.port2;
channel.port1.onmessage = nextTickHandler;
timerFunc = function timerFunc() {
port.postMessage(1);
};
} else
/* istanbul ignore next */
if (typeof Promise !== 'undefined' && isNative(Promise)) {
// use microtask in non-DOM environments, e.g. Weex
var p = Promise.resolve();
timerFunc = function timerFunc() {
p.then(nextTickHandler);
};
} else {
// fallback to setTimeout
timerFunc = function timerFunc() {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick(cb, ctx) {
var _resolve = void 0;
callbacks.push(function () {
if (cb) {
try {
cb.call(ctx);
} catch (e) {
console.error(e);
}
} else if (_resolve) {
_resolve(ctx);
}
});
if (!pending) {
pending = true;
timerFunc();
}
// $flow-disable-line
if (!cb && typeof Promise !== 'undefined') {
return new Promise(function (resolve, reject) {
_resolve = resolve;
});
}
};
}();
var falsy;
var $$skipArray = {
__ob__: falsy,
$accessors: falsy,
$vbthis: falsy,
$vbsetter: falsy
};
var uid = 0;
/**
* A dep is an observable that can have multiple
* directives subscribing to it.
*/
var Dep = function () {
function Dep() {
_classCallCheck(this, Dep);
this.id = uid++;
this.subs = [];
}
Dep.prototype.addSub = function addSub(sub) {
this.subs.push(sub);
};
Dep.prototype.removeSub = function removeSub(sub) {
remove(this.subs, sub);
};
Dep.prototype.depend = function depend() {
if (Dep.target) {
Dep.target.addDep(this);
}
};
Dep.prototype.notify = function notify(options) {
// stabilize the subscriber list first
var subs = this.subs.slice();
for (var i = 0, l = subs.length; i < l; i++) {
subs[i].update(options);
}
};
return Dep;
}();
// the current target watcher being evaluated.
// this is globally unique because there could be only one
// watcher being evaluated at any time.
Dep.target = null;
var targetStack = [];
function pushTarget(_target) {
if (Dep.target) targetStack.push(Dep.target);
Dep.target = _target;
}
function popTarget() {
Dep.target = targetStack.pop();
}
var arrayProto = Array.prototype;
var arrayMethods = [];
_.each(['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'], function (method) {
var original = arrayProto[method];
arrayMethods[method] = function mutator() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var ob = this.__ob__;
var inserted = void 0;
switch (method) {
case 'push':
case 'unshift':
inserted = args;
break;
case 'splice':
inserted = args.slice(2);
break;
}
if (inserted) inserted = ob.observeArray(inserted);
switch (method) {
case 'push':
case 'unshift':
args = inserted;
break;
case 'splice':
args = [args[0], args[1]].concat(inserted ? inserted : []);
break;
}
var result = original.apply(this, args);
notify(ob.parent, ob.parentKey, ob.dep, true);
return result;
};
});
//如果浏览器不支持ecma262v5的Object.defineProperties或者存在BUG,比如IE8
//标准浏览器使用__defineGetter__, __defineSetter__实现
var canHideProperty = true;
try {
Object.defineProperty({}, '_', {
value: 'x'
});
delete $$skipArray.$vbsetter;
delete $$skipArray.$vbthis;
} catch (e) {
/* istanbul ignore next*/
canHideProperty = false;
}
var createViewModel = Object.defineProperties;
var defineProperty = void 0;
var timeBucket = new Date() - 0;
/* istanbul ignore if*/
if (!canHideProperty) {
if ('__defineGetter__' in {}) {
defineProperty = function defineProperty(obj, prop, desc) {
if ('value' in desc) {
obj[prop] = desc.value;
}
if ('get' in desc) {
obj.__defineGetter__(prop, desc.get);
}
if ('set' in desc) {
obj.__defineSetter__(prop, desc.set);
}
return obj;
};
createViewModel = function createViewModel(obj, descs) {
for (var prop in descs) {
if (descs.hasOwnProperty(prop)) {
defineProperty(obj, prop, descs[prop]);
}
}
return obj;
};
}
/* istanbul ignore if*/
if (isIE9Below) {
var VBClassPool = {};
window.execScript([// jshint ignore:line
'Function parseVB(code)', '\tExecuteGlobal(code)', 'End Function' //转换一段文本为VB代码
].join('\n'), 'VBScript');
var VBMediator = function VBMediator(instance, accessors, name, value) {
// jshint ignore:line
var accessor = accessors[name];
if (arguments.length === 4) {
accessor.set.call(instance, value);
} else {
return accessor.get.call(instance);
}
};
createViewModel = function createViewModel(name, accessors, properties) {
// jshint ignore:line
var buffer = [];
buffer.push('\tPrivate [$vbsetter]', '\tPublic [$accessors]', '\tPublic Default Function [$vbthis](ac' + timeBucket + ', s' + timeBucket + ')', '\t\tSet [$accessors] = ac' + timeBucket + ': set [$vbsetter] = s' + timeBucket, '\t\tSet [$vbthis] = Me', //链式调用
'\tEnd Function');
//添加普通属性,因为VBScript对象不能像JS那样随意增删属性,必须在这里预先定义好
var uniq = {
$vbthis: true,
$vbsetter: true,
$accessors: true
};
for (name in $$skipArray) {
if (!uniq[name]) {
buffer.push('\tPublic [' + name + ']');
uniq[name] = true;
}
}
//添加访问器属性
for (name in accessors) {
if (uniq[name]) {
continue;
}
uniq[name] = true;
buffer.push(
//由于不知对方会传入什么,因此set, let都用上
'\tPublic Property Let [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Set [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Get [' + name + ']', //getter
'\tOn Error Resume Next', //必须优先使用set语句,否则它会误将数组当字符串返回
'\t\tSet[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tIf Err.Number <> 0 Then', '\t\t[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tEnd If', '\tOn Error Goto 0', '\tEnd Property');
}
for (name in properties) {
if (!uniq[name]) {
uniq[name] = true;
buffer.push('\tPublic [' + name + ']');
}
}
buffer.push('\tPublic [hasOwnProperty]');
buffer.push('End Class');
var body = buffer.join('\r\n');
var className = VBClassPool[body];
if (!className) {
className = makeHashCode('VBClass');
window.parseVB('Class ' + className + body);
window.parseVB(['Function ' + className + 'Factory(acc, vbm)', //创建实例并传入两个关键的参数
'\tDim o', '\tSet o = (New ' + className + ')(acc, vbm)', '\tSet ' + className + 'Factory = o', 'End Function'].join('\r\n'));
VBClassPool[body] = className;
}
var ret = window[className + 'Factory'](accessors, VBMediator); //得到其产品
return ret; //得到其产品
};
}
}
var createViewModel$1 = createViewModel;
var arrayKeys = _.keys(arrayMethods);
var observerState = {
shouldConvert: true
};
function def(obj, key, val, enumerable) {
Object.defineProperty(obj, key, {
value: val,
enumerable: !!enumerable,
writable: true,
configurable: true
});
}
/**
* Observer class that are attached to each observed
* object. Once attached, the observer converts target
* object's property keys into getter/setters that
* collect dependencies and dispatches updates.
*/
var Observer = function () {
function Observer(value) {
_classCallCheck(this, Observer);
this.value = value;
this.dep = new Dep();
this.vmCount = 0;
if (_.isArray(value)) {
var augment = hasProto ? protoAugment : copyAugment;
augment(value, arrayMethods, arrayKeys);
this.model = this.observeArray(value);
} else {
this.model = this.walk(value);
}
if (isIE9Below) {
this.model['__ob__'] = this;
} else {
def(this.model, "__ob__", this);
}
}
Observer.prototype.walk = function walk(obj) {
return defineReactive(obj, this);
};
Observer.prototype.observeArray = function observeArray(items) {
for (var i = 0, l = items.length; i < l; i++) {
var ob = observe(items[i], this, i);
items[i] = ob ? ob.model : items[i];
}
return items;
};
return Observer;
}();
function protoAugment(target, src, keys) {
/* eslint-disable no-proto */
target.__proto__ = src;
/* eslint-enable no-proto */
}
/* istanbul ignore next */
function copyAugment(target, src, keys) {
for (var i = 0, l = keys.length; i < l; i++) {
var key = keys[i];
target[key] = src[key];
}
}
function observe(value, parentObserver, parentKey) {
if (!_.isObject(value)) {
return;
}
var ob = void 0;
if (value.__ob__ instanceof Observer) {
ob = value.__ob__;
} else if (observerState.shouldConvert && isExtensible(value) && (_.isArray(value) || isPlainObject(value))) {
ob = new Observer(value);
}
if (ob) {
ob.parent = parentObserver || ob.parent;
ob.parentKey = parentKey;
}
return ob;
}
function notify(observer, key, dep, refresh) {
dep.notify({ observer: observer, key: key, refresh: refresh });
if (observer) {
//触发a.*绑定的依赖
_.each(observer._deps, function (dep) {
dep.notify({ observer: observer, key: key });
});
//触发a.**绑定的依赖
var parent = observer,
root = observer,
route = key || "";
while (parent) {
_.each(parent._scopeDeps, function (dep) {
dep.notify({ observer: observer, key: key });
});
if (parent.parentKey != null) {
route = parent.parentKey + '.' + route;
}
root = parent;
parent = parent.parent;
}
for (var _key2 in root._globalDeps) {
var reg = new RegExp(_key2);
if (reg.test(route)) {
root._globalDeps[_key2].notify({ observer: observer, key: _key2 });
}
}
}
}
function defineReactive(obj, observer, shallow) {
var props = {};
var model = void 0;
// if (typeof Proxy === 'function') {
// const deps = {}, childObs = {}, cache = {}
// _.each(obj, function (val, key) {
// if (key in $$skipArray) {
// return
// }
// cache[key] = val
// const dep = deps[key] = (observer && observer['__dep' + key]) || new Dep()
// observer && (observer['__dep' + key] = dep)
// childObs[key] = !shallow && observe(val, observer, key)
// })
// return model = new Proxy(props, {
// has: function (target, key) {
// return key in obj;
// },
// get: function (target, key) {
// if (key in $$skipArray) {
// return target[key]
// }
// const value = cache[key]
// if (Dep.target) {
// deps[key].depend()
// if (childObs[key]) {
// childObs[key].dep.depend()
// if (_.isArray(value)) {
// dependArray(value)
// }
// }
// }
// return value
// },
// set: function (target, key, newVal) {
// if (key in $$skipArray) {
// return target[key] = newVal
// }
// const value = cache[key], dep = deps[key]
// if (newVal === value || (newVal !== newVal && value !== value)) {
// return newVal
// }
// cache[key] = newVal
// childObs[key] = !shallow && observe(newVal, observer, key)
// obj[key] = childObs[key] ? childObs[key].model : newVal
// notify(model, key, dep)
// return obj[key]
// }
// })
// }
_.each(obj, function (val, key) {
if (key in $$skipArray) {
return;
}
var configurable = isConfigurable(obj, key);
var dep = observer && observer['__dep' + key] || new Dep();
observer && (observer['__dep' + key] = dep);
var childOb = configurable && !shallow && observe(val, observer, key);
props[key] = {
enumerable: true,
configurable: true,
get: function reactiveGetter() {
var value = childOb ? childOb.model : val;
if (Dep.target) {
dep.depend();
if (childOb) {
childOb.dep.depend();
if (_.isArray(value)) {
dependArray(value);
}
}
}
return value;
},
set: function reactiveSetter(newVal) {
var value = childOb ? childOb.model : val;
if (newVal === value || newVal !== newVal && value !== value) {
return;
}
val = newVal;
childOb = configurable && !shallow && observe(newVal, observer, key);
if (childOb && value && value.__ob__) {
childOb._scopeDeps = value.__ob__._scopeDeps;
childOb._deps = value.__ob__._deps;
}
obj[key] = childOb ? childOb.model : newVal;
notify(model.__ob__, key, dep);
}
};
});
return model = createViewModel$1(obj, props);
}
/**
* Set a property on an object. Adds the new property and
* triggers change notification if the property doesn't
* already exist.
*/
function set(target, key, val) {
if (_.isArray(target)) {
target.length = Math.max(target.length, key);
target.splice(key, 1, val);
return val;
}
if (_.has(target, key)) {
target[key] = val;
return val;
}
var ob = target.__ob__;
if (!ob) {
target[key] = val;
return val;
}
ob.value[key] = val;
target = defineReactive(ob.value, ob);
notify(ob, key, ob.dep);
return target;
}
/**
* Delete a property and trigger change if necessary.
*/
function del(target, key) {
if (_.isArray(target)) {
target.splice(key, 1);
return;
}
var ob = target.__ob__;
if (!_.has(target, key)) {
return;
}
if (!ob) {
delete target[key];
return target;
}
delete ob.value[key];
target = defineReactive(ob.value, ob);
notify(ob, key, ob.dep);
return target;
}
/**
* Collect dependencies on array elements when the array is touched, since
* we cannot intercept array element access like property getters.
*/
function dependArray(value) {
for (var e, i = 0, l = value.length; i < l; i++) {
e = value[i];
e && e.__ob__ && e.__ob__.dep.depend();
if (_.isArray(e)) {
dependArray(e);
}
}
}
var queue = [];
var activatedChildren = [];
var has = {};
var waiting = false;
var flushing = false;
var index = 0;
function resetSchedulerState() {
index = queue.length = activatedChildren.length = 0;
has = {};
waiting = flushing = false;
}
function flushSchedulerQueue() {
flushing = true;
var watcher = void 0,
id = void 0,
options = void 0;
// Sort queue before flush.
// This ensures that:
// 1. Components are updated from parent to child. (because parent is always
// created before the child)
// 2. A component's user watchers are run before its render watcher (because
// user watchers are created before the render watcher)
// 3. If a component is destroyed during a parent component's watcher run,
// its watchers can be skipped.
queue.sort(function (a, b) {
return a.id - b.id;
});
// do not cache length because more watchers might be pushed
// as we run existing watchers
for (index = 0; index < queue.length; index++) {
watcher = queue[index].watcher;
options = queue[index].options;
id = watcher.id;
has[id] = null;
watcher.run(options);
}
resetSchedulerState();
}
function queueWatcher(watcher, options) {
var id = watcher.id;
if (has[id] == null) {
has[id] = true;
if (!flushing) {
queue.push({ watcher: watcher, options: options });
} else {
// if already flushing, splice the watcher based on its id
// if already past its id, it will be run next immediately.
var i = queue.length - 1;
while (i > index && queue[i].watcher.id > watcher.id) {
i--;
}
queue.splice(i + 1, 0, { watcher: watcher, options: options });
}
// queue the flush
if (!waiting) {
waiting = true;
nextTick(flushSchedulerQueue);
}
}
}
var uid$1 = 0;
var Watcher = function () {
function Watcher(vm, expOrFn, cb, options) {
_classCallCheck(this, Watcher);
this.vm = vm;
// vm._watchers || (vm._watchers = [])
// vm._watchers.push(this)
// options
if (options) {
this.deep = !!options.deep;
this.user = !!options.user;
this.lazy = !!options.lazy;
this.sync = !!options.sync;
} else {
this.deep = this.user = this.lazy = this.sync = false;
}
this.cb = cb;
this.id = ++uid$1; // uid for batching
this.active = true;
this.dirty = this.lazy; // for lazy watchers
this.deps = [];
this.newDeps = [];
this.depIds = new Set();
this.newDepIds = new Set();
this.expression = '';
// parse expression for getter
if (typeof expOrFn === 'function') {
this.getter = expOrFn;
} else {
this.getter = parsePath(expOrFn);
if (!this.getter) {
this.getter = function () {};
}
}
this.value = this.lazy ? undefined : this.get();
}
Watcher.prototype.get = function get() {
pushTarget(this);
var value = void 0;
var vm = this.vm;
try {
value = this.getter.call(vm, vm);
} catch (e) {
// if (this.user) {
// } else {
// console.error(e)
// }
} finally {
// "touch" every property so they are all tracked as
// dependencies for deep watching
if (this.deep) {
traverse(value);
}
popTarget();
this.cleanupDeps();
}
return value;
};
Watcher.prototype.addDep = function addDep(dep) {
var id = dep.id;
if (!this.newDepIds.has(id)) {
this.newDepIds.add(id);
this.newDeps.push(dep);
if (!this.depIds.has(id)) {
dep.addSub(this);
}
}
};
Watcher.prototype.cleanupDeps = function cleanupDeps() {
var i = this.deps.length;
while (i--) {
var dep = this.deps[i];
if (!this.newDepIds.has(dep.id)) {
dep.removeSub(this);
}
}
var tmp = this.depIds;
this.depIds = this.newDepIds;
this.newDepIds = tmp;
this.newDepIds.clear();
tmp = this.deps;
this.deps = this.newDeps;
this.newDeps = tmp;
this.newDeps.length = 0;
};
Watcher.prototype.update = function update(options) {
/* istanbul ignore else */
if (this.lazy) {
this.dirty = true;
} else if (this.sync) {
this.run(options);
} else {
queueWatcher(this, options);
}
};
Watcher.prototype.run = function run(options) {
if (this.active) {
var value = this.get();
if (value !== this.value ||
// Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may
// have mutated.
options && options.refresh || this.deep) {
// set new value
var oldValue = this.value;
this.value = value;
if (this.user) {
try {
this.cb.call(this.vm, value, oldValue, options);
} catch (e) {
console.error(e);
}
} else {
try {
this.cb.call(this.vm, value, oldValue, options);
} catch (e) {
console.error(e);
}
}
}
}
};
Watcher.prototype.evaluate = function evaluate() {
this.value = this.get();
this.dirty = false;
};
Watcher.prototype.depend = function depend() {
var i = this.deps.length;
while (i--) {
this.deps[i].depend();
}
};
Watcher.prototype.teardown = function teardown() {
if (this.active) {
// remove self from vm's watcher list
// this is a somewhat expensive operation so we skip it
// if the vm is being destroyed.
remove(this.vm._watchers, this);
var i = this.deps.length;
while (i--) {
this.deps[i].removeSub(this);
}
this.active = false;
}
};
return Watcher;
}();
var seenObjects = new Set();
function traverse(val) {
seenObjects.clear();
_traverse(val, seenObjects);
}
function _traverse(val, seen) {
var i = void 0,
keys = void 0;
var isA = _.isArray(val);
if (!isA && !_.isObject(val)) {
return;
}
if (val.__ob__) {
var depId = val.__ob__.dep.id;
if (seen.has(depId)) {
return;
}
seen.add(depId);
}
if (isA) {
i = val.length;
while (i--) {
_traverse(val[i], seen);
}
} else {
keys = _.keys(val);
i = keys.length;
while (i--) {
_traverse(val[keys[i]], seen);
}
}
}
var falsy$1;
var operators = {
'||': falsy$1,
'&&': falsy$1,
'(': falsy$1,
')': falsy$1
};
function runBinaryFunction(binarys) {
var expr = '';
for (var i = 0, len = binarys.length; i < len; i++) {
if (_.isBoolean(binarys[i]) || _.has(operators, binarys[i])) {
expr += binarys[i];
} else {
expr += 'false';
}
}
return new Function('return ' + expr)();
}
function routeToRegExp(route) {
route = route.replace(/\*./g, '[a-zA-Z0-9_]+.');
return '^' + route + '$';
}
function watch(model, expOrFn, cb, options) {
if (isPlainObject(cb)) {
options = cb;
cb = cb.handler;
}
if (typeof cb === 'string') {
cb = model[cb];
}
options = options || {};
options.user = true;
var exps = void 0;
if (_.isFunction(expOrFn) || !(exps = expOrFn.match(/[a-zA-Z0-9_.*]+|[|][|]|[&][&]|[(]|[)]/g)) || exps.length === 1 && !/\*/.test(expOrFn)) {
var watcher = new Watcher(model, expOrFn, cb, options);
if (options.immediate) {
cb(watcher.value);
}
return function unwatchFn() {
watcher.teardown();
};
}
var watchers = [];
var fns = exps.slice();
var complete = false,
running = false;
var callback = function callback(index, newValue, oldValue, attrs) {
if (complete === true) {
return;
}
fns[index] = true;
if (runBinaryFunction(fns)) {
complete = true;
cb(newValue, oldValue, attrs);
}
if (options && options.sync) {
complete = false;
running = false;
fns = exps.slice();
} else {
if (!running) {
running = true;
nextTick(function () {
complete = false;
running = false;
fns = exps.slice();
});
}
}
};
_.each(exps, function (exp, i) {
if (_.has(operators, exp)) {
return;
}
//a.**或a.*形式
if (/^[1-9a-zA-Z.]+(\*\*$|\*$)/.test(exp) || exp === "**") {
var isGlobal = /\*\*$/.test(exp);
if (isGlobal) {
//a.**的形式
exp = exp.replace(".**", "");
} else {
//a.*的形式
exp = exp.replace(".*", "");
}
var getter = exp === "**" ? function (m) {
return m;
} : parsePath(exp);
var v = getter.call(model, model);
var dep = new Dep();
if (isGlobal) {
(v.__ob__._scopeDeps || (v.__ob__._scopeDeps = [])).push(dep);
} else {
(v.__ob__._deps || (v.__ob__._deps = [])).push(dep);
}
var w = new Watcher(model, function () {
dep.depend();
return NaN;
}, function (newValue, oldValue, attrs) {
callback(i, newValue, oldValue, _.extend({ index: i }, attrs));
}, options);
watchers.push(function unwatchFn() {
w.teardown();
v.__ob__._scopeDeps && remove(v.__ob__._scopeDeps, dep);
v.__ob__._deps && remove(v.__ob__._deps, dep);
});
return;
}
if (/\*\*$|\*$/.test(exp)) {
throw new Error('not support');
}
//其他含有*的情况,如*.a,*.*.a,a.*.a
if (/\*/.test(exp)) {
var currentModel = model;
//先获取到能获取到的对象
var paths = exp.split(".");
for (var _i = 0, len = paths.length; _i < len; _i++) {
if (paths[_i] === "*") {
break;
}
currentModel = model[paths[_i]];
}
exp = exp.substr(exp.indexOf("*"));
//补全路径
var parent = currentModel.__ob__.parent,
root = currentModel.__ob__;
while (parent) {
exp = '*.' + exp;
root = parent;
parent = parent.parent;
}
var regStr = routeToRegExp(exp);
var _dep = new Dep();
root._globalDeps || (root._globalDeps = {});
root._globalDeps[regStr] = _dep;
var _w = new Watcher(currentModel, function () {
_dep.depend();
return NaN;
}, function (newValue, oldValue, attrs) {
callback(i, newValue, oldValue, _.extend({ index: i }, attrs));
}, options);
watchers.push(function unwatchFn() {
_w.teardown();
root._globalDeps && delete root._globalDeps[regStr];
});
return;
}
var watcher = new Watcher(model, exp, function (newValue, oldValue, attrs) {
callback(i, newValue, oldValue, _.extend({ index: i }, attrs));
}, options);
watchers.push(function unwatchFn() {
watcher.teardown();
});
});
return watchers;
}
var mixinInjection = {};
function getMixins(type) {
return mixinInjection[type];
}
function mixin(xtype, cls) {
mixinInjection[xtype] = _.cloneDeep(cls);
}
var computedWatcherOptions = { lazy: true };
function initState(vm, state) {
if (state) {
vm.$$state = observe(state).model;
}
}
function initComputed(vm, computed) {
var watchers = vm._computedWatchers = {};
defineComputed(vm, computed);
for (var key in computed) {
var userDef = computed[key],
context = vm.$$model ? vm.model : vm;
var getter = typeof userDef === "function" ? _.bind(userDef, context) : _.bind(userDef.get, context);
watchers[key] = new Watcher(vm.$$computed, getter || noop, noop, computedWatcherOptions);
}
}
function defineComputed(vm, computed) {
var props = {};
// if (typeof Proxy === 'function') {
// return vm.$$computed = new Proxy(props, {
// has: function (target, key) {
// return computed && key in computed
// },
// get: function (target, key) {
// return createComputedGetter(vm, key)()
// }
// })
// }
var shouldCache = true;
for (var key in computed) {
if (!(key in vm)) {
var sharedPropertyDefinition = {
enumerable: true,
configurable: true,
get: noop,
set: noop
};
var userDef = computed[key];
if (typeof userDef === "function") {
sharedPropertyDefinition.get = createComputedGetter(vm, key);
sharedPropertyDefinition.set = noop;
} else {
sharedPropertyDefinition.get = userDef.get ? shouldCache && userDef.cache !== false ? createComputedGetter(key) : userDef.get : noop;
sharedPropertyDefinition.set = userDef.set ? userDef.set : noop;
}
props[key] = sharedPropertyDefinition;
}
}
vm.$$computed = createViewModel$1({}, props);
}
function createComputedGetter(vm, key) {
return function computedGetter() {
var watcher = vm._computedWatchers && vm._computedWatchers[key];
if (watcher) {
if (watcher.dirty) {
watcher.evaluate();
}
if (Dep.target) {
watcher.depend();
}
return watcher.value;
}
};
}
function initWatch(vm, watch$$1) {
vm._watchers || (vm._watchers = []);
for (var key in watch$$1) {
var handler = watch$$1[key];
if (_.isArray(handler)) {
for (var i = 0; i < handler.length; i++) {
vm._watchers.push(createWatcher(vm, key, handler[i]));
}
} else {
vm._watchers.push(createWatcher(vm, key, handler));
}
}
}
function createWatcher(vm, keyOrFn, cb, options) {
if (isPlainObject(cb)) {
options = cb;
cb = cb.handler;
}
if (typeof cb === 'string') {
cb = vm[cb];
}
return watch(vm.model, keyOrFn, _.bind(cb, vm.$$model ? vm.model : vm), options);
}
function initMethods(vm, methods) {
for (var key in methods) {
vm[key] = methods[key] == null ? noop : _.bind(methods[key], vm.$$model ? vm.model : vm);
}
}
function initMixins(vm, mixins) {
mixins = mixins || [];
_.each(mixins.reverse(), function (mixinType) {
var mixin$$1 = getMixins(mixinType);
for (var key in mixin$$1) {
if (typeof mixin$$1[key] !== "function") continue;
if (_.has(vm, key)) continue;
vm[key] = _.bind(mixin$$1[key], vm.$$model ? vm.model : vm);
}
});
}
function defineProps(vm, keys) {
var props = {};
// if (typeof Proxy === 'function') {
// return vm.model = new Proxy(props, {
// has: function (target, key) {
// return keys.indexOf(key) > -1;
// },
// get: function (target, key) {
// if (key in $$skipArray) {
// return props[key]
// }
// if (vm.$$computed && key in vm.$$computed) {
// return vm.$$computed[key]
// }
// if (vm.$$state && key in vm.$$state) {
// return vm.$$state[key]
// }
// return vm.$$model[key]
// },
// set: function (target, key, val) {
// if (key in $$skipArray) {
// return props[key] = val
// }
// if (vm.$$state && key in vm.$$state) {
// return vm.$$state[key] = val
// }
// if (vm.$$model && key in vm.$$model) {
// return vm.$$model[key] = val
// }
// }
// })
// }
var _loop = function _loop(i, len) {
var key = keys[i];
if (!(key in $$skipArray)) {
props[key] = {
enumerable: true,
configurable: true,
get: function get() {
if (vm.$$computed && key in vm.$$computed) {
return vm.$$computed[key];
}
if (vm.$$state && key in vm.$$state) {
return vm.$$state[key];
}
if (vm.$$model && key in vm.$$model) {
return vm.$$model[key];
}
var p = vm._parent;
while (p) {
if (p.$$context && key in p.$$context) {
return p.$$context[key];
}
p = p._parent;
}
},
set: function set(val) {
if (vm.$$state && key in vm.$$state) {
return vm.$$state[key] = val;
}
if (vm.$$model && key in vm.$$model) {
return vm.$$model[key] = val;
}
var p = vm._parent;
while (p) {
if (p.$$context && key in p.$$context) {
return p.$$context[key] = val;
}
p = p._parent;
}
}
};
}
};
for (var i = 0, len = keys.length; i < len; i++) {
_loop(i, len);
}
vm.model = createViewModel$1({}, props);
}
function defineContext(vm, keys) {
var props = {};
var _loop2 = function _loop2(i, len) {
var key = keys[i];
if (!(key in $$skipArray)) {
props[key] = {
enumerable: true,
configurable: true,
get: function get() {
return vm.model[key];
},
set: function set(val) {
return vm.model[key] = val;
}
};
}
};
for (var i = 0, len = keys.length; i < len; i++) {
_loop2(i, len);
}
vm.$$context = createViewModel$1({}, props);
}
var Model = function () {
function Model() {
_classCallCheck(this, Model);
}
Model.prototype._constructor = function _constructor(model, destroyHandler) {
if (model instanceof Observer || model instanceof Model) {
model = model.model;
}
if (model && model.__ob__) {
this.$$model = model;
} else {
this.options = model || {};
}
this._parent = Model.target;
var state = _.isFunction(this.state) ? this.state() : this.state;
var computed = this.computed;
var context = this.context;
var childContext = this.childContext;
var watch$$1 = this.watch;
var actions = this.actions;
var keys = _.keys(this.$$model).concat(_.keys(state)).concat(_.keys(computed)).concat(context || []);
var mixins = this.mixins;
defineProps(this, keys);
childContext && defineContext(this, childContext);
this.$$model && (this.model.__ob__ = this.$$model.__ob__);
initMixins(this, mixins);
this.init();
initState(this, state);
initComputed(this, computed);
initWatch(this, watch$$1);
initMethods(this, actions);
this.created && this.created();
this._destroyHandler = destroyHandler;
if (this.$$model) {
return this.model;
}
};
Model.prototype._init = function _init() {};
Model.prototype.init = function init() {
this._init();
};
Model.prototype.destroy = function destroy() {
for (var _key3 in this._computedWatchers) {
this._computedWatchers[_key3].teardown();
}
_.each(this._watchers, function (unwatches) {
unwatches = _.isArray(unwatches) ? unwatches : [unwatches];
_.each(unwatches, function (unwatch) {
unwatch();
});
});
this._watchers && (this._watchers = []);
this.destroyed && this.destroyed();
this.$$model = null;
this.$$computed = null;
this.$$state = null;
this._destroyHandler && this._destroyHandler();
};
return Model;
}();
function toJSON(model) {
var result = void 0;
if (_.isArray(model)) {
result = [];
for (var i = 0, len = model.length; i < len; i++) {
result[i] = toJSON(model[i]);
}
} else if (model && isPlainObject(model)) {
result = {};
for (var _key4 in model) {
if (!_.has($$skipArray, _key4)) {
result[_key4] = toJSON(model[_key4]);
}
}
} else {
result = model;
}
return result;
}
function define(model) {
return new Observer(model).model;
}
var version = '2.0';
exports.define = define;
exports.version = version;
exports.$$skipArray = $$skipArray;
exports.mixin = mixin;
exports.Model = Model;
exports.observerState = observerState;
exports.Observer = Observer;
exports.observe = observe;
exports.notify = notify;
exports.defineReactive = defineReactive;
exports.set = set;
exports.del = del;
exports.Watcher = Watcher;
exports.pushTarget = pushTarget;
exports.popTarget = popTarget;
exports.watch = watch;
exports.toJSON = toJSON;
exports.__esModule = true;
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(52).setImmediate))
/***/ }),
/* 738 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 739 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 740 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 741 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 742 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 743 */
/***/ (function(module, exports) {
;(function () {
function initWatch (vm, watch) {
vm._watchers || (vm._watchers = []);
for (var key in watch) {
var handler = watch[key];
if (BI.isArray(handler)) {
for (var i = 0; i < handler.length; i++) {
vm._watchers.push(createWatcher(vm, key, handler[i]));
}
} else {
vm._watchers.push(createWatcher(vm, key, handler));
}
}
}
function createWatcher(vm, keyOrFn, cb, options) {
if (BI.isPlainObject(cb)) {
options = cb;
cb = cb.handler;
}
options = options || {};
return Fix.watch(vm.model, keyOrFn, _.bind(cb, vm), BI.extend(options, {
store: vm.store
}));
}
var target = null;
var targetStack = [];
function pushTarget (_target) {
if (target) targetStack.push(target);
Fix.Model.target = target = _target;
}
function popTarget () {
Fix.Model.target = target = targetStack.pop();
}
var context = null;
var contextStack = [];
function pushContext (_context) {
if (context) contextStack.push(context);
Fix.Model.context = context = _context;
}
function popContext () {
Fix.Model.context = context = contextStack.pop();
}
var oldWatch = Fix.watch;
Fix.watch = function (model, expOrFn, cb, options) {
if (BI.isPlainObject(cb)) {
options = cb;
cb = cb.handler;
}
if (typeof cb === "string") {
cb = model[cb];
}
return oldWatch.call(this, model, expOrFn, function () {
options && options.store && pushTarget(options.store);
try {
var res = cb.apply(this, arguments);
} catch (e) {
console.error(e);
}
options && options.store && popTarget();
return res;
}, options);
};
function findStore (widget) {
if (target != null) {
return target;
}
widget = widget || context;
var p = widget;
while (p) {
if (p instanceof Fix.Model || p.store || p.__cacheStore) {
break;
}
p = p._parent || (p.options && p.options.element);
}
if (p) {
if (p instanceof Fix.Model) {
return widget.__cacheStore = p;
}
widget.__cacheStore = p.store || p.__cacheStore;
return p.__cacheStore || p.store;
}
}
var _create = BI.createWidget;
BI.createWidget = function (item, options, context) {
var pushed = false;
if (BI.isWidget(options)) {
pushContext(options);
pushed = true;
} else if (context != null) {
pushContext(context);
pushed = true;
}
var result = _create.apply(this, arguments);
// try {
// var result = _create.apply(this, arguments);
// } catch (e) {
// console.error(e);
// }
pushed && popContext();
return result;
};
_.each(["populate", "addItems", "prependItems"], function (name) {
var old = BI.Loader.prototype[name];
BI.Loader.prototype[name] = function () {
pushContext(this);
try {
var result = old.apply(this, arguments);
} catch (e) {
console.error(e);
}
popContext();
return result;
};
});
function createStore () {
var needPop = false;
if (_global.Fix && this._store) {
var store = findStore(this.options.context || this.options.element);
if (store) {
pushTarget(store);
needPop = true;
}
this.store = this._store();
this.store && (this.store._widget = this);
needPop && popTarget();
needPop = false;
pushTarget(this.store);
if (this.store instanceof Fix.Model) {
this.model = this.store.model;
} else {
this.model = this.store;
}
needPop = true;
}
return needPop;
}
var _init = BI.Widget.prototype._init;
BI.Widget.prototype._init = function () {
var self = this;
var needPop = createStore.call(this);
try {
_init.apply(this, arguments);
} catch (e) {
console.error(e);
}
needPop && popTarget();
};
var _render = BI.Widget.prototype._render;
BI.Widget.prototype._render = function () {
var needPop = false;
if (_global.Fix && this._store) {
needPop = true;
pushTarget(this.store);
initWatch(this, this.watch);
}
_render.apply(this, arguments);
// try {
// _render.apply(this, arguments);
// } catch (e) {
// console.error(e);
// }
needPop && popTarget();
};
var unMount = BI.Widget.prototype.__d;
BI.Widget.prototype.__d = function () {
try {
unMount.apply(this, arguments);
} catch (e) {
console.error(e);
}
this.store && BI.isFunction(this.store.destroy) && this.store.destroy();
BI.each(this._watchers, function (i, unwatches) {
unwatches = BI.isArray(unwatches) ? unwatches : [unwatches];
BI.each(unwatches, function (j, unwatch) {
unwatch();
});
});
this._watchers && (this._watchers = []);
if (this.store) {
this.store._parent && (this.store._parent = null);
this.store._widget && (this.store._widget = null);
this.store = null;
}
delete this.__cacheStore;
};
_.each(["_mount"], function (name) {
var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () {
this.store && pushTarget(this.store);
try {
var res = old.apply(this, arguments);
} catch (e) {
console.error(e);
}
this.store && popTarget();
return res;
});
});
if (BI.isIE9Below && BI.isIE9Below()) {
_.each(["each", "map", "reduce", "reduceRight", "find", "filter", "reject", "every", "all", "some", "any", "max", "min",
"sortBy", "groupBy", "indexBy", "countBy", "partition",
"keys", "allKeys", "values", "pairs", "invert",
"mapObject", "findKey", "pick", "omit", "tap"], function (name) {
var old = BI[name];
BI[name] = function (obj, fn, context) {
return typeof fn === "function" ? old(obj, function (key, value) {
if (!(key in Fix.$$skipArray)) {
return fn.apply(this, arguments);
}
}, context) : old.apply(this, arguments);
};
});
BI.isEmpty = function (ob) {
if (BI.isPlainObject(ob) && ob.__ob__) {
return BI.keys(ob).length === 0;
}
return _.isEmpty(ob);
};
BI.keys = function (ob) {
var keys = _.keys(ob);
var nKeys = [];
for (var i = 0; i < keys.length; i++) {
if (!(keys[i] in Fix.$$skipArray)) {
nKeys.push(keys[i]);
}
}
return nKeys;
};
BI.values = function (ob) {
var keys = BI.keys(obj);
var length = keys.length;
var values = [];
for (var i = 0; i < length; i++) {
values[i] = obj[keys[i]];
}
return values;
};
BI.extend = function () {
var args = Array.prototype.slice.call(arguments);
if (args.length < 1) {
return {};
}
var object = args[0];
var i = 1;
while (i < args.length) {
BI.each(args[i], function (key, v) {
object[key] = v;
});
i++;
}
return object;
};
BI.size = function (ob) {
if (BI.isPlainObject(ob) && ob.__ob__) {
return BI.keys(ob).length;
}
return _.size(ob);
};
BI.isEmptyObject = function (ob) {
return BI.size(ob) === 0;
};
BI.deepClone = function (ob) {
return Fix.toJSON(ob);
};
}
BI.watch = Fix.watch;
}());
/***/ }),
/* 744 */
/***/ (function(module, exports) {
BI.i18n = {
"BI-Multi_Date_Quarter_End": "季度末",
"BI-Multi_Date_Month_Begin": "月初",
"BI-Multi_Date_YMD": "年月日",
"BI-Custom_Color": "自定义颜色",
"BI-Numerical_Interval_Input_Data": "请输入数值",
"BI-Please_Input_Natural_Number": "请输入非负整数",
"BI-No_More_Data": "无更多数据",
"BI-Basic_Altogether": "共",
"BI-Basic_Sunday": "星期日",
"BI-Widget_Background_Colour": "组件背景",
"BI-Color_Picker_Error_Text": "请输入0~255的正整数",
"BI-Multi_Date_Month": "月",
"BI-No_Selected_Item": "没有可选项",
"BI-Multi_Date_Year_Begin": "年初",
"BI-Quarter_1": "第1季度",
"BI-Quarter_2": "第2季度",
"BI-Quarter_3": "第3季度",
"BI-Quarter_4": "第4季度",
"BI-Multi_Date_Year_Next": "年后",
"BI-Multi_Date_Month_Prev": "个月前",
"BI-Month_Trigger_Error_Text": "请输入1~12的正整数",
"BI-Less_And_Equal": "小于等于",
"BI-Year_Trigger_Invalid_Text": "请输入有效时间",
"BI-Multi_Date_Week_Next": "周后",
"BI-Font_Size": "字号",
"BI-Basic_Total": "共",
"BI-Already_Selected": "已选择",
"BI-Formula_Insert": "插入",
"BI-Select_All": "全选",
"BI-Basic_Tuesday": "星期二",
"BI-Multi_Date_Month_End": "月末",
"BI-Load_More": "点击加载更多数据",
"BI-Basic_September": "九月",
"BI-Current_Is_Last_Page": "当前已是最后一页",
"BI-Basic_Auto": "自动",
"BI-Basic_Count": "个",
"BI-Basic_Value": "值",
"BI-Basic_Unrestricted": "无限制",
"BI-Quarter_Trigger_Error_Text": "请输入1~4的正整数",
"BI-Basic_More": "更多",
"BI-Basic_Wednesday": "星期三",
"BI-Basic_Bold": "加粗",
"BI-Basic_Simple_Saturday": "六",
"BI-Multi_Date_Month_Next": "个月后",
"BI-Basic_March": "三月",
"BI-Current_Is_First_Page": "当前已是第一页",
"BI-Basic_Thursday": "星期四",
"BI-Basic_Prompt": "提示",
"BI-Multi_Date_Today": "今天",
"BI-Multi_Date_Quarter_Prev": "个季度前",
"BI-Row_Header": "行表头",
"BI-Date_Trigger_Error_Text": "日期格式示例:2015-3-11",
"BI-Basic_Cancel": "取消",
"BI-Basic_January": "一月",
"BI-Basic_June": "六月",
"BI-Basic_July": "七月",
"BI-Basic_April": "四月",
"BI-Multi_Date_Quarter_Begin": "季度初",
"BI-Multi_Date_Week": "周",
"BI-Click_Blank_To_Select": "点击\"空格键\"选中完全匹配项",
"BI-Basic_August": "八月",
"BI-Word_Align_Left": "文字居左",
"BI-Basic_November": "十一月",
"BI-Font_Colour": "字体颜色",
"BI-Multi_Date_Day_Prev": "天前",
"BI-Select_Part": "部分选择",
"BI-Multi_Date_Day_Next": "天后",
"BI-Less_Than": "小于",
"BI-Basic_February": "二月",
"BI-Multi_Date_Year": "年",
"BI-Number_Index": "序号",
"BI-Multi_Date_Week_Prev": "周前",
"BI-Next_Page": "下一页",
"BI-Right_Page": "向右翻页",
"BI-Numerical_Interval_Signal_Value": "前后值相等,请将操作符改为“≤”",
"BI-Basic_December": "十二月",
"BI-Basic_Saturday": "星期六",
"BI-Basic_Simple_Wednesday": "三",
"BI-Multi_Date_Quarter_Next": "个季度后",
"BI-Basic_October": "十月",
"BI-Basic_Simple_Friday": "五",
"BI-Basic_Save": "保存",
"BI-Numerical_Interval_Number_Value": "请保证前面的数值小于/等于后面的数值",
"BI-Previous_Page": "上一页",
"BI-No_Select": "搜索结果为空",
"BI-Basic_Clears": "清空",
"BI-Created_By_Me": "我创建的",
"BI-Basic_Simple_Tuesday": "二",
"BI-Word_Align_Right": "文字居右",
"BI-Summary_Values": "汇总",
"BI-Basic_Clear": "清除",
"BI-Upload_File_Size_Error": "文件大小不支持",
"BI-Up_Page": "向上翻页",
"BI-Basic_Simple_Sunday": "日",
"BI-Multi_Date_Relative_Current_Time": "相对当前时间",
"BI-Selected_Data": "已选数据:",
"BI-Multi_Date_Quarter": "季度",
"BI-Check_Selected": "查看已选",
"BI-Basic_Search": "搜索",
"BI-Basic_May": "五月",
"BI-Continue_Select": "继续选择",
"BI-Please_Input_Positive_Integer": "请输入正整数",
"BI-Upload_File_Type_Error": "文件类型不支持",
"BI-Upload_File_Error": "文件上传失败",
"BI-Basic_Friday": "星期五",
"BI-Down_Page": "向下翻页",
"BI-Basic_Monday": "星期一",
"BI-Left_Page": "向左翻页",
"BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证开始时间早于/等于结束时间",
"BI-Basic_Time": "时间",
"BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定",
"BI-Basic_Simple_Thursday": "四",
"BI-Multi_Date_Year_Prev": "年前",
"BI-Tiao_Data": "条数据",
"BI-Basic_Italic": "斜体",
"BI-Basic_Dynamic_Title": "动态时间",
"BI-Basic_Year": "年",
"BI-Basic_Single_Quarter": "季",
"BI-Basic_Month": "月",
"BI-Basic_Week": "周",
"BI-Basic_Day": "天",
"BI-Basic_Work_Day": "工作日",
"BI-Basic_Front": "前",
"BI-Basic_Behind": "后",
"BI-Basic_Empty": "空",
"BI-Basic_Month_End": "月末",
"BI-Basic_Month_Begin": "月初",
"BI-Basic_Year_End": "年末",
"BI-Basic_Year_Begin": "年初",
"BI-Basic_Quarter_End": "季末",
"BI-Basic_Quarter_Begin": "季初",
"BI-Basic_Week_End": "周末",
"BI-Basic_Week_Begin": "周初",
"BI-Basic_Current_Day": "当天",
"BI-Basic_Begin_Start": "初",
"BI-Basic_End_Stop": "末",
"BI-Basic_Current_Year": "今年",
"BI-Basic_Year_Fen": "年份",
"BI-Basic_Current_Month": "本月",
"BI-Basic_Current_Quarter": "本季度",
"BI-Basic_Year_Month": "年月",
"BI-Basic_Year_Quarter": "年季度",
"BI-Basic_Input_Can_Not_Null": "输入框不能为空",
"BI-Basic_Date_Time_Error_Text": "日期格式示例:2015-3-11 00:00:00",
"BI-Basic_Input_From_To_Number": "请输入{R1}的数值",
"BI-Basic_Or": "或",
"BI-Basic_And": "且",
"BI-Conf_Add_Formula": "添加公式",
"BI-Conf_Add_Condition": "添加条件",
"BI-Conf_Formula_And": "且公式条件",
"BI-Conf_Formula_Or": "或公式条件",
"BI-Conf_Condition_And": "且条件",
"BI-Conf_Condition_Or": "或条件",
"BI-Microsoft_YaHei": "微软雅黑",
"BI-Apple_Light": "苹方-light",
"BI-Font_Family": "字体",
"BI-Basic_Please_Input_Content": "请输入内容",
"BI-Word_Align_Center": "文字居中",
"BI-Basic_Please_Enter_Number_Between": "请输入{R1}-{R2}的值",
"BI-More_Than": "大于",
"BI-More_And_Equal": "大于等于",
"BI-Please_Enter_SQL": "请输入SQL",
"BI-Basic_Click_To_Add_Text": "+点击新增\"{R1}\"",
"BI-Basic_Please_Select": "请选择",
"BI-Basic_Font_Color": "文字颜色",
"BI-Basic_Background_Color": "背景色",
"BI-Basic_Underline": "下划线",
"BI-Basic_Param_Month": "{R1}月",
"BI-Basic_Param_Day": "{R1}日",
"BI-Basic_Param_Quarter": "{R1}季度",
"BI-Basic_Param_Week_Count": "第{R1}周",
"BI-Basic_Param_Hour": "{R1}时",
"BI-Basic_Param_Minute": "{R1}分",
"BI-Basic_Param_Second": "{R1}秒",
"BI-Basic_Param_Year": "{R1}年",
"BI-Basic_Date_Day": "日",
"BI-Basic_Hour_Sin": "时",
"BI-Basic_Seconds": "秒",
"BI-Basic_Minute": "分",
"BI-Basic_Wan": "万",
"BI-Basic_Million": "百万",
"BI-Basic_Billion": "亿",
"BI-Basic_Quarter": "季度",
"BI-Basic_No_Select": "不选",
"BI-Basic_Now": "此刻"
};
/***/ }),
/* 745 */,
/* 746 */,
/* 747 */,
/* 748 */,
/* 749 */,
/* 750 */,
/* 751 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(752);
var _global = _interopRequireDefault(__webpack_require__(925));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
if (_global["default"]._babelPolyfill && typeof console !== "undefined" && console.warn) {
console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended " + "and may have consequences if different versions of the polyfills are applied sequentially. " + "If you do need to load the polyfill more than once, use @babel/polyfill/noConflict " + "instead to bypass the warning.");
}
_global["default"]._babelPolyfill = true;
/***/ }),
/* 752 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(753);
__webpack_require__(896);
__webpack_require__(898);
__webpack_require__(901);
__webpack_require__(903);
__webpack_require__(905);
__webpack_require__(907);
__webpack_require__(909);
__webpack_require__(911);
__webpack_require__(913);
__webpack_require__(915);
__webpack_require__(917);
__webpack_require__(919);
__webpack_require__(923);
/***/ }),
/* 753 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(754);
__webpack_require__(757);
__webpack_require__(758);
__webpack_require__(759);
__webpack_require__(760);
__webpack_require__(761);
__webpack_require__(762);
__webpack_require__(763);
__webpack_require__(764);
__webpack_require__(765);
__webpack_require__(766);
__webpack_require__(767);
__webpack_require__(768);
__webpack_require__(769);
__webpack_require__(770);
__webpack_require__(771);
__webpack_require__(772);
__webpack_require__(773);
__webpack_require__(774);
__webpack_require__(775);
__webpack_require__(776);
__webpack_require__(777);
__webpack_require__(778);
__webpack_require__(779);
__webpack_require__(780);
__webpack_require__(781);
__webpack_require__(782);
__webpack_require__(783);
__webpack_require__(784);
__webpack_require__(785);
__webpack_require__(786);
__webpack_require__(787);
__webpack_require__(788);
__webpack_require__(789);
__webpack_require__(790);
__webpack_require__(791);
__webpack_require__(792);
__webpack_require__(793);
__webpack_require__(794);
__webpack_require__(795);
__webpack_require__(796);
__webpack_require__(797);
__webpack_require__(798);
__webpack_require__(800);
__webpack_require__(801);
__webpack_require__(802);
__webpack_require__(803);
__webpack_require__(804);
__webpack_require__(805);
__webpack_require__(806);
__webpack_require__(807);
__webpack_require__(808);
__webpack_require__(809);
__webpack_require__(810);
__webpack_require__(811);
__webpack_require__(812);
__webpack_require__(813);
__webpack_require__(814);
__webpack_require__(815);
__webpack_require__(816);
__webpack_require__(817);
__webpack_require__(818);
__webpack_require__(819);
__webpack_require__(820);
__webpack_require__(821);
__webpack_require__(822);
__webpack_require__(823);
__webpack_require__(824);
__webpack_require__(825);
__webpack_require__(826);
__webpack_require__(827);
__webpack_require__(828);
__webpack_require__(829);
__webpack_require__(830);
__webpack_require__(831);
__webpack_require__(832);
__webpack_require__(833);
__webpack_require__(835);
__webpack_require__(836);
__webpack_require__(838);
__webpack_require__(839);
__webpack_require__(840);
__webpack_require__(841);
__webpack_require__(842);
__webpack_require__(843);
__webpack_require__(844);
__webpack_require__(846);
__webpack_require__(847);
__webpack_require__(848);
__webpack_require__(849);
__webpack_require__(850);
__webpack_require__(851);
__webpack_require__(852);
__webpack_require__(853);
__webpack_require__(854);
__webpack_require__(855);
__webpack_require__(856);
__webpack_require__(857);
__webpack_require__(858);
__webpack_require__(90);
__webpack_require__(859);
__webpack_require__(288);
__webpack_require__(860);
__webpack_require__(289);
__webpack_require__(861);
__webpack_require__(862);
__webpack_require__(863);
__webpack_require__(864);
__webpack_require__(290);
__webpack_require__(867);
__webpack_require__(868);
__webpack_require__(869);
__webpack_require__(870);
__webpack_require__(871);
__webpack_require__(872);
__webpack_require__(873);
__webpack_require__(874);
__webpack_require__(875);
__webpack_require__(876);
__webpack_require__(877);
__webpack_require__(878);
__webpack_require__(879);
__webpack_require__(880);
__webpack_require__(881);
__webpack_require__(882);
__webpack_require__(883);
__webpack_require__(884);
__webpack_require__(885);
__webpack_require__(886);
__webpack_require__(887);
__webpack_require__(888);
__webpack_require__(889);
__webpack_require__(890);
__webpack_require__(891);
__webpack_require__(892);
__webpack_require__(893);
__webpack_require__(894);
__webpack_require__(895);
module.exports = __webpack_require__(7);
/***/ }),
/* 754 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// ECMAScript 6 symbols shim
var global = __webpack_require__(1);
var has = __webpack_require__(14);
var DESCRIPTORS = __webpack_require__(8);
var $export = __webpack_require__(0);
var redefine = __webpack_require__(11);
var META = __webpack_require__(28).KEY;
var $fails = __webpack_require__(2);
var shared = __webpack_require__(53);
var setToStringTag = __webpack_require__(39);
var uid = __webpack_require__(30);
var wks = __webpack_require__(5);
var wksExt = __webpack_require__(71);
var wksDefine = __webpack_require__(269);
var enumKeys = __webpack_require__(756);
var isArray = __webpack_require__(56);
var anObject = __webpack_require__(3);
var isObject = __webpack_require__(4);
var toObject = __webpack_require__(10);
var toIObject = __webpack_require__(16);
var toPrimitive = __webpack_require__(27);
var createDesc = __webpack_require__(29);
var _create = __webpack_require__(34);
var gOPNExt = __webpack_require__(272);
var $GOPD = __webpack_require__(21);
var $GOPS = __webpack_require__(55);
var $DP = __webpack_require__(9);
var $keys = __webpack_require__(32);
var gOPD = $GOPD.f;
var dP = $DP.f;
var gOPN = gOPNExt.f;
var $Symbol = global.Symbol;
var $JSON = global.JSON;
var _stringify = $JSON && $JSON.stringify;
var PROTOTYPE = 'prototype';
var HIDDEN = wks('_hidden');
var TO_PRIMITIVE = wks('toPrimitive');
var isEnum = {}.propertyIsEnumerable;
var SymbolRegistry = shared('symbol-registry');
var AllSymbols = shared('symbols');
var OPSymbols = shared('op-symbols');
var ObjectProto = Object[PROTOTYPE];
var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
var QObject = global.QObject;
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
var setSymbolDesc = DESCRIPTORS && $fails(function () {
return _create(dP({}, 'a', {
get: function () { return dP(this, 'a', { value: 7 }).a; }
})).a != 7;
}) ? function (it, key, D) {
var protoDesc = gOPD(ObjectProto, key);
if (protoDesc) delete ObjectProto[key];
dP(it, key, D);
if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
} : dP;
var wrap = function (tag) {
var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
sym._k = tag;
return sym;
};
var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
return typeof it == 'symbol';
} : function (it) {
return it instanceof $Symbol;
};
var $defineProperty = function defineProperty(it, key, D) {
if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
anObject(it);
key = toPrimitive(key, true);
anObject(D);
if (has(AllSymbols, key)) {
if (!D.enumerable) {
if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
it[HIDDEN][key] = true;
} else {
if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
D = _create(D, { enumerable: createDesc(0, false) });
} return setSymbolDesc(it, key, D);
} return dP(it, key, D);
};
var $defineProperties = function defineProperties(it, P) {
anObject(it);
var keys = enumKeys(P = toIObject(P));
var i = 0;
var l = keys.length;
var key;
while (l > i) $defineProperty(it, key = keys[i++], P[key]);
return it;
};
var $create = function create(it, P) {
return P === undefined ? _create(it) : $defineProperties(_create(it), P);
};
var $propertyIsEnumerable = function propertyIsEnumerable(key) {
var E = isEnum.call(this, key = toPrimitive(key, true));
if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
it = toIObject(it);
key = toPrimitive(key, true);
if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
var D = gOPD(it, key);
if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
return D;
};
var $getOwnPropertyNames = function getOwnPropertyNames(it) {
var names = gOPN(toIObject(it));
var result = [];
var i = 0;
var key;
while (names.length > i) {
if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
} return result;
};
var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
var IS_OP = it === ObjectProto;
var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
var result = [];
var i = 0;
var key;
while (names.length > i) {
if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
} return result;
};
// 19.4.1.1 Symbol([description])
if (!USE_NATIVE) {
$Symbol = function Symbol() {
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
var $set = function (value) {
if (this === ObjectProto) $set.call(OPSymbols, value);
if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
setSymbolDesc(this, tag, createDesc(1, value));
};
if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
return wrap(tag);
};
redefine($Symbol[PROTOTYPE], 'toString', function toString() {
return this._k;
});
$GOPD.f = $getOwnPropertyDescriptor;
$DP.f = $defineProperty;
__webpack_require__(35).f = gOPNExt.f = $getOwnPropertyNames;
__webpack_require__(47).f = $propertyIsEnumerable;
$GOPS.f = $getOwnPropertySymbols;
if (DESCRIPTORS && !__webpack_require__(31)) {
redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
}
wksExt.f = function (name) {
return wrap(wks(name));
};
}
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
for (var es6Symbols = (
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
// 19.4.2.1 Symbol.for(key)
'for': function (key) {
return has(SymbolRegistry, key += '')
? SymbolRegistry[key]
: SymbolRegistry[key] = $Symbol(key);
},
// 19.4.2.5 Symbol.keyFor(sym)
keyFor: function keyFor(sym) {
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
},
useSetter: function () { setter = true; },
useSimple: function () { setter = false; }
});
$export($export.S + $export.F * !USE_NATIVE, 'Object', {
// 19.1.2.2 Object.create(O [, Properties])
create: $create,
// 19.1.2.4 Object.defineProperty(O, P, Attributes)
defineProperty: $defineProperty,
// 19.1.2.3 Object.defineProperties(O, Properties)
defineProperties: $defineProperties,
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
// 19.1.2.7 Object.getOwnPropertyNames(O)
getOwnPropertyNames: $getOwnPropertyNames,
// 19.1.2.8 Object.getOwnPropertySymbols(O)
getOwnPropertySymbols: $getOwnPropertySymbols
});
// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
// https://bugs.chromium.org/p/v8/issues/detail?id=3443
var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
getOwnPropertySymbols: function getOwnPropertySymbols(it) {
return $GOPS.f(toObject(it));
}
});
// 24.3.2 JSON.stringify(value [, replacer [, space]])
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
var S = $Symbol();
// MS Edge converts symbol values to JSON as {}
// WebKit converts symbol values to JSON as null
// V8 throws on boxed symbols
return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
})), 'JSON', {
stringify: function stringify(it) {
var args = [it];
var i = 1;
var replacer, $replacer;
while (arguments.length > i) args.push(arguments[i++]);
$replacer = replacer = args[1];
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
if (!isArray(replacer)) replacer = function (key, value) {
if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
if (!isSymbol(value)) return value;
};
args[1] = replacer;
return _stringify.apply($JSON, args);
}
});
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(15)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
// 19.4.3.5 Symbol.prototype[@@toStringTag]
setToStringTag($Symbol, 'Symbol');
// 20.2.1.9 Math[@@toStringTag]
setToStringTag(Math, 'Math', true);
// 24.3.3 JSON[@@toStringTag]
setToStringTag(global.JSON, 'JSON', true);
/***/ }),
/* 755 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(53)('native-function-to-string', Function.toString);
/***/ }),
/* 756 */
/***/ (function(module, exports, __webpack_require__) {
// all enumerable object keys, includes symbols
var getKeys = __webpack_require__(32);
var gOPS = __webpack_require__(55);
var pIE = __webpack_require__(47);
module.exports = function (it) {
var result = getKeys(it);
var getSymbols = gOPS.f;
if (getSymbols) {
var symbols = getSymbols(it);
var isEnum = pIE.f;
var i = 0;
var key;
while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
} return result;
};
/***/ }),
/* 757 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
$export($export.S, 'Object', { create: __webpack_require__(34) });
/***/ }),
/* 758 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
$export($export.S + $export.F * !__webpack_require__(8), 'Object', { defineProperty: __webpack_require__(9).f });
/***/ }),
/* 759 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
$export($export.S + $export.F * !__webpack_require__(8), 'Object', { defineProperties: __webpack_require__(271) });
/***/ }),
/* 760 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
var toIObject = __webpack_require__(16);
var $getOwnPropertyDescriptor = __webpack_require__(21).f;
__webpack_require__(22)('getOwnPropertyDescriptor', function () {
return function getOwnPropertyDescriptor(it, key) {
return $getOwnPropertyDescriptor(toIObject(it), key);
};
});
/***/ }),
/* 761 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 Object.getPrototypeOf(O)
var toObject = __webpack_require__(10);
var $getPrototypeOf = __webpack_require__(36);
__webpack_require__(22)('getPrototypeOf', function () {
return function getPrototypeOf(it) {
return $getPrototypeOf(toObject(it));
};
});
/***/ }),
/* 762 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 Object.keys(O)
var toObject = __webpack_require__(10);
var $keys = __webpack_require__(32);
__webpack_require__(22)('keys', function () {
return function keys(it) {
return $keys(toObject(it));
};
});
/***/ }),
/* 763 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.7 Object.getOwnPropertyNames(O)
__webpack_require__(22)('getOwnPropertyNames', function () {
return __webpack_require__(272).f;
});
/***/ }),
/* 764 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.5 Object.freeze(O)
var isObject = __webpack_require__(4);
var meta = __webpack_require__(28).onFreeze;
__webpack_require__(22)('freeze', function ($freeze) {
return function freeze(it) {
return $freeze && isObject(it) ? $freeze(meta(it)) : it;
};
});
/***/ }),
/* 765 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.17 Object.seal(O)
var isObject = __webpack_require__(4);
var meta = __webpack_require__(28).onFreeze;
__webpack_require__(22)('seal', function ($seal) {
return function seal(it) {
return $seal && isObject(it) ? $seal(meta(it)) : it;
};
});
/***/ }),
/* 766 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.15 Object.preventExtensions(O)
var isObject = __webpack_require__(4);
var meta = __webpack_require__(28).onFreeze;
__webpack_require__(22)('preventExtensions', function ($preventExtensions) {
return function preventExtensions(it) {
return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;
};
});
/***/ }),
/* 767 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.12 Object.isFrozen(O)
var isObject = __webpack_require__(4);
__webpack_require__(22)('isFrozen', function ($isFrozen) {
return function isFrozen(it) {
return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
};
});
/***/ }),
/* 768 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.13 Object.isSealed(O)
var isObject = __webpack_require__(4);
__webpack_require__(22)('isSealed', function ($isSealed) {
return function isSealed(it) {
return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
};
});
/***/ }),
/* 769 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.11 Object.isExtensible(O)
var isObject = __webpack_require__(4);
__webpack_require__(22)('isExtensible', function ($isExtensible) {
return function isExtensible(it) {
return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
};
});
/***/ }),
/* 770 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__(0);
$export($export.S + $export.F, 'Object', { assign: __webpack_require__(273) });
/***/ }),
/* 771 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.10 Object.is(value1, value2)
var $export = __webpack_require__(0);
$export($export.S, 'Object', { is: __webpack_require__(274) });
/***/ }),
/* 772 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.19 Object.setPrototypeOf(O, proto)
var $export = __webpack_require__(0);
$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(75).set });
/***/ }),
/* 773 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 19.1.3.6 Object.prototype.toString()
var classof = __webpack_require__(48);
var test = {};
test[__webpack_require__(5)('toStringTag')] = 'z';
if (test + '' != '[object z]') {
__webpack_require__(11)(Object.prototype, 'toString', function toString() {
return '[object ' + classof(this) + ']';
}, true);
}
/***/ }),
/* 774 */
/***/ (function(module, exports, __webpack_require__) {
// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
var $export = __webpack_require__(0);
$export($export.P, 'Function', { bind: __webpack_require__(275) });
/***/ }),
/* 775 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(9).f;
var FProto = Function.prototype;
var nameRE = /^\s*function ([^ (]*)/;
var NAME = 'name';
// 19.2.4.2 name
NAME in FProto || __webpack_require__(8) && dP(FProto, NAME, {
configurable: true,
get: function () {
try {
return ('' + this).match(nameRE)[1];
} catch (e) {
return '';
}
}
});
/***/ }),
/* 776 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var isObject = __webpack_require__(4);
var getPrototypeOf = __webpack_require__(36);
var HAS_INSTANCE = __webpack_require__(5)('hasInstance');
var FunctionProto = Function.prototype;
// 19.2.3.6 Function.prototype[@@hasInstance](V)
if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(9).f(FunctionProto, HAS_INSTANCE, { value: function (O) {
if (typeof this != 'function' || !isObject(O)) return false;
if (!isObject(this.prototype)) return O instanceof this;
// for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
while (O = getPrototypeOf(O)) if (this.prototype === O) return true;
return false;
} });
/***/ }),
/* 777 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
var $parseInt = __webpack_require__(277);
// 18.2.5 parseInt(string, radix)
$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });
/***/ }),
/* 778 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
var $parseFloat = __webpack_require__(278);
// 18.2.4 parseFloat(string)
$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });
/***/ }),
/* 779 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var global = __webpack_require__(1);
var has = __webpack_require__(14);
var cof = __webpack_require__(24);
var inheritIfRequired = __webpack_require__(77);
var toPrimitive = __webpack_require__(27);
var fails = __webpack_require__(2);
var gOPN = __webpack_require__(35).f;
var gOPD = __webpack_require__(21).f;
var dP = __webpack_require__(9).f;
var $trim = __webpack_require__(40).trim;
var NUMBER = 'Number';
var $Number = global[NUMBER];
var Base = $Number;
var proto = $Number.prototype;
// Opera ~12 has broken Object#toString
var BROKEN_COF = cof(__webpack_require__(34)(proto)) == NUMBER;
var TRIM = 'trim' in String.prototype;
// 7.1.3 ToNumber(argument)
var toNumber = function (argument) {
var it = toPrimitive(argument, false);
if (typeof it == 'string' && it.length > 2) {
it = TRIM ? it.trim() : $trim(it, 3);
var first = it.charCodeAt(0);
var third, radix, maxCode;
if (first === 43 || first === 45) {
third = it.charCodeAt(2);
if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
} else if (first === 48) {
switch (it.charCodeAt(1)) {
case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
default: return +it;
}
for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
code = digits.charCodeAt(i);
// parseInt parses a string to a first unavailable symbol
// but ToNumber should return NaN if a string contains unavailable symbols
if (code < 48 || code > maxCode) return NaN;
} return parseInt(digits, radix);
}
} return +it;
};
if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {
$Number = function Number(value) {
var it = arguments.length < 1 ? 0 : value;
var that = this;
return that instanceof $Number
// check on 1..constructor(foo) case
&& (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)
? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
};
for (var keys = __webpack_require__(8) ? gOPN(Base) : (
// ES3:
'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
// ES6 (in case, if modules with ES6 Number statics required before):
'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
).split(','), j = 0, key; keys.length > j; j++) {
if (has(Base, key = keys[j]) && !has($Number, key)) {
dP($Number, key, gOPD(Base, key));
}
}
$Number.prototype = proto;
proto.constructor = $Number;
__webpack_require__(11)(global, NUMBER, $Number);
}
/***/ }),
/* 780 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var toInteger = __webpack_require__(20);
var aNumberValue = __webpack_require__(279);
var repeat = __webpack_require__(78);
var $toFixed = 1.0.toFixed;
var floor = Math.floor;
var data = [0, 0, 0, 0, 0, 0];
var ERROR = 'Number.toFixed: incorrect invocation!';
var ZERO = '0';
var multiply = function (n, c) {
var i = -1;
var c2 = c;
while (++i < 6) {
c2 += n * data[i];
data[i] = c2 % 1e7;
c2 = floor(c2 / 1e7);
}
};
var divide = function (n) {
var i = 6;
var c = 0;
while (--i >= 0) {
c += data[i];
data[i] = floor(c / n);
c = (c % n) * 1e7;
}
};
var numToString = function () {
var i = 6;
var s = '';
while (--i >= 0) {
if (s !== '' || i === 0 || data[i] !== 0) {
var t = String(data[i]);
s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;
}
} return s;
};
var pow = function (x, n, acc) {
return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
};
var log = function (x) {
var n = 0;
var x2 = x;
while (x2 >= 4096) {
n += 12;
x2 /= 4096;
}
while (x2 >= 2) {
n += 1;
x2 /= 2;
} return n;
};
$export($export.P + $export.F * (!!$toFixed && (
0.00008.toFixed(3) !== '0.000' ||
0.9.toFixed(0) !== '1' ||
1.255.toFixed(2) !== '1.25' ||
1000000000000000128.0.toFixed(0) !== '1000000000000000128'
) || !__webpack_require__(2)(function () {
// V8 ~ Android 4.3-
$toFixed.call({});
})), 'Number', {
toFixed: function toFixed(fractionDigits) {
var x = aNumberValue(this, ERROR);
var f = toInteger(fractionDigits);
var s = '';
var m = ZERO;
var e, z, j, k;
if (f < 0 || f > 20) throw RangeError(ERROR);
// eslint-disable-next-line no-self-compare
if (x != x) return 'NaN';
if (x <= -1e21 || x >= 1e21) return String(x);
if (x < 0) {
s = '-';
x = -x;
}
if (x > 1e-21) {
e = log(x * pow(2, 69, 1)) - 69;
z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
z *= 0x10000000000000;
e = 52 - e;
if (e > 0) {
multiply(0, z);
j = f;
while (j >= 7) {
multiply(1e7, 0);
j -= 7;
}
multiply(pow(10, j, 1), 0);
j = e - 1;
while (j >= 23) {
divide(1 << 23);
j -= 23;
}
divide(1 << j);
multiply(1, 1);
divide(2);
m = numToString();
} else {
multiply(0, z);
multiply(1 << -e, 0);
m = numToString() + repeat.call(ZERO, f);
}
}
if (f > 0) {
k = m.length;
m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
} else {
m = s + m;
} return m;
}
});
/***/ }),
/* 781 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var $fails = __webpack_require__(2);
var aNumberValue = __webpack_require__(279);
var $toPrecision = 1.0.toPrecision;
$export($export.P + $export.F * ($fails(function () {
// IE7-
return $toPrecision.call(1, undefined) !== '1';
}) || !$fails(function () {
// V8 ~ Android 4.3-
$toPrecision.call({});
})), 'Number', {
toPrecision: function toPrecision(precision) {
var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
}
});
/***/ }),
/* 782 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.1 Number.EPSILON
var $export = __webpack_require__(0);
$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });
/***/ }),
/* 783 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.2 Number.isFinite(number)
var $export = __webpack_require__(0);
var _isFinite = __webpack_require__(1).isFinite;
$export($export.S, 'Number', {
isFinite: function isFinite(it) {
return typeof it == 'number' && _isFinite(it);
}
});
/***/ }),
/* 784 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.3 Number.isInteger(number)
var $export = __webpack_require__(0);
$export($export.S, 'Number', { isInteger: __webpack_require__(280) });
/***/ }),
/* 785 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.4 Number.isNaN(number)
var $export = __webpack_require__(0);
$export($export.S, 'Number', {
isNaN: function isNaN(number) {
// eslint-disable-next-line no-self-compare
return number != number;
}
});
/***/ }),
/* 786 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.5 Number.isSafeInteger(number)
var $export = __webpack_require__(0);
var isInteger = __webpack_require__(280);
var abs = Math.abs;
$export($export.S, 'Number', {
isSafeInteger: function isSafeInteger(number) {
return isInteger(number) && abs(number) <= 0x1fffffffffffff;
}
});
/***/ }),
/* 787 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.6 Number.MAX_SAFE_INTEGER
var $export = __webpack_require__(0);
$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });
/***/ }),
/* 788 */
/***/ (function(module, exports, __webpack_require__) {
// 20.1.2.10 Number.MIN_SAFE_INTEGER
var $export = __webpack_require__(0);
$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });
/***/ }),
/* 789 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
var $parseFloat = __webpack_require__(278);
// 20.1.2.12 Number.parseFloat(string)
$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });
/***/ }),
/* 790 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
var $parseInt = __webpack_require__(277);
// 20.1.2.13 Number.parseInt(string, radix)
$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });
/***/ }),
/* 791 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.3 Math.acosh(x)
var $export = __webpack_require__(0);
var log1p = __webpack_require__(281);
var sqrt = Math.sqrt;
var $acosh = Math.acosh;
$export($export.S + $export.F * !($acosh
// V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
&& Math.floor($acosh(Number.MAX_VALUE)) == 710
// Tor Browser bug: Math.acosh(Infinity) -> NaN
&& $acosh(Infinity) == Infinity
), 'Math', {
acosh: function acosh(x) {
return (x = +x) < 1 ? NaN : x > 94906265.62425156
? Math.log(x) + Math.LN2
: log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
}
});
/***/ }),
/* 792 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.5 Math.asinh(x)
var $export = __webpack_require__(0);
var $asinh = Math.asinh;
function asinh(x) {
return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
}
// Tor Browser bug: Math.asinh(0) -> -0
$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });
/***/ }),
/* 793 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.7 Math.atanh(x)
var $export = __webpack_require__(0);
var $atanh = Math.atanh;
// Tor Browser bug: Math.atanh(-0) -> 0
$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
atanh: function atanh(x) {
return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
}
});
/***/ }),
/* 794 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.9 Math.cbrt(x)
var $export = __webpack_require__(0);
var sign = __webpack_require__(79);
$export($export.S, 'Math', {
cbrt: function cbrt(x) {
return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);
}
});
/***/ }),
/* 795 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.11 Math.clz32(x)
var $export = __webpack_require__(0);
$export($export.S, 'Math', {
clz32: function clz32(x) {
return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;
}
});
/***/ }),
/* 796 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.12 Math.cosh(x)
var $export = __webpack_require__(0);
var exp = Math.exp;
$export($export.S, 'Math', {
cosh: function cosh(x) {
return (exp(x = +x) + exp(-x)) / 2;
}
});
/***/ }),
/* 797 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.14 Math.expm1(x)
var $export = __webpack_require__(0);
var $expm1 = __webpack_require__(80);
$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });
/***/ }),
/* 798 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.16 Math.fround(x)
var $export = __webpack_require__(0);
$export($export.S, 'Math', { fround: __webpack_require__(799) });
/***/ }),
/* 799 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.16 Math.fround(x)
var sign = __webpack_require__(79);
var pow = Math.pow;
var EPSILON = pow(2, -52);
var EPSILON32 = pow(2, -23);
var MAX32 = pow(2, 127) * (2 - EPSILON32);
var MIN32 = pow(2, -126);
var roundTiesToEven = function (n) {
return n + 1 / EPSILON - 1 / EPSILON;
};
module.exports = Math.fround || function fround(x) {
var $abs = Math.abs(x);
var $sign = sign(x);
var a, result;
if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
a = (1 + EPSILON32 / EPSILON) * $abs;
result = a - (a - $abs);
// eslint-disable-next-line no-self-compare
if (result > MAX32 || result != result) return $sign * Infinity;
return $sign * result;
};
/***/ }),
/* 800 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
var $export = __webpack_require__(0);
var abs = Math.abs;
$export($export.S, 'Math', {
hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars
var sum = 0;
var i = 0;
var aLen = arguments.length;
var larg = 0;
var arg, div;
while (i < aLen) {
arg = abs(arguments[i++]);
if (larg < arg) {
div = larg / arg;
sum = sum * div * div + 1;
larg = arg;
} else if (arg > 0) {
div = arg / larg;
sum += div * div;
} else sum += arg;
}
return larg === Infinity ? Infinity : larg * Math.sqrt(sum);
}
});
/***/ }),
/* 801 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.18 Math.imul(x, y)
var $export = __webpack_require__(0);
var $imul = Math.imul;
// some WebKit versions fails with big numbers, some has wrong arity
$export($export.S + $export.F * __webpack_require__(2)(function () {
return $imul(0xffffffff, 5) != -5 || $imul.length != 2;
}), 'Math', {
imul: function imul(x, y) {
var UINT16 = 0xffff;
var xn = +x;
var yn = +y;
var xl = UINT16 & xn;
var yl = UINT16 & yn;
return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
}
});
/***/ }),
/* 802 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.21 Math.log10(x)
var $export = __webpack_require__(0);
$export($export.S, 'Math', {
log10: function log10(x) {
return Math.log(x) * Math.LOG10E;
}
});
/***/ }),
/* 803 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.20 Math.log1p(x)
var $export = __webpack_require__(0);
$export($export.S, 'Math', { log1p: __webpack_require__(281) });
/***/ }),
/* 804 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.22 Math.log2(x)
var $export = __webpack_require__(0);
$export($export.S, 'Math', {
log2: function log2(x) {
return Math.log(x) / Math.LN2;
}
});
/***/ }),
/* 805 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.28 Math.sign(x)
var $export = __webpack_require__(0);
$export($export.S, 'Math', { sign: __webpack_require__(79) });
/***/ }),
/* 806 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.30 Math.sinh(x)
var $export = __webpack_require__(0);
var expm1 = __webpack_require__(80);
var exp = Math.exp;
// V8 near Chromium 38 has a problem with very small numbers
$export($export.S + $export.F * __webpack_require__(2)(function () {
return !Math.sinh(-2e-17) != -2e-17;
}), 'Math', {
sinh: function sinh(x) {
return Math.abs(x = +x) < 1
? (expm1(x) - expm1(-x)) / 2
: (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);
}
});
/***/ }),
/* 807 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.33 Math.tanh(x)
var $export = __webpack_require__(0);
var expm1 = __webpack_require__(80);
var exp = Math.exp;
$export($export.S, 'Math', {
tanh: function tanh(x) {
var a = expm1(x = +x);
var b = expm1(-x);
return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
}
});
/***/ }),
/* 808 */
/***/ (function(module, exports, __webpack_require__) {
// 20.2.2.34 Math.trunc(x)
var $export = __webpack_require__(0);
$export($export.S, 'Math', {
trunc: function trunc(it) {
return (it > 0 ? Math.floor : Math.ceil)(it);
}
});
/***/ }),
/* 809 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
var toAbsoluteIndex = __webpack_require__(33);
var fromCharCode = String.fromCharCode;
var $fromCodePoint = String.fromCodePoint;
// length should be 1, old FF problem
$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
// 21.1.2.2 String.fromCodePoint(...codePoints)
fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
var res = [];
var aLen = arguments.length;
var i = 0;
var code;
while (aLen > i) {
code = +arguments[i++];
if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');
res.push(code < 0x10000
? fromCharCode(code)
: fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
);
} return res.join('');
}
});
/***/ }),
/* 810 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
var toIObject = __webpack_require__(16);
var toLength = __webpack_require__(6);
$export($export.S, 'String', {
// 21.1.2.4 String.raw(callSite, ...substitutions)
raw: function raw(callSite) {
var tpl = toIObject(callSite.raw);
var len = toLength(tpl.length);
var aLen = arguments.length;
var res = [];
var i = 0;
while (len > i) {
res.push(String(tpl[i++]));
if (i < aLen) res.push(String(arguments[i]));
} return res.join('');
}
});
/***/ }),
/* 811 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 21.1.3.25 String.prototype.trim()
__webpack_require__(40)('trim', function ($trim) {
return function trim() {
return $trim(this, 3);
};
});
/***/ }),
/* 812 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $at = __webpack_require__(81)(true);
// 21.1.3.27 String.prototype[@@iterator]()
__webpack_require__(82)(String, 'String', function (iterated) {
this._t = String(iterated); // target
this._i = 0; // next index
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function () {
var O = this._t;
var index = this._i;
var point;
if (index >= O.length) return { value: undefined, done: true };
point = $at(O, index);
this._i += point.length;
return { value: point, done: false };
});
/***/ }),
/* 813 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var $at = __webpack_require__(81)(false);
$export($export.P, 'String', {
// 21.1.3.3 String.prototype.codePointAt(pos)
codePointAt: function codePointAt(pos) {
return $at(this, pos);
}
});
/***/ }),
/* 814 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
var $export = __webpack_require__(0);
var toLength = __webpack_require__(6);
var context = __webpack_require__(83);
var ENDS_WITH = 'endsWith';
var $endsWith = ''[ENDS_WITH];
$export($export.P + $export.F * __webpack_require__(85)(ENDS_WITH), 'String', {
endsWith: function endsWith(searchString /* , endPosition = @length */) {
var that = context(this, searchString, ENDS_WITH);
var endPosition = arguments.length > 1 ? arguments[1] : undefined;
var len = toLength(that.length);
var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);
var search = String(searchString);
return $endsWith
? $endsWith.call(that, search, end)
: that.slice(end - search.length, end) === search;
}
});
/***/ }),
/* 815 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 21.1.3.7 String.prototype.includes(searchString, position = 0)
var $export = __webpack_require__(0);
var context = __webpack_require__(83);
var INCLUDES = 'includes';
$export($export.P + $export.F * __webpack_require__(85)(INCLUDES), 'String', {
includes: function includes(searchString /* , position = 0 */) {
return !!~context(this, searchString, INCLUDES)
.indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
}
});
/***/ }),
/* 816 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
$export($export.P, 'String', {
// 21.1.3.13 String.prototype.repeat(count)
repeat: __webpack_require__(78)
});
/***/ }),
/* 817 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 21.1.3.18 String.prototype.startsWith(searchString [, position ])
var $export = __webpack_require__(0);
var toLength = __webpack_require__(6);
var context = __webpack_require__(83);
var STARTS_WITH = 'startsWith';
var $startsWith = ''[STARTS_WITH];
$export($export.P + $export.F * __webpack_require__(85)(STARTS_WITH), 'String', {
startsWith: function startsWith(searchString /* , position = 0 */) {
var that = context(this, searchString, STARTS_WITH);
var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
var search = String(searchString);
return $startsWith
? $startsWith.call(that, search, index)
: that.slice(index, index + search.length) === search;
}
});
/***/ }),
/* 818 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// B.2.3.2 String.prototype.anchor(name)
__webpack_require__(12)('anchor', function (createHTML) {
return function anchor(name) {
return createHTML(this, 'a', 'name', name);
};
});
/***/ }),
/* 819 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// B.2.3.3 String.prototype.big()
__webpack_require__(12)('big', function (createHTML) {
return function big() {
return createHTML(this, 'big', '', '');
};
});
/***/ }),
/* 820 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// B.2.3.4 String.prototype.blink()
__webpack_require__(12)('blink', function (createHTML) {
return function blink() {
return createHTML(this, 'blink', '', '');
};
});
/***/ }),
/* 821 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// B.2.3.5 String.prototype.bold()
__webpack_require__(12)('bold', function (createHTML) {
return function bold() {
return createHTML(this, 'b', '', '');
};
});
/***/ }),
/* 822 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// B.2.3.6 String.prototype.fixed()
__webpack_require__(12)('fixed', function (createHTML) {
return function fixed() {
return createHTML(this, 'tt', '', '');
};
});
/***/ }),
/* 823 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// B.2.3.7 String.prototype.fontcolor(color)
__webpack_require__(12)('fontcolor', function (createHTML) {
return function fontcolor(color) {
return createHTML(this, 'font', 'color', color);
};
});
/***/ }),
/* 824 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// B.2.3.8 String.prototype.fontsize(size)
__webpack_require__(12)('fontsize', function (createHTML) {
return function fontsize(size) {
return createHTML(this, 'font', 'size', size);
};
});
/***/ }),
/* 825 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// B.2.3.9 String.prototype.italics()
__webpack_require__(12)('italics', function (createHTML) {
return function italics() {
return createHTML(this, 'i', '', '');
};
});
/***/ }),
/* 826 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// B.2.3.10 String.prototype.link(url)
__webpack_require__(12)('link', function (createHTML) {
return function link(url) {
return createHTML(this, 'a', 'href', url);
};
});
/***/ }),
/* 827 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// B.2.3.11 String.prototype.small()
__webpack_require__(12)('small', function (createHTML) {
return function small() {
return createHTML(this, 'small', '', '');
};
});
/***/ }),
/* 828 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// B.2.3.12 String.prototype.strike()
__webpack_require__(12)('strike', function (createHTML) {
return function strike() {
return createHTML(this, 'strike', '', '');
};
});
/***/ }),
/* 829 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// B.2.3.13 String.prototype.sub()
__webpack_require__(12)('sub', function (createHTML) {
return function sub() {
return createHTML(this, 'sub', '', '');
};
});
/***/ }),
/* 830 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// B.2.3.14 String.prototype.sup()
__webpack_require__(12)('sup', function (createHTML) {
return function sup() {
return createHTML(this, 'sup', '', '');
};
});
/***/ }),
/* 831 */
/***/ (function(module, exports, __webpack_require__) {
// 20.3.3.1 / 15.9.4.4 Date.now()
var $export = __webpack_require__(0);
$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });
/***/ }),
/* 832 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var toObject = __webpack_require__(10);
var toPrimitive = __webpack_require__(27);
$export($export.P + $export.F * __webpack_require__(2)(function () {
return new Date(NaN).toJSON() !== null
|| Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
}), 'Date', {
// eslint-disable-next-line no-unused-vars
toJSON: function toJSON(key) {
var O = toObject(this);
var pv = toPrimitive(O);
return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
}
});
/***/ }),
/* 833 */
/***/ (function(module, exports, __webpack_require__) {
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
var $export = __webpack_require__(0);
var toISOString = __webpack_require__(834);
// PhantomJS / old WebKit has a broken implementations
$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {
toISOString: toISOString
});
/***/ }),
/* 834 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
var fails = __webpack_require__(2);
var getTime = Date.prototype.getTime;
var $toISOString = Date.prototype.toISOString;
var lz = function (num) {
return num > 9 ? num : '0' + num;
};
// PhantomJS / old WebKit has a broken implementations
module.exports = (fails(function () {
return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
}) || !fails(function () {
$toISOString.call(new Date(NaN));
})) ? function toISOString() {
if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');
var d = this;
var y = d.getUTCFullYear();
var m = d.getUTCMilliseconds();
var s = y < 0 ? '-' : y > 9999 ? '+' : '';
return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
'-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
} : $toISOString;
/***/ }),
/* 835 */
/***/ (function(module, exports, __webpack_require__) {
var DateProto = Date.prototype;
var INVALID_DATE = 'Invalid Date';
var TO_STRING = 'toString';
var $toString = DateProto[TO_STRING];
var getTime = DateProto.getTime;
if (new Date(NaN) + '' != INVALID_DATE) {
__webpack_require__(11)(DateProto, TO_STRING, function toString() {
var value = getTime.call(this);
// eslint-disable-next-line no-self-compare
return value === value ? $toString.call(this) : INVALID_DATE;
});
}
/***/ }),
/* 836 */
/***/ (function(module, exports, __webpack_require__) {
var TO_PRIMITIVE = __webpack_require__(5)('toPrimitive');
var proto = Date.prototype;
if (!(TO_PRIMITIVE in proto)) __webpack_require__(15)(proto, TO_PRIMITIVE, __webpack_require__(837));
/***/ }),
/* 837 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var anObject = __webpack_require__(3);
var toPrimitive = __webpack_require__(27);
var NUMBER = 'number';
module.exports = function (hint) {
if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');
return toPrimitive(anObject(this), hint != NUMBER);
};
/***/ }),
/* 838 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
var $export = __webpack_require__(0);
$export($export.S, 'Array', { isArray: __webpack_require__(56) });
/***/ }),
/* 839 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var ctx = __webpack_require__(18);
var $export = __webpack_require__(0);
var toObject = __webpack_require__(10);
var call = __webpack_require__(283);
var isArrayIter = __webpack_require__(86);
var toLength = __webpack_require__(6);
var createProperty = __webpack_require__(87);
var getIterFn = __webpack_require__(88);
$export($export.S + $export.F * !__webpack_require__(57)(function (iter) { Array.from(iter); }), 'Array', {
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var O = toObject(arrayLike);
var C = typeof this == 'function' ? this : Array;
var aLen = arguments.length;
var mapfn = aLen > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var index = 0;
var iterFn = getIterFn(O);
var length, result, step, iterator;
if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
// if object isn't iterable or it's array with default iterator - use simple case
if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
}
} else {
length = toLength(O.length);
for (result = new C(length); length > index; index++) {
createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
}
}
result.length = index;
return result;
}
});
/***/ }),
/* 840 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var createProperty = __webpack_require__(87);
// WebKit Array.of isn't generic
$export($export.S + $export.F * __webpack_require__(2)(function () {
function F() { /* empty */ }
return !(Array.of.call(F) instanceof F);
}), 'Array', {
// 22.1.2.3 Array.of( ...items)
of: function of(/* ...args */) {
var index = 0;
var aLen = arguments.length;
var result = new (typeof this == 'function' ? this : Array)(aLen);
while (aLen > index) createProperty(result, index, arguments[index++]);
result.length = aLen;
return result;
}
});
/***/ }),
/* 841 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 22.1.3.13 Array.prototype.join(separator)
var $export = __webpack_require__(0);
var toIObject = __webpack_require__(16);
var arrayJoin = [].join;
// fallback for not array-like strings
$export($export.P + $export.F * (__webpack_require__(46) != Object || !__webpack_require__(17)(arrayJoin)), 'Array', {
join: function join(separator) {
return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
}
});
/***/ }),
/* 842 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var html = __webpack_require__(74);
var cof = __webpack_require__(24);
var toAbsoluteIndex = __webpack_require__(33);
var toLength = __webpack_require__(6);
var arraySlice = [].slice;
// fallback for not array-like ES3 strings and DOM objects
$export($export.P + $export.F * __webpack_require__(2)(function () {
if (html) arraySlice.call(html);
}), 'Array', {
slice: function slice(begin, end) {
var len = toLength(this.length);
var klass = cof(this);
end = end === undefined ? len : end;
if (klass == 'Array') return arraySlice.call(this, begin, end);
var start = toAbsoluteIndex(begin, len);
var upTo = toAbsoluteIndex(end, len);
var size = toLength(upTo - start);
var cloned = new Array(size);
var i = 0;
for (; i < size; i++) cloned[i] = klass == 'String'
? this.charAt(start + i)
: this[start + i];
return cloned;
}
});
/***/ }),
/* 843 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var aFunction = __webpack_require__(19);
var toObject = __webpack_require__(10);
var fails = __webpack_require__(2);
var $sort = [].sort;
var test = [1, 2, 3];
$export($export.P + $export.F * (fails(function () {
// IE8-
test.sort(undefined);
}) || !fails(function () {
// V8 bug
test.sort(null);
// Old WebKit
}) || !__webpack_require__(17)($sort)), 'Array', {
// 22.1.3.25 Array.prototype.sort(comparefn)
sort: function sort(comparefn) {
return comparefn === undefined
? $sort.call(toObject(this))
: $sort.call(toObject(this), aFunction(comparefn));
}
});
/***/ }),
/* 844 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var $forEach = __webpack_require__(23)(0);
var STRICT = __webpack_require__(17)([].forEach, true);
$export($export.P + $export.F * !STRICT, 'Array', {
// 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
forEach: function forEach(callbackfn /* , thisArg */) {
return $forEach(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 845 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(4);
var isArray = __webpack_require__(56);
var SPECIES = __webpack_require__(5)('species');
module.exports = function (original) {
var C;
if (isArray(original)) {
C = original.constructor;
// cross-realm fallback
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
if (isObject(C)) {
C = C[SPECIES];
if (C === null) C = undefined;
}
} return C === undefined ? Array : C;
};
/***/ }),
/* 846 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var $map = __webpack_require__(23)(1);
$export($export.P + $export.F * !__webpack_require__(17)([].map, true), 'Array', {
// 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
map: function map(callbackfn /* , thisArg */) {
return $map(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 847 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var $filter = __webpack_require__(23)(2);
$export($export.P + $export.F * !__webpack_require__(17)([].filter, true), 'Array', {
// 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
filter: function filter(callbackfn /* , thisArg */) {
return $filter(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 848 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var $some = __webpack_require__(23)(3);
$export($export.P + $export.F * !__webpack_require__(17)([].some, true), 'Array', {
// 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
some: function some(callbackfn /* , thisArg */) {
return $some(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 849 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var $every = __webpack_require__(23)(4);
$export($export.P + $export.F * !__webpack_require__(17)([].every, true), 'Array', {
// 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
every: function every(callbackfn /* , thisArg */) {
return $every(this, callbackfn, arguments[1]);
}
});
/***/ }),
/* 850 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var $reduce = __webpack_require__(285);
$export($export.P + $export.F * !__webpack_require__(17)([].reduce, true), 'Array', {
// 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
reduce: function reduce(callbackfn /* , initialValue */) {
return $reduce(this, callbackfn, arguments.length, arguments[1], false);
}
});
/***/ }),
/* 851 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var $reduce = __webpack_require__(285);
$export($export.P + $export.F * !__webpack_require__(17)([].reduceRight, true), 'Array', {
// 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
reduceRight: function reduceRight(callbackfn /* , initialValue */) {
return $reduce(this, callbackfn, arguments.length, arguments[1], true);
}
});
/***/ }),
/* 852 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var $indexOf = __webpack_require__(54)(false);
var $native = [].indexOf;
var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(17)($native)), 'Array', {
// 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
return NEGATIVE_ZERO
// convert -0 to +0
? $native.apply(this, arguments) || 0
: $indexOf(this, searchElement, arguments[1]);
}
});
/***/ }),
/* 853 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var toIObject = __webpack_require__(16);
var toInteger = __webpack_require__(20);
var toLength = __webpack_require__(6);
var $native = [].lastIndexOf;
var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;
$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(17)($native)), 'Array', {
// 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
// convert -0 to +0
if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;
var O = toIObject(this);
var length = toLength(O.length);
var index = length - 1;
if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));
if (index < 0) index = length + index;
for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;
return -1;
}
});
/***/ }),
/* 854 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
var $export = __webpack_require__(0);
$export($export.P, 'Array', { copyWithin: __webpack_require__(286) });
__webpack_require__(37)('copyWithin');
/***/ }),
/* 855 */
/***/ (function(module, exports, __webpack_require__) {
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
var $export = __webpack_require__(0);
$export($export.P, 'Array', { fill: __webpack_require__(89) });
__webpack_require__(37)('fill');
/***/ }),
/* 856 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
var $export = __webpack_require__(0);
var $find = __webpack_require__(23)(5);
var KEY = 'find';
var forced = true;
// Shouldn't skip holes
if (KEY in []) Array(1)[KEY](function () { forced = false; });
$export($export.P + $export.F * forced, 'Array', {
find: function find(callbackfn /* , that = undefined */) {
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__(37)(KEY);
/***/ }),
/* 857 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
var $export = __webpack_require__(0);
var $find = __webpack_require__(23)(6);
var KEY = 'findIndex';
var forced = true;
// Shouldn't skip holes
if (KEY in []) Array(1)[KEY](function () { forced = false; });
$export($export.P + $export.F * forced, 'Array', {
findIndex: function findIndex(callbackfn /* , that = undefined */) {
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__(37)(KEY);
/***/ }),
/* 858 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(42)('Array');
/***/ }),
/* 859 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(1);
var inheritIfRequired = __webpack_require__(77);
var dP = __webpack_require__(9).f;
var gOPN = __webpack_require__(35).f;
var isRegExp = __webpack_require__(84);
var $flags = __webpack_require__(58);
var $RegExp = global.RegExp;
var Base = $RegExp;
var proto = $RegExp.prototype;
var re1 = /a/g;
var re2 = /a/g;
// "new" creates a new object, old webkit buggy here
var CORRECT_NEW = new $RegExp(re1) !== re1;
if (__webpack_require__(8) && (!CORRECT_NEW || __webpack_require__(2)(function () {
re2[__webpack_require__(5)('match')] = false;
// RegExp constructor can alter flags and IsRegExp works correct with @@match
return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
}))) {
$RegExp = function RegExp(p, f) {
var tiRE = this instanceof $RegExp;
var piRE = isRegExp(p);
var fiU = f === undefined;
return !tiRE && piRE && p.constructor === $RegExp && fiU ? p
: inheritIfRequired(CORRECT_NEW
? new Base(piRE && !fiU ? p.source : p, f)
: Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)
, tiRE ? this : proto, $RegExp);
};
var proxy = function (key) {
key in $RegExp || dP($RegExp, key, {
configurable: true,
get: function () { return Base[key]; },
set: function (it) { Base[key] = it; }
});
};
for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);
proto.constructor = $RegExp;
$RegExp.prototype = proto;
__webpack_require__(11)(global, 'RegExp', $RegExp);
}
__webpack_require__(42)('RegExp');
/***/ }),
/* 860 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(289);
var anObject = __webpack_require__(3);
var $flags = __webpack_require__(58);
var DESCRIPTORS = __webpack_require__(8);
var TO_STRING = 'toString';
var $toString = /./[TO_STRING];
var define = function (fn) {
__webpack_require__(11)(RegExp.prototype, TO_STRING, fn, true);
};
// 21.2.5.14 RegExp.prototype.toString()
if (__webpack_require__(2)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {
define(function toString() {
var R = anObject(this);
return '/'.concat(R.source, '/',
'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
});
// FF44- RegExp#toString has a wrong name
} else if ($toString.name != TO_STRING) {
define(function toString() {
return $toString.call(this);
});
}
/***/ }),
/* 861 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var anObject = __webpack_require__(3);
var toLength = __webpack_require__(6);
var advanceStringIndex = __webpack_require__(92);
var regExpExec = __webpack_require__(59);
// @@match logic
__webpack_require__(60)('match', 1, function (defined, MATCH, $match, maybeCallNative) {
return [
// `String.prototype.match` method
// https://tc39.github.io/ecma262/#sec-string.prototype.match
function match(regexp) {
var O = defined(this);
var fn = regexp == undefined ? undefined : regexp[MATCH];
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
},
// `RegExp.prototype[@@match]` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
function (regexp) {
var res = maybeCallNative($match, regexp, this);
if (res.done) return res.value;
var rx = anObject(regexp);
var S = String(this);
if (!rx.global) return regExpExec(rx, S);
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
var A = [];
var n = 0;
var result;
while ((result = regExpExec(rx, S)) !== null) {
var matchStr = String(result[0]);
A[n] = matchStr;
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
n++;
}
return n === 0 ? null : A;
}
];
});
/***/ }),
/* 862 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var anObject = __webpack_require__(3);
var toObject = __webpack_require__(10);
var toLength = __webpack_require__(6);
var toInteger = __webpack_require__(20);
var advanceStringIndex = __webpack_require__(92);
var regExpExec = __webpack_require__(59);
var max = Math.max;
var min = Math.min;
var floor = Math.floor;
var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
var maybeToString = function (it) {
return it === undefined ? it : String(it);
};
// @@replace logic
__webpack_require__(60)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {
return [
// `String.prototype.replace` method
// https://tc39.github.io/ecma262/#sec-string.prototype.replace
function replace(searchValue, replaceValue) {
var O = defined(this);
var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
return fn !== undefined
? fn.call(searchValue, O, replaceValue)
: $replace.call(String(O), searchValue, replaceValue);
},
// `RegExp.prototype[@@replace]` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
function (regexp, replaceValue) {
var res = maybeCallNative($replace, regexp, this, replaceValue);
if (res.done) return res.value;
var rx = anObject(regexp);
var S = String(this);
var functionalReplace = typeof replaceValue === 'function';
if (!functionalReplace) replaceValue = String(replaceValue);
var global = rx.global;
if (global) {
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
}
var results = [];
while (true) {
var result = regExpExec(rx, S);
if (result === null) break;
results.push(result);
if (!global) break;
var matchStr = String(result[0]);
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
}
var accumulatedResult = '';
var nextSourcePosition = 0;
for (var i = 0; i < results.length; i++) {
result = results[i];
var matched = String(result[0]);
var position = max(min(toInteger(result.index), S.length), 0);
var captures = [];
// NOTE: This is equivalent to
// captures = result.slice(1).map(maybeToString)
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
var namedCaptures = result.groups;
if (functionalReplace) {
var replacerArgs = [matched].concat(captures, position, S);
if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
var replacement = String(replaceValue.apply(undefined, replacerArgs));
} else {
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
}
if (position >= nextSourcePosition) {
accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
nextSourcePosition = position + matched.length;
}
}
return accumulatedResult + S.slice(nextSourcePosition);
}
];
// https://tc39.github.io/ecma262/#sec-getsubstitution
function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
var tailPos = position + matched.length;
var m = captures.length;
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
if (namedCaptures !== undefined) {
namedCaptures = toObject(namedCaptures);
symbols = SUBSTITUTION_SYMBOLS;
}
return $replace.call(replacement, symbols, function (match, ch) {
var capture;
switch (ch.charAt(0)) {
case '$': return '$';
case '&': return matched;
case '`': return str.slice(0, position);
case "'": return str.slice(tailPos);
case '<':
capture = namedCaptures[ch.slice(1, -1)];
break;
default: // \d\d?
var n = +ch;
if (n === 0) return match;
if (n > m) {
var f = floor(n / 10);
if (f === 0) return match;
if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
return match;
}
capture = captures[n - 1];
}
return capture === undefined ? '' : capture;
});
}
});
/***/ }),
/* 863 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var anObject = __webpack_require__(3);
var sameValue = __webpack_require__(274);
var regExpExec = __webpack_require__(59);
// @@search logic
__webpack_require__(60)('search', 1, function (defined, SEARCH, $search, maybeCallNative) {
return [
// `String.prototype.search` method
// https://tc39.github.io/ecma262/#sec-string.prototype.search
function search(regexp) {
var O = defined(this);
var fn = regexp == undefined ? undefined : regexp[SEARCH];
return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
},
// `RegExp.prototype[@@search]` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
function (regexp) {
var res = maybeCallNative($search, regexp, this);
if (res.done) return res.value;
var rx = anObject(regexp);
var S = String(this);
var previousLastIndex = rx.lastIndex;
if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
var result = regExpExec(rx, S);
if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
return result === null ? -1 : result.index;
}
];
});
/***/ }),
/* 864 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var isRegExp = __webpack_require__(84);
var anObject = __webpack_require__(3);
var speciesConstructor = __webpack_require__(49);
var advanceStringIndex = __webpack_require__(92);
var toLength = __webpack_require__(6);
var callRegExpExec = __webpack_require__(59);
var regexpExec = __webpack_require__(91);
var fails = __webpack_require__(2);
var $min = Math.min;
var $push = [].push;
var $SPLIT = 'split';
var LENGTH = 'length';
var LAST_INDEX = 'lastIndex';
var MAX_UINT32 = 0xffffffff;
// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); });
// @@split logic
__webpack_require__(60)('split', 2, function (defined, SPLIT, $split, maybeCallNative) {
var internalSplit;
if (
'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
'.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
'.'[$SPLIT](/()()/)[LENGTH] > 1 ||
''[$SPLIT](/.?/)[LENGTH]
) {
// based on es5-shim implementation, need to rework it
internalSplit = function (separator, limit) {
var string = String(this);
if (separator === undefined && limit === 0) return [];
// If `separator` is not a regex, use native split
if (!isRegExp(separator)) return $split.call(string, separator, limit);
var output = [];
var flags = (separator.ignoreCase ? 'i' : '') +
(separator.multiline ? 'm' : '') +
(separator.unicode ? 'u' : '') +
(separator.sticky ? 'y' : '');
var lastLastIndex = 0;
var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0;
// Make `global` and avoid `lastIndex` issues by working with a copy
var separatorCopy = new RegExp(separator.source, flags + 'g');
var match, lastIndex, lastLength;
while (match = regexpExec.call(separatorCopy, string)) {
lastIndex = separatorCopy[LAST_INDEX];
if (lastIndex > lastLastIndex) {
output.push(string.slice(lastLastIndex, match.index));
if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));
lastLength = match[0][LENGTH];
lastLastIndex = lastIndex;
if (output[LENGTH] >= splitLimit) break;
}
if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
}
if (lastLastIndex === string[LENGTH]) {
if (lastLength || !separatorCopy.test('')) output.push('');
} else output.push(string.slice(lastLastIndex));
return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
};
// Chakra, V8
} else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {
internalSplit = function (separator, limit) {
return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit);
};
} else {
internalSplit = $split;
}
return [
// `String.prototype.split` method
// https://tc39.github.io/ecma262/#sec-string.prototype.split
function split(separator, limit) {
var O = defined(this);
var splitter = separator == undefined ? undefined : separator[SPLIT];
return splitter !== undefined
? splitter.call(separator, O, limit)
: internalSplit.call(String(O), separator, limit);
},
// `RegExp.prototype[@@split]` method
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
//
// NOTE: This cannot be properly polyfilled in engines that don't support
// the 'y' flag.
function (regexp, limit) {
var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split);
if (res.done) return res.value;
var rx = anObject(regexp);
var S = String(this);
var C = speciesConstructor(rx, RegExp);
var unicodeMatching = rx.unicode;
var flags = (rx.ignoreCase ? 'i' : '') +
(rx.multiline ? 'm' : '') +
(rx.unicode ? 'u' : '') +
(SUPPORTS_Y ? 'y' : 'g');
// ^(? + rx + ) is needed, in combination with some S slicing, to
// simulate the 'y' flag.
var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
if (lim === 0) return [];
if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
var p = 0;
var q = 0;
var A = [];
while (q < S.length) {
splitter.lastIndex = SUPPORTS_Y ? q : 0;
var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
var e;
if (
z === null ||
(e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
) {
q = advanceStringIndex(S, q, unicodeMatching);
} else {
A.push(S.slice(p, q));
if (A.length === lim) return A;
for (var i = 1; i <= z.length - 1; i++) {
A.push(z[i]);
if (A.length === lim) return A;
}
q = p = e;
}
}
A.push(S.slice(p));
return A;
}
];
});
/***/ }),
/* 865 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(1);
var macrotask = __webpack_require__(93).set;
var Observer = global.MutationObserver || global.WebKitMutationObserver;
var process = global.process;
var Promise = global.Promise;
var isNode = __webpack_require__(24)(process) == 'process';
module.exports = function () {
var head, last, notify;
var flush = function () {
var parent, fn;
if (isNode && (parent = process.domain)) parent.exit();
while (head) {
fn = head.fn;
head = head.next;
try {
fn();
} catch (e) {
if (head) notify();
else last = undefined;
throw e;
}
} last = undefined;
if (parent) parent.enter();
};
// Node.js
if (isNode) {
notify = function () {
process.nextTick(flush);
};
// browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
} else if (Observer && !(global.navigator && global.navigator.standalone)) {
var toggle = true;
var node = document.createTextNode('');
new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
notify = function () {
node.data = toggle = !toggle;
};
// environments with maybe non-completely correct, but existent Promise
} else if (Promise && Promise.resolve) {
// Promise.resolve without an argument throws an error in LG WebOS 2
var promise = Promise.resolve(undefined);
notify = function () {
promise.then(flush);
};
// for other environments - macrotask based on:
// - setImmediate
// - MessageChannel
// - window.postMessag
// - onreadystatechange
// - setTimeout
} else {
notify = function () {
// strange IE + webpack dev server bug - use .call(global)
macrotask.call(global, flush);
};
}
return function (fn) {
var task = { fn: fn, next: undefined };
if (last) last.next = task;
if (!head) {
head = task;
notify();
} last = task;
};
};
/***/ }),
/* 866 */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return { e: false, v: exec() };
} catch (e) {
return { e: true, v: e };
}
};
/***/ }),
/* 867 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var strong = __webpack_require__(293);
var validate = __webpack_require__(38);
var MAP = 'Map';
// 23.1 Map Objects
module.exports = __webpack_require__(63)(MAP, function (get) {
return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.1.3.6 Map.prototype.get(key)
get: function get(key) {
var entry = strong.getEntry(validate(this, MAP), key);
return entry && entry.v;
},
// 23.1.3.9 Map.prototype.set(key, value)
set: function set(key, value) {
return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);
}
}, strong, true);
/***/ }),
/* 868 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var strong = __webpack_require__(293);
var validate = __webpack_require__(38);
var SET = 'Set';
// 23.2 Set Objects
module.exports = __webpack_require__(63)(SET, function (get) {
return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.2.3.1 Set.prototype.add(value)
add: function add(value) {
return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
}
}, strong);
/***/ }),
/* 869 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var global = __webpack_require__(1);
var each = __webpack_require__(23)(0);
var redefine = __webpack_require__(11);
var meta = __webpack_require__(28);
var assign = __webpack_require__(273);
var weak = __webpack_require__(294);
var isObject = __webpack_require__(4);
var validate = __webpack_require__(38);
var NATIVE_WEAK_MAP = __webpack_require__(38);
var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
var WEAK_MAP = 'WeakMap';
var getWeak = meta.getWeak;
var isExtensible = Object.isExtensible;
var uncaughtFrozenStore = weak.ufstore;
var InternalMap;
var wrapper = function (get) {
return function WeakMap() {
return get(this, arguments.length > 0 ? arguments[0] : undefined);
};
};
var methods = {
// 23.3.3.3 WeakMap.prototype.get(key)
get: function get(key) {
if (isObject(key)) {
var data = getWeak(key);
if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);
return data ? data[this._i] : undefined;
}
},
// 23.3.3.5 WeakMap.prototype.set(key, value)
set: function set(key, value) {
return weak.def(validate(this, WEAK_MAP), key, value);
}
};
// 23.3 WeakMap Objects
var $WeakMap = module.exports = __webpack_require__(63)(WEAK_MAP, wrapper, methods, weak, true, true);
// IE11 WeakMap frozen keys fix
if (NATIVE_WEAK_MAP && IS_IE11) {
InternalMap = weak.getConstructor(wrapper, WEAK_MAP);
assign(InternalMap.prototype, methods);
meta.NEED = true;
each(['delete', 'has', 'get', 'set'], function (key) {
var proto = $WeakMap.prototype;
var method = proto[key];
redefine(proto, key, function (a, b) {
// store frozen objects on internal weakmap shim
if (isObject(a) && !isExtensible(a)) {
if (!this._f) this._f = new InternalMap();
var result = this._f[key](a, b);
return key == 'set' ? this : result;
// store all the rest on native weakmap
} return method.call(this, a, b);
});
});
}
/***/ }),
/* 870 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var weak = __webpack_require__(294);
var validate = __webpack_require__(38);
var WEAK_SET = 'WeakSet';
// 23.4 WeakSet Objects
__webpack_require__(63)(WEAK_SET, function (get) {
return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.4.3.1 WeakSet.prototype.add(value)
add: function add(value) {
return weak.def(validate(this, WEAK_SET), value, true);
}
}, weak, false, true);
/***/ }),
/* 871 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $export = __webpack_require__(0);
var $typed = __webpack_require__(64);
var buffer = __webpack_require__(94);
var anObject = __webpack_require__(3);
var toAbsoluteIndex = __webpack_require__(33);
var toLength = __webpack_require__(6);
var isObject = __webpack_require__(4);
var ArrayBuffer = __webpack_require__(1).ArrayBuffer;
var speciesConstructor = __webpack_require__(49);
var $ArrayBuffer = buffer.ArrayBuffer;
var $DataView = buffer.DataView;
var $isView = $typed.ABV && ArrayBuffer.isView;
var $slice = $ArrayBuffer.prototype.slice;
var VIEW = $typed.VIEW;
var ARRAY_BUFFER = 'ArrayBuffer';
$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });
$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {
// 24.1.3.1 ArrayBuffer.isView(arg)
isView: function isView(it) {
return $isView && $isView(it) || isObject(it) && VIEW in it;
}
});
$export($export.P + $export.U + $export.F * __webpack_require__(2)(function () {
return !new $ArrayBuffer(2).slice(1, undefined).byteLength;
}), ARRAY_BUFFER, {
// 24.1.4.3 ArrayBuffer.prototype.slice(start, end)
slice: function slice(start, end) {
if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix
var len = anObject(this).byteLength;
var first = toAbsoluteIndex(start, len);
var fin = toAbsoluteIndex(end === undefined ? len : end, len);
var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));
var viewS = new $DataView(this);
var viewT = new $DataView(result);
var index = 0;
while (first < fin) {
viewT.setUint8(index++, viewS.getUint8(first++));
} return result;
}
});
__webpack_require__(42)(ARRAY_BUFFER);
/***/ }),
/* 872 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
$export($export.G + $export.W + $export.F * !__webpack_require__(64).ABV, {
DataView: __webpack_require__(94).DataView
});
/***/ }),
/* 873 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(26)('Int8', 1, function (init) {
return function Int8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 874 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(26)('Uint8', 1, function (init) {
return function Uint8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 875 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(26)('Uint8', 1, function (init) {
return function Uint8ClampedArray(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
}, true);
/***/ }),
/* 876 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(26)('Int16', 2, function (init) {
return function Int16Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 877 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(26)('Uint16', 2, function (init) {
return function Uint16Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 878 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(26)('Int32', 4, function (init) {
return function Int32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 879 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(26)('Uint32', 4, function (init) {
return function Uint32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 880 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(26)('Float32', 4, function (init) {
return function Float32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 881 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(26)('Float64', 8, function (init) {
return function Float64Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
/***/ }),
/* 882 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
var $export = __webpack_require__(0);
var aFunction = __webpack_require__(19);
var anObject = __webpack_require__(3);
var rApply = (__webpack_require__(1).Reflect || {}).apply;
var fApply = Function.apply;
// MS Edge argumentsList argument is optional
$export($export.S + $export.F * !__webpack_require__(2)(function () {
rApply(function () { /* empty */ });
}), 'Reflect', {
apply: function apply(target, thisArgument, argumentsList) {
var T = aFunction(target);
var L = anObject(argumentsList);
return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
}
});
/***/ }),
/* 883 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
var $export = __webpack_require__(0);
var create = __webpack_require__(34);
var aFunction = __webpack_require__(19);
var anObject = __webpack_require__(3);
var isObject = __webpack_require__(4);
var fails = __webpack_require__(2);
var bind = __webpack_require__(275);
var rConstruct = (__webpack_require__(1).Reflect || {}).construct;
// MS Edge supports only 2 arguments and argumentsList argument is optional
// FF Nightly sets third argument as `new.target`, but does not create `this` from it
var NEW_TARGET_BUG = fails(function () {
function F() { /* empty */ }
return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);
});
var ARGS_BUG = !fails(function () {
rConstruct(function () { /* empty */ });
});
$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
construct: function construct(Target, args /* , newTarget */) {
aFunction(Target);
anObject(args);
var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);
if (Target == newTarget) {
// w/o altered newTarget, optimization for 0-4 arguments
switch (args.length) {
case 0: return new Target();
case 1: return new Target(args[0]);
case 2: return new Target(args[0], args[1]);
case 3: return new Target(args[0], args[1], args[2]);
case 4: return new Target(args[0], args[1], args[2], args[3]);
}
// w/o altered newTarget, lot of arguments case
var $args = [null];
$args.push.apply($args, args);
return new (bind.apply(Target, $args))();
}
// with altered newTarget, not support built-in constructors
var proto = newTarget.prototype;
var instance = create(isObject(proto) ? proto : Object.prototype);
var result = Function.apply.call(Target, instance, args);
return isObject(result) ? result : instance;
}
});
/***/ }),
/* 884 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
var dP = __webpack_require__(9);
var $export = __webpack_require__(0);
var anObject = __webpack_require__(3);
var toPrimitive = __webpack_require__(27);
// MS Edge has broken Reflect.defineProperty - throwing instead of returning false
$export($export.S + $export.F * __webpack_require__(2)(function () {
// eslint-disable-next-line no-undef
Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });
}), 'Reflect', {
defineProperty: function defineProperty(target, propertyKey, attributes) {
anObject(target);
propertyKey = toPrimitive(propertyKey, true);
anObject(attributes);
try {
dP.f(target, propertyKey, attributes);
return true;
} catch (e) {
return false;
}
}
});
/***/ }),
/* 885 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.4 Reflect.deleteProperty(target, propertyKey)
var $export = __webpack_require__(0);
var gOPD = __webpack_require__(21).f;
var anObject = __webpack_require__(3);
$export($export.S, 'Reflect', {
deleteProperty: function deleteProperty(target, propertyKey) {
var desc = gOPD(anObject(target), propertyKey);
return desc && !desc.configurable ? false : delete target[propertyKey];
}
});
/***/ }),
/* 886 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// 26.1.5 Reflect.enumerate(target)
var $export = __webpack_require__(0);
var anObject = __webpack_require__(3);
var Enumerate = function (iterated) {
this._t = anObject(iterated); // target
this._i = 0; // next index
var keys = this._k = []; // keys
var key;
for (key in iterated) keys.push(key);
};
__webpack_require__(282)(Enumerate, 'Object', function () {
var that = this;
var keys = that._k;
var key;
do {
if (that._i >= keys.length) return { value: undefined, done: true };
} while (!((key = keys[that._i++]) in that._t));
return { value: key, done: false };
});
$export($export.S, 'Reflect', {
enumerate: function enumerate(target) {
return new Enumerate(target);
}
});
/***/ }),
/* 887 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.6 Reflect.get(target, propertyKey [, receiver])
var gOPD = __webpack_require__(21);
var getPrototypeOf = __webpack_require__(36);
var has = __webpack_require__(14);
var $export = __webpack_require__(0);
var isObject = __webpack_require__(4);
var anObject = __webpack_require__(3);
function get(target, propertyKey /* , receiver */) {
var receiver = arguments.length < 3 ? target : arguments[2];
var desc, proto;
if (anObject(target) === receiver) return target[propertyKey];
if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')
? desc.value
: desc.get !== undefined
? desc.get.call(receiver)
: undefined;
if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);
}
$export($export.S, 'Reflect', { get: get });
/***/ }),
/* 888 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
var gOPD = __webpack_require__(21);
var $export = __webpack_require__(0);
var anObject = __webpack_require__(3);
$export($export.S, 'Reflect', {
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
return gOPD.f(anObject(target), propertyKey);
}
});
/***/ }),
/* 889 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.8 Reflect.getPrototypeOf(target)
var $export = __webpack_require__(0);
var getProto = __webpack_require__(36);
var anObject = __webpack_require__(3);
$export($export.S, 'Reflect', {
getPrototypeOf: function getPrototypeOf(target) {
return getProto(anObject(target));
}
});
/***/ }),
/* 890 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.9 Reflect.has(target, propertyKey)
var $export = __webpack_require__(0);
$export($export.S, 'Reflect', {
has: function has(target, propertyKey) {
return propertyKey in target;
}
});
/***/ }),
/* 891 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.10 Reflect.isExtensible(target)
var $export = __webpack_require__(0);
var anObject = __webpack_require__(3);
var $isExtensible = Object.isExtensible;
$export($export.S, 'Reflect', {
isExtensible: function isExtensible(target) {
anObject(target);
return $isExtensible ? $isExtensible(target) : true;
}
});
/***/ }),
/* 892 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.11 Reflect.ownKeys(target)
var $export = __webpack_require__(0);
$export($export.S, 'Reflect', { ownKeys: __webpack_require__(296) });
/***/ }),
/* 893 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.12 Reflect.preventExtensions(target)
var $export = __webpack_require__(0);
var anObject = __webpack_require__(3);
var $preventExtensions = Object.preventExtensions;
$export($export.S, 'Reflect', {
preventExtensions: function preventExtensions(target) {
anObject(target);
try {
if ($preventExtensions) $preventExtensions(target);
return true;
} catch (e) {
return false;
}
}
});
/***/ }),
/* 894 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
var dP = __webpack_require__(9);
var gOPD = __webpack_require__(21);
var getPrototypeOf = __webpack_require__(36);
var has = __webpack_require__(14);
var $export = __webpack_require__(0);
var createDesc = __webpack_require__(29);
var anObject = __webpack_require__(3);
var isObject = __webpack_require__(4);
function set(target, propertyKey, V /* , receiver */) {
var receiver = arguments.length < 4 ? target : arguments[3];
var ownDesc = gOPD.f(anObject(target), propertyKey);
var existingDescriptor, proto;
if (!ownDesc) {
if (isObject(proto = getPrototypeOf(target))) {
return set(proto, propertyKey, V, receiver);
}
ownDesc = createDesc(0);
}
if (has(ownDesc, 'value')) {
if (ownDesc.writable === false || !isObject(receiver)) return false;
if (existingDescriptor = gOPD.f(receiver, propertyKey)) {
if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
existingDescriptor.value = V;
dP.f(receiver, propertyKey, existingDescriptor);
} else dP.f(receiver, propertyKey, createDesc(0, V));
return true;
}
return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
}
$export($export.S, 'Reflect', { set: set });
/***/ }),
/* 895 */
/***/ (function(module, exports, __webpack_require__) {
// 26.1.14 Reflect.setPrototypeOf(target, proto)
var $export = __webpack_require__(0);
var setProto = __webpack_require__(75);
if (setProto) $export($export.S, 'Reflect', {
setPrototypeOf: function setPrototypeOf(target, proto) {
setProto.check(target, proto);
try {
setProto.set(target, proto);
return true;
} catch (e) {
return false;
}
}
});
/***/ }),
/* 896 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(897);
module.exports = __webpack_require__(7).Array.includes;
/***/ }),
/* 897 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://github.com/tc39/Array.prototype.includes
var $export = __webpack_require__(0);
var $includes = __webpack_require__(54)(true);
$export($export.P, 'Array', {
includes: function includes(el /* , fromIndex = 0 */) {
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
}
});
__webpack_require__(37)('includes');
/***/ }),
/* 898 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(899);
module.exports = __webpack_require__(7).Array.flatMap;
/***/ }),
/* 899 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap
var $export = __webpack_require__(0);
var flattenIntoArray = __webpack_require__(900);
var toObject = __webpack_require__(10);
var toLength = __webpack_require__(6);
var aFunction = __webpack_require__(19);
var arraySpeciesCreate = __webpack_require__(284);
$export($export.P, 'Array', {
flatMap: function flatMap(callbackfn /* , thisArg */) {
var O = toObject(this);
var sourceLen, A;
aFunction(callbackfn);
sourceLen = toLength(O.length);
A = arraySpeciesCreate(O, 0);
flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);
return A;
}
});
__webpack_require__(37)('flatMap');
/***/ }),
/* 900 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
var isArray = __webpack_require__(56);
var isObject = __webpack_require__(4);
var toLength = __webpack_require__(6);
var ctx = __webpack_require__(18);
var IS_CONCAT_SPREADABLE = __webpack_require__(5)('isConcatSpreadable');
function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {
var targetIndex = start;
var sourceIndex = 0;
var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;
var element, spreadable;
while (sourceIndex < sourceLen) {
if (sourceIndex in source) {
element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
spreadable = false;
if (isObject(element)) {
spreadable = element[IS_CONCAT_SPREADABLE];
spreadable = spreadable !== undefined ? !!spreadable : isArray(element);
}
if (spreadable && depth > 0) {
targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
} else {
if (targetIndex >= 0x1fffffffffffff) throw TypeError();
target[targetIndex] = element;
}
targetIndex++;
}
sourceIndex++;
}
return targetIndex;
}
module.exports = flattenIntoArray;
/***/ }),
/* 901 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(902);
module.exports = __webpack_require__(7).String.padStart;
/***/ }),
/* 902 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://github.com/tc39/proposal-string-pad-start-end
var $export = __webpack_require__(0);
var $pad = __webpack_require__(297);
var userAgent = __webpack_require__(62);
// https://github.com/zloirock/core-js/issues/280
var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
$export($export.P + $export.F * WEBKIT_BUG, 'String', {
padStart: function padStart(maxLength /* , fillString = ' ' */) {
return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
}
});
/***/ }),
/* 903 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(904);
module.exports = __webpack_require__(7).String.padEnd;
/***/ }),
/* 904 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://github.com/tc39/proposal-string-pad-start-end
var $export = __webpack_require__(0);
var $pad = __webpack_require__(297);
var userAgent = __webpack_require__(62);
// https://github.com/zloirock/core-js/issues/280
var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
$export($export.P + $export.F * WEBKIT_BUG, 'String', {
padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
}
});
/***/ }),
/* 905 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(906);
module.exports = __webpack_require__(7).String.trimLeft;
/***/ }),
/* 906 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://github.com/sebmarkbage/ecmascript-string-left-right-trim
__webpack_require__(40)('trimLeft', function ($trim) {
return function trimLeft() {
return $trim(this, 1);
};
}, 'trimStart');
/***/ }),
/* 907 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(908);
module.exports = __webpack_require__(7).String.trimRight;
/***/ }),
/* 908 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://github.com/sebmarkbage/ecmascript-string-left-right-trim
__webpack_require__(40)('trimRight', function ($trim) {
return function trimRight() {
return $trim(this, 2);
};
}, 'trimEnd');
/***/ }),
/* 909 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(910);
module.exports = __webpack_require__(71).f('asyncIterator');
/***/ }),
/* 910 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(269)('asyncIterator');
/***/ }),
/* 911 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(912);
module.exports = __webpack_require__(7).Object.getOwnPropertyDescriptors;
/***/ }),
/* 912 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-getownpropertydescriptors
var $export = __webpack_require__(0);
var ownKeys = __webpack_require__(296);
var toIObject = __webpack_require__(16);
var gOPD = __webpack_require__(21);
var createProperty = __webpack_require__(87);
$export($export.S, 'Object', {
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
var O = toIObject(object);
var getDesc = gOPD.f;
var keys = ownKeys(O);
var result = {};
var i = 0;
var key, desc;
while (keys.length > i) {
desc = getDesc(O, key = keys[i++]);
if (desc !== undefined) createProperty(result, key, desc);
}
return result;
}
});
/***/ }),
/* 913 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(914);
module.exports = __webpack_require__(7).Object.values;
/***/ }),
/* 914 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-values-entries
var $export = __webpack_require__(0);
var $values = __webpack_require__(298)(false);
$export($export.S, 'Object', {
values: function values(it) {
return $values(it);
}
});
/***/ }),
/* 915 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(916);
module.exports = __webpack_require__(7).Object.entries;
/***/ }),
/* 916 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-values-entries
var $export = __webpack_require__(0);
var $entries = __webpack_require__(298)(true);
$export($export.S, 'Object', {
entries: function entries(it) {
return $entries(it);
}
});
/***/ }),
/* 917 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__(290);
__webpack_require__(918);
module.exports = __webpack_require__(7).Promise['finally'];
/***/ }),
/* 918 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://github.com/tc39/proposal-promise-finally
var $export = __webpack_require__(0);
var core = __webpack_require__(7);
var global = __webpack_require__(1);
var speciesConstructor = __webpack_require__(49);
var promiseResolve = __webpack_require__(292);
$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
var C = speciesConstructor(this, core.Promise || global.Promise);
var isFunction = typeof onFinally == 'function';
return this.then(
isFunction ? function (x) {
return promiseResolve(C, onFinally()).then(function () { return x; });
} : onFinally,
isFunction ? function (e) {
return promiseResolve(C, onFinally()).then(function () { throw e; });
} : onFinally
);
} });
/***/ }),
/* 919 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(920);
__webpack_require__(921);
__webpack_require__(922);
module.exports = __webpack_require__(7);
/***/ }),
/* 920 */
/***/ (function(module, exports, __webpack_require__) {
// ie9- setTimeout & setInterval additional parameters fix
var global = __webpack_require__(1);
var $export = __webpack_require__(0);
var userAgent = __webpack_require__(62);
var slice = [].slice;
var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check
var wrap = function (set) {
return function (fn, time /* , ...args */) {
var boundArgs = arguments.length > 2;
var args = boundArgs ? slice.call(arguments, 2) : false;
return set(boundArgs ? function () {
// eslint-disable-next-line no-new-func
(typeof fn == 'function' ? fn : Function(fn)).apply(this, args);
} : fn, time);
};
};
$export($export.G + $export.B + $export.F * MSIE, {
setTimeout: wrap(global.setTimeout),
setInterval: wrap(global.setInterval)
});
/***/ }),
/* 921 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(0);
var $task = __webpack_require__(93);
$export($export.G + $export.B, {
setImmediate: $task.set,
clearImmediate: $task.clear
});
/***/ }),
/* 922 */
/***/ (function(module, exports, __webpack_require__) {
var $iterators = __webpack_require__(90);
var getKeys = __webpack_require__(32);
var redefine = __webpack_require__(11);
var global = __webpack_require__(1);
var hide = __webpack_require__(15);
var Iterators = __webpack_require__(41);
var wks = __webpack_require__(5);
var ITERATOR = wks('iterator');
var TO_STRING_TAG = wks('toStringTag');
var ArrayValues = Iterators.Array;
var DOMIterables = {
CSSRuleList: true, // TODO: Not spec compliant, should be false.
CSSStyleDeclaration: false,
CSSValueList: false,
ClientRectList: false,
DOMRectList: false,
DOMStringList: false,
DOMTokenList: true,
DataTransferItemList: false,
FileList: false,
HTMLAllCollection: false,
HTMLCollection: false,
HTMLFormElement: false,
HTMLSelectElement: false,
MediaList: true, // TODO: Not spec compliant, should be false.
MimeTypeArray: false,
NamedNodeMap: false,
NodeList: true,
PaintRequestList: false,
Plugin: false,
PluginArray: false,
SVGLengthList: false,
SVGNumberList: false,
SVGPathSegList: false,
SVGPointList: false,
SVGStringList: false,
SVGTransformList: false,
SourceBufferList: false,
StyleSheetList: true, // TODO: Not spec compliant, should be false.
TextTrackCueList: false,
TextTrackList: false,
TouchList: false
};
for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
var NAME = collections[i];
var explicit = DOMIterables[NAME];
var Collection = global[NAME];
var proto = Collection && Collection.prototype;
var key;
if (proto) {
if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
Iterators[NAME] = ArrayValues;
if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
}
}
/***/ }),
/* 923 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(module) {
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var runtime = function (exports) {
"use strict";
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return {
type: "normal",
arg: fn.call(obj, arg)
};
} catch (err) {
return {
type: "throw",
arg: err
};
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function (method) {
prototype[method] = function (arg) {
return this._invoke(method, arg);
};
});
}
exports.isGeneratorFunction = function (genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction" : false;
};
exports.mark = function (genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
_defaults(genFun, GeneratorFunctionPrototype);
if (!(toStringTagSymbol in genFun)) {
genFun[toStringTagSymbol] = "GeneratorFunction";
}
}
genFun.prototype = Object.create(Gp);
return genFun;
}; // Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
exports.awrap = function (arg) {
return {
__await: arg
};
};
function AsyncIterator(generator, PromiseImpl) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) {
return PromiseImpl.resolve(value.__await).then(function (value) {
invoke("next", value, resolve, reject);
}, function (err) {
invoke("throw", err, resolve, reject);
});
}
return PromiseImpl.resolve(value).then(function (unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration.
result.value = unwrapped;
resolve(result);
}, function (error) {
// If a rejected Promise was yielded, throw the rejection back
// into the async generator function so it can be handled there.
return invoke("throw", error, resolve, reject);
});
}
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new PromiseImpl(function (resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise = // If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
} // Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
return this;
};
exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
if (PromiseImpl === void 0) PromiseImpl = Promise;
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function (result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
} // Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if (context.method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted; // Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context.method = "throw";
context.arg = record.arg;
}
}
};
} // Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context.delegate = null;
if (context.method === "throw") {
// Note: ["return"] must be used for ES3 parsing compatibility.
if (delegate.iterator["return"]) {
// If the delegate iterator has a return method, give it a
// chance to clean up.
context.method = "return";
context.arg = undefined;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError("The iterator does not provide a 'throw' method");
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (!info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if (context.method !== "return") {
context.method = "next";
context.arg = undefined;
}
} else {
// Re-yield the result returned by the delegate method.
return info;
} // The delegate iterator is finished, so forget it and continue with
// the outer generator.
context.delegate = null;
return ContinueSentinel;
} // Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function () {
return this;
};
Gp.toString = function () {
return "[object Generator]";
};
function pushTryEntry(locs) {
var entry = {
tryLoc: locs[0]
};
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{
tryLoc: "root"
}];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
exports.keys = function (object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse(); // Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
} // To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1,
next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined;
next.done = true;
return next;
};
return next.next = next;
}
} // Return an iterator with no values.
return {
next: doneResult
};
}
exports.values = values;
function doneResult() {
return {
value: undefined,
done: true
};
}
Context.prototype = {
constructor: Context,
reset: function reset(skipTempReset) {
this.prev = 0;
this.next = 0; // Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
this[name] = undefined;
}
}
}
},
stop: function stop() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function dispatchException(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context.method = "next";
context.arg = undefined;
}
return !!caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function abrupt(type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function complete(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" || record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function finish(finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function _catch(tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
} // The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
};
if (this.method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this.arg = undefined;
}
return ContinueSentinel;
}
}; // Regardless of whether this script is executing as a CommonJS module
// or not, return the runtime object so that we can declare the variable
// regeneratorRuntime in the outer scope, which allows this module to be
// injected easily by `bin/regenerator --include-runtime script.js`.
return exports;
}( // If this script is executing as a CommonJS module, use module.exports
// as the regeneratorRuntime namespace. Otherwise create a new empty
// object. Either way, the resulting object will be used to initialize
// the regeneratorRuntime variable at the top of this file.
( false ? undefined : _typeof(module)) === "object" ? module.exports : {});
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
// This module should not be running in strict mode, so the above
// assignment should always work unless something is misconfigured. Just
// in case runtime.js accidentally runs in strict mode, we can escape
// strict mode using a global Function call. This could conceivably fail
// if a Content Security Policy forbids using Function, but in that case
// the proper solution is to fix the accidental strict mode problem. If
// you've misconfigured your bundler to force strict mode and applied a
// CSP to forbid Function, and you're not willing to fix either of those
// problems, please detail your unique predicament in a GitHub issue.
Function("r", "regeneratorRuntime = r")(runtime);
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(924)(module)))
/***/ }),
/* 924 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = function (module) {
if (!module.webpackPolyfill) {
module.deprecate = function () {};
module.paths = []; // module.parent = undefined by default
if (!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function get() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function get() {
return module.i;
}
});
module.webpackPolyfill = 1;
}
return module;
};
/***/ }),
/* 925 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(926);
module.exports = __webpack_require__(299).global;
/***/ }),
/* 926 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-global
var $export = __webpack_require__(927);
$export($export.G, { global: __webpack_require__(95) });
/***/ }),
/* 927 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(95);
var core = __webpack_require__(299);
var ctx = __webpack_require__(928);
var hide = __webpack_require__(930);
var has = __webpack_require__(937);
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var IS_WRAP = type & $export.W;
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE];
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
var key, own, out;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if (own && has(exports, key)) continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? ctx(out, global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function (C) {
var F = function (a, b, c) {
if (this instanceof C) {
switch (arguments.length) {
case 0: return new C();
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if (IS_PROTO) {
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/* 928 */
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__(929);
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
/***/ }),
/* 929 */
/***/ (function(module, exports) {
module.exports = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
/***/ }),
/* 930 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(931);
var createDesc = __webpack_require__(936);
module.exports = __webpack_require__(97) ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/* 931 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(932);
var IE8_DOM_DEFINE = __webpack_require__(933);
var toPrimitive = __webpack_require__(935);
var dP = Object.defineProperty;
exports.f = __webpack_require__(97) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/* 932 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(96);
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/* 933 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__(97) && !__webpack_require__(300)(function () {
return Object.defineProperty(__webpack_require__(934)('div'), 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 934 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(96);
var document = __webpack_require__(95).document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return is ? document.createElement(it) : {};
};
/***/ }),
/* 935 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(96);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
if (!isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/* 936 */
/***/ (function(module, exports) {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
/***/ }),
/* 937 */
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/* 938 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// This file can be required in Browserify and Node.js for automatic polyfill
// To use it: require('es6-promise/auto');
module.exports = __webpack_require__(939).polyfill();
/***/ }),
/* 939 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(process, global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/
(function (global, factory) {
( false ? undefined : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
__WEBPACK_AMD_DEFINE_FACTORY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : undefined;
})(void 0, function () {
'use strict';
function objectOrFunction(x) {
var type = _typeof(x);
return x !== null && (type === 'object' || type === 'function');
}
function isFunction(x) {
return typeof x === 'function';
}
var _isArray = void 0;
if (Array.isArray) {
_isArray = Array.isArray;
} else {
_isArray = function _isArray(x) {
return Object.prototype.toString.call(x) === '[object Array]';
};
}
var isArray = _isArray;
var len = 0;
var vertxNext = void 0;
var customSchedulerFn = void 0;
var asap = function asap(callback, arg) {
queue[len] = callback;
queue[len + 1] = arg;
len += 2;
if (len === 2) {
// If len is 2, that means that we need to schedule an async flush.
// If additional callbacks are queued before the queue is flushed, they
// will be processed by this flush that we are scheduling.
if (customSchedulerFn) {
customSchedulerFn(flush);
} else {
scheduleFlush();
}
}
};
function setScheduler(scheduleFn) {
customSchedulerFn = scheduleFn;
}
function setAsap(asapFn) {
asap = asapFn;
}
var browserWindow = typeof window !== 'undefined' ? window : undefined;
var browserGlobal = browserWindow || {};
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; // test for web worker but not in IE10
var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; // node
function useNextTick() {
// node version 0.10.x displays a deprecation warning when nextTick is used recursively
// see https://github.com/cujojs/when/issues/410 for details
return function () {
return process.nextTick(flush);
};
} // vertx
function useVertxTimer() {
if (typeof vertxNext !== 'undefined') {
return function () {
vertxNext(flush);
};
}
return useSetTimeout();
}
function useMutationObserver() {
var iterations = 0;
var observer = new BrowserMutationObserver(flush);
var node = document.createTextNode('');
observer.observe(node, {
characterData: true
});
return function () {
node.data = iterations = ++iterations % 2;
};
} // web worker
function useMessageChannel() {
var channel = new MessageChannel();
channel.port1.onmessage = flush;
return function () {
return channel.port2.postMessage(0);
};
}
function useSetTimeout() {
// Store setTimeout reference so es6-promise will be unaffected by
// other code modifying setTimeout (like sinon.useFakeTimers())
var globalSetTimeout = setTimeout;
return function () {
return globalSetTimeout(flush, 1);
};
}
var queue = new Array(1000);
function flush() {
for (var i = 0; i < len; i += 2) {
var callback = queue[i];
var arg = queue[i + 1];
callback(arg);
queue[i] = undefined;
queue[i + 1] = undefined;
}
len = 0;
}
function attemptVertx() {
try {
var vertx = Function('return this')().require('vertx');
vertxNext = vertx.runOnLoop || vertx.runOnContext;
return useVertxTimer();
} catch (e) {
return useSetTimeout();
}
}
var scheduleFlush = void 0; // Decide what async method to use to triggering processing of queued callbacks:
if (isNode) {
scheduleFlush = useNextTick();
} else if (BrowserMutationObserver) {
scheduleFlush = useMutationObserver();
} else if (isWorker) {
scheduleFlush = useMessageChannel();
} else if (browserWindow === undefined && "function" === 'function') {
scheduleFlush = attemptVertx();
} else {
scheduleFlush = useSetTimeout();
}
function then(onFulfillment, onRejection) {
var parent = this;
var child = new this.constructor(noop);
if (child[PROMISE_ID] === undefined) {
makePromise(child);
}
var _state = parent._state;
if (_state) {
var callback = arguments[_state - 1];
asap(function () {
return invokeCallback(_state, child, callback, parent._result);
});
} else {
subscribe(parent, child, onFulfillment, onRejection);
}
return child;
}
/**
`Promise.resolve` returns a promise that will become resolved with the
passed `value`. It is shorthand for the following:
```javascript
let promise = new Promise(function(resolve, reject){
resolve(1);
});
promise.then(function(value){
// value === 1
});
```
Instead of writing the above, your code now simply becomes the following:
```javascript
let promise = Promise.resolve(1);
promise.then(function(value){
// value === 1
});
```
@method resolve
@static
@param {Any} value value that the returned promise will be resolved with
Useful for tooling.
@return {Promise} a promise that will become fulfilled with the given
`value`
*/
function resolve$1(object) {
/*jshint validthis:true */
var Constructor = this;
if (object && _typeof(object) === 'object' && object.constructor === Constructor) {
return object;
}
var promise = new Constructor(noop);
resolve(promise, object);
return promise;
}
var PROMISE_ID = Math.random().toString(36).substring(2);
function noop() {}
var PENDING = void 0;
var FULFILLED = 1;
var REJECTED = 2;
function selfFulfillment() {
return new TypeError("You cannot resolve a promise with itself");
}
function cannotReturnOwn() {
return new TypeError('A promises callback cannot return that same promise.');
}
function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
try {
then$$1.call(value, fulfillmentHandler, rejectionHandler);
} catch (e) {
return e;
}
}
function handleForeignThenable(promise, thenable, then$$1) {
asap(function (promise) {
var sealed = false;
var error = tryThen(then$$1, thenable, function (value) {
if (sealed) {
return;
}
sealed = true;
if (thenable !== value) {
resolve(promise, value);
} else {
fulfill(promise, value);
}
}, function (reason) {
if (sealed) {
return;
}
sealed = true;
reject(promise, reason);
}, 'Settle: ' + (promise._label || ' unknown promise'));
if (!sealed && error) {
sealed = true;
reject(promise, error);
}
}, promise);
}
function handleOwnThenable(promise, thenable) {
if (thenable._state === FULFILLED) {
fulfill(promise, thenable._result);
} else if (thenable._state === REJECTED) {
reject(promise, thenable._result);
} else {
subscribe(thenable, undefined, function (value) {
return resolve(promise, value);
}, function (reason) {
return reject(promise, reason);
});
}
}
function handleMaybeThenable(promise, maybeThenable, then$$1) {
if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
handleOwnThenable(promise, maybeThenable);
} else {
if (then$$1 === undefined) {
fulfill(promise, maybeThenable);
} else if (isFunction(then$$1)) {
handleForeignThenable(promise, maybeThenable, then$$1);
} else {
fulfill(promise, maybeThenable);
}
}
}
function resolve(promise, value) {
if (promise === value) {
reject(promise, selfFulfillment());
} else if (objectOrFunction(value)) {
var then$$1 = void 0;
try {
then$$1 = value.then;
} catch (error) {
reject(promise, error);
return;
}
handleMaybeThenable(promise, value, then$$1);
} else {
fulfill(promise, value);
}
}
function publishRejection(promise) {
if (promise._onerror) {
promise._onerror(promise._result);
}
publish(promise);
}
function fulfill(promise, value) {
if (promise._state !== PENDING) {
return;
}
promise._result = value;
promise._state = FULFILLED;
if (promise._subscribers.length !== 0) {
asap(publish, promise);
}
}
function reject(promise, reason) {
if (promise._state !== PENDING) {
return;
}
promise._state = REJECTED;
promise._result = reason;
asap(publishRejection, promise);
}
function subscribe(parent, child, onFulfillment, onRejection) {
var _subscribers = parent._subscribers;
var length = _subscribers.length;
parent._onerror = null;
_subscribers[length] = child;
_subscribers[length + FULFILLED] = onFulfillment;
_subscribers[length + REJECTED] = onRejection;
if (length === 0 && parent._state) {
asap(publish, parent);
}
}
function publish(promise) {
var subscribers = promise._subscribers;
var settled = promise._state;
if (subscribers.length === 0) {
return;
}
var child = void 0,
callback = void 0,
detail = promise._result;
for (var i = 0; i < subscribers.length; i += 3) {
child = subscribers[i];
callback = subscribers[i + settled];
if (child) {
invokeCallback(settled, child, callback, detail);
} else {
callback(detail);
}
}
promise._subscribers.length = 0;
}
function invokeCallback(settled, promise, callback, detail) {
var hasCallback = isFunction(callback),
value = void 0,
error = void 0,
succeeded = true;
if (hasCallback) {
try {
value = callback(detail);
} catch (e) {
succeeded = false;
error = e;
}
if (promise === value) {
reject(promise, cannotReturnOwn());
return;
}
} else {
value = detail;
}
if (promise._state !== PENDING) {// noop
} else if (hasCallback && succeeded) {
resolve(promise, value);
} else if (succeeded === false) {
reject(promise, error);
} else if (settled === FULFILLED) {
fulfill(promise, value);
} else if (settled === REJECTED) {
reject(promise, value);
}
}
function initializePromise(promise, resolver) {
try {
resolver(function resolvePromise(value) {
resolve(promise, value);
}, function rejectPromise(reason) {
reject(promise, reason);
});
} catch (e) {
reject(promise, e);
}
}
var id = 0;
function nextId() {
return id++;
}
function makePromise(promise) {
promise[PROMISE_ID] = id++;
promise._state = undefined;
promise._result = undefined;
promise._subscribers = [];
}
function validationError() {
return new Error('Array Methods must be provided an Array');
}
var Enumerator = function () {
function Enumerator(Constructor, input) {
this._instanceConstructor = Constructor;
this.promise = new Constructor(noop);
if (!this.promise[PROMISE_ID]) {
makePromise(this.promise);
}
if (isArray(input)) {
this.length = input.length;
this._remaining = input.length;
this._result = new Array(this.length);
if (this.length === 0) {
fulfill(this.promise, this._result);
} else {
this.length = this.length || 0;
this._enumerate(input);
if (this._remaining === 0) {
fulfill(this.promise, this._result);
}
}
} else {
reject(this.promise, validationError());
}
}
Enumerator.prototype._enumerate = function _enumerate(input) {
for (var i = 0; this._state === PENDING && i < input.length; i++) {
this._eachEntry(input[i], i);
}
};
Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {
var c = this._instanceConstructor;
var resolve$$1 = c.resolve;
if (resolve$$1 === resolve$1) {
var _then = void 0;
var error = void 0;
var didError = false;
try {
_then = entry.then;
} catch (e) {
didError = true;
error = e;
}
if (_then === then && entry._state !== PENDING) {
this._settledAt(entry._state, i, entry._result);
} else if (typeof _then !== 'function') {
this._remaining--;
this._result[i] = entry;
} else if (c === Promise$1) {
var promise = new c(noop);
if (didError) {
reject(promise, error);
} else {
handleMaybeThenable(promise, entry, _then);
}
this._willSettleAt(promise, i);
} else {
this._willSettleAt(new c(function (resolve$$1) {
return resolve$$1(entry);
}), i);
}
} else {
this._willSettleAt(resolve$$1(entry), i);
}
};
Enumerator.prototype._settledAt = function _settledAt(state, i, value) {
var promise = this.promise;
if (promise._state === PENDING) {
this._remaining--;
if (state === REJECTED) {
reject(promise, value);
} else {
this._result[i] = value;
}
}
if (this._remaining === 0) {
fulfill(promise, this._result);
}
};
Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {
var enumerator = this;
subscribe(promise, undefined, function (value) {
return enumerator._settledAt(FULFILLED, i, value);
}, function (reason) {
return enumerator._settledAt(REJECTED, i, reason);
});
};
return Enumerator;
}();
/**
`Promise.all` accepts an array of promises, and returns a new promise which
is fulfilled with an array of fulfillment values for the passed promises, or
rejected with the reason of the first passed promise to be rejected. It casts all
elements of the passed iterable to promises as it runs this algorithm.
Example:
```javascript
let promise1 = resolve(1);
let promise2 = resolve(2);
let promise3 = resolve(3);
let promises = [ promise1, promise2, promise3 ];
Promise.all(promises).then(function(array){
// The array here would be [ 1, 2, 3 ];
});
```
If any of the `promises` given to `all` are rejected, the first promise
that is rejected will be given as an argument to the returned promises's
rejection handler. For example:
Example:
```javascript
let promise1 = resolve(1);
let promise2 = reject(new Error("2"));
let promise3 = reject(new Error("3"));
let promises = [ promise1, promise2, promise3 ];
Promise.all(promises).then(function(array){
// Code here never runs because there are rejected promises!
}, function(error) {
// error.message === "2"
});
```
@method all
@static
@param {Array} entries array of promises
@param {String} label optional string for labeling the promise.
Useful for tooling.
@return {Promise} promise that is fulfilled when all `promises` have been
fulfilled, or rejected if any of them become rejected.
@static
*/
function all(entries) {
return new Enumerator(this, entries).promise;
}
/**
`Promise.race` returns a new promise which is settled in the same way as the
first passed promise to settle.
Example:
```javascript
let promise1 = new Promise(function(resolve, reject){
setTimeout(function(){
resolve('promise 1');
}, 200);
});
let promise2 = new Promise(function(resolve, reject){
setTimeout(function(){
resolve('promise 2');
}, 100);
});
Promise.race([promise1, promise2]).then(function(result){
// result === 'promise 2' because it was resolved before promise1
// was resolved.
});
```
`Promise.race` is deterministic in that only the state of the first
settled promise matters. For example, even if other promises given to the
`promises` array argument are resolved, but the first settled promise has
become rejected before the other promises became fulfilled, the returned
promise will become rejected:
```javascript
let promise1 = new Promise(function(resolve, reject){
setTimeout(function(){
resolve('promise 1');
}, 200);
});
let promise2 = new Promise(function(resolve, reject){
setTimeout(function(){
reject(new Error('promise 2'));
}, 100);
});
Promise.race([promise1, promise2]).then(function(result){
// Code here never runs
}, function(reason){
// reason.message === 'promise 2' because promise 2 became rejected before
// promise 1 became fulfilled
});
```
An example real-world use case is implementing timeouts:
```javascript
Promise.race([ajax('foo.json'), timeout(5000)])
```
@method race
@static
@param {Array} promises array of promises to observe
Useful for tooling.
@return {Promise} a promise which settles in the same way as the first passed
promise to settle.
*/
function race(entries) {
/*jshint validthis:true */
var Constructor = this;
if (!isArray(entries)) {
return new Constructor(function (_, reject) {
return reject(new TypeError('You must pass an array to race.'));
});
} else {
return new Constructor(function (resolve, reject) {
var length = entries.length;
for (var i = 0; i < length; i++) {
Constructor.resolve(entries[i]).then(resolve, reject);
}
});
}
}
/**
`Promise.reject` returns a promise rejected with the passed `reason`.
It is shorthand for the following:
```javascript
let promise = new Promise(function(resolve, reject){
reject(new Error('WHOOPS'));
});
promise.then(function(value){
// Code here doesn't run because the promise is rejected!
}, function(reason){
// reason.message === 'WHOOPS'
});
```
Instead of writing the above, your code now simply becomes the following:
```javascript
let promise = Promise.reject(new Error('WHOOPS'));
promise.then(function(value){
// Code here doesn't run because the promise is rejected!
}, function(reason){
// reason.message === 'WHOOPS'
});
```
@method reject
@static
@param {Any} reason value that the returned promise will be rejected with.
Useful for tooling.
@return {Promise} a promise rejected with the given `reason`.
*/
function reject$1(reason) {
/*jshint validthis:true */
var Constructor = this;
var promise = new Constructor(noop);
reject(promise, reason);
return promise;
}
function needsResolver() {
throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
}
function needsNew() {
throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
}
/**
Promise objects represent the eventual result of an asynchronous operation. The
primary way of interacting with a promise is through its `then` method, which
registers callbacks to receive either a promise's eventual value or the reason
why the promise cannot be fulfilled.
Terminology
-----------
- `promise` is an object or function with a `then` method whose behavior conforms to this specification.
- `thenable` is an object or function that defines a `then` method.
- `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
- `exception` is a value that is thrown using the throw statement.
- `reason` is a value that indicates why a promise was rejected.
- `settled` the final resting state of a promise, fulfilled or rejected.
A promise can be in one of three states: pending, fulfilled, or rejected.
Promises that are fulfilled have a fulfillment value and are in the fulfilled
state. Promises that are rejected have a rejection reason and are in the
rejected state. A fulfillment value is never a thenable.
Promises can also be said to *resolve* a value. If this value is also a
promise, then the original promise's settled state will match the value's
settled state. So a promise that *resolves* a promise that rejects will
itself reject, and a promise that *resolves* a promise that fulfills will
itself fulfill.
Basic Usage:
------------
```js
let promise = new Promise(function(resolve, reject) {
// on success
resolve(value);
// on failure
reject(reason);
});
promise.then(function(value) {
// on fulfillment
}, function(reason) {
// on rejection
});
```
Advanced Usage:
---------------
Promises shine when abstracting away asynchronous interactions such as
`XMLHttpRequest`s.
```js
function getJSON(url) {
return new Promise(function(resolve, reject){
let xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.onreadystatechange = handler;
xhr.responseType = 'json';
xhr.setRequestHeader('Accept', 'application/json');
xhr.send();
function handler() {
if (this.readyState === this.DONE) {
if (this.status === 200) {
resolve(this.response);
} else {
reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
}
}
};
});
}
getJSON('/posts.json').then(function(json) {
// on fulfillment
}, function(reason) {
// on rejection
});
```
Unlike callbacks, promises are great composable primitives.
```js
Promise.all([
getJSON('/posts'),
getJSON('/comments')
]).then(function(values){
values[0] // => postsJSON
values[1] // => commentsJSON
return values;
});
```
@class Promise
@param {Function} resolver
Useful for tooling.
@constructor
*/
var Promise$1 = function () {
function Promise(resolver) {
this[PROMISE_ID] = nextId();
this._result = this._state = undefined;
this._subscribers = [];
if (noop !== resolver) {
typeof resolver !== 'function' && needsResolver();
this instanceof Promise ? initializePromise(this, resolver) : needsNew();
}
}
/**
The primary way of interacting with a promise is through its `then` method,
which registers callbacks to receive either a promise's eventual value or the
reason why the promise cannot be fulfilled.
```js
findUser().then(function(user){
// user is available
}, function(reason){
// user is unavailable, and you are given the reason why
});
```
Chaining
--------
The return value of `then` is itself a promise. This second, 'downstream'
promise is resolved with the return value of the first promise's fulfillment
or rejection handler, or rejected if the handler throws an exception.
```js
findUser().then(function (user) {
return user.name;
}, function (reason) {
return 'default name';
}).then(function (userName) {
// If `findUser` fulfilled, `userName` will be the user's name, otherwise it
// will be `'default name'`
});
findUser().then(function (user) {
throw new Error('Found user, but still unhappy');
}, function (reason) {
throw new Error('`findUser` rejected and we're unhappy');
}).then(function (value) {
// never reached
}, function (reason) {
// if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
// If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
});
```
If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
```js
findUser().then(function (user) {
throw new PedagogicalException('Upstream error');
}).then(function (value) {
// never reached
}).then(function (value) {
// never reached
}, function (reason) {
// The `PedgagocialException` is propagated all the way down to here
});
```
Assimilation
------------
Sometimes the value you want to propagate to a downstream promise can only be
retrieved asynchronously. This can be achieved by returning a promise in the
fulfillment or rejection handler. The downstream promise will then be pending
until the returned promise is settled. This is called *assimilation*.
```js
findUser().then(function (user) {
return findCommentsByAuthor(user);
}).then(function (comments) {
// The user's comments are now available
});
```
If the assimliated promise rejects, then the downstream promise will also reject.
```js
findUser().then(function (user) {
return findCommentsByAuthor(user);
}).then(function (comments) {
// If `findCommentsByAuthor` fulfills, we'll have the value here
}, function (reason) {
// If `findCommentsByAuthor` rejects, we'll have the reason here
});
```
Simple Example
--------------
Synchronous Example
```javascript
let result;
try {
result = findResult();
// success
} catch(reason) {
// failure
}
```
Errback Example
```js
findResult(function(result, err){
if (err) {
// failure
} else {
// success
}
});
```
Promise Example;
```javascript
findResult().then(function(result){
// success
}, function(reason){
// failure
});
```
Advanced Example
--------------
Synchronous Example
```javascript
let author, books;
try {
author = findAuthor();
books = findBooksByAuthor(author);
// success
} catch(reason) {
// failure
}
```
Errback Example
```js
function foundBooks(books) {
}
function failure(reason) {
}
findAuthor(function(author, err){
if (err) {
failure(err);
// failure
} else {
try {
findBoooksByAuthor(author, function(books, err) {
if (err) {
failure(err);
} else {
try {
foundBooks(books);
} catch(reason) {
failure(reason);
}
}
});
} catch(error) {
failure(err);
}
// success
}
});
```
Promise Example;
```javascript
findAuthor().
then(findBooksByAuthor).
then(function(books){
// found books
}).catch(function(reason){
// something went wrong
});
```
@method then
@param {Function} onFulfilled
@param {Function} onRejected
Useful for tooling.
@return {Promise}
*/
/**
`catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
as the catch block of a try/catch statement.
```js
function findAuthor(){
throw new Error('couldn't find that author');
}
// synchronous
try {
findAuthor();
} catch(reason) {
// something went wrong
}
// async with promises
findAuthor().catch(function(reason){
// something went wrong
});
```
@method catch
@param {Function} onRejection
Useful for tooling.
@return {Promise}
*/
Promise.prototype["catch"] = function _catch(onRejection) {
return this.then(null, onRejection);
};
/**
`finally` will be invoked regardless of the promise's fate just as native
try/catch/finally behaves
Synchronous example:
```js
findAuthor() {
if (Math.random() > 0.5) {
throw new Error();
}
return new Author();
}
try {
return findAuthor(); // succeed or fail
} catch(error) {
return findOtherAuther();
} finally {
// always runs
// doesn't affect the return value
}
```
Asynchronous example:
```js
findAuthor().catch(function(reason){
return findOtherAuther();
}).finally(function(){
// author was either found, or not
});
```
@method finally
@param {Function} callback
@return {Promise}
*/
Promise.prototype["finally"] = function _finally(callback) {
var promise = this;
var constructor = promise.constructor;
if (isFunction(callback)) {
return promise.then(function (value) {
return constructor.resolve(callback()).then(function () {
return value;
});
}, function (reason) {
return constructor.resolve(callback()).then(function () {
throw reason;
});
});
}
return promise.then(callback, callback);
};
return Promise;
}();
Promise$1.prototype.then = then;
Promise$1.all = all;
Promise$1.race = race;
Promise$1.resolve = resolve$1;
Promise$1.reject = reject$1;
Promise$1._setScheduler = setScheduler;
Promise$1._setAsap = setAsap;
Promise$1._asap = asap;
/*global self*/
function polyfill() {
var local = void 0;
if (typeof global !== 'undefined') {
local = global;
} else if (typeof self !== 'undefined') {
local = self;
} else {
try {
local = Function('return this')();
} catch (e) {
throw new Error('polyfill failed because global object is unavailable in this environment');
}
}
var P = local.Promise;
if (P) {
var promiseToString = null;
try {
promiseToString = Object.prototype.toString.call(P.resolve());
} catch (e) {// silently ignored
}
if (promiseToString === '[object Promise]' && !P.cast) {
return;
}
}
local.Promise = Promise$1;
} // Strange compat..
Promise$1.polyfill = polyfill;
Promise$1.Promise = Promise$1;
return Promise$1;
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(66), __webpack_require__(13)))
/***/ }),
/* 940 */,
/* 941 */,
/* 942 */,
/* 943 */,
/* 944 */,
/* 945 */,
/* 946 */,
/* 947 */,
/* 948 */,
/* 949 */,
/* 950 */,
/* 951 */,
/* 952 */,
/* 953 */,
/* 954 */,
/* 955 */,
/* 956 */,
/* 957 */,
/* 958 */,
/* 959 */,
/* 960 */,
/* 961 */,
/* 962 */,
/* 963 */,
/* 964 */,
/* 965 */,
/* 966 */,
/* 967 */,
/* 968 */,
/* 969 */,
/* 970 */,
/* 971 */,
/* 972 */,
/* 973 */,
/* 974 */,
/* 975 */,
/* 976 */,
/* 977 */,
/* 978 */,
/* 979 */,
/* 980 */,
/* 981 */,
/* 982 */,
/* 983 */,
/* 984 */,
/* 985 */,
/* 986 */,
/* 987 */,
/* 988 */,
/* 989 */,
/* 990 */,
/* 991 */,
/* 992 */,
/* 993 */,
/* 994 */,
/* 995 */,
/* 996 */,
/* 997 */,
/* 998 */,
/* 999 */,
/* 1000 */,
/* 1001 */,
/* 1002 */,
/* 1003 */,
/* 1004 */,
/* 1005 */,
/* 1006 */,
/* 1007 */,
/* 1008 */,
/* 1009 */,
/* 1010 */,
/* 1011 */,
/* 1012 */,
/* 1013 */,
/* 1014 */,
/* 1015 */,
/* 1016 */,
/* 1017 */,
/* 1018 */,
/* 1019 */,
/* 1020 */,
/* 1021 */,
/* 1022 */,
/* 1023 */,
/* 1024 */,
/* 1025 */,
/* 1026 */,
/* 1027 */,
/* 1028 */,
/* 1029 */,
/* 1030 */,
/* 1031 */,
/* 1032 */,
/* 1033 */,
/* 1034 */,
/* 1035 */,
/* 1036 */,
/* 1037 */,
/* 1038 */,
/* 1039 */,
/* 1040 */,
/* 1041 */,
/* 1042 */,
/* 1043 */,
/* 1044 */,
/* 1045 */,
/* 1046 */,
/* 1047 */,
/* 1048 */,
/* 1049 */,
/* 1050 */,
/* 1051 */,
/* 1052 */,
/* 1053 */,
/* 1054 */,
/* 1055 */,
/* 1056 */,
/* 1057 */,
/* 1058 */,
/* 1059 */,
/* 1060 */,
/* 1061 */,
/* 1062 */,
/* 1063 */,
/* 1064 */,
/* 1065 */,
/* 1066 */,
/* 1067 */,
/* 1068 */,
/* 1069 */,
/* 1070 */,
/* 1071 */,
/* 1072 */,
/* 1073 */,
/* 1074 */,
/* 1075 */,
/* 1076 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(101);
__webpack_require__(686);
__webpack_require__(687);
__webpack_require__(688);
__webpack_require__(689);
__webpack_require__(690);
__webpack_require__(691);
__webpack_require__(751);
__webpack_require__(938);
__webpack_require__(692);
__webpack_require__(693);
__webpack_require__(193);
__webpack_require__(194);
__webpack_require__(195);
__webpack_require__(196);
__webpack_require__(197);
__webpack_require__(198);
__webpack_require__(199);
__webpack_require__(200);
__webpack_require__(201);
__webpack_require__(202);
__webpack_require__(203);
__webpack_require__(204);
__webpack_require__(205);
__webpack_require__(206);
__webpack_require__(207);
__webpack_require__(208);
__webpack_require__(209);
__webpack_require__(102);
__webpack_require__(105);
__webpack_require__(107);
__webpack_require__(301);
__webpack_require__(302);
__webpack_require__(108);
__webpack_require__(109);
__webpack_require__(110);
__webpack_require__(111);
__webpack_require__(112);
__webpack_require__(113);
__webpack_require__(303);
__webpack_require__(304);
__webpack_require__(114);
__webpack_require__(115);
__webpack_require__(116);
__webpack_require__(117);
__webpack_require__(118);
__webpack_require__(119);
__webpack_require__(120);
__webpack_require__(121);
__webpack_require__(305);
__webpack_require__(306);
__webpack_require__(307);
__webpack_require__(308);
__webpack_require__(309);
__webpack_require__(122);
__webpack_require__(310);
__webpack_require__(311);
__webpack_require__(312);
__webpack_require__(313);
__webpack_require__(314);
__webpack_require__(315);
__webpack_require__(316);
__webpack_require__(317);
__webpack_require__(318);
__webpack_require__(319);
__webpack_require__(320);
__webpack_require__(123);
__webpack_require__(321);
__webpack_require__(124);
__webpack_require__(125);
__webpack_require__(126);
__webpack_require__(127);
__webpack_require__(128);
__webpack_require__(129);
__webpack_require__(322);
__webpack_require__(323);
__webpack_require__(324);
__webpack_require__(325);
__webpack_require__(694);
__webpack_require__(695);
__webpack_require__(696);
__webpack_require__(697);
__webpack_require__(698);
__webpack_require__(699);
__webpack_require__(701);
__webpack_require__(702);
__webpack_require__(703);
__webpack_require__(326);
__webpack_require__(130);
__webpack_require__(327);
__webpack_require__(328);
__webpack_require__(329);
__webpack_require__(330);
__webpack_require__(331);
__webpack_require__(332);
__webpack_require__(333);
__webpack_require__(334);
__webpack_require__(335);
__webpack_require__(336);
__webpack_require__(337);
__webpack_require__(338);
__webpack_require__(339);
__webpack_require__(340);
__webpack_require__(341);
__webpack_require__(342);
__webpack_require__(343);
__webpack_require__(344);
__webpack_require__(345);
__webpack_require__(346);
__webpack_require__(347);
__webpack_require__(348);
__webpack_require__(349);
__webpack_require__(350);
__webpack_require__(351);
__webpack_require__(352);
__webpack_require__(353);
__webpack_require__(354);
__webpack_require__(355);
__webpack_require__(356);
__webpack_require__(357);
__webpack_require__(358);
__webpack_require__(359);
__webpack_require__(360);
__webpack_require__(361);
__webpack_require__(362);
__webpack_require__(363);
__webpack_require__(364);
__webpack_require__(365);
__webpack_require__(366);
__webpack_require__(367);
__webpack_require__(368);
__webpack_require__(369);
__webpack_require__(131);
__webpack_require__(132);
__webpack_require__(133);
__webpack_require__(704);
__webpack_require__(736);
__webpack_require__(210);
__webpack_require__(211);
__webpack_require__(212);
__webpack_require__(213);
__webpack_require__(214);
__webpack_require__(215);
__webpack_require__(216);
__webpack_require__(217);
__webpack_require__(218);
__webpack_require__(219);
__webpack_require__(220);
__webpack_require__(221);
__webpack_require__(222);
__webpack_require__(223);
__webpack_require__(224);
__webpack_require__(225);
__webpack_require__(226);
__webpack_require__(227);
__webpack_require__(228);
__webpack_require__(229);
__webpack_require__(230);
__webpack_require__(231);
__webpack_require__(232);
__webpack_require__(233);
__webpack_require__(234);
__webpack_require__(235);
__webpack_require__(236);
__webpack_require__(237);
__webpack_require__(238);
__webpack_require__(239);
__webpack_require__(240);
__webpack_require__(241);
__webpack_require__(242);
__webpack_require__(243);
__webpack_require__(244);
__webpack_require__(245);
__webpack_require__(246);
__webpack_require__(247);
__webpack_require__(248);
__webpack_require__(249);
__webpack_require__(250);
__webpack_require__(251);
__webpack_require__(252);
__webpack_require__(253);
__webpack_require__(254);
__webpack_require__(255);
__webpack_require__(256);
__webpack_require__(257);
__webpack_require__(258);
__webpack_require__(259);
__webpack_require__(260);
__webpack_require__(261);
__webpack_require__(262);
__webpack_require__(263);
__webpack_require__(264);
__webpack_require__(265);
__webpack_require__(266);
__webpack_require__(705);
__webpack_require__(370);
__webpack_require__(371);
__webpack_require__(372);
__webpack_require__(373);
__webpack_require__(374);
__webpack_require__(375);
__webpack_require__(376);
__webpack_require__(377);
__webpack_require__(706);
__webpack_require__(707);
__webpack_require__(708);
__webpack_require__(709);
__webpack_require__(710);
__webpack_require__(711);
__webpack_require__(378);
__webpack_require__(379);
__webpack_require__(380);
__webpack_require__(381);
__webpack_require__(382);
__webpack_require__(383);
__webpack_require__(384);
__webpack_require__(385);
__webpack_require__(386);
__webpack_require__(387);
__webpack_require__(388);
__webpack_require__(389);
__webpack_require__(390);
__webpack_require__(391);
__webpack_require__(392);
__webpack_require__(393);
__webpack_require__(394);
__webpack_require__(395);
__webpack_require__(396);
__webpack_require__(397);
__webpack_require__(398);
__webpack_require__(399);
__webpack_require__(400);
__webpack_require__(401);
__webpack_require__(402);
__webpack_require__(403);
__webpack_require__(404);
__webpack_require__(405);
__webpack_require__(406);
__webpack_require__(407);
__webpack_require__(408);
__webpack_require__(409);
__webpack_require__(410);
__webpack_require__(411);
__webpack_require__(412);
__webpack_require__(413);
__webpack_require__(414);
__webpack_require__(415);
__webpack_require__(416);
__webpack_require__(417);
__webpack_require__(418);
__webpack_require__(419);
__webpack_require__(420);
__webpack_require__(421);
__webpack_require__(422);
__webpack_require__(423);
__webpack_require__(712);
__webpack_require__(424);
__webpack_require__(425);
__webpack_require__(426);
__webpack_require__(427);
__webpack_require__(428);
__webpack_require__(429);
__webpack_require__(430);
__webpack_require__(431);
__webpack_require__(432);
__webpack_require__(433);
__webpack_require__(434);
__webpack_require__(435);
__webpack_require__(436);
__webpack_require__(713);
__webpack_require__(714);
__webpack_require__(715);
__webpack_require__(716);
__webpack_require__(437);
__webpack_require__(438);
__webpack_require__(439);
__webpack_require__(440);
__webpack_require__(441);
__webpack_require__(442);
__webpack_require__(443);
__webpack_require__(444);
__webpack_require__(445);
__webpack_require__(446);
__webpack_require__(447);
__webpack_require__(448);
__webpack_require__(449);
__webpack_require__(450);
__webpack_require__(451);
__webpack_require__(452);
__webpack_require__(453);
__webpack_require__(454);
__webpack_require__(455);
__webpack_require__(456);
__webpack_require__(457);
__webpack_require__(458);
__webpack_require__(459);
__webpack_require__(460);
__webpack_require__(461);
__webpack_require__(462);
__webpack_require__(463);
__webpack_require__(464);
__webpack_require__(465);
__webpack_require__(466);
__webpack_require__(467);
__webpack_require__(717);
__webpack_require__(718);
__webpack_require__(719);
__webpack_require__(720);
__webpack_require__(721);
__webpack_require__(722);
__webpack_require__(723);
__webpack_require__(724);
__webpack_require__(725);
__webpack_require__(726);
__webpack_require__(727);
__webpack_require__(728);
__webpack_require__(468);
__webpack_require__(469);
__webpack_require__(470);
__webpack_require__(471);
__webpack_require__(472);
__webpack_require__(473);
__webpack_require__(474);
__webpack_require__(475);
__webpack_require__(476);
__webpack_require__(477);
__webpack_require__(478);
__webpack_require__(479);
__webpack_require__(480);
__webpack_require__(481);
__webpack_require__(482);
__webpack_require__(483);
__webpack_require__(484);
__webpack_require__(485);
__webpack_require__(486);
__webpack_require__(487);
__webpack_require__(488);
__webpack_require__(489);
__webpack_require__(490);
__webpack_require__(491);
__webpack_require__(492);
__webpack_require__(493);
__webpack_require__(494);
__webpack_require__(495);
__webpack_require__(496);
__webpack_require__(497);
__webpack_require__(498);
__webpack_require__(499);
__webpack_require__(500);
__webpack_require__(501);
__webpack_require__(502);
__webpack_require__(503);
__webpack_require__(504);
__webpack_require__(505);
__webpack_require__(506);
__webpack_require__(729);
__webpack_require__(730);
__webpack_require__(731);
__webpack_require__(507);
__webpack_require__(508);
__webpack_require__(509);
__webpack_require__(510);
__webpack_require__(511);
__webpack_require__(512);
__webpack_require__(513);
__webpack_require__(514);
__webpack_require__(134);
__webpack_require__(135);
__webpack_require__(136);
__webpack_require__(137);
__webpack_require__(138);
__webpack_require__(139);
__webpack_require__(140);
__webpack_require__(141);
__webpack_require__(142);
__webpack_require__(143);
__webpack_require__(144);
__webpack_require__(145);
__webpack_require__(146);
__webpack_require__(147);
__webpack_require__(148);
__webpack_require__(149);
__webpack_require__(150);
__webpack_require__(151);
__webpack_require__(152);
__webpack_require__(153);
__webpack_require__(154);
__webpack_require__(155);
__webpack_require__(156);
__webpack_require__(157);
__webpack_require__(158);
__webpack_require__(159);
__webpack_require__(160);
__webpack_require__(161);
__webpack_require__(162);
__webpack_require__(163);
__webpack_require__(164);
__webpack_require__(165);
__webpack_require__(166);
__webpack_require__(167);
__webpack_require__(168);
__webpack_require__(169);
__webpack_require__(170);
__webpack_require__(171);
__webpack_require__(172);
__webpack_require__(173);
__webpack_require__(174);
__webpack_require__(175);
__webpack_require__(176);
__webpack_require__(177);
__webpack_require__(178);
__webpack_require__(179);
__webpack_require__(180);
__webpack_require__(181);
__webpack_require__(182);
__webpack_require__(183);
__webpack_require__(184);
__webpack_require__(185);
__webpack_require__(186);
__webpack_require__(187);
__webpack_require__(188);
__webpack_require__(189);
__webpack_require__(190);
__webpack_require__(191);
__webpack_require__(515);
__webpack_require__(516);
__webpack_require__(517);
__webpack_require__(518);
__webpack_require__(519);
__webpack_require__(520);
__webpack_require__(521);
__webpack_require__(522);
__webpack_require__(523);
__webpack_require__(524);
__webpack_require__(525);
__webpack_require__(526);
__webpack_require__(527);
__webpack_require__(528);
__webpack_require__(529);
__webpack_require__(530);
__webpack_require__(531);
__webpack_require__(532);
__webpack_require__(533);
__webpack_require__(534);
__webpack_require__(535);
__webpack_require__(536);
__webpack_require__(537);
__webpack_require__(538);
__webpack_require__(539);
__webpack_require__(540);
__webpack_require__(541);
__webpack_require__(542);
__webpack_require__(543);
__webpack_require__(544);
__webpack_require__(545);
__webpack_require__(546);
__webpack_require__(547);
__webpack_require__(548);
__webpack_require__(549);
__webpack_require__(550);
__webpack_require__(551);
__webpack_require__(552);
__webpack_require__(553);
__webpack_require__(554);
__webpack_require__(555);
__webpack_require__(556);
__webpack_require__(557);
__webpack_require__(558);
__webpack_require__(559);
__webpack_require__(560);
__webpack_require__(561);
__webpack_require__(562);
__webpack_require__(563);
__webpack_require__(564);
__webpack_require__(565);
__webpack_require__(566);
__webpack_require__(567);
__webpack_require__(568);
__webpack_require__(569);
__webpack_require__(570);
__webpack_require__(571);
__webpack_require__(572);
__webpack_require__(573);
__webpack_require__(574);
__webpack_require__(575);
__webpack_require__(576);
__webpack_require__(577);
__webpack_require__(578);
__webpack_require__(579);
__webpack_require__(580);
__webpack_require__(581);
__webpack_require__(582);
__webpack_require__(583);
__webpack_require__(584);
__webpack_require__(585);
__webpack_require__(586);
__webpack_require__(587);
__webpack_require__(588);
__webpack_require__(589);
__webpack_require__(590);
__webpack_require__(591);
__webpack_require__(592);
__webpack_require__(593);
__webpack_require__(594);
__webpack_require__(595);
__webpack_require__(596);
__webpack_require__(597);
__webpack_require__(598);
__webpack_require__(599);
__webpack_require__(600);
__webpack_require__(601);
__webpack_require__(602);
__webpack_require__(603);
__webpack_require__(604);
__webpack_require__(605);
__webpack_require__(606);
__webpack_require__(607);
__webpack_require__(608);
__webpack_require__(609);
__webpack_require__(610);
__webpack_require__(611);
__webpack_require__(612);
__webpack_require__(613);
__webpack_require__(614);
__webpack_require__(615);
__webpack_require__(616);
__webpack_require__(617);
__webpack_require__(618);
__webpack_require__(619);
__webpack_require__(620);
__webpack_require__(621);
__webpack_require__(622);
__webpack_require__(623);
__webpack_require__(624);
__webpack_require__(625);
__webpack_require__(626);
__webpack_require__(627);
__webpack_require__(628);
__webpack_require__(629);
__webpack_require__(630);
__webpack_require__(631);
__webpack_require__(632);
__webpack_require__(633);
__webpack_require__(634);
__webpack_require__(635);
__webpack_require__(636);
__webpack_require__(637);
__webpack_require__(638);
__webpack_require__(639);
__webpack_require__(640);
__webpack_require__(641);
__webpack_require__(642);
__webpack_require__(643);
__webpack_require__(644);
__webpack_require__(645);
__webpack_require__(646);
__webpack_require__(647);
__webpack_require__(648);
__webpack_require__(649);
__webpack_require__(650);
__webpack_require__(651);
__webpack_require__(652);
__webpack_require__(653);
__webpack_require__(654);
__webpack_require__(655);
__webpack_require__(656);
__webpack_require__(657);
__webpack_require__(658);
__webpack_require__(659);
__webpack_require__(660);
__webpack_require__(661);
__webpack_require__(662);
__webpack_require__(663);
__webpack_require__(664);
__webpack_require__(665);
__webpack_require__(666);
__webpack_require__(667);
__webpack_require__(668);
__webpack_require__(669);
__webpack_require__(670);
__webpack_require__(671);
__webpack_require__(672);
__webpack_require__(673);
__webpack_require__(674);
__webpack_require__(675);
__webpack_require__(676);
__webpack_require__(677);
__webpack_require__(678);
__webpack_require__(679);
__webpack_require__(680);
__webpack_require__(681);
__webpack_require__(682);
__webpack_require__(738);
__webpack_require__(739);
__webpack_require__(732);
__webpack_require__(740);
__webpack_require__(741);
__webpack_require__(742);
__webpack_require__(743);
__webpack_require__(1077);
__webpack_require__(744);
__webpack_require__(683);
__webpack_require__(1078);
__webpack_require__(1079);
__webpack_require__(1080);
__webpack_require__(1081);
__webpack_require__(1082);
__webpack_require__(1083);
__webpack_require__(1084);
__webpack_require__(1085);
__webpack_require__(1086);
__webpack_require__(1087);
__webpack_require__(1088);
__webpack_require__(1089);
__webpack_require__(1090);
__webpack_require__(1091);
__webpack_require__(1092);
__webpack_require__(1093);
__webpack_require__(1094);
__webpack_require__(1095);
__webpack_require__(1096);
__webpack_require__(1097);
__webpack_require__(1098);
__webpack_require__(1099);
__webpack_require__(1100);
__webpack_require__(1101);
__webpack_require__(1102);
__webpack_require__(1103);
__webpack_require__(1104);
__webpack_require__(1105);
__webpack_require__(1106);
__webpack_require__(1107);
__webpack_require__(1108);
__webpack_require__(1109);
__webpack_require__(1110);
__webpack_require__(1111);
__webpack_require__(1112);
__webpack_require__(1113);
__webpack_require__(1114);
__webpack_require__(1115);
__webpack_require__(1116);
__webpack_require__(1117);
__webpack_require__(1118);
__webpack_require__(1119);
__webpack_require__(1120);
__webpack_require__(1121);
__webpack_require__(1122);
__webpack_require__(1123);
__webpack_require__(1124);
__webpack_require__(1125);
__webpack_require__(1126);
__webpack_require__(1127);
__webpack_require__(1128);
__webpack_require__(1129);
__webpack_require__(1130);
__webpack_require__(1131);
__webpack_require__(1132);
__webpack_require__(1133);
__webpack_require__(1134);
__webpack_require__(1135);
__webpack_require__(1136);
__webpack_require__(1137);
__webpack_require__(1138);
__webpack_require__(1139);
__webpack_require__(1140);
__webpack_require__(1141);
__webpack_require__(1142);
__webpack_require__(1143);
__webpack_require__(1144);
__webpack_require__(1145);
__webpack_require__(1146);
__webpack_require__(1147);
__webpack_require__(1148);
__webpack_require__(1149);
__webpack_require__(1150);
__webpack_require__(1151);
__webpack_require__(1152);
__webpack_require__(1153);
__webpack_require__(1154);
__webpack_require__(1155);
__webpack_require__(1156);
__webpack_require__(1157);
__webpack_require__(1158);
__webpack_require__(1159);
__webpack_require__(1160);
__webpack_require__(1161);
__webpack_require__(1162);
__webpack_require__(1163);
__webpack_require__(1164);
__webpack_require__(1165);
__webpack_require__(1166);
__webpack_require__(1167);
__webpack_require__(1168);
__webpack_require__(1169);
__webpack_require__(1170);
__webpack_require__(1171);
__webpack_require__(1172);
__webpack_require__(1173);
__webpack_require__(1174);
__webpack_require__(1175);
__webpack_require__(1176);
__webpack_require__(1177);
__webpack_require__(1178);
__webpack_require__(1179);
__webpack_require__(1180);
__webpack_require__(1181);
__webpack_require__(1182);
__webpack_require__(1183);
__webpack_require__(1184);
__webpack_require__(1185);
__webpack_require__(1186);
__webpack_require__(1187);
__webpack_require__(1188);
__webpack_require__(1189);
__webpack_require__(1190);
__webpack_require__(1191);
__webpack_require__(1192);
__webpack_require__(1193);
__webpack_require__(1194);
__webpack_require__(1195);
__webpack_require__(1196);
__webpack_require__(1197);
__webpack_require__(1198);
__webpack_require__(1199);
__webpack_require__(1200);
__webpack_require__(1201);
__webpack_require__(1202);
__webpack_require__(1203);
__webpack_require__(1204);
__webpack_require__(1205);
__webpack_require__(1206);
__webpack_require__(1207);
__webpack_require__(1208);
__webpack_require__(1209);
__webpack_require__(1210);
__webpack_require__(1211);
__webpack_require__(1212);
__webpack_require__(1213);
__webpack_require__(1214);
__webpack_require__(1215);
__webpack_require__(1216);
__webpack_require__(1217);
__webpack_require__(1218);
__webpack_require__(1219);
__webpack_require__(1220);
__webpack_require__(1221);
__webpack_require__(1222);
__webpack_require__(1223);
__webpack_require__(1224);
__webpack_require__(1225);
__webpack_require__(1226);
__webpack_require__(1227);
__webpack_require__(1228);
__webpack_require__(1229);
__webpack_require__(1230);
__webpack_require__(1231);
__webpack_require__(1232);
__webpack_require__(1233);
__webpack_require__(1234);
__webpack_require__(1235);
__webpack_require__(1236);
__webpack_require__(1237);
__webpack_require__(1238);
__webpack_require__(1239);
__webpack_require__(1240);
__webpack_require__(1241);
__webpack_require__(1242);
module.exports = __webpack_require__(1243);
/***/ }),
/* 1077 */
/***/ (function(module, exports) {
/***/ }),
/* 1078 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 1079 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 1080 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 1081 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 1082 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 1083 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 1084 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 1085 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 1086 */
/***/ (function(module, exports) {
Demo = {
version: 1.0
};
BI.$(function () {
var ref;
BI.each(Demo.CONFIG, function (index, item) {
!item.id && (item.id = item.value || item.text);
});
var tree = BI.Tree.transformToTreeFormat(Demo.CONFIG);
var obj = {
routes: {
"": "index"
},
index: function () {
Demo.showIndex = "demo.face";
}
};
BI.Tree.traversal(tree, function (index, node) {
if (!node.children || BI.isEmptyArray(node.children)) {
obj.routes[node.text] = node.text;
obj[node.text] = function () {
Demo.showIndex = node.value;
};
}
});
var AppRouter = BI.inherit(BI.Router, obj);
new AppRouter;
BI.history.start();
BI.createWidget({
type: "demo.main",
ref: function (_ref) {
console.log(_ref);
ref = _ref;
},
element: "#wrapper"
});
});
/***/ }),
/* 1087 */
/***/ (function(module, exports) {
Demo.Button = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-button"
},
render: function () {
var items = [{
el: {
type: "bi.button",
text: "一般按钮",
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示成功状态按钮",
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示警告状态的按钮",
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示错误状态的按钮",
level: "error",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.button",
text: "一般按钮",
block: true,
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示成功状态按钮",
block: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示警告状态的按钮",
block: true,
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
block: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
block: true,
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
block: true,
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
block: true,
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.button",
text: "一般按钮",
clear: true,
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示成功状态按钮",
clear: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示警告状态的按钮",
clear: true,
level: "warning",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示忽略状态的按钮",
clear: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "普通灰化按钮",
clear: true,
disabled: true,
level: "success",
height: 30
}
}, {
el: {
type: "bi.button",
text: "忽略状态灰化按钮",
clear: true,
disabled: true,
level: "ignore",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
clear: true,
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.text_button",
text: "文字按钮",
height: 30
}
}, {
el: {
type: "bi.button",
text: "幽灵按钮(common)",
ghost: true,
height: 30
}
}, {
el: {
type: "bi.button",
text: "幽灵按钮(common)灰化",
disabled: true,
ghost: true,
height: 30
}
}, {
el: {
type: "bi.button",
text: "弹出bubble",
bubble: function () {
return BI.parseInt(Math.random() * 100) % 10 + "提示"
},
handler: function () {
BI.Msg.toast("1111");
},
height: 30
}
}];
// BI.each(items, function (i, item) {
// item.el.handler = function () {
// BI.Msg.alert("按钮", this.options.text);
// };
// });
return {
type: "bi.left",
scrolly: true,
vgap: 100,
hgap: 20,
items: items
};
}
});
BI.shortcut("demo.button", Demo.Button);
/***/ }),
/* 1088 */
/***/ (function(module, exports) {
Demo.Button = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-button"
},
render: function () {
var items = [
{
el: {
type: "bi.icon_button",
cls: "close-ha-font",
width: 25,
height: 25
}
}
];
return {
type: "bi.left",
vgap: 200,
hgap: 20,
items: items
};
}
});
BI.shortcut("demo.icon_button", Demo.Button);
/***/ }),
/* 1089 */
/***/ (function(module, exports) {
Demo.Button = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-button"
},
render: function () {
var items = [
{
el: {
type: "bi.image_button",
src: "http://www.easyicon.net/api/resizeApi.php?id=1206741&size=128",
width: 100,
height: 100
}
}
];
return {
type: "bi.left",
vgap: 200,
hgap: 20,
items: items
};
}
});
BI.shortcut("demo.image_button", Demo.Button);
/***/ }),
/* 1090 */
/***/ (function(module, exports) {
Demo.Button = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-button"
},
render: function () {
var items = [
{
el: {
type: "bi.text_button",
text: "文字按钮",
height: 30,
keyword: "w"
}
}
];
return {
type: "bi.left",
vgap: 200,
hgap: 20,
items: items
};
}
});
BI.shortcut("demo.text_button", Demo.Button);
/***/ }),
/* 1091 */
/***/ (function(module, exports) {
Demo.Html = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-html"
},
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.html",
text: "<h1>在bi.html标签中使用html原生标签</h1>"
}, {
type: "bi.html",
text: "<ul>ul列表<li>list item1</li><li>list item2</li></ul>"
}],
hgap: 300,
vgap: 20
};
}
});
BI.shortcut("demo.html", Demo.Html);
/***/ }),
/* 1092 */
/***/ (function(module, exports) {
Demo.IconLabel = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-bubble"
},
render: function () {
return {
type: "bi.default",
items: [{
type: "bi.label",
text: "这是一个icon标签,在加了border之后仍然是居中显示的"
}, {
type: "bi.icon_label",
cls: "date-font bi-border",
height: 40,
width: 40
}]
};
}
});
BI.shortcut("demo.icon_label", Demo.IconLabel);
/***/ }),
/* 1093 */
/***/ (function(module, exports) {
Demo.Label = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-label"
},
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.label",
cls: "layout-bg6",
text: "这是一个label控件,默认居中",
disabled: true,
textAlign: "center"
}, {
type: "bi.label",
cls: "layout-bg1",
text: "这是一个label控件, 高度为30,默认居中",
textAlign: "center",
height: 30
}, {
type: "bi.label",
cls: "layout-bg3",
text: "这是一个label控件,使用水平居左",
textAlign: "left",
height: 30
}, {
type: "bi.label",
cls: "layout-bg2",
text: "这是一个label控件,whiteSpace是normal,不设置高度,为了演示这个是真的是normal的,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal"
}, {
type: "bi.label",
cls: "layout-bg5",
text: "这是一个label控件,whiteSpace是默认的nowrap,不设置高度,为了演示这个是真的是nowrap的,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数"
}, {
type: "bi.label",
cls: "layout-bg7",
text: "这是一个label控件,whiteSpace是默认的nowrap,高度为30,为了演示这个是真的是nowrap的,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
height: 30
}, {
type: "bi.label",
cls: "layout-bg3",
text: "这是一个label控件,whiteSpace设置为normal,高度为60,为了演示这个是真的是normal的,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
height: 60
}, {
type: "bi.label",
cls: "layout-bg5",
text: "这是一个label控件,whiteSpace设置为normal,textHeight控制text的lineHeight,这样可以实现换行效果,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textHeight: 30,
height: 60
}, {
type: "bi.label",
cls: "layout-bg1",
text: "这是一个label控件,whiteSpace设置为nowrap,textWidth控制text的width",
textWidth: 200,
height: 60
}, {
type: "bi.label",
cls: "layout-bg8",
text: "这是一个label控件,whiteSpace设置为normal,textWidth控制text的width,这样可以实现换行效果,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textWidth: 200,
height: 60
}, {
type: "bi.label",
cls: "layout-bg7",
text: "whiteSpace为默认的nowrap,高度设置为60,宽度设置为300",
height: 60,
width: 300
}, {
type: "bi.label",
cls: "layout-bg6",
text: "设置了宽度300,高度60,whiteSpace设置为normal",
whiteSpace: "normal",
width: 300,
height: 60
}, {
type: "bi.label",
cls: "layout-bg8",
text: "textWidth设置为200,textHeight设置为30,width设置300,凑点字数看效果",
width: 300,
textWidth: 200,
textHeight: 30,
height: 60,
whiteSpace: "normal"
}, {
type: "bi.label",
cls: "layout-bg1",
text: "textWidth设置为200,width设置300,看下水平居左的换行效果",
textAlign: "left",
width: 300,
textWidth: 200,
textHeight: 30,
height: 60,
whiteSpace: "normal"
}, {
type: "bi.label",
cls: "layout-bg2",
text: "使用默认的nowrap,再去设置textHeight,只会有一行的效果",
textAlign: "left",
width: 300,
textWidth: 200,
textHeight: 30,
height: 60
}, {
type: "bi.left",
items: [{
type: "bi.label",
cls: "layout-bg3",
text: "在float布局中自适应的,不设高度和宽度,文字多长这个就有多长"
}],
height: 30
}, {
type: "bi.left",
items: [{
type: "bi.label",
cls: "layout-bg4",
text: "在float布局中自适应的,设置了宽度200,后面还有",
width: 200
}],
height: 30
}, {
type: "bi.left",
items: [{
type: "bi.label",
text: "在float布局中自适应的,设置了高度,文字多长这个就有多长",
cls: "layout-bg5",
height: 30
}],
height: 30
}],
hgap: 300,
vgap: 20
};
}
});
BI.shortcut("demo.label", Demo.Label);
/***/ }),
/* 1094 */
/***/ (function(module, exports) {
/**
* 整理所有label场景
*/
Demo.LabelScene = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-label"
},
render: function () {
var items = [];
items.push(this.createExpander("1.1.1 文字居中,有宽度和高度,有文字宽度,whiteSpace为normal", {
type: "bi.label",
cls: "layout-bg6",
text: "设置了textWidth,则一定是嵌套结构,因此需要用center_adapt布局容纳一下.为了实现不足一行时文字水平居中,超出一行时左对齐,需要设置maxWidth.",
whiteSpace: "normal",
height: 50,
width: 500,
textWidth: 200,
textAlign: "center"
}));
items.push(this.createExpander("1.1.2 居中,有宽度和高度,有文字宽度,whiteSpace为nowrap", {
type: "bi.label",
cls: "layout-bg6",
text: "居中,有宽度高度,有文字宽度,whiteSpace为nowrap,maxWidth会限制文字",
whiteSpace: "nowrap",
height: 50,
width: 500,
textWidth: 350,
textAlign: "center"
}));
items.push((this.createExpander("1.2.1 居中,有宽度无高度,有文字宽度,whiteSpace为normal", {
type: "bi.label",
cls: "layout-bg6",
text: "居中,有宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
width: 500,
textWidth: 200,
textAlign: "center"
})));
items.push((this.createExpander("1.2.1 居中,有宽度无高度,有文字宽度,whiteSpace为normal,高度被父容器拉满", {
type: "bi.absolute",
height: 100,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg6",
text: "此时虽然没有对label设置高度,但由于使用了center_adapt布局,依然会垂直方向居中",
whiteSpace: "normal",
width: 500,
textWidth: 200,
textAlign: "center"
},
top: 0,
left: 0,
bottom: 0
}
]
})));
items.push((this.createExpander("1.2.2 居中,有宽度无高度,有文字宽度,whiteSpace为nowrap", {
type: "bi.label",
cls: "layout-bg6",
text: "居中,有宽度无高度,有文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "nowrap",
width: 500,
textWidth: 350,
textAlign: "center"
})));
items.push((this.createExpander("1.3.1 居中,有宽度和高度,无文字宽度,whiteSpace为normal", {
type: "bi.label",
cls: "layout-bg3",
text: "居中,有宽度高度,无文字宽度,whiteSpace为normal,只需用center_adapt布局包一下即可.度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,whiteSpace为normal",
width: 500,
whiteSpace: "normal",
textAlign: "center",
height: 50
})));
items.push((this.createExpander("1.3.2 居中,有宽度无高度,无文字宽度,whiteSpace为normal", {
type: "bi.absolute",
height: 100,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg3",
text: "居中,有宽度无高度,无文字宽度,whiteSpace为normal,只需用center_adapt布局包一下即可.度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,下即可.居中,有宽度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,度,无文字宽度,whiteSpace为normal居中,有宽度,无文字宽度,whiteSpace为normal",
width: 500,
whiteSpace: "normal",
textAlign: "center"
},
top: 0,
left: 0,
bottom: 0
}
]
})));
items.push((this.createExpander("1.4 居中,有宽度和高度,无文字宽度,whiteSpace为nowrap", {
type: "bi.label",
cls: "layout-bg3",
text: "居中,有宽度500有高度50,无文字宽度,whiteSpace为nowrap,此处无需两层div,设置text即可,然后设置line-height为传入高度即可实现垂直方向居中",
width: 500,
whiteSpace: "nowrap",
textAlign: "center",
height: 50
})));
items.push((this.createExpander("1.5.1 居中,有宽度无高度,无文字宽度,whiteSpace为nowrap", {
type: "bi.label",
cls: "layout-bg3",
text: "居中,有宽度500无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
width: 500,
whiteSpace: "nowrap",
textAlign: "center"
})));
items.push((this.createExpander("1.5.2 居中,有宽度无高度,无文字宽度,whiteSpace为nowrap,高度被父级拉满", {
type: "bi.absolute",
height: 50,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg3",
text: "居中,有宽度500无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
width: 500,
whiteSpace: "nowrap",
textAlign: "center"
},
top: 0,
left: 0,
bottom: 0
}
]
})));
items.push((this.createExpander("1.6.1 居中,无宽度无高度,有文字宽度,whiteSpace为nowrap", {
type: "bi.label",
cls: "layout-bg3",
text: "居中,无宽度,有文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
textWidth: 500,
whiteSpace: "nowrap",
textAlign: "center"
})));
items.push((this.createExpander("1.6.2 居中,无宽度无高度,有文字宽度,whiteSpace为normal", {
type: "bi.label",
cls: "layout-bg3",
text: "居中,无宽度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
textWidth: 500,
whiteSpace: "normal",
textAlign: "center"
})));
items.push((this.createExpander("1.6.3 居中,无宽度无,有文字宽度,whiteSpace为normal,被父级拉满", {
type: "bi.absolute",
height: 100,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg3",
text: "居中,无宽度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
textWidth: 500,
whiteSpace: "normal",
textAlign: "center"
},
left: 0,
right: 0,
top: 0,
bottom: 0
}
]
})));
items.push((this.createExpander("1.7.1 居中,无宽度无高度,无文字宽度,whiteSpace为normal", {
type: "bi.label",
cls: "layout-bg3",
text: "居中,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "center"
})));
items.push((this.createExpander("1.7.2 居中,无宽度无高度,无文字宽度,whiteSpace为normal,被父级拉满", {
type: "bi.absolute",
height: 100,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg3",
text: "居中,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "center"
},
left: 0,
right: 0,
top: 0,
bottom: 0
}
]
})));
items.push((this.createExpander("1.7.3 居中,无宽度有高度,无文字宽度,whiteSpace为normal", {
type: "bi.label",
cls: "layout-bg3",
text: "居中,无宽度有高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
height: 50,
textAlign: "center"
})));
items.push((this.createExpander("1.8 居中,无宽度有高度,无文字宽度,whiteSpace为nowrap", {
type: "bi.label",
cls: "layout-bg3",
text: "居中,无宽度有高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "nowrap",
height: 50,
textAlign: "center"
})));
items.push((this.createExpander("1.9 居中,无宽度无高度,无文字宽度,whiteSpace为nowrap", {
type: "bi.label",
cls: "layout-bg3",
text: "居中,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "nowrap",
textAlign: "center"
})));
items.push((this.createExpander("1.9.1 居中,无宽度无高度,无文字宽度,whiteSpace为nowrap,高度被父级拉满", {
type: "bi.absolute",
height: 50,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg3",
text: "居中,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "nowrap",
textAlign: "center"
},
top: 0,
left: 0,
right: 0,
bottom: 0
}
]
})));
items.push((this.createExpander("2.1.1 居左,有宽度有高度,有文字宽度,whiteSpace为normal", {
type: "bi.label",
cls: "layout-bg2",
text: "居左,有宽度有高度,有文字宽度,whiteSpace为normal,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "left",
textWidth: 300,
height: 50,
width: 500
})));
items.push((this.createExpander("2.1.2 居左,有宽度有高度,有文字宽度,whiteSpace为nowrap", {
type: "bi.label",
cls: "layout-bg2",
text: "居左,有宽度有高度,有文字宽度,whiteSpace为normal,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "nowrap",
textAlign: "left",
textWidth: 300,
height: 50,
width: 500
})));
items.push((this.createExpander("2.2.1 居左,有宽度无高度,有文字宽度,whiteSpace为normal", {
type: "bi.label",
cls: "layout-bg2",
text: "居左,有宽度无高度,有文字宽度,whiteSpace为normal,不设置高度,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "left",
textWidth: 300,
width: 500
})));
items.push((this.createExpander("2.2.2 居左,有宽度无高度,有文字宽度,whiteSpace为normal,高度被父级拉满", {
type: "bi.absolute",
height: 100,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg2",
text: "居左,有宽度无高度,有文字宽度,whiteSpace为normal,不设置高度,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "left",
textWidth: 300,
width: 500
},
top: 0,
bottom: 0,
left: 0
}
]
})));
items.push((this.createExpander("2.2.3 居左,有宽度无高度,有文字宽度,whiteSpace为nowrap", {
type: "bi.label",
cls: "layout-bg2",
text: "居左,有宽度无高度,有文字宽度,whiteSpace为nowrap,不设置高度,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "nowrap",
textAlign: "left",
textWidth: 300,
width: 500
})));
items.push((this.createExpander("2.2.4 居左,有宽度无高度,有文字宽度,whiteSpace为nowrap,高度被父级拉满", {
type: "bi.absolute",
height: 100,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg2",
text: "居左,有宽度无高度,有文字宽度,whiteSpace为nowrap,不设置高度,为了演示这个是真的是normal的我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "nowrap",
textAlign: "left",
textWidth: 300,
width: 500
},
top: 0,
bottom: 0,
left: 0
}
]
})));
items.push((this.createExpander("2.3.1 居左,有宽度有高度,无文字宽度,whiteSpace为nowrap", {
type: "bi.label",
cls: "layout-bg2",
text: "居左,有宽度有高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "nowrap",
textAlign: "left",
height: 50,
vgap: 5,
width: 500
})));
items.push((this.createExpander("2.3.2 居左,有宽度有高度,无文字宽度,whiteSpace为normal", {
type: "bi.label",
cls: "layout-bg2",
text: "居左,有宽度有高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "left",
height: 50,
width: 500
})));
items.push((this.createExpander("2.4.1 居左,有宽度无高度,无文字宽度,whiteSpace为normal", {
type: "bi.label",
cls: "layout-bg2",
text: "居左,有宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "left",
width: 500
})));
items.push((this.createExpander("2.4.2 居左,有宽度无高度,无文字宽度,whiteSpace为normal,高度被父级拉满", {
type: "bi.absolute",
height: 100,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg1",
text: "居左,有宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "left",
width: 500
},
top: 0,
left: 0,
bottom: 0
}
]
})));
items.push((this.createExpander("2.5.1 居左,无宽度无高度,有文字宽度,whiteSpace为normal", {
type: "bi.label",
cls: "layout-bg2",
text: "居左,无宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "left",
textWidth: 300
})));
items.push((this.createExpander("2.5.2 居左,无宽度无高度,有文字宽度,whiteSpace为normal,高度被父级拉满", {
type: "bi.absolute",
height: 100,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg2",
text: "居左,无宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "left",
textWidth: 300
},
top: 0,
left: 0,
bottom: 0,
right: 0
}
]
})));
items.push((this.createExpander("2.5.3 居左,无宽度无高度,有文字宽度,whiteSpace为nowrap", {
type: "bi.label",
cls: "layout-bg2",
text: "居左,无宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "nowrap",
textAlign: "left",
textWidth: 300
})));
items.push((this.createExpander("2.5.4 居左,无宽度无高度,有文字宽度,whiteSpace为nowrap,高度被父级拉满", {
type: "bi.absolute",
height: 100,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg2",
text: "居左,无宽度无高度,有文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "nowrap",
textAlign: "left",
textWidth: 300
},
top: 0,
left: 0,
bottom: 0,
right: 0
}
]
})));
items.push((this.createExpander("2.6.1 居左,无宽度有高度,无文字宽度,whiteSpace为nowrap", {
type: "bi.label",
cls: "layout-bg2",
text: "居左,无宽度有高度,无文字宽度,whiteSpace为nowrap,注意这个是设置了vgap的,为了实现居中,lineHeight要做计算,才能准确的垂直居中",
whiteSpace: "nowrap",
textAlign: "left",
vgap: 10,
height: 50
})));
items.push((this.createExpander("2.6.2 居左,无宽度有高度,无文字宽度,whiteSpace为normal", {
type: "bi.label",
cls: "layout-bg2",
text: "居左,无宽度有高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "left",
height: 50
})));
items.push((this.createExpander("2.7.1 居左,无宽度无高度,无文字宽度,whiteSpace为normal", {
type: "bi.label",
cls: "layout-bg2",
text: "居左,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "left"
})));
items.push((this.createExpander("2.7.2 居左,无宽度无高度,无文字宽度,whiteSpace为normal,高度被父级拉满", {
type: "bi.absolute",
height: 100,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg2",
text: "居左,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "left"
},
top: 0,
left: 0,
bottom: 0,
right: 0
}
]
})));
items.push((this.createExpander("2.7.3 居左,无宽度无高度,无文字宽度,whiteSpace为nowrap", {
type: "bi.label",
cls: "layout-bg2",
text: "居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "nowrap",
textAlign: "left"
})));
items.push((this.createExpander("2.7.4 居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,高度被父级拉满", {
type: "bi.absolute",
height: 100,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg2",
text: "居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "nowrap",
textAlign: "left"
},
top: 0,
left: 0,
bottom: 0,
right: 0
}
]
})));
items.push((this.createExpander("2.8 居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,高度被父级拉满", {
type: "bi.absolute",
height: 100,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg2",
text: "居左,无宽度无高度,无文字宽度,whiteSpace为nowrap,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "nowrap",
textAlign: "left"
},
top: 0,
left: 0,
bottom: 0,
right: 0
}
]
})));
items.push((this.createExpander("2.8.2 居左,无宽度无高度,无文字宽度,whiteSpace为normal,高度被父级拉满", {
type: "bi.absolute",
height: 100,
items: [
{
el: {
type: "bi.label",
cls: "layout-bg2",
text: "居左,无宽度无高度,无文字宽度,whiteSpace为normal,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,我凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数,凑点字数",
whiteSpace: "normal",
textAlign: "left"
},
top: 0,
left: 0,
bottom: 0,
right: 0
}
]
})));
return {
type: "bi.vertical",
items: items,
hgap: 300,
vgap: 20
};
},
createExpander: function (text, popup) {
return {
type: "bi.vertical",
items: [
{
type: "bi.label",
cls: "demo-font-weight-bold",
textAlign: "left",
text: text,
height: 30
}, {
el: popup
}
]
};
}
});
BI.shortcut("demo.label_scene", Demo.LabelScene);
/***/ }),
/* 1095 */
/***/ (function(module, exports) {
Demo.Message = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-bubble"
},
render: function () {
return {
type: "bi.center_adapt",
items: [
{
el: {
type: "bi.button",
text: "点击我弹出一个消息框",
height: 30,
handler: function () {
BI.Msg.alert("测试消息框", "我是测试消息框的内容");
}
}
}
]
};
}
});
BI.shortcut("demo.message", Demo.Message);
/***/ }),
/* 1096 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.label",
height: 30,
text: "默认的分页"
}, {
type: "bi.pager",
height: 50,
pages: 18,
groups: 5,
curr: 6,
first: "首页",
last: "尾页"
}, {
type: "bi.label",
height: 30,
text: "显示上一页、下一页、首页、尾页"
}, {
type: "bi.pager",
dynamicShow: false,
height: 50,
pages: 18,
groups: 5,
curr: 1,
first: "首页>",
last: "<尾页"
}, {
type: "bi.label",
height: 30,
text: "显示上一页、下一页"
}, {
type: "bi.pager",
dynamicShow: false,
dynamicShowFirstLast: true,
height: 50,
pages: 18,
groups: 5,
curr: 1,
first: "首页>",
last: "<尾页"
}, {
type: "bi.label",
height: 30,
text: "自定义上一页、下一页"
}, {
type: "bi.pager",
dynamicShow: false,
height: 50,
pages: 18,
groups: 5,
curr: 6,
prev: {
type: "bi.button",
cls: "",
text: "上一页",
value: "prev",
once: false,
height: 30,
handler: function () {
}
},
next: {
type: "bi.button",
cls: "",
text: "下一页",
value: "next",
once: false,
handler: function () {
}
}
}, {
type: "bi.label",
height: 30,
text: "不知道总页数的情况(测试条件 1<=page<=3)"
}, {
type: "bi.pager",
dynamicShow: false,
height: 50,
pages: false,
curr: 1,
prev: {
type: "bi.button",
cls: "",
text: "上一页",
value: "prev",
once: false,
height: 30,
handler: function () {
}
},
next: {
type: "bi.button",
cls: "",
text: "下一页",
value: "next",
once: false,
handler: function () {
}
},
hasPrev: function (v) {
return v > 1;
},
hasNext: function (v) {
return v < 3;
}
}]
};
}
});
BI.shortcut("demo.pager", Demo.Func);
/***/ }),
/* 1097 */
/***/ (function(module, exports) {
Demo.Editor = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-editor"
},
render: function () {
var editor1 = BI.createWidget({
type: "bi.editor",
cls: "bi-border",
watermark: "alert信息显示在下面",
errorText: "字段不可重名!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
width: 200,
height: 24
});
editor1.on(BI.Editor.EVENT_ENTER, function () {
editor1.blur();
});
var editor2 = BI.createWidget({
type: "bi.editor",
cls: "mvc-border",
watermark: "输入'a'会有错误信息",
disabled: true,
errorText: "字段不可重名",
validationChecker: function (v) {
if (v == "a") {
return false;
}
return true;
},
allowBlank: true,
width: 200,
height: 24
});
var editor3 = BI.createWidget({
type: "bi.editor",
cls: "mvc-border",
watermark: "输入'a'会有错误信息且回车键不能退出编辑",
errorText: "字段不可重名",
value: "a",
validationChecker: function (v) {
if (v == "a") {
return false;
}
return true;
},
quitChecker: function (v) {
return false;
},
allowBlank: true,
width: 300,
height: 24
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: editor1,
left: 0,
top: 0
}, {
el: editor2,
left: 250,
top: 30
}, {
el: editor3,
left: 500,
top: 60
}, {
el: {
type: "bi.button",
text: "disable",
handler: function () {
editor1.setEnable(false);
editor2.setEnable(false);
editor3.setEnable(false);
},
height: 30
},
left: 100,
bottom: 60
}, {
el: {
type: "bi.button",
text: "enable",
handler: function () {
editor1.setEnable(true);
editor2.setEnable(true);
editor3.setEnable(true);
},
height: 30
},
left: 200,
bottom: 60
}]
});
}
});
BI.shortcut("demo.editor", Demo.Editor);
/***/ }),
/* 1098 */
/***/ (function(module, exports) {
Demo.CodeEditor = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-editor"
},
render: function () {
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.adaptive",
cls: "layout-bg1",
items: [{
type: "bi.multifile_editor",
width: 400,
height: 300
}],
width: 400,
height: 300
},
top: 50,
left: 50
}]
};
}
});
BI.shortcut("demo.multifile_editor", Demo.CodeEditor);
/***/ }),
/* 1099 */
/***/ (function(module, exports) {
Demo.CodeEditor = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-editor"
},
render: function () {
var editor = BI.createWidget({
type: "bi.textarea_editor",
cls: "bi-border",
width: 600,
height: 400,
watermark: "请输入内容"
});
editor.on(BI.TextAreaEditor.EVENT_FOCUS, function () {
BI.Msg.toast("Focus");
});
editor.on(BI.TextAreaEditor.EVENT_BLUR, function () {
BI.Msg.toast("Blur");
});
BI.createWidget({
type: "bi.vertical",
element: this,
hgap: 30,
vgap: 20,
items: [editor, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(editor.getValue()));
}
}, {
type: "bi.button",
text: "setValue",
handler: function () {
editor.setValue("测试数据");
}
}]
});
}
});
BI.shortcut("demo.textarea_editor", Demo.CodeEditor);
/***/ }),
/* 1100 */
/***/ (function(module, exports) {
Demo.Bubble = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-bubble"
},
render: function () {
var btns = [];
var items = [
{
el: {
ref: function (_ref) {
btns.push(_ref);
},
type: "bi.button",
text: "bubble测试(消息)",
title: "123",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble1", "bubble测试", this, {
level: "common"
});
}
}
}, {
el: {
ref: function (_ref) {
btns.push(_ref);
},
type: "bi.button",
text: "bubble测试(成功)",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble2", "bubble测试", this, {
offsetStyle: "center",
level: "success"
});
}
}
}, {
el: {
ref: function (_ref) {
btns.push(_ref);
},
type: "bi.button",
text: "bubble测试(错误)",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble3", "bubble测试", this, {
offsetStyle: "right",
level: "error"
});
}
}
}, {
el: {
ref: function (_ref) {
btns.push(_ref);
},
type: "bi.button",
text: "bubble测试(警告)",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble4", "bubble测试", this, {
level: "warning"
});
}
}
}
];
return {
type: "bi.left",
vgap: 200,
hgap: 20,
items: items
};
}
});
BI.shortcut("demo.bubble", Demo.Bubble);
/***/ }),
/* 1101 */
/***/ (function(module, exports) {
Demo.Title = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-title"
},
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.label",
cls: "layout-bg1",
height: 50,
title: "title提示",
text: "移上去有title提示",
textAlign: "center"
}, {
type: "bi.label",
cls: "layout-bg6",
height: 50,
disabled: true,
warningTitle: "title错误提示",
text: "移上去有title错误提示",
textAlign: "center"
}, {
type: "bi.label",
cls: "layout-bg2",
height: 50,
disabled: true,
tipType: "success",
title: "自定义title提示效果",
warningTitle: "自定义title提示效果",
text: "自定义title提示效果",
textAlign: "center"
}],
hgap: 300,
vgap: 20
};
}
});
BI.shortcut("demo.title", Demo.Title);
/***/ }),
/* 1102 */
/***/ (function(module, exports) {
Demo.Toast = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-toast"
},
render: function () {
var items = [
{
el: {
type: "bi.button",
text: "简单Toast测试(success)",
height: 30,
handler: function () {
BI.Msg.toast("这是一条简单的数据");
}
}
}, {
el: {
type: "bi.button",
text: "很长的Toast测试(normal)",
height: 30,
handler: function () {
BI.Msg.toast("这是一条很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长的数据", {
level: "normal"
});
}
}
}, {
el: {
type: "bi.button",
text: "非常长的Toast测试(warning)",
height: 30,
handler: function () {
BI.Msg.toast("这是一条非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长的数据", {
level: "warning",
autoClose: false
});
}
}
}, {
el: {
type: "bi.button",
text: "错误提示Toast测试(error)",
height: 30,
handler: function () {
BI.Msg.toast("错误提示Toast测试", {
level: "error"
});
}
}
}, {
el: {
type: "bi.button",
text: "错误提示Toast测试(error), 此toast不会自动消失",
height: 30,
handler: function () {
BI.Msg.toast("错误提示Toast测试", {
autoClose: false
});
}
}
}
];
BI.createWidget({
type: "bi.left",
element: this,
vgap: 200,
hgap: 20,
items: items
});
}
});
BI.shortcut("demo.toast", Demo.Toast);
/***/ }),
/* 1103 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
mounted: function () {
this.partTree.stroke({
keyword: "1"
});
},
render: function () {
var self = this;
return {
type: "bi.vtape",
items: [{
type: "bi.label",
height: 50,
text: "先初始化一份数据,然后再异步获取数据的树"
}, {
type: "bi.part_tree",
ref: function (_ref) {
self.partTree = _ref;
},
paras: {
selectedValues: {"1": {}, "2": {"1": {}}}
},
itemsCreator: function (op, callback) {
if (op.type === BI.TreeView.REQ_TYPE_INIT_DATA) {
callback({
items: [{
id: "1",
text: 1,
isParent: true,
open: true
}, {
id: "11",
pId: "1",
text: 11,
isParent: true,
open: true
}, {
id: "111",
pId: "11",
text: 111,
isParent: true
}, {
id: "2",
text: 2
}, {
id: "3",
text: 3
}],
hasNext: BI.isNull(op.id)
});
return;
}
callback({
items: [{
id: (op.id || "") + "1",
pId: op.id,
text: 1,
isParent: true
}, {
id: (op.id || "") + "2",
pId: op.id,
text: 2
}, {
id: (op.id || "") + "3",
pId: op.id,
text: 3
}],
hasNext: BI.isNull(op.id)
});
}
}]
};
}
});
BI.shortcut("demo.part_tree", Demo.Func);
/***/ }),
/* 1104 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
mounted: function () {
this.syncTree.stroke({
keyword: "1"
});
},
render: function () {
var self = this;
return {
type: "bi.vtape",
items: [{
type: "bi.label",
height: 50,
text: "可以异步获取数据的树"
}, {
type: "bi.async_tree",
ref: function (_ref) {
self.syncTree = _ref;
},
paras: {
selectedValues: {"1": {}, "2": {"1": {}}}
},
itemsCreator: function (op, callback) {
callback({
items: [{
id: (op.id || "") + "1",
pId: op.id,
text: 1,
isParent: true
}, {
id: (op.id || "") + "2",
pId: op.id,
text: 2
}, {
id: (op.id || "") + "3",
pId: op.id,
text: 3
}],
hasNext: BI.isNull(op.id)
});
}
}]
};
}
});
BI.shortcut("demo.sync_tree", Demo.Func);
/***/ }),
/* 1105 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
_createDefaultTree: function () {
var tree = BI.createWidget({
type: "bi.tree_view"
});
tree.initTree([
{id: 1, pId: 0, text: "test1", open: true},
{id: 11, pId: 1, text: "test11"},
{id: 12, pId: 1, text: "test12"},
{id: 111, pId: 11, text: "test111"},
{id: 2, pId: 0, text: "test2", open: true},
{id: 21, pId: 2, text: "test21"},
{id: 22, pId: 2, text: "test22"}
]);
return tree;
},
render: function () {
var self = this;
BI.createWidget({
type: "bi.grid",
columns: 1,
rows: 1,
element: this,
items: [{
column: 0,
row: 0,
el: {
type: "bi.vtape",
items: [
{
el: this._createDefaultTree()
},
{
el: {
type: "bi.label",
text: "tree.initTree([{\"id\":1, \"pId\":0, \"text\":\"test1\", open:true},{\"id\":11, \"pId\":1, \"text\":\"test11\"},{\"id\":12, \"pId\":1, \"text\":\"test12\"},{\"id\":111, \"pId\":11, \"text\":\"test111\"}])",
whiteSpace: "normal"
},
height: 50
}
]
}
}]
});
}
});
BI.shortcut("demo.tree_view", Demo.Func);
/***/ }),
/* 1106 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this, count = 1;
var combo1 = BI.createWidget({
type: "bi.bubble_combo",
trigger: "click,hover",
el: {
type: "bi.button",
text: "测试",
height: 24
},
popup: {
el: {
type: "bi.button_group",
items: BI.makeArray(100, {
type: "bi.text_item",
height: 24,
text: "item"
}),
layouts: [{
type: "bi.vertical"
}]
},
maxHeight: 200
}
});
var combo2 = BI.createWidget({
type: "bi.bubble_combo",
direction: "right",
el: {
type: "bi.button",
text: "测试",
height: 24
},
popup: {
type: "bi.text_bubble_bar_popup_view",
text: "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字",
ref: function () {
self.popup = this;
}
},
listeners: [{
eventName: BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.populate((count++) % 2 === 1 ? "我的文字变少了" : "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字");
}
}]
});
var combo3 = BI.createWidget({
type: "bi.bubble_combo",
el: {
type: "bi.button",
text: "测试",
height: 25
},
popup: {
type: "bi.text_bubble_bar_popup_view",
text: "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字",
ref: function () {
self.popup = this;
}
},
listeners: [{
eventName: BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.populate((count++) % 2 === 1 ? "我的文字变少了" : "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字");
}
}]
});
var combo4 = BI.createWidget({
type: "bi.bubble_combo",
el: {
type: "bi.button",
text: "测试",
height: 25
},
popup: {
type: "bi.text_bubble_bar_popup_view",
text: "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字",
ref: function () {
self.popup = this;
}
},
listeners: [{
eventName: BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.populate((count++) % 2 === 1 ? "我的文字变少了" : "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字");
}
}]
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: combo1,
left: 150,
top: 10
}, {
el: combo2,
left: 10,
bottom: 200
}, {
el: combo3,
right: 10,
bottom: 10
}, {
el: combo4,
right: 10,
top: 10
}]
});
}
});
BI.shortcut("demo.bubble_combo", Demo.Func);
/***/ }),
/* 1107 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/11.
*/
Demo.TextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.editor_icon_check_combo",
ref: function () {
self.combo = this;
},
watermark: "默认值",
width: 200,
height: 24,
value: 2,
items: [{
// text: "MVC-1",
value: "1"
}, {
// text: "MVC-2",
value: "2"
}, {
// text: "MVC-3",
value: "3"
}]
}, {
type: "bi.button",
width: 90,
height: 25,
text: "setValue为空",
handler: function () {
self.combo.setValue()
}
}],
vgap: 20
};
}
});
BI.shortcut("demo.editor_icon_check_combo", Demo.TextValueCombo);
/***/ }),
/* 1108 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/12.
*/
Demo.IconCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.icon_combo",
container: "body",
ref: function (_ref) {
self.refs = _ref;
},
value: "第二项",
items: [{
value: "第一项",
iconCls: "close-font"
}, {
value: "第二项",
iconCls: "search-font"
}, {
value: "第三项",
iconCls: "copy-font"
}]
}],
vgap: 20
};
}
});
BI.shortcut("demo.icon_combo", Demo.IconCombo);
/***/ }),
/* 1109 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2017/12/13.
*/
Demo.IconTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.icon_text_value_combo",
text: "默认值",
// defaultIconCls: "next-page-h-font",
width: 300,
items: [{
text: "MVC-1",
iconCls: "close-font",
value: 1
}, {
text: "MVC-2",
iconCls: "date-font",
value: 2
}, {
text: "MVC-3",
iconCls: "search-close-h-font",
value: 3
}]
}],
vgap: 20
};
}
});
BI.shortcut("demo.icon_text_value_combo", Demo.IconTextValueCombo);
/***/ }),
/* 1110 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2018/2/4.
*/
Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var combo, searchCombo;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.search_text_value_combo",
ref: function () {
combo = this;
},
warningTitle: "111",
text: "默认值",
value: 14,
width: 300,
items: [{
text: "ABC-1",
iconCls: "date-font",
value: 1
}, {
text: "BCD-2",
iconCls: "search-font",
value: 2
}, {
text: "CDE-3",
iconCls: "pull-right-font",
value: 3
}, {
text: "DEF-3",
iconCls: "pull-right-font",
value: 4
}, {
text: "FEG-3",
iconCls: "pull-right-font",
value: 5
}, {
text: "FGH-3",
iconCls: "pull-right-font",
value: 6
}, {
text: "GHI-3",
iconCls: "pull-right-font",
value: 7
}, {
text: "HIJ-3",
iconCls: "pull-right-font",
value: 8
}, {
text: "IJK-3",
iconCls: "pull-right-font",
value: 9
}, {
text: "JKL-3",
iconCls: "pull-right-font",
value: 10
}]
}, {
type: "bi.all_value_multi_text_value_combo",
items: Demo.CONSTANTS.ITEMS,
text: "提示文本",
width: 200,
value: {
type: 1,
value: ["1", "2", "柳州市城贸金属材料有限责任公司", "3"]
},
ref: function () {
searchCombo = this;
},
listeners: [{
eventName: "BI.AllValueMultiTextValueCombo.EVENT_CONFIRM",
action: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}]
}, {
type: "bi.button",
text: "setValue(3)",
width: 90,
height: 25,
handler: function () {
combo.setValue(11);
}
}, {
type: "bi.button",
text: "getValue()",
width: 90,
height: 25,
handler: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}],
vgap: 20
};
}
});
BI.shortcut("demo.search_text_value_combo", Demo.SearchTextValueCombo);
/***/ }),
/* 1111 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/11.
*/
Demo.TextValueCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var combo, wrapper;
return {
type: "bi.button_group",
items: [{
type: "bi.text_value_combo",
ref: function () {
combo = this;
},
text: "默认值",
value: 22,
width: 300,
items: [{
text: "MVC-1",
iconCls: "date-font",
value: 1
}, {
text: "MVC-2",
iconCls: "search-font",
value: 2
}, {
text: "MVC-3",
iconCls: "pull-right-font",
value: 3
}]
}, {
type: "bi.search_multi_text_value_combo",
items: Demo.CONSTANTS.ITEMS,
width: 200,
value: {
type: 1,
value: ["1", "2", "3"]
}
}, {
type: "bi.button",
width: 90,
height: 25,
handler: function () {
wrapper.populate();
}
}, {
type: 'bi.label',
height: 1000
}],
ref: function () {
wrapper = this;
},
layouts: [{
type: "bi.vertical",
vgap: 20
}]
};
}
});
BI.shortcut("demo.text_value_combo", Demo.TextValueCombo);
/***/ }),
/* 1112 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/11.
*/
Demo.TextValueDownListCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.text_value_down_list_combo",
width: 300,
ref: function (_ref) {
self.refs = _ref;
},
text: "默认值",
value: 11,
items: [[{
text: "属于",
value: 1,
cls: "dot-e-font"
}, {
text: "不属于",
value: 2,
cls: "dot-e-font"
}], [{
el: {
text: "大于",
value: 3,
iconCls1: "dot-e-font"
},
value: 3,
children: [{
text: "固定值",
value: 4,
cls: "dot-e-font"
}, {
text: "平均值",
value: 5,
cls: "dot-e-font"
}]
}]]
}, {
type: "bi.button",
width: 90,
height: 25,
text: "setValue",
handler: function () {
self.refs.setValue(2);
}
}, {
type: "bi.button",
width: 90,
height: 25,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(self.refs.getValue()));
}
}],
vgap: 20
};
}
});
BI.shortcut("demo.text_value_down_list_combo", Demo.TextValueDownListCombo);
/***/ }),
/* 1113 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/11.
*/
Demo.TextValueCheckCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.text_value_check_combo",
ref: function () {
self.combo = this;
},
text: "默认值",
//value: 1,
width: 300,
items: [{
text: "MVC-1",
value: 1
}, {
text: "MVC-2",
value: 2
}, {
text: "MVC-3",
value: 3
}]
}, {
type: "bi.button",
width: 90,
height: 25,
handler: function () {
BI.Msg.alert("", JSON.stringify(self.combo.getValue()));
}
}],
vgap: 20
};
}
});
BI.shortcut("demo.text_value_check_combo", Demo.TextValueCheckCombo);
/***/ }),
/* 1114 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
var date = new Date();
return {
type: "bi.calendar",
ref: function () {
self.calendar = this;
},
logic: {
dynamic: false
},
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
};
},
mounted: function () {
var date = new Date();
this.calendar.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
});
}
});
BI.shortcut("demo.calendar", Demo.Func);
/***/ }),
/* 1115 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.vertical",
items: BI.createItems([{
text: "bi-list-item",
cls: "bi-list-item close-font"
}, {
text: "bi-list-item-simple",
cls: "bi-list-item-simple close-font"
}, {
text: "bi-list-item-effect",
cls: "bi-list-item-effect close-font"
}, {
text: "bi-list-item-active",
cls: "bi-list-item-active close-font"
}, {
text: "bi-list-item-active2",
cls: "bi-list-item-active2 close-font"
}, {
text: "bi-list-item-select",
cls: "bi-list-item-select close-font"
}, {
text: "bi-list-item-select2",
cls: "bi-list-item-select2 close-font"
}], {
type: "bi.icon_text_item",
logic: {
dynamic: true
}
}),
vgap: 10
};
}
});
BI.shortcut("demo.click_item_effect", Demo.Func);
/***/ }),
/* 1116 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.color_chooser_popup",
cls: "bi-card"
},
left: 100,
top: 250
}, {
el: {
type: "bi.simple_color_chooser_popup",
cls: "bi-card"
},
left: 400,
top: 250
}]
};
}
});
BI.shortcut("demo.color_chooser_popup", Demo.Func);
/***/ }),
/* 1117 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.color_chooser",
width: 24,
height: 24
},
left: 100,
top: 250
}, {
el: {
type: "bi.simple_color_chooser",
width: 30,
height: 24
},
left: 400,
top: 250
}, {
el: {
type: "bi.color_chooser",
width: 230,
height: 24
},
left: 100,
top: 350
}]
};
}
});
BI.shortcut("demo.color_chooser", Demo.Func);
/***/ }),
/* 1118 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
BI.createWidget({
type: "bi.vertical",
element: this,
vgap: 20,
hgap: 30,
items: [{
type: "bi.segment",
items: [{
text: "1",
value: 1
}, {
text: "2",
value: 2
}, {
text: "3",
value: 3
}]
}]
});
}
});
BI.shortcut("demo.segment", Demo.Func);
/***/ }),
/* 1119 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/11.
*/
Demo.ClearEditor = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.clear_editor",
cls: "bi-border",
width: 300,
watermark: "这个是带清除按钮的",
value: 123
}],
vgap: 20
};
}
});
BI.shortcut("demo.clear_editor", Demo.ClearEditor);
/***/ }),
/* 1120 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/11.
*/
Demo.ClearEditor = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var editor = BI.createWidget({
type: "bi.shelter_editor",
cls: "bi-border",
validationChecker: function (v) {
return v != "a";
},
watermark: "可以设置标记的输入框",
value: "这是一个遮罩",
keyword: "z"
});
BI.createWidget({
type: "bi.vertical",
element: this,
hgap: 30,
vgap: 20,
bgap: 50,
items: [editor]
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.button",
text: "focus",
height: 25,
handler: function () {
editor.focus();
}
},
right: 10,
left: 10,
bottom: 10
}]
});
}
});
BI.shortcut("demo.shelter_editor", Demo.ClearEditor);
/***/ }),
/* 1121 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/14.
*/
Demo.SignEditor = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var editor = BI.createWidget({
type: "bi.sign_editor",
cls: "bi-border bi-focus-shadow",
validationChecker: function (v) {
return v != "abc";
},
watermark: "可以设置标记的输入框",
text: "这是一个标记,点击它即可进行输入"
});
editor.setValue(2);
BI.createWidget({
type: "bi.vertical",
element: this,
hgap: 30,
vgap: 20,
items: [editor]
});
}
});
BI.shortcut("demo.sign_editor", Demo.SignEditor);
/***/ }),
/* 1122 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/11.
*/
Demo.SimpleStateEditor = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_adapt",
items: [{
type: "bi.simple_state_editor",
ref: function () {
self.editor = this;
},
cls: "bi-border",
width: 300
}],
vgap: 20
};
},
mounted: function () {
var self = this;
setTimeout(function () {
self.editor.setState(["*", "*"]);
}, 1000);
}
});
BI.shortcut("demo.simple_state_editor", Demo.SimpleStateEditor);
/***/ }),
/* 1123 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/11.
*/
Demo.StateEditor = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_adapt",
items: [{
type: "bi.state_editor",
ref: function () {
self.editor = this;
},
cls: "bi-border",
width: 300
}],
vgap: 20
};
},
mounted: function () {
var self = this;
setTimeout(function () {
self.editor.setState(["*", "*"]);
}, 1000);
}
});
BI.shortcut("demo.state_editor", Demo.StateEditor);
/***/ }),
/* 1124 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.label",
height: 30,
text: "复选item"
}, {
type: "bi.multi_select_item",
text: "复选项"
}],
hgap: 300
};
}
});
BI.shortcut("demo.multi_select_item", Demo.Func);
/***/ }),
/* 1125 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/25.
*/
Demo.Items = BI.inherit(BI.Widget, {
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.label",
height: 30,
text: "单选item"
}, {
type: "bi.single_select_item",
text: "单选项"
}],
hgap: 300
};
}
});
BI.shortcut("demo.single_select_item", Demo.Items);
/***/ }),
/* 1126 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/25.
*/
Demo.Items = BI.inherit(BI.Widget, {
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.label",
height: 30,
text: "单选item"
}, {
type: "bi.single_select_radio_item",
text: "单选项"
}],
hgap: 300
};
}
});
BI.shortcut("demo.single_select_radio_item", Demo.Items);
/***/ }),
/* 1127 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
BI.createWidget({
type: "bi.lazy_loader",
element: this,
el: {
layouts: [{
type: "bi.left",
hgap: 5
}]
},
items: BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), {
type: "bi.button"
})
});
}
});
BI.shortcut("demo.lazy_loader", Demo.Func);
/***/ }),
/* 1128 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
BI.createWidget({
type: "bi.select_list",
toolbar: {
type: "bi.multi_select_bar",
iconWrapperWidth: 26
},
element: this,
el: {
el: {
chooseType: BI.Selection.Multi
}
},
items: BI.createItems(BI.deepClone(Demo.CONSTANTS.SIMPLE_ITEMS), {
type: "bi.multi_select_item"
})
});
}
});
BI.shortcut("demo.select_list", Demo.Func);
/***/ }),
/* 1129 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
BI.createWidget({
type: "bi.vertical",
hgap: 200,
vgap: 50,
element: this,
items: [{
type: "bi.label",
height: 30,
text: " (测试条件:总页数为3)"
}, {
type: "bi.all_count_pager",
pages: 3,
curr: 1,
count: 1000
}]
});
}
});
BI.shortcut("demo.all_count_pager", Demo.Func);
/***/ }),
/* 1130 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
mounted: function () {
this.pager.populate();
},
render: function () {
var self = this;
BI.createWidget({
type: "bi.vertical",
hgap: 200,
vgap: 50,
element: this,
items: [{
type: "bi.direction_pager",
ref: function (_ref) {
self.pager = _ref;
},
horizontal: {
pages: false, // 总页数
curr: 1, // 初始化当前页, pages为数字时可用
hasPrev: function (v) {
return v > 1;
},
hasNext: function () {
return true;
},
firstPage: 1
},
vertical: {
pages: false, // 总页数
curr: 1, // 初始化当前页, pages为数字时可用
hasPrev: function (v) {
return v > 1;
},
hasNext: function () {
return true;
},
firstPage: 1
}
}]
});
}
});
BI.shortcut("demo.direction_pager", Demo.Func);
/***/ }),
/* 1131 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.list_pane",
ref: function () {
self.pane = this;
},
itemsCreator: function (op, callback) {
setTimeout(function () {
callback(BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), {
type: "bi.multi_select_item",
height: 25
}));
}, 2000);
},
el: {
type: "bi.button_group",
layouts: [{
type: "bi.vertical"
}]
}
};
},
mounted: function () {
this.pane.populate();
}
});
BI.shortcut("demo.list_pane", Demo.Func);
/***/ }),
/* 1132 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
width: 200,
height: 30,
el: {
type: "bi.text_button",
text: "点击",
cls: "bi-border",
height: 30
},
popup: {
type: "bi.multi_popup_view",
el: {
type: "bi.button_group",
layouts: [{
type: "bi.vertical"
}],
items: BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), {
type: "bi.multi_select_item",
height: 25
})
}
}
}
}]
};
}
});
BI.shortcut("demo.multi_popup_view", Demo.Func);
/***/ }),
/* 1133 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.panel",
title: "title",
titleButtons: [{
type: "bi.button",
text: "操作"
}],
el: {
type: "bi.button_group",
layouts: [{
type: "bi.vertical"
}],
items: BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), {
type: "bi.multi_select_item",
height: 25
})
}
};
}
});
BI.shortcut("demo.panel", Demo.Func);
/***/ }),
/* 1134 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
width: 200,
height: 30,
el: {
type: "bi.text_button",
text: "点击",
cls: "bi-border",
height: 30
},
popup: {
type: "bi.popup_panel",
el: {
type: "bi.button_group",
layouts: [{
type: "bi.vertical"
}],
items: BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), {
type: "bi.multi_select_item",
height: 25
})
}
}
}
}]
};
}
});
BI.shortcut("demo.popup_panel", Demo.Func);
/***/ }),
/* 1135 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var tree = BI.createWidget({
type: "bi.display_tree",
element: this
});
tree.initTree([{
id: 1,
text: "第一项",
open: true
}, {
id: 2,
text: "第二项"
}, {
id: 11,
pId: 1,
text: "子项1(共2个)",
open: true
}, {
id: 111,
pId: 11,
text: "子子项1"
}, {
id: 112,
pId: 11,
text: "子子项2"
}, {
id: 12,
pId: 1,
text: "子项2"
}, {
id: 13,
pId: 1,
text: "子项3"
}]);
}
});
BI.shortcut("demo.display_tree", Demo.Func);
/***/ }),
/* 1136 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var tree = BI.createWidget({
type: "bi.level_tree",
chooseType: 0,
items: [{
id: 1,
text: "第一项",
value: 1,
isParent: true
}, {
id: 2,
text: "第二项",
value: 2,
isParent: true
}, {
id: 3,
text: "第三项",
value: 1,
isParent: true,
open: true
}, {
id: 4,
text: "第四项",
value: 1
}, {
id: 11,
pId: 1,
text: "子项1",
value: 11
}, {
id: 12,
pId: 1,
text: "子项2",
value: 12
}, {
id: 13,
pId: 1,
text: "子项3",
value: 13
}, {
id: 21,
pId: 2,
text: "子项1",
value: 21
}, {
id: 31,
pId: 3,
text: "子项1",
value: 31
}, {
id: 32,
pId: 3,
text: "子项2",
value: 32
}, {
id: 33,
pId: 3,
text: "子项3",
value: 33
}]
});
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: tree
}, {
height: 30,
el: {
type: "bi.button",
height: 30,
text: "getValue",
handler: function () {
BI.Msg.alert("", tree.getValue());
}
}
}]
});
}
});
BI.shortcut("demo.level_tree", Demo.Func);
/***/ }),
/* 1137 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
// value值一定要是字符串
var tree = BI.createWidget({
type: "bi.simple_tree",
items: [{
id: 1,
text: "第一项",
value: "1"
}, {
id: 2,
text: "第二项",
value: "2"
}, {
id: 3,
text: "第三项",
value: "3",
open: true
}, {
id: 11,
pId: 1,
text: "子项1",
value: "11"
}, {
id: 12,
pId: 1,
text: "子项2",
value: "12"
}, {
id: 13,
pId: 1,
text: "子项3",
value: "13"
}, {
id: 31,
pId: 3,
text: "子项1",
value: "31"
}, {
id: 32,
pId: 3,
text: "子项2",
value: "32"
}, {
id: 33,
pId: 3,
text: "子项3",
value: "33"
}],
value: ["31", "32", "33"]
});
// tree.populate([{
// id: 1,
// text: "第一项",
// value: "1"
// }, {
// id: 2,
// text: "第二项",
// value: "2"
// }, {
// id: 3,
// text: "第三项",
// value: "3",
// open: true
// }, {
// id: 11,
// pId: 1,
// text: "子项1",
// value: "11"
// }, {
// id: 12,
// pId: 1,
// text: "子项2",
// value: "12"
// }, {
// id: 13,
// pId: 1,
// text: "子项3",
// value: "13"
// }, {
// id: 31,
// pId: 3,
// text: "子项1",
// value: "31"
// }, {
// id: 32,
// pId: 3,
// text: "子项2",
// value: "32"
// }, {
// id: 33,
// pId: 3,
// text: "子项3",
// value: "33"
// }], "z");
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: tree
}, {
height: 30,
el: {
type: "bi.button",
height: 30,
text: "setValue(['31', '32', '33'])",
handler: function () {
tree.setValue(["31", "32", "33"]);
}
}
}, {
height: 30,
el: {
type: "bi.button",
height: 30,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(tree.getValue()));
}
}
}]
});
}
});
BI.shortcut("demo.simple_tree", Demo.Func);
/***/ }),
/* 1138 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
BI.createWidget({
type: "bi.vertical",
element: this,
items: [{
type: "bi.label",
text: "输入框加图标的trigger"
}, {
type: "bi.editor_trigger",
watermark: "这是水印",
width: 200,
height: 24
}],
hgap: 20,
vgap: 20
});
}
});
BI.shortcut("demo.editor_trigger", Demo.Func);
/***/ }),
/* 1139 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
BI.createWidget({
type: "bi.vertical",
element: this,
items: [{
type: "bi.label",
text: "只有一个图标的trigger"
}, {
type: "bi.icon_trigger",
width: 30,
height: 24
}],
hgap: 20,
vgap: 20
});
}
});
BI.shortcut("demo.icon_trigger", Demo.Func);
/***/ }),
/* 1140 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
BI.createWidget({
type: "bi.vertical",
element: this,
items: [{
type: "bi.label",
text: "可被选择的trigger"
}, {
type: "bi.select_text_trigger",
text: "这是一个简单的trigger",
width: 200,
height: 24
}],
hgap: 20,
vgap: 20
});
}
});
BI.shortcut("demo.select_text_trigger", Demo.Func);
/***/ }),
/* 1141 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
BI.createWidget({
type: "bi.vertical",
element: this,
items: [{
type: "bi.label",
text: "文本加图标的trigger"
}, {
type: "bi.text_trigger",
text: "这是一个简单的trigger",
width: 200,
height: 24
}],
hgap: 20,
vgap: 20
});
}
});
BI.shortcut("demo.text_trigger", Demo.Func);
/***/ }),
/* 1142 */
/***/ (function(module, exports) {
Demo.Center = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-center"
},
render: function () {
var self = this;
return {
type: "bi.tab",
ref: function () {
self.tab = this;
},
single: true,
showIndex: Demo.showIndex,
cardCreator: function (v) {
return BI.createWidget({
type: v
});
}
};
},
setValue: function (v) {
this.tab.setSelect(v);
}
});
BI.shortcut("demo.center", Demo.Center);
/***/ }),
/* 1143 */
/***/ (function(module, exports) {
Demo.TreeValueChooser = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-tree-value-chooser-combo"
},
render: function () {
var widget = BI.createWidget({
type: "bi.tree_value_chooser_combo",
width: 300,
// items: BI.deepClone(Demo.CONSTANTS.TREEITEMS),
itemsCreator: function (op, callback) {
callback(BI.deepClone(Demo.CONSTANTS.TREEITEMS));
}
});
return {
type: "bi.vertical",
hgap: 200,
vgap: 10,
items: [widget]
};
}
});
BI.shortcut("demo.tree_value_chooser_combo", Demo.TreeValueChooser);
/***/ }),
/* 1144 */
/***/ (function(module, exports) {
Demo.TreeValueChooser = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-tree-value-chooser"
},
render: function () {
return {
type: "bi.tree_value_chooser_pane",
items: BI.deepClone(Demo.CONSTANTS.TREEITEMS)
// itemsCreator: function (op, callback) {
// callback(tree);
// }
};
}
});
BI.shortcut("demo.tree_value_chooser_pane", Demo.TreeValueChooser);
/***/ }),
/* 1145 */
/***/ (function(module, exports) {
Demo.ValueChooserCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-value-chooser-combo"
},
render: function () {
var widget = BI.createWidget({
type: "bi.value_chooser_combo",
itemsCreator: function (op, callback) {
callback(BI.deepClone(Demo.CONSTANTS.ITEMS));
}
});
return {
type: "bi.vertical",
hgap: 200,
vgap: 10,
items: [widget]
};
}
});
BI.shortcut("demo.value_chooser_combo", Demo.ValueChooserCombo);
/***/ }),
/* 1146 */
/***/ (function(module, exports) {
Demo.ValueChooserPane = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-value-chooser-pane"
},
render: function () {
return {
type: "bi.value_chooser_pane",
items: BI.deepClone(Demo.CONSTANTS.ITEMS)
// itemsCreator: function (op, callback) {
// callback(BI.deepClone(Demo.CONSTANTS.ITEMS));
// }
};
}
});
BI.shortcut("demo.value_chooser_pane", Demo.ValueChooserPane);
/***/ }),
/* 1147 */
/***/ (function(module, exports) {
Demo.BASE_CONFIG = [{
id: 2,
text: "基础控件",
open: false
}, {
pId: 2,
text: "bi.label",
value: "demo.label"
},{
pId: 2,
text: "bi.label_scene",
value: "demo.label_scene"
}, {
pId: 2,
text: "bi.icon_label",
value: "demo.icon_label"
}, {
pId: 2,
text: "bi.html",
value: "demo.html"
}, {
pId: 2,
text: "title提示",
value: "demo.title"
}, {
pId: 2,
text: "气泡提示",
value: "demo.bubble"
}, {
pId: 2,
text: "toast提示",
value: "demo.toast"
}, {
pId: 2,
id: 201,
text: "button"
}, {
pId: 201,
text: "bi.button",
value: "demo.button"
}, {
pId: 201,
text: "bi.text_button",
value: "demo.text_button"
}, {
pId: 201,
text: "bi.icon_button",
value: "demo.icon_button"
}, {
pId: 201,
text: "bi.image_button",
value: "demo.image_button"
}, {
pId: 2,
id: 202,
text: "editor"
}, {
pId: 202,
text: "bi.editor",
value: "demo.editor"
}, {
pId: 202,
text: "bi.multifile_editor",
value: "demo.multifile_editor"
}, {
pId: 202,
text: "bi.textarea_editor",
value: "demo.textarea_editor"
}, {
pId: 2,
id: 203,
text: "tree"
}, {
pId: 203,
text: "bi.tree_view",
value: "demo.tree_view"
}, {
pId: 203,
text: "bi.async_tree",
value: "demo.sync_tree"
}, {
pId: 203,
text: "bi.part_tree",
value: "demo.part_tree"
}, {
pId: 2,
text: "bi.pager",
value: "demo.pager"
}];
/***/ }),
/* 1148 */
/***/ (function(module, exports) {
Demo.CASE_CONFIG = [{
id: 3,
text: "实例控件",
open: false
}, {
pId: 3,
id: 300,
text: "按钮"
}, {
pId: 300,
text: "bi.multi_select_item",
value: "demo.multi_select_item"
}, {
pId: 300,
text: "bi.single_select_item",
value: "demo.single_select_item"
}, {
pId: 300,
text: "bi.single_select_radio_item",
value: "demo.single_select_radio_item"
}, {
pId: 3,
id: 301,
text: "editors"
}, {
pId: 301,
text: "bi.shelter_editor",
value: "demo.shelter_editor"
}, {
pId: 301,
text: "bi.sign_editor",
value: "demo.sign_editor"
}, {
pId: 301,
text: "bi.state_editor",
value: "demo.state_editor"
}, {
pId: 301,
text: "bi.simple_state_editor",
value: "demo.simple_state_editor"
}, {
pId: 301,
text: "bi.clear_editor",
value: "demo.clear_editor"
}, {
pId: 3,
id: 302,
text: "列表"
}, {
pId: 302,
text: "bi.select_list",
value: "demo.select_list"
}, {
pId: 302,
text: "bi.lazy_loader",
value: "demo.lazy_loader"
}, {
pId: 3,
id: 303,
text: "面板"
}, {
pId: 303,
text: "bi.list_pane",
value: "demo.list_pane"
}, {
pId: 303,
text: "bi.panel",
value: "demo.panel"
}, {
pId: 3,
id: 304,
text: "popup弹出层"
}, {
pId: 304,
text: "bi.multi_popup_view",
value: "demo.multi_popup_view"
}, {
pId: 304,
text: "bi.popup_panel",
value: "demo.popup_panel"
}, {
pId: 3,
id: 305,
text: "触发器trigger"
}, {
pId: 305,
text: "bi.editor_trigger",
value: "demo.editor_trigger"
}, {
pId: 305,
text: "bi.icon_trigger",
value: "demo.icon_trigger"
}, {
pId: 305,
text: "bi.text_trigger",
value: "demo.text_trigger"
}, {
pId: 305,
text: "bi.select_text_trigger",
value: "demo.select_text_trigger"
}, {
pId: 3,
id: 306,
text: "combo"
}, {
pId: 306,
text: "bi.bubble_combo",
value: "demo.bubble_combo"
}, {
pId: 306,
text: "bi.icon_combo",
value: "demo.icon_combo"
}, {
pId: 306,
text: "bi.text_value_combo",
value: "demo.text_value_combo"
}, {
pId: 306,
text: "bi.search_text_value_combo",
value: "demo.search_text_value_combo"
}, {
pId: 306,
text: "bi.icon_text_value_combo",
value: "demo.icon_text_value_combo"
}, {
pId: 306,
text: "bi.text_value_check_combo",
value: "demo.text_value_check_combo"
}, {
pId: 306,
text: "bi.editor_icon_check_combo",
value: "demo.editor_icon_check_combo"
}, {
pId: 306,
text: "bi.text_value_down_list_combo",
value: "demo.text_value_down_list_combo"
}, {
pId: 3,
id: 307,
text: "tree"
}, {
pId: 307,
text: "bi.display_tree",
value: "demo.display_tree"
}, {
pId: 307,
text: "bi.simple_tree",
value: "demo.simple_tree"
}, {
pId: 307,
text: "bi.level_tree",
value: "demo.level_tree"
}, {
pId: 3,
id: 309,
text: "pager"
}, {
pId: 309,
text: "bi.all_count_pager",
value: "demo.all_count_pager"
}, {
pId: 309,
text: "bi.direction_pager",
value: "demo.direction_pager"
}, {
pId: 3,
text: "bi.calendar",
value: "demo.calendar"
}, {
pId: 3,
text: "bi.color_chooser",
value: "demo.color_chooser"
}, {
pId: 3,
text: "bi.color_chooser_popup",
value: "demo.color_chooser_popup"
}, {
pId: 3,
text: "bi.segment",
value: "demo.segment"
}, {
pId: 3,
text: "点击项样式查看",
value: "demo.click_item_effect"
}];
/***/ }),
/* 1149 */
/***/ (function(module, exports) {
Demo.CATEGORY_CONFIG = [{
id: 100000,
text: "专题"
}, {
pId: 100000,
text: "可以排序的树",
value: "demo.sort_tree"
}];
/***/ }),
/* 1150 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.COMPONENT_CONFIG = [{
id: 5,
text: "部件+服务"
}, {
pId: 5,
text: "bi.value_chooser_combo",
value: "demo.value_chooser_combo"
}, {
pId: 5,
text: "bi.value_chooser_pane",
value: "demo.value_chooser_pane"
}, {
pId: 5,
text: "bi.tree_value_chooser_combo",
value: "demo.tree_value_chooser_combo"
}, {
pId: 5,
text: "bi.tree_value_chooser_pane",
value: "demo.tree_value_chooser_pane"
}];
/***/ }),
/* 1151 */
/***/ (function(module, exports) {
Demo.CORE_CONFIG = [{
id: 1,
text: "核心控件"
}, {
id: 101,
pId: 1,
text: "布局"
}, {
pId: 101,
text: "bi.absolute",
value: "demo.absolute"
}, {
pId: 101,
text: "bi.center_adapt",
value: "demo.center_adapt"
}, {
pId: 101,
text: "bi.vertical_adapt",
value: "demo.vertical_adapt"
}, {
pId: 101,
text: "bi.horizontal_adapt",
value: "demo.horizontal_adapt"
}, {
pId: 101,
text: "bi.horizontal_auto",
value: "demo.horizontal_auto"
}, {
pId: 101,
text: "bi.horizontal_float",
value: "demo.horizontal_float"
}, {
pId: 101,
text: "bi.left_right_vertical_adapt",
value: "demo.left_right_vertical_adapt"
}, {
pId: 101,
text: "bi.center",
value: "demo.center_layout"
}, {
pId: 101,
text: "bi.float_center",
value: "demo.float_center"
}, {
pId: 101,
text: "bi.vertical",
value: "demo.vertical"
}, {
pId: 101,
text: "bi.horizontal",
value: "demo.horizontal"
}, {
pId: 101,
text: "bi.border",
value: "demo.border"
}, {
pId: 101,
text: "bi.left, bi.right",
value: "demo.flow"
}, {
pId: 101,
text: "bi.htape",
value: "demo.htape"
}, {
pId: 101,
text: "bi.vtape",
value: "demo.vtape"
}, {
pId: 101,
text: "bi.grid",
value: "demo.grid"
}, {
pId: 101,
text: "bi.table",
value: "demo.table_layout"
}, {
pId: 101,
text: "bi.td",
value: "demo.td"
}, {
pId: 101,
text: "..."
}, {
pId: 1,
id: 102,
text: "抽象控件"
}, {
pId: 102,
text: "bi.button_group",
value: "demo.button_group"
}, {
pId: 102,
text: "bi.button_tree",
value: "demo.button_tree"
}, {
pId: 102,
text: "bi.virtual_group",
value: "demo.virtual_group"
}, {
pId: 102,
text: "bi.custom_tree",
value: "demo.custom_tree"
}, {
pId: 102,
text: "bi.grid_view",
value: "demo.grid_view"
}, {
pId: 102,
text: "bi.collection_view",
value: "demo.collection_view"
}, {
pId: 102,
text: "bi.list_view",
value: "demo.list_view"
}, {
pId: 102,
text: "bi.virtual_list",
value: "demo.virtual_list"
}, {
pId: 102,
id: 10201,
text: "组合控件"
}, {
pId: 10201,
text: "bi.combo",
value: "demo.combo"
}, {
pId: 10201,
text: "bi.combo(各种位置)",
value: "demo.combo2"
}, {
pId: 10201,
text: "bi.combo(內部位置)",
value: "demo.combo3"
}, {
pId: 10201,
text: "bi.expander",
value: "demo.expander"
}, {
pId: 10201,
text: "bi.combo_group",
value: "demo.combo_group"
}, {
pId: 10201,
text: "bi.loader",
value: "demo.loader"
}, {
pId: 10201,
text: "bi.navigation",
value: "demo.navigation"
}, {
pId: 10201,
text: "bi.searcher",
value: "demo.searcher"
}, {
pId: 10201,
text: "bi.switcher",
value: "demo.switcher"
}, {
pId: 10201,
text: "bi.tab",
value: "demo.tab"
}, {
pId: 102,
id: 10202,
text: "弹出层"
}, {
pId: 10202,
text: "layer",
value: "demo.layer"
}, {
pId: 10202,
text: "bi.popover",
value: "demo.popover"
}, {
pId: 10202,
text: "bi.popup_view",
value: "demo.popup_view"
}, {
pId: 10202,
text: "bi.searcher_view",
value: "demo.searcher_view"
}, {
pId: 1,
text: "Widget(继承)",
value: "demo.widget"
}, {
pId: 1,
text: "Single(继承)",
value: "demo.single"
}, {
pId: 1,
text: "BasicButton(继承)",
value: "demo.basic_button"
}, {
pId: 1,
text: "NodeButton(继承)",
value: "demo.node_button"
}, {
pId: 1,
text: "Pane(继承)",
value: "demo.pane"
}];
/***/ }),
/* 1152 */
/***/ (function(module, exports) {
/**
* author: young
* createdDate: 2018/11/30
* description:
*/
!(function () {
var Pane = BI.inherit(BI.LoadingPane, {
props: {
},
render: function () {
return {
type: "bi.center_adapt",
items: [{
type: "bi.label",
text: "this is pane center"
}]
};
},
beforeInit: function (callback) {
setTimeout(function () {
callback();
}, 3000);
}
});
BI.shortcut("demo.pane", Pane);
})();
/***/ }),
/* 1153 */
/***/ (function(module, exports) {
Demo.FIX_CONFIG = [{
id: 7,
text: "数据流框架fix-2.0"
}, {
id: 71,
pId: 7,
text: "定义响应式数据",
value: "demo.fix_define"
}, {
id: 72,
pId: 7,
text: "state属性",
value: "demo.fix_state"
}, {
id: 73,
pId: 7,
text: "计算属性",
value: "demo.fix_computed"
}, {
id: 74,
pId: 7,
text: "store",
value: "demo.fix_store"
}, {
id: 75,
pId: 7,
text: "watcher且或表达式",
value: "demo.fix_watcher"
}, {
id: 76,
pId: 7,
text: "watcher星号表达式",
value: "demo.fix_global_watcher"
}, {
id: 77,
pId: 7,
text: "context",
value: "demo.fix_context"
}, {
id: 78,
pId: 7,
text: "一个混合的例子",
value: "demo.fix"
}, {
id: 79,
pId: 7,
text: "场景",
value: "demo.fix_scene"
}];
/***/ }),
/* 1154 */
/***/ (function(module, exports) {
Demo.WIDGET_CONFIG = [{
id: 4,
text: "详细控件",
open: true
}, {
pId: 4,
id: 401,
text: "各种小控件"
}, {
pId: 401,
text: "各种通用按钮",
value: "demo.buttons"
}, {
pId: 401,
text: "各种提示性信息",
value: "demo.tips"
}, {
pId: 401,
text: "各种items",
value: "demo.items"
}, {
pId: 401,
text: "各种节点node",
value: "demo.nodes"
}, {
pId: 401,
text: "各种segment",
value: "demo.segments"
}, {
pId: 4,
id: 402,
text: "文本框控件"
}, {
pId: 402,
text: "bi.text_editor",
value: "demo.text_editor"
}, {
pId: 402,
text: "bi.search_editor",
value: "demo.search_editor"
}, {
pId: 402,
text: "bi.number_editor",
value: "demo.number_editor"
}, {
pId: 4,
id: 403,
text: "tree"
}, {
pId: 403,
text: "bi.single_level_tree",
value: "demo.single_level_tree"
}, {
pId: 403,
text: "bi.select_level_tree",
value: "demo.select_level_tree"
}, {
pId: 403,
text: "bi.multilayer_single_level_tree",
value: "demo.multilayer_single_level_tree"
}, {
pId: 403,
text: "bi.multilayer_select_level_tree",
value: "demo.multilayer_select_level_tree"
}, {
pId: 4,
id: 405,
text: "下拉列表"
}, {
pId: 405,
text: "bi.down_list_combo",
value: "demo.down_list"
}, {
pId: 4,
id: 421,
text: "单选下拉框"
}, {
pId: 421,
text: "bi.single_select_combo",
value: "demo.single_select_combo"
}, {
pId: 4,
id: 406,
text: "复选下拉框"
}, {
pId: 406,
text: "bi.multi_select_combo",
value: "demo.multi_select_combo"
}, {
pId: 406,
text: "bi.multi_select_list",
value: "demo.multi_select_list"
}, {
pId: 4,
id: 407,
text: "简单下拉树"
}, {
pId: 407,
text: "bi.single_tree_combo",
value: "demo.single_tree_combo"
}, {
pId: 4,
id: 408,
text: "多层级下拉树"
}, {
pId: 408,
text: "bi.multilayer_single_tree_combo",
value: "demo.multilayer_single_tree_combo"
}, {
pId: 4,
id: 409,
text: "可选下拉树"
}, {
pId: 409,
text: "bi.select_tree_combo",
value: "demo.select_tree_combo"
}, {
pId: 4,
id: 410,
text: "多层级可选下拉树"
}, {
pId: 410,
text: "bi.multilayer_select_tree_combo",
value: "demo.multilayer_select_tree_combo"
}, {
pId: 4,
id: 411,
text: "复选下拉树"
}, {
pId: 411,
text: "bi.multi_tree_combo",
value: "demo.multi_tree_combo"
}, {
pId: 411,
text: "bi.multi_select_tree",
value: "demo.multi_select_tree"
}, {
pId: 4,
id: 412,
text: "日期相关控件"
}, {
pId: 412,
text: "bi.year_combo",
value: "demo.year"
}, {
pId: 412,
text: "bi.year_month_combo",
value: "demo.year_month_combo"
}, {
pId: 412,
text: "bi.year_quarter_combo",
value: "demo.year_quarter_combo"
}, {
pId: 412,
text: "bi.date_pane",
value: "demo.date_pane"
}, {
pId: 412,
text: "bi.multidate_combo",
value: "demo.multidate_combo"
}, {
pId: 412,
text: "bi.date_time",
value: "demo.date_time"
}, {
pId: 412,
text: "bi.time_combo",
value: "demo.time_combo"
}, {
pId: 412,
text: "bi.time_interval",
value: "demo.time_interval"
}, {
pId: 412,
text: "bi.year_month_interval",
value: "demo.year_month_interval"
}, {
pId: 4,
id: 413,
text: "数值区间控件"
}, {
pId: 413,
text: "bi.number_interval",
value: "demo.number_interval"
}, {
id: 420,
text: "滚动sliders",
value: "demo.slider"
}];
/***/ }),
/* 1155 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
child: [{
type: "bi.combo_group",
el: {
type: "bi.icon_text_icon_item",
text: "2010年",
value: 2010,
height: 25,
iconCls: "close-ha-font"
},
children: [{
type: "bi.single_select_item",
height: 25,
text: "一月",
value: 11
}, {
type: "bi.icon_text_icon_item",
height: 25,
text: "二月",
value: 12,
children: [{type: "bi.single_select_item", text: "一号", value: 101, height: 25}]
}]
}, {
text: "2011年", value: 2011
}, {
text: "2012年", value: 2012, iconCls: "close-ha-font"
}, {
text: "2013年", value: 2013
}, {
text: "2014年", value: 2014, iconCls: "close-ha-font"
}, {
text: "2015年", value: 2015, iconCls: "close-ha-font"
}],
_createBottom: function () {
var childCombo = BI.createWidget({
type: "bi.combo",
el: {
type: "bi.text_button",
cls: "button-combo",
height: 30
},
popup: {
el: {
type: "bi.button_tree",
items: BI.createItems(BI.deepClone(this.child), {
type: "bi.single_select_item",
height: 25,
handler: function (v) {
}
}),
layouts: [{
type: "bi.vertical"
}]
}
},
width: 200
});
childCombo.setValue(BI.deepClone(this.child)[0].children[0].value);
return BI.createWidget({
type: "bi.left",
items: [childCombo],
hgap: 20,
vgap: 20
});
},
render: function () {
return {
type: "bi.grid",
columns: 1,
rows: 1,
items: [{
column: 0,
row: 0,
el: this._createBottom()
}]
};
}
});
BI.shortcut("demo.combo_group", Demo.Func);
/***/ }),
/* 1156 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
years: [{
text: "2010年", value: 2010, iconCls: "close-ha-font"
}, {
text: "2011年", value: 2011
}, {
text: "2012年", value: 2012, iconCls: "close-ha-font"
}, {
text: "2013年", value: 2013
}, {
text: "2014年", value: 2014, iconCls: "close-ha-font"
}, {
text: "2015年", value: 2015, iconCls: "close-ha-font"
}, {
text: "2016年", value: 2016, iconCls: "close-ha-font"
}, {
text: "2017年", value: 2017, iconCls: "close-ha-font"
}],
child: [{
type: "bi.combo_group",
el: {
type: "bi.icon_text_icon_item",
text: "2010年",
value: 2010,
height: 25,
iconCls: "close-ha-font"
},
children: [{
type: "bi.single_select_item",
height: 25,
text: "一月",
value: 11
}, {
type: "bi.icon_text_icon_item",
height: 25,
text: "二月",
value: 12,
children: [{type: "bi.single_select_item", text: "一号", value: 101, height: 25}]
}]
}, {
text: "2011年", value: 2011
}, {
text: "2012年", value: 2012, iconCls: "close-ha-font"
}, {
text: "2013年", value: 2013
}, {
text: "2014年", value: 2014, iconCls: "close-ha-font"
}, {
text: "2015年", value: 2015, iconCls: "close-ha-font"
}],
months: [[{
el: {
text: "一月", value: 1
}
}, {
el: {
text: "二月", value: 2
}
}], [{
el: {
text: "三月", value: 3
}
}, {
el: {
text: "四月", value: 4
}
}], [{
el: {
text: "五月", value: 5
}
}, {
el: {
text: "六月", value: 6
}
}], [{
el: {
text: "七月", value: 7
}
}, {
el: {
text: "八月", value: 8
}
}], [{
el: {
text: "九月", value: 9
}
}, {
el: {
text: "十月", value: 10
}
}], [{
el: {
text: "十一月", value: 11
}
}, {
el: {
text: "十二月", value: 12
}
}]],
dynamic: [
{
text: "2010年", value: 1
}, {
text: "20112222年", value: 2
}, {
text: "201233333年", value: 3
}, {
text: "2013年", value: 4
}, {
text: "2012324年", value: 5
}, {
text: "2015年", value: 6
}, {
text: "2016年", value: 7
}, {
text: "201744444444444444444444444444444444444年", value: 8
}
],
week: [{
text: "周一", value: 100, iconClsLeft: "close-ha-font", iconClsRight: "close-font"
}, {
text: "周二", value: 101, iconClsLeft: "close-ha-font"
}, {
text: "周三", value: 102
}, {
text: "周四", value: 103, iconClsRight: "close-ha-font"
}, {
text: "周五", value: 104, iconClsLeft: "close-ha-font", iconClsRight: "close-font"
}, {
text: "周六", value: 105, iconClsLeft: "close-font", iconClsRight: "close-ha-font"
}, {
text: "周日", value: 106, iconClsLeft: "close-font"
}],
_createTop: function () {
var self = this;
var yearCombo = BI.createWidget({
type: "bi.combo",
el: {
type: "bi.button",
text: "简单下拉框",
height: 30
},
popup: {
el: {
type: "bi.button_group",
items: BI.createItems(BI.deepClone(this.years), {
type: "bi.single_select_radio_item",
height: 25,
handler: function (v) {
}
}),
layouts: [{
type: "bi.vertical"
}]
}
},
width: 200
});
var multiCombo = BI.createWidget({
type: "bi.combo",
el: {
type: "bi.button",
text: "多选下拉框",
height: 30
},
popup: {
el: {
items: BI.createItems(BI.deepClone(this.years), {
type: "bi.multi_select_item",
height: 25,
handler: function (v) {
}
}),
chooseType: 1,
layouts: [{
type: "bi.vertical"
}]
},
tool: {
type: "bi.label",
text: "这是一个下拉框",
height: 35
},
tabs: [{
type: "bi.multi_select_bar",
height: 25,
text: "全选",
onCheck: function (v) {
if (v) {
multiCombo.setValue(BI.map(BI.deepClone(self.years), "value"));
} else {
multiCombo.setValue([]);
}
},
isAllCheckedBySelectedValue: function (selectedValue) {
return selectedValue.length == self.years.length;
// return true;
}
}],
buttons: [{
type: "bi.text_button",
text: "清空",
handler: function () {
multiCombo.setValue([]);
}
}, {
type: "bi.text_button",
text: "确定",
handler: function () {
BI.Msg.alert("", multiCombo.getValue());
}
}]
},
width: 200
});
var dynamicPopupCombo = BI.createWidget({
type: "bi.combo",
isNeedAdjustWidth: false,
offsetStyle: "center",
el: {
type: "bi.button",
text: "动态调整宽度",
height: 30
},
popup: {
el: {
items: BI.createItems(BI.deepClone(this.dynamic), {
type: "bi.single_select_item",
height: 25
}),
layouts: [{
type: "bi.vertical"
}]
}
},
width: 200
});
var dynamicCombo = BI.createWidget({
type: "bi.combo",
el: {
type: "bi.button",
text: "搜索",
height: 30
},
popup: {
el: {
type: "bi.loader",
logic: {
dynamic: true,
scrolly: true
},
el: {
behaviors: {
redmark: function () {
return true;
}
},
layouts: [{
type: "bi.vertical"
}]
},
itemsCreator: function (options, popuplate) {
var times = options.times;
BI.delay(function () {
if (times == 3) {
popuplate([{
type: "bi.single_select_item",
text: "这是最后一个",
value: "这是最后一个",
py: "zszhyg",
height: 25
}]);
return;
}
var map = BI.map(BI.makeArray(3, null), function (i, v) {
var val = i + "_" + BI.random(1, 100);
return {
type: "bi.single_select_item",
text: val,
value: val,
height: 25
};
});
popuplate(map);
}, 1000);
},
hasNext: function (options) {
return options.times < 3;
}
},
buttons: [{
type: "bi.text_button",
text: "清空",
handler: function () {
dynamicCombo.setValue([]);
}
}, {
type: "bi.text_button",
text: "确定",
handler: function () {
BI.Msg.alert("", dynamicCombo.getValue());
}
}]
},
width: 200
});
return BI.createWidget({
type: "bi.left",
items: [yearCombo, multiCombo, dynamicPopupCombo, dynamicCombo],
hgap: 20,
vgap: 20
});
},
_createBottom: function () {
var combo = BI.createWidget({
type: "bi.combo",
el: {
type: "bi.text_button",
cls: "button-combo",
height: 30
},
popup: {
el: {
type: "bi.button_group",
items: BI.createItems(BI.deepClone(this.years), {
type: "bi.single_select_item",
iconWidth: 25,
height: 25,
handler: function (v) {
}
}),
chooseType: 1,
layouts: [{
type: "bi.vertical"
}]
}
},
width: 200
});
combo.setValue(BI.deepClone(this.years)[0].value);
var childCombo = BI.createWidget({
type: "bi.combo",
el: {
type: "bi.text_button",
cls: "button-combo",
height: 30
},
popup: {
el: {
type: "bi.button_tree",
items: BI.createItems(BI.deepClone(this.child), {
type: "bi.single_select_item",
height: 25,
handler: function (v) {
}
}),
layouts: [{
type: "bi.vertical"
}]
}
},
width: 200
});
childCombo.setValue(BI.deepClone(this.child)[0].children[0].value);
var monthCombo = BI.createWidget({
type: "bi.combo",
el: {
type: "bi.button",
text: "多层样式下拉框",
height: 30
},
popup: {
el: {
items: BI.createItems(BI.deepClone(this.months), {
type: "bi.single_select_item",
cls: "button-combo",
handler: function (v) {
}
}),
layouts: [{
type: "bi.adaptive",
items: [{
el: {
type: "bi.table",
columns: 2,
rows: 6,
columnSize: [0.5, "fill"],
rowSize: 30
},
left: 4,
right: 4,
top: 2,
bottom: 2
}]
}, {
type: "bi.absolute",
el: {left: 4, top: 2, right: 4, bottom: 2}
}]
}
},
width: 200
});
var yearCombo = BI.createWidget({
type: "bi.combo",
el: {
type: "bi.button",
text: "自定义控件",
height: 30
},
popup: {
el: {
type: "bi.navigation",
direction: "bottom",
logic: {
dynamic: true
},
tab: {
height: 30,
items: [{
once: false,
text: "后退",
value: -1,
cls: "mvc-button layout-bg3"
}, {
once: false,
text: "前进",
value: 1,
cls: "mvc-button layout-bg4"
}]
},
cardCreator: function (v) {
return BI.createWidget({
type: "bi.text_button",
whiteSpace: "normal",
text: new Date().getFullYear() + v
});
}
}
},
width: 200
});
return BI.createWidget({
type: "bi.left",
items: [combo, childCombo, monthCombo, yearCombo],
hgap: 20,
vgap: 20
});
},
render: function () {
return {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this._createTop()
}, {
column: 0,
row: 1,
el: this._createBottom()
}]
};
}
});
BI.shortcut("demo.combo", Demo.Func);
/***/ }),
/* 1157 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
_createEl: function () {
return {
type: "bi.button",
height: 25,
text: "点击"
};
},
oneCombo: function () {
return BI.createWidget({
type: "bi.combo",
adjustLength: 5,
el: this._createEl(),
popup: {
el: {
type: "bi.layout",
height: 500
},
maxHeight: 400
}
});
},
twoCombo: function () {
return BI.createWidget({
type: "bi.combo",
adjustXOffset: 25,
adjustYOffset: 5,
direction: "bottom,left",
el: this._createEl(),
popup: {
el: {
type: "bi.layout",
height: 1200
}
}
});
},
threeCombo: function () {
return BI.createWidget({
type: "bi.combo",
adjustYOffset: 5,
el: this._createEl(),
isNeedAdjustHeight: false,
popup: {
el: {
type: "bi.layout",
height: 1200
}
}
});
},
fourCombo: function () {
return BI.createWidget({
type: "bi.combo",
adjustXOffset: 25,
adjustYOffset: 5,
direction: "left",
el: this._createEl(),
isNeedAdjustHeight: true,
popup: {
el: {
type: "bi.layout",
height: 1200
}
}
});
},
fiveCombo: function () {
return BI.createWidget({
type: "bi.combo",
adjustXOffset: 25,
adjustYOffset: 5,
direction: "left,top",
el: this._createEl(),
isNeedAdjustHeight: true,
popup: {
el: {
type: "bi.layout",
height: 1200
},
maxHeight: 2000
}
});
},
sixCombo: function () {
return BI.createWidget({
type: "bi.combo",
adjustXOffset: 25,
adjustYOffset: 5,
direction: "top,left",
el: this._createEl(),
isNeedAdjustHeight: true,
popup: {
el: {
type: "bi.layout",
height: 1200
}
}
});
},
sevenCombo: function () {
return BI.createWidget({
type: "bi.combo",
adjustXOffset: 25,
adjustYOffset: 5,
direction: "bottom",
isNeedAdjustWidth: false,
// isNeedAdjustHeight: false,
offsetStyle: "center",
el: this._createEl(),
popup: {
el: {
type: "bi.layout",
width: 200,
height: 1200
}
}
});
},
eightCombo: function () {
return BI.createWidget({
type: "bi.combo",
adjustXOffset: 25,
adjustYOffset: 5,
direction: "right",
isNeedAdjustWidth: false,
// isNeedAdjustHeight: false,
offsetStyle: "middle",
el: this._createEl(),
popup: {
el: {
type: "bi.layout",
width: 200,
height: 200
}
}
});
},
render: function () {
return {
type: "bi.grid",
hgap: 10,
vgap: 5,
items: [[this.oneCombo(), this.twoCombo(), this.threeCombo()],
[this.fourCombo(), this.fiveCombo(), this.sixCombo()],
[this.sevenCombo(), this.eightCombo()]]
};
}
});
BI.shortcut("demo.combo2", Demo.Func);
/***/ }),
/* 1158 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
_createEl: function () {
return {
type: "bi.label",
cls:"bi-border",
height: "100%",
text: "点击"
};
},
oneCombo: function () {
return BI.createWidget({
type: "bi.combo",
direction: "right,innerRight",
isNeedAdjustWidth: false,
isNeedAdjustHeight: false,
el: this._createEl(),
popup: {
el: {
type: "bi.layout",
width: 200,
height: 200
}
}
});
},
twoCombo: function () {
return BI.createWidget({
type: "bi.combo",
direction: "right,innerRight",
isNeedAdjustWidth: false,
isNeedAdjustHeight: false,
el: this._createEl(),
popup: {
el: {
type: "bi.layout",
width: 1000,
height: 200
}
}
});
},
threeCombo: function () {
return BI.createWidget({
type: "bi.combo",
direction: "right,innerRight",
isNeedAdjustWidth: false,
isNeedAdjustHeight: false,
el: this._createEl(),
popup: {
el: {
type: "bi.layout",
width: 400,
height: 200
}
}
});
},
render: function () {
return {
type: "bi.grid",
hgap: 10,
vgap: 5,
items: [[this.oneCombo()], [this.twoCombo()], [this.threeCombo()]]
};
}
});
BI.shortcut("demo.combo3", Demo.Func);
/***/ }),
/* 1159 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.vertical",
hgap: 30,
vgap: 20,
items: [{
type: "bi.expander",
el: {
type: "bi.icon_text_node",
cls: "pull-right-ha-font mvc-border",
height: 25,
text: "Expander"
},
popup: {
cls: "mvc-border",
items: BI.createItems([{
text: "项目1",
value: 1
}, {
text: "项目2",
value: 2
}, {
text: "项目3",
value: 3
}, {
text: "项目4",
value: 4
}], {
type: "bi.single_select_item",
height: 25
})
}
}]
};
}
});
BI.shortcut("demo.expander", Demo.Func);
/***/ }),
/* 1160 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
this.all = 0;
var items = BI.deepClone(Demo.CONSTANTS.ITEMS);
return {
type: "bi.loader",
itemsCreator: function (options, populate) {
setTimeout(function () {
populate(BI.map(items.slice((options.times - 1) * 10, options.times * 10), function (i, v) {
return BI.extend(v, {
type: "bi.single_select_item",
height: 25
});
}));
}, 1000);
},
hasNext: function (options) {
return options.times * 10 < items.length;
}
};
}
});
BI.shortcut("demo.loader", Demo.Func);
/***/ }),
/* 1161 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
_createNav: function (v) {
return BI.createWidget({
type: "bi.label",
cls: "layout-bg" + BI.random(1, 8),
text: "第" + v + "页"
});
},
render: function () {
return {
type: "bi.navigation",
showIndex: 0,
tab: {
height: 30,
items: [{
once: false,
text: "后退",
value: -1,
cls: "mvc-button layout-bg3"
}, {
once: false,
text: "前进",
value: 1,
cls: "mvc-button layout-bg4"
}]
},
cardCreator: BI.bind(this._createNav, this)
};
}
});
BI.shortcut("demo.navigation", Demo.Func);
/***/ }),
/* 1162 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
_createItems: function (items) {
return BI.createItems(items, {
type: "bi.multi_select_item",
height: 25,
handler: function (v) {
}
});
},
render: function () {
var self = this;
var items = [{
text: "2010年", value: 2010, py: "2010n", title: "1111111111111111111111111111111111"
}, {
text: "2011年", value: 2011, py: "2011n", title: "1111111111111111111111111111111111"
}, {
text: "2012年", value: 2012, py: "2012n", title: "1111111111111111111111111111111111"
}, {
text: "2013年", value: 2013, py: "2013n", title: "1111111111111111111111111111111111"
}, {
text: "2014年", value: 2014, py: "2014n", title: "1111111111111111111111111111111111"
}, {
text: "2015年", value: 2015, py: "2015n", title: "1111111111111111111111111111111111"
}, {
text: "2016年", value: 2016, py: "2016n", title: "1111111111111111111111111111111111"
}, {
text: "2017年", value: 2017, py: "2017n", title: "1111111111111111111111111111111111"
}];
var adapter = BI.createWidget({
type: "bi.button_group",
cls: "layout-bg1",
items: this._createItems(items),
chooseType: 1,
behaviors: {},
layouts: [{
type: "bi.vertical"
}]
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: adapter,
top: 50,
left: 50,
width: 200,
height: 100
}]
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.absolute",
width: 200,
height: 30,
items: [{
el: {
type: "bi.searcher",
adapter: adapter,
width: 200,
height: 30
},
left: 0,
right: 0,
top: 0,
bottom: 0
}]
},
top: 100,
left: 300
}]
});
}
});
BI.shortcut("demo.searcher", Demo.Func);
/***/ }),
/* 1163 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var adapter = BI.createWidget({
type: "bi.label",
cls: "layout-bg2",
text: "将在该处弹出switcher"
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: adapter,
top: 50,
left: 20,
width: 200,
height: 300
}]
});
BI.createWidget({
type: "bi.vertical",
element: this,
hgap: 30,
vgap: 20,
items: [{
type: "bi.switcher",
el: {
type: "bi.button",
height: 25,
text: "Switcher"
},
popup: {
cls: "mvc-border layout-bg5",
items: BI.createItems([{
text: "项目1",
value: 1
}, {
text: "项目2",
value: 2
}, {
text: "项目3",
value: 3
}, {
text: "项目4",
value: 4
}], {
type: "bi.single_select_item",
height: 25
})
},
adapter: adapter
}]
});
}
});
BI.shortcut("demo.switcher", Demo.Func);
/***/ }),
/* 1164 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
_createTabs: function (v) {
switch (v) {
case 1:
return BI.createWidget({
type: "bi.label",
cls: "layout-bg1",
text: "面板1"
});
case 2:
return BI.createWidget({
type: "bi.label",
cls: "layout-bg2",
text: "面板2"
});
}
},
render: function () {
this.tab = BI.createWidget({
type: "bi.button_group",
height: 30,
items: [{
text: "Tab1",
value: 1,
width: 50,
cls: "mvc-button layout-bg3"
}, {
text: "Tab2",
value: 2,
width: 50,
cls: "mvc-button layout-bg4"
}],
layouts: [{
type: "bi.center_adapt",
items: [{
el: {
type: "bi.horizontal",
width: 100
}
}]
}]
});
var tab = BI.createWidget({
direction: "custom",
type: "bi.tab",
element: this,
tab: this.tab,
cardCreator: BI.bind(this._createTabs, this)
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: this.tab,
left: 200,
top: 200
}]
});
tab.setSelect(2);
}
});
BI.shortcut("demo.tab", Demo.Func);
/***/ }),
/* 1165 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var ref;
return {
type: "bi.vertical",
items: [{
type: "bi.button_group",
ref: function (_ref) {
ref = _ref;
},
chooseType: BI.ButtonGroup.CHOOSE_TYPE_NONE,
layouts: [{
type: "bi.vertical",
items: [{
type: "bi.vtape",
height: 200
}]
}],
items: [{
el: {
type: "bi.label",
text: "button_group是一类具有相同属性或相似属性的抽象, 本案例实现的是布局的嵌套(vertical布局下内嵌center_adapt布局)"
},
height: 150
}, {
el: {
type: "bi.button",
text: "1"
}
}]
}, {
type: "bi.button",
text: "populate",
handler: function () {
ref.populate([{
el: {
type: "bi.label",
text: "1"
},
height: 50
}, {
el: {
type: "bi.button",
text: "2"
},
height: 50
}, {
el: {
type: "bi.label",
text: "3"
}
}]);
}
}]
};
}
});
BI.shortcut("demo.button_group", Demo.Func);
/***/ }),
/* 1166 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.button_tree",
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
type: "bi.vertical"
}, {
type: "bi.center_adapt"
}],
items: [{
type: "bi.label",
text: "0",
value: 0
}, {
type: "bi.button",
text: "1",
value: 1
}]
};
}
});
BI.shortcut("demo.button_tree", Demo.Func);
/***/ }),
/* 1167 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var items = [];
var cellCount = 100;
for (var i = 0; i < cellCount; i++) {
items[i] = {
type: "bi.label",
text: i
};
}
var grid = BI.createWidget({
type: "bi.collection_view",
width: 400,
height: 300,
items: items,
cellSizeAndPositionGetter: function (index) {
return {
x: index % 10 * 50,
y: Math.floor(index / 10) * 50,
width: 50,
height: 50
};
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: grid,
left: 10,
right: 10,
top: 10,
bottom: 10
}]
});
}
});
BI.shortcut("demo.collection_view", Demo.Func);
/***/ }),
/* 1168 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
_createDefaultTree: function () {
var TREEITEMS = [{id: -1, pId: -2, value: "根目录", open: true, type: "bi.plus_group_node", height: 25},
{id: 1, pId: -1, value: "第一级目录1", type: "bi.plus_group_node", height: 25},
{id: 11, pId: 1, value: "第二级文件1", type: "bi.single_select_item", height: 25},
{id: 12, pId: 1, value: "第二级目录2", type: "bi.plus_group_node", height: 25},
{id: 121, pId: 12, value: "第三级目录1", type: "bi.plus_group_node", height: 25},
{id: 122, pId: 12, value: "第三级文件1", type: "bi.single_select_item", height: 25},
{id: 1211, pId: 121, value: "第四级目录1", type: "bi.plus_group_node", height: 25},
{id: 12111, pId: 1211, value: "第五级文件1", type: "bi.single_select_item", height: 25},
{id: 2, pId: -1, value: "第一级目录2", type: "bi.plus_group_node", height: 25},
{id: 21, pId: 2, value: "第二级目录3", type: "bi.plus_group_node", height: 25},
{id: 22, pId: 2, value: "第二级文件2", type: "bi.single_select_item", height: 25},
{id: 211, pId: 21, value: "第三级目录2", type: "bi.plus_group_node", height: 25},
{id: 212, pId: 21, value: "第三级文件2", type: "bi.single_select_item", height: 25},
{id: 2111, pId: 211, value: "第四级文件1", type: "bi.single_select_item", height: 25}];
this.tree = BI.createWidget({
type: "bi.custom_tree",
el: {
type: "bi.button_tree",
chooseType: 0,
layouts: [{
type: "bi.vertical",
hgap: 30
}]
},
items: BI.deepClone(TREEITEMS)
});
return this.tree;
},
_createAsyncTree: function () {
this.asyncTree = BI.createWidget({
type: "bi.custom_tree",
itemsCreator: function (op, callback) {
if (!op.node) {// 根节点
callback([{
id: 1,
pId: 0,
type: "bi.plus_group_node",
text: "test1",
value: 1,
height: 25,
isParent: true
}, {
id: 2,
pId: 0,
type: "bi.plus_group_node",
text: "test2",
value: 1,
isParent: true,
open: true,
height: 25
}]);
} else {
if (op.node.id == 1) {
callback([
{
id: 11,
pId: 1,
type: "bi.plus_group_node",
text: "test11",
value: 11,
height: 25,
isParent: true
},
{
id: 12,
pId: 1,
type: "bi.single_select_item",
text: "test12",
value: 12,
height: 35
},
{
id: 13,
pId: 1,
type: "bi.single_select_item",
text: "test13",
value: 13,
height: 35
},
{
id: 14,
pId: 1,
type: "bi.single_select_item",
text: "test14",
value: 14,
height: 35
},
{
id: 15,
pId: 1,
type: "bi.single_select_item",
text: "test15",
value: 15,
height: 35
},
{
id: 16,
pId: 1,
type: "bi.single_select_item",
text: "test16",
value: 16,
height: 35
},
{id: 17, pId: 1, type: "bi.single_select_item", text: "test17", value: 17, height: 35}
]);
} else if (op.node.id == 2) {
callback([{
id: 21,
pId: 2,
type: "bi.single_select_item",
text: "test21",
value: 21,
height: 35
},
{
id: 22,
pId: 2,
type: "bi.single_select_item",
text: "test22",
value: 22,
height: 35
}]);
} else if (op.node.id == 11) {
callback([{
id: 111,
pId: 11,
type: "bi.single_select_item",
text: "test111",
value: 111,
height: 35
}]);
}
}
},
el: {
type: "bi.loader",
next: false,
el: {
type: "bi.button_tree",
chooseType: 0,
layouts: [{
type: "bi.vertical",
hgap: 30,
vgap: 0
}]
}
}
});
return this.asyncTree;
},
render: function () {
var self = this;
BI.createWidget({
type: "bi.grid",
columns: 2,
rows: 1,
element: this,
items: [{
column: 0,
row: 0,
el: {
type: "bi.vtape",
items: [
{
el: this._createDefaultTree()
},
{
el: {
type: "bi.center",
hgap: 10,
items: [{
type: "bi.text_button",
cls: "mvc-button layout-bg2",
text: "getValue",
height: 30,
handler: function () {
BI.Msg.alert("", JSON.stringify(self.tree.getValue()));
}
}, {
type: "bi.text_button",
cls: "mvc-button layout-bg2",
text: "getNodeByValue(第一级目录1)",
height: 30,
handler: function () {
BI.Msg.alert("", "节点名称为: " + self.tree.getNodeByValue("第一级目录1").getValue());
}
}]
},
height: 30
}
]
}
}, {
column: 1,
row: 0,
el: {
type: "bi.vtape",
items: [
{
type: "bi.label",
text: "异步加载数据",
height: 30
},
{
el: this._createAsyncTree()
},
{
el: {
type: "bi.center",
hgap: 10,
items: [{
type: "bi.text_button",
cls: "mvc-button layout-bg2",
text: "getValue",
height: 30,
handler: function () {
BI.Msg.alert("", JSON.stringify(self.asyncTree.getValue()));
}
}, {
type: "bi.text_button",
cls: "mvc-button layout-bg2",
text: "getNodeById(11)",
height: 30,
handler: function () {
BI.Msg.alert("", "节点名称为: " + (self.asyncTree.getNodeById(11) && self.asyncTree.getNodeById(11).getText()));
}
}]
},
height: 30
}
]
}
}]
});
}
});
BI.shortcut("demo.custom_tree", Demo.Func);
/***/ }),
/* 1169 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var items = [];
var rowCount = 10000, columnCount = 100;
for (var i = 0; i < rowCount; i++) {
items[i] = [];
for (var j = 0; j < columnCount; j++) {
items[i][j] = {
type: "bi.label",
text: i + "-" + j
};
}
}
var grid = BI.createWidget({
type: "bi.grid_view",
width: 400,
height: 300,
estimatedRowSize: 30,
estimatedColumnSize: 100,
items: items,
scrollTop: 100,
rowHeightGetter: function () {
return 30;
},
columnWidthGetter: function () {
return 100;
}
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.grid",
columns: 1,
rows: 1,
items: [{
column: 0,
row: 0,
el: grid
}]
},
left: 10,
right: 10,
top: 10,
bottom: 10
}]
});
}
});
BI.shortcut("demo.grid_view", Demo.Func);
/***/ }),
/* 1170 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.list_view",
el: {
type: "bi.left"
},
items: BI.map(Demo.CONSTANTS.ITEMS, function (i, item) {
return BI.extend({}, item, {
type: "bi.label",
width: 200,
height: 200,
text: (i + 1) + "." + item.text
});
})
};
}
});
BI.shortcut("demo.list_view", Demo.Func);
/***/ }),
/* 1171 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
_createItems: function () {
var items = BI.map(BI.range(1000), function (i) {
return {
type: "demo.virtual_group_item",
value: i,
key: i + 1
};
});
return items;
},
render: function () {
var self = this;
var buttonGroupItems = self._createItems();
var virtualGroupItems = self._createItems();
return {
type: "bi.vertical",
vgap: 20,
items: [{
type: "bi.label",
cls: "layout-bg5",
height: 50,
text: "共1000个元素,演示button_group和virtual_group每次删除第一个元素,打开控制台看输出"
}, {
type: "bi.button_group",
width: 500,
height: 300,
ref: function () {
self.buttonGroup = this;
},
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
type: "bi.vertical"
}],
items: this._createItems()
}, {
type: "bi.button",
text: "演示button_group的刷新",
handler: function () {
buttonGroupItems.shift();
self.buttonGroup.populate(BI.deepClone(buttonGroupItems));
}
}, {
type: "bi.virtual_group",
width: 500,
height: 300,
ref: function () {
self.virtualGroup = this;
},
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{
type: "bi.vertical"
}],
items: this._createItems()
}, {
type: "bi.button",
text: "演示virtual_group的刷新",
handler: function () {
virtualGroupItems.shift();
self.virtualGroup.populate(BI.deepClone(virtualGroupItems));
}
}]
};
}
});
BI.shortcut("demo.virtual_group", Demo.Func);
Demo.Item = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-item",
height: 30
},
render: function () {
var self = this, o = this.options;
return {
type: "bi.label",
ref: function () {
self.label = this;
},
height: this.options.height,
text: "key:" + o.key + ",随机数" + BI.UUID()
};
},
shouldUpdate: function (nextProps) {
var o = this.options;
return o.type !== nextProps.type || o.key !== nextProps.key || o.value !== nextProps.value;
},
update: function (item) {
this.label.setText(item.value);
console.log("更新了一项");
return true;// 返回是不是更新成功
},
created: function () {
console.log("创建了一项");
},
destroyed: function () {
console.log("删除了一项");
}
});
BI.shortcut("demo.virtual_group_item", Demo.Item);
/***/ }),
/* 1172 */
/***/ (function(module, exports) {
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
return {
type: "bi.virtual_list",
items: BI.map(Demo.CONSTANTS.ITEMS, function (i, item) {
return BI.extend({}, item, {
type: "bi.label",
height: 30,
text: (i + 1) + "." + item.text
});
})
};
}
});
BI.shortcut("demo.virtual_list", Demo.Func);
/***/ }),
/* 1173 */
/***/ (function(module, exports) {
Demo.AbsoluteLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-absolute"
},
render: function () {
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.label",
text: "绝对布局",
cls: "layout-bg1",
width: 300,
height: 200
},
left: 100,
top: 100
}]
};
}
});
BI.shortcut("demo.absolute", Demo.AbsoluteLayout);
/***/ }),
/* 1174 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.BorderLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-border"
},
_createNorth: function () {
return BI.createWidget({
type: "bi.label",
text: "North",
cls: "layout-bg1",
height: 30
});
},
_createWest: function () {
return BI.createWidget({
type: "bi.center",
cls: "layout-bg2",
items: [{
type: "bi.label",
text: "West",
whiteSpace: "normal"
}]
});
},
_createCenter: function () {
return BI.createWidget({
type: "bi.center",
cls: "layout-bg3",
items: [{
type: "bi.label",
text: "Center",
whiteSpace: "normal"
}]
});
},
_createEast: function () {
return BI.createWidget({
type: "bi.center",
cls: "layout-bg5",
items: [{
type: "bi.label",
text: "East",
whiteSpace: "normal"
}]
});
},
_createSouth: function () {
return BI.createWidget({
type: "bi.label",
text: "South",
cls: "layout-bg6",
height: 50
});
},
render: function () {
return {
type: "bi.border",
cls: "",
items: {
north: {
el: this._createNorth(),
height: 30,
top: 20,
left: 20,
right: 20
},
south: {
el: this._createSouth(),
height: 50,
bottom: 20,
left: 20,
right: 20
},
west: {
el: this._createWest(),
width: 200,
left: 20
},
east: {
el: this._createEast(),
width: 300,
right: 20
},
center: this._createCenter()
}
};
}
});
BI.shortcut("demo.border", Demo.BorderLayout);
/***/ }),
/* 1175 */
/***/ (function(module, exports) {
Demo.CenterAdapt = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-absolute"
},
render: function () {
return {
type: "bi.center_adapt",
items: [{
type: "bi.label",
text: "水平垂直居中",
width: 300,
height: 200,
cls: "layout-bg1"
}]
};
}
});
BI.shortcut("demo.center_adapt", Demo.CenterAdapt);
/***/ }),
/* 1176 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.CenterLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-center"
},
render: function () {
return {
type: "bi.center",
items: [{
type: "bi.label",
text: "其实是一个grid嵌套absolute的实现",
cls: "layout-bg1",
whiteSpace: "normal"
}, {
type: "bi.label",
text: "Center 2,为了演示label是占满整个的,用了一个whiteSpace:normal",
cls: "layout-bg2",
whiteSpace: "normal"
}, {
type: "bi.label",
text: "Center 3",
cls: "layout-bg3"
}, {
type: "bi.label",
text: "Center 4",
cls: "layout-bg5"
}],
hgap: 20,
vgap: 20
};
}
});
BI.shortcut("demo.center_layout", Demo.CenterLayout);
/***/ }),
/* 1177 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.FloatCenterLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-float-center"
},
render: function () {
return {
type: "bi.float_center",
items: [{
type: "bi.label",
text: "floatCenter与center的不同在于,它可以控制最小宽度和最大宽度",
cls: "layout-bg1",
whiteSpace: "normal"
}, {
type: "bi.label",
text: "浮动式的中间布局",
cls: "layout-bg2",
whiteSpace: "normal"
}],
hgap: 20,
vgap: 20
};
}
});
BI.shortcut("demo.float_center", Demo.FloatCenterLayout);
/***/ }),
/* 1178 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.FlowLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-flow"
},
render: function () {
return {
type: "bi.center_adapt",
items: [{
type: "bi.left",
items: [{
type: "bi.label",
height: 30,
text: "Left-1",
cls: "layout-bg1"
}, {
type: "bi.label",
height: 30,
text: "Left-2",
cls: "layout-bg2"
}, {
type: "bi.label",
height: 30,
text: "Left-3",
cls: "layout-bg3"
}, {
type: "bi.label",
height: 30,
text: "Left-4",
cls: "layout-bg4"
}, {
type: "bi.label",
height: 30,
text: "Left-5",
cls: "layout-bg5"
}],
hgap: 20
}, {
type: "bi.right",
hgap: 20,
items: [{
type: "bi.label",
height: 30,
text: "Right-1",
cls: "layout-bg1"
}, {
type: "bi.label",
height: 30,
text: "Right-2",
cls: "layout-bg2"
}, {
type: "bi.label",
height: 30,
text: "Right-3",
cls: "layout-bg3"
}, {
type: "bi.label",
height: 30,
text: "Right-4",
cls: "layout-bg4"
}, {
type: "bi.label",
height: 30,
text: "Right-5",
cls: "layout-bg5"
}],
vgap: 20
}]
};
}
});
BI.shortcut("demo.flow", Demo.FlowLayout);
/***/ }),
/* 1179 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.GridLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-grid"
},
render: function () {
return {
type: "bi.grid",
columns: 5,
rows: 3,
items: [{
column: 0,
row: 0,
el: {
type: "bi.label",
text: "column-0, row-0",
cls: "layout-bg1"
}
}, {
column: 1,
row: 0,
el: {
type: "bi.label",
text: "column-1, row-0",
cls: "layout-bg2"
}
}, {
column: 2,
row: 0,
el: {
type: "bi.label",
text: "column-2, row-0",
cls: "layout-bg6"
}
}, {
column: 3,
row: 0,
el: {
type: "bi.label",
text: "column-3, row-0",
cls: "layout-bg3"
}
}, {
column: 4,
row: 0,
el: {
type: "bi.label",
text: "column-4, row-0",
cls: "layout-bg4"
}
}, {
column: 0,
row: 1,
el: {
type: "bi.label",
text: "column-0, row-1",
cls: "layout-bg5"
}
}, {
column: 1,
row: 1,
el: {
type: "bi.label",
text: "column-1, row-1",
cls: "layout-bg6"
}
}, {
column: 2,
row: 1,
el: {
type: "bi.label",
text: "column-2, row-1",
cls: "layout-bg7"
}
}, {
column: 3,
row: 1,
el: {
type: "bi.label",
text: "column-3, row-1",
cls: "layout-bg1"
}
}, {
column: 4,
row: 1,
el: {
type: "bi.label",
text: "column-4, row-1",
cls: "layout-bg3"
}
}, {
column: 0,
row: 2,
el: {
type: "bi.label",
text: "column-0, row-2",
cls: "layout-bg2"
}
}, {
column: 1,
row: 2,
el: {
type: "bi.label",
text: "column-1, row-2",
cls: "layout-bg3"
}
}, {
column: 2,
row: 2,
el: {
type: "bi.label",
text: "column-2, row-2",
cls: "layout-bg4"
}
}, {
column: 3,
row: 2,
el: {
type: "bi.label",
text: "column-3, row-2",
cls: "layout-bg5"
}
}, {
column: 4,
row: 2,
el: {
type: "bi.label",
text: "column-4, row-2",
cls: "layout-bg6"
}
}]
};
}
});
BI.shortcut("demo.grid", Demo.GridLayout);
/***/ }),
/* 1180 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.HorizontalAdapt = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-horizontal-adapt"
},
_createLayout: function () {
return BI.createWidget({
type: "bi.horizontal_adapt",
items: [{
type: "bi.label",
text: "例子1:可用做水平居中",
cls: "layout-bg1",
width: 300,
height: 30
}]
});
},
_createAdaptLayout: function () {
return BI.createWidget({
type: "bi.horizontal_adapt",
columnSize: [300, "fill"],
items: [{
type: "bi.label",
text: "例子2:用于水平适应布局",
cls: "layout-bg1",
height: 30
}, {
type: "bi.label",
text: "水平自适应列",
cls: "layout-bg2",
height: 30
}]
});
},
render: function () {
return {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this._createLayout()
}, {
column: 0,
row: 1,
el: this._createAdaptLayout()
}]
};
}
});
BI.shortcut("demo.horizontal_adapt", Demo.HorizontalAdapt);
/***/ }),
/* 1181 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.HorizontalAuto = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-horizontal-auto"
},
_createLayout: function () {
return BI.createWidget({
type: "bi.horizontal_auto",
items: [{
type: "bi.label",
text: "水平居中",
cls: "layout-bg1",
width: 300,
height: 30
}, {
type: "bi.label",
text: "水平居中优先使用该布局",
cls: "layout-bg2",
width: 300,
height: 30
}]
});
},
render: function () {
return {
type: "bi.grid",
columns: 1,
rows: 2,
items: [{
column: 0,
row: 0,
el: this._createLayout()
}]
};
}
});
BI.shortcut("demo.horizontal_auto", Demo.HorizontalAuto);
/***/ }),
/* 1182 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.HorizontalFloat = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-horizontal-float"
},
render: function () {
return {
type: "bi.horizontal_float",
items: [{
type: "bi.label",
text: "浮动式水平居中布局方案,用于宽度未知的情况",
cls: "layout-bg1",
height: 30
}]
};
}
});
BI.shortcut("demo.horizontal_float", Demo.HorizontalFloat);
/***/ }),
/* 1183 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/21.
*/
Demo.Horizontal = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-horizontal"
},
render: function () {
return {
type: "bi.vertical",
vgap: 10,
items: [{
type: "bi.horizontal",
height: 150,
hgap: 10,
items: [{
type: "bi.label",
whiteSpace: "normal",
text: "因为大多数场景下都需要垂直居中,所以这个布局一般会被vertical_adapt布局设置scrollx=true取代",
cls: "layout-bg3",
width: 500,
height: 50
}, {
type: "bi.label",
text: "水平布局",
cls: "layout-bg4",
width: 300,
height: 30
}, {
type: "bi.label",
text: "水平布局",
cls: "layout-bg5",
width: 300,
height: 30
}, {
type: "bi.label",
text: "水平布局",
cls: "layout-bg6",
width: 300,
height: 30
}]
}, {
type: "bi.layout",
height: 1,
cls: "bi-border-bottom bi-high-light-border"
}, {
type: "bi.horizontal",
height: 150,
verticalAlign: BI.VerticalAlign.Middle,
horizontalAlign: BI.HorizontalAlign.Left,
vgap: 10,
items: [{
type: "bi.label",
text: "以horizontal实现的vertical_adapt垂直居中",
cls: "layout-bg1",
width: 300,
height: 30
}, {
type: "bi.label",
text: "以horizontal实现的vertical_adapt垂直居中",
cls: "layout-bg2",
width: 300,
height: 30
}]
}, {
type: "bi.layout",
height: 1,
cls: "bi-border-bottom bi-high-light-border"
}, {
type: "bi.horizontal",
height: 150,
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Center,
items: [{
type: "bi.label",
text: "以horizontal代替horizontal_adapt实现的水平居中(单元素)",
cls: "layout-bg1",
width: 300,
height: 30
}]
}, {
type: "bi.layout",
height: 1,
cls: "bi-border-bottom bi-high-light-border"
}, {
type: "bi.horizontal",
height: 150,
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Center,
columnSize: [300, "fill"],
items: [{
type: "bi.label",
text: "以horizontal代替horizontal_adapt实现的用于水平适应布局",
cls: "layout-bg1",
height: 30
}, {
type: "bi.label",
text: "以horizontal代替horizontal_adapt实现的水平自适应列",
cls: "layout-bg2",
height: 30
}]
}, {
type: "bi.layout",
height: 1,
cls: "bi-border-bottom bi-high-light-border"
}, {
type: "bi.center_adapt",
height: 150,
verticalAlign: BI.VerticalAlign.Middle,
horizontalAlign: BI.HorizontalAlign.Center,
items: [{
type: "bi.label",
text: "以horizontal代替center_adapt实现的水平垂直居中",
width: 300,
height: 100,
cls: "layout-bg1"
}]
}, {
type: "bi.layout",
height: 1,
cls: "bi-border-bottom bi-high-light-border"
}]
};
}
});
BI.shortcut("demo.horizontal", Demo.Horizontal);
/***/ }),
/* 1184 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.HtapeLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-htape"
},
render: function () {
return {
type: "bi.htape",
items: [
{
width: 100,
el: {
type: "bi.label",
text: "1",
cls: "bi-background"
}
}, {
width: 200,
el: {
type: "bi.label",
text: "2",
cls: "layout-bg2"
}
}, {
width: "fill",
el: {
type: "bi.label",
text: "3",
cls: "layout-bg3"
}
}
]
};
}
});
BI.shortcut("demo.htape", Demo.HtapeLayout);
/***/ }),
/* 1185 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.LeftRightVerticalAdaptLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-left-right-vertical-adapt"
},
render: function () {
return {
type: "bi.left_right_vertical_adapt",
lhgap: 10,
rhgap: 30,
items: {
left: [{
type: "bi.label",
text: "左边的垂直居中",
cls: "layout-bg1",
width: 100,
height: 30
}, {
type: "bi.label",
text: "左边的垂直居中",
cls: "layout-bg2",
width: 100,
height: 30
}],
right: [{
type: "bi.label",
text: "右边的垂直居中",
cls: "layout-bg1",
width: 100,
height: 30
}, {
type: "bi.label",
text: "右边的垂直居中",
cls: "layout-bg2",
width: 100,
height: 30
}]
}
};
}
});
BI.shortcut("demo.left_right_vertical_adapt", Demo.LeftRightVerticalAdaptLayout);
/***/ }),
/* 1186 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.TableLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-table-layout"
},
_createTable1: function () {
return {
type: "bi.table",
items: BI.createItems([
[
{
el: {
cls: "layout-bg1"
}
},
{
el: {
cls: "layout-bg2"
}
},
{
el: {
cls: "layout-bg3"
}
}
],
[
{
el: {
cls: "layout-bg4"
}
},
{
el: {
cls: "layout-bg5"
}
},
{
el: {
cls: "layout-bg6"
}
}
],
[
{
el: {
cls: "layout-bg7"
}
},
{
el: {
cls: "layout-bg8"
}
},
{
el: {
cls: "layout-bg1"
}
}
],
[
{
el: {
cls: "layout-bg2"
}
},
{
el: {
cls: "layout-bg3"
}
},
{
el: {
cls: "layout-bg4"
}
}
],
[
{
el: {
cls: "layout-bg5"
}
},
{
el: {
cls: "layout-bg6"
}
},
{
el: {
cls: "layout-bg7"
}
}
],
[
{
el: {
cls: "layout-bg8"
}
},
{
el: {
cls: "layout-bg1"
}
},
{
el: {
cls: "layout-bg2"
}
}
],
[
{
el: {
cls: "layout-bg6"
}
},
{
el: {
cls: "layout-bg7"
}
},
{
el: {
cls: "layout-bg8"
}
}
]
], {
type: "bi.layout"
}),
columnSize: [100, "fill", 200],
rowSize: [10, 30, 50, 70, 90, 110, 130],
hgap: 20,
vgap: 10
};
},
render: function () {
return {
type: "bi.grid",
columns: 1,
rows: 1,
items: [
{
column: 0,
row: 0,
el: this._createTable1()
}
// , {
// column: 0,
// row: 1,
// el: this._createTable2()
// }
]
};
}
});
BI.shortcut("demo.table_layout", Demo.TableLayout);
/***/ }),
/* 1187 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.TdLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-td"
},
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.td",
columnSize: [100, 100, ""],
items: BI.createItems([
[{
el: {
type: "bi.label",
text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写",
cls: "layout-bg1"
}
}, {
el: {
type: "bi.label",
text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写",
cls: "layout-bg2"
}
}, {
el: {
type: "bi.label",
text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写",
cls: "layout-bg3"
}
}], [{
el: {
type: "bi.label",
text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写",
cls: "layout-bg5"
}
}, {
el: {
type: "bi.label",
text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写",
cls: "layout-bg6"
}
}, {
el: {
type: "bi.label",
text: "这是一段可以换行的文字,为了使它换行我要多写几个字,但是我又凑不够这么多的字,万般焦急下,只能随便写写",
cls: "layout-bg7"
}
}]
], {
whiteSpace: "normal"
})
}]
};
}
});
BI.shortcut("demo.td", Demo.TdLayout);
/***/ }),
/* 1188 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.VerticalAdaptLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-vertical-adapt"
},
_createLayout: function () {
return BI.createWidget({
type: "bi.vertical_adapt",
vgap: 10,
items: [{
type: "bi.label",
text: "垂直居中",
cls: "layout-bg1",
width: 300,
height: 30
}, {
type: "bi.label",
text: "垂直居中",
cls: "layout-bg2",
width: 300,
height: 30
}]
});
},
render: function () {
return {
type: "bi.grid",
columns: 2,
rows: 1,
items: [{
column: 0,
row: 0,
el: this._createLayout()
}]
};
}
});
BI.shortcut("demo.vertical_adapt", Demo.VerticalAdaptLayout);
/***/ }),
/* 1189 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/21.
*/
Demo.VerticalLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-vertical"
},
render: function () {
return {
type: "bi.vertical",
vgap: 10,
items: [{
type: "bi.label",
cls: "layout-bg3",
text: "垂直布局",
height: 30
}, {
type: "bi.label",
cls: "layout-bg4",
text: "垂直布局",
height: 30
}]
};
}
});
BI.shortcut("demo.vertical", Demo.VerticalLayout);
/***/ }),
/* 1190 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.VtapeLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-vtape"
},
render: function () {
return {
type: "bi.vtape",
vgap: 10,
items: [
{
height: 100,
el: {
type: "bi.label",
text: "1",
cls: "layout-bg1"
},
tgap: 10,
vgap: 10
}, {
height: 200,
el: {
type: "bi.label",
text: "2",
cls: "layout-bg2"
}
}, {
height: "fill",
el: {
type: "bi.label",
text: "3",
cls: "layout-bg3"
}
}
]
};
}
});
BI.shortcut("demo.vtape", Demo.VtapeLayout);
/***/ }),
/* 1191 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this, id1 = BI.UUID(), id2 = BI.UUID();
return {
type: "bi.vertical",
vgap: 10,
items: [{
type: "bi.button",
text: "create形式创建layer, 遮住当前面板, 返回创建的面板对象",
height: 30,
handler: function () {
BI.Layers.create(id1, self, {
//偏移量
offset: {
left: 10,
right: 10,
top: 10,
bottom: 10
},
type: "bi.center_adapt",
cls: "bi-card",
items: [{
type: "bi.button",
text: "点击关闭",
handler: function () {
BI.Layers.hide(id1);
}
}]
});
BI.Layers.show(id1);
}
}, {
type: "bi.button",
text: "make形式创建layer,可以指定放到哪个面板内,这里指定当前面板(默认放在body下撑满), 返回创建的面板对象",
height: 30,
handler: function () {
BI.Layers.make(id2, self, {
//偏移量
offset: {
left: 10,
right: 10,
top: 10,
bottom: 10
},
type: "bi.center_adapt",
cls: "bi-card",
items: [{
type: "bi.button",
text: "点击关闭",
handler: function () {
BI.Layers.remove(id2);
}
}]
});
BI.Layers.show(id2);
}
}]
};
}
});
BI.shortcut("demo.layer", Demo.Func);
/***/ }),
/* 1192 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var id = BI.UUID();
var body;
return {
type: "bi.vertical",
vgap: 10,
items: [{
type: "bi.text_button",
text: "点击弹出Popover(normal size & fixed)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
size: "normal",
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
}
}).open(id);
}
}, {
type: "bi.text_button",
text: "点击弹出Popover(small size & fixed)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
size: "small",
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
}
}).open(id);
}
}, {
type: "bi.text_button",
text: "点击弹出Popover(big size & fixed)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
size: "big",
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
}
}).open(id);
}
}, {
type: "bi.text_button",
text: "点击弹出Popover(normal size & adapt body区域高度是300)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
size: "normal",
logic: {
dynamic: true
},
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.vertical",
items: [{
type: "bi.button_group",
ref: function () {
body = this;
},
items: BI.map(BI.range(0, 10), function () {
return {
type: "bi.label",
text: "1",
height: 30
};
}),
layouts: [{
type: "bi.vertical"
}]
}]
}
}).open(id);
}
}, {
type: "bi.text_button",
text: "点击弹出Popover(small size & adapt body区域高度是900)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
type: "bi.bar_popover",
size: "small",
logic: {
dynamic: true
},
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.vertical",
items: [{
type: "bi.button_group",
ref: function () {
body = this;
},
items: BI.map(BI.range(0, 30), function () {
return {
type: "bi.label",
text: "1",
height: 30
};
}),
layouts: [{
type: "bi.vertical"
}]
}]
}
}).open(id);
}
}, {
type: "bi.text_button",
text: "点击弹出Popover(custom)",
height: 30,
handler: function () {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
width: 400,
height: 300,
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
},
footer: {
type: "bi.label",
text: "这个是footer"
}
}).open(id);
}
}]
};
}
});
BI.shortcut("demo.popover", Demo.Func);
/***/ }),
/* 1193 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.combo",
width: 200,
height: 30,
el: {
type: "bi.text_button",
text: "点击",
cls: "bi-border",
height: 30
},
popup: {
type: "bi.popup_view",
el: {
type: "bi.button_group",
layouts: [{
type: "bi.vertical"
}],
items: BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), {
type: "bi.multi_select_item",
height: 25
})
}
}
}
}]
};
}
});
BI.shortcut("demo.popup_view", Demo.Func);
/***/ }),
/* 1194 */
/***/ (function(module, exports) {
/**
* Created by Windy on 2017/12/13.
*/
Demo.Func = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-func"
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.searcher_view",
ref: function () {
self.searcherView = this;
}
},
left: 100,
top: 20,
width: 230
}]
};
},
mounted: function () {
this.searcherView.populate(BI.createItems([{
text: 2012
}, {
text: 2013
}, {
text: 2014
}, {
text: 2015
}], {
type: "bi.label",
textHeight: 24,
height: 24
}), [{
text: 2
}], "2");
}
});
BI.shortcut("demo.searcher_view", Demo.Func);
/***/ }),
/* 1195 */
/***/ (function(module, exports) {
Demo.Face = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-face"
},
_createLabel: function (text) {
return {
width: 200,
el: {
type: "bi.label",
text: text,
textAlign: "left",
hgap: 5,
height: 40,
cls: "config-label"
}
};
},
_createColorPicker: function (ref, action) {
return {
el: {
type: "bi.vertical_adapt",
items: [{
type: "bi.color_chooser",
listeners: [{
eventName: BI.ColorChooser.EVENT_CHANGE,
action: action
}],
ref: ref,
width: 24,
height: 24
}]
}
};
},
_createBackgroundConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("背景色:"), this._createColorPicker(function () {
self.backgroundColor = this;
}, function () {
self._runGlobalStyle();
})]
};
},
_createFontConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("字体颜色:"), this._createColorPicker(function () {
self.fontColor = this;
}, function () {
self._runGlobalStyle();
})]
};
},
_createActiveFontConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("激活状态字体颜色:"), this._createColorPicker(function () {
self.activeFontColor = this;
}, function () {
self._runGlobalStyle();
}), {
width: 100,
el: {
type: "bi.text_button",
cls: "bi-list-item-active",
text: "测试激活状态",
}
}]
};
},
_createSelectFontConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("选中状态字体颜色:"), this._createColorPicker(function () {
self.selectFontColor = this;
}, function () {
self._runGlobalStyle();
}), {
width: 100,
el: {
type: "bi.text_button",
cls: "bi-list-item-active",
text: "测试选中状态",
}
}]
};
},
_createGrayFontConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("tip提示字体颜色:"), this._createColorPicker(function () {
self.grayFontColor = this;
}, function () {
self._runGlobalStyle();
}), {
width: 100,
el: {
type: "bi.icon_text_item",
cls: "bi-tips copy-font",
height: 40,
text: "测试提示文字"
}
}]
};
},
_createDisableFontConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("灰化字体颜色:"), this._createColorPicker(function () {
self.disabledFontColor = this;
}, function () {
self._runGlobalStyle();
}), {
width: 100,
el: {
type: "bi.text_button",
text: "这个按钮是灰化的",
disabled: true
}
}]
};
},
_createCardBackgroundConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("Card背景颜色:"), this._createColorPicker(function () {
self.cardBackgroundColor = this;
}, function () {
self._runGlobalStyle();
})]
};
},
_createHoverBackgroundColor: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("悬浮状态背景颜色:"), this._createColorPicker(function () {
self.hoverBackgroundColor = this;
}, function () {
self._runGlobalStyle();
}), {
width: 100,
el: {
type: "bi.text_button",
cls: "bi-list-item-active",
text: "测试悬浮状态",
}
}]
};
},
_createActiveBackgroundColor: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("激活状态背景颜色:"), this._createColorPicker(function () {
self.activeBackgroundColor = this;
}, function () {
self._runGlobalStyle();
}), {
width: 100,
el: {
type: "bi.text_button",
cls: "bi-list-item-active",
text: "测试激活状态",
}
}]
};
},
_createSelectBackgroundColor: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("选中状态背景颜色:"), this._createColorPicker(function () {
self.selectBackgroundColor = this;
}, function () {
self._runGlobalStyle();
}), {
width: 100,
el: {
type: "bi.text_button",
cls: "bi-list-item-active",
text: "测试选中状态",
}
}]
};
},
_createSlitColor: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("分割线颜色:"), this._createColorPicker(function () {
self.slitColor = this;
}, function () {
self._runGlobalStyle();
})]
};
},
_createBaseConfig: function () {
return {
type: "bi.vertical",
items: [this._createLabel("--通用配色--"),
this._createBackgroundConfig(),
this._createCardBackgroundConfig(),
this._createFontConfig(),
this._createActiveFontConfig(),
this._createSelectFontConfig(),
this._createGrayFontConfig(),
this._createDisableFontConfig(),
this._createHoverBackgroundColor(),
this._createActiveBackgroundColor(),
this._createSelectBackgroundColor(),
this._createSlitColor()
]
};
},
_createButton1BackgroundConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("按钮背景色1:"), this._createColorPicker(function () {
self.button1BackgroundColor = this;
}, function () {
self._runGlobalStyle();
}), {
width: 100,
el: {
type: "bi.vertical_adapt",
height: 40,
items: [{
type: "bi.button",
cls: "config-button1",
text: "测试按钮"
}]
}
}]
};
},
_createButton2BackgroundConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("按钮背景色2:"), this._createColorPicker(function () {
self.button2BackgroundColor = this;
}, function () {
self._runGlobalStyle();
}), {
width: 100,
el: {
type: "bi.vertical_adapt",
height: 40,
items: [{
type: "bi.button",
level: "success",
cls: "config-button2",
text: "测试按钮"
}]
}
}]
};
},
_createButton3BackgroundConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("按钮背景色3:"), this._createColorPicker(function () {
self.button3BackgroundColor = this;
}, function () {
self._runGlobalStyle();
}), {
width: 100,
el: {
type: "bi.vertical_adapt",
height: 40,
items: [{
type: "bi.button",
level: "warning",
cls: "config-button3",
text: "测试按钮"
}]
}
}]
};
},
_createButton4BackgroundConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("按钮背景色4:"), this._createColorPicker(function () {
self.button4BackgroundColor = this;
}, function () {
self._runGlobalStyle();
}), {
width: 100,
el: {
type: "bi.vertical_adapt",
height: 40,
items: [{
type: "bi.button",
level: "ignore",
cls: "config-button4",
text: "测试按钮"
}]
}
}]
};
},
_createScrollBackgroundConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("滚动条底色:"), this._createColorPicker(function () {
self.scrollBackgroundColor = this;
}, function () {
self._runGlobalStyle();
})]
};
},
_createScrollThumbConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("滚动条thumb颜色:"), this._createColorPicker(function () {
self.scrollThumbColor = this;
}, function () {
self._runGlobalStyle();
})]
};
},
_createPopupBackgroundConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("下拉框背景颜色:"), this._createColorPicker(function () {
self.popupBackgroundColor = this;
}, function () {
self._runGlobalStyle();
}), {
width: 100,
el: {
type: "bi.vertical_adapt",
items: [{
type: "bi.down_list_combo",
items: [[{
el: {
text: "column 1111",
iconCls1: "check-mark-e-font",
value: 11
},
children: [
{
text: "column 1.1",
value: 21,
cls: "dot-e-font",
selected: true
}, {
text: "column 1.222222222222222222222222222222222222",
cls: "dot-e-font",
value: 22
}, {
text: "column 1.3",
cls: "dot-e-font",
value: 23
}, {
text: "column 1.4",
cls: "dot-e-font",
value: 24
}, {
text: "column 1.5",
cls: "dot-e-font",
value: 25
}
]
}], [
{
el: {
type: "bi.icon_text_icon_item",
text: "column 2",
iconCls1: "chart-type-e-font",
cls: "dot-e-font",
value: 12
},
disabled: true,
children: [{
type: "bi.icon_text_item",
cls: "dot-e-font",
height: 25,
text: "column 2.1",
value: 11
}, {text: "column 2.2", value: 12, cls: "dot-e-font"}]
}
], [
{
text: "column 33333333333333333333333333333333",
cls: "style-set-e-font",
value: 13
}
], [
{
text: "column 4",
cls: "filter-e-font",
value: 14
}
], [
{
text: "column 5",
cls: "copy-e-font",
value: 15
}
], [
{
text: "column 6",
cls: "delete-e-font",
value: 16
}
], [
{
text: "column 7",
cls: "dimension-from-e-font",
value: 17,
disabled: true
}
]]
}]
}
}]
};
},
_createMaskBackgroundConfig: function () {
var self = this;
return {
type: "bi.htape",
cls: "config-item bi-border-bottom",
height: 40,
items: [this._createLabel("弹出层蒙版颜色:"), this._createColorPicker(function () {
self.maskBackgroundColor = this;
}, function () {
self._runGlobalStyle();
}), {
width: 100,
el: {
type: "bi.vertical_adapt",
items: [{
type: "bi.button",
text: "mask测试",
handler: function () {
BI.Msg.alert("弹出层", "弹出层面板");
}
}]
}
}]
};
},
_createCommonConfig: function () {
return {
type: "bi.vertical",
items: [this._createLabel("--一般配色--"),
this._createButton1BackgroundConfig(),
this._createButton2BackgroundConfig(),
this._createButton3BackgroundConfig(),
this._createButton4BackgroundConfig(),
this._createScrollBackgroundConfig(),
this._createScrollThumbConfig(),
this._createPopupBackgroundConfig(),
this._createMaskBackgroundConfig()
]
};
},
render: function () {
var self = this;
return {
type: "bi.grid",
items: [[{
el: {
type: "bi.vertical",
cls: "face-config bi-border-right",
items: [this._createBaseConfig(),
this._createCommonConfig()]
}
}, {
el: {
type: "bi.layout"
}
}]]
};
},
_setStyle: function (objects) {
var result = "";
BI.each(objects, function (cls, object) {
result += cls + "{";
BI.each(object, function (name, value) {
result += name + ":" + value + ";";
});
result += "} ";
});
BI.StyleLoaders.removeStyle("style").loadStyle("style", result);
},
_runGlobalStyle: function () {
var backgroundColor = this.backgroundColor.getValue();
var fontColor = this.fontColor.getValue();
var activeFontColor = this.activeFontColor.getValue();
var selectFontColor = this.selectFontColor.getValue();
var grayFontColor = this.grayFontColor.getValue();
var disabledFontColor = this.disabledFontColor.getValue();
var cardBackgroundColor = this.cardBackgroundColor.getValue();
var hoverBackgroundColor = this.hoverBackgroundColor.getValue();
var activeBackgroundColor = this.activeBackgroundColor.getValue();
var selectBackgroundColor = this.selectBackgroundColor.getValue();
var slitColor = this.slitColor.getValue();
var button1BackgroundColor = this.button1BackgroundColor.getValue();
var button2BackgroundColor = this.button2BackgroundColor.getValue();
var button3BackgroundColor = this.button3BackgroundColor.getValue();
var button4BackgroundColor = this.button4BackgroundColor.getValue();
var scrollBackgroundColor = this.scrollBackgroundColor.getValue();
var scrollThumbColor = this.scrollThumbColor.getValue();
var popupBackgroundColor = this.popupBackgroundColor.getValue();
var maskBackgroundColor = this.maskBackgroundColor.getValue();
this._setStyle({
"body.bi-background, body .bi-background": {
"background-color": backgroundColor,
color: fontColor
},
"body .bi-card": {
"background-color": cardBackgroundColor,
color: fontColor
},
"body .bi-tips": {
color: grayFontColor
},
"div::-webkit-scrollbar,.scrollbar-layout-main": {
"background-color": scrollBackgroundColor + "!important"
},
"div::-webkit-scrollbar-thumb,.public-scrollbar-face:after": {
"background-color": scrollThumbColor + "!important"
},
".base-disabled": {
color: disabledFontColor + "!important"
},
".base-disabled .b-font:before": {
color: disabledFontColor + "!important"
},
".list-view-outer": {
"background-color": popupBackgroundColor + "!important"
},
".bi-z-index-mask": {
"background-color": maskBackgroundColor + "!important"
},
".bi-list-item:hover,.bi-list-item-hover:hover,.bi-list-item-active:hover,.bi-list-item-select:hover,.bi-list-item-effect:hover": {
"background-color": hoverBackgroundColor + "!important"
},
".bi-list-item-active:active,.bi-list-item-select:active,.bi-list-item-effect:active": {
"background-color": activeBackgroundColor + "!important",
color: activeFontColor + "!important"
},
".bi-list-item-active.active,.bi-list-item-select.active,.bi-list-item-effect.active": {
"background-color": selectBackgroundColor + "!important",
color: selectFontColor + "!important"
},
"body .bi-button.button-common": {
"background-color": button1BackgroundColor,
"border-color": button1BackgroundColor
},
"body .bi-button.button-success": {
"background-color": button2BackgroundColor,
"border-color": button2BackgroundColor
},
"body .bi-button.button-warning": {
"background-color": button3BackgroundColor,
"border-color": button3BackgroundColor
},
"body .bi-button.button-ignore": {
"background-color": button4BackgroundColor
},
// 以下是分割线颜色
"body .bi-border,body .bi-border-top,#wrapper .bi-border-bottom,body .bi-border-left,body .bi-border-right": {
"border-color": slitColor
},
".bi-collection-table-cell": {
"border-right-color": slitColor,
"border-bottom-color": slitColor
},
".bi-collection-table-cell.first-col": {
"border-left-color": slitColor
},
".bi-collection-table-cell.first-row": {
"border-top-color": slitColor
}
});
},
mounted: function () {
this.backgroundColor.setValue("");
this.fontColor.setValue("");
this.activeFontColor.setValue("");
this.selectFontColor.setValue("");
this.grayFontColor.setValue("");
this.disabledFontColor.setValue("");
this.cardBackgroundColor.setValue("");
this.hoverBackgroundColor.setValue("");
this.activeBackgroundColor.setValue("");
this.selectBackgroundColor.setValue("");
this.button1BackgroundColor.setValue("");
this.button2BackgroundColor.setValue("");
this.button3BackgroundColor.setValue("");
this.button4BackgroundColor.setValue("");
this.scrollBackgroundColor.setValue("");
this.scrollThumbColor.setValue("");
this.popupBackgroundColor.setValue("");
this.maskBackgroundColor.setValue("");
this.slitColor.setValue("");
this._runGlobalStyle();
}
});
BI.shortcut("demo.face", Demo.Face);
/***/ }),
/* 1196 */
/***/ (function(module, exports) {
(function () {
var model = Fix.define({
name: "原始属性",
arr: [{
n: "a"
}, {
n: "b"
}]
});
var Computed = BI.inherit(Fix.Model, {
computed: {
b: function () {
return this.name + "-计算属性";
}
}
});
Demo.Fix = BI.inherit(BI.Widget, {
_store: function () {
return new Computed(model);
},
watch: {
b: function () {
this.button.setText(this.model.b);
}
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.name = "这是改变后的属性";
},
text: this.model.b
}
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.fix_computed", Demo.Fix);
}());
/***/ }),
/* 1197 */
/***/ (function(module, exports) {
(function () {
var ParentStore = BI.inherit(Fix.Model, {
state: function () {
return {
context: "默认context"
};
},
childContext: ["context"]
});
var ChildStore = BI.inherit(Fix.Model, {
context: ["context"],
computed: {
currContext: function () {
return this.model.context;
}
},
actions: {
changeContext: function () {
this.model.context = "改变后的context";
}
}
});
var Child = BI.inherit(BI.Widget, {
_store: function () {
return new ChildStore();
},
watch: {
currContext: function (val) {
this.button.setText(val);
}
},
render: function () {
var self = this;
return {
type: "bi.button",
ref: function () {
self.button = this;
},
text: this.model.context,
handler: function () {
self.store.changeContext();
}
};
},
mounted: function () {
}
});
BI.shortcut("demo.fix_context_child", Child);
var Parent = BI.inherit(BI.Widget, {
_store: function () {
return new ParentStore();
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "demo.fix_context_child"
}
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.fix_context", Parent);
}());
/***/ }),
/* 1198 */
/***/ (function(module, exports) {
(function () {
var model = Fix.define({
name: "原始属性",
arr: [{
n: "a"
}, {
n: "b"
}]
});
Demo.Fix = BI.inherit(BI.Widget, {
_store: function () {
return model;
},
watch: {
name: function () {
this.button.setText(this.model.name);
}
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.name = "这是改变后的属性";
},
text: this.model.name
}
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.fix_define", Demo.Fix);
}());
/***/ }),
/* 1199 */
/***/ (function(module, exports) {
(function () {
var model = Fix.define({
name: 1,
arr: [{
n: "a"
}, {
n: 0
}]
});
var Computed = BI.inherit(Fix.Model, {
computed: {
b: function () {
return this.name + 1;
},
c: function () {
return this.arr[1].n + this.b;
}
}
});
var Store = BI.inherit(Fix.Model, {
_init: function () {
this.comp = new Computed(model);
},
computed: {
b: function () {
return this.comp.c + 1;
},
c: function () {
return this.comp.arr[1].n & 1;
}
},
actions: {
run: function () {
this.comp.name++;
this.comp.arr[1].n++;
}
}
});
Demo.Fix = BI.inherit(BI.Widget, {
_store: function () {
return new Store();
},
watch: {
"b&&(c||b)": function () {
this.button.setText(this.model.b);
}
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.store.run();
},
text: this.model.b
}
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.fix", Demo.Fix);
}());
/***/ }),
/* 1200 */
/***/ (function(module, exports) {
(function () {
var model = Fix.define({
name: "原始属性",
arr: [{
n: "a"
}, {
n: 0
}]
});
Demo.Fix = BI.inherit(BI.Widget, {
_store: function () {
return model;
},
watch: {
"*.*.n": function () {
debugger
},
"**": function () {
debugger
},
"arr.1.*": function () {
this.button.setText(this.model.name + "-" + this.model.arr[1].n);
}
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.arr[0].n += 1;
self.model.arr[1].n += 1;
},
text: this.model.name + "-" + this.model.arr[1].n
}
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.fix_global_watcher", Demo.Fix);
}());
/***/ }),
/* 1201 */
/***/ (function(module, exports) {
/**
* @Author: Young
* @CreationDate 2017-11-06 10:32
* @Description
*/
(function () {
var model = Fix.define({
groups: [{
id: "27a9c8bf159e99e",
name: "功能数据",
packages: [{
id: "82a96a4b03ac17e6",
name: "通信行业",
type: 1,
tables: [{
id: "品类",
name: "品类",
connName: "BIDemo",
fields: [{
id: "sd2ad2f343ca23",
name: "类别",
type: 32,
enable: true,
usable: true
}, {
id: "f34ds34aw2345w",
name: "描述",
type: 32,
enable: true,
usable: true
}]
}]
}]
}, {
id: "das2dw24214sa4",
name: "样式数据",
packages: [{
id: "hi23i1o34a34we",
name: "零售行业",
type: 1,
tables: [{
id: "销售记录",
name: "销售记录",
connName: "BIDemo",
fields: [{
id: "wr213d24t345",
name: "分类",
type: 16,
enable: true,
usable: true
}, {
id: "faw134r24al344",
name: "金额",
type: 32,
enable: true,
usable: true
}]
}]
}, {
id: "fwr124f3453fa",
name: "地产行业",
tables: [{
id: "开发商名称",
name: "开发商名称",
connName: "BIDemo",
fields: [{
id: "sa13f345fg356",
name: "编号",
type: 32,
enable: true,
usable: true
}, {
id: "ad2r24tt232a22",
name: "名称",
type: 16,
enable: true,
usable: true
}]
}, {
id: "楼盘",
name: "楼盘",
connName: "BIDemo",
fields: [{
id: "hfe3345fg356",
name: "编号",
type: 32,
enable: true,
usable: true
}, {
id: "kl224tt232a22",
name: "名称",
type: 16,
enable: true,
usable: true
}]
}]
}]
}],
fineIndexUpdate: {
needUpdate: false,
lastUpdate: 1509953199062
}
});
Demo.FixScene = BI.inherit(BI.Widget, {
constant: {
TAB1: 1,
TAB2: 2
},
_store: function () {
return model;
},
watch: {
"groups.*.name": function () {
this.fineIndexTab.setText("FineIndex更新(******* 分组名变化 需要更新 *******)");
this.model.fineIndexUpdate.needUpdate = true;
},
"groups.*.packages.*.name": function () {
this.fineIndexTab.setText("FineIndex更新(******* 业务包名变化 需要更新 *******)");
this.model.fineIndexUpdate.needUpdate = true;
},
"groups.*.packages.*.tables.*.name": function () {
this.fineIndexTab.setText("FineIndex更新(******* 表名变化 需要更新 *******)");
this.model.fineIndexUpdate.needUpdate = true;
},
"groups.*.packages.*.tables.*.fields.*.name": function () {
this.fineIndexTab.setText("FineIndex更新(******* 字段名变化 需要更新 *******)");
this.model.fineIndexUpdate.needUpdate = true;
},
"fineIndexUpdate.needUpdate": function (needUpdate) {
!needUpdate && this.fineIndexTab.setText("FineIndex更新");
}
},
render: function () {
var self = this;
return {
type: "bi.tab",
showIndex: this.constant.TAB1,
single: true,
tab: {
type: "bi.button_group",
items: BI.createItems([{
text: "业务包管理",
value: this.constant.TAB1
}, {
text: "FineIndex更新",
value: this.constant.TAB2,
ref: function (ref) {
self.fineIndexTab = ref;
}
}], {
type: "bi.text_button",
cls: "bi-list-item-active",
height: 50
}),
height: 50
},
cardCreator: BI.bind(this.cardCreator, this)
};
},
cardCreator: function (v) {
switch (v) {
case this.constant.TAB1:
return {
type: "demo.fix_scene_data_manager",
data: this.model
};
case this.constant.TAB2:
return {
type: "demo.fix_scene_fine_index_update"
};
}
}
});
BI.shortcut("demo.fix_scene", Demo.FixScene);
Demo.FixSceneDataManager = BI.inherit(BI.Widget, {
_store: function () {
return this.options.data;
},
watch: {
"*.name": function () {
}
},
render: function () {
var items = [];
BI.each(this.model.groups, function (i, group) {
items.push({
type: "demo.fix_scene_group",
group: group
});
});
return {
type: "bi.vertical",
items: [{
type: "bi.left",
items: BI.createItems([{
text: "分组名"
}, {
text: "业务包名"
}, {
text: "表名"
}, {
text: "字段名"
}], {
type: "bi.label",
cls: "layout-bg1",
width: 150
})
}, {
type: "bi.vertical",
items: items
}],
vgap: 20,
hgap: 20
};
}
});
BI.shortcut("demo.fix_scene_data_manager", Demo.FixSceneDataManager);
Demo.FixSceneGroup = BI.inherit(BI.Widget, {
props: {
group: {}
},
_store: function () {
return this.options.group;
},
render: function () {
var self = this;
var items = [];
BI.each(this.model.packages, function (i, child) {
items.push({
type: "demo.fix_scene_package",
pack: child
});
});
return {
type: "bi.left",
items: [{
type: "bi.sign_editor",
cls: "bi-border-bottom",
width: 100,
height: 30,
value: this.model.name,
listeners: [{
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
self.model.name = this.getValue();
}
}]
}, {
type: "bi.vertical",
items: items
}],
hgap: 20
};
}
});
BI.shortcut("demo.fix_scene_group", Demo.FixSceneGroup);
Demo.FixScenePackage = BI.inherit(BI.Widget, {
props: {
pack: {}
},
_store: function () {
return this.options.pack;
},
render: function () {
var self = this;
var items = [];
BI.each(this.model.tables, function (i, child) {
items.push({
type: "demo.fix_scene_table",
table: child
});
});
return {
type: "bi.left",
items: [{
type: "bi.sign_editor",
cls: "bi-border-bottom",
width: 100,
height: 30,
value: this.model.name,
listeners: [{
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
self.model.name = this.getValue();
}
}]
}, {
type: "bi.vertical",
items: items
}],
hgap: 20
};
}
});
BI.shortcut("demo.fix_scene_package", Demo.FixScenePackage);
Demo.FixSceneTable = BI.inherit(BI.Widget, {
props: {
table: {}
},
_store: function () {
return this.options.table;
},
render: function () {
var self = this;
var items = [];
BI.each(this.model.fields, function (i, child) {
items.push({
type: "demo.fix_scene_field",
field: child
});
});
return {
type: "bi.left",
items: [{
type: "bi.sign_editor",
cls: "bi-border-bottom",
width: 100,
height: 30,
value: this.model.name,
listeners: [{
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
self.model.name = this.getValue();
}
}]
}, {
type: "bi.vertical",
items: items
}],
hgap: 20
};
}
});
BI.shortcut("demo.fix_scene_table", Demo.FixSceneTable);
Demo.FixSceneField = BI.inherit(BI.Widget, {
props: {
field: {}
},
_store: function () {
return this.options.field;
},
render: function () {
var self = this;
return {
type: "bi.center_adapt",
items: [{
type: "bi.sign_editor",
cls: "bi-border-bottom",
width: 100,
height: 30,
value: this.model.name,
listeners: [{
eventName: BI.SignEditor.EVENT_CHANGE,
action: function () {
self.model.name = this.getValue();
}
}]
}]
};
}
});
BI.shortcut("demo.fix_scene_field", Demo.FixSceneField);
Demo.FixSceneFineIndexUpdateStore = BI.inherit(Fix.Model, {
_init: function () {
this.fineIndexUpdate = model.fineIndexUpdate;
},
computed: {
text: function () {
return "立即更新(上次更新时间:" + BI.date2Str(new Date(this.fineIndexUpdate.lastUpdate), "yyyy-MM-dd HH:mm:ss") + ")";
},
needUpdate: function () {
return this.fineIndexUpdate.needUpdate;
}
},
actions: {
updateFineIndex: function () {
this.fineIndexUpdate.needUpdate = false;
this.fineIndexUpdate.lastUpdate = new Date().getTime();
}
}
});
Demo.FixSceneFineIndexUpdate = BI.inherit(BI.Widget, {
_store: function () {
return new Demo.FixSceneFineIndexUpdateStore();
},
watch: {
needUpdate: function () {
this.button.setEnable(this.model.needUpdate);
},
text: function () {
this.button.setText(this.model.text);
}
},
render: function () {
var self = this;
return {
type: "bi.center_adapt",
items: [{
type: "bi.button",
text: this.model.text,
disabled: !this.model.needUpdate,
height: 30,
width: 360,
handler: function () {
self.store.updateFineIndex();
},
ref: function (ref) {
self.button = ref;
}
}]
};
}
});
BI.shortcut("demo.fix_scene_fine_index_update", Demo.FixSceneFineIndexUpdate);
})();
/***/ }),
/* 1202 */
/***/ (function(module, exports) {
(function () {
var State = BI.inherit(Fix.Model, {
state: function () {
return {
name: "原始属性"
};
},
computed: {
b: function () {
return this.model.name + "-计算属性";
}
}
});
Demo.Fix = BI.inherit(BI.Widget, {
_store: function () {
return new State();
},
watch: {
b: function () {
this.button.setText(this.model.b);
}
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.model.name = "这是改变后的属性";
},
text: this.model.b
}
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.fix_state", Demo.Fix);
}());
/***/ }),
/* 1203 */
/***/ (function(module, exports) {
(function () {
var model = Fix.define({
name: "原始属性",
arr: [{
n: "a"
}, {
n: "b"
}]
});
var Store = BI.inherit(Fix.Model, {
_init: function () {
},
computed: {
b: function () {
return model.name + "-计算属性";
}
},
actions: {
run: function () {
model.name = "这是改变后的属性";
}
}
});
Demo.Fix = BI.inherit(BI.Widget, {
_store: function () {
return new Store();
},
watch: {
b: function () {
this.button.setText(this.model.b);
}
},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
self.store.run();
},
text: this.model.b
}
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.fix_store", Demo.Fix);
}());
/***/ }),
/* 1204 */
/***/ (function(module, exports) {
(function () {
var model = Fix.define({
name: "原始属性",
arr: [{
n: "a"
}, {
n: 0
}]
});
Demo.Fix = BI.inherit(BI.Widget, {
_store: function () {
return model;
},
watch: {
"name||arr.1.n": function () {
this.button.setText(this.model.name + "-" + this.model.arr[1].n);
}
},
render: function () {
var self = this;
var cnt = 0;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.button",
ref: function () {
self.button = this;
},
handler: function () {
if (cnt & 1) {
self.model.name += 1;
} else {
self.model.arr[1].n += 1;
}
cnt++;
},
text: this.model.name + "-" + this.model.arr[1].n
}
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.fix_watcher", Demo.Fix);
}());
/***/ }),
/* 1205 */
/***/ (function(module, exports) {
Demo.Main = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-main bi-background"
},
_store: function () {
return BI.Stores.getStore("demo.store.main");
},
watch: {
activeCard: function (v) {
this.center.setValue(v);
}
},
beforeInit: function (cb) {
this.store.init(cb);
},
render: function () {
var self = this;
return {
type: "bi.border",
items: {
north: {
height: 50,
el: {
type: "demo.north",
listeners: [{
eventName: Demo.North.EVENT_VALUE_CHANGE,
action: function (v) {
self.store.handleTreeSelectChange(v);
}
}]
}
},
west: {
width: 230,
el: {
type: "demo.west",
listeners: [{
eventName: Demo.West.EVENT_VALUE_CHANGE,
action: function (v) {
self.store.handleTreeSelectChange(v);
}
}]
}
},
center: {
el: {
type: "demo.center",
ref: function (_ref) {
self.center = _ref;
}
}
}
}
};
}
});
BI.shortcut("demo.main", Demo.Main);
/***/ }),
/* 1206 */
/***/ (function(module, exports) {
!(function () {
var Store = BI.inherit(Fix.Model, {
_init: function () {
},
state: function () {
return {
activeCard: Demo.showIndex
};
},
computed: {},
watch: {},
actions: {
init: function (cb) {
var tree = BI.Tree.transformToTreeFormat(Demo.CONFIG);
var traversal = function (array, callback) {
var t = [];
BI.some(array, function (i, item) {
var match = callback(i, item);
if (match) {
t.push(item.id);
}
var b = traversal(item.children, callback);
if (BI.isNotEmptyArray(b)) {
t = BI.concat([item.id], b);
}
});
return t;
};
var paths = traversal(tree, function (index, node) {
if (!node.children || BI.isEmptyArray(node.children)) {
if (node.value === Demo.showIndex) {
return true;
}
}
});
BI.each(Demo.CONFIG, function (index, item) {
if (BI.contains(paths, item.id)) {
item.open = true;
}
});
cb();
},
handleTreeSelectChange: function (v) {
this.model.activeCard = v;
var matched = BI.some(Demo.CONFIG, function (index, item) {
if (item.value === v) {
BI.history.navigate(item.text, {trigger: true});
return true;
}
});
if (!matched) {
BI.history.navigate("", {trigger: true});
}
}
}
});
BI.store("demo.store.main", Store);
})();
/***/ }),
/* 1207 */
/***/ (function(module, exports) {
Demo.North = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-north"
},
render: function () {
var self = this;
return {
type: "bi.htape",
items: [{
width: 230,
el: {
type: "bi.text_button",
listeners: [{
eventName: BI.Button.EVENT_CHANGE,
action: function () {
self.fireEvent(Demo.North.EVENT_VALUE_CHANGE, "demo.face");
}
}],
cls: "logo",
height: 50,
text: "FineUI2.0"
}
}, {
el: {
type: "bi.right",
hgap: 10,
items: [{
type: "bi.text_button",
text: "星空蓝",
handler: function () {
BI.$("html").removeClass("bi-theme-default").addClass("bi-theme-dark");
}
}, {
type: "bi.text_button",
text: "典雅白",
handler: function () {
BI.$("html").removeClass("bi-theme-dark").addClass("bi-theme-default");
}
}]
}
}]
};
}
});
Demo.North.EVENT_VALUE_CHANGE = "EVENT_VALUE_CHANGE";
BI.shortcut("demo.north", Demo.North);
/***/ }),
/* 1208 */
/***/ (function(module, exports) {
Demo.Preview = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-preview"
},
render: function () {
var self = this;
var items = [], header = [], columnSize = [];
var rowCount = 100, columnCount = 100;
for (var i = 0; i < 1; i++) {
header[i] = [];
for (var j = 0; j < columnCount; j++) {
header[i][j] = {
type: "bi.label",
text: "表头" + i + "-" + j
};
columnSize[j] = 100;
}
}
for (var i = 0; i < rowCount; i++) {
items[i] = [];
for (var j = 0; j < columnCount; j++) {
items[i][j] = {
type: "bi.label",
text: (i < 3 ? 0 : i) + "-" + j
};
}
}
return {
type: "bi.absolute",
cls: "preview-background",
items: [{
el: {
type: "bi.vtape",
cls: "preview-card bi-card",
items: [{
el: {
type: "bi.label",
cls: "preview-title bi-border-bottom",
height: 40,
text: "Card",
hgap: 10,
textAlign: "left"
},
height: 40
}, {
type: "bi.center_adapt",
scrollable: true,
items: [{
type: "bi.resizable_table",
el: {
type: "bi.collection_table"
},
width: 500,
height: 400,
isResizeAdapt: true,
isNeedResize: true,
isNeedMerge: true,
mergeCols: [0, 1],
mergeRule: function (col1, col2) {
return BI.isEqual(col1, col2);
},
isNeedFreeze: true,
freezeCols: [0, 1],
columnSize: columnSize,
items: items,
header: header
}]
}]
},
left: 60,
right: 60,
top: 60,
bottom: 60
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.preview", Demo.Preview);
/***/ }),
/* 1209 */
/***/ (function(module, exports) {
Demo.West = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-west bi-border-right bi-card"
},
mounted: function () {
this.searcher.setAdapter(this.tree);
},
render: function () {
var self = this;
return {
type: "bi.vtape",
items: [{
type: "bi.center_adapt",
items: [{
type: "bi.searcher",
el: {
type: "bi.search_editor",
watermark: "简单搜索"
},
width: 200,
isAutoSearch: false,
isAutoSync: false,
ref: function (ref) {
self.searcher = ref;
},
popup: {
type: "bi.multilayer_single_level_tree",
cls: "bi-card",
listeners: [{
eventName: BI.MultiLayerSingleLevelTree.EVENT_CHANGE,
action: function (v) {
self.fireEvent(Demo.West.EVENT_VALUE_CHANGE, v);
}
}]
},
onSearch: function (op, callback) {
var result = BI.Func.getSearchResult(Demo.CONFIG, op.keyword, "text");
var items = BI.concat(result.match, result.find);
var children = [];
BI.each(items, function (index, item) {
var childList = BI.Func.getSearchResult(Demo.CONFIG, item.id, "pId");
BI.each(childList.match, function (index, child) {
if (child.value) {
children.push(child);
}
});
});
items = BI.concat(items, children);
callback(items);
}
}],
height: 40
}, {
type: "bi.multilayer_single_level_tree",
listeners: [{
eventName: BI.MultiLayerSingleLevelTree.EVENT_CHANGE,
action: function (v) {
self.fireEvent(Demo.West.EVENT_VALUE_CHANGE, v);
}
}],
value: Demo.showIndex,
items: Demo.CONFIG,
ref: function (ref) {
self.tree = ref;
}
}]
};
}
});
Demo.West.EVENT_VALUE_CHANGE = "EVENT_VALUE_CHANGE";
BI.shortcut("demo.west", Demo.West);
/***/ }),
/* 1210 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/25.
*/
Demo.Buttons = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-button"
},
render: function () {
var items = [
{
el: {
type: "bi.button",
text: "一般按钮",
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "带图标的按钮",
// level: 'ignore',
iconCls: "close-font",
height: 30
}
}, {
el: {
type: "bi.button",
text: "一般按钮",
block: true,
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "一般按钮",
clear: true,
level: "common",
height: 30
}
}, {
el: {
type: "bi.multi_select_bar",
selected: true,
halfSelected: true
}
}, {
el: {
type: "bi.multi_select_bar",
selected: true,
halfSelected: false
}
}, {
el: {
type: "bi.multi_select_bar",
selected: false,
halfSelected: true
}
}, {
el: {
type: "bi.multi_select_bar"
}
}
];
BI.each(items, function (i, item) {
item.el.handler = function () {
BI.Msg.alert("按钮", this.options.text);
};
});
return {
type: "bi.left",
vgap: 100,
hgap: 20,
items: items
};
}
});
BI.shortcut("demo.buttons", Demo.Buttons);
/***/ }),
/* 1211 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/25.
*/
Demo.Items = BI.inherit(BI.Widget, {
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.text_button",
cls: "bi-list-item-select bi-high-light-border bi-border",
height: 30,
level: "warning",
text: "单选item"
}, {
type: "bi.single_select_item",
text: "单选项"
}, {
type: "bi.single_select_radio_item",
text: "单选项"
}, {
type: "bi.label",
height: 30,
text: "复选item"
}, {
type: "bi.multi_select_item",
text: "复选项"
}, {
type: "bi.switch",
selected: true
}],
hgap: 300
};
}
});
BI.shortcut("demo.items", Demo.Items);
/***/ }),
/* 1212 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/25.
*/
Demo.Nodes = BI.inherit(BI.Widget, {
render: function (vessel) {
return {
type: "bi.vertical",
items: [{
type: "bi.label",
height: 30,
text: "十字形的节点"
}, {
type: "bi.plus_group_node",
text: "十字形的节点"
}, {
type: "bi.label",
height: 30,
text: "箭头节点"
}, {
type: "bi.arrow_group_node",
text: "箭头节点"
}, {
type: "bi.icon_arrow_node",
iconCls: "search-font",
text: "箭头图标节点"
}, {
type: "bi.multilayer_icon_arrow_node",
layer: 2
}]
};
}
});
BI.shortcut("demo.nodes", Demo.Nodes);
/***/ }),
/* 1213 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/25.
*/
Demo.Segments = BI.inherit(BI.Widget, {
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.label",
height: 30,
text: "默认风格"
}, {
type: "bi.segment",
items: [{
text: "tab1",
value: 1,
selected: true
}, {
text: "tab2",
value: 2
}, {
text: "tab3 disabled",
disabled: true,
value: 3
}]
}],
hgap: 50,
vgap: 20
};
}
});
BI.shortcut("demo.segments", Demo.Segments);
/***/ }),
/* 1214 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/25.
*/
Demo.Tips = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-tips"
},
render: function () {
var btns = [];
var bubble = BI.createWidget({
type: "bi.left",
items: [{
el: {
type: "bi.button",
text: "bubble测试",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble1", "bubble测试", this);
btns.push("singleBubble1");
}
}
}, {
el: {
type: "bi.button",
text: "bubble测试(居中显示)",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble2", "bubble测试", this, {
offsetStyle: "center"
});
btns.push("singleBubble2");
}
}
}, {
el: {
type: "bi.button",
text: "bubble测试(右边显示)",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble3", "bubble测试", this, {
offsetStyle: "right"
});
btns.push("singleBubble3");
}
}
}, {
el: {
type: "bi.button",
text: "隐藏所有 bubble",
height: 30,
cls: "layout-bg2",
handler: function () {
BI.each(btns, function (index, value) {
BI.Bubbles.hide(value);
});
}
}
}],
hgap: 20
});
var title = BI.createWidget({
type: "bi.vertical",
items: [{
type: "bi.label",
cls: "layout-bg1",
height: 50,
title: "title提示",
text: "移上去有title提示",
textAlign: "center"
}, {
type: "bi.label",
cls: "layout-bg6",
height: 50,
disabled: true,
warningTitle: "title错误提示",
text: "移上去有title错误提示",
textAlign: "center"
}, {
type: "bi.label",
cls: "layout-bg2",
height: 50,
disabled: true,
tipType: "success",
title: "自定义title提示效果",
warningTitle: "自定义title提示效果",
text: "自定义title提示效果",
textAlign: "center"
}],
hgap: 20,
vgap: 20
});
var toast = BI.createWidget({
type: "bi.vertical",
items: [{
el: {
type: "bi.button",
text: "简单Toast测试",
height: 30,
handler: function () {
BI.Msg.toast("这是一条简单的数据");
}
}
}, {
el: {
type: "bi.button",
text: "很长的Toast测试",
height: 30,
handler: function () {
BI.Msg.toast("这是一条很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长的数据");
}
}
}, {
el: {
type: "bi.button",
text: "非常长的Toast测试",
height: 30,
handler: function () {
BI.Msg.toast("这是一条非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长的数据");
}
}
}, {
el: {
type: "bi.button",
text: "错误提示Toast测试",
level: "warning",
height: 30,
handler: function () {
BI.Msg.toast("错误提示Toast测试", "warning");
}
}
}],
vgap: 20
});
return {
type: "bi.horizontal_auto",
vgap: 20,
hgap: 20,
items: [bubble, title, toast]
};
}
});
BI.shortcut("demo.tips", Demo.Tips);
/***/ }),
/* 1215 */
/***/ (function(module, exports) {
Demo.DatePane = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-datepane"
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.vertical",
vgap: 10,
items: [{
type: "bi.label",
cls: "layout-bg2",
text: "bi.date_pane"
}, {
type: "bi.dynamic_date_pane",
// value: {
// type: 1,
// value: {
// year: 2017,
// month: 12,
// day: 11
// }
// },
ref: function (_ref) {
self.datepane = _ref;
},
height: 300
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast("date" + JSON.stringify(self.datepane.getValue()));
}
}, {
type: "bi.dynamic_date_time_pane",
value: {
type: 1,
value: {
year: 2017,
month: 12,
day: 11,
hour: 12,
minute: 12,
second: 12
}
},
ref: function (_ref) {
self.dateTimePane = _ref;
},
height: 340
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast("date" + JSON.stringify(self.dateTimePane.getValue()));
}
}, {
type: "bi.button",
text: "setValue '2017-12-31'",
handler: function () {
self.datepane.setValue({
year: 2017,
month: 12,
day: 31
});
}
}
],
width: "50%"
}]
};
},
mounted: function () {
this.datepane.setValue();// 不设value值表示当前时间
}
});
BI.shortcut("demo.date_pane", Demo.DatePane);
/***/ }),
/* 1216 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/11.
*/
Demo.Date = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-date"
},
_init: function () {
Demo.Date.superclass._init.apply(this, arguments);
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
vgap: 20,
items: [{
type: "bi.dynamic_date_combo",
ref: function () {
self.datecombo = this;
},
width: 300,
// allowEdit: false,
// format: "%Y-%X-%d", // yyyy-MM-dd
// format: "%Y/%X/%d", // yyyy/MM/dd
// format: "%Y-%x-%e", // yyyy-M-d
// format: "%Y/%x/%e", // yyyy/M/d
// format: "%X/%d/%Y", // MM/dd/yyyy
// format: "%X/%e/%y", // MM/d/yy
// format: "%X.%d.%Y", // MM.dd.yyyy
// format: "%X.%e.%Y", // MM.d.yyyy
// format: "%X-%e-%y", // MM.d.yyyy
value: {
type: 1,
value: {
year: 2018,
month: 2,
day: 23
}
}
}, {
type: "bi.button",
text: "getValue",
width: 300,
handler: function () {
BI.Msg.alert("date", JSON.stringify(self.datecombo.getValue()));
}
}, {
type: "bi.dynamic_date_time_combo",
ref: function () {
self.datetimecombo = this;
},
width: 300,
// allowEdit: false,
// format: "%Y-%X-%d %H:%M:%S", // yyyy-MM-dd HH:mm:ss
// format: "%Y/%X/%d %H:%M:%S", // yyyy/MM/dd HH:mm:ss
// format: "%Y-%X-%d %I:%M:%S", // yyyy-MM-dd hh:mm:ss
// format: "%Y/%X/%d %I:%M:%S", // yyyy/MM/dd hh:mm:ss
// format: "%Y-%X-%d %H:%M:%S %p", // yyyy-MM-dd HH:mm:ss a
// format: "Y/%X/%d %H:%M:%S %p", // yyyy/MM/dd HH:mm:ss a
// format: "%Y-%X-%d %I:%M:%S %p", // yyyy-MM-dd hh:mm:ss a
// format: "%Y/%X/%d %I:%M:%S %p", // yyyy/MM/dd hh:mm:ss a
// format: "%X/%d/%Y %I:%M:%S", // MM/dd/yyyy hh:mm:ss
// format: "%X/%d/%Y %H:%M:%S", // MM/dd/yyyy HH:mm:ss
// format: "%X/%d/%Y %I:%M:%S", // MM/dd/yyyy hh:mm:ss a
// format: "%X/%d/%Y %H:%M:%S %p", // MM/dd/yyyy HH:mm:ss a
// format: "%X/%d/%Y %I:%M:%S %p", // MM/dd/yyyy hh:mm:ss a
// format: "%X/%d/%Y %H:%M:%S %p", // MM/dd/yyyy HH:mm:ss a
// format: "%X/%d/%Y %l:%M %p", // MM/dd/yyyy h:mm a
// format: "%X-%d-%Y %k:%M %p", // MM/dd/yyyy H:mm a
// format: "%Y-%x-%e %l:%M", // yyyy-M-d h:mm
// format: "%Y-%x-%e %k:%M", // yyyy-M-d H:mm
value: {
type: 1,
value: {
year: 2018,
month: 2,
day: 23
}
}
}, {
type: "bi.button",
text: "getValue",
width: 300,
handler: function () {
BI.Msg.alert("date", JSON.stringify(self.datetimecombo.getValue()));
}
}, {
type: "bi.button",
text: "setValue '2017-12-31'",
width: 300,
handler: function () {
self.datecombo.setValue({
year: 2017,
month: 11,
day: 31
});
}
}]
};
}
});
BI.shortcut("demo.multidate_combo", Demo.Date);
/***/ }),
/* 1217 */
/***/ (function(module, exports) {
/**
* Created by Urthur on 2017/7/18.
*/
Demo.CustomDateTime = BI.inherit(BI.Widget, {
props: {},
render: function () {
var self = this;
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.date_time_combo",
listeners: [{
eventName: BI.DateTimeCombo.EVENT_CONFIRM,
action: function () {
var value = this.getValue();
var date = new Date(value.year, value.month - 1, value.day, value.hour, value.minute, value.second);
var dateStr = BI.print(date, "%Y-%X-%d %H:%M:%S");
BI.Msg.alert("日期", dateStr);
}
}, {
eventName: BI.DateTimeCombo.EVENT_CANCEL,
action: function () {
}
}],
value: {
year: 2017,
month: 2,
day: 23,
hour: 12,
minute: 11,
second: 1
}
},
top: 200,
left: 200
}]
};
}
});
BI.shortcut("demo.date_time", Demo.CustomDateTime);
/***/ }),
/* 1218 */
/***/ (function(module, exports) {
Demo.Downlist = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-downlist"
},
mounted: function () {
var downlist = this.downlist;
var label = this.label;
this.downlist.setValue([{
value: [11, 6],
childValue: 67
}]);
downlist.on(BI.DownListCombo.EVENT_CHANGE, function (value, fatherValue) {
label.setValue(JSON.stringify(downlist.getValue()));
});
this.downlist.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function (value, fatherValue) {
label.setValue(JSON.stringify(downlist.getValue()));
});
},
render: function () {
var self = this;
// test
return {
type: "bi.horizontal_adapt",
items: [{
type: "bi.down_list_combo",
ref: function (_ref) {
self.downlist = _ref;
},
// value: [{"childValue":22,"value":11},{"value":18},{"value":20}],
height: 30,
width: 100,
items: [
[{
el: {
text: "column 1111",
iconCls1: "dot-e-font",
value: 12
},
children: [{
text: "column 1.1",
value: 21,
cls: "dot-e-font"
}, {
text: "column 1.2",
value: 22,
cls: "dot-e-font"
}]
}],
[{
el: {
text: "column 1111",
iconCls1: "dot-e-font",
value: 11
},
children: [{
text: "column 1.1",
value: 21,
cls: "dot-e-font"
}, {
text: "column 1.2",
value: 22,
cls: "dot-e-font"
}]
// children: [{
// text: BI.i18nText("BI-Basic_None"),
// cls: "dot-e-font",
// value: 1
// }, {
// text: BI.i18nText("BI-Basic_Calculate_Same_Period"),
// cls: "dot-e-font",
// value: 2
// }, {
// text: BI.i18nText("BI-Basic_Calculate_Same_Ring"),
// cls: "dot-e-font",
// value: 3
// }, {
// text: BI.i18nText("BI-Basic_Calculate_Same_Period_Rate"),
// cls: "dot-e-font",
// value: 4
// }, {
// text: BI.i18nText("BI-Basic_Calculate_Same_Ring_Rate"),
// cls: "dot-e-font",
// value: 5
// }, {
// el: {
// text: BI.i18nText("BI-Basic_Rank"),
// iconCls1: "dot-e-font",
// value: 6
// },
// children: [{
// text: "test1",
// cls: "dot-e-font",
// value: 67
// }, {
// text: "test2",
// cls: "dot-e-font",
// value: 68
// }]
// }, {
// text: BI.i18nText("BI-Basic_Rank_In_Group"),
// cls: "dot-e-font",
// value: 7
// }, {
// text: BI.i18nText("BI-Basic_Sum_Of_All"),
// cls: "dot-e-font",
// value: 8
// }, {
// text: BI.i18nText("BI-Basic_Sum_Of_All_In_Group"),
// cls: "dot-e-font",
// value: 9
// }, {
// text: BI.i18nText("BI-Basic_Sum_Of_Above"),
// cls: "dot-e-font",
// value: 10
// }, {
// text: BI.i18nText("BI-Basic_Sum_Of_Above_In_Group"),
// cls: "dot-e-font",
// value: 11
// }, {
// text: BI.i18nText("BI-Design_Current_Dimension_Percent"),
// cls: "dot-e-font",
// value: 12
// }, {
// text: BI.i18nText("BI-Design_Current_Target_Percent"),
// cls: "dot-e-font",
// value: 13
// }]
}]
]
}, {
type: "bi.multi_layer_down_list_combo",
ref: function (_ref) {
self.downlist = _ref;
},
// value: [{"childValue":22,"value":11},{"value":18},{"value":20}],
height: 30,
width: 100,
items: [
[{
el: {
text: "column 1111",
iconCls1: "dot-e-font",
value: 12
},
children: [{
text: "column 1.1",
value: 21,
cls: "dot-e-font"
}, {
text: "column 1.2",
value: 22,
cls: "dot-e-font"
}]
}],
[{
el: {
text: "column 1111",
iconCls1: "dot-e-font",
value: 11
},
children: [{
text: "column 1.1",
value: 21,
cls: "dot-e-font"
}, {
text: "column 1.2",
value: 22,
cls: "dot-e-font"
}]
}]
]
}, {
type: "bi.label",
text: "显示选择值",
width: 500,
cls: "layout-bg3",
ref: function (_ref) {
self.label = _ref;
}
}],
vgap: 20
};
},
});
BI.shortcut("demo.down_list", Demo.Downlist);
/***/ }),
/* 1219 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/11.
*/
Demo.SearchEditor = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.search_editor",
width: 300,
watermark: "添加合法性判断",
errorText: "长度必须大于4",
validationChecker: function () {
return this.getValue().length > 4;
}
}, {
type: "bi.small_search_editor",
width: 300,
watermark: "这个是 small,小一号"
}],
vgap: 20
};
}
});
BI.shortcut("demo.search_editor", Demo.SearchEditor);
/***/ }),
/* 1220 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/11.
*/
Demo.TextEditor = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.text_editor",
watermark: "这是水印,watermark",
width: 300
}, {
type: "bi.text_editor",
watermark: "这个不予许空",
allowBlank: false,
errorText: "非空!",
width: 300
}],
vgap: 20
};
}
});
BI.shortcut("demo.text_editor", Demo.TextEditor);
/***/ }),
/* 1221 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-multi-select-combo"
},
_createMultiSelectCombo: function () {
var self = this;
var widget = BI.createWidget({
type: "bi.multi_select_insert_combo",
// allowEdit: false,
itemsCreator: BI.bind(this._itemsCreator, this),
width: 200,
value: {
type: 1,
value: ["柳州市城贸金属材料有限责任公司", "柳州市建福房屋租赁有限公司", "柳州市迅昌数码办公设备有限责任公司"]
}
});
widget.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {
BI.Msg.toast(JSON.stringify(this.getValue()));
});
return widget;
},
_getItemsByTimes: function (items, times) {
var res = [];
for (var i = (times - 1) * 100; items[i] && i < times * 100; i++) {
res.push(items[i]);
}
return res;
},
_hasNextByTimes: function (items, times) {
return times * 100 < items.length;
},
_itemsCreator: function (options, callback) {
var self = this;
var items = Demo.CONSTANTS.ITEMS;
var keywords = (options.keywords || []).slice();
if (options.keyword) {
keywords.push(options.keyword);
}
BI.each(keywords, function (i, kw) {
var search = BI.Func.getSearchResult(items, kw);
items = search.match.concat(search.find);
});
if (options.selectedValues) {// 过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});
}
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: items
});
return;
}
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}
BI.delay(function () {
callback({
items: self._getItemsByTimes(items, options.times),
hasNext: self._hasNextByTimes(items, options.times)
});
}, 1000);
},
render: function () {
return {
type: "bi.absolute",
scrolly: false,
items: [{
el: this._createMultiSelectCombo(),
right: "50%",
top: 10
}]
};
}
});
BI.shortcut("demo.multi_select_combo", Demo.MultiSelectCombo);
/***/ }),
/* 1222 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.MultiSelectList = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-multi-select-combo"
},
mounted: function () {
this.list.populate();
},
_createMultiSelectCombo: function () {
var self = this;
var widget = BI.createWidget({
type: "bi.multi_select_insert_list",
ref: function (ref) {
self.list = ref;
},
itemsCreator: BI.bind(this._itemsCreator, this),
value: {
type: 1,
value: ["柳州市城贸金属材料有限责任公司", "柳州市建福房屋租赁有限公司", "柳州市迅昌数码办公设备有限责任公司"]
}
});
widget.on(BI.MultiSelectCombo.EVENT_CONFIRM, function () {
BI.Msg.toast(JSON.stringify(this.getValue()));
});
return widget;
},
_getItemsByTimes: function (items, times) {
var res = [];
for (var i = (times - 1) * 10; items[i] && i < times * 10; i++) {
res.push(items[i]);
}
return res;
},
_hasNextByTimes: function (items, times) {
return times * 10 < items.length;
},
_itemsCreator: function (options, callback) {
var self = this;
var items = Demo.CONSTANTS.ITEMS;
var keywords = (options.keywords || []).slice();
if (options.keyword) {
keywords.push(options.keyword);
}
BI.each(keywords, function (i, kw) {
var search = BI.Func.getSearchResult(items, kw);
items = search.match.concat(search.find);
});
if (options.selectedValues) {// 过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});
}
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: items
});
return;
}
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}
BI.delay(function () {
callback({
items: self._getItemsByTimes(items, options.times),
hasNext: self._hasNextByTimes(items, options.times)
});
}, 1000);
},
render: function () {
return {
type: "bi.absolute",
scrolly: false,
items: [{
el: this._createMultiSelectCombo(),
top: 50,
left: 50,
right: 50,
bottom: 50
}]
};
}
});
BI.shortcut("demo.multi_select_list", Demo.MultiSelectList);
/***/ }),
/* 1223 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/13.
*/
Demo.MultiTreeCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
var items = BI.deepClone(Demo.CONSTANTS.TREE);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.multi_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
itemsCreator: function (options, callback) {
console.log(options);
// 根据不同的类型处理相应的结果
switch (options.type) {
case BI.TreeView.REQ_TYPE_INIT_DATA:
break;
case BI.TreeView.REQ_TYPE_ADJUST_DATA:
break;
case BI.TreeView.REQ_TYPE_SELECT_DATA:
break;
case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:
break;
default :
break;
}
callback({
items: items
});
},
width: 300,
value: {
"根目录": {}
}
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.tree.getValue()));
},
width: 300
}],
vgap: 20
};
}
});
BI.shortcut("demo.multi_tree_combo", Demo.MultiTreeCombo);
/***/ }),
/* 1224 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/13.
*/
Demo.MultiTreeCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
mounted: function () {
this.tree.populate();
},
render: function () {
var self = this;
var items = BI.deepClone(Demo.CONSTANTS.TREE);
return {
type: "bi.absolute",
items: [{
el: {
type: "bi.multi_select_tree",
ref: function (_ref) {
self.tree = _ref;
},
itemsCreator: function (options, callback) {
console.log(options);
// 根据不同的类型处理相应的结果
switch (options.type) {
case BI.TreeView.REQ_TYPE_INIT_DATA:
break;
case BI.TreeView.REQ_TYPE_ADJUST_DATA:
break;
case BI.TreeView.REQ_TYPE_SELECT_DATA:
break;
case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:
break;
default :
break;
}
callback({
items: BI.deepClone(items)
});
},
width: 300,
value: {
"根目录": {}
}
},
top: 50,
bottom: 50,
left: 50,
right: 50
}, {
el: {
type: "bi.button",
height: 30,
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.tree.getValue()));
}
},
left: 50,
right: 50,
bottom: 20
}]
};
}
});
BI.shortcut("demo.multi_select_tree", Demo.MultiTreeCombo);
/***/ }),
/* 1225 */
/***/ (function(module, exports) {
/* 文件管理导航
Created by dailer on 2017 / 7 / 21.
*/
Demo.FileManager = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var editor = BI.createWidget({
type: "bi.number_editor",
validationChecker: function (v) {
return BI.parseFloat(v) <= 100 && BI.parseFloat(v) >= 0;
},
height: 24,
width: 150,
errorText: "hahah"
});
editor.on(BI.NumberEditor.EVENT_CHANGE, function () {
if (BI.parseFloat(this.getValue()) < 1) {
editor.setDownEnable(false);
} else {
editor.setDownEnable(true);
}
BI.Msg.toast(editor.getValue());
});
return {
type: "bi.vertical",
items: [{
el: editor,
height: 24
}]
};
}
});
BI.shortcut("demo.number_editor", Demo.FileManager);
/***/ }),
/* 1226 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/12.
*/
Demo.NumericalInterval = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
mounted: function () {
var numerical = this.numerical;
var label = this.label;
numerical.on(BI.NumberInterval.EVENT_CONFIRM, function () {
var temp = numerical.getValue();
var res = "大于" + (temp.closemin ? "等于 " : " ") + temp.min + " 小于" + (temp.closemax ? "等于 " : " ") + temp.max;
label.setValue(res);
});
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.number_interval",
ref: function (_ref) {
self.numerical = _ref;
},
width: 500,
value: {
max: 300,
closeMax: true,
closeMin: false
}
}, {
type: "bi.label",
ref: function (_ref) {
self.label = _ref;
},
text: "显示结果"
}],
vgap: 20
};
}
});
BI.shortcut("demo.number_interval", Demo.NumericalInterval);
/***/ }),
/* 1227 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/13.
*/
Demo.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
var items = BI.deepClone(Demo.CONSTANTS.TREE);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.multilayer_select_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
text: "默认值",
items: items,
width: 300,
value: ["第五级文件1"]
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300
}, {
type: "bi.button",
text: "setVlaue (第二级文件1)",
handler: function () {
self.tree.setValue(["第二级文件1"]);
},
width: 300
}],
vgap: 20
};
}
});
BI.shortcut("demo.multilayer_select_tree_combo", Demo.MultiLayerSelectTreeCombo);
/***/ }),
/* 1228 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/13.
*/
Demo.SelectTreeCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
var self = this;
var items = BI.deepClone(Demo.CONSTANTS.LEVELTREE);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.select_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
value: "11",
text: "默认值",
items: items,
width: 300
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300
}, {
type: "bi.button",
text: "setVlaue (第二级文件1)",
handler: function () {
self.tree.setValue(["2"]);
},
width: 300
}],
vgap: 20
};
}
});
BI.shortcut("demo.select_tree_combo", Demo.SelectTreeCombo);
/***/ }),
/* 1229 */
/***/ (function(module, exports) {
/**
* Created by User on 2017/3/22.
*/
Demo.SingleSelectCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-single-select-combo"
},
_createSingleSelectCombo: function () {
var self = this;
var widget = BI.createWidget({
type: "bi.single_select_insert_combo",
itemsCreator: BI.bind(this._itemsCreator, this),
width: 200,
ref: function () {
self.SingleSelectCombo = this;
},
value: "柳州市针织总厂"
});
widget.populate();
widget.on(BI.SingleSelectCombo.EVENT_CONFIRM, function () {
BI.Msg.toast(JSON.stringify(this.getValue()));
});
return widget;
},
_getItemsByTimes: function (items, times) {
var res = [];
for (var i = (times - 1) * 100; items[i] && i < times * 100; i++) {
res.push(items[i]);
}
return res;
},
_hasNextByTimes: function (items, times) {
return times * 100 < items.length;
},
_itemsCreator: function (options, callback) {
var self = this;
var items = Demo.CONSTANTS.ITEMS;
var keywords = (options.keywords || []).slice();
if (options.keyword) {
keywords.push(options.keyword);
}
BI.each(keywords, function (i, kw) {
var search = BI.Func.getSearchResult(items, kw);
items = search.match.concat(search.find);
});
if (options.selectedValues) {// 过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});
}
if (options.type == BI.SingleSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: items
});
return;
}
if (options.type == BI.SingleSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}
BI.delay(function () {
callback({
items: self._getItemsByTimes(items, options.times),
hasNext: self._hasNextByTimes(items, options.times)
});
}, 1000);
},
render: function () {
var self = this;
return {
type: "bi.absolute",
scrolly: false,
items: [{
el: this._createSingleSelectCombo(),
right: "50%",
top: 10
}, {
el: {
type: "bi.button",
text: "setValue(\"柳州市针织总厂\")",
handler: function () {
self.SingleSelectCombo.setValue("柳州市针织总厂");
}
}
}]
};
}
});
BI.shortcut("demo.single_select_combo", Demo.SingleSelectCombo);
/***/ }),
/* 1230 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/13.
*/
Demo.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
var items = BI.deepClone(Demo.CONSTANTS.TREE);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.multilayer_single_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
text: "默认值",
items: items,
width: 300
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300
}, {
type: "bi.button",
text: "setVlaue (第二级文件1)",
handler: function () {
self.tree.setValue(["第二级文件1"]);
},
width: 300
}],
vgap: 20
};
}
});
BI.shortcut("demo.multilayer_single_tree_combo", Demo.MultiLayerSingleTreeCombo);
/***/ }),
/* 1231 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/13.
*/
Demo.SingleTreeCombo = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
var self = this;
var items = BI.deepClone(Demo.CONSTANTS.LEVELTREE);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.single_tree_combo",
ref: function (_ref) {
self.tree = _ref;
},
text: "默认值",
items: items,
width: 300,
value: "11"
}, {
type: "bi.button",
text: "getVlaue",
handler: function () {
BI.Msg.toast(self.tree.getValue()[0]);
},
width: 300
}, {
type: "bi.button",
text: "setVlaue (第二级文件1)",
handler: function () {
self.tree.setValue(["2"]);
},
width: 300
}],
vgap: 20
};
}
});
BI.shortcut("demo.single_tree_combo", Demo.SingleTreeCombo);
/***/ }),
/* 1232 */
/***/ (function(module, exports) {
/**
* Created by Urthur on 2017/9/4.
*/
Demo.Slider = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-slider",
width: 300,
height: 50,
min: 0,
max: 100
},
render: function () {
var self = this, o = this.options;
var singleSlider = BI.createWidget({
type: "bi.single_slider",
digit: 0,
width: o.width,
height: o.height,
cls: "layout-bg-white"
});
singleSlider.setMinAndMax({
min: 10,
max: o.max
});
singleSlider.setValue(30);
singleSlider.populate();
singleSlider.on(BI.SingleSlider.EVENT_CHANGE, function () {
console.log(this.getValue());
});
var normalSingleSlider = BI.createWidget({
type: "bi.single_slider_normal",
width: o.width,
height: 30,
cls: "layout-bg-white"
});
normalSingleSlider.setMinAndMax({
min: o.min,
max: o.max
});
normalSingleSlider.setValue(10);
normalSingleSlider.populate();
var singleSliderLabel = BI.createWidget({
type: "bi.single_slider_label",
width: o.width,
height: o.height,
digit: 0,
unit: "个",
cls: "layout-bg-white"
});
singleSliderLabel.setMinAndMax({
min: o.min,
max: o.max
});
singleSliderLabel.setValue(10);
singleSliderLabel.populate();
var intervalSlider = BI.createWidget({
type: "bi.interval_slider",
width: o.width,
digit: 0,
cls: "layout-bg-white"
});
intervalSlider.setMinAndMax({
min: o.min,
max: o.max
});
intervalSlider.setValue({
min: 10,
max: 120
});
intervalSlider.populate();
var intervalSliderLabel = BI.createWidget({
type: "bi.interval_slider",
width: o.width,
unit: "px",
cls: "layout-bg-white",
digit: 1
});
intervalSliderLabel.setMinAndMax({
min: 0,
max: 120
});
intervalSliderLabel.setValue({
min: 10,
max: 120
});
intervalSliderLabel.populate();
return {
type: "bi.vertical",
element: this,
items: [{
type: "bi.center_adapt",
items: [{
el: singleSlider
}]
}, {
type: "bi.center_adapt",
items: [{
el: normalSingleSlider
}]
}, {
type: "bi.center_adapt",
items: [{
el: singleSliderLabel
}]
}, {
type: "bi.center_adapt",
items: [{
el: intervalSlider
}]
}, {
type: "bi.center_adapt",
items: [{
el: intervalSliderLabel
}]
}],
vgap: 20
};
}
});
BI.shortcut("demo.slider", Demo.Slider);
/***/ }),
/* 1233 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/13.
*/
Demo.TimeCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.time_combo",
ref: function (_ref) {
self.timeCombo = _ref;
},
// allowEdit: true,
// format: "%H:%M:%S", // HH:mm:ss
// format: "%I:%M:%S", // hh:mm:ss
// format: "%l:%M:%S", // h:mm:ss
// format: "%k:%M:%S", // H:mm:ss
// format: "%l:%M:%S %p", // h:mm:ss a
// format: "%l:%M", // h:mm
// format: "%k:%M", // H:mm
// format: "%I:%M", // hh:mm
// format: "%H:%M", // HH:mm
// format: "%M:%S", // mm:ss
value: {
hour: 12,
minute: 0,
second: 0
},
width: 300
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.timeCombo.getValue()));
},
width: 300
}],
vgap: 20
};
}
});
BI.shortcut("demo.time_combo", Demo.TimeCombo);
/***/ }),
/* 1234 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/13.
*/
Demo.TimeInterval = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
var items = BI.deepClone(Demo.CONSTANTS.TREE);
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.date_interval",
ref: function (_ref) {
self.dateInterval = _ref;
},
value: {
start: {
type: 2,
value: {
year: -1,
position: 2
}
},
end: {
type: 1,
value: {
year: 2018,
month: 1,
day: 12
}
}
},
width: 300
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.dateInterval.getValue()));
},
width: 300
}, {
type: "bi.time_interval",
ref: function (_ref) {
self.interval = _ref;
},
value: {
start: {
type: 2,
value: {
year: -1,
position: 2
}
},
end: {
type: 1,
value: {
year: 2018,
month: 1,
day: 12
}
}
},
width: 400
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.interval.getValue()));
},
width: 300
}, {
type: "bi.time_periods",
value: {
start: {
hour: 7,
minute: 23,
second: 14
},
end: {
hour: 23,
minute: 34,
second: 32
}
},
ref: function (_ref) {
self.periods = _ref;
},
width: 180
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.periods.getValue()));
},
width: 300
}],
vgap: 20
};
}
});
BI.shortcut("demo.time_interval", Demo.TimeInterval);
/***/ }),
/* 1235 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/26.
*/
Demo.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, {
render: function () {
var self = this;
var tree = BI.createWidget({
type: "bi.multilayer_select_level_tree",
items: BI.deepClone(Demo.CONSTANTS.TREE),
value: "第五级文件1"
});
return {
type: "bi.vtape",
items: [{
el: tree
}, {
el: {
type: "bi.button",
height: 25,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(tree.getValue()));
}
},
height: 25
}, {
el: {
type: "bi.button",
height: 25,
text: "setValue (第二级文件1)",
handler: function () {
tree.setValue(["第二级文件1"]);
}
},
height: 25
}],
width: 500,
hgap: 300
};
}
});
BI.shortcut("demo.multilayer_select_level_tree", Demo.MultiLayerSelectLevelTree);
/***/ }),
/* 1236 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/26.
*/
Demo.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
render: function () {
var self = this;
this.tree = BI.createWidget({
type: "bi.multilayer_single_level_tree",
items: [],
value: "第二级文件1"
});
return {
type: "bi.vtape",
items: [{
el: this.tree
}, {
el: {
type: "bi.button",
height: 25,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(self.tree.getValue()));
}
},
height: 25
}, {
el: {
type: "bi.button",
height: 25,
text: "setValue (第二级文件1)",
handler: function () {
self.tree.setValue(["第二级文件1"]);
}
},
height: 25
}],
width: 500,
hgap: 300
};
},
mounted: function () {
var tree = [
// {id: -2, pId: 0, value: "根目录1", text: "根目录1"},
{id: -1, pId: 0, value: "根目录", text: "根目录"},
{id: 1, pId: -1, value: "第一级目录1", text: "第一级目录1"},
{id: 11, pId: 1, value: "第二级文件1", text: "第二级文件1"},
{id: 12, pId: 1, value: "第二级目录2", text: "第二级目录2"},
{id: 121, pId: 12, value: "第三级目录1", text: "第三级目录1"},
{id: 122, pId: 12, value: "第三级文件1", text: "第三级文件1"},
{id: 1211, pId: 121, value: "第四级目录1", text: "第四级目录1"},
{id: 2, pId: -1, value: "第一级目录2", text: "第一级目录2"},
{id: 21, pId: 2, value: "第二级目录3", text: "第二级目录3"},
{id: 22, pId: 2, value: "第二级文件2", text: "第二级文件2"},
{id: 211, pId: 21, value: "第三级目录2", text: "第三级目录2"},
{id: 212, pId: 21, value: "第三级文件2", text: "第三级文件2"},
{id: 2111, pId: 211, value: "第四级文件1", text: "第四级文件1"},
{id: 3, pId: -1, value: "第一级目录3", text: "第一级目录3"},
{id: 31, pId: 3, value: "第二级文件2", text: "第二级文件2"},
{id: 33, pId: 3, value: "第二级目录3", text: "第二级目录1"},
{id: 32, pId: 3, value: "第二级文件3", text: "第二级文件3"},
{id: 331, pId: 33, value: "第三级文件1", text: "第三级文件1"}
];
this.tree.populate(tree);
}
});
BI.shortcut("demo.multilayer_single_level_tree", Demo.MultiLayerSingleLevelTree);
/***/ }),
/* 1237 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/26.
*/
Demo.SelectLevelTree = BI.inherit(BI.Widget, {
render: function () {
var self = this;
var tree = BI.createWidget({
type: "bi.select_level_tree",
items: BI.deepClone(Demo.CONSTANTS.LEVELTREE),
value: "11"
});
return {
type: "bi.vtape",
items: [{
el: tree
}, {
el: {
type: "bi.button",
height: 25,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(tree.getValue()));
}
},
height: 25
}, {
el: {
type: "bi.button",
height: 25,
text: "setValue (第二级文件1)",
handler: function () {
tree.setValue(["2"]);
}
},
height: 25
}],
width: 500,
hgap: 300
};
}
});
BI.shortcut("demo.select_level_tree", Demo.SelectLevelTree);
/***/ }),
/* 1238 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/26.
*/
Demo.SingleLevelTree = BI.inherit(BI.Widget, {
render: function () {
var self = this;
var tree = BI.createWidget({
type: "bi.single_level_tree",
items: BI.deepClone(Demo.CONSTANTS.LEVELTREE),
value: "11"
});
return {
type: "bi.vtape",
items: [{
el: tree
}, {
el: {
type: "bi.button",
height: 25,
text: "getValue",
handler: function () {
BI.Msg.alert("", JSON.stringify(tree.getValue()));
}
},
height: 25
}, {
el: {
type: "bi.button",
height: 25,
text: "setValue (第二级文件1)",
handler: function () {
tree.setValue(["2"]);
}
},
height: 25
}],
width: 500,
hgap: 300
};
}
});
BI.shortcut("demo.single_level_tree", Demo.SingleLevelTree);
/***/ }),
/* 1239 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/11.
*/
Demo.Year = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-exceltable"
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
vgap: 10,
items: [{
type: "bi.dynamic_year_combo",
width: 300,
ref: function () {
self.yearcombo = this;
},
value: {
type: 1,
value: {
year: 2017
}
}
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.yearcombo.getValue()));
},
width: 300
}, {
type: "bi.button",
text: "setValue : 2018",
handler: function () {
self.yearcombo.setValue(2018);
},
width: 300
}],
vgap: 10
};
}
});
BI.shortcut("demo.year", Demo.Year);
/***/ }),
/* 1240 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/13.
*/
Demo.YearMonthCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.dynamic_year_month_combo",
ref: function (_ref) {
self.widget = _ref;
},
width: 300,
// value: {
// type: 1,
// value: {
// year: 2018,
// month: 1
// }
// }
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.widget.getValue()));
},
width: 300
}, {
type: "bi.button",
text: "setValue '2017-12'",
width: 300,
handler: function () {
self.widget.setValue({
year: 2017,
month: 12
});
}
}],
vgap: 20
};
}
});
BI.shortcut("demo.year_month_combo", Demo.YearMonthCombo);
/***/ }),
/* 1241 */
/***/ (function(module, exports) {
Demo.YearMonthInterval = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.year_month_interval",
ref: function (_ref) {
self.interval = _ref;
},
value: {
start: {
type: 2,
value: {
year: -1,
month: 1
}
},
end: {
type: 1,
value: {
year: 2018,
month: 1
}
}
},
width: 400
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.interval.getValue()));
},
width: 300
}],
vgap: 20
};
}
});
BI.shortcut("demo.year_month_interval", Demo.YearMonthInterval);
/***/ }),
/* 1242 */
/***/ (function(module, exports) {
/**
* Created by Dailer on 2017/7/13.
*/
Demo.YearQuarterCombo = BI.inherit(BI.Widget, {
props: {
baseCls: ""
},
render: function () {
var self = this;
return {
type: "bi.horizontal_auto",
items: [{
type: "bi.dynamic_year_quarter_combo",
width: 300,
ref: function (_ref) {
self.widget = _ref;
},
yearBehaviors: {},
quarterBehaviors: {},
value: {
type: 1,
value: {
year: 2018,
quarter: 1
}
}
}, {
type: "bi.button",
text: "getValue",
handler: function () {
BI.Msg.toast(JSON.stringify(self.widget.getValue()));
},
width: 300
}, {
type: "bi.button",
text: "setVlaue '2017 季度3'",
width: 300,
handler: function () {
self.widget.setValue({
year: 2017,
quarter: 3
});
}
}],
vgap: 20
};
}
});
BI.shortcut("demo.year_quarter_combo", Demo.YearQuarterCombo);
/***/ }),
/* 1243 */
/***/ (function(module, exports) {
Demo.CONFIG = Demo.CORE_CONFIG.concat(Demo.BASE_CONFIG).concat(Demo.CASE_CONFIG).concat(Demo.WIDGET_CONFIG).concat(Demo.COMPONENT_CONFIG).concat(Demo.FIX_CONFIG);
Demo.CONSTANTS = {
SIMPLE_ITEMS: BI.map("柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂".match(/[^\s]+/g), function (i, v) {
return {
text: v,
value: v,
title: v
};
}),
ITEMS: BI.map("柳州市城贸金属材料有限责任公司 柳州市建福房屋租赁有限公司 柳州市迅昌数码办公设备有限责任公司 柳州市河海贸易有限责任公司 柳州市花篮制衣厂 柳州市兴溪物资有限公司 柳州市针织总厂 柳州市衡管物资有限公司 柳州市琪成机电设备有限公司 柳州市松林工程机械修理厂 柳州市积玉贸易有限公司 柳州市福运来贸易有限责任公司 柳州市钢义物资有限公司 柳州市洋力化工有限公司 柳州市悦盛贸易有限公司 柳州市雁城钢管物资有限公司 柳州市恒瑞钢材经营部 柳州市科拓电子有限公司 柳州市九方电子有限公司 柳州市桂龙汽车配件厂 柳州市制鞋工厂 柳州市炜力科贸有限公司 柳州市希翼贸易有限公司 柳州市兆金物资有限公司 柳州市和润电子科技有限责任公司 柳州市汇凯贸易有限公司 柳州市好机汇商贸有限公司 柳州市泛源商贸经营部 柳州市利汇达物资有限公司 广西全民药业有限责任公司 柳州超凡物资贸易有限责任公司 柳州市贵宏物资有限责任公司 柳州昊恒贸易有限责任公司 柳州市浦联物资有限公司 柳州市广通园林绿化工程有限责任公司 柳州市松发物资贸易有限责任公司 柳州市奥士达办公设备有限责任公司 柳州市海泰物资有限公司 柳州市金三环针织厂 柳州市钢贸物资有限公司 柳州市明阳纺织有限公司 柳州市世科科技发展有限公司 柳州市禄羊贸易有限公司 柳州市金兆阳商贸有限公司 柳州市汇昌物资经营部 柳州市林泰金属物资供应站 柳州市自来水管道材料设备公司 柳州市丹柳铝板有限公司 柳州市桂冶物资有限公司 柳州市宸业物资经营部 柳州市耀成贸易有限公司 柳州奥易自动化科技有限公司 柳州市萃丰科技有限责任公司 柳州市华储贸易有限责任公司 柳州市黄颜钢材有限责任公司 柳州市银盛物资有限责任公司 柳州市新仪化玻供应站 柳州市晶凯化工有限公司 广西柳州市柳江包装纸厂 柳州市志新物资有限责任公司 柳州市兆钢物资有限公司 柳州市友方科技发展有限责任公司 柳州市缝纫机台板家具总厂 柳州市晖海数码办公设备有限责任公司 柳州市富兰特服饰有限责任公司 柳州市柳北区富兴物资经营部 柳州市柳锌福利厂 柳州市海泉印刷有限责任公司 柳州市乾亨贸易有限公司 柳州市悦宁物资贸易有限公司 柳州市昊天贸易有限公司 广西惠字钢铁有限公司 柳州市名青物资有限公司 柳州市林郝物资有限公司 柳州市民政服装厂 柳州市多维劳保用品厂 柳州市轻工物资供应公司 柳州市程源物资有限责任公司 柳州市寿丰物资贸易有限责任公司 柳州市凯凡物资有限公司 柳州市利晖物资经营部 柳州市恒茂金属物资供应站 柳州市中储物资经营部 柳州市第二医疗器械厂 柳州市来鑫物资经营部 柳州市钢鑫物资贸易有限责任公司 柳州市双合袜业有限责任公司 柳州市茂松经贸有限责任公司 柳州市行行物资贸易有限公司 柳州市方一物资有限公司 柳州成异钢管销售有限公司 柳州广惠佳电脑有限公司 桂林市圣泽鑫物资有限公司柳州分公司 柳州市砼基建材贸易有限公司 柳州市海燕针织厂 上海浦光仪表厂柳州销售处 柳州市能电工贸有限责任公司 柳州市广贸物资有限公司 柳州市柳北区大昌电工灯饰经营部 柳州市金龙印务有限公司 柳州市奇缘婚典服务有限公司 柳州市盛博物资经营部 柳州市项元钢铁贸易有限公司 柳州市虞美人化妆品经营部 柳州市俊彦鞋厂 柳州市聚源特钢有限公司 柳州市迅龙科贸有限责任公司 柳州市恒飞电子有限责任公司 柳州市蓝正现代办公设备有限责任公司 柳州地区农业生产资料公司 柳州华菱钢管销售有限公司 柳州融通物资有限公司 柳州市可仁广告策划有限责任公司 柳州市鸟鑫物资有限责任公司 柳州市五丰钢材供应站 柳州市金江不锈钢有限公司 柳州市美日物资设备有限责任公司 柳州市鑫东物资贸易有限责任公司 柳州地区日用杂品公司 柳州市华纳物资贸易有限公司 柳州乾利金虹物资贸易有限责任公司 柳州市新迈计算机有限公司 柳州市富丽实业发展公司 柳州市石钢金属材料有限公司 柳州市力志传真机销售有限公司 广西宝森投资有限公司 柳州市嵘基商贸有限公司 柳州市景民商贸有限责任公司 柳州市银桥化玻有限责任公司 柳州市宏文糖烟店 柳州市科苑电脑网络有限公司 柳州市两面针旅游用品厂 柳州市立早室内装璜有限责任公司 柳州地化建材有限公司 柳州市涛达贸易有限公司 柳州市兰丰档案服务中心 柳州市惠贸物资有限责任公司 柳州市立文物资有限责任公司 柳州市致和商贸经营部 柳州市金色阳光信息咨询有限公司 柳州市赛利钢材经销部 柳州市日用化工厂 柳州市昆廷物资有限责任公司 柳州市邦盛贸易有限公司 柳州市济华贸易有限公司 柳州昕威橡塑化工经营部 柳州市联业贸易有限公司 柳州市兰钢贸易有限公司 柳州市子欣科技有限公司 柳州市狄龙机电设备有限公司 柳州市方真物资贸易有限公司 柳州市银鸥废旧回收中心 柳州市冠宝贸易有限公司 柳州市鑫盛德商务咨询有限责任公司 柳州市泰汇银通经贸有限公司 广西瀚维智测科技有限公司 柳州市钓鱼郎制衣有限责任公司 柳州溪水物资有限公司 柳州市融峰物资有限责任公司 广西新地科技有限责任公司 柳州市纺织装饰公司 柳州市粤翔冶金炉料有限公司 柳州市远腾贸易有限公司 柳州市东鸿城市改造有限公司 广西丛欣实业有限公司 柳州市服装厂 柳州市立安联合刀片有限公司 广西国扬投资有限责任公司 柳州市铭泰办公设备公司 柳州市桂钢物资供应站 柳州市昱升物资有限责任公司 柳州市鹰飞灿科贸有限公司 柳州市先导科贸有限公司 柳州市金秋建材物资经营部 柳州市童装厂 柳州市民泽物资有限公司 柳州市恒先物资贸易有限公司 柳州市银夏冷气工程有限责任公司 柳州粮食批发有限责任公司 柳州市金银华窗纱制造有限责任公司 柳州市三方贸易有限公司 柳州市丰涛商贸有限责任公司 柳州华智企业管理咨询有限责任公司 柳州市诚正建筑工程施工图审查有限公司 柳州市今科电讯设备营销中心 柳州市闽德电子有限公司 柳州市鑫虹针织厂 柳州市畅通通讯器材有限责任公司 柳州市正钢物资经营部 柳州市新柳饲料有限责任公司 柳州市黄村油库 柳州市天泰电力装饰工程有限公司 柳州市兆吉物资有限责任公司 柳州市八龙纸制品有限责任公司 柳州市巨佳电脑网络科技有限公司 ".match(/[^\s]+/g), function (i, v) {
return {
text: v,
value: v,
title: v
};
}),
TREEITEMS: [{pId: "0", id: "0_0", text: "( 共25个 )", value: "", open: true}, {
pId: "0_0",
id: "0_0_0",
text: "安徽省( 共1个 )",
value: "安徽省",
open: true
}, {pId: "0_0_0", id: "0_0_0_0", text: "芜湖市", value: "芜湖市", open: true}, {
pId: "0_0",
id: "0_0_1",
text: "北京市( 共6个 )",
value: "北京市",
open: true
}, {pId: "0_0_1", id: "0_0_1_0", text: "北京市区", value: "北京市区", open: true}, {
pId: "0_0_1",
id: "0_0_1_1",
text: "朝阳区",
value: "朝阳区",
open: true
}, {pId: "0_0_1", id: "0_0_1_2", text: "东城区", value: "东城区", open: true}, {
pId: "0_0_1",
id: "0_0_1_3",
text: "海淀区4内",
value: "海淀区4内",
open: true
}, {pId: "0_0_1", id: "0_0_1_4", text: "海淀区4外", value: "海淀区4外", open: true}, {
pId: "0_0_1",
id: "0_0_1_5",
text: "石景山区",
value: "石景山区",
open: true
}, {pId: "0_0", id: "0_0_2", text: "福建省( 共2个 )", value: "福建省", open: true}, {
pId: "0_0_2",
id: "0_0_2_0",
text: "莆田市",
value: "莆田市",
open: true
}, {pId: "0_0_2", id: "0_0_2_1", text: "泉州市", value: "泉州市", open: true}, {
pId: "0_0",
id: "0_0_3",
text: "甘肃省( 共1个 )",
value: "甘肃省",
open: true
}, {pId: "0_0_3", id: "0_0_3_0", text: "兰州市", value: "兰州市", open: true}, {
pId: "0_0",
id: "0_0_4",
text: "广东省( 共5个 )",
value: "广东省",
open: true
}, {pId: "0_0_4", id: "0_0_4_0", text: "东莞市", value: "东莞市", open: true}, {
pId: "0_0_4",
id: "0_0_4_1",
text: "广州市",
value: "广州市",
open: true
}, {pId: "0_0_4", id: "0_0_4_2", text: "惠州市", value: "惠州市", open: true}, {
pId: "0_0_4",
id: "0_0_4_3",
text: "深圳市",
value: "深圳市",
open: true
}, {pId: "0_0_4", id: "0_0_4_4", text: "珠海市", value: "珠海市", open: true}, {
pId: "0_0",
id: "0_0_5",
text: "广西壮族自治区( 共1个 )",
value: "广西壮族自治区",
open: true
}, {pId: "0_0_5", id: "0_0_5_0", text: "南宁市", value: "南宁市", open: true}, {
pId: "0_0",
id: "0_0_6",
text: "河北省( 共2个 )",
value: "河北省",
open: true
}, {pId: "0_0_6", id: "0_0_6_0", text: "保定市", value: "保定市", open: true}, {
pId: "0_0_6",
id: "0_0_6_1",
text: "邢台市",
value: "邢台市",
open: true
}, {pId: "0_0", id: "0_0_7", text: "河南省( 共1个 )", value: "河南省", open: true}, {
pId: "0_0_7",
id: "0_0_7_0",
text: "郑州市",
value: "郑州市",
open: true
}, {pId: "0_0", id: "0_0_8", text: "黑龙江省( 共7个 )", value: "黑龙江省", open: true}, {
pId: "0_0_8",
id: "0_0_8_0",
text: "大庆市",
value: "大庆市",
open: true
}, {pId: "0_0_8", id: "0_0_8_1", text: "哈尔滨市", value: "哈尔滨市", open: true}, {
pId: "0_0_8",
id: "0_0_8_2",
text: "鸡西市",
value: "鸡西市",
open: true
}, {pId: "0_0_8", id: "0_0_8_3", text: "佳木斯市", value: "佳木斯市", open: true}, {
pId: "0_0_8",
id: "0_0_8_4",
text: "牡丹江市",
value: "牡丹江市",
open: true
}, {pId: "0_0_8", id: "0_0_8_5", text: "齐齐哈尔市", value: "齐齐哈尔市", open: true}, {
pId: "0_0_8",
id: "0_0_8_6",
text: "双鸭山市",
value: "双鸭山市",
open: true
}, {pId: "0_0", id: "0_0_9", text: "湖北省( 共1个 )", value: "湖北省", open: true}, {
pId: "0_0_9",
id: "0_0_9_0",
text: "武汉市",
value: "武汉市",
open: true
}, {pId: "0_0", id: "0_0_10", text: "湖南省( 共3个 )", value: "湖南省", open: true}, {
pId: "0_0_10",
id: "0_0_10_0",
text: "常德市",
value: "常德市",
open: true
}, {pId: "0_0_10", id: "0_0_10_1", text: "长沙市", value: "长沙市", open: true}, {
pId: "0_0_10",
id: "0_0_10_2",
text: "邵阳市",
value: "邵阳市",
open: true
}, {pId: "0_0", id: "0_0_11", text: "吉林省( 共4个 )", value: "吉林省", open: true}, {
pId: "0_0_11",
id: "0_0_11_0",
text: "白山市",
value: "白山市",
open: true
}, {pId: "0_0_11", id: "0_0_11_1", text: "长春市", value: "长春市", open: true}, {
pId: "0_0_11",
id: "0_0_11_2",
text: "松原市",
value: "松原市",
open: true
}, {pId: "0_0_11", id: "0_0_11_3", text: "通化市", value: "通化市", open: true}, {
pId: "0_0",
id: "0_0_12",
text: "江苏省( 共8个 )",
value: "江苏省",
open: true
}, {pId: "0_0_12", id: "0_0_12_0", text: "常州市", value: "常州市", open: true}, {
pId: "0_0_12",
id: "0_0_12_1",
text: "南京市",
value: "南京市",
open: true
}, {pId: "0_0_12", id: "0_0_12_2", text: "南通市", value: "南通市", open: true}, {
pId: "0_0_12",
id: "0_0_12_3",
text: "苏州市",
value: "苏州市",
open: true
}, {pId: "0_0_12", id: "0_0_12_4", text: "宿迁市", value: "宿迁市", open: true}, {
pId: "0_0_12",
id: "0_0_12_5",
text: "泰州市",
value: "泰州市",
open: true
}, {pId: "0_0_12", id: "0_0_12_6", text: "无锡市", value: "无锡市", open: true}, {
pId: "0_0_12",
id: "0_0_12_7",
text: "盐城市",
value: "盐城市",
open: true
}, {pId: "0_0", id: "0_0_13", text: "辽宁省( 共11个 )", value: "辽宁省", open: true}, {
pId: "0_0_13",
id: "0_0_13_0",
text: "鞍山市",
value: "鞍山市",
open: true
}, {pId: "0_0_13", id: "0_0_13_1", text: "本溪市", value: "本溪市", open: true}, {
pId: "0_0_13",
id: "0_0_13_2",
text: "朝阳市",
value: "朝阳市",
open: true
}, {pId: "0_0_13", id: "0_0_13_3", text: "大连市", value: "大连市", open: true}, {
pId: "0_0_13",
id: "0_0_13_4",
text: "抚顺市",
value: "抚顺市",
open: true
}, {pId: "0_0_13", id: "0_0_13_5", text: "葫芦岛市", value: "葫芦岛市", open: true}, {
pId: "0_0_13",
id: "0_0_13_6",
text: "锦州市",
value: "锦州市",
open: true
}, {pId: "0_0_13", id: "0_0_13_7", text: "辽阳市", value: "辽阳市", open: true}, {
pId: "0_0_13",
id: "0_0_13_8",
text: "盘锦市",
value: "盘锦市",
open: true
}, {pId: "0_0_13", id: "0_0_13_9", text: "沈阳市", value: "沈阳市", open: true}, {
pId: "0_0_13",
id: "0_0_13_10",
text: "营口市",
value: "营口市",
open: true
}, {pId: "0_0", id: "0_0_14", text: "内蒙古( 共1个 )", value: "内蒙古", open: true}, {
pId: "0_0_14",
id: "0_0_14_0",
text: "鄂尔多斯市",
value: "鄂尔多斯市",
open: true
}, {pId: "0_0", id: "0_0_15", text: "宁夏回族自治区( 共1个 )", value: "宁夏回族自治区", open: true}, {
pId: "0_0_15",
id: "0_0_15_0",
text: "银川市",
value: "银川市",
open: true
}, {pId: "0_0", id: "0_0_16", text: "山东省( 共7个 )", value: "山东省", open: true}, {
pId: "0_0_16",
id: "0_0_16_0",
text: "济南市",
value: "济南市",
open: true
}, {pId: "0_0_16", id: "0_0_16_1", text: "济宁市", value: "济宁市", open: true}, {
pId: "0_0_16",
id: "0_0_16_2",
text: "聊城市",
value: "聊城市",
open: true
}, {pId: "0_0_16", id: "0_0_16_3", text: "临沂市", value: "临沂市", open: true}, {
pId: "0_0_16",
id: "0_0_16_4",
text: "青岛市",
value: "青岛市",
open: true
}, {pId: "0_0_16", id: "0_0_16_5", text: "烟台市", value: "烟台市", open: true}, {
pId: "0_0_16",
id: "0_0_16_6",
text: "枣庄市",
value: "枣庄市",
open: true
}, {pId: "0_0", id: "0_0_17", text: "山西省( 共1个 )", value: "山西省", open: true}, {
pId: "0_0_17",
id: "0_0_17_0",
text: "太原市",
value: "太原市",
open: true
}, {pId: "0_0", id: "0_0_18", text: "陕西省( 共1个 )", value: "陕西省", open: true}, {
pId: "0_0_18",
id: "0_0_18_0",
text: "西安市",
value: "西安市",
open: true
}, {pId: "0_0", id: "0_0_19", text: "上海市( 共1个 )", value: "上海市", open: true}, {
pId: "0_0_19",
id: "0_0_19_0",
text: "上海市区",
value: "上海市区",
open: true
}, {pId: "0_0", id: "0_0_20", text: "四川省( 共1个 )", value: "四川省", open: true}, {
pId: "0_0_20",
id: "0_0_20_0",
text: "成都市",
value: "成都市",
open: true
}, {pId: "0_0", id: "0_0_21", text: "新疆维吾尔族自治区( 共2个 )", value: "新疆维吾尔族自治区", open: true}, {
pId: "0_0_21",
id: "0_0_21_0",
text: "吐鲁番地区",
value: "吐鲁番地区",
open: true
}, {pId: "0_0_21", id: "0_0_21_1", text: "乌鲁木齐", value: "乌鲁木齐", open: true}, {
pId: "0_0",
id: "0_0_22",
text: "云南省( 共1个 )",
value: "云南省",
open: true
}, {pId: "0_0_22", id: "0_0_22_0", text: "昆明市", value: "昆明市", open: true}, {
pId: "0_0",
id: "0_0_23",
text: "浙江省( 共5个 )",
value: "浙江省",
open: true
}, {pId: "0_0_23", id: "0_0_23_0", text: "杭州市", value: "杭州市", open: true}, {
pId: "0_0_23",
id: "0_0_23_1",
text: "湖州市",
value: "湖州市",
open: true
}, {pId: "0_0_23", id: "0_0_23_2", text: "嘉兴市", value: "嘉兴市", open: true}, {
pId: "0_0_23",
id: "0_0_23_3",
text: "宁波市",
value: "宁波市",
open: true
}, {pId: "0_0_23", id: "0_0_23_4", text: "绍兴市", value: "绍兴市", open: true}, {
pId: "0_0",
id: "0_0_24",
text: "重庆市( 共1个 )",
value: "重庆市",
open: true
}, {pId: "0_0_24", id: "0_0_24_0", text: "重庆市区", value: "重庆市区", open: true}, {
pId: "0",
id: "0_1",
text: "中国( 共34个 )",
value: "中国",
open: true
}, {pId: "0_1", id: "0_1_0", text: "安徽省( 共19个 )", value: "安徽省", open: true}, {
pId: "0_1_0",
id: "0_1_0_0",
text: "安庆市",
value: "安庆市",
open: true
}, {pId: "0_1_0", id: "0_1_0_1", text: "蚌埠市", value: "蚌埠市", open: true}, {
pId: "0_1_0",
id: "0_1_0_2",
text: "亳州市",
value: "亳州市",
open: true
}, {pId: "0_1_0", id: "0_1_0_3", text: "巢湖市", value: "巢湖市", open: true}, {
pId: "0_1_0",
id: "0_1_0_4",
text: "池州市",
value: "池州市",
open: true
}, {pId: "0_1_0", id: "0_1_0_5", text: "滁州市", value: "滁州市", open: true}, {
pId: "0_1_0",
id: "0_1_0_6",
text: "阜阳市",
value: "阜阳市",
open: true
}, {pId: "0_1_0", id: "0_1_0_7", text: "毫州市", value: "毫州市", open: true}, {
pId: "0_1_0",
id: "0_1_0_8",
text: "合肥市",
value: "合肥市",
open: true
}, {pId: "0_1_0", id: "0_1_0_9", text: "淮北市", value: "淮北市", open: true}, {
pId: "0_1_0",
id: "0_1_0_10",
text: "淮南市",
value: "淮南市",
open: true
}, {pId: "0_1_0", id: "0_1_0_11", text: "黄山市", value: "黄山市", open: true}, {
pId: "0_1_0",
id: "0_1_0_12",
text: "六安市",
value: "六安市",
open: true
}, {pId: "0_1_0", id: "0_1_0_13", text: "马鞍山市", value: "马鞍山市", open: true}, {
pId: "0_1_0",
id: "0_1_0_14",
text: "濮阳市",
value: "濮阳市",
open: true
}, {pId: "0_1_0", id: "0_1_0_15", text: "宿州市", value: "宿州市", open: true}, {
pId: "0_1_0",
id: "0_1_0_16",
text: "铜陵市",
value: "铜陵市",
open: true
}, {pId: "0_1_0", id: "0_1_0_17", text: "芜湖市", value: "芜湖市", open: true}, {
pId: "0_1_0",
id: "0_1_0_18",
text: "宣城市",
value: "宣城市",
open: true
}, {pId: "0_1", id: "0_1_1", text: "澳门特别行政区( 共1个 )", value: "澳门特别行政区", open: true}, {
pId: "0_1_1",
id: "0_1_1_0",
text: "澳门",
value: "澳门",
open: true
}, {pId: "0_1", id: "0_1_2", text: "北京市( 共17个 )", value: "北京市", open: true}, {
pId: "0_1_2",
id: "0_1_2_0",
text: "北京市区",
value: "北京市区",
open: true
}, {pId: "0_1_2", id: "0_1_2_1", text: "昌平区", value: "昌平区", open: true}, {
pId: "0_1_2",
id: "0_1_2_2",
text: "朝阳区",
value: "朝阳区",
open: true
}, {pId: "0_1_2", id: "0_1_2_3", text: "大兴区", value: "大兴区", open: true}, {
pId: "0_1_2",
id: "0_1_2_4",
text: "东城区",
value: "东城区",
open: true
}, {pId: "0_1_2", id: "0_1_2_5", text: "房山区", value: "房山区", open: true}, {
pId: "0_1_2",
id: "0_1_2_6",
text: "丰台区",
value: "丰台区",
open: true
}, {pId: "0_1_2", id: "0_1_2_7", text: "海淀区", value: "海淀区", open: true}, {
pId: "0_1_2",
id: "0_1_2_8",
text: "海淀区4内",
value: "海淀区4内",
open: true
}, {pId: "0_1_2", id: "0_1_2_9", text: "海淀区4外", value: "海淀区4外", open: true}, {
pId: "0_1_2",
id: "0_1_2_10",
text: "门头沟区",
value: "门头沟区",
open: true
}, {pId: "0_1_2", id: "0_1_2_11", text: "平谷区", value: "平谷区", open: true}, {
pId: "0_1_2",
id: "0_1_2_12",
text: "石景山区",
value: "石景山区",
open: true
}, {pId: "0_1_2", id: "0_1_2_13", text: "顺义区", value: "顺义区", open: true}, {
pId: "0_1_2",
id: "0_1_2_14",
text: "通州区",
value: "通州区",
open: true
}, {pId: "0_1_2", id: "0_1_2_15", text: "西城区", value: "西城区", open: true}, {
pId: "0_1_2",
id: "0_1_2_16",
text: "西城区 ",
value: "西城区 ",
open: true
}, {pId: "0_1", id: "0_1_3", text: "福建省( 共9个 )", value: "福建省", open: true}, {
pId: "0_1_3",
id: "0_1_3_0",
text: "福州市",
value: "福州市",
open: true
}, {pId: "0_1_3", id: "0_1_3_1", text: "龙岩市", value: "龙岩市", open: true}, {
pId: "0_1_3",
id: "0_1_3_2",
text: "南平市",
value: "南平市",
open: true
}, {pId: "0_1_3", id: "0_1_3_3", text: "宁德市", value: "宁德市", open: true}, {
pId: "0_1_3",
id: "0_1_3_4",
text: "莆田市",
value: "莆田市",
open: true
}, {pId: "0_1_3", id: "0_1_3_5", text: "泉州市", value: "泉州市", open: true}, {
pId: "0_1_3",
id: "0_1_3_6",
text: "三明市",
value: "三明市",
open: true
}, {pId: "0_1_3", id: "0_1_3_7", text: "厦门市", value: "厦门市", open: true}, {
pId: "0_1_3",
id: "0_1_3_8",
text: "漳州市",
value: "漳州市",
open: true
}, {pId: "0_1", id: "0_1_4", text: "甘肃省( 共12个 )", value: "甘肃省", open: true}, {
pId: "0_1_4",
id: "0_1_4_0",
text: "白银市",
value: "白银市",
open: true
}, {pId: "0_1_4", id: "0_1_4_1", text: "嘉峪关市", value: "嘉峪关市", open: true}, {
pId: "0_1_4",
id: "0_1_4_2",
text: "金昌市",
value: "金昌市",
open: true
}, {pId: "0_1_4", id: "0_1_4_3", text: "酒泉市", value: "酒泉市", open: true}, {
pId: "0_1_4",
id: "0_1_4_4",
text: "兰州市",
value: "兰州市",
open: true
}, {pId: "0_1_4", id: "0_1_4_5", text: "陇南市", value: "陇南市", open: true}, {
pId: "0_1_4",
id: "0_1_4_6",
text: "平凉市",
value: "平凉市",
open: true
}, {pId: "0_1_4", id: "0_1_4_7", text: "庆阳市", value: "庆阳市", open: true}, {
pId: "0_1_4",
id: "0_1_4_8",
text: "天津市区",
value: "天津市区",
open: true
}, {pId: "0_1_4", id: "0_1_4_9", text: "天水市", value: "天水市", open: true}, {
pId: "0_1_4",
id: "0_1_4_10",
text: "武威市",
value: "武威市",
open: true
}, {pId: "0_1_4", id: "0_1_4_11", text: "张掖市", value: "张掖市", open: true}, {
pId: "0_1",
id: "0_1_5",
text: "广东省( 共21个 )",
value: "广东省",
open: true
}, {pId: "0_1_5", id: "0_1_5_0", text: "潮州市", value: "潮州市", open: true}, {
pId: "0_1_5",
id: "0_1_5_1",
text: "东莞市",
value: "东莞市",
open: true
}, {pId: "0_1_5", id: "0_1_5_2", text: "佛山市", value: "佛山市", open: true}, {
pId: "0_1_5",
id: "0_1_5_3",
text: "广州市",
value: "广州市",
open: true
}, {pId: "0_1_5", id: "0_1_5_4", text: "河源市", value: "河源市", open: true}, {
pId: "0_1_5",
id: "0_1_5_5",
text: "惠州市",
value: "惠州市",
open: true
}, {pId: "0_1_5", id: "0_1_5_6", text: "江门市", value: "江门市", open: true}, {
pId: "0_1_5",
id: "0_1_5_7",
text: "揭阳市",
value: "揭阳市",
open: true
}, {pId: "0_1_5", id: "0_1_5_8", text: "茂名市", value: "茂名市", open: true}, {
pId: "0_1_5",
id: "0_1_5_9",
text: "梅州市",
value: "梅州市",
open: true
}, {pId: "0_1_5", id: "0_1_5_10", text: "清远市", value: "清远市", open: true}, {
pId: "0_1_5",
id: "0_1_5_11",
text: "汕头市",
value: "汕头市",
open: true
}, {pId: "0_1_5", id: "0_1_5_12", text: "汕尾市", value: "汕尾市", open: true}, {
pId: "0_1_5",
id: "0_1_5_13",
text: "韶关市",
value: "韶关市",
open: true
}, {pId: "0_1_5", id: "0_1_5_14", text: "深圳市", value: "深圳市", open: true}, {
pId: "0_1_5",
id: "0_1_5_15",
text: "阳江市",
value: "阳江市",
open: true
}, {pId: "0_1_5", id: "0_1_5_16", text: "云浮市", value: "云浮市", open: true}, {
pId: "0_1_5",
id: "0_1_5_17",
text: "湛江市",
value: "湛江市",
open: true
}, {pId: "0_1_5", id: "0_1_5_18", text: "肇庆市", value: "肇庆市", open: true}, {
pId: "0_1_5",
id: "0_1_5_19",
text: "中山市",
value: "中山市",
open: true
}, {pId: "0_1_5", id: "0_1_5_20", text: "珠海市", value: "珠海市", open: true}, {
pId: "0_1",
id: "0_1_6",
text: "广西壮族自治区( 共14个 )",
value: "广西壮族自治区",
open: true
}, {pId: "0_1_6", id: "0_1_6_0", text: "百色市", value: "百色市", open: true}, {
pId: "0_1_6",
id: "0_1_6_1",
text: "北海市",
value: "北海市",
open: true
}, {pId: "0_1_6", id: "0_1_6_2", text: "崇左市", value: "崇左市", open: true}, {
pId: "0_1_6",
id: "0_1_6_3",
text: "防城港市",
value: "防城港市",
open: true
}, {pId: "0_1_6", id: "0_1_6_4", text: "桂林市", value: "桂林市", open: true}, {
pId: "0_1_6",
id: "0_1_6_5",
text: "贵港市",
value: "贵港市",
open: true
}, {pId: "0_1_6", id: "0_1_6_6", text: "河池市", value: "河池市", open: true}, {
pId: "0_1_6",
id: "0_1_6_7",
text: "贺州市",
value: "贺州市",
open: true
}, {pId: "0_1_6", id: "0_1_6_8", text: "来宾市", value: "来宾市", open: true}, {
pId: "0_1_6",
id: "0_1_6_9",
text: "柳州市",
value: "柳州市",
open: true
}, {pId: "0_1_6", id: "0_1_6_10", text: "南宁市", value: "南宁市", open: true}, {
pId: "0_1_6",
id: "0_1_6_11",
text: "钦州市",
value: "钦州市",
open: true
}, {pId: "0_1_6", id: "0_1_6_12", text: "梧州市", value: "梧州市", open: true}, {
pId: "0_1_6",
id: "0_1_6_13",
text: "玉林市",
value: "玉林市",
open: true
}, {pId: "0_1", id: "0_1_7", text: "贵州省( 共9个 )", value: "贵州省", open: true}, {
pId: "0_1_7",
id: "0_1_7_0",
text: "安顺市",
value: "安顺市",
open: true
}, {pId: "0_1_7", id: "0_1_7_1", text: "毕节地区", value: "毕节地区", open: true}, {
pId: "0_1_7",
id: "0_1_7_2",
text: "贵阳市",
value: "贵阳市",
open: true
}, {pId: "0_1_7", id: "0_1_7_3", text: "六盘水市", value: "六盘水市", open: true}, {
pId: "0_1_7",
id: "0_1_7_4",
text: "黔东南州",
value: "黔东南州",
open: true
}, {pId: "0_1_7", id: "0_1_7_5", text: "黔南州", value: "黔南州", open: true}, {
pId: "0_1_7",
id: "0_1_7_6",
text: "黔西南市",
value: "黔西南市",
open: true
}, {pId: "0_1_7", id: "0_1_7_7", text: "铜仁地区", value: "铜仁地区", open: true}, {
pId: "0_1_7",
id: "0_1_7_8",
text: "遵义市",
value: "遵义市",
open: true
}, {pId: "0_1", id: "0_1_8", text: "海南省( 共2个 )", value: "海南省", open: true}, {
pId: "0_1_8",
id: "0_1_8_0",
text: "海口市",
value: "海口市",
open: true
}, {pId: "0_1_8", id: "0_1_8_1", text: "三亚市", value: "三亚市", open: true}, {
pId: "0_1",
id: "0_1_9",
text: "河北省( 共12个 )",
value: "河北省",
open: true
}, {pId: "0_1_9", id: "0_1_9_0", text: "保定市", value: "保定市", open: true}, {
pId: "0_1_9",
id: "0_1_9_1",
text: "沧州市",
value: "沧州市",
open: true
}, {pId: "0_1_9", id: "0_1_9_2", text: "承德市", value: "承德市", open: true}, {
pId: "0_1_9",
id: "0_1_9_3",
text: "邯郸市",
value: "邯郸市",
open: true
}, {pId: "0_1_9", id: "0_1_9_4", text: "衡水市", value: "衡水市", open: true}, {
pId: "0_1_9",
id: "0_1_9_5",
text: "廊坊市",
value: "廊坊市",
open: true
}, {pId: "0_1_9", id: "0_1_9_6", text: "秦皇岛市", value: "秦皇岛市", open: true}, {
pId: "0_1_9",
id: "0_1_9_7",
text: "石家庄市",
value: "石家庄市",
open: true
}, {pId: "0_1_9", id: "0_1_9_8", text: "唐山市", value: "唐山市", open: true}, {
pId: "0_1_9",
id: "0_1_9_9",
text: "天津市区",
value: "天津市区",
open: true
}, {pId: "0_1_9", id: "0_1_9_10", text: "邢台市", value: "邢台市", open: true}, {
pId: "0_1_9",
id: "0_1_9_11",
text: "张家口市",
value: "张家口市",
open: true
}, {pId: "0_1", id: "0_1_10", text: "河南省( 共19个 )", value: "河南省", open: true}, {
pId: "0_1_10",
id: "0_1_10_0",
text: "安阳市",
value: "安阳市",
open: true
}, {pId: "0_1_10", id: "0_1_10_1", text: "鹤壁市", value: "鹤壁市", open: true}, {
pId: "0_1_10",
id: "0_1_10_2",
text: "济源市",
value: "济源市",
open: true
}, {pId: "0_1_10", id: "0_1_10_3", text: "焦作市", value: "焦作市", open: true}, {
pId: "0_1_10",
id: "0_1_10_4",
text: "开封市",
value: "开封市",
open: true
}, {pId: "0_1_10", id: "0_1_10_5", text: "廊坊市", value: "廊坊市", open: true}, {
pId: "0_1_10",
id: "0_1_10_6",
text: "洛阳市",
value: "洛阳市",
open: true
}, {pId: "0_1_10", id: "0_1_10_7", text: "漯河市", value: "漯河市", open: true}, {
pId: "0_1_10",
id: "0_1_10_8",
text: "南阳市",
value: "南阳市",
open: true
}, {pId: "0_1_10", id: "0_1_10_9", text: "平顶山市", value: "平顶山市", open: true}, {
pId: "0_1_10",
id: "0_1_10_10",
text: "濮阳市",
value: "濮阳市",
open: true
}, {pId: "0_1_10", id: "0_1_10_11", text: "三门峡市", value: "三门峡市", open: true}, {
pId: "0_1_10",
id: "0_1_10_12",
text: "商丘市",
value: "商丘市",
open: true
}, {pId: "0_1_10", id: "0_1_10_13", text: "新乡市", value: "新乡市", open: true}, {
pId: "0_1_10",
id: "0_1_10_14",
text: "信阳市",
value: "信阳市",
open: true
}, {pId: "0_1_10", id: "0_1_10_15", text: "许昌市", value: "许昌市", open: true}, {
pId: "0_1_10",
id: "0_1_10_16",
text: "郑州市",
value: "郑州市",
open: true
}, {pId: "0_1_10", id: "0_1_10_17", text: "周口市", value: "周口市", open: true}, {
pId: "0_1_10",
id: "0_1_10_18",
text: "驻马店市",
value: "驻马店市",
open: true
}, {pId: "0_1", id: "0_1_11", text: "黑龙江省( 共13个 )", value: "黑龙江省", open: true}, {
pId: "0_1_11",
id: "0_1_11_0",
text: "大庆市",
value: "大庆市",
open: true
}, {pId: "0_1_11", id: "0_1_11_1", text: "大兴安岭地区", value: "大兴安岭地区", open: true}, {
pId: "0_1_11",
id: "0_1_11_2",
text: "大兴安岭市",
value: "大兴安岭市",
open: true
}, {pId: "0_1_11", id: "0_1_11_3", text: "哈尔滨市", value: "哈尔滨市", open: true}, {
pId: "0_1_11",
id: "0_1_11_4",
text: "鹤港市",
value: "鹤港市",
open: true
}, {pId: "0_1_11", id: "0_1_11_5", text: "黑河市", value: "黑河市", open: true}, {
pId: "0_1_11",
id: "0_1_11_6",
text: "佳木斯市",
value: "佳木斯市",
open: true
}, {pId: "0_1_11", id: "0_1_11_7", text: "牡丹江市", value: "牡丹江市", open: true}, {
pId: "0_1_11",
id: "0_1_11_8",
text: "七台河市",
value: "七台河市",
open: true
}, {pId: "0_1_11", id: "0_1_11_9", text: "齐齐哈尔市", value: "齐齐哈尔市", open: true}, {
pId: "0_1_11",
id: "0_1_11_10",
text: "双鸭山市",
value: "双鸭山市",
open: true
}, {pId: "0_1_11", id: "0_1_11_11", text: "绥化市", value: "绥化市", open: true}, {
pId: "0_1_11",
id: "0_1_11_12",
text: "伊春市",
value: "伊春市",
open: true
}, {pId: "0_1", id: "0_1_12", text: "湖北省( 共16个 )", value: "湖北省", open: true}, {
pId: "0_1_12",
id: "0_1_12_0",
text: "鄂州市",
value: "鄂州市",
open: true
}, {pId: "0_1_12", id: "0_1_12_1", text: "恩施土家族苗族自治州", value: "恩施土家族苗族自治州", open: true}, {
pId: "0_1_12",
id: "0_1_12_2",
text: "黄冈市",
value: "黄冈市",
open: true
}, {pId: "0_1_12", id: "0_1_12_3", text: "黄石市", value: "黄石市", open: true}, {
pId: "0_1_12",
id: "0_1_12_4",
text: "荆门市",
value: "荆门市",
open: true
}, {pId: "0_1_12", id: "0_1_12_5", text: "荆州市", value: "荆州市", open: true}, {
pId: "0_1_12",
id: "0_1_12_6",
text: "神农架市",
value: "神农架市",
open: true
}, {pId: "0_1_12", id: "0_1_12_7", text: "十堰市", value: "十堰市", open: true}, {
pId: "0_1_12",
id: "0_1_12_8",
text: "随州市",
value: "随州市",
open: true
}, {pId: "0_1_12", id: "0_1_12_9", text: "天门市", value: "天门市", open: true}, {
pId: "0_1_12",
id: "0_1_12_10",
text: "武汉市",
value: "武汉市",
open: true
}, {pId: "0_1_12", id: "0_1_12_11", text: "咸宁市", value: "咸宁市", open: true}, {
pId: "0_1_12",
id: "0_1_12_12",
text: "襄樊市",
value: "襄樊市",
open: true
}, {pId: "0_1_12", id: "0_1_12_13", text: "襄阳市", value: "襄阳市", open: true}, {
pId: "0_1_12",
id: "0_1_12_14",
text: "孝感市",
value: "孝感市",
open: true
}, {pId: "0_1_12", id: "0_1_12_15", text: "宜昌市", value: "宜昌市", open: true}, {
pId: "0_1",
id: "0_1_13",
text: "湖南省( 共15个 )",
value: "湖南省",
open: true
}, {pId: "0_1_13", id: "0_1_13_0", text: "常德市", value: "常德市", open: true}, {
pId: "0_1_13",
id: "0_1_13_1",
text: "长沙市",
value: "长沙市",
open: true
}, {pId: "0_1_13", id: "0_1_13_2", text: "郴州市", value: "郴州市", open: true}, {
pId: "0_1_13",
id: "0_1_13_3",
text: "衡阳市",
value: "衡阳市",
open: true
}, {pId: "0_1_13", id: "0_1_13_4", text: "怀化市", value: "怀化市", open: true}, {
pId: "0_1_13",
id: "0_1_13_5",
text: "娄底市",
value: "娄底市",
open: true
}, {pId: "0_1_13", id: "0_1_13_6", text: "邵阳市", value: "邵阳市", open: true}, {
pId: "0_1_13",
id: "0_1_13_7",
text: "湘潭市",
value: "湘潭市",
open: true
}, {pId: "0_1_13", id: "0_1_13_8", text: "湘西市", value: "湘西市", open: true}, {
pId: "0_1_13",
id: "0_1_13_9",
text: "湘西土家族苗族自治州",
value: "湘西土家族苗族自治州",
open: true
}, {pId: "0_1_13", id: "0_1_13_10", text: "益阳市", value: "益阳市", open: true}, {
pId: "0_1_13",
id: "0_1_13_11",
text: "永州市",
value: "永州市",
open: true
}, {pId: "0_1_13", id: "0_1_13_12", text: "岳阳市", value: "岳阳市", open: true}, {
pId: "0_1_13",
id: "0_1_13_13",
text: "张家界市",
value: "张家界市",
open: true
}, {pId: "0_1_13", id: "0_1_13_14", text: "株洲市", value: "株洲市", open: true}, {
pId: "0_1",
id: "0_1_14",
text: "吉林省( 共10个 )",
value: "吉林省",
open: true
}, {pId: "0_1_14", id: "0_1_14_0", text: "白城市", value: "白城市", open: true}, {
pId: "0_1_14",
id: "0_1_14_1",
text: "白山市",
value: "白山市",
open: true
}, {pId: "0_1_14", id: "0_1_14_2", text: "长春市", value: "长春市", open: true}, {
pId: "0_1_14",
id: "0_1_14_3",
text: "大庆市",
value: "大庆市",
open: true
}, {pId: "0_1_14", id: "0_1_14_4", text: "吉林市", value: "吉林市", open: true}, {
pId: "0_1_14",
id: "0_1_14_5",
text: "辽源市",
value: "辽源市",
open: true
}, {pId: "0_1_14", id: "0_1_14_6", text: "四平市", value: "四平市", open: true}, {
pId: "0_1_14",
id: "0_1_14_7",
text: "松原市",
value: "松原市",
open: true
}, {pId: "0_1_14", id: "0_1_14_8", text: "通化市", value: "通化市", open: true}, {
pId: "0_1_14",
id: "0_1_14_9",
text: "延边朝鲜族自治州",
value: "延边朝鲜族自治州",
open: true
}, {pId: "0_1", id: "0_1_15", text: "江苏省( 共13个 )", value: "江苏省", open: true}, {
pId: "0_1_15",
id: "0_1_15_0",
text: "常州市",
value: "常州市",
open: true
}, {pId: "0_1_15", id: "0_1_15_1", text: "淮安市", value: "淮安市", open: true}, {
pId: "0_1_15",
id: "0_1_15_2",
text: "连云港市",
value: "连云港市",
open: true
}, {pId: "0_1_15", id: "0_1_15_3", text: "南京市", value: "南京市", open: true}, {
pId: "0_1_15",
id: "0_1_15_4",
text: "南通市",
value: "南通市",
open: true
}, {pId: "0_1_15", id: "0_1_15_5", text: "苏州市", value: "苏州市", open: true}, {
pId: "0_1_15",
id: "0_1_15_6",
text: "宿迁市",
value: "宿迁市",
open: true
}, {pId: "0_1_15", id: "0_1_15_7", text: "泰州市", value: "泰州市", open: true}, {
pId: "0_1_15",
id: "0_1_15_8",
text: "无锡市",
value: "无锡市",
open: true
}, {pId: "0_1_15", id: "0_1_15_9", text: "徐州市", value: "徐州市", open: true}, {
pId: "0_1_15",
id: "0_1_15_10",
text: "盐城市",
value: "盐城市",
open: true
}, {pId: "0_1_15", id: "0_1_15_11", text: "扬州市", value: "扬州市", open: true}, {
pId: "0_1_15",
id: "0_1_15_12",
text: "镇江市",
value: "镇江市",
open: true
}, {pId: "0_1", id: "0_1_16", text: "江西省( 共10个 )", value: "江西省", open: true}, {
pId: "0_1_16",
id: "0_1_16_0",
text: "抚州市",
value: "抚州市",
open: true
}, {pId: "0_1_16", id: "0_1_16_1", text: "赣州市", value: "赣州市", open: true}, {
pId: "0_1_16",
id: "0_1_16_2",
text: "景德镇市",
value: "景德镇市",
open: true
}, {pId: "0_1_16", id: "0_1_16_3", text: "九江市", value: "九江市", open: true}, {
pId: "0_1_16",
id: "0_1_16_4",
text: "南昌市",
value: "南昌市",
open: true
}, {pId: "0_1_16", id: "0_1_16_5", text: "萍乡市", value: "萍乡市", open: true}, {
pId: "0_1_16",
id: "0_1_16_6",
text: "上饶市",
value: "上饶市",
open: true
}, {pId: "0_1_16", id: "0_1_16_7", text: "新余市", value: "新余市", open: true}, {
pId: "0_1_16",
id: "0_1_16_8",
text: "宜春市",
value: "宜春市",
open: true
}, {pId: "0_1_16", id: "0_1_16_9", text: "鹰潭市", value: "鹰潭市", open: true}, {
pId: "0_1",
id: "0_1_17",
text: "辽宁省( 共14个 )",
value: "辽宁省",
open: true
}, {pId: "0_1_17", id: "0_1_17_0", text: "鞍山市", value: "鞍山市", open: true}, {
pId: "0_1_17",
id: "0_1_17_1",
text: "本溪市",
value: "本溪市",
open: true
}, {pId: "0_1_17", id: "0_1_17_2", text: "朝阳市", value: "朝阳市", open: true}, {
pId: "0_1_17",
id: "0_1_17_3",
text: "大连市",
value: "大连市",
open: true
}, {pId: "0_1_17", id: "0_1_17_4", text: "丹东市", value: "丹东市", open: true}, {
pId: "0_1_17",
id: "0_1_17_5",
text: "抚顺市",
value: "抚顺市",
open: true
}, {pId: "0_1_17", id: "0_1_17_6", text: "阜新市", value: "阜新市", open: true}, {
pId: "0_1_17",
id: "0_1_17_7",
text: "葫芦岛市",
value: "葫芦岛市",
open: true
}, {pId: "0_1_17", id: "0_1_17_8", text: "锦州市", value: "锦州市", open: true}, {
pId: "0_1_17",
id: "0_1_17_9",
text: "辽阳市",
value: "辽阳市",
open: true
}, {pId: "0_1_17", id: "0_1_17_10", text: "盘锦市", value: "盘锦市", open: true}, {
pId: "0_1_17",
id: "0_1_17_11",
text: "沈阳市",
value: "沈阳市",
open: true
}, {pId: "0_1_17", id: "0_1_17_12", text: "铁岭市", value: "铁岭市", open: true}, {
pId: "0_1_17",
id: "0_1_17_13",
text: "营口市",
value: "营口市",
open: true
}, {pId: "0_1", id: "0_1_18", text: "内蒙古( 共10个 )", value: "内蒙古", open: true}, {
pId: "0_1_18",
id: "0_1_18_0",
text: "包头市",
value: "包头市",
open: true
}, {pId: "0_1_18", id: "0_1_18_1", text: "赤峰市", value: "赤峰市", open: true}, {
pId: "0_1_18",
id: "0_1_18_2",
text: "鄂尔多斯市",
value: "鄂尔多斯市",
open: true
}, {pId: "0_1_18", id: "0_1_18_3", text: "呼和浩特市", value: "呼和浩特市", open: true}, {
pId: "0_1_18",
id: "0_1_18_4",
text: "呼伦贝尔市",
value: "呼伦贝尔市",
open: true
}, {pId: "0_1_18", id: "0_1_18_5", text: "通辽市", value: "通辽市", open: true}, {
pId: "0_1_18",
id: "0_1_18_6",
text: "乌海市",
value: "乌海市",
open: true
}, {pId: "0_1_18", id: "0_1_18_7", text: "锡林郭勒市", value: "锡林郭勒市", open: true}, {
pId: "0_1_18",
id: "0_1_18_8",
text: "兴安市",
value: "兴安市",
open: true
}, {pId: "0_1_18", id: "0_1_18_9", text: "运城市", value: "运城市", open: true}, {
pId: "0_1",
id: "0_1_19",
text: "宁夏回族自治区( 共5个 )",
value: "宁夏回族自治区",
open: true
}, {pId: "0_1_19", id: "0_1_19_0", text: "固原市", value: "固原市", open: true}, {
pId: "0_1_19",
id: "0_1_19_1",
text: "石嘴山市",
value: "石嘴山市",
open: true
}, {pId: "0_1_19", id: "0_1_19_2", text: "吴忠市", value: "吴忠市", open: true}, {
pId: "0_1_19",
id: "0_1_19_3",
text: "银川市",
value: "银川市",
open: true
}, {pId: "0_1_19", id: "0_1_19_4", text: "中卫市", value: "中卫市", open: true}, {
pId: "0_1",
id: "0_1_20",
text: "青海省( 共4个 )",
value: "青海省",
open: true
}, {pId: "0_1_20", id: "0_1_20_0", text: "海东地区", value: "海东地区", open: true}, {
pId: "0_1_20",
id: "0_1_20_1",
text: "海南藏族自治州",
value: "海南藏族自治州",
open: true
}, {pId: "0_1_20", id: "0_1_20_2", text: "海西蒙古族藏族自治州", value: "海西蒙古族藏族自治州", open: true}, {
pId: "0_1_20",
id: "0_1_20_3",
text: "西宁市",
value: "西宁市",
open: true
}, {pId: "0_1", id: "0_1_21", text: "山东省( 共17个 )", value: "山东省", open: true}, {
pId: "0_1_21",
id: "0_1_21_0",
text: "滨州市",
value: "滨州市",
open: true
}, {pId: "0_1_21", id: "0_1_21_1", text: "德州市", value: "德州市", open: true}, {
pId: "0_1_21",
id: "0_1_21_2",
text: "东营市",
value: "东营市",
open: true
}, {pId: "0_1_21", id: "0_1_21_3", text: "菏泽市", value: "菏泽市", open: true}, {
pId: "0_1_21",
id: "0_1_21_4",
text: "济南市",
value: "济南市",
open: true
}, {pId: "0_1_21", id: "0_1_21_5", text: "济宁市", value: "济宁市", open: true}, {
pId: "0_1_21",
id: "0_1_21_6",
text: "莱芜市",
value: "莱芜市",
open: true
}, {pId: "0_1_21", id: "0_1_21_7", text: "聊城市", value: "聊城市", open: true}, {
pId: "0_1_21",
id: "0_1_21_8",
text: "临沂市",
value: "临沂市",
open: true
}, {pId: "0_1_21", id: "0_1_21_9", text: "青岛市", value: "青岛市", open: true}, {
pId: "0_1_21",
id: "0_1_21_10",
text: "日照市",
value: "日照市",
open: true
}, {pId: "0_1_21", id: "0_1_21_11", text: "泰安市", value: "泰安市", open: true}, {
pId: "0_1_21",
id: "0_1_21_12",
text: "威海市",
value: "威海市",
open: true
}, {pId: "0_1_21", id: "0_1_21_13", text: "潍坊市", value: "潍坊市", open: true}, {
pId: "0_1_21",
id: "0_1_21_14",
text: "烟台市",
value: "烟台市",
open: true
}, {pId: "0_1_21", id: "0_1_21_15", text: "枣庄市", value: "枣庄市", open: true}, {
pId: "0_1_21",
id: "0_1_21_16",
text: "淄博市",
value: "淄博市",
open: true
}, {pId: "0_1", id: "0_1_22", text: "山西省( 共12个 )", value: "山西省", open: true}, {
pId: "0_1_22",
id: "0_1_22_0",
text: "长治市",
value: "长治市",
open: true
}, {pId: "0_1_22", id: "0_1_22_1", text: "大同市", value: "大同市", open: true}, {
pId: "0_1_22",
id: "0_1_22_2",
text: "晋城市",
value: "晋城市",
open: true
}, {pId: "0_1_22", id: "0_1_22_3", text: "晋中市", value: "晋中市", open: true}, {
pId: "0_1_22",
id: "0_1_22_4",
text: "临汾市",
value: "临汾市",
open: true
}, {pId: "0_1_22", id: "0_1_22_5", text: "吕梁市", value: "吕梁市", open: true}, {
pId: "0_1_22",
id: "0_1_22_6",
text: "青岛市",
value: "青岛市",
open: true
}, {pId: "0_1_22", id: "0_1_22_7", text: "朔州市", value: "朔州市", open: true}, {
pId: "0_1_22",
id: "0_1_22_8",
text: "太原市",
value: "太原市",
open: true
}, {pId: "0_1_22", id: "0_1_22_9", text: "忻州市", value: "忻州市", open: true}, {
pId: "0_1_22",
id: "0_1_22_10",
text: "阳泉市",
value: "阳泉市",
open: true
}, {pId: "0_1_22", id: "0_1_22_11", text: "运城市", value: "运城市", open: true}, {
pId: "0_1",
id: "0_1_23",
text: "陕西省( 共9个 )",
value: "陕西省",
open: true
}, {pId: "0_1_23", id: "0_1_23_0", text: "安康市", value: "安康市", open: true}, {
pId: "0_1_23",
id: "0_1_23_1",
text: "宝鸡市",
value: "宝鸡市",
open: true
}, {pId: "0_1_23", id: "0_1_23_2", text: "汉中市", value: "汉中市", open: true}, {
pId: "0_1_23",
id: "0_1_23_3",
text: "商洛市",
value: "商洛市",
open: true
}, {pId: "0_1_23", id: "0_1_23_4", text: "渭南市", value: "渭南市", open: true}, {
pId: "0_1_23",
id: "0_1_23_5",
text: "西安市",
value: "西安市",
open: true
}, {pId: "0_1_23", id: "0_1_23_6", text: "咸阳市", value: "咸阳市", open: true}, {
pId: "0_1_23",
id: "0_1_23_7",
text: "延安市",
value: "延安市",
open: true
}, {pId: "0_1_23", id: "0_1_23_8", text: "榆林市", value: "榆林市", open: true}, {
pId: "0_1",
id: "0_1_24",
text: "上海市( 共19个 )",
value: "上海市",
open: true
}, {pId: "0_1_24", id: "0_1_24_0", text: "宝山区", value: "宝山区", open: true}, {
pId: "0_1_24",
id: "0_1_24_1",
text: "长宁区",
value: "长宁区",
open: true
}, {pId: "0_1_24", id: "0_1_24_2", text: "崇明县", value: "崇明县", open: true}, {
pId: "0_1_24",
id: "0_1_24_3",
text: "奉贤区",
value: "奉贤区",
open: true
}, {pId: "0_1_24", id: "0_1_24_4", text: "虹口区", value: "虹口区", open: true}, {
pId: "0_1_24",
id: "0_1_24_5",
text: "黄浦区",
value: "黄浦区",
open: true
}, {pId: "0_1_24", id: "0_1_24_6", text: "嘉定区", value: "嘉定区", open: true}, {
pId: "0_1_24",
id: "0_1_24_7",
text: "金山区",
value: "金山区",
open: true
}, {pId: "0_1_24", id: "0_1_24_8", text: "静安区", value: "静安区", open: true}, {
pId: "0_1_24",
id: "0_1_24_9",
text: "昆明市",
value: "昆明市",
open: true
}, {pId: "0_1_24", id: "0_1_24_10", text: "闵行区", value: "闵行区", open: true}, {
pId: "0_1_24",
id: "0_1_24_11",
text: "普陀区",
value: "普陀区",
open: true
}, {pId: "0_1_24", id: "0_1_24_12", text: "浦东新区", value: "浦东新区", open: true}, {
pId: "0_1_24",
id: "0_1_24_13",
text: "青浦区",
value: "青浦区",
open: true
}, {pId: "0_1_24", id: "0_1_24_14", text: "上海市区", value: "上海市区", open: true}, {
pId: "0_1_24",
id: "0_1_24_15",
text: "松江区",
value: "松江区",
open: true
}, {pId: "0_1_24", id: "0_1_24_16", text: "徐汇区", value: "徐汇区", open: true}, {
pId: "0_1_24",
id: "0_1_24_17",
text: "杨浦区",
value: "杨浦区",
open: true
}, {pId: "0_1_24", id: "0_1_24_18", text: "闸北区", value: "闸北区", open: true}, {
pId: "0_1",
id: "0_1_25",
text: "四川省( 共21个 )",
value: "四川省",
open: true
}, {pId: "0_1_25", id: "0_1_25_0", text: "阿坝藏族羌族自治州", value: "阿坝藏族羌族自治州", open: true}, {
pId: "0_1_25",
id: "0_1_25_1",
text: "巴中市",
value: "巴中市",
open: true
}, {pId: "0_1_25", id: "0_1_25_2", text: "成都市", value: "成都市", open: true}, {
pId: "0_1_25",
id: "0_1_25_3",
text: "达州市",
value: "达州市",
open: true
}, {pId: "0_1_25", id: "0_1_25_4", text: "德阳市", value: "德阳市", open: true}, {
pId: "0_1_25",
id: "0_1_25_5",
text: "甘孜市",
value: "甘孜市",
open: true
}, {pId: "0_1_25", id: "0_1_25_6", text: "广安市", value: "广安市", open: true}, {
pId: "0_1_25",
id: "0_1_25_7",
text: "广元市",
value: "广元市",
open: true
}, {pId: "0_1_25", id: "0_1_25_8", text: "乐山市", value: "乐山市", open: true}, {
pId: "0_1_25",
id: "0_1_25_9",
text: "凉山市",
value: "凉山市",
open: true
}, {pId: "0_1_25", id: "0_1_25_10", text: "泸州市", value: "泸州市", open: true}, {
pId: "0_1_25",
id: "0_1_25_11",
text: "眉山市",
value: "眉山市",
open: true
}, {pId: "0_1_25", id: "0_1_25_12", text: "绵阳市", value: "绵阳市", open: true}, {
pId: "0_1_25",
id: "0_1_25_13",
text: "南充市",
value: "南充市",
open: true
}, {pId: "0_1_25", id: "0_1_25_14", text: "内江市", value: "内江市", open: true}, {
pId: "0_1_25",
id: "0_1_25_15",
text: "攀枝花市",
value: "攀枝花市",
open: true
}, {pId: "0_1_25", id: "0_1_25_16", text: "遂宁市", value: "遂宁市", open: true}, {
pId: "0_1_25",
id: "0_1_25_17",
text: "雅安市",
value: "雅安市",
open: true
}, {pId: "0_1_25", id: "0_1_25_18", text: "宜宾市", value: "宜宾市", open: true}, {
pId: "0_1_25",
id: "0_1_25_19",
text: "资阳市",
value: "资阳市",
open: true
}, {pId: "0_1_25", id: "0_1_25_20", text: "自贡市", value: "自贡市", open: true}, {
pId: "0_1",
id: "0_1_26",
text: "台湾( 共1个 )",
value: "台湾",
open: true
}, {pId: "0_1_26", id: "0_1_26_0", text: "台北市", value: "台北市", open: true}, {
pId: "0_1",
id: "0_1_27",
text: "天津市( 共1个 )",
value: "天津市",
open: true
}, {pId: "0_1_27", id: "0_1_27_0", text: "天津市区", value: "天津市区", open: true}, {
pId: "0_1",
id: "0_1_28",
text: "西藏自治区( 共2个 )",
value: "西藏自治区",
open: true
}, {pId: "0_1_28", id: "0_1_28_0", text: "阿里市", value: "阿里市", open: true}, {
pId: "0_1_28",
id: "0_1_28_1",
text: "日喀则市",
value: "日喀则市",
open: true
}, {pId: "0_1", id: "0_1_29", text: "香港特别行政区( 共1个 )", value: "香港特别行政区", open: true}, {
pId: "0_1_29",
id: "0_1_29_0",
text: "香港",
value: "香港",
open: true
}, {
pId: "0_1",
id: "0_1_30",
text: "新疆维吾尔族自治区( 共11个 )",
value: "新疆维吾尔族自治区",
open: true
}, {pId: "0_1_30", id: "0_1_30_0", text: "巴音郭楞市", value: "巴音郭楞市", open: true}, {
pId: "0_1_30",
id: "0_1_30_1",
text: "哈密市",
value: "哈密市",
open: true
}, {pId: "0_1_30", id: "0_1_30_2", text: "和田市", value: "和田市", open: true}, {
pId: "0_1_30",
id: "0_1_30_3",
text: "喀什地区",
value: "喀什地区",
open: true
}, {pId: "0_1_30", id: "0_1_30_4", text: "克拉玛依市", value: "克拉玛依市", open: true}, {
pId: "0_1_30",
id: "0_1_30_5",
text: "克孜勒苏柯州",
value: "克孜勒苏柯州",
open: true
}, {pId: "0_1_30", id: "0_1_30_6", text: "石河子市", value: "石河子市", open: true}, {
pId: "0_1_30",
id: "0_1_30_7",
text: "塔城市",
value: "塔城市",
open: true
}, {pId: "0_1_30", id: "0_1_30_8", text: "吐鲁番地区", value: "吐鲁番地区", open: true}, {
pId: "0_1_30",
id: "0_1_30_9",
text: "乌鲁木齐",
value: "乌鲁木齐",
open: true
}, {pId: "0_1_30", id: "0_1_30_10", text: "伊犁市", value: "伊犁市", open: true}, {
pId: "0_1",
id: "0_1_31",
text: "云南省( 共12个 )",
value: "云南省",
open: true
}, {pId: "0_1_31", id: "0_1_31_0", text: "保山市", value: "保山市", open: true}, {
pId: "0_1_31",
id: "0_1_31_1",
text: "楚雄彝族自治州",
value: "楚雄彝族自治州",
open: true
}, {pId: "0_1_31", id: "0_1_31_2", text: "大理白族自治州", value: "大理白族自治州", open: true}, {
pId: "0_1_31",
id: "0_1_31_3",
text: "红河哈尼族彝族自治州",
value: "红河哈尼族彝族自治州",
open: true
}, {pId: "0_1_31", id: "0_1_31_4", text: "昆明市", value: "昆明市", open: true}, {
pId: "0_1_31",
id: "0_1_31_5",
text: "丽江市",
value: "丽江市",
open: true
}, {pId: "0_1_31", id: "0_1_31_6", text: "临沧市", value: "临沧市", open: true}, {
pId: "0_1_31",
id: "0_1_31_7",
text: "曲靖市",
value: "曲靖市",
open: true
}, {pId: "0_1_31", id: "0_1_31_8", text: "思茅市", value: "思茅市", open: true}, {
pId: "0_1_31",
id: "0_1_31_9",
text: "文山市",
value: "文山市",
open: true
}, {pId: "0_1_31", id: "0_1_31_10", text: "玉溪市", value: "玉溪市", open: true}, {
pId: "0_1_31",
id: "0_1_31_11",
text: "昭通市",
value: "昭通市",
open: true
}, {pId: "0_1", id: "0_1_32", text: "浙江省( 共12个 )", value: "浙江省", open: true}, {
pId: "0_1_32",
id: "0_1_32_0",
text: "杭州市",
value: "杭州市",
open: true
}, {pId: "0_1_32", id: "0_1_32_1", text: "湖州市", value: "湖州市", open: true}, {
pId: "0_1_32",
id: "0_1_32_2",
text: "嘉兴市",
value: "嘉兴市",
open: true
}, {pId: "0_1_32", id: "0_1_32_3", text: "金华市", value: "金华市", open: true}, {
pId: "0_1_32",
id: "0_1_32_4",
text: "丽水市",
value: "丽水市",
open: true
}, {pId: "0_1_32", id: "0_1_32_5", text: "宁波市", value: "宁波市", open: true}, {
pId: "0_1_32",
id: "0_1_32_6",
text: "衢州市",
value: "衢州市",
open: true
}, {pId: "0_1_32", id: "0_1_32_7", text: "绍兴市", value: "绍兴市", open: true}, {
pId: "0_1_32",
id: "0_1_32_8",
text: "台州市",
value: "台州市",
open: true
}, {pId: "0_1_32", id: "0_1_32_9", text: "温州市", value: "温州市", open: true}, {
pId: "0_1_32",
id: "0_1_32_10",
text: "浙江省",
value: "浙江省",
open: true
}, {pId: "0_1_32", id: "0_1_32_11", text: "舟山市", value: "舟山市", open: true}, {
pId: "0_1",
id: "0_1_33",
text: "重庆市( 共1个 )",
value: "重庆市",
open: true
}, {pId: "0_1_33", id: "0_1_33_0", text: "重庆市区", value: "重庆市区", open: true}],
TREE: [{id: -1, pId: -2, value: "根目录", text: "根目录"},
{id: 1, pId: -1, value: "第一级目录1", text: "第一级目录1"},
{id: 11, pId: 1, value: "第二级文件1", text: "第二级文件1"},
{id: 12, pId: 1, value: "第二级目录2", text: "第二级目录2"},
{id: 121, pId: 12, value: "第三级目录1", text: "第三级目录1"},
{id: 122, pId: 12, value: "第三级文件1", text: "第三级文件1"},
{id: 1211, pId: 121, value: "第四级目录1", text: "第四级目录1"},
{
id: 12111,
pId: 1211,
value: "第五级文件1",
text: "第五级文件111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
},
{id: 2, pId: -1, value: "第一级目录2", text: "第一级目录2"},
{id: 21, pId: 2, value: "第二级目录3", text: "第二级目录3"},
{id: 22, pId: 2, value: "第二级文件2", text: "第二级文件2"},
{id: 211, pId: 21, value: "第三级目录2", text: "第三级目录2"},
{id: 212, pId: 21, value: "第三级文件2", text: "第三级文件2"},
{id: 2111, pId: 211, value: "第四级文件1", text: "第四级文件1"}],
LEVELTREE: [{
id: 1,
text: "第一项",
value: "1"
}, {
id: 2,
text: "第二项",
value: "2"
}, {
id: 3,
text: "第三项",
value: "3",
open: true
}, {
id: 11,
pId: 1,
text: "子项1",
value: "11"
}, {
id: 12,
pId: 1,
text: "子项2",
value: "12"
}, {
id: 13,
pId: 1,
text: "子项3",
value: "13"
}, {
id: 31,
pId: 3,
text: "子项1",
value: "31"
}, {
id: 32,
pId: 3,
text: "子项2",
value: "32"
}, {
id: 33,
pId: 3,
text: "子项3",
value: "33"
}]
};
/***/ })
/******/ ]);
//# sourceMappingURL=./demo.js.map