/*! * DevExtreme (dx.all.debug.js) * Version: 16.1.5 * Build date: Mon Jul 25 2016 * * Copyright (c) 2012 - 2016 Developer Express Inc. ALL RIGHTS RESERVED * EULA: https://www.devexpress.com/Support/EULAs/DevExtreme.xml */ "use strict"; ! function(modules) { var installedModules = {}; function __webpack_require__(moduleId) { if (installedModules[moduleId]) { return installedModules[moduleId].exports } var module = installedModules[moduleId] = { exports: {}, id: moduleId, loaded: false }; modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); module.loaded = true; return module.exports } __webpack_require__.m = modules; __webpack_require__.c = installedModules; __webpack_require__.p = ""; return __webpack_require__(0) }([ /*!**************************!*\ !*** multi dx.all.debug ***! \**************************/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! c:\projects\DevExtreme\16.1\BuildLabel\Temp\DevExtreme.v16.1\repo\DXTreme.ClientResources\Root\Scripts\bundles\dx.all.js */ 586) }, /*!*************************!*\ !*** external "jQuery" ***! \*************************/ function(module, exports) { module.exports = jQuery }, /*!**************************************!*\ !*** ./Scripts/core/utils/common.js ***! \**************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), config = __webpack_require__( /*! ../config */ 35); var isDefined = function(object) { return null !== object && void 0 !== object }; var isString = function(object) { return "string" === $.type(object) }; var isNumber = function(object) { return "number" === typeof object && isFinite(object) || $.isNumeric(object) }; var isObject = function(object) { return "object" === $.type(object) }; var isArray = function(object) { return "array" === $.type(object) }; var isDate = function(object) { return "date" === $.type(object) }; var isBoolean = function(object) { return "boolean" === $.type(object) }; var isFunction = function(object) { return "function" === $.type(object) }; var isPrimitive = function(value) { return -1 === $.inArray($.type(value), ["object", "array", "function"]) }; var isExponential = function(value) { return isNumber(value) && -1 !== value.toString().indexOf("e") }; var ensureDefined = function(value, defaultValue) { return isDefined(value) ? value : defaultValue }; var getDefaultAlignment = function(isRtlEnabled) { var rtlEnabled = isRtlEnabled || config().rtlEnabled; return rtlEnabled ? "right" : "left" }; var executeAsync = function(action, context) { var timerId, deferred = $.Deferred(), normalizedContext = context || this, task = { promise: deferred.promise(), abort: function() { clearTimeout(timerId); deferred.rejectWith(normalizedContext) } }, callback = function() { var result = action.call(normalizedContext); if (result && result.done && $.isFunction(result.done)) { result.done(function() { deferred.resolveWith(normalizedContext) }) } else { deferred.resolveWith(normalizedContext) } }; timerId = (arguments[2] || setTimeout)(callback, "number" === typeof context ? context : 0); return task }; var delayedFuncs = []; var delayedNames = []; var delayedDeferreds = []; var executingName; var deferExecute = function(name, func, deferred) { if (executingName && executingName !== name) { delayedFuncs.push(func); delayedNames.push(name); deferred = deferred || $.Deferred(); delayedDeferreds.push(deferred); return deferred } else { var oldExecutingName = executingName, currentDelayedCount = delayedDeferreds.length; executingName = name; var result = func(); if (!result) { if (delayedDeferreds.length > currentDelayedCount) { result = $.when.apply($, delayedDeferreds.slice(currentDelayedCount)) } else { if (deferred) { deferred.resolve() } } } executingName = oldExecutingName; if (deferred && result && result.done) { result.done(deferred.resolve).fail(deferred.reject) } if (!executingName && delayedFuncs.length) { ("render" === delayedNames.shift() ? deferRender : deferUpdate)(delayedFuncs.shift(), delayedDeferreds.shift()) } return result } }; var deferRender = function(func, deferred) { return deferExecute("render", func, deferred) }; var deferUpdate = function(func, deferred) { return deferExecute("update", func, deferred) }; var deferRenderer = function(func) { return function() { var that = this; return deferExecute("render", function() { return func.call(that) }) } }; var deferUpdater = function(func) { return function() { var that = this; return deferExecute("update", function() { return func.call(that) }) } }; var findBestMatches = function(targetFilter, items, mapFn) { var bestMatches = [], maxMatchCount = 0; $.each(items, function(index, itemSrc) { var matchCount = 0, item = mapFn ? mapFn(itemSrc) : itemSrc; $.each(targetFilter, function(paramName, targetValue) { var value = item[paramName]; if (void 0 === value) { return } if (match(value, targetValue)) { matchCount++; return } matchCount = -1; return false }); if (matchCount < maxMatchCount) { return } if (matchCount > maxMatchCount) { bestMatches.length = 0; maxMatchCount = matchCount } bestMatches.push(itemSrc) }); return bestMatches }; var match = function(value, targetValue) { if ($.isArray(value) && $.isArray(targetValue)) { var mismatch = false; $.each(value, function(index, valueItem) { if (valueItem !== targetValue[index]) { mismatch = true; return false } }); if (mismatch) { return false } return true } if (value === targetValue) { return true } return false }; var splitPair = function(raw) { switch (typeof raw) { case "string": return raw.split(/\s+/, 2); case "object": return [raw.x || raw.h, raw.y || raw.v]; case "number": return [raw]; default: return raw } }; var splitQuad = function(raw) { switch (typeof raw) { case "string": return raw.split(/\s+/, 4); case "object": return [raw.x || raw.h || raw.left, raw.y || raw.v || raw.top, raw.x || raw.h || raw.right, raw.y || raw.v || raw.bottom]; case "number": return [raw]; default: return raw } }; var normalizeKey = function(id) { var key = isString(id) ? id : id.toString(), arr = key.match(/[^a-zA-Z0-9]/g); arr && $.each(arr, function(_, sign) { key = key.replace(sign, "_" + sign.charCodeAt() + "_") }); return key }; exports.isDefined = isDefined; exports.isString = isString; exports.isNumber = isNumber; exports.isObject = isObject; exports.isArray = isArray; exports.isDate = isDate; exports.isBoolean = isBoolean; exports.isFunction = isFunction; exports.isPrimitive = isPrimitive; exports.isExponential = isExponential; exports.ensureDefined = ensureDefined; exports.executeAsync = executeAsync; exports.deferRender = deferRender; exports.deferRenderer = deferRenderer; exports.deferUpdate = deferUpdate; exports.deferUpdater = deferUpdater; exports.splitPair = splitPair; exports.splitQuad = splitQuad; exports.findBestMatches = findBestMatches; exports.getDefaultAlignment = getDefaultAlignment; exports.normalizeKey = normalizeKey }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***********************************************!*\ !*** ./Scripts/core/component_registrator.js ***! \***********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), errors = __webpack_require__( /*! ./errors */ 10), MemorizedCallbacks = __webpack_require__( /*! ./memorized_callbacks */ 140); var callbacks = new MemorizedCallbacks; var registerComponent = function(name, namespace, componentClass) { if (!componentClass) { componentClass = namespace } else { namespace[name] = componentClass } componentClass.publicName(name); callbacks.fire(name, componentClass) }; registerComponent.callbacks = callbacks; var registerJQueryComponent = function(name, componentClass) { $.fn[name] = function(options) { var result, isMemberInvoke = "string" === typeof options; if (isMemberInvoke) { var memberName = options, memberArgs = $.makeArray(arguments).slice(1); this.each(function() { var instance = componentClass.getInstance(this); if (!instance) { throw errors.Error("E0009", name) } var member = instance[memberName], memberValue = member.apply(instance, memberArgs); if (void 0 === result) { result = memberValue } }) } else { this.each(function() { var instance = componentClass.getInstance(this); if (instance) { instance.option(options) } else { new componentClass(this, options) } }); result = this } return result } }; callbacks.add(registerJQueryComponent); module.exports = registerComponent }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*********************************!*\ !*** ./Scripts/events/utils.js ***! \*********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), errors = __webpack_require__( /*! ../core/errors */ 10), eventNS = $.event, hooksNS = eventNS.fixHooks; var eventSource = function() { var EVENT_SOURCES_REGEX = { dx: /^dx/i, mouse: /(mouse|wheel)/i, touch: /^touch/i, keyboard: /^key/i, pointer: /^(ms)?pointer/i }; return function(e) { var result = "other"; $.each(EVENT_SOURCES_REGEX, function(key) { if (this.test(e.type)) { result = key; return false } }); return result } }(); var isDxEvent = function(e) { return "dx" === eventSource(e) }; var isNativeMouseEvent = function(e) { return "mouse" === eventSource(e) }; var isNativeTouchEvent = function(e) { return "touch" === eventSource(e) }; var isPointerEvent = function(e) { return "pointer" === eventSource(e) }; var isMouseEvent = function(e) { return isNativeMouseEvent(e) || (isPointerEvent(e) || isDxEvent(e)) && "mouse" === e.pointerType }; var isTouchEvent = function(e) { return isNativeTouchEvent(e) || (isPointerEvent(e) || isDxEvent(e)) && "touch" === e.pointerType }; var isKeyboardEvent = function(e) { return "keyboard" === eventSource(e) }; var isFakeClickEvent = function(e) { return 0 === e.screenX && !e.offsetX && 0 === e.pageX }; var eventData = function(e) { return { x: e.pageX, y: e.pageY, time: e.timeStamp } }; var eventDelta = function(from, to) { return { x: to.x - from.x, y: to.y - from.y, time: to.time - from.time || 1 } }; var hasTouches = function(e) { if (isNativeTouchEvent(e)) { return (e.originalEvent.touches || []).length } if (isDxEvent(e)) { return (e.pointers || []).length } return 0 }; var needSkipEvent = function(e) { var $target = $(e.target), touchInInput = $target.is("input, textarea, select"); if ($target.is(".dx-skip-gesture-event *, .dx-skip-gesture-event")) { return true } if ("dxmousewheel" === e.type) { return $target.is("input[type='number'], textarea, select") && $target.is(":focus") } if (isMouseEvent(e)) { return touchInInput || e.which > 1 } if (isTouchEvent(e)) { return touchInInput && $target.is(":focus") } }; var createEvent = function(originalEvent, args) { var event = $.Event(originalEvent), fixHook = hooksNS[originalEvent.type] || eventNS.mouseHooks; var props = fixHook.props ? eventNS.props.concat(fixHook.props) : eventNS.props, propIndex = props.length; while (propIndex--) { var prop = props[propIndex]; event[prop] = originalEvent[prop] } if (args) { $.extend(event, args) } return fixHook.filter ? fixHook.filter(event, originalEvent) : event }; var fireEvent = function(props) { var event = createEvent(props.originalEvent, props); eventNS.trigger(event, null, props.delegateTarget || event.target); return event }; var addNamespace = function(eventNames, namespace) { if (!namespace) { throw errors.Error("E0017") } if ("string" === typeof eventNames) { if (-1 === eventNames.indexOf(" ")) { return eventNames + "." + namespace } return addNamespace(eventNames.split(/\s+/g), namespace) } $.each(eventNames, function(index, eventName) { eventNames[index] = eventName + "." + namespace }); return eventNames.join(" ") }; module.exports = { eventSource: eventSource, isPointerEvent: isPointerEvent, isMouseEvent: isMouseEvent, isTouchEvent: isTouchEvent, isKeyboardEvent: isKeyboardEvent, isFakeClickEvent: isFakeClickEvent, hasTouches: hasTouches, eventData: eventData, eventDelta: eventDelta, needSkipEvent: needSkipEvent, createEvent: createEvent, fireEvent: fireEvent, addNamespace: addNamespace } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*******************************!*\ !*** ./Scripts/core/class.js ***! \*******************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var errors = __webpack_require__( /*! ./errors */ 10); var wrapOverridden = function(baseProto, methodName, method) { return function() { var prevCallBase = this.callBase; this.callBase = baseProto[methodName]; try { return method.apply(this, arguments) } finally { this.callBase = prevCallBase } } }; var clonePrototype = function(obj) { var func = function() {}; func.prototype = obj.prototype; return new func }; var redefine = function(members) { var overridden, memberName, member, that = this; if (!members) { return that } for (memberName in members) { member = members[memberName]; overridden = "function" === typeof that.prototype[memberName] && "function" === typeof member; that.prototype[memberName] = overridden ? wrapOverridden(that.parent.prototype, memberName, member) : member } return that }; var include = function() { var argument, name, i, classObj = this; for (i = 0; i < arguments.length; i++) { argument = arguments[i]; if (argument.ctor) { classObj._includedCtors.push(argument.ctor) } if (argument.postCtor) { classObj._includedPostCtors.push(argument.postCtor) } for (name in argument) { if ("ctor" === name || "postCtor" === name) { continue } if (name in classObj.prototype) { throw errors.Error("E0002", name) } classObj.prototype[name] = argument[name] } } return classObj }; var subclassOf = function(parentClass) { if (this.parent === parentClass) { return true } if (!this.parent || !this.parent.subclassOf) { return false } return this.parent.subclassOf(parentClass) }; var abstract = function() { throw errors.Error("E0001") }; var copyStatic = function() { var hasOwn = Object.prototype.hasOwnProperty; return function(source, destination) { for (var key in source) { if (!hasOwn.call(source, key)) { return } destination[key] = source[key] } } }(); var classImpl = function() {}; classImpl.inherit = function(members) { var inheritor = function() { if (!this || this === window || "function" !== typeof this.constructor) { throw errors.Error("E0003") } var i, instance = this, ctor = instance.ctor, includedCtors = instance.constructor._includedCtors, includedPostCtors = instance.constructor._includedPostCtors; for (i = 0; i < includedCtors.length; i++) { includedCtors[i].call(instance) } if (ctor) { ctor.apply(instance, arguments) } for (i = 0; i < includedPostCtors.length; i++) { includedPostCtors[i].call(instance) } }; inheritor.prototype = clonePrototype(this); copyStatic(this, inheritor); inheritor.inherit = this.inherit; inheritor.abstract = abstract; inheritor.redefine = redefine; inheritor.include = include; inheritor.subclassOf = subclassOf; inheritor.parent = this; inheritor._includedCtors = this._includedCtors ? this._includedCtors.slice(0) : []; inheritor._includedPostCtors = this._includedPostCtors ? this._includedPostCtors.slice(0) : []; inheritor.prototype.constructor = inheritor; inheritor.redefine(members); return inheritor }; classImpl.abstract = abstract; module.exports = classImpl }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***********************************!*\ !*** ./Scripts/viz/core/utils.js ***! \***********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), _isDefined = commonUtils.isDefined, _inArray = $.inArray, _each = $.each, _math = Math, _round = _math.round, _sqrt = Math.sqrt, _extend = $.extend; var PI = Math.PI, MAX_PIXEL_COUNT = 1e10, PI_DIV_180 = PI / 180, LN10 = Math.LN10; var cosFunc = Math.cos, sinFunc = Math.sin, abs = Math.abs, log = Math.log, floor = Math.floor, ceil = Math.ceil, max = Math.max, isNaN = window.isNaN, Number = window.Number, NaN = window.NaN; var isNumber = commonUtils.isNumber, isExponential = commonUtils.isExponential; var getPrecision = function(value) { var stringFraction, startIndex, precision, stringValue = value.toString(), pointIndex = stringValue.indexOf("."); if (isExponential(value)) { precision = getDecimalOrder(value); if (precision < 0) { return Math.abs(precision) } else { return 0 } } if (-1 !== pointIndex) { startIndex = pointIndex + 1; stringFraction = stringValue.substring(startIndex, startIndex + 20); return stringFraction.length } return 0 }; var getLog = function(value, base) { if (!value) { return NaN } return Math.log(value) / Math.log(base) }; var raiseTo = function(power, base) { return Math.pow(base, power) }; var normalizeAngle = function(angle) { return (angle % 360 + 360) % 360 }; var convertAngleToRendererSpace = function(angle) { return 90 - angle }; var degreesToRadians = function(value) { return PI * value / 180 }; var getCosAndSin = function(angle) { var angleInRadians = degreesToRadians(angle); return { cos: cosFunc(angleInRadians), sin: sinFunc(angleInRadians) } }; var DECIMAL_ORDER_THRESHOLD = 1e-14; var getDistance = function(x1, y1, x2, y2) { var diffX = x2 - x1, diffY = y2 - y1; return Math.sqrt(diffY * diffY + diffX * diffX) }; var getDecimalOrder = function(number) { var cn, n = abs(number); if (!isNaN(n)) { if (n > 0) { n = log(n) / LN10; cn = ceil(n); return cn - n < DECIMAL_ORDER_THRESHOLD ? cn : floor(n) } return 0 } return NaN }; var getAppropriateFormat = function(start, end, count) { var format, order = max(getDecimalOrder(start), getDecimalOrder(end)), precision = -getDecimalOrder(abs(end - start) / count); if (!isNaN(order) && !isNaN(precision)) { if (abs(order) <= 4) { format = "fixedPoint"; precision < 0 && (precision = 0); precision > 4 && (precision = 4) } else { format = "exponential"; precision += order - 1; precision > 3 && (precision = 3) } return { type: format, precision: precision } } return null }; var getFraction = function(value) { var valueString, dotIndex; if (isNumber(value)) { valueString = value.toString(); dotIndex = valueString.indexOf("."); if (dotIndex >= 0) { if (isExponential(value)) { return valueString.substr(dotIndex + 1, valueString.indexOf("e") - dotIndex - 1) } else { valueString = value.toFixed(20); return valueString.substr(dotIndex + 1, valueString.length - dotIndex + 1) } } } return "" }; var getSignificantDigitPosition = function(value) { var i, fraction = getFraction(value); if (fraction) { for (i = 0; i < fraction.length; i++) { if ("0" !== fraction.charAt(i)) { return i + 1 } } } return 0 }; var adjustValue = function(value) { var nextValue, i, fraction = getFraction(value); if (fraction) { for (i = 1; i <= fraction.length; i++) { nextValue = roundValue(value, i); if (0 !== nextValue && fraction[i - 2] && fraction[i - 1] && fraction[i - 2] === fraction[i - 1]) { return nextValue } } } return value }; var roundValue = function(value, precision) { if (precision > 20) { precision = 20 } if (isNumber(value)) { if (isExponential(value)) { return Number(value.toExponential(precision)) } else { return Number(value.toFixed(precision)) } } }; var applyPrecisionByMinDelta = function(min, delta, value) { var minPrecision = getPrecision(min), deltaPrecision = getPrecision(delta); return roundValue(value, minPrecision < deltaPrecision ? deltaPrecision : minPrecision) }; var getPower = function(value) { return value.toExponential().split("e")[1] }; function map(array, callback) { var value, i = 0, len = array.length, ret = []; while (i < len) { value = callback(array[i], i); if (null !== value) { ret.push(value) } i++ } return ret } function selectByKeys(object, keys) { return map(keys, function(key) { return object[key] ? object[key] : null }) } function decreaseFields(object, keys, eachDecrease, decrease) { var dec = decrease; _each(keys, function(_, key) { if (object[key]) { object[key] -= eachDecrease; dec -= eachDecrease } }); return dec } function normalizeEnum(value) { return String(value).toLowerCase() } function setCanvasValues(canvas) { if (canvas) { canvas.originalTop = canvas.top; canvas.originalBottom = canvas.bottom; canvas.originalLeft = canvas.left; canvas.originalRight = canvas.right } } function normalizeBBoxField(value) { return -MAX_PIXEL_COUNT < value && value < +MAX_PIXEL_COUNT ? value : 0 } function normalizeBBox(bbox) { var rxl = normalizeBBoxField(floor(bbox.x)), ryt = normalizeBBoxField(floor(bbox.y)), rxr = normalizeBBoxField(ceil(bbox.width + bbox.x)), ryb = normalizeBBoxField(ceil(bbox.height + bbox.y)), result = { x: rxl, y: ryt, width: rxr - rxl, height: ryb - ryt }; result.isEmpty = !result.x && !result.y && !result.width && !result.height; return result } function rotateBBox(bbox, center, angle) { var cos = Number(cosFunc(angle * PI_DIV_180).toFixed(3)), sin = Number(sinFunc(angle * PI_DIV_180).toFixed(3)), w2 = bbox.width / 2, h2 = bbox.height / 2, xc = bbox.x + w2, yc = bbox.y + h2, w2_ = abs(w2 * cos) + abs(h2 * sin), h2_ = abs(w2 * sin) + abs(h2 * cos), xc_ = center[0] + (xc - center[0]) * cos + (yc - center[1]) * sin, yc_ = center[1] - (xc - center[0]) * sin + (yc - center[1]) * cos; return normalizeBBox({ x: xc_ - w2_, y: yc_ - h2_, width: 2 * w2_, height: 2 * h2_ }) } $.extend(exports, { decreaseGaps: function(object, keys, decrease) { var arrayGaps; do { arrayGaps = selectByKeys(object, keys); arrayGaps.push(_math.ceil(decrease / arrayGaps.length)); decrease = decreaseFields(object, keys, _math.min.apply(null, arrayGaps), decrease) } while (decrease > 0 && arrayGaps.length > 1); return decrease }, normalizeEnum: normalizeEnum, parseScalar: function(value, defaultValue) { return void 0 !== value ? value : defaultValue }, enumParser: function(values) { var i, ii, stored = {}; for (i = 0, ii = values.length; i < ii; ++i) { stored[normalizeEnum(values[i])] = 1 } return function(value, defaultValue) { var _value = normalizeEnum(value); return stored[_value] ? _value : defaultValue } }, patchFontOptions: function(options) { var fontOptions = {}; _each(options || {}, function(key, value) { if (/^(cursor|opacity)$/i.test(key)) {} else { if ("color" === key) { key = "fill" } else { key = "font-" + key } } fontOptions[key] = value }); return fontOptions }, convertPolarToXY: function(centerCoords, startAngle, angle, radius) { var cossin, shiftAngle = 90; angle = _isDefined(angle) ? angle + startAngle - shiftAngle : 0; cossin = getCosAndSin(angle); return { x: _round(centerCoords.x + radius * cossin.cos), y: _round(centerCoords.y + radius * cossin.sin) } }, convertXYToPolar: function(centerCoords, x, y) { var radius = getDistance(centerCoords.x, centerCoords.y, x, y), angle = _math.atan2(y - centerCoords.y, x - centerCoords.x); return { phi: _round(normalizeAngle(180 * angle / _math.PI)), r: _round(radius) } }, processSeriesTemplate: function(seriesTemplate, items) { var series, length, data, customizeSeries = commonUtils.isFunction(seriesTemplate.customizeSeries) ? seriesTemplate.customizeSeries : $.noop, nameField = seriesTemplate.nameField || "series", generatedSeries = {}, seriesOrder = [], i = 0; for (length = items.length; i < length; i++) { data = items[i]; if (nameField in data) { series = generatedSeries[data[nameField]]; if (!series) { series = generatedSeries[data[nameField]] = { name: data[nameField], data: [] }; seriesOrder.push(series.name) } series.data.push(data) } } return map(seriesOrder, function(orderedName) { var group = generatedSeries[orderedName]; return $.extend(group, customizeSeries.call(null, group.name)) }) }, getCategoriesInfo: function(categories, startValue, endValue) { if (!(categories && categories.length > 0)) { return {} } startValue = _isDefined(startValue) ? startValue : categories[0]; endValue = _isDefined(endValue) ? endValue : categories[categories.length - 1]; var visibleCategories, swapBuf, hasVisibleCategories, visibleCategoriesLen, categoriesValue = map(categories, function(category) { return _isDefined(category) ? category.valueOf() : null }), indexStartValue = _isDefined(startValue) ? _inArray(startValue.valueOf(), categoriesValue) : 0, indexEndValue = _isDefined(endValue) ? _inArray(endValue.valueOf(), categoriesValue) : categories.length - 1, inverted = false; indexStartValue < 0 && (indexStartValue = 0); indexEndValue < 0 && (indexEndValue = categories.length - 1); if (indexEndValue < indexStartValue) { swapBuf = indexEndValue; indexEndValue = indexStartValue; indexStartValue = swapBuf; inverted = true } visibleCategories = categories.slice(indexStartValue, indexEndValue + 1); visibleCategoriesLen = visibleCategories.length; hasVisibleCategories = visibleCategoriesLen > 0; return { categories: hasVisibleCategories ? visibleCategories : null, start: hasVisibleCategories ? visibleCategories[inverted ? visibleCategoriesLen - 1 : 0] : null, end: hasVisibleCategories ? visibleCategories[inverted ? 0 : visibleCategoriesLen - 1] : null, inverted: inverted } }, setCanvasValues: setCanvasValues, updatePanesCanvases: function(panes, canvas, rotated) { var weightSum = 0; _each(panes, function(_, pane) { pane.weight = pane.weight || 1; weightSum += pane.weight }); var distributedSpace = 0, padding = panes.padding || 10, paneSpace = rotated ? canvas.width - canvas.left - canvas.right : canvas.height - canvas.top - canvas.bottom, oneWeight = (paneSpace - padding * (panes.length - 1)) / weightSum, startName = rotated ? "left" : "top", endName = rotated ? "right" : "bottom"; _each(panes, function(_, pane) { var calcLength = _round(pane.weight * oneWeight); pane.canvas = pane.canvas || {}; _extend(pane.canvas, { deltaLeft: 0, deltaRight: 0, deltaTop: 0, deltaBottom: 0 }, canvas); pane.canvas[startName] = canvas[startName] + distributedSpace; pane.canvas[endName] = canvas[endName] + (paneSpace - calcLength - distributedSpace); distributedSpace = distributedSpace + calcLength + padding; setCanvasValues(pane.canvas) }) }, unique: function(array) { var values = {}; return map(array, function(item) { var result = !values[item] ? item : null; values[item] = true; return result }) }, map: map, getVerticallyShiftedAngularCoords: function(bbox, dy, center) { var isPositive = bbox.x + bbox.width / 2 >= center.x, dx1 = (isPositive ? bbox.x : bbox.x + bbox.width) - center.x, dy1 = bbox.y - center.y, dy2 = dy1 + dy, dx2 = _round(_sqrt(dx1 * dx1 + dy1 * dy1 - dy2 * dy2)), dx = (isPositive ? +dx2 : -dx2) || dx1; return { x: center.x + (isPositive ? dx : dx - bbox.width), y: bbox.y + dy } } }); exports.getPrecision = getPrecision; exports.getLog = getLog; exports.raiseTo = raiseTo; exports.normalizeAngle = normalizeAngle; exports.convertAngleToRendererSpace = convertAngleToRendererSpace; exports.degreesToRadians = degreesToRadians; exports.getCosAndSin = getCosAndSin; exports.getDecimalOrder = getDecimalOrder; exports.getAppropriateFormat = getAppropriateFormat; exports.getDistance = getDistance; exports.getFraction = getFraction; exports.adjustValue = adjustValue; exports.roundValue = roundValue; exports.applyPrecisionByMinDelta = applyPrecisionByMinDelta; exports.getSignificantDigitPosition = getSignificantDigitPosition; exports.getPower = getPower; exports.rotateBBox = rotateBBox; exports.normalizeBBox = normalizeBBox }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*********************************!*\ !*** ./Scripts/core/devices.js ***! \*********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ./class */ 5), errors = __webpack_require__( /*! ./errors */ 10), resizeCallbacks = __webpack_require__( /*! ./utils/window */ 57).resizeCallbacks, EventsMixin = __webpack_require__( /*! ./events_mixin */ 32), SessionStorage = __webpack_require__( /*! ./utils/storage */ 122).sessionStorage, viewPort = __webpack_require__( /*! ./utils/view_port */ 52), Config = __webpack_require__( /*! ./config */ 35); var KNOWN_UA_TABLE = { iPhone: "iPhone", iPhone5: "iPhone", iPhone6: "iPhone", iPhone6plus: "iPhone", iPad: "iPad", iPadMini: "iPad Mini", androidPhone: "Android Mobile", androidTablet: "Android", win8: "MSAppHost", win8Phone: "Windows Phone 8.0", msSurface: "MSIE ARM Tablet PC", desktop: "desktop", win10Phone: "Windows Phone 10.0", win10: "MSAppHost/3.0" }; var DEFAULT_DEVICE = { deviceType: "desktop", platform: "generic", version: [], phone: false, tablet: false, android: false, ios: false, win: false, generic: true, grade: "A", mac: false }; var uaParsers = { win: function(userAgent) { var isPhone = /windows phone/i.test(userAgent) || userAgent.match(/WPDesktop/), isTablet = !isPhone && /arm(.*)trident/i.test(userAgent), isDesktop = !isPhone && !isTablet && /msapphost/i.test(userAgent); if (!(isPhone || isTablet || isDesktop)) { return } var matches = userAgent.match(/windows phone (\d+).(\d+)/i) || userAgent.match(/windows nt (\d+).(\d+)/i), version = []; if (matches) { version.push(parseInt(matches[1], 10), parseInt(matches[2], 10)) } else { matches = userAgent.match(/msapphost(\/(\d+).(\d+))?/i); matches && version.push(3 === parseInt(matches[2], 10) ? 10 : 8) } return { deviceType: isPhone ? "phone" : isTablet ? "tablet" : "desktop", platform: "win", version: version, grade: "A" } }, ios: function(userAgent) { if (!/ip(hone|od|ad)/i.test(userAgent)) { return } var isPhone = /ip(hone|od)/i.test(userAgent), matches = userAgent.match(/os (\d+)_(\d+)_?(\d+)?/i), version = matches ? [parseInt(matches[1], 10), parseInt(matches[2], 10), parseInt(matches[3] || 0, 10)] : [], isIPhone4 = 480 === window.screen.height, grade = isIPhone4 ? "B" : "A"; return { deviceType: isPhone ? "phone" : "tablet", platform: "ios", version: version, grade: grade } }, android: function(userAgent) { if (!/android|htc_|silk/i.test(userAgent)) { return } var isPhone = /mobile/i.test(userAgent), matches = userAgent.match(/android (\d+)\.(\d+)\.?(\d+)?/i), version = matches ? [parseInt(matches[1], 10), parseInt(matches[2], 10), parseInt(matches[3] || 0, 10)] : [], worseThan4_4 = version.length > 1 && (version[0] < 4 || 4 === version[0] && version[1] < 4), grade = worseThan4_4 ? "B" : "A"; return { deviceType: isPhone ? "phone" : "tablet", platform: "android", version: version, grade: grade } } }; var Devices = Class.inherit({ ctor: function(options) { this._window = options && options.window || window; this._realDevice = this._getDevice(); this._currentDevice = void 0; this._currentOrientation = void 0; this.changed = $.Callbacks(); this._recalculateOrientation(); resizeCallbacks.add($.proxy(this._recalculateOrientation, this)) }, current: function(deviceOrName) { if (deviceOrName) { this._currentDevice = this._getDevice(deviceOrName); this._forced = true; this.changed.fire(); if ("win" === this._currentDevice.platform && 8 === this._currentDevice.version[0]) { errors.log("W0010", "the 'win8' theme", "16.1", "Use the 'win10' theme instead.") } return } if (!this._currentDevice) { deviceOrName = void 0; try { deviceOrName = this._getDeviceOrNameFromWindowScope() } catch (e) { deviceOrName = this._getDeviceNameFromSessionStorage() } finally { if (!deviceOrName) { deviceOrName = this._getDeviceNameFromSessionStorage() } if (deviceOrName) { this._forced = true } } this._currentDevice = this._getDevice(deviceOrName) } return this._currentDevice }, real: function() { var forceDevice = arguments[0]; if ($.isPlainObject(forceDevice)) { $.extend(this._realDevice, forceDevice); return } return $.extend({}, this._realDevice) }, orientation: function() { return this._currentOrientation }, isForced: function() { return this._forced }, isRippleEmulator: function() { return !!this._window.tinyHippos }, _getCssClasses: function(device) { var result = []; var realDevice = this._realDevice; device = device || this.current(); if (device.deviceType) { result.push("dx-device-" + device.deviceType); if ("desktop" !== device.deviceType) { result.push("dx-device-mobile") } } result.push("dx-device-" + realDevice.platform); if (realDevice.version && realDevice.version.length) { result.push("dx-device-" + realDevice.platform + "-" + realDevice.version[0]) } if (devices.isSimulator()) { result.push("dx-simulator") } if (Config().rtlEnabled) { result.push("dx-rtl") } return result }, attachCssClasses: function(element, device) { this._deviceClasses = this._getCssClasses(device).join(" "); $(element).addClass(this._deviceClasses) }, detachCssClasses: function(element) { $(element).removeClass(this._deviceClasses) }, isSimulator: function() { try { return this._isSimulator || this._window.top !== this._window.self && this._window.top["dx-force-device"] || this.isRippleEmulator() } catch (e) { return false } }, forceSimulator: function() { this._isSimulator = true }, _getDevice: function(deviceName) { if ("genericPhone" === deviceName) { deviceName = { deviceType: "phone", platform: "generic", generic: true } } if ($.isPlainObject(deviceName)) { return this._fromConfig(deviceName) } else { var ua; if (deviceName) { ua = KNOWN_UA_TABLE[deviceName]; if (!ua) { throw errors.Error("E0005") } } else { ua = navigator.userAgent } return this._fromUA(ua) } }, _getDeviceOrNameFromWindowScope: function() { var result; if (this._window.top["dx-force-device-object"] || this._window.top["dx-force-device"]) { result = this._window.top["dx-force-device-object"] || this._window.top["dx-force-device"] } return result }, _getDeviceNameFromSessionStorage: function() { var sessionStorage = SessionStorage(); if (!sessionStorage) { return } var deviceOrName = sessionStorage.getItem("dx-force-device"); try { return $.parseJSON(deviceOrName) } catch (ex) { return deviceOrName } }, _fromConfig: function(config) { var result = $.extend({}, DEFAULT_DEVICE, this._currentDevice, config), shortcuts = { phone: "phone" === result.deviceType, tablet: "tablet" === result.deviceType, android: "android" === result.platform, ios: "ios" === result.platform, win: "win" === result.platform, generic: "generic" === result.platform }; return $.extend(result, shortcuts) }, _fromUA: function(ua) { var config; $.each(uaParsers, function(platform, parser) { config = parser(ua); return !config }); if (config) { return this._fromConfig(config) } var isMac = /(mac os)/.test(ua.toLowerCase()), deviceWithOS = DEFAULT_DEVICE; deviceWithOS.mac = isMac; return deviceWithOS }, _changeOrientation: function() { var $window = $(this._window), orientation = $window.height() > $window.width() ? "portrait" : "landscape"; if (this._currentOrientation === orientation) { return } this._currentOrientation = orientation; this.fireEvent("orientationChanged", [{ orientation: orientation }]) }, _recalculateOrientation: function() { var windowWidth = $(this._window).width(); if (this._currentWidth === windowWidth) { return } this._currentWidth = windowWidth; this._changeOrientation() } }).include(EventsMixin); var devices = new Devices; viewPort.changeCallback.add(function(viewPort, prevViewport) { devices.detachCssClasses(prevViewport); devices.attachCssClasses(viewPort) }); if (!devices.isForced() && "win" === devices.current().platform) { devices.current({ version: [10] }) } module.exports = devices }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************************!*\ !*** ./Scripts/localization/message.js ***! \*****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 80), stringFormat = __webpack_require__( /*! ../core/utils/string */ 26).format, humanize = __webpack_require__( /*! ../core/utils/inflector */ 29).humanize; __webpack_require__( /*! ./core */ 217); var baseDictionary = $.extend(true, {}, __webpack_require__( /*! ./en/core.en */ 296), __webpack_require__( /*! ./en/widgets-base.en */ 297), __webpack_require__( /*! ./en/widgets-mobile.en */ 298), __webpack_require__( /*! ./en/widgets-web.en */ 299)); var newMessages = {}; var messageLocalization = dependencyInjector({ _dictionary: baseDictionary, locale: function() { var currentLocale = "en"; return function(locale) { if (!locale) { return currentLocale } currentLocale = locale } }(), load: function(messages) { $.extend(true, this._dictionary, messages) }, _localizablePrefix: "@", setup: function(localizablePrefix) { this._localizablePrefix = localizablePrefix }, localizeString: function(text) { var that = this, regex = new RegExp("(^|[^a-zA-Z_0-9" + that._localizablePrefix + "-]+)(" + that._localizablePrefix + "{1,2})([a-zA-Z_0-9-]+)", "g"), escapeString = that._localizablePrefix + that._localizablePrefix; return text.replace(regex, function(str, prefix, escape, localizationKey) { var result, defaultResult = that._localizablePrefix + localizationKey; if (escape !== escapeString) { result = that.format(localizationKey) } if (!result) { newMessages[localizationKey] = humanize(localizationKey) } return prefix + (result || defaultResult) }) }, _messageLoaded: function(key, locale) { return void 0 !== this._dictionary[locale || this.locale()][key] }, localizeNode: function(node) { var that = this; $(node).each(function(index, nodeItem) { if (!nodeItem.nodeType) { return } if (3 === nodeItem.nodeType) { nodeItem.nodeValue = that.localizeString(nodeItem.nodeValue) } else { if (!$(nodeItem).is("iframe")) { $.each(nodeItem.attributes || [], function(index, attr) { if ("string" === typeof attr.value) { var localizedValue = that.localizeString(attr.value); if (attr.value !== localizedValue) { attr.value = localizedValue } } }); $(nodeItem).contents().each(function(index, node) { that.localizeNode(node) }) } } }) }, getMessagesByLocales: function() { return this._dictionary }, getDictionary: function(onlyNew) { if (onlyNew) { return newMessages } return $.extend({}, newMessages, this.getMessagesByLocales()[this.locale()]) }, getFormatter: function(key, locale) { var localeMessages = this._dictionary[locale || this.locale()], message = localeMessages && localeMessages[key]; if (message) { return function() { var args = 1 === arguments.length && Array.isArray(arguments[0]) ? arguments[0].slice(0) : Array.prototype.slice.call(arguments, 0); args.unshift(message); return stringFormat.apply(this, args) } } }, format: function(key) { var formatter = this.getFormatter(key); return formatter && formatter() || "" } }); module.exports = messageLocalization }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*********************************!*\ !*** ./Scripts/events/click.js ***! \*********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), devices = __webpack_require__( /*! ../core/devices */ 7), domUtils = __webpack_require__( /*! ../core/utils/dom */ 11), animationFrame = __webpack_require__( /*! ../animation/frame */ 75), eventUtils = __webpack_require__( /*! ./utils */ 4), pointerEvents = __webpack_require__( /*! ./pointer */ 13), Emitter = __webpack_require__( /*! ./core/emitter */ 81), registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 61); var CLICK_EVENT_NAME = "dxclick", TOUCH_BOUNDARY = 10, abs = Math.abs; var isInput = function(element) { return $(element).is("input, textarea, select, button ,:focus, :focus *") }; var misc = { requestAnimationFrame: animationFrame.requestAnimationFrame }; var ClickEmitter = Emitter.inherit({ ctor: function(element) { this.callBase(element); this._makeElementClickable($(element)) }, _makeElementClickable: function($element) { if (!$element.attr("onclick")) { $element.attr("onclick", "void(0)") } }, start: function(e) { this._blurPrevented = e.isDefaultPrevented(); this._startTarget = e.target; this._startEventData = eventUtils.eventData(e) }, end: function(e) { if (this._eventOutOfElement(e, this.getElement().get(0)) || e.type === pointerEvents.cancel) { this._cancel(e); return } if (!isInput(e.target) && !this._blurPrevented) { domUtils.resetActiveElement() } this._accept(e); misc.requestAnimationFrame($.proxy(function() { this._fireClickEvent(e) }, this)) }, _eventOutOfElement: function(e, element) { var target = e.target, targetChanged = !$.contains(element, target) && element !== target, gestureDelta = eventUtils.eventDelta(eventUtils.eventData(e), this._startEventData), boundsExceeded = abs(gestureDelta.x) > TOUCH_BOUNDARY || abs(gestureDelta.y) > TOUCH_BOUNDARY; return targetChanged || boundsExceeded }, _fireClickEvent: function(e) { this._fireEvent(CLICK_EVENT_NAME, e, { target: domUtils.closestCommonParent(this._startTarget, e.target) }) } }); ! function() { var NATIVE_CLICK_CLASS = "dx-native-click"; var useNativeClick = devices.real().generic; var prevented = null; function isNativeClickEvent(e) { return useNativeClick || $(e.target).closest("." + NATIVE_CLICK_CLASS).length } ClickEmitter = ClickEmitter.inherit({ configurate: function(data) { this.callBase(data); if (data.useNative) { this.getElement().addClass(NATIVE_CLICK_CLASS) } }, start: function(e) { prevented = null; if (!isNativeClickEvent(e)) { this.callBase(e) } }, end: function(e) { if (!isNativeClickEvent(e)) { this.callBase(e) } }, cancel: function() { prevented = true } }); var clickHandler = function(e) { if ((!e.which || 1 === e.which) && !prevented && isNativeClickEvent(e)) { eventUtils.fireEvent({ type: CLICK_EVENT_NAME, originalEvent: e }) } }; $(document).on(eventUtils.addNamespace("click", "NATIVE_DXCLICK_STRATEGY"), clickHandler); exports.useNativeClick = useNativeClick }(); ! function() { var desktopDevice = devices.real().generic; if (!desktopDevice) { var startTarget = null, blurPrevented = false; var pointerDownHandler = function(e) { startTarget = e.target; blurPrevented = e.isDefaultPrevented() }; var clickHandler = function(e) { var $target = $(e.target); if (!blurPrevented && startTarget && !$target.is(startTarget) && !$(startTarget).is("label") && isInput($target)) { domUtils.resetActiveElement() } startTarget = null; blurPrevented = false }; var NATIVE_CLICK_FIXER_NAMESPACE = "NATIVE_CLICK_FIXER"; $(document).on(eventUtils.addNamespace(pointerEvents.down, NATIVE_CLICK_FIXER_NAMESPACE), pointerDownHandler).on(eventUtils.addNamespace("click", NATIVE_CLICK_FIXER_NAMESPACE), clickHandler) } }(); registerEmitter({ emitter: ClickEmitter, bubble: true, events: [CLICK_EVENT_NAME] }); exports.name = CLICK_EVENT_NAME; exports.misc = misc }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!********************************!*\ !*** ./Scripts/core/errors.js ***! \********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var errorUtils = __webpack_require__( /*! ./utils/error */ 94); module.exports = errorUtils({ E0001: "Method is not implemented", E0002: "Member name collision: {0}", E0003: "A class must be instantiated using the 'new' keyword", E0004: "The NAME property of the component is not specified", E0005: "Unknown device", E0006: "Unknown endpoint key is requested", E0007: "'Invalidate' method is called outside the update transaction", E0008: "Type of the option name is not appropriate to create an action", E0009: "Component '{0}' has not been initialized for an element", E0010: "Animation configuration with the '{0}' type requires '{1}' configuration as {2}", E0011: "Unknown animation type '{0}'", E0012: "jQuery version is too old. Please upgrade jQuery to 1.10.0 or later", E0013: "KnockoutJS version is too old. Please upgrade KnockoutJS to 2.3.0 or later", E0014: "The 'release' method shouldn't be called for an unlocked Lock object", E0015: "Queued task returned an unexpected result", E0017: "Event namespace is not defined", E0018: "DevExpress.ui.DevExpressPopup widget is required", E0020: "Template engine '{0}' is not supported", E0021: "Unknown theme is set: {0}", E0022: "LINK[rel=DevExpress-theme] tags must go before DevExpress included scripts", E0023: "Template name is not specified", E0100: "Unknown validation type is detected", E0101: "Misconfigured range validation rule is detected", E0102: "Misconfigured comparison validation rule is detected", E0110: "Unknown validation group is detected", E0120: "Adapter for a DevExpressValidator component cannot be configured", E0121: "The onCustomItemCreating action should return an item or Promise of jQuery Deferred object resolved when an item is created", E4016: "The compileSetter(expr) method is called with 'self' passed as a parameter", W0000: "'{0}' is deprecated in {1}. {2}", W0001: "{0} - '{1}' option is deprecated in {2}. {3}", W0002: "{0} - '{1}' method is deprecated in {2}. {3}", W0003: "{0} - '{1}' property is deprecated in {2}. {3}", W0004: "Timeout for theme loading is over: {0}", W0005: "'{0}' event is deprecated in {1}. {2}", W0006: "Invalid recurrence rule: '{0}'", W0008: "Invalid view name: '{0}'", W0009: "Invalid time zone name: '{0}'", W0010: "{0} is deprecated in {1}. {2}", W0011: "Number parsing is invoked while the parser is not defined", W0012: "Date parsing is invoked while the parser is not defined" }) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***********************************!*\ !*** ./Scripts/core/utils/dom.js ***! \***********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), errors = __webpack_require__( /*! ../errors */ 10), commonUtils = __webpack_require__( /*! ./common */ 2); var resetActiveElement = function() { var activeElement = document.activeElement; if (activeElement && activeElement !== document.body && activeElement.blur) { activeElement.blur() } }; var getSelection = function() { if (window.getSelection) { return window.getSelection() } if (document.selection) { return document.selection } return null }; var clearSelection = function() { var selection = getSelection(); if (!selection) { return } if ("Caret" === selection.type) { return } if (selection.empty) { selection.empty() } else { if (selection.removeAllRanges) { selection.removeAllRanges() } } }; var closestCommonParent = function(startTarget, endTarget) { var $startParents = $(startTarget).parents().addBack(), $endParents = $(endTarget).parents().addBack(), startingParent = Math.min($startParents.length, $endParents.length) - 1; for (var i = startingParent; i >= 0; i--) { if ($startParents.eq(i).is($endParents.eq(i))) { return $startParents.get(i) } } }; var triggerVisibilityChangeEvent = function(eventName) { var VISIBILITY_CHANGE_SELECTOR = ".dx-visibility-change-handler"; return function(element) { var $element = $(element || "body"); var $changeHandlers = $element.find(VISIBILITY_CHANGE_SELECTOR).add($element.filter(VISIBILITY_CHANGE_SELECTOR)); $changeHandlers.each(function() { $(this).triggerHandler(eventName) }) } }; var uniqueId = function() { var counter = 0; return function(prefix) { return (prefix || "") + counter++ } }(); var dataOptionsAttributeName = "data-options"; var getElementOptions = function(element) { var result, optionsString = $(element).attr(dataOptionsAttributeName); if ("{" !== $.trim(optionsString).charAt(0)) { optionsString = "{" + optionsString + "}" } try { result = new Function("return " + optionsString)() } catch (ex) { throw errors.Error("E3018", ex, optionsString) } return result }; var createComponents = function(elements, componentTypes) { var result = [], selector = "[" + dataOptionsAttributeName + "]"; elements.find(selector).addBack(selector).each(function(index, element) { var $element = $(element), options = getElementOptions(element); for (var componentName in options) { if (!componentTypes || $.inArray(componentName, componentTypes) > -1) { if ($element[componentName]) { $element[componentName](options[componentName]); result.push($element[componentName]("instance")) } } } }); return result }; var createMarkupFromString = function(str) { if (!window.WinJS) { return $(str) } var tempElement = $("
"); window.WinJS.Utilities.setInnerHTMLUnsafe(tempElement.get(0), str); return tempElement.contents() }; var normalizeTemplateElement = function(element) { var $element = commonUtils.isDefined(element) && (element.nodeType || element.jquery) ? $(element) : $("
").html(element).contents(); if (1 === $element.length && $element.is("script")) { $element = normalizeTemplateElement($element.html()) } return $element }; var toggleAttr = function($target, attr, value) { value ? $target.attr(attr, value) : $target.removeAttr(attr) }; var clipboardText = function(event, text) { var clipboard = event.originalEvent && event.originalEvent.clipboardData || window.clipboardData; if (1 === arguments.length) { return clipboard && clipboard.getData("Text") } clipboard && clipboard.setData("Text", text) }; exports.resetActiveElement = resetActiveElement; exports.createMarkupFromString = createMarkupFromString; exports.triggerShownEvent = triggerVisibilityChangeEvent("dxshown"); exports.triggerHidingEvent = triggerVisibilityChangeEvent("dxhiding"); exports.triggerResizeEvent = triggerVisibilityChangeEvent("dxresize"); exports.getElementOptions = getElementOptions; exports.createComponents = createComponents; exports.normalizeTemplateElement = normalizeTemplateElement; exports.clearSelection = clearSelection; exports.getSelection = getSelection; exports.uniqueId = uniqueId; exports.closestCommonParent = closestCommonParent; exports.clipboardText = clipboardText; exports.toggleAttr = toggleAttr }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************!*\ !*** ./Scripts/core/utils/date.js ***! \************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ./common */ 2), inflector = __webpack_require__( /*! ./inflector */ 29), isObject = commonUtils.isObject, isString = commonUtils.isString, isDate = commonUtils.isDate, isDefined = commonUtils.isDefined, camelize = inflector.camelize; var dateUnitIntervals = ["millisecond", "second", "minute", "hour", "day", "week", "month", "quarter", "year"]; var toMilliseconds = function(value) { switch (value) { case "millisecond": return 1; case "second": return 1e3 * toMilliseconds("millisecond"); case "minute": return 60 * toMilliseconds("second"); case "hour": return 60 * toMilliseconds("minute"); case "day": return 24 * toMilliseconds("hour"); case "week": return 7 * toMilliseconds("day"); case "month": return 30 * toMilliseconds("day"); case "quarter": return 3 * toMilliseconds("month"); case "year": return 365 * toMilliseconds("day"); default: return 0 } }; var getDatesInterval = function(startDate, endDate, intervalUnit) { var delta = endDate.getTime() - startDate.getTime(), millisecondCount = toMilliseconds(intervalUnit) || 1; return Math.floor(delta / millisecondCount) }; var getNextDateUnit = function(unit, withWeeks) { var interval = getDateUnitInterval(unit); switch (interval) { case "millisecond": return "second"; case "second": return "minute"; case "minute": return "hour"; case "hour": return "day"; case "day": return withWeeks ? "week" : "month"; case "week": return "month"; case "month": return "quarter"; case "quarter": return "year"; case "year": return "year"; default: return 0 } }; var convertMillisecondsToDateUnits = function(value) { var i, dateUnitCount, dateUnitInterval, dateUnitIntervals = ["millisecond", "second", "minute", "hour", "day", "month", "year"], result = {}; for (i = dateUnitIntervals.length - 1; i >= 0; i--) { dateUnitInterval = dateUnitIntervals[i]; dateUnitCount = Math.floor(value / toMilliseconds(dateUnitInterval)); if (dateUnitCount > 0) { result[dateUnitInterval + "s"] = dateUnitCount; value -= convertDateUnitToMilliseconds(dateUnitInterval, dateUnitCount) } } return result }; var dateToMilliseconds = function(tickInterval) { var milliseconds = 0; if (isObject(tickInterval)) { $.each(tickInterval, function(key, value) { milliseconds += convertDateUnitToMilliseconds(key.substr(0, key.length - 1), value) }) } if (isString(tickInterval)) { milliseconds = convertDateUnitToMilliseconds(tickInterval, 1) } return milliseconds }; var convertDateUnitToMilliseconds = function(dateUnit, count) { return toMilliseconds(dateUnit) * count }; var getDateUnitInterval = function(tickInterval) { var i, maxInterval = -1; if (isString(tickInterval)) { return tickInterval } if (isObject(tickInterval)) { $.each(tickInterval, function(key, value) { for (i = 0; i < dateUnitIntervals.length; i++) { if (value && (key === dateUnitIntervals[i] + "s" || key === dateUnitIntervals[i]) && maxInterval < i) { maxInterval = i } } }); return dateUnitIntervals[maxInterval] } return "" }; var tickIntervalToFormatMap = { millisecond: "millisecond", second: "longtime", minute: "shorttime", hour: "shorttime", day: "day", week: "day", month: "month", quarter: "quarter", year: "year" }; function getDateFormatByTickInterval(tickInterval) { return tickIntervalToFormatMap[getDateUnitInterval(tickInterval)] || "" } var getQuarter = function(month) { return Math.floor(month / 3) }; var getFirstQuarterMonth = function(month) { return 3 * getQuarter(month) }; var correctDateWithUnitBeginning = function(date, dateInterval, withCorrection) { var firstQuarterMonth, oldDate = new Date(date.getTime()), dateUnitInterval = getDateUnitInterval(dateInterval); switch (dateUnitInterval) { case "second": date.setMilliseconds(0); break; case "minute": date.setSeconds(0, 0); break; case "hour": date.setMinutes(0, 0, 0); break; case "year": date.setMonth(0); case "month": date.setDate(1); case "day": date.setHours(0, 0, 0, 0); break; case "week": date.setDate(date.getDate() - date.getDay()); date.setHours(0, 0, 0, 0); break; case "quarter": firstQuarterMonth = getFirstQuarterMonth(date.getMonth()); if (date.getMonth() !== firstQuarterMonth) { date.setMonth(firstQuarterMonth) } date.setDate(1); date.setHours(0, 0, 0, 0) } if (withCorrection && "hour" !== dateUnitInterval && "minute" !== dateUnitInterval && "second" !== dateUnitInterval) { fixTimezoneGap(oldDate, date) } }; var trimTime = function(date) { dateUtils.correctDateWithUnitBeginning(date, "day"); return date }; var getDatesDifferences = function(date1, date2) { var differences, counter = 0; differences = { year: date1.getFullYear() !== date2.getFullYear(), month: date1.getMonth() !== date2.getMonth(), day: date1.getDate() !== date2.getDate(), hour: date1.getHours() !== date2.getHours(), minute: date1.getMinutes() !== date2.getMinutes(), second: date1.getSeconds() !== date2.getSeconds() }; $.each(differences, function(key, value) { if (value) { counter++ } }); differences.count = counter; return differences }; function addDateInterval(value, interval, dir) { var result = new Date(value.getTime()), intervalObject = isString(interval) ? getDateIntervalByString(interval.toLowerCase()) : interval; if (intervalObject.years) { result.setFullYear(result.getFullYear() + intervalObject.years * dir) } if (intervalObject.quarters) { result.setMonth(result.getMonth() + 3 * intervalObject.quarters * dir) } if (intervalObject.months) { result.setMonth(result.getMonth() + intervalObject.months * dir) } if (intervalObject.weeks) { result.setDate(result.getDate() + 7 * intervalObject.weeks * dir) } if (intervalObject.days) { result.setDate(result.getDate() + intervalObject.days * dir) } if (intervalObject.hours) { result.setHours(result.getHours() + intervalObject.hours * dir) } if (intervalObject.minutes) { result.setMinutes(result.getMinutes() + intervalObject.minutes * dir) } if (intervalObject.seconds) { result.setSeconds(result.getSeconds() + intervalObject.seconds * dir) } if (intervalObject.milliseconds) { result.setMilliseconds(value.getMilliseconds() + intervalObject.milliseconds * dir) } return result } var addInterval = function(value, interval, isNegative) { var dir = isNegative ? -1 : 1; return isDate(value) ? addDateInterval(value, interval, dir) : value + interval * dir }; var getViewFirstCellDate = function(viewType, date) { if ("month" === viewType) { return new Date(date.getFullYear(), date.getMonth(), 1) } if ("year" === viewType) { return new Date(date.getFullYear(), 0, date.getDate()) } if ("decade" === viewType) { return new Date(getFirstYearInDecade(date), date.getMonth(), date.getDate()) } if ("century" === viewType) { return new Date(getFirstDecadeInCentury(date), date.getMonth(), date.getDate()) } }; var getViewLastCellDate = function(viewType, date) { if ("month" === viewType) { return new Date(date.getFullYear(), date.getMonth(), getLastMonthDay(date)) } if ("year" === viewType) { return new Date(date.getFullYear(), 11, date.getDate()) } if ("decade" === viewType) { return new Date(getFirstYearInDecade(date) + 9, date.getMonth(), date.getDate()) } if ("century" === viewType) { return new Date(getFirstDecadeInCentury(date) + 90, date.getMonth(), date.getDate()) } }; var getViewMinBoundaryDate = function(viewType, date) { var resultDate = new Date(date.getFullYear(), date.getMonth(), 1); if ("month" === viewType) { return resultDate } resultDate.setMonth(0); if ("year" === viewType) { return resultDate } if ("decade" === viewType) { resultDate.setFullYear(getFirstYearInDecade(date)) } if ("century" === viewType) { resultDate.setFullYear(getFirstDecadeInCentury(date)) } return resultDate }; var getViewMaxBoundaryDate = function(viewType, date) { var resultDate = new Date(date.getFullYear(), date.getMonth(), getLastMonthDay(date)); if ("month" === viewType) { return resultDate } resultDate.setMonth(11); resultDate.setDate(getLastMonthDay(resultDate)); if ("year" === viewType) { return resultDate } if ("decade" === viewType) { resultDate.setFullYear(getFirstYearInDecade(date) + 9) } if ("century" === viewType) { resultDate.setFullYear(getFirstDecadeInCentury(date) + 99) } return resultDate }; var getLastMonthDay = function(date) { var resultDate = new Date(date.getFullYear(), date.getMonth() + 1, 0); return resultDate.getDate() }; var sameView = function(view, date1, date2) { return dateUtils[camelize("same " + view)](date1, date2) }; var getViewUp = function(typeView) { switch (typeView) { case "month": return "year"; case "year": return "decade"; case "decade": return "century" } }; var getViewDown = function(typeView) { switch (typeView) { case "century": return "decade"; case "decade": return "year"; case "year": return "month" } }; var getDifferenceInMonth = function(typeView) { var difference = 1; if ("year" === typeView) { difference = 12 } if ("decade" === typeView) { difference = 120 } if ("century" === typeView) { difference = 1200 } return difference }; var getDifferenceInMonthForCells = function(typeView) { var difference = 1; if ("decade" === typeView) { difference = 12 } if ("century" === typeView) { difference = 120 } return difference }; var getDateIntervalByString = function(intervalString) { var result = {}; switch (intervalString) { case "year": result.years = 1; break; case "month": result.months = 1; break; case "quarter": result.months = 3; break; case "week": result.days = 7; break; case "day": result.days = 1; break; case "hour": result.hours = 1; break; case "minute": result.minutes = 1; break; case "second": result.seconds = 1; break; case "millisecond": result.milliseconds = 1 } return result }; var sameMonthAndYear = function(date1, date2) { return date1 && date2 && date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() }; var sameYear = function(date1, date2) { return date1 && date2 && date1.getFullYear() === date2.getFullYear() }; var sameDecade = function(date1, date2) { if (!isDefined(date1) || !isDefined(date2)) { return } var startDecadeDate1 = date1.getFullYear() - date1.getFullYear() % 10, startDecadeDate2 = date2.getFullYear() - date2.getFullYear() % 10; return date1 && date2 && startDecadeDate1 === startDecadeDate2 }; var sameCentury = function(date1, date2) { if (!isDefined(date1) || !isDefined(date2)) { return } var startCenturyDate1 = date1.getFullYear() - date1.getFullYear() % 100, startCenturyDate2 = date2.getFullYear() - date2.getFullYear() % 100; return date1 && date2 && startCenturyDate1 === startCenturyDate2 }; var getFirstDecadeInCentury = function(date) { return date && date.getFullYear() - date.getFullYear() % 100 }; var getFirstYearInDecade = function(date) { return date && date.getFullYear() - date.getFullYear() % 10 }; var getShortDateFormat = function() { return "yyyy/M/d" }; var getFirstMonthDate = function(date) { if (!isDefined(date)) { return } var newDate = new Date(date.getFullYear(), date.getMonth(), 1); return newDate }; var getLastMonthDate = function(date) { if (!isDefined(date)) { return } var newDate = new Date(date.getFullYear(), date.getMonth() + 1, 0); return newDate }; var getFirstWeekDate = function(date, firstDayOfWeek) { var delta = (date.getDay() - firstDayOfWeek + 7) % 7; var result = new Date(date); result.setDate(date.getDate() - delta); return result }; var normalizeDateByWeek = function(date, currentDate) { var differenceInDays = dateUtils.getDatesInterval(date, currentDate, "day"), resultDate = new Date(date); if (differenceInDays >= 6) { resultDate = new Date(resultDate.setDate(resultDate.getDate() + 7)) } return resultDate }; var dateInRange = function(date, min, max, format) { if ("date" === format) { min = min && new Date(min.getFullYear(), min.getMonth(), min.getDate()); max = max && new Date(max.getFullYear(), max.getMonth(), max.getDate()); date = date && new Date(date.getFullYear(), date.getMonth(), date.getDate()) } return normalizeDate(date, min, max) === date }; var normalizeDate = function(date, min, max) { var normalizedDate = date; if (!isDefined(date)) { return date } if (isDefined(min) && date < min) { normalizedDate = min } if (isDefined(max) && date > max) { normalizedDate = max } return normalizedDate }; var fixTimezoneGap = function(oldDate, newDate) { if (!isDefined(oldDate)) { return } var sign, trial, diff = newDate.getHours() - oldDate.getHours(); if (0 === diff) { return } sign = 1 === diff || -23 === diff ? -1 : 1, trial = new Date(newDate.getTime() + 36e5 * sign); if (sign > 0 || trial.getDate() === newDate.getDate()) { newDate.setTime(trial.getTime()) } }; var getTimezonesDifference = function(min, max) { return 60 * (max.getTimezoneOffset() - min.getTimezoneOffset()) * 1e3 }; var makeDate = function(date) { return new Date(date) }; var NUMBER_SERIALIZATION_FORMAT = "number", DATE_SERIALIZATION_FORMAT = "yyyy'/'MM'/'dd", DATETIME_SERIALIZATION_FORMAT = "yyyy'/'MM'/'dd HH:mm:ss"; var getDateSerializationFormat = function(value) { if (commonUtils.isNumber(value)) { return NUMBER_SERIALIZATION_FORMAT } else { if (commonUtils.isString(value)) { if (value.indexOf(":") >= 0) { return DATETIME_SERIALIZATION_FORMAT } else { return DATE_SERIALIZATION_FORMAT } } } }; var deserializeDate = function(value, serializationFormat, localizationParseFunc) { var parsedValue; if (!serializationFormat || serializationFormat === NUMBER_SERIALIZATION_FORMAT || serializationFormat === DATE_SERIALIZATION_FORMAT || serializationFormat === DATETIME_SERIALIZATION_FORMAT) { parsedValue = serializationFormat === NUMBER_SERIALIZATION_FORMAT ? value : !isDate(value) && Date.parse(value); return parsedValue ? new Date(parsedValue) : value } if (void 0 !== value) { return localizationParseFunc(value, serializationFormat) } }; var serializeDate = function(value, serializationFormat, localizationFormatFunc) { if (serializationFormat === NUMBER_SERIALIZATION_FORMAT) { return value && value.valueOf && value.valueOf() } if (serializationFormat) { return localizationFormatFunc(value, serializationFormat) } return value }; var dateUtils = { dateUnitIntervals: dateUnitIntervals, convertMillisecondsToDateUnits: convertMillisecondsToDateUnits, dateToMilliseconds: dateToMilliseconds, getNextDateUnit: getNextDateUnit, convertDateUnitToMilliseconds: convertDateUnitToMilliseconds, getDateUnitInterval: getDateUnitInterval, getDateFormatByTickInterval: getDateFormatByTickInterval, getDatesDifferences: getDatesDifferences, correctDateWithUnitBeginning: correctDateWithUnitBeginning, trimTime: trimTime, addDateInterval: addDateInterval, addInterval: addInterval, getDateIntervalByString: getDateIntervalByString, sameMonthAndYear: sameMonthAndYear, sameMonth: sameMonthAndYear, sameYear: sameYear, sameDecade: sameDecade, sameCentury: sameCentury, sameView: sameView, getDifferenceInMonth: getDifferenceInMonth, getDifferenceInMonthForCells: getDifferenceInMonthForCells, getFirstYearInDecade: getFirstYearInDecade, getFirstDecadeInCentury: getFirstDecadeInCentury, getShortDateFormat: getShortDateFormat, getViewFirstCellDate: getViewFirstCellDate, getViewLastCellDate: getViewLastCellDate, getViewDown: getViewDown, getViewUp: getViewUp, getLastMonthDay: getLastMonthDay, getLastMonthDate: getLastMonthDate, getFirstMonthDate: getFirstMonthDate, getFirstWeekDate: getFirstWeekDate, normalizeDateByWeek: normalizeDateByWeek, getQuarter: getQuarter, getFirstQuarterMonth: getFirstQuarterMonth, dateInRange: dateInRange, normalizeDate: normalizeDate, getViewMinBoundaryDate: getViewMinBoundaryDate, getViewMaxBoundaryDate: getViewMaxBoundaryDate, fixTimezoneGap: fixTimezoneGap, getTimezonesDifference: getTimezonesDifference, makeDate: makeDate, deserializeDate: deserializeDate, serializeDate: serializeDate, getDateSerializationFormat: getDateSerializationFormat, getDatesInterval: getDatesInterval }; module.exports = dateUtils }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***********************************!*\ !*** ./Scripts/events/pointer.js ***! \***********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), support = __webpack_require__( /*! ../core/utils/support */ 18), devices = __webpack_require__( /*! ../core/devices */ 7), registerEvent = __webpack_require__( /*! ./core/event_registrator */ 43), TouchStrategy = __webpack_require__( /*! ./pointer/touch */ 208), MsPointerStrategy = __webpack_require__( /*! ./pointer/mspointer */ 275), MouseStrategy = __webpack_require__( /*! ./pointer/mouse */ 206), MouseAndTouchStrategy = __webpack_require__( /*! ./pointer/mouse_and_touch */ 274); var EventStrategy = function() { if (support.pointerEvents) { return MsPointerStrategy } var device = devices.real(); if (support.touch && !(device.tablet || device.phone)) { return MouseAndTouchStrategy } if (support.touch) { return TouchStrategy } return MouseStrategy }(); $.each(EventStrategy.map, function(pointerEvent, originalEvents) { registerEvent(pointerEvent, new EventStrategy(pointerEvent, originalEvents)) }); module.exports = { down: "dxpointerdown", up: "dxpointerup", move: "dxpointermove", cancel: "dxpointercancel", enter: "dxpointerenter", leave: "dxpointerleave", over: "dxpointerover", out: "dxpointerout" } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************!*\ !*** ./Scripts/localization/date.js ***! \**************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), numberLocalization = __webpack_require__( /*! ./number */ 38), dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 80), errors = __webpack_require__( /*! ../core/errors */ 10); __webpack_require__( /*! ./core */ 217); var FORMATS_TO_PATTERN_MAP = { shortdate: "M/d/y", shorttime: "h:mm a", longdate: "EEEE, MMMM d, y", longtime: "h:mm:ss a", monthandday: "MMMM d", monthandyear: "MMMM y", quarterandyear: "QQQ y", day: "d", year: "y", shortdateshorttime: "M/d/y, h:mm a", mediumdatemediumtime: "MMMM d, h:mm a", longdatelongtime: "EEEE, MMMM d, y, h:mm:ss a", month: "LLLL", shortyear: "yy", dayofweek: "EEEE", quarter: "QQQ", hour: "HH", minute: "mm", second: "ss", millisecond: "SSS", "datetime-local": "yyyy-MM-ddTHH':'mm':'ss" }; var parseTime = function(text) { var now = new Date, parts = text.split(" "), time = parts[0].split(":"), hours = Number(time[0]), minutes = Number(time[1]), second = Number(time[2]) || 0; if (/^pm$/i.test(parts[1])) { hours += 12 } return new Date(now.getFullYear(), now.getMonth(), now.getDate(), hours, minutes, second) }; var removeTimezoneOffset = function(date) { return new Date(date.valueOf() + 60 * date.getTimezoneOffset() * 1e3) }; var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; var ampm = function(date) { return date.getHours() >= 12 ? "PM" : "AM" }; var getTwelveHourTimeFormat = function(hours) { return hours % 12 || 12 }; var formatNumber = function(number, precision) { return numberLocalization.format(number, { type: "decimal", precision: precision }) }; var FORMATTERS = { millisecond: function(date) { return formatNumber(date.getMilliseconds(date), 3) }, second: function(date) { return formatNumber(date.getSeconds(), 2) }, minute: function(date) { return formatNumber(date.getMinutes(), 2) }, h: function(date) { return formatNumber(getTwelveHourTimeFormat(date.getHours()), 1) }, hh: function(date) { return formatNumber(getTwelveHourTimeFormat(date.getHours()), 2) }, hour: function(date) { return formatNumber(date.getHours(), 2) }, day: function(date) { return date.getDate() }, dayofweek: function(date) { return days[date.getDay()] }, M: function(date) { return date.getMonth() + 1 }, MM: function(date) { return formatNumber(date.getMonth() + 1, 2) }, month: function(date) { return months[date.getMonth()] }, year: function(date) { return date.getFullYear() }, shortyear: function(date) { return String(date.getFullYear()).substr(2, 2) }, shorttime: function(date) { return FORMATTERS.h(date) + ":" + FORMATTERS.minute(date) + " " + ampm(date) }, shortdate: function(date) { return [FORMATTERS.M(date), FORMATTERS.day(date), FORMATTERS.year(date)].join("/") }, shortdateshorttime: function(date) { return [FORMATTERS.shortdate(date), FORMATTERS.shorttime(date)].join(", ") }, mediumdatemediumtime: function(date) { return [FORMATTERS.monthandday(date), FORMATTERS.shorttime(date)].join(", ") }, monthandyear: function(date) { return [FORMATTERS.month(date), FORMATTERS.year(date)].join(" ") }, monthandday: function(date) { return [FORMATTERS.month(date), FORMATTERS.day(date)].join(" ") }, longdate: function(date) { return FORMATTERS.dayofweek(date) + ", " + FORMATTERS.month(date) + " " + FORMATTERS.day(date) + ", " + FORMATTERS.year(date) }, longtime: function(date) { return [FORMATTERS.h(date), FORMATTERS.minute(date), FORMATTERS.second(date)].join(":") + " " + ampm(date) }, longdatelongtime: function(date) { return [FORMATTERS.longdate(date), FORMATTERS.longtime(date)].join(", ") }, d: function(date) { return formatNumber(FORMATTERS.day(date), 1) }, dd: function(date) { return formatNumber(FORMATTERS.day(date), 2) }, "d MMMM": function(date) { return FORMATTERS.day(date) + " " + FORMATTERS.month(date) }, "yyyy/M/d": function(date) { return [FORMATTERS.year(date), FORMATTERS.M(date), FORMATTERS.day(date)].join("/") }, "yyyy/MM/dd": function(date) { return [FORMATTERS.year(date), FORMATTERS.MM(date), FORMATTERS.dd(date)].join("/") }, "dd.MM.yyyy": function(date) { return [FORMATTERS.dd(date), FORMATTERS.MM(date), FORMATTERS.year(date)].join(".") }, "HH:mm": function(date) { return [FORMATTERS.hour(date), FORMATTERS.minute(date)].join(":") }, "HH:mm:ss": function(date) { return [FORMATTERS["HH:mm"](date), FORMATTERS.second(date)].join(":") }, "h:mm:ss": function(date) { return [FORMATTERS.h(date), FORMATTERS.minute(date), FORMATTERS.second(date)].join(":") }, "h:mm:ss:SSS": function(date) { return [FORMATTERS.h(date), FORMATTERS.minute(date), FORMATTERS.second(date), FORMATTERS.SSS(date)].join(":") }, "yyyy/MM/dd HH:mm:ss": function(date) { return [FORMATTERS["yyyy/MM/dd"](date), FORMATTERS["HH:mm:ss"](date)].join(" ") }, "yyyy-MM-dd hh:mm:ss.SSS a": function(date) { return [ [FORMATTERS.year(date), FORMATTERS.MM(date), FORMATTERS.dd(date)].join("-"), [FORMATTERS.hh(date), FORMATTERS.minute(date), FORMATTERS.second(date)].join(":") + "." + FORMATTERS.SSS(date), ampm(date) ].join(" ") }, "yyyy-MM-dd": function(date) { return [FORMATTERS.year(date), FORMATTERS.MM(date), FORMATTERS.dd(date)].join("-") }, yyyyMMddTHHmmss: function(date) { return [FORMATTERS.year(date), FORMATTERS.MM(date), FORMATTERS.dd(date), "T", FORMATTERS.hour(date), FORMATTERS.minute(date), FORMATTERS.second(date)].join("") }, "datetime-local": function(date) { return FORMATTERS["yyyy-MM-dd"](date) + "T" + FORMATTERS["HH:mm:ss"](date) }, "yyyy-MM-ddTHH:mm:ssZ": function(date) { return FORMATTERS["datetime-local"](date) + "Z" }, "yyyy-MM-ddTHH:mmZ": function(date) { return FORMATTERS["yyyy-MM-dd"](date) + "T" + FORMATTERS.hour(date) + ":" + FORMATTERS.minute(date) + "Z" }, "dd/MM/yyyy": function(date) { return [FORMATTERS.dd(date), FORMATTERS.MM(date), FORMATTERS.year(date)].join("/") }, "yyyy MMMM d": function(date) { return [FORMATTERS.year(date), FORMATTERS.month(date), FORMATTERS.day(date)].join(" ") }, "EEEE, d": function(date) { return [FORMATTERS.dayofweek(date), FORMATTERS.d(date)].join(", ") }, "EEEE MM yy": function(date) { return [FORMATTERS.dayofweek(date), FORMATTERS.MM(date), FORMATTERS.shortyear(date)].join(" ") }, "d MMMM yyyy": function(date) { return [FORMATTERS.day(date), FORMATTERS.month(date), FORMATTERS.year(date)].join(" ") }, "E d": function(date) { return FORMATTERS.E(date) + " " + FORMATTERS.day(date) }, E: function(date) { return cutCaptions([FORMATTERS.dayofweek(date)], "abbreviated")[0] }, EEE: function(date) { return FORMATTERS.E(date) }, "EEE hh": function(date) { return [FORMATTERS.EEE(date), FORMATTERS.hh(date)].join(" ") }, "ss SSS": function(date) { return [FORMATTERS.second(date), FORMATTERS.SSS(date)].join(" ") }, quarter: function(date) { var month = date.getMonth(); if (month >= 0 && month < 3) { return "Q1" } if (month > 2 && month < 6) { return "Q2" } if (month > 5 && month < 9) { return "Q3" } return "Q4" }, quarterandyear: function(date) { return FORMATTERS.quarter(date) + " " + FORMATTERS.year(date) } }; var parseWithoutTimezone = function(text) { if ("Z" !== text.slice(-1)) { text += "Z" } return removeTimezoneOffset(new Date(text)) }; var PARSERS = { day: function(text) { var now = new Date; return new Date(now.getFullYear(), now.getMonth(), Number(text)) }, hour: function(text) { var now = new Date; return new Date(now.getFullYear(), now.getMonth(), now.getDate(), Number(text)) }, minute: function(text) { var now = new Date; return new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), Number(text)) }, month: function(text) { return new Date((new Date).getFullYear(), $.inArray(text, months)) }, monthandday: function(text) { var parts = text.split(" "), ret = PARSERS.month(parts[0]); ret.setDate(Number(parts[1])); return ret }, monthandyear: function(text) { var parts = text.split(" "), ret = PARSERS.month(parts[0]); ret.setYear(Number(parts[1])); return ret }, year: function(text) { var date = new Date(new Date(0)); date.setUTCFullYear(Number(text)); return removeTimezoneOffset(date) }, shortyear: function(text) { var MAX_YEAR_IN_XXI_CENTURY = 36; var year = Number(text); if (year > MAX_YEAR_IN_XXI_CENTURY) { year += 1900 } else { year += 2e3 } return PARSERS.year(year) }, shortdate: function(text) { var parts = text.split("/"); if (3 !== parts.length) { return } return new Date(Number(parts[2]), Number(parts[0]) - 1, Number(parts[1])) }, longtime: function(text) { return parseTime(text) }, shorttime: function(text) { return parseTime(text) }, millisecond: function(text) { return new Date(Number(text)) }, "yyyy MMMM d": function(text) { var parts = text.split(" "); if (3 !== parts.length) { return } return new Date(Number(parts[0]), $.inArray(parts[1], months), Number(parts[2])) }, "HH:mm": function(text) { var parts = text.split(":"); return new Date(0, 0, 0, Number(parts[0]), Number(parts[1]), 0, 0) }, "yyyy-MM-ddTHH:mm:ssZ": parseWithoutTimezone, "yyyy-MM-ddTHH:mmZ": parseWithoutTimezone, "datetime-local": parseWithoutTimezone, mediumdatemediumtime: function(text) { var parts = text.split(", "), dateParts = parts[0].split(" "), timeParts = parts[1].split(" "); var ampm = 2 === timeParts.length ? timeParts.pop() : void 0; var ret = PARSERS.month(dateParts[0]); ret.setDate(Number(dateParts[1])); timeParts = timeParts[0].split(":"); var hours = Number(timeParts[0]); switch (String(ampm).toLowerCase()) { case "am": hours = 12 === hours ? 0 : hours; break; case "pm": hours = 12 === hours ? 12 : hours + 12 } ret.setHours(hours); ret.setMinutes(Number(timeParts[1])); return ret } }; $.each(FORMATS_TO_PATTERN_MAP, function(key, value) { value = value.replace(/'/g, ""); FORMATTERS[value] = FORMATTERS[key]; PARSERS[value] = PARSERS[key] }); var getByFormat = function(obj, format) { return obj[format.toLowerCase()] || obj[format.replace(/'/g, "")] }; var cutCaptions = function(captions, format) { var lengthByFormat = { abbreviated: 3, "short": 2, narrow: 1 }; return $.map(captions, function(caption) { return caption.substr(0, lengthByFormat[format]) }) }; var dateLocalization = dependencyInjector({ getPatternByFormat: function(format) { return FORMATS_TO_PATTERN_MAP[format.toLowerCase()] }, getMonthNames: function(format) { return cutCaptions(months, format) }, getDayNames: function(format) { return cutCaptions(days, format) }, getTimeSeparator: function() { return ":" }, format: function(date, format) { if (!date) { return } if (!format) { return date } var formatter; if ("function" === typeof format) { formatter = format } else { if (format.formatter) { formatter = format.formatter } else { format = format.type || format; formatter = getByFormat(FORMATTERS, format) } } if (!formatter) { return } return formatter(date) }, parse: function(text, format) { var result, parser; if (!text) { return } if (!format) { return new Date(text) } if (format.parser) { return format.parser(text) } if (format.type || format.formatter) { format = format.type } if (format && "function" !== typeof format) { parser = getByFormat(PARSERS, format) } if (parser) { result = parser(text) } else { errors.log("W0012"); result = new Date(text) } if (!result || isNaN(result.getTime())) { return } return result }, firstDayOfWeekIndex: function() { return 0 } }); module.exports = dateLocalization }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************************!*\ !*** ./Scripts/animation/translator.js ***! \*****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), support = __webpack_require__( /*! ../core/utils/support */ 18); var TRANSLATOR_DATA_KEY = "dxTranslator", TRANSFORM_MATRIX_REGEX = /matrix(3d)?\((.+?)\)/, TRANSLATE_REGEX = /translate(?:3d)?\((.+?)\)/; var locate = function($element) { var translate = support.transform ? getTranslate($element) : getTranslateFallback($element); return { left: translate.x, top: translate.y } }; var move = function($element, position) { if (!support.transform) { $element.css(position); return } var translate, left = position.left, top = position.top; if (void 0 === left) { translate = getTranslate($element); translate.y = top || 0 } else { if (void 0 === top) { translate = getTranslate($element); translate.x = left || 0 } else { translate = { x: left || 0, y: top || 0, z: 0 }; cacheTranslate($element, translate) } } $element.css({ transform: getTranslateCss(translate) }); if (isPercentValue(left) || isPercentValue(top)) { clearCache($element) } }; var isPercentValue = function(value) { return "string" === $.type(value) && "%" === value[value.length - 1] }; var getTranslateFallback = function($element) { var result; try { var originalTop = $element.css("top"), originalLeft = $element.css("left"); var position = $element.position(); $element.css({ transform: "none", top: 0, left: 0 }); clearCache($element); var finalPosition = $element.position(); result = { x: position.left - finalPosition.left || parseInt(originalLeft) || 0, y: position.top - finalPosition.top || parseInt(originalTop) || 0 }; $element.css({ top: originalTop, left: originalLeft }) } catch (e) { result = { x: 0, y: 0 } } return result }; var getTranslate = function($element) { var result = $element.length ? $.data($element.get(0), TRANSLATOR_DATA_KEY) : null; if (!result) { var transformValue = $element.css("transform") || getTranslateCss({ x: 0, y: 0 }), matrix = transformValue.match(TRANSFORM_MATRIX_REGEX), is3D = matrix && matrix[1]; if (matrix) { matrix = matrix[2].split(","); if ("3d" === is3D) { matrix = matrix.slice(12, 15) } else { matrix.push(0); matrix = matrix.slice(4, 7) } } else { matrix = [0, 0, 0] } result = { x: parseFloat(matrix[0]), y: parseFloat(matrix[1]), z: parseFloat(matrix[2]) }; cacheTranslate($element, result) } return result }; var cacheTranslate = function($element, translate) { if ($element.length) { $.data($element.get(0), TRANSLATOR_DATA_KEY, translate) } }; var clearCache = function($element) { if ($element.length) { $.removeData($element.get(0), TRANSLATOR_DATA_KEY) } }; var resetPosition = function($element) { $element.css({ left: 0, top: 0, transform: "none" }); clearCache($element) }; var parseTranslate = function(translateString) { var result = translateString.match(TRANSLATE_REGEX); if (!result || !result[1]) { return } result = result[1].split(","); result = { x: parseFloat(result[0]), y: parseFloat(result[1]), z: parseFloat(result[2]) }; return result }; var getTranslateCss = function(translate) { translate.x = translate.x || 0; translate.y = translate.y || 0; var xValueString = isPercentValue(translate.x) ? translate.x : translate.x + "px"; var yValueString = isPercentValue(translate.y) ? translate.y : translate.y + "px"; return "translate(" + xValueString + ", " + yValueString + ")" }; exports.move = move; exports.locate = locate; exports.clearCache = clearCache; exports.parseTranslate = parseTranslate; exports.getTranslate = getTranslate; exports.getTranslateCss = getTranslateCss; exports.resetPosition = resetPosition }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************!*\ !*** ./Scripts/core/utils/data.js ***! \************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), errors = __webpack_require__( /*! ../errors */ 10), Class = __webpack_require__( /*! ../class */ 5), objectUtils = __webpack_require__( /*! ./object */ 30), variableWrapper = __webpack_require__( /*! ./variable_wrapper */ 73), unwrapVariable = variableWrapper.unwrap, isWrapped = variableWrapper.isWrapped, assign = variableWrapper.assign; var bracketsToDots = function(expr) { return expr.replace(/\[/g, ".").replace(/\]/g, "") }; var readPropValue = function(obj, propName) { if ("this" === propName) { return obj } return obj[propName] }; var assignPropValue = function(obj, propName, value, options) { if ("this" === propName) { throw new errors.Error("E4016") } var propValue = obj[propName]; if (options.unwrapObservables && isWrapped(propValue)) { assign(propValue, value) } else { obj[propName] = value } }; var prepareOptions = function(options) { options = options || {}; options.unwrapObservables = void 0 !== options.unwrapObservables ? options.unwrapObservables : true; return options }; var unwrap = function(value, options) { return options.unwrapObservables ? unwrapVariable(value) : value }; var compileGetter = function(expr) { if (arguments.length > 1) { expr = $.makeArray(arguments) } if (!expr || "this" === expr) { return function(obj) { return obj } } if ("string" === typeof expr) { expr = bracketsToDots(expr); var path = expr.split("."); return function(obj, options) { options = prepareOptions(options); var functionAsIs = options.functionsAsIs, current = unwrap(obj, options); for (var i = 0; i < path.length; i++) { if (!current) { break } var next = unwrap(current[path[i]], options); if (!functionAsIs && $.isFunction(next)) { next = next.call(current) } current = next } return current } } if ($.isArray(expr)) { return combineGetters(expr) } if ($.isFunction(expr)) { return expr } }; var combineGetters = function(getters) { var compiledGetters = {}; for (var i = 0, l = getters.length; i < l; i++) { var getter = getters[i]; compiledGetters[getter] = compileGetter(getter) } return function(obj, options) { var result; $.each(compiledGetters, function(name) { var current, path, last, i, value = this(obj, options); if (void 0 === value) { return } current = result || (result = {}); path = name.split("."); last = path.length - 1; for (i = 0; i < last; i++) { current = current[path[i]] = {} } current[path[i]] = value }); return result } }; var compileSetter = function(expr) { expr = expr || "this"; expr = bracketsToDots(expr); var pos = expr.lastIndexOf("."), targetGetter = compileGetter(expr.substr(0, pos)), targetPropName = expr.substr(1 + pos); return function(obj, value, options) { options = prepareOptions(options); var target = targetGetter(obj, { functionsAsIs: options.functionsAsIs, unwrapObservables: options.unwrapObservables }), prevTargetValue = readPropValue(target, targetPropName); if (!options.functionsAsIs && $.isFunction(prevTargetValue) && !isWrapped(prevTargetValue)) { target[targetPropName](value) } else { prevTargetValue = unwrap(prevTargetValue, options); if (options.merge && $.isPlainObject(value) && (void 0 === prevTargetValue || $.isPlainObject(prevTargetValue)) && !(value instanceof $.Event)) { if (!prevTargetValue) { assignPropValue(target, targetPropName, {}, options) } objectUtils.deepExtendArraySafe(unwrap(readPropValue(target, targetPropName), options), value) } else { assignPropValue(target, targetPropName, value, options) } } } }; var toComparable = function(value, caseSensitive) { if (value instanceof Date) { return value.getTime() } if (value && value instanceof Class && value.valueOf) { return value.valueOf() } if (!caseSensitive && "string" === typeof value) { return value.toLowerCase() } return value }; exports.compileGetter = compileGetter; exports.compileSetter = compileSetter; exports.toComparable = toComparable }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************************!*\ !*** ./Scripts/ui/data_grid/ui.data_grid.core.js ***! \***************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), toComparable = __webpack_require__( /*! ../../core/utils/data */ 16).toComparable, stringUtils = __webpack_require__( /*! ../../core/utils/string */ 26), modules = __webpack_require__( /*! ../grid_core/ui.grid_core.modules */ 224), dataUtils = __webpack_require__( /*! ../../data/utils */ 28), formatHelper = __webpack_require__( /*! ../../format_helper */ 68); var DATE_INTERVAL_SELECTORS = { year: function(value) { return value && value.getFullYear() }, month: function(value) { return value && value.getMonth() + 1 }, day: function(value) { return value && value.getDate() }, quarter: function(value) { return value && Math.floor(value.getMonth() / 3) + 1 }, hour: function(value) { return value && value.getHours() }, minute: function(value) { return value && value.getMinutes() }, second: function(value) { return value && value.getSeconds() } }, DEFAULT_DATE_INTERVAL = ["year", "month", "day"]; $.extend(exports, modules, function() { var getIntervalSelector = function() { var groupInterval, nameIntervalSelector, data = arguments[1], value = this.calculateCellValue(data); if (!commonUtils.isDefined(value)) { return null } else { if ("date" === this.dataType) { nameIntervalSelector = arguments[0]; return DATE_INTERVAL_SELECTORS[nameIntervalSelector](value) } else { if ("number" === this.dataType) { groupInterval = arguments[0]; return Math.floor(Number(value) / groupInterval) * groupInterval } } } }; var getDateValues = function(dateValue) { if (commonUtils.isDate(dateValue)) { return [dateValue.getFullYear(), dateValue.getMonth(), dateValue.getDate(), dateValue.getHours(), dateValue.getMinutes(), dateValue.getSeconds()] } return $.map(("" + dateValue).split("/"), function(value, index) { return 1 === index ? Number(value) - 1 : Number(value) }) }; var getFilterExpressionForDate = function(filterValue, selectedFilterOperation, target) { var dateStart, dateEnd, column = this, selector = getFilterSelector(column, target), values = getDateValues(filterValue), dateInterval = exports.getGroupInterval(column)[values.length - 1]; switch (dateInterval) { case "year": dateStart = new Date(values[0], 0, 1), dateEnd = new Date(values[0] + 1, 0, 1); break; case "month": dateStart = new Date(values[0], values[1], 1), dateEnd = new Date(values[0], values[1] + 1, 1); break; case "quarter": dateStart = new Date(values[0], 3 * values[1], 1), dateEnd = new Date(values[0], 3 * values[1] + 3, 1); break; case "hour": dateStart = new Date(values[0], values[1], values[2], values[3]), dateEnd = new Date(values[0], values[1], values[2], values[3] + 1); break; case "minute": dateStart = new Date(values[0], values[1], values[2], values[3], values[4]), dateEnd = new Date(values[0], values[1], values[2], values[3], values[4] + 1); break; case "second": dateStart = new Date(values[0], values[1], values[2], values[3], values[4], values[5]), dateEnd = new Date(values[0], values[1], values[2], values[3], values[4], values[5] + 1); break; default: dateStart = new Date(values[0], values[1], values[2]), dateEnd = new Date(values[0], values[1], values[2] + 1) } switch (selectedFilterOperation) { case "<": return [selector, "<", dateStart]; case "<=": return [selector, "<", dateEnd]; case ">": return [selector, ">=", dateEnd]; case ">=": return [selector, ">=", dateStart]; case "<>": return [ [selector, "<", dateStart], "or", [selector, ">=", dateEnd] ]; default: return [ [selector, ">=", dateStart], "and", [selector, "<", dateEnd] ] } }; var getFilterExpressionForNumber = function(filterValue, selectedFilterOperation, target) { var interval, startFilterValue, endFilterValue, column = this, selector = getFilterSelector(column, target), values = ("" + filterValue).split("/"), value = Number(values[values.length - 1]), isExclude = "exclude" === column.filterType, groupInterval = exports.getGroupInterval(column); if ("headerFilter" === target && groupInterval && commonUtils.isDefined(filterValue)) { interval = groupInterval[values.length - 1]; startFilterValue = [selector, isExclude ? "<" : ">=", value]; endFilterValue = [selector, isExclude ? ">=" : "<", value + interval]; return [startFilterValue, isExclude ? "or" : "and", endFilterValue] } return [selector, selectedFilterOperation || "=", filterValue] }; var getFilterSelector = function(column, target) { var selector = column.dataField || column.selector; if ("search" === target) { selector = column.displayField || column.calculateDisplayValue || selector } return selector }; var getFilterExpressionByRange = function(filterValue, selectedFilterOperation, target) { var column = this, dataField = column.dataField; if (commonUtils.isArray(filterValue) && commonUtils.isDefined(filterValue[0]) && commonUtils.isDefined(filterValue[1])) { return [ [dataField, ">=", filterValue[0]], "and", [dataField, "<=", filterValue[1]] ] } }; return { formatValue: function(value, options) { var valueText = formatHelper.format(value, options.format, options.precision) || value && value.toString() || "", formatObject = { value: value, valueText: options.getDisplayFormat ? options.getDisplayFormat(valueText) : valueText, target: options.target || "row", groupInterval: options.groupInterval }; return options.customizeText ? options.customizeText.call(options, formatObject) : formatObject.valueText }, getDisplayValue: function(column, value, data, rowType) { if (column.displayValueMap && void 0 !== column.displayValueMap[value]) { return column.displayValueMap[value] } else { if (column.calculateDisplayValue && data && "group" !== rowType) { return column.calculateDisplayValue(data) } else { if (column.lookup) { return column.lookup.calculateCellValue(value) } } } return value }, getGroupRowSummaryText: function(summaryItems, summaryTexts) { var i, summaryItem, result = "("; for (i = 0; i < summaryItems.length; i++) { summaryItem = summaryItems[i]; result += (i > 0 ? ", " : "") + exports.getSummaryText(summaryItem, summaryTexts) } return result += ")" }, getSummaryText: function(summaryItem, summaryTexts) { var displayFormat = summaryItem.displayFormat || summaryItem.columnCaption && summaryTexts[summaryItem.summaryType + "OtherColumn"] || summaryTexts[summaryItem.summaryType]; return this.formatValue(summaryItem.value, { format: summaryItem.valueFormat, precision: summaryItem.precision, getDisplayFormat: function(valueText) { return displayFormat ? stringUtils.format(displayFormat, valueText, summaryItem.columnCaption) : valueText }, customizeText: summaryItem.customizeText }) }, getKeyHash: function(key) { if (commonUtils.isObject(key) || commonUtils.isArray(key)) { try { var keyHash = JSON.stringify(key); return "{}" === keyHash ? key : keyHash } catch (e) { return key } } return key }, normalizeSortingInfo: function(sort) { sort = sort || []; var result, i; result = dataUtils.normalizeSortingInfo(sort); for (i = 0; i < sort.length; i++) { if (sort && sort[i] && void 0 !== sort[i].isExpanded) { result[i].isExpanded = sort[i].isExpanded } if (sort && sort[i] && void 0 !== sort[i].groupInterval) { result[i].groupInterval = sort[i].groupInterval } } return result }, getFormatByDataType: function(dataType) { switch (dataType) { case "date": return "shortDate" } }, defaultCalculateFilterExpression: function(filterValue, selectedFilterOperation, target) { var column = this, selector = getFilterSelector(column, target), isSearchByDisplayValue = column.calculateDisplayValue && "search" === target, dataType = isSearchByDisplayValue && column.lookup && column.lookup.dataType || column.dataType, filter = null; if ("headerFilter" === target && null === filterValue) { filter = [selector, selectedFilterOperation || "=", null]; if ("string" === dataType) { filter = [filter, "=" === selectedFilterOperation ? "or" : "and", [selector, selectedFilterOperation || "=", ""]] } } else { if ("string" === dataType && (!column.lookup || isSearchByDisplayValue)) { filter = [selector, selectedFilterOperation || "contains", filterValue] } else { if ("between" === selectedFilterOperation) { return getFilterExpressionByRange.apply(column, arguments) } else { if ("date" === dataType && commonUtils.isDefined(filterValue)) { return getFilterExpressionForDate.apply(column, arguments) } else { if ("number" === dataType) { return getFilterExpressionForNumber.apply(column, arguments) } else { if ("object" !== dataType) { filter = [selector, selectedFilterOperation || "=", filterValue] } } } } } } return filter }, getHeaderFilterGroupParameters: function(column, remoteGrouping) { var result = [], dataField = column.dataField || column.name, groupInterval = this.getGroupInterval(column); if (column.calculateGroupValue) { return remoteGrouping ? [{ selector: column.calculateGroupValue, isExpanded: false }] : $.proxy(column.calculateGroupValue, column) } if (groupInterval) { $.each(groupInterval, function(index, interval) { result.push(remoteGrouping ? { selector: dataField, groupInterval: interval, isExpanded: false } : $.proxy(getIntervalSelector, column, interval)) }); return result } return remoteGrouping ? [{ selector: dataField, isExpanded: false }] : function(data) { var result = column.calculateCellValue(data); if (void 0 === result || "" === result) { result = null } return result } }, getGroupInterval: function(column) { var index, result = [], dateIntervals = ["year", "month", "day", "hour", "minute", "second"], groupInterval = column.headerFilter && column.headerFilter.groupInterval, interval = "quarter" === groupInterval ? "month" : groupInterval; if ("date" === column.dataType) { result = DEFAULT_DATE_INTERVAL; index = $.inArray(interval, dateIntervals); if (index >= 0) { result = dateIntervals.slice(0, index); result.push(groupInterval); return result } return result } else { if (commonUtils.isDefined(groupInterval)) { return commonUtils.isArray(groupInterval) ? groupInterval : [groupInterval] } } }, checkChanges: function(changes, changeNames) { var i, changesWithChangeNamesCount = 0; for (i = 0; i < changeNames.length; i++) { if (changes[changeNames[i]]) { changesWithChangeNamesCount++ } } return changes.length && changes.length === changesWithChangeNamesCount }, equalSortParameters: function(sortParameters1, sortParameters2, ignoreIsExpanded) { var i; sortParameters1 = exports.normalizeSortingInfo(sortParameters1); sortParameters2 = exports.normalizeSortingInfo(sortParameters2); if ($.isArray(sortParameters1) && $.isArray(sortParameters2)) { if (sortParameters1.length !== sortParameters2.length) { return false } else { for (i = 0; i < sortParameters1.length; i++) { if (sortParameters1[i].selector !== sortParameters2[i].selector || sortParameters1[i].desc !== sortParameters2[i].desc || sortParameters1[i].groupInterval !== sortParameters2[i].groupInterval || !ignoreIsExpanded && Boolean(sortParameters1[i].isExpanded) !== Boolean(sortParameters2[i].isExpanded)) { return false } } } return true } else { return (!sortParameters1 || !sortParameters1.length) === (!sortParameters2 || !sortParameters2.length) } }, equalFilterParameters: function(filter1, filter2) { var i; if ($.isArray(filter1) && $.isArray(filter2)) { if (filter1.length !== filter2.length) { return false } else { for (i = 0; i < filter1.length; i++) { if (!exports.equalFilterParameters(filter1[i], filter2[i])) { return false } } } return true } else { if ($.isFunction(filter1) && filter1.columnIndex >= 0 && $.isFunction(filter2) && filter2.columnIndex >= 0) { return filter1.columnIndex === filter2.columnIndex } else { return toComparable(filter1) === toComparable(filter2) } } }, proxyMethod: function(instance, methodName, defaultResult) { if (!instance[methodName]) { instance[methodName] = function() { var dataSource = this._dataSource; return dataSource ? dataSource[methodName].apply(dataSource, arguments) : defaultResult } } }, combineFilters: function(filters, operation) { var i, resultFilter = []; operation = operation || "and"; for (i = 0; i < filters.length; i++) { if (!filters[i]) { continue } if (resultFilter.length) { resultFilter.push(operation) } resultFilter.push(filters[i]) } if (1 === resultFilter.length) { resultFilter = resultFilter[0] } if (resultFilter.length) { return resultFilter } }, getPointsByColumns: function(items, pointCreated, isVertical, startColumnIndex) { var point, i, item, offset, prevItemOffset, rtlEnabled, cellsLength = items.length, notCreatePoint = false, columnIndex = startColumnIndex || 0, result = []; for (i = 0; i <= cellsLength; i++) { if (i < cellsLength) { item = items.eq(i); offset = item.offset(); rtlEnabled = "rtl" === item.css("direction") } point = { index: columnIndex, x: offset ? offset.left + (!isVertical && rtlEnabled ^ i === cellsLength ? item.outerWidth() : 0) : 0, y: offset ? offset.top + (isVertical && i === cellsLength ? item.outerHeight() : 0) : 0, columnIndex: columnIndex }; if (!isVertical && i > 0) { prevItemOffset = items.eq(i - 1).offset(); if (prevItemOffset.top < point.y) { point.y = prevItemOffset.top } } if (pointCreated) { notCreatePoint = pointCreated(point) } if (!notCreatePoint) { result.push(point) } columnIndex++ } return result } } }()) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************!*\ !*** ./Scripts/core/utils/support.js ***! \***************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), inflector = __webpack_require__( /*! ./inflector */ 29), devices = __webpack_require__( /*! ../devices */ 7); var camelize = inflector.camelize; var jsPrefixes = ["", "Webkit", "Moz", "O", "Ms"], cssPrefixes = { "": "", Webkit: "-webkit-", Moz: "-moz-", O: "-o-", ms: "-ms-" }, styles = document.createElement("dx").style; var transitionEndEventNames = { webkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd", msTransition: "MsTransitionEnd", transition: "transitionend" }; var forEachPrefixes = function(prop, callBack) { prop = camelize(prop, true); var result; for (var i = 0, cssPrefixesCount = jsPrefixes.length; i < cssPrefixesCount; i++) { var jsPrefix = jsPrefixes[i]; var prefixedProp = jsPrefix + prop; var lowerPrefixedProp = camelize(prefixedProp); result = callBack(lowerPrefixedProp, jsPrefix); if (void 0 === result) { result = callBack(prefixedProp, jsPrefix) } if (void 0 !== result) { break } } return result }; var styleProp = function(prop) { return forEachPrefixes(prop, function(specific) { if (specific in styles) { return specific } }) }; var stylePropPrefix = function(prop) { return forEachPrefixes(prop, function(specific, jsPrefix) { if (specific in styles) { return cssPrefixes[jsPrefix] } }) }; var supportProp = function(prop) { return !!styleProp(prop) }; var isNativeScrollingSupported = function() { var realDevice = devices.real(), realPlatform = realDevice.platform, realVersion = realDevice.version, isObsoleteAndroid = realVersion && realVersion[0] < 4 && "android" === realPlatform, isNativeScrollDevice = !isObsoleteAndroid && $.inArray(realPlatform, ["ios", "android", "win"]) > -1 || realDevice.mac; return isNativeScrollDevice }; var inputType = function(type) { if ("text" === type) { return true } var input = document.createElement("input"); try { input.setAttribute("type", type); input.value = "wrongValue"; return !input.value } catch (e) { return false } }; var touchEvents = "ontouchstart" in window && !("callPhantom" in window), pointerEvents = !!window.navigator.pointerEnabled || !!window.navigator.msPointerEnabled, touchPointersPresent = !!window.navigator.maxTouchPoints || !!window.navigator.msMaxTouchPoints; exports.touchEvents = touchEvents; exports.pointerEvents = pointerEvents; exports.touch = touchEvents || pointerEvents && touchPointersPresent; exports.transform = supportProp("transform"); exports.transition = supportProp("transition"); exports.transitionEndEventName = transitionEndEventNames[styleProp("transition")]; exports.animation = supportProp("animation"); exports.nativeScrolling = isNativeScrollingSupported(); exports.winJS = "WinJS" in window; exports.styleProp = styleProp; exports.stylePropPrefix = stylePropPrefix; exports.supportProp = supportProp; exports.hasKo = !!window.ko; exports.inputType = inputType }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************************!*\ !*** ./Scripts/ui/widget/ui.widget.js ***! \****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), errors = __webpack_require__( /*! ./ui.errors */ 20), Action = __webpack_require__( /*! ../../core/action */ 54), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), domUtils = __webpack_require__( /*! ../../core/utils/dom */ 11), devices = __webpack_require__( /*! ../../core/devices */ 7), DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 39), TemplateBase = __webpack_require__( /*! ./ui.template_base */ 47), DynamicTemplate = __webpack_require__( /*! ./ui.template.dynamic */ 187), EmptyTemplate = __webpack_require__( /*! ./ui.template.empty */ 323), MoveTemplate = __webpack_require__( /*! ./ui.template.move */ 188), TemplateProvider = __webpack_require__( /*! ./jquery.template_provider */ 160), KeyboardProcessor = __webpack_require__( /*! ./ui.keyboard_processor */ 175), selectors = __webpack_require__( /*! ./jquery.selectors */ 98), eventUtils = __webpack_require__( /*! ../../events/utils */ 4), hoverEvents = __webpack_require__( /*! ../../events/hover */ 133), feedbackEvents = __webpack_require__( /*! ../../events/core/emitter.feedback */ 70), clickEvent = __webpack_require__( /*! ../../events/click */ 9); var UI_FEEDBACK = "UIFeedback", WIDGET_CLASS = "dx-widget", ACTIVE_STATE_CLASS = "dx-state-active", DISABLED_STATE_CLASS = "dx-state-disabled", INVISIBLE_STATE_CLASS = "dx-state-invisible", HOVER_STATE_CLASS = "dx-state-hover", FOCUSED_STATE_CLASS = "dx-state-focused", FEEDBACK_SHOW_TIMEOUT = 30, FEEDBACK_HIDE_TIMEOUT = 400, FOCUS_NAMESPACE = "Focus", ANONYMOUS_TEMPLATE_NAME = "template", TEXT_NODE = 3, TEMPLATE_SELECTOR = "[data-options*='dxTemplate']", TEMPLATE_WRAPPER_CLASS = "dx-template-wrapper"; var beforeActivateExists = void 0 !== document.onbeforeactivate; var Widget = DOMComponent.inherit({ _supportedKeys: function() { return {} }, _getDefaultOptions: function() { return $.extend(this.callBase(), { disabled: false, visible: true, hint: void 0, activeStateEnabled: false, onContentReady: null, hoverStateEnabled: false, focusStateEnabled: false, tabIndex: 0, accessKey: null, onFocusIn: null, onFocusOut: null, watchMethod: $.noop, _keyboardProcessor: void 0, templateProvider: TemplateProvider, _templates: {} }) }, _feedbackShowTimeout: FEEDBACK_SHOW_TIMEOUT, _feedbackHideTimeout: FEEDBACK_HIDE_TIMEOUT, _init: function() { this.callBase(); this._tempTemplates = []; this._dynamicTemplates = {}; this._initTemplates(); this._initContentReadyAction() }, _initTemplates: function() { this._extractTemplates(); this._extractAnonymousTemplate() }, _extractTemplates: function() { var templates = this.option("_templates"), templateElements = this.element().contents().filter(TEMPLATE_SELECTOR); var templatesMap = {}; templateElements.each(function(_, template) { var templateOptions = domUtils.getElementOptions(template).dxTemplate; if (!templateOptions) { return } if (!templateOptions.name) { throw errors.Error("E0023") } $(template).addClass(TEMPLATE_WRAPPER_CLASS).detach(); templatesMap[templateOptions.name] = templatesMap[templateOptions.name] || []; templatesMap[templateOptions.name].push(template) }); $.each(templatesMap, $.proxy(function(templateName, value) { var deviceTemplate = this._findTemplateByDevice(value); if (deviceTemplate) { templates[templateName] = this._createTemplate(deviceTemplate, this) } }, this)) }, _findTemplateByDevice: function(templates) { var suitableTemplate = commonUtils.findBestMatches(devices.current(), templates, function(template) { return domUtils.getElementOptions(template).dxTemplate })[0]; $.each(templates, function(index, template) { if (template !== suitableTemplate) { $(template).remove() } }); return suitableTemplate }, _extractAnonymousTemplate: function() { var templates = this.option("_templates"), anonymousTemplateName = this._getAnonymousTemplateName(), $anonymousTemplate = this.element().contents().detach(); var $notJunkTemplateContent = $anonymousTemplate.filter(function(_, element) { var isTextNode = element.nodeType === TEXT_NODE, isEmptyText = $.trim($(element).text()).length < 1; return !(isTextNode && isEmptyText) }), onlyJunkTemplateContent = $notJunkTemplateContent.length < 1; if (!templates[anonymousTemplateName] && !onlyJunkTemplateContent) { templates[anonymousTemplateName] = this._createTemplate($anonymousTemplate, this) } }, _getAriaTarget: function() { return this._focusTarget() }, _getAnonymousTemplateName: function() { return ANONYMOUS_TEMPLATE_NAME }, _getTemplateByOption: function(optionName) { return this._getTemplate(this.option(optionName)) }, _getTemplate: function(templateSource) { if ($.isFunction(templateSource)) { var that = this; return new DynamicTemplate(function() { var templateSourceResult = templateSource.apply(that, arguments); if (commonUtils.isDefined(templateSourceResult)) { return that._acquireTemplate(templateSourceResult, this, true) } else { return new EmptyTemplate } }, this) } return this._acquireTemplate(templateSource, this) }, _acquireTemplate: function(templateSource, owner, preferRenderer) { if (null == templateSource) { return this._createTemplate(domUtils.normalizeTemplateElement(templateSource), owner) } if (templateSource instanceof TemplateBase) { return templateSource } if (templateSource.nodeType || templateSource.jquery) { templateSource = $(templateSource); if (preferRenderer && !templateSource.is("script")) { return new MoveTemplate(templateSource, owner) } return this._createTemplate(templateSource, owner) } if ("string" === typeof templateSource) { var userTemplate = this.option("_templates")[templateSource]; if (userTemplate) { return userTemplate } var dynamicTemplate = this._dynamicTemplates[templateSource]; if (dynamicTemplate) { return dynamicTemplate } var defaultTemplate = this.option("templateProvider").getTemplates(this)[templateSource]; if (defaultTemplate) { return defaultTemplate } return this._createTemplate(domUtils.normalizeTemplateElement(templateSource), owner) } return this._acquireTemplate(templateSource.toString(), owner) }, _createTemplate: function(element, owner) { var template = this.option("templateProvider").createTemplate(element, owner); this._tempTemplates.push(template); return template }, _cleanTemplates: function() { var that = this; $.each(this.option("_templates"), function(_, template) { if (that === template.owner()) { template.dispose() } }); $.each(this._tempTemplates, function(_, template) { template.dispose() }) }, _initContentReadyAction: function() { this._contentReadyAction = this._createActionByOption("onContentReady", { excludeValidators: ["designMode", "disabled", "readOnly"] }) }, _render: function() { this.element().addClass(WIDGET_CLASS); this.callBase(); this._toggleDisabledState(this.option("disabled")); this._toggleVisibility(this.option("visible")); this._renderHint(); this._renderContent(); this._renderFocusState(); this._attachFeedbackEvents(); this._attachHoverEvents() }, _renderHint: function() { domUtils.toggleAttr(this.element(), "title", this.option("hint")) }, _renderContent: function() { var that = this; commonUtils.deferRender(function() { that._renderContentImpl() }); that._fireContentReadyAction() }, _renderContentImpl: $.noop, _fireContentReadyAction: function() { this._contentReadyAction() }, _dispose: function() { this._cleanTemplates(); this._contentReadyAction = null; this.callBase() }, _clean: function() { this._cleanFocusState(); this.callBase(); this.element().empty() }, _toggleVisibility: function(visible) { this.element().toggleClass(INVISIBLE_STATE_CLASS, !visible); this.setAria("hidden", !visible || void 0) }, _renderFocusState: function() { if (!this.option("focusStateEnabled") || this.option("disabled")) { return } this._renderFocusTarget(); this._attachFocusEvents(); this._attachKeyboardEvents(); this._renderAccessKey() }, _renderAccessKey: function() { var focusTarget = this._focusTarget(); focusTarget.attr("accesskey", this.option("accessKey")); var clickNamespace = eventUtils.addNamespace(clickEvent.name, UI_FEEDBACK); focusTarget.off(clickNamespace); this.option("accessKey") && focusTarget.on(clickNamespace, $.proxy(function(e) { if (eventUtils.isFakeClickEvent(e)) { e.stopImmediatePropagation(); this.focus() } }, this)) }, _eventBindingTarget: function() { return this.element() }, _focusTarget: function() { return this._getActiveElement() }, _getActiveElement: function() { var activeElement = this._eventBindingTarget(); if (this._activeStateUnit) { activeElement = activeElement.find(this._activeStateUnit).not("." + DISABLED_STATE_CLASS) } return activeElement }, _renderFocusTarget: function() { this._focusTarget().attr("tabindex", this.option("tabIndex")) }, _keyboardEventBindingTarget: function() { return this._eventBindingTarget() }, _detachFocusEvents: function() { var $element = this._focusTarget(), namespace = this.NAME + FOCUS_NAMESPACE, focusEvents = eventUtils.addNamespace("focusin", namespace); focusEvents = focusEvents + " " + eventUtils.addNamespace("focusout", namespace); if (beforeActivateExists) { focusEvents = focusEvents + " " + eventUtils.addNamespace("beforeactivate", namespace) } $element.off(focusEvents) }, _attachFocusEvents: function() { var namespace = this.NAME + FOCUS_NAMESPACE, focusInEvent = eventUtils.addNamespace("focusin", namespace), focusOutEvent = eventUtils.addNamespace("focusout", namespace); this._focusTarget().on(focusInEvent, $.proxy(this._focusInHandler, this)).on(focusOutEvent, $.proxy(this._focusOutHandler, this)); if (beforeActivateExists) { var beforeactivateEvent = eventUtils.addNamespace("beforeactivate", namespace); this._focusTarget().on(beforeactivateEvent, function(e) { if (!$(e.target).is(selectors.focusable)) { e.preventDefault() } }) } }, _refreshFocusEvent: function() { this._detachFocusEvents(); this._attachFocusEvents() }, _focusInHandler: function(e) { var that = this; that._createActionByOption("onFocusIn", { beforeExecute: function() { that._updateFocusState(e, true) }, excludeValidators: ["readOnly"] })({ jQueryEvent: e }) }, _focusOutHandler: function(e) { var that = this; that._createActionByOption("onFocusOut", { beforeExecute: function() { that._updateFocusState(e, false) }, excludeValidators: ["readOnly", "disabled"] })({ jQueryEvent: e }) }, _updateFocusState: function(e, isFocused) { var target = e.target; if (-1 !== $.inArray(target, this._focusTarget())) { this._toggleFocusClass(isFocused, $(target)) } }, _toggleFocusClass: function(isFocused, $element) { var $focusTarget = $element && $element.length ? $element : this._focusTarget(); $focusTarget.toggleClass(FOCUSED_STATE_CLASS, isFocused) }, _hasFocusClass: function(element) { var $focusTarget = $(element || this._focusTarget()); return $focusTarget.hasClass(FOCUSED_STATE_CLASS) }, _attachKeyboardEvents: function() { var processor = this.option("_keyboardProcessor") || new KeyboardProcessor({ element: this._keyboardEventBindingTarget(), focusTarget: this._focusTarget() }); this._keyboardProcessor = processor.reinitialize(this._keyboardHandler, this) }, _keyboardHandler: function(options) { var e = options.originalEvent, key = options.key; var keys = this._supportedKeys(), func = keys[key]; if (void 0 !== func) { var handler = $.proxy(func, this); return handler(e) || false } else { return true } }, _refreshFocusState: function() { this._cleanFocusState(); this._renderFocusState() }, _cleanFocusState: function() { var $element = this._focusTarget(); this._detachFocusEvents(); this._toggleFocusClass(false); $element.removeAttr("tabindex"); if (this._keyboardProcessor) { this._keyboardProcessor.dispose() } }, _attachHoverEvents: function() { var that = this, hoverableSelector = that._activeStateUnit, nameStart = eventUtils.addNamespace(hoverEvents.start, UI_FEEDBACK), nameEnd = eventUtils.addNamespace(hoverEvents.end, UI_FEEDBACK); that._eventBindingTarget().off(nameStart, hoverableSelector).off(nameEnd, hoverableSelector); if (that.option("hoverStateEnabled")) { var startAction = new Action(function(args) { that._hoverStartHandler(args.event); var $target = args.element; that._refreshHoveredElement($target) }, { excludeValidators: ["readOnly"] }); that._eventBindingTarget().on(nameStart, hoverableSelector, function(e) { startAction.execute({ element: $(e.target), event: e }) }).on(nameEnd, hoverableSelector, function(e) { that._hoverEndHandler(e); that._forgetHoveredElement() }) } else { that._toggleHoverClass(false) } }, _hoverStartHandler: $.noop, _hoverEndHandler: $.noop, _attachFeedbackEvents: function() { var feedbackAction, feedbackActionDisabled, that = this, feedbackSelector = that._activeStateUnit, activeEventName = eventUtils.addNamespace(feedbackEvents.active, UI_FEEDBACK), inactiveEventName = eventUtils.addNamespace(feedbackEvents.inactive, UI_FEEDBACK); that._eventBindingTarget().off(activeEventName, feedbackSelector).off(inactiveEventName, feedbackSelector); if (that.option("activeStateEnabled")) { var feedbackActionHandler = function(args) { var $element = args.element, value = args.value, jQueryEvent = args.jQueryEvent; that._toggleActiveState($element, value, jQueryEvent) }; that._eventBindingTarget().on(activeEventName, feedbackSelector, { timeout: that._feedbackShowTimeout }, function(e) { feedbackAction = feedbackAction || new Action(feedbackActionHandler), feedbackAction.execute({ element: $(e.currentTarget), value: true, jQueryEvent: e }) }).on(inactiveEventName, feedbackSelector, { timeout: that._feedbackHideTimeout }, function(e) { feedbackActionDisabled = feedbackActionDisabled || new Action(feedbackActionHandler, { excludeValidators: ["disabled", "readOnly"] }), feedbackActionDisabled.execute({ element: $(e.currentTarget), value: false, jQueryEvent: e }) }) } }, _toggleActiveState: function($element, value) { this._toggleHoverClass(!value); $element.toggleClass(ACTIVE_STATE_CLASS, value) }, _refreshHoveredElement: function(hoveredElement) { var selector = this._activeStateUnit || this._eventBindingTarget(); this._forgetHoveredElement(); this._hoveredElement = hoveredElement.closest(selector); this._toggleHoverClass(true) }, _forgetHoveredElement: function() { this._toggleHoverClass(false); delete this._hoveredElement }, _toggleHoverClass: function(value) { if (this._hoveredElement) { this._hoveredElement.toggleClass(HOVER_STATE_CLASS, value && this.option("hoverStateEnabled")) } }, _toggleDisabledState: function(value) { this.element().toggleClass(DISABLED_STATE_CLASS, Boolean(value)); this._toggleHoverClass(!value); this.setAria("disabled", value || void 0) }, _setWidgetOption: function(widgetName, args) { if (!this[widgetName]) { return } if ($.isPlainObject(args[0])) { $.each(args[0], $.proxy(function(option, value) { this._setWidgetOption(widgetName, [option, value]) }, this)); return } var optionName = args[0]; var value = args[1]; if (1 === args.length) { value = this.option(optionName) } var widgetOptionMap = this[widgetName + "OptionMap"]; this[widgetName].option(widgetOptionMap ? widgetOptionMap(optionName) : optionName, value) }, _createComponent: function(element, name, config) { config = config || {}; this._extendConfig(config, { templateProvider: this.option("templateProvider"), _templates: this.option("_templates") }); return this.callBase(element, name, config) }, _optionChanged: function(args) { switch (args.name) { case "disabled": this._toggleDisabledState(args.value); this._refreshFocusState(); break; case "hint": this._renderHint(); break; case "activeStateEnabled": this._attachFeedbackEvents(); break; case "hoverStateEnabled": this._attachHoverEvents(); break; case "tabIndex": case "_keyboardProcessor": case "focusStateEnabled": this._refreshFocusState(); break; case "onFocusIn": case "onFocusOut": break; case "accessKey": this._renderAccessKey(); break; case "visible": var visible = args.value; this._toggleVisibility(visible); if (this._isVisibilityChangeSupported()) { this._checkVisibilityChanged(args.value ? "shown" : "hiding") } break; case "onContentReady": this._initContentReadyAction(); break; case "_templates": case "templateProvider": break; default: this.callBase(args) } }, _isVisible: function() { return this.callBase() && this.option("visible") }, beginUpdate: function() { this._ready(false); this.callBase() }, endUpdate: function() { this.callBase(); if (this._initialized) { this._ready(true) } }, _ready: function(value) { if (0 === arguments.length) { return this._isReady } this._isReady = value }, setAria: function() { var setAttribute = function(option) { var attrName = "role" === option.name || "id" === option.name ? option.name : "aria-" + option.name, attrValue = option.value; if (null === attrValue || void 0 === attrValue) { attrValue = void 0 } else { attrValue = attrValue.toString() } domUtils.toggleAttr(option.target, attrName, attrValue) }; if (!$.isPlainObject(arguments[0])) { setAttribute({ name: arguments[0], value: arguments[1], target: arguments[2] || this._getAriaTarget() }) } else { var $target = arguments[1] || this._getAriaTarget(); $.each(arguments[0], function(key, value) { setAttribute({ name: key, value: value, target: $target }) }) } }, isReady: function() { return this._ready() }, repaint: function() { this._refresh() }, focus: function() { this._focusTarget().focus() }, registerKeyHandler: function(key, handler) { var currentKeys = this._supportedKeys(), addingKeys = {}; addingKeys[key] = handler; this._supportedKeys = function() { return $.extend(currentKeys, addingKeys) } } }); module.exports = Widget }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************************!*\ !*** ./Scripts/ui/widget/ui.errors.js ***! \****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var errorUtils = __webpack_require__( /*! ../../core/utils/error */ 94), errors = __webpack_require__( /*! ../../core/errors */ 10); module.exports = errorUtils(errors.ERROR_MESSAGES, { E1001: "Module '{0}'. Controller '{1}' is already registered", E1002: "Module '{0}'. Controller '{1}' must be inheritor of DevExpress.ui.dxDataGrid.Controller", E1003: "Module '{0}'. View '{1}' is already registered", E1004: "Module '{0}'. View '{1}' must be inheritor of DevExpress.ui.dxDataGrid.View", E1005: "Public method '{0}' is already registered", E1006: "Public method '{0}.{1}' is not exists", E1007: "State storing can not be provided due to the restrictions of your browser", E1010: "A template should contain dxTextBox widget", E1011: "You have to implement 'remove' method in dataStore used by dxList to be able to delete items", E1012: "Editing type '{0}' with name '{1}' not supported", E1016: "Unexpected type of data source is provided for a lookup column", E1018: "The 'collapseAll' method cannot be called when using a remote data source", E1019: "Search mode '{0}' is unavailable", E1020: "Type can not be changed after initialization", E1021: "{0} '{1}' you are trying to remove does not exist", E1022: "Markers option should be an array", E1023: "Routes option should be an array", E1024: "Google provider cannot be used in WinJS application", E1025: "This layout is too complex to render", E1026: "The 'custom' value is set to a summary item's summaryType option, but a function for calculating the custom summary is not assigned to the grid's calculateCustomSummary option", E1030: "Unknown dxScrollView refresh strategy: '{0}'", E1031: "Unknown subscription is detected in the dxScheduler widget: '{0}'", E1032: "Unknown start date is detected in an appointment of the dxScheduler widget: '{0}'", E1033: "Unknown step is specified for the scheduler's navigator: '{0}'", E1034: "The current browser does not implement an API required for saving files", E1035: "The editor could not be created because of the internal error: {0}", E1036: "Validation rules are not defined for any form item", E1037: "Invalid structure of grouped data", E1038: "Your browser does not support local storage for local web pages", E0139: "The cell position can not be calculated", W1001: "Key option can not be modified after initialization", W1002: "Item '{0}' you are trying to select does not exist", W1003: "Group with key '{0}' in which you are trying to select items does not exist", W1004: "Item '{0}' you are trying to select in group '{1}' does not exist", W1005: "Due to column data types being unspecified, data has been loaded twice in order to apply initial filter settings. To resolve this issue, specify data types for all grid columns." }) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*********************************!*\ !*** ./Scripts/animation/fx.js ***! \*********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), errors = __webpack_require__( /*! ../core/errors */ 10), translator = __webpack_require__( /*! ./translator */ 15), animationFrame = __webpack_require__( /*! ./frame */ 75), support = __webpack_require__( /*! ../core/utils/support */ 18), positionUtils = __webpack_require__( /*! ./position */ 65), removeEvent = __webpack_require__( /*! ../core/remove_event */ 141), eventUtils = __webpack_require__( /*! ../events/utils */ 4), transitionEndEventName = support.transitionEndEventName + ".dxFX", removeEventName = eventUtils.addNamespace(removeEvent, "dxFX"); var CSS_TRANSITION_EASING_REGEX = /cubic-bezier\((\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\)/, RELATIVE_VALUE_REGEX = /^([+-])=(.*)/i, ANIM_DATA_KEY = "dxAnimData", ANIM_QUEUE_KEY = "dxAnimQueue", TRANSFORM_PROP = "transform"; var TransitionAnimationStrategy = { initAnimation: function($element, config) { $element.css({ transitionProperty: "none" }); if ("string" === typeof config.from) { $element.addClass(config.from) } else { setProps($element, config.from) } var that = this, deferred = $.Deferred(), cleanupWhen = config.cleanupWhen; config.transitionAnimation = { deferred: deferred, finish: function() { that._finishTransition($element, config); if (cleanupWhen) { $.when(deferred, cleanupWhen).always(function() { that._cleanup($element, config) }) } else { that._cleanup($element, config) } deferred.resolveWith($element, [config, $element]) } }; this._completeAnimationCallback($element, config).done(function() { config.transitionAnimation.finish() }).fail(function() { deferred.rejectWith($element, [config, $element]) }); if (!config.duration) { config.transitionAnimation.finish() } $element.css("transform") }, animate: function($element, config) { this._startAnimation($element, config); return config.transitionAnimation.deferred.promise() }, _completeAnimationCallback: function($element, config) { var simulatedEndEventTimer, waitForJSCompleteTimer, that = this, startTime = $.now() + config.delay, deferred = $.Deferred(), transitionEndFired = $.Deferred(), simulatedTransitionEndFired = $.Deferred(); config.transitionAnimation.cleanup = function() { clearTimeout(simulatedEndEventTimer); clearTimeout(waitForJSCompleteTimer); $element.off(transitionEndEventName); $element.off(removeEventName) }; $element.one(transitionEndEventName, function() { if ($.now() - startTime >= config.duration) { transitionEndFired.reject() } }).off(removeEventName).on(removeEventName, function() { that.stop($element, config); deferred.reject() }); waitForJSCompleteTimer = setTimeout(function() { simulatedEndEventTimer = setTimeout(function() { simulatedTransitionEndFired.reject() }, config.duration + config.delay + fx._simulatedTransitionEndDelay); $.when(transitionEndFired, simulatedTransitionEndFired).fail($.proxy(function() { deferred.resolve() }, this)) }); return deferred.promise() }, _startAnimation: function($element, config) { $element.css({ transitionProperty: "all", transitionDelay: config.delay + "ms", transitionDuration: config.duration + "ms", transitionTimingFunction: config.easing }); if ("string" === typeof config.to) { $element[0].className += " " + config.to } else { if (config.to) { setProps($element, config.to) } } }, _finishTransition: function($element, config) { $element.css("transition", "none") }, _cleanup: function($element, config) { config.transitionAnimation.cleanup(); if ("string" === typeof config.from) { $element.removeClass(config.from); $element.removeClass(config.to) } }, stop: function($element, config, jumpToEnd) { if (!config) { return } if (jumpToEnd) { config.transitionAnimation.finish() } else { if ($.isPlainObject(config.to)) { $.each(config.to, function(key) { $element.css(key, $element.css(key)) }) } this._finishTransition($element, config); this._cleanup($element, config) } } }; var FrameAnimationStrategy = { initAnimation: function($element, config) { setProps($element, config.from) }, animate: function($element, config) { var deferred = $.Deferred(), that = this; if (!config) { return deferred.reject().promise() } $.each(config.to, function(prop) { if (void 0 === config.from[prop]) { config.from[prop] = that._normalizeValue($element.css(prop)) } }); if (config.to[TRANSFORM_PROP]) { config.from[TRANSFORM_PROP] = that._parseTransform(config.from[TRANSFORM_PROP]); config.to[TRANSFORM_PROP] = that._parseTransform(config.to[TRANSFORM_PROP]) } config.frameAnimation = { to: config.to, from: config.from, currentValue: config.from, easing: convertTransitionTimingFuncToJQueryEasing(config.easing), duration: config.duration, startTime: (new Date).valueOf(), finish: function() { this.currentValue = this.to; this.draw(); animationFrame.cancelAnimationFrame(config.frameAnimation.animationFrameId); deferred.resolve() }, draw: function() { if (config.draw) { config.draw(this.currentValue); return } var currentValue = $.extend({}, this.currentValue); if (currentValue[TRANSFORM_PROP]) { currentValue[TRANSFORM_PROP] = $.map(currentValue[TRANSFORM_PROP], function(value, prop) { if ("translate" === prop) { return translator.getTranslateCss(value) } else { if ("scale" === prop) { return "scale(" + value + ")" } else { if ("rotate" === prop.substr(0, prop.length - 1)) { return prop + "(" + value + "deg)" } } } }).join(" ") } $element.css(currentValue) } }; if (config.delay) { config.frameAnimation.startTime += config.delay; config.frameAnimation.delayTimeout = setTimeout(function() { that._startAnimation($element, config) }, config.delay) } else { that._startAnimation($element, config) } return deferred.promise() }, _startAnimation: function($element, config) { $element.off(removeEventName).on(removeEventName, function() { if (config.frameAnimation) { animationFrame.cancelAnimationFrame(config.frameAnimation.animationFrameId) } }); this._animationStep($element, config) }, _parseTransform: function(transformString) { var result = {}; $.each(transformString.match(/(\w|\d)+\([^\)]*\)\s*/g), function(i, part) { var translateData = translator.parseTranslate(part), scaleData = part.match(/scale\((.+?)\)/), rotateData = part.match(/(rotate.)\((.+)deg\)/); if (translateData) { result.translate = translateData } if (scaleData && scaleData[1]) { result.scale = parseFloat(scaleData[1]) } if (rotateData && rotateData[1]) { result[rotateData[1]] = parseFloat(rotateData[2]) } }); return result }, stop: function($element, config, jumpToEnd) { var frameAnimation = config && config.frameAnimation; if (!frameAnimation) { return } animationFrame.cancelAnimationFrame(frameAnimation.animationFrameId); clearTimeout(frameAnimation.delayTimeout); if (jumpToEnd) { frameAnimation.finish() } delete config.frameAnimation }, _animationStep: function($element, config) { var frameAnimation = config && config.frameAnimation; if (!frameAnimation) { return } var now = (new Date).valueOf(); if (now >= frameAnimation.startTime + frameAnimation.duration) { frameAnimation.finish(); return } frameAnimation.currentValue = this._calcStepValue(frameAnimation, now - frameAnimation.startTime); frameAnimation.draw(); var that = this; frameAnimation.animationFrameId = animationFrame.requestAnimationFrame(function() { that._animationStep($element, config) }) }, _calcStepValue: function(frameAnimation, currentDuration) { var calcValueRecursively = function(from, to) { var result = $.isArray(to) ? [] : {}; var calcEasedValue = function(propName) { var x = currentDuration / frameAnimation.duration, t = currentDuration, b = 1 * from[propName], c = to[propName] - from[propName], d = frameAnimation.duration; return $.easing[frameAnimation.easing](x, t, b, c, d) }; $.each(to, function(propName, endPropValue) { if ("string" === typeof endPropValue && false === parseFloat(endPropValue, 10)) { return true } result[propName] = "object" === typeof endPropValue ? calcValueRecursively(from[propName], endPropValue) : calcEasedValue(propName) }); return result }; return calcValueRecursively(frameAnimation.from, frameAnimation.to) }, _normalizeValue: function(value) { var numericValue = parseFloat(value, 10); if (false === numericValue) { return value } return numericValue } }; var FallbackToNoAnimationStrategy = { initAnimation: function($element, config) {}, animate: function($element, config) { return $.Deferred().resolve().promise() }, stop: $.noop, isSynchronous: true }; var animationStrategies = { transition: support.transition ? TransitionAnimationStrategy : FrameAnimationStrategy, frame: FrameAnimationStrategy, noAnimation: FallbackToNoAnimationStrategy }; var getAnimationStrategy = function(config) { config = config || {}; var strategy = config.strategy || "transition"; if ("css" === config.type && !support.transition) { strategy = "noAnimation" } return animationStrategies[strategy] }; var TransitionTimingFuncMap = { linear: "cubic-bezier(0, 0, 1, 1)", ease: "cubic-bezier(0.25, 0.1, 0.25, 1)", "ease-in": "cubic-bezier(0.42, 0, 1, 1)", "ease-out": "cubic-bezier(0, 0, 0.58, 1)", "ease-in-out": "cubic-bezier(0.42, 0, 0.58, 1)" }; var convertTransitionTimingFuncToJQueryEasing = function(cssTransitionEasing) { cssTransitionEasing = TransitionTimingFuncMap[cssTransitionEasing] || cssTransitionEasing; var bezCoeffs = cssTransitionEasing.match(CSS_TRANSITION_EASING_REGEX); if (!bezCoeffs) { return "linear" } bezCoeffs = bezCoeffs.slice(1, 5); $.each(bezCoeffs, function(index, value) { bezCoeffs[index] = parseFloat(value) }); var easingName = "cubicbezier_" + bezCoeffs.join("_").replace(/\./g, "p"); if (!$.isFunction($.easing[easingName])) { var polynomBezier = function(x1, y1, x2, y2) { var Cx = 3 * x1, Bx = 3 * (x2 - x1) - Cx, Ax = 1 - Cx - Bx, Cy = 3 * y1, By = 3 * (y2 - y1) - Cy, Ay = 1 - Cy - By; var bezierX = function(t) { return t * (Cx + t * (Bx + t * Ax)) }; var bezierY = function(t) { return t * (Cy + t * (By + t * Ay)) }; var findXfor = function(t) { var z, x = t, i = 0; while (i < 14) { z = bezierX(x) - t; if (Math.abs(z) < .001) { break } x -= z / derivativeX(x); i++ } return x }; var derivativeX = function(t) { return Cx + t * (2 * Bx + 3 * t * Ax) }; return function(t) { return bezierY(findXfor(t)) } }; $.easing[easingName] = function(x, t, b, c, d) { return c * polynomBezier(bezCoeffs[0], bezCoeffs[1], bezCoeffs[2], bezCoeffs[3])(t / d) + b } } return easingName }; var baseConfigValidator = function(config, animationType, validate, typeMessage) { $.each(["from", "to"], function() { if (!validate(config[this])) { throw errors.Error("E0010", animationType, this, typeMessage) } }) }; var isObjectConfigValidator = function(config, animationType) { return baseConfigValidator(config, animationType, function(target) { return $.isPlainObject(target) }, "a plain object") }; var isStringConfigValidator = function(config, animationType) { return baseConfigValidator(config, animationType, function(target) { return "string" === typeof target }, "a string") }; var CustomAnimationConfigurator = { setup: function($element, config) {} }; var CssAnimationConfigurator = { validateConfig: function(config) { isStringConfigValidator(config, "css") }, setup: function($element, config) {} }; var positionAliases = { top: { my: "bottom center", at: "top center" }, bottom: { my: "top center", at: "bottom center" }, right: { my: "left center", at: "right center" }, left: { my: "right center", at: "left center" } }; var SlideAnimationConfigurator = { validateConfig: function(config) { isObjectConfigValidator(config, "slide") }, setup: function($element, config) { var location = translator.locate($element); if ("slide" !== config.type) { var positioningConfig = "slideIn" === config.type ? config.from : config.to; positioningConfig.position = $.extend({ of: window }, positionAliases[config.direction]); setupPosition($element, positioningConfig) } this._setUpConfig(location, config.from); this._setUpConfig(location, config.to); translator.clearCache($element); if (!support.transform && "static" === $element.css("position")) { $element.css("position", "relative") } }, _setUpConfig: function(location, config) { config.left = "left" in config ? config.left : "+=0"; config.top = "top" in config ? config.top : "+=0"; this._initNewPosition(location, config) }, _initNewPosition: function(location, config) { var position = { left: config.left, top: config.top }; delete config.left; delete config.top; var relativeValue = this._getRelativeValue(position.left); if (void 0 !== relativeValue) { position.left = relativeValue + location.left } else { config.left = 0 } relativeValue = this._getRelativeValue(position.top); if (void 0 !== relativeValue) { position.top = relativeValue + location.top } else { config.top = 0 } var translate = { x: 0, y: 0 }; if (support.transform) { translate = { x: position.left, y: position.top } } else { config.left = position.left; config.top = position.top } config[TRANSFORM_PROP] = translator.getTranslateCss(translate) }, _getRelativeValue: function(value) { var relativeValue; if ("string" === typeof value && (relativeValue = RELATIVE_VALUE_REGEX.exec(value))) { return parseInt(relativeValue[1] + "1") * relativeValue[2] } } }; var FadeAnimationConfigurator = { setup: function($element, config) { var toOpacity, from = config.from, fromOpacity = $.isPlainObject(from) ? config.skipElementInitialStyles ? 0 : $element.css("opacity") : String(from); switch (config.type) { case "fadeIn": toOpacity = 1; break; case "fadeOut": toOpacity = 0; break; default: toOpacity = String(config.to) } config.from = { visibility: "visible", opacity: fromOpacity }; config.to = { opacity: toOpacity } } }; var PopAnimationConfigurator = { validateConfig: function(config) { isObjectConfigValidator(config, "pop") }, setup: function($element, config) { var from = config.from, to = config.to, fromOpacity = "opacity" in from ? from.opacity : $element.css("opacity"), toOpacity = "opacity" in to ? to.opacity : 1, fromScale = "scale" in from ? from.scale : 0, toScale = "scale" in to ? to.scale : 1; config.from = { opacity: fromOpacity }; var translate = translator.getTranslate($element); config.from[TRANSFORM_PROP] = this._getCssTransform(translate, fromScale); config.to = { opacity: toOpacity }; config.to[TRANSFORM_PROP] = this._getCssTransform(translate, toScale) }, _getCssTransform: function(translate, scale) { return translator.getTranslateCss(translate) + "scale(" + scale + ")" } }; var animationConfigurators = { custom: CustomAnimationConfigurator, slide: SlideAnimationConfigurator, slideIn: SlideAnimationConfigurator, slideOut: SlideAnimationConfigurator, fade: FadeAnimationConfigurator, fadeIn: FadeAnimationConfigurator, fadeOut: FadeAnimationConfigurator, pop: PopAnimationConfigurator, css: CssAnimationConfigurator }; var getAnimationConfigurator = function(config) { var result = animationConfigurators[config.type]; if (!result) { throw errors.Error("E0011", config.type) } return result }; var defaultJSConfig = { type: "custom", from: {}, to: {}, duration: 400, start: $.noop, complete: $.noop, easing: "ease", delay: 0 }, defaultCssConfig = { duration: 400, easing: "ease", delay: 0 }; var setupAnimationOnElement = function() { var animation = this, $element = animation.element, config = animation.config; setupPosition($element, config.from); setupPosition($element, config.to); animation.configurator.setup($element, config); $element.data(ANIM_DATA_KEY, animation); if (fx.off) { config.duration = 0; config.delay = 0 } animation.strategy.initAnimation($element, config); if (config.start) { config.start.apply(this, [$element, config]) } }; var onElementAnimationComplete = function(animation) { var $element = animation.element, config = animation.config; $element.removeData(ANIM_DATA_KEY); if (config.complete) { config.complete.apply(this, [$element, config]) } animation.deferred.resolveWith(this, [$element, config]) }; var startAnimationOnElement = function() { var animation = this, $element = animation.element, config = animation.config; animation.isStarted = true; return animation.strategy.animate($element, config).done(function() { onElementAnimationComplete(animation) }).fail(function() { animation.deferred.rejectWith(this, [$element, config]) }) }; var stopAnimationOnElement = function(jumpToEnd) { var animation = this, $element = animation.element, config = animation.config; clearTimeout(animation.startTimeout); if (!animation.isStarted) { animation.start() } animation.strategy.stop($element, config, jumpToEnd) }; var createAnimation = function(element, initialConfig) { var defaultConfig = "css" === initialConfig.type ? defaultCssConfig : defaultJSConfig, config = $.extend(true, {}, defaultConfig, initialConfig), configurator = getAnimationConfigurator(config), strategy = getAnimationStrategy(config), animation = { element: $(element), config: config, configurator: configurator, strategy: strategy, isSynchronous: strategy.isSynchronous, setup: setupAnimationOnElement, start: startAnimationOnElement, stop: stopAnimationOnElement, deferred: $.Deferred() }; if ($.isFunction(configurator.validateConfig)) { configurator.validateConfig(config) } return animation }; var animate = function(element, config) { var $element = $(element); if (!$element.length) { return $.Deferred().resolve().promise() } var animation = createAnimation($element, config); pushInAnimationQueue($element, animation); return animation.deferred.promise() }; var pushInAnimationQueue = function($element, animation) { var queueData = getAnimQueueData($element); writeAnimQueueData($element, queueData); queueData.push(animation); if (!isAnimating($element)) { shiftFromAnimationQueue($element, queueData) } }; var getAnimQueueData = function($element) { return $element.data(ANIM_QUEUE_KEY) || [] }; var writeAnimQueueData = function($element, queueData) { $element.data(ANIM_QUEUE_KEY, queueData) }; var destroyAnimQueueData = function($element) { $element.removeData(ANIM_QUEUE_KEY) }; var isAnimating = function($element) { return !!$element.data(ANIM_DATA_KEY) }; var shiftFromAnimationQueue = function($element, queueData) { queueData = getAnimQueueData($element); if (!queueData.length) { return } var animation = queueData.shift(); if (0 === queueData.length) { destroyAnimQueueData($element) } executeAnimation(animation).done(function() { if (!isAnimating($element)) { shiftFromAnimationQueue($element) } }) }; var executeAnimation = function(animation) { animation.setup(); if (fx.off || animation.isSynchronous) { animation.start() } else { animation.startTimeout = setTimeout(function() { animation.start() }); var namespacedRemoveEvent = eventUtils.addNamespace(removeEvent, "dxFXStartAnimation"); animation.element.off(namespacedRemoveEvent).on(namespacedRemoveEvent, function() { clearTimeout(animation.startTimeout) }) } return animation.deferred.promise() }; var setupPosition = function($element, config) { if (!config || !config.position) { return } var position = positionUtils.calculate($element, config.position), offset = $element.offset(), currentPosition = $element.position(); $.extend(config, { left: position.h.location - offset.left + currentPosition.left, top: position.v.location - offset.top + currentPosition.top }); delete config.position }; var setProps = function($element, props) { $.each(props, function(key, value) { try { $element.css(key, value) } catch (e) {} }) }; var stop = function(element, jumpToEnd) { var $element = $(element), queueData = getAnimQueueData($element); $.each(queueData, function(_, animation) { animation.config.delay = 0; animation.config.duration = 0; animation.isSynchronous = true }); if (!isAnimating($element)) { shiftFromAnimationQueue($element, queueData) } var animation = $element.data(ANIM_DATA_KEY); if (animation) { animation.stop(jumpToEnd) } $element.removeData(ANIM_DATA_KEY); destroyAnimQueueData($element) }; var fx = { off: false, animationTypes: animationConfigurators, animate: animate, createAnimation: createAnimation, isAnimating: isAnimating, stop: stop, _simulatedTransitionEndDelay: 100 }; fx.__internals = { convertTransitionTimingFuncToJQueryEasing: convertTransitionTimingFuncToJQueryEasing }; module.exports = fx }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************!*\ !*** ./Scripts/core/utils/browser.js ***! \***************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1); var webkitRegExp = /(webkit)[ \/]([\w.]+)/, ieRegExp = /(msie) (\d{1,2}\.\d)/, ie11RegExp = /(trident).*rv:(\d{1,2}\.\d)/, msEdge = /(edge)\/((\d+)?[\w\.]+)/, mozillaRegExp = /(mozilla)(?:.*? rv:([\w.]+))/; var browserFromUA = function(ua) { ua = ua.toLowerCase(); var result = {}, matches = ieRegExp.exec(ua) || ie11RegExp.exec(ua) || msEdge.exec(ua) || ua.indexOf("compatible") < 0 && mozillaRegExp.exec(ua) || webkitRegExp.exec(ua) || [], browserName = matches[1], browserVersion = matches[2]; if ("trident" === browserName || "edge" === browserName) { browserName = "msie" } if (browserName) { result[browserName] = true; result.version = browserVersion } return result }; module.exports = $.extend({ _fromUA: browserFromUA }, browserFromUA(navigator.userAgent)) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!******************************!*\ !*** ./Scripts/ui/themes.js ***! \******************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), errors = __webpack_require__( /*! ./widget/ui.errors */ 20), domUtils = __webpack_require__( /*! ../core/utils/dom */ 11), devices = __webpack_require__( /*! ../core/devices */ 7), viewPortUtils = __webpack_require__( /*! ../core/utils/view_port */ 52), viewPort = viewPortUtils.value, viewPortChanged = viewPortUtils.changeCallback; var DX_LINK_SELECTOR = "link[rel=dx-theme]", THEME_ATTR = "data-theme", ACTIVE_ATTR = "data-active", DX_HAIRLINES_CLASS = "dx-hairlines"; var context, $activeThemeLink, knownThemes, currentThemeName, pendingThemeName; var THEME_MARKER_PREFIX = "dx."; function readThemeMarker() { var result, element = $("
", context).addClass("dx-theme-marker").appendTo(context.documentElement); try { result = element.css("font-family"); if (!result) { return null } result = result.replace(/["']/g, ""); if (result.substr(0, THEME_MARKER_PREFIX.length) !== THEME_MARKER_PREFIX) { return null } return result.substr(THEME_MARKER_PREFIX.length) } finally { element.remove() } } function waitForThemeLoad(themeName, callback) { var timerId, waitStartTime; pendingThemeName = themeName; function handleLoaded() { pendingThemeName = null; callback() } if (isPendingThemeLoaded()) { handleLoaded() } else { waitStartTime = $.now(); timerId = setInterval(function() { var isLoaded = isPendingThemeLoaded(), isTimeout = !isLoaded && $.now() - waitStartTime > 15e3; if (isTimeout) { errors.log("W0004", pendingThemeName) } if (isLoaded || isTimeout) { clearInterval(timerId); handleLoaded() } }, 10) } } function isPendingThemeLoaded() { return !pendingThemeName || readThemeMarker() === pendingThemeName } function processMarkup() { var $allThemeLinks = $(DX_LINK_SELECTOR, context); if (!$allThemeLinks.length) { return } knownThemes = {}; $activeThemeLink = $(domUtils.createMarkupFromString(""), context); $allThemeLinks.each(function() { var link = $(this, context), fullThemeName = link.attr(THEME_ATTR), url = link.attr("href"), isActive = "true" === link.attr(ACTIVE_ATTR); knownThemes[fullThemeName] = { url: url, isActive: isActive } }); $allThemeLinks.last().after($activeThemeLink); $allThemeLinks.remove() } function resolveFullThemeName(desiredThemeName) { var desiredThemeParts = desiredThemeName.split("."), result = null; if (knownThemes) { $.each(knownThemes, function(knownThemeName, themeData) { var knownThemeParts = knownThemeName.split("."); if (knownThemeParts[0] !== desiredThemeParts[0]) { return } if (desiredThemeParts[1] && desiredThemeParts[1] !== knownThemeParts[1]) { return } if (desiredThemeParts[2] && desiredThemeParts[2] !== knownThemeParts[2]) { return } if (!result || themeData.isActive) { result = knownThemeName } if (themeData.isActive) { return false } }) } return result } function initContext(newContext) { try { if (newContext !== context) { knownThemes = null } } catch (x) { knownThemes = null } context = newContext } function init(options) { options = options || {}; initContext(options.context || document); processMarkup(); currentThemeName = void 0; current(options) } function current(options) { if (!arguments.length) { currentThemeName = currentThemeName || readThemeMarker(); return currentThemeName } detachCssClasses(viewPort(), currentThemeName); options = options || {}; if ("string" === typeof options) { options = { theme: options } } var currentThemeData, isAutoInit = options._autoInit, loadCallback = options.loadCallback; currentThemeName = options.theme || currentThemeName; if (isAutoInit && !currentThemeName) { currentThemeName = themeNameFromDevice(devices.current()) } currentThemeName = resolveFullThemeName(currentThemeName); if (currentThemeName) { currentThemeData = knownThemes[currentThemeName] } if (currentThemeData) { $activeThemeLink.attr("href", knownThemes[currentThemeName].url); if (loadCallback) { waitForThemeLoad(currentThemeName, loadCallback) } else { if (pendingThemeName) { pendingThemeName = currentThemeName } } } else { if (isAutoInit) { if (loadCallback) { loadCallback() } } else { throw errors.Error("E0021", currentThemeName) } } attachCssClasses(viewPortUtils.originalViewPort(), currentThemeName) } function themeNameFromDevice(device) { var themeName = device.platform; var majorVersion = device.version && device.version[0]; switch (themeName) { case "ios": themeName += "7"; break; case "android": themeName += "5"; break; case "win": themeName += majorVersion && 8 === majorVersion ? "8" : "10" } return themeName } function getCssClasses(themeName) { themeName = themeName || current(); var result = [], themeNameParts = themeName && themeName.split("."); if (themeNameParts) { result.push("dx-theme-" + themeNameParts[0], "dx-theme-" + themeNameParts[0] + "-typography"); if (themeNameParts.length > 1) { result.push("dx-color-scheme-" + themeNameParts[1]) } } return result } var themeClasses; function attachCssClasses(element, themeName) { themeClasses = getCssClasses(themeName).join(" "); $(element).addClass(themeClasses); var activateHairlines = function() { var pixelRatio = window.devicePixelRatio; if (!pixelRatio || pixelRatio < 2) { return } var $tester = $("
"); $tester.css("border", ".5px solid transparent"); $("body").append($tester); if (1 === $tester.outerHeight()) { $(element).addClass(DX_HAIRLINES_CLASS); themeClasses += " " + DX_HAIRLINES_CLASS } $tester.remove() }; activateHairlines() } function detachCssClasses(element, themeName) { $(element).removeClass(themeClasses) } $.holdReady(true); init({ _autoInit: true, loadCallback: function() { $.holdReady(false) } }); $(function() { if ($(DX_LINK_SELECTOR, context).length) { throw errors.Error("E0022") } }); viewPortChanged.add(function(viewPort, prevViewPort) { detachCssClasses(prevViewPort); attachCssClasses(viewPort) }); devices.changed.add(function() { init({ _autoInit: true }) }); exports.current = current; exports.init = init; exports.attachCssClasses = attachCssClasses; exports.detachCssClasses = detachCssClasses; exports.themeNameFromDevice = themeNameFromDevice; exports.waitForThemeLoad = waitForThemeLoad; exports.resetTheme = function() { $activeThemeLink && $activeThemeLink.attr("href", "about:blank"); currentThemeName = null; pendingThemeName = null } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!******************************!*\ !*** ./Scripts/ui/button.js ***! \******************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), iconUtils = __webpack_require__( /*! ../core/utils/icon */ 77), devices = __webpack_require__( /*! ../core/devices */ 7), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 3), ValidationMixin = __webpack_require__( /*! ./validation/validation_mixin */ 132), ValidationEngine = __webpack_require__( /*! ./validation_engine */ 64), Widget = __webpack_require__( /*! ./widget/ui.widget */ 19), inkRipple = __webpack_require__( /*! ./widget/utils.ink_ripple */ 48), eventUtils = __webpack_require__( /*! ../events/utils */ 4), themes = __webpack_require__( /*! ./themes */ 23), clickEvent = __webpack_require__( /*! ../events/click */ 9); var BUTTON_CLASS = "dx-button", BUTTON_CONTENT_CLASS = "dx-button-content", BUTTON_HAS_TEXT_CLASS = "dx-button-has-text", BUTTON_HAS_ICON_CLASS = "dx-button-has-icon", TEMPLATE_WRAPPER_CLASS = "dx-template-wrapper", ANONYMOUS_TEMPLATE_NAME = "content", BUTTON_FEEDBACK_HIDE_TIMEOUT = 100; var Button = Widget.inherit({ _supportedKeys: function() { var that = this, click = function(e) { e.preventDefault(); that._executeClickAction(e) }; return $.extend(this.callBase(), { space: click, enter: click }) }, _setDeprecatedOptions: function() { this.callBase(); $.extend(this._deprecatedOptions, { iconSrc: { since: "15.1", alias: "icon" } }) }, _getDefaultOptions: function() { return $.extend(this.callBase(), { hoverStateEnabled: true, onClick: null, type: "normal", text: "", icon: "", validationGroup: void 0, activeStateEnabled: true, template: "content", useInkRipple: false }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function(device) { return "desktop" === devices.real().deviceType && !devices.isSimulator() }, options: { focusStateEnabled: true } }, { device: function() { return /android5/.test(themes.current()) }, options: { useInkRipple: true } }]) }, _getAnonymousTemplateName: function() { return ANONYMOUS_TEMPLATE_NAME }, _feedbackHideTimeout: BUTTON_FEEDBACK_HIDE_TIMEOUT, _render: function() { this.element().addClass(BUTTON_CLASS); this._renderType(); this.option("useInkRipple") && this._renderInkRipple(); this._renderClick(); this.setAria("role", "button"); this._updateAriaLabel(); this.callBase() }, _renderInkRipple: function() { var isOnlyIconButton = !this.option("text") && this.option("icon") || "back" === this.option("type"), config = {}; if (isOnlyIconButton) { $.extend(config, { waveSizeCoefficient: 1, useHoldAnimation: false, isCentered: true }) } this._inkRipple = inkRipple.render(config) }, _toggleActiveState: function($element, value, e) { this.callBase.apply(this, arguments); if (!this._inkRipple) { return } var config = { element: this._$content, jQueryEvent: e }; if (value) { this._inkRipple.showWave(config) } else { this._inkRipple.hideWave(config) } }, _renderContentImpl: function() { var $element = this.element(), data = this._getContentData(); if (this._$content) { this._$content.empty() } else { this._$content = $("
").addClass(BUTTON_CONTENT_CLASS).appendTo($element) } $element.toggleClass(BUTTON_HAS_ICON_CLASS, !!data.icon).toggleClass(BUTTON_HAS_TEXT_CLASS, !!data.text); var template = this._getTemplateByOption("template"), $result = template.render(data, this._$content); if ($result.hasClass(TEMPLATE_WRAPPER_CLASS)) { this._$content.replaceWith($result); this._$content = $result; this._$content.addClass(BUTTON_CONTENT_CLASS) } }, _getContentData: function() { var icon = this.option("icon"), text = this.option("text"), back = "back" === this.option("type"); if (back && !icon) { icon = "back" } return { icon: icon, text: text } }, _renderClick: function() { var that = this, eventName = eventUtils.addNamespace(clickEvent.name, this.NAME); this._clickAction = this._createActionByOption("onClick"); this.element().off(eventName).on(eventName, function(e) { that._executeClickAction(e) }) }, _executeClickAction: function(e) { this._clickAction({ jQueryEvent: e, validationGroup: ValidationEngine.getGroupConfig(this._findGroup()) }) }, _updateAriaLabel: function() { var icon = this.option("icon"), text = this.option("text"); if ("image" === iconUtils.getImageSourceType(icon)) { if (-1 === icon.indexOf("base64")) { icon = icon.replace(/.+\/([^\.]+)\..+$/, "$1") } else { icon = "Base64" } } var ariaLabel = text || icon; this.setAria("label", $.trim(ariaLabel)) }, _renderType: function() { var type = this.option("type"); if (type) { this.element().addClass("dx-button-" + type) } }, _refreshType: function(prevType) { var type = this.option("type"); prevType && this.element().removeClass("dx-button-" + prevType).addClass("dx-button-" + type); if (!this.element().hasClass(BUTTON_HAS_ICON_CLASS) && "back" === type) { this._renderContentImpl() } }, _optionChanged: function(args) { switch (args.name) { case "onClick": this._renderClick(); break; case "icon": case "text": this._renderContentImpl(); this._updateAriaLabel(); break; case "type": this._refreshType(args.previousValue); this._renderContentImpl(); this._updateAriaLabel(); break; case "template": this._renderContentImpl(); break; case "useInkRipple": this._invalidate(); break; default: this.callBase(args) } }, _clean: function() { this.callBase(); delete this._$content } }).include(ValidationMixin); registerComponent("dxButton", Button); module.exports = Button }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!********************************!*\ !*** ./Scripts/data/errors.js ***! \********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var errorUtils = __webpack_require__( /*! ../core/utils/error */ 94), coreErrors = __webpack_require__( /*! ../core/errors */ 10), handlers = {}; var errors = errorUtils(coreErrors.ERROR_MESSAGES, { E4000: "[DevExpress.data]: {0}", E4001: "Unknown aggregating function is detected: '{0}'", E4002: "Unsupported OData protocol version is used", E4003: "Unknown filter operation is used: {0}", E4004: "The thenby() method is called before the sortby() method", E4005: "Store requires a key expression for this operation", E4006: "ArrayStore 'data' option must be an array", E4007: "Compound keys cannot be auto-generated", E4008: "Attempt to insert an item with the a duplicated key", E4009: "Data item cannot be found", E4010: "CustomStore does not support creating queries", E4011: "Custom Store method is not implemented or is not a function: {0}", E4012: "Custom Store method returns an invalid value: {0}", E4013: "Local Store requires the 'name' configuration option is specified", E4014: "Unknown key type is detected: {0}", E4015: "Unknown entity name or alias is used: {0}", E4017: "Keys cannot be modified", E4018: "The server has returned a non-numeric value in a response to an item count request", E4019: "Mixing of group operators inside a single group of filter expression is not allowed", E4020: "Unknown store type is detected: {0}" }); function handleError(error) { var id = "E4000"; if (error && "__id" in error) { id = error.__id } errors.log(id, error) } var errorHandler = null; var _errorHandler = function(error) { handleError(error); if (handlers.errorHandler) { handlers.errorHandler(error) } }; handlers = { errors: errors, errorHandler: errorHandler, _errorHandler: _errorHandler }; module.exports = handlers }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************!*\ !*** ./Scripts/core/utils/string.js ***! \**************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ./common */ 2); var encodeHtml = function() { var encodeRegExp = [new RegExp("&", "g"), new RegExp('"', "g"), new RegExp("'", "g"), new RegExp("<", "g"), new RegExp(">", "g")]; return function(str) { return String(str).replace(encodeRegExp[0], "&").replace(encodeRegExp[1], """).replace(encodeRegExp[2], "'").replace(encodeRegExp[3], "<").replace(encodeRegExp[4], ">") } }(); var pairToObject = function(raw) { var pair = commonUtils.splitPair(raw), h = parseInt(pair && pair[0], 10), v = parseInt(pair && pair[1], 10); if (!isFinite(h)) { h = 0 } if (!isFinite(v)) { v = h } return { h: h, v: v } }; var quadToObject = function(raw) { var quad = commonUtils.splitQuad(raw), left = parseInt(quad && quad[0], 10), top = parseInt(quad && quad[1], 10), right = parseInt(quad && quad[2], 10), bottom = parseInt(quad && quad[3], 10); if (!isFinite(left)) { left = 0 } if (!isFinite(top)) { top = left } if (!isFinite(right)) { right = left } if (!isFinite(bottom)) { bottom = top } return { top: top, right: right, bottom: bottom, left: left } }; var stringFormat = function() { var replaceDollarCount, reg, value, s = arguments[0], values = $.makeArray(arguments).slice(1); if ($.isFunction(s)) { return s.apply(this, values) } for (var i = 0; i < values.length; i++) { reg = new RegExp("\\{" + i + "\\}", "gm"); value = values[i]; if ("string" === $.type(value) && value.indexOf("$") >= 0) { replaceDollarCount = "$".replace("$", "$$").length; value = value.replace("$", 1 === replaceDollarCount ? "$$$$" : "$$") } s = s.replace(reg, value) } return s }; var replaceAll = function() { var preg_quote = function(str) { return (str + "").replace(/([\+\*\?\\\.\[\^\]\$\(\)\{\}\><\|\=\!\:])/g, "\\$1") }; return function(text, searchToken, replacementToken) { return text.replace(new RegExp("(" + preg_quote(searchToken) + ")", "gi"), replacementToken) } }(); var isEmpty = function(text) { var SPACE_REGEXP = /\s/g; return function(text) { return !text || !text.replace(SPACE_REGEXP, "") } }(); exports.encodeHtml = encodeHtml; exports.pairToObject = pairToObject; exports.quadToObject = quadToObject; exports.format = stringFormat; exports.replaceAll = replaceAll; exports.isEmpty = isEmpty }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************************************!*\ !*** ./Scripts/ui/collection/ui.collection_widget.edit.js ***! \************************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), BaseCollectionWidget = __webpack_require__( /*! ./ui.collection_widget.base */ 303), errors = __webpack_require__( /*! ../widget/ui.errors */ 20), arrayUtils = __webpack_require__( /*! ../../core/utils/array */ 41), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), PlainEditStrategy = __webpack_require__( /*! ./ui.collection_widget.edit.strategy.plain */ 153), DataSource = __webpack_require__( /*! ../../data/data_source/data_source */ 37).DataSource; var ITEM_DELETING_DATA_KEY = "dxItemDeleting"; var CollectionWidget = BaseCollectionWidget.inherit({ _setOptionsByReference: function() { this.callBase(); $.extend(this._optionsByReference, { selectedItem: true }) }, _getDefaultOptions: function() { return $.extend(this.callBase(), { selectionMode: "none", selectionRequired: false, selectionByClick: true, selectedItems: [], selectedIndex: -1, selectedItem: null, onSelectionChanged: null, onItemReordered: null, onItemDeleting: null, onItemDeleted: null }) }, _init: function() { this._initEditStrategy(); this.callBase(); this._selectedItemIndices = []; if ("multi" === this.option("selectionMode")) { this._showDeprecatedSelectionMode() } }, _initEditStrategy: function() { var Strategy = PlainEditStrategy; this._editStrategy = new Strategy(this) }, _forgetNextPageLoading: function() { this.callBase(); this._selectedItemIndices = this._editStrategy.selectedItemIndices() }, _render: function() { this._syncSelectionOptions(); this._normalizeSelectedItems(); this._initSelectedItems(); this.callBase(); this._renderSelection(this._selectedItemIndices, []) }, _syncSelectionOptions: function(byOption) { byOption = byOption || this._chooseSelectOption(); var selectedItem, selectedItems; switch (byOption) { case "selectedIndex": selectedItem = this._editStrategy.getItemDataByIndex(this.option("selectedIndex")); if (commonUtils.isDefined(selectedItem)) { this._setOptionSilent("selectedItems", [selectedItem]); this._setOptionSilent("selectedItem", selectedItem) } else { this._setOptionSilent("selectedItems", []); this._setOptionSilent("selectedItem", null) } break; case "selectedItems": selectedItems = this.option("selectedItems") || []; this._setOptionSilent("selectedItem", selectedItems[0]); this._setOptionSilent("selectedIndex", this._editStrategy.getIndexByItemData(selectedItems[0])); break; case "selectedItem": selectedItem = this.option("selectedItem"); if (commonUtils.isDefined(selectedItem)) { this._setOptionSilent("selectedItems", [selectedItem]); this._setOptionSilent("selectedIndex", this._editStrategy.getIndexByItemData(selectedItem)) } else { this._setOptionSilent("selectedItems", []); this._setOptionSilent("selectedIndex", -1) } } }, _chooseSelectOption: function() { var optionName = "selectedIndex"; if (this.option("selectedItems").length) { optionName = "selectedItems" } else { if (commonUtils.isDefined(this.option("selectedItem"))) { optionName = "selectedItem" } } return optionName }, _normalizeSelectedItems: function() { if ("none" === this.option("selectionMode")) { this._setOptionSilent("selectedItems", []); this._syncSelectionOptions("selectedItems") } else { if ("single" === this.option("selectionMode")) { var newSelection = this._editStrategy.selectedItemIndices(this.option("selectedItems")); if (newSelection.length > 1 || !newSelection.length && this.option("selectionRequired") && this.option("items") && this.option("items").length) { var normalizedSelection = [newSelection[0] || this._selectedItemIndices[0] || 0]; this._setOptionSilent("selectedItems", this._editStrategy.fetchSelectedItems(normalizedSelection)); this._syncSelectionOptions("selectedItems") } } } }, _initSelectedItems: function() { this._selectedItemIndices = this._editStrategy.selectedItemIndices(this.option("selectedItems")) }, _renderSelection: $.noop, _itemClickHandler: function(e) { this._createAction($.proxy(function(e) { this._itemSelectHandler(e.jQueryEvent) }, this), { validatingTargetName: "itemElement" })({ itemElement: $(e.currentTarget), jQueryEvent: e }); this.callBase.apply(this, arguments) }, _itemSelectHandler: function(e) { if (!this.option("selectionByClick")) { return } var $itemElement = e.currentTarget; if (this.isItemSelected($itemElement)) { this.unselectItem(e.currentTarget) } else { this.selectItem(e.currentTarget) } }, _selectedItemElement: function(index) { return this._itemElements().eq(index) }, _postprocessRenderItem: function(args) { var $itemElement = $(args.itemElement); if (this._isItemSelected(this._editStrategy.getNormalizedIndex($itemElement))) { $itemElement.addClass(this._selectedItemClass()); this._setAriaSelected($itemElement, "true") } else { this._setAriaSelected($itemElement, "false") } }, _updateSelectedItems: function() { var that = this, oldSelection = this._selectedItemIndices.slice(), newSelection = this._editStrategy.selectedItemIndices(), addedSelection = arrayUtils.removeDuplicates(newSelection, oldSelection), removedSelection = arrayUtils.removeDuplicates(oldSelection, newSelection); $.each(removedSelection, function(_, normalizedIndex) { that._removeSelection(normalizedIndex) }); $.each(addedSelection, function(_, normalizedIndex) { that._addSelection(normalizedIndex) }); if (removedSelection.length || addedSelection.length) { var selectionChangePromise = this._selectionChangePromise; this._updateSelection(addedSelection, removedSelection); $.when(selectionChangePromise).done(function() { that._fireSelectionChangeEvent(addedSelection, removedSelection) }) } }, _fireSelectionChangeEvent: function(addedSelection, removedSelection) { this._createActionByOption("onSelectionChanged", { excludeValidators: ["disabled", "readOnly"] })(this._editStrategy.fetchSelectionDifference(addedSelection, removedSelection)) }, _updateSelection: function() { this._renderSelection.apply(this, arguments) }, _setAriaSelected: function($target, value) { this.setAria("selected", value, $target) }, _removeSelection: function(normalizedIndex) { var $itemElement = this._editStrategy.getItemElement(normalizedIndex), itemSelectionIndex = $.inArray(normalizedIndex, this._selectedItemIndices); if (itemSelectionIndex > -1) { $itemElement.removeClass(this._selectedItemClass()); this._setAriaSelected($itemElement, "false"); this._selectedItemIndices.splice(itemSelectionIndex, 1); $itemElement.triggerHandler("stateChanged") } }, _showDeprecatedSelectionMode: function() { errors.log("W0001", this.NAME, "selectionMode: 'multi'", "16.1", "Use selectionMode: 'multiple' instead"); this.option("selectionMode", "multiple") }, _addSelection: function(normalizedIndex) { var $itemElement = this._editStrategy.getItemElement(normalizedIndex); if (normalizedIndex > -1 && !this._isItemSelected(normalizedIndex)) { $itemElement.addClass(this._selectedItemClass()); this._setAriaSelected($itemElement, "true"); this._selectedItemIndices.push(normalizedIndex); $itemElement.triggerHandler("stateChanged") } }, _isItemSelected: function(index) { return $.inArray(index, this._selectedItemIndices) > -1 }, _optionChanged: function(args) { if (this._cancelOptionChange) { return } switch (args.name) { case "selectionMode": if ("multi" === args.value) { this._showDeprecatedSelectionMode() } else { this._invalidate() } break; case "selectedIndex": case "selectedItem": case "selectedItems": this._syncSelectionOptions(args.name); this._normalizeSelectedItems(); this._updateSelectedItems(); break; case "selectionRequired": this._normalizeSelectedItems(); this._updateSelectedItems(); break; case "selectionByClick": case "onSelectionChanged": case "onItemDeleting": case "onItemDeleted": case "onItemReordered": break; default: this.callBase(args) } }, _clearSelectedItems: function() { this._selectedItemIndices = []; this._setOptionSilent("selectedItems", []); this._syncSelectionOptions("selectedItems") }, _setOptionSilent: function(name, value) { this._cancelOptionChange = true; this.option(name, value); this._cancelOptionChange = false }, _waitDeletingPrepare: function($itemElement) { if ($itemElement.data(ITEM_DELETING_DATA_KEY)) { return $.Deferred().resolve().promise() } $itemElement.data(ITEM_DELETING_DATA_KEY, true); var deferred = $.Deferred(), deletePromise = this._itemEventHandler($itemElement, "onItemDeleting", {}, { excludeValidators: ["disabled", "readOnly"] }); $.when(deletePromise).always($.proxy(function(value) { var deletePromiseExists = !deletePromise, deletePromiseResolved = !deletePromiseExists && "resolved" === deletePromise.state(), argumentsSpecified = !!arguments.length, shouldDelete = deletePromiseExists || deletePromiseResolved && !argumentsSpecified || deletePromiseResolved && value; $itemElement.data(ITEM_DELETING_DATA_KEY, false); shouldDelete ? deferred.resolve() : deferred.reject() }, this)); return deferred.promise() }, _deleteItemFromDS: function($item) { if (!this._dataSource) { return $.Deferred().resolve().promise() } var deferred = $.Deferred(), disabledState = this.option("disabled"), dataStore = this._dataSource.store(); this.option("disabled", true); if (!dataStore.remove) { throw errors.Error("E1011") } dataStore.remove(dataStore.keyOf(this._getItemData($item))).done(function(key) { if (void 0 !== key) { deferred.resolve() } else { deferred.reject() } }).fail(function() { deferred.reject() }); deferred.always($.proxy(function() { this.option("disabled", disabledState) }, this)); return deferred }, _tryRefreshLastPage: function() { var deferred = $.Deferred(); if (this._isLastPage() || this.option("grouped")) { deferred.resolve() } else { this._refreshLastPage().done(function() { deferred.resolve() }) } return deferred.promise() }, _refreshLastPage: function() { this._expectLastItemLoading(); return this._dataSource.load() }, _updateSelectionAfterDelete: function(fromIndex) { var itemIndex = $.inArray(fromIndex, this._selectedItemIndices); if (itemIndex > -1) { this._selectedItemIndices.splice(itemIndex, 1) } this._editStrategy.updateSelectionAfterDelete(fromIndex); this.option("selectedItems", this._editStrategy.fetchSelectedItems()) }, _simulateOptionChange: function(optionName) { var optionValue = this.option(optionName); if (optionValue instanceof DataSource) { return } this._optionChangedAction({ name: optionName, fullName: optionName, value: optionValue }) }, isItemSelected: function(itemElement) { return this._isItemSelected(this._editStrategy.getNormalizedIndex(itemElement)) }, selectItem: function(itemElement) { var itemIndex = this._editStrategy.getNormalizedIndex(itemElement); if (-1 === itemIndex) { return } var itemSelectionIndex = $.inArray(itemIndex, this._selectedItemIndices); if (-1 !== itemSelectionIndex) { return } if ("single" === this.option("selectionMode")) { this.option("selectedItems", this._editStrategy.fetchSelectedItems([itemIndex])) } else { var newSelectedIndices = this._selectedItemIndices.slice(); newSelectedIndices.push(itemIndex); this.option("selectedItems", this._editStrategy.fetchSelectedItems(newSelectedIndices)) } }, unselectItem: function(itemElement) { var itemIndex = this._editStrategy.getNormalizedIndex(itemElement); if (-1 === itemIndex) { return } var itemSelectionIndex = $.inArray(itemIndex, this._selectedItemIndices); if (-1 === itemSelectionIndex) { return } var newSelectedIndices = this._selectedItemIndices.slice(); newSelectedIndices.splice(itemSelectionIndex, 1); if (this.option("selectionRequired") && 0 === newSelectedIndices.length) { return } this.option("selectedItems", this._editStrategy.fetchSelectedItems(newSelectedIndices)) }, deleteItem: function(itemElement) { var that = this, deferred = $.Deferred(), $item = this._editStrategy.getItemElement(itemElement), index = this._editStrategy.getNormalizedIndex(itemElement), changingOption = this._dataSource ? "dataSource" : "items", itemResponseWaitClass = this._itemResponseWaitClass(); if (index > -1) { this._waitDeletingPrepare($item).done(function() { $item.addClass(itemResponseWaitClass); var deletedActionArgs = that._extendActionArgs($item); that._deleteItemFromDS($item).done(function() { that._editStrategy.deleteItemAtIndex(index); that._simulateOptionChange(changingOption); that._updateSelectionAfterDelete(index); that._itemEventHandler($item, "onItemDeleted", deletedActionArgs, { beforeExecute: function() { $item.detach() }, excludeValidators: ["disabled", "readOnly"] }); that._renderEmptyMessage(); that._tryRefreshLastPage().done(function() { deferred.resolveWith(that) }) }).fail(function() { $item.removeClass(itemResponseWaitClass); deferred.rejectWith(that) }) }).fail(function() { deferred.rejectWith(that) }) } else { deferred.rejectWith(that) } return deferred.promise() }, reorderItem: function(itemElement, toItemElement) { var deferred = $.Deferred(), that = this, strategy = this._editStrategy, $movingItem = strategy.getItemElement(itemElement), $destinationItem = strategy.getItemElement(toItemElement), movingIndex = strategy.getNormalizedIndex(itemElement), destinationIndex = strategy.getNormalizedIndex(toItemElement), changingOption = this._dataSource ? "dataSource" : "items"; var canMoveItems = movingIndex > -1 && destinationIndex > -1 && movingIndex !== destinationIndex; if (canMoveItems) { deferred.resolveWith(this) } else { deferred.rejectWith(this) } return deferred.promise().done(function() { $destinationItem[strategy.itemPlacementFunc(movingIndex, destinationIndex)]($movingItem); var newSelectedItems = strategy.getSelectedItemsAfterReorderItem(movingIndex, destinationIndex); strategy.moveItemAtIndexToIndex(movingIndex, destinationIndex); that._selectedItemIndices = strategy.selectedItemIndices(newSelectedItems); that.option("selectedItems", strategy.fetchSelectedItems()); if ("items" === changingOption) { that._simulateOptionChange(changingOption) } that._itemEventHandler($movingItem, "onItemReordered", { fromIndex: strategy.getIndex(movingIndex), toIndex: strategy.getIndex(destinationIndex) }, { excludeValidators: ["disabled", "readOnly"] }) }) } }); module.exports = CollectionWidget }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*******************************!*\ !*** ./Scripts/data/utils.js ***! \*******************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), toComparable = __webpack_require__( /*! ../core/utils/data */ 16).toComparable; var normalizeBinaryCriterion = function(crit) { return [crit[0], crit.length < 3 ? "=" : String(crit[1]).toLowerCase(), crit.length < 2 ? true : crit[crit.length - 1]] }; var normalizeSortingInfo = function(info) { if (!$.isArray(info)) { info = [info] } return $.map(info, function(i) { return { selector: $.isFunction(i) || "string" === typeof i ? i : i.getter || i.field || i.selector, desc: !!(i.desc || "d" === String(i.dir).charAt(0).toLowerCase()) } }) }; var errorMessageFromXhr = function() { var textStatusMessages = { timeout: "Network connection timeout", error: "Unspecified network error", parsererror: "Unexpected server response" }; var textStatusDetails = { timeout: "possible causes: the remote host is not accessible, overloaded or is not included into the domain white-list when being run in the native container", error: "if the remote host is located on another domain, make sure it properly supports cross-origin resource sharing (CORS), or use the JSONP approach instead", parsererror: "the remote host did not respond with valid JSON data" }; var explainTextStatus = function(textStatus) { var result = textStatusMessages[textStatus]; if (!result) { return textStatus } result += " (" + textStatusDetails[textStatus] + ")"; return result }; return function(xhr, textStatus) { if (xhr.status < 400) { return explainTextStatus(textStatus) } return xhr.statusText } }(); var aggregators = { count: { seed: 0, step: function(count) { return 1 + count } }, sum: { seed: 0, step: function(sum, item) { return sum + item } }, min: { step: function(min, item) { return item < min ? item : min } }, max: { step: function(max, item) { return item > max ? item : max } }, avg: { seed: [0, 0], step: function(pair, value) { return [pair[0] + value, pair[1] + 1] }, finalize: function(pair) { return pair[1] ? pair[0] / pair[1] : NaN } } }; var processRequestResultLock = function() { var lockDeferred, lockCount = 0; var obtain = function() { if (0 === lockCount) { lockDeferred = $.Deferred() } lockCount++ }; var release = function() { lockCount--; if (lockCount < 1) { lockDeferred.resolve() } }; var promise = function() { var deferred = 0 === lockCount ? $.Deferred().resolve() : lockDeferred; return deferred.promise() }; var reset = function() { lockCount = 0; if (lockDeferred) { lockDeferred.resolve() } }; return { obtain: obtain, release: release, promise: promise, reset: reset } }(); function isDisjunctiveOperator(condition) { return /^(or|\|\||\|)$/i.test(condition) } function isConjunctiveOperator(condition) { return /^(and|\&\&|\&)$/i.test(condition) } var keysEqual = function(keyExpr, key1, key2) { if ($.isArray(keyExpr)) { var name, names = $.map(key1, function(v, k) { return k }); for (var i = 0; i < names.length; i++) { name = names[i]; if (toComparable(key1[name], true) != toComparable(key2[name], true)) { return false } } return true } return toComparable(key1, true) == toComparable(key2, true) }; var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var base64_encode = function(input) { if (!$.isArray(input)) { input = stringToByteArray(String(input)) } var result = ""; function getBase64Char(index) { return BASE64_CHARS.charAt(index) } for (var i = 0; i < input.length; i += 3) { var octet1 = input[i], octet2 = input[i + 1], octet3 = input[i + 2]; result += $.map([octet1 >> 2, (3 & octet1) << 4 | octet2 >> 4, isNaN(octet2) ? 64 : (15 & octet2) << 2 | octet3 >> 6, isNaN(octet3) ? 64 : 63 & octet3], getBase64Char).join("") } return result }; var stringToByteArray = function(str) { var code, i, bytes = []; for (i = 0; i < str.length; i++) { code = str.charCodeAt(i); if (code < 128) { bytes.push(code) } else { if (code < 2048) { bytes.push(192 + (code >> 6), 128 + (63 & code)) } else { if (code < 65536) { bytes.push(224 + (code >> 12), 128 + (code >> 6 & 63), 128 + (63 & code)) } else { if (code < 2097152) { bytes.push(240 + (code >> 18), 128 + (code >> 12 & 63), 128 + (code >> 6 & 63), 128 + (63 & code)) } } } } } return bytes }; var utils = { normalizeBinaryCriterion: normalizeBinaryCriterion, normalizeSortingInfo: normalizeSortingInfo, errorMessageFromXhr: errorMessageFromXhr, aggregators: aggregators, keysEqual: keysEqual, isDisjunctiveOperator: isDisjunctiveOperator, isConjunctiveOperator: isConjunctiveOperator, processRequestResultLock: processRequestResultLock, base64_encode: base64_encode }; module.exports = utils }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************************!*\ !*** ./Scripts/core/utils/inflector.js ***! \*****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1); var _normalize = function(text) { if (void 0 === text || null === text) { return "" } return String(text) }; var _ucfirst = function(text) { return _normalize(text).charAt(0).toUpperCase() + text.substr(1) }; var _chop = function(text) { return _normalize(text).replace(/([a-z\d])([A-Z])/g, "$1 $2").split(/[\s_-]+/) }; var dasherize = function(text) { return $.map(_chop(text), function(p) { return p.toLowerCase() }).join("-") }; var underscore = function(text) { return dasherize(text).replace(/-/g, "_") }; var camelize = function(text, upperFirst) { return $.map(_chop(text), function(p, i) { p = p.toLowerCase(); if (upperFirst || i > 0) { p = _ucfirst(p) } return p }).join("") }; var humanize = function(text) { return _ucfirst(dasherize(text).replace(/-/g, " ")) }; var titleize = function(text) { return $.map(_chop(text), function(p) { return _ucfirst(p.toLowerCase()) }).join(" ") }; var captionize = function(name) { var i, char, captionList = [], isPrevCharNewWord = false, isNewWord = false; for (i = 0; i < name.length; i++) { char = name.charAt(i); isNewWord = char === char.toUpperCase() || char in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]; if ("_" === char || "." === char) { char = " "; isNewWord = true } else { if (0 === i) { char = char.toUpperCase(); isNewWord = true } else { if (!isPrevCharNewWord && isNewWord) { if (captionList.length > 0) { captionList.push(" ") } } } } captionList.push(char); isPrevCharNewWord = isNewWord } return captionList.join("") }; exports.dasherize = dasherize; exports.camelize = camelize; exports.humanize = humanize; exports.titleize = titleize; exports.underscore = underscore; exports.captionize = captionize }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************!*\ !*** ./Scripts/core/utils/object.js ***! \**************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ./common */ 2); var clone = function() { function Clone() {} return function(obj) { Clone.prototype = obj; return new Clone } }(); var extendFromObject = function(target, source, overrideExistingValues) { target = target || {}; for (var prop in source) { if (source.hasOwnProperty(prop)) { var value = source[prop]; if (!(prop in target) || overrideExistingValues) { target[prop] = value } } } return target }; var orderEach = function(map, func) { var key, i, keys = []; for (key in map) { if (map.hasOwnProperty(key)) { keys.push(key) } } keys.sort(function(x, y) { var isNumberX = commonUtils.isNumber(x), isNumberY = commonUtils.isNumber(y); if (isNumberX && isNumberY) { return x - y } if (isNumberX && !isNumberY) { return -1 } if (!isNumberX && isNumberY) { return 1 } if (x < y) { return -1 } if (x > y) { return 1 } return 0 }); for (i = 0; i < keys.length; i++) { key = keys[i]; func(key, map[key]) } }; var deepExtendArraySafe = function(target, changes) { var prevValue, newValue; for (var name in changes) { prevValue = target[name]; newValue = changes[name]; if (target === newValue) { continue } if ($.isPlainObject(newValue) && !(newValue instanceof $.Event)) { target[name] = deepExtendArraySafe($.isPlainObject(prevValue) ? prevValue : {}, newValue) } else { if (void 0 !== newValue) { target[name] = newValue } } } return target }; exports.clone = clone; exports.extendFromObject = extendFromObject; exports.orderEach = orderEach; exports.deepExtendArraySafe = deepExtendArraySafe }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************!*\ !*** ./Scripts/ui/editor/editor.js ***! \*************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), themes = __webpack_require__( /*! ../themes */ 23), Widget = __webpack_require__( /*! ../widget/ui.widget */ 19), ValidationMixin = __webpack_require__( /*! ../validation/validation_mixin */ 132), Overlay = __webpack_require__( /*! ../overlay */ 49); var READONLY_STATE_CLASS = "dx-state-readonly", INVALID_CLASS = "dx-invalid", INVALID_MESSAGE = "dx-invalid-message", INVALID_MESSAGE_AUTO = "dx-invalid-message-auto", INVALID_MESSAGE_ALWAYS = "dx-invalid-message-always", VALIDATION_TARGET = "dx-validation-target", VALIDATION_MESSAGE_MIN_WIDTH = 100; var Editor = Widget.inherit({ _init: function() { this.callBase(); this.validationRequest = $.Callbacks(); var $element = this.element(); if ($element) { $.data($element[0], VALIDATION_TARGET, this) } }, _getDefaultOptions: function() { return $.extend(this.callBase(), { value: null, onValueChanged: null, readOnly: false, isValid: true, validationError: null, validationMessageMode: "auto", validationBoundary: void 0, validationMessageOffset: { h: 0, v: 0 } }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function() { var currentTheme = (themes.current() || "").split(".")[0]; return "android5" === currentTheme }, options: { validationMessageOffset: { v: -8 } } }]) }, _attachKeyboardEvents: function() { if (this.option("readOnly")) { return } this.callBase(); this._attachChildKeyboardEvents() }, _attachChildKeyboardEvents: $.noop, _setOptionsByReference: function() { this.callBase(); $.extend(this._optionsByReference, { validationError: true }) }, _createValueChangeAction: function() { this._valueChangeAction = this._createActionByOption("onValueChanged", { excludeValidators: ["disabled", "readOnly"] }) }, _suppressValueChangeAction: function() { this._valueChangeActionSuppressed = true }, _resumeValueChangeAction: function() { this._valueChangeActionSuppressed = false }, _render: function() { this.callBase(); this._renderValidationState(); this._toggleReadOnlyState() }, _raiseValueChangeAction: function(value, previousValue, extraArguments) { if (!this._valueChangeAction) { this._createValueChangeAction() } this._valueChangeAction(this._valueChangeArgs(value, previousValue)) }, _valueChangeArgs: function(value, previousValue) { return { value: value, previousValue: previousValue, jQueryEvent: this._valueChangeEventInstance } }, _saveValueChangeEvent: function(e) { this._valueChangeEventInstance = e }, _renderValidationState: function() { var isValid = this.option("isValid"), validationError = this.option("validationError"), validationMessageMode = this.option("validationMessageMode"), $element = this.element(); $element.toggleClass(INVALID_CLASS, !isValid); this.setAria("invalid", !isValid || void 0); if (this._$validationMessage) { this._$validationMessage.remove(); this._$validationMessage = null } if (!isValid && validationError && validationError.message) { this._$validationMessage = $("
", { "class": INVALID_MESSAGE }).html(validationError.message).appendTo($element); this._validationMessage = this._createComponent(this._$validationMessage, Overlay, { target: this._getValidationMessageTarget(), shading: false, width: "auto", height: "auto", container: $element, position: this._getValidationMessagePosition("below"), closeOnOutsideClick: false, closeOnTargetScroll: false, animation: null, visible: true, propagateOutsideClick: true }); this._$validationMessage.toggleClass(INVALID_MESSAGE_AUTO, "auto" === validationMessageMode).toggleClass(INVALID_MESSAGE_ALWAYS, "always" === validationMessageMode); this._setValidationMessageMaxWidth() } }, _setValidationMessageMaxWidth: function() { if (!this._validationMessage) { return } var validationMessageMaxWidth = Math.max(VALIDATION_MESSAGE_MIN_WIDTH, this._getValidationMessageTarget().outerWidth()); this._validationMessage.option("maxWidth", validationMessageMaxWidth) }, _getValidationMessageTarget: function() { return this.element() }, _getValidationMessagePosition: function(positionRequest) { var rtlEnabled = this.option("rtlEnabled"), messagePositionSide = commonUtils.getDefaultAlignment(rtlEnabled), messageOriginalOffset = this.option("validationMessageOffset"), messageOffset = { h: messageOriginalOffset.h, v: messageOriginalOffset.v }, verticalPositions = "below" === positionRequest ? [" top", " bottom"] : [" bottom", " top"]; if (rtlEnabled) { messageOffset.h = -messageOffset.h } if ("below" !== positionRequest) { messageOffset.v = -messageOffset.v } return { offset: messageOffset, boundary: this.option("validationBoundary"), my: messagePositionSide + verticalPositions[0], at: messagePositionSide + verticalPositions[1], collision: "none flip" } }, _toggleReadOnlyState: function() { this.element().toggleClass(READONLY_STATE_CLASS, this.option("readOnly")); this.setAria("readonly", this.option("readOnly") || void 0) }, _dispose: function() { var element = this.element()[0]; $.data(element, VALIDATION_TARGET, null); this.callBase() }, _optionChanged: function(args) { switch (args.name) { case "onValueChanged": this._createValueChangeAction(); break; case "isValid": case "validationError": case "validationBoundary": case "validationMessageMode": this._renderValidationState(); break; case "readOnly": this._toggleReadOnlyState(); this._refreshFocusState(); break; case "value": if (!this._valueChangeActionSuppressed) { this._raiseValueChangeAction(args.value, args.previousValue); this._saveValueChangeEvent(void 0) } if (args.value != args.previousValue) { this.validationRequest.fire({ value: args.value, editor: this }) } break; case "width": this.callBase(args); this._setValidationMessageMaxWidth(); break; default: this.callBase(args) } }, reset: function() { this.option("value", null) } }).include(ValidationMixin); module.exports = Editor }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************!*\ !*** ./Scripts/core/events_mixin.js ***! \**************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1); module.exports = { ctor: function() { this._events = {} }, hasEvent: function(eventName) { var callbacks = this._events[eventName]; if (callbacks) { return callbacks.has() } return false }, fireEvent: function(eventName, eventArgs) { var callbacks = this._events[eventName]; if (callbacks) { callbacks.fireWith(this, eventArgs) } return this }, on: function(eventName, eventHandler) { if ($.isPlainObject(eventName)) { $.each(eventName, $.proxy(function(e, h) { this.on(e, h) }, this)) } else { var addFn, callbacks = this._events[eventName]; if (!callbacks) { callbacks = $.Callbacks(); this._events[eventName] = callbacks } addFn = callbacks.originalAdd || callbacks.add; addFn.call(callbacks, eventHandler) } return this }, off: function(eventName, eventHandler) { var callbacks = this._events[eventName]; if (callbacks) { if ($.isFunction(eventHandler)) { callbacks.remove(eventHandler) } else { callbacks.empty() } } return this }, _disposeEvents: function() { $.each(this._events, function() { this.empty() }) } } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!******************************!*\ !*** ./Scripts/core/guid.js ***! \******************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var Class = __webpack_require__( /*! ./class */ 5); var Guid = Class.inherit({ ctor: function(value) { if (value) { value = String(value) } this._value = this._normalize(value || this._generate()) }, _normalize: function(value) { value = value.replace(/[^a-f0-9]/gi, "").toLowerCase(); while (value.length < 32) { value += "0" } return [value.substr(0, 8), value.substr(8, 4), value.substr(12, 4), value.substr(16, 4), value.substr(20, 12)].join("-") }, _generate: function() { var value = ""; for (var i = 0; i < 32; i++) { value += Math.round(15 * Math.random()).toString(16) } return value }, toString: function() { return this._value }, valueOf: function() { return this._value }, toJSON: function() { return this._value } }); module.exports = Guid }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*******************************!*\ !*** ./Scripts/data/query.js ***! \*******************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), arrayQueryImpl = __webpack_require__( /*! ./array_query */ 201), remoteQueryImpl = __webpack_require__( /*! ./remote_query */ 273); var queryImpl = { array: arrayQueryImpl, remote: remoteQueryImpl }; var query = function() { var impl = $.isArray(arguments[0]) ? "array" : "remote"; return queryImpl[impl].apply(this, arguments) }; module.exports = query; module.exports.queryImpl = queryImpl }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!********************************!*\ !*** ./Scripts/core/config.js ***! \********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), config = { rtlEnabled: false, defaultCurrency: "USD", designMode: false }; module.exports = function() { if (!arguments.length) { return config } $.extend(config, arguments[0]) } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************!*\ !*** ./Scripts/core/utils/console.js ***! \***************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1); var logger = function() { var console = window.console; function info(text) { if (!console || !$.isFunction(console.info)) { return } console.info(text) } function warn(text) { if (!console || !$.isFunction(console.warn)) { return } console.warn(text) } function error(text) { if (!console || !$.isFunction(console.error)) { return } console.error(text) } return { info: info, warn: warn, error: error } }(); var debug = function() { function assert(condition, message) { if (!condition) { throw new Error(message) } } function assertParam(parameter, message) { assert(null !== parameter && void 0 !== parameter, message) } return { assert: assert, assertParam: assertParam } }(); exports.logger = logger; exports.debug = debug }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************************!*\ !*** ./Scripts/data/data_source/data_source.js ***! \*************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../../core/class */ 5), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), dataUtils = __webpack_require__( /*! ../utils */ 28), Store = __webpack_require__( /*! ../abstract_store */ 50), ArrayStore = __webpack_require__( /*! ../array_store */ 58), CustomStore = __webpack_require__( /*! ../custom_store */ 202), EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 32), errors = __webpack_require__( /*! ../errors */ 25).errors, array = __webpack_require__( /*! ../../core/utils/array */ 41), queue = __webpack_require__( /*! ../../core/utils/queue */ 143), __isString = commonUtils.isString, __isNumber = commonUtils.isNumber, __isBoolean = commonUtils.isBoolean, __isDefined = commonUtils.isDefined; var CANCELED_TOKEN = "canceled"; function OperationManager() { this._counter = -1; this._deferreds = {} } OperationManager.prototype.constructor = OperationManager; OperationManager.prototype.add = function(deferred) { this._counter += 1; this._deferreds[this._counter] = deferred; return this._counter }; OperationManager.prototype.remove = function(operationId) { return delete this._deferreds[operationId] }; OperationManager.prototype.cancel = function(operationId) { if (operationId in this._deferreds) { this._deferreds[operationId].reject(CANCELED_TOKEN); return true } return false }; var operationManager = new OperationManager; function isPending(deferred) { return "pending" === deferred.state() } function normalizeDataSourceOptions(options) { var store; function createCustomStoreFromLoadFunc() { var storeConfig = {}; $.each(["useDefaultSearch", "key", "load", "byKey", "lookup", "totalCount", "insert", "update", "remove"], function() { storeConfig[this] = options[this]; delete options[this] }); return new CustomStore(storeConfig) } function createStoreFromConfig(storeConfig) { var alias = storeConfig.type; delete storeConfig.type; return Store.create(alias, storeConfig) } function createCustomStoreFromUrl(url) { return new CustomStore({ load: function() { return $.getJSON(url) } }) } if ("string" === typeof options) { options = { paginate: false, store: createCustomStoreFromUrl(options) } } if (void 0 === options) { options = [] } if ($.isArray(options) || options instanceof Store) { options = { store: options } } else { options = $.extend({}, options) } if (void 0 === options.store) { options.store = [] } store = options.store; if ("load" in options) { store = createCustomStoreFromLoadFunc() } else { if ($.isArray(store)) { store = new ArrayStore(store) } else { if ($.isPlainObject(store)) { store = createStoreFromConfig($.extend({}, store)) } } } options.store = store; return options } function normalizeStoreLoadOptionAccessorArguments(originalArguments) { switch (originalArguments.length) { case 0: return; case 1: return originalArguments[0] } return $.makeArray(originalArguments) } function generateStoreLoadOptionAccessor(optionName) { return function() { var args = normalizeStoreLoadOptionAccessorArguments(arguments); if (void 0 === args) { return this._storeLoadOptions[optionName] } this._storeLoadOptions[optionName] = args } } function mapDataRespectingGrouping(items, mapper, groupInfo) { function mapRecursive(items, level) { if (!commonUtils.isArray(items)) { return items } return level ? mapGroup(items, level) : $.map(items, mapper) } function mapGroup(group, level) { return $.map(group, function(item) { var result = { key: item.key, items: mapRecursive(item.items, level - 1) }; if ("aggregates" in item) { result.aggregates = item.aggregates } return result }) } return mapRecursive(items, groupInfo ? dataUtils.normalizeSortingInfo(groupInfo).length : 0) } var DataSource = Class.inherit({ ctor: function(options) { var that = this; options = normalizeDataSourceOptions(options); this._store = options.store; this._storeLoadOptions = this._extractLoadOptions(options); this._mapFunc = options.map; this._postProcessFunc = options.postProcess; this._pageIndex = void 0 !== options.pageIndex ? options.pageIndex : 0; this._pageSize = void 0 !== options.pageSize ? options.pageSize : 20; this._loadingCount = 0; this._loadQueue = this._createLoadQueue(); this._searchValue = "searchValue" in options ? options.searchValue : null; this._searchOperation = options.searchOperation || "contains"; this._searchExpr = options.searchExpr; this._paginate = options.paginate; $.each(["onChanged", "onLoadError", "onLoadingChanged", "onCustomizeLoadResult", "onCustomizeStoreLoadOptions"], function(_, optionName) { if (optionName in options) { that.on(optionName.substr(2, 1).toLowerCase() + optionName.substr(3), options[optionName]) } }); this._init() }, _init: function() { this._items = []; this._userData = {}; this._totalCount = -1; this._isLoaded = false; if (!__isDefined(this._paginate)) { this._paginate = !this.group() } this._isLastPage = !this._paginate }, dispose: function() { this._disposeEvents(); delete this._store; if (this._delayedLoadTask) { this._delayedLoadTask.abort() } this._disposed = true }, _extractLoadOptions: function(options) { var result = {}, names = ["sort", "filter", "select", "group", "requireTotalCount"], customNames = this._store._customLoadOptions(); if (customNames) { names = names.concat(customNames) } $.each(names, function() { result[this] = options[this] }); return result }, loadOptions: function() { return this._storeLoadOptions }, items: function() { return this._items }, pageIndex: function(newIndex) { if (!__isNumber(newIndex)) { return this._pageIndex } this._pageIndex = newIndex; this._isLastPage = !this._paginate }, paginate: function(value) { if (!__isBoolean(value)) { return this._paginate } if (this._paginate !== value) { this._paginate = value; this.pageIndex(0) } }, pageSize: function(value) { if (!__isNumber(value)) { return this._pageSize } this._pageSize = value }, isLastPage: function() { return this._isLastPage }, sort: generateStoreLoadOptionAccessor("sort"), filter: function() { var newFilter = normalizeStoreLoadOptionAccessorArguments(arguments); if (void 0 === newFilter) { return this._storeLoadOptions.filter } this._storeLoadOptions.filter = newFilter; this.pageIndex(0) }, group: generateStoreLoadOptionAccessor("group"), select: generateStoreLoadOptionAccessor("select"), requireTotalCount: function(value) { if (!__isBoolean(value)) { return this._storeLoadOptions.requireTotalCount } this._storeLoadOptions.requireTotalCount = value }, searchValue: function(value) { if (arguments.length < 1) { return this._searchValue } this._searchValue = value; this.pageIndex(0) }, searchOperation: function(op) { if (!__isString(op)) { return this._searchOperation } this._searchOperation = op; this.pageIndex(0) }, searchExpr: function(expr) { var argc = arguments.length; if (0 === argc) { return this._searchExpr } if (argc > 1) { expr = $.makeArray(arguments) } this._searchExpr = expr; this.pageIndex(0) }, store: function() { return this._store }, key: function() { return this._store && this._store.key() }, totalCount: function() { return this._totalCount }, isLoaded: function() { return this._isLoaded }, isLoading: function() { return this._loadingCount > 0 }, _createLoadQueue: function() { return queue.create() }, _changeLoadingCount: function(increment) { var newLoading, oldLoading = this.isLoading(); this._loadingCount += increment; newLoading = this.isLoading(); if (oldLoading ^ newLoading) { this.fireEvent("loadingChanged", [newLoading]) } }, _scheduleLoadCallbacks: function(deferred) { var that = this; that._changeLoadingCount(1); deferred.always(function() { that._changeLoadingCount(-1) }) }, _scheduleFailCallbacks: function(deferred) { var that = this; deferred.fail(function() { if (arguments[0] === CANCELED_TOKEN) { return } that.fireEvent("loadError", arguments) }) }, _scheduleChangedCallbacks: function(deferred) { var that = this; deferred.done(function() { that.fireEvent("changed") }) }, loadSingle: function(propName, propValue) { var that = this; var d = $.Deferred(), key = this.key(), store = this._store, options = this._createStoreLoadOptions(), handleDone = function(data) { if (!__isDefined(data) || array.isEmpty(data)) { d.reject(new errors.Error("E4009")) } else { d.resolve(that._applyMapFunction($.makeArray(data))[0]) } }; this._scheduleFailCallbacks(d); if (arguments.length < 2) { propValue = propName; propName = key } delete options.skip; delete options.group; delete options.refresh; delete options.pageIndex; delete options.searchString; (function() { if (propName === key || store instanceof CustomStore) { return store.byKey(propValue, options) } options.take = 1; options.filter = options.filter ? [options.filter, [propName, propValue]] : [propName, propValue]; return store.load(options) })().fail(d.reject).done(handleDone); return d.promise() }, load: function() { var loadOperation, that = this, d = $.Deferred(); function loadTask() { if (that._disposed) { return } if (!isPending(d)) { return } return that._loadFromStore(loadOperation, d) } this._scheduleLoadCallbacks(d); this._scheduleFailCallbacks(d); this._scheduleChangedCallbacks(d); loadOperation = this._createLoadOperation(d); this.fireEvent("customizeStoreLoadOptions", [loadOperation]); this._loadQueue.add(function() { if ("number" === typeof loadOperation.delay) { that._delayedLoadTask = commonUtils.executeAsync(loadTask, loadOperation.delay) } else { loadTask() } return d.promise() }); return d.promise({ operationId: loadOperation.operationId }) }, _createLoadOperation: function(deferred) { var id = operationManager.add(deferred), options = this._createStoreLoadOptions(); deferred.always(function() { operationManager.remove(id) }); return { operationId: id, storeLoadOptions: options } }, reload: function() { this._init(); return this.load() }, cancel: function(operationId) { return operationManager.cancel(operationId) }, _addSearchOptions: function(storeLoadOptions) { if (this._disposed) { return } if (this.store()._useDefaultSearch) { this._addSearchFilter(storeLoadOptions) } else { storeLoadOptions.searchOperation = this._searchOperation; storeLoadOptions.searchValue = this._searchValue; storeLoadOptions.searchExpr = this._searchExpr } }, _createStoreLoadOptions: function() { var result = $.extend({}, this._storeLoadOptions); this._addSearchOptions(result); if (this._paginate) { if (this._pageSize) { result.skip = this._pageIndex * this._pageSize; result.take = this._pageSize } } result.userData = this._userData; return result }, _addSearchFilter: function(storeLoadOptions) { var value = this._searchValue, op = this._searchOperation, selector = this._searchExpr, searchFilter = []; if (!value) { return } if (!selector) { selector = "this" } if (!$.isArray(selector)) { selector = [selector] } $.each(selector, function(i, item) { if (searchFilter.length) { searchFilter.push("or") } searchFilter.push([item, op, value]) }); if (storeLoadOptions.filter) { storeLoadOptions.filter = [searchFilter, storeLoadOptions.filter] } else { storeLoadOptions.filter = searchFilter } }, _loadFromStore: function(loadOptions, pendingDeferred) { var that = this; function handleSuccess(data, extra) { function processResult() { var loadResult; if (data && !$.isArray(data) && data.data) { extra = data; data = data.data } loadResult = $.extend({ data: data, extra: extra }, loadOptions); that.fireEvent("customizeLoadResult", [loadResult]); $.when(loadResult.data).done(function(data) { loadResult.data = data; that._processStoreLoadResult(loadResult, pendingDeferred) }).fail(pendingDeferred.reject) } if (that._disposed) { return } if (!isPending(pendingDeferred)) { return } processResult() } if (loadOptions.data) { return $.Deferred().resolve(loadOptions.data).done(handleSuccess) } return this.store().load(loadOptions.storeLoadOptions).done(handleSuccess).fail(pendingDeferred.reject) }, _processStoreLoadResult: function(loadResult, pendingDeferred) { var that = this; var data = $.makeArray(loadResult.data), extra = loadResult.extra, storeLoadOptions = loadResult.storeLoadOptions; function resolvePendingDeferred() { that._isLoaded = true; that._totalCount = isFinite(extra.totalCount) ? extra.totalCount : -1; return pendingDeferred.resolve(data, extra) } function proceedLoadingTotalCount() { that.store().totalCount(storeLoadOptions).done(function(count) { extra.totalCount = count; resolvePendingDeferred() }).fail(pendingDeferred.reject) } if (that._disposed) { return } data = that._applyPostProcessFunction(that._applyMapFunction(data)); if (!$.isPlainObject(extra)) { extra = {} } that._items = data; if (!data.length || !that._paginate || that._pageSize && data.length < that._pageSize) { that._isLastPage = true } if (storeLoadOptions.requireTotalCount && !isFinite(extra.totalCount)) { proceedLoadingTotalCount() } else { resolvePendingDeferred() } }, _applyMapFunction: function(data) { if (this._mapFunc) { return mapDataRespectingGrouping(data, this._mapFunc, this.group()) } return data }, _applyPostProcessFunction: function(data) { if (this._postProcessFunc) { return this._postProcessFunc(data) } return data } }).include(EventsMixin); exports.DataSource = DataSource; exports.normalizeDataSourceOptions = normalizeDataSourceOptions }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************************!*\ !*** ./Scripts/localization/number.js ***! \****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 80), errors = __webpack_require__( /*! ../core/errors */ 10); var MAX_LARGE_NUMBER_POWER = 4, DECIMAL_BASE = 10; var NUMERIC_FORMATS = ["currency", "fixedpoint", "exponential", "percent", "decimal"]; var LargeNumberFormatPostfixes = { 1: "K", 2: "M", 3: "B", 4: "T" }; var LargeNumberFormatPowers = { largenumber: "auto", thousands: 1, millions: 2, billions: 3, trillions: 4 }; var numberLocalization = dependencyInjector({ numericFormats: NUMERIC_FORMATS, defaultLargeNumberFormatPostfixes: LargeNumberFormatPostfixes, _parseNumberFormatString: function(formatType) { var formatList, formatObject = {}; if (!formatType || "string" !== typeof formatType) { return } formatList = formatType.split(" "); $.each(formatList, function(index, value) { if ($.inArray(value, NUMERIC_FORMATS) > -1) { formatObject.formatType = value } else { if (value in LargeNumberFormatPowers) { formatObject.power = LargeNumberFormatPowers[value] } } }); if (formatObject.power && !formatObject.formatType) { formatObject.formatType = "fixedpoint" } if (formatObject.formatType) { return formatObject } }, _calculateNumberPower: function(value, base, minPower, maxPower) { var number = Math.abs(value), power = 0; if (number > 1) { while (number && number >= base && (void 0 === maxPower || power < maxPower)) { power++; number /= base } } else { if (number > 0 && number < 1) { while (number < 1 && (void 0 === minPower || power > minPower)) { power--; number *= base } } } return power }, _getNumberByPower: function(number, power, base) { var result = number; while (power > 0) { result /= base; power-- } while (power < 0) { result *= base; power++ } return result }, _formatNumber: function(value, formatObject, formatConfig) { var powerPostfix; if ("auto" === formatObject.power) { formatObject.power = this._calculateNumberPower(value, 1e3, 0, MAX_LARGE_NUMBER_POWER) } if (formatObject.power) { value = this._getNumberByPower(value, formatObject.power, 1e3) } powerPostfix = this.defaultLargeNumberFormatPostfixes[formatObject.power] || ""; return this._formatNumberCore(value, formatObject.formatType, formatConfig) + powerPostfix }, _formatNumberExponential: function(value, formatConfig) { var powString, power = this._calculateNumberPower(value, DECIMAL_BASE), number = this._getNumberByPower(value, power, DECIMAL_BASE); if (void 0 === formatConfig.precision) { formatConfig.precision = 1 } if (number.toFixed(formatConfig.precision || 0) >= DECIMAL_BASE) { power++; number /= DECIMAL_BASE } powString = (power >= 0 ? "+" : "") + power.toString(); return this._formatNumberCore(number, "fixedpoint", formatConfig) + "E" + powString }, _addZeroes: function(value, precision) { var multiplier = Math.pow(10, precision); value = (value * multiplier >>> 0) / multiplier; var result = value.toString(); while (result.length < precision) { result = "0" + result } return result }, _addGroupSeparators: function(value) { var parts = value.toString().split("."); return parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") + (parts[1] ? "." + parts[1] : "") }, _formatNumberCore: function(value, format, formatConfig) { if ("exponential" === format) { return this._formatNumberExponential(value, formatConfig) } if ("percent" === format) { formatConfig.precision = formatConfig.precision || 0; value = 100 * value } if (void 0 !== formatConfig.precision) { if ("decimal" === format) { value = this._addZeroes(value, formatConfig.precision) } else { value = value.toFixed(formatConfig.precision) } } if ("decimal" !== format) { value = this._addGroupSeparators(value) } if ("percent" === format) { value += "%" } return value.toString() }, _normalizeFormat: function(format) { if (!format) { return {} } if ("function" === typeof format) { return format } if (!$.isPlainObject(format)) { format = { type: format } } if (format.type) { format.type = format.type.toLowerCase() } return format }, format: function(value, format) { if ("number" !== typeof value) { return value } if ("number" === typeof format) { return value } format = format && format.formatter || format; if ("function" === typeof format) { return format(value) } format = this._normalizeFormat(format); if (!format.type) { format.type = "decimal" } var numberConfig = this._parseNumberFormatString(format.type); if (!numberConfig) { return } return this._formatNumber(value, numberConfig, format) }, parse: function(text, format) { if (!text) { return } if (format && format.parser) { return format.parser(text) } if (format) { errors.log("W0011") } return parseFloat(text.replace(/^\D+|,+/g, "")) } }); module.exports = numberLocalization }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************!*\ !*** ./Scripts/core/dom_component.js ***! \***************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), config = __webpack_require__( /*! ./config */ 35), errors = __webpack_require__( /*! ./errors */ 10), windowResizeCallbacks = __webpack_require__( /*! ./utils/window */ 57).resizeCallbacks, commonUtils = __webpack_require__( /*! ./utils/common */ 2), publicComponentUtils = __webpack_require__( /*! ./utils/public_component */ 142), Component = __webpack_require__( /*! ./component */ 92), abstract = Component.abstract; var RTL_DIRECTION_CLASS = "dx-rtl", VISIBILITY_CHANGE_CLASS = "dx-visibility-change-handler", VISIBILITY_CHANGE_EVENTNAMESPACE = "VisibilityChange"; var DOMComponent = Component.inherit({ _getDefaultOptions: function() { return $.extend(this.callBase(), { width: void 0, height: void 0, rtlEnabled: config().rtlEnabled, disabled: false }) }, ctor: function(element, options) { this._$element = $(element); publicComponentUtils.attachInstanceToElement(this._$element, this.constructor.publicName(), this, this._dispose); this.callBase(options) }, _visibilityChanged: abstract, _dimensionChanged: abstract, _init: function() { this.callBase(); this._attachWindowResizeCallback() }, _attachWindowResizeCallback: function() { if (this._isDimensionChangeSupported()) { var windowResizeCallBack = this._windowResizeCallBack = $.proxy(this._dimensionChanged, this); windowResizeCallbacks.add(windowResizeCallBack) } }, _isDimensionChangeSupported: function() { return this._dimensionChanged !== abstract }, _render: function() { this._toggleRTLDirection(this.option("rtlEnabled")); this._renderVisibilityChange(); this._renderDimensions() }, _renderVisibilityChange: function() { if (this._isDimensionChangeSupported()) { this._attachDimensionChangeHandlers() } if (!this._isVisibilityChangeSupported()) { return } this.element().addClass(VISIBILITY_CHANGE_CLASS); this._attachVisibilityChangeHandlers() }, _renderDimensions: function() { var width = this.option("width"), height = this.option("height"), $element = this.element(); $element.outerWidth(width); $element.outerHeight(height) }, _attachDimensionChangeHandlers: function() { var that = this; var resizeEventName = "dxresize." + this.NAME + VISIBILITY_CHANGE_EVENTNAMESPACE; that.element().off(resizeEventName).on(resizeEventName, function() { that._dimensionChanged() }) }, _attachVisibilityChangeHandlers: function() { var that = this; var hidingEventName = "dxhiding." + this.NAME + VISIBILITY_CHANGE_EVENTNAMESPACE; var shownEventName = "dxshown." + this.NAME + VISIBILITY_CHANGE_EVENTNAMESPACE; that._isHidden = !that._isVisible(); that.element().off(hidingEventName).on(hidingEventName, function() { that._checkVisibilityChanged("hiding") }).off(shownEventName).on(shownEventName, function() { that._checkVisibilityChanged("shown") }) }, _isVisible: function() { return this.element().is(":visible") }, _checkVisibilityChanged: function(event) { if ("hiding" === event && this._isVisible() && !this._isHidden) { this._visibilityChanged(false); this._isHidden = true } else { if ("shown" === event && this._isVisible() && this._isHidden) { this._isHidden = false; this._visibilityChanged(true) } } }, _isVisibilityChangeSupported: function() { return this._visibilityChanged !== abstract }, _clean: $.noop, _modelByElement: function() { var modelByElement = this.option("modelByElement") || $.noop; return modelByElement(this.element()) }, _invalidate: function() { if (!this._updateLockCount) { throw errors.Error("E0007") } this._requireRefresh = true }, _refresh: function() { this._clean(); this._render() }, _dispose: function() { this.callBase(); this._clean(); this._detachWindowResizeCallback() }, _detachWindowResizeCallback: function() { if (this._isDimensionChangeSupported()) { windowResizeCallbacks.remove(this._windowResizeCallBack) } }, _toggleRTLDirection: function(rtl) { this.element().toggleClass(RTL_DIRECTION_CLASS, rtl) }, _createComponent: function(element, component, config) { var that = this; config = config || {}; var synchronizableOptions = $.grep(["rtlEnabled", "disabled"], function(value) { return !(value in config) }); var nestedComponentOptions = that.option("nestedComponentOptions") || $.noop; that._extendConfig(config, $.extend({ rtlEnabled: this.option("rtlEnabled"), disabled: this.option("disabled") }, nestedComponentOptions(this))); var instance; if (commonUtils.isString(component)) { var $element = $(element)[component](config); instance = $element[component]("instance") } else { if (element) { instance = component.getInstance(element); if (instance) { instance.option(config) } else { instance = new component(element, config) } } } if (instance) { var optionChangedHandler = function(args) { if ($.inArray(args.name, synchronizableOptions) >= 0) { instance.option(args.name, args.value) } }; that.on("optionChanged", optionChangedHandler); instance.on("disposing", function() { that.off("optionChanged", optionChangedHandler) }) } return instance }, _extendConfig: function(config, extendConfig) { $.each(extendConfig, function(key, value) { config[key] = config.hasOwnProperty(key) ? config[key] : value }) }, _defaultActionConfig: function() { return $.extend(this.callBase(), { context: this._modelByElement(this.element()) }) }, _defaultActionArgs: function() { var element = this.element(), model = this._modelByElement(this.element()); return $.extend(this.callBase(), { element: element, model: model }) }, _optionChanged: function(args) { switch (args.name) { case "width": case "height": this._renderDimensions(); break; case "rtlEnabled": this._invalidate(); break; case "disabled": break; default: this.callBase(args) } }, endUpdate: function() { var requireRender = !this._initializing && !this._initialized; this.callBase.apply(this, arguments); if (!this._updateLockCount) { if (requireRender) { this._render() } else { if (this._requireRefresh) { this._requireRefresh = false; this._refresh() } } } }, element: function() { return this._$element } }); DOMComponent.getInstance = function($element) { return publicComponentUtils.getInstanceByElement($element, this.publicName()) }; DOMComponent.defaultOptions = function(rule) { this.prototype._customRules = this.prototype._customRules || []; this.prototype._customRules.push(rule) }; module.exports = DOMComponent }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************!*\ !*** external "window.ko" ***! \****************************/ function(module, exports) { module.exports = window.ko }, /*!*************************************!*\ !*** ./Scripts/core/utils/array.js ***! \*************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ./common */ 2), objectUtils = __webpack_require__( /*! ./object */ 30); var isEmpty = function(entity) { return $.isArray(entity) && !entity.length }; var wrapToArray = function(entity) { return $.isArray(entity) ? entity : [entity] }; var intersection = function(a, b) { if (!$.isArray(a) || 0 === a.length || !$.isArray(b) || 0 === b.length) { return [] } var result = []; $.each(a, function(_, value) { var index = $.inArray(value, b); if (-1 !== index) { result.push(value) } }); return result }; var removeDuplicates = function(from, what) { if (!$.isArray(from) || 0 === from.length) { return [] } if (!$.isArray(what) || 0 === what.length) { return from.slice() } var result = []; $.each(from, function(_, value) { var index = $.inArray(value, what); if (-1 === index) { result.push(value) } }); return result }; var normalizeIndexes = function(items, indexParameterName, currentItem, needIndexCallback) { var indexedItems = {}, parameterIndex = 0; $.each(items, function(index, item) { index = item[indexParameterName]; if (commonUtils.isDefined(index)) { indexedItems[index] = indexedItems[index] || []; if (item === currentItem) { indexedItems[index].unshift(item) } else { indexedItems[index].push(item) } delete item[indexParameterName] } }); objectUtils.orderEach(indexedItems, function(index, items) { $.each(items, function() { if (index >= 0) { this[indexParameterName] = parameterIndex++ } }) }); $.each(items, function() { if (!commonUtils.isDefined(this[indexParameterName]) && (!needIndexCallback || needIndexCallback(this))) { this[indexParameterName] = parameterIndex++ } }); return parameterIndex }; exports.isEmpty = isEmpty; exports.wrapToArray = wrapToArray; exports.intersection = intersection; exports.removeDuplicates = removeDuplicates; exports.normalizeIndexes = normalizeIndexes }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************************************!*\ !*** ./Scripts/ui/grid_core/ui.grid_core.utils.js ***! \****************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), LoadPanel = __webpack_require__( /*! ../load_panel */ 170); var DATAGRID_NODATA_TEXT_CLASS = "dx-datagrid-nodata", DATAGRID_INDICATOR_ALIGNMENT_CLASS = "dx-indicator-alignment-", DATAGRID_COLUMN_INDICATORS_CLASS = "dx-column-indicators", DATAGRID_GROUP_PANEL_ITEM_CLASS = "dx-group-panel-item"; exports.renderNoDataText = function($element) { var that = this; $element = $element || this.element(); var noDataElement = $element.find("." + DATAGRID_NODATA_TEXT_CLASS), isVisible = this._dataController.isEmpty(), isLoading = this._dataController.isLoading(), rtlEnabled = this.option("rtlEnabled"); if (!noDataElement.length) { noDataElement = $("").addClass(DATAGRID_NODATA_TEXT_CLASS).appendTo($element) } if (isVisible && !isLoading) { noDataElement.removeClass("dx-hidden").text(that._getNoDataText()); commonUtils.deferUpdate(function() { var noDataHeight = noDataElement.height(), noDataWidth = noDataElement.width(); commonUtils.deferRender(function() { noDataElement.css({ marginTop: -Math.floor(noDataHeight / 2), marginRight: rtlEnabled ? -Math.floor(noDataWidth / 2) : 0, marginLeft: rtlEnabled ? 0 : -Math.floor(noDataWidth / 2) }) }) }) } else { noDataElement.addClass("dx-hidden") } }; exports.renderLoadPanel = function($element, $container, isLocalStore) { var loadPanelOptions, that = this; that._loadPanel && that._loadPanel.element().remove(); loadPanelOptions = that.option("loadPanel"); if (loadPanelOptions && ("auto" === loadPanelOptions.enabled ? !isLocalStore : loadPanelOptions.enabled)) { loadPanelOptions = $.extend({ shading: false, message: loadPanelOptions.text, position: { of: $element }, container: $element }, loadPanelOptions); that._loadPanel = that._createComponent($("
").appendTo($container), LoadPanel, loadPanelOptions) } else { that._loadPanel = null } }; exports.columnStateMixin = { _applyColumnState: function(options) { var that = this, rtlEnabled = this.option("rtlEnabled"), columnAlignment = that._getColumnAlignment(options.column.alignment, rtlEnabled), parameters = $.extend(true, { columnAlignment: columnAlignment }, options), isGroupPanelItem = parameters.rootElement.hasClass(DATAGRID_GROUP_PANEL_ITEM_CLASS), $indicatorsContainer = that._createIndicatorContainer(parameters, isGroupPanelItem), $span = $("").addClass(that._getIndicatorClassName(options.name)), getIndicatorAlignment = function() { if (rtlEnabled) { return "left" === columnAlignment ? "right" : "left" } return columnAlignment }; parameters.container = $indicatorsContainer; parameters.indicator = $span; that._renderIndicator(parameters); $indicatorsContainer[(isGroupPanelItem || !options.showColumnLines) && "left" === getIndicatorAlignment() ? "appendTo" : "prependTo"](options.rootElement).addClass(DATAGRID_INDICATOR_ALIGNMENT_CLASS + columnAlignment); return $span }, _getIndicatorClassName: $.noop, _getColumnAlignment: function(alignment, rtlEnabled) { rtlEnabled = rtlEnabled || this.option("rtlEnabled"); return "center" !== alignment ? alignment : commonUtils.getDefaultAlignment(rtlEnabled) }, _createIndicatorContainer: function(options, ignoreIndicatorAlignment) { var $indicatorsContainer = options.rootElement.find("." + DATAGRID_COLUMN_INDICATORS_CLASS), indicatorAlignment = "left" === options.columnAlignment ? "right" : "left"; if (!$indicatorsContainer.length) { $indicatorsContainer = $("
").addClass(DATAGRID_COLUMN_INDICATORS_CLASS) } return $indicatorsContainer.css("float", options.showColumnLines && !ignoreIndicatorAlignment ? indicatorAlignment : null) }, _getIndicatorContainer: function($cell) { return $cell && $cell.find("." + DATAGRID_COLUMN_INDICATORS_CLASS) }, _renderIndicator: function(options) { var $container = options.container, $indicator = options.indicator; $container && $indicator && $container.append($indicator) }, _updateIndicators: function(indicatorName) { var $cell, i, that = this, columns = that.getColumns(), $cells = that.getColumnElements(); for (i = 0; i < columns.length; i++) { $cell = $cells.eq(i); that._updateIndicator($cell, columns[i], indicatorName) } }, _updateIndicator: function($cell, column, indicatorName) { if (!column.command) { return this._applyColumnState({ name: indicatorName, rootElement: $cell, column: column, showColumnLines: this.option("showColumnLines") }) } } }; var MAX_EQUAL_KEYS_LEVEL = 3; exports.equalKeys = function(key1, key2, level) { var propertyName, i; level = level || 0; if (level < MAX_EQUAL_KEYS_LEVEL) { if (commonUtils.isObject(key1) && commonUtils.isObject(key2)) { for (propertyName in key1) { if (key1.hasOwnProperty(propertyName) && !exports.equalKeys(key1[propertyName], key2[propertyName], level + 1)) { return false } } for (propertyName in key2) { if (!(propertyName in key1)) { return false } } return true } else { if (commonUtils.isArray(key1) && commonUtils.isArray(key2)) { if (key1.length !== key2.length) { return false } for (i = 0; i < key1.length; i++) { if (!exports.equalKeys(key1[i], key2[i], level + 1)) { return false } } return true } else { if (commonUtils.isDate(key1) && commonUtils.isDate(key2)) { return key1.getTime() === key2.getTime() } else { return key1 === key2 } } } } return true }; exports.getIndexByKey = function(key, items, keyName) { var item, index = -1; if (commonUtils.isArray(items)) { keyName = arguments.length <= 2 ? "key" : keyName; for (var i = 0; i < items.length; i++) { item = commonUtils.isDefined(keyName) ? items[i][keyName] : items[i]; if (exports.equalKeys(key, item)) { index = i; break } } } return index }; exports.exportMixin = { _getEmptyCell: function() { return { text: "", value: void 0, colspan: 1, rowspan: 1 } }, _defaultSetter: function(value) { value = parseInt(value, 10); return !value ? 1 : value }, _makeRowOffset: function(resultItems) { var offset = 0, rowIndex = resultItems.length - 1, row = resultItems[rowIndex], cellIndex = row.length; $.each(resultItems, function(rowIndex) { if (this[cellIndex] && this[cellIndex].rowspan + rowIndex > resultItems.length - 1) { offset = Math.max.apply(this, [this[cellIndex].colspan, offset]) } }); for (var i = 0; i < offset; i++) { row.push(this._cloneItem(resultItems[resultItems.length - 2][cellIndex && cellIndex - 1 || 0])) } if (offset > 0) { this._makeRowOffset(resultItems) } }, _cloneItem: function(item) { return $.extend({}, item, this._getEmptyCell()) }, _prepareItems: function(cols, items) { var i, row, cellIndex, rowIndex, that = this, resultItems = []; for (rowIndex = 0; rowIndex < items.length; rowIndex++) { row = []; resultItems.push(row); do { that._makeRowOffset(resultItems); cellIndex = row.length; row.push(items[rowIndex].shift()); if (row[row.length - 1]) { row[row.length - 1].colspan = that._defaultSetter(row[row.length - 1].colspan); row[row.length - 1].rowspan = that._defaultSetter(row[row.length - 1].rowspan) } else { row[row.length - 1] = $({}, that._getEmptyCell()) } for (i = 1; i < row[cellIndex].colspan; i++) { row.push(that._cloneItem(row[row.length - 1])) } } while (items[rowIndex].length); while (row.length < cols) { row.push(that._cloneItem(row[row.length - 1])) } } return resultItems } } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************************!*\ !*** ./Scripts/events/core/event_registrator.js ***! \**************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), MemorizedCallbacks = __webpack_require__( /*! ../../core/memorized_callbacks */ 140); var eventNS = $.event, hooksNS = eventNS.fixHooks, specialNS = $.event.special; var DX_EVENT_HOOKS = { props: eventNS.mouseHooks.props.concat(["pointerType", "pointerId", "pointers"]) }; var callbacks = new MemorizedCallbacks; var registerEvent = function(name, eventObject) { var strategy = {}; if ("noBubble" in eventObject) { strategy.noBubble = eventObject.noBubble } if ("bindType" in eventObject) { strategy.bindType = eventObject.bindType } if ("delegateType" in eventObject) { strategy.delegateType = eventObject.delegateType } $.each(["setup", "teardown", "add", "remove", "trigger", "handle", "_default", "dispose"], function(_, methodName) { if (!eventObject[methodName]) { return } strategy[methodName] = function() { var args = $.makeArray(arguments); args.unshift(this); return eventObject[methodName].apply(eventObject, args) } }); hooksNS[name] = DX_EVENT_HOOKS; callbacks.fire(name, strategy) }; registerEvent.callbacks = callbacks; var registerJQueryEvent = function(name, eventObject) { specialNS[name] = eventObject }; callbacks.add(registerJQueryEvent); module.exports = registerEvent }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************!*\ !*** ./Scripts/framework/errors.js ***! \*************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var errorUtils = __webpack_require__( /*! ../core/utils/error */ 94), errors = __webpack_require__( /*! ../core/errors */ 10); module.exports = errorUtils(errors.ERROR_MESSAGES, { E3001: "Routing rule is not found for the '{0}' URI.", E3002: "The passed object cannot be formatted into a URI string by the application's router. An appropriate route should be registered.", E3003: "Unable to navigate. Application is being initialized.", E3004: "Cannot execute the command: {0}.", E3005: "The '{0}' command {1} is not registered in the application's command mapping. Go to http://dxpr.es/1bTjfj1 for more details.", E3006: "Unknown navigation target: '{0}'. Use the 'current', 'back' or 'blank' values.", E3007: "Error while restoring the application state. The state has been cleared. Refresh the page.", E3008: "Unable to go back.", E3009: "Unable to go forward.", E3010: "The command's 'id' option should be specified.\r\nProcessed markup: {0}\n", E3011: "Layout controller cannot be resolved. There are no appropriate layout controllers for the current context. Check browser console for details.", E3012: "Layout controller cannot be resolved. Two or more layout controllers suit the current context. Check browser console for details.", E3013: "The '{0}' template with the '{1}' name is not found. Make sure the case is correct in the specified view name and the template fits the current context.", E3014: "All the children of the dxView element should be either of the dxCommand or dxContent type.\r\nProcessed markup: {0}", E3015: "The 'exec' method should be called before the 'finalize' method.", E3016: "Unknown transition type '{0}'.", E3018: "Unable to parse options.\nMessage: {0};\nOptions value: {1}.", E3019: "View templates should be updated according to the 13.1 changes. Go to http://dxpr.es/15ikrJA for more details.", E3020: "Concurrent templates are found:\r\n{0}Target device:\r\n{1}.", E3021: "Remote template cannot be loaded.\r\nUrl:{0}\r\nError:{1}.", E3022: "Cannot initialize the HtmlApplication component.", E3023: "Navigation item is not found", E3024: "Layout controller is not initialized", W3001: "A view with the '{0}' key doesn't exist.", W3002: "A view with the '{0}' key has already been released.", W3003: "Layout resolving context:\n{0}\nAvailable layout controller registrations:\n{1}\n", W3004: "Layout resolving context:\n{0}\nConcurent layout controller registrations for the context:\n{1}\n", W3005: 'Direct hash-based navigation is detected in a mobile application. Use data-bind="dxAction: url" instead of href="#url" to avoid navigation issues.\nFound markup:\n{0}\n' }) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**********************************************************!*\ !*** ./Scripts/framework/html/view_engine_components.js ***! \**********************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var errors = __webpack_require__( /*! ../errors */ 44), domUtils = __webpack_require__( /*! ../../core/utils/dom */ 11), registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 3), MarkupComponent = __webpack_require__( /*! ./markup_component */ 149).MarkupComponent; __webpack_require__( /*! ../../integration/knockout */ 85); var View = MarkupComponent.inherit({ _setDefaultOptions: function() { this.callBase(); this.option({ name: null, title: null }) }, ctor: function() { this._id = domUtils.uniqueId(); this.callBase.apply(this, arguments) }, _render: function() { this.callBase(); this.element().addClass("dx-view"); this.element().attr("dx-data-template-id", this._id) }, getId: function() { return this._id } }); var Layout = MarkupComponent.inherit({ _setDefaultOptions: function() { this.callBase(); this.option({ name: null }) }, _render: function() { this.callBase(); this.element().addClass("dx-layout") } }); var ViewPlaceholder = MarkupComponent.inherit({ _setDefaultOptions: function() { this.callBase(); this.option({ viewName: null }) }, _render: function() { this.callBase(); this.element().addClass("dx-view-placeholder") } }); var setupTransitionElement = function($element, transitionType, transitionName, contentCssPosition) { if ("absolute" === contentCssPosition) { $element.addClass("dx-transition-absolute") } else { $element.addClass("dx-transition-static") } $element.addClass("dx-transition").addClass("dx-transition-" + transitionName).addClass("dx-transition-" + transitionType).attr("data-dx-transition-type", transitionType).attr("data-dx-transition-name", transitionName) }; var setupTransitionInnerElement = function($element) { $element.addClass("dx-transition-inner-wrapper") }; var Transition = MarkupComponent.inherit({ _setDefaultOptions: function() { this.callBase(); this.option({ name: null, type: void 0, animation: "slide" }) }, _render: function() { this.callBase(); var element = this.element(); setupTransitionElement(element, this.option("type") || this.option("animation"), this.option("name"), "absolute"); element.wrapInner("
"); setupTransitionInnerElement(element.children()); if (this.option("type")) { errors.log("W0003", "dxTransition", "type", "15.1", "Use the 'animation' property instead") } }, _clean: function() { this.callBase(); this.element().empty() } }); var ContentPlaceholder = MarkupComponent.inherit({ _setDefaultOptions: function() { this.callBase(); this.option({ name: null, transition: void 0, animation: "none", contentCssPosition: "absolute" }) }, _render: function() { this.callBase(); var $element = this.element(); $element.addClass("dx-content-placeholder").addClass("dx-content-placeholder-" + this.option("name")); $element.attr("data-dx-content-placeholder-name", this.option("name")); setupTransitionElement($element, this.option("transition") || this.option("animation"), this.option("name"), this.option("contentCssPosition")); if (this.option("transition")) { errors.log("W0003", "dxContentPlaceholder", "transition", "15.1", "Use the 'animation' property instead") } } }); var Content = MarkupComponent.inherit({ _setDefaultOptions: function() { this.callBase(); this.option({ targetPlaceholder: null }) }, _optionChanged: function() { this._refresh() }, _clean: function() { this.callBase(); this.element().removeClass(this._currentClass) }, _render: function() { this.callBase(); var element = this.element(); element.addClass("dx-content"); this._currentClass = "dx-content-" + this.option("targetPlaceholder"); element.attr("data-dx-target-placeholder-id", this.option("targetPlaceholder")); element.addClass(this._currentClass); setupTransitionInnerElement(element) } }); registerComponent("dxView", View); registerComponent("dxLayout", Layout); registerComponent("dxViewPlaceholder", ViewPlaceholder); registerComponent("dxContentPlaceholder", ContentPlaceholder); registerComponent("dxTransition", Transition); registerComponent("dxContent", Content); exports.dxView = View; exports.dxLayout = Layout; exports.dxViewPlaceholder = ViewPlaceholder; exports.dxContentPlaceholder = ContentPlaceholder; exports.dxTransition = Transition; exports.dxContent = Content }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***********************************!*\ !*** external "window.Globalize" ***! \***********************************/ function(module, exports) { module.exports = window.Globalize }, /*!***********************************************!*\ !*** ./Scripts/ui/widget/ui.template_base.js ***! \***********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), triggerShownEvent = __webpack_require__( /*! ../../core/utils/dom */ 11).triggerShownEvent, Class = __webpack_require__( /*! ../../core/class */ 5), abstract = Class.abstract; var renderedCallbacks = $.Callbacks(); var TemplateBase = Class.inherit({ ctor: function(element, owner) { this._element = $(element); this._owner = owner }, owner: function() { return this._owner }, render: function(data, $container, index) { if (data instanceof $) { $container = data; data = void 0 } if ($container) { data = this._prepareDataForContainer(data, $container) } var $result = this._renderCore(data, index, $container); this._ensureResultInContainer($result, $container); renderedCallbacks.fire($result, $container); return $result }, _ensureResultInContainer: function($result, $container) { if (!$container) { return } var resultInContainer = $.contains($container.get(0), $result.get(0)); $container.append($result); if (resultInContainer) { return } var resultInBody = $.contains(document.body, $container.get(0)); if (!resultInBody) { return } triggerShownEvent($result) }, source: function() { return this._element.clone() }, _prepareDataForContainer: function(data) { return data }, _renderCore: abstract, dispose: function() { this._owner = null } }); module.exports = TemplateBase; module.exports.renderedCallbacks = renderedCallbacks }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***********************************************!*\ !*** ./Scripts/ui/widget/utils.ink_ripple.js ***! \***********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__( /*! jquery */ 1)], __WEBPACK_AMD_DEFINE_RESULT__ = function($) { var INKRIPPLE_CLASS = "dx-inkripple", INKRIPPLE_WAVE_CLASS = "dx-inkripple-wave", INKRIPPLE_SHOWING_CLASS = "dx-inkripple-showing", INKRIPPLE_HIDING_CLASS = "dx-inkripple-hiding"; var DEFAULT_WAVE_SIZE_COEFFICIENT = 2, MAX_WAVE_SIZE = 4e3, ANIMATION_DURATION = 300, HOLD_ANIMATION_DURATION = 1e3, DEFAULT_WAVE_INDEX = 0; var render = function(args) { args = args || {}; if (void 0 === args.useHoldAnimation) { args.useHoldAnimation = true } var config = { waveSizeCoefficient: args.waveSizeCoefficient || DEFAULT_WAVE_SIZE_COEFFICIENT, isCentered: args.isCentered || false, wavesNumber: args.wavesNumber || 1, durations: getDurations(args.useHoldAnimation) }; return { showWave: $.proxy(showWave, null, config), hideWave: $.proxy(hideWave, null, config) } }; var getInkRipple = function(element) { var result = element.children("." + INKRIPPLE_CLASS); if (0 === result.length) { result = $("
").addClass(INKRIPPLE_CLASS).appendTo(element) } return result }; var getWaves = function(element, wavesNumber) { var inkRipple = getInkRipple(element), result = inkRipple.children("." + INKRIPPLE_WAVE_CLASS); for (var i = result.length; i < wavesNumber; i++) { var $currentWave = $("
").appendTo(inkRipple).addClass(INKRIPPLE_WAVE_CLASS); result.push($currentWave[0]) } return result }; var getWaveStyleConfig = function(args, config) { var left, top, element = config.element, elementWidth = element.outerWidth(), elementHeight = element.outerHeight(), elementDiagonal = parseInt(Math.sqrt(elementWidth * elementWidth + elementHeight * elementHeight)), waveSize = Math.min(MAX_WAVE_SIZE, parseInt(elementDiagonal * args.waveSizeCoefficient)); if (args.isCentered) { left = (elementWidth - waveSize) / 2; top = (elementHeight - waveSize) / 2 } else { var event = config.jQueryEvent, position = config.element.offset(), x = event.pageX - position.left, y = event.pageY - position.top; left = x - waveSize / 2; top = y - waveSize / 2 } return { left: left, top: top, height: waveSize, width: waveSize } }; var showWave = function(args, config) { var $wave = getWaves(config.element, args.wavesNumber).eq(config.wave || DEFAULT_WAVE_INDEX); args.hidingTimeout && clearTimeout(args.hidingTimeout); hideSelectedWave($wave); $wave.css(getWaveStyleConfig(args, config)); setTimeout($.proxy(showingWaveHandler, null, args, $wave), 0) }; var showingWaveHandler = function(args, $wave) { var durationCss = args.durations.showingScale + "ms"; $wave.addClass(INKRIPPLE_SHOWING_CLASS).css("transition-duration", durationCss) }; var getDurations = function(useHoldAnimation) { return { showingScale: useHoldAnimation ? HOLD_ANIMATION_DURATION : ANIMATION_DURATION, hidingScale: ANIMATION_DURATION, hidingOpacity: ANIMATION_DURATION } }; var hideSelectedWave = function($wave) { $wave.removeClass(INKRIPPLE_HIDING_CLASS).css("transition-duration", "") }; var hideWave = function(args, config) { var $wave = getWaves(config.element, config.wavesNumber).eq(config.wave || DEFAULT_WAVE_INDEX), durations = args.durations, durationCss = durations.hidingScale + "ms, " + durations.hidingOpacity + "ms"; $wave.addClass(INKRIPPLE_HIDING_CLASS).removeClass(INKRIPPLE_SHOWING_CLASS).css("transition-duration", durationCss); var animationDuration = Math.max(durations.hidingScale, durations.hidingOpacity); args.hidingTimeout = setTimeout($.proxy(hideSelectedWave, null, $wave), animationDuration) }; return { render: render } }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*******************************!*\ !*** ./Scripts/ui/overlay.js ***! \*******************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), fx = __webpack_require__( /*! ../animation/fx */ 21), translator = __webpack_require__( /*! ../animation/translator */ 15), compareVersions = __webpack_require__( /*! ../core/utils/version */ 56).compare, viewPortUtils = __webpack_require__( /*! ../core/utils/view_port */ 52), viewPort = viewPortUtils.value, viewPortChanged = viewPortUtils.changeCallback, hideTopOverlayCallback = __webpack_require__( /*! ../mobile/hide_top_overlay */ 100).hideCallback, positionUtils = __webpack_require__( /*! ../animation/position */ 65), fitIntoRange = __webpack_require__( /*! ../core/utils/math */ 66).fitIntoRange, domUtils = __webpack_require__( /*! ../core/utils/dom */ 11), commonUtils = __webpack_require__( /*! ../core/utils/common */ 2), devices = __webpack_require__( /*! ../core/devices */ 7), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 3), Widget = __webpack_require__( /*! ./widget/ui.widget */ 19), KeyboardProcessor = __webpack_require__( /*! ./widget/ui.keyboard_processor */ 175), selectors = __webpack_require__( /*! ./widget/jquery.selectors */ 98), dragEvents = __webpack_require__( /*! ../events/drag */ 62), eventUtils = __webpack_require__( /*! ../events/utils */ 4), pointerEvents = __webpack_require__( /*! ../events/pointer */ 13), Resizable = __webpack_require__( /*! ./resizable */ 177); var OVERLAY_CLASS = "dx-overlay", OVERLAY_WRAPPER_CLASS = "dx-overlay-wrapper", OVERLAY_CONTENT_CLASS = "dx-overlay-content", OVERLAY_SHADER_CLASS = "dx-overlay-shader", OVERLAY_MODAL_CLASS = "dx-overlay-modal", INVISIBLE_STATE_CLASS = "dx-state-invisible", ANONYMOUS_TEMPLATE_NAME = "content", RTL_DIRECTION_CLASS = "dx-rtl", ACTIONS = ["onShowing", "onShown", "onHiding", "onHidden", "onPositioning", "onPositioned", "onResizeStart", "onResize", "onResizeEnd"], FIRST_Z_INDEX = 1500, OVERLAY_STACK = [], DISABLED_STATE_CLASS = "dx-state-disabled", TAB_KEY = 9; var realDevice = devices.real(), realVersion = realDevice.version, iOS = "ios" === realDevice.platform, iOS7_0andBelow = iOS && compareVersions(realVersion, [7, 1]) < 0, android4_0nativeBrowser = "android" === realDevice.platform && 0 === compareVersions(realVersion, [4, 0], 2) && -1 === navigator.userAgent.indexOf("Chrome"); var forceRepaint = function($element) { if (iOS7_0andBelow) { $element.width() } if (android4_0nativeBrowser) { var $parents = $element.parents(), inScrollView = $parents.is(".dx-scrollable-native"); if (!inScrollView) { $parents.css("backface-visibility", "hidden"); $parents.css("backface-visibility"); $parents.css("backface-visibility", "visible") } } }; var getElement = function(value) { return value && $(value instanceof $.Event ? value.target : value) }; $(document).on(pointerEvents.down, function(e) { for (var i = OVERLAY_STACK.length - 1; i >= 0; i--) { if (!OVERLAY_STACK[i]._proxiedDocumentDownHandler(e)) { return } } }); var Overlay = Widget.inherit({ _supportedKeys: function() { var offsetSize = 5, move = function(top, left, e) { if (!this.option("dragEnabled")) { return } e.preventDefault(); e.stopPropagation(); var allowedOffsets = this._allowedOffsets(); var offset = { top: fitIntoRange(top, -allowedOffsets.top, allowedOffsets.bottom), left: fitIntoRange(left, -allowedOffsets.left, allowedOffsets.right) }; this._changePosition(offset) }; return $.extend(this.callBase(), { escape: function(e) { this.hide() }, upArrow: $.proxy(move, this, -offsetSize, 0), downArrow: $.proxy(move, this, offsetSize, 0), leftArrow: $.proxy(move, this, 0, -offsetSize), rightArrow: $.proxy(move, this, 0, offsetSize) }) }, _getDefaultOptions: function() { return $.extend(this.callBase(), { activeStateEnabled: false, visible: false, deferRendering: true, shading: true, shadingColor: "", position: { my: "center", at: "center" }, width: function() { return .8 * $(window).width() }, minWidth: null, maxWidth: null, height: function() { return .8 * $(window).height() }, minHeight: null, maxHeight: null, animation: { show: { type: "pop", duration: 300, from: { scale: .55 } }, hide: { type: "pop", duration: 300, to: { opacity: 0, scale: .55 }, from: { opacity: 1, scale: 1 } } }, closeOnOutsideClick: false, closeOnBackButton: true, onShowing: null, onShown: null, onHiding: null, onHidden: null, contentTemplate: "content", dragEnabled: false, resizeEnabled: false, onResizeStart: null, onResize: null, onResizeEnd: null, onContentReady: null, target: void 0, container: void 0, hideTopOverlayHandler: void 0, closeOnTargetScroll: false, onPositioned: null, boundaryOffset: { h: 0, v: 0 }, propagateOutsideClick: false }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function(device) { var realDevice = devices.real(), realPlatform = realDevice.platform, realVersion = realDevice.version; return "android" === realPlatform && compareVersions(realVersion, [4, 2]) < 0 }, options: { animation: { show: { type: "fade", duration: 400 }, hide: { type: "fade", duration: 400, to: { opacity: 0 }, from: { opacity: 1 } } } } }]) }, _setOptionsByReference: function() { this.callBase(); $.extend(this._optionsByReference, { animation: true }) }, _getAnonymousTemplateName: function() { return ANONYMOUS_TEMPLATE_NAME }, _wrapper: function() { return this._$wrapper }, _container: function() { return this._$content }, _eventBindingTarget: function() { return this._$content }, _init: function() { this.callBase(); this._initActions(); this._initCloseOnOutsideClickHandler(); this._initTabTerminatorHandler(); this._$wrapper = $("
").addClass(OVERLAY_WRAPPER_CLASS); this._$content = $("
").addClass(OVERLAY_CONTENT_CLASS); var $element = this.element(); this._$wrapper.addClass($element.attr("class")); $element.addClass(OVERLAY_CLASS); this._$wrapper.attr("data-bind", "dxControlsDescendantBindings: true"); this._$wrapper.on("MSPointerDown", $.noop); this._$wrapper.on("focusin", function(e) { e.stopPropagation() }); this._toggleViewPortSubscription(true) }, _initOptions: function(options) { this._initTarget(options.target); this._initContainer(options.container); this._initHideTopOverlayHandler(options.hideTopOverlayHandler); this.callBase(options) }, _initTarget: function(target) { if (!commonUtils.isDefined(target)) { return } var options = this.option(); $.each(["position.of", "animation.show.from.position.of", "animation.show.to.position.of", "animation.hide.from.position.of", "animation.hide.to.position.of"], function(_, path) { var pathParts = path.split("."); var option = options; while (option) { if (1 === pathParts.length) { if ($.isPlainObject(option)) { option[pathParts.shift()] = target } break } else { option = option[pathParts.shift()] } } }) }, _initContainer: function(container) { container = void 0 === container ? viewPort() : container; var $element = this.element(), $container = $element.closest(container); if (!$container.length) { $container = $(container).first() } this._$container = $container.length ? $container : $element.parent() }, _initHideTopOverlayHandler: function(handler) { this._hideTopOverlayHandler = void 0 !== handler ? handler : $.proxy(this._defaultHideTopOverlayHandler, this) }, _defaultHideTopOverlayHandler: function() { this.hide() }, _initActions: function() { this._actions = {}; $.each(ACTIONS, $.proxy(function(_, action) { this._actions[action] = this._createActionByOption(action, { excludeValidators: ["disabled", "readOnly"] }) || $.noop }, this)) }, _initCloseOnOutsideClickHandler: function() { var that = this; this._proxiedDocumentDownHandler = function() { return that._documentDownHandler.apply(that, arguments) } }, _documentDownHandler: function(e) { if (this._showAnimationProcessing) { this._stopAnimation(); return } var closeOnOutsideClick = this.option("closeOnOutsideClick"); if ($.isFunction(closeOnOutsideClick)) { closeOnOutsideClick = closeOnOutsideClick(e) } if (closeOnOutsideClick) { var $container = this._$content, outsideClick = !$container.is(e.target) && !$.contains($container.get(0), e.target); if (outsideClick) { if (this.option("shading")) { e.preventDefault() } this.hide() } } return this.option("propagateOutsideClick") }, _isTopOverlay: function() { var overlayStack = this._overlayStack(); return overlayStack[overlayStack.length - 1] === this }, _overlayStack: function() { return OVERLAY_STACK }, _zIndexInitValue: function() { return FIRST_Z_INDEX }, _toggleViewPortSubscription: function(toggle) { viewPortChanged.remove(this._viewPortChangeHandle); if (toggle) { this._viewPortChangeHandle = $.proxy(this._viewPortChangeHandler, this); viewPortChanged.add(this._viewPortChangeHandle) } }, _viewPortChangeHandler: function() { this._initContainer(this.option("container")); this._refresh() }, _renderVisibilityAnimate: function(visible) { this._stopAnimation(); return visible ? this._show() : this._hide() }, _normalizePosition: function() { this._position = this.option("position") }, _getAnimationConfig: function() { var animation = this.option("animation"); if ($.isFunction(animation)) { animation = animation.call(this) } return animation }, _show: function() { var that = this, deferred = $.Deferred(); this._parentHidden = this._isParentHidden(); deferred.done(function() { delete that._parentHidden }); if (this._parentHidden) { return deferred.resolve() } if (this._currentVisible) { return $.when().promise() } this._currentVisible = true; this._normalizePosition(); var animation = that._getAnimationConfig() || {}, showAnimation = this._normalizeAnimation(animation.show, "to"), startShowAnimation = showAnimation && showAnimation.start || $.noop, completeShowAnimation = showAnimation && showAnimation.complete || $.noop; if (this._isHidingActionCanceled) { delete this._isHidingActionCanceled; deferred.resolve() } else { var show = function() { this._renderVisibility(true); this._animate(showAnimation, function() { if (that.option("focusStateEnabled")) { that._focusTarget().focus() } completeShowAnimation.apply(this, arguments); that._showAnimationProcessing = false; that._actions.onShown(); deferred.resolve() }, function() { startShowAnimation.apply(this, arguments); that._showAnimationProcessing = true }) }.bind(this); if (this.option("templatesRenderAsynchronously")) { this._asyncShowTimeout = setTimeout(show) } else { show() } } return deferred.promise() }, _normalizeAnimation: function(animation, prop) { if (animation && animation[prop]) { animation = $.extend({ type: "slide" }, animation); $.extend(animation[prop], { position: this._position }) } return animation }, _hide: function() { if (!this._currentVisible) { return $.when().promise() } this._currentVisible = false; var that = this, deferred = $.Deferred(), animation = that._getAnimationConfig() || {}, hideAnimation = this._normalizeAnimation(animation.hide, "from"), completeHideAnimation = hideAnimation && hideAnimation.complete || $.noop, hidingArgs = { cancel: false }; this._actions.onHiding(hidingArgs); if (hidingArgs.cancel) { this._isHidingActionCanceled = true; this.option("visible", true); deferred.resolve() } else { this._forceFocusLost(); this._toggleShading(false); this._toggleSubscriptions(false); this._animate(hideAnimation, function() { that._renderVisibility(false); completeHideAnimation.apply(this, arguments); that._actions.onHidden(); deferred.resolve() }) } return deferred.promise() }, _forceFocusLost: function() { document.activeElement && this._$content.find(document.activeElement).length && document.activeElement.blur() }, _animate: function(animation, completeCallback, startCallback) { if (animation) { startCallback = startCallback || animation.start || $.noop; var $content = this._$content; fx.animate(this._$content, $.extend({}, animation, { start: function() { $content.css("pointer-events", "none"); startCallback.apply(this, arguments) }, complete: function() { $content.css("pointer-events", ""); completeCallback.apply(this, arguments) } })) } else { completeCallback() } }, _stopAnimation: function() { fx.stop(this._$content, true) }, _renderVisibility: function(visible) { if (visible && this._isParentHidden()) { return } this._currentVisible = visible; this._stopAnimation(); clearTimeout(this._asyncShowTimeout); if (!visible) { domUtils.triggerHidingEvent(this._$content) } this._toggleVisibility(visible); this._$content.toggleClass(INVISIBLE_STATE_CLASS, !visible); this._updateZIndexStackPosition(visible); if (visible) { this._renderContent(); this._actions.onShowing(); this._moveToContainer(); this._renderGeometry(); domUtils.triggerShownEvent(this._$content); domUtils.triggerResizeEvent(this._$content) } else { this._moveFromContainer() } this._toggleShading(visible); this._toggleSubscriptions(visible) }, _updateZIndexStackPosition: function(pushToStack) { var overlayStack = this._overlayStack(), index = $.inArray(this, overlayStack); if (pushToStack) { if (-1 === index) { var length = overlayStack.length; this._zIndex = (length ? overlayStack[length - 1]._zIndex : this._zIndexInitValue()) + 1; overlayStack.push(this) } this._$wrapper.css("z-index", this._zIndex); this._$content.css("z-index", this._zIndex) } else { if (-1 !== index) { overlayStack.splice(index, 1) } } }, _toggleShading: function(visible) { this._$wrapper.toggleClass(OVERLAY_MODAL_CLASS, this.option("shading") && !this.option("container")); this._$wrapper.toggleClass(OVERLAY_SHADER_CLASS, visible && this.option("shading")); this._$wrapper.css("background-color", this.option("shading") ? this.option("shadingColor") : ""); this._toggleTabTerminator(visible && this.option("shading")) }, _initTabTerminatorHandler: function() { var that = this; this._proxiedTabTerminatorHandler = function() { that._tabKeyHandler.apply(that, arguments) } }, _toggleTabTerminator: function(enabled) { var eventName = eventUtils.addNamespace("keydown", this.NAME); if (enabled) { $(document).on(eventName, this._proxiedTabTerminatorHandler) } else { $(document).off(eventName, this._proxiedTabTerminatorHandler) } }, _tabKeyHandler: function(e) { if (e.keyCode !== TAB_KEY || !this._isTopOverlay()) { return } var tabbableElements = this._$wrapper.find(selectors.tabbable), $firstTabbable = tabbableElements.first(), $lastTabbable = tabbableElements.last(), isTabOnLast = !e.shiftKey && e.target === $lastTabbable.get(0), isShiftTabOnFirst = e.shiftKey && e.target === $firstTabbable.get(0), isEmptyTabList = 0 === tabbableElements.length, isOutsideTarget = -1 === $.inArray(e.target, tabbableElements); if (isTabOnLast || isShiftTabOnFirst || isEmptyTabList || isOutsideTarget) { e.preventDefault(); (e.shiftKey ? $lastTabbable : $firstTabbable).focusin().focus() } }, _toggleSubscriptions: function(enabled) { this._toggleHideTopOverlayCallback(enabled); this._toggleParentsScrollSubscription(enabled) }, _toggleHideTopOverlayCallback: function(subscribe) { if (!this._hideTopOverlayHandler) { return } if (subscribe && this.option("closeOnBackButton")) { hideTopOverlayCallback.add(this._hideTopOverlayHandler) } else { hideTopOverlayCallback.remove(this._hideTopOverlayHandler) } }, _toggleParentsScrollSubscription: function(subscribe) { if (!this._position) { return } var target = this._position.of || $(), closeOnScroll = this.option("closeOnTargetScroll"), $parents = getElement(target).parents(), scrollEvent = eventUtils.addNamespace("scroll", this.NAME); if ("generic" === devices.real().platform) { $parents = $parents.add(window) } this._proxiedTargetParentsScrollHandler = this._proxiedTargetParentsScrollHandler || $.proxy(function(e) { this._targetParentsScrollHandler(e) }, this); $().add(this._$prevTargetParents).off(scrollEvent, this._proxiedTargetParentsScrollHandler); if (subscribe && closeOnScroll) { $parents.on(scrollEvent, this._proxiedTargetParentsScrollHandler); this._$prevTargetParents = $parents } }, _targetParentsScrollHandler: function(e) { var closeHandled = false, closeOnScroll = this.option("closeOnTargetScroll"); if ($.isFunction(closeOnScroll)) { closeHandled = closeOnScroll(e) } if (!closeHandled && !this._showAnimationProcessing) { this.hide() } }, _render: function() { this.callBase(); this._$content.appendTo(this.element()); this._renderVisibilityAnimate(this.option("visible")) }, _renderContent: function() { var shouldDeferRendering = !this._currentVisible && this.option("deferRendering"); var isParentHidden = this.option("visible") && this._isParentHidden(); if (isParentHidden) { this._isHidden = true; return } if (this._contentAlreadyRendered || shouldDeferRendering) { return } this._contentAlreadyRendered = true; this.callBase() }, _isParentHidden: function() { if (void 0 !== this._parentHidden) { return this._parentHidden } var $parent = this.element().parent(); if ($parent.is(":visible")) { return false } var isHidden = false; $parent.add($parent.parents()).each(function() { var $element = $(this); if ("none" === $element.css("display")) { isHidden = true; return false } }); return isHidden || !$.contains(document, $parent.get(0)) }, _renderContentImpl: function() { var $element = this.element(); this._$content.appendTo($element); var contentTemplate = this._getTemplate(this.option("contentTemplate")); contentTemplate && contentTemplate.render(this.content()); this._renderDrag(); this._renderResize(); this._renderScrollTerminator() }, _renderDrag: function() { var $dragTarget = this._getDragTarget(); if (!$dragTarget) { return } var startEventName = eventUtils.addNamespace(dragEvents.start, this.NAME), updateEventName = eventUtils.addNamespace(dragEvents.move, this.NAME); $dragTarget.off(startEventName).off(updateEventName); if (!this.option("dragEnabled")) { return } $dragTarget.on(startEventName, $.proxy(this._dragStartHandler, this)).on(updateEventName, $.proxy(this._dragUpdateHandler, this)) }, _renderResize: function() { this._createComponent(this._$content, Resizable, { handles: this.option("resizeEnabled") ? "all" : "none", onResizeEnd: $.proxy(this._resizeEndHandler, this), onResize: $.proxy(this._actions.onResize, this), onResizeStart: $.proxy(this._actions.onResizeStart, this), minHeight: 100, minWidth: 100, area: this._$container }) }, _resizeEndHandler: function() { this._positionChangeHandled = true; this._dimensionChangeHandled = true; this._actions.onResizeEnd() }, _renderScrollTerminator: function() { var $scrollTerminator = this._wrapper(); var terminatorEventName = eventUtils.addNamespace(dragEvents.move, this.NAME); $scrollTerminator.off(terminatorEventName).on(terminatorEventName, { validate: function() { return true }, getDirection: function() { return "both" }, _toggleGestureCover: $.noop, _clearSelection: $.noop, isNative: true }, function(e) { if ("mousemove" !== e.originalEvent.originalEvent.type) { e.preventDefault() } }) }, _getDragTarget: function() { return this.content() }, _dragStartHandler: function(e) { e.targetElements = []; this._prevOffset = { x: 0, y: 0 }; var allowedOffsets = this._allowedOffsets(); e.maxTopOffset = allowedOffsets.top; e.maxBottomOffset = allowedOffsets.bottom; e.maxLeftOffset = allowedOffsets.left; e.maxRightOffset = allowedOffsets.right }, _deltaSize: function() { var $content = this._$content, $container = this._$container; var contentWidth = $content.outerWidth(), contentHeight = $content.outerHeight(), containerWidth = $container.width(), containerHeight = $container.height(); return { width: containerWidth - contentWidth, height: containerHeight - contentHeight } }, _dragUpdateHandler: function(e) { var offset = e.offset, prevOffset = this._prevOffset, targetOffset = { top: offset.y - prevOffset.y, left: offset.x - prevOffset.x }; this._changePosition(targetOffset); this._prevOffset = offset }, _changePosition: function(offset) { var position = translator.locate(this._$content); translator.move(this._$content, { left: position.left + offset.left, top: position.top + offset.top }); this._positionChangeHandled = true }, _allowedOffsets: function() { var position = translator.locate(this._$content), deltaSize = this._deltaSize(), isAllowedDrag = deltaSize.height >= 0 && deltaSize.width >= 0, boundaryOffset = this.option("boundaryOffset"); return { top: isAllowedDrag ? position.top + boundaryOffset.v : 0, bottom: isAllowedDrag ? -position.top + deltaSize.height - boundaryOffset.v : 0, left: isAllowedDrag ? position.left + boundaryOffset.h : 0, right: isAllowedDrag ? -position.left + deltaSize.width - boundaryOffset.h : 0 } }, _fireContentReadyAction: function() { if (this.option("visible")) { this._moveToContainer() } this.callBase.apply(this, arguments) }, _moveFromContainer: function() { this._$content.appendTo(this.element()); this._detachWrapperToContainer() }, _detachWrapperToContainer: function() { this._$wrapper.detach() }, _moveToContainer: function() { this._attachWrapperToContainer(); this._$content.appendTo(this._$wrapper) }, _attachWrapperToContainer: function() { var $element = this.element(); if (this._$container && this._$container[0] !== $element.parent()[0]) { this._$wrapper.appendTo(this._$container) } else { this._$wrapper.appendTo($element) } }, _renderGeometry: function() { if (this.option("visible")) { this._renderGeometryImpl() } }, _renderGeometryImpl: function() { this._stopAnimation(); this._normalizePosition(); this._renderShading(); this._renderDimensions(); var resultPosition = this._renderPosition(); this._actions.onPositioned({ position: resultPosition }) }, _renderShading: function() { var $wrapper = this._$wrapper, $container = this._getContainer(); $wrapper.css("position", this._isWindow($container) && !iOS ? "fixed" : "absolute"); this._renderShadingDimensions(); this._renderShadingPosition() }, _renderShadingPosition: function() { if (this.option("shading")) { var $container = this._getContainer(); positionUtils.setup(this._$wrapper, { my: "top left", at: "top left", of: $container }) } }, _renderShadingDimensions: function() { if (this.option("shading")) { var $container = this._getContainer(), wrapperWidth = this._isWindow($container) ? "100%" : $container.outerWidth(), wrapperHeight = this._isWindow($container) ? "100%" : $container.outerHeight(); this._$wrapper.css({ width: wrapperWidth, height: wrapperHeight }) } }, _isWindow: function($element) { return !!$element && $.isWindow($element.get(0)) }, _getContainer: function() { var position = this._position, container = this.option("container"), positionOf = position ? position.of || window : null; return getElement(container || positionOf) }, _renderDimensions: function() { this._$content.css({ minWidth: this.option("minWidth"), maxWidth: this.option("maxWidth"), minHeight: this.option("minHeight"), maxHeight: this.option("maxHeight") }); if (this._dimensionChangeHandled) { var $content = this._$content, $container = this._$container; $content.outerWidth(Math.min($content.outerWidth(), $container.width())).outerHeight(Math.min($content.outerHeight(), $container.height())) } else { this._$content.outerWidth(this.option("width")).outerHeight(this.option("height")) } }, _renderPosition: function() { if (this._positionChangeHandled) { var allowedOffsets = this._allowedOffsets(); this._changePosition({ top: fitIntoRange(0, -allowedOffsets.top, allowedOffsets.bottom), left: fitIntoRange(0, -allowedOffsets.left, allowedOffsets.right) }) } else { this._renderOverlayBoundaryOffset(); translator.resetPosition(this._$content); var resultPosition = positionUtils.setup(this._$content, this._position); forceRepaint(this._$content); this._actions.onPositioning(); return resultPosition } }, _renderOverlayBoundaryOffset: function() { var boundaryOffset = this.option("boundaryOffset"); this._$content.css("margin", boundaryOffset.v + "px " + boundaryOffset.h + "px") }, _focusTarget: function() { return this._$content }, _attachKeyboardEvents: function() { this._keyboardProcessor = new KeyboardProcessor({ element: this._$content, handler: this._keyboardHandler, context: this }) }, _keyboardHandler: function(options) { var e = options.originalEvent, $target = $(e.target); if ($target.is(this._$content)) { this.callBase.apply(this, arguments) } }, _isVisible: function() { return this.option("visible") }, _visibilityChanged: function(visible) { if (visible) { if (this.option("visible")) { this._renderVisibilityAnimate(visible) } } else { this._renderVisibilityAnimate(visible) } }, _dimensionChanged: function() { this._renderGeometry() }, _clean: function() { if (!this._contentAlreadyRendered) { this.content().empty() } this._renderVisibility(false); this._cleanFocusState() }, _dispose: function() { fx.stop(this._$content, false); clearTimeout(this._deferShowTimer); this._toggleViewPortSubscription(false); this._toggleSubscriptions(false); this._updateZIndexStackPosition(false); this._toggleTabTerminator(false); this._actions = null; this.callBase(); this._$wrapper.remove(); this._$content.remove() }, _toggleDisabledState: function(value) { this.callBase.apply(this, arguments); this._$content.toggleClass(DISABLED_STATE_CLASS, Boolean(value)) }, _toggleRTLDirection: function(rtl) { this._$content.toggleClass(RTL_DIRECTION_CLASS, rtl) }, _optionChanged: function(args) { var value = args.value; if ($.inArray(args.name, ACTIONS) > -1) { this._initActions(); return } switch (args.name) { case "dragEnabled": this._renderDrag(); this._renderGeometry(); break; case "resizeEnabled": this._renderResize(); this._renderGeometry(); break; case "shading": case "shadingColor": this._toggleShading(this.option("visible")); break; case "width": case "minWidth": case "maxWidth": case "height": case "minHeight": case "maxHeight": case "position": case "boundaryOffset": this._renderGeometry(); break; case "visible": this._renderVisibilityAnimate(value).done($.proxy(function() { if (!this._animateDeferred) { return } this._animateDeferred.resolveWith(this) }, this)); break; case "target": this._initTarget(value); this._invalidate(); break; case "container": this._initContainer(value); this._invalidate(); break; case "deferRendering": case "contentTemplate": this._contentAlreadyRendered = false; this._invalidate(); break; case "closeOnBackButton": this._toggleHideTopOverlayCallback(this.option("visible")); break; case "closeOnTargetScroll": this._toggleParentsScrollSubscription(this.option("visible")); break; case "closeOnOutsideClick": case "animation": case "propagateOutsideClick": break; default: this.callBase(args) } }, toggle: function(showing) { showing = void 0 === showing ? !this.option("visible") : showing; if (showing === this.option("visible")) { return $.Deferred().resolve().promise() } var animateDeferred = $.Deferred(); this._animateDeferred = animateDeferred; this.option("visible", showing); return animateDeferred.promise().done($.proxy(function() { delete this._animateDeferred }, this)) }, show: function() { return this.toggle(true) }, hide: function() { return this.toggle(false) }, content: function() { return this._$content }, repaint: function() { this._renderGeometry() } }); Overlay.baseZIndex = function(zIndex) { FIRST_Z_INDEX = zIndex }; registerComponent("dxOverlay", Overlay); module.exports = Overlay }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************************!*\ !*** ./Scripts/data/abstract_store.js ***! \****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../core/class */ 5), abstract = Class.abstract, EventsMixin = __webpack_require__( /*! ../core/events_mixin */ 32), errorsModule = __webpack_require__( /*! ./errors */ 25), dataUtils = __webpack_require__( /*! ./utils */ 28), normalizeSortingInfo = dataUtils.normalizeSortingInfo, compileGetter = __webpack_require__( /*! ../core/utils/data */ 16).compileGetter, Query = __webpack_require__( /*! ./query */ 34), storeImpl = {}; function multiLevelGroup(query, groupInfo) { query = query.groupBy(groupInfo[0].selector); if (groupInfo.length > 1) { query = query.select(function(g) { return $.extend({}, g, { items: multiLevelGroup(Query(g.items), groupInfo.slice(1)).toArray() }) }) } return query } function arrangeSortingInfo(groupInfo, sortInfo) { var filteredGroup = []; $.each(groupInfo, function(_, group) { var collision = $.grep(sortInfo, function(sort) { return group.selector === sort.selector }); if (collision.length < 1) { filteredGroup.push(group) } }); return filteredGroup.concat(sortInfo) } var Store = Class.inherit({ ctor: function(options) { var that = this; options = options || {}; $.each(["onLoaded", "onLoading", "onInserted", "onInserting", "onUpdated", "onUpdating", "onRemoved", "onRemoving", "onModified", "onModifying"], function(_, optionName) { if (optionName in options) { that.on(optionName.slice(2).toLowerCase(), options[optionName]) } }); this._key = options.key; this._errorHandler = options.errorHandler; this._useDefaultSearch = true }, _customLoadOptions: function() { return null }, key: function() { return this._key }, keyOf: function(obj) { if (!this._keyGetter) { this._keyGetter = compileGetter(this.key()) } return this._keyGetter(obj) }, _requireKey: function() { if (!this.key()) { throw errorsModule.errors.Error("E4005") } }, load: function(options) { var that = this; options = options || {}; this.fireEvent("loading", [options]); return this._withLock(this._loadImpl(options)).done(function(result, extra) { that.fireEvent("loaded", [result, options]) }) }, _loadImpl: function(options) { var filter = options.filter, sort = options.sort, select = options.select, group = options.group, skip = options.skip, take = options.take, q = this.createQuery(options); if (filter) { q = q.filter(filter) } if (group) { group = normalizeSortingInfo(group) } if (sort || group) { sort = normalizeSortingInfo(sort || []); if (group) { sort = arrangeSortingInfo(group, sort) } $.each(sort, function(index) { q = q[index ? "thenBy" : "sortBy"](this.selector, this.desc) }) } if (select) { q = q.select(select) } if (group) { q = multiLevelGroup(q, group) } if (take || skip) { q = q.slice(skip || 0, take) } return q.enumerate() }, _withLock: function(task) { var result = $.Deferred(); task.done(function() { var that = this, args = arguments; dataUtils.processRequestResultLock.promise().done(function() { result.resolveWith(that, args) }) }).fail(function() { result.rejectWith(this, arguments) }); return result }, createQuery: abstract, totalCount: function(options) { return this._totalCountImpl(options) }, _totalCountImpl: function(options) { options = options || {}; var q = this.createQuery(), group = options.group, filter = options.filter; if (filter) { q = q.filter(filter) } if (group) { group = normalizeSortingInfo(group); q = multiLevelGroup(q, group) } return q.count() }, byKey: function(key, extraOptions) { return this._addFailHandlers(this._withLock(this._byKeyImpl(key, extraOptions))) }, _byKeyImpl: abstract, insert: function(values) { var that = this; that.fireEvent("modifying"); that.fireEvent("inserting", [values]); return that._addFailHandlers(that._insertImpl(values).done(function(callbackValues, callbackKey) { that.fireEvent("inserted", [callbackValues, callbackKey]); that.fireEvent("modified") })) }, _insertImpl: abstract, update: function(key, values) { var that = this; that.fireEvent("modifying"); that.fireEvent("updating", [key, values]); return that._addFailHandlers(that._updateImpl(key, values).done(function(callbackKey, callbackValues) { that.fireEvent("updated", [callbackKey, callbackValues]); that.fireEvent("modified") })) }, _updateImpl: abstract, remove: function(key) { var that = this; that.fireEvent("modifying"); that.fireEvent("removing", [key]); return that._addFailHandlers(that._removeImpl(key).done(function(callbackKey) { that.fireEvent("removed", [callbackKey]); that.fireEvent("modified") })) }, _removeImpl: abstract, _addFailHandlers: function(deferred) { return deferred.fail(this._errorHandler, errorsModule._errorHandler) } }).include(EventsMixin); Store.create = function(alias, options) { if (!(alias in storeImpl)) { throw errorsModule.errors.Error("E4020", alias) } return new storeImpl[alias](options) }; Store.inherit = function(inheritor) { return function(members, alias) { var type = inheritor.apply(this, [members]); if (alias) { storeImpl[alias] = type } return type } }(Store.inherit); module.exports = Store; module.exports.multiLevelGroup = multiLevelGroup; module.exports.arrangeSortingInfo = arrangeSortingInfo }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***********************************************!*\ !*** ./Scripts/viz/tree_map/tree_map.base.js ***! \***********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var common = __webpack_require__( /*! ./common */ 90), Node = __webpack_require__( /*! ./node */ 168), _getTilingAlgorithm = __webpack_require__( /*! ./tiling */ 107).getAlgorithm, _getColorizer = __webpack_require__( /*! ./colorizing */ 106).getColorizer, _patchFontOptions = __webpack_require__( /*! ../core/utils */ 6).patchFontOptions, _buildRectAppearance = common.buildRectAppearance, _buildTextAppearance = common.buildTextAppearance, _noop = __webpack_require__( /*! jquery */ 1).noop, _max = Math.max, directions = { lefttoprightbottom: [1, 1], leftbottomrighttop: [1, -1], righttopleftbottom: [-1, 1], rightbottomlefttop: [-1, -1] }; __webpack_require__( /*! ./tiling.squarified */ 346); __webpack_require__( /*! ./tiling */ 107).setDefaultAlgorithm("squarified"); __webpack_require__( /*! ./colorizing.discrete */ 342); __webpack_require__( /*! ./colorizing */ 106).setDefaultColorizer("discrete"); function pickPositiveInteger(val) { return val > 0 ? Math.round(val) : 0 } var dxTreeMap = __webpack_require__( /*! ../core/base_widget */ 109).inherit({ _handlers: { beginBuildNodes: _noop, buildNode: _noop, endBuildNodes: _noop, setTrackerData: _noop, calculateState: function(options) { return _buildRectAppearance(options) } }, _rootClass: "dxtm-tree-map", _rootClassPrefix: "dxtm", _getDefaultSize: function() { return { width: 400, height: 400 } }, _createThemeManager: function() { return new ThemeManager }, _init: function() { var that = this; that._rectOffsets = {}; that._context = { suspend: function() { if (!that._applyingChanges) { that._suspendChanges() } }, resume: function() { if (!that._applyingChanges) { that._resumeChanges() } }, change: function(codes) { that._change(codes) }, settings: [{}, {}], calculateState: that._handlers.calculateState, calculateLabelState: _buildTextAppearance }; that._root = that._topNode = { nodes: [] }; that.callBase.apply(that, arguments) }, _initialChanges: ["DATA_SOURCE"], _initCore: function() { var that = this, renderer = that._renderer; that._createProxyType(); that._tilesGroup = renderer.g().linkOn(renderer.root, "tiles").linkAppend(); that._labelsGroup = renderer.g().attr({ align: "left" }).linkOn(renderer.root, "labels").linkAppend() }, _createProxyType: _noop, _disposeCore: function() { var that = this; that._filter && that._filter.dispose(); that._labelsGroup.linkOff(); that._tilesGroup.linkOff() }, _applySize: function(rect) { this._tilingRect = rect.slice(); this._change(["TILING"]) }, _optionChangesMap: { dataSource: "DATA_SOURCE", valueField: "NODES_CREATE", childrenField: "NODES_CREATE", colorField: "TILES", colorizer: "TILES", labelField: "LABELS", tile: "TILE_SETTINGS", group: "GROUP_SETTINGS", maxDepth: "MAX_DEPTH", layoutAlgorithm: "TILING", layoutDirection: "TILING" }, _themeDependentChanges: ["TILE_SETTINGS", "GROUP_SETTINGS", "MAX_DEPTH"], _changeDataSource: function() { var that = this; that._isDataExpected = that._isSyncData = true; that._updateDataSource(); that._isSyncData = false; if (that._isDataExpected) { that._suspendChanges() } }, _dataSourceChangedHandler: function() { var that = this; if (that._isDataExpected) { that._isDataExpected = false; that._change(["NODES_CREATE"]); if (!that._isSyncData) { that._resumeChanges() } } else { that._requestChange(["NODES_CREATE"]) } }, _optionChangesOrder: ["DATA_SOURCE", "TILE_SETTINGS", "GROUP_SETTINGS", "MAX_DEPTH"], _change_DATA_SOURCE: function() { this._changeDataSource() }, _change_TILE_SETTINGS: function() { this._changeTileSettings() }, _change_GROUP_SETTINGS: function() { this._changeGroupSettings() }, _change_MAX_DEPTH: function() { this._changeMaxDepth() }, _customChangesOrder: ["NODES_CREATE", "NODES_RESET", "TILES", "LABELS", "TILING", "LABELS_LAYOUT"], _change_NODES_CREATE: function() { this._buildNodes() }, _change_NODES_RESET: function() { this._resetNodes() }, _change_TILES: function() { this._applyTilesAppearance() }, _change_LABELS: function() { this._applyLabelsAppearance() }, _change_TILING: function() { this._performTiling() }, _change_LABELS_LAYOUT: function() { this._performLabelsLayout() }, _applyChanges: function() { var that = this; that.callBase.apply(that, arguments); if (!that._isDataExpected) { that._drawn() } that._context.forceReset = false }, _buildNodes: function() { var processedData, that = this, root = that._root = that._topNode = new Node; root._id = 0; root.parent = {}; root.data = {}; root.level = root.index = -1; root.ctx = that._context; root.label = null; that._nodes = [root]; that._handlers.beginBuildNodes(); processedData = that._processDataSourceItems(that._dataSource.items() || []); traverseDataItems(root, processedData.items, 0, { itemsField: !processedData.isPlain && that._getOption("childrenField", true) || "items", valueField: that._getOption("valueField", true) || "value", buildNode: that._handlers.buildNode, ctx: that._context, nodes: that._nodes }); that._onNodesCreated(); that._handlers.endBuildNodes(); that._change(["NODES_RESET"]) }, _onNodesCreated: common.empty, _processDataSourceItems: function(items) { return { items: items, isPlain: false } }, _changeTileSettings: function() { var that = this, options = that._getOption("tile"), offsets = that._rectOffsets, borderWidth = pickPositiveInteger(options.border.width), edgeOffset = borderWidth / 2, innerOffset = 1 & borderWidth ? .5 : 0, labelOptions = options.label, settings = that._context.settings[0]; that._change(["TILES", "LABELS"]); settings.state = that._handlers.calculateState(options); that._filter = that._filter || that._renderer.shadowFilter("-50%", "-50%", "200%", "200%"); that._filter.attr(labelOptions.shadow); that._calculateLabelSettings(settings, labelOptions, that._filter.ref); if (offsets.tileEdge !== edgeOffset || offsets.tileInner !== innerOffset) { offsets.tileEdge = edgeOffset; offsets.tileInner = innerOffset; that._change(["TILING"]) } }, _changeGroupSettings: function() { var that = this, options = that._getOption("group"), labelOptions = options.label, offsets = that._rectOffsets, borderWidth = pickPositiveInteger(options.border.width), edgeOffset = borderWidth / 2, innerOffset = 1 & borderWidth ? .5 : 0, headerHeight = 0, groupPadding = pickPositiveInteger(options.padding), settings = that._context.settings[1]; that._change(["TILES", "LABELS"]); settings.state = that._handlers.calculateState(options); that._calculateLabelSettings(settings, labelOptions); if (options.headerHeight >= 0) { headerHeight = pickPositiveInteger(options.headerHeight) } else { headerHeight = settings.labelParams.height + 2 * pickPositiveInteger(labelOptions.paddingTopBottom) } if (that._headerHeight !== headerHeight) { that._headerHeight = headerHeight; that._change(["TILING"]) } if (that._groupPadding !== groupPadding) { that._groupPadding = groupPadding; that._change(["TILING"]) } if (offsets.headerEdge !== edgeOffset || offsets.headerInner !== innerOffset) { offsets.headerEdge = edgeOffset; offsets.headerInner = innerOffset; that._change(["TILING"]) } }, _calculateLabelSettings: function(settings, options, filter) { var bbox = this._getTextBBox(options.font), paddingLeftRight = pickPositiveInteger(options.paddingLeftRight), paddingTopBottom = pickPositiveInteger(options.paddingTopBottom); settings.labelState = _buildTextAppearance(options, filter); settings.labelState.visible = !("visible" in options) || !!options.visible; settings.labelParams = { unitWidth: bbox.width, height: bbox.height, hOffset: paddingLeftRight, vOffset: -bbox.y + paddingTopBottom, rtlEnabled: this._getOption("rtlEnabled", true), paddingTopBottom: paddingTopBottom, paddingLeftRight: paddingLeftRight } }, _changeMaxDepth: function() { var maxDepth = this._getOption("maxDepth", true); maxDepth = maxDepth >= 1 ? Math.round(maxDepth) : 1 / 0; if (this._maxDepth !== maxDepth) { this._maxDepth = maxDepth; this._change(["NODES_RESET"]) } }, _resetNodes: function() { var that = this; that._tilesGroup.clear(); that._renderer.initHatching(); that._context.forceReset = true; that._context.minLevel = that._topNode.level + 1; that._context.maxLevel = that._context.minLevel + that._maxDepth - 1; that._change(["TILES", "LABELS", "TILING"]) }, _processNodes: function(context, process) { processNodes(context, this._topNode, process) }, _applyTilesAppearance: function() { var that = this, colorizer = _getColorizer(that._getOption("colorizer"), that._themeManager, that._topNode); that._processNodes({ renderer: that._renderer, group: that._tilesGroup, setTrackerData: that._handlers.setTrackerData, colorField: that._getOption("colorField", true) || "color", getColor: colorizer }, processTileAppearance) }, _applyLabelsAppearance: function() { var that = this; that._labelsGroup.clear(); that._processNodes({ renderer: that._renderer, group: that._labelsGroup, setTrackerData: that._handlers.setTrackerData, labelField: that._getOption("labelField", true) || "name" }, processLabelAppearance); that._change(["LABELS_LAYOUT"]) }, _performTiling: function() { var that = this, context = { algorithm: _getTilingAlgorithm(that._getOption("layoutAlgorithm", true)), directions: directions[String(that._getOption("layoutDirection", true)).toLowerCase()] || directions.lefttoprightbottom, headerHeight: that._headerHeight, groupPadding: that._groupPadding, rectOffsets: that._rectOffsets }; that._topNode.innerRect = that._tilingRect; calculateRects(context, that._topNode); that._processNodes(context, processTiling); that._change(["LABELS_LAYOUT"]); that._onTilingPerformed() }, _onTilingPerformed: common.empty, _performLabelsLayout: function() { this._processNodes(null, processLabelsLayout) }, _getTextBBox: function(fontOptions) { var bbox, renderer = this._renderer, text = this._textForCalculations || renderer.text("0", 0, 0); this._textForCalculations = text; text.css(_patchFontOptions(fontOptions)).append(renderer.root); bbox = text.getBBox(); text.remove(); return bbox } }); function traverseDataItems(root, dataItems, level, params) { var node, i, dataItem, items, nodes = [], allNodes = params.nodes, ii = dataItems.length, totalValue = 0; for (i = 0; i < ii; ++i) { dataItem = dataItems[i]; node = new Node; node._id = allNodes.length; node.ctx = params.ctx; node.parent = root; node.level = level; node.index = nodes.length; node.data = dataItem; params.buildNode(node); allNodes.push(node); nodes.push(node); items = dataItem[params.itemsField]; if (items && items.length) { traverseDataItems(node, items, level + 1, params) } if (dataItem[params.valueField] > 0) { node.value = Number(dataItem[params.valueField]) } totalValue += node.value } root.nodes = nodes; root.value = totalValue } function processNodes(context, root, process) { var node, i, nodes = root.nodes, ii = nodes.length; for (i = 0; i < ii; ++i) { node = nodes[i]; process(context, node); if (node.isNode()) { processNodes(context, node, process) } } } function processTileAppearance(context, node) { node.color = node.data[context.colorField] || context.getColor(node) || node.parent.color; node.updateStyles(); node.tile = !node.ctx.forceReset && node.tile || createTile[Number(node.isNode())](context, node); node.applyState() } var createTile = [createLeaf, createGroup]; function createLeaf(context, node) { var tile = context.renderer.simpleRect().append(context.group); context.setTrackerData(node, tile); return tile } function createGroup(context, node) { var outer = context.renderer.simpleRect().append(context.group), inner = context.renderer.simpleRect().append(context.group); context.setTrackerData(node, inner); return { outer: outer, inner: inner } } function processLabelAppearance(context, node) { node.updateLabelStyle(); if (node.labelState.visible) { createLabel(context, node, node.labelState, node.labelParams) } } function createLabel(context, currentNode, settings, params) { var textData = currentNode.data[context.labelField]; currentNode.label = textData ? String(textData) : null; textData = currentNode.customLabel || currentNode.label; if (textData) { currentNode.text = context.renderer.text(textData).attr(settings.attr).css(settings.css).append(context.group); context.setTrackerData(currentNode, currentNode.text); currentNode.textWidth = params.unitWidth * textData.length } } var emptyRect = [0, 0, 0, 0]; function calculateRects(context, root) { var i, nodes = root.nodes, items = [], rects = [], sum = 0, ii = items.length = rects.length = nodes.length; for (i = 0; i < ii; ++i) { sum += nodes[i].value; items[i] = { value: nodes[i].value, i: i } } if (sum > 0) { context.algorithm({ items: items.slice(), sum: sum, rect: root.innerRect.slice(), isRotated: 1 & nodes[0].level, directions: context.directions }) } for (i = 0; i < ii; ++i) { rects[i] = items[i].rect || emptyRect } root.rects = rects } function processTiling(context, node) { var headerHeight, rect = node.parent.rects[node.index], rectOffsets = context.rectOffsets; if (node.isNode()) { setRectAttrs(node.tile.outer, buildTileRect(rect, node.parent.innerRect, rectOffsets.headerEdge, rectOffsets.headerInner)); rect = marginateRect(rect, context.groupPadding); headerHeight = Math.min(context.headerHeight, rect[3] - rect[1]); node.rect = [rect[0], rect[1], rect[2], rect[1] + headerHeight]; setRectAttrs(node.tile.inner, marginateRect(node.rect, rectOffsets.headerEdge)); rect[1] += headerHeight; node.innerRect = rect; calculateRects(context, node) } else { node.rect = rect; setRectAttrs(node.tile, buildTileRect(rect, node.parent.innerRect, rectOffsets.tileEdge, rectOffsets.tileInner)) } } function marginateRect(rect, margin) { return [rect[0] + margin, rect[1] + margin, rect[2] - margin, rect[3] - margin] } function buildTileRect(rect, outer, edgeOffset, innerOffset) { return [rect[0] + (rect[0] === outer[0] ? edgeOffset : +innerOffset), rect[1] + (rect[1] === outer[1] ? edgeOffset : +innerOffset), rect[2] - (rect[2] === outer[2] ? edgeOffset : -innerOffset), rect[3] - (rect[3] === outer[3] ? edgeOffset : -innerOffset)] } function setRectAttrs(element, rect) { element.attr({ x: rect[0], y: rect[1], width: _max(rect[2] - rect[0], 0), height: _max(rect[3] - rect[1], 0) }) } function processLabelsLayout(context, node) { if (node.text && node.labelState.visible) { layoutTextNode(node, node.labelParams) } } function layoutTextNode(node, params) { var rect = node.rect, hOffset = params.hOffset; node.text.attr({ x: params.rtlEnabled ? rect[2] - hOffset : rect[0] + hOffset, y: rect[1] + params.vOffset, visibility: node.textWidth + params.paddingLeftRight < rect[2] - rect[0] && params.height + params.paddingTopBottom < rect[3] - rect[1] ? "visible" : "hidden" }) } var ThemeManager = __webpack_require__( /*! ../core/base_theme_manager */ 103).BaseThemeManager.inherit({ _themeSection: "treeMap", _fontFields: ["tile.label.font", "group.label.font", "loadingIndicator.font", "title.font", "title.subtitle.font", "tooltip.font"] }); __webpack_require__( /*! ../../core/component_registrator */ 3)("dxTreeMap", dxTreeMap); module.exports = dxTreeMap; dxTreeMap.addPlugin(__webpack_require__( /*! ../core/data_source */ 161).plugin) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************************!*\ !*** ./Scripts/core/utils/view_port.js ***! \*****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), changeCallback = $.Callbacks(), $originalViewPort = $(); var value = function() { var $current; return function(element) { if (!arguments.length) { return $current } var $element = $(element); $originalViewPort = $element; var isNewViewportFound = !!$element.length; var prevViewPort = value(); $current = isNewViewportFound ? $element : $("body"); changeCallback.fire(isNewViewportFound ? value() : $(), prevViewPort) } }(); $(function() { value(".dx-viewport") }); exports.value = value; exports.changeCallback = changeCallback; exports.originalViewPort = function() { return $originalViewPort } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************!*\ !*** ./Scripts/ui/popup.js ***! \*****************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), translator = __webpack_require__( /*! ../animation/translator */ 15), camelize = __webpack_require__( /*! ../core/utils/inflector */ 29).camelize, commonUtils = __webpack_require__( /*! ../core/utils/common */ 2), messageLocalization = __webpack_require__( /*! ../localization/message */ 8), devices = __webpack_require__( /*! ../core/devices */ 7), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 3), Button = __webpack_require__( /*! ./button */ 24), themes = __webpack_require__( /*! ./themes */ 23), Overlay = __webpack_require__( /*! ./overlay */ 49); __webpack_require__( /*! ./toolbar/ui.toolbar.base */ 257); var POPUP_CLASS = "dx-popup", POPUP_WRAPPER_CLASS = "dx-popup-wrapper", POPUP_FULL_SCREEN_CLASS = "dx-popup-fullscreen", POPUP_FULL_SCREEN_WIDTH_CLASS = "dx-popup-fullscreen-width", POPUP_NORMAL_CLASS = "dx-popup-normal", POPUP_CONTENT_CLASS = "dx-popup-content", POPUP_DRAGGABLE_CLASS = "dx-popup-draggable", POPUP_TITLE_CLASS = "dx-popup-title", POPUP_TITLE_CLOSEBUTTON_CLASS = "dx-closebutton", POPUP_BOTTOM_CLASS = "dx-popup-bottom", TEMPLATE_WRAPPER_CLASS = "dx-template-wrapper", ALLOWED_TOOLBAR_ITEM_ALIASES = ["cancel", "clear", "done"]; var getButtonPlace = function(name) { var device = devices.current(), platform = device.platform, toolbar = "bottom", location = "before"; if ("ios" === platform) { switch (name) { case "cancel": toolbar = "top"; break; case "clear": toolbar = "top"; location = "after"; break; case "done": location = "after" } } else { if ("win" === platform) { location = "after" } else { if ("android" === platform && device.version && parseInt(device.version[0]) > 4) { switch (name) { case "cancel": location = "after"; break; case "done": location = "after" } } else { if ("android" === platform) { location = "center" } } } } return { toolbar: toolbar, location: location } }; var Popup = Overlay.inherit({ _getDefaultOptions: function() { return $.extend(this.callBase(), { fullScreen: false, title: "", showTitle: true, titleTemplate: "title", onTitleRendered: null, dragEnabled: false, toolbarItems: [], showCloseButton: false, bottomTemplate: "bottom" }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function() { var currentTheme = (themes.current() || "").split(".")[0]; return "win8" === currentTheme }, options: { width: function() { return $(window).width() } } }, { device: function(device) { var currentTheme = (themes.current() || "").split(".")[0]; return device.phone && "win8" === currentTheme }, options: { position: { my: "top center", at: "top center", offset: "0 0" } } }, { device: { platform: "ios" }, options: { animation: this._iosAnimation } }, { device: { platform: "android" }, options: { animation: this._androidAnimation } }, { device: { platform: "generic" }, options: { showCloseButton: true } }, { device: function(device) { return "generic" === devices.real().platform && "generic" === device.platform }, options: { dragEnabled: true } }, { device: function(device) { return "desktop" === devices.real().deviceType && !devices.isSimulator() }, options: { focusStateEnabled: true } }]) }, _setDeprecatedOptions: function() { this.callBase(); $.extend(this._deprecatedOptions, { buttons: { since: "16.1", alias: "toolbarItems" } }) }, _iosAnimation: { show: { type: "slide", duration: 400, from: { position: { my: "top", at: "bottom" } }, to: { position: { my: "center", at: "center" } } }, hide: { type: "slide", duration: 400, from: { opacity: 1, position: { my: "center", at: "center" } }, to: { opacity: 1, position: { my: "top", at: "bottom" } } } }, _androidAnimation: function() { var fullScreenConfig = { show: { type: "slide", duration: 300, from: { top: "30%", opacity: 0 }, to: { top: 0, opacity: 1 } }, hide: { type: "slide", duration: 300, from: { top: 0, opacity: 1 }, to: { top: "30%", opacity: 0 } } }, defaultConfig = { show: { type: "fade", duration: 400, from: 0, to: 1 }, hide: { type: "fade", duration: 400, from: 1, to: 0 } }; return this.option("fullScreen") ? fullScreenConfig : defaultConfig }, _init: function() { this.callBase(); this.element().addClass(POPUP_CLASS); this._wrapper().addClass(POPUP_WRAPPER_CLASS); this._$popupContent = this._$content.wrapInner($("
").addClass(POPUP_CONTENT_CLASS)).children().eq(0) }, _render: function() { var isFullscreen = this.option("fullScreen"); this._$content.toggleClass(POPUP_FULL_SCREEN_CLASS, isFullscreen).toggleClass(POPUP_NORMAL_CLASS, !isFullscreen); this.callBase() }, _renderContentImpl: function() { this.callBase(); this._renderTitle(); this._renderBottom() }, _renderTitle: function() { var items = this._getToolbarItems("top"), titleText = this.option("title"), showTitle = this.option("showTitle"); if (showTitle && !!titleText) { items.unshift({ location: devices.current().ios ? "center" : "before", text: titleText }) } if (showTitle || items.length > 0) { this._$title && this._$title.remove(); var $title = $("
").addClass(POPUP_TITLE_CLASS).insertBefore(this.content()); this._$title = this._renderTemplateByType("titleTemplate", items, $title).addClass(POPUP_TITLE_CLASS); this._renderDrag(); this._executeTitleRenderAction(this._$title) } else { if (this._$title) { this._$title.detach() } } }, _renderTemplateByType: function(optionName, data, $container) { var $result, template = this._getTemplateByOption(optionName), toolbarTemplate = template.owner() === this.option("templateProvider"); if (toolbarTemplate) { $result = template.render(data, $container); $container.replaceWith($result); return $result } else { $result = template.render($container); if ($result.hasClass(TEMPLATE_WRAPPER_CLASS)) { $container.replaceWith($result); $container = $result } return $container } }, _executeTitleRenderAction: function(titleElement) { this._getTitleRenderAction()({ titleElement: titleElement }) }, _getTitleRenderAction: function() { return this._titleRenderAction || this._createTitleRenderAction() }, _createTitleRenderAction: function() { return this._titleRenderAction = this._createActionByOption("onTitleRendered", { element: this.element(), excludeValidators: ["designMode", "disabled", "readOnly"] }) }, _getCloseButton: function() { return { toolbar: "top", location: "after", template: this._getCloseButtonRenderer() } }, _getCloseButtonRenderer: function() { return $.proxy(function(_, __, $container) { var $button = $("
").addClass(POPUP_TITLE_CLOSEBUTTON_CLASS); this._createComponent($button, Button, { icon: "close", onClick: this._createToolbarItemAction(void 0), _templates: {} }); $container.append($button) }, this) }, _getToolbarItems: function(toolbar) { var toolbarItems = this.option("toolbarItems"); var toolbarsItems = []; this._toolbarItemClasses = []; var currentPlatform = devices.current().platform, index = 0; $.each(toolbarItems, $.proxy(function(_, data) { var isShortcut = commonUtils.isDefined(data.shortcut), item = isShortcut ? getButtonPlace(data.shortcut) : data; if (isShortcut && "ios" === currentPlatform && index < 2) { item.toolbar = "top"; index++ } $.extend(item, commonUtils.isDefined(data.toolbar) ? { toolbar: data.toolbar } : {}); if (item && item.toolbar === toolbar) { if (isShortcut) { $.extend(item, { location: data.location }, this._getToolbarItemByAlias(data)) } var isLTROrder = "win" === currentPlatform || "generic" === currentPlatform; if ("done" === data.shortcut && isLTROrder || "cancel" === data.shortcut && !isLTROrder) { toolbarsItems.unshift(item) } else { toolbarsItems.push(item) } } }, this)); if ("top" === toolbar && this.option("showCloseButton") && this.option("showTitle")) { toolbarsItems.push(this._getCloseButton()) } return toolbarsItems }, _getToolbarItemByAlias: function(data) { var that = this, itemType = data.shortcut; if ($.inArray(itemType, ALLOWED_TOOLBAR_ITEM_ALIASES) < 0) { return false } var itemConfig = $.extend({ text: messageLocalization.format(camelize(itemType, true)), onClick: this._createToolbarItemAction(data.onClick), _templates: {} }, data.options || {}); var itemClass = POPUP_CLASS + "-" + itemType; this._toolbarItemClasses.push(itemClass); return { template: function(_, __, $container) { var $toolbarItem = $("
").addClass(itemClass).appendTo($container); that._createComponent($toolbarItem, Button, itemConfig) } } }, _createToolbarItemAction: function(clickAction) { return this._createAction(clickAction, { afterExecute: function(e) { e.component.hide() } }) }, _renderBottom: function() { var items = this._getToolbarItems("bottom"); if (items.length) { this._$bottom && this._$bottom.remove(); var $bottom = $("
").addClass(POPUP_BOTTOM_CLASS).insertAfter(this.content()); this._$bottom = this._renderTemplateByType("bottomTemplate", items, $bottom).addClass(POPUP_BOTTOM_CLASS); this._toggleClasses() } else { this._$bottom && this._$bottom.detach() } }, _toggleClasses: function() { var aliases = ALLOWED_TOOLBAR_ITEM_ALIASES; $.each(aliases, $.proxy(function(_, alias) { var className = POPUP_CLASS + "-" + alias; if ($.inArray(className, this._toolbarItemClasses) >= 0) { this._wrapper().addClass(className + "-visible"); this._$bottom.addClass(className) } else { this._wrapper().removeClass(className + "-visible"); this._$bottom.removeClass(className) } }, this)) }, _getDragTarget: function() { return this._$title }, _renderGeometryImpl: function() { this._resetContentHeight(); this.callBase.apply(this, arguments); this._setContentHeight() }, _resetContentHeight: function() { this._$popupContent.css({ height: "auto" }) }, _renderDrag: function() { this.callBase(); this._$content.toggleClass(POPUP_DRAGGABLE_CLASS, this.option("dragEnabled")) }, _renderResize: function() { this.callBase(); this._$content.dxResizable("option", "onResize", $.proxy(function() { this._setContentHeight(); this._actions.onResize(arguments) }, this)) }, _setContentHeight: function() { if (this._disallowUpdateContentHeight()) { return } var contentPaddings = this._$content.outerHeight() - this._$content.height(), contentHeight = this._$content.get(0).getBoundingClientRect().height - contentPaddings; if (this._$title && this._$title.is(":visible")) { contentHeight -= this._$title.get(0).getBoundingClientRect().height || 0 } if (this._$bottom && this._$bottom.is(":visible")) { contentHeight -= this._$bottom.get(0).getBoundingClientRect().height || 0 } this._$popupContent.css({ height: contentHeight }) }, _disallowUpdateContentHeight: function() { var isHeightAuto = "auto" === this._$content.get(0).style.height, maxHeightSpecified = "none" !== this._$content.css("maxHeight"), minHeightSpecified = parseInt(this._$content.css("minHeight")) > 0; return isHeightAuto && !(maxHeightSpecified || minHeightSpecified) }, _renderDimensions: function() { if (this.option("fullScreen")) { this._$content.css({ width: "100%", height: "100%" }) } else { this.callBase.apply(this, arguments) } this._renderFullscreenWidthClass() }, _renderFullscreenWidthClass: function() { this.overlayContent().toggleClass(POPUP_FULL_SCREEN_WIDTH_CLASS, this.overlayContent().outerWidth() === $(window).width()) }, _renderShadingDimensions: function() { if (this.option("fullScreen")) { this._wrapper().css({ width: "100%", height: "100%" }) } else { this.callBase.apply(this, arguments) } }, _renderPosition: function() { if (this.option("fullScreen")) { translator.move(this._$content, { top: 0, left: 0 }) } else { return this.callBase.apply(this, arguments) } }, _optionChanged: function(args) { switch (args.name) { case "showTitle": case "title": case "titleTemplate": this._renderTitle(); this._renderGeometry(); break; case "bottomTemplate": this._renderBottom(); this._renderGeometry(); break; case "onTitleRendered": this._createTitleRenderAction(args.value); break; case "toolbarItems": this._renderTitle(); this._renderBottom(); this._renderGeometry(); break; case "dragEnabled": this._renderDrag(); break; case "fullScreen": this._$content.toggleClass(POPUP_FULL_SCREEN_CLASS, args.value); this._refresh(); break; case "showCloseButton": this._renderTitle(); break; default: this.callBase(args) } }, bottomToolbar: function() { return this._$bottom }, content: function() { return this._$popupContent }, overlayContent: function() { return this._$content } }); registerComponent("dxPopup", Popup); module.exports = Popup }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!********************************!*\ !*** ./Scripts/core/action.js ***! \********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), config = __webpack_require__( /*! ./config */ 35), Class = __webpack_require__( /*! ./class */ 5); var Action = Class.inherit({ ctor: function(action, config) { config = config || {}; this._action = action; this._context = config.context || window; this._beforeExecute = config.beforeExecute; this._afterExecute = config.afterExecute; this._component = config.component; this._validatingTargetName = config.validatingTargetName; var excludeValidators = this._excludeValidators = {}; if (config.excludeValidators) { for (var i = 0; i < config.excludeValidators.length; i++) { excludeValidators[config.excludeValidators[i]] = true } } }, execute: function() { var e = { action: this._action, args: Array.prototype.slice.call(arguments), context: this._context, component: this._component, validatingTargetName: this._validatingTargetName, cancel: false, handled: false }; var beforeExecute = this._beforeExecute, afterExecute = this._afterExecute; if (!this._validateAction(e)) { return } beforeExecute && beforeExecute.call(this._context, e); if (e.cancel) { return } var result = this._executeAction(e); var argsBag = e.args[0]; if (argsBag && argsBag.cancel) { return } afterExecute && afterExecute.call(this._context, e); return result }, _validateAction: function(e) { var excludeValidators = this._excludeValidators, executors = Action.executors; for (var name in executors) { if (!excludeValidators[name]) { var executor = executors[name]; if (executor.validate) { executor.validate(e) } if (e.cancel) { return false } } } return true }, _executeAction: function(e) { var result, executors = Action.executors; for (var name in executors) { var executor = executors[name]; if (executor.execute) { executor.execute(e) } if (e.handled) { result = e.result; break } } return result } }); Action.executors = {}; Action.registerExecutor = function(name, executor) { if ($.isPlainObject(name)) { $.each(name, Action.registerExecutor); return } Action.executors[name] = executor }; Action.unregisterExecutor = function() { var args = $.makeArray(arguments); $.each(args, function() { delete Action.executors[this] }) }; Action.registerExecutor({ undefined: { execute: function(e) { if (!e.action) { e.result = void 0; e.handled = true } } }, func: { execute: function(e) { if ($.isFunction(e.action)) { e.result = e.action.call(e.context, e.args[0]); e.handled = true } } } }); var createValidatorByTargetElement = function(condition) { return function(e) { if (!e.args.length) { return } var args = e.args[0], element = args[e.validatingTargetName] || args.element; if (element && condition(element)) { e.cancel = true } } }; Action.registerExecutor({ designMode: { validate: function(e) { if (config().designMode) { e.cancel = true } } }, disabled: { validate: createValidatorByTargetElement(function($target) { return $target.is(".dx-state-disabled, .dx-state-disabled *") }) }, readOnly: { validate: createValidatorByTargetElement(function($target) { return $target.is(".dx-state-readonly, .dx-state-readonly *") }) } }); module.exports = Action }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************!*\ !*** ./Scripts/color.js ***! \**************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var standardColorNames = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "00ffff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000000", blanchedalmond: "ffebcd", blue: "0000ff", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "00ffff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dodgerblue: "1e90ff", feldspar: "d19275", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "ff00ff", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgrey: "d3d3d3", lightgreen: "90ee90", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslateblue: "8470ff", lightslategray: "778899", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "00ff00", limegreen: "32cd32", linen: "faf0e6", magenta: "ff00ff", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370d8", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "d87093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "663399", red: "ff0000", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", violetred: "d02090", wheat: "f5deb3", white: "ffffff", whitesmoke: "f5f5f5", yellow: "ffff00", yellowgreen: "9acd32" }; var standardColorTypes = [{ re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, process: function(colorString) { return [parseInt(colorString[1], 10), parseInt(colorString[2], 10), parseInt(colorString[3], 10)] } }, { re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d*\.*\d+)\)$/, process: function(colorString) { return [parseInt(colorString[1], 10), parseInt(colorString[2], 10), parseInt(colorString[3], 10), parseFloat(colorString[4])] } }, { re: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/, process: function(colorString) { return [parseInt(colorString[1], 16), parseInt(colorString[2], 16), parseInt(colorString[3], 16)] } }, { re: /^#([a-f0-9]{1})([a-f0-9]{1})([a-f0-9]{1})$/, process: function(colorString) { return [parseInt(colorString[1] + colorString[1], 16), parseInt(colorString[2] + colorString[2], 16), parseInt(colorString[3] + colorString[3], 16)] } }, { re: /^hsv\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, process: function(colorString) { var h = parseInt(colorString[1], 10), s = parseInt(colorString[2], 10), v = parseInt(colorString[3], 10), rgb = hsvToRgb(h, s, v); return [rgb[0], rgb[1], rgb[2], 1, [h, s, v]] } }, { re: /^hsl\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, process: function(colorString) { var h = parseInt(colorString[1], 10), s = parseInt(colorString[2], 10), l = parseInt(colorString[3], 10), rgb = hslToRgb(h, s, l); return [rgb[0], rgb[1], rgb[2], 1, null, [h, s, l]] } }]; function Color(value) { this.baseColor = value; var color; if (value) { color = String(value).toLowerCase().replace(/ /g, ""); color = standardColorNames[color] ? "#" + standardColorNames[color] : color; color = parseColor(color) } if (!color) { this.colorIsInvalid = true } color = color || {}; this.r = normalize(color[0]); this.g = normalize(color[1]); this.b = normalize(color[2]); this.a = normalize(color[3], 1, 1); if (color[4]) { this.hsv = { h: color[4][0], s: color[4][1], v: color[4][2] } } else { this.hsv = toHsvFromRgb(this.r, this.g, this.b) } if (color[5]) { this.hsl = { h: color[5][0], s: color[5][1], l: color[5][2] } } else { this.hsl = toHslFromRgb(this.r, this.g, this.b) } } function parseColor(color) { if ("transparent" === color) { return [0, 0, 0, 0] } var str, i = 0, ii = standardColorTypes.length; for (; i < ii; ++i) { str = standardColorTypes[i].re.exec(color); if (str) { return standardColorTypes[i].process(str) } } return null } function normalize(colorComponent, def, max) { def = def || 0; max = max || 255; return colorComponent < 0 || isNaN(colorComponent) ? def : colorComponent > max ? max : colorComponent } function toHexFromRgb(r, g, b) { return "#" + (16777216 | r << 16 | g << 8 | b).toString(16).slice(1) } function toHsvFromRgb(r, g, b) { var H, S, V, max = Math.max(r, g, b), min = Math.min(r, g, b), delta = max - min; V = max; S = 0 === max ? 0 : 1 - min / max; if (max === min) { H = 0 } else { switch (max) { case r: H = 60 * ((g - b) / delta); if (g < b) { H += 360 } break; case g: H = 60 * ((b - r) / delta) + 120; break; case b: H = 60 * ((r - g) / delta) + 240 } } S *= 100; V *= 100 / 255; return { h: Math.round(H), s: Math.round(S), v: Math.round(V) } } function hsvToRgb(h, s, v) { var Vdec, Vinc, Vmin, Hi, a, r, g, b; Hi = Math.floor(h % 360 / 60); Vmin = (100 - s) * v / 100; a = (v - Vmin) * (h % 60 / 60); Vinc = Vmin + a; Vdec = v - a; switch (Hi) { case 0: r = v; g = Vinc; b = Vmin; break; case 1: r = Vdec; g = v; b = Vmin; break; case 2: r = Vmin; g = v; b = Vinc; break; case 3: r = Vmin; g = Vdec; b = v; break; case 4: r = Vinc; g = Vmin; b = v; break; case 5: r = v; g = Vmin; b = Vdec } return [Math.round(2.55 * r), Math.round(2.55 * g), Math.round(2.55 * b)] } function calculateHue(r, g, b, delta) { var max = Math.max(r, g, b); switch (max) { case r: return (g - b) / delta + (g < b ? 6 : 0); case g: return (b - r) / delta + 2; case b: return (r - g) / delta + 4 } } function toHslFromRgb(r, g, b) { r = convertTo01Bounds(r, 255); g = convertTo01Bounds(g, 255); b = convertTo01Bounds(b, 255); var h, s, max = Math.max(r, g, b), min = Math.min(r, g, b), maxMinSum = max + min, l = maxMinSum / 2; if (max === min) { h = s = 0 } else { var delta = max - min; if (l > .5) { s = delta / (2 - maxMinSum) } else { s = delta / maxMinSum } h = calculateHue(r, g, b, delta); h /= 6 } return { h: _round(360 * h), s: _round(100 * s), l: _round(100 * l) } } function makeTc(colorPart, h) { var Tc = h; if ("r" === colorPart) { Tc = h + 1 / 3 } if ("b" === colorPart) { Tc = h - 1 / 3 } return Tc } function modifyTc(Tc) { if (Tc < 0) { Tc += 1 } if (Tc > 1) { Tc -= 1 } return Tc } function hueToRgb(p, q, Tc) { Tc = modifyTc(Tc); if (Tc < 1 / 6) { return p + 6 * (q - p) * Tc } if (Tc < .5) { return q } if (Tc < 2 / 3) { return p + (q - p) * (2 / 3 - Tc) * 6 } return p } function hslToRgb(h, s, l) { var r, g, b; h = convertTo01Bounds(h, 360), s = convertTo01Bounds(s, 100), l = convertTo01Bounds(l, 100); if (0 === s) { r = g = b = l } else { var q = l < .5 ? l * (1 + s) : l + s - l * s, p = 2 * l - q; r = hueToRgb(p, q, makeTc("r", h)); g = hueToRgb(p, q, makeTc("g", h)); b = hueToRgb(p, q, makeTc("b", h)) } return [_round(255 * r), _round(255 * g), _round(255 * b)] } function convertTo01Bounds(n, max) { n = Math.min(max, Math.max(0, parseFloat(n))); if (Math.abs(n - max) < 1e-6) { return 1 } return n % max / parseFloat(max) } function isIntegerBtwMinAndMax(number, min, max) { min = min || 0; max = max || 255; if (number % 1 !== 0 || number < min || number > max || "number" !== typeof number || isNaN(number)) { return false } return true } var _round = Math.round; Color.prototype = { constructor: Color, highlight: function(step) { step = step || 10; return this.alter(step).toHex() }, darken: function(step) { step = step || 10; return this.alter(-step).toHex() }, alter: function(step) { var result = new Color; result.r = normalize(this.r + step); result.g = normalize(this.g + step); result.b = normalize(this.b + step); return result }, blend: function(blendColor, opacity) { var other = blendColor instanceof Color ? blendColor : new Color(blendColor), result = new Color; result.r = normalize(_round(this.r * (1 - opacity) + other.r * opacity)); result.g = normalize(_round(this.g * (1 - opacity) + other.g * opacity)); result.b = normalize(_round(this.b * (1 - opacity) + other.b * opacity)); return result }, toHex: function() { return toHexFromRgb(this.r, this.g, this.b) }, getPureColor: function() { var rgb = hsvToRgb(this.hsv.h, 100, 100); return new Color("rgb(" + rgb.join(",") + ")") }, isValidHex: function(hex) { return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex) }, isValidRGB: function(r, g, b) { if (!isIntegerBtwMinAndMax(r) || !isIntegerBtwMinAndMax(g) || !isIntegerBtwMinAndMax(b)) { return false } return true }, isValidAlpha: function(a) { if (isNaN(a) || a < 0 || a > 1 || "number" !== typeof a) { return false } return true }, colorIsInvalid: false }; module.exports = Color }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************!*\ !*** ./Scripts/core/utils/version.js ***! \***************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var compare = function(x, y, maxLevel) { function normalizeArg(value) { if ("string" === typeof value) { return value.split(".") } if ("number" === typeof value) { return [value] } return value } x = normalizeArg(x); y = normalizeArg(y); var length = Math.max(x.length, y.length); if (isFinite(maxLevel)) { length = Math.min(length, maxLevel) } for (var i = 0; i < length; i++) { var xItem = parseInt(x[i] || 0, 10), yItem = parseInt(y[i] || 0, 10); if (xItem < yItem) { return -1 } if (xItem > yItem) { return 1 } } return 0 }; exports.compare = compare }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************!*\ !*** ./Scripts/core/utils/window.js ***! \**************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1); var resizeCallbacks = function() { var prevSize, callbacks = $.Callbacks(), jqWindow = $(window), resizeEventHandlerAttached = false, originalCallbacksAdd = callbacks.add, originalCallbacksRemove = callbacks.remove; var formatSize = function() { return [jqWindow.width(), jqWindow.height()].join() }; var handleResize = function() { var now = formatSize(); if (now === prevSize) { return } prevSize = now; setTimeout(callbacks.fire) }; prevSize = formatSize(); callbacks.add = function() { var result = originalCallbacksAdd.apply(callbacks, arguments); if (!resizeEventHandlerAttached && callbacks.has()) { jqWindow.on("resize", handleResize); resizeEventHandlerAttached = true } return result }; callbacks.remove = function() { var result = originalCallbacksRemove.apply(callbacks, arguments); if (!callbacks.has() && resizeEventHandlerAttached) { jqWindow.off("resize", handleResize); resizeEventHandlerAttached = false } return result }; return callbacks }(); var defaultScreenFactorFunc = function(width) { if (width < 768) { return "xs" } else { if (width < 992) { return "sm" } else { if (width < 1200) { return "md" } else { return "lg" } } } }; var getCurrentScreenFactor = function(screenFactorCallback) { var screenFactorFunc = screenFactorCallback || defaultScreenFactorFunc; return screenFactorFunc($(window).width()) }; exports.resizeCallbacks = resizeCallbacks; exports.defaultScreenFactorFunc = defaultScreenFactorFunc; exports.getCurrentScreenFactor = getCurrentScreenFactor }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************!*\ !*** ./Scripts/data/array_store.js ***! \*************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Guid = __webpack_require__( /*! ../core/guid */ 33), objectUtils = __webpack_require__( /*! ../core/utils/object */ 30), keysEqual = __webpack_require__( /*! ./utils */ 28).keysEqual, Query = __webpack_require__( /*! ./query */ 34), errors = __webpack_require__( /*! ./errors */ 25).errors, Store = __webpack_require__( /*! ./abstract_store */ 50); var hasKey = function(target, keyOrKeys) { var key, keys = $.makeArray(keyOrKeys); while (keys.length) { key = keys.shift(); if (key in target) { return true } } return false }; var trivialPromise = function() { var d = $.Deferred(); return d.resolve.apply(d, arguments).promise() }; var rejectedPromise = function() { var d = $.Deferred(); return d.reject.apply(d, arguments).promise() }; var ArrayStore = Store.inherit({ ctor: function(options) { if ($.isArray(options)) { options = { data: options } } else { options = options || {} } this.callBase(options); var initialArray = options.data; if (initialArray && !$.isArray(initialArray)) { throw errors.Error("E4006") } this._array = initialArray || [] }, createQuery: function() { return Query(this._array, { errorHandler: this._errorHandler }) }, _byKeyImpl: function(key) { var index = this._indexByKey(key); if (-1 === index) { return rejectedPromise(errors.Error("E4009")) } return trivialPromise(this._array[index]) }, _insertImpl: function(values) { var keyValue, obj, keyExpr = this.key(); if ($.isPlainObject(values)) { obj = $.extend({}, values) } else { obj = values } if (keyExpr) { keyValue = this.keyOf(obj); if (void 0 === keyValue || "object" === typeof keyValue && $.isEmptyObject(keyValue)) { if ($.isArray(keyExpr)) { throw errors.Error("E4007") } keyValue = obj[keyExpr] = String(new Guid) } else { if (void 0 !== this._array[this._indexByKey(keyValue)]) { return rejectedPromise(errors.Error("E4008")) } } } else { keyValue = obj } this._array.push(obj); return trivialPromise(values, keyValue) }, _updateImpl: function(key, values) { var index, target, keyExpr = this.key(); if (keyExpr) { if (hasKey(values, keyExpr) && !keysEqual(keyExpr, key, this.keyOf(values))) { return rejectedPromise(errors.Error("E4017")) } index = this._indexByKey(key); if (index < 0) { return rejectedPromise(errors.Error("E4009")) } target = this._array[index] } else { target = key } objectUtils.deepExtendArraySafe(target, values); return trivialPromise(key, values) }, _removeImpl: function(key) { var index = this._indexByKey(key); if (index > -1) { this._array.splice(index, 1) } return trivialPromise(key) }, _indexByKey: function(key) { for (var i = 0, arrayLength = this._array.length; i < arrayLength; i++) { if (keysEqual(this.key(), this.keyOf(this._array[i]), key)) { return i } } return -1 }, clear: function() { this.fireEvent("modifying"); this._array = []; this.fireEvent("modified") } }, "array"); module.exports = ArrayStore }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************************!*\ !*** ./Scripts/framework/view_cache.js ***! \*****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../core/class */ 5), EventsMixin = __webpack_require__( /*! ../core/events_mixin */ 32); var ViewCache = Class.inherit({ ctor: function() { this._cache = {} }, setView: function(key, viewInfo) { this._cache[key] = viewInfo }, getView: function(key) { return this._cache[key] }, removeView: function(key) { var result = this._cache[key]; if (result) { delete this._cache[key]; this.fireEvent("viewRemoved", [{ viewInfo: result }]) } return result }, clear: function() { var that = this; $.each(this._cache, function(key) { that.removeView(key) }) }, hasView: function(key) { return key in this._cache } }).include(EventsMixin); var NullViewCache = ViewCache.inherit({ setView: function(key, viewInfo) { this.callBase(key, viewInfo); this.removeView(key) } }); var ConditionalViewCacheDecorator = Class.inherit({ ctor: function(options) { this._filter = options.filter; this._viewCache = options.viewCache; this.viewRemoved = this._viewCache.viewRemoved; this._events = this._viewCache._events }, setView: function(key, viewInfo) { this._viewCache.setView(key, viewInfo); if (!this._filter(key, viewInfo)) { this._viewCache.removeView(key) } }, getView: function(key) { return this._viewCache.getView(key) }, removeView: function(key) { return this._viewCache.removeView(key) }, clear: function() { return this._viewCache.clear() }, hasView: function(key) { return this._viewCache.hasView(key) } }).include(EventsMixin); var DEFAULT_VIEW_CACHE_CAPACITY = 5; var CapacityViewCacheDecorator = Class.inherit({ ctor: function(options) { this._keys = []; this._size = options.size || DEFAULT_VIEW_CACHE_CAPACITY; this._viewCache = options.viewCache; this.viewRemoved = this._viewCache.viewRemoved; this._events = this._viewCache._events }, setView: function(key, viewInfo) { if (!this.hasView(key)) { if (this._keys.length === this._size) { this.removeView(this._keys[0]) } this._keys.push(key) } this._viewCache.setView(key, viewInfo) }, getView: function(key) { var index = $.inArray(key, this._keys); if (index < 0) { return null } this._keys.push(key); this._keys.splice(index, 1); return this._viewCache.getView(key) }, removeView: function(key) { var index = $.inArray(key, this._keys); if (index > -1) { this._keys.splice(index, 1) } return this._viewCache.removeView(key) }, clear: function() { this._keys = []; return this._viewCache.clear() }, hasView: function(key) { return this._viewCache.hasView(key) } }).include(EventsMixin); var HistoryDependentViewCacheDecorator = Class.inherit({ ctor: function(options) { this._viewCache = options.viewCache || new ViewCache; this._navigationManager = options.navigationManager; this._navigationManager.on("itemRemoved", $.proxy(this._onNavigationItemRemoved, this)); this.viewRemoved = this._viewCache.viewRemoved; this._events = this._viewCache._events }, _onNavigationItemRemoved: function(item) { this.removeView(item.key) }, setView: function(key, viewInfo) { this._viewCache.setView(key, viewInfo) }, getView: function(key) { return this._viewCache.getView(key) }, removeView: function(key) { return this._viewCache.removeView(key) }, clear: function() { return this._viewCache.clear() }, hasView: function(key) { return this._viewCache.hasView(key) } }).include(EventsMixin); module.exports = ViewCache; module.exports.NullViewCache = NullViewCache; module.exports.ConditionalViewCacheDecorator = ConditionalViewCacheDecorator; module.exports.CapacityViewCacheDecorator = CapacityViewCacheDecorator; module.exports.HistoryDependentViewCacheDecorator = HistoryDependentViewCacheDecorator }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************!*\ !*** ./Scripts/ui/load_indicator.js ***! \**************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), support = __webpack_require__( /*! ../core/utils/support */ 18), themes = __webpack_require__( /*! ./themes */ 23), browser = __webpack_require__( /*! ../core/utils/browser */ 22), devices = __webpack_require__( /*! ../core/devices */ 7), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 3), Widget = __webpack_require__( /*! ./widget/ui.widget */ 19); var LOADINDICATOR_CLASS = "dx-loadindicator", LOADINDICATOR_WRAPPER_CLASS = "dx-loadindicator-wrapper", LOADINDICATOR_CONTENT_CLASS = "dx-loadindicator-content", LOADINDICATOR_ICON_CLASS = "dx-loadindicator-icon", LOADINDICATOR_SEGMENT_CLASS = "dx-loadindicator-segment", LOADINDICATOR_SEGMENT_INNER_CLASS = "dx-loadindicator-segment-inner", LOADINDICATOR_IMAGE_CLASS = "dx-loadindicator-image"; var LoadIndicator = Widget.inherit({ _getDefaultOptions: function() { return $.extend(this.callBase(), { indicatorSrc: "", activeStateEnabled: false, hoverStateEnabled: false, _animatingSegmentCount: 1, _animatingSegmentInner: false }) }, _defaultOptionsRules: function() { var themeName = function() { var currentTheme = themes.current(); return currentTheme && currentTheme.split(".")[0] }; return this.callBase().concat([{ device: function() { var realDevice = devices.real(), obsoleteAndroid = "android" === realDevice.platform && !/chrome/i.test(navigator.userAgent); return browser.msie && browser.version < 10 || obsoleteAndroid }, options: { viaImage: true } }, { device: function() { return "win8" === themeName() || "win10" === themeName() }, options: { _animatingSegmentCount: 5 } }, { device: function() { return "ios7" === themeName() }, options: { _animatingSegmentCount: 11 } }, { device: function() { return "android5" === themeName() }, options: { _animatingSegmentCount: 2, _animatingSegmentInner: true } }, { device: function() { return "generic" === themeName() }, options: { _animatingSegmentCount: 7 } }]) }, _init: function() { this.callBase(); this.element().addClass(LOADINDICATOR_CLASS) }, _render: function() { this._renderWrapper(); this._renderIndicatorContent(); this._renderMarkup(); this.callBase() }, _renderWrapper: function() { this._$wrapper = $("
").addClass(LOADINDICATOR_WRAPPER_CLASS); this.element().append(this._$wrapper) }, _renderIndicatorContent: function() { this._$content = $("
").addClass(LOADINDICATOR_CONTENT_CLASS); this._$wrapper.append(this._$content) }, _renderMarkup: function() { if (support.animation && !this.option("viaImage") && !this.option("indicatorSrc")) { this._renderMarkupForAnimation() } else { this._renderMarkupForImage() } }, _renderMarkupForAnimation: function() { var animatingSegmentInner = this.option("_animatingSegmentInner"); this._$indicator = $("
").addClass(LOADINDICATOR_ICON_CLASS); this._$content.append(this._$indicator); for (var i = this.option("_animatingSegmentCount"); i >= 0; --i) { var $segment = $("
").addClass(LOADINDICATOR_SEGMENT_CLASS).addClass(LOADINDICATOR_SEGMENT_CLASS + i); if (animatingSegmentInner) { $segment.append($("
").addClass(LOADINDICATOR_SEGMENT_INNER_CLASS)) } this._$indicator.append($segment) } }, _renderMarkupForImage: function() { var indicatorSrc = this.option("indicatorSrc"); this._$wrapper.addClass(LOADINDICATOR_IMAGE_CLASS); if (indicatorSrc) { this._$wrapper.css("background-image", "url(" + indicatorSrc + ")") } }, _renderDimensions: function() { this.callBase(); this._updateContentSizeForAnimation() }, _updateContentSizeForAnimation: function() { if (!this._$indicator) { return } var width = this.option("width"), height = this.option("height"); if (width || height) { width = this.element().width(); height = this.element().height(); var minDimension = Math.min(height, width); this._$wrapper.css({ height: minDimension, width: minDimension, "font-size": minDimension }) } }, _clean: function() { this.callBase(); this._removeMarkupForAnimation(); this._removeMarkupForImage() }, _removeMarkupForAnimation: function() { if (!this._$indicator) { return } this._$indicator.remove(); delete this._$indicator }, _removeMarkupForImage: function() { this._$wrapper.css("background-image", "none") }, _optionChanged: function(args) { switch (args.name) { case "_animatingSegmentCount": case "_animatingSegmentInner": case "indicatorSrc": this._invalidate(); break; default: this.callBase(args) } } }); registerComponent("dxLoadIndicator", LoadIndicator); module.exports = LoadIndicator }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************************************!*\ !*** ./Scripts/events/core/emitter_registrator.js ***! \****************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../../core/class */ 5), registerEvent = __webpack_require__( /*! ./event_registrator */ 43), eventUtils = __webpack_require__( /*! ../utils */ 4), pointerEvents = __webpack_require__( /*! ../pointer */ 13), wheelEvent = __webpack_require__( /*! ./wheel */ 78); var MANAGER_EVENT = "dxEventManager", EMITTER_DATA = "dxEmitter"; var EventManager = Class.inherit({ ctor: function() { this._attachHandlers(); this.reset(); this._proxiedCancelHandler = $.proxy(this._cancelHandler, this); this._proxiedAcceptHandler = $.proxy(this._acceptHandler, this) }, _attachHandlers: function() { $(document).on(eventUtils.addNamespace(pointerEvents.down, MANAGER_EVENT), $.proxy(this._pointerDownHandler, this)).on(eventUtils.addNamespace(pointerEvents.move, MANAGER_EVENT), $.proxy(this._pointerMoveHandler, this)).on(eventUtils.addNamespace([pointerEvents.up, pointerEvents.cancel].join(" "), MANAGER_EVENT), $.proxy(this._pointerUpHandler, this)).on(eventUtils.addNamespace(wheelEvent.name, MANAGER_EVENT), $.proxy(this._mouseWheelHandler, this)) }, _eachEmitter: function(callback) { var activeEmitters = this._activeEmitters || []; var i = 0; while (activeEmitters.length > i) { var emitter = activeEmitters[i]; if (false === callback(emitter)) { break } if (activeEmitters[i] === emitter) { i++ } } }, _applyToEmitters: function(method, arg) { this._eachEmitter(function(emitter) { emitter[method].call(emitter, arg) }) }, reset: function() { this._eachEmitter(this._proxiedCancelHandler); this._activeEmitters = [] }, resetEmitter: function(emitter) { this._proxiedCancelHandler(emitter) }, _pointerDownHandler: function(e) { if (eventUtils.isMouseEvent(e) && e.which > 1) { return } this._updateEmitters(e) }, _updateEmitters: function(e) { if (!this._isSetChanged(e)) { return } this._cleanEmitters(e); this._fetchEmitters(e) }, _isSetChanged: function(e) { var currentSet = this._closestEmitter(e); var previousSet = this._emittersSet || []; var setChanged = currentSet.length !== previousSet.length; $.each(currentSet, function(index, emitter) { setChanged = setChanged || previousSet[index] !== emitter; return !setChanged }); this._emittersSet = currentSet; return setChanged }, _closestEmitter: function(e) { var that = this, result = [], $element = $(e.target); function handleEmitter(_, emitter) { if (!!emitter && emitter.validatePointers(e) && emitter.validate(e)) { emitter.addCancelCallback(that._proxiedCancelHandler); emitter.addAcceptCallback(that._proxiedAcceptHandler); result.push(emitter) } } while ($element.length) { var emitters = $.data($element.get(0), EMITTER_DATA) || []; $.each(emitters, handleEmitter); $element = $element.parent() } return result }, _acceptHandler: function(acceptedEmitter, e) { var that = this; this._eachEmitter(function(emitter) { if (emitter !== acceptedEmitter) { that._cancelEmitter(emitter, e) } }) }, _cancelHandler: function(canceledEmitter, e) { this._cancelEmitter(canceledEmitter, e) }, _cancelEmitter: function(emitter, e) { var activeEmitters = this._activeEmitters; if (e) { emitter.cancel(e) } else { emitter.reset() } emitter.removeCancelCallback(); emitter.removeAcceptCallback(); var emitterIndex = $.inArray(emitter, activeEmitters); if (emitterIndex > -1) { activeEmitters.splice(emitterIndex, 1) } }, _cleanEmitters: function(e) { this._applyToEmitters("end", e); this.reset(e) }, _fetchEmitters: function(e) { this._activeEmitters = this._emittersSet.slice(); this._applyToEmitters("start", e) }, _pointerMoveHandler: function(e) { this._applyToEmitters("move", e) }, _pointerUpHandler: function(e) { this._updateEmitters(e) }, _mouseWheelHandler: function(e) { if (!this._allowInterruptionByMousewheel()) { return } e.pointers = [null]; this._pointerDownHandler(e); this._adjustWheelEvent(e); this._pointerMoveHandler(e); e.pointers = []; this._pointerUpHandler(e) }, _allowInterruptionByMousewheel: function() { var allowInterruption = true; this._eachEmitter(function(emitter) { allowInterruption = emitter.allowInterruptionByMousewheel() && allowInterruption; return allowInterruption }); return allowInterruption }, _adjustWheelEvent: function(e) { var closestGestureEmitter = null; this._eachEmitter(function(emitter) { if (!emitter.gesture) { return } var direction = emitter.getDirection(e); if ("horizontal" !== direction && !e.shiftKey || "vertical" !== direction && e.shiftKey) { closestGestureEmitter = emitter; return false } }); if (!closestGestureEmitter) { return } var direction = closestGestureEmitter.getDirection(e), verticalGestureDirection = "both" === direction && !e.shiftKey || "vertical" === direction, prop = verticalGestureDirection ? "pageY" : "pageX"; e[prop] += e.delta }, isActive: function(element) { var result = false; this._eachEmitter(function(emitter) { result = result || emitter.getElement().is(element) }); return result } }); var eventManager = new EventManager; var EMITTER_SUBSCRIPTION_DATA = "dxEmitterSubscription"; var registerEmitter = function(emitterConfig) { var emitterClass = emitterConfig.emitter, emitterName = emitterConfig.events[0], emitterEvents = emitterConfig.events; $.each(emitterEvents, function(_, eventName) { registerEvent(eventName, { noBubble: !emitterConfig.bubble, setup: function(element, data) { var subscriptions = $.data(element, EMITTER_SUBSCRIPTION_DATA) || {}, emitters = $.data(element, EMITTER_DATA) || {}, emitter = emitters[emitterName] || new emitterClass(element); subscriptions[eventName] = true; emitters[emitterName] = emitter; $.data(element, EMITTER_DATA, emitters); $.data(element, EMITTER_SUBSCRIPTION_DATA, subscriptions) }, add: function(element, handleObj) { var emitters = $.data(element, EMITTER_DATA), emitter = emitters[emitterName]; emitter.configurate($.extend({ delegateSelector: handleObj.selector }, handleObj.data), handleObj.type) }, teardown: function(element) { var subscriptions = $.data(element, EMITTER_SUBSCRIPTION_DATA), emitters = $.data(element, EMITTER_DATA), emitter = emitters[emitterName]; delete subscriptions[eventName]; var disposeEmitter = true; $.each(emitterEvents, function(_, eventName) { disposeEmitter = disposeEmitter && !subscriptions[eventName]; return disposeEmitter }); if (disposeEmitter) { if (eventManager.isActive(element)) { eventManager.resetEmitter(emitter) } emitter && emitter.dispose(); delete emitters[emitterName] } } }) }) }; module.exports = registerEmitter }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!********************************!*\ !*** ./Scripts/events/drag.js ***! \********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), wrapToArray = __webpack_require__( /*! ../core/utils/array */ 41).wrapToArray, registerEvent = __webpack_require__( /*! ./core/event_registrator */ 43), eventUtils = __webpack_require__( /*! ./utils */ 4), GestureEmitter = __webpack_require__( /*! ./gesture/emitter.gesture */ 120), registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 61); var DRAG_START_EVENT = "dxdragstart", DRAG_EVENT = "dxdrag", DRAG_END_EVENT = "dxdragend", DRAG_ENTER_EVENT = "dxdragenter", DRAG_LEAVE_EVENT = "dxdragleave", DROP_EVENT = "dxdrop"; var knownDropTargets = [], knownDropTargetSelectors = [], knownDropTargetConfigs = []; var dropTargetRegistration = { setup: function(element, data) { var knownDropTarget = -1 !== $.inArray(element, knownDropTargets); if (!knownDropTarget) { knownDropTargets.push(element); knownDropTargetSelectors.push([]); knownDropTargetConfigs.push(data || {}) } }, add: function(element, handleObj) { var index = $.inArray(element, knownDropTargets); var selector = handleObj.selector; if (-1 === $.inArray(selector, knownDropTargetSelectors[index])) { knownDropTargetSelectors[index].push(selector) } }, teardown: function(element, data) { var elementEvents = $._data(element, "events"), handlersCount = 0; $.each([DRAG_ENTER_EVENT, DRAG_LEAVE_EVENT, DROP_EVENT], function(_, eventName) { var eventHandlers = elementEvents[eventName]; if (eventHandlers) { handlersCount += eventHandlers.length } }); if (!handlersCount) { var index = $.inArray(element, knownDropTargets); knownDropTargets.splice(index, 1); knownDropTargetSelectors.splice(index, 1); knownDropTargetConfigs.splice(index, 1) } } }; registerEvent(DRAG_ENTER_EVENT, dropTargetRegistration); registerEvent(DRAG_LEAVE_EVENT, dropTargetRegistration); registerEvent(DROP_EVENT, dropTargetRegistration); var getItemDelegatedTargets = function($element) { var dropTargetIndex = $.inArray($element.get(0), knownDropTargets), dropTargetSelectors = knownDropTargetSelectors[dropTargetIndex]; var $delegatedTargets = $element.find(dropTargetSelectors.join(", ")); if (-1 !== $.inArray(void 0, dropTargetSelectors)) { $delegatedTargets = $delegatedTargets.addBack() } return $delegatedTargets }; var getItemConfig = function($element) { var dropTargetIndex = $.inArray($element.get(0), knownDropTargets); return knownDropTargetConfigs[dropTargetIndex] }; var getItemPosition = function(dropTargetConfig, $element) { if (dropTargetConfig.itemPositionFunc) { return dropTargetConfig.itemPositionFunc($element) } else { return $element.offset() } }; var getItemSize = function(dropTargetConfig, $element) { if (dropTargetConfig.itemSizeFunc) { return dropTargetConfig.itemSizeFunc($element) } return { width: $element.width(), height: $element.height() } }; var DragEmitter = GestureEmitter.inherit({ ctor: function(element) { this.callBase(element); this.direction = "both" }, _init: function(e) { this._initEvent = e }, _start: function(e) { e = this._fireEvent(DRAG_START_EVENT, this._initEvent); this._maxLeftOffset = e.maxLeftOffset; this._maxRightOffset = e.maxRightOffset; this._maxTopOffset = e.maxTopOffset; this._maxBottomOffset = e.maxBottomOffset; var dropTargets = wrapToArray(e.targetElements || (null === e.targetElements ? [] : knownDropTargets)); this._dropTargets = $.map(dropTargets, function(element) { return $(element).get(0) }) }, _move: function(e) { var eventData = eventUtils.eventData(e), dragOffset = this._calculateOffset(eventData); this._fireEvent(DRAG_EVENT, e, { offset: dragOffset }); this._processDropTargets(e, dragOffset); e.preventDefault() }, _calculateOffset: function(eventData) { return { x: this._calculateXOffset(eventData), y: this._calculateYOffset(eventData) } }, _calculateXOffset: function(eventData) { if ("vertical" !== this.direction) { var offset = eventData.x - this._startEventData.x; return this._fitOffset(offset, this._maxLeftOffset, this._maxRightOffset) } return 0 }, _calculateYOffset: function(eventData) { if ("horizontal" !== this.direction) { var offset = eventData.y - this._startEventData.y; return this._fitOffset(offset, this._maxTopOffset, this._maxBottomOffset) } return 0 }, _fitOffset: function(offset, minOffset, maxOffset) { if (null != minOffset) { offset = Math.max(offset, -minOffset) } if (null != maxOffset) { offset = Math.min(offset, maxOffset) } return offset }, _processDropTargets: function(e, dragOffset) { var target = this._findDropTarget(e), sameTarget = target === this._currentDropTarget; if (!sameTarget) { this._fireDropTargetEvent(e, DRAG_LEAVE_EVENT); this._currentDropTarget = target; this._fireDropTargetEvent(e, DRAG_ENTER_EVENT) } }, _fireDropTargetEvent: function(event, eventName) { if (!this._currentDropTarget) { return } var eventData = { type: eventName, originalEvent: event, draggingElement: this._$element.get(0), target: this._currentDropTarget }; eventUtils.fireEvent(eventData) }, _findDropTarget: function(e) { var result, that = this; $.each(knownDropTargets, function(_, target) { if (!that._checkDropTargetActive(target)) { return } var $target = $(target); $.each(getItemDelegatedTargets($target), function(_, delegatedTarget) { var $delegatedTarget = $(delegatedTarget); if (that._checkDropTarget(getItemConfig($target), $delegatedTarget, e)) { result = delegatedTarget } }) }); return result }, _checkDropTargetActive: function(target) { var active = false; $.each(this._dropTargets, function(_, activeTarget) { active = active || activeTarget === target || $.contains(activeTarget, target); return !active }); return active }, _checkDropTarget: function(config, $target, e) { var isDraggingElement = $target.get(0) === this._$element.get(0); if (isDraggingElement) { return false } var targetPosition = getItemPosition(config, $target); if (e.pageX < targetPosition.left) { return false } if (e.pageY < targetPosition.top) { return false } var targetSize = getItemSize(config, $target); if (e.pageX > targetPosition.left + targetSize.width) { return false } if (e.pageY > targetPosition.top + targetSize.height) { return false } return $target }, _end: function(e) { var eventData = eventUtils.eventData(e); this._fireEvent(DRAG_END_EVENT, e, { offset: this._calculateOffset(eventData) }); this._fireDropTargetEvent(e, DROP_EVENT); delete this._currentDropTarget } }); registerEmitter({ emitter: DragEmitter, events: [DRAG_START_EVENT, DRAG_EVENT, DRAG_END_EVENT] }); exports.dropTargets = knownDropTargets; exports.move = DRAG_EVENT; exports.start = DRAG_START_EVENT; exports.end = DRAG_END_EVENT; exports.enter = DRAG_ENTER_EVENT; exports.leave = DRAG_LEAVE_EVENT; exports.drop = DROP_EVENT }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!********************************!*\ !*** ./Scripts/events/hold.js ***! \********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), eventUtils = __webpack_require__( /*! ./utils */ 4), Emitter = __webpack_require__( /*! ./core/emitter */ 81), registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 61), abs = Math.abs; var HOLD_EVENT_NAME = "dxhold", HOLD_TIMEOUT = 750, TOUCH_BOUNDARY = 5; var HoldEmitter = Emitter.inherit({ start: function(e) { this._startEventData = eventUtils.eventData(e); this._startTimer(e) }, _startTimer: function(e) { var holdTimeout = "timeout" in this ? this.timeout : HOLD_TIMEOUT; this._holdTimer = setTimeout($.proxy(function() { this._requestAccept(e); this._fireEvent(HOLD_EVENT_NAME, e, { target: e.target }); this._forgetAccept() }, this), holdTimeout) }, move: function(e) { if (this._touchWasMoved(e)) { this._cancel(e) } }, _touchWasMoved: function(e) { var delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e)); return abs(delta.x) > TOUCH_BOUNDARY || abs(delta.y) > TOUCH_BOUNDARY }, end: function() { this._stopTimer() }, _stopTimer: function() { clearTimeout(this._holdTimer) }, cancel: function() { this._stopTimer() } }); registerEmitter({ emitter: HoldEmitter, bubble: true, events: [HOLD_EVENT_NAME] }); module.exports = { name: HOLD_EVENT_NAME } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************************!*\ !*** ./Scripts/ui/validation_engine.js ***! \*****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../core/class */ 5), EventsMixin = __webpack_require__( /*! ../core/events_mixin */ 32), errors = __webpack_require__( /*! ../core/errors */ 10), commonUtils = __webpack_require__( /*! ../core/utils/common */ 2), numberLocalization = __webpack_require__( /*! ../localization/number */ 38), messageLocalization = __webpack_require__( /*! ../localization/message */ 8); var rulesValidators = { required: { validate: function(value, rule) { if (!commonUtils.isDefined(value)) { return false } if (false === value) { return false } value = String(value); if (rule.trim || !commonUtils.isDefined(rule.trim)) { value = $.trim(value) } return "" !== value }, defaultMessage: function(value) { return messageLocalization.getFormatter("validation-required")(value) }, defaultFormattedMessage: function(value) { return messageLocalization.getFormatter("validation-required-formatted")(value) } }, numeric: { validate: function(value, rule) { if (!rulesValidators.required.validate(value, {})) { return true } if (rule.useCultureSettings && commonUtils.isString(value)) { return !isNaN(numberLocalization.parse(value)) } else { return $.isNumeric(value) } }, defaultMessage: function(value) { return messageLocalization.getFormatter("validation-numeric")(value) }, defaultFormattedMessage: function(value) { return messageLocalization.getFormatter("validation-numeric-formatted")(value) } }, range: { validate: function(value, rule) { if (!rulesValidators.required.validate(value, {})) { return true } var validNumber = rulesValidators.numeric.validate(value, rule), validValue = commonUtils.isDefined(value), number = validNumber ? parseFloat(value) : validValue && value.valueOf(), min = rule.min, max = rule.max; if (!(validNumber || commonUtils.isDate(value)) && !validValue) { return false } if (commonUtils.isDefined(min)) { if (commonUtils.isDefined(max)) { return number >= min && number <= max } return number >= min } else { if (commonUtils.isDefined(max)) { return number <= max } else { throw errors.Error("E0101") } } }, defaultMessage: function(value) { return messageLocalization.getFormatter("validation-range")(value) }, defaultFormattedMessage: function(value) { return messageLocalization.getFormatter("validation-range-formatted")(value) } }, stringLength: { validate: function(value, rule) { value = commonUtils.isDefined(value) ? String(value) : ""; if (rule.trim || !commonUtils.isDefined(rule.trim)) { value = $.trim(value) } return rulesValidators.range.validate(value.length, $.extend({}, rule)) }, defaultMessage: function(value) { return messageLocalization.getFormatter("validation-stringLength")(value) }, defaultFormattedMessage: function(value) { return messageLocalization.getFormatter("validation-stringLength-formatted")(value) } }, custom: { validate: function(value, rule) { return rule.validationCallback({ value: value, validator: rule.validator, rule: rule }) }, defaultMessage: function(value) { return messageLocalization.getFormatter("validation-custom")(value) }, defaultFormattedMessage: function(value) { return messageLocalization.getFormatter("validation-custom-formatted")(value) } }, compare: { validate: function(value, rule) { if (!rule.comparisonTarget) { throw errors.Error("E0102") } $.extend(rule, { reevaluate: true }); var otherValue = rule.comparisonTarget(), type = rule.comparisonType || "=="; switch (type) { case "==": return value == otherValue; case "!=": return value != otherValue; case "===": return value === otherValue; case "!==": return value !== otherValue; case ">": return value > otherValue; case ">=": return value >= otherValue; case "<": return value < otherValue; case "<=": return value <= otherValue } }, defaultMessage: function(value) { return messageLocalization.getFormatter("validation-compare")(value) }, defaultFormattedMessage: function(value) { return messageLocalization.getFormatter("validation-compare-formatted")(value) } }, pattern: { validate: function(value, rule) { if (!rulesValidators.required.validate(value, {})) { return true } var pattern = rule.pattern; if (commonUtils.isString(pattern)) { pattern = new RegExp(pattern) } return pattern.test(value) }, defaultMessage: function(value) { return messageLocalization.getFormatter("validation-pattern")(value) }, defaultFormattedMessage: function(value) { return messageLocalization.getFormatter("validation-pattern-formatted")(value) } }, email: { validate: function(value, rule) { if (!rulesValidators.required.validate(value, {})) { return true } return rulesValidators.pattern.validate(value, $.extend({}, rule, { pattern: /^[\d\w\._\-]+@([\d\w\._\-]+\.)+[\w]+$/i })) }, defaultMessage: function(value) { return messageLocalization.getFormatter("validation-email")(value) }, defaultFormattedMessage: function(value) { return messageLocalization.getFormatter("validation-email-formatted")(value) } } }; var GroupConfig = Class.inherit({ ctor: function(group) { this.group = group; this.validators = [] }, validate: function() { var result = { isValid: true, brokenRules: [], validators: [] }; $.each(this.validators, function(_, validator) { var validatorResult = validator.validate(); result.isValid = result.isValid && validatorResult.isValid; if (validatorResult.brokenRule) { result.brokenRules.push(validatorResult.brokenRule) } result.validators.push(validator) }); this.fireEvent("validated", [{ validators: result.validators, brokenRules: result.brokenRules, isValid: result.isValid }]); return result }, reset: function() { $.each(this.validators, function(_, validator) { validator.reset() }) } }).include(EventsMixin); var ValidationEngine = { groups: [], getGroupConfig: function(group) { var result = $.grep(this.groups, function(config) { return config.group === group }); if (result.length) { return result[0] } }, initGroups: function() { this.groups = []; this.addGroup() }, addGroup: function(group) { var config = this.getGroupConfig(group); if (!config) { config = new GroupConfig(group); this.groups.push(config) } return config }, removeGroup: function(group) { var config = this.getGroupConfig(group), index = $.inArray(config, this.groups); if (index > -1) { this.groups.splice(index, 1) } return config }, _setDefaultMessage: function(rule, validator, name) { if (!commonUtils.isDefined(rule.message)) { if (validator.defaultFormattedMessage && commonUtils.isDefined(name)) { rule.message = validator.defaultFormattedMessage(name) } else { rule.message = validator.defaultMessage() } } }, validate: function(value, rules, name) { var result = { name: name, value: value, brokenRule: null, isValid: true, validationRules: rules }, that = this; $.each(rules || [], function(_, rule) { var ruleValidationResult, ruleValidator = rulesValidators[rule.type]; if (ruleValidator) { if (commonUtils.isDefined(rule.isValid) && rule.value === value && !rule.reevaluate) { if (!rule.isValid) { result.isValid = false; result.brokenRule = rule; return false } return true } rule.value = value; ruleValidationResult = ruleValidator.validate(value, rule); rule.isValid = ruleValidationResult; if (!ruleValidationResult) { result.isValid = false; that._setDefaultMessage(rule, ruleValidator, name); result.brokenRule = rule } if (!rule.isValid) { return false } } else { throw errors.Error("E0100") } }); return result }, registerValidatorInGroup: function(group, validator) { var groupConfig = ValidationEngine.addGroup(group); if ($.inArray(validator, groupConfig.validators) < 0) { groupConfig.validators.push(validator) } }, removeRegisteredValidator: function(group, validator) { var config = ValidationEngine.getGroupConfig(group), validatorsInGroup = config && config.validators; var index = $.inArray(validator, validatorsInGroup); if (index > -1) { validatorsInGroup.splice(index, 1) } }, validateGroup: function(group) { var groupConfig = ValidationEngine.getGroupConfig(group); if (!groupConfig) { throw errors.Error("E0110") } return groupConfig.validate() }, resetGroup: function(group) { var groupConfig = ValidationEngine.getGroupConfig(group); if (!groupConfig) { throw errors.Error("E0110") } return groupConfig.reset() } }; ValidationEngine.initGroups(); module.exports = ValidationEngine }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************!*\ !*** ./Scripts/animation/position.js ***! \***************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ../core/utils/common */ 2), stringUtils = __webpack_require__( /*! ../core/utils/string */ 26), translator = __webpack_require__( /*! ./translator */ 15), support = __webpack_require__( /*! ../core/utils/support */ 18); var horzRe = /left|right/, vertRe = /top|bottom/, collisionRe = /fit|flip|none/; var normalizeAlign = function(raw) { var result = { h: "center", v: "center" }; var pair = commonUtils.splitPair(raw); if (pair) { $.each(pair, function() { var w = String(this).toLowerCase(); if (horzRe.test(w)) { result.h = w } else { if (vertRe.test(w)) { result.v = w } } }) } return result }; var normalizeOffset = function(raw) { return stringUtils.pairToObject(raw) }; var normalizeCollision = function(raw) { var pair = commonUtils.splitPair(raw), h = String(pair && pair[0]).toLowerCase(), v = String(pair && pair[1]).toLowerCase(); if (!collisionRe.test(h)) { h = "none" } if (!collisionRe.test(v)) { v = h } return { h: h, v: v } }; var getAlignFactor = function(align) { switch (align) { case "center": return .5; case "right": case "bottom": return 1; default: return 0 } }; var inverseAlign = function(align) { switch (align) { case "left": return "right"; case "right": return "left"; case "top": return "bottom"; case "bottom": return "top"; default: return align } }; var calculateOversize = function(data, bounds) { var oversize = 0; if (data.myLocation < bounds.min) { oversize += bounds.min - data.myLocation } if (data.myLocation > bounds.max) { oversize += data.myLocation - bounds.max } return oversize }; var collisionSide = function(direction, data, bounds) { if (data.myLocation < bounds.min) { return "h" === direction ? "left" : "top" } if (data.myLocation > bounds.max) { return "h" === direction ? "right" : "bottom" } return "none" }; var initMyLocation = function(data) { data.myLocation = data.atLocation + getAlignFactor(data.atAlign) * data.atSize - getAlignFactor(data.myAlign) * data.mySize + data.offset }; var decolliders = { fit: function(data, bounds) { var result = false; if (data.myLocation > bounds.max) { data.myLocation = bounds.max; result = true } if (data.myLocation < bounds.min) { data.myLocation = bounds.min; result = true } data.fit = result }, flip: function(data, bounds) { data.flip = false; if ("center" === data.myAlign && "center" === data.atAlign) { return } if (data.myLocation < bounds.min || data.myLocation > bounds.max) { var inverseData = $.extend({}, data, { myAlign: inverseAlign(data.myAlign), atAlign: inverseAlign(data.atAlign), offset: -data.offset }); initMyLocation(inverseData); inverseData.oversize = calculateOversize(inverseData, bounds); if (inverseData.myLocation >= bounds.min && inverseData.myLocation <= bounds.max || data.oversize > inverseData.oversize) { data.myLocation = inverseData.myLocation; data.oversize = inverseData.oversize; data.flip = true } } }, flipfit: function(data, bounds) { this.flip(data, bounds); this.fit(data, bounds) }, none: function(data, bounds) { data.oversize = 0 } }; var scrollbarWidth; var calculateScrollbarWidth = function() { var $scrollDiv = $("
").css({ width: 100, height: 100, overflow: "scroll", position: "absolute", top: -9999 }).appendTo($("body")), result = $scrollDiv.get(0).offsetWidth - $scrollDiv.get(0).clientWidth; $scrollDiv.remove(); scrollbarWidth = result }; var defaultPositionResult = { h: { location: 0, flip: false, fit: false, oversize: 0 }, v: { location: 0, flip: false, fit: false, oversize: 0 } }; var calculatePosition = function(what, options) { var $what = $(what), currentOffset = $what.offset(), result = $.extend(true, {}, defaultPositionResult, { h: { location: currentOffset.left }, v: { location: currentOffset.top } }); if (!options) { return result } var my = normalizeAlign(options.my), at = normalizeAlign(options.at), of = options.of || window, offset = normalizeOffset(options.offset), collision = normalizeCollision(options.collision), boundary = options.boundary, boundaryOffset = normalizeOffset(options.boundaryOffset); var h = { mySize: $what.outerWidth(), myAlign: my.h, atAlign: at.h, offset: offset.h, collision: collision.h, boundaryOffset: boundaryOffset.h }; var v = { mySize: $what.outerHeight(), myAlign: my.v, atAlign: at.v, offset: offset.v, collision: collision.v, boundaryOffset: boundaryOffset.v }; if (of.preventDefault) { h.atLocation = of.pageX; v.atLocation = of.pageY; h.atSize = 0; v.atSize = 0 } else { of = $(of); if ($.isWindow(of[0])) { h.atLocation = of.scrollLeft(); v.atLocation = of.scrollTop(); h.atSize = of.width(); v.atSize = of.height() } else { if (9 === of[0].nodeType) { h.atLocation = 0; v.atLocation = 0; h.atSize = of.width(); v.atSize = of.height() } else { var o = of.offset(); h.atLocation = o.left; v.atLocation = o.top; h.atSize = of.outerWidth(); v.atSize = of.outerHeight() } } } initMyLocation(h); initMyLocation(v); var bounds = function() { var win = $(window), windowWidth = win.width(), windowHeight = win.height(), left = win.scrollLeft(), top = win.scrollTop(), hScrollbar = document.width > document.documentElement.clientWidth, vScrollbar = document.height > document.documentElement.clientHeight, hZoomLevel = support.touch ? document.documentElement.clientWidth / (vScrollbar ? windowWidth - scrollbarWidth : windowWidth) : 1, vZoomLevel = support.touch ? document.documentElement.clientHeight / (hScrollbar ? windowHeight - scrollbarWidth : windowHeight) : 1; if (void 0 === scrollbarWidth) { calculateScrollbarWidth() } var boundaryWidth = windowWidth, boundaryHeight = windowHeight; if (boundary) { var $boundary = $(boundary), boundaryPosition = $boundary.offset(); left = boundaryPosition.left; top = boundaryPosition.top; boundaryWidth = $boundary.width(); boundaryHeight = $boundary.height() } return { h: { min: left + h.boundaryOffset, max: left + boundaryWidth / hZoomLevel - h.mySize - h.boundaryOffset }, v: { min: top + v.boundaryOffset, max: top + boundaryHeight / vZoomLevel - v.mySize - v.boundaryOffset } } }(); h.oversize = calculateOversize(h, bounds.h); v.oversize = calculateOversize(v, bounds.v); h.collisionSide = collisionSide("h", h, bounds.h); v.collisionSide = collisionSide("v", v, bounds.v); if (decolliders[h.collision]) { decolliders[h.collision](h, bounds.h) } if (decolliders[v.collision]) { decolliders[v.collision](v, bounds.v) } var preciser = function(number) { return options.precise ? number : Math.round(number) }; $.extend(true, result, { h: { location: preciser(h.myLocation), oversize: preciser(h.oversize), fit: h.fit, flip: h.flip, collisionSide: h.collisionSide }, v: { location: preciser(v.myLocation), oversize: preciser(v.oversize), fit: v.fit, flip: v.flip, collisionSide: v.collisionSide }, precise: options.precise }); return result }; var position = function(what, options) { var $what = $(what); if (!options) { return $what.offset() } translator.resetPosition($what); var offset = $what.offset(), targetPosition = options.h && options.v ? options : calculatePosition($what, options); var preciser = function(number) { return options.precise ? number : Math.round(number) }; translator.move($what, { left: targetPosition.h.location - preciser(offset.left), top: targetPosition.v.location - preciser(offset.top) }); return targetPosition }; $.extend(position, { inverseAlign: inverseAlign, normalizeAlign: normalizeAlign }); module.exports = { calculateScrollbarWidth: calculateScrollbarWidth, calculate: calculatePosition, setup: position } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************!*\ !*** ./Scripts/core/utils/math.js ***! \************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var sign = function(value) { if (0 === value) { return 0 } return value / Math.abs(value) }; var fitIntoRange = function(value, minValue, maxValue) { return Math.min(Math.max(value, minValue), maxValue) }; exports.sign = sign; exports.fitIntoRange = fitIntoRange }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************************************!*\ !*** ./Scripts/ui/list/ui.list.edit.decorator_registry.js ***! \************************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1); exports.registry = {}; exports.register = function(option, type, decoratorClass) { var decoratorsRegistry = exports.registry; var decoratorConfig = {}; decoratorConfig[option] = decoratorsRegistry[option] ? decoratorsRegistry[option] : {}; decoratorConfig[option][type] = decoratorClass; decoratorsRegistry = $.extend(decoratorsRegistry, decoratorConfig) } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**********************************!*\ !*** ./Scripts/format_helper.js ***! \**********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ./core/utils/common */ 2), dateUtils = __webpack_require__( /*! ./core/utils/date */ 12), numberLocalization = __webpack_require__( /*! ./localization/number */ 38), dateLocalization = __webpack_require__( /*! ./localization/date */ 14), dependencyInjector = __webpack_require__( /*! ./core/utils/dependency_injector */ 80), logger = __webpack_require__( /*! ./core/utils/console */ 36).logger; __webpack_require__( /*! ./localization/currency */ 117); module.exports = dependencyInjector({ _addFormatSeparator: function(format1, format2) { var separator = " "; if (format2) { return format1 + separator + format2 } return format1 }, _getDateTimeFormatPattern: function(dateTimeFormat) { return dateLocalization.getPatternByFormat(dateTimeFormat) }, format: function(value, format, precision) { var formatIsValid = commonUtils.isString(format) && "" !== format || $.isPlainObject(format) || commonUtils.isFunction(format), valueIsValid = commonUtils.isNumber(value) || commonUtils.isDate(value); if (!formatIsValid || !valueIsValid) { return commonUtils.isDefined(value) ? value.toString() : "" } if (commonUtils.isFunction(format)) { return format(value) } if (void 0 !== precision) { logger.warn("Option 'precision' is deprecated. Use field 'precision' of a format object instead.") } if (commonUtils.isString(format)) { format = { type: format, precision: precision } } if (commonUtils.isNumber(value)) { return numberLocalization.format(value, format) } if (commonUtils.isDate(value)) { return dateLocalization.format(value, format) } }, getTimeFormat: function(showSecond) { if (showSecond) { return this._getDateTimeFormatPattern("longtime") } return this._getDateTimeFormatPattern("shorttime") }, getDateFormatByDifferences: function(dateDifferences) { var resultFormat = ""; if (dateDifferences.millisecond) { resultFormat = dateLocalization.getPatternByFormat("millisecond") } if (dateDifferences.hour || dateDifferences.minute || dateDifferences.second) { resultFormat = this._addFormatSeparator(this.getTimeFormat(dateDifferences.second), resultFormat) } if (dateDifferences.year && dateDifferences.month && dateDifferences.day) { return this._addFormatSeparator(this._getDateTimeFormatPattern("shortdate"), resultFormat) } if (dateDifferences.year && dateDifferences.month) { return dateLocalization.getPatternByFormat("monthandyear") } if (dateDifferences.year && dateDifferences.quarter) { return dateLocalization.getPatternByFormat("quarterandyear") } if (dateDifferences.year) { return dateLocalization.getPatternByFormat("year") } if (dateDifferences.quarter) { return dateLocalization.getPatternByFormat("quarter") } if (dateDifferences.month && dateDifferences.day) { return this._addFormatSeparator(this._getDateTimeFormatPattern("monthandday"), resultFormat) } if (dateDifferences.month) { return dateLocalization.getPatternByFormat("month") } if (dateDifferences.day) { var dayPattern = dateLocalization.getPatternByFormat("dayofweek") + ", " + dateLocalization.getPatternByFormat("day"); return this._addFormatSeparator(dayPattern, resultFormat) } return resultFormat }, getDateFormatByTicks: function(ticks) { var resultFormat, maxDif, currentDif, i; if (ticks.length > 1) { maxDif = dateUtils.getDatesDifferences(ticks[0], ticks[1]); for (i = 1; i < ticks.length - 1; i++) { currentDif = dateUtils.getDatesDifferences(ticks[i], ticks[i + 1]); if (maxDif.count < currentDif.count) { maxDif = currentDif } } } else { maxDif = { year: true, month: true, day: true, hour: ticks[0].getHours() > 0, minute: ticks[0].getMinutes() > 0, second: ticks[0].getSeconds() > 0 } } resultFormat = this.getDateFormatByDifferences(maxDif); return resultFormat }, getDateFormatByTickInterval: function(startValue, endValue, tickInterval) { var resultFormat, dateDifferences, dateUnitInterval, dateDifferencesConverter = { week: "day" }, correctDateDifferences = function(dateDifferences, tickInterval, value) { switch (tickInterval) { case "year": case "quarter": dateDifferences.month = value; case "month": dateDifferences.day = value; case "week": case "day": dateDifferences.hour = value; case "hour": dateDifferences.minute = value; case "minute": dateDifferences.second = value; case "second": dateDifferences.millisecond = value } }, correctDifferencesByMaxDate = function(differences, minDate, maxDate) { if (!maxDate.getMilliseconds() && maxDate.getSeconds()) { if (maxDate.getSeconds() - minDate.getSeconds() === 1) { differences.millisecond = true; differences.second = false } } else { if (!maxDate.getSeconds() && maxDate.getMinutes()) { if (maxDate.getMinutes() - minDate.getMinutes() === 1) { differences.second = true; differences.minute = false } } else { if (!maxDate.getMinutes() && maxDate.getHours()) { if (maxDate.getHours() - minDate.getHours() === 1) { differences.minute = true; differences.hour = false } } else { if (!maxDate.getHours() && maxDate.getDate() > 1) { if (maxDate.getDate() - minDate.getDate() === 1) { differences.hour = true; differences.day = false } } else { if (1 === maxDate.getDate() && maxDate.getMonth()) { if (maxDate.getMonth() - minDate.getMonth() === 1) { differences.day = true; differences.month = false } } else { if (!maxDate.getMonth() && maxDate.getFullYear()) { if (maxDate.getFullYear() - minDate.getFullYear() === 1) { differences.month = true; differences.year = false } } } } } } } }; tickInterval = commonUtils.isString(tickInterval) ? tickInterval.toLowerCase() : tickInterval; dateDifferences = dateUtils.getDatesDifferences(startValue, endValue); if (startValue !== endValue) { correctDifferencesByMaxDate(dateDifferences, startValue > endValue ? endValue : startValue, startValue > endValue ? startValue : endValue) } dateUnitInterval = dateUtils.getDateUnitInterval(dateDifferences); correctDateDifferences(dateDifferences, dateUnitInterval, true); dateUnitInterval = dateUtils.getDateUnitInterval(tickInterval || "second"); correctDateDifferences(dateDifferences, dateUnitInterval, false); dateDifferences[dateDifferencesConverter[dateUnitInterval] || dateUnitInterval] = true; resultFormat = this.getDateFormatByDifferences(dateDifferences); return resultFormat } }) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*******************************!*\ !*** ./Scripts/viz/themes.js ***! \*******************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), vizUtils = __webpack_require__( /*! ./core/utils */ 6), themes = {}, themesMapping = {}, themesSchemeMapping = {}, _extend = $.extend, _each = $.each, _normalizeEnum = vizUtils.normalizeEnum, currentThemeName = null, nextCacheUid = 0, widgetsCache = {}; function findTheme(themeName) { var name = _normalizeEnum(themeName); return themes[name] || themes[themesMapping[name] || currentThemeName] } function findThemeNameByName(name, scheme) { return themesMapping[name + "." + scheme] || themesSchemeMapping[name + "." + scheme] || themesMapping[name] } function findThemeNameByPlatform(platform, version, scheme) { return findThemeNameByName(platform + version, scheme) || findThemeNameByName(platform, scheme) } function currentTheme(themeName, colorScheme) { if (!arguments.length) { return currentThemeName } var scheme = _normalizeEnum(colorScheme); currentThemeName = (themeName && themeName.platform ? findThemeNameByPlatform(_normalizeEnum(themeName.platform), themeName.version, scheme) : findThemeNameByName(_normalizeEnum(themeName), scheme)) || currentThemeName; return this } function getThemeInfo(themeName, splitter) { var k = themeName.indexOf(splitter); return k > 0 ? { name: themeName.substring(0, k), scheme: themeName.substring(k + 1) } : null } function registerThemeName(themeName, targetThemeName) { var themeInfo = getThemeInfo(themeName, ".") || getThemeInfo(themeName, "-") || { name: themeName }, name = themeInfo.name, scheme = themeInfo.scheme; if (scheme) { themesMapping[name] = themesMapping[name] || targetThemeName; themesMapping[name + "." + scheme] = themesMapping[name + "-" + scheme] = targetThemeName } else { themesMapping[name] = targetThemeName } } function registerTheme(theme, baseThemeName) { var themeName = _normalizeEnum(theme && theme.name); if (themeName) { registerThemeName(themeName, themeName); themes[themeName] = _extend(true, {}, findTheme(baseThemeName), patchTheme(theme)) } } function registerThemeAlias(alias, theme) { registerThemeName(_normalizeEnum(alias), _normalizeEnum(theme)) } function registerThemeSchemeAlias(from, to) { themesSchemeMapping[from] = to } function mergeScalar(target, field, source, sourceValue) { var _value = source ? source[field] : sourceValue; if (void 0 !== _value && void 0 === target[field]) { target[field] = _value } } function mergeObject(target, field, source, sourceValue) { var _value = source ? source[field] : sourceValue; if (void 0 !== _value) { target[field] = _extend(true, {}, _value, target[field]) } } function patchTheme(theme) { theme = _extend(true, { loadingIndicator: { font: {} }, "export": { font: {} }, legend: { font: {}, border: {} }, title: { font: {} }, tooltip: { font: {} }, "chart:common": {}, "chart:common:axis": { grid: {}, minorGrid: {}, tick: {}, minorTick: {}, title: { font: {} }, label: { font: {} } }, chart: { commonSeriesSettings: { candlestick: {} } }, pie: {}, polar: {}, gauge: { scale: { tick: {}, minorTick: {}, label: { font: {} } } }, barGauge: {}, map: { background: {} }, treeMap: { tile: { selectionStyle: { border: {} } }, group: { border: {}, selectionStyle: { border: {} }, label: { font: {} } } }, rangeSelector: { scale: { tick: {}, minorTick: {}, label: { font: {} } }, chart: {} }, sparkline: {}, bullet: {} }, theme); mergeScalar(theme.loadingIndicator, "backgroundColor", theme); mergeScalar(theme.chart.commonSeriesSettings.candlestick, "innerColor", null, theme.backgroundColor); mergeScalar(theme.map.background, "color", null, theme.backgroundColor); mergeScalar(theme.title.font, "color", null, theme.primaryTitleColor); mergeObject(theme.title, "subtitle", null, theme.title); mergeScalar(theme.legend.font, "color", null, theme.secondaryTitleColor); mergeScalar(theme.legend.border, "color", null, theme.axisColor); patchAxes(theme); _each(["chart", "pie", "polar", "gauge", "barGauge", "map", "treeMap", "rangeSelector", "sparkline", "bullet"], function(_, section) { mergeScalar(theme[section], "redrawOnResize", theme); mergeScalar(theme[section], "containerBackgroundColor", null, theme.backgroundColor); mergeObject(theme[section], "tooltip", theme) }); _each(["chart", "pie", "polar", "gauge", "barGauge", "map", "treeMap", "rangeSelector"], function(_, section) { mergeObject(theme[section], "loadingIndicator", theme); mergeObject(theme[section], "export", theme); mergeObject(theme[section], "legend", theme); mergeObject(theme[section], "title", theme) }); _each(["chart", "pie", "polar"], function(_, section) { mergeObject(theme, section, null, theme["chart:common"]) }); _each(["chart", "polar"], function(_, section) { theme[section] = theme[section] || {}; mergeObject(theme[section], "commonAxisSettings", null, theme["chart:common:axis"]) }); mergeObject(theme.rangeSelector.chart, "commonSeriesSettings", theme.chart); mergeObject(theme.rangeSelector.chart, "dataPrepareSettings", theme.chart); mergeScalar(theme.treeMap.group.border, "color", null, theme.axisColor); mergeScalar(theme.treeMap.tile.selectionStyle.border, "color", null, theme.primaryTitleColor); mergeScalar(theme.treeMap.group.selectionStyle.border, "color", null, theme.primaryTitleColor); mergeScalar(theme.treeMap.group.label.font, "color", null, theme.secondaryTitleColor); mergeScalar(theme.map.legend, "backgroundColor", theme); patchMapLayers(theme); return theme } function patchAxes(theme) { var commonAxisSettings = theme["chart:common:axis"], colorFieldName = "color"; _each([commonAxisSettings, commonAxisSettings.grid, commonAxisSettings.minorGrid, commonAxisSettings.tick, commonAxisSettings.minorTick], function(_, obj) { mergeScalar(obj, colorFieldName, null, theme.axisColor) }); mergeScalar(commonAxisSettings.title.font, colorFieldName, null, theme.secondaryTitleColor); mergeScalar(commonAxisSettings.label.font, colorFieldName, null, theme.axisLabelColor); mergeScalar(theme.gauge.scale.label.font, colorFieldName, null, theme.axisLabelColor); mergeScalar(theme.gauge.scale.tick, colorFieldName, null, theme.backgroundColor); mergeScalar(theme.gauge.scale.minorTick, colorFieldName, null, theme.backgroundColor); mergeScalar(theme.rangeSelector.scale.tick, colorFieldName, null, theme.axisColor); mergeScalar(theme.rangeSelector.scale.minorTick, colorFieldName, null, theme.axisColor); mergeScalar(theme.rangeSelector.scale.label.font, colorFieldName, null, theme.axisLabelColor) } function patchMapLayers(theme) { var map = theme.map; _each(["area", "line", "marker"], function(_, section) { mergeObject(map, "layer:" + section, null, map.layer) }); _each(["dot", "bubble", "pie", "image"], function(_, section) { mergeObject(map, "layer:marker:" + section, null, map["layer:marker"]) }) } function addCacheItem(target) { var cacheUid = ++nextCacheUid; target._cache = cacheUid; widgetsCache[cacheUid] = target } function removeCacheItem(target) { delete widgetsCache[target._cache] } function refreshAll() { _each(widgetsCache, function() { this.refresh() }); return this } _extend(exports, { currentTheme: currentTheme, registerTheme: registerTheme, findTheme: findTheme, registerThemeAlias: registerThemeAlias, registerThemeSchemeAlias: registerThemeSchemeAlias, refreshAll: refreshAll, addCacheItem: addCacheItem, removeCacheItem: removeCacheItem }); _extend(exports, { themes: themes, themesMapping: themesMapping, themesSchemeMapping: themesSchemeMapping, widgetsCache: widgetsCache, resetCurrentTheme: function() { currentThemeName = null } }) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************************!*\ !*** ./Scripts/events/core/emitter.feedback.js ***! \*************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../../core/class */ 5), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), devices = __webpack_require__( /*! ../../core/devices */ 7), eventUtils = __webpack_require__( /*! ../utils */ 4), pointerEvents = __webpack_require__( /*! ../pointer */ 13), Emitter = __webpack_require__( /*! ./emitter */ 81), registerEmitter = __webpack_require__( /*! ./emitter_registrator */ 61); var ACTIVE_EVENT_NAME = "dxactive", INACTIVE_EVENT_NAME = "dxinactive", ACTIVE_TIMEOUT = 30, INACTIVE_TIMEOUT = 400; var FeedbackEvent = Class.inherit({ ctor: function(timeout, fire) { this._timeout = timeout; this._fire = fire }, start: function() { var that = this; this._schedule(function() { that.force() }) }, _schedule: function(fn) { this._timer = window.setTimeout(fn, this._timeout) }, stop: function() { clearTimeout(this._timer) }, force: function() { if (this._fired) { return } this.stop(); this._fire(); this._fired = true }, fired: function() { return this._fired } }); var activeFeedback; var FeedbackEmitter = Emitter.inherit({ ctor: function() { this.callBase.apply(this, arguments); this._active = new FeedbackEvent(0, $.noop); this._inactive = new FeedbackEvent(0, $.noop) }, configurate: function(data, eventName) { switch (eventName) { case ACTIVE_EVENT_NAME: data.activeTimeout = data.timeout; break; case INACTIVE_EVENT_NAME: data.inactiveTimeout = data.timeout } this.callBase(data) }, start: function(e) { if (activeFeedback) { var activeChildExists = $.contains(this.getElement().get(0), activeFeedback.getElement().get(0)); var childJustActivated = !activeFeedback._active.fired(); if (activeChildExists && childJustActivated) { this._cancel(); return } activeFeedback._inactive.force() } activeFeedback = this; this._initEvents(e); this._active.start() }, _initEvents: function(e) { var that = this, eventTarget = this._getEmitterTarget(e), mouseEvent = eventUtils.isMouseEvent(e), isSimulator = devices.isSimulator(), deferFeedback = isSimulator || !mouseEvent, activeTimeout = commonUtils.ensureDefined(this.activeTimeout, ACTIVE_TIMEOUT), inactiveTimeout = commonUtils.ensureDefined(this.inactiveTimeout, INACTIVE_TIMEOUT); this._active = new FeedbackEvent(deferFeedback ? activeTimeout : 0, function() { that._fireEvent(ACTIVE_EVENT_NAME, e, { target: eventTarget }) }); this._inactive = new FeedbackEvent(deferFeedback ? inactiveTimeout : 0, function() { that._fireEvent(INACTIVE_EVENT_NAME, e, { target: eventTarget }); activeFeedback = null }) }, cancel: function(e) { this.end(e) }, end: function(e) { var skipTimers = e.type !== pointerEvents.up; if (skipTimers) { this._active.stop() } else { this._active.force() } this._inactive.start(); if (skipTimers) { this._inactive.force() } }, dispose: function() { this._active.stop(); this._inactive.stop(); this.callBase() }, lockInactive: function() { this._active.force(); this._inactive.stop(); activeFeedback = null; this._cancel(); return $.proxy(this._inactive.force, this._inactive) } }); FeedbackEmitter.lock = function(deferred) { var lockInactive = activeFeedback ? activeFeedback.lockInactive() : $.noop; $.when(deferred).always(lockInactive) }; registerEmitter({ emitter: FeedbackEmitter, events: [ACTIVE_EVENT_NAME, INACTIVE_EVENT_NAME] }); exports.lock = FeedbackEmitter.lock; exports.active = ACTIVE_EVENT_NAME; exports.inactive = INACTIVE_EVENT_NAME }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************!*\ !*** ./Scripts/data/odata/utils.js ***! \*************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../../core/class */ 5), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), Guid = __webpack_require__( /*! ../../core/guid */ 33), isDefined = commonUtils.isDefined, errors = __webpack_require__( /*! ../errors */ 25).errors, dataUtils = __webpack_require__( /*! ../utils */ 28); var GUID_REGEX = /^(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})$/; var VERBOSE_DATE_REGEX = /^\/Date\((-?\d+)((\+|-)?(\d+)?)\)\/$/; var ISO8601_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[-+]{1}\d{2}(:?)(\d{2})?)?$/; var JSON_VERBOSE_MIME_TYPE = "application/json;odata=verbose"; function formatISO8601(date, skipZeroTime, skipTimezone) { var ret = []; var pad = function(n) { if (n < 10) { return "0".concat(n) } return String(n) }; var isZeroTime = function() { return date.getHours() + date.getMinutes() + date.getSeconds() + date.getMilliseconds() < 1 }; ret.push(date.getFullYear()); ret.push("-"); ret.push(pad(date.getMonth() + 1)); ret.push("-"); ret.push(pad(date.getDate())); if (!(skipZeroTime && isZeroTime())) { ret.push("T"); ret.push(pad(date.getHours())); ret.push(":"); ret.push(pad(date.getMinutes())); ret.push(":"); ret.push(pad(date.getSeconds())); if (date.getMilliseconds()) { ret.push("."); ret.push(date.getMilliseconds()) } if (!skipTimezone) { ret.push("Z") } } return ret.join("") } function parseISO8601(isoString) { var result = new Date(60 * new Date(0).getTimezoneOffset() * 1e3), chunks = isoString.replace("Z", "").split("T"), date = /(\d{4})-(\d{2})-(\d{2})/.exec(chunks[0]), time = /(\d{2}):(\d{2}):(\d{2})\.?(\d{0,7})?/.exec(chunks[1]); result.setFullYear(Number(date[1])); result.setMonth(Number(date[2]) - 1); result.setDate(Number(date[3])); if ($.isArray(time) && time.length) { result.setHours(Number(time[1])); result.setMinutes(Number(time[2])); result.setSeconds(Number(time[3])); result.setMilliseconds(Number(String(time[4]).substr(0, 3)) || 0) } return result } function isAbsoluteUrl(url) { return /^(?:[a-z]+:)?\/\//i.test(url) } function toAbsoluteUrl(basePath, relativePath) { var part; var baseParts = stripParams(basePath).split("/"); var relativeParts = relativePath.split("/"); function stripParams(url) { var index = url.indexOf("?"); if (index > -1) { return url.substr(0, index) } return url } baseParts.pop(); while (relativeParts.length) { part = relativeParts.shift(); if (".." === part) { baseParts.pop() } else { baseParts.push(part) } } return baseParts.join("/") } var ajaxOptionsForRequest = function(protocolVersion, request, requestOptions) { request = $.extend({ async: true, method: "get", url: "", params: {}, payload: null, headers: {}, timeout: 3e4 }, request); requestOptions = requestOptions || {}; var beforeSend = requestOptions.beforeSend; if (beforeSend) { beforeSend(request) } var method = (request.method || "get").toLowerCase(), isGet = "get" === method, useJsonp = isGet && requestOptions.jsonp, params = $.extend({}, request.params), ajaxData = isGet ? params : formatPayload(request.payload), qs = !isGet && $.param(params), url = request.url, contentType = !isGet && JSON_VERBOSE_MIME_TYPE; if (qs) { url += (url.indexOf("?") > -1 ? "&" : "?") + qs } if (useJsonp) { ajaxData.$format = "json" } return { url: url, data: ajaxData, dataType: useJsonp ? "jsonp" : "json", jsonp: useJsonp && "$callback", type: method, async: request.async, timeout: request.timeout, headers: request.headers, contentType: contentType, accepts: { json: [JSON_VERBOSE_MIME_TYPE, "text/plain"].join() }, xhrFields: { withCredentials: requestOptions.withCredentials } }; function formatPayload(payload) { return JSON.stringify(payload, function(key, value) { if (!(this[key] instanceof Date)) { return value } value = formatISO8601(this[key]); switch (protocolVersion) { case 2: return value.substr(0, value.length - 1); case 3: case 4: return value; default: throw errors.Error("E4002") } }) } }; var sendRequest = function(protocolVersion, request, requestOptions, deserializeDates) { var d = $.Deferred(); var options = ajaxOptionsForRequest(protocolVersion, request, requestOptions); $.ajax(options).always(function(obj, textStatus) { var extra, tuplet = interpretJsonFormat(obj, textStatus, deserializeDates), error = tuplet.error, data = tuplet.data, nextUrl = tuplet.nextUrl; if (error) { d.reject(error) } else { if (requestOptions.countOnly) { if (isFinite(tuplet.count)) { d.resolve(tuplet.count) } else { d.reject(new errors.Error("E4018")) } } else { if (nextUrl) { if (!isAbsoluteUrl(nextUrl)) { nextUrl = toAbsoluteUrl(options.url, nextUrl) } sendRequest(protocolVersion, { url: nextUrl }, requestOptions, deserializeDates).fail(d.reject).done(function(nextData) { d.resolve(data.concat(nextData)) }) } else { if (isFinite(tuplet.count)) { extra = { totalCount: tuplet.count } } d.resolve(data, extra) } } } }); return d.promise() }; var formatDotNetError = function(errorObj) { var message, currentError = errorObj; if ("message" in errorObj) { if (errorObj.message.value) { message = errorObj.message.value } else { message = errorObj.message } } while (currentError = currentError.innererror || currentError.internalexception) { message = currentError.message; if (currentError.internalexception && -1 === message.indexOf("inner exception")) { break } } return message }; var errorFromResponse = function(obj, textStatus) { if ("nocontent" === textStatus) { return null } var httpStatus = 200, message = "Unknown error", response = obj; if ("success" !== textStatus) { httpStatus = obj.status; message = dataUtils.errorMessageFromXhr(obj, textStatus); try { response = $.parseJSON(obj.responseText) } catch (x) {} } var errorObj = response && (response.error || response["odata.error"] || response["@odata.error"]); if (errorObj) { message = formatDotNetError(errorObj) || message; if (200 === httpStatus) { httpStatus = 500 } if (errorObj.code) { httpStatus = Number(errorObj.code) } return $.extend(Error(message), { httpStatus: httpStatus, errorDetails: errorObj }) } else { if (200 !== httpStatus) { return $.extend(Error(message), { httpStatus: httpStatus }) } } }; var interpretJsonFormat = function(obj, textStatus, deserializeDates) { var value, error = errorFromResponse(obj, textStatus); if (error) { return { error: error } } if (!$.isPlainObject(obj)) { return { data: obj } } if ("d" in obj && (commonUtils.isArray(obj.d) || commonUtils.isObject(obj.d))) { value = interpretVerboseJsonFormat(obj, textStatus) } else { value = interpretLightJsonFormat(obj, textStatus) } transformTypes(value, deserializeDates); return value }; var interpretVerboseJsonFormat = function(obj) { var data = obj.d; if (!isDefined(data)) { return { error: Error("Malformed or unsupported JSON response received") } } data = data; if (isDefined(data.results)) { data = data.results } return { data: data, nextUrl: obj.d.__next, count: parseInt(obj.d.__count, 10) } }; var interpretLightJsonFormat = function(obj) { var data = obj; if (isDefined(data.value)) { data = data.value } return { data: data, nextUrl: obj["@odata.nextLink"], count: parseInt(obj["@odata.count"], 10) } }; var EdmLiteral = Class.inherit({ ctor: function(value) { this._value = value }, valueOf: function() { return this._value } }); var transformTypes = function(obj, deserializeDates) { $.each(obj, function(key, value) { if (null !== value && "object" === typeof value) { if ("results" in value) { obj[key] = value.results } transformTypes(obj[key], deserializeDates) } else { if ("string" === typeof value) { if (GUID_REGEX.test(value)) { obj[key] = new Guid(value) } if (false !== deserializeDates) { if (value.match(VERBOSE_DATE_REGEX)) { var date = new Date(Number(RegExp.$1) + 60 * RegExp.$2 * 1e3); obj[key] = new Date(date.valueOf() + 60 * date.getTimezoneOffset() * 1e3) } else { if (ISO8601_DATE_REGEX.test(value)) { obj[key] = new Date(parseISO8601(obj[key]).valueOf()) } } } } } }) }; var serializeDate = function(date) { return "datetime'" + formatISO8601(date, true, true) + "'" }; var serializeString = function(value) { return "'" + value.replace(/'/g, "''") + "'" }; var serializePropName = function(propName) { if (propName instanceof EdmLiteral) { return propName.valueOf() } return propName.replace(/\./g, "/") }; var serializeValueV4 = function(value) { if (value instanceof Date) { return formatISO8601(value, false, false) } if (value instanceof Guid) { return value.valueOf() } return serializeValueV2(value) }; var serializeValueV2 = function(value) { if (value instanceof Date) { return serializeDate(value) } if (value instanceof Guid) { return "guid'" + value + "'" } if (value instanceof EdmLiteral) { return value.valueOf() } if ("string" === typeof value) { return serializeString(value) } return String(value) }; var serializeValue = function(value, protocolVersion) { switch (protocolVersion) { case 2: case 3: return serializeValueV2(value); case 4: return serializeValueV4(value); default: throw errors.Error("E4002") } }; var serializeKey = function(key, protocolVersion) { if ($.isPlainObject(key)) { var parts = []; $.each(key, function(k, v) { parts.push(serializePropName(k) + "=" + serializeValue(v, protocolVersion)) }); return parts.join() } return serializeValue(key, protocolVersion) }; var keyConverters = { String: function(value) { return value + "" }, Int32: function(value) { return Math.floor(value) }, Int64: function(value) { if (value instanceof EdmLiteral) { return value } return new EdmLiteral(value + "L") }, Guid: function(value) { if (value instanceof Guid) { return value } return new Guid(value) }, Boolean: function(value) { return !!value }, Single: function(value) { if (value instanceof EdmLiteral) { return value } return new EdmLiteral(value + "f") }, Decimal: function(value) { if (value instanceof EdmLiteral) { return value } return new EdmLiteral(value + "m") } }; exports.sendRequest = sendRequest; exports.serializePropName = serializePropName; exports.serializeValue = serializeValue; exports.serializeKey = serializeKey; exports.keyConverters = keyConverters; exports.EdmLiteral = EdmLiteral; exports.OData__internals = { interpretJsonFormat: interpretJsonFormat } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************************!*\ !*** ./Scripts/ui/scroll_view/ui.scrollable.js ***! \*************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), support = __webpack_require__( /*! ../../core/utils/support */ 18), browser = __webpack_require__( /*! ../../core/utils/browser */ 22), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), devices = __webpack_require__( /*! ../../core/devices */ 7), registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 3), DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 39), selectors = __webpack_require__( /*! ../widget/jquery.selectors */ 98), eventUtils = __webpack_require__( /*! ../../events/utils */ 4), scrollEvents = __webpack_require__( /*! ./ui.events.emitter.gesture.scroll */ 398), simulatedStrategy = __webpack_require__( /*! ./ui.scrollable.simulated */ 249), NativeStrategy = __webpack_require__( /*! ./ui.scrollable.native */ 137); var SCROLLABLE = "dxScrollable", SCROLLABLE_STRATEGY = "dxScrollableStrategy", SCROLLABLE_CLASS = "dx-scrollable", SCROLLABLE_DISABLED_CLASS = "dx-scrollable-disabled", SCROLLABLE_CONTAINER_CLASS = "dx-scrollable-container", SCROLLABLE_CONTENT_CLASS = "dx-scrollable-content", VERTICAL = "vertical", HORIZONTAL = "horizontal", BOTH = "both"; var beforeActivateExists = void 0 !== document.onbeforeactivate; var deviceDependentOptions = function() { return [{ device: function(device) { return !support.nativeScrolling }, options: { useNative: false } }, { device: function(device) { return !support.nativeScrolling && !devices.isSimulator() && "generic" === devices.real().platform && "generic" === device.platform }, options: { bounceEnabled: false, scrollByThumb: true, scrollByContent: support.touch, showScrollbar: "onHover" } }] }; var Scrollable = DOMComponent.inherit({ _getDefaultOptions: function() { return $.extend(this.callBase(), { disabled: false, onScroll: null, direction: VERTICAL, showScrollbar: "onScroll", useNative: true, bounceEnabled: true, scrollByContent: true, scrollByThumb: false, onUpdated: null, onStart: null, onEnd: null, onBounce: null, onStop: null, useSimulatedScrollbar: false, useKeyboard: true, inertiaEnabled: true, pushBackValue: 0, updateManually: false }) }, _defaultOptionsRules: function() { return this.callBase().concat(deviceDependentOptions(), [{ device: function(device) { return support.nativeScrolling && "android" === devices.real().platform }, options: { useSimulatedScrollbar: true } }, { device: function(device) { return "ios" === devices.real().platform }, options: { pushBackValue: 1 } }]) }, _initOptions: function(options) { this.callBase(options); if (!("useSimulatedScrollbar" in options)) { this._setUseSimulatedScrollbar() } }, _setUseSimulatedScrollbar: function() { if (!this.initialOption("useSimulatedScrollbar")) { this.option("useSimulatedScrollbar", !this.option("useNative")) } }, _init: function() { this.callBase(); this._initMarkup(); this._attachNativeScrollbarsCustomizationCss(); this._locked = false }, _visibilityChanged: function(visible) { if (this.element().is(":hidden")) { return } if (visible) { this.update(); this._toggleRTLDirection(this.option("rtlEnabled")); this._savedScrollOffset && this.scrollTo(this._savedScrollOffset); delete this._savedScrollOffset } else { this._savedScrollOffset = this.scrollOffset() } }, _initMarkup: function() { var $element = this.element().addClass(SCROLLABLE_CLASS), $container = this._$container = $("
").addClass(SCROLLABLE_CONTAINER_CLASS), $content = this._$content = $("
").addClass(SCROLLABLE_CONTENT_CLASS); if (beforeActivateExists) { $element.on(eventUtils.addNamespace("beforeactivate", SCROLLABLE), function(e) { if (!$(e.target).is(selectors.focusable)) { e.preventDefault() } }) } $content.append($element.contents()).appendTo($container); $container.appendTo($element) }, _dimensionChanged: function() { this.update() }, _attachNativeScrollbarsCustomizationCss: function() { if (!(navigator.platform.indexOf("Mac") > -1 && browser.webkit)) { this.element().addClass("dx-scrollable-customizable-scrollbars") } }, _render: function() { this._renderPushBackOffset(); this._renderDirection(); this._renderStrategy(); this._attachEventHandlers(); this._renderDisabledState(); this._createActions(); this.update(); this.callBase() }, _renderPushBackOffset: function() { var pushBackValue = this.option("pushBackValue"); if (!pushBackValue && !this._lastPushBackValue) { return } this._$content.css({ paddingTop: pushBackValue, paddingBottom: pushBackValue }); this._lastPushBackValue = pushBackValue }, _toggleRTLDirection: function(rtl) { var that = this; this.callBase(rtl); if (rtl && this.option("direction") !== VERTICAL) { commonUtils.deferUpdate(function() { var left = that.scrollWidth() - that.clientWidth(); commonUtils.deferRender(function() { that.scrollTo({ left: left }) }) }) } }, _attachEventHandlers: function() { var strategy = this._strategy; var initEventData = { getDirection: $.proxy(strategy.getDirection, strategy), validate: $.proxy(this._validate, this), isNative: this.option("useNative") }; this._$container.off("." + SCROLLABLE).on(eventUtils.addNamespace("scroll", SCROLLABLE), $.proxy(strategy.handleScroll, strategy)).on(eventUtils.addNamespace(scrollEvents.init, SCROLLABLE), initEventData, $.proxy(this._initHandler, this)).on(eventUtils.addNamespace(scrollEvents.start, SCROLLABLE), $.proxy(strategy.handleStart, strategy)).on(eventUtils.addNamespace(scrollEvents.move, SCROLLABLE), $.proxy(strategy.handleMove, strategy)).on(eventUtils.addNamespace(scrollEvents.end, SCROLLABLE), $.proxy(strategy.handleEnd, strategy)).on(eventUtils.addNamespace(scrollEvents.cancel, SCROLLABLE), $.proxy(strategy.handleCancel, strategy)).on(eventUtils.addNamespace(scrollEvents.stop, SCROLLABLE), $.proxy(strategy.handleStop, strategy)) }, _validate: function(e) { if (this._isLocked()) { return false } this._updateIfNeed(); return this._strategy.validate(e) }, _initHandler: function() { var strategy = this._strategy; strategy.handleInit.apply(strategy, arguments) }, _renderDisabledState: function() { this.element().toggleClass(SCROLLABLE_DISABLED_CLASS, this.option("disabled")); if (this.option("disabled")) { this._lock() } else { this._unlock() } }, _renderDirection: function() { this.element().removeClass("dx-scrollable-" + HORIZONTAL).removeClass("dx-scrollable-" + VERTICAL).removeClass("dx-scrollable-" + BOTH).addClass("dx-scrollable-" + this.option("direction")) }, _renderStrategy: function() { this._createStrategy(); this._strategy.render(); this.element().data(SCROLLABLE_STRATEGY, this._strategy) }, _createStrategy: function() { this._strategy = this.option("useNative") ? new NativeStrategy(this) : new simulatedStrategy.SimulatedStrategy(this) }, _createActions: function() { this._strategy.createActions() }, _clean: function() { this._strategy.dispose() }, _optionChanged: function(args) { switch (args.name) { case "onStart": case "onEnd": case "onStop": case "onUpdated": case "onScroll": case "onBounce": this._createActions(); break; case "direction": this._resetInactiveDirection(); this._invalidate(); break; case "useNative": this._setUseSimulatedScrollbar(); this._invalidate(); break; case "inertiaEnabled": case "bounceEnabled": case "scrollByContent": case "scrollByThumb": case "bounceEnabled": case "useKeyboard": case "showScrollbar": case "useSimulatedScrollbar": case "pushBackValue": this._invalidate(); break; case "disabled": this._renderDisabledState(); break; case "updateManually": break; default: this.callBase(args) } }, _resetInactiveDirection: function() { var inactiveProp = this._getInactiveProp(); if (!inactiveProp) { return } var scrollOffset = this.scrollOffset(); scrollOffset[inactiveProp] = 0; this.scrollTo(scrollOffset) }, _getInactiveProp: function() { var direction = this.option("direction"); if (direction === VERTICAL) { return "left" } if (direction === HORIZONTAL) { return "top" } }, _location: function() { return this._strategy.location() }, _normalizeLocation: function(location) { if ($.isPlainObject(location)) { var left = commonUtils.ensureDefined(location.left, location.x); var top = commonUtils.ensureDefined(location.top, location.y); return { left: commonUtils.isDefined(left) ? -left : void 0, top: commonUtils.isDefined(top) ? -top : void 0 } } else { var direction = this.option("direction"); return { left: direction !== VERTICAL ? -location : void 0, top: direction !== HORIZONTAL ? -location : void 0 } } }, _isLocked: function() { return this._locked }, _lock: function() { this._locked = true }, _unlock: function() { if (!this.option("disabled")) { this._locked = false } }, _isDirection: function(direction) { var current = this.option("direction"); if (direction === VERTICAL) { return current !== HORIZONTAL } if (direction === HORIZONTAL) { return current !== VERTICAL } return current === direction }, _updateAllowedDirection: function() { var allowedDirections = this._strategy._allowedDirections(); if (this._isDirection(BOTH) && allowedDirections.vertical && allowedDirections.horizontal) { this._allowedDirectionValue = BOTH } else { if (this._isDirection(HORIZONTAL) && allowedDirections.horizontal) { this._allowedDirectionValue = HORIZONTAL } else { if (this._isDirection(VERTICAL) && allowedDirections.vertical) { this._allowedDirectionValue = VERTICAL } else { this._allowedDirectionValue = null } } } }, _allowedDirection: function() { return this._allowedDirectionValue }, _container: function() { return this._$container }, content: function() { return this._$content }, scrollOffset: function() { var location = this._location(); return { top: -location.top, left: -location.left } }, scrollTop: function() { return this.scrollOffset().top }, scrollLeft: function() { return this.scrollOffset().left }, clientHeight: function() { return this._$container.height() }, scrollHeight: function() { return this.content().outerHeight() - 2 * this.option("pushBackValue") }, clientWidth: function() { return this._$container.width() }, scrollWidth: function() { return this.content().outerWidth() }, update: function() { var that = this; return $.when(that._strategy.update()).done(function() { that._updateAllowedDirection() }) }, scrollBy: function(distance) { distance = this._normalizeLocation(distance); if (!distance.top && !distance.left) { return } this._updateIfNeed(); this._strategy.scrollBy(distance) }, scrollTo: function(targetLocation) { targetLocation = this._normalizeLocation(targetLocation); this._updateIfNeed(); var location = this._location(); var distance = this._normalizeLocation({ left: location.left - commonUtils.ensureDefined(targetLocation.left, location.left), top: location.top - commonUtils.ensureDefined(targetLocation.top, location.top) }); if (!distance.top && !distance.left) { return } this._strategy.scrollBy(distance) }, scrollToElement: function(element, offset) { offset = offset || {}; var $element = $(element); var elementInsideContent = this.content().find(element).length; var elementIsInsideContent = $element.parents("." + SCROLLABLE_CLASS).length - $element.parents("." + SCROLLABLE_CONTENT_CLASS).length === 0; if (!elementInsideContent || !elementIsInsideContent) { return } var scrollPosition = { top: 0, left: 0 }; var direction = this.option("direction"); if (direction !== VERTICAL) { scrollPosition.left = this._scrollToElementPosition($element, HORIZONTAL, offset) } if (direction !== HORIZONTAL) { scrollPosition.top = this._scrollToElementPosition($element, VERTICAL, offset) } this.scrollTo(scrollPosition) }, _scrollToElementPosition: function($element, direction, offset) { var isVertical = direction === VERTICAL; var startOffset = (isVertical ? offset.top : offset.left) || 0; var endOffset = (isVertical ? offset.bottom : offset.right) || 0; var pushBackOffset = isVertical ? this.option("pushBackValue") : 0; var elementPositionRelativeToContent = this._elementPositionRelativeToContent($element, isVertical ? "top" : "left"); var elementPosition = elementPositionRelativeToContent - pushBackOffset; var elementSize = $element[isVertical ? "outerHeight" : "outerWidth"](); var scrollLocation = isVertical ? this.scrollTop() : this.scrollLeft(); var clientSize = isVertical ? this.clientHeight() : this.clientWidth(); var startDistance = scrollLocation - elementPosition + startOffset; var endDistance = scrollLocation - elementPosition - elementSize + clientSize - endOffset; if (startDistance <= 0 && endDistance >= 0) { return scrollLocation } return scrollLocation - (Math.abs(startDistance) > Math.abs(endDistance) ? endDistance : startDistance) }, _elementPositionRelativeToContent: function($element, prop) { var result = 0; while (this._hasScrollContent($element)) { result += $element.position()[prop]; $element = $element.offsetParent() } return result }, _hasScrollContent: function($element) { var $content = this.content(); return $element.closest($content).length && !$element.is($content) }, _updateIfNeed: function() { if (!this.option("updateManually")) { this.update() } } }); registerComponent(SCROLLABLE, Scrollable); exports.default = Scrollable; exports.deviceDependentOptions = deviceDependentOptions }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************************!*\ !*** ./Scripts/core/utils/variable_wrapper.js ***! \************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var logger = __webpack_require__( /*! ./console */ 36).logger, dependencyInjector = __webpack_require__( /*! ./dependency_injector */ 80); module.exports = dependencyInjector({ isWrapped: function(value) { return false }, isWritableWrapped: function(value) { return false }, wrap: function(value) { return value }, unwrap: function(value) { return value }, assign: function(variable, value) { logger.error("Method 'assign' should not be used for not wrapped variables. Use 'isWrapped' method for enshuring.") } }) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!******************************************************!*\ !*** ./Scripts/ui/pivot_grid/ui.pivot_grid.utils.js ***! \******************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), formatHelper = __webpack_require__( /*! ../../format_helper */ 68); exports.setFieldProperty = function(field, property, value, isInitialization) { var initProperties = field._initProperties = field._initProperties || {}, initValue = isInitialization ? value : field[property]; if (!initProperties.hasOwnProperty(property) || isInitialization) { initProperties[property] = initValue } field[property] = value }; exports.sendRequest = function(options) { return $.ajax(options) }; var foreachTreeAsyncDate = new Date; function createForeachTreeFunc(isAsync) { var foreachTreeFunc = function(items, callback, parentAtFirst, members, index, isChildrenProcessing) { members = members || []; items = items || []; var item, i, deferred, childrenDeferred; index = index || 0; function createForeachTreeAsyncHandler(deferred, i, isChildrenProcessing) { $.when(foreachTreeFunc(items, callback, parentAtFirst, members, i, isChildrenProcessing)).done(deferred.resolve) } for (i = index; i < items.length; i++) { if (isAsync && i > index && i % 1e4 === 0 && new Date - foreachTreeAsyncDate >= 300) { foreachTreeAsyncDate = new Date; deferred = $.Deferred(); setTimeout(createForeachTreeAsyncHandler(deferred, i, false), 0); return deferred } item = items[i]; if (!isChildrenProcessing) { members.unshift(item); if (parentAtFirst && false === callback(members, i)) { return } if (item.children) { childrenDeferred = foreachTreeFunc(item.children, callback, parentAtFirst, members); if (isAsync && childrenDeferred) { deferred = $.Deferred(); childrenDeferred.done(createForeachTreeAsyncHandler(deferred, i, true)); return deferred } } } isChildrenProcessing = false; if (!parentAtFirst && false === callback(members, i)) { return } members.shift(); if (items[i] !== item) { i-- } } }; return foreachTreeFunc } exports.foreachTree = createForeachTreeFunc(false); exports.foreachTreeAsync = createForeachTreeFunc(true); exports.findField = function(fields, id) { var i, field; if (fields && commonUtils.isDefined(id)) { for (i = 0; i < fields.length; i++) { field = fields[i]; if (field.name === id || field.caption === id || field.dataField === id || field.index === id) { return i } } } return -1 }; exports.formatValue = function(value, options) { var formatObject = { value: value, valueText: formatHelper.format(value, options.format, options.precision) || "" }; return options.customizeText ? options.customizeText.call(options, formatObject) : formatObject.valueText }; exports.getCompareFunction = function(valueSelector) { return function(a, b) { var result = 0; if (valueSelector(a) > valueSelector(b)) { result = 1 } else { if (valueSelector(a) < valueSelector(b)) { result = -1 } } return result } }; exports.createPath = function(items) { var i, result = []; for (i = items.length - 1; i >= 0; i--) { result.push(items[i].key || items[i].value) } return result }; exports.foreachDataLevel = function foreachDataLevel(data, callback, index, childrenField) { var item, i; index = index || 0; childrenField = childrenField || "children"; if (data.length) { callback(data, index) } for (i = 0; i < data.length; i++) { item = data[i]; if (item[childrenField] && item[childrenField].length) { foreachDataLevel(item[childrenField], callback, index + 1, childrenField) } } }; exports.mergeArraysByMaxValue = function(values1, values2) { var i, result = []; for (i = 0; i < values1.length; i++) { result.push(Math.max(values1[i] || 0, values2[i] || 0)) } return result } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************!*\ !*** ./Scripts/animation/frame.js ***! \************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), FRAME_ANIMATION_STEP_TIME = 1e3 / 60, requestAnimationFrame = function(callback) { return this.setTimeout(callback, FRAME_ANIMATION_STEP_TIME) }, cancelAnimationFrame = function(requestID) { this.clearTimeout(requestID) }, nativeRequestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame, nativeCancelAnimationFrame = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame; if (nativeRequestAnimationFrame && nativeCancelAnimationFrame) { requestAnimationFrame = nativeRequestAnimationFrame; cancelAnimationFrame = nativeCancelAnimationFrame } if (nativeRequestAnimationFrame && !nativeCancelAnimationFrame) { var canceledRequests = {}; requestAnimationFrame = function(callback) { var requestId = nativeRequestAnimationFrame.call(window, function() { try { if (requestId in canceledRequests) { return } callback.apply(this, arguments) } finally { delete canceledRequests[requestId] } }); return requestId }; cancelAnimationFrame = function(requestId) { canceledRequests[requestId] = true } } requestAnimationFrame = $.proxy(requestAnimationFrame, window); cancelAnimationFrame = $.proxy(cancelAnimationFrame, window); exports.requestAnimationFrame = requestAnimationFrame; exports.cancelAnimationFrame = cancelAnimationFrame }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*********************************************!*\ !*** ./Scripts/events/gesture/swipeable.js ***! \*********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), swipeEvents = __webpack_require__( /*! ../swipe */ 82), DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 39), eventUtils = __webpack_require__( /*! ../utils */ 4); var DX_SWIPEABLE = "dxSwipeable", SWIPEABLE_CLASS = "dx-swipeable", ACTION_TO_EVENT_MAP = { onStart: swipeEvents.start, onUpdated: swipeEvents.swipe, onEnd: swipeEvents.end, onCancel: "dxswipecancel" }; var Swipeable = DOMComponent.inherit({ _getDefaultOptions: function() { return $.extend(this.callBase(), { elastic: true, immediate: false, direction: "horizontal", itemSizeFunc: null, onStart: null, onUpdated: null, onEnd: null, onCancel: null }) }, _render: function() { this.callBase(); this.element().addClass(SWIPEABLE_CLASS); this._attachEventHandlers() }, _attachEventHandlers: function() { this._detachEventHandlers(); if (this.option("disabled")) { return } var NAME = this.NAME; this._createEventData(); $.each(ACTION_TO_EVENT_MAP, $.proxy(function(actionName, eventName) { var action = this._createActionByOption(actionName, { context: this }); eventName = eventUtils.addNamespace(eventName, NAME); this.element().on(eventName, this._eventData, function(e) { return action({ jQueryEvent: e }) }) }, this)) }, _createEventData: function() { this._eventData = { elastic: this.option("elastic"), itemSizeFunc: this.option("itemSizeFunc"), direction: this.option("direction"), immediate: this.option("immediate") } }, _detachEventHandlers: function() { this.element().off("." + DX_SWIPEABLE) }, _optionChanged: function(args) { switch (args.name) { case "disabled": case "onStart": case "onUpdated": case "onEnd": case "onCancel": case "elastic": case "immediate": case "itemSizeFunc": case "direction": this._detachEventHandlers(); this._attachEventHandlers(); break; case "rtlEnabled": break; default: this.callBase(args) } } }); Swipeable.publicName(DX_SWIPEABLE); module.exports = Swipeable }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************!*\ !*** ./Scripts/core/utils/icon.js ***! \************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1); var getImageSourceType = function(source) { if (!source || "string" !== typeof source) { return false } if (/data:.*base64|\.|\//.test(source)) { return "image" } if (/^[\w-_]+$/.test(source)) { return "dxIcon" } return "fontIcon" }; var getImageContainer = function(source) { var imageType = getImageSourceType(source), ICON_CLASS = "dx-icon"; switch (imageType) { case "image": return $("", { src: source }).addClass(ICON_CLASS); case "fontIcon": return $("", { "class": ICON_CLASS + " " + source }); case "dxIcon": return $("", { "class": ICON_CLASS + " " + ICON_CLASS + "-" + source }); default: return null } }; exports.getImageSourceType = getImageSourceType; exports.getImageContainer = getImageContainer }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************!*\ !*** ./Scripts/events/core/wheel.js ***! \**************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), registerEvent = __webpack_require__( /*! ./event_registrator */ 43), eventUtils = __webpack_require__( /*! ../utils */ 4); var EVENT_NAME = "dxmousewheel", EVENT_NAMESPACE = "dxWheel"; $.event.fixHooks.wheel = $.event.mouseHooks; var wheelEvent = void 0 !== document.onwheel ? "wheel" : "mousewheel"; var wheel = { setup: function(element, data) { var $element = $(element); $element.on(eventUtils.addNamespace(wheelEvent, EVENT_NAMESPACE), $.proxy(wheel._wheelHandler, wheel)) }, teardown: function(element) { var $element = $(element); $element.off("." + EVENT_NAMESPACE) }, _wheelHandler: function(e) { var delta = this._getWheelDelta(e.originalEvent); eventUtils.fireEvent({ type: EVENT_NAME, originalEvent: e, delta: delta, pointerType: "mouse" }); e.stopPropagation() }, _getWheelDelta: function(event) { return event.wheelDelta ? event.wheelDelta : 30 * -event.deltaY } }; registerEvent(EVENT_NAME, wheel); exports.name = EVENT_NAME }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**********************************!*\ !*** ./Scripts/ui/number_box.js ***! \**********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { module.exports = __webpack_require__( /*! ./number_box/number_box */ 392) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************************!*\ !*** ./Scripts/core/utils/dependency_injector.js ***! \***************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { module.exports = function(object) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../class */ 5); var BaseClass = Class.inherit(object), InjectedClass = BaseClass, instance = new InjectedClass(object), initialFields = {}; var injectFields = function(injectionObject, initial) { $.each(injectionObject, function(key) { if ($.isFunction(instance[key])) { if (initial || !object[key]) { object[key] = function() { return instance[key].apply(object, arguments) } } } else { if (initial) { initialFields[key] = object[key] } object[key] = instance[key] } }) }; injectFields(object, true); object.inject = function(injectionObject) { InjectedClass = InjectedClass.inherit(injectionObject); instance = new InjectedClass; injectFields(injectionObject) }; object.resetInjection = function() { $.extend(object, initialFields); InjectedClass = BaseClass; instance = new BaseClass }; return object } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************************!*\ !*** ./Scripts/events/core/emitter.js ***! \****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../../core/class */ 5), eventUtils = __webpack_require__( /*! ../utils */ 4); var Emitter = Class.inherit({ ctor: function(element) { this._$element = $(element); this._cancelCallback = $.Callbacks(); this._acceptCallback = $.Callbacks() }, getElement: function() { return this._$element }, validate: function(e) { return "dxmousewheel" !== e.type }, validatePointers: function(e) { return 1 === eventUtils.hasTouches(e) }, allowInterruptionByMousewheel: function() { return true }, configurate: function(data) { $.extend(this, data) }, addCancelCallback: function(callback) { this._cancelCallback.add(callback) }, removeCancelCallback: function() { this._cancelCallback.empty() }, _cancel: function(e) { this._cancelCallback.fire(this, e) }, addAcceptCallback: function(callback) { this._acceptCallback.add(callback) }, removeAcceptCallback: function() { this._acceptCallback.empty() }, _accept: function(e) { this._acceptCallback.fire(this, e) }, _requestAccept: function(e) { this._acceptRequestEvent = e }, _forgetAccept: function() { this._accept(this._acceptRequestEvent); this._acceptRequestEvent = null }, start: $.noop, move: $.noop, end: $.noop, cancel: $.noop, reset: function() { if (this._acceptRequestEvent) { this._accept(this._acceptRequestEvent) } }, _fireEvent: function(eventName, e, params) { var eventData = $.extend({ type: eventName, originalEvent: e, target: this._getEmitterTarget(e), delegateTarget: this.getElement().get(0) }, params); e = eventUtils.fireEvent(eventData); if (e.cancel) { this._cancel(e) } return e }, _getEmitterTarget: function(e) { return (this.delegateSelector ? $(e.target).closest(this.delegateSelector) : this.getElement()).get(0) }, dispose: $.noop }); module.exports = Emitter }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*********************************!*\ !*** ./Scripts/events/swipe.js ***! \*********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var eventUtils = __webpack_require__( /*! ./utils */ 4), GestureEmitter = __webpack_require__( /*! ./gesture/emitter.gesture */ 120), registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 61); var SWIPE_START_EVENT = "dxswipestart", SWIPE_EVENT = "dxswipe", SWIPE_END_EVENT = "dxswipeend"; var HorizontalStrategy = { defaultItemSizeFunc: function() { return this.getElement().width() }, getBounds: function() { return [this._maxLeftOffset, this._maxRightOffset] }, calcOffsetRatio: function(e) { var endEventData = eventUtils.eventData(e); return (endEventData.x - (this._savedEventData && this._savedEventData.x || 0)) / this._itemSizeFunc().call(this, e) }, isFastSwipe: function(e) { var endEventData = eventUtils.eventData(e); return this.FAST_SWIPE_SPEED_LIMIT * Math.abs(endEventData.x - this._tickData.x) >= endEventData.time - this._tickData.time } }; var VerticalStrategy = { defaultItemSizeFunc: function() { return this.getElement().height() }, getBounds: function() { return [this._maxTopOffset, this._maxBottomOffset] }, calcOffsetRatio: function(e) { var endEventData = eventUtils.eventData(e); return (endEventData.y - (this._savedEventData && this._savedEventData.y || 0)) / this._itemSizeFunc().call(this, e) }, isFastSwipe: function(e) { var endEventData = eventUtils.eventData(e); return this.FAST_SWIPE_SPEED_LIMIT * Math.abs(endEventData.y - this._tickData.y) >= endEventData.time - this._tickData.time } }; var STRATEGIES = { horizontal: HorizontalStrategy, vertical: VerticalStrategy }; var SwipeEmitter = GestureEmitter.inherit({ TICK_INTERVAL: 300, FAST_SWIPE_SPEED_LIMIT: 10, ctor: function(element) { this.callBase(element); this.direction = "horizontal"; this.elastic = true }, _getStrategy: function() { return STRATEGIES[this.direction] }, _defaultItemSizeFunc: function() { return this._getStrategy().defaultItemSizeFunc.call(this) }, _itemSizeFunc: function() { return this.itemSizeFunc || this._defaultItemSizeFunc }, _init: function(e) { this._tickData = eventUtils.eventData(e) }, _start: function(e) { this._savedEventData = eventUtils.eventData(e); e = this._fireEvent(SWIPE_START_EVENT, e); if (!e.cancel) { this._maxLeftOffset = e.maxLeftOffset; this._maxRightOffset = e.maxRightOffset; this._maxTopOffset = e.maxTopOffset; this._maxBottomOffset = e.maxBottomOffset } }, _move: function(e) { var strategy = this._getStrategy(), moveEventData = eventUtils.eventData(e), offset = strategy.calcOffsetRatio.call(this, e); offset = this._fitOffset(offset, this.elastic); if (moveEventData.time - this._tickData.time > this.TICK_INTERVAL) { this._tickData = moveEventData } this._fireEvent(SWIPE_EVENT, e, { offset: offset }); e.preventDefault() }, _end: function(e) { var strategy = this._getStrategy(), offsetRatio = strategy.calcOffsetRatio.call(this, e), isFast = strategy.isFastSwipe.call(this, e), startOffset = offsetRatio, targetOffset = this._calcTargetOffset(offsetRatio, isFast); startOffset = this._fitOffset(startOffset, this.elastic); targetOffset = this._fitOffset(targetOffset, false); this._fireEvent(SWIPE_END_EVENT, e, { offset: startOffset, targetOffset: targetOffset }) }, _fitOffset: function(offset, elastic) { var strategy = this._getStrategy(), bounds = strategy.getBounds.call(this); if (offset < -bounds[0]) { return elastic ? (-2 * bounds[0] + offset) / 3 : -bounds[0] } if (offset > bounds[1]) { return elastic ? (2 * bounds[1] + offset) / 3 : bounds[1] } return offset }, _calcTargetOffset: function(offsetRatio, isFast) { var result; if (isFast) { result = Math.ceil(Math.abs(offsetRatio)); if (offsetRatio < 0) { result = -result } } else { result = Math.round(offsetRatio) } return result } }); registerEmitter({ emitter: SwipeEmitter, events: [SWIPE_START_EVENT, SWIPE_EVENT, SWIPE_END_EVENT] }); exports.swipe = SWIPE_EVENT; exports.start = SWIPE_START_EVENT; exports.end = SWIPE_END_EVENT }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************************!*\ !*** ./Scripts/framework/navigation_manager.js ***! \*************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../core/class */ 5), commonUtils = __webpack_require__( /*! ../core/utils/common */ 2), navigationDevices = __webpack_require__( /*! ./navigation_devices */ 115), EventsMixin = __webpack_require__( /*! ../core/events_mixin */ 32), errors = __webpack_require__( /*! ./errors */ 44), hardwareBackButton = __webpack_require__( /*! ../mobile/process_hardware_back_button */ 219).processCallback, hideTopOverlay = __webpack_require__( /*! ../mobile/hide_top_overlay */ 100); var NAVIGATION_TARGETS = { current: "current", blank: "blank", back: "back" }, STORAGE_HISTORY_KEY = "__history"; var HistoryBasedNavigationManager = Class.inherit({ ctor: function(options) { options = options || {}; this._currentItem = void 0; this._previousItem = void 0; this._createNavigationDevice(options) }, _createNavigationDevice: function(options) { this._navigationDevice = options.navigationDevice || new navigationDevices.HistoryBasedNavigationDevice; this._navigationDevice.uriChanged.add($.proxy(this._uriChangedHandler, this)) }, _uriChangedHandler: function(uri) { while (hideTopOverlay()) {} this.navigate(uri) }, _syncUriWithCurrentNavigationItem: function() { var currentUri = this._currentItem && this._currentItem.uri; this._navigationDevice.setUri(currentUri, true) }, _cancelNavigation: function(args) { this._syncUriWithCurrentNavigationItem(); this.fireEvent("navigationCanceled", [args]) }, _getDefaultOptions: function() { return { direction: "none", target: NAVIGATION_TARGETS.blank } }, _updateHistory: function(uri, options) { this._previousItem = this._currentItem; this._currentItem = { uri: uri, key: uri }; this._navigationDevice.setUri(uri, options.target === NAVIGATION_TARGETS.current) }, _setCurrentItem: function(item) { this._currentItem = item }, navigate: function(uri, options) { options = options || {}; var args, that = this, isFirstNavigate = !that._currentItem, currentItem = that._currentItem || {}, targetItem = options.item || {}, currentUri = currentItem.uri, currentKey = currentItem.key, targetKey = targetItem.key; if (void 0 === uri) { uri = that._navigationDevice.getUri() } if (/^_back$/.test(uri)) { that.back(); return } options = $.extend(that._getDefaultOptions(), options || {}); if (isFirstNavigate) { options.target = NAVIGATION_TARGETS.current } args = { currentUri: currentUri, uri: uri, cancel: false, navigateWhen: [], options: options }; that.fireEvent("navigating", [args]); uri = args.uri; if (args.cancel || currentUri === uri && (void 0 === targetKey || targetKey === currentKey) && !that._forceNavigate) { that._cancelNavigation(args) } else { that._forceNavigate = false; $.when.apply($, args.navigateWhen).done(function() { commonUtils.executeAsync(function() { that._updateHistory(uri, options); that.fireEvent("navigated", [{ uri: uri, previousUri: currentUri, options: options, item: that._currentItem }]) }) }) } }, back: function() { return this._navigationDevice.back() }, previousItem: function() { return this._previousItem }, currentItem: function(item) { if (arguments.length > 0) { if (!item) { throw errors.Error("E3023") } this._setCurrentItem(item) } else { return this._currentItem } }, rootUri: function() { return this._currentItem && this._currentItem.uri }, canBack: function() { return true }, saveState: $.noop, restoreState: $.noop, removeState: $.noop }).include(EventsMixin); var StackBasedNavigationManager = HistoryBasedNavigationManager.inherit({ ctor: function(options) { options = options || {}; this.callBase(options); this._createNavigationStacks(options); hardwareBackButton.add($.proxy(this._deviceBackInitiated, this)); this._stateStorageKey = options.stateStorageKey || STORAGE_HISTORY_KEY }, init: function() { return this._navigationDevice.init() }, _createNavigationDevice: function(options) { if (!options.navigationDevice) { options.navigationDevice = new navigationDevices.StackBasedNavigationDevice } this.callBase(options); this._navigationDevice.backInitiated.add($.proxy(this._deviceBackInitiated, this)) }, _uriChangedHandler: function(uri) { this.navigate(uri) }, _createNavigationStacks: function(options) { this.navigationStacks = {}; this._keepPositionInStack = options.keepPositionInStack; this.currentStack = new NavigationStack }, _deviceBackInitiated: function() { if (!hideTopOverlay()) { this.back({ isHardwareButton: true }) } else { this._syncUriWithCurrentNavigationItem() } }, _getDefaultOptions: function() { return { target: NAVIGATION_TARGETS.blank } }, _createNavigationStack: function() { var result = new NavigationStack; result.itemsRemoved.add($.proxy(this._removeItems, this)); return result }, _setCurrentItem: function(item) { this._setCurrentStack(item.stack); this.currentStack.currentItem(item); this.callBase(item); this._syncUriWithCurrentNavigationItem() }, _setCurrentStack: function(stackOrStackKey) { var stack, stackKey; if ("string" === typeof stackOrStackKey) { stackKey = stackOrStackKey; if (!(stackKey in this.navigationStacks)) { this.navigationStacks[stackKey] = this._createNavigationStack() } stack = this.navigationStacks[stackKey] } else { stack = stackOrStackKey; stackKey = $.map(this.navigationStacks, function(stack, key) { if (stack === stackOrStackKey) { return key } return null })[0] } this.currentStack = stack; this.currentStackKey = stackKey }, _getViewTargetStackKey: function(uri, isRoot) { var result; if (isRoot) { if (void 0 !== this.navigationStacks[uri]) { result = uri } else { for (var stackKey in this.navigationStacks) { if (this.navigationStacks[stackKey].items[0].uri === uri) { result = stackKey; break } } result = result || uri } } else { result = this.currentStackKey || uri } return result }, _updateHistory: function(uri, options) { var isRoot = options.root, forceIsRoot = isRoot, forceToRoot = false, previousStack = this.currentStack, keepPositionInStack = void 0 !== options.keepPositionInStack ? options.keepPositionInStack : this._keepPositionInStack; options.stack = options.stack || this._getViewTargetStackKey(uri, isRoot); this._setCurrentStack(options.stack); if (isRoot || !this.currentStack.items.length) { forceToRoot = this.currentStack === previousStack; forceIsRoot = true } if (isRoot && this.currentStack.items.length) { if (!keepPositionInStack || forceToRoot) { this.currentStack.currentIndex = 0; if (this.currentItem().uri !== uri) { this.currentStack.navigate(uri, true) } } options.direction = options.direction || "none" } else { var prevIndex = this.currentStack.currentIndex, prevItem = this.currentItem() || {}; switch (options.target) { case NAVIGATION_TARGETS.blank: this.currentStack.navigate(uri); break; case NAVIGATION_TARGETS.current: this.currentStack.navigate(uri, true); break; case NAVIGATION_TARGETS.back: if (this.currentStack.currentIndex > 0) { this.currentStack.back(uri) } else { this.currentStack.navigate(uri, true) } break; default: throw errors.Error("E3006", options.target) } if (void 0 === options.direction) { var indexDelta = this.currentStack.currentIndex - prevIndex; if (indexDelta < 0) { options.direction = this.currentStack.currentItem().backDirection || "backward" } else { if (indexDelta > 0 && this.currentStack.currentIndex > 0) { options.direction = "forward" } else { options.direction = "none" } } } prevItem.backDirection = "forward" === options.direction ? "backward" : "none" } options.root = forceIsRoot; this._currentItem = this.currentStack.currentItem(); this._syncUriWithCurrentNavigationItem() }, _removeItems: function(items) { var that = this; $.each(items, function(index, item) { that.fireEvent("itemRemoved", [item]) }) }, back: function(options) { options = options || {}; var navigatingBackArgs = $.extend({ cancel: false }, options); this.fireEvent("navigatingBack", [navigatingBackArgs]); if (navigatingBackArgs.cancel) { this._syncUriWithCurrentNavigationItem(); return } var item = this.previousItem(navigatingBackArgs.stack); if (item) { this.navigate(item.uri, { stack: navigatingBackArgs.stack, target: NAVIGATION_TARGETS.back, item: item }) } else { this.callBase() } }, rootUri: function() { return this.currentStack.items.length ? this.currentStack.items[0].uri : this.callBase() }, canBack: function(stackKey) { var stack = stackKey ? this.navigationStacks[stackKey] : this.currentStack; return stack.canBack() }, saveState: function(storage) { if (this.currentStack.items.length) { var state = { navigationStacks: {}, currentStackKey: this.currentStackKey }; $.each(this.navigationStacks, function(stackKey, stack) { var stackState = {}; state.navigationStacks[stackKey] = stackState; stackState.currentIndex = stack.currentIndex; stackState.items = $.map(stack.items, function(item) { return { key: item.key, uri: item.uri } }) }); var json = JSON.stringify(state); storage.setItem(this._stateStorageKey, json) } else { this.removeState(storage) } }, restoreState: function(storage) { if (this.disableRestoreState) { return } var json = storage.getItem(this._stateStorageKey); if (json) { try { var that = this, state = JSON.parse(json); $.each(state.navigationStacks, function(stackKey, stackState) { var stack = that._createNavigationStack(); that.navigationStacks[stackKey] = stack; stack.currentIndex = stackState.currentIndex; stack.items = $.map(stackState.items, function(item) { item.stack = stack; return item }) }); this.currentStackKey = state.currentStackKey; this.currentStack = this.navigationStacks[this.currentStackKey]; this._currentItem = this.currentStack.currentItem(); this._navigationDevice.setUri(this.currentItem().uri); this._forceNavigate = true } catch (e) { this.removeState(storage); throw errors.Error("E3007") } } }, removeState: function(storage) { storage.removeItem(this._stateStorageKey) }, currentIndex: function() { return this.currentStack.currentIndex }, previousItem: function(stackKey) { var stack = this.navigationStacks[stackKey] || this.currentStack; return stack.previousItem() }, getItemByIndex: function(index) { return this.currentStack.items[index] }, clearHistory: function() { this._createNavigationStacks({ keepPositionInStack: this._keepPositionInStack }) }, itemByKey: function(itemKey) { var result; $.each(this.navigationStacks, function(stackKey, stack) { var item = stack.itemByKey(itemKey); if (item) { result = item; return false } }); return result }, currentItem: function(itemOrItemKey) { var item; if (arguments.length > 0) { if ("string" === typeof itemOrItemKey) { item = this.itemByKey(itemOrItemKey) } else { if ($.isPlainObject(itemOrItemKey)) { item = itemOrItemKey } } this.callBase(item) } else { return this.callBase() } } }); var NavigationStack = Class.inherit({ ctor: function(options) { options = options || {}; this.itemsRemoved = $.Callbacks(); this.clear() }, currentItem: function(item) { if (item) { for (var i = 0; i < this.items.length; i++) { if (item === this.items[i]) { this.currentIndex = i; break } } } else { return this.items[this.currentIndex] } }, previousItem: function() { return this.items.length > 1 ? this.items[this.currentIndex - 1] : void 0 }, canBack: function() { return this.currentIndex > 0 }, clear: function() { this._deleteItems(this.items); this.items = []; this.currentIndex = -1 }, back: function(uri) { this.currentIndex--; if (this.currentIndex < 0) { throw errors.Error("E3008") } var currentItem = this.currentItem(); if (currentItem.uri !== uri) { this._updateItem(this.currentIndex, uri) } }, forward: function() { this.currentIndex++; if (this.currentIndex >= this.items.length) { throw errors.Error("E3009") } }, navigate: function(uri, replaceCurrent) { if (this.currentIndex < this.items.length && this.currentIndex > -1 && this.items[this.currentIndex].uri === uri) { return } if (replaceCurrent && this.currentIndex > -1) { this.currentIndex-- } if (this.currentIndex + 1 < this.items.length && this.items[this.currentIndex + 1].uri === uri) { this.currentIndex++ } else { var toDelete = this.items.splice(this.currentIndex + 1, this.items.length - this.currentIndex - 1); this.items.push({ stack: this }); this.currentIndex++; this._updateItem(this.currentIndex, uri); this._deleteItems(toDelete) } return this.currentItem() }, itemByKey: function(key) { for (var i = 0; i < this.items.length; i++) { var item = this.items[i]; if (item.key === key) { return item } } }, _updateItem: function(index, uri) { var item = this.items[index]; item.uri = uri; item.key = this.items[0].uri + "_" + index + "_" + uri }, _deleteItems: function(items) { if (items) { this.itemsRemoved.fire(items) } } }); HistoryBasedNavigationManager.NAVIGATION_TARGETS = NAVIGATION_TARGETS; exports.HistoryBasedNavigationManager = HistoryBasedNavigationManager; exports.StackBasedNavigationManager = StackBasedNavigationManager; exports.NavigationStack = NavigationStack }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************!*\ !*** ./Scripts/framework/utils.js ***! \************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), KoTemplateProvider = __webpack_require__( /*! ../integration/knockout/template_provider */ 216); var mergeWithReplace = function(targetArray, arrayToMerge, needReplaceFn) { var result = []; for (var i = 0, length = targetArray.length; i < length; i++) { if (!needReplaceFn(targetArray[i], arrayToMerge)) { result.push(targetArray[i]) } } result.push.apply(result, arrayToMerge); return result }; var prepareCommandToReplace = function(targetCommand, commandsToMerge) { var needToReplace = false; $.each(commandsToMerge, function(_, commandToMerge) { var idEqual = targetCommand.option("id") === commandToMerge.option("id") && commandToMerge.option("id"), behaviorEqual = targetCommand.option("behavior") === commandToMerge.option("behavior") && targetCommand.option("behavior"); needToReplace = idEqual || behaviorEqual; if (behaviorEqual && null === commandToMerge.option("onExecute")) { commandToMerge.option("onExecute", targetCommand.option("onExecute")) } if (needToReplace) { targetCommand.element().remove(); return false } }); return needToReplace }; var mergeCommands = function(targetCommands, commandsToMerge) { return mergeWithReplace(targetCommands, commandsToMerge, prepareCommandToReplace) }; var resolvePropertyValue = function(command, containerOptions, propertyName, defaultValue) { var containerOption = containerOptions ? containerOptions[propertyName] : void 0, defaultOption = void 0 === containerOption ? defaultValue : containerOption, commandOption = command.option(propertyName); return void 0 === commandOption || commandOption === defaultValue ? defaultOption : commandOption }; var resolveTextValue = function(command, containerOptions) { var showText = resolvePropertyValue(command, containerOptions, "showText"), hasIcon = !!command.option("icon"), titleValue = resolvePropertyValue(command, containerOptions, "title", ""); return showText || !hasIcon ? titleValue : "" }; var resolveIconValue = function(command, containerOptions) { var showIcon = resolvePropertyValue(command, containerOptions, "showIcon"), hasText = !!command.option("title"), iconValue = resolvePropertyValue(command, containerOptions, "icon", ""); return showIcon || !hasText ? iconValue : "" }; exports.utils = { mergeCommands: mergeCommands, commandToContainer: { resolveIconValue: resolveIconValue, resolveTextValue: resolveTextValue, resolvePropertyValue: resolvePropertyValue } }; exports.templateProvider = KoTemplateProvider }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************************!*\ !*** ./Scripts/integration/knockout.js ***! \*****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var ko = __webpack_require__( /*! knockout */ 40), errors = __webpack_require__( /*! ../core/errors */ 10), compareVersion = __webpack_require__( /*! ../core/utils/version */ 56).compare; if (!ko) { return } if (compareVersion(ko.version, [2, 3]) < 0) { throw errors.Error("E0013") } __webpack_require__( /*! ./knockout/component_registrator */ 289); __webpack_require__( /*! ./knockout/event_registrator */ 292); __webpack_require__( /*! ./knockout/components */ 290); __webpack_require__( /*! ./knockout/validation */ 294); __webpack_require__( /*! ./knockout/variable_wrapper_utils */ 295); __webpack_require__( /*! ./knockout/clean_node */ 287); __webpack_require__( /*! ./knockout/clean_node_old */ 288) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************************!*\ !*** ./Scripts/localization/globalize/core.js ***! \************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var Globalize = __webpack_require__( /*! globalize */ 46); if (!Globalize || !Globalize.load) { return } var likelySubtags = { supplemental: { version: { _cldrVersion: "28", _unicodeVersion: "8.0.0", _number: "$Revision: 11965 $" }, likelySubtags: { en: "en-Latn-US", de: "de-Latn-DE", ru: "ru-Cyrl-RU", ja: "ja-Jpan-JP" } } }; Globalize.load(likelySubtags); Globalize.locale("en") }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************!*\ !*** ./Scripts/ui/list.js ***! \****************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var ListEdit = __webpack_require__( /*! ./list/ui.list.edit */ 381), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 3); /** * @name dxList * @publicName dxList * @description List widget. * @inherits CollectionWidget * @module ui/list */ registerComponent("dxList", ListEdit); module.exports = ListEdit }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**********************************************!*\ !*** ./Scripts/viz/series/scatter_series.js ***! \**********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), rangeCalculator = __webpack_require__( /*! ./helpers/range_data_calculator */ 167), _each = $.each, _extend = $.extend, _noop = $.noop, commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), _isDefined = commonUtils.isDefined, _isString = commonUtils.isString, vizUtils = __webpack_require__( /*! ../core/utils */ 6), _map = vizUtils.map, _normalizeEnum = vizUtils.normalizeEnum, math = Math, _floor = math.floor, _abs = math.abs, _sqrt = math.sqrt, _min = math.min, _max = math.max, DEFAULT_SYMBOL_POINT_SIZE = 2, DEFAULT_TRACKER_WIDTH = 12, DEFAULT_DURATION = 400, HIGH_ERROR = "highError", LOW_ERROR = "lowError", ORIGINAL = "original", VARIANCE = "variance", STANDARD_DEVIATION = "stddeviation", STANDARD_ERROR = "stderror", PERCENT = "percent", FIXED = "fixed", UNDEFINED = "undefined", DISCRETE = "discrete", LOGARITHMIC = "logarithmic", DATETIME = "datetime"; exports.chart = {}; exports.polar = {}; function sum(array) { var result = 0; _each(array, function(_, value) { result += value }); return result } function isErrorBarTypeCorrect(type) { return -1 !== $.inArray(type, [FIXED, PERCENT, VARIANCE, STANDARD_DEVIATION, STANDARD_ERROR]) } function variance(array, expectedValue) { return sum(_map(array, function(value) { return (value - expectedValue) * (value - expectedValue) })) / array.length } var baseScatterMethods = { _defaultDuration: DEFAULT_DURATION, _defaultTrackerWidth: DEFAULT_TRACKER_WIDTH, _applyStyle: _noop, _updateOptions: _noop, _parseStyle: _noop, _prepareSegment: _noop, _drawSegment: _noop, _generateDefaultSegments: _noop, _prepareSeriesToDrawing: function() { var that = this; that._deleteOldAnimationMethods(); that._disposePoints(that._oldPoints); that._oldPoints = null }, _appendInGroup: function() { this._group.append(this._extGroups.seriesGroup) }, _createLegendState: function(styleOptions, defaultColor) { return { fill: styleOptions.color || defaultColor, hatching: styleOptions.hatching } }, updateTemplateFieldNames: function() { var that = this, options = that._options; options.valueField = that.getValueFields()[0] + that.name; options.tagField = that.getTagField() + that.name }, _applyElementsClipRect: function(settings) { settings.clipId = this._paneClipRectID }, _applyMarkerClipRect: function(settings) { settings.clipId = this._forceClipping ? this._paneClipRectID : null }, _createGroup: function(groupName, parent, target, settings) { var group = parent[groupName] = parent[groupName] || this._renderer.g(); target && group.append(target); settings && group.attr(settings) }, _applyClearingSettings: function(settings) { settings.opacity = null; settings.scale = null; if (this._options.rotated) { settings.translateX = null } else { settings.translateY = null } }, _createGroups: function() { var that = this; that._createGroup("_markersGroup", that, that._group); that._createGroup("_labelsGroup", that) }, _setMarkerGroupSettings: function() { var that = this, settings = that._createPointStyles(that._getMarkerGroupOptions()).normal; settings.class = "dxc-markers"; settings.opacity = 1; that._applyMarkerClipRect(settings); that._markersGroup.attr(settings) }, _applyVisibleArea: function() { var that = this, visibleX = that.translators.x.getCanvasVisibleArea(), visibleY = that.translators.y.getCanvasVisibleArea(); that._visibleArea = { minX: visibleX.min, maxX: visibleX.max, minY: visibleY.min, maxY: visibleY.max } }, areErrorBarsVisible: function() { var errorBarOptions = this._options.valueErrorBar; return errorBarOptions && this._errorBarsEnabled() && "none" !== errorBarOptions.displayMode && (isErrorBarTypeCorrect(_normalizeEnum(errorBarOptions.type)) || _isDefined(errorBarOptions.lowValueField) || _isDefined(errorBarOptions.highValueField)) }, _createErrorBarGroup: function(animationEnabled) { var settings, that = this, errorBarOptions = that._options.valueErrorBar; if (that.areErrorBarsVisible()) { settings = { "class": "dxc-error-bars", stroke: errorBarOptions.color, "stroke-width": errorBarOptions.lineWidth, opacity: animationEnabled ? .001 : errorBarOptions.opacity || 1, "stroke-linecap": "square", sharp: true, clipId: that._forceClipping ? that._paneClipRectID : that._widePaneClipRectID }; that._createGroup("_errorBarGroup", that, that._group, settings) } }, _setGroupsSettings: function(animationEnabled) { var that = this; that._setMarkerGroupSettings(); that._setLabelGroupSettings(animationEnabled); that._createErrorBarGroup(animationEnabled) }, _getCreatingPointOptions: function() { var defaultPointOptions, normalStyle, that = this, creatingPointOptions = that._predefinedPointOptions; if (!creatingPointOptions) { defaultPointOptions = that._getPointOptions(); that._predefinedPointOptions = creatingPointOptions = _extend(true, { styles: {} }, defaultPointOptions); normalStyle = defaultPointOptions.styles && defaultPointOptions.styles.normal || {}; creatingPointOptions.styles = creatingPointOptions.styles || {}; creatingPointOptions.styles.normal = { "stroke-width": normalStyle["stroke-width"], r: normalStyle.r, opacity: normalStyle.opacity } } return creatingPointOptions }, _getSpecialColor: function(mainSeriesColor) { return mainSeriesColor }, _getPointOptions: function() { return this._parsePointOptions(this._preparePointOptions(), this._options.label) }, _getOptionsForPoint: function() { return this._options.point }, _parsePointStyle: function(style, defaultColor, defaultBorderColor) { var border = style.border || {}; return { fill: style.color || defaultColor, stroke: border.color || defaultBorderColor, "stroke-width": border.visible ? border.width : 0, r: style.size / 2 + (border.visible && 0 !== style.size ? ~~(border.width / 2) || 0 : 0) } }, _createPointStyles: function(pointOptions) { var that = this, mainPointColor = pointOptions.color || that._options.mainSeriesColor, containerColor = that._options.containerBackgroundColor, normalStyle = that._parsePointStyle(pointOptions, mainPointColor, mainPointColor); normalStyle.visibility = pointOptions.visible ? "visible" : "hidden"; return { normal: normalStyle, hover: that._parsePointStyle(pointOptions.hoverStyle, containerColor, mainPointColor), selection: that._parsePointStyle(pointOptions.selectionStyle, containerColor, mainPointColor) } }, _checkData: function(data) { return _isDefined(data.argument) && void 0 !== data.value }, getErrorBarRangeCorrector: function() { var mode, func; if (this.areErrorBarsVisible()) { mode = _normalizeEnum(this._options.valueErrorBar.displayMode); func = function(point) { var lowError = point.lowError, highError = point.highError; switch (mode) { case "low": return [lowError]; case "high": return [highError]; case "none": return []; default: return [lowError, highError] } } } return func }, _processRange: function(point, prevPoint, errorBarCorrector) { rangeCalculator.processRange(this, point, prevPoint, errorBarCorrector) }, _getRangeData: function(zoomArgs, calcIntervalFunction) { rangeCalculator.calculateRangeData(this, zoomArgs, calcIntervalFunction); rangeCalculator.addLabelPaddings(this); return this._rangeData }, _getPointData: function(data, options) { var pointData = { value: data[options.valueField || "val"], argument: data[options.argumentField || "arg"], tag: data[options.tagField || "tag"] }; this._fillErrorBars(data, pointData, options); return pointData }, _errorBarsEnabled: function() { return this.valueAxisType !== DISCRETE && this.valueAxisType !== LOGARITHMIC && this.valueType !== DATETIME }, _fillErrorBars: function(data, pointData, options) { var errorBars = options.valueErrorBar; if (this.areErrorBarsVisible()) { pointData.lowError = data[errorBars.lowValueField || LOW_ERROR]; pointData.highError = data[errorBars.highValueField || HIGH_ERROR] } }, _drawPoint: function(options) { var point = options.point; if (point.isInVisibleArea()) { point.clearVisibility(); point.draw(this._renderer, options.groups, options.hasAnimation, options.firstDrawing); this._drawnPoints.push(point) } else { point.setInvisibility() } }, _clearingAnimation: function(translators, drawComplete) { var that = this, params = { opacity: .001 }, options = { duration: that._defaultDuration, partitionDuration: .5 }; that._labelsGroup && that._labelsGroup.animate(params, options, function() { that._markersGroup && that._markersGroup.animate(params, options, drawComplete) }) }, _animateComplete: function() { var that = this, animationSettings = { duration: that._defaultDuration }; that._labelsGroup && that._labelsGroup.animate({ opacity: 1 }, animationSettings); that._errorBarGroup && that._errorBarGroup.animate({ opacity: that._options.valueErrorBar.opacity || 1 }, animationSettings) }, _animate: function() { var that = this, lastPointIndex = that._drawnPoints.length - 1; _each(that._drawnPoints || [], function(i, p) { p.animate(i === lastPointIndex ? function() { that._animateComplete() } : void 0, { translateX: p.x, translateY: p.y }) }) }, _getPointSize: function() { return this._options.point.visible ? this._options.point.size : DEFAULT_SYMBOL_POINT_SIZE }, _calcMedianValue: function(fusionPoints, valueField) { var result, allValue = _map(fusionPoints, function(point) { return _isDefined(point[valueField]) ? point[valueField] : null }); allValue.sort(function(a, b) { return a - b }); result = allValue[_floor(allValue.length / 2)]; return _isDefined(result) ? result : null }, _calcErrorBarValues: function(fusionPoints) { if (!fusionPoints.length) { return {} } var lowError, highError, lowValue = fusionPoints[0].lowError, highValue = fusionPoints[0].highError, i = 1, length = fusionPoints.length; for (i; i < length; i++) { lowError = fusionPoints[i].lowError; highError = fusionPoints[i].highError; if (_isDefined(lowError) && _isDefined(highError)) { lowValue = _min(lowError, lowValue); highValue = _max(highError, highValue) } } return { low: lowValue, high: highValue } }, _fusionPoints: function(fusionPoints, tick, index) { var errorBarValues = this._calcErrorBarValues(fusionPoints); return { value: this._calcMedianValue(fusionPoints, "value"), argument: tick, tag: null, index: index, seriesName: this.name, lowError: errorBarValues.low, highError: errorBarValues.high } }, _endUpdateData: function() { delete this._predefinedPointOptions }, getArgumentField: function() { return this._options.argumentField || "arg" }, getValueFields: function() { var lowValueField, highValueField, options = this._options, errorBarsOptions = options.valueErrorBar, valueFields = [options.valueField || "val"]; if (errorBarsOptions) { lowValueField = errorBarsOptions.lowValueField; highValueField = errorBarsOptions.highValueField; _isString(lowValueField) && valueFields.push(lowValueField); _isString(highValueField) && valueFields.push(highValueField) } return valueFields }, _calculateErrorBars: function(data) { if (!this.areErrorBarsVisible()) { return } var value, valueArray, valueArrayLength, meanValue, processDataItem, that = this, options = that._options, errorBarsOptions = options.valueErrorBar, errorBarType = _normalizeEnum(errorBarsOptions.type), floatErrorValue = parseFloat(errorBarsOptions.value), valueField = that.getValueFields()[0], lowValueField = errorBarsOptions.lowValueField || LOW_ERROR, highValueField = errorBarsOptions.highValueField || HIGH_ERROR, addSubError = function(_i, item) { value = item[valueField]; item[lowValueField] = value - floatErrorValue; item[highValueField] = value + floatErrorValue }; switch (errorBarType) { case FIXED: processDataItem = addSubError; break; case PERCENT: processDataItem = function(_, item) { value = item[valueField]; var error = value * floatErrorValue / 100; item[lowValueField] = value - error; item[highValueField] = value + error }; break; case UNDEFINED: processDataItem = function(_, item) { item[lowValueField] = item[ORIGINAL + lowValueField]; item[highValueField] = item[ORIGINAL + highValueField] }; break; default: valueArray = _map(data, function(item) { return _isDefined(item[valueField]) ? item[valueField] : null }); valueArrayLength = valueArray.length; floatErrorValue = floatErrorValue || 1; switch (errorBarType) { case VARIANCE: floatErrorValue = variance(valueArray, sum(valueArray) / valueArrayLength) * floatErrorValue; processDataItem = addSubError; break; case STANDARD_DEVIATION: meanValue = sum(valueArray) / valueArrayLength; floatErrorValue = _sqrt(variance(valueArray, meanValue)) * floatErrorValue; processDataItem = function(_, item) { item[lowValueField] = meanValue - floatErrorValue; item[highValueField] = meanValue + floatErrorValue }; break; case STANDARD_ERROR: floatErrorValue = _sqrt(variance(valueArray, sum(valueArray) / valueArrayLength) / valueArrayLength) * floatErrorValue; processDataItem = addSubError } } processDataItem && _each(data, processDataItem) }, _beginUpdateData: function(data) { this._calculateErrorBars(data) } }; exports.chart = _extend({}, baseScatterMethods, { drawTrackers: function() { var trackers, trackersGroup, that = this, segments = that._segments || [], rotated = that._options.rotated, cat = []; if (!that.isVisible()) { return } if (segments.length) { trackers = that._trackers = that._trackers || []; trackersGroup = that._trackersGroup = (that._trackersGroup || that._renderer.g().attr({ fill: "gray", opacity: .001, stroke: "gray", "class": "dxc-trackers" })).attr({ clipId: this._paneClipRectID || null }).append(that._group); _each(segments, function(i, segment) { if (!trackers[i]) { trackers[i] = that._drawTrackerElement(segment).data({ "chart-data-series": that }).append(trackersGroup) } else { that._updateTrackerElement(segment, trackers[i]) } }) } that._trackersTranslator = cat; _each(that.getVisiblePoints(), function(_, p) { var pointCoord = parseInt(rotated ? p.vy : p.vx); if (!cat[pointCoord]) { cat[pointCoord] = p } else { $.isArray(cat[pointCoord]) ? cat[pointCoord].push(p) : cat[pointCoord] = [cat[pointCoord], p] } }) }, getNeighborPoint: function(x, y) { var minDistance, pCoord = this._options.rotated ? y : x, nCoord = pCoord, cat = this._trackersTranslator, point = null, oppositeCoord = this._options.rotated ? x : y, oppositeCoordName = this._options.rotated ? "vx" : "vy"; if (this.isVisible() && cat) { point = cat[pCoord]; do { point = cat[nCoord] || cat[pCoord]; pCoord--; nCoord++ } while ((pCoord >= 0 || nCoord < cat.length) && !point); if ($.isArray(point)) { minDistance = _abs(point[0][oppositeCoordName] - oppositeCoord); _each(point, function(i, p) { var distance = _abs(p[oppositeCoordName] - oppositeCoord); if (minDistance >= distance) { minDistance = distance; point = p } }) } } return point } }); exports.polar = _extend({}, baseScatterMethods, { drawTrackers: function() { exports.chart.drawTrackers.call(this); var index, cat = this._trackersTranslator; if (!this.isVisible()) { return } _each(cat, function(i, category) { if (category) { index = i; return false } }); cat[index + 360] = cat[index] }, getNeighborPoint: function(x, y) { var pos = this.translators.untranslate(x, y); return exports.chart.getNeighborPoint.call(this, pos.phi, pos.r) }, _applyVisibleArea: function() { var that = this, canvas = that.translators.canvas; that._visibleArea = { minX: canvas.left, maxX: canvas.width - canvas.right, minY: canvas.top, maxY: canvas.height - canvas.bottom } } }) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!******************************************!*\ !*** ./Scripts/viz/translators/range.js ***! \******************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var _Range, $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), _isDefined = commonUtils.isDefined, _isDate = commonUtils.isDate, unique = __webpack_require__( /*! ../core/utils */ 6).unique, minSelector = "min", maxSelector = "max", minVisibleSelector = "minVisible", maxVisibleSelector = "maxVisible", baseSelector = "base", axisTypeSelector = "axisType"; function otherLessThan(thisValue, otherValue) { return otherValue < thisValue } function otherGreaterThan(thisValue, otherValue) { return otherValue > thisValue } function compareAndReplace(thisValue, otherValue, setValue, compare) { var otherValueDefined = _isDefined(otherValue); if (_isDefined(thisValue)) { if (otherValueDefined && compare(thisValue, otherValue)) { setValue(otherValue) } } else { if (otherValueDefined) { setValue(otherValue) } } } _Range = exports.Range = function(range) { range && $.extend(this, range) }; _Range.prototype = { constructor: _Range, addRange: function(otherRange) { var that = this, categories = that.categories, otherCategories = otherRange.categories; var compareAndReplaceByField = function(field, compare) { compareAndReplace(that[field], otherRange[field], function(value) { that[field] = value }, compare) }; var controlValuesByVisibleBounds = function(valueField, visibleValueField, compare) { compareAndReplace(that[valueField], that[visibleValueField], function(value) { _isDefined(that[valueField]) && (that[valueField] = value) }, compare) }; var checkField = function(field) { that[field] = that[field] || otherRange[field] }; if (commonUtils.isDefined(otherRange.stick)) { that.stick = otherRange.stick } checkField("addSpiderCategory"); checkField("percentStick"); checkField("minSpaceCorrection"); checkField("maxSpaceCorrection"); checkField("invert"); checkField(axisTypeSelector); checkField("dataType"); if ("logarithmic" === that[axisTypeSelector]) { checkField(baseSelector) } else { that[baseSelector] = void 0 } compareAndReplaceByField(minSelector, otherLessThan); compareAndReplaceByField(maxSelector, otherGreaterThan); if ("discrete" === that[axisTypeSelector]) { checkField(minVisibleSelector); checkField(maxVisibleSelector) } else { compareAndReplaceByField(minVisibleSelector, otherLessThan); compareAndReplaceByField(maxVisibleSelector, otherGreaterThan) } compareAndReplaceByField("interval", otherLessThan); controlValuesByVisibleBounds(minSelector, minVisibleSelector, otherLessThan); controlValuesByVisibleBounds(minSelector, maxVisibleSelector, otherLessThan); controlValuesByVisibleBounds(maxSelector, maxVisibleSelector, otherGreaterThan); controlValuesByVisibleBounds(maxSelector, minVisibleSelector, otherGreaterThan); if (void 0 === categories) { that.categories = otherCategories } else { that.categories = otherCategories ? unique(categories.concat(otherCategories)) : categories } return that }, isDefined: function() { return _isDefined(this[minSelector]) && _isDefined(this[maxSelector]) || this.categories && this.categories.length }, setStubData: function(dataType) { var that = this, year = (new Date).getYear() - 1, isDate = "datetime" === dataType, isCategories = "discrete" === that[axisTypeSelector]; if (isCategories) { that.categories = ["0", "1", "2"] } else { that[minSelector] = isDate ? new Date(year, 0, 1) : 0; that[maxSelector] = isDate ? new Date(year, 11, 31) : 10 } that.stubData = true; return that }, correctValueZeroLevel: function() { var that = this; if ("logarithmic" === that[axisTypeSelector] || _isDate(that[maxSelector]) || _isDate(that[minSelector])) { return that } function setZeroLevel(min, max) { that[min] < 0 && that[max] < 0 && (that[max] = 0); that[min] > 0 && that[max] > 0 && (that[min] = 0) } setZeroLevel(minSelector, maxSelector); setZeroLevel(minVisibleSelector, maxVisibleSelector); return that }, checkZeroStick: function() { var that = this; if (that.min >= 0 && that.max >= 0) { that.minStickValue = 0 } else { if (that.min <= 0 && that.max <= 0) { that.maxStickValue = 0 } } return that } } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************************!*\ !*** ./Scripts/viz/tree_map/common.js ***! \****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var _patchFontOptions = __webpack_require__( /*! ../core/utils */ 6).patchFontOptions; function empty() {} exports.empty = empty; function createChainExecutor() { var chain = []; executeChain.add = function(item) { chain.push(item) }; return executeChain; function executeChain() { var i, ii = chain.length; for (i = 0; i < ii; ++i) { chain[i].apply(this, arguments) } } } exports.expand = function(target, name, expander) { var current = target[name]; if (current.add) { current.add(expander) } else { if (current === empty) { current = expander } else { current = createChainExecutor(); current.add(target[name]); current.add(expander) } } target[name] = current }; exports.buildRectAppearance = function(option) { var border = option.border || {}; return { fill: option.color, opacity: option.opacity, stroke: border.color, "stroke-width": border.width, "stroke-opacity": border.opacity, hatching: option.hatching } }; exports.buildTextAppearance = function(options, filter) { return { attr: options["stroke-width"] ? { stroke: options.stroke, "stroke-width": options["stroke-width"], "stroke-opacity": options["stroke-opacity"], filter: filter } : {}, css: _patchFontOptions(options.font) } } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**********************************************************************!*\ !*** ./Scripts/animation/transition_executor/transition_executor.js ***! \**********************************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../../core/class */ 5), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), fx = __webpack_require__( /*! ../fx */ 21), animationPresetsModule = __webpack_require__( /*! ../presets/presets */ 110); var directionPostfixes = { forward: " dx-forward", backward: " dx-backward", none: " dx-no-direction", undefined: " dx-no-direction" }, DX_ANIMATING_CLASS = "dx-animating"; var TransitionExecutor = Class.inherit({ ctor: function() { this._accumulatedDelays = { enter: 0, leave: 0 }; this._animations = []; this.reset() }, _createAnimations: function($elements, initialConfig, configModifier, type) { var animationConfig, that = this, result = []; configModifier = configModifier || {}; animationConfig = this._prepareElementAnimationConfig(initialConfig, configModifier, type); if (animationConfig) { $elements.each(function() { var animation = that._createAnimation($(this), animationConfig, configModifier); if (animation) { animation.element.addClass(DX_ANIMATING_CLASS); animation.setup(); result.push(animation) } }) } return result }, _prepareElementAnimationConfig: function(config, configModifier, type) { var result; if ("string" === typeof config) { var presetName = config; config = animationPresetsModule.presets.getPreset(presetName) } if (!config) { result = void 0 } else { if ($.isFunction(config[type])) { result = config[type] } else { result = $.extend({ skipElementInitialStyles: true, cleanupWhen: this._completePromise }, config, configModifier); if (!result.type || "css" === result.type) { var cssClass = "dx-" + type, extraCssClasses = (result.extraCssClasses ? " " + result.extraCssClasses : "") + directionPostfixes[result.direction]; result.type = "css"; result.from = (result.from || cssClass) + extraCssClasses; result.to = result.to || cssClass + "-active" } result.staggerDelay = result.staggerDelay || 0; result.delay = result.delay || 0; if (result.staggerDelay) { result.delay += this._accumulatedDelays[type]; this._accumulatedDelays[type] += result.staggerDelay } } } return result }, _createAnimation: function($element, animationConfig, configModifier) { var result; if ($.isPlainObject(animationConfig)) { result = fx.createAnimation($element, animationConfig) } else { if ($.isFunction(animationConfig)) { result = animationConfig($element, configModifier) } } return result }, _startAnimations: function() { var animations = this._animations; for (var i = 0; i < animations.length; i++) { animations[i].start() } }, _stopAnimations: function(jumpToEnd) { var animations = this._animations; for (var i = 0; i < animations.length; i++) { animations[i].stop(jumpToEnd) } }, _clearAnimations: function() { var animations = this._animations; for (var i = 0; i < animations.length; i++) { animations[i].element.removeClass(DX_ANIMATING_CLASS) } this._animations.length = 0 }, reset: function() { this._accumulatedDelays.enter = 0; this._accumulatedDelays.leave = 0; this._clearAnimations(); this._completeDeferred = $.Deferred(); this._completePromise = this._completeDeferred.promise() }, enter: function($elements, animationConfig, configModifier) { var animations = this._createAnimations($elements, animationConfig, configModifier, "enter"); this._animations.push.apply(this._animations, animations) }, leave: function($elements, animationConfig, configModifier) { var animations = this._createAnimations($elements, animationConfig, configModifier, "leave"); this._animations.push.apply(this._animations, animations) }, start: function() { var result, that = this; if (!this._animations.length) { that.reset(); result = $.Deferred().resolve().promise() } else { var animationDeferreds = $.map(this._animations, function(animation) { var result = $.Deferred(); animation.deferred.always(function() { result.resolve() }); return result.promise() }); result = $.when.apply($, animationDeferreds).always(function() { that._completeDeferred.resolve(); that.reset() }); commonUtils.executeAsync(function() { that._startAnimations() }) } return result }, stop: function(jumpToEnd) { this._stopAnimations(jumpToEnd) } }); exports.TransitionExecutor = TransitionExecutor }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***********************************!*\ !*** ./Scripts/core/component.js ***! \***********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ./class */ 5), Action = __webpack_require__( /*! ./action */ 54), errors = __webpack_require__( /*! ./errors */ 10), coreDataUtils = __webpack_require__( /*! ./utils/data */ 16), commonUtils = __webpack_require__( /*! ./utils/common */ 2), EventsMixin = __webpack_require__( /*! ./events_mixin */ 32), publicComponentUtils = __webpack_require__( /*! ./utils/public_component */ 142), devices = __webpack_require__( /*! ./devices */ 7); var cachedGetters = {}; var cachedSetters = {}; var Component = Class.inherit({ _setDeprecatedOptions: function() { this._deprecatedOptions = {} }, _getDeprecatedOptions: function() { return this._deprecatedOptions }, _getOptionAliasesByName: function(optionName) { return $.map(this._deprecatedOptions, function(deprecate, aliasName) { return optionName === deprecate.alias ? aliasName : void 0 }) }, _getDefaultOptions: function() { return { onInitialized: null, onOptionChanged: null, onDisposing: null, defaultOptionsRules: null } }, _setDefaultOptions: function() { this._options = this._getDefaultOptions() }, _defaultOptionsRules: function() { return [] }, _setOptionsByDevice: function(userRules) { var rules = this._defaultOptionsRules(); if (this._customRules) { rules = rules.concat(this._customRules) } if ($.isArray(userRules)) { rules = rules.concat(userRules) } var rulesOptions = this._convertRulesToOptions(rules); $.extend(true, this._options, rulesOptions); for (var fieldName in this._optionsByReference) { if (rulesOptions.hasOwnProperty(fieldName)) { this._options[fieldName] = rulesOptions[fieldName] } } }, _convertRulesToOptions: function(rules) { var options = {}; var currentDevice = devices.current(); var deviceMatch = function(device, filter) { filter = $.makeArray(filter); return 1 === filter.length && $.isEmptyObject(filter[0]) || commonUtils.findBestMatches(device, filter).length > 0 }; for (var i = 0; i < rules.length; i++) { var match, rule = rules[i], deviceFilter = rule.device || {}; if ($.isFunction(deviceFilter)) { match = deviceFilter(currentDevice) } else { match = deviceMatch(currentDevice, deviceFilter) } if (match) { $.extend(options, rule.options) } } return options }, _isInitialOptionValue: function(name) { var isCustomOption = this._customRules && this._convertRulesToOptions(this._customRules).hasOwnProperty(name); var optionValue = this.option(name); var initialOptionValue = this.initialOption(name); var isInitialOption = $.isFunction(optionValue) && $.isFunction(optionValue) ? optionValue.toString() === initialOptionValue.toString() : optionValue === initialOptionValue; return !isCustomOption && isInitialOption }, _setOptionsByReference: function() { this._optionsByReference = {} }, _getOptionsByReference: function() { return this._optionsByReference }, ctor: function(options) { this.NAME = this.constructor.publicName(); options = options || {}; this._options = {}; this._updateLockCount = 0; this._optionChangedCallbacks = options._optionChangedCallbacks || $.Callbacks(); this._disposingCallbacks = options._disposingCallbacks || $.Callbacks(); this.beginUpdate(); try { this._suppressDeprecatedWarnings(); this._setOptionsByReference(); this._setDeprecatedOptions(); this._setDefaultOptions(); this._setOptionsByDevice(options.defaultOptionsRules); this._resumeDeprecatedWarnings(); this._initOptions(options) } finally { this.endUpdate() } }, _initOptions: function(options) { this.option(options) }, _optionValuesEqual: function(name, oldValue, newValue) { oldValue = coreDataUtils.toComparable(oldValue, true); newValue = coreDataUtils.toComparable(newValue, true); if (oldValue && newValue && oldValue.jquery && newValue.jquery) { return newValue.is(oldValue) } var oldValueIsNaN = oldValue !== oldValue, newValueIsNaN = newValue !== newValue; if (oldValueIsNaN && newValueIsNaN) { return true } if (null === oldValue || "object" !== typeof oldValue) { return oldValue === newValue } return false }, _init: function() { this._createOptionChangedAction(); this.on("disposing", function(args) { this._disposingCallbacks.fireWith(this, [args]) }) }, _createOptionChangedAction: function() { this._optionChangedAction = this._createActionByOption("onOptionChanged", { excludeValidators: ["disabled", "readOnly", "designMode"] }) }, _createDisposingAction: function() { this._disposingAction = this._createActionByOption("onDisposing", { excludeValidators: ["disabled", "readOnly", "designMode"] }) }, _optionChanged: function(args) { switch (args.name) { case "onDisposing": case "onInitialized": break; case "onOptionChanged": this._createOptionChangedAction(); break; case "defaultOptionsRules": } }, _dispose: function() { this._optionChangedCallbacks.empty(); this._createDisposingAction(); this._disposingAction(); this._disposeEvents(); this._disposed = true }, instance: function() { return this }, beginUpdate: function() { this._updateLockCount++ }, endUpdate: function() { this._updateLockCount = Math.max(this._updateLockCount - 1, 0); if (!this._updateLockCount) { if (!this._initializing && !this._initialized) { this._initializing = true; try { this._init() } finally { this._initializing = false; this._updateLockCount++; this._createActionByOption("onInitialized", { excludeValidators: ["disabled", "readOnly", "designMode"] })(); this._updateLockCount--; this._initialized = true } } } }, _logWarningIfDeprecated: function(option) { var info = this._deprecatedOptions[option]; if (info && !this._deprecatedOptionsSuppressed) { this._logDeprecatedWarning(option, info) } }, _logDeprecatedWarningCount: 0, _logDeprecatedWarning: function(option, info) { var message = info.message || "Use the '" + info.alias + "' option instead"; errors.log("W0001", this.NAME, option, info.since, message); ++this._logDeprecatedWarningCount }, _suppressDeprecatedWarnings: function() { this._deprecatedOptionsSuppressed = true }, _resumeDeprecatedWarnings: function() { this._deprecatedOptionsSuppressed = false }, _optionChanging: $.noop, _notifyOptionChanged: function(option, value, previousValue) { var that = this; if (this._initialized) { var optionNames = [option].concat(that._getOptionAliasesByName(option)); for (var i = 0; i < optionNames.length; i++) { var name = optionNames[i], args = { name: name.split(/[.\[]/)[0], fullName: name, value: value, previousValue: previousValue }; that._optionChangedCallbacks.fireWith(that, [$.extend(that._defaultActionArgs(), args)]); that._optionChangedAction($.extend({}, args)); if (!that._disposed) { that._optionChanged(args) } } } }, initialOption: function(optionName) { var currentOptions, currentInitialized = this._initialized; if (!this._initialOptions) { currentOptions = this._options; this._options = {}; this._initialized = false; this._setDefaultOptions(); this._setOptionsByDevice(currentOptions.defaultOptionsRules); this._initialOptions = this._options; this._options = currentOptions; this._initialized = currentInitialized } return this._initialOptions[optionName] }, _defaultActionConfig: function() { return { context: this, component: this } }, _defaultActionArgs: function() { return { component: this } }, _createAction: function(actionSource, config) { var action, that = this; return function(e) { if (!arguments.length) { e = {} } if (e instanceof $.Event) { throw Error("Action must be executed with jQuery.Event like action({ jQueryEvent: event })") } if (!$.isPlainObject(e)) { e = { actionValue: e } } action = action || new Action(actionSource, $.extend(config, that._defaultActionConfig())); return action.execute.call(action, $.extend(e, that._defaultActionArgs())) } }, _createActionByOption: function(optionName, config) { var action, eventName, actionFunc, that = this; var result = function() { if (!eventName) { config = config || {}; if ("string" !== typeof optionName) { throw errors.Error("E0008") } if (0 === optionName.indexOf("on")) { eventName = optionName.charAt(2).toLowerCase() + optionName.substr(3) } else { throw Error("The '" + optionName + "' option name should start with 'on' prefix") } actionFunc = that.option(optionName) } if (!action && !actionFunc && !config.beforeExecute && !config.afterExecute && !that.hasEvent(eventName)) { return } if (!action) { var beforeExecute = config.beforeExecute; config.beforeExecute = function(args) { that.fireEvent(eventName, args.args); beforeExecute && beforeExecute.apply(that, arguments) }; that._suppressDeprecatedWarnings(); action = that._createAction(actionFunc, config); that._resumeDeprecatedWarnings() } return action.apply(that, arguments) }; var onActionCreated = that.option("onActionCreated") || $.noop; result = onActionCreated(that, result, config) || result; return result }, isOptionDeprecated: function(name) { var deprecatedOptions = this._getDeprecatedOptions(); return deprecatedOptions.hasOwnProperty(name) }, option: function() { var normalizeOptionName = function(that, name) { var deprecate; if (name) { if (!that._cachedDeprecateNames) { that._cachedDeprecateNames = []; for (var optionName in that._deprecatedOptions) { that._cachedDeprecateNames.push(optionName) } } for (var i = 0; i < that._cachedDeprecateNames.length; i++) { if (that._cachedDeprecateNames[i] === name) { deprecate = that._deprecatedOptions[name]; break } } if (deprecate) { that._logWarningIfDeprecated(name); var alias = deprecate.alias; if (alias) { name = alias } } } return name }; var getPreviousName = function(fullName) { var splittedNames = fullName.split("."); splittedNames.pop(); return splittedNames.join(".") }; var getFieldName = function(fullName) { var splittedNames = fullName.split("."); return splittedNames[splittedNames.length - 1] }; var getOptionValue = function(options, name, unwrapObservables) { var getter = cachedGetters[name]; if (!getter) { getter = cachedGetters[name] = coreDataUtils.compileGetter(name) } return getter(options, { functionsAsIs: true, unwrapObservables: unwrapObservables }) }; var clearOptionsField = function(options, name) { delete options[name]; var previousFieldName = getPreviousName(name), fieldName = getFieldName(name), fieldObject = previousFieldName ? getOptionValue(options, previousFieldName, false) : options; if (fieldObject) { delete fieldObject[fieldName] } }; var setOptionsField = function(options, fullName, value) { var fieldObject, fieldName = ""; do { if (fieldName) { fieldName = "." + fieldName } fieldName = getFieldName(fullName) + fieldName; fullName = getPreviousName(fullName); fieldObject = fullName ? getOptionValue(options, fullName, false) : options } while (!fieldObject); fieldObject[fieldName] = value }; var normalizeOptionValue = function(that, options, name, value) { if (name) { var alias = normalizeOptionName(that, name); if (alias && alias !== name) { setOptionsField(options, alias, value); clearOptionsField(options, name) } } }; var prepareOption = function(that, options, name, value) { if ($.isPlainObject(value)) { for (var valueName in value) { prepareOption(that, options, name + "." + valueName, value[valueName]) } } normalizeOptionValue(that, options, name, value) }; var setOptionValue = function(that, name, value) { if (!cachedSetters[name]) { cachedSetters[name] = coreDataUtils.compileSetter(name) } cachedSetters[name](that._options, value, { functionsAsIs: true, merge: !that._getOptionsByReference()[name], unwrapObservables: false }) }; var setOption = function(that, name, value) { var previousValue = getOptionValue(that._options, name, false); if (that._optionValuesEqual(name, previousValue, value)) { return } if (that._initialized) { that._optionChanging(name, previousValue, value) } setOptionValue(that, name, value); that._notifyOptionChanged(name, value, previousValue) }; return function(options, value) { var that = this, name = options; if (arguments.length < 2 && "object" !== $.type(name)) { name = normalizeOptionName(that, name); return getOptionValue(that._options, name) } if ("string" === typeof name) { options = {}; options[name] = value } that.beginUpdate(); try { var optionName; for (optionName in options) { prepareOption(that, options, optionName, options[optionName]) } for (optionName in options) { setOption(that, optionName, options[optionName]) } } finally { that.endUpdate() } } }() }).include(EventsMixin); Component.publicName = publicComponentUtils.getName; module.exports = Component }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************************!*\ !*** ./Scripts/ui/list/ui.list.edit.decorator.js ***! \***************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../../core/class */ 5), swipeEvents = __webpack_require__( /*! ../../events/swipe */ 82), eventUtils = __webpack_require__( /*! ../../events/utils */ 4); var LIST_EDIT_DECORATOR = "dxListEditDecorator", SWIPE_START_EVENT_NAME = eventUtils.addNamespace(swipeEvents.start, LIST_EDIT_DECORATOR), SWIPE_UPDATE_EVENT_NAME = eventUtils.addNamespace(swipeEvents.swipe, LIST_EDIT_DECORATOR), SWIPE_END_EVENT_NAME = eventUtils.addNamespace(swipeEvents.end, LIST_EDIT_DECORATOR); var EditDecorator = Class.inherit({ ctor: function(list) { this._list = list; this._init() }, _init: $.noop, _shouldHandleSwipe: false, _attachSwipeEvent: function(config) { var swipeConfig = { itemSizeFunc: $.proxy(function() { if (this._clearSwipeCache) { this._itemWidthCache = this._list.element().width(); this._clearSwipeCache = false } return this._itemWidthCache }, this) }; config.$itemElement.on(SWIPE_START_EVENT_NAME, swipeConfig, $.proxy(this._itemSwipeStartHandler, this)).on(SWIPE_UPDATE_EVENT_NAME, $.proxy(this._itemSwipeUpdateHandler, this)).on(SWIPE_END_EVENT_NAME, $.proxy(this._itemSwipeEndHandler, this)) }, _itemSwipeStartHandler: function(e) { var $itemElement = $(e.currentTarget); if ($itemElement.is(".dx-state-disabled, .dx-state-disabled *")) { e.cancel = true; return } this._swipeStartHandler($itemElement, e) }, _itemSwipeUpdateHandler: function(e) { var $itemElement = $(e.currentTarget); this._swipeUpdateHandler($itemElement, e) }, _itemSwipeEndHandler: function(e) { var $itemElement = $(e.currentTarget); this._swipeEndHandler($itemElement, e); this._clearSwipeCache = true }, beforeBag: $.noop, afterBag: $.noop, _commonOptions: function() { return { activeStateEnabled: this._list.option("activeStateEnabled"), hoverStateEnabled: this._list.option("hoverStateEnabled"), focusStateEnabled: this._list.option("focusStateEnabled") } }, modifyElement: function(config) { if (this._shouldHandleSwipe) { this._attachSwipeEvent(config); this._clearSwipeCache = true } }, afterRender: $.noop, handleClick: $.noop, handleContextMenu: $.noop, _swipeStartHandler: $.noop, _swipeUpdateHandler: $.noop, _swipeEndHandler: $.noop, visibilityChange: $.noop, dispose: $.noop }); module.exports = EditDecorator }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************!*\ !*** ./Scripts/core/utils/error.js ***! \*************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), consoleUtils = __webpack_require__( /*! ./console */ 36), stringUtils = __webpack_require__( /*! ./string */ 26), version = __webpack_require__( /*! ../version */ 123); var ERROR_URL = "http://js.devexpress.com/error/" + version.split(".").slice(0, 2).join("_") + "/"; module.exports = function(baseErrors, errors) { var exports = { ERROR_MESSAGES: $.extend(errors, baseErrors), Error: function() { return makeError($.makeArray(arguments)) }, log: function(id) { var method = "log"; if (/^E\d+$/.test(id)) { method = "error" } else { if (/^W\d+$/.test(id)) { method = "warn" } } consoleUtils.logger[method]("log" === method ? id : combineMessage($.makeArray(arguments))) } }; var combineMessage = function(args) { var id = args[0]; args = args.slice(1); return formatMessage(id, formatDetails(id, args)) }; var formatDetails = function(id, args) { args = [exports.ERROR_MESSAGES[id]].concat(args); return stringUtils.format.apply(this, args).replace(/\.*\s*?$/, "") }; var formatMessage = function(id, details) { return stringUtils.format.apply(this, ["{0} - {1}. See:\n{2}", id, details, ERROR_URL + id]) }; var makeError = function(args) { var id, details, message; id = args[0]; args = args.slice(1); details = formatDetails(id, args); message = formatMessage(id, details); return $.extend(new Error(message), { __id: id, __details: details }) }; return exports } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*******************************!*\ !*** ./Scripts/ui/popover.js ***! \*******************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 3), stringUtils = __webpack_require__( /*! ../core/utils/string */ 26), translator = __webpack_require__( /*! ../animation/translator */ 15), positionUtils = __webpack_require__( /*! ../animation/position */ 65), commonUtils = __webpack_require__( /*! ../core/utils/common */ 2), mathUtils = __webpack_require__( /*! ../core/utils/math */ 66), Popup = __webpack_require__( /*! ./popup */ 53); var POPOVER_CLASS = "dx-popover", POPOVER_WRAPPER_CLASS = "dx-popover-wrapper", POPOVER_ARROW_CLASS = "dx-popover-arrow", POPOVER_WITHOUT_TITLE_CLASS = "dx-popover-without-title", POSITION_FLIP_MAP = { left: "right", top: "bottom", right: "left", bottom: "top", center: "center" }, WEIGHT_OF_SIDES = { left: -1, top: -1, center: 0, right: 1, bottom: 1 }, POSITION_ALIASES = { top: { my: "bottom center", at: "top center", collision: "fit flip" }, bottom: { my: "top center", at: "bottom center", collision: "fit flip" }, right: { my: "left center", at: "right center", collision: "flip fit" }, left: { my: "right center", at: "left center", collision: "flip fit" } }; var Popover = Popup.inherit({ _getDefaultOptions: function() { return $.extend(this.callBase(), { target: window, shading: false, position: "bottom", closeOnOutsideClick: true, animation: { show: { type: "fade", from: 0, to: 1 }, hide: { type: "fade", to: 0 } }, showTitle: false, width: "auto", height: "auto", dragEnabled: false, resizeEnabled: false, fullScreen: false, closeOnTargetScroll: true, arrowPosition: "", arrowOffset: 0, boundaryOffset: { h: 10, v: 10 } }) }, _defaultOptionsRules: function() { return [{ device: { platform: "ios" }, options: { arrowPosition: { boundaryOffset: { h: 20, v: -10 }, collision: "fit" } } }] }, _init: function() { this.callBase(); this._renderArrow(); this.element().addClass(POPOVER_CLASS); this._wrapper().addClass(POPOVER_WRAPPER_CLASS) }, _renderArrow: function() { this._$arrow = $("
").addClass(POPOVER_ARROW_CLASS).prependTo(this.overlayContent()) }, _documentDownHandler: function(e) { if (this._isOutsideClick(e)) { return this.callBase(e) } }, _isOutsideClick: function(e) { return !$(e.target).closest(this.option("target")).length }, _animate: function(animation) { if (animation && animation.to) { $.extend(animation.to, { position: this._getContainerPosition() }) } this.callBase.apply(this, arguments) }, _stopAnimation: function() { this.callBase.apply(this, arguments) }, _renderTitle: function() { this._wrapper().toggleClass(POPOVER_WITHOUT_TITLE_CLASS, !this.option("showTitle")); this.callBase() }, _renderPosition: function() { this.callBase(); this._renderOverlayPosition() }, _renderOverlayBoundaryOffset: $.noop, _renderOverlayPosition: function() { this._resetOverlayPosition(); this._updateContentSize(); var contentPosition = this._getContainerPosition(); var resultLocation = positionUtils.setup(this._$content, contentPosition); var positionSide = this._getSideByLocation(resultLocation); this._togglePositionClass("dx-position-" + positionSide); this._toggleFlippedClass(resultLocation.h.flip, resultLocation.v.flip); this._renderArrowPosition(positionSide) }, _resetOverlayPosition: function() { this._setContentHeight(true); this._togglePositionClass("dx-position-" + this._positionSide); translator.move(this._$content, { left: 0, top: 0 }); this._$arrow.css({ top: "auto", right: "auto", bottom: "auto", left: "auto" }) }, _updateContentSize: function() { if (!this._$popupContent) { return } var containerLocation = positionUtils.calculate(this._$content, this._getContainerPosition()); if (containerLocation.h.oversize > 0 && this._isHorizontalSide() && !containerLocation.h.fit) { var newContainerWidth = this._$content.width() - containerLocation.h.oversize; this._$content.width(newContainerWidth) } if (containerLocation.v.oversize > 0 && this._isVerticalSide() && !containerLocation.v.fit) { var newOverlayContentHeight = this._$content.height() - containerLocation.v.oversize, newPopupContentHeight = this._$popupContent.height() - containerLocation.v.oversize; this._$content.height(newOverlayContentHeight); this._$popupContent.height(newPopupContentHeight) } }, _getContainerPosition: function() { var offset = stringUtils.pairToObject(this._position.offset || ""); var hOffset = offset.h; var vOffset = offset.v; var isPopoverInside = this._isPopoverInside(); var sign = (isPopoverInside ? -1 : 1) * WEIGHT_OF_SIDES[this._positionSide]; var arrowSizeCorrection = this._getContentBorderWidth(this._positionSide); if (this._isVerticalSide()) { vOffset += sign * (this._$arrow.height() - arrowSizeCorrection) } else { if (this._isHorizontalSide()) { hOffset += sign * (this._$arrow.width() - arrowSizeCorrection) } } return $.extend({}, this._position, { offset: hOffset + " " + vOffset }) }, _getContentBorderWidth: function(side) { var borderWidth = this._$content.css("border-" + side + "-width"); return parseInt(borderWidth) || 0 }, _getSideByLocation: function(location) { var isFlippedByVertical = location.v.flip; var isFlippedByHorizontal = location.h.flip; return this._isVerticalSide() && isFlippedByVertical || this._isHorizontalSide() && isFlippedByHorizontal || this._isPopoverInside() ? POSITION_FLIP_MAP[this._positionSide] : this._positionSide }, _togglePositionClass: function(positionClass) { this._$wrapper.removeClass("dx-position-left dx-position-right dx-position-top dx-position-bottom").addClass(positionClass) }, _toggleFlippedClass: function(isFlippedHorizontal, isFlippedVertical) { this._$wrapper.toggleClass("dx-popover-flipped-horizontal", isFlippedHorizontal).toggleClass("dx-popover-flipped-vertical", isFlippedVertical) }, _renderArrowPosition: function(side) { this._$arrow.css(POSITION_FLIP_MAP[side], -(this._isVerticalSide(side) ? this._$arrow.height() : this._$arrow.width())); var axis = this._isVerticalSide(side) ? "left" : "top"; var sizeProperty = this._isVerticalSide(side) ? "outerWidth" : "outerHeight"; var $target = $(this._position.of); var targetOffset = $target.offset() || { top: 0, left: 0 }; var contentOffset = this._$content.offset(); var arrowSize = this._$arrow[sizeProperty](); var contentLocation = contentOffset[axis]; var contentSize = this._$content[sizeProperty](); var targetLocation = targetOffset[axis]; var targetSize = $target.get(0).preventDefault ? 0 : $target[sizeProperty](); var min = Math.max(contentLocation, targetLocation); var max = Math.min(contentLocation + contentSize, targetLocation + targetSize); var arrowLocation; if ("start" === this.option("arrowPosition")) { arrowLocation = min - contentLocation } else { if ("end" === this.option("arrowPosition")) { arrowLocation = max - contentLocation - arrowSize } else { arrowLocation = (min + max) / 2 - contentLocation - arrowSize / 2 } } var borderWidth = this._getContentBorderWidth(side); var finalArrowLocation = mathUtils.fitIntoRange(arrowLocation - borderWidth + this.option("arrowOffset"), borderWidth, contentSize - arrowSize - 2 * borderWidth); this._$arrow.css(axis, finalArrowLocation) }, _isPopoverInside: function() { var position = this._getPosition(); var my = positionUtils.setup.normalizeAlign(position.my); var at = positionUtils.setup.normalizeAlign(position.at); return my.h === at.h && my.v === at.v }, _getPosition: function() { var position = this.option("position"); if (commonUtils.isString(position)) { position = $.extend({}, POSITION_ALIASES[position]) } return position }, _setContentHeight: function(fullUpdate) { if (fullUpdate) { this.callBase() } }, _renderShadingPosition: function() { if (this.option("shading")) { this._$wrapper.css({ top: 0, left: 0 }) } }, _renderShadingDimensions: function() { if (this.option("shading")) { this._$wrapper.css({ width: "100%", height: "100%" }) } }, _normalizePosition: function() { var position = $.extend({}, this._getPosition()); if (!position.of) { position.of = this.option("target") } if (!position.collision) { position.collision = "flip" } if (!position.boundaryOffset) { position.boundaryOffset = this.option("boundaryOffset") } this._positionSide = this._getDisplaySide(position); this._position = position }, _getDisplaySide: function(position) { var my = positionUtils.setup.normalizeAlign(position.my), at = positionUtils.setup.normalizeAlign(position.at); var weightSign = WEIGHT_OF_SIDES[my.h] === WEIGHT_OF_SIDES[at.h] && WEIGHT_OF_SIDES[my.v] === WEIGHT_OF_SIDES[at.v] ? -1 : 1, horizontalWeight = Math.abs(WEIGHT_OF_SIDES[my.h] - weightSign * WEIGHT_OF_SIDES[at.h]), verticalWeight = Math.abs(WEIGHT_OF_SIDES[my.v] - weightSign * WEIGHT_OF_SIDES[at.v]); return horizontalWeight > verticalWeight ? at.h : at.v }, _isVerticalSide: function(side) { side = side || this._positionSide; return "top" === side || "bottom" === side }, _isHorizontalSide: function(side) { side = side || this._positionSide; return "left" === side || "right" === side }, _optionChanged: function(args) { switch (args.name) { case "showTitle": case "title": case "titleTemplate": this.callBase(args); this._renderGeometry(); break; case "target": case "boundaryOffset": case "arrowPosition": case "arrowOffset": this._renderGeometry(); break; case "fullScreen": if (args.value) { this.option("fullScreen", false) } break; default: this.callBase(args) } }, show: function(target) { if (target) { this.option("target", target) } return this.callBase() } }); registerComponent("dxPopover", Popover); module.exports = Popover }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!********************************!*\ !*** ./Scripts/ui/text_box.js ***! \********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { module.exports = __webpack_require__( /*! ./text_box/text_box */ 407) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************************!*\ !*** ./Scripts/bundles/modules/core.js ***! \*****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var DevExpress = window.DevExpress = window.DevExpress || {}; DevExpress.clientExporter = __webpack_require__( /*! ../../client_exporter */ 138); DevExpress.VERSION = __webpack_require__( /*! ../../core/version */ 123); DevExpress.Class = __webpack_require__( /*! ../../core/class */ 5); DevExpress.DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 39); DevExpress.Component = __webpack_require__( /*! ../../core/component */ 92); DevExpress.registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 3); DevExpress.devices = __webpack_require__( /*! ../../core/devices */ 7); var errors = DevExpress.errors = __webpack_require__( /*! ../../core/errors */ 10); DevExpress.Color = __webpack_require__( /*! ../../color */ 55); var $ = __webpack_require__( /*! jquery */ 1); var compareVersions = __webpack_require__( /*! ../../core/utils/version */ 56).compare; if (compareVersions($.fn.jquery, [1, 10]) < 0) { throw errors.Error("E0012") } var animationFrame = __webpack_require__( /*! ../../animation/frame */ 75); /** * @name requestAnimationFrame * @publicName requestAnimationFrame(callback) * @type method * @deprecated utils_requestAnimationFrame */ DevExpress.requestAnimationFrame = function() { errors.log("W0000", "DevExpress.requestAnimationFrame", "15.2", "Use the 'DevExpress.utils.requestAnimationFrame' method instead."); return animationFrame.requestAnimationFrame.apply(animationFrame, arguments) }; DevExpress.cancelAnimationFrame = function() { errors.log("W0000", "DevExpress.cancelAnimationFrame", "15.2", "Use the 'DevExpress.utils.cancelAnimationFrame' method instead."); return animationFrame.cancelAnimationFrame.apply(animationFrame, arguments) }; DevExpress.EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 32); DevExpress.utils = {}; DevExpress.utils.requestAnimationFrame = animationFrame.requestAnimationFrame; DevExpress.utils.cancelAnimationFrame = animationFrame.cancelAnimationFrame; DevExpress.utils.initMobileViewport = __webpack_require__( /*! ../../mobile/init_mobile_viewport/init_mobile_viewport */ 218).initMobileViewport; DevExpress.utils.extendFromObject = __webpack_require__( /*! ../../core/utils/object */ 30).extendFromObject; DevExpress.utils.createComponents = __webpack_require__( /*! ../../core/utils/dom */ 11).createComponents; DevExpress.utils.triggerShownEvent = __webpack_require__( /*! ../../core/utils/dom */ 11).triggerShownEvent; DevExpress.utils.triggerHidingEvent = __webpack_require__( /*! ../../core/utils/dom */ 11).triggerHidingEvent; DevExpress.utils.resetActiveElement = __webpack_require__( /*! ../../core/utils/dom */ 11).resetActiveElement; DevExpress.utils.findBestMatches = __webpack_require__( /*! ../../core/utils/common */ 2).findBestMatches; DevExpress.createQueue = __webpack_require__( /*! ../../core/utils/queue */ 143).create; DevExpress.utils.dom = __webpack_require__( /*! ../../core/utils/dom */ 11); DevExpress.utils.common = __webpack_require__( /*! ../../core/utils/common */ 2); DevExpress.utils.date = __webpack_require__( /*! ../../core/utils/date */ 12); DevExpress.utils.browser = __webpack_require__( /*! ../../core/utils/browser */ 22); DevExpress.utils.inflector = __webpack_require__( /*! ../../core/utils/inflector */ 29); DevExpress.utils.resizeCallbacks = __webpack_require__( /*! ../../core/utils/window */ 57).resizeCallbacks; DevExpress.utils.console = __webpack_require__( /*! ../../core/utils/console */ 36); DevExpress.utils.string = __webpack_require__( /*! ../../core/utils/string */ 26); DevExpress.utils.support = __webpack_require__( /*! ../../core/utils/support */ 18); DevExpress.processHardwareBackButton = __webpack_require__( /*! ../../mobile/process_hardware_back_button */ 219); DevExpress.viewPort = __webpack_require__( /*! ../../core/utils/view_port */ 52).value; DevExpress.hideTopOverlay = __webpack_require__( /*! ../../mobile/hide_top_overlay */ 100); DevExpress.formatHelper = __webpack_require__( /*! ../../format_helper */ 68); var config = DevExpress.config = __webpack_require__( /*! ../../core/config */ 35); Object.defineProperty(DevExpress, "rtlEnabled", { get: function() { errors.log("W0003", "DevExpress", "rtlEnabled", "16.1", "Use the 'DevExpress.config' method instead"); return config().rtlEnabled }, set: function(value) { errors.log("W0003", "DevExpress", "rtlEnabled", "16.1", "Use the 'DevExpress.config' method instead"); config({ rtlEnabled: value }) } }); Object.defineProperty(DevExpress, "designMode", { get: function() { return config().designMode }, set: function(value) { config({ designMode: value }) } }); DevExpress.animationPresets = __webpack_require__( /*! ../../animation/presets/presets */ 110).presets; DevExpress.fx = __webpack_require__( /*! ../../animation/fx */ 21); DevExpress.TransitionExecutor = __webpack_require__( /*! ../../animation/transition_executor/transition_executor */ 91).TransitionExecutor; DevExpress.AnimationPresetCollection = __webpack_require__( /*! ../../animation/presets/presets */ 110).PresetCollection; module.exports = DevExpress.events = {}; DevExpress.events.click = __webpack_require__( /*! ../../events/click */ 9); DevExpress.events.utils = __webpack_require__( /*! ../../events/utils */ 4); DevExpress.events.GestureEmitter = __webpack_require__( /*! ../../events/gesture/emitter.gesture */ 120); DevExpress.localization = {}; DevExpress.localization.message = __webpack_require__( /*! ../../localization/message */ 8); DevExpress.localization.number = __webpack_require__( /*! ../../localization/number */ 38); DevExpress.localization.date = __webpack_require__( /*! ../../localization/date */ 14); __webpack_require__( /*! ../../localization/currency */ 117); module.exports = DevExpress }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***********************************************!*\ !*** ./Scripts/ui/widget/jquery.selectors.js ***! \***********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__( /*! jquery */ 1)], __WEBPACK_AMD_DEFINE_RESULT__ = function($) { var focusable = function(element, tabIndex) { var nodeName = element.nodeName.toLowerCase(), isTabIndexNotNaN = !isNaN(tabIndex), isVisible = visible(element), isDisabled = element.disabled, isDefaultFocus = /^(input|select|textarea|button|object|iframe)$/.test(nodeName), isHyperlink = "a" === nodeName, isFocusable = true; if (isDefaultFocus) { isFocusable = !isDisabled } else { if (isHyperlink) { isFocusable = element.href || isTabIndexNotNaN } else { isFocusable = isTabIndexNotNaN } } return isVisible ? isFocusable : false }; var visible = function(element) { var $element = $(element); return $element.is(":visible") && "hidden" !== $element.css("visibility") && "hidden" !== $element.parents().css("visibility") }; var icontains = function(elem, text) { var result = false; $.each($(elem).contents(), function(index, content) { if (3 === content.nodeType && (content.textContent || content.nodeValue || "").toLowerCase().indexOf((text || "").toLowerCase()) > -1) { result = true; return false } }); return result }; $.extend($.expr[":"], { "dx-focusable": function(element) { return focusable(element, $.attr(element, "tabindex")) }, "dx-tabbable": function(element) { var tabIndex = $.attr(element, "tabindex"); return (isNaN(tabIndex) || tabIndex >= 0) && focusable(element, tabIndex) }, "dx-icontains": $.expr.createPseudo(function(text) { return function(elem) { return icontains(elem, text) } }) }); return { focusable: ":dx-focusable", tabbable: ":dx-tabbable", icontains: ":dx-icontains" } }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************************!*\ !*** ./Scripts/ui/widget/ui.template.function.js ***! \***************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), TemplateBase = __webpack_require__( /*! ./ui.template_base */ 47), domUtils = __webpack_require__( /*! ../../core/utils/dom */ 11); var FunctionTemplate = TemplateBase.inherit({ ctor: function(render, owner) { this.callBase($(), owner); this._render = render }, _renderCore: function(data, index, container) { return domUtils.normalizeTemplateElement(this._render(data, index, container)) } }); module.exports = FunctionTemplate }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!********************************************!*\ !*** ./Scripts/mobile/hide_top_overlay.js ***! \********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1); var hideCallback = function() { var callbacks = []; return { add: function(callback) { var indexOfCallback = $.inArray(callback, callbacks); if (-1 === indexOfCallback) { callbacks.push(callback) } }, remove: function(callback) { var indexOfCallback = $.inArray(callback, callbacks); if (-1 !== indexOfCallback) { callbacks.splice(indexOfCallback, 1) } }, fire: function() { var callback = callbacks.pop(), result = !!callback; if (result) { callback() } return result }, hasCallback: function() { return callbacks.length > 0 }, reset: function() { callbacks = [] } } }(); module.exports = function() { return hideCallback.fire() }; module.exports.hideCallback = hideCallback }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*********************************!*\ !*** ./Scripts/ui/check_box.js ***! \*********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), devices = __webpack_require__( /*! ../core/devices */ 7), inkRipple = __webpack_require__( /*! ./widget/utils.ink_ripple */ 48), Editor = __webpack_require__( /*! ./editor/editor */ 31), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 3), eventUtils = __webpack_require__( /*! ../events/utils */ 4), themes = __webpack_require__( /*! ./themes */ 23), clickEvent = __webpack_require__( /*! ../events/click */ 9); var CHECKBOX_CLASS = "dx-checkbox", CHECKBOX_ICON_CLASS = "dx-checkbox-icon", CHECKBOX_CHECKED_CLASS = "dx-checkbox-checked", CHECKBOX_CONTAINER_CLASS = "dx-checkbox-container", CHECKBOX_TEXT_CLASS = "dx-checkbox-text", CHECKBOX_HAS_TEXT_CLASS = "dx-checkbox-has-text", CHECKBOX_INDETERMINATE_CLASS = "dx-checkbox-indeterminate", CHECKBOX_FEEDBACK_HIDE_TIMEOUT = 100; var CheckBox = Editor.inherit({ _supportedKeys: function() { var click = function(e) { e.preventDefault(); this._clickAction({ jQueryEvent: e }) }; return $.extend(this.callBase(), { space: click }) }, _getDefaultOptions: function() { return $.extend(this.callBase(), { hoverStateEnabled: true, activeStateEnabled: true, value: false, text: "", useInkRipple: false }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function(device) { return "desktop" === devices.real().deviceType && !devices.isSimulator() }, options: { focusStateEnabled: true } }, { device: function() { return /android5/.test(themes.current()) }, options: { useInkRipple: true } }]) }, _feedbackHideTimeout: CHECKBOX_FEEDBACK_HIDE_TIMEOUT, _render: function() { this.callBase(); this._$container = $("
").addClass(CHECKBOX_CONTAINER_CLASS); this.setAria("role", "checkbox"); this._renderClick(); this._renderValue(); this._renderIcon(); this._renderText(); this.option("useInkRipple") && this._renderInkRipple(); this.element().addClass(CHECKBOX_CLASS).append(this._$container) }, _renderInkRipple: function() { this._inkRipple = inkRipple.render({ waveSizeCoefficient: 2.5, useHoldAnimation: false, wavesNumber: 2, isCentered: true }) }, _renderInkWave: function(element, jQueryEvent, doRender, waveIndex) { if (!this._inkRipple) { return } var config = { element: element, jQueryEvent: jQueryEvent, wave: waveIndex }; if (doRender) { this._inkRipple.showWave(config) } else { this._inkRipple.hideWave(config) } }, _updateFocusState: function(e, value) { this.callBase.apply(this, arguments); this._renderInkWave(this._$icon, e, value, 0) }, _toggleActiveState: function($element, value, e) { this.callBase.apply(this, arguments); this._renderInkWave(this._$icon, e, value, 1) }, _renderIcon: function() { this._$icon = $("").addClass(CHECKBOX_ICON_CLASS).prependTo(this._$container) }, _renderText: function() { var textValue = this.option("text"); if (!textValue) { if (this._$text) { this._$text.remove(); this.element().removeClass(CHECKBOX_HAS_TEXT_CLASS) } return } if (!this._$text) { this._$text = $("").addClass(CHECKBOX_TEXT_CLASS) } this._$text.text(textValue); this._$container.append(this._$text); this.element().addClass(CHECKBOX_HAS_TEXT_CLASS) }, _renderClick: function() { var that = this, eventName = eventUtils.addNamespace(clickEvent.name, that.NAME); that._clickAction = that._createAction(that._clickHandler); that.element().off(eventName).on(eventName, function(e) { that._clickAction({ jQueryEvent: e }) }) }, _clickHandler: function(args) { var that = args.component; that._saveValueChangeEvent(args.jQueryEvent); that.option("value", !that.option("value")) }, _renderValue: function() { var $element = this.element(), checked = this.option("value"), indeterminate = void 0 === checked; $element.toggleClass(CHECKBOX_CHECKED_CLASS, Boolean(checked)); $element.toggleClass(CHECKBOX_INDETERMINATE_CLASS, indeterminate); this.setAria("checked", indeterminate ? "mixed" : checked || "false") }, _optionChanged: function(args) { switch (args.name) { case "useInkRipple": this._invalidate(); break; case "value": this._renderValue(); this.callBase(args); break; case "text": this._renderText(); this._renderDimensions(); break; default: this.callBase(args) } } }); registerComponent("dxCheckBox", CheckBox); module.exports = CheckBox }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************************************!*\ !*** ./Scripts/ui/scheduler/ui.scheduler.publisher_mixin.js ***! \**************************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var publisherMixin = { notifyObserver: function(subject, args) { var observer = this.option("observer"); if (observer) { observer.fire(subject, args) } }, invoke: function() { var observer = this.option("observer"); if (observer) { return observer.fire.apply(observer, arguments) } } }; module.exports = publisherMixin }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************************!*\ !*** ./Scripts/viz/core/base_theme_manager.js ***! \************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../../core/class */ 5), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), paletteModule = __webpack_require__( /*! ../palette */ 121), _isString = commonUtils.isString, _parseScalar = __webpack_require__( /*! ./utils */ 6).parseScalar, themeModule = __webpack_require__( /*! ../themes */ 69), _findTheme = themeModule.findTheme, _addCacheItem = themeModule.addCacheItem, _removeCacheItem = themeModule.removeCacheItem, _extend = $.extend, _each = $.each; __webpack_require__( /*! ./default */ 513); __webpack_require__( /*! ./ios */ 516); __webpack_require__( /*! ./android */ 512); __webpack_require__( /*! ./win */ 520); function getThemePart(theme, path) { var _theme = theme; path && _each(path.split("."), function(_, pathItem) { return _theme = _theme[pathItem] }); return _theme } exports.BaseThemeManager = Class.inherit({ ctor: function() { _addCacheItem(this) }, dispose: function() { var that = this; _removeCacheItem(that); that._callback = that._theme = that._font = null; return that }, setCallback: function(callback) { this._callback = callback; return this }, setTheme: function(theme, rtl) { this._current = theme; this._rtl = rtl; return this.refresh() }, refresh: function() { var that = this, current = that._current || {}, theme = _findTheme(current.name || current); that._themeName = theme.name; that._defaultPalette = theme.defaultPalette; that._font = _extend({}, theme.font, current.font); that._themeSection && _each(that._themeSection.split("."), function(_, path) { theme = _extend(true, {}, theme[path], that._IE8 ? theme[path + "IE8"] : {}) }); that._theme = _extend(true, {}, theme, _isString(current) ? {} : current); that._initializeTheme(); if (_parseScalar(that._rtl, that._theme.rtlEnabled)) { _extend(true, that._theme, that._theme._rtl) } that._callback(); return that }, theme: function(path) { return getThemePart(this._theme, path) }, themeName: function() { return this._themeName }, createPalette: function(palette, options) { return new paletteModule.Palette(palette || this._defaultPalette, options) }, createDiscretePalette: function(palette, count) { return new paletteModule.DiscretePalette(palette || this._defaultPalette, count) }, createGradientPalette: function(palette) { return new paletteModule.GradientPalette(palette || this._defaultPalette) }, _initializeTheme: function() { var that = this; _each(that._fontFields || [], function(_, path) { that._initializeFont(getThemePart(that._theme, path)) }) }, _initializeFont: function(font) { _extend(font, this._font, _extend({}, font)) } }) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************************!*\ !*** ./Scripts/viz/series/points/symbol_point.js ***! \***************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ../../../core/utils/common */ 2), labelModule = __webpack_require__( /*! ./label */ 336), _extend = $.extend, _isDefined = commonUtils.isDefined, _normalizeEnum = __webpack_require__( /*! ../../core/utils */ 6).normalizeEnum, _math = Math, _round = _math.round, _floor = _math.floor, _ceil = _math.ceil, DEFAULT_IMAGE_WIDTH = 20, DEFAULT_IMAGE_HEIGHT = 20, LABEL_OFFSET = 10, CANVAS_POSITION_DEFAULT = "canvas_position_default"; function getSquareMarkerCoords(radius) { return [-radius, -radius, radius, -radius, radius, radius, -radius, radius, -radius, -radius] } function getPolygonMarkerCoords(radius) { var r = _ceil(radius); return [-r, 0, 0, -r, r, 0, 0, r, -r, 0] } function getCrossMarkerCoords(radius) { var r = _ceil(radius), floorHalfRadius = _floor(r / 2), ceilHalfRadius = _ceil(r / 2); return [-r, -floorHalfRadius, -floorHalfRadius, -r, 0, -ceilHalfRadius, floorHalfRadius, -r, r, -floorHalfRadius, ceilHalfRadius, 0, r, floorHalfRadius, floorHalfRadius, r, 0, ceilHalfRadius, -floorHalfRadius, r, -r, floorHalfRadius, -ceilHalfRadius, 0] } function getTriangleDownMarkerCoords(radius) { return [-radius, -radius, radius, -radius, 0, radius, -radius, -radius] } function getTriangleUpMarkerCoords(radius) { return [-radius, radius, radius, radius, 0, -radius, -radius, radius] } module.exports = { deleteLabel: function() { this._label.dispose(); this._label = null }, _hasGraphic: function() { return this.graphic }, clearVisibility: function() { var that = this, graphic = that.graphic; if (graphic && graphic.attr("visibility")) { graphic.attr({ visibility: null }) } that._label.clearVisibility() }, isVisible: function() { return this.inVisibleArea && this.series.isVisible() }, setInvisibility: function() { var that = this, graphic = that.graphic; if (graphic && "hidden" !== graphic.attr("visibility")) { graphic.attr({ visibility: "hidden" }) } that._errorBar && that._errorBar.attr({ visibility: "hidden" }); that._label.hide() }, clearMarker: function() { var graphic = this.graphic; graphic && graphic.attr(this._emptySettings) }, _createLabel: function() { this._label = new labelModule.Label({ renderer: this.series._renderer, labelsGroup: this.series._labelsGroup, point: this }) }, _updateLabelData: function() { this._label.setData(this._getLabelFormatObject()) }, _updateLabelOptions: function() { !this._label && this._createLabel(); this._label.setOptions(this._options.label) }, _checkImage: function(image) { return _isDefined(image) && ("string" === typeof image || _isDefined(image.url)) }, _fillStyle: function() { this._styles = this._options.styles }, _checkSymbol: function(oldOptions, newOptions) { var oldSymbol = oldOptions.symbol, newSymbol = newOptions.symbol, symbolChanged = "circle" === oldSymbol && "circle" !== newSymbol || "circle" !== oldSymbol && "circle" === newSymbol, imageChanged = this._checkImage(oldOptions.image) !== this._checkImage(newOptions.image); return !!(symbolChanged || imageChanged) }, _populatePointShape: function(symbol, radius) { switch (symbol) { case "square": return getSquareMarkerCoords(radius); case "polygon": return getPolygonMarkerCoords(radius); case "triangle": case "triangleDown": return getTriangleDownMarkerCoords(radius); case "triangleUp": return getTriangleUpMarkerCoords(radius); case "cross": return getCrossMarkerCoords(radius) } }, correctValue: function(correction) { var that = this; if (that.hasValue()) { that.value = that.initialValue + correction; that.minValue = correction; that.translate() } }, resetCorrection: function() { this.value = this.initialValue; this.minValue = CANVAS_POSITION_DEFAULT }, resetValue: function() { var that = this; if (that.hasValue()) { that.value = that.initialValue = 0; that.minValue = 0; that.translate(); that._label.setDataField("value", that.value) } }, _getTranslates: function(animationEnabled) { var translateX = this.x, translateY = this.y; if (animationEnabled) { if (this._options.rotated) { translateX = this.defaultX } else { translateY = this.defaultY } } return { x: translateX, y: translateY } }, _createImageMarker: function(renderer, settings, options) { var width = options.width || DEFAULT_IMAGE_WIDTH, height = options.height || DEFAULT_IMAGE_HEIGHT; return renderer.image(-_round(.5 * width), -_round(.5 * height), width, height, options.url ? options.url.toString() : options.toString(), "center").attr({ translateX: settings.translateX, translateY: settings.translateY, visibility: settings.visibility }) }, _createSymbolMarker: function(renderer, pointSettings) { var marker, symbol = this._options.symbol; if ("circle" === symbol) { delete pointSettings.points; marker = renderer.circle().attr(pointSettings) } else { if ("square" === symbol || "polygon" === symbol || "triangle" === symbol || "triangleDown" === symbol || "triangleUp" === symbol || "cross" === symbol) { marker = renderer.path([], "area").attr(pointSettings).sharp() } } return marker }, _createMarker: function(renderer, group, image, settings, animationEnabled) { var that = this, marker = that._checkImage(image) ? that._createImageMarker(renderer, settings, image) : that._createSymbolMarker(renderer, settings); if (marker) { marker.data({ "chart-data-point": that }).append(group) } return marker }, _getSymbolBbox: function(x, y, r) { return { x: x - r, y: y - r, width: 2 * r, height: 2 * r } }, _getImageBbox: function(x, y) { var image = this._options.image, width = image.width || DEFAULT_IMAGE_WIDTH, height = image.height || DEFAULT_IMAGE_HEIGHT; return { x: x - _round(width / 2), y: y - _round(height / 2), width: width, height: height } }, _getGraphicBbox: function() { var bbox, that = this, options = that._options, x = that.x, y = that.y; if (options.visible) { bbox = that._checkImage(options.image) ? that._getImageBbox(x, y) : that._getSymbolBbox(x, y, options.styles.normal.r) } else { bbox = { x: x, y: y, width: 0, height: 0 } } return bbox }, _isLabelInsidePoint: $.noop, _getShiftLabelCoords: function(label) { var coord = this._addLabelAlignmentAndOffset(label, this._getLabelCoords(label)); return this._checkLabelPosition(label, coord) }, _drawLabel: function() { var that = this, customVisibility = that._getCustomLabelVisibility(), label = that._label; if ((that.series.getLabelVisibility() || customVisibility) && that._showForZeroValues() && that.hasValue()) { label.show() } else { label.hide() } }, correctLabelPosition: function(label) { var coord, that = this; if (!that._isLabelInsidePoint(label)) { coord = that._getShiftLabelCoords(label); label.setFigureToDrawConnector(that._getLabelConnector(label.pointPosition)); label.shift(_round(coord.x), _round(coord.y)) } }, _showForZeroValues: function() { return true }, _getLabelConnector: function(pointPosition) { var bbox = this._getGraphicBbox(pointPosition), w2 = bbox.width / 2, h2 = bbox.height / 2; return { x: bbox.x + w2, y: bbox.y + h2, r: this._options.visible ? Math.max(w2, h2) : 0 } }, _getPositionFromLocation: function() { return { x: this.x, y: this.y } }, _isPointInVisibleArea: function(visibleArea, graphicBbox) { return visibleArea.minX <= graphicBbox.x + graphicBbox.width && visibleArea.maxX >= graphicBbox.x && visibleArea.minY <= graphicBbox.y + graphicBbox.height && visibleArea.maxY >= graphicBbox.y }, _checkLabelPosition: function(label, coord) { var that = this, visibleArea = that._getVisibleArea(), labelBbox = label.getBoundingRect(), graphicBbox = that._getGraphicBbox(label.pointPosition), offset = LABEL_OFFSET; if (that._isPointInVisibleArea(visibleArea, graphicBbox)) { if (!that._options.rotated) { if (visibleArea.minX > coord.x) { coord.x = visibleArea.minX } if (visibleArea.maxX < coord.x + labelBbox.width) { coord.x = visibleArea.maxX - labelBbox.width } if (visibleArea.minY > coord.y) { coord.y = graphicBbox.y + graphicBbox.height + offset } if (visibleArea.maxY < coord.y + labelBbox.height) { coord.y = graphicBbox.y - labelBbox.height - offset } } else { if (visibleArea.minX > coord.x) { coord.x = graphicBbox.x + graphicBbox.width + offset } if (visibleArea.maxX < coord.x + labelBbox.width) { coord.x = graphicBbox.x - offset - labelBbox.width } if (visibleArea.minY > coord.y) { coord.y = visibleArea.minY } if (visibleArea.maxY < coord.y + labelBbox.height) { coord.y = visibleArea.maxY - labelBbox.height } } } return coord }, _addLabelAlignmentAndOffset: function(label, coord) { var labelBBox = label.getBoundingRect(), labelOptions = label.getLayoutOptions(); if (!this._options.rotated) { if ("left" === labelOptions.alignment) { coord.x += labelBBox.width / 2 } else { if ("right" === labelOptions.alignment) { coord.x -= labelBBox.width / 2 } } } coord.x += labelOptions.horizontalOffset; coord.y += labelOptions.verticalOffset; return coord }, _getLabelCoords: function(label) { return this._getLabelCoordOfPosition(label, this._getLabelPosition(label.pointPosition)) }, _getLabelCoordOfPosition: function(label, position) { var that = this, labelBBox = label.getBoundingRect(), graphicBbox = that._getGraphicBbox(label.pointPosition), offset = LABEL_OFFSET, centerY = graphicBbox.height / 2 - labelBBox.height / 2, centerX = graphicBbox.width / 2 - labelBBox.width / 2, x = graphicBbox.x, y = graphicBbox.y; switch (position) { case "left": x -= labelBBox.width + offset; y += centerY; break; case "right": x += graphicBbox.width + offset; y += centerY; break; case "top": x += centerX; y -= labelBBox.height + offset; break; case "bottom": x += centerX; y += graphicBbox.height + offset; break; case "inside": x += centerX; y += centerY } return { x: x, y: y } }, _drawMarker: function(renderer, group, animationEnabled) { var that = this, options = that._options, translates = that._getTranslates(animationEnabled), style = that._getStyle(); that.graphic = that._createMarker(renderer, group, options.image, _extend({ translateX: translates.x, translateY: translates.y, points: that._populatePointShape(options.symbol, style.r) }, style), animationEnabled) }, _getErrorBarSettings: function() { return { visibility: "visible" } }, _drawErrorBar: function(renderer, group) { if (!this._options.errorBars) { return } var settings, that = this, options = that._options, errorBarOptions = options.errorBars, points = [], pos = that._errorBarPos, high = that._highErrorCoord, low = that._lowErrorCoord, displayMode = _normalizeEnum(errorBarOptions.displayMode), isHighDisplayMode = "high" === displayMode, isLowDisplayMode = "low" === displayMode, edgeLength = _floor(parseInt(errorBarOptions.edgeLength) / 2), highErrorOnly = (isHighDisplayMode || !_isDefined(low)) && _isDefined(high) && !isLowDisplayMode, lowErrorOnly = (isLowDisplayMode || !_isDefined(high)) && _isDefined(low) && !isHighDisplayMode; highErrorOnly && (low = that._baseErrorBarPos); lowErrorOnly && (high = that._baseErrorBarPos); if ("none" !== displayMode && _isDefined(high) && _isDefined(low) && _isDefined(pos)) { !lowErrorOnly && points.push([pos - edgeLength, high, pos + edgeLength, high]); points.push([pos, high, pos, low]); !highErrorOnly && points.push([pos + edgeLength, low, pos - edgeLength, low]); options.rotated && $.each(points, function(_, p) { p.reverse() }); settings = that._getErrorBarSettings(errorBarOptions); if (!that._errorBar) { that._errorBar = renderer.path(points, "line").attr(settings).append(group) } else { settings.points = points; that._errorBar.attr(settings) } } else { that._errorBar && that._errorBar.attr({ visibility: "hidden" }) } }, getTooltipParams: function() { var that = this, graphic = that.graphic; return { x: that.x, y: that.y, offset: graphic ? graphic.getBBox().height / 2 : 0 } }, setPercentValue: function(total, fullStacked, leftHoleTotal, rightHoleTotal) { var that = this, valuePercent = that.value / total || 0, minValuePercent = that.minValue / total || 0, percent = valuePercent - minValuePercent; that._label.setDataField("percent", percent); that._label.setDataField("total", total); if (that.series.isFullStackedSeries() && that.hasValue()) { if (that.leftHole) { that.leftHole /= total - leftHoleTotal; that.minLeftHole /= total - leftHoleTotal } if (that.rightHole) { that.rightHole /= total - rightHoleTotal; that.minRightHole /= total - rightHoleTotal } that.value = valuePercent; that.minValue = !minValuePercent ? that.minValue : minValuePercent; that.translate() } }, _storeTrackerR: function() { var minTrackerSize, that = this, navigator = window.navigator, r = that._options.styles.normal.r; navigator = that.__debug_navigator || navigator; that.__debug_browserNavigator = navigator; minTrackerSize = "ontouchstart" in window || navigator.msPointerEnabled && navigator.msMaxTouchPoints || navigator.pointerEnabled && navigator.maxTouchPoints ? 20 : 6; that._options.trackerR = r < minTrackerSize ? minTrackerSize : r; return that._options.trackerR }, _translateErrorBars: function(valueTranslator) { var that = this, options = that._options, rotated = options.rotated, errorBars = options.errorBars; if (!errorBars) { return } _isDefined(that.lowError) && (that._lowErrorCoord = valueTranslator.translate(that.lowError)); _isDefined(that.highError) && (that._highErrorCoord = valueTranslator.translate(that.highError)); that._errorBarPos = _floor(rotated ? that.vy : that.vx); that._baseErrorBarPos = "stdDeviation" === errorBars.type ? that._lowErrorCoord + (that._highErrorCoord - that._lowErrorCoord) / 2 : rotated ? that.vx : that.vy }, _translate: function(translators) { var valueTranslator, that = this; if (that._options.rotated) { valueTranslator = translators.x; that.vx = that.x = valueTranslator.translate(that.value); that.vy = that.y = translators.y.translate(that.argument); that.minX = valueTranslator.translate(that.minValue); that.defaultX = valueTranslator.translate(CANVAS_POSITION_DEFAULT); that._translateErrorBars(valueTranslator) } else { valueTranslator = translators.y; that.vy = that.y = valueTranslator.translate(that.value); that.vx = that.x = translators.x.translate(that.argument); that.minY = valueTranslator.translate(that.minValue); that.defaultY = valueTranslator.translate(CANVAS_POSITION_DEFAULT); that._translateErrorBars(valueTranslator) } that._calculateVisibility(that.x, that.y) }, _updateData: function(data) { var that = this; that.value = that.initialValue = that.originalValue = data.value; that.minValue = that.initialMinValue = that.originalMinValue = _isDefined(data.minValue) ? data.minValue : CANVAS_POSITION_DEFAULT }, _getImageSettings: function(image) { return { href: image.url || image.toString(), width: image.width || DEFAULT_IMAGE_WIDTH, height: image.height || DEFAULT_IMAGE_HEIGHT } }, getCrosshairData: function() { var that = this, r = that._options.rotated, value = that.value, argument = that.argument; return { x: that.vx, y: that.vy, xValue: r ? value : argument, yValue: r ? argument : value, axis: that.series.axis } }, getPointRadius: function() { var extraSpace, style = this._getStyle(), options = this._options, r = style.r, symbol = options.symbol, isSquare = "square" === symbol, isTriangle = "triangle" === symbol || "triangleDown" === symbol || "triangleUp" === symbol; if (options.visible && !options.image && r) { extraSpace = style["stroke-width"] / 2; return (isSquare || isTriangle ? 1.4 * r : r) + extraSpace } return 0 }, _updateMarker: function(animationEnabled, style) { var settings, that = this, options = that._options, image = options.image, visibility = !that.isVisible() ? { visibility: "hidden" } : {}; style = style || that._getStyle(); if (that._checkImage(image)) { settings = _extend({}, { visibility: style.visibility }, visibility, that._getImageSettings(image)) } else { settings = _extend({}, style, visibility, { points: that._populatePointShape(options.symbol, style.r) }) } if (!animationEnabled) { settings.translateX = that.x; settings.translateY = that.y } that.graphic.attr(settings).sharp() }, _getLabelFormatObject: function() { var that = this; return { argument: that.initialArgument, value: that.initialValue, originalArgument: that.originalArgument, originalValue: that.originalValue, seriesName: that.series.name, lowErrorValue: that.lowError, highErrorValue: that.highError, point: that } }, _getLabelPosition: function() { var rotated = this._options.rotated; if (this.initialValue > 0) { return rotated ? "right" : "top" } else { return rotated ? "left" : "bottom" } }, _getFormatObject: function(tooltip) { var that = this, labelFormatObject = that._label.getData(); return _extend({}, labelFormatObject, { argumentText: tooltip.formatValue(that.initialArgument, "argument"), valueText: tooltip.formatValue(that.initialValue) }, _isDefined(labelFormatObject.percent) ? { percentText: tooltip.formatValue(labelFormatObject.percent, "percent") } : {}, _isDefined(labelFormatObject.total) ? { totalText: tooltip.formatValue(labelFormatObject.total) } : {}) }, _getMarkerVisibility: function() { return this._options.visible }, coordsIn: function(x, y) { var trackerRadius = this._storeTrackerR(); return x >= this.x - trackerRadius && x <= this.x + trackerRadius && y >= this.y - trackerRadius && y <= this.y + trackerRadius } } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************************!*\ !*** ./Scripts/viz/translators/translator2d.js ***! \*************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var _Translator2d, $ = __webpack_require__( /*! jquery */ 1), numericTranslator = __webpack_require__( /*! ./numeric_translator */ 237), categoryTranslator = __webpack_require__( /*! ./category_translator */ 554), intervalTranslator = __webpack_require__( /*! ./interval_translator */ 556), datetimeTranslator = __webpack_require__( /*! ./datetime_translator */ 555), logarithmicTranslator = __webpack_require__( /*! ./logarithmic_translator */ 557), vizUtils = __webpack_require__( /*! ../core/utils */ 6), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), getLog = vizUtils.getLog, getPower = vizUtils.getPower, isDefined = commonUtils.isDefined, _abs = Math.abs, CANVAS_PROP = ["width", "height", "left", "top", "bottom", "right"], NUMBER_EQUALITY_CORRECTION = 1, DATETIME_EQUALITY_CORRECTION = 6e4, _noop = $.noop, addInterval = __webpack_require__( /*! ../../core/utils/date */ 12).addInterval; var validateCanvas = function(canvas) { $.each(CANVAS_PROP, function(_, prop) { canvas[prop] = parseInt(canvas[prop]) || 0 }); return canvas }; var makeCategoriesToPoints = function(categories) { var categoriesToPoints = {}, length = categories.length, i = 0; for (; i < length; i++) { categoriesToPoints[categories[i]] = i } return categoriesToPoints }; var validateBusinessRange = function(businessRange) { function validate(valueSelector, baseValueSelector) { if (!isDefined(businessRange[valueSelector]) && isDefined(businessRange[baseValueSelector])) { businessRange[valueSelector] = businessRange[baseValueSelector] } } validate("minVisible", "min"); validate("maxVisible", "max"); return businessRange }; function valuesIsDefinedAndEqual(val1, val2) { return isDefined(val1) && isDefined(val2) && val1.valueOf() === val2.valueOf() } function getCanvasBounds(range) { var newMin, newMax, min = range.min, max = range.max, minVisible = range.minVisible, maxVisible = range.maxVisible, base = range.base, isDateTime = commonUtils.isDate(max) || commonUtils.isDate(min), correction = isDateTime ? DATETIME_EQUALITY_CORRECTION : NUMBER_EQUALITY_CORRECTION, isLogarithmic = "logarithmic" === range.axisType; if (isLogarithmic) { maxVisible = getLog(maxVisible, base); minVisible = getLog(minVisible, base); min = getLog(min, base); max = getLog(max, base) } if (valuesIsDefinedAndEqual(min, max)) { newMin = min.valueOf() - correction; newMax = max.valueOf() + correction; if (isDateTime) { min = new Date(newMin); max = new Date(newMax) } else { min = 0 !== min || isLogarithmic ? newMin : 0; max = newMax } } if (valuesIsDefinedAndEqual(minVisible, maxVisible)) { newMin = minVisible.valueOf() - correction; newMax = maxVisible.valueOf() + correction; if (isDateTime) { minVisible = newMin < min.valueOf() ? min : new Date(newMin); maxVisible = newMax > max.valueOf() ? max : new Date(newMax) } else { if (0 !== minVisible || isLogarithmic) { minVisible = newMin < min ? min : newMin } maxVisible = newMax > max ? max : newMax } } return { base: base, rangeMin: min, rangeMax: max, rangeMinVisible: minVisible, rangeMaxVisible: maxVisible } } exports.Translator2D = _Translator2d = function(businessRange, canvas, options) { this.update(businessRange, canvas, options) }; _Translator2d.prototype = { constructor: _Translator2d, reinit: function() { var that = this, range = that._businessRange, categories = range.categories || [], script = {}, canvasOptions = that._prepareCanvasOptions(), visibleCategories = vizUtils.getCategoriesInfo(categories, range.minVisible, range.maxVisible).categories, categoriesLength = (visibleCategories || categories).length; switch (range.axisType) { case "logarithmic": script = logarithmicTranslator; break; case "semidiscrete": script = intervalTranslator; canvasOptions.ratioOfCanvasRange = canvasOptions.canvasLength / (addInterval(canvasOptions.rangeMaxVisible, that._options.interval) - canvasOptions.rangeMinVisible); break; case "discrete": script = categoryTranslator; that._categories = categories; canvasOptions.interval = that._getDiscreteInterval(range.addSpiderCategory ? categoriesLength + 1 : categoriesLength, canvasOptions); that._categoriesToPoints = makeCategoriesToPoints(categories, canvasOptions.invert); if (visibleCategories && categoriesLength) { canvasOptions.startPointIndex = that._categoriesToPoints[visibleCategories[0]]; that.visibleCategories = visibleCategories } break; default: if ("datetime" === range.dataType) { script = datetimeTranslator } else { script = numericTranslator } } $.extend(that, script); that._conversionValue = that._options.conversionValue ? function(value) { return value } : function(value) { return Math.round(value) }; that._calculateSpecialValues() }, _getDiscreteInterval: function(categoriesLength, canvasOptions) { var correctedCategoriesCount = categoriesLength - (this._businessRange.stick ? 1 : 0); return correctedCategoriesCount > 0 ? canvasOptions.canvasLength / correctedCategoriesCount : canvasOptions.canvasLength }, _prepareCanvasOptions: function() { var length, that = this, businessRange = that._businessRange, canvasOptions = that._canvasOptions = getCanvasBounds(businessRange), canvas = that._canvas; if (that._options.isHorizontal) { canvasOptions.startPoint = canvas.left; length = canvas.width; canvasOptions.endPoint = canvas.width - canvas.right; canvasOptions.invert = businessRange.invert } else { canvasOptions.startPoint = canvas.top; length = canvas.height; canvasOptions.endPoint = canvas.height - canvas.bottom; canvasOptions.invert = !businessRange.invert } that.canvasLength = canvasOptions.canvasLength = canvasOptions.endPoint - canvasOptions.startPoint; canvasOptions.rangeDoubleError = Math.pow(10, getPower(canvasOptions.rangeMax - canvasOptions.rangeMin) - getPower(length) - 2); canvasOptions.ratioOfCanvasRange = canvasOptions.canvasLength / (canvasOptions.rangeMaxVisible - canvasOptions.rangeMinVisible); return canvasOptions }, updateCanvas: function(canvas) { this._canvas = validateCanvas(canvas); this.reinit() }, updateBusinessRange: function(businessRange) { this._businessRange = validateBusinessRange(businessRange); this.reinit() }, update: function(businessRange, canvas, options) { var that = this; that._options = $.extend(that._options || {}, options); that._canvas = validateCanvas(canvas); that.updateBusinessRange(businessRange) }, getBusinessRange: function() { return this._businessRange }, getCanvasVisibleArea: function() { return { min: this._canvasOptions.startPoint, max: this._canvasOptions.endPoint } }, _calculateSpecialValues: function() { var invert, canvas_position_default, canvas_position_center_middle, that = this, canvasOptions = that._canvasOptions, startPoint = canvasOptions.startPoint, endPoint = canvasOptions.endPoint, range = that._businessRange, minVisible = range.minVisible, maxVisible = range.maxVisible; if (minVisible <= 0 && maxVisible >= 0) { that.sc = {}; canvas_position_default = that.translate(0) } else { invert = range.invert ^ (minVisible <= 0 && maxVisible <= 0); if (that._options.isHorizontal) { canvas_position_default = invert ? endPoint : startPoint } else { canvas_position_default = invert ? startPoint : endPoint } } canvas_position_center_middle = startPoint + canvasOptions.canvasLength / 2; that.sc = { canvas_position_default: canvas_position_default, canvas_position_left: startPoint, canvas_position_top: startPoint, canvas_position_center: canvas_position_center_middle, canvas_position_middle: canvas_position_center_middle, canvas_position_right: endPoint, canvas_position_bottom: endPoint, canvas_position_start: canvasOptions.invert ? endPoint : startPoint, canvas_position_end: canvasOptions.invert ? startPoint : endPoint } }, translateSpecialCase: function(value) { return this.sc[value] }, _calculateProjection: function(distance) { var canvasOptions = this._canvasOptions; return canvasOptions.invert ? canvasOptions.endPoint - distance : canvasOptions.startPoint + distance }, _calculateUnProjection: function(distance) { var canvasOptions = this._canvasOptions; return canvasOptions.invert ? canvasOptions.rangeMaxVisible.valueOf() - distance : canvasOptions.rangeMinVisible.valueOf() + distance }, getVisibleCategories: function() { return this.visibleCategories }, getMinBarSize: function(minBarSize) { var visibleArea = this.getCanvasVisibleArea(), minValue = this.untranslate(visibleArea.min + minBarSize); return _abs(this.untranslate(visibleArea.min) - (!isDefined(minValue) ? this.untranslate(visibleArea.max) : minValue)) }, translate: _noop, untranslate: _noop, getInterval: _noop, zoom: _noop, getMinScale: _noop, getRange: function() { return [this.untranslate(this._canvasOptions.startPoint, -1), this.untranslate(this._canvasOptions.endPoint, 1)] }, isEmptyValueRange: function() { return this._businessRange.stubData }, getScreenRange: function() { return [this._canvasOptions.startPoint, this._canvasOptions.endPoint] }, add: function(value, diff, dir) { return this._add(value, diff, (this._businessRange.invert ? -1 : 1) * dir) } } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!********************************************!*\ !*** ./Scripts/viz/tree_map/colorizing.js ***! \********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var defaultColorizerName, _normalizeEnum = __webpack_require__( /*! ../core/utils */ 6).normalizeEnum, _noop = __webpack_require__( /*! jquery */ 1).noop, colorizers = {}; function wrapLeafColorGetter(getter) { return function(node) { return !node.isNode() ? getter(node) : void 0 } } function wrapGroupColorGetter(getter) { return function(node) { var parent = !node.isNode() && node.parent; return parent ? parent._groupColor = parent._groupColor || getter(parent) : void 0 } } exports.getColorizer = function(options, themeManager, root) { var type = _normalizeEnum(options.type || defaultColorizerName), colorizer = colorizers[type] && colorizers[type](options, themeManager, root); return colorizer ? (options.colorizeGroups ? wrapGroupColorGetter : wrapLeafColorGetter)(colorizer) : _noop }; exports.addColorizer = function(name, colorizer) { colorizers[name] = colorizer }; exports.setDefaultColorizer = function(name) { defaultColorizerName = name }; function getValueAsColorCode(node) { return node.value } function createColorCodeGetter(colorCodeField) { return function(node) { return Number(node.data[colorCodeField]) } } exports.createColorCodeGetter = function(options) { return options.colorCodeField ? createColorCodeGetter(options.colorCodeField) : getValueAsColorCode } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************************!*\ !*** ./Scripts/viz/tree_map/tiling.js ***! \****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var defaultAlgorithm, _isFunction = __webpack_require__( /*! ../../core/utils/common */ 2).isFunction, _normalizeEnum = __webpack_require__( /*! ../core/utils */ 6).normalizeEnum, _round = Math.round, algorithms = {}; exports.getAlgorithm = function(value) { return algorithms[_normalizeEnum(value)] || _isFunction(value) && value || defaultAlgorithm }; exports.addAlgorithm = function(name, callback) { algorithms[name] = callback }; exports.setDefaultAlgorithm = function(name) { defaultAlgorithm = algorithms[name] }; var directionToIndexOffsets = {}; directionToIndexOffsets[-1] = [2, 0]; directionToIndexOffsets[1] = [0, 2]; exports.buildSidesData = function(rect, directions, _staticSideIndex) { var sides = [rect[2] - rect[0], rect[3] - rect[1]], staticSideIndex = void 0 !== _staticSideIndex ? _staticSideIndex : sides[0] < sides[1] ? 0 : 1, variedSideIndex = 1 - staticSideIndex, staticSideDirection = directions[staticSideIndex], variedSideDirection = directions[variedSideIndex], staticSideIndexOffsets = directionToIndexOffsets[staticSideDirection], variedSideIndexOffsets = directionToIndexOffsets[variedSideDirection]; return { staticSide: sides[staticSideIndex], variedSide: sides[variedSideIndex], static1: staticSideIndex + staticSideIndexOffsets[0], static2: staticSideIndex + staticSideIndexOffsets[1], varied1: variedSideIndex + variedSideIndexOffsets[0], varied2: variedSideIndex + variedSideIndexOffsets[1], staticDir: staticSideDirection, variedDir: variedSideDirection } }; exports.calculateRectangles = function(nodes, head, totalRect, sidesData, rowData) { var i, ii, rect, delta, variedSidePart = [0, 0, 0, 0], static1 = sidesData.static1, static2 = sidesData.static2, position = totalRect[static1], dir = sidesData.staticDir, side = sidesData.staticSide, sum = rowData.sum; variedSidePart[sidesData.varied1] = totalRect[sidesData.varied1]; variedSidePart[sidesData.varied2] = totalRect[sidesData.varied1] + sidesData.variedDir * rowData.side; for (i = head, ii = head + rowData.count; i < ii; ++i) { rect = variedSidePart.slice(); rect[static1] = position; delta = _round(side * nodes[i].value / sum) || 0; sum -= nodes[i].value; side -= delta; position += dir * delta; rect[static2] = position; nodes[i].rect = rect } totalRect[sidesData.varied1] = variedSidePart[sidesData.varied2] } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**********************************!*\ !*** ./Scripts/ui/select_box.js ***! \**********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ../core/utils/common */ 2), errors = __webpack_require__( /*! ../core/errors */ 10), inkRipple = __webpack_require__( /*! ./widget/utils.ink_ripple */ 48), messageLocalization = __webpack_require__( /*! ../localization/message */ 8), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 3), eventUtils = __webpack_require__( /*! ../events/utils */ 4), DropDownList = __webpack_require__( /*! ./drop_down_editor/ui.drop_down_list */ 181), themes = __webpack_require__( /*! ./themes */ 23), clickEvent = __webpack_require__( /*! ../events/click */ 9); var SELECTBOX_CLASS = "dx-selectbox", SELECTBOX_POPUP_CLASS = "dx-selectbox-popup", SELECTBOX_CONTAINER_CLASS = "dx-selectbox-container", SELECTBOX_POPUP_WRAPPER_CLASS = "dx-selectbox-popup-wrapper"; var SelectBox = DropDownList.inherit({ _supportedKeys: function() { var that = this, parent = this.callBase(), clearSelectBox = function(e) { var isEditable = this._isEditable(); if (!isEditable) { if (this.option("showClearButton")) { e.preventDefault(); this.reset() } } else { if (this._valueSubstituted()) { this._preventFiltering = true } } this._preventSubstitution = true }; var searchIfNeeded = function() { if (that.option("searchEnabled") && that._valueSubstituted()) { that._searchHandler() } }; return $.extend({}, parent, { tab: function(e) { if (this.option("opened") && "instantly" === this.option("applyValueMode")) { this._cleanInputSelection() } parent.tab.apply(this, arguments) }, upArrow: function(e) { if (parent.upArrow.apply(this, arguments)) { if (!this.option("opened")) { this._setNextValue(-1) } return true } }, downArrow: function(e) { if (parent.downArrow.apply(this, arguments)) { if (!this.option("opened")) { this._setNextValue(1) } return true } }, leftArrow: function() { searchIfNeeded(); parent.leftArrow.apply(this, arguments) }, rightArrow: function() { searchIfNeeded(); parent.rightArrow.apply(this, arguments) }, home: function() { searchIfNeeded(); parent.home.apply(this, arguments) }, end: function() { searchIfNeeded(); parent.end.apply(this, arguments) }, enter: function(e) { if (this._list && null === this._list.option("focusedElement") && "" === this._input().val()) { this.option({ selectedItem: null, value: null }); this.close() } else { if (this.option("acceptCustomValue")) { e.preventDefault() } if (parent.enter.apply(this, arguments)) { return this.option("opened") } } }, backspace: clearSelectBox, del: clearSelectBox }) }, _getDefaultOptions: function() { return $.extend(this.callBase(), { placeholder: messageLocalization.format("Select"), fieldTemplate: null, valueChangeEvent: "change", acceptCustomValue: false, onCustomItemCreating: function(e) { return e.text }, showSelectionControls: false, autocompletionEnabled: true, tooltipEnabled: false, openOnFieldClick: true, showDropButton: true, displayCustomValue: false, _isAdaptablePopupPosition: false, useInkRipple: false }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function() { return /win8/.test(themes.current()) }, options: { _isAdaptablePopupPosition: true, popupPosition: { at: "left top", offset: { h: 0, v: 0 } } } }, { device: function() { return /android5/.test(themes.current()) }, options: { _isAdaptablePopupPosition: true, popupPosition: { offset: { h: -16, v: -8 } } } }, { device: function() { return /android5/.test(themes.current()) }, options: { useInkRipple: true } }]) }, _init: function() { this.callBase(); this._initCustomItemCreatingAction() }, _render: function() { this.callBase(); this.element().addClass(SELECTBOX_CLASS); this.option("useInkRipple") && this._renderInkRipple(); this._renderTooltip(); this._$container.addClass(SELECTBOX_CONTAINER_CLASS) }, _renderInkRipple: function() { this._inkRipple = inkRipple.render() }, _toggleActiveState: function($element, value, e) { this.callBase.apply(this, arguments); if (!this._inkRipple || this._isEditable()) { return } var config = { element: this._inputWrapper(), jQueryEvent: e }; if (value) { this._inkRipple.showWave(config) } else { this._inkRipple.hideWave(config) } }, _createPopup: function() { this.callBase(); this._popup.element().addClass(SELECTBOX_POPUP_CLASS) }, _popupWrapperClass: function() { return this.callBase() + " " + SELECTBOX_POPUP_WRAPPER_CLASS }, _renderOpenedState: function() { this.callBase(); if (this.option("opened")) { this._updatePopupHeight(); this._scrollToSelectedItem(); this._focusSelectedElement() } }, _focusSelectedElement: function() { var searchValue = this._searchValue(); if (!searchValue) { this._focusListElement(null); return } var $listItems = this._list._itemElements(), selectedItem = this.option("selectedItem"), index = $.inArray(selectedItem, this.option("items")), isSelectedItemDisplayed = selectedItem && searchValue === this._displayGetter(selectedItem).toString(), focusedElement = index >= 0 && isSelectedItemDisplayed ? $listItems.eq(index) : null; this._focusListElement(focusedElement) }, _renderFocusedElement: function() { var searchValue = this._searchValue(); if (!searchValue || this.option("acceptCustomValue")) { this._focusListElement(null); return } var $listItems = this._list._itemElements(), focusedElement = $listItems.eq(0); this._focusListElement(focusedElement) }, _focusListElement: function(element) { if (!this._list) { return } this._preventInputValueRender = true; this._list.option("focusedElement", element); delete this._preventInputValueRender }, _scrollToSelectedItem: function() { if (this._dataSource.paginate() && this._isEditable()) { this._list.scrollTo(0) } else { this._list.scrollToItem(this._list.option("selectedItem")) } }, _listContentReadyHandler: function() { this.callBase(); if (this._dataSource.paginate() && this._isEditable()) { return } this._list.scrollToItem(this._list.option("selectedItem")) }, _renderValue: function() { this._renderInputValue() }, _renderInputValue: function() { return this.callBase().always($.proxy(function() { this._renderTooltip(); this._renderInputValueImpl(); this._refreshSelected() }, this)) }, _renderInputValueImpl: function() { this._renderInputAddons() }, _fitIntoRange: function(value, start, end) { if (value > end) { return start } if (value < start) { return end } return value }, _setNextValue: function(step) { var dataSourceIsLoaded = this._dataSource.isLoaded() ? $.Deferred().resolve() : this._dataSource.load(); dataSourceIsLoaded.done($.proxy(function() { var item = this._calcNextItem(step), value = this._valueGetter(item); this._setValue(value) }, this)) }, _calcNextItem: function(step) { var items = this._items(); var nextIndex = this._fitIntoRange(this._getSelectedIndex() + step, 0, items.length - 1); return items[nextIndex] }, _items: function() { return this._list ? this.option("items") : this._dataSource.items() }, _getSelectedIndex: function() { var items = this._items(); var selectedItem = this.option("selectedItem"); var result = -1; $.each(items, $.proxy(function(index, item) { if (this._isValueEquals(item, selectedItem)) { result = index; return false } }, this)); return result }, _setSelectedItem: function(item) { var isUnknownItem = !this._isCustomValueAllowed() && void 0 === item; this.callBase(isUnknownItem ? null : item) }, _isCustomValueAllowed: function() { return this.option("acceptCustomValue") || this.callBase() }, _displayValue: function(item) { item = !commonUtils.isDefined(item) && this._isCustomValueAllowed() ? this.option("value") : item; return this.callBase(item) }, _listConfig: function() { var result = $.extend(this.callBase(), { pageLoadMode: "scrollBottom", onSelectionChanged: this._getSelectionChangeHandler(), onFocusedItemChanged: $.proxy(function(e) { if (this._preventInputValueRender) { return } var list = e.component, focusedElement = list.option("focusedElement"), focusedItem = list._getItemData(focusedElement); this._updateField(focusedItem) }, this) }); if (this.option("showSelectionControls")) { $.extend(result, { showSelectionControls: true }) } return result }, _updateField: function(item) { var fieldTemplate = this._getTemplateByOption("fieldTemplate"); if (!(fieldTemplate && this.option("fieldTemplate"))) { this._renderDisplayText(this._displayGetter(item)); return } this._renderTemplatedField(fieldTemplate, item) }, _getSelectionChangeHandler: function() { return this.option("showSelectionControls") ? $.proxy(this._selectionChangeHandler, this) : $.noop }, _selectionChangeHandler: function(e) { $.each(e.addedItems || [], $.proxy(function(_, addedItem) { this._setValue(this._valueGetter(addedItem)) }, this)) }, _toggleOpenState: function(isVisible) { if (this.option("disabled")) { return } isVisible = arguments.length ? isVisible : !this.option("opened"); if (this._wasSearch() && isVisible) { this._wasSearch(false); if (this.option("showDataBeforeSearch") || 0 === this.option("minSearchLength")) { this._filterDataSource(null) } else { this._setListOption("items", []); this._list && this._setListOption("noDataText", this._list.initialOption("noDataText")) } } this.callBase(isVisible) }, _renderTooltip: function() { if (this.option("tooltipEnabled")) { this.element().attr("title", this.option("displayValue")) } }, _renderDimensions: function() { this.callBase(); this._setPopupOption("width") }, _focusOutHandler: function(e) { this.callBase(e); if (!this.option("searchEnabled") || this.option("acceptCustomValue")) { return } if (!this._searchValue()) { this._clearTextValue(); return } var selectedItem = this.option("selectedItem"); this._renderInputValue().always($.proxy(function(e) { this._setSelectedItem(selectedItem); this._renderDisplayText(this._displayGetter(this.option("selectedItem"))) }, this)) }, _clearTextValue: function() { this.reset() }, _renderValueChangeEvent: function() { if (this._isEditable()) { this.callBase() } }, _isEditable: function() { return this.option("acceptCustomValue") || this.option("searchEnabled") }, _fieldRenderData: function() { return this.option("selectedItem") }, _readOnlyPropValue: function() { return !this._isEditable() || this.option("readOnly") }, _isSelectedValue: function(value) { return this._isValueEquals(value, this.option("value")) }, _listItemClickHandler: function(e) { var previousValue = this._getCurrentValue(); this._completeSelection(this._valueGetter(e.itemData)); this.option("opened", false); if (this.option("searchEnabled") && previousValue === this._valueGetter(e.itemData)) { this._renderDisplayText(this._displayGetter(e.itemData)) } }, _completeSelection: function(value) { if (this._wasSearch()) { this._clearFilter() } this._setValue(value) }, _clearValueHandler: function() { this.reset() }, _loadItem: function(value) { var that = this, deferred = $.Deferred(); this.callBase(value).done(function(item) { deferred.resolve(item) }).fail(function() { if (that.option("acceptCustomValue")) { deferred.resolve(that.option("selectedItem")) } else { deferred.reject() } }); return deferred.promise() }, _valueChangeEventHandler: function(e) { if (!this.option("acceptCustomValue")) { return } this._customItemAddedHandler() }, _initCustomItemCreatingAction: function() { this._customItemCreatingAction = this._createActionByOption("onCustomItemCreating") }, _customItemAddedHandler: function() { var searchValue = this._searchValue(), item = this._customItemCreatingAction({ text: searchValue }), isDeferred = item && item.promise && item.done && item.fail; if (void 0 === item) { this._renderValue(); throw errors.Error("E0121") } isDeferred ? item.always($.proxy(this._setCustomItem, this)) : this._setCustomItem(item) }, _setCustomItem: function(item) { item = item || null; this.option("selectedItem", item); this._setValue(this._valueGetter(item)); this._renderDisplayText(this._displayGetter(item)) }, _createClearButton: function() { var eventName = eventUtils.addNamespace(clickEvent.name, this.NAME); return this.callBase().on(eventName, function() { return false }) }, _wasSearch: function(value) { if (!arguments.length) { return this._wasSearchValue } this._wasSearchValue = value }, _searchHandler: function(e) { if (e && this._isControlKey(e.which || e.keyCode) || this._preventFiltering) { delete this._preventFiltering; return } if (this._needPassDataSourceToList()) { this._wasSearch(true) } this.callBase(e) }, _filterDataSource: function(searchValue) { this.callBase(searchValue); this._setCollectionWidgetOption("noDataText", searchValue ? "" : this._list && this._list.initialOption("noDataText")) }, _dataSourceFiltered: function(searchValue) { this.callBase(); this._renderInputSubstitution(); if (null !== searchValue) { this._renderFocusedElement() } }, _valueSubstituted: function() { var input = this._input().get(0), inputHasSelection = input.selectionStart !== input.selectionEnd; return this._wasSearch() && inputHasSelection }, _shouldSubstitutionBeRendered: function() { return this.option("autocompletionEnabled") && !this._preventSubstitution && this.option("searchEnabled") && !this.option("acceptCustomValue") && "startswith" === this.option("searchMode") }, _renderInputSubstitution: function() { if (!this._shouldSubstitutionBeRendered()) { delete this._preventSubstitution; return } var item = this._list && this._list.option("items")[0]; if (!item) { return } var $input = this._input(), valueLength = $input.val().length; if (0 === valueLength) { return } var inputElement = $input.get(0), displayValue = this._displayGetter(item); inputElement.value = displayValue; inputElement.selectionStart = valueLength; inputElement.selectionEnd = displayValue.length }, _cleanInputSelection: function() { var inputElement = this._input().get(0), endPosition = inputElement.value.length; inputElement.selectionStart = endPosition; inputElement.selectionEnd = endPosition }, _optionChanged: function(args) { switch (args.name) { case "_isAdaptablePopupPosition": case "autocompletionEnabled": break; case "onCustomItemCreating": this._initCustomItemCreatingAction(); break; case "tooltipEnabled": this._renderTooltip(); break; case "displayCustomValue": case "acceptCustomValue": case "showSelectionControls": case "useInkRipple": this._invalidate(); break; default: this.callBase(args) } } }); registerComponent("dxSelectBox", SelectBox); module.exports = SelectBox }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************************!*\ !*** ./Scripts/viz/core/base_widget.js ***! \*****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), version = __webpack_require__( /*! ../../core/version */ 123), _windowResizeCallbacks = __webpack_require__( /*! ../../core/utils/window */ 57).resizeCallbacks, _stringFormat = __webpack_require__( /*! ../../core/utils/string */ 26).format, _isObject = __webpack_require__( /*! ../../core/utils/common */ 2).isObject, _Number = Number, DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 39), helpers = __webpack_require__( /*! ./helpers */ 515), _parseScalar = __webpack_require__( /*! ./utils */ 6).parseScalar, errors = __webpack_require__( /*! ./errors_warnings */ 514), _log = errors.log, rendererModule = __webpack_require__( /*! ./renderers/renderer */ 176), _Layout = __webpack_require__( /*! ./layout */ 517), OPTION_RTL_ENABLED = "rtlEnabled", _option = DOMComponent.prototype.option; function getTrue() { return true } function getFalse() { return false } function areCanvasesDifferent(canvas1, canvas2) { return !(canvas1.width === canvas2.width && canvas1.height === canvas2.height && canvas1.left === canvas2.left && canvas1.top === canvas2.top && canvas1.right === canvas2.right && canvas1.bottom === canvas2.bottom) } function createResizeHandler(callback) { var timeout, handler = function() { clearTimeout(timeout); timeout = setTimeout(callback, 100) }; handler.dispose = function() { clearTimeout(timeout); return this }; return handler } function defaultOnIncidentOccurred(e) { _log.apply(null, [e.target.id].concat(e.target.args || [])) } var createIncidentOccurred = function(widgetName, eventTrigger) { return incidentOccurred; function incidentOccurred(id, args) { eventTrigger("incidentOccurred", { target: { id: id, type: "E" === id[0] ? "error" : "warning", args: args, text: _stringFormat.apply(null, [errors.ERROR_MESSAGES[id]].concat(args || [])), widget: widgetName, version: version } }) } }; function pickPositiveValue(value, defaultValue) { return _Number(value > 0 ? value : defaultValue || 0) } module.exports = DOMComponent.inherit({ _eventsMap: { onIncidentOccurred: { name: "incidentOccurred" }, onDrawn: { name: "drawn", config: { category: "rendering" } } }, _getDefaultOptions: function() { return $.extend(this.callBase(), { onIncidentOccurred: defaultOnIncidentOccurred }) }, _useLinks: true, _init: function() { var linkTarget, that = this; that.callBase.apply(that, arguments); that._changesLocker = 0; that._changes = helpers.changes(); that._suspendChanges(); that._themeManager = that._createThemeManager(); that._themeManager.setCallback(function() { that._requestChange(that._themeDependentChanges) }); that._initRenderer(); linkTarget = that._useLinks && that._renderer.root; linkTarget && linkTarget.enableLinks().virtualLink("core").virtualLink("peripheral"); that._renderVisibilityChange(); that._initEventTrigger(); that._incidentOccurred = createIncidentOccurred(that.NAME, that._eventTrigger); that._layout = new _Layout; linkTarget && linkTarget.linkAfter("core"); that._initPlugins(); that._initCore(); linkTarget && linkTarget.linkAfter(); that._change(that._initialChanges); that._resumeChanges() }, _initialChanges: ["LAYOUT", "RESIZE_HANDLER", "THEME"], _initPlugins: function() { var that = this; $.each(that._plugins, function(_, plugin) { plugin.init.call(that) }) }, _disposePlugins: function() { var that = this; $.each(that._plugins.slice().reverse(), function(_, plugin) { plugin.dispose.call(that) }) }, _change: function(codes) { this._changes.add(codes) }, _suspendChanges: function() { ++this._changesLocker }, _resumeChanges: function() { var that = this; if (0 === --that._changesLocker && that._changes.count() > 0) { that._renderer.lock(); that._applyingChanges = true; that._applyChanges(); that._changes.reset(); that._applyingChanges = false; that._renderer.unlock(); if (that._optionsQueue) { that._applyQueuedOptions() } } }, _applyQueuedOptions: function() { var that = this, queue = that._optionsQueue; that._optionsQueue = null; that.beginUpdate(); $.each(queue, function(_, args) { _option.apply(that, args) }); that.endUpdate() }, _requestChange: function(codes) { var applyingChanges = this._applyingChanges; if (!applyingChanges) { this._suspendChanges() } this._change(codes); if (!applyingChanges) { this._resumeChanges() } }, _applyChanges: function() { var i, that = this, changes = that._changes, order = that._totalChangesOrder, ii = order.length; for (i = 0; i < ii; ++i) { if (changes.has(order[i])) { that["_change_" + order[i]]() } } }, _optionChangesOrder: ["EVENTS", "THEME", "RENDERER", "RESIZE_HANDLER"], _layoutChangesOrder: ["CONTAINER_SIZE", "LAYOUT"], _customChangesOrder: [], _change_EVENTS: function() { this._eventTrigger.applyChanges() }, _change_THEME: function() { this._setThemeAndRtl() }, _change_RENDERER: function() { this._setRendererOptions() }, _change_RESIZE_HANDLER: function() { this._setupResizeHandler() }, _change_CONTAINER_SIZE: function() { this._updateSize() }, _change_LAYOUT: function() { this._setContentSize() }, _themeDependentChanges: ["RENDERER"], _initRenderer: function() { var that = this; that._canvas = that._calculateCanvas(); that._renderer = new rendererModule.Renderer({ cssClass: that._rootClassPrefix + " " + that._rootClass, pathModified: that.option("pathModified"), container: that._$element[0] }); that._renderer.resize(that._canvas.width, that._canvas.height) }, _disposeRenderer: function() { this._useLinks && this._renderer.root.checkLinks(); this._renderer.dispose() }, _getAnimationOptions: $.noop, render: function() { this._requestChange(["CONTAINER_SIZE"]); this._onRender() }, _onRender: $.noop, _dispose: function() { var that = this; that.callBase.apply(that, arguments); that._removeResizeHandler(); that._layout.dispose(); that._eventTrigger.dispose(); that._disposeCore(); that._disposePlugins(); that._disposeRenderer(); that._themeManager.dispose(); that._themeManager = that._renderer = that._eventTrigger = null }, _initEventTrigger: function() { var that = this; that._eventTrigger = createEventTrigger(that._eventsMap, function(name, config) { return that._createActionByOption(name, config) }) }, _calculateCanvas: function() { var that = this, size = that.option("size") || {}, margin = that.option("margin") || {}, defaultCanvas = that._getDefaultSize() || {}, canvas = { width: size.width <= 0 ? 0 : pickPositiveValue(size.width, that._$element.width() || defaultCanvas.width), height: size.height <= 0 ? 0 : pickPositiveValue(size.height, that._$element.height() || defaultCanvas.height), left: pickPositiveValue(margin.left, defaultCanvas.left || 0), top: pickPositiveValue(margin.top, defaultCanvas.top || 0), right: pickPositiveValue(margin.right, defaultCanvas.right || 0), bottom: pickPositiveValue(margin.bottom, defaultCanvas.bottom || 0) }; if (canvas.width - canvas.left - canvas.right <= 0 || canvas.height - canvas.top - canvas.bottom <= 0) { canvas = { width: 0, height: 0 } } return canvas }, _updateSize: function() { var that = this, canvas = that._calculateCanvas(); if (areCanvasesDifferent(that._canvas, canvas) || that.__forceRender) { that._canvas = canvas; that._renderer.resize(canvas.width, canvas.height); that._change(["LAYOUT"]) } }, _setContentSize: function() { var nextRect, canvas = this._canvas, layout = this._layout, rect = canvas.width > 0 && canvas.height > 0 ? [canvas.left, canvas.top, canvas.width - canvas.right, canvas.height - canvas.bottom] : [0, 0, 0, 0]; rect = layout.forward(rect); nextRect = this._applySize(rect) || rect; layout.backward(nextRect) }, DEBUG_getCanvas: function() { return this._canvas }, DEBUG_getEventTrigger: function() { return this._eventTrigger }, _getOption: function(name, isScalar) { var theme = this._themeManager.theme(name), option = this.option(name); return isScalar ? void 0 !== option ? option : theme : $.extend(true, {}, theme, option) }, _setupResizeHandler: function() { if (_parseScalar(this._getOption("redrawOnResize", true), true)) { this._addResizeHandler() } else { this._removeResizeHandler() } }, _addResizeHandler: function() { var that = this; if (!that._resizeHandler) { that._resizeHandler = createResizeHandler(function() { that._requestChange(["CONTAINER_SIZE"]) }); _windowResizeCallbacks.add(that._resizeHandler) } }, _removeResizeHandler: function() { if (this._resizeHandler) { _windowResizeCallbacks.remove(this._resizeHandler); this._resizeHandler.dispose(); this._resizeHandler = null } }, _onBeginUpdate: $.noop, beginUpdate: function() { var that = this; if (that._initialized && 0 === that._updateLockCount) { that._onBeginUpdate(); that._suspendChanges() } that.callBase.apply(that, arguments); return that }, endUpdate: function() { var that = this, initialized = that._initialized; that.callBase.apply(that, arguments); if (initialized && 0 === that._updateLockCount) { that._resumeChanges() } return that }, option: function(name) { var that = this; if (that._initialized && that._applyingChanges && (arguments.length > 1 || _isObject(name))) { that._optionsQueue = that._optionsQueue || []; that._optionsQueue.push(arguments) } else { return _option.apply(that, arguments) } }, _clean: $.noop, _render: $.noop, _optionChanged: function(arg) { var that = this; if (that._eventTrigger.change(arg.name)) { that._change(["EVENTS"]) } else { if (that._optionChangesMap[arg.name]) { that._change([that._optionChangesMap[arg.name]]) } else { that.callBase.apply(that, arguments) } } }, _optionChangesMap: { size: "CONTAINER_SIZE", margin: "CONTAINER_SIZE", redrawOnResize: "RESIZE_HANDLER", theme: "THEME", rtlEnabled: "THEME", encodeHtml: "THEME" }, _visibilityChanged: function() { this.render() }, _setThemeAndRtl: function() { this._themeManager.setTheme(this.option("theme"), this.option(OPTION_RTL_ENABLED)) }, _getRendererOptions: function() { return { rtl: this.option(OPTION_RTL_ENABLED), encodeHtml: this.option("encodeHtml"), animation: this._getAnimationOptions() } }, _setRendererOptions: function() { this._renderer.setOptions(this._getRendererOptions()) }, _normalizeHtml: function(html) { var re = /xmlns="[\s\S]*?"/gi, first = true; html = html.replace(re, function(match) { if (!first) { return "" } first = false; return match }); return html.replace(/xmlns:NS1="[\s\S]*?"/gi, "").replace(/NS1:xmlns:xlink="([\s\S]*?)"/gi, 'xmlns:xlink="$1"') }, svg: function() { return this._normalizeHtml(this._renderer.svg()) }, isReady: getFalse, _dataIsReady: getTrue, _resetIsReady: function() { this.isReady = getFalse }, _drawn: function() { var that = this; that.isReady = getFalse; if (that._dataIsReady()) { that._renderer.onEndAnimation(function() { that.isReady = getTrue }) } that._eventTrigger("drawn", {}) } }); helpers.replaceInherit(module.exports); function createEventTrigger(eventsMap, callbackGetter) { var triggers = {}; $.each(eventsMap, function(name, info) { if (info.name) { createEvent(name) } }); var changes; triggerEvent.change = function(name) { var eventInfo = eventsMap[name]; if (eventInfo) { (changes = changes || {})[name] = eventInfo } return !!eventInfo }; triggerEvent.applyChanges = function() { if (changes) { $.each(changes, function(name, eventInfo) { createEvent(eventInfo.newName || name) }); changes = null } }; triggerEvent.dispose = function() { eventsMap = callbackGetter = triggers = null }; return triggerEvent; function createEvent(name) { var eventInfo = eventsMap[name]; triggers[eventInfo.name] = callbackGetter(name, eventInfo.config) } function triggerEvent(name, arg, complete) { triggers[name](arg); complete && complete() } } module.exports.DEBUG_createEventTrigger = createEventTrigger; module.exports.DEBUG_createIncidentOccurred = createIncidentOccurred; module.exports.DEBUG_stub_createIncidentOccurred = function(stub) { createIncidentOccurred = stub }; module.exports.DEBUG_restore_createIncidentOccurred = function() { createIncidentOccurred = module.exports.DEBUG_createIncidentOccurred }; module.exports.DEBUG_createResizeHandler = createResizeHandler }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**********************************************!*\ !*** ./Scripts/animation/presets/presets.js ***! \**********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Component = __webpack_require__( /*! ../../core/component */ 92), devices = __webpack_require__( /*! ../../core/devices */ 7), fx = __webpack_require__( /*! ../fx */ 21); var directionPostfixes = { forward: " dx-forward", backward: " dx-backward", none: " dx-no-direction", undefined: " dx-no-direction" }; var optionPrefix = "preset_"; var AnimationPresetCollection = Component.inherit({ ctor: function() { this.callBase.apply(this, arguments); this._customRules = []; this._registeredPresets = []; this.resetToDefaults() }, _getDefaultOptions: function() { return $.extend(this.callBase(), { defaultAnimationDuration: 400, defaultAnimationDelay: 0, defaultStaggerAnimationDuration: 300, defaultStaggerAnimationDelay: 40, defaultStaggerAnimationStartDelay: 500 }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function(device) { return device.phone }, options: { defaultStaggerAnimationDuration: 350, defaultStaggerAnimationDelay: 50, defaultStaggerAnimationStartDelay: 0 } }, { device: function() { return devices.current().android || devices.real.android }, options: { defaultAnimationDelay: 100 } }]) }, _getPresetOptionName: function(animationName) { return optionPrefix + animationName }, _createAndroidSlideAnimationConfig: function(throughOpacity, widthMultiplier) { var that = this; var createBaseConfig = function(configModifier) { return { type: "slide", delay: void 0 === configModifier.delay ? that.option("defaultAnimationDelay") : configModifier.delay, duration: void 0 === configModifier.duration ? that.option("defaultAnimationDuration") : configModifier.duration } }; return { enter: function($element, configModifier) { var width = $element.parent().width() * widthMultiplier, direction = configModifier.direction, config = createBaseConfig(configModifier); config.to = { left: 0, opacity: 1 }; if ("forward" === direction) { config.from = { left: width, opacity: throughOpacity } } else { if ("backward" === direction) { config.from = { left: -width, opacity: throughOpacity } } else { config.from = { left: 0, opacity: 0 } } } return fx.createAnimation($element, config) }, leave: function($element, configModifier) { var width = $element.parent().width() * widthMultiplier, direction = configModifier.direction, config = createBaseConfig(configModifier); config.from = { left: 0, opacity: 1 }; if ("forward" === direction) { config.to = { left: -width, opacity: throughOpacity } } else { if ("backward" === direction) { config.to = { left: width, opacity: throughOpacity } } else { config.to = { left: 0, opacity: 0 } } } return fx.createAnimation($element, config) } } }, _createOpenDoorConfig: function() { var that = this; var createBaseConfig = function(configModifier) { return { type: "css", extraCssClasses: "dx-opendoor-animation", delay: void 0 === configModifier.delay ? that.option("defaultAnimationDelay") : configModifier.delay, duration: void 0 === configModifier.duration ? that.option("defaultAnimationDuration") : configModifier.duration } }; return { enter: function($element, configModifier) { var direction = configModifier.direction, config = createBaseConfig(configModifier); config.delay = "none" === direction ? config.delay : config.duration; config.from = "dx-enter dx-opendoor-animation" + directionPostfixes[direction]; config.to = "dx-enter-active"; return fx.createAnimation($element, config) }, leave: function($element, configModifier) { var direction = configModifier.direction, config = createBaseConfig(configModifier); config.from = "dx-leave dx-opendoor-animation" + directionPostfixes[direction]; config.to = "dx-leave-active"; return fx.createAnimation($element, config) } } }, _createWinPopConfig: function() { var that = this, baseConfig = { type: "css", extraCssClasses: "dx-win-pop-animation", duration: that.option("defaultAnimationDuration") }; return { enter: function($element, configModifier) { var config = baseConfig, direction = configModifier.direction; config.delay = "none" === direction ? that.option("defaultAnimationDelay") : that.option("defaultAnimationDuration") / 2; config.from = "dx-enter dx-win-pop-animation" + directionPostfixes[direction]; config.to = "dx-enter-active"; return fx.createAnimation($element, config) }, leave: function($element, configModifier) { var config = baseConfig, direction = configModifier.direction; config.delay = that.option("defaultAnimationDelay"); config.from = "dx-leave dx-win-pop-animation" + directionPostfixes[direction]; config.to = "dx-leave-active"; return fx.createAnimation($element, config) } } }, resetToDefaults: function() { this.clear(); this.registerDefaultPresets(); this.applyChanges() }, clear: function(name) { var that = this, newRegisteredPresets = []; $.each(this._registeredPresets, function(index, preset) { if (!name || name === preset.name) { that.option(that._getPresetOptionName(preset.name), void 0) } else { newRegisteredPresets.push(preset) } }); this._registeredPresets = newRegisteredPresets; this.applyChanges() }, registerPreset: function(name, config) { this._registeredPresets.push({ name: name, config: config }) }, applyChanges: function() { var that = this; this._customRules.length = 0; $.each(this._registeredPresets, function(index, preset) { var rule = { device: preset.config.device, options: {} }; rule.options[that._getPresetOptionName(preset.name)] = preset.config.animation; that._customRules.push(rule) }); this._setOptionsByDevice() }, getPreset: function(name) { var result = name; while ("string" === typeof result) { result = this.option(this._getPresetOptionName(result)) } return result }, registerDefaultPresets: function() { this.registerPreset("pop", { animation: { extraCssClasses: "dx-android-pop-animation", delay: this.option("defaultAnimationDelay"), duration: this.option("defaultAnimationDuration") } }); this.registerPreset("openDoor", { animation: this._createOpenDoorConfig() }); this.registerPreset("win-pop", { animation: this._createWinPopConfig() }); this.registerPreset("fade", { animation: { extraCssClasses: "dx-fade-animation", delay: this.option("defaultAnimationDelay"), duration: this.option("defaultAnimationDuration") } }); this.registerPreset("slide", { device: function() { return devices.current().android || devices.real.android }, animation: this._createAndroidSlideAnimationConfig(1, 1) }); this.registerPreset("slide", { device: function() { return !devices.current().android && !devices.real.android }, animation: { extraCssClasses: "dx-slide-animation", delay: this.option("defaultAnimationDelay"), duration: this.option("defaultAnimationDuration") } }); this.registerPreset("ios7-slide", { animation: { extraCssClasses: "dx-ios7-slide-animation", delay: this.option("defaultAnimationDelay"), duration: this.option("defaultAnimationDuration") } }); this.registerPreset("overflow", { animation: { extraCssClasses: "dx-overflow-animation", delay: this.option("defaultAnimationDelay"), duration: this.option("defaultAnimationDuration") } }); this.registerPreset("ios7-toolbar", { device: function() { return !devices.current().android && !devices.real.android }, animation: { extraCssClasses: "dx-ios7-toolbar-animation", delay: this.option("defaultAnimationDelay"), duration: this.option("defaultAnimationDuration") } }); this.registerPreset("ios7-toolbar", { device: function() { return devices.current().android || devices.real.android }, animation: this._createAndroidSlideAnimationConfig(0, .4) }); this.registerPreset("stagger-fade", { animation: { extraCssClasses: "dx-fade-animation", staggerDelay: this.option("defaultStaggerAnimationDelay"), duration: this.option("defaultStaggerAnimationDuration"), delay: this.option("defaultStaggerAnimationStartDelay") } }); this.registerPreset("stagger-slide", { animation: { extraCssClasses: "dx-slide-animation", staggerDelay: this.option("defaultStaggerAnimationDelay"), duration: this.option("defaultStaggerAnimationDuration"), delay: this.option("defaultStaggerAnimationStartDelay") } }); this.registerPreset("stagger-fade-slide", { animation: { extraCssClasses: "dx-fade-slide-animation", staggerDelay: this.option("defaultStaggerAnimationDelay"), duration: this.option("defaultStaggerAnimationDuration"), delay: this.option("defaultStaggerAnimationStartDelay") } }); this.registerPreset("stagger-drop", { animation: { extraCssClasses: "dx-drop-animation", staggerDelay: this.option("defaultStaggerAnimationDelay"), duration: this.option("defaultStaggerAnimationDuration"), delay: this.option("defaultStaggerAnimationStartDelay") } }); this.registerPreset("stagger-fade-drop", { animation: { extraCssClasses: "dx-fade-drop-animation", staggerDelay: this.option("defaultStaggerAnimationDelay"), duration: this.option("defaultStaggerAnimationDuration"), delay: this.option("defaultStaggerAnimationStartDelay") } }); this.registerPreset("stagger-fade-rise", { animation: { extraCssClasses: "dx-fade-rise-animation", staggerDelay: this.option("defaultStaggerAnimationDelay"), duration: this.option("defaultStaggerAnimationDuration"), delay: this.option("defaultStaggerAnimationStartDelay") } }); this.registerPreset("stagger-3d-drop", { animation: { extraCssClasses: "dx-3d-drop-animation", staggerDelay: this.option("defaultStaggerAnimationDelay"), duration: this.option("defaultStaggerAnimationDuration"), delay: this.option("defaultStaggerAnimationStartDelay") } }); this.registerPreset("stagger-fade-zoom", { animation: { extraCssClasses: "dx-fade-zoom-animation", staggerDelay: this.option("defaultStaggerAnimationDelay"), duration: this.option("defaultStaggerAnimationDuration"), delay: this.option("defaultStaggerAnimationStartDelay") } }) } }); exports.PresetCollection = AnimationPresetCollection; var animationPresets = new AnimationPresetCollection; exports.presets = animationPresets }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************************!*\ !*** ./Scripts/client_exporter/excel_creator.js ***! \**************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../core/class */ 5), commonUtils = __webpack_require__( /*! ../core/utils/common */ 2), stringUtils = __webpack_require__( /*! ../core/utils/string */ 26), JSZip = __webpack_require__( /*! jszip */ 351), numberFormatter = __webpack_require__( /*! ../localization/number */ 38), fileSaver = __webpack_require__( /*! ./file_saver */ 197), XML_TAG = '', GROUP_SHEET_PR_XML = '', SINGLE_SHEET_PR_XML = "", BASE_STYLE_XML = '', OPEN_XML_FORMAT_URL = "http://schemas.openxmlformats.org", RELATIONSHIP_PART_NAME = "rels", XL_FOLDER_NAME = "xl", WORKBOOK_FILE_NAME = "workbook.xml", CONTENTTYPES_FILE_NAME = "[Content_Types].xml", SHAREDSTRING_FILE_NAME = "sharedStrings.xml", STYLE_FILE_NAME = "styles.xml", WORKSHEETS_FOLDER = "worksheets", WORKSHEET_FILE_NAME = "sheet1.xml", DEFINED_DATE_FORMATS = { longDate: "d MMMM yyyy", longTime: "H:mm:ss", monthAndDay: "MMMM dd", monthAndYear: "MMMM yyyy", quarterAndYear: "dd.MM.yyyy", shortDate: "dd.MM.yyyy", shortTime: "H:mm", millisecond: "H:mm:ss", day: "dd", month: "MMMM", quarter: "dd.MM.yyyy", year: "yyyy" }, DEFAULT_DATE_FORMAT = "shortTime", DEFINED_NUMBER_FORMTATS = { thousands: "#,##0{0},"K"", millions: "#,##0{0},,"M"", billions: "#,##0{0},,,"B"", trillions: "#,##0{0},,,,"T"", percent: "0{0}%", decimal: "#{0}", fixedPoint: "#,##0{0}", exponential: "0{0}E+00", currency: " " }, VALID_TYPES = { "boolean": "b", date: "d", number: "n", string: "s" }, EXCEL_START_TIME = Date.UTC(1899, 11, 30), DAYS_COUNT_BEFORE_29_FEB_1900 = 60, BOLD_STYLES_COUNT = 4, MAX_DIGIT_WIDTH_IN_PIXELS = 7, CUSTOM_FORMAT_START_INDEX = 165; __webpack_require__( /*! ../localization/currency */ 117); exports.excelFormatConverter = { _applyPrecision: function(format, precision) { var result, i; if (precision > 0) { result = "decimal" !== format ? "." : ""; for (i = 0; i < precision; i++) { result += "0" } return result } return "" }, _getCurrencyFormat: function(currency) { return numberFormatter.getOpenXmlCurrencyFormat(currency) }, _convertDateFormat: function(format) { return DEFINED_DATE_FORMATS[format] || DEFINED_DATE_FORMATS[DEFAULT_DATE_FORMAT] }, _convertNumberFormat: function(format, precision) { var result, excelFormat = "currency" === format ? this._getCurrencyFormat() : DEFINED_NUMBER_FORMTATS[format]; if (excelFormat) { result = stringUtils.format(excelFormat, this._applyPrecision(format, precision)) } return result }, convertFormat: function(format, precision, type) { if (commonUtils.isDefined(format)) { if ("date" === type) { return exports.excelFormatConverter._convertDateFormat(format) } else { if (DEFINED_NUMBER_FORMTATS[format]) { return exports.excelFormatConverter._convertNumberFormat(format, precision) } } } } }; exports.ExcelCreator = Class.inherit({ _getXMLTag: function(tagName, attributes, content) { var i, attr, result = "<" + tagName, length = attributes.length; for (i = 0; i < length; i++) { attr = attributes[i]; result = result + " " + attr.name + '="' + attr.value + '"' } return commonUtils.isDefined(content) ? result + ">" + content + "" : result + " />" }, _getDataProviderRowIndex: function(dpRowIndex) { var correctRowIndex = this._dataProvider.getHeaderRowCount ? this._dataProvider.getHeaderRowCount() : 0; return dpRowIndex - correctRowIndex }, _getExcelRowIndex: function(exRowIndex) { var correctRowIndex = this._dataProvider.getHeaderRowCount ? this._dataProvider.getHeaderRowCount() : 0; return exRowIndex + correctRowIndex }, _getCellIndex: function(rowIndex, cellIndex) { var charCode, sheetIndex = "", max = 26; if (this._maxIndex[0] < Number(rowIndex)) { this._maxIndex[0] = Number(rowIndex) } if (this._maxIndex[1] < Number(cellIndex)) { this._maxIndex[1] = Number(cellIndex) } while (true) { charCode = 65 + (cellIndex >= max ? cellIndex % max : Math.ceil(cellIndex)); sheetIndex = String.fromCharCode(charCode) + sheetIndex; if (cellIndex >= max) { cellIndex = Math.floor(cellIndex / max) - 1 } else { break } } return sheetIndex + rowIndex }, _getDataType: function(dataType) { return VALID_TYPES[dataType] || "s" }, _appendFormat: function(format, precision, dataType) { format = exports.excelFormatConverter.convertFormat(format, precision, dataType); if (format) { if (-1 === $.inArray(format, this._styleFormat)) { this._styleFormat.push(format) } return $.inArray(format, this._styleFormat) + 1 } }, _appendString: function(value) { if (commonUtils.isDefined(value)) { value = String(value); if (value.length) { value = stringUtils.encodeHtml(value); if (void 0 === this._stringHash[value]) { this._stringHash[value] = this._stringArray.length; this._stringArray.push(value) } return this._stringHash[value] } } }, _getExcelDateValue: function(date) { var days, totalTime; if (commonUtils.isDate(date)) { days = Math.floor((Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - EXCEL_START_TIME) / 864e5); if (days < DAYS_COUNT_BEFORE_29_FEB_1900) { days-- } totalTime = (3600 * date.getHours() + 60 * date.getMinutes() + date.getSeconds()) / 86400; return days + totalTime } }, _prepareValue: function(rowIndex, cellIndex) { var dataProvider = this._dataProvider, value = dataProvider.getCellValue(rowIndex, cellIndex), type = this._getDataType(dataProvider.getCellType(rowIndex, cellIndex)), formatID = this._styleArray[cellIndex + BOLD_STYLES_COUNT].formatID, format = commonUtils.isNumber(formatID) ? this._styleFormat[formatID - 1] : null; if ("d" === type && !commonUtils.isDate(value)) { type = "s" } switch (type) { case "s": value = this._appendString(value); break; case "d": value = this._getExcelDateValue(value, format); type = "n" } return { value: value, type: type } }, _getHeadersArray: function() { var i, j, column, columns = this._dataProvider.getColumns(true), result = []; for (i = 0; i < columns.length - 1; i++) { result.push([]); for (j = 0; j < columns[i].length; j++) { column = columns[i][j]; result[i].push({ style: 0, type: "s", value: this._appendString(column.caption) }) } } return result }, _getDataArray: function() { var rowIndex, cellIndex, cellsArray, cellData, cellsLength, type, styleID, result = [], rowsLength = this._dataProvider.getRowsCount(), columns = this._dataProvider.getColumns(); for (rowIndex = 0; rowIndex < rowsLength; rowIndex++) { cellsArray = []; cellsLength = columns.length; for (cellIndex = 0; cellIndex !== cellsLength; cellIndex++) { cellData = this._prepareValue(rowIndex, cellIndex); type = cellData.type; if (!this._dataProvider.isGroupRow(rowIndex) && commonUtils.isDefined(this._styleArray[cellIndex + BOLD_STYLES_COUNT].formatID) && "s" !== cellData.type) { type = "n" } styleID = cellIndex + BOLD_STYLES_COUNT; if (this._dataProvider.isGroupRow(rowIndex)) { styleID = BOLD_STYLES_COUNT - 1 } if (this._dataProvider.isTotalCell(rowIndex, cellIndex)) { styleID = this._getBoldStyleID(columns[cellIndex].alignment) } cellsArray.push({ style: styleID, value: cellData.value, type: type }) } if (rowIndex && !this._needSheetPr && this._dataProvider.getGroupLevel(this._getDataProviderRowIndex(rowIndex)) > 0) { this._needSheetPr = true } result.push(cellsArray) } return result }, _getBoldStyleID: function(alignment) { for (var i = 0; i < BOLD_STYLES_COUNT - 1; i++) { if (this._styleArray[i].alignment === alignment) { return i } } }, _calculateWidth: function(pixelsWidth) { pixelsWidth = parseInt(pixelsWidth, 10); if (!pixelsWidth || pixelsWidth < 5) { pixelsWidth = 100 } return Math.min(255, Math.floor((pixelsWidth - 5) / MAX_DIGIT_WIDTH_IN_PIXELS * 100 + .5) / 100) }, _prepareStyleData: function() { var i, column, wrapText = Number(!!this._options.wrapTextEnabled), alignments = ["center", "left", "right"], columns = this._dataProvider.getColumns(); for (i = 0; i < alignments.length; i++) { this._styleArray.push({ bold: true, alignment: alignments[i], wrapText: 1 }) } this._styleArray.push({ bold: true, alignment: commonUtils.getDefaultAlignment(this._rtlEnabled), wrapText: 0 }); for (i = 0; i < columns.length; i++) { column = columns[i]; this._styleArray.push({ alignment: commonUtils.isDefined(column.alignment) ? column.alignment : "left", formatID: this._appendFormat(column.format, column.precision, column.dataType), wrapText: wrapText }); this._colsArray.push(this._calculateWidth(column.width)) } }, _prepareCellData: function() { if (this._dataProvider.isHeadersVisible()) { this._cellsArray = this._cellsArray.concat(this._getHeadersArray()) } this._cellsArray = this._cellsArray.concat(this._getDataArray()) }, _createXMLRelationships: function(xmlRelationships) { return this._getXMLTag("Relationships", [{ name: "xmlns", value: OPEN_XML_FORMAT_URL + "/package/2006/relationships" }], xmlRelationships) }, _createXMLRelationship: function(id, type, target) { return this._getXMLTag("Relationship", [{ name: "Id", value: "rId" + id }, { name: "Type", value: OPEN_XML_FORMAT_URL + "/officeDocument/2006/relationships/" + type }, { name: "Target", value: target }]) }, _getWorkbookContent: function() { var content = 'Sheet!$1:$1'; return XML_TAG + this._getXMLTag("workbook", [{ name: "xmlns:r", value: OPEN_XML_FORMAT_URL + "/officeDocument/2006/relationships" }, { name: "xmlns", value: OPEN_XML_FORMAT_URL + "/spreadsheetml/2006/main" }], content) }, _getContentTypesContent: function() { return XML_TAG + '' }, _generateStylesXML: function() { var styleIndex, style, formatIndex, xlFolder = this._zip.folder(XL_FOLDER_NAME), stylesLength = this._styleArray.length, xmlStyles = [], XML = ""; for (formatIndex = 0; formatIndex < this._styleFormat.length; formatIndex++) { this._styleFormat[formatIndex] = this._getXMLTag("numFmt", [{ name: "numFmtId", value: Number(formatIndex) + CUSTOM_FORMAT_START_INDEX }, { name: "formatCode", value: this._styleFormat[formatIndex] }]) } XML = XML + this._getXMLTag("numFmts", [{ name: "count", value: this._styleFormat.length }], this._styleFormat.join("")) + BASE_STYLE_XML; for (styleIndex = 0; styleIndex < stylesLength; styleIndex++) { style = this._styleArray[styleIndex]; xmlStyles.push(this._getXMLTag("xf", [{ name: "xfId", value: 0 }, { name: "applyAlignment", value: 1 }, { name: "fontId", value: Number(!!style.bold) }, { name: "applyNumberFormat", value: commonUtils.isDefined(style.formatID) ? 1 : 0 }, { name: "numFmtId", value: commonUtils.isDefined(style.formatID) ? Number(style.formatID) + CUSTOM_FORMAT_START_INDEX - 1 : 0 }], this._getXMLTag("alignment", [{ name: "horizontal", value: style.alignment }, { name: "vertical", value: "top" }, { name: "wrapText", value: style.wrapText }]))) } XML += this._getXMLTag("cellXfs", [{ name: "count", value: xmlStyles.length }], xmlStyles.join("")); XML += this._getXMLTag("cellStyles", [{ name: "count", value: 1 }], this._getXMLTag("cellStyle", [{ name: "name", value: "Normal" }, { name: "xfId", value: 0 }, { name: "builtinId", value: 0 }])); XML = XML_TAG + this._getXMLTag("styleSheet", [{ name: "xmlns", value: OPEN_XML_FORMAT_URL + "/spreadsheetml/2006/main" }], XML); xlFolder.file(STYLE_FILE_NAME, XML); this._styleArray = [] }, _generateStringsXML: function() { var stringIndex, xlFolder = this._zip.folder(XL_FOLDER_NAME), stringsLength = this._stringArray.length, sharedStringXml = XML_TAG; for (stringIndex = 0; stringIndex < stringsLength; stringIndex++) { this._stringArray[stringIndex] = this._getXMLTag("si", [], this._getXMLTag("t", [], this._stringArray[stringIndex])) } sharedStringXml += this._getXMLTag("sst", [{ name: "xmlns", value: OPEN_XML_FORMAT_URL + "/spreadsheetml/2006/main" }, { name: "count", value: this._stringArray.length }, { name: "uniqueCount", value: this._stringArray.length }], this._stringArray.join("")); xlFolder.file(SHAREDSTRING_FILE_NAME, sharedStringXml); this._stringArray = [] }, _getPaneXML: function() { var attributes = [{ name: "activePane", value: "bottomLeft" }, { name: "state", value: "frozen" }], frozenArea = this._dataProvider.getFrozenArea(); if (!(frozenArea.x || frozenArea.y)) { return "" } if (frozenArea.x) { attributes.push({ name: "xSplit", value: frozenArea.x }) } if (frozenArea.y) { attributes.push({ name: "ySplit", value: frozenArea.y }) } attributes.push({ name: "topLeftCell", value: this._getCellIndex(frozenArea.y + 1, frozenArea.x) }); return this._getXMLTag("pane", attributes) }, _generateWorksheetXML: function() { var colIndex, rowIndex, cellData, xmlCells, maxCellIndex, cellsLength, counter = 0, xmlRows = [], rowsLength = this._cellsArray.length, colsLength = this._colsArray.length, rSpans = "1:" + colsLength, headerRowCount = this._dataProvider.getHeaderRowCount ? this._dataProvider.getHeaderRowCount() : 1, xmlResult = [ ['', this._needSheetPr ? GROUP_SHEET_PR_XML : SINGLE_SHEET_PR_XML, '' + this._getPaneXML() + ''].join("") ]; for (colIndex = 0; colIndex < colsLength; colIndex++) { this._colsArray[colIndex] = this._getXMLTag("col", [{ name: "width", value: this._colsArray[colIndex] }, { name: "min", value: Number(colIndex) + 1 }, { name: "max", value: Number(colIndex) + 1 }]) } xmlResult.push(this._getXMLTag("cols", [], this._colsArray.join("")) + ""); for (rowIndex = 0; rowIndex < rowsLength; rowIndex++) { xmlCells = []; cellsLength = this._cellsArray[rowIndex].length; for (colIndex = 0; colIndex < cellsLength; colIndex++) { rowIndex = Number(rowIndex); cellData = this._cellsArray[rowIndex][colIndex]; xmlCells.push(this._getXMLTag("c", [{ name: "r", value: this._getCellIndex(rowIndex + 1, colIndex) }, { name: "s", value: cellData.style }, { name: "t", value: cellData.type }], commonUtils.isDefined(cellData.value) ? this._getXMLTag("v", [], cellData.value) : null)) } xmlRows.push(this._getXMLTag("row", [{ name: "r", value: Number(rowIndex) + 1 }, { name: "spans", value: rSpans }, { name: "outlineLevel", value: rowIndex >= headerRowCount ? this._dataProvider.getGroupLevel(this._getDataProviderRowIndex(rowIndex)) : 0 }, { name: "x14ac:dyDescent", value: "0.25" }], xmlCells.join(""))); this._cellsArray[rowIndex] = null; if (counter++ > 1e4) { xmlResult.push(xmlRows.join("")); xmlRows = []; counter = 0 } } xmlResult.push(xmlRows.join("")); xmlRows = []; maxCellIndex = this._getCellIndex(this._maxIndex[0], this._maxIndex[1]); xmlResult.push("" + this._generateMergingXML() + (this._options.autoFilterEnabled ? '' : "") + ''); this._zip.folder(XL_FOLDER_NAME).folder(WORKSHEETS_FOLDER).file(WORKSHEET_FILE_NAME, xmlResult.join("")); this._colsArray = []; this._cellsArray = []; xmlResult = [] }, _generateMergingXML: function() { var k, l, cellIndex, rowIndex, mergeArrayLength, mergeIndex, rowsLength = commonUtils.isDefined(this._dataProvider.getHeaderRowCount) ? this._dataProvider.getHeaderRowCount() : this._dataProvider.getRowsCount(), columnsLength = this._dataProvider.getColumns().length, usedArea = [], mergeArray = [], mergeXML = ""; for (rowIndex = 0; rowIndex < rowsLength; rowIndex++) { for (cellIndex = 0; cellIndex !== columnsLength; cellIndex++) { if (!commonUtils.isDefined(usedArea[rowIndex]) || !commonUtils.isDefined(usedArea[rowIndex][cellIndex])) { var cellMerge = this._dataProvider.getCellMerging(rowIndex, cellIndex); if (cellMerge.colspan || cellMerge.rowspan) { mergeArray.push({ start: this._getCellIndex(rowIndex + 1, cellIndex), end: this._getCellIndex(rowIndex + 1 + (cellMerge.rowspan || 0), cellIndex + (cellMerge.colspan || 0)) }); for (k = rowIndex; k <= rowIndex + cellMerge.rowspan || 0; k++) { for (l = cellIndex; l <= cellIndex + cellMerge.colspan || 0; l++) { if (!commonUtils.isDefined(usedArea[k])) { usedArea[k] = [] } usedArea[k][l] = true } } } } } } mergeArrayLength = mergeArray.length; for (mergeIndex = 0; mergeIndex < mergeArrayLength; mergeIndex++) { mergeXML += this._getXMLTag("mergeCell", [{ name: "ref", value: mergeArray[mergeIndex].start + ":" + mergeArray[mergeIndex].end }]) } return mergeXML.length ? this._getXMLTag("mergeCells", [{ name: "count", value: mergeArrayLength }], mergeXML) : "" }, _generateCommonXML: function() { var xmlRelationships, relsFileContent = XML_TAG + this._createXMLRelationships(this._createXMLRelationship(1, "officeDocument", "xl/" + WORKBOOK_FILE_NAME)), xlFolder = this._zip.folder(XL_FOLDER_NAME), relsXML = XML_TAG; this._zip.folder("_" + RELATIONSHIP_PART_NAME).file("." + RELATIONSHIP_PART_NAME, relsFileContent); xmlRelationships = this._createXMLRelationship(1, "worksheet", "worksheets/" + WORKSHEET_FILE_NAME) + this._createXMLRelationship(2, "styles", STYLE_FILE_NAME) + this._createXMLRelationship(3, "sharedStrings", SHAREDSTRING_FILE_NAME); relsXML += this._createXMLRelationships(xmlRelationships); xlFolder.folder("_" + RELATIONSHIP_PART_NAME).file(WORKBOOK_FILE_NAME + ".rels", relsXML); xlFolder.file(WORKBOOK_FILE_NAME, this._getWorkbookContent()); this._zip.file(CONTENTTYPES_FILE_NAME, this._getContentTypesContent()) }, _generateContent: function() { this._prepareStyleData(); this._prepareCellData(); this._generateWorkXML(); this._generateCommonXML() }, _generateWorkXML: function() { this._generateStylesXML(); this._generateStringsXML(); this._generateWorksheetXML() }, ctor: function(dataProvider, options) { this._rtlEnabled = options && !!options.rtlEnabled; this._options = options; this._maxIndex = [1, 2]; this._stringArray = []; this._stringHash = {}; this._styleArray = []; this._colsArray = []; this._cellsArray = []; this._styleFormat = []; this._needSheetPr = false; this._dataProvider = dataProvider; this._zip = new JSZip }, ready: function() { return this._dataProvider.ready() }, getData: function(isBlob) { var options = { type: isBlob ? "blob" : "base64", compression: "DEFLATE", mimeType: fileSaver.MIME_TYPES.EXCEL }; this._generateContent(); return this._zip.generateAsync ? this._zip.generateAsync(options) : this._zip.generate(options) } }); exports.getBlob = function(data, options, callback) { var excelCreator = new exports.ExcelCreator(data, options); excelCreator.ready().done(function() { if (excelCreator._zip.generateAsync) { excelCreator.getData(commonUtils.isFunction(window.Blob)).then(callback) } else { callback(excelCreator.getData(commonUtils.isFunction(window.Blob))) } }) }; exports.__internals = { CONTENTTYPES_FILE_NAME: CONTENTTYPES_FILE_NAME, RELATIONSHIP_PART_NAME: RELATIONSHIP_PART_NAME, XL_FOLDER_NAME: XL_FOLDER_NAME, WORKBOOK_FILE_NAME: WORKBOOK_FILE_NAME, STYLE_FILE_NAME: STYLE_FILE_NAME, WORKSHEET_FILE_NAME: WORKSHEET_FILE_NAME, WORKSHEETS_FOLDER: WORKSHEETS_FOLDER, SHAREDSTRING_FILE_NAME: SHAREDSTRING_FILE_NAME, GROUP_SHEET_PR_XML: GROUP_SHEET_PR_XML, SINGLE_SHEET_PR_XML: SINGLE_SHEET_PR_XML } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*********************************************!*\ !*** ./Scripts/data/odata/query_adapter.js ***! \*********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), queryAdapters = __webpack_require__( /*! ../query_adapters */ 144), odataUtils = __webpack_require__( /*! ./utils */ 71), serializePropName = odataUtils.serializePropName, errors = __webpack_require__( /*! ../errors */ 25).errors, dataUtils = __webpack_require__( /*! ../utils */ 28); var DEFAULT_PROTOCOL_VERSION = 2; var compileCriteria = function() { var createBinaryOperationFormatter = function(op) { return function(prop, val) { return prop + " " + op + " " + val } }; var createStringFuncFormatter = function(op, reverse) { return function(prop, val) { var bag = [op, "("]; if (reverse) { bag.push(val, ",", prop) } else { bag.push(prop, ",", val) } bag.push(")"); return bag.join("") } }; var formatters = { "=": createBinaryOperationFormatter("eq"), "<>": createBinaryOperationFormatter("ne"), ">": createBinaryOperationFormatter("gt"), ">=": createBinaryOperationFormatter("ge"), "<": createBinaryOperationFormatter("lt"), "<=": createBinaryOperationFormatter("le"), startswith: createStringFuncFormatter("startswith"), endswith: createStringFuncFormatter("endswith") }; var formattersV2 = $.extend({}, formatters, { contains: createStringFuncFormatter("substringof", true), notcontains: createStringFuncFormatter("not substringof", true) }); var formattersV4 = $.extend({}, formatters, { contains: createStringFuncFormatter("contains"), notcontains: createStringFuncFormatter("not contains") }); var compileBinary = function(criteria, protocolVersion) { criteria = dataUtils.normalizeBinaryCriterion(criteria); var op = criteria[1], formatters = 4 === protocolVersion ? formattersV4 : formattersV2, formatter = formatters[op.toLowerCase()]; if (!formatter) { throw errors.Error("E4003", op) } return formatter(serializePropName(criteria[0]), odataUtils.serializeValue(criteria[2], protocolVersion)) }; var compileGroup = function(criteria, protocolVersion) { var groupOperator, nextGroupOperator, bag = []; $.each(criteria, function(index, criterion) { if ($.isArray(criterion)) { if (bag.length > 1 && groupOperator !== nextGroupOperator) { throw new errors.Error("E4019") } bag.push("(" + compileCore(criterion, protocolVersion) + ")"); groupOperator = nextGroupOperator; nextGroupOperator = "and" } else { nextGroupOperator = dataUtils.isConjunctiveOperator(this) ? "and" : "or" } }); return bag.join(" " + groupOperator + " ") }; var compileCore = function(criteria, protocolVersion) { if ($.isArray(criteria[0])) { return compileGroup(criteria, protocolVersion) } return compileBinary(criteria, protocolVersion) }; return function(criteria, protocolVersion) { return compileCore(criteria, protocolVersion) } }(); var createODataQueryAdapter = function(queryOptions) { var _select, _skip, _take, _countQuery, _sorting = [], _criteria = [], _expand = queryOptions.expand, _oDataVersion = queryOptions.version || DEFAULT_PROTOCOL_VERSION; var hasSlice = function() { return _skip || void 0 !== _take }; var hasFunction = function(criterion) { for (var i = 0; i < criterion.length; i++) { if ($.isFunction(criterion[i])) { return true } if ($.isArray(criterion[i]) && hasFunction(criterion[i])) { return true } } return false }; var generateSelectExpand = function() { var hasDot = function(x) { return /\./.test(x) }; var generateSelect = function() { if (!_select) { return } if (_oDataVersion < 4) { return serializePropName(_select.join()) } return $.grep(_select, hasDot, true).join() }; var generateExpand = function() { var generatorV2 = function() { var hash = {}; if (_expand) { $.each($.makeArray(_expand), function() { hash[serializePropName(this)] = 1 }) } if (_select) { $.each($.makeArray(_select), function() { var path = this.split("."); if (path.length < 2) { return } path.pop(); hash[serializePropName(path.join("."))] = 1 }) } return $.map(hash, function(k, v) { return v }).join() }; var generatorV4 = function() { var format = function(hash) { var formatCore = function(hash) { var ret = "", select = [], expand = []; $.each(hash, function(key, value) { if ($.isArray(value)) { [].push.apply(select, value) } if ($.isPlainObject(value)) { expand.push(key + formatCore(value)) } }); if (select.length || expand.length) { ret += "("; if (select.length) { ret += "$select=" + $.map(select, serializePropName).join() } if (expand.length) { if (select.length) { ret += ";" } ret += "$expand=" + $.map(expand, serializePropName).join() } ret += ")" } return ret }; var ret = []; $.each(hash, function(key, value) { ret.push(key + formatCore(value)) }); return ret.join() }; var parseTree = function(exprs, root, stepper) { var parseCore = function(exprParts, root, stepper) { var result = stepper(root, exprParts.shift(), exprParts); if (false === result) { return } parseCore(exprParts, result, stepper) }; $.each(exprs, function(_, x) { parseCore(x.split("."), root, stepper) }) }; var hash = {}; if (_expand || _select) { if (_expand) { parseTree($.makeArray(_expand), hash, function(node, key, path) { node[key] = node[key] || {}; if (!path.length) { return false } return node[key] }) } if (_select) { parseTree($.grep($.makeArray(_select), hasDot), hash, function(node, key, path) { if (!path.length) { node[key] = node[key] || []; node[key].push(key); return false } return node[key] = node[key] || {} }) } return format(hash) } }; if (_oDataVersion < 4) { return generatorV2() } return generatorV4() }; var tuple = { $select: generateSelect() || void 0, $expand: generateExpand() || void 0 }; return tuple }; var requestData = function() { var result = {}; if (!_countQuery) { if (_sorting.length) { result.$orderby = _sorting.join(",") } if (_skip) { result.$skip = _skip } if (void 0 !== _take) { result.$top = _take } var tuple = generateSelectExpand(); result.$select = tuple.$select; result.$expand = tuple.$expand } if (_criteria.length) { result.$filter = compileCriteria(_criteria.length < 2 ? _criteria[0] : _criteria, _oDataVersion) } if (_countQuery) { result.$top = 0 } if (queryOptions.requireTotalCount || _countQuery) { if (4 !== _oDataVersion) { result.$inlinecount = "allpages" } else { result.$count = "true" } } return result }; return { exec: function(url) { return odataUtils.sendRequest(_oDataVersion, { url: url, params: $.extend(requestData(), queryOptions && queryOptions.params) }, { beforeSend: queryOptions.beforeSend, jsonp: queryOptions.jsonp, withCredentials: queryOptions.withCredentials, countOnly: _countQuery }, queryOptions.deserializeDates) }, multiSort: function(args) { var rules; if (hasSlice()) { return false } for (var i = 0; i < args.length; i++) { var rule, getter = args[i][0], desc = !!args[i][1]; if ("string" !== typeof getter) { return false } rule = serializePropName(getter); if (desc) { rule += " desc" } rules = rules || []; rules.push(rule) } _sorting = rules }, slice: function(skipCount, takeCount) { if (hasSlice()) { return false } _skip = skipCount; _take = takeCount }, filter: function(criterion) { if (hasSlice()) { return false } if (!$.isArray(criterion)) { criterion = $.makeArray(arguments) } if (hasFunction(criterion)) { return false } if (_criteria.length) { _criteria.push("and") } _criteria.push(criterion) }, select: function(expr) { if (_select || $.isFunction(expr)) { return false } if (!$.isArray(expr)) { expr = $.makeArray(arguments) } _select = expr }, count: function() { _countQuery = true } } }; queryAdapters.odata = createODataQueryAdapter; exports.odata = createODataQueryAdapter }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************************!*\ !*** ./Scripts/events/pointer/base.js ***! \****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), browser = __webpack_require__( /*! ../../core/utils/browser */ 22), Class = __webpack_require__( /*! ../../core/class */ 5), eventUtils = __webpack_require__( /*! ../utils */ 4); var POINTER_EVENTS_NAMESPACE = "dxPointerEvents"; var BaseStrategy = Class.inherit({ ctor: function(eventName, originalEvents) { this._eventName = eventName; this._originalEvents = eventUtils.addNamespace(originalEvents, POINTER_EVENTS_NAMESPACE); this._handlerCount = 0; this.noBubble = this._isNoBubble() }, _isNoBubble: function() { var eventName = this._eventName; return "dxpointerenter" === eventName || "dxpointerleave" === eventName }, _handler: function(e) { var delegateTarget = this._getDelegateTarget(e); return this._fireEvent({ type: this._eventName, pointerType: e.pointerType || eventUtils.eventSource(e), originalEvent: e, delegateTarget: delegateTarget, timeStamp: browser.mozilla ? (new Date).getTime() : e.timeStamp }) }, _getDelegateTarget: function(e) { var delegateTarget; if (this.noBubble) { delegateTarget = e.delegateTarget } return delegateTarget }, _fireEvent: function(args) { return eventUtils.fireEvent(args) }, setup: function() { return true }, add: function(element, handleObj) { if (this._handlerCount <= 0 || this.noBubble) { this._selector = handleObj.selector; element = this.noBubble ? element : document; var that = this; $(element).on(this._originalEvents, this._selector, function(e) { that._handler(e) }) } if (!this.noBubble) { this._handlerCount++ } }, remove: function(element) { if (!this.noBubble) { this._handlerCount-- } }, teardown: function(element) { if (this._handlerCount && !this.noBubble) { return } element = this.noBubble ? element : document; if (this._originalEvents !== "." + POINTER_EVENTS_NAMESPACE) { $(element).off(this._originalEvents, this._selector) } }, dispose: function(element) { element = this.noBubble ? element : document; $(element).off(this._originalEvents) } }); module.exports = BaseStrategy }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*******************************************!*\ !*** ./Scripts/framework/html/presets.js ***! \*******************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { exports.layoutSets = {}; exports.animationSets = { "native": { "view-content-change": [{ animation: "slide" }, { animation: "ios7-slide", device: { platform: "ios" } }, { animation: "none", device: { deviceType: "desktop", platform: "generic" } }, { animation: "none", device: { grade: "C" } }], "view-header-toolbar": [{ animation: "ios7-toolbar" }, { animation: "slide", device: { grade: "B" } }, { animation: "none", device: { grade: "C" } }] }, "default": { "layout-change": [{ animation: "none" }, { animation: "ios7-slide", device: { platform: "ios" } }, { animation: "pop", device: { platform: "android" } }, { animation: "openDoor", device: { deviceType: "phone", platform: "win", version: [8] } }, { animation: "win-pop", device: { deviceType: "phone", platform: "win" } }], "view-content-change": [{ animation: "slide" }, { animation: "ios7-slide", device: { platform: "ios" } }, { animation: "fade", device: { deviceType: "desktop", platform: "generic" } }, { animation: "none", device: { grade: "C" } }], "view-content-rendered": [{ animation: "fade" }, { animation: "none", device: { grade: "C" } }], "view-header-toolbar": [{ animation: "ios7-toolbar" }, { animation: "slide", device: { grade: "B" } }, { animation: "none", device: { grade: "C" } }], "command-rendered-top": [{ animation: "stagger-fade-drop" }, { animation: "fade", device: { grade: "B" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }, { animation: "none", device: { platform: "win", version: [10] } }], "command-rendered-bottom": [{ animation: "stagger-fade-rise" }, { animation: "fade", device: { grade: "B" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }, { animation: "none", device: { platform: "win", version: [10] } }], "list-item-rendered": [{ animation: "stagger-3d-drop", device: { grade: "A" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }], "detail-item-rendered": [{ animation: "stagger-3d-drop", device: { grade: "A" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }], "edit-item-rendered": [{ animation: "stagger-3d-drop", device: { grade: "A" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }] }, slide: { "view-content-change": [{ animation: "slide" }, { animation: "ios7-slide", device: { platform: "ios" } }, { animation: "fade", device: { deviceType: "desktop", platform: "generic" } }, { animation: "none", device: { grade: "C" } }], "view-content-rendered": [{ animation: "fade" }, { animation: "none", device: { grade: "C" } }], "view-header-toolbar": [{ animation: "ios7-toolbar" }, { animation: "slide", device: { grade: "B" } }, { animation: "none", device: { grade: "C" } }], "command-rendered-top": [{ animation: "stagger-fade-drop" }, { animation: "fade", device: { grade: "B" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }], "command-rendered-bottom": [{ animation: "stagger-fade-rise" }, { animation: "fade", device: { grade: "B" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }], "list-item-rendered": [{ animation: "stagger-fade-slide", device: { grade: "A" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }], "detail-item-rendered": [{ animation: "stagger-fade-slide", device: { grade: "A" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }], "edit-item-rendered": [{ animation: "stagger-fade-slide", device: { grade: "A" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }] }, zoom: { "view-content-change": [{ animation: "slide" }, { animation: "ios7-slide", device: { platform: "ios" } }, { animation: "fade", device: { deviceType: "desktop", platform: "generic" } }, { animation: "none", device: { grade: "C" } }], "view-content-rendered": [{ animation: "fade" }, { animation: "none", device: { grade: "C" } }], "view-header-toolbar": [{ animation: "ios7-toolbar" }, { animation: "slide", device: { grade: "B" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }], "command-rendered-top": [{ animation: "stagger-fade-zoom" }, { animation: "fade", device: { grade: "B" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }], "command-rendered-bottom": [{ animation: "stagger-fade-zoom" }, { animation: "fade", device: { grade: "B" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }], "list-item-rendered": [{ animation: "stagger-fade-zoom", device: { grade: "A" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }], "detail-item-rendered": [{ animation: "stagger-fade-zoom", device: { grade: "A" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }], "edit-item-rendered": [{ animation: "stagger-fade-zoom", device: { grade: "A" } }, { animation: "fade", device: { deviceType: "desktop" } }, { animation: "none", device: { grade: "C" } }] } } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************************!*\ !*** ./Scripts/framework/navigation_devices.js ***! \*************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../core/class */ 5), browserAdapters = __webpack_require__( /*! ./browser_adapters */ 211), SessionStorage = __webpack_require__( /*! ../core/utils/storage */ 122).sessionStorage, devices = __webpack_require__( /*! ../core/devices */ 7); var SESSION_KEY = "dxPhoneJSApplication"; var HistoryBasedNavigationDevice = Class.inherit({ ctor: function(options) { options = options || {}; this._browserAdapter = options.browserAdapter || this._createBrowserAdapter(options); this.uriChanged = $.Callbacks(); this._browserAdapter.popState.add($.proxy(this._onPopState, this)) }, init: $.noop, getUri: function() { return this._browserAdapter.getHash() }, setUri: function(uri, replaceCurrent) { if (replaceCurrent) { return this._browserAdapter.replaceState(uri) } else { if (uri !== this.getUri()) { return this._browserAdapter.pushState(uri) } else { return $.Deferred().resolve().promise() } } }, back: function() { return this._browserAdapter.back() }, _onPopState: function() { this.uriChanged.fire(this.getUri()) }, _isBuggyAndroid2: function() { var realDevice = devices.real(); var version = realDevice.version; return "android" === realDevice.platform && version.length > 1 && (2 === version[0] && version[1] < 4 || version[0] < 2) }, _isBuggyAndroid4: function() { var realDevice = devices.real(); var version = realDevice.version; return "android" === realDevice.platform && version.length > 1 && 4 === version[0] && 0 === version[1] }, _isWindowsPhone8: function() { var realDevice = devices.real(); return "win" === realDevice.platform && realDevice.phone }, _createBrowserAdapter: function(options) { var result, sourceWindow = options.window || window, supportPushReplace = sourceWindow.history.replaceState && sourceWindow.history.pushState; if (this._isWindowsPhone8()) { result = new browserAdapters.BuggyCordovaWP81BrowserAdapter(options) } else { if (sourceWindow !== sourceWindow.top) { result = new browserAdapters.HistorylessBrowserAdapter(options) } else { if (this._isBuggyAndroid4()) { result = new browserAdapters.BuggyAndroidBrowserAdapter(options) } else { if (this._isBuggyAndroid2() || !supportPushReplace) { result = new browserAdapters.OldBrowserAdapter(options) } else { result = new browserAdapters.DefaultBrowserAdapter(options) } } } } return result } }); var StackBasedNavigationDevice = HistoryBasedNavigationDevice.inherit({ ctor: function(options) { this.callBase(options); this.backInitiated = $.Callbacks(); this._rootStateHandler = null; $(window).on("unload", this._saveBrowserState) }, init: function() { var that = this; if (that._browserAdapter.canWorkInPureBrowser) { return that._initRootPage().done(function() { if (that._browserAdapter.isRootPage()) { that._browserAdapter.pushState("") } }) } else { return $.Deferred().resolve().promise() } }, setUri: function(uri) { return this.callBase(uri, !this._browserAdapter.isRootPage()) }, _saveBrowserState: function() { var sessionStorage = SessionStorage(); if (sessionStorage) { sessionStorage.setItem(SESSION_KEY, true) } }, _initRootPage: function() { var hash = this.getUri(), sessionStorage = SessionStorage(); if (!sessionStorage || sessionStorage.getItem(SESSION_KEY)) { return $.Deferred().resolve().promise() } sessionStorage.removeItem(SESSION_KEY); this._browserAdapter.createRootPage(); return this._browserAdapter.pushState(hash) }, _onPopState: function() { if (this._browserAdapter.isRootPage()) { if (this._rootStateHandler) { this._rootStateHandler() } else { this.backInitiated.fire() } } else { if (!this._rootStateHandler) { this._createRootStateHandler() } this.back() } }, _createRootStateHandler: function() { var uri = this.getUri(); this._rootStateHandler = function() { this.uriChanged.fire(uri); this._rootStateHandler = null } } }); exports.HistoryBasedNavigationDevice = HistoryBasedNavigationDevice; exports.StackBasedNavigationDevice = StackBasedNavigationDevice }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************!*\ !*** ./Scripts/framework/router.js ***! \*************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../core/class */ 5); var JSON_URI_PREFIX = encodeURIComponent("json:"); var Route = Class.inherit({ _trimSeparators: function(str) { return str.replace(/^[\/.]+|\/+$/g, "") }, _escapeRe: function(str) { return str.replace(/\W/g, "\\$1") }, _checkConstraint: function(param, constraint) { param = String(param); if ("string" === typeof constraint) { constraint = new RegExp(constraint) } var match = constraint.exec(param); if (!match || match[0] !== param) { return false } return true }, _ensureReady: function() { var that = this; if (this._patternRe) { return false } this._pattern = this._trimSeparators(this._pattern); this._patternRe = ""; this._params = []; this._segments = []; this._separators = []; this._pattern.replace(/[^\/]+/g, function(segment, index) { that._segments.push(segment); if (index) { that._separators.push(that._pattern.substr(index - 1, 1)) } }); $.each(this._segments, function(index) { var isStatic = true, segment = this, separator = index ? that._separators[index - 1] : ""; if (":" === segment.charAt(0)) { isStatic = false; segment = segment.substr(1); that._params.push(segment); that._patternRe += "(?:" + separator + "([^/]*))"; if (segment in that._defaults) { that._patternRe += "?" } } else { that._patternRe += separator + that._escapeRe(segment) } }); this._patternRe = new RegExp("^" + this._patternRe + "$") }, ctor: function(pattern, defaults, constraints) { this._pattern = pattern || ""; this._defaults = defaults || {}; this._constraints = constraints || {} }, parse: function(uri) { var that = this; this._ensureReady(); var matches = this._patternRe.exec(uri); if (!matches) { return false } var result = $.extend({}, this._defaults); $.each(this._params, function(i) { var index = i + 1; if (matches.length >= index && matches[index]) { result[this] = that.parseSegment(matches[index]) } }); $.each(this._constraints, function(key) { if (!that._checkConstraint(result[key], that._constraints[key])) { result = false; return false } }); return result }, format: function(routeValues) { var that = this, query = ""; this._ensureReady(); var mergeValues = $.extend({}, this._defaults), useStatic = 0, ret = [], dels = [], unusedRouteValues = {}; $.each(routeValues, function(paramName, paramValue) { routeValues[paramName] = that.formatSegment(paramValue); if (!(paramName in mergeValues)) { unusedRouteValues[paramName] = true } }); $.each(this._segments, function(index, segment) { ret[index] = index ? that._separators[index - 1] : ""; if (":" === segment.charAt(0)) { var paramName = segment.substr(1); if (!(paramName in routeValues) && !(paramName in that._defaults)) { ret = null; return false } if (paramName in that._constraints && !that._checkConstraint(routeValues[paramName], that._constraints[paramName])) { ret = null; return false } if (paramName in routeValues) { if (void 0 !== routeValues[paramName]) { mergeValues[paramName] = routeValues[paramName]; ret[index] += routeValues[paramName]; useStatic = index } delete unusedRouteValues[paramName] } else { if (paramName in mergeValues) { ret[index] += mergeValues[paramName]; dels.push(index) } } } else { ret[index] += segment; useStatic = index } }); $.each(mergeValues, function(key, value) { if (!!value && -1 === $.inArray(":" + key, that._segments) && routeValues[key] !== value) { ret = null; return false } }); var unusedCount = 0; if (!$.isEmptyObject(unusedRouteValues)) { query = "?"; $.each(unusedRouteValues, function(key) { query += key + "=" + routeValues[key] + "&"; unusedCount++ }); query = query.substr(0, query.length - 1) } if (null === ret) { return false } if (dels.length) { $.map(dels, function(i) { if (i >= useStatic) { ret[i] = "" } }) } var path = ret.join(""); path = path.replace(/\/+$/, ""); return { uri: path + query, unusedCount: unusedCount } }, formatSegment: function(value) { if ($.isArray(value) || $.isPlainObject(value)) { return JSON_URI_PREFIX + encodeURIComponent(JSON.stringify(value)) } return encodeURIComponent(value) }, parseSegment: function(value) { if (value.substr(0, JSON_URI_PREFIX.length) === JSON_URI_PREFIX) { try { return $.parseJSON(decodeURIComponent(value.substr(JSON_URI_PREFIX.length))) } catch (x) {} } return decodeURIComponent(value) } }); var Router = Class.inherit({ ctor: function() { this._registry = [] }, _trimSeparators: function(str) { return str.replace(/^[\/.]+|\/+$/g, "") }, _createRoute: function(pattern, defaults, constraints) { return new Route(pattern, defaults, constraints) }, register: function(pattern, defaults, constraints) { this._registry.push(this._createRoute(pattern, defaults, constraints)) }, _parseQuery: function(query) { var result = {}, values = query.split("&"); $.each(values, function(index, value) { var keyValuePair = value.split("="); result[keyValuePair[0]] = decodeURIComponent(keyValuePair[1]) }); return result }, parse: function(uri) { var ret, that = this; uri = this._trimSeparators(uri); var parts = uri.split("?", 2), path = parts[0], query = parts[1]; $.each(this._registry, function() { var result = this.parse(path); if (false !== result) { ret = result; if (query) { ret = $.extend(ret, that._parseQuery(query)) } return false } }); return ret ? ret : false }, format: function(obj) { var ret = false, minUnusedCount = 99999; obj = obj || {}; $.each(this._registry, function() { var toFormat = $.extend(true, {}, obj); var result = this.format(toFormat); if (false !== result) { if (minUnusedCount > result.unusedCount) { minUnusedCount = result.unusedCount; ret = result.uri } } }); return ret } }); Route.__internals = { JSON_URI_PREFIX: JSON_URI_PREFIX }; module.exports = Router; module.exports.Route = Route }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!******************************************!*\ !*** ./Scripts/localization/currency.js ***! \******************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), numberLocalization = __webpack_require__( /*! ./number */ 38); numberLocalization.inject({ _formatNumberCore: function(value, format, formatConfig) { if ("currency" === format) { formatConfig.precision = formatConfig.precision || 0; return this.getCurrencySymbol().symbol + this.format(value, $.extend({}, formatConfig, { type: "fixedpoint" })) } return this.callBase.apply(this, arguments) }, getCurrencySymbol: function(currency) { return { symbol: "$" } }, getOpenXmlCurrencyFormat: function(currency) { return "$#,##0{0}_);\\($#,##0{0}\\)" } }) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************************!*\ !*** ./Scripts/ui/collection/ui.data_helper.js ***! \*************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), DataSource = __webpack_require__( /*! ../../data/data_source/data_source */ 37).DataSource, normalizeDataSourceOptions = __webpack_require__( /*! ../../data/data_source/data_source */ 37).normalizeDataSourceOptions; var DATA_SOURCE_OPTIONS_METHOD = "_dataSourceOptions", DATA_SOURCE_CHANGED_METHOD = "_dataSourceChangedHandler", DATA_SOURCE_LOAD_ERROR_METHOD = "_dataSourceLoadErrorHandler", DATA_SOURCE_LOADING_CHANGED_METHOD = "_dataSourceLoadingChangedHandler"; var DataHelperMixin = { postCtor: function() { this.on("disposing", function() { this._disposeDataSource() }) }, _refreshDataSource: function() { this._initDataSource(); this._loadDataSource() }, _initDataSource: function() { var widgetDataSourceOptions, dataSourceType, dataSourceOptions = this.option("dataSource"); this._disposeDataSource(); if (dataSourceOptions) { if (dataSourceOptions instanceof DataSource) { this._isSharedDataSource = true; this._dataSource = dataSourceOptions } else { widgetDataSourceOptions = DATA_SOURCE_OPTIONS_METHOD in this ? this[DATA_SOURCE_OPTIONS_METHOD]() : {}; dataSourceType = this._dataSourceType ? this._dataSourceType() : DataSource; this._dataSource = new dataSourceType($.extend(true, {}, widgetDataSourceOptions, normalizeDataSourceOptions(dataSourceOptions))) } this._addDataSourceHandlers() } }, _addDataSourceHandlers: function() { if (DATA_SOURCE_CHANGED_METHOD in this) { this._addDataSourceChangeHandler() } if (DATA_SOURCE_LOAD_ERROR_METHOD in this) { this._addDataSourceLoadErrorHandler() } if (DATA_SOURCE_LOADING_CHANGED_METHOD in this) { this._addDataSourceLoadingChangedHandler() } this._addReadyWatcher() }, _addReadyWatcher: function() { this._dataSource.on("loadingChanged", $.proxy(function(isLoading) { this._ready && this._ready(!isLoading) }, this)) }, _addDataSourceChangeHandler: function() { var dataSource = this._dataSource; this._proxiedDataSourceChangedHandler = $.proxy(function() { this[DATA_SOURCE_CHANGED_METHOD](dataSource.items()) }, this); dataSource.on("changed", this._proxiedDataSourceChangedHandler) }, _addDataSourceLoadErrorHandler: function() { this._proxiedDataSourceLoadErrorHandler = $.proxy(this[DATA_SOURCE_LOAD_ERROR_METHOD], this); this._dataSource.on("loadError", this._proxiedDataSourceLoadErrorHandler) }, _addDataSourceLoadingChangedHandler: function() { this._proxiedDataSourceLoadingChangedHandler = $.proxy(this[DATA_SOURCE_LOADING_CHANGED_METHOD], this); this._dataSource.on("loadingChanged", this._proxiedDataSourceLoadingChangedHandler) }, _loadDataSource: function() { if (this._dataSource) { var dataSource = this._dataSource; if (dataSource.isLoaded()) { this._proxiedDataSourceChangedHandler && this._proxiedDataSourceChangedHandler() } else { dataSource.load() } } }, _loadSingle: function(key, value) { key = "this" === key ? this._dataSource.key() || "this" : key; return this._dataSource.loadSingle(key, value) }, _isLastPage: function() { return !this._dataSource || this._dataSource.isLastPage() || !this._dataSource._pageSize }, _isDataSourceLoading: function() { return this._dataSource && this._dataSource.isLoading() }, _disposeDataSource: function() { if (this._dataSource) { if (this._isSharedDataSource) { delete this._isSharedDataSource; this._proxiedDataSourceChangedHandler && this._dataSource.off("changed", this._proxiedDataSourceChangedHandler); this._proxiedDataSourceLoadErrorHandler && this._dataSource.off("loadError", this._proxiedDataSourceLoadErrorHandler); this._proxiedDataSourceLoadingChangedHandler && this._dataSource.off("loadingChanged", this._proxiedDataSourceLoadingChangedHandler) } else { this._dataSource.dispose() } delete this._dataSource; delete this._proxiedDataSourceChangedHandler; delete this._proxiedDataSourceLoadErrorHandler; delete this._proxiedDataSourceLoadingChangedHandler } } }; module.exports = DataHelperMixin }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**********************************************!*\ !*** ./Scripts/ui/date_box/ui.date_utils.js ***! \**********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), dateLocalization = __webpack_require__( /*! ../../localization/date */ 14); var dateComponents = function() { return ["year", "day", "month", "day"] }; var ONE_MINUTE = 6e4; var ONE_DAY = 60 * ONE_MINUTE * 24; var ONE_YEAR = 365 * ONE_DAY; var getStringFormat = function(format) { var formatType = typeof format; if ("string" === formatType) { return "format" } if ("object" === formatType && void 0 !== format.type) { return format.type } return null }; var dateUtils = { SUPPORTED_FORMATS: ["date", "time", "datetime"], DEFAULT_FORMATTER: function(value) { return value }, DATE_COMPONENT_TEXT_FORMATTER: function(value, name) { var $container = $("
").addClass("dx-dateview-formatter-container"); $("").text(value).addClass("dx-dateview-value-formatter").appendTo($container); $("").text(name).addClass("dx-dateview-name-formatter").appendTo($container); return $container }, ONE_MINUTE: ONE_MINUTE, ONE_DAY: ONE_DAY, ONE_YEAR: ONE_YEAR, MIN_DATEVIEW_DEFAULT_DATE: new Date(1900, 0, 1), MAX_DATEVIEW_DEFAULT_DATE: function() { var newDate = new Date; return new Date(newDate.getFullYear() + 50, newDate.getMonth(), newDate.getDate(), 23, 59, 59) }(), FORMATS_INFO: { date: { getStandardPattern: function() { return "yyyy-MM-dd" }, components: dateComponents() }, time: { getStandardPattern: function() { return "HH':'mm" }, components: ["hours", "minutes"] }, datetime: { getStandardPattern: function() { var standardPattern; ! function() { var androidFormatPattern = "yyyy-MM-ddTHH':'mm'Z'"; var $input = $("").attr("type", "datetime"); $input.val(dateUtils.toStandardDateFormat(new Date, "datetime", androidFormatPattern)); if ($input.val()) { standardPattern = androidFormatPattern } }(); if (!standardPattern) { standardPattern = "yyyy-MM-ddTHH':'mm':'ss'Z'" } dateUtils.FORMATS_INFO.datetime.getStandardPattern = function() { return standardPattern }; return standardPattern }, components: dateComponents().concat(["hours", "minutes", "seconds", "milliseconds"]) }, "datetime-local": { getStandardPattern: function() { return "yyyy-MM-ddTHH':'mm':'ss" }, components: dateComponents().concat(["hours", "minutes", "seconds"]) } }, FORMATS_MAP: { date: "shortdate", time: "shorttime", datetime: "shortdateshorttime", "datetime-local": "datetime-local" }, toStandardDateFormat: function(date, mode, pattern) { pattern = pattern || dateUtils.FORMATS_INFO[mode].getStandardPattern(); return dateLocalization.format(date, pattern) }, fromStandardDateFormat: function(date) { return dateLocalization.parse(date, dateUtils.FORMATS_INFO.datetime.getStandardPattern()) || dateLocalization.parse(date, dateUtils.FORMATS_INFO["datetime-local"].getStandardPattern()) || dateLocalization.parse(date, dateUtils.FORMATS_INFO.time.getStandardPattern()) || dateLocalization.parse(date, dateUtils.FORMATS_INFO.date.getStandardPattern()) || Date.parse && Date.parse(date) && new Date(Date.parse(date)) }, getMaxMonthDay: function(year, month) { return new Date(year, month + 1, 0).getDate() }, mergeDates: function(target, source, format) { if (!source) { return } if (isNaN(target.getTime())) { target = new Date(0, 0, 0, 0, 0, 0) } var formatInfo = dateUtils.FORMATS_INFO[format]; $.each(formatInfo.components, function() { var componentInfo = dateUtils.DATE_COMPONENTS_INFO[this]; target[componentInfo.setter](source[componentInfo.getter]()) }); return target }, getLongestCaptionIndex: function(captionArray) { var i, longestIndex = 0, longestCaptionLength = 0; for (i = 0; i < captionArray.length; ++i) { if (captionArray[i].length > longestCaptionLength) { longestIndex = i; longestCaptionLength = captionArray[i].length } } return longestIndex }, expandPattern: function(pattern) { return dateLocalization.getPatternByFormat(pattern) || pattern }, formatUsesMonthName: function(format) { return -1 !== dateUtils.expandPattern(format).indexOf("MMMM") }, formatUsesDayName: function(format) { return -1 !== dateUtils.expandPattern(format).indexOf("EEEE") }, getLongestDate: function(format, monthNames, dayNames) { var stringFormat = getStringFormat(format), month = 9; if (!stringFormat || dateUtils.formatUsesMonthName(stringFormat)) { month = dateUtils.getLongestCaptionIndex(monthNames) } var longestDate = new Date(1888, month, 21, 23, 59, 59, 999); if (!stringFormat || dateUtils.formatUsesDayName(stringFormat)) { var date = longestDate.getDate() - longestDate.getDay() + dateUtils.getLongestCaptionIndex(dayNames); longestDate.setDate(date) } return longestDate } }; dateUtils.DATE_COMPONENTS_INFO = { year: { getter: "getFullYear", setter: "setFullYear", possibleFormats: ["y", "yy", "yyyy"], formatter: dateUtils.DEFAULT_FORMATTER, startValue: void 0, endValue: void 0 }, day: { getter: "getDate", setter: "setDate", possibleFormats: ["d", "dd"], formatter: function(value, showNames, date) { if (!showNames) { return value } var formatDate = new Date(date.getTime()); formatDate.setDate(value); return dateUtils.DATE_COMPONENT_TEXT_FORMATTER(value, dateLocalization.getDayNames()[formatDate.getDay()]) }, startValue: 1, endValue: void 0 }, month: { getter: "getMonth", setter: "setMonth", possibleFormats: ["M", "MM", "MMM", "MMMM"], formatter: function(value, showNames) { var monthName = dateLocalization.getMonthNames()[value]; return showNames ? dateUtils.DATE_COMPONENT_TEXT_FORMATTER(value + 1, monthName) : monthName }, startValue: 0, endValue: 11 }, hours: { getter: "getHours", setter: "setHours", possibleFormats: ["H", "HH", "h", "hh"], formatter: function(value) { return dateLocalization.format(new Date(0, 0, 0, value), "hour") }, startValue: 0, endValue: 23 }, minutes: { getter: "getMinutes", setter: "setMinutes", possibleFormats: ["m", "mm"], formatter: function(value) { return dateLocalization.format(new Date(0, 0, 0, 0, value), "minute") }, startValue: 0, endValue: 59 }, seconds: { getter: "getSeconds", setter: "setSeconds", possibleFormats: ["s", "ss"], formatter: function(value) { return dateLocalization.format(new Date(0, 0, 0, 0, 0, value), "second") }, startValue: 0, endValue: 59 }, milliseconds: { getter: "getMilliseconds", setter: "setMilliseconds", possibleFormats: ["S", "SS", "SSS"], formatter: function(value) { return dateLocalization.format(new Date(0, 0, 0, 0, 0, 0, value), "millisecond") }, startValue: 0, endValue: 999 } }; module.exports = dateUtils }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************************!*\ !*** ./Scripts/events/gesture/emitter.gesture.js ***! \***************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), devices = __webpack_require__( /*! ../../core/devices */ 7), support = __webpack_require__( /*! ../../core/utils/support */ 18), browser = __webpack_require__( /*! ../../core/utils/browser */ 22), domUtils = __webpack_require__( /*! ../../core/utils/dom */ 11), mathUtils = __webpack_require__( /*! ../../core/utils/math */ 66), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), eventUtils = __webpack_require__( /*! ../utils */ 4), Emitter = __webpack_require__( /*! ../core/emitter */ 81), sign = mathUtils.sign, abs = Math.abs; var SLEEP = 0, INITED = 1, STARTED = 2, TOUCH_BOUNDARY = 10, IMMEDIATE_TOUCH_BOUNDARY = 0, IMMEDIATE_TIMEOUT = 180; var isMousewheelEvent = function(e) { return e && "dxmousewheel" === e.type }; var supportPointerEvents = function() { var cssSupport = support.styleProp("pointer-events"); var msieLess11 = browser.msie && parseInt(browser.version, 10) < 11; return cssSupport && !msieLess11 }; var gestureCover = function() { var GESTURE_COVER_CLASS = "dx-gesture-cover"; var isDesktop = "generic" === devices.real().platform; if (!supportPointerEvents() || !isDesktop) { return $.noop } var $cover = $("
").addClass(GESTURE_COVER_CLASS).css("pointerEvents", "none"); $cover.on("dxmousewheel", function(e) { e.preventDefault() }); $(function() { $cover.appendTo("body") }); return function(toggle, cursor) { $cover.css("pointerEvents", toggle ? "all" : "none"); toggle && $cover.css("cursor", cursor) } }(); var GestureEmitter = Emitter.inherit({ gesture: true, configurate: function(data) { this.getElement().css("msTouchAction", data.immediate ? "pinch-zoom" : ""); this.callBase(data) }, allowInterruptionByMousewheel: function() { return this._stage !== STARTED }, getDirection: function() { return this.direction }, _cancel: function(e) { this.callBase.apply(this, arguments); this._toggleGestureCover(false); this._stage = SLEEP }, start: function(e) { if (eventUtils.needSkipEvent(e)) { this._cancel(e); return } this._startEvent = eventUtils.createEvent(e); this._startEventData = eventUtils.eventData(e); this._prevEventData = this._startEventData; this._stage = INITED; this._init(e); this._setupImmediateTimer() }, _setupImmediateTimer: function() { clearTimeout(this._immediateTimer); this._immediateAccepted = false; if (!this.immediate) { return } this._immediateTimer = setTimeout($.proxy(function() { this._immediateAccepted = true }, this), IMMEDIATE_TIMEOUT) }, move: function(e) { if (this._stage === INITED && this._directionConfirmed(e)) { this._stage = STARTED; this._resetActiveElement(); this._toggleGestureCover(true, e); this._clearSelection(e); this._adjustStartEvent(e); this._start(this._startEvent); this._prevEventData = eventUtils.eventData(this._startEvent); if (this._stage === SLEEP) { return } this._requestAccept(e); this._move(e); this._forgetAccept() } else { if (this._stage === STARTED) { this._clearSelection(e); this._move(e) } } this._prevEventData = eventUtils.eventData(e) }, _directionConfirmed: function(e) { var touchBoundary = this._getTouchBoundary(e), delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e)), deltaX = abs(delta.x), deltaY = abs(delta.y); var horizontalMove = this._validateMove(touchBoundary, deltaX, deltaY), verticalMove = this._validateMove(touchBoundary, deltaY, deltaX); var direction = this.getDirection(e), bothAccepted = "both" === direction && (horizontalMove || verticalMove), horizontalAccepted = "horizontal" === direction && horizontalMove, verticalAccepted = "vertical" === direction && verticalMove; return bothAccepted || horizontalAccepted || verticalAccepted || this._immediateAccepted }, _validateMove: function(touchBoundary, mainAxis, crossAxis) { return mainAxis && mainAxis >= touchBoundary && (this.immediate ? mainAxis >= crossAxis : true) }, _getTouchBoundary: function(e) { return this.immediate || isMousewheelEvent(e) ? IMMEDIATE_TOUCH_BOUNDARY : TOUCH_BOUNDARY }, _adjustStartEvent: function(e) { var touchBoundary = this._getTouchBoundary(e), delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e)); this._startEvent.pageX += sign(delta.x) * touchBoundary; this._startEvent.pageY += sign(delta.y) * touchBoundary }, _resetActiveElement: function() { if ("ios" === devices.real().platform && $(":focus", this.getElement()).length) { domUtils.resetActiveElement() } }, _toggleGestureCover: function(toggle, e) { var isStarted = this._stage === STARTED; if (isStarted) { gestureCover(toggle, this.getElement().css("cursor")) } }, _clearSelection: function(e) { if (isMousewheelEvent(e) || eventUtils.isTouchEvent(e)) { return } domUtils.clearSelection() }, end: function(e) { this._toggleGestureCover(false, e); if (this._stage === STARTED) { this._end(e) } else { if (this._stage === INITED) { this._stop(e) } } this._stage = SLEEP }, dispose: function() { clearTimeout(this._immediateTimer); this.callBase.apply(this, arguments); this._toggleGestureCover(false) }, _init: $.noop, _start: $.noop, _move: $.noop, _stop: $.noop, _end: $.noop }); GestureEmitter.initialTouchBoundary = TOUCH_BOUNDARY; GestureEmitter.touchBoundary = function(newBoundary) { if (commonUtils.isDefined(newBoundary)) { TOUCH_BOUNDARY = newBoundary; return } return TOUCH_BOUNDARY }; module.exports = GestureEmitter }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!********************************!*\ !*** ./Scripts/viz/palette.js ***! \********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), vizUtils = __webpack_require__( /*! ./core/utils */ 6), _floor = Math.floor, _ceil = Math.ceil, _Color = __webpack_require__( /*! ../color */ 55), commonUtils = __webpack_require__( /*! ../core/utils/common */ 2), _isArray = commonUtils.isArray, _isString = commonUtils.isString, _extend = $.extend, _normalizeEnum = vizUtils.normalizeEnum, HIGHLIGHTING_STEP = 50, DEFAULT = "default", currentPaletteName = DEFAULT; var palettes = { "default": { simpleSet: ["#5f8b95", "#ba4d51", "#af8a53", "#955f71", "#859666", "#7e688c"], indicatingSet: ["#a3b97c", "#e1b676", "#ec7f83"], gradientSet: ["#5f8b95", "#ba4d51"] }, "harmony light": { simpleSet: ["#fcb65e", "#679ec5", "#ad79ce", "#7abd5c", "#e18e92", "#b6d623", "#b7abea", "#85dbd5"], indicatingSet: ["#b6d623", "#fcb65e", "#e18e92"], gradientSet: ["#7abd5c", "#fcb65e"] }, "soft pastel": { simpleSet: ["#60a69f", "#78b6d9", "#6682bb", "#a37182", "#eeba69", "#90ba58", "#456c68", "#7565a4"], indicatingSet: ["#90ba58", "#eeba69", "#a37182"], gradientSet: ["#78b6d9", "#eeba69"] }, pastel: { simpleSet: ["#bb7862", "#70b3a1", "#bb626a", "#057d85", "#ab394b", "#dac599", "#153459", "#b1d2c6"], indicatingSet: ["#70b3a1", "#dac599", "#bb626a"], gradientSet: ["#bb7862", "#70b3a1"] }, bright: { simpleSet: ["#70c92f", "#f8ca00", "#bd1550", "#e97f02", "#9d419c", "#7e4452", "#9ab57e", "#36a3a6"], indicatingSet: ["#70c92f", "#f8ca00", "#bd1550"], gradientSet: ["#e97f02", "#f8ca00"] }, soft: { simpleSet: ["#cbc87b", "#9ab57e", "#e55253", "#7e4452", "#e8c267", "#565077", "#6babac", "#ad6082"], indicatingSet: ["#9ab57e", "#e8c267", "#e55253"], gradientSet: ["#9ab57e", "#e8c267"] }, ocean: { simpleSet: ["#75c099", "#acc371", "#378a8a", "#5fa26a", "#064970", "#38c5d2", "#00a7c6", "#6f84bb"], indicatingSet: ["#c8e394", "#7bc59d", "#397c8b"], gradientSet: ["#acc371", "#38c5d2"] }, vintage: { simpleSet: ["#dea484", "#efc59c", "#cb715e", "#eb9692", "#a85c4c", "#f2c0b5", "#c96374", "#dd956c"], indicatingSet: ["#ffe5c6", "#f4bb9d", "#e57660"], gradientSet: ["#efc59c", "#cb715e"] }, violet: { simpleSet: ["#d1a1d1", "#eeacc5", "#7b5685", "#7e7cad", "#a13d73", "#5b41ab", "#e287e2", "#689cc1"], indicatingSet: ["#d8e2f6", "#d0b2da", "#d56a8a"], gradientSet: ["#eeacc5", "#7b5685"] } }; function currentPalette(name) { if (void 0 === name) { return currentPaletteName } else { name = _normalizeEnum(name); currentPaletteName = name in palettes ? name : DEFAULT } } function getPalette(palette, parameters) { var result, type = parameters && parameters.type; if (_isArray(palette)) { return palette.slice(0) } else { if (_isString(palette)) { result = palettes[_normalizeEnum(palette)] } if (!result) { result = palettes[currentPaletteName] } } result = result || null; return type ? result ? result[type].slice(0) : result : result } function registerPalette(name, palette) { var paletteName, item = {}; if (_isArray(palette)) { item.simpleSet = palette.slice(0) } else { if (palette) { item.simpleSet = _isArray(palette.simpleSet) ? palette.simpleSet.slice(0) : void 0; item.indicatingSet = _isArray(palette.indicatingSet) ? palette.indicatingSet.slice(0) : void 0; item.gradientSet = _isArray(palette.gradientSet) ? palette.gradientSet.slice(0) : void 0 } } if (item.simpleSet || item.indicatingSet || item.gradientSet) { paletteName = _normalizeEnum(name); _extend(palettes[paletteName] = palettes[paletteName] || {}, item) } } function RingBuf(buf) { var ind = 0; this.next = function() { var res = buf[ind++]; if (ind === buf.length) { this.reset() } return res }; this.reset = function() { ind = 0 } } function Palette(palette, parameters) { parameters = parameters || {}; var stepHighlight = parameters.useHighlight ? HIGHLIGHTING_STEP : 0; this._originalPalette = getPalette(palette, { type: parameters.type || "simpleSet" }); this._paletteSteps = new RingBuf([0, stepHighlight, -stepHighlight]); this._resetPalette() } Palette.prototype = { constructor: Palette, dispose: function() { this._originalPalette = this._palette = this._paletteSteps = null }, getNextColor: function() { var that = this; if (that._currentColor >= that._palette.length) { that._resetPalette() } return that._palette[that._currentColor++] }, _resetPalette: function() { var that = this, step = that._paletteSteps.next(); that._palette = step ? getAlteredPalette(that._originalPalette, step) : that._originalPalette.slice(0); that._currentColor = 0 }, reset: function() { this._paletteSteps.reset(); this._resetPalette(); return this } }; function getAlteredPalette(originalPalette, step) { var i, palette = [], ii = originalPalette.length; for (i = 0; i < ii; ++i) { palette.push(getNewColor(originalPalette[i], step)) } return palette } function getNewColor(currentColor, step) { var newColor = new _Color(currentColor).alter(step), lightness = getLightness(newColor); if (lightness > 200 || lightness < 55) { newColor = new _Color(currentColor).alter(-step / 2) } return newColor.toHex() } function getLightness(color) { return .3 * color.r + .59 * color.g + .11 * color.b } function DiscretePalette(source, size) { var palette = size > 0 ? createDiscreteColors(getPalette(source, { type: "gradientSet" }), size) : []; this.getColor = function(index) { return palette[index] || null } } function createDiscreteColors(source, count) { var i, ncolors = count - 1, nsource = source.length - 1, colors = [], gradient = []; function addColor(pos) { var k = nsource * pos, kl = _floor(k), kr = _ceil(k); gradient.push(colors[kl].blend(colors[kr], k - kl).toHex()) } for (i = 0; i <= nsource; ++i) { colors.push(new _Color(source[i])) } if (ncolors > 0) { for (i = 0; i <= ncolors; ++i) { addColor(i / ncolors) } } else { addColor(.5) } return gradient } function GradientPalette(source) { var palette = getPalette(source, { type: "gradientSet" }), color1 = new _Color(palette[0]), color2 = new _Color(palette[1]); this.getColor = function(ratio) { return 0 <= ratio && ratio <= 1 ? color1.blend(color2, ratio).toHex() : null } } _extend(exports, { Palette: Palette, DiscretePalette: DiscretePalette, GradientPalette: GradientPalette, registerPalette: registerPalette, getPalette: getPalette, currentPalette: currentPalette }); exports._DEBUG_palettes = palettes }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************!*\ !*** ./Scripts/core/utils/storage.js ***! \***************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var getSessionStorage = function() { var sessionStorage; try { sessionStorage = window.sessionStorage } catch (e) {} return sessionStorage }; exports.sessionStorage = getSessionStorage }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*********************************!*\ !*** ./Scripts/core/version.js ***! \*********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { module.exports = "16.1.5" }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************!*\ !*** ./Scripts/ui/context_menu.js ***! \************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { module.exports = __webpack_require__( /*! ./context_menu/ui.context_menu */ 422) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************************!*\ !*** ./Scripts/ui/scheduler/utils.recurrence.js ***! \**************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), errors = __webpack_require__( /*! ../../core/errors */ 10), dateUtils = __webpack_require__( /*! ../../core/utils/date */ 12); var intervalMap = { secondly: "seconds", minutely: "minutes", hourly: "hours", daily: "days", weekly: "weeks", monthly: "months", yearly: "years" }; var dateSetterMap = { bysecond: function(date, value) { date.setSeconds(value) }, byminute: function(date, value) { date.setMinutes(value) }, byhour: function(date, value) { date.setHours(value) }, bymonth: function(date, value) { date.setMonth(value) }, bymonthday: function(date, value) { date.setDate(value) }, byday: function(date, dayOfWeek) { date.setDate(date.getDate() - date.getDay() + dayOfWeek) } }; var dateGetterMap = { bysecond: "getSeconds", byminute: "getMinutes", byhour: "getHours", bymonth: "getMonth", bymonthday: "getDate", byday: "getDay" }; var ruleNames = ["freq", "interval", "byday", "bymonth", "bymonthday", "count", "until", "byhour", "byminute", "bysecond"], freqNames = ["DAILY", "WEEKLY", "MONTHLY", "YEARLY", "SECONDLY", "MINUTELY", "HOURLY"], days = { SU: 0, MO: 1, TU: 2, WE: 3, TH: 4, FR: 5, SA: 6 }; var dateInRecurrenceRange = function(recurrenceString, currentDate, viewStartDate, viewEndDate, recurrenceException) { var result = []; if (recurrenceString) { result = getDatesByRecurrence(recurrenceString, currentDate, viewStartDate, viewEndDate, recurrenceException) } return !!result.length }; var normalizeInterval = function(freq, interval) { var intervalObject = {}, intervalField = intervalMap[freq.toLowerCase()]; intervalObject[intervalField] = interval; return intervalObject }; var getDatesByRecurrenceException = function(recurrenceException) { var result = []; if (!recurrenceException) { return result } var ruleValues = recurrenceException.split(","); for (var i = 0, len = ruleValues.length; i < len; i++) { result[i] = getDateByAsciiString(ruleValues[i]) } return result }; var dateInArray = function(date, dates) { var result = false; for (var i = 0, len = dates.length; i < len; i++) { if (date.getTime() === dates[i].getTime()) { result = true } } return result }; var getDatesByRecurrence = function(recurrenceString, recurrenceStartDate, viewStartDate, viewEndDate, recurrenceException) { var result = [], recurrenceRule = getRecurrenceRule(recurrenceString); if (!recurrenceRule.isValid) { return [] } var rule = recurrenceRule.rule; if (!rule.freq) { return result } rule.interval = normalizeInterval(rule.freq, rule.interval); viewEndDate = dateUtils.normalizeDate(viewEndDate, viewStartDate, rule.until); var recurrenceCounter = 0, dateCounter = 0, dateRules = splitDateRules(rule), ruleDates = getDatesByRules(dateRules, recurrenceStartDate), currentDate = ruleDates[0], firstDate = new Date(recurrenceStartDate), exceptDates = getDatesByRecurrenceException(recurrenceException); dateUtils.correctDateWithUnitBeginning(firstDate, rule.interval); var firstDateInterval = getDatePartDiffs(recurrenceStartDate, firstDate); while (currentDate <= viewEndDate && rule.count !== recurrenceCounter) { if (checkDateByRule(currentDate, dateRules)) { if (currentDate >= viewStartDate && !dateInArray(currentDate, exceptDates)) { viewStartDate = new Date(currentDate); viewStartDate.setMilliseconds(viewStartDate.getMilliseconds() + 1); result.push(new Date(currentDate)) } recurrenceCounter++ } dateCounter++; currentDate = ruleDates[dateCounter % ruleDates.length]; if (dateCounter / ruleDates.length >= 1) { dateCounter = 0; firstDate = dateUtils.addInterval(firstDate, rule.interval); ruleDates = getDatesByRules(dateRules, dateUtils.addInterval(firstDate, firstDateInterval)); currentDate = ruleDates[0] } } return result }; var getDatePartDiffs = function(date1, date2) { return { years: date1.getFullYear() - date2.getFullYear(), months: date1.getMonth() - date2.getMonth(), days: date1.getDate() - date2.getDate(), hours: date1.getHours() - date2.getHours(), minutes: date1.getMinutes() - date2.getMinutes(), seconds: date1.getSeconds() - date2.getSeconds() } }; var getRecurrenceRule = function(recurrence) { var result = { rule: {}, isValid: false }; if (recurrence) { result.rule = parseRecurrenceRule(recurrence); result.isValid = validateRRule(result.rule, recurrence) } return result }; var loggedWarnings = []; var validateRRule = function(rule, recurrence) { if (brokenRuleNameExists(rule) || -1 === $.inArray(rule.freq, freqNames) || wrongCountRule(rule) || wrongIntervalRule(rule) || wrongDayOfWeek(rule) || wrongByMonthDayRule(rule) || wrongByMonth(rule) || wrongUntilRule(rule)) { logBrokenRule(recurrence); return false } return true }; var wrongUntilRule = function(rule) { var wrongUntil = false, until = rule.until; if (void 0 !== until && !(until instanceof Date)) { wrongUntil = true } return wrongUntil }; var wrongCountRule = function(rule) { var wrongCount = false, count = rule.count; if (count && "string" === typeof count) { wrongCount = true } return wrongCount }; var wrongByMonthDayRule = function(rule) { var wrongByMonthDay = false, byMonthDay = rule.bymonthday; if (byMonthDay && isNaN(parseInt(byMonthDay))) { wrongByMonthDay = true } return wrongByMonthDay }; var wrongByMonth = function(rule) { var wrongByMonth = false, byMonth = rule.bymonth; if (byMonth && isNaN(parseInt(byMonth))) { wrongByMonth = true } return wrongByMonth }; var wrongIntervalRule = function(rule) { var wrongInterval = false, interval = rule.interval; if (interval && "string" === typeof interval) { wrongInterval = true } return wrongInterval }; var wrongDayOfWeek = function(rule) { var daysByRule = daysFromByDayRule(rule), brokenDaysExist = false; $.each(daysByRule, function(_, day) { if (!days.hasOwnProperty(day)) { brokenDaysExist = true; return false } }); return brokenDaysExist }; var brokenRuleNameExists = function(rule) { var brokenRuleExists = false; $.each(rule, function(ruleName, _) { if (-1 === $.inArray(ruleName, ruleNames)) { brokenRuleExists = true; return false } }); return brokenRuleExists }; var logBrokenRule = function(recurrence) { if (-1 === $.inArray(recurrence, loggedWarnings)) { errors.log("W0006", recurrence); loggedWarnings.push(recurrence) } }; var parseRecurrenceRule = function(recurrence) { var ruleObject = {}, ruleParts = recurrence.split(";"); for (var i = 0, len = ruleParts.length; i < len; i++) { var rule = ruleParts[i].split("="), ruleName = rule[0].toLowerCase(), ruleValue = rule[1]; ruleObject[ruleName] = ruleValue } var count = parseInt(ruleObject.count); if (!isNaN(count)) { ruleObject.count = count } if (ruleObject.interval) { var interval = parseInt(ruleObject.interval); if (!isNaN(interval)) { ruleObject.interval = interval } } else { ruleObject.interval = 1 } if (ruleObject.freq && ruleObject.until) { ruleObject.until = getDateByAsciiString(ruleObject.until) } return ruleObject }; var getDateByAsciiString = function(string) { if ("string" !== typeof string) { return string } var arrayDate = string.match(/(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2}))?/); if (!arrayDate) { return null } var date = new(Function.prototype.bind.apply(Date, prepareDateArrayToParse(arrayDate))); return date }; var prepareDateArrayToParse = function(arrayDate) { arrayDate.shift(); if (void 0 === arrayDate[3]) { arrayDate.splice(3) } else { arrayDate.splice(3, 1) } arrayDate[1]--; arrayDate.unshift(null); return arrayDate }; var daysFromByDayRule = function(rule) { var result = []; if (rule.byday) { result = rule.byday.split(",") } return result }; var getAsciiStringByDate = function(date) { return date.getFullYear() + ("0" + (date.getMonth() + 1)).slice(-2) + ("0" + date.getDate()).slice(-2) + "T" + ("0" + date.getHours()).slice(-2) + ("0" + date.getMinutes()).slice(-2) + ("0" + date.getSeconds()).slice(-2) + "Z" }; var splitDateRules = function(rule) { var result = []; for (var field in dateSetterMap) { if (!rule[field]) { continue } var ruleFieldValues = rule[field].split(","), ruleArray = getDateRuleArray(field, ruleFieldValues); result = result.length ? extendObjectArray(ruleArray, result) : ruleArray } return result }; var getDateRuleArray = function(field, values) { var result = []; for (var i = 0, length = values.length; i < length; i++) { var dateRule = {}; dateRule[field] = handleRuleFieldValue(field, values[i]); result.push(dateRule) } return result }; var handleRuleFieldValue = function(field, value) { var result = parseInt(value); if ("bymonth" === field) { result -= 1 } if ("byday" === field) { result = days[value] } return result }; var extendObjectArray = function(firstArray, secondArray) { var result = []; for (var i = 0, firstArrayLength = firstArray.length; i < firstArrayLength; i++) { for (var j = 0, secondArrayLength = secondArray.length; j < secondArrayLength; j++) { result.push($.extend({}, firstArray[i], secondArray[j])) } } return result }; var getDatesByRules = function(dateRules, startDate) { var updatedDate = new Date(startDate), result = []; for (var i = 0, len = dateRules.length; i < len; i++) { var current = dateRules[i]; for (var field in current) { dateSetterMap[field](updatedDate, current[field]) } result.push(new Date(updatedDate)) } if (!result.length) { result.push(updatedDate) } return result }; var checkDateByRule = function(date, rules) { var result = false; for (var i = 0; i < rules.length; i++) { var current = rules[i], currentRuleResult = true; for (var field in current) { if (current[field] !== date[dateGetterMap[field]]()) { currentRuleResult = false } } result = result || currentRuleResult } return result || !rules.length }; var getRecurrenceString = function(object) { if (!object || !object.freq) { return } var result = ""; for (var field in object) { var value = object[field]; if ("interval" === field && value < 2) { continue } if ("until" === field) { value = getAsciiStringByDate(value) } result += field + "=" + value + ";" } result = result.substring(0, result.length - 1); return result.toUpperCase() }; module.exports = { getRecurrenceString: getRecurrenceString, getRecurrenceRule: getRecurrenceRule, getAsciiStringByDate: getAsciiStringByDate, getDatesByRecurrence: getDatesByRecurrence, dateInRecurrenceRange: dateInRecurrenceRange, getDateByAsciiString: getDateByAsciiString, daysFromByDayRule: daysFromByDayRule } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!******************************************!*\ !*** ./Scripts/viz/components/consts.js ***! \******************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { module.exports = { events: { mouseover: "mouseover", mouseout: "mouseout", mousemove: "mousemove", touchstart: "touchstart", touchmove: "touchmove", touchend: "touchend", mousedown: "mousedown", mouseup: "mouseup", click: "click", selectSeries: "selectseries", deselectSeries: "deselectseries", selectPoint: "selectpoint", deselectPoint: "deselectpoint", showPointTooltip: "showpointtooltip", hidePointTooltip: "hidepointtooltip" }, states: { hover: "hover", normal: "normal", selection: "selection", normalMark: 0, hoverMark: 1, selectedMark: 2, applyHover: "applyHover", applySelected: "applySelected", resetItem: "resetItem" }, pieLabelIndent: 30, pieLabelSpacing: 10, pieSeriesSpacing: 4 } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************!*\ !*** ./Scripts/viz/core/export.js ***! \************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), _extend = $.extend, _each = $.each, clientExporter = __webpack_require__( /*! ../../client_exporter */ 138), messageLocalization = __webpack_require__( /*! ../../localization/message */ 8), config = __webpack_require__( /*! ../../core/config */ 35), imageExporter = clientExporter.image, svgExporter = clientExporter.svg, pdfExporter = clientExporter.pdf, hoverEvent = __webpack_require__( /*! ../../events/hover */ 133), pointerEvents = __webpack_require__( /*! ../../events/pointer */ 13), pointerActions = [pointerEvents.down, pointerEvents.move].join(" "), BUTTON_SIZE = 35, ICON_COORDS = [ [9, 12, 26, 12, 26, 14, 9, 14], [9, 17, 26, 17, 26, 19, 9, 19], [9, 22, 26, 22, 26, 24, 9, 24] ], LIST_PADDING_TOP = 4, LIST_WIDTH = 120, VERTICAL_TEXT_MARGIN = 8, HORIZONTAL_TEXT_MARGIN = 15, MENU_ITEM_HEIGHT = 30, LIST_STROKE_WIDTH = 1, MARGIN = 10, SHADOW_OFFSET = 2, SHADOW_BLUR = 3, ALLOWED_EXPORT_FORMATS = ["PNG", "PDF", "JPEG", "SVG", "GIF"], EXPORT_CSS_CLASS = "dx-export-menu", EXPORT_DATA_KEY = "export-element-type", FORMAT_DATA_KEY = "export-element-format"; function validateFormat(format) { var validatedFormat = String(format).toUpperCase(); if (-1 !== $.inArray(validatedFormat, ALLOWED_EXPORT_FORMATS)) { return validatedFormat } } function getCreatorFunc(format) { if ("SVG" === format) { return svgExporter.getBlob } else { if ("PDF" === format) { return pdfExporter.getBlob } else { return imageExporter.getBlob } } } function print(data) { var vizWindow = window.open(); if (!vizWindow) { return } vizWindow.document.open(); vizWindow.document.write(data); vizWindow.document.close(); vizWindow.print(); vizWindow.close() } exports.exportFromMarkup = function(markup, options) { options.format = validateFormat(options.format) || "PNG"; options.fileName = options.fileName || "file"; clientExporter.export(markup, options, getCreatorFunc(options.format)) }; exports.ExportMenu = function(renderer, svgMethod) { var that = this; that._renderer = renderer; that._svgMethod = svgMethod; that._shadow = renderer.shadowFilter("-50%", "-50%", "200%", "200%", SHADOW_OFFSET, 6, SHADOW_BLUR); that._shadow.attr({ opacity: .8 }); that._group = renderer.g().attr({ "class": EXPORT_CSS_CLASS }).linkOn(renderer.root, { name: "export-menu", after: "peripheral" }); that._buttonGroup = renderer.g().attr({ "class": EXPORT_CSS_CLASS + "-button" }).append(that._group); that._listGroup = renderer.g().attr({ "class": EXPORT_CSS_CLASS + "-list" }).append(that._group); that._subscribeEvents() }; _extend(exports.ExportMenu.prototype, { getLayoutOptions: function() { var bbox = this._buttonGroup.getBBox(); bbox.cutSide = "vertical"; bbox.cutLayoutSide = "top"; bbox.height += 2 * MARGIN; bbox.position = { vertical: "top", horizontal: "right" }; bbox.verticalAlignment = "top"; bbox.horizontalAlignment = "right"; return bbox }, probeDraw: $.noop, shift: function(_, y) { this._group.attr({ translateY: this._group.attr("translateY") + y }) }, draw: function(_, height, canvas) { this._options.exportOptions.width = canvas.width; this._options.exportOptions.height = canvas.height; this._group.move(canvas.width - BUTTON_SIZE - SHADOW_OFFSET - SHADOW_BLUR, height - BUTTON_SIZE - MARGIN) }, show: function() { this._group.linkAppend() }, hide: function() { this._group.linkRemove() }, setOptions: function(options) { this._options = options; options.formats = options.formats || ALLOWED_EXPORT_FORMATS; options.printingEnabled = void 0 === options.printingEnabled ? true : options.printingEnabled; if (options.enabled && (options.formats.length || options.printingEnabled)) { this.show(); this._updateButton(); this._updateList(); this._hideList() } else { this.hide() } }, dispose: function() { var that = this; that._unsubscribeEvents(); that._group.linkRemove().linkOff(); that._group.dispose(); that._shadow.dispose(); that._shadow = that._group = that._listGroup = that._buttonGroup = that._button = null; that._options = null }, layoutOptions: function() { var options = this._options; return options.enabled && { horizontalAlignment: "right", verticalAlignment: "top", weak: true } }, measure: function() { return [BUTTON_SIZE + SHADOW_OFFSET, BUTTON_SIZE] }, move: function(rect) { this._group.attr({ translateX: Math.round(rect[0]), translateY: Math.round(rect[1]) }) }, _hideList: function() { this._listGroup.attr({ visibility: "hidden" }); this._listShown = false; this._setButtonState("default") }, _showList: function() { this._listGroup.attr({ visibility: "visible" }); this._listShown = true }, _setButtonState: function(state) { var that = this, style = that._options.button[state]; this._button.attr({ stroke: style.borderColor, fill: style.backgroundColor }); this._icon.attr({ fill: style.color }) }, _subscribeEvents: function() { var that = this; that._renderer.root.on(pointerEvents.up + ".export", function(e) { var exportOptions, elementType = e.target[EXPORT_DATA_KEY], options = that._options; if (!elementType) { if (that._button) { that._hideList() } return } if ("button" === elementType) { if (that._listShown) { that._setButtonState("default"); that._hideList() } else { that._setButtonState("focus"); that._showList() } } else { if ("printing" === elementType) { that.hide(); print(that._svgMethod()); that.show(); that._hideList() } else { if ("exporting" === elementType) { that.hide(); exportOptions = _extend({}, options.exportOptions, { format: e.target[FORMAT_DATA_KEY], backgroundColor: options.backgroundColor }); clientExporter.export(that._svgMethod(), exportOptions, getCreatorFunc(exportOptions.format)); that.show(); that._hideList() } } } }); that._listGroup.on(pointerActions, function(e) { e.stopPropagation() }); that._buttonGroup.on(pointerEvents.enter, function() { that._setButtonState("hover") }); that._buttonGroup.on(pointerEvents.leave, function() { that._setButtonState(that._listShown ? "focus" : "default") }); that._buttonGroup.on(pointerEvents.down + ".export", function(e) { that._setButtonState("active") }) }, _unsubscribeEvents: function() { this._renderer.root.off(".export"); this._listGroup.off(); this._buttonGroup.off() }, _updateButton: function() { var that = this, renderer = that._renderer, options = that._options, iconAttr = { fill: options.button.default.color, cursor: "pointer" }, exportData = { "export-element-type": "button" }; if (!that._button) { that._button = renderer.rect(0, 0, BUTTON_SIZE, BUTTON_SIZE).append(that._buttonGroup); that._button.attr({ rx: 4, ry: 4, fill: options.button.default.backgroundColor, stroke: options.button.default.borderColor, "stroke-width": 1, cursor: "pointer" }); that._button.data(exportData); that._icon = renderer.path(ICON_COORDS).append(that._buttonGroup); that._icon.attr(iconAttr); that._icon.data(exportData); that._buttonGroup.setTitle(messageLocalization.format("vizExport-titleMenuText")) } }, _getItemStyle: function(options) { var font = options.font, style = { rect: { cursor: "pointer", "pointer-events": "all" }, text: { "pointer-events": "none" } }; style.text["font-size"] = font.size; style.text["font-family"] = font.family; style.text.fill = font.color; style.text["font-weight"] = font.weight; return style }, _getItemAttributes: function(options, items) { var path, attr = {}, x = BUTTON_SIZE - LIST_WIDTH, y = BUTTON_SIZE + LIST_PADDING_TOP + (items.length + 1) * MENU_ITEM_HEIGHT; attr.rect = { width: LIST_WIDTH - 2 * LIST_STROKE_WIDTH, height: MENU_ITEM_HEIGHT, x: x + LIST_STROKE_WIDTH, y: y - MENU_ITEM_HEIGHT }; attr.text = config().rtlEnabled ? { x: x + LIST_WIDTH - 2 * LIST_STROKE_WIDTH - HORIZONTAL_TEXT_MARGIN } : { x: x + HORIZONTAL_TEXT_MARGIN }; attr.text.y = y - VERTICAL_TEXT_MARGIN; if ("printing" === options.type) { path = "M " + x + " " + (y - LIST_STROKE_WIDTH) + " L " + (x + LIST_WIDTH) + " " + (y - LIST_STROKE_WIDTH); attr.separator = { stroke: options.stroke, "stroke-width": LIST_STROKE_WIDTH, cursor: "pointer", sharp: "v", d: path } } return attr }, _addMenuItem: function(renderer, options, items) { var menuItem, that = this, itemData = {}, hoverFill = options.hoverFill, fill = options.fill, type = options.type, format = options.format, style = that._getItemStyle(options), attr = that._getItemAttributes(options, items); menuItem = renderer.g().attr({ "class": EXPORT_CSS_CLASS + "-list-item" }); itemData[EXPORT_DATA_KEY] = type; if (format) { itemData[FORMAT_DATA_KEY] = format } var rect = renderer.rect(), text = renderer.text(options.text); rect.attr(attr.rect).css(style.rect).data(itemData); rect.on(hoverEvent.start + ".export", function(e) { rect.attr({ fill: hoverFill }) }).on(hoverEvent.end + ".export", function(e) { rect.attr({ fill: fill }) }); rect.append(menuItem); text.css(style.text).attr(attr.text).append(menuItem); if ("printing" === type) { renderer.path(null, "line").attr(attr.separator).append(menuItem) } items.push({ g: menuItem, rect: rect }) }, _getMenuItems: function(options) { var that = this, buttonDefault = options.button.default, buttonHover = options.button.hover, formats = options.formats, renderer = that._renderer, items = []; if (options.printingEnabled) { that._addMenuItem(renderer, { font: options.font, type: "printing", fill: buttonDefault.backgroundColor, stroke: buttonDefault.borderColor, hoverFill: buttonHover.backgroundColor, text: messageLocalization.format("vizExport-printingButtonText") }, items) } _each(formats, function(_, format) { format = validateFormat(format); if (format) { that._addMenuItem(renderer, { font: options.font, fill: buttonDefault.backgroundColor, stroke: buttonDefault.borderColor, hoverFill: buttonHover.backgroundColor, type: "exporting", text: messageLocalization.getFormatter("vizExport-exportButtonText")(format), format: format }, items) } }); items && that._setConnerRadius(items); return items }, _getMenuOverlay: function(options, items) { var rect, listHeight, that = this, listPadding = BUTTON_SIZE + LIST_PADDING_TOP, renderer = that._renderer, xCoord = -LIST_WIDTH + BUTTON_SIZE; listHeight = items.length * MENU_ITEM_HEIGHT; rect = renderer.rect(xCoord, listPadding, LIST_WIDTH, listHeight); that._shadow.attr({ color: options.shadowColor }); rect.attr({ fill: options.button.default.backgroundColor, stroke: options.button.default.borderColor, "stroke-width": LIST_STROKE_WIDTH, cursor: "pointer", rx: 4, ry: 4, filter: that._shadow.ref }); rect.data({ "export-element-type": "list" }); return rect }, _setConnerRadius: function(items) { var firstRect = items[0].rect, lastRect = items[items.length - 1].rect; firstRect.attr({ y: parseInt(firstRect.attr("y")) + 2 * LIST_STROKE_WIDTH, height: parseInt(firstRect.attr("height")) - 2 * LIST_STROKE_WIDTH }); lastRect.attr({ height: parseInt(lastRect.attr("height")) - 2 * LIST_STROKE_WIDTH }) }, _updateList: function() { var that = this, options = that._options, listGroup = that._listGroup, items = that._getMenuItems(options), menuOverlay = that._getMenuOverlay(options, items); listGroup.clear(); menuOverlay.append(listGroup); _each(items, function(_, item) { item.g.append(listGroup) }) } }); function getExportOptions(widget, fileName, format, backgroundColor) { var validatedFormat = String(format).toUpperCase(); if (-1 === $.inArray(validatedFormat, ["PNG", "PDF", "JPEG", "SVG", "GIF"])) { validatedFormat = "PNG" } return { format: validatedFormat, fileName: fileName || "file", proxyUrl: widget.option("export.proxyUrl"), width: widget._canvas.width, height: widget._canvas.height, exportingAction: widget._createActionByOption("onExporting"), exportedAction: widget._createActionByOption("onExported"), fileSavingAction: widget._createActionByOption("onFileSaving") } } exports.plugin = { name: "export", init: function() { var that = this; that._exportMenu = new exports.ExportMenu(that._renderer, function() { return that.svg() }); that._layout.add(that._exportMenu) }, dispose: function() { this._exportMenu.dispose(); this._exportMenu = null }, members: { _getExportMenuOptions: function() { var that = this, userOptions = that._getOption("export") || {}, options = getExportOptions(that, userOptions.fileName, userOptions.format, userOptions.color); return $.extend({}, userOptions, { exportOptions: options }) }, exportTo: function(fileName, format) { var creatorFunc, exportOptions = getExportOptions(this, fileName, format), exportMenu = this._exportMenu; if ("SVG" === exportOptions.format) { creatorFunc = clientExporter.svg.getBlob } else { if ("PDF" === exportOptions.format) { creatorFunc = clientExporter.pdf.getBlob } else { creatorFunc = clientExporter.image.getBlob } } exportMenu && exportMenu.hide(); clientExporter.export(this.svg(), exportOptions, creatorFunc); exportMenu && exportMenu.show() }, print: function() { var vizWindow = window.open(); if (!vizWindow) { return } vizWindow.document.open(); vizWindow.document.write(this.svg()); vizWindow.document.close(); vizWindow.print(); vizWindow.close() } }, customize: function(constructor) { var proto = constructor.prototype; constructor.addChange({ code: "EXPORT", handler: function() { this._exportMenu.setOptions(this._getExportMenuOptions()); this._change(["LAYOUT"]) }, isThemeDependent: true, isOptionChange: true, option: "export" }); proto._optionChangesMap.onExporting = "EXPORT"; proto._optionChangesMap.onExported = "EXPORT"; proto._optionChangesMap.onFileSaving = "EXPORT" } } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!******************************************!*\ !*** ./Scripts/viz/gauges/base_gauge.js ***! \******************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), _Number = Number, _getAppropriateFormat = __webpack_require__( /*! ../core/utils */ 6).getAppropriateFormat, translator1DModule = __webpack_require__( /*! ../translators/translator1d */ 341), _extend = $.extend, BaseWidget = __webpack_require__( /*! ../core/base_widget */ 109), _normalizeEnum = __webpack_require__( /*! ../core/utils */ 6).normalizeEnum, commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), Tracker = __webpack_require__( /*! ./tracker */ 528), _isString = commonUtils.isString; var dxBaseGauge = BaseWidget.inherit({ _rootClassPrefix: "dxg", _createThemeManager: function() { return new this._factory.ThemeManager }, _setDeprecatedOptions: function() { this.callBase(); _extend(this._deprecatedOptions, { subtitle: { since: "15.2", message: "Use the 'title.subtitle' option instead" }, "title.position": { since: "15.2", message: "Use the 'verticalAlignment' and 'horizontalAlignment' options instead" }, "scale.hideFirstTick": { since: "15.2", message: "The functionality is not more available" }, "scale.hideLastTick": { since: "15.2", message: "The functionality is not more available" }, "scale.hideFirstLabel": { since: "15.2", message: "The functionality is not more available" }, "scale.hideLastLabel": { since: "15.2", message: "The functionality is not more available" }, "scale.majorTick": { since: "15.2", message: "Use the 'tick' option instead" }, "scale.minorTick.showCalculatedTicks": { since: "15.2", message: "The functionality is not more available" }, "scale.minorTick.customTickValues": { since: "15.2", message: "Use the 'customMinorTicks' option instead" }, "scale.minorTick.tickInterval": { since: "15.2", message: "Use the 'minorTickInterval' option instead" } }) }, _initCore: function() { var that = this, root = that._renderer.root; that._valueChangingLocker = 0; that._translator = that._factory.createTranslator(); that._initDeltaIndicator(); that._tracker = that._factory.createTracker({ renderer: that._renderer, container: root }); that._setTrackerCallbacks() }, _beginValueChanging: function() { this._resetIsReady(); ++this._valueChangingLocker }, _endValueChanging: function() { if (0 === --this._valueChangingLocker) { this._drawn() } }, _initDeltaIndicator: function() { var that = this, DeltaIndicator = that._DeltaIndicator; if (DeltaIndicator) { that._deltaIndicator = new DeltaIndicator({ renderer: that._renderer, container: that._renderer.root }); that._deltaIndicator.layoutOptions = function() { this.clean(); this.draw(that._getOption("indicator")); var options = this.getLayoutOptions(); this._size = options ? [options.width, options.height] : null; return options && { horizontalAlignment: options.horizontalAlignment || "center", verticalAlignment: options.verticalAlignment || "bottom" } }; that._deltaIndicator.measure = function() { return this._size }; that._deltaIndicator.move = function(rect) { return this.shift(Math.round(rect[0]), Math.round(rect[1])) }; that._layout.add(that._deltaIndicator) } }, _disposeDeltaIndicator: function() { if (this._deltaIndicator) { this._deltaIndicator.clean(); this._deltaIndicator.dispose() } }, _setTrackerCallbacks: function() { var that = this, renderer = that._renderer, tooltip = that._tooltip; that._tracker.setCallbacks({ "tooltip-show": function(target, info) { var tooltipParameters = target.getTooltipParameters(), offset = renderer.getRootOffset(), formatObject = _extend({ value: tooltipParameters.value, valueText: tooltip.formatValue(tooltipParameters.value), color: tooltipParameters.color }, info); return tooltip.show(formatObject, { x: tooltipParameters.x + offset.left, y: tooltipParameters.y + offset.top, offset: tooltipParameters.offset }, { target: info }) }, "tooltip-hide": function() { return tooltip.hide() } }); that._resetTrackerCallbacks = function() { that._resetTrackerCallbacks = that = renderer = tooltip = null } }, _dispose: function() { this._cleanCore(); this.callBase.apply(this, arguments) }, _disposeCore: function() { var that = this; that._themeManager.dispose(); that._tracker.dispose(); that._disposeDeltaIndicator(); that._translator = that._tracker = null }, _cleanCore: function() { var that = this; that._tracker.deactivate(); that._cleanContent() }, _renderCore: function() { var that = this; if (!that._isValidDomain) { return } that._renderContent(); that._tracker.setTooltipState(that._tooltip.isEnabled()); that._tracker.activate(); that._noAnimation = false; that._debug_rendered && that._debug_rendered() }, _applyChanges: function() { this.callBase.apply(this, arguments); this._resizing = this._noAnimation = false }, _setContentSize: function() { var that = this; that._resizing = that._noAnimation = 2 === that._changes.count(); that.callBase.apply(that, arguments) }, _applySize: function(rect) { var that = this; that._DEBUG_rootRect = rect; that._innerRect = { left: rect[0], top: rect[1], right: rect[2], bottom: rect[3] }; var layoutCache = that._layout._cache; that._cleanCore(); that._renderCore(); that._layout._cache = that._layout._cache || layoutCache; return [rect[0], that._innerRect.top, rect[2], that._innerRect.bottom] }, _initialChanges: ["DOMAIN"], _themeDependentChanges: ["DOMAIN"], _optionChangesMap: { subtitle: "MOSTLY_TOTAL", indicator: "MOSTLY_TOTAL", geometry: "MOSTLY_TOTAL", animation: "MOSTLY_TOTAL", startValue: "DOMAIN", endValue: "DOMAIN" }, _optionChangesOrder: ["DOMAIN", "MOSTLY_TOTAL"], _change_DOMAIN: function() { this._setupDomain() }, _change_MOSTLY_TOTAL: function() { this._applyMostlyTotalChange() }, _setupDomain: function() { var that = this; that._setupDomainCore(); that._isValidDomain = isFinite(1 / (that._translator.getDomain()[1] - that._translator.getDomain()[0])); if (!that._isValidDomain) { that._incidentOccurred("W2301") } that._change(["MOSTLY_TOTAL"]) }, _applyMostlyTotalChange: function() { var that = this; that._setupCodomain(); that._setupAnimationSettings(); that._setupDefaultFormat(); that._change(["LAYOUT"]) }, _setupAnimationSettings: function() { var that = this, option = that.option("animation"); that._animationSettings = null; if (void 0 === option || option) { option = _extend({ enabled: true, duration: 1e3, easing: "easeOutCubic" }, option); if (option.enabled && option.duration > 0) { that._animationSettings = { duration: _Number(option.duration), easing: option.easing } } } that._containerBackgroundColor = that.option("containerBackgroundColor") || that._themeManager.theme().containerBackgroundColor }, _setupDefaultFormat: function() { var domain = this._translator.getDomain(); this._defaultFormatOptions = _getAppropriateFormat(domain[0], domain[1], this._getApproximateScreenRange()) }, _setupDomainCore: null, _calculateSize: null, _cleanContent: null, _renderContent: null, _setupCodomain: null, _getApproximateScreenRange: null, _factory: { createTranslator: function() { return new translator1DModule.Translator1D }, createTracker: function(parameters) { return new Tracker(parameters) } } }); exports.dxBaseGauge = dxBaseGauge; var _format = __webpack_require__( /*! ../core/format */ 162); var formatValue = function(value, options, extra) { options = options || {}; var formatObject, text = _format(value, options); if ("function" === typeof options.customizeText) { formatObject = _extend({ value: value, valueText: text }, extra); return String(options.customizeText.call(formatObject, formatObject)) } return text }; var getSampleText = function(translator, options) { var text1 = formatValue(translator.getDomainStart(), options), text2 = formatValue(translator.getDomainEnd(), options); return text1.length >= text2.length ? text1 : text2 }; exports.formatValue = formatValue; exports.getSampleText = getSampleText; exports.compareArrays = function(array1, array2) { return array1 && array2 && array1.length === array2.length && compareArraysElements(array1, array2) }; function compareArraysElements(array1, array2) { var i, ii = array1.length; for (i = 0; i < ii; ++i) { if (array1[i] !== array2[i]) { return false } } return true } dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/export */ 127).plugin); dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/title */ 164).plugin); dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/tooltip */ 165).plugin); dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/loading_indicator */ 163).plugin); var _setTooltipOptions = dxBaseGauge.prototype._setTooltipOptions; dxBaseGauge.prototype._setTooltipOptions = function() { _setTooltipOptions.apply(this, arguments); this._tracker && this._tracker.setTooltipState(this._tooltip.isEnabled()) }; function processTitleOptions(options) { return _isString(options) ? { text: options } : options || {} } dxBaseGauge.prototype._getTitleOptions = function() { var options, position, that = this, titleOptions = processTitleOptions(that.option("title")); that._suppressDeprecatedWarnings(); titleOptions.subtitle = $.extend(processTitleOptions(titleOptions.subtitle), processTitleOptions(that.option("subtitle"))); that._resumeDeprecatedWarnings(); options = _extend(true, {}, that._themeManager.theme("title"), titleOptions); if (options.position) { position = _normalizeEnum(options.position).split("-"); options.verticalAlignment = position[0]; options.horizontalAlignment = position[1] } return options } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!******************************************!*\ !*** ./Scripts/viz/series/bar_series.js ***! \******************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), scatterSeries = __webpack_require__( /*! ./scatter_series */ 88), areaSeries = __webpack_require__( /*! ./area_series */ 166).chart.area, chartSeries = scatterSeries.chart, polarSeries = scatterSeries.polar, _extend = $.extend, _each = $.each, DEFAULT_BAR_POINT_SIZE = 3; exports.chart = {}; exports.polar = {}; var baseBarSeriesMethods = { _getSpecialColor: areaSeries._getSpecialColor, _createPattern: areaSeries._createPattern, _updateOptions: function(options) { this._stackName = "axis_" + (options.axis || "default") + "_stack_" + (options.stack || "default") }, _parsePointStyle: function(style, defaultColor, defaultBorderColor) { var color = this._createPattern(style.color || defaultColor, style.hatching), base = chartSeries._parsePointStyle.call(this, style, color, defaultBorderColor); base.fill = color; base.dashStyle = style.border && style.border.dashStyle || "solid"; delete base.r; return base }, _applyMarkerClipRect: function(settings) { settings.clipId = null }, _clearingAnimation: function(translators, drawComplete) { var that = this, settings = that._oldgetAffineCoordOptions(translators) || that._getAffineCoordOptions(translators); that._labelsGroup && that._labelsGroup.animate({ opacity: .001 }, { duration: that._defaultDuration, partitionDuration: .5 }, function() { that._markersGroup.animate(settings, { partitionDuration: .5 }, function() { that._markersGroup.attr({ scaleX: null, scaleY: null, translateX: 0, translateY: 0 }); drawComplete() }) }) }, _setGroupsSettings: function(animationEnabled, firstDrawing) { var that = this, settings = {}; chartSeries._setGroupsSettings.apply(that, arguments); if (animationEnabled && firstDrawing) { settings = this._getAffineCoordOptions(that.translators, true) } else { if (!animationEnabled) { settings = { scaleX: 1, scaleY: 1, translateX: 0, translateY: 0 } } } that._markersGroup.attr(settings) }, _drawPoint: function(options) { options.hasAnimation = options.hasAnimation && !options.firstDrawing; options.firstDrawing = false; chartSeries._drawPoint.call(this, options) }, _getMainColor: function() { return this._options.mainSeriesColor }, _createPointStyles: function(pointOptions) { var that = this, mainColor = pointOptions.color || that._getMainColor(), specialMainColor = that._getSpecialColor(mainColor); return { normal: that._parsePointStyle(pointOptions, mainColor, mainColor), hover: that._parsePointStyle(pointOptions.hoverStyle || {}, specialMainColor, mainColor), selection: that._parsePointStyle(pointOptions.selectionStyle || {}, specialMainColor, mainColor) } }, _updatePointsVisibility: function() { var visibility = this._options.visible; $.each(this._points, function(_, point) { point._options.visible = visibility }) }, _getOptionsForPoint: function() { return this._options }, _animate: function(firstDrawing) { var that = this, complete = function() { that._animateComplete() }, animateFunc = function(drawnPoints, complete) { var lastPointIndex = drawnPoints.length - 1; _each(drawnPoints || [], function(i, point) { point.animate(i === lastPointIndex ? complete : void 0, point.getMarkerCoords()) }) }; that._animatePoints(firstDrawing, complete, animateFunc) }, _getPointSize: function() { return DEFAULT_BAR_POINT_SIZE }, _beginUpdateData: function(data) { chartSeries._beginUpdateData.call(this, data); this._deletePatterns() } }; exports.chart.bar = _extend({}, chartSeries, baseBarSeriesMethods, { _getAffineCoordOptions: function(translators) { var rotated = this._options.rotated, direction = rotated ? "x" : "y", settings = { scaleX: rotated ? .001 : 1, scaleY: rotated ? 1 : .001 }; settings["translate" + direction.toUpperCase()] = translators[direction].translate("canvas_position_default"); return settings }, _getRangeData: function() { var rangeData = areaSeries._getRangeData.apply(this, arguments); rangeData.arg.stick = false; return rangeData }, _animatePoints: function(firstDrawing, complete, animateFunc) { var that = this; that._markersGroup.animate({ scaleX: 1, scaleY: 1, translateY: 0, translateX: 0 }, void 0, complete); if (!firstDrawing) { animateFunc(that._drawnPoints, complete) } } }); exports.polar.bar = _extend({}, polarSeries, baseBarSeriesMethods, { _animatePoints: function(firstDrawing, complete, animateFunc) { animateFunc(this._drawnPoints, complete) }, _setGroupsSettings: chartSeries._setGroupsSettings, _drawPoint: function(point, groups, animationEnabled) { chartSeries._drawPoint.call(this, point, groups, animationEnabled) }, _parsePointStyle: function(style) { var base = baseBarSeriesMethods._parsePointStyle.apply(this, arguments); base.opacity = style.opacity; return base }, _createGroups: chartSeries._createGroups, _setMarkerGroupSettings: function() { var groupSettings, that = this, markersSettings = that._createPointStyles(that._getMarkerGroupOptions()).normal; markersSettings.class = "dxc-markers"; that._applyMarkerClipRect(markersSettings); groupSettings = _extend({}, markersSettings); delete groupSettings.opacity; that._markersGroup.attr(groupSettings) }, _createLegendState: areaSeries._createLegendState, _getRangeData: areaSeries._getRangeData }) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************!*\ !*** ./Scripts/viz/tree_map/api.js ***! \*************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var proto = __webpack_require__( /*! ./tree_map.base */ 51).prototype, nodeProto = __webpack_require__( /*! ./node */ 168).prototype, _extend = __webpack_require__( /*! jquery */ 1).extend; proto._eventsMap.onNodesInitialized = { name: "nodesInitialized" }; proto._eventsMap.onNodesRendering = { name: "nodesRendering" }; proto._createProxyType = function() { var nodes, that = this; Proxy.prototype = { constructor: Proxy, getParent: function() { return nodes[this._id].parent.proxy || null }, getChild: function(index) { var _nodes = nodes[this._id].nodes; return _nodes ? _nodes[index].proxy : null }, getChildrenCount: function() { var _nodes = nodes[this._id].nodes; return _nodes ? _nodes.length : 0 }, getAllChildren: function() { var i, _nodes = nodes[this._id].nodes, ii = _nodes && _nodes.length, list = []; for (i = 0; i < ii; ++i) { list.push(_nodes[i].proxy) } return list }, getAllNodes: function() { var list = []; collectNodes(nodes[this._id], list); return list }, isLeaf: function() { return !nodes[this._id].isNode() }, isActive: function() { return nodes[this._id].isActive() }, value: function(arg) { var ret, node = nodes[this._id]; if (void 0 !== arg) { updateValue(node, arg > 0 ? Number(arg) : 0); change(node, ["TILING"]); ret = this } else { ret = node.value } return ret }, label: function(arg) { var ret, node = nodes[this._id]; if (void 0 !== arg) { node.customLabel = arg ? String(arg) : null; change(node, ["LABELS"]); ret = this } else { ret = node.customLabel || node.label } return ret }, customize: function(settings) { var node = nodes[this._id]; if (settings) { node._custom = node._custom || {}; _extend(true, node._custom, settings); node._partialState = node._partialLabelState = null } change(node, ["TILES", "LABELS"]); return this }, resetCustomization: function() { var node = nodes[this._id]; node._custom = node._partialState = node._partialLabelState = null; change(node, ["TILES", "LABELS"]); return this } }; that._extendProxyType(Proxy.prototype); function Proxy(node) { var that = this; node.proxy = that; that._id = node._id; that.level = node.level; that.index = node.index; that.data = node.data } that._handlers.beginBuildNodes = function() { nodes = that._nodes; new Proxy(that._root) }; that._handlers.buildNode = function(node) { new Proxy(node) }; that._handlers.endBuildNodes = function() { that._eventTrigger("nodesInitialized", { root: that._root.proxy }) } }; function change(node, codes) { var ctx = node.ctx; ctx.suspend(); ctx.change(codes); ctx.resume() } function collectNodes(node, list) { var i, nodes = node.nodes, ii = nodes && nodes.length; for (i = 0; i < ii; ++i) { list.push(nodes[i].proxy); collectNodes(nodes[i], list) } } function updateValue(node, value) { var delta = value - node.value; while (node) { node.value += delta; node = node.parent } } proto._extendProxyType = __webpack_require__( /*! ./common */ 90).empty; var _resetNodes = proto._resetNodes; proto._resetNodes = function() { _resetNodes.call(this); this._eventTrigger("nodesRendering", { node: this._topNode.proxy }) }; var _updateStyles = nodeProto.updateStyles; nodeProto.updateStyles = function() { var that = this; _updateStyles.call(that); if (that._custom) { that._partialState = !that.ctx.forceReset && that._partialState || that.ctx.calculateState(that._custom); _extend(true, that.state, that._partialState) } }; var _updateLabelStyle = nodeProto.updateLabelStyle; nodeProto.updateLabelStyle = function() { var that = this, custom = that._custom; _updateLabelStyle.call(that); if (custom && custom.label) { that._partialLabelState = !that.ctx.forceReset && that._partialLabelState || calculatePartialLabelState(that, custom.label); that.labelState = _extend(true, {}, that.labelState, that._partialLabelState) } }; function calculatePartialLabelState(node, settings) { var state = node.ctx.calculateLabelState(settings); if ("visible" in settings) { state.visible = !!settings.visible } return state } proto.getRootNode = function() { return this._root.proxy }; proto.resetNodes = function() { var context = this._context; context.suspend(); context.change(["NODES_CREATE"]); context.resume(); return this } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************!*\ !*** ./Scripts/ui/drop_down_menu.js ***! \**************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), devices = __webpack_require__( /*! ../core/devices */ 7), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 3), Widget = __webpack_require__( /*! ./widget/ui.widget */ 19), Button = __webpack_require__( /*! ./button */ 24), Popover = __webpack_require__( /*! ./popover */ 95), DataHelperMixin = __webpack_require__( /*! ./collection/ui.data_helper */ 118), List = __webpack_require__( /*! ./list */ 87); var DROP_DOWN_MENU_CLASS = "dx-dropdownmenu", DROP_DOWN_MENU_POPUP_CLASS = "dx-dropdownmenu-popup", DROP_DOWN_MENU_POPUP_WRAPPER_CLASS = "dx-dropdownmenu-popup-wrapper", DROP_DOWN_MENU_LIST_CLASS = "dx-dropdownmenu-list", DROP_DOWN_MENU_BUTTON_CLASS = "dx-dropdownmenu-button"; var POPUP_OPTION_MAP = { popupWidth: "width", popupHeight: "height" }; var BUTTON_OPTION_MAP = { buttonIcon: "icon", buttonText: "text", buttonWidth: "width", buttonHeight: "height", buttonTemplate: "template" }; var DropDownMenu = Widget.inherit({ _supportedKeys: function() { var extension = {}; if (!this.option("opened") || !this._list.option("focusedElement")) { extension = this._button._supportedKeys() } return $.extend(this.callBase(), extension, { tab: function(e) { this._popup.hide() } }) }, _setDeprecatedOptions: function() { this.callBase(); $.extend(this._deprecatedOptions, { buttonIconSrc: { since: "15.1", alias: "buttonIcon" } }) }, _getDefaultOptions: function() { return $.extend(this.callBase(), { items: [], onItemClick: null, dataSource: null, itemTemplate: "item", buttonText: "", buttonIcon: "overflow", buttonWidth: void 0, buttonHeight: void 0, buttonTemplate: "content", onButtonClick: null, usePopover: false, popupWidth: "auto", popupHeight: "auto", activeStateEnabled: true, hoverStateEnabled: true, opened: false, deferRendering: false, popupPosition: { my: "top center", at: "bottom center", collision: "fit flip", offset: { v: 1 } }, popupAnimation: void 0, onItemRendered: null, menuWidget: List }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: [{ platform: "ios" }], options: { usePopover: true } }, { device: [{ platform: "generic" }], options: { popupPosition: { offset: { v: 4 } } } }, { device: function(device) { return "desktop" === devices.real().deviceType && !devices.isSimulator() }, options: { focusStateEnabled: true } }, { device: [{ platform: "android" }], options: { popupPosition: { my: "top " + (this.option("rtlEnabled") ? "left" : "right"), at: "top " + (this.option("rtlEnabled") ? "left" : "right"), collision: "flipfit" }, popupAnimation: { show: { type: "pop", duration: 200, from: { scale: 0 }, to: { scale: 1 } }, hide: { type: "pop", duration: 200, from: { scale: 1 }, to: { scale: 0 } } } } }]) }, _initOptions: function(options) { if ("android" === devices.current().platform) { if (!options.popupPosition) { options.popupPosition = { at: (options.usePopover ? "bottom " : "top ") + (options.rtlEnabled ? "left" : "right") } } } this.callBase(options) }, _dataSourceOptions: function() { return { paginate: false } }, _init: function() { this.callBase(); this.element().addClass(DROP_DOWN_MENU_CLASS); this._initDataSource(); this._initItemClickAction(); this._initButtonClickAction() }, _initItemClickAction: function() { this._itemClickAction = this._createActionByOption("onItemClick") }, _initButtonClickAction: function() { this._buttonClickAction = this._createActionByOption("onButtonClick") }, _render: function() { this._renderButton(); this.callBase(); this.setAria({ role: "menubar", haspopup: true, expanded: this.option("opened") }) }, _renderContentImpl: function() { if (this.option("opened")) { this._renderPopup() } }, _clean: function() { this._cleanFocusState(); if (this._popup) { this._popup.element().remove(); delete this._$popup } }, _renderButton: function() { var $button = this.element().addClass(DROP_DOWN_MENU_BUTTON_CLASS), config = this._buttonOptions(); this._button = this._createComponent($button, Button, config) }, _buttonOptions: function() { return { text: this.option("buttonText"), icon: this.option("buttonIcon"), width: this.option("buttonWidth"), height: this.option("buttonHeight"), template: this.option("buttonTemplate"), focusStateEnabled: false, onClick: $.proxy(function(e) { this.option("opened", !this.option("opened")); this._buttonClickAction(e) }, this) } }, _toggleMenuVisibility: function(opened) { var state = void 0 === opened ? !this._popup.option("visible") : opened; if (opened) { this._renderPopup() } this._popup.toggle(state); this.setAria("expanded", state) }, _renderPopup: function() { if (this._$popup) { return } var $popup = this._$popup = $("
").appendTo(this.element()), config = this._popupOptions(); this._popup = this._createComponent($popup, Popover, config) }, _popupOptions: function() { var usePopup = !this.option("usePopover"); return { onInitialized: function(args) { args.component._wrapper().addClass(DROP_DOWN_MENU_POPUP_WRAPPER_CLASS).toggleClass(DROP_DOWN_MENU_POPUP_CLASS, usePopup) }, visible: this.option("opened"), onContentReady: $.proxy(this._popupContentReadyHandler, this), deferRendering: false, position: this.option("popupPosition"), animation: this.option("popupAnimation"), onOptionChanged: $.proxy(function(args) { if ("visible" === args.name) { this.option("opened", args.value) } }, this), target: this.element(), height: this.option("popupHeight"), width: this.option("popupWidth") } }, _popupContentReadyHandler: function() { var popup = Popover.getInstance(this._$popup); this._renderList(popup) }, _renderList: function(instance) { var $content = instance.content(), listConfig = this._listOptions(); $content.addClass(DROP_DOWN_MENU_LIST_CLASS); this._list = this._createComponent($content, this.option("menuWidget"), listConfig); this._list._getAriaTarget = $.proxy(function() { return this.element() }, this); this._setListDataSource(); var listMaxHeight = .5 * $(window).height(); if ($content.height() > listMaxHeight) { $content.height(listMaxHeight) } }, _listOptions: function() { return { _keyboardProcessor: this._listProcessor, pageLoadMode: "scrollBottom", indicateLoading: false, noDataText: "", itemTemplate: this._getTemplateByOption("itemTemplate"), onItemClick: $.proxy(function(e) { this.option("opened", false); this._itemClickAction(e) }, this), tabIndex: -1, focusStateEnabled: this.option("focusStateEnabled"), activeStateEnabled: this.option("activeStateEnabled"), onItemRendered: this.option("onItemRendered"), _itemAttributes: { role: "menuitem" } } }, _setListDataSource: function() { if (this._list) { this._list.option("dataSource", this._dataSource || this.option("items")) } delete this._deferRendering }, _attachKeyboardEvents: function() { this.callBase.apply(this, arguments); this._listProcessor = this._keyboardProcessor.attachChildProcessor(); if (this._list) { this._list.option("_keyboardProcessor", this._listProcessor) } }, _cleanFocusState: function() { this.callBase.apply(this, arguments); delete this._listProcessor }, _toggleVisibility: function(visible) { this.callBase(visible); this._button.option("visible", visible) }, _optionChanged: function(args) { var name = args.name; var value = args.value; switch (name) { case "items": case "dataSource": if (this.option("deferRendering") && !this.option("opened")) { this._deferRendering = true } else { this._refreshDataSource(); this._setListDataSource() } break; case "itemTemplate": if (this._list) { this._list.option(name, this._getTemplate(value)) } break; case "onItemClick": this._initItemClickAction(); break; case "onButtonClick": this._buttonClickAction(); break; case "buttonIcon": case "buttonText": case "buttonWidth": case "buttonHeight": case "buttonTemplate": this._button.option(BUTTON_OPTION_MAP[name], value); this._renderPopup(); break; case "popupWidth": case "popupHeight": this._popup.option(POPUP_OPTION_MAP[name], value); break; case "usePopover": case "menuWidget": this._invalidate(); break; case "focusStateEnabled": case "activeStateEnabled": if (this._list) { this._list.option(name, value) } this.callBase(args); break; case "onItemRendered": if (this._list) { this._list.option(name, value) } break; case "opened": if (this._deferRendering) { this._refreshDataSource(); this._setListDataSource() } this._toggleMenuVisibility(value); break; case "deferRendering": case "popupPosition": break; default: this.callBase(args) } }, open: function() { this.option("opened", true) }, close: function() { this.option("opened", false) } }).include(DataHelperMixin); registerComponent("dxDropDownMenu", DropDownMenu); module.exports = DropDownMenu }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************************!*\ !*** ./Scripts/ui/validation/validation_mixin.js ***! \***************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var ValidationMixin = { _findGroup: function() { var $dxGroup, group = this.option("validationGroup"); if (!group) { $dxGroup = this.element().parents(".dx-validationgroup:first"); if ($dxGroup.length) { group = $dxGroup.dxValidationGroup("instance") } else { group = this._modelByElement(this.element()) } } return group } }; module.exports = ValidationMixin }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*********************************!*\ !*** ./Scripts/events/hover.js ***! \*********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../core/class */ 5), devices = __webpack_require__( /*! ../core/devices */ 7), registerEvent = __webpack_require__( /*! ./core/event_registrator */ 43), eventUtils = __webpack_require__( /*! ./utils */ 4), pointerEvents = __webpack_require__( /*! ./pointer */ 13); var HOVERSTART_NAMESPACE = "dxHoverStart", HOVERSTART = "dxhoverstart", POINTERENTER_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(pointerEvents.enter, HOVERSTART_NAMESPACE), HOVEREND_NAMESPACE = "dxHoverEnd", HOVEREND = "dxhoverend", POINTERLEAVE_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(pointerEvents.leave, HOVEREND_NAMESPACE); var Hover = Class.inherit({ noBubble: true, add: function(element, handleObj) { var that = this, $element = $(element); $element.off(this._originalEventName).on(this._originalEventName, handleObj.selector, function(e) { that._handler(e) }) }, _handler: function(e) { if (eventUtils.isTouchEvent(e) || devices.isSimulator()) { return } eventUtils.fireEvent({ type: this._eventName, originalEvent: e, delegateTarget: e.delegateTarget }) }, teardown: function(element) { $(element).off(this._originalEventName) } }); var HoverStart = Hover.inherit({ ctor: function() { this._eventName = HOVERSTART; this._originalEventName = POINTERENTER_NAMESPACED_EVENT_NAME; this._isMouseDown = false }, _handler: function(e) { var pointers = e.pointers || []; if (!pointers.length) { this.callBase(e) } } }); var HoverEnd = Hover.inherit({ ctor: function() { this._eventName = HOVEREND; this._originalEventName = POINTERLEAVE_NAMESPACED_EVENT_NAME } }); registerEvent(HOVERSTART, new HoverStart); registerEvent(HOVEREND, new HoverEnd); exports.start = HOVERSTART; exports.end = HOVEREND }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************!*\ !*** ./Scripts/ui/box.js ***! \***************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../core/class */ 5), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 3), commonUtils = __webpack_require__( /*! ../core/utils/common */ 2), support = __webpack_require__( /*! ../core/utils/support */ 18), browser = __webpack_require__( /*! ../core/utils/browser */ 22), devices = __webpack_require__( /*! ../core/devices */ 7), CollectionWidget = __webpack_require__( /*! ./collection/ui.collection_widget.edit */ 27); var BOX_CLASS = "dx-box", BOX_SELECTOR = ".dx-box", BOX_ITEM_CLASS = "dx-box-item", BOX_ITEM_DATA_KEY = "dxBoxItemData"; var flexGrowProp = support.styleProp("flexGrow"); var flexShrinkProp = support.styleProp("flexShrink"); var flexPropPrefix = support.stylePropPrefix("flexDirection"); var MINSIZE_MAP = { row: "minWidth", col: "minHeight" }; var MAXSIZE_MAP = { row: "maxWidth", col: "maxHeight" }; var SHRINK = 1; var FLEX_JUSTIFY_CONTENT_MAP = { start: "flex-start", end: "flex-end", center: "center", "space-between": "space-between", "space-around": "space-around" }; var FLEX_ALIGN_ITEMS_MAP = { start: "flex-start", end: "flex-end", center: "center", stretch: "stretch" }; var FLEX_DIRECTION_MAP = { row: "row", col: "column" }; var FlexLayoutStrategy = Class.inherit({ ctor: function($element, option) { this._$element = $element; this._option = option }, renderBox: function() { this._$element.css({ display: support.stylePropPrefix("flexDirection") + "flex", flexDirection: FLEX_DIRECTION_MAP[this._option("direction")] }) }, renderAlign: function() { this._$element.css({ justifyContent: this._normalizedAlign() }) }, _normalizedAlign: function() { var align = this._option("align"); return align in FLEX_JUSTIFY_CONTENT_MAP ? FLEX_JUSTIFY_CONTENT_MAP[align] : align }, renderCrossAlign: function() { this._$element.css({ alignItems: this._normalizedCrossAlign() }) }, _normalizedCrossAlign: function() { var crossAlign = this._option("crossAlign"); return crossAlign in FLEX_ALIGN_ITEMS_MAP ? FLEX_ALIGN_ITEMS_MAP[crossAlign] : crossAlign }, renderItems: function($items) { var direction = this._option("direction"); $.each($items, function() { var $item = $(this); var item = $item.data(BOX_ITEM_DATA_KEY); $item.css({ display: flexPropPrefix + "flex", flexBasis: item.baseSize || 0 }).css(MAXSIZE_MAP[direction], item.maxSize || "none").css(MINSIZE_MAP[direction], item.minSize || "0"); var itemStyle = $item.get(0).style; itemStyle[flexGrowProp] = item.ratio; itemStyle[flexShrinkProp] = commonUtils.isDefined(item.shrink) ? item.shrink : SHRINK; $item.children().each(function(_, itemContent) { $(itemContent).css({ width: "auto", height: "auto", display: support.stylePropPrefix("flexDirection") + "flex", flexDirection: $item.children().css("flexDirection") || "column" }); itemContent.style[flexGrowProp] = 1 }) }) }, initSize: $.noop, update: $.noop }); var BOX_EVENTNAMESPACE = "dxBox", UPDATE_EVENT = "dxupdate." + BOX_EVENTNAMESPACE, FALLBACK_BOX_ITEM = "dx-box-fallback-item"; var FALLBACK_WRAP_MAP = { row: "nowrap", col: "normal" }; var FALLBACK_MAIN_SIZE_MAP = { row: "width", col: "height" }; var FALLBACK_CROSS_SIZE_MAP = { row: "height", col: "width" }; var FALLBACK_PRE_MARGIN_MAP = { row: "marginLeft", col: "marginTop" }; var FALLBACK_POST_MARGIN_MAP = { row: "marginRight", col: "marginBottom" }; var FALLBACK_CROSS_PRE_MARGIN_MAP = { row: "marginTop", col: "marginLeft" }; var FALLBACK_CROSS_POST_MARGIN_MAP = { row: "marginBottom", col: "marginRight" }; var MARGINS_RTL_FLIP_MAP = { marginLeft: "marginRight", marginRight: "marginLeft" }; var FallbackLayoutStrategy = Class.inherit({ ctor: function($element, option) { this._$element = $element; this._option = option }, renderBox: function() { this._$element.css({ fontSize: 0, whiteSpace: FALLBACK_WRAP_MAP[this._option("direction")], verticalAlign: "top" }); this._$element.off(UPDATE_EVENT).on(UPDATE_EVENT, $.proxy(this.update, this)) }, renderAlign: function() { var $items = this._$items; if (!$items) { return } var align = this._option("align"), shift = 0, totalItemSize = this.totalItemSize, direction = this._option("direction"), boxSize = this._$element[FALLBACK_MAIN_SIZE_MAP[direction]](), freeSpace = boxSize - totalItemSize; this._setItemsMargins($items, direction, 0); switch (align) { case "start": break; case "end": shift = freeSpace; $items.first().css(this._chooseMarginSide(FALLBACK_PRE_MARGIN_MAP[direction]), shift); break; case "center": shift = .5 * freeSpace; $items.first().css(this._chooseMarginSide(FALLBACK_PRE_MARGIN_MAP[direction]), shift); $items.last().css(this._chooseMarginSide(FALLBACK_POST_MARGIN_MAP[direction]), shift); break; case "space-between": shift = .5 * freeSpace / ($items.length - 1); this._setItemsMargins($items, direction, shift); $items.first().css(this._chooseMarginSide(FALLBACK_PRE_MARGIN_MAP[direction]), 0); $items.last().css(this._chooseMarginSide(FALLBACK_POST_MARGIN_MAP[direction]), 0); break; case "space-around": shift = .5 * freeSpace / $items.length; this._setItemsMargins($items, direction, shift) } }, _setItemsMargins: function($items, direction, shift) { $items.css(this._chooseMarginSide(FALLBACK_PRE_MARGIN_MAP[direction]), shift).css(this._chooseMarginSide(FALLBACK_POST_MARGIN_MAP[direction]), shift) }, renderCrossAlign: function() { var $items = this._$items; if (!$items) { return } var crossAlign = this._option("crossAlign"), direction = this._option("direction"), size = this._$element[FALLBACK_CROSS_SIZE_MAP[direction]](); var that = this; switch (crossAlign) { case "start": break; case "end": $.each($items, function() { var $item = $(this), itemSize = $item[FALLBACK_CROSS_SIZE_MAP[direction]](), shift = size - itemSize; $item.css(that._chooseMarginSide(FALLBACK_CROSS_PRE_MARGIN_MAP[direction]), shift) }); break; case "center": $.each($items, function() { var $item = $(this), itemSize = $item[FALLBACK_CROSS_SIZE_MAP[direction]](), shift = .5 * (size - itemSize); $item.css(that._chooseMarginSide(FALLBACK_CROSS_PRE_MARGIN_MAP[direction]), shift).css(that._chooseMarginSide(FALLBACK_CROSS_POST_MARGIN_MAP[direction]), shift) }); break; case "stretch": $items.css(that._chooseMarginSide(FALLBACK_CROSS_PRE_MARGIN_MAP[direction]), 0).css(that._chooseMarginSide(FALLBACK_CROSS_POST_MARGIN_MAP[direction]), 0).css(FALLBACK_CROSS_SIZE_MAP[direction], "100%") } }, _chooseMarginSide: function(value) { if (!this._option("rtlEnabled")) { return value } return MARGINS_RTL_FLIP_MAP[value] || value }, renderItems: function($items) { this._$items = $items; var direction = this._option("direction"), totalRatio = 0, totalWeightedShrink = 0, totalBaseSize = 0; $.each($items, $.proxy(function(_, item) { var $item = $(item); $item.css({ display: "inline-block", verticalAlign: "top" }); $item[FALLBACK_MAIN_SIZE_MAP[direction]]("auto"); $item.removeClass(FALLBACK_BOX_ITEM); var itemData = $item.data(BOX_ITEM_DATA_KEY), ratio = itemData.ratio || 0, size = this._baseSize($item), shrink = commonUtils.isDefined(itemData.shrink) ? itemData.shrink : SHRINK; totalRatio += ratio; totalWeightedShrink += shrink * size; totalBaseSize += size }, this)); var freeSpaceSize = this._boxSize() - totalBaseSize; var itemSize = $.proxy(function($item) { var itemData = $item.data(BOX_ITEM_DATA_KEY), size = this._baseSize($item), factor = freeSpaceSize >= 0 ? itemData.ratio || 0 : (commonUtils.isDefined(itemData.shrink) ? itemData.shrink : SHRINK) * size, totalFactor = freeSpaceSize >= 0 ? totalRatio : totalWeightedShrink, shift = totalFactor ? Math.round(freeSpaceSize * factor / totalFactor) : 0; return size + shift }, this); var totalItemSize = 0; $.each($items, function(_, item) { var $item = $(item), itemData = $(item).data(BOX_ITEM_DATA_KEY), size = itemSize($item); totalItemSize += size; $item.css(MAXSIZE_MAP[direction], itemData.maxSize || "none").css(MINSIZE_MAP[direction], itemData.minSize || "0").css(FALLBACK_MAIN_SIZE_MAP[direction], size); $item.addClass(FALLBACK_BOX_ITEM) }); this.totalItemSize = totalItemSize }, _baseSize: function(item) { var itemData = $(item).data(BOX_ITEM_DATA_KEY); return null == itemData.baseSize ? 0 : "auto" === itemData.baseSize ? this._contentSize(item) : this._parseSize(itemData.baseSize) }, _contentSize: function(item) { return $(item)[FALLBACK_MAIN_SIZE_MAP[this._option("direction")]]() }, _parseSize: function(size) { return String(size).match(/.+%$/) ? .01 * parseFloat(size) * this._boxSizeValue : size }, _boxSize: function(value) { if (!arguments.length) { this._boxSizeValue = this._boxSizeValue || this._totalBaseSize(); return this._boxSizeValue } this._boxSizeValue = value }, _totalBaseSize: function() { var result = 0; $.each(this._$items, $.proxy(function(_, item) { result += this._baseSize(item) }, this)); return result }, initSize: function() { this._boxSize(this._$element[FALLBACK_MAIN_SIZE_MAP[this._option("direction")]]()) }, update: function() { if (!this._$items || this._$element.is(":hidden")) { return } this._$items.detach(); this.initSize(); this._$element.append(this._$items); this.renderItems(this._$items); this.renderAlign(); this.renderCrossAlign(); var element = this._$element.get(0); this._$items.find(BOX_SELECTOR).each(function() { if (element === $(this).parent().closest(BOX_SELECTOR).get(0)) { $(this).triggerHandler(UPDATE_EVENT) } }) } }); var Box = CollectionWidget.inherit({ _getDefaultOptions: function() { return $.extend(this.callBase(), { direction: "row", align: "start", crossAlign: "stretch", activeStateEnabled: false, focusStateEnabled: false, _layoutStrategy: "flex", _queue: void 0 }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function() { var device = devices.real(); var isOldAndroid = "android" === device.platform && (device.version[0] < 4 || 4 === device.version[0] && device.version[1] < 4), isOldIos = "ios" === device.platform && device.version[0] < 7; return "win" === device.platform || browser.msie || isOldAndroid || isOldIos }, options: { _layoutStrategy: "fallback" } }]) }, _itemClass: function() { return BOX_ITEM_CLASS }, _itemDataKey: function() { return BOX_ITEM_DATA_KEY }, _itemElements: function() { return this._itemContainer().children(this._itemSelector()) }, _init: function() { this.callBase(); this.element().addClass(BOX_CLASS + "-" + this.option("_layoutStrategy")); this._initLayout(); this._initBoxQueue() }, _initLayout: function() { this._layout = "fallback" === this.option("_layoutStrategy") ? new FallbackLayoutStrategy(this.element(), $.proxy(this.option, this)) : new FlexLayoutStrategy(this.element(), $.proxy(this.option, this)) }, _initBoxQueue: function() { this._queue = this.option("_queue") || [] }, _queueIsNotEmpty: function() { return this.option("_queue") ? false : !!this._queue.length }, _pushItemToQueue: function($item, config) { this._queue.push({ $item: $item, config: config }) }, _shiftItemFromQueue: function() { return this._queue.shift() }, _render: function() { this.callBase(); this.element().addClass(BOX_CLASS); this._renderBox() }, _renderBox: function() { this._layout.renderBox(); this._layout.renderAlign(); this._layout.renderCrossAlign() }, _renderItems: function(items) { this._layout.initSize(); this.callBase(items); while (this._queueIsNotEmpty()) { var item = this._shiftItemFromQueue(); this._createComponent(item.$item, Box, $.extend({ _layoutStrategy: this.option("_layoutStrategy"), itemTemplate: this.option("itemTemplate"), itemHoldTimeout: this.option("itemHoldTimeout"), onItemHold: this.option("onItemHold"), onItemClick: this.option("onItemClick"), onItemContextMenu: this.option("onItemContextMenu"), onItemRendered: this.option("onItemRendered"), _queue: this._queue }, item.config)) } this._layout.renderItems(this._itemElements()); clearTimeout(this._updateTimer); this._updateTimer = setTimeout($.proxy(function() { if (!this._isUpdated) { this._layout.update() } this._isUpdated = false; this._updateTimer = null }, this)) }, _renderItemContent: function(args) { var $itemNode = args.itemData && args.itemData.node; if ($itemNode) { return this._renderItemContentByNode(args, $itemNode) } return this.callBase(args) }, _postprocessRenderItem: function(args) { var boxConfig = args.itemData.box; if (!boxConfig) { return } this._pushItemToQueue(args.itemContent, boxConfig) }, _createItemByTemplate: function(itemTemplate, args) { return args.itemData.box ? itemTemplate.source() : this.callBase(itemTemplate, args) }, _visibilityChanged: function(visible) { if (visible) { this._dimensionChanged() } }, _dimensionChanged: function() { if (this._updateTimer) { return } this._isUpdated = true; this._layout.update() }, _dispose: function() { clearTimeout(this._updateTimer); this.callBase.apply(this, arguments) }, _optionChanged: function(args) { switch (args.name) { case "_layoutStrategy": case "_queue": case "direction": this._invalidate(); break; case "align": this._layout.renderAlign(); break; case "crossAlign": this._layout.renderCrossAlign(); break; default: this.callBase(args) } }, repaint: function() { this._dimensionChanged() } }); registerComponent("dxBox", Box); module.exports = Box }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************************************!*\ !*** ./Scripts/ui/date_box/ui.date_box.strategy.js ***! \*****************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../../core/class */ 5), dateLocalization = __webpack_require__( /*! ../../localization/date */ 14); var abstract = Class.abstract; var DateBoxStrategy = Class.inherit({ ctor: function(dateBox) { this.dateBox = dateBox }, widgetOption: function() { return this._widget && this._widget.option.apply(this._widget, arguments) }, _renderWidget: function(element) { element = element || $("
"); this._widget = this._createWidget(element); this._widget.element().appendTo(this._getWidgetContainer()) }, _createWidget: function(element) { var widgetName = this._getWidgetName(); var widgetOptions = this._getWidgetOptions(); return this.dateBox._createComponent(element, widgetName, widgetOptions) }, _getWidgetOptions: abstract, _getWidgetName: abstract, getDefaultOptions: function() { return { mode: "text" } }, getDisplayFormat: abstract, supportedKeys: $.noop, attachKeyboardEvents: function(keyboardProcessor) { this._widgetKeyboardProcessor = keyboardProcessor.attachChildProcessor() }, getParsedText: function(text, format) { return dateLocalization.parse(text, format) }, renderInputMinMax: $.noop, renderOpenedState: function() { if (this.dateBox.option("opened")) { this._updateValue() } }, popupConfig: abstract, renderPopupContent: function() { var popup = this._getPopup(); this._renderWidget(); popup.content().parent().off("mousedown").on("mousedown", $.proxy(this._preventFocusOnPopup, this)) }, getFirstPopupElement: $.noop, getLastPopupElement: $.noop, _preventFocusOnPopup: function(e) { e.preventDefault() }, _getWidgetContainer: function() { return this._getPopup().content() }, _getPopup: function() { return this.dateBox._popup }, popupShowingHandler: $.noop, popupHiddenHandler: $.noop, _updateValue: function() { this._widget && this._widget.option("value", this.dateBoxValue()) }, _valueChangedHandler: function(args) { if (this.dateBox.option("opened") && "instantly" === this.dateBox.option("applyValueMode")) { this.dateBoxValue(args.value) } }, textChangedHandler: $.noop, renderValue: function() { if (this.dateBox.option("opened")) { this._updateValue() } }, getValue: function() { return this._widget.option("value") }, isAdaptivityChanged: function() { return false }, dispose: function() { var popup = this._getPopup(); if (popup) { popup.content().empty() } }, dateBoxValue: function() { var args = ["value"]; arguments.length && args.push(arguments[0]); return this.dateBox.dateOption.apply(this.dateBox, args) } }); module.exports = DateBoxStrategy }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************************!*\ !*** ./Scripts/ui/list/ui.list.base.js ***! \*****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), compileGetter = __webpack_require__( /*! ../../core/utils/data */ 16).compileGetter, clickEvent = __webpack_require__( /*! ../../events/click */ 9), swipeEvents = __webpack_require__( /*! ../../events/swipe */ 82), support = __webpack_require__( /*! ../../core/utils/support */ 18), messageLocalization = __webpack_require__( /*! ../../localization/message */ 8), inkRipple = __webpack_require__( /*! ../widget/utils.ink_ripple */ 48), devices = __webpack_require__( /*! ../../core/devices */ 7), Button = __webpack_require__( /*! ../button */ 24), eventUtils = __webpack_require__( /*! ../../events/utils */ 4), themes = __webpack_require__( /*! ../themes */ 23), ScrollModule = __webpack_require__( /*! ../scroll_view/ui.scroll_view */ 183), deviceDependentOptions = __webpack_require__( /*! ../scroll_view/ui.scrollable */ 72).deviceDependentOptions, CollectionWidget = __webpack_require__( /*! ../collection/ui.collection_widget.edit */ 27); var LIST_CLASS = "dx-list", LIST_ITEM_CLASS = "dx-list-item", LIST_ITEM_SELECTOR = "." + LIST_ITEM_CLASS, LIST_GROUP_CLASS = "dx-list-group", LIST_GROUP_HEADER_CLASS = "dx-list-group-header", LIST_GROUP_BODY_CLASS = "dx-list-group-body", LIST_COLLAPSIBLE_GROUPS_CLASS = "dx-list-collapsible-groups", LIST_GROUP_COLLAPSED_CLASS = "dx-list-group-collapsed", LIST_HAS_NEXT_CLASS = "dx-has-next", LIST_NEXT_BUTTON_CLASS = "dx-list-next-button", LIST_ITEM_DATA_KEY = "dxListItemData", LIST_FEEDBACK_SHOW_TIMEOUT = 70; var groupItemsGetter = compileGetter("items"); var ListBase = CollectionWidget.inherit({ _activeStateUnit: LIST_ITEM_SELECTOR, _supportedKeys: function() { var that = this; var moveFocusPerPage = function(direction) { var $item = getEdgeVisibleItem(direction), isFocusedItem = $item.is(that.option("focusedElement")); if (isFocusedItem) { scrollListTo($item, direction); $item = getEdgeVisibleItem(direction) } that.option("focusedElement", $item); that.scrollToItem($item) }; var getEdgeVisibleItem = function(direction) { var scrollTop = that.scrollTop(), containerHeight = that.element().height(); var $item = that.option("focusedElement"), isItemVisible = true; if (!$item) { return $() } while (isItemVisible) { var $nextItem = $item[direction](); if (!$nextItem.length) { break } var nextItemLocation = $nextItem.position().top + $nextItem.outerHeight() / 2; isItemVisible = nextItemLocation < containerHeight + scrollTop && nextItemLocation > scrollTop; if (isItemVisible) { $item = $nextItem } } return $item }; var scrollListTo = function($item, direction) { var resultPosition = $item.position().top; if ("prev" === direction) { resultPosition = $item.position().top - that.element().height() + $item.outerHeight() } that.scrollTo(resultPosition) }; return $.extend(this.callBase(), { leftArrow: $.noop, rightArrow: $.noop, pageUp: function() { moveFocusPerPage("prev"); return false }, pageDown: function() { moveFocusPerPage("next"); return false } }) }, _setDeprecatedOptions: function() { this.callBase(); $.extend(this._deprecatedOptions, { autoPagingEnabled: { since: "15.1", message: "Use the 'pageLoadMode' option instead" }, showNextButton: { since: "15.1", message: "Use the 'pageLoadMode' option instead" } }) }, _getDefaultOptions: function() { return $.extend(this.callBase(), { hoverStateEnabled: true, pullRefreshEnabled: false, scrollingEnabled: true, showScrollbar: "onScroll", useNativeScrolling: true, bounceEnabled: true, scrollByContent: true, scrollByThumb: false, pullingDownText: messageLocalization.format("dxList-pullingDownText"), pulledDownText: messageLocalization.format("dxList-pulledDownText"), refreshingText: messageLocalization.format("dxList-refreshingText"), pageLoadingText: messageLocalization.format("dxList-pageLoadingText"), onScroll: null, onPullRefresh: null, onPageLoading: null, pageLoadMode: "scrollBottom", nextButtonText: messageLocalization.format("dxList-nextButtonText"), onItemSwipe: null, grouped: false, onGroupRendered: null, collapsibleGroups: false, groupTemplate: "group", indicateLoading: true, activeStateEnabled: true, _itemAttributes: { role: "option" }, useInkRipple: false }) }, _defaultOptionsRules: function() { return this.callBase().concat(deviceDependentOptions(), [{ device: function(device) { return !support.nativeScrolling }, options: { useNativeScrolling: false } }, { device: function(device) { return !support.nativeScrolling && !devices.isSimulator() && "generic" === devices.real().platform && "generic" === device.platform }, options: { showScrollbar: "onHover", pageLoadMode: "nextButton" } }, { device: function(device) { return "desktop" === devices.real().deviceType && !devices.isSimulator() }, options: { focusStateEnabled: true } }, { device: function() { return /android5/.test(themes.current()) }, options: { useInkRipple: true } }, { device: function(device) { return "win" === devices.current().platform && devices.isSimulator() }, options: { bounceEnabled: false } }]) }, _visibilityChanged: function(visible) { if (visible) { this._updateLoadingState(true) } }, _itemClass: function() { return LIST_ITEM_CLASS }, _itemDataKey: function() { return LIST_ITEM_DATA_KEY }, _itemContainer: function() { return this._$container }, _itemElements: function() { if (!this.option("grouped")) { return this._itemContainer().children(this._itemSelector()) } return this._itemContainer().children("." + LIST_GROUP_CLASS).children("." + LIST_GROUP_BODY_CLASS).children(this._itemSelector()) }, _itemSelectHandler: function(e) { if ("single" === this.option("selectionMode") && this.isItemSelected(e.currentTarget)) { return } this.callBase(e) }, _allowDynamicItemsAppend: function() { return true }, _init: function() { this.callBase(); this._$container = this.element(); this._initScrollView(); this._feedbackShowTimeout = LIST_FEEDBACK_SHOW_TIMEOUT; this._createGroupRenderAction(); this.setAria("role", "listbox") }, _dataSourceOptions: function() { this._suppressDeprecatedWarnings(); var pagingEnabled = this.option("autoPagingEnabled"); pagingEnabled = commonUtils.isDefined(this.option("showNextButton")) ? pagingEnabled || this.option("showNextButton") : pagingEnabled; this._resumeDeprecatedWarnings(); return $.extend(this.callBase(), { paginate: commonUtils.isDefined(pagingEnabled) ? pagingEnabled : true }) }, _initScrollView: function() { this._suppressDeprecatedWarnings(); var scrollingEnabled = this.option("scrollingEnabled"), pullRefreshEnabled = scrollingEnabled && this.option("pullRefreshEnabled"), autoPagingEnabled = scrollingEnabled && commonUtils.ensureDefined(this.option("autoPagingEnabled"), "scrollBottom" === this.option("pageLoadMode")) && !!this._dataSource; this._resumeDeprecatedWarnings(); this._scrollView = this._createComponent(this.element(), ScrollModule.ScrollView, { disabled: this.option("disabled") || !scrollingEnabled, onScroll: $.proxy(this._scrollHandler, this), onPullDown: pullRefreshEnabled ? $.proxy(this._pullDownHandler, this) : null, onReachBottom: autoPagingEnabled ? $.proxy(this._scrollBottomHandler, this) : null, showScrollbar: this.option("showScrollbar"), useNative: this.option("useNativeScrolling"), bounceEnabled: this.option("bounceEnabled"), scrollByContent: this.option("scrollByContent"), scrollByThumb: this.option("scrollByThumb"), pullingDownText: this.option("pullingDownText"), pulledDownText: this.option("pulledDownText"), refreshingText: this.option("refreshingText"), reachBottomText: this.option("pageLoadingText"), useKeyboard: false }); this._$container = this._scrollView.content(); this._createScrollViewActions() }, _createScrollViewActions: function() { this._scrollAction = this._createActionByOption("onScroll"); this._pullRefreshAction = this._createActionByOption("onPullRefresh"); this._pageLoadingAction = this._createActionByOption("onPageLoading") }, _scrollHandler: function(e) { this._scrollAction(e) }, _updateLoadingState: function(tryLoadMore) { this._suppressDeprecatedWarnings(); var isDataLoaded = !tryLoadMore || this._isLastPage(), autoPagingEnabled = commonUtils.ensureDefined(this.option("autoPagingEnabled"), "scrollBottom" === this.option("pageLoadMode")), stopLoading = isDataLoaded || !autoPagingEnabled, hideLoadIndicator = stopLoading && !this._isDataSourceLoading(); this._resumeDeprecatedWarnings(); if (stopLoading || this._scrollViewIsFull()) { this._scrollView.release(hideLoadIndicator); this._toggleNextButton(this._shouldRenderNextButton() && !isDataLoaded); this._loadIndicationSuppressed(false) } else { this._infiniteDataLoading() } }, _shouldRenderNextButton: function() { this._suppressDeprecatedWarnings(); var result = commonUtils.ensureDefined(this.option("showNextButton"), "nextButton" === this.option("pageLoadMode")) && this._dataSource && this._dataSource.isLoaded(); this._resumeDeprecatedWarnings(); return result }, _dataSourceLoadingChangedHandler: function(isLoading) { if (this._loadIndicationSuppressed()) { return } if (isLoading && this.option("indicateLoading")) { this._showLoadingIndicatorTimer = setTimeout($.proxy(function() { var isEmpty = !this._itemElements().length; if (this._scrollView && !isEmpty) { this._scrollView.startLoading() } }, this)) } else { clearTimeout(this._showLoadingIndicatorTimer); this._scrollView && this._scrollView.finishLoading() } }, _dataSourceChangedHandler: function(newItems) { if (!this._shouldAppendItems()) { this._scrollView && this._scrollView.scrollTo(0) } this.callBase(newItems) }, _hideLoadingIfLoadIndicationOff: function() { if (!this.option("indicateLoading")) { this._dataSourceLoadingChangedHandler(false) } }, _loadIndicationSuppressed: function(value) { if (!arguments.length) { return this._isLoadIndicationSuppressed } this._isLoadIndicationSuppressed = value }, _scrollViewIsFull: function() { return !this._scrollView || this._scrollView.isFull() }, _pullDownHandler: function(e) { this._pullRefreshAction(e); if (this._dataSource && !this._isDataSourceLoading()) { this._clearSelectedItems(); this._dataSource.pageIndex(0); this._dataSource.load() } else { this._updateLoadingState() } }, _infiniteDataLoading: function() { var isElementVisible = this.element().is(":visible"); if (isElementVisible && !this._scrollViewIsFull() && !this._isDataSourceLoading() && !this._isLastPage()) { clearTimeout(this._loadNextPageTimer); this._loadNextPageTimer = setTimeout($.proxy(this._loadNextPage, this)) } }, _scrollBottomHandler: function(e) { this._pageLoadingAction(e); if (!this._isDataSourceLoading()) { this._loadNextPage() } else { this._updateLoadingState() } }, _renderItems: function(items) { if (this.option("grouped")) { $.each(items, $.proxy(this._renderGroup, this)); this._attachGroupCollapseEvent(); this._renderEmptyMessage() } else { this.callBase.apply(this, arguments) } this._updateLoadingState(true) }, _attachGroupCollapseEvent: function() { var eventName = eventUtils.addNamespace(clickEvent.name, this.NAME), selector = "." + LIST_GROUP_HEADER_CLASS, $element = this.element(), collapsibleGroups = this.option("collapsibleGroups"); $element.toggleClass(LIST_COLLAPSIBLE_GROUPS_CLASS, collapsibleGroups); $element.off(eventName, selector); if (collapsibleGroups) { $element.on(eventName, selector, $.proxy(function(e) { this._createAction($.proxy(function(e) { var $group = $(e.jQueryEvent.currentTarget).parent(); this._collapseGroupHandler($group); if (this.option("focusStateEnabled")) { this.option("focusedElement", $group.find("." + LIST_ITEM_CLASS).eq(0)) } }, this), { validatingTargetName: "element" })({ jQueryEvent: e }) }, this)) } }, _collapseGroupHandler: function($group, toggle) { var deferred = $.Deferred(), $groupBody = $group.children("." + LIST_GROUP_BODY_CLASS); $group.toggleClass(LIST_GROUP_COLLAPSED_CLASS, toggle); var slideMethod = "slideToggle"; if (true === toggle) { slideMethod = "slideUp" } if (false === toggle) { slideMethod = "slideDown" } $groupBody[slideMethod]({ duration: 200, complete: $.proxy(function() { this.updateDimensions(); this._updateLoadingState(true); deferred.resolve() }, this) }); return deferred.promise() }, _dataSourceLoadErrorHandler: function() { this._forgetNextPageLoading(); if (this._initialized) { this._renderEmptyMessage(); this._updateLoadingState() } }, _render: function() { this.element().addClass(LIST_CLASS); this.callBase(); this.option("useInkRipple") && this._renderInkRipple() }, _renderInkRipple: function() { this._inkRipple = inkRipple.render() }, _toggleActiveState: function($element, value, e) { this.callBase.apply(this, arguments); if (!this._inkRipple) { return } var config = { element: $element, jQueryEvent: e }; if (value) { this._inkRipple.showWave(config) } else { this._inkRipple.hideWave(config) } }, _postprocessRenderItem: function(args) { this.callBase.apply(this, arguments); if (this.option("onItemSwipe")) { this._attachSwipeEvent($(args.itemElement)) } }, _attachSwipeEvent: function($itemElement) { var endEventName = eventUtils.addNamespace(swipeEvents.end, this.NAME); $itemElement.on(endEventName, $.proxy(this._itemSwipeEndHandler, this)) }, _itemSwipeEndHandler: function(e) { this._itemJQueryEventHandler(e, "onItemSwipe", { direction: e.offset < 0 ? "left" : "right" }) }, _nextButtonHandler: function() { var source = this._dataSource; if (source && !source.isLoading()) { this._scrollView.toggleLoading(true); this._$nextButton.detach(); this._loadIndicationSuppressed(true); this._loadNextPage() } }, _renderGroup: function(index, group) { var $groupElement = $("
").addClass(LIST_GROUP_CLASS).appendTo(this._itemContainer()); var $groupHeaderElement = $("
").addClass(LIST_GROUP_HEADER_CLASS).appendTo($groupElement); var groupTemplateName = this.option("groupTemplate"), groupTemplate = this._getTemplate(group.template || groupTemplateName, group, index, $groupHeaderElement), renderArgs = { index: index, itemData: group, container: $groupHeaderElement }; this._createItemByTemplate(groupTemplate, renderArgs); this._renderingGroupIndex = index; var $groupBody = $("
").addClass(LIST_GROUP_BODY_CLASS).appendTo($groupElement); $.each(groupItemsGetter(group) || [], $.proxy(function(index, item) { this._renderItem(index, item, $groupBody) }, this)); this._groupRenderAction({ groupElement: $groupElement, groupIndex: index, groupData: group }) }, _createGroupRenderAction: function() { this._groupRenderAction = this._createActionByOption("onGroupRendered") }, _clean: function() { if (this._$nextButton) { this._$nextButton.remove(); this._$nextButton = null } this.callBase.apply(this, arguments) }, _dispose: function() { clearTimeout(this._holdTimer); clearTimeout(this._loadNextPageTimer); clearTimeout(this._showLoadingIndicatorTimer); this.callBase() }, _toggleDisabledState: function(value) { this.callBase(value); this._scrollView.option("disabled", value || !this.option("scrollingEnabled")) }, _toggleNextButton: function(value) { var dataSource = this._dataSource, $nextButton = this._getNextButton(); this.element().toggleClass(LIST_HAS_NEXT_CLASS, value); if (value && dataSource && dataSource.isLoaded()) { $nextButton.appendTo(this._itemContainer()) } if (!value) { $nextButton.detach() } }, _getNextButton: function() { if (!this._$nextButton) { this._$nextButton = this._createNextButton() } return this._$nextButton }, _createNextButton: function() { var $result = $("
").addClass(LIST_NEXT_BUTTON_CLASS); var $button = $("
").appendTo($result); this._createComponent($button, Button, { text: this.option("nextButtonText"), onClick: $.proxy(this._nextButtonHandler, this), _templates: {} }); return $result }, _moveFocus: function(location) { this.callBase.apply(this, arguments); this.scrollToItem(this.option("focusedElement")) }, _optionChanged: function(args) { switch (args.name) { case "pageLoadMode": this._toggleNextButton(args.value); this._initScrollView(); break; case "showNextButton": this._toggleNextButton(args.value); break; case "dataSource": this.callBase(args); this._initScrollView(); break; case "pullingDownText": case "pulledDownText": case "refreshingText": case "pageLoadingText": case "useNative": case "showScrollbar": case "bounceEnabled": case "scrollByContent": case "scrollByThumb": case "scrollingEnabled": case "pullRefreshEnabled": case "autoPagingEnabled": this._initScrollView(); this._updateLoadingState(); break; case "nextButtonText": case "onItemSwipe": case "useInkRipple": this._invalidate(); break; case "onScroll": case "onPullRefresh": case "onPageLoading": this._createScrollViewActions(); this._invalidate(); break; case "grouped": case "collapsibleGroups": case "groupTemplate": this._invalidate(); break; case "onGroupRendered": this._createGroupRenderAction(); break; case "width": case "height": this.callBase(args); this._scrollView.update(); break; case "indicateLoading": this._hideLoadingIfLoadIndicationOff(); break; case "visible": this.callBase(args); this._scrollView.update(); break; case "rtlEnabled": this._initScrollView(); this.callBase(args); break; default: this.callBase(args) } }, _extendActionArgs: function($itemElement) { if (!this.option("grouped")) { return this.callBase($itemElement) } var $group = $itemElement.closest("." + LIST_GROUP_CLASS); var $item = $group.find("." + LIST_ITEM_CLASS); return $.extend(this.callBase($itemElement), { itemIndex: { group: $group.index(), item: $item.index($itemElement) } }) }, expandGroup: function(groupIndex) { var deferred = $.Deferred(), $group = this._itemContainer().find("." + LIST_GROUP_CLASS).eq(groupIndex); this._collapseGroupHandler($group, false).done($.proxy(function() { deferred.resolveWith(this) }, this)); return deferred.promise() }, collapseGroup: function(groupIndex) { var deferred = $.Deferred(), $group = this._itemContainer().find("." + LIST_GROUP_CLASS).eq(groupIndex); this._collapseGroupHandler($group, true).done($.proxy(function() { deferred.resolveWith(this) }, this)); return deferred }, updateDimensions: function() { var that = this, deferred = $.Deferred(); if (that._scrollView) { that._scrollView.update().done(function() { deferred.resolveWith(that) }) } else { deferred.resolveWith(that) } return deferred.promise() }, reload: function() { this.scrollTo(0); this._pullDownHandler() }, repaint: function() { this.scrollTo(0); this.callBase() }, scrollTop: function() { return this._scrollView.scrollOffset().top }, clientHeight: function() { return this._scrollView.clientHeight() }, scrollHeight: function() { return this._scrollView.scrollHeight() }, scrollBy: function(distance) { this._scrollView.scrollBy(distance) }, scrollTo: function(location) { this._scrollView.scrollTo(location) }, scrollToItem: function(itemElement) { var $item = this._editStrategy.getItemElement(itemElement); this._scrollView.scrollToElement($item) } }); module.exports = ListBase }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!********************************************************!*\ !*** ./Scripts/ui/scroll_view/ui.scrollable.native.js ***! \********************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), devices = __webpack_require__( /*! ../../core/devices */ 7), Class = __webpack_require__( /*! ../../core/class */ 5), Scrollbar = __webpack_require__( /*! ./ui.scrollbar */ 250); var SCROLLABLE_NATIVE = "dxNativeScrollable", SCROLLABLE_NATIVE_CLASS = "dx-scrollable-native", SCROLLABLE_SCROLLBAR_SIMULATED = "dx-scrollable-scrollbar-simulated", SCROLLABLE_SCROLLBARS_HIDDEN = "dx-scrollable-scrollbars-hidden", VERTICAL = "vertical", HORIZONTAL = "horizontal", HIDE_SCROLLBAR_TIMOUT = 500; var NativeStrategy = Class.inherit({ ctor: function(scrollable) { this._init(scrollable) }, _init: function(scrollable) { this._component = scrollable; this._$element = scrollable.element(); this._$container = scrollable._$container; this._$content = scrollable._$content; this._direction = scrollable.option("direction"); this._useSimulatedScrollbar = scrollable.option("useSimulatedScrollbar"); this._showScrollbar = scrollable.option("showScrollbar"); this.option = $.proxy(scrollable.option, scrollable); this._createActionByOption = $.proxy(scrollable._createActionByOption, scrollable); this._isLocked = $.proxy(scrollable._isLocked, scrollable); this._isDirection = $.proxy(scrollable._isDirection, scrollable); this._allowedDirection = $.proxy(scrollable._allowedDirection, scrollable) }, render: function() { var device = devices.real(), deviceType = device.platform; this._$element.addClass(SCROLLABLE_NATIVE_CLASS).addClass(SCROLLABLE_NATIVE_CLASS + "-" + deviceType).toggleClass(SCROLLABLE_SCROLLBARS_HIDDEN, !this._showScrollbar); if (this._showScrollbar && this._useSimulatedScrollbar) { this._renderScrollbars() } }, _renderScrollbars: function() { this._scrollbars = {}; this._hideScrollbarTimeout = 0; this._$element.addClass(SCROLLABLE_SCROLLBAR_SIMULATED); this._renderScrollbar(VERTICAL); this._renderScrollbar(HORIZONTAL) }, _renderScrollbar: function(direction) { if (!this._isDirection(direction)) { return } this._scrollbars[direction] = new Scrollbar($("
").appendTo(this._$element), { direction: direction, expandable: this._component.option("scrollByThumb") }) }, handleInit: $.noop, handleStart: function() { this._disablePushBack = true }, handleMove: function(e) { if (this._isLocked()) { e.cancel = true; return } if (this._allowedDirection()) { e.originalEvent.isScrollingEvent = true } }, handleEnd: function() { this._disablePushBack = false }, handleStop: $.noop, _eachScrollbar: function(callback) { callback = $.proxy(callback, this); $.each(this._scrollbars || {}, function(direction, scrollbar) { callback(scrollbar, direction) }) }, createActions: function() { this._scrollAction = this._createActionByOption("onScroll"); this._updateAction = this._createActionByOption("onUpdated") }, _createActionArgs: function() { var location = this.location(); return { jQueryEvent: this._eventForUserAction, scrollOffset: { top: -location.top, left: -location.left }, reachedLeft: this._isDirection(HORIZONTAL) ? location.left >= 0 : void 0, reachedRight: this._isDirection(HORIZONTAL) ? location.left <= this._containerSize.width - this._componentContentSize.width : void 0, reachedTop: this._isDirection(VERTICAL) ? location.top >= 0 : void 0, reachedBottom: this._isDirection(VERTICAL) ? location.top <= this._containerSize.height - this._componentContentSize.height : void 0 } }, handleScroll: function(e) { if (!this._isScrollLocationChanged()) { e.stopImmediatePropagation(); return } this._eventForUserAction = e; this._moveScrollbars(); this._scrollAction(this._createActionArgs()); this._lastLocation = this.location(); this._pushBackFromBoundary() }, _pushBackFromBoundary: function() { var pushBackValue = this.option("pushBackValue"); if (!pushBackValue || this._disablePushBack) { return } var scrollOffset = this._containerSize.height - this._contentSize.height, scrollTopPos = this._$container.scrollTop(), scrollBottomPos = scrollOffset + scrollTopPos - 2 * pushBackValue; if (!scrollTopPos) { this._$container.scrollTop(pushBackValue) } else { if (!scrollBottomPos) { this._$container.scrollTop(pushBackValue - scrollOffset) } } }, _isScrollLocationChanged: function() { var currentLocation = this.location(), lastLocation = this._lastLocation || {}, isTopChanged = lastLocation.top !== currentLocation.top, isLeftChanged = lastLocation.left !== currentLocation.left; return isTopChanged || isLeftChanged }, _moveScrollbars: function() { this._eachScrollbar(function(scrollbar) { scrollbar.moveTo(this.location()); scrollbar.option("visible", true) }); this._hideScrollbars() }, _hideScrollbars: function() { clearTimeout(this._hideScrollbarTimeout); this._hideScrollbarTimeout = setTimeout($.proxy(function() { this._eachScrollbar(function(scrollbar) { scrollbar.option("visible", false) }) }, this), HIDE_SCROLLBAR_TIMOUT) }, location: function() { return { left: -this._$container.scrollLeft(), top: this.option("pushBackValue") - this._$container.scrollTop() } }, disabledChanged: $.noop, update: function() { this._update(); this._updateAction(this._createActionArgs()) }, _update: function() { this._updateDimensions(); this._updateScrollbars() }, _updateDimensions: function() { this._containerSize = { height: this._$container.height(), width: this._$container.width() }; this._componentContentSize = { height: this._component.content().height(), width: this._component.content().width() }; this._contentSize = { height: this._$content.height(), width: this._$content.width() }; this._pushBackFromBoundary() }, _updateScrollbars: function() { this._eachScrollbar(function(scrollbar, direction) { var dimension = direction === VERTICAL ? "height" : "width"; scrollbar.option({ containerSize: this._containerSize[dimension], contentSize: this._componentContentSize[dimension] }); scrollbar.update() }) }, _allowedDirections: function() { return { vertical: this._isDirection(VERTICAL) && this._contentSize.height > this._containerSize.height, horizontal: this._isDirection(HORIZONTAL) && this._contentSize.width > this._containerSize.width } }, dispose: function() { this._$element.removeClass(function(index, className) { var scrollableNativeRegexp = new RegExp(SCROLLABLE_NATIVE_CLASS + "\\S*", "g"); if (scrollableNativeRegexp.test(className)) { return className.match(scrollableNativeRegexp).join(" ") } }); this._$element.off("." + SCROLLABLE_NATIVE); this._$container.off("." + SCROLLABLE_NATIVE); this._removeScrollbars(); clearTimeout(this._gestureEndTimer); clearTimeout(this._hideScrollbarTimeout) }, _removeScrollbars: function() { this._eachScrollbar(function(scrollbar) { scrollbar.element().remove() }) }, scrollBy: function(distance) { var location = this.location(); this._$container.scrollTop(-location.top - distance.top + this.option("pushBackValue")); this._$container.scrollLeft(-location.left - distance.left) }, validate: function() { return !this.option("disabled") && this._allowedDirection() }, getDirection: function() { return this._allowedDirection() } }); module.exports = NativeStrategy }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************!*\ !*** ./Scripts/client_exporter.js ***! \************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var fileSaver = __webpack_require__( /*! ./client_exporter/file_saver */ 197).fileSaver, _isFunction = __webpack_require__( /*! ./core/utils/common */ 2).isFunction; exports.export = function(data, options, getBlob) { if (!data) { return } var exportingAction = options.exportingAction, exportedAction = options.exportedAction, fileSavingAction = options.fileSavingAction, eventArgs = { fileName: options.fileName, format: options.format, cancel: false }; _isFunction(exportingAction) && exportingAction(eventArgs); if (!eventArgs.cancel) { getBlob(data, options, function(blob) { _isFunction(exportedAction) && exportedAction(); if (_isFunction(fileSavingAction)) { eventArgs.data = blob; fileSavingAction(eventArgs) } if (!eventArgs.cancel) { fileSaver.saveAs(eventArgs.fileName, options.format, blob, options.proxyUrl) } }) } }; exports.fileSaver = fileSaver; exports.excel = { creator: __webpack_require__( /*! ./client_exporter/excel_creator */ 111).ExcelCreator, getBlob: __webpack_require__( /*! ./client_exporter/excel_creator */ 111).getBlob, formatConverter: __webpack_require__( /*! ./client_exporter/excel_creator */ 111).excelFormatConverter }; exports.excel.__internals = __webpack_require__( /*! ./client_exporter/excel_creator */ 111).__internals; exports.image = { creator: __webpack_require__( /*! ./client_exporter/image_creator */ 139).imageCreator, getBlob: __webpack_require__( /*! ./client_exporter/image_creator */ 139).getBlob }; exports.pdf = { creator: __webpack_require__( /*! ./client_exporter/pdf_creator */ 198).pdfCreator, getBlob: __webpack_require__( /*! ./client_exporter/pdf_creator */ 198).getBlob }; exports.svg = { creator: __webpack_require__( /*! ./client_exporter/svg_creator */ 199).svgCreator, getBlob: __webpack_require__( /*! ./client_exporter/svg_creator */ 199).getBlob } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************************!*\ !*** ./Scripts/client_exporter/image_creator.js ***! \**************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var currentTspanY, clipPaths, textOffset, imageDeferreds, patterns, filters, $ = __webpack_require__( /*! jquery */ 1), Color = __webpack_require__( /*! ../color */ 55), _math = Math, PI = _math.PI, _min = _math.min, _abs = _math.abs, _sqrt = _math.sqrt, _pow = _math.pow, _atan2 = _math.atan2, _cos = _math.cos, _sin = _math.sin, _each = $.each, _extend = $.extend, _number = Number, IMAGE_QUALITY = 1, TEXT_DECORATION_LINE_WIDTH_COEFF = .05, DEFAULT_MARGIN_SIZE = { x: 30, y: 20 }, DEFAULT_FONT_SIZE = "10px", DEFAULT_FONT_FAMILY = "sans-serif", DEFAULT_TEXT_COLOR = "#000"; function createCanvas(width, height) { var canvas = $("")[0]; canvas.width = width + 2 * DEFAULT_MARGIN_SIZE.x; canvas.height = height + 2 * DEFAULT_MARGIN_SIZE.y; return canvas } function getStringFromCanvas(canvas, mimeType) { var dataURL = canvas.toDataURL(mimeType, IMAGE_QUALITY), imageData = atob(dataURL.substring(("data:" + mimeType + ";base64,").length)); return imageData } function arcTo(x1, y1, x2, y2, radius, largeArcFlag, clockwise, context) { var opSide, adjSide, centerX, centerY, startAngle, endAngle, cBx = (x1 + x2) / 2, cBy = (y1 + y2) / 2, aB = _atan2(y1 - y2, x1 - x2), k = largeArcFlag ? 1 : -1; aB += 90 * (PI / 180) * (clockwise ? 1 : -1); opSide = _sqrt(_pow(x2 - x1, 2) + _pow(y2 - y1, 2)) / 2; adjSide = _sqrt(_abs(_pow(radius, 2) - _pow(opSide, 2))); centerX = cBx + k * (adjSide * _cos(aB)); centerY = cBy + k * (adjSide * _sin(aB)); startAngle = _atan2(y1 - centerY, x1 - centerX); endAngle = _atan2(y2 - centerY, x2 - centerX); context.arc(centerX, centerY, radius, startAngle, endAngle, !clockwise) } function getElementOptions(element, isText) { var coords, attr = parseAttributes(element.attributes), style = element.style || {}, options = _extend({}, attr, { text: element.textContent, textAlign: "middle" === attr["text-anchor"] ? "center" : attr["text-anchor"] }), transform = attr.transform; if (transform) { coords = transform.match(/translate\(-*\d+([.]\d+)*(,*\s*-*\d+([.]\d+)*)*/); if (coords) { coords = coords[0].match(/-*\d+([.]\d+)*/g); options.translateX = _number(coords[0]); options.translateY = coords[1] ? _number(coords[1]) : 0 } coords = transform.match(/rotate\(-*\d+([.]\d+)*(,*\s*-*\d+([.]\d+)*,*\s*-*\d+([.]\d+)*)*/); if (coords) { coords = coords[0].match(/-*\d+([.]\d+)*/g); options.rotationAngle = _number(coords[0]); options.rotationX = coords[1] && _number(coords[1]); options.rotationY = coords[2] && _number(coords[2]) } } parseStyles(style, options, isText); isText && aggregateTextPosition(options); return options } function drawRect(context, options) { var x = options.x, y = options.y, width = options.width, height = options.height, cornerRadius = options.rx; if (!cornerRadius) { context.rect(options.x, options.y, options.width, options.height) } else { cornerRadius = _min(cornerRadius, width / 2, height / 2); context.save(); context.translate(x, y); context.moveTo(width / 2, 0); context.arcTo(width, 0, width, height, cornerRadius); context.arcTo(width, height, 0, height, cornerRadius); context.arcTo(0, height, 0, 0, cornerRadius); context.arcTo(0, 0, cornerRadius, 0, cornerRadius); context.lineTo(width / 2, 0); context.restore() } } function drawImage(context, options) { var d = $.Deferred(), image = new Image; image.onload = function() { context.save(); context.globalAlpha = options.globalAlpha; transformElement(context, options); clipElement(context, options); context.drawImage(image, options.x, options.y, options.width, options.height); context.restore(); d.resolve() }; image.onerror = function(e) { d.resolve() }; imageDeferreds.push(d); image.setAttribute("crossOrigin", "anonymous"); image.src = options["xlink:href"] } function drawPath(context, dAttr) { var param1, param2, dArray = dAttr.split(" "), i = 0; do { param1 = _number(dArray[i + 1]); param2 = _number(dArray[i + 2]); switch (dArray[i]) { case "M": context.moveTo(param1, param2); i += 3; break; case "L": context.lineTo(param1, param2); i += 3; break; case "C": context.bezierCurveTo(param1, param2, _number(dArray[i + 3]), _number(dArray[i + 4]), _number(dArray[i + 5]), _number(dArray[i + 6])); i += 7; break; case "A": arcTo(_number(dArray[i - 2]), _number(dArray[i - 1]), _number(dArray[i + 6]), _number(dArray[i + 7]), param1, _number(dArray[i + 4]), _number(dArray[i + 5]), context); i += 8; break; case "Z": context.closePath(); i += 1 } } while (i < dArray.length) } function parseStyles(style, options, isText) { _each(style, function(_, field) { if ("" !== style[field]) { options[$.camelCase(field)] = style[field] } }); options.textDecoration = options.textDecoration || options.textDecorationLine; options.globalAlpha = options.opacity || options.globalAlpha } function parseUrl(urlString) { return urlString.match(/\w+/g)[1] } function setFontStyle(context, options) { var fontParams = []; options.fontSize = options.fontSize || DEFAULT_FONT_SIZE; options.fontFamily || DEFAULT_FONT_FAMILY; options.fill = options.fill || DEFAULT_TEXT_COLOR; options.fontStyle && fontParams.push(options.fontStyle); options.fontWeight && fontParams.push(options.fontWeight); fontParams.push(options.fontSize); fontParams.push(options.fontFamily); context.font = fontParams.join(" "); context.textAlign = options.textAlign; context.fillStyle = options.fill; context.globalAlpha = options.globalAlpha } function drawText(context, options) { setFontStyle(context, options); options.text && context.fillText(options.text, options.x, options.y); strokeElement(context, options, true); drawTextDecoration(context, options); textOffset = options.x + context.measureText(options.text).width } function drawTextDecoration(context, options) { if (!options.textDecoration || "none" === options.textDecoration) { return } var x = options.x, align = options.textAlign, textWidth = context.measureText(options.text).width, textHeight = parseInt(options.fontSize, 10), lineHeight = textHeight * TEXT_DECORATION_LINE_WIDTH_COEFF < 1 ? 1 : textHeight * TEXT_DECORATION_LINE_WIDTH_COEFF, y = options.y; if ("center" === align) { x -= textWidth / 2 } else { if ("end" === align) { x -= textWidth } } switch (options.textDecoration) { case "line-through": y -= textHeight / 3 + lineHeight / 2; break; case "overline": y -= textHeight - lineHeight; break; case "underline": y += lineHeight } context.rect(x, y, textWidth, lineHeight); fillElement(context, options); strokeElement(context, options) } function createClipPath(element) { clipPaths[element.attributes.id.textContent] = element.childNodes[0] } function createPattern(element) { patterns[element.attributes.id.textContent] = element } function aggregateOpacity(options) { options.strokeOpacity = void 0 !== options["stroke-opacity"] ? options["stroke-opacity"] : 1; options.fillOpacity = void 0 !== options["fill-opacity"] ? options["fill-opacity"] : 1; if (void 0 !== options.opacity) { options.strokeOpacity *= options.opacity; options.fillOpacity *= options.opacity } } function aggregateTextPosition(options) { if (options.dy) { options.y = currentTspanY + _number(options.dy) } if (textOffset && void 0 === options.x) { options.x = textOffset } if (void 0 !== options.y) { currentTspanY = options.y } else { options.y = currentTspanY } } function drawElement(element, context, parentOptions) { var tagName = element.tagName, isText = "text" === tagName || "tspan" === tagName || void 0 === tagName, isImage = "image" === tagName, options = _extend({}, parentOptions, getElementOptions(element, isText)); if ("hidden" === options.visibility) { return } context.save(); !isImage && transformElement(context, options); clipElement(context, options); aggregateOpacity(options); context.beginPath(); switch (element.tagName) { case void 0: drawText(context, options); break; case "text": case "tspan": textOffset = 0; drawCanvasElements(element.childNodes, context, options); break; case "title": return; case "image": drawImage(context, options); break; case "path": drawPath(context, options.d); break; case "rect": drawRect(context, options); context.closePath(); break; case "circle": context.arc(options.cx, options.cy, options.r, 0, 2 * PI, 1) } applyFilter(context, options); if (!isText) { fillElement(context, options); strokeElement(context, options) } context.restore() } function applyFilter(context, options) { var filterOptions, matches = options.filter && options.filter.match(/url\(\#(.*)\)/); if (matches && matches[1]) { filterOptions = filters && filters[matches[1]]; if (!filterOptions) { filterOptions = { offsetX: 0, offsetY: 0, blur: 0, color: "#000" } } context.shadowOffsetX = filterOptions.offsetX; context.shadowOffsetY = filterOptions.offsetY; context.shadowColor = filterOptions.color; context.shadowBlur = filterOptions.blur } } function transformElement(context, options) { context.translate(options.translateX || 0, options.translateY || 0); delete options.translateX; delete options.translateY; if (options.rotationAngle) { context.translate(options.rotationX || 0, options.rotationY || 0); context.rotate(options.rotationAngle * PI / 180); context.translate(-(options.rotationX || 0), -(options.rotationY || 0)); delete options.rotationAngle; delete options.rotationX; delete options.rotationY } } function clipElement(context, options) { if (options["clip-path"]) { drawElement(clipPaths[parseUrl(options["clip-path"])], context, {}); context.clip(); delete options["clip-path"] } } function hex2rgba(hexColor, alpha) { var color = new Color(hexColor); return "rgba(" + color.r + "," + color.g + "," + color.b + "," + alpha + ")" } function createFilter(element) { var color, opacity, filterOptions = {}; _each(element.childNodes, function(_, node) { var attr = node.attributes; if (!attr.result) { return } switch (attr.result.value) { case "gaussianBlurResult": filterOptions.blur = _number(attr.stdDeviation.value); break; case "offsetResult": filterOptions.offsetX = _number(attr.dx.value); filterOptions.offsetY = _number(attr.dy.value); break; case "floodResult": color = attr["flood-color"] ? attr["flood-color"].value : "#000"; opacity = attr["flood-opacity"] ? attr["flood-opacity"].value : 1; filterOptions.color = hex2rgba(color, opacity) } }); filters[element.id] = filterOptions } function drawCanvasElements(elements, context, parentOptions) { var options; _each(elements, function(_, element) { switch (element.tagName && element.tagName.toLowerCase()) { case "g": options = _extend({}, parentOptions, getElementOptions(element)); context.save(); transformElement(context, options); clipElement(context, options); drawCanvasElements(element.childNodes, context, options); context.restore(); break; case "defs": clipPaths = {}; patterns = {}; filters = {}; drawCanvasElements(element.childNodes, context); break; case "clippath": createClipPath(element); break; case "pattern": createPattern(element); break; case "filter": createFilter(element); break; default: drawElement(element, context, parentOptions) } }) } function setLineDash(context, options) { var matches = options["stroke-dasharray"] && options["stroke-dasharray"].match(/(\d+)/g); if (matches && matches.length) { matches = $.map(matches, function(item) { return _number(item) }); context.setLineDash(matches) } } function strokeElement(context, options, isText) { var stroke = options.stroke; if (stroke && "none" !== stroke && 0 !== options["stroke-width"]) { setLineDash(context, options); context.lineJoin = options["stroke-linejoin"]; context.lineWidth = options["stroke-width"]; context.globalAlpha = options.strokeOpacity; context.strokeStyle = stroke; isText ? context.strokeText(options.text, options.x, options.y) : context.stroke() } } function getPattern(context, fill) { var pattern = patterns[parseUrl(fill)], options = getElementOptions(pattern), patternCanvas = createCanvas(options.width, options.height), patternContext = patternCanvas.getContext("2d"); drawCanvasElements(pattern.childNodes, patternContext, options); return context.createPattern(patternCanvas, "repeat") } function fillElement(context, options) { var fill = options.fill; if (fill && "none" !== fill) { context.fillStyle = -1 === fill.search(/url/) ? fill : getPattern(context, fill); context.globalAlpha = options.fillOpacity; context.fill() } } function parseAttributes(attributes) { var attr, newAttributes = {}; $.each(attributes, function(index, item) { attr = item.textContent; if (isFinite(attr)) { attr = _number(attr) } newAttributes[item.name.toLowerCase()] = attr }); return newAttributes } function drawBackground(context, width, height, backgroundColor) { context.fillStyle = backgroundColor || "#ffffff"; context.fillRect(-DEFAULT_MARGIN_SIZE.x, -DEFAULT_MARGIN_SIZE.y, width + 2 * DEFAULT_MARGIN_SIZE.x, height + 2 * DEFAULT_MARGIN_SIZE.y) } function getCanvasFromSvg(markup, width, height, backgroundColor) { var canvas = createCanvas(width, height), context = canvas.getContext("2d"), parser = new DOMParser, elem = parser.parseFromString(markup, "image/svg+xml"), svgElem = elem.childNodes[0]; context.translate(DEFAULT_MARGIN_SIZE.x, DEFAULT_MARGIN_SIZE.y); imageDeferreds = []; document.body.appendChild(canvas); if (svgElem.attributes.direction) { canvas.dir = svgElem.attributes.direction.textContent } drawBackground(context, width, height, backgroundColor); drawCanvasElements(svgElem.childNodes, context, {}); document.body.removeChild(canvas); return canvas } function resolveString(string, canvas, mimeType) { $.when.apply($, imageDeferreds).done(function() { var resultString = getStringFromCanvas(canvas, mimeType); string.resolve(resultString) }) } exports.imageCreator = { getImageData: function(markup, options) { var mimeType = "image/" + options.format, string = $.Deferred(), width = options.width, height = options.height, backgroundColor = options.backgroundColor; resolveString(string, getCanvasFromSvg(markup, width, height, backgroundColor), mimeType); return string }, getBlob: function(markup, options) { var blobSource, i, imageData = exports.imageCreator.getImageData(markup, options), mimeType = "image/" + options.format, blob = $.Deferred(); $.when(imageData).done(function(data) { blobSource = new Uint8Array(data.length); for (i = 0; i < data.length; i++) { blobSource[i] = data.charCodeAt(i) } blob.resolve(new Blob([blobSource.buffer], { type: mimeType })) }); return blob } }; exports.getBlob = function(data, options, callback) { exports.imageCreator.getBlob(data, options).done(callback) } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*********************************************!*\ !*** ./Scripts/core/memorized_callbacks.js ***! \*********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1); var MemorizedCallbacks = function() { var memory = []; var callbacks = $.Callbacks(); this.add = function(fn) { $.each(memory, function(_, item) { fn.apply(fn, item) }); callbacks.add(fn) }; this.remove = function(fn) { callbacks.remove(fn) }; this.fire = function() { memory.push(arguments); callbacks.fire.apply(callbacks, arguments) } }; module.exports = MemorizedCallbacks }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************!*\ !*** ./Scripts/core/remove_event.js ***! \**************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), cleanData = $.cleanData, specialEvents = $.event.special; var eventName = "dxremove", eventPropName = "dxRemoveEvent"; $.cleanData = function(elements) { for (var i = 0; i < elements.length; i++) { var $element = $(elements[i]); if ($element.prop(eventPropName)) { $element.removeProp(eventPropName); $element.triggerHandler(eventName) } } return cleanData(elements) }; specialEvents[eventName] = { noBubble: true, setup: function() { $(this).prop(eventPropName, true) } }; module.exports = eventName }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************************!*\ !*** ./Scripts/core/utils/public_component.js ***! \************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), WeakMap = __webpack_require__( /*! ./weak_map */ 268), commonUtils = __webpack_require__( /*! ./common */ 2), removeEvent = __webpack_require__( /*! ../remove_event */ 141); var COMPONENT_NAMES_DATA_KEY = "dxComponents", ANONYMOUS_COMPONENT_DATA_KEY = "dxPrivateComponent"; var componentNames = new WeakMap, nextAnonymousComponent = 0; exports.attachInstanceToElement = function($element, name, component, disposeFn) { var element = $element.get(0), data = $.data(element); disposeFn = disposeFn || $.noop; data[name] = component; $element.one(removeEvent, function() { disposeFn.call(component) }); if (!data[COMPONENT_NAMES_DATA_KEY]) { data[COMPONENT_NAMES_DATA_KEY] = [] } data[COMPONENT_NAMES_DATA_KEY].push(name) }; exports.getInstanceByElement = function(element, name) { element = $(element).get(0); return $.data(element, name) }; exports.getName = function(newName) { if (commonUtils.isDefined(newName)) { componentNames.set(this, newName); return } if (!componentNames.has(this)) { var generatedName = ANONYMOUS_COMPONENT_DATA_KEY + nextAnonymousComponent++; componentNames.set(this, generatedName); return generatedName } return componentNames.get(this) } }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*************************************!*\ !*** ./Scripts/core/utils/queue.js ***! \*************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), errors = __webpack_require__( /*! ../errors */ 10); function createQueue(discardPendingTasks) { var _tasks = [], _busy = false; function exec() { while (_tasks.length) { _busy = true; var task = _tasks.shift(), result = task(); if (void 0 === result) { continue } if (result.then) { $.when(result).always(exec); return } throw errors.Error("E0015") } _busy = false } function add(task, removeTaskCallback) { if (!discardPendingTasks) { _tasks.push(task) } else { if (_tasks[0] && removeTaskCallback) { removeTaskCallback(_tasks[0]) } _tasks = [task] } if (!_busy) { exec() } } function busy() { return _busy } return { add: add, busy: busy } } exports.create = createQueue; exports.enqueue = createQueue().add }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************************!*\ !*** ./Scripts/data/query_adapters.js ***! \****************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var queryAdapters = {}; module.exports = queryAdapters }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************!*\ !*** ./Scripts/framework/command.js ***! \**************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), errors = __webpack_require__( /*! ./errors */ 44), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 3), DOMComponent = __webpack_require__( /*! ../core/dom_component */ 39); __webpack_require__( /*! ../integration/knockout */ 85); var Command = DOMComponent.inherit({ ctor: function(element, options) { if ($.isPlainObject(element)) { options = element; element = $("
") } this.callBase(element, options) }, _setDeprecatedOptions: function() { this.callBase(); $.extend(this._deprecatedOptions, { iconSrc: { since: "15.1", alias: "icon" } }) }, _getDefaultOptions: function() { return $.extend(this.callBase(), { onExecute: null, id: null, title: "", icon: "", visible: true, disabled: false, renderStage: "onViewShown" }) }, execute: function() { var isDisabled = this._options.disabled; if ($.isFunction(isDisabled)) { isDisabled = !!isDisabled.apply(this, arguments) } if (isDisabled) { throw errors.Error("E3004", this._options.id) } this.fireEvent("beforeExecute", arguments); this._createActionByOption("onExecute").apply(this, arguments); this.fireEvent("afterExecute", arguments) }, _render: function() { this.callBase(); this.element().addClass("dx-command") }, _renderDisabledState: $.noop, _dispose: function() { this.callBase(); this.element().removeData(this.NAME) } }); registerComponent("dxCommand", Command); module.exports = Command }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**********************************************!*\ !*** ./Scripts/framework/command_mapping.js ***! \**********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../core/class */ 5), errors = __webpack_require__( /*! ./errors */ 44); var CommandMapping = Class.inherit({ ctor: function() { this._commandMappings = {}; this._containerDefaults = {} }, setDefaults: function(containerId, defaults) { this._containerDefaults[containerId] = defaults; return this }, mapCommands: function(containerId, commandMappings) { var that = this; $.each(commandMappings, function(index, commandMapping) { if ("string" === typeof commandMapping) { commandMapping = { id: commandMapping } } var commandId = commandMapping.id; var mappings = that._commandMappings[containerId] || {}; mappings[commandId] = $.extend({ showIcon: true, showText: true }, that._containerDefaults[containerId] || {}, commandMapping); that._commandMappings[containerId] = mappings }); this._initExistingCommands(); return this }, unmapCommands: function(containerId, commandIds) { var that = this; $.each(commandIds, function(index, commandId) { var mappings = that._commandMappings[containerId] || {}; if (mappings) { delete mappings[commandId] } }); this._initExistingCommands() }, getCommandMappingForContainer: function(commandId, containerId) { return (this._commandMappings[containerId] || {})[commandId] }, checkCommandsExist: function(commands) { var that = this, result = $.grep(commands, function(commandName, index) { return $.inArray(commandName, that._existingCommands) < 0 && $.inArray(commandName, commands) === index }); if (0 !== result.length) { throw errors.Error("E3005", result.join("', '"), 1 === result.length ? " is" : "s are") } }, load: function(config) { if (!config) { return } var that = this; $.each(config, function(name, container) { that.setDefaults(name, container.defaults); that.mapCommands(name, container.commands) }); return this }, _initExistingCommands: function() { var that = this; this._existingCommands = []; $.each(that._commandMappings, function(name, _commands) { $.each(_commands, function(index, command) { if ($.inArray(command.id, that._existingCommands) < 0) { that._existingCommands.push(command.id) } }) }) } }); CommandMapping.defaultMapping = { "global-navigation": { defaults: { showIcon: true, showText: true }, commands: [] }, "ios-header-toolbar": { defaults: { showIcon: false, showText: true, location: "after" }, commands: ["edit", "save", { id: "back", location: "before" }, { id: "cancel", location: "before" }, { id: "create", showIcon: true, showText: false }] }, "ios-action-sheet": { defaults: { showIcon: false, showText: true }, commands: [] }, "ios-view-footer": { defaults: { showIcon: false, showText: true }, commands: [{ id: "delete", type: "danger" }] }, "android-header-toolbar": { defaults: { showIcon: true, showText: false, location: "after" }, commands: [{ id: "back", showIcon: false, location: "before" }, "create", { id: "save", showText: true, showIcon: false, location: "after" }, { id: "edit", showText: false, location: "after" }, { id: "cancel", showText: false, location: "before" }, { id: "delete", showText: false, location: "after" }] }, "android-simple-toolbar": { defaults: { showIcon: true, showText: false, location: "after" }, commands: [{ id: "back", showIcon: false, location: "before" }, { id: "create" }, { id: "save", showText: true, showIcon: false, location: "after" }, { id: "edit", showText: false, location: "after" }, { id: "cancel", showText: false, location: "before" }, { id: "delete", showText: false, location: "after" }] }, "android-footer-toolbar": { defaults: { location: "after" }, commands: [{ id: "create", showText: false, location: "center" }, { id: "edit", showText: false, location: "before" }, { id: "delete", locateInMenu: "always" }, { id: "save", showIcon: false, location: "before" }] }, "generic-header-toolbar": { defaults: { showIcon: false, showText: true, location: "after" }, commands: ["edit", "save", { id: "back", location: "before" }, { id: "cancel", location: "before" }, { id: "create", showIcon: true, showText: false }] }, "generic-view-footer": { defaults: { showIcon: false, showText: true }, commands: [{ id: "delete", type: "danger" }] }, "win8-appbar": { defaults: { location: "after" }, commands: ["edit", "cancel", "save", "delete", { id: "create", location: "before" }, { id: "refresh", location: "before" }] }, "win8-toolbar": { defaults: { showText: false, location: "before" }, commands: [{ id: "previousPage" }] }, "win8-phone-appbar": { defaults: { location: "center" }, commands: ["create", "edit", "cancel", "save", "refresh", { id: "delete", locateInMenu: "always" }] }, "win8-split-toolbar": { defaults: { showIcon: true, showText: false, location: "after" }, commands: [{ id: "back", showIcon: false, location: "before" }, { id: "create" }, { id: "save", showText: true, location: "before" }, { id: "edit", showText: true, locateInMenu: "always" }, { id: "cancel", showText: true, locateInMenu: "always" }, { id: "delete", showText: true, locateInMenu: "always" }] }, "win8-master-detail-toolbar": { defaults: { showText: false, location: "before" }, commands: ["back"] }, "win10-appbar": { defaults: { showText: false, location: "after" }, commands: [{ id: "back", location: "before" }, "edit", "cancel", "save", "delete", "create", "refresh"] }, "win10-phone-appbar": { defaults: { location: "after" }, commands: ["create", "edit", "cancel", "save", "refresh", { id: "delete", locateInMenu: "always" }] }, "desktop-toolbar": { defaults: { showIcon: false, showText: true, location: "after" }, commands: ["cancel", "create", "edit", "save", { id: "delete", type: "danger" }] } }; module.exports = CommandMapping }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************************************!*\ !*** ./Scripts/framework/html/command_container.js ***! \*****************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), MarkupComponent = __webpack_require__( /*! ./markup_component */ 149).MarkupComponent, registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 3); __webpack_require__( /*! ../../integration/knockout */ 85); var CommandContainer = MarkupComponent.inherit({ ctor: function(element, options) { if ($.isPlainObject(element)) { options = element; element = $("
") } this.callBase(element, options) }, _setDefaultOptions: function() { this.callBase(); this.option({ id: null }) }, _render: function() { this.callBase(); this.element().addClass("dx-command-container") } }); registerComponent("dxCommandContainer", CommandContainer); module.exports = CommandContainer }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*****************************************************!*\ !*** ./Scripts/framework/html/layout_controller.js ***! \*****************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../../core/class */ 5), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), frameworkUtils = __webpack_require__( /*! ../utils */ 84), layoutSets = __webpack_require__( /*! ./presets */ 114).layoutSets, EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 32), errors = __webpack_require__( /*! ../errors */ 44), domUtils = __webpack_require__( /*! ../../core/utils/dom */ 11), HIDDEN_BAG_ID = "__hidden-bag", TRANSITION_SELECTOR = ".dx-transition:not(.dx-transition .dx-transition)", CONTENT_SELECTOR = ".dx-content", DEFAULT_COMMAND_RENDER_STAGE = "onViewShown", CONTENT_RENDERED_EVENT_NAME = "dxcontentrendered.layoutController", PENDING_RENDERING_SELECTOR = ".dx-pending-rendering", PENDING_RENDERING_MANUAL_SELECTOR = ".dx-pending-rendering-manual", TransitionExecutorModule = __webpack_require__( /*! ../../animation/transition_executor/transition_executor */ 91); __webpack_require__( /*! ./command_container */ 147); __webpack_require__( /*! ./view_engine_components */ 45); var transitionSelector = function(transitionName) { return ".dx-transition-" + transitionName }; var DefaultLayoutController = Class.inherit({ ctor: function(options) { options = options || {}; this.name = options.name || ""; this._layoutModel = options.layoutModel || {}; this._defaultPaneName = options.defaultPaneName || "content"; this._transitionDuration = void 0 === options.transitionDuration ? 400 : options.transitionDuration; this._showViewFired = false }, init: function(options) { options = options || {}; this._visibleViews = {}; this._$viewPort = options.$viewPort || $("body"); this._commandManager = options.commandManager; this._viewEngine = options.viewEngine; this.transitionExecutor = new TransitionExecutorModule.TransitionExecutor; this._prepareTemplates(); this._$viewPort.append(this.element()); this._hideElements(this.element()); if (options.templateContext) { this._templateContext = options.templateContext; this._proxiedTemplateContextChangedHandler = $.proxy(this._templateContextChangedHandler, this) } }, ensureActive: function(targetNode) { if (this._disabledState) { return this.enable() } else { return this.activate(targetNode) } }, activate: function() { this._showViewFired = false; var $rootElement = this.element(); this._showElements($rootElement); this._attachRefreshViewRequiredHandler(); return $.Deferred().resolve().promise() }, deactivate: function() { this._disabledState = false; this._showViewFired = false; this._releaseVisibleViews(); this._hideElements(this.element()); this._detachRefreshViewRequiredHandler(); return $.Deferred().resolve().promise() }, enable: function() { this._disabledState = false; if (!this._showViewFired) { this._notifyShowing() } this._showViewFired = false; return $.Deferred().resolve().promise() }, disable: function() { this._disabledState = true; this._showViewFired = false; this._notifyHidden() }, activeViewInfo: function() { return this._visibleViews[this._defaultPaneName] }, _fireViewEvents: function(eventName) { var that = this; $.each(this._visibleViews, function(index, viewInfo) { that.fireEvent(eventName, [viewInfo]) }) }, _notifyShowing: function() { this._fireViewEvents("viewShowing") }, _notifyShown: function() { this._fireViewEvents("viewShown") }, _notifyHidden: function() { this._fireViewEvents("viewHidden") }, _applyTemplate: function($elements, model) { $elements.each(function(i, element) { frameworkUtils.templateProvider.applyTemplate(element, model) }) }, _releaseVisibleViews: function() { var that = this; $.each(this._visibleViews, function(index, viewInfo) { that._hideView(viewInfo); that._releaseView(viewInfo) }); this._visibleViews = {} }, _templateContextChangedHandler: function() { var that = this; $.when.apply($, $.map(that._visibleViews, function(viewInfo) { return that.showView(viewInfo) })).then(function() { that._notifyShown() }) }, _attachRefreshViewRequiredHandler: function() { if (this._templateContext) { this._templateContext.on("optionChanged", this._proxiedTemplateContextChangedHandler) } }, _detachRefreshViewRequiredHandler: function() { if (this._templateContextChanged) { this._templateContext.off("optionChanged", this._proxiedTemplateContextChangedHandler) } }, _getPreviousViewInfo: function(viewInfo) { return this._visibleViews[this._getViewPaneName(viewInfo.viewTemplateInfo)] }, _prepareTemplates: function() { var that = this; var $layoutTemplate = that._viewEngine.getLayoutTemplate(this._getLayoutTemplateName()); that._$layoutTemplate = $layoutTemplate; that._$mainLayout = that._createEmptyLayout(); that._showElements(that._$mainLayout); that._applyTemplate(that._$mainLayout, that._layoutModel); that._$navigationWidget = that._createNavigationWidget() }, renderNavigation: function(navigationCommands) { this._clearNavigationWidget(); this._renderNavigationImpl(navigationCommands) }, _renderNavigationImpl: function(navigationCommands) { this._renderCommands(this._$mainLayout, navigationCommands) }, _createNavigationWidget: function() { var result, containers = this._findCommandContainers(this._$mainLayout); $.each(containers, function(k, container) { if ("global-navigation" === container.option("id")) { result = container.element(); return false } }); return result }, _clearNavigationWidget: function() { if (this._$navigationWidget) { this._commandManager.clearContainer(this._$navigationWidget.dxCommandContainer("instance")) } }, element: function() { return this._$mainLayout }, _getViewFrame: function(viewInfo) { return this._$mainLayout }, _getLayoutTemplateName: function() { return this.name }, _applyModelToTransitionElements: function($markup, model) { var that = this; this._getTransitionElements($markup).each(function(i, item) { that._applyTemplate($(item).children(), model) }) }, _createViewLayoutTemplate: function() { var that = this; var $viewLayoutTemplate = that._$layoutTemplate.clone(); this._hideElements($viewLayoutTemplate); return $viewLayoutTemplate }, _createEmptyLayout: function() { var that = this; var $result = that._$layoutTemplate.clone(); this._hideElements($result); this._getTransitionElements($result).empty(); $result.children(CONTENT_SELECTOR).remove(); return $result }, _getTransitionElements: function($markup) { return $markup.find(TRANSITION_SELECTOR).addBack(TRANSITION_SELECTOR) }, showView: function(viewInfo, direction) { direction = direction || "forward"; var result, that = this, previousViewInfo = that._getPreviousViewInfo(viewInfo), previousViewTemplateId = previousViewInfo === viewInfo ? previousViewInfo.currentViewTemplateId : void 0; this._showViewFired = true; this._defineCurrentViewTemplateId(viewInfo); if (previousViewTemplateId && previousViewTemplateId === viewInfo.currentViewTemplateId && viewInfo === previousViewInfo) { that.fireEvent("viewShowing", [viewInfo, direction]); result = $.Deferred().resolve().promise() } else { that._ensureViewRendered(viewInfo); that.fireEvent("viewShowing", [viewInfo, direction]); result = this._showViewImpl(viewInfo, direction, previousViewTemplateId).done(function() { that._onViewShown(viewInfo) }) } return result }, disposeView: function(viewInfo) { this._clearRenderResult(viewInfo) }, _clearRenderResult: function(viewInfo) { if (viewInfo.renderResult) { viewInfo.renderResult.$markup.remove(); viewInfo.renderResult.$viewItems.remove(); delete viewInfo.renderResult } }, _renderViewImpl: function($viewTemplate, viewInfo) { var $viewItems, that = this, allowedChildrenSelector = ".dx-command,.dx-content,script", $layout = this._createViewLayoutTemplate(), isSimplifiedMarkup = true, outOfContentItems = $(); if (0 === $viewTemplate.children(allowedChildrenSelector).length) { this._viewEngine._wrapViewDefaultContent($viewTemplate) } $viewItems = $viewTemplate.children(); this._applyModelToTransitionElements($layout, viewInfo.model); this._viewEngine.applyLayout($viewTemplate, $layout); $viewItems.each(function(i, item) { var $item = $(item); that._applyTemplate($item, viewInfo.model); if ($item.is(allowedChildrenSelector)) { isSimplifiedMarkup = false } else { outOfContentItems = outOfContentItems.add($item) } }); if (outOfContentItems.length && !isSimplifiedMarkup) { throw errors.Error("E3014", outOfContentItems[0].outerHTML) } viewInfo.renderResult = viewInfo.renderResult || {}; viewInfo.renderResult.$viewItems = $viewItems; viewInfo.renderResult.$markup = $layout }, _renderCommands: function($markup, commands) { var commandContainers = this._findCommandContainers($markup); return this._commandManager.renderCommandsToContainers(commands, commandContainers) }, _prepareViewCommands: function(viewInfo) { var $viewItems = viewInfo.renderResult.$viewItems, viewCommands = this._commandManager.findCommands($viewItems), commandsToRenderMap = {}; viewInfo.commands = frameworkUtils.utils.mergeCommands(viewInfo.commands || [], viewCommands); viewInfo.commandsToRenderMap = commandsToRenderMap; $.each(viewInfo.commands, function(index, command) { var renderStage = command.option("renderStage") || DEFAULT_COMMAND_RENDER_STAGE, targetArray = commandsToRenderMap[renderStage] = commandsToRenderMap[renderStage] || []; targetArray.push(command) }) }, _applyViewCommands: function(viewInfo, renderStage) { renderStage = renderStage || DEFAULT_COMMAND_RENDER_STAGE; var result, commandsToRender = viewInfo.commandsToRenderMap[renderStage], $markup = viewInfo.renderResult.$markup; if (commandsToRender) { result = this._renderCommands($markup, commandsToRender); delete viewInfo.commandsToRenderMap[renderStage] } else { result = $.Deferred().resolve().promise() } return result }, _findCommandContainers: function($markup) { return domUtils.createComponents($markup, ["dxCommandContainer"]) }, _defineCurrentViewTemplateId: function(viewInfo) { var viewTemplateInstance = viewInfo.$viewTemplate ? viewInfo.$viewTemplate.dxView("instance") : this._viewEngine.getViewTemplateInfo(viewInfo.viewName), currentViewTemplateId = viewTemplateInstance.getId(); viewInfo.currentViewTemplateId = currentViewTemplateId }, _ensureViewRendered: function(viewInfo) { var $cachedMarkup = viewInfo.renderResult && viewInfo.renderResult.markupCache[viewInfo.currentViewTemplateId]; if ($cachedMarkup) { viewInfo.renderResult.$markup = $cachedMarkup } else { this._renderView(viewInfo); viewInfo.renderResult.markupCache = viewInfo.renderResult.markupCache || {}; viewInfo.renderResult.markupCache[viewInfo.currentViewTemplateId] = viewInfo.renderResult.$markup } }, _renderView: function(viewInfo) { var $viewTemplate = viewInfo.$viewTemplate || this._viewEngine.getViewTemplate(viewInfo.viewName); this._renderViewImpl($viewTemplate, viewInfo); this._prepareViewCommands(viewInfo); this._applyViewCommands(viewInfo, "onViewRendering"); this._appendViewToLayout(viewInfo); $viewTemplate.remove(); this._onRenderComplete(viewInfo); this.fireEvent("viewRendered", [viewInfo]) }, _prepareTransition: function($element, targetPlaceholderName) { if (0 === $element.children(".dx-content").length) { $element.wrapInner("
"); $element.children().dxContent({ targetPlaceholder: targetPlaceholderName }) } }, _appendViewToLayout: function(viewInfo) { var that = this, $viewFrame = that._getViewFrame(viewInfo), $markup = viewInfo.renderResult.$markup, $transitionContentElements = $(), animationItems = []; $.each($markup.find(".dx-content-placeholder"), function(index, el) { that._prepareTransition($(el), $(el).attr("data-dx-content-placeholder-name")) }); $.each(that._getTransitionElements($viewFrame), function(index, transitionElement) { var $transition = $(transitionElement), $viewElement = $markup.find(transitionSelector($transition.attr("data-dx-transition-name"))).children(), animationItem = { $element: $viewElement, animation: $transition.attr("data-dx-transition-type") }; animationItems.push(animationItem); $transition.append($viewElement); that._showViewElements($viewElement); domUtils.triggerShownEvent($viewElement); $transitionContentElements = $transitionContentElements.add($viewElement) }); that._$mainLayout.append(viewInfo.renderResult.$viewItems.filter(".dx-command")); $markup.remove(); viewInfo.renderResult.$markup = $transitionContentElements; viewInfo.renderResult.animationItems = animationItems }, _onRenderComplete: function(viewInfo) {}, _onViewShown: function(viewInfo) { $(document).trigger("dx.viewchanged") }, _enter: function(animationItems, animationModifier) { var transitionExecutor = this.transitionExecutor; $.each(animationItems, function(index, item) { transitionExecutor.enter(item.$element, item.animation, animationModifier) }) }, _leave: function(animationItems, animationModifier) { var transitionExecutor = this.transitionExecutor; $.each(animationItems, function(index, item) { transitionExecutor.leave(item.$element, item.animation, animationModifier) }) }, _doTransition: function(oldViewInfo, newViewInfo, animationModifier) { if (oldViewInfo) { this._leave(oldViewInfo.renderResult.animationItems, animationModifier) } this._enter(newViewInfo.renderResult.animationItems, animationModifier); this._showView(newViewInfo); return this.transitionExecutor.start() }, _showViewImpl: function(viewInfo, direction, previousViewTemplateId) { var result, that = this, previousViewInfo = this._getPreviousViewInfo(viewInfo), animationModifier = { direction: direction }; if (previousViewInfo === viewInfo) { previousViewInfo = void 0 } if (!previousViewInfo) { animationModifier.duration = 0; animationModifier.delay = 0 } result = that._doTransition(previousViewInfo, viewInfo, animationModifier).then(function() { return that._changeView(viewInfo, previousViewTemplateId) }); return result }, _releaseView: function(viewInfo) { this.fireEvent("viewReleased", [viewInfo]) }, _getReadyForRenderDeferredItems: function(viewInfo) { return $.Deferred().resolve().promise() }, _changeView: function(viewInfo, previousViewTemplateId) { var that = this; if (previousViewTemplateId) { that._hideView(viewInfo, previousViewTemplateId) } else { var previousViewInfo = that._getPreviousViewInfo(viewInfo); if (previousViewInfo && previousViewInfo !== viewInfo) { that._hideView(previousViewInfo); that._releaseView(previousViewInfo) } this._visibleViews[this._getViewPaneName(viewInfo.viewTemplateInfo)] = viewInfo } this._subscribeToDeferredItems(viewInfo); return this._getReadyForRenderDeferredItems(viewInfo).then(function() { return that._applyViewCommands(viewInfo) }).then(function() { return that._renderDeferredItems(viewInfo.renderResult.$markup) }) }, _subscribeToDeferredItems: function(viewInfo) { var that = this, $markup = viewInfo.renderResult.$markup; $markup.find(PENDING_RENDERING_SELECTOR).add($markup.filter(PENDING_RENDERING_SELECTOR)).each(function() { var eventData = { viewInfo: viewInfo, context: that }; $(this).on(CONTENT_RENDERED_EVENT_NAME, eventData, that._onDeferredContentRendered) }) }, _onDeferredContentRendered: function(event) { var $element = $(event.target), viewInfo = event.data.viewInfo, that = event.data.context; $element.off(CONTENT_RENDERED_EVENT_NAME, that._onDeferredContentRendered); that._renderCommands($element, viewInfo.commands) }, _renderDeferredItems: function($items) { var that = this, result = $.Deferred(); var $pendingItem = $items.find(PENDING_RENDERING_MANUAL_SELECTOR).add($items.filter(PENDING_RENDERING_MANUAL_SELECTOR)).first(); if ($pendingItem.length) { var render = $pendingItem.data("dx-render-delegate"); commonUtils.executeAsync(function() { render().then(function() { return that._renderDeferredItems($items) }).then(function() { result.resolve() }) }) } else { result.resolve() } return result.promise() }, _getViewPaneName: function(viewTemplateInfo) { return this._defaultPaneName }, _hideElements: function($elements) { $elements.addClass("dx-fast-hidden") }, _showElements: function($elements) { $elements.removeClass("dx-fast-hidden") }, _hideViewElements: function($elements) { this._patchIDs($elements); this._disableInputs($elements); $elements.removeClass("dx-active-view").addClass("dx-inactive-view") }, _hideView: function(viewInfo, templateId) { if (viewInfo.renderResult) { var $markupToHide = void 0 === templateId ? viewInfo.renderResult.$markup : viewInfo.renderResult.markupCache[templateId]; this._hideViewElements($markupToHide); this.fireEvent("viewHidden", [viewInfo]) } }, _showViewElements: function($elements) { this._unpatchIDs($elements); this._enableInputs($elements); $elements.removeClass("dx-inactive-view").addClass("dx-active-view"); this._skipAnimation($elements) }, _showView: function(viewInfo) { if (viewInfo.renderResult) { this._showViewElements(viewInfo.renderResult.$markup) } }, _skipAnimation: function($elements) { $elements.addClass("dx-skip-animation"); for (var i = 0; i < $elements.length; i++) { $elements.eq(i).css("transform") } $elements.removeClass("dx-skip-animation") }, _patchIDs: function($markup) { this._processIDs($markup, function(id) { var result = id; if (-1 === id.indexOf(HIDDEN_BAG_ID)) { result = HIDDEN_BAG_ID + "-" + id } return result }) }, _unpatchIDs: function($markup) { this._processIDs($markup, function(id) { var result = id; if (0 === id.indexOf(HIDDEN_BAG_ID)) { result = id.substr(HIDDEN_BAG_ID.length + 1) } return result }) }, _processIDs: function($markup, process) { var elementsWithIds = $markup.find("[id]"); $.each(elementsWithIds, function(index, element) { var $el = $(element), id = $el.attr("id"); $el.attr("id", process(id)) }) }, _enableInputs: function($markup) { var $inputs = $markup.find(":input[data-disabled=true]"); $.each($inputs, function(index, input) { $(input).removeAttr("disabled").removeAttr("data-disabled") }) }, _disableInputs: function($markup) { var $inputs = $markup.find(":input:not([disabled], [disabled=true])"); $.each($inputs, function(index, input) { $(input).attr({ disabled: true, "data-disabled": true }) }) } }).include(EventsMixin); layoutSets.default = layoutSets.default || []; layoutSets.default.push({ controller: new DefaultLayoutController }); exports.DefaultLayoutController = DefaultLayoutController; exports.layoutSets = layoutSets }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************************************!*\ !*** ./Scripts/framework/html/markup_component.js ***! \****************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Class = __webpack_require__( /*! ../../core/class */ 5), publicComponentUtils = __webpack_require__( /*! ../../core/utils/public_component */ 142); var MarkupComponent = Class.inherit({ ctor: function(element, options) { this.NAME = this.constructor.publicName(); options = options || {}; this._$element = $(element); publicComponentUtils.attachInstanceToElement(this._$element, this.NAME, this, this._dispose); if (options.fromCache) { this._options = options } else { this._options = {}; this._setDefaultOptions(); if (options) { this.option(options) } this._render() } }, _setDefaultOptions: $.noop, _render: $.noop, _dispose: $.noop, element: function() { return this._$element }, option: function(name, value) { if (0 === arguments.length) { return this._options } else { if (1 === arguments.length) { if ("string" === typeof name) { return this._options[name] } else { value = name; $.extend(this._options, value) } } else { this._options[name] = value } } }, instance: function() { return this } }); MarkupComponent.publicName = publicComponentUtils.getName; MarkupComponent.getInstance = function($element) { return publicComponentUtils.getInstanceByElement($element, this.publicName()) }; exports.MarkupComponent = MarkupComponent }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!********************************************!*\ !*** ./Scripts/framework/state_manager.js ***! \********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var Class = __webpack_require__( /*! ../core/class */ 5), $ = __webpack_require__( /*! jquery */ 1); var MemoryKeyValueStorage = Class.inherit({ ctor: function() { this.storage = {} }, getItem: function(key) { return this.storage[key] }, setItem: function(key, value) { this.storage[key] = value }, removeItem: function(key) { delete this.storage[key] } }); var StateManager = Class.inherit({ ctor: function(options) { options = options || {}; this.storage = options.storage || new MemoryKeyValueStorage; this.stateSources = options.stateSources || [] }, addStateSource: function(stateSource) { this.stateSources.push(stateSource) }, removeStateSource: function(stateSource) { var index = $.inArray(stateSource, this.stateSources); if (index > -1) { this.stateSources.splice(index, 1); stateSource.removeState(this.storage) } }, saveState: function() { var that = this; $.each(this.stateSources, function(index, stateSource) { stateSource.saveState(that.storage) }) }, restoreState: function() { var that = this; $.each(this.stateSources, function(index, stateSource) { stateSource.restoreState(that.storage) }) }, clearState: function() { var that = this; $.each(this.stateSources, function(index, stateSource) { stateSource.removeState(that.storage) }) } }); module.exports = StateManager; module.exports.MemoryKeyValueStorage = MemoryKeyValueStorage }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***********************************************!*\ !*** ./Scripts/integration/angular/module.js ***! \***********************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { module.exports = window.angular.module("dx", ["ngSanitize"]) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!**************************************************!*\ !*** ./Scripts/localization/globalize/number.js ***! \**************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { __webpack_require__( /*! ./core */ 86); var Globalize = __webpack_require__( /*! globalize */ 46), numberLocalization = __webpack_require__( /*! ../number */ 38), errors = __webpack_require__( /*! ../../core/errors */ 10); __webpack_require__( /*! globalize/number */ 46); if (!Globalize || !Globalize.formatNumber) { return } var enNumbers = { main: { en: { identity: { version: { _cldrVersion: "28", _number: "$Revision: 11972 $" }, language: "en" }, numbers: { defaultNumberingSystem: "latn", otherNumberingSystems: { "native": "latn" }, minimumGroupingDigits: "1", "symbols-numberSystem-latn": { decimal: ".", group: ",", list: ";", percentSign: "%", plusSign: "+", minusSign: "-", exponential: "E", superscriptingExponent: "×", perMille: "‰", infinity: "∞", nan: "NaN", timeSeparator: ":" }, "decimalFormats-numberSystem-latn": { standard: "#,##0.###", "long": { decimalFormat: { "1000-count-one": "0 thousand", "1000-count-other": "0 thousand", "10000-count-one": "00 thousand", "10000-count-other": "00 thousand", "100000-count-one": "000 thousand", "100000-count-other": "000 thousand", "1000000-count-one": "0 million", "1000000-count-other": "0 million", "10000000-count-one": "00 million", "10000000-count-other": "00 million", "100000000-count-one": "000 million", "100000000-count-other": "000 million", "1000000000-count-one": "0 billion", "1000000000-count-other": "0 billion", "10000000000-count-one": "00 billion", "10000000000-count-other": "00 billion", "100000000000-count-one": "000 billion", "100000000000-count-other": "000 billion", "1000000000000-count-one": "0 trillion", "1000000000000-count-other": "0 trillion", "10000000000000-count-one": "00 trillion", "10000000000000-count-other": "00 trillion", "100000000000000-count-one": "000 trillion", "100000000000000-count-other": "000 trillion" } }, "short": { decimalFormat: { "1000-count-one": "0K", "1000-count-other": "0K", "10000-count-one": "00K", "10000-count-other": "00K", "100000-count-one": "000K", "100000-count-other": "000K", "1000000-count-one": "0M", "1000000-count-other": "0M", "10000000-count-one": "00M", "10000000-count-other": "00M", "100000000-count-one": "000M", "100000000-count-other": "000M", "1000000000-count-one": "0B", "1000000000-count-other": "0B", "10000000000-count-one": "00B", "10000000000-count-other": "00B", "100000000000-count-one": "000B", "100000000000-count-other": "000B", "1000000000000-count-one": "0T", "1000000000000-count-other": "0T", "10000000000000-count-one": "00T", "10000000000000-count-other": "00T", "100000000000000-count-one": "000T", "100000000000000-count-other": "000T" } } }, "scientificFormats-numberSystem-latn": { standard: "#E0" }, "percentFormats-numberSystem-latn": { standard: "#,##0%" }, "currencyFormats-numberSystem-latn": { currencySpacing: { beforeCurrency: { currencyMatch: "[:^S:]", surroundingMatch: "[:digit:]", insertBetween: " " }, afterCurrency: { currencyMatch: "[:^S:]", surroundingMatch: "[:digit:]", insertBetween: " " } }, standard: "¤#,##0.00", accounting: "¤#,##0.00;(¤#,##0.00)", "short": { standard: { "1000-count-one": "¤0K", "1000-count-other": "¤0K", "10000-count-one": "¤00K", "10000-count-other": "¤00K", "100000-count-one": "¤000K", "100000-count-other": "¤000K", "1000000-count-one": "¤0M", "1000000-count-other": "¤0M", "10000000-count-one": "¤00M", "10000000-count-other": "¤00M", "100000000-count-one": "¤000M", "100000000-count-other": "¤000M", "1000000000-count-one": "¤0B", "1000000000-count-other": "¤0B", "10000000000-count-one": "¤00B", "10000000000-count-other": "¤00B", "100000000000-count-one": "¤000B", "100000000000-count-other": "¤000B", "1000000000000-count-one": "¤0T", "1000000000000-count-other": "¤0T", "10000000000000-count-one": "¤00T", "10000000000000-count-other": "¤00T", "100000000000000-count-one": "¤000T", "100000000000000-count-other": "¤000T" } }, "unitPattern-count-one": "{0} {1}", "unitPattern-count-other": "{0} {1}" }, "miscPatterns-numberSystem-latn": { atLeast: "{0}+", range: "{0}–{1}" } } } } }; Globalize.load(enNumbers); Globalize.locale("en"); var formattersCache = {}; var getFormatter = function(format) { var formatter, formatCacheKey; if ("object" === typeof format) { formatCacheKey = Globalize.locale().locale + ":" + JSON.stringify(format) } else { formatCacheKey = Globalize.locale().locale + ":" + format } formatter = formattersCache[formatCacheKey]; if (!formatter) { formatter = formattersCache[formatCacheKey] = Globalize.numberFormatter(format) } return formatter }; var globalizeNumberLocalization = { _formatNumberCore: function(value, format, formatConfig) { if ("exponential" === format) { return this.callBase.apply(this, arguments) } return getFormatter(this._normalizeFormatConfig(format, formatConfig, value))(value) }, _normalizeFormatConfig: function(format, formatConfig, value) { var config; if ("decimal" === format) { config = { minimumIntegerDigits: formatConfig.precision || 1, useGrouping: false, maximumFractionDigits: 0, round: value < 0 ? "ceil" : "floor" } } else { config = { minimumFractionDigits: formatConfig.precision, maximumFractionDigits: formatConfig.precision } } if ("percent" === format) { config.style = "percent" } return config }, format: function(value, format) { if ("number" !== typeof value) { return value } format = this._normalizeFormat(format); if (!format || "function" !== typeof format && !format.type && !format.formatter) { return getFormatter(format)(value) } return this.callBase.apply(this, arguments) }, parse: function(text, format) { if (!text) { return } if (format && format.parser) { return format.parser(text) } if (format) { errors.log("W0011") } return Globalize.parseNumber(text) } }; numberLocalization.inject(globalizeNumberLocalization) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***************************************************************************!*\ !*** ./Scripts/ui/collection/ui.collection_widget.edit.strategy.plain.js ***! \***************************************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), errors = __webpack_require__( /*! ../widget/ui.errors */ 20), arrayUtils = __webpack_require__( /*! ../../core/utils/array */ 41), EditStrategy = __webpack_require__( /*! ./ui.collection_widget.edit.strategy */ 304); var PlainEditStrategy = EditStrategy.inherit({ _getPlainItems: function() { return this._collectionWidget.option("items") || [] }, getIndexByItemData: function(itemData) { return $.inArray(itemData, this._getPlainItems()) }, getItemDataByIndex: function(index) { return this._getPlainItems()[index] }, deleteItemAtIndex: function(index) { this._getPlainItems().splice(index, 1) }, updateSelectionAfterDelete: function(fromIndex) { var selectedItemIndices = this._collectionWidget._selectedItemIndices; $.each(selectedItemIndices, function(i, index) { if (index > fromIndex) { selectedItemIndices[i] -= 1 } }) }, fetchSelectedItems: function(indices) { indices = indices || this._collectionWidget._selectedItemIndices; indices.sort(function(a, b) { return a - b }); var items = this._getPlainItems(), selectedItems = []; $.each(indices, function(_, index) { selectedItems.push(items[index]) }); if (this._collectionWidget._dataSource && "single" !== this._collectionWidget.option("selectionMode")) { var allSelectedItems = this._collectionWidget.option("selectedItems"), unavailableItems = $.grep(allSelectedItems, function(item) { return -1 === $.inArray(item, items) }); selectedItems = selectedItems.concat(unavailableItems) } return selectedItems }, fetchSelectionDifference: function(addedSelection, removedSelection) { var difference = this.callBase(addedSelection, removedSelection); if (this._collectionWidget._dataSource) { var addedItems = difference.addedItems, removedItems = difference.removedItems, duplicatedItems = arrayUtils.intersection(addedItems, removedItems); $.each(duplicatedItems, function(_, item) { var addedItemIndex = $.inArray(item, addedItems), removedItemIndex = $.inArray(item, removedItems); addedItems.splice(addedItemIndex, 1); removedItems.splice(removedItemIndex, 1) }) } return difference }, selectedItemIndices: function() { var selectedIndices = [], items = this._getPlainItems(), selected = this._collectionWidget.option("selectedItems"), dataSource = this._collectionWidget._dataSource; $.each(selected, function(_, selectedItem) { var index = $.inArray(selectedItem, items); if (-1 !== index) { selectedIndices.push(index) } else { if (!dataSource) { errors.log("W1002", selectedItem) } } }); return selectedIndices }, moveItemAtIndexToIndex: function(movingIndex, destinationIndex) { var items = this._getPlainItems(), movedItemData = items[movingIndex]; items.splice(movingIndex, 1); items.splice(destinationIndex, 0, movedItemData) }, _isItemIndex: function(index) { return "number" === typeof index && Math.round(index) === index }, _getNormalizedItemIndex: function(itemElement) { return this._collectionWidget._itemElements().index(itemElement) }, _normalizeItemIndex: function(index) { return index }, _denormalizeItemIndex: function(index) { return index }, _getItemByNormalizedIndex: function(index) { return index > -1 ? this._collectionWidget._itemElements().eq(index) : null }, _itemsFromSameParent: function() { return true } }); module.exports = PlainEditStrategy }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!***********************************************************!*\ !*** ./Scripts/ui/data_grid/ui.data_grid.columns_view.js ***! \***********************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), clickEvent = __webpack_require__( /*! ../../events/click */ 9), browser = __webpack_require__( /*! ../../core/utils/browser */ 22), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), devices = __webpack_require__( /*! ../../core/devices */ 7), gridCore = __webpack_require__( /*! ./ui.data_grid.core */ 17), gridCoreUtils = __webpack_require__( /*! ../grid_core/ui.grid_core.utils */ 42); var DATAGRID_SCROLL_CONTAINER_CLASS = "dx-datagrid-scroll-container", DATAGRID_ROW_CLASS = "dx-row", DATAGRID_GROUP_SPACE_CLASS = "dx-datagrid-group-space", DATAGRID_GROUP_ROW_CLASS = "dx-group-row", DATAGRID_DETAIL_ROW_CLASS = "dx-master-detail-row", DATAGRID_CONTENT_CLASS = "dx-datagrid-content", DATAGRID_TABLE_CLASS = "dx-datagrid-table", DATAGRID_TABLE_FIXED_CLASS = "dx-datagrid-table-fixed", DATAGRID_CONTENT_FIXED_CLASS = "dx-datagrid-content-fixed", DATAGRID_HIDDEN_COLUMNS_WIDTH = "0.0001px", DATAGRID_CELL_HINT_VISIBLE = "dxCellHintVisible"; var appendElementTemplate = { render: function(element, container) { container.append(element) } }; exports.ColumnsView = gridCore.View.inherit(gridCoreUtils.columnStateMixin).inherit({ _createScrollableOptions: function() { var that = this, scrollingOptions = that.option("scrolling"), useNativeScrolling = that.option("scrolling.useNative"); var options = $.extend({}, scrollingOptions, { direction: "both", bounceEnabled: false, useKeyboard: false }); if (void 0 === useNativeScrolling) { useNativeScrolling = true } if ("auto" === useNativeScrolling) { delete options.useNative; delete options.useSimulatedScrollbar } else { options.useNative = !!useNativeScrolling; options.useSimulatedScrollbar = !useNativeScrolling } return options }, _updateCell: function($cell, parameters) { if (parameters.rowType) { this._cellPrepared($cell, parameters) } }, _createCell: function(options) { var column = options.column, alignment = column.alignment || commonUtils.getDefaultAlignment(this.option("rtlEnabled")); var cell = window.document.createElement("td"); cell.style.textAlign = alignment; var $cell = $(cell); this.setAria("role", "gridcell", $cell); if (!commonUtils.isDefined(column.groupIndex) && column.cssClass) { $cell.addClass(column.cssClass) } if ("expand" === column.command) { $cell.addClass(DATAGRID_GROUP_SPACE_CLASS) } column.colspan > 1 && $cell.attr("colspan", column.colspan); return $cell }, _createRow: function(row) { return $("").addClass(DATAGRID_ROW_CLASS).attr("role", "row") }, _createTable: function(columns) { var that = this, $table = $("").addClass(DATAGRID_TABLE_CLASS).addClass(DATAGRID_TABLE_FIXED_CLASS).attr("role", "grid"); if (columns) { $table.append(that._createColGroup(columns)); if (devices.real().ios) { $table.append("") } } if (browser.mozilla) { $table.on("mousedown", "td", function(e) { if (e.ctrlKey) { e.preventDefault() } }) } if (that.option("cellHintEnabled")) { $table.on("mousemove", ".dx-row > td", this.createAction(function(args) { var e = args.jQueryEvent, $element = $(e.target), $cell = $(e.currentTarget), $row = $cell.parent(), isDataRow = $row.hasClass("dx-data-row"), isHeaderRow = $row.hasClass("dx-header-row"), isGroupRow = $row.hasClass("dx-group-row"), visibleColumns = that._columnsController.getVisibleColumns(), rowOptions = $row.data("options"), columnIndex = $cell.index(), cellOptions = rowOptions && rowOptions.cells && rowOptions.cells[columnIndex], column = cellOptions ? cellOptions.column : visibleColumns[columnIndex]; if ((!isDataRow || isDataRow && column && !column.cellTemplate) && (!isHeaderRow || isHeaderRow && column && !column.headerCellTemplate) && (!isGroupRow || isGroupRow && column && (void 0 === column.groupIndex || !column.groupCellTemplate))) { if ($element.data(DATAGRID_CELL_HINT_VISIBLE)) { $element.removeAttr("title"); $element.data(DATAGRID_CELL_HINT_VISIBLE, false) } if ($element[0].scrollWidth > $element[0].clientWidth && !commonUtils.isDefined($element.attr("title"))) { $element.attr("title", $element.text()); $element.data(DATAGRID_CELL_HINT_VISIBLE, true) } } })) } var getOptions = function(event) { var cellElement = $(event.currentTarget), rowOptions = cellElement.parent().data("options"), options = rowOptions && rowOptions.cells && rowOptions.cells[cellElement.index()]; return $.extend({}, options, { cellElement: cellElement, jQueryEvent: event, eventType: event.type }) }; if (that.option("onCellHoverChanged")) { $table.on("mouseover", ".dx-row > td", function(e) { that.executeAction("onCellHoverChanged", getOptions(e)) }); $table.on("mouseout", ".dx-row > td", function(e) { that.executeAction("onCellHoverChanged", getOptions(e)) }) } if (that.option("onCellClick")) { $table.on(clickEvent.name, ".dx-row > td", function(e) { that.executeAction("onCellClick", getOptions(e)) }) } $table.on(clickEvent.name, ".dx-row", { useNative: that._isNativeClick() }, that.createAction(function(e) { var jQueryEvent = e.jQueryEvent; if (!$(jQueryEvent.target).closest("a").length) { e.rowIndex = that.getRowIndex(jQueryEvent.currentTarget); if (e.rowIndex >= 0) { e.rowElement = $(jQueryEvent.currentTarget); e.columns = that.getColumns(); that._rowClick(e) } } })); return $table }, _isNativeClick: $.noop, _rowClick: $.noop, _createColGroup: function(columns) { var i, j, colspan, colgroupElement = $(""); for (i = 0; i < columns.length; i++) { colspan = columns[i].colspan || 1; for (j = 0; j < colspan; j++) { colgroupElement.append(this._createCol(columns[i])) } } return colgroupElement }, _createCol: function(column) { var width = column.visibleWidth || column.width; if ("adaptiveHidden" === width) { width = DATAGRID_HIDDEN_COLUMNS_WIDTH } return $("").width(width) }, renderDelayedTemplates: function() { var templateParameters, delayedTemplates = this._delayedTemplates; while (delayedTemplates.length) { templateParameters = delayedTemplates.shift(); templateParameters.template.render(templateParameters.options, templateParameters.container); if (templateParameters.options.column) { this._updateCell(templateParameters.container, templateParameters.options) } } }, _processTemplate: function(template) { var templateID, renderingTemplate, that = this; if (template && template.render) { renderingTemplate = { allowRenderToDetachedContainer: template.allowRenderToDetachedContainer, render: function(options, container) { template.render(container, options) } } } else { if ($.isFunction(template)) { renderingTemplate = { render: function(options, container) { template(container, options) } } } else { templateID = commonUtils.isString(template) ? template : $(template).attr("id"); if (!templateID) { renderingTemplate = that.getTemplate(template) } else { if (!that._templatesCache[templateID]) { that._templatesCache[templateID] = that.getTemplate(template) } renderingTemplate = that._templatesCache[templateID] } } } return renderingTemplate }, renderTemplate: function(container, template, options) { var that = this, renderingTemplate = that._processTemplate(template, options); if (renderingTemplate) { if (renderingTemplate.allowRenderToDetachedContainer) { renderingTemplate.render(options, container); return true } else { that._delayedTemplates.push({ template: renderingTemplate, container: container, options: options }) } } return false }, _appendRow: function($table, $row, appendTemplate) { var that = this; if (that.option("rowTemplate") && that._delayedTemplates.length && $row) { that._delayedTemplates.push({ container: $table, template: appendTemplate || appendElementTemplate, options: $row }) } else { $table.append($row) } }, _resizeCore: function() { var that = this, scrollLeft = that._scrollLeft; that._scrollLeft = 0; that.scrollTo({ left: scrollLeft }) }, _renderCore: function(change) { var $root = this.element().parent(); if (!$root || $root.parent().length) { this.renderDelayedTemplates() } }, _renderTable: function(options) { options = options || {}; var $table, that = this; options.columns = that._columnsController.getVisibleColumns(); $table = that._createTable(options.columns); that._renderRows($table, options); return $table }, _renderRows: function($table, options) { var i, that = this, rows = that._getRows(options.change); for (i = 0; i < rows.length; i++) { that._renderRow($table, $.extend({ row: rows[i] }, options)) } }, _renderRow: function($table, options) { var $row, that = this; options.row.cells = []; $row = that._createRow(options.row); that._renderCells($row, options); that._appendRow($table, $row); that._rowPrepared($row, $.extend({ columns: options.columns }, options.row)) }, _renderCells: function($row, options) { var i, that = this, columnIndex = 0, row = options.row, columns = options.columns; for (i = 0; i < columns.length; i++) { that._renderCell($row, $.extend({ column: columns[i], columnIndex: columnIndex, value: row.values && row.values[columnIndex] }, options)); if (commonUtils.isDefined(columns[i].colspan)) { columnIndex += columns[i].colspan } else { columnIndex++ } } }, _renderCell: function($row, options) { var $cell, that = this, cellOptions = that._getCellOptions(options), column = options.column; options.row.cells.push(cellOptions); $cell = that._createCell(cellOptions); if (!column.command) { that.setAria("label", that.localize("dxDataGrid-ariaColumn") + " " + column.caption + ", " + that.localize("dxDataGrid-ariaValue") + " " + cellOptions.text, $cell) } that._renderCellContent($cell, cellOptions); $row.get(0).appendChild($cell.get(0)); return $cell }, _renderCellContent: function($cell, options) { var template = this._getCellTemplate(options); if (!template || this.renderTemplate($cell, template, options)) { this._updateCell($cell, options) } }, _getCellTemplate: function(options) {}, _getRows: function() { return [] }, _getCellOptions: function(options) { return { column: options.column, columnIndex: options.columnIndex, rowType: options.row.rowType } }, _cellPrepared: function($cell, options) { options.cellElement = $cell; this.executeAction("onCellPrepared", options) }, _rowPrepared: function($row, options) { $.data($row.get(0), "options", options); options.rowElement = $row; this.executeAction("onRowPrepared", options) }, _columnOptionChanged: function(e) { var optionNames = e.optionNames; if (gridCore.checkChanges(optionNames, ["width", "visibleWidth"])) { var visibleColumns = this._columnsController.getVisibleColumns(); var widths = $.map(visibleColumns, function(column) { return column.visibleWidth || column.width || "auto" }); this.setColumnWidths(widths); return } if (!this._requireReady) { this.render() } }, getTableElements: function() { return this._tableElement || $() }, _getTableElement: function() { return this._tableElement }, _setTableElement: function(tableElement) { this._tableElement = tableElement }, optionChanged: function(args) { this.callBase(args); switch (args.name) { case "cellHintEnabled": case "onCellPrepared": case "onRowPrepared": case "onCellHoverChanged": this._invalidate(true, true); args.handled = true } }, init: function() { var that = this; that._scrollLeft = 0; that._columnsController = that.getController("columns"); that._dataController = that.getController("data"); that._delayedTemplates = []; that._templatesCache = {}; that.createAction("onCellClick"); that.createAction("onRowClick"); that.createAction("onCellHoverChanged", { excludeValidators: ["disabled", "readOnly"] }); that.createAction("onCellPrepared", { excludeValidators: ["designMode", "disabled", "readOnly"], category: "rendering" }); that.createAction("onRowPrepared", { excludeValidators: ["designMode", "disabled", "readOnly"], category: "rendering", afterExecute: function(e) { that._afterRowPrepared(e) } }); that._columnsController.columnsChanged.add($.proxy(that._columnOptionChanged, that)); that._dataController && that._dataController.changed.add($.proxy(that._handleDataChanged, that)) }, _afterRowPrepared: $.noop, _handleDataChanged: function(e) {}, callbackNames: function() { return ["scrollChanged"] }, scrollTo: function(pos) { var that = this, $element = that.element(), $scrollContainer = $element && $element.children("." + DATAGRID_SCROLL_CONTAINER_CLASS).not("." + DATAGRID_CONTENT_FIXED_CLASS); that._skipScrollChanged = false; if (commonUtils.isDefined(pos) && commonUtils.isDefined(pos.left) && that._scrollLeft !== pos.left) { that._scrollLeft = pos.left; $scrollContainer && $scrollContainer.scrollLeft(Math.round(pos.left)); that._skipScrollChanged = true } }, _wrapTableInScrollContainer: function($table) { var $scrollContainer, that = this; $scrollContainer = $("
").on("scroll", function() { !that._skipScrollChanged && that.scrollChanged.fire({ left: $scrollContainer.scrollLeft() }, that.name); that._skipScrollChanged = false }).addClass(DATAGRID_CONTENT_CLASS).addClass(DATAGRID_SCROLL_CONTAINER_CLASS).append($table).appendTo(that.element()); return $scrollContainer }, _updateContent: function($newTableElement) { this._setTableElement($newTableElement); this._wrapTableInScrollContainer($newTableElement) }, _findContentElement: $.noop, _getWidths: function($cellElements) { var width, clientRect, result = []; if ($cellElements) { $.each($cellElements, function(index, item) { width = item.offsetWidth; if (item.getBoundingClientRect) { clientRect = item.getBoundingClientRect(); if (clientRect.width > width) { width = Math.ceil(clientRect.width) } } result.push(width) }) } return result }, getColumnWidths: function($tableElement) { var $cells, that = this, result = []; $tableElement = $tableElement || that._getTableElement(); if ($tableElement) { $cells = $tableElement.children("tbody").children(":not(." + DATAGRID_GROUP_ROW_CLASS + ", ." + DATAGRID_DETAIL_ROW_CLASS + ")").first().children("td"); result = that._getWidths($cells) } return result }, setColumnWidths: function(widths) { var $cols, i, j, columnIndex, columns, width, tableElements = this.getTableElements(true); if (tableElements.length && widths) { for (i = 0; i < tableElements.length; i++) { columnIndex = 0; $cols = $(tableElements[i]).find("col"); columns = this.getColumns(null, $(tableElements[i])); for (j = 0; j < columns.length; j++) { if (columns[j].colspan) { columnIndex += columns[j].colspan; continue } width = widths[columnIndex]; if ("adaptiveHidden" === width) { width = DATAGRID_HIDDEN_COLUMNS_WIDTH } $cols.eq(columnIndex).css("width", width || "auto"); columnIndex++ } } } }, getCellElements: function(rowIndex) { var $row = this._getRowElements().eq(rowIndex); return $row.children() }, getCellElement: function(rowIndex, columnIdentificator) { var $cell, columnIndex, that = this, $cells = that.getCellElements(rowIndex), columnsController = that._columnsController, columnVisibleIndex = columnIdentificator; if (commonUtils.isString(columnIdentificator)) { columnIndex = columnsController.columnOption(columnIdentificator, "index"); columnVisibleIndex = columnsController.getVisibleIndex(columnIndex) } if ($cells.length && columnVisibleIndex >= 0) { $cell = $cells.eq(columnVisibleIndex) } if ($cell && $cell.length) { return $cell } }, getColumnElements: function() {}, getColumns: function(rowIndex) { return this._columnsController.getVisibleColumns(rowIndex) }, getCell: function(cellPosition, rows) { var $cells, $rows = rows || this._getRowElements(); if ($rows.length > 0 && cellPosition.rowIndex >= 0) { cellPosition.rowIndex = cellPosition.rowIndex < $rows.length ? cellPosition.rowIndex : $rows.length - 1; $cells = this.getCellElements(cellPosition.rowIndex); if ($cells && $cells.length > 0) { return $cells.eq($cells.length > cellPosition.columnIndex ? cellPosition.columnIndex : $cells.length - 1) } } }, getRowsCount: function() { var tableElement = this._getTableElement(); if (tableElement && 1 === tableElement.length) { return tableElement[0].rows.length } return 0 }, _getRowElements: function(tableElement) { tableElement = tableElement || this._getTableElement(); return tableElement && tableElement.children("tbody").children("." + DATAGRID_ROW_CLASS) || $() }, getRowIndex: function($row) { return this._getRowElements().index($row) }, getBoundingRect: function() {}, getName: function() {}, setScrollerSpacing: function(width) { var that = this, $element = that.element(), rtlEnabled = that.option("rtlEnabled"); $element && $element.css(rtlEnabled ? { paddingLeft: width } : { paddingRight: width }) } }) }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!************************************************************!*\ !*** ./Scripts/ui/drop_down_editor/ui.drop_down_editor.js ***! \************************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), Guid = __webpack_require__( /*! ../../core/guid */ 33), registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 3), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), errors = __webpack_require__( /*! ../widget/ui.errors */ 20), positionUtils = __webpack_require__( /*! ../../animation/position */ 65), messageLocalization = __webpack_require__( /*! ../../localization/message */ 8), devices = __webpack_require__( /*! ../../core/devices */ 7), Button = __webpack_require__( /*! ../button */ 24), eventUtils = __webpack_require__( /*! ../../events/utils */ 4), TextBox = __webpack_require__( /*! ../text_box */ 96), clickEvent = __webpack_require__( /*! ../../events/click */ 9), Popup = __webpack_require__( /*! ../popup */ 53); var DROP_DOWN_EDITOR_CLASS = "dx-dropdowneditor", DROP_DOWN_EDITOR_INPUT_WRAPPER_CLASS = "dx-dropdowneditor-input-wrapper", DROP_DOWN_EDITOR_BUTTON_CLASS = "dx-dropdowneditor-button", DROP_DOWN_EDITOR_BUTTON_ICON = "dx-dropdowneditor-icon", DROP_DOWN_EDITOR_OVERLAY = "dx-dropdowneditor-overlay", DROP_DOWN_EDITOR_OVERLAY_FLIPPED = "dx-dropdowneditor-overlay-flipped", DROP_DOWN_EDITOR_ACTIVE = "dx-dropdowneditor-active", DROP_DOWN_EDITOR_BUTTON_VISIBLE = "dx-dropdowneditor-button-visible", DROP_DOWN_EDITOR_FIELD_CLICKABLE = "dx-dropdowneditor-field-clickable"; var DropDownEditor = TextBox.inherit({ _supportedKeys: function() { return $.extend({}, this.callBase(), { tab: function(e) { if (!this.option("opened")) { return } if ("instantly" === this.option("applyValueMode")) { this.close(); return } var $focusableElement = e.shiftKey ? this._getLastPopupElement() : this._getFirstPopupElement(); $focusableElement && $focusableElement.focus(); e.preventDefault() }, escape: function(e) { if (this.option("opened")) { e.preventDefault() } this.close() }, upArrow: function(e) { e.preventDefault(); e.stopPropagation(); if (e.altKey) { this.close(); return false } return true }, downArrow: function(e) { e.preventDefault(); e.stopPropagation(); if (e.altKey) { this._validatedOpening(); return false } return true }, enter: function(e) { if (this.option("opened")) { e.preventDefault(); this._valueChangeEventHandler(e) } return true } }) }, _setDeprecatedOptions: function() { this.callBase(); $.extend(this._deprecatedOptions, { fieldEditEnabled: { since: "16.1", alias: "acceptCustomValue" } }) }, _getDefaultOptions: function() { return $.extend(this.callBase(), { value: null, onOpened: null, onClosed: null, opened: false, acceptCustomValue: true, applyValueMode: "instantly", deferRendering: true, activeStateEnabled: true, fieldTemplate: null, contentTemplate: null, openOnFieldClick: false, showDropButton: true, popupPosition: this._getDefaultPopupPosition(), onPopupInitialized: null, applyButtonText: messageLocalization.format("OK"), cancelButtonText: messageLocalization.format("Cancel"), buttonsLocation: "default", showPopupTitle: false }) }, _getDefaultPopupPosition: function() { var position = commonUtils.getDefaultAlignment(this.option("rtlEnabled")); return { offset: { h: 0, v: -1 }, my: position + " top", at: position + " bottom", collision: "flip flip" } }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function(device) { var isGeneric = "generic" === device.platform, isWin10 = "win" === device.platform && device.version && 10 === device.version[0]; return isGeneric || isWin10 }, options: { popupPosition: { offset: { v: 0 } } } }]) }, _inputWrapper: function() { return this.element().find("." + DROP_DOWN_EDITOR_INPUT_WRAPPER_CLASS) }, _init: function() { this.callBase(); this._initVisibilityActions(); this._initPopupInitializedAction() }, _initVisibilityActions: function() { this._openAction = this._createActionByOption("onOpened", { excludeValidators: ["disabled", "readOnly"] }); this._closeAction = this._createActionByOption("onClosed", { excludeValidators: ["disabled", "readOnly"] }) }, _initPopupInitializedAction: function() { this._popupInitializedAction = this._createActionByOption("onPopupInitialized", { excludeValidators: ["disabled", "readOnly", "designMode"] }) }, _render: function() { this.callBase(); this._renderOpenHandler(); this.element().addClass(DROP_DOWN_EDITOR_CLASS); this._renderOpenedState(); this.setAria("role", "combobox") }, _renderContentImpl: function() { if (!this.option("deferRendering")) { this._createPopup() } }, _renderInput: function() { this.callBase(); this.element().wrapInner($("
").addClass(DROP_DOWN_EDITOR_INPUT_WRAPPER_CLASS)); this._$container = this.element().children().eq(0); this.setAria({ haspopup: "true", autocomplete: "list" }) }, _readOnlyPropValue: function() { return !this.option("acceptCustomValue") || this.callBase() }, _cleanFocusState: function() { this.callBase(); if (this.option("fieldTemplate")) { this._input().off("focusin focusout beforeactivate") } }, _renderField: function() { var fieldTemplate = this._getTemplateByOption("fieldTemplate"); if (!(fieldTemplate && this.option("fieldTemplate"))) { return } this._renderTemplatedField(fieldTemplate, this._fieldRenderData()) }, _renderTemplatedField: function(fieldTemplate, data) { var isFocused = this._input().is(":focus"); this._resetFocus(isFocused); var $container = this._$container; $container.empty(); this._$dropButton = null; this._$clearButton = null; fieldTemplate.render(data, $container); if (!this._input().length) { throw errors.Error("E1010") } this._refreshEvents(); this._refreshValueChangeEvent(); isFocused && this._input().focus(); this._renderFocusState() }, _resetFocus: function(isFocused) { this._cleanFocusState(); isFocused && this._input().focusout() }, _fieldRenderData: function() { return this.option("value") }, _renderInputAddons: function() { this._renderField(); this.callBase(); this._renderDropButton() }, _renderDropButton: function() { var dropButtonVisible = this.option("showDropButton"); this.element().toggleClass(DROP_DOWN_EDITOR_BUTTON_VISIBLE, dropButtonVisible); if (!dropButtonVisible) { this._$dropButton && this._$dropButton.remove(); this._$dropButton = null; return } if (!this._$dropButton) { this._$dropButton = this._createDropButton().addClass(DROP_DOWN_EDITOR_BUTTON_CLASS) } this._$dropButton.prependTo(this._buttonsContainer()) }, _createDropButton: function() { var $button = $("
"); this._createComponent($button, Button, { focusStateEnabled: false, disabled: this.option("readOnly"), _templates: {}, useInkRipple: false }); var $buttonIcon = $("
").addClass(DROP_DOWN_EDITOR_BUTTON_ICON); $button.append($buttonIcon).removeClass("dx-button").on("mousedown", function(e) { e.preventDefault() }); $button.find(".dx-button-content").remove(); return $button }, _renderOpenHandler: function() { var $inputWrapper = this.element().find("." + DROP_DOWN_EDITOR_INPUT_WRAPPER_CLASS); var eventName = eventUtils.addNamespace(clickEvent.name, this.NAME); $inputWrapper.off(eventName); var openOnFieldClick = this.option("openOnFieldClick"); this.element().toggleClass(DROP_DOWN_EDITOR_FIELD_CLICKABLE, openOnFieldClick); if (openOnFieldClick) { $inputWrapper.on(eventName, $.proxy(this._openHandler, this)); return } if (this.option("showDropButton")) { this._$dropButton.dxButton("option", "onClick", $.proxy(this._openHandler, this)) } }, _openHandler: function() { this._toggleOpenState() }, _keyboardEventBindingTarget: function() { return this._input() }, _toggleOpenState: function(isVisible) { if (this.option("disabled")) { return } if (this._needFocusOnButtonClick()) { this._input().focus() } if (!this.option("readOnly")) { isVisible = arguments.length ? isVisible : !this.option("opened"); this.option("opened", isVisible) } }, _needFocusOnButtonClick: function() { return "desktop" === devices.real().deviceType }, _renderOpenedState: function() { var opened = this.option("opened"); if (opened) { this._createPopup() } this.element().toggleClass(DROP_DOWN_EDITOR_ACTIVE, opened); this._setPopupOption("visible", opened); this.setAria({ expanded: opened, owns: (opened || void 0) && this._popupContentId }) }, _createPopup: function() { if (this._$popup) { return } this._$popup = $("
").addClass(DROP_DOWN_EDITOR_OVERLAY).addClass(this.option("customOverlayCssClass")).appendTo(this.element()); this._renderPopup(); this._renderPopupContent() }, _renderPopup: function() { this._popup = this._createComponent(this._$popup, Popup, this._popupConfig()); this._popup.on({ showing: $.proxy(this._popupShowingHandler, this), shown: $.proxy(this._popupShownHandler, this), hiding: $.proxy(this._popupHidingHandler, this), hidden: $.proxy(this._popupHiddenHandler, this) }); this._popup.option("onContentReady", $.proxy(this._contentReadyHandler, this)); this._contentReadyHandler(); this._popupContentId = new Guid; this.setAria("id", this._popupContentId, this._popup.content()) }, _contentReadyHandler: $.noop, _popupConfig: function() { return { onInitialized: this._popupInitializedHandler(), position: $.extend(this.option("popupPosition"), { of: this.element() }), showTitle: this.option("showPopupTitle"), width: "auto", height: "auto", shading: false, closeOnTargetScroll: true, closeOnOutsideClick: $.proxy(this._closeOutsideDropDownHandler, this), animation: { show: { type: "fade", duration: 0, from: 0, to: 1 }, hide: { type: "fade", duration: 400, from: 1, to: 0 } }, deferRendering: false, focusStateEnabled: false, showCloseButton: false, toolbarItems: this._getPopupToolbarItems(), onPositioned: $.proxy(this._popupPositionedHandler, this), fullScreen: false } }, _popupInitializedHandler: function() { if (!this.option("onPopupInitialized")) { return } return $.proxy(function(e) { this._popupInitializedAction({ popup: e.component }) }, this) }, _popupPositionedHandler: function(e) { this._popup.overlayContent().toggleClass(DROP_DOWN_EDITOR_OVERLAY_FLIPPED, e.position.v.flip) }, _popupShowingHandler: $.noop, _popupHidingHandler: function() { this.option("opened", false) }, _popupShownHandler: function() { this._openAction(); if (this._$validationMessage) { this._$validationMessage.dxOverlay("option", "position", this._getValidationMessagePosition()) } }, _popupHiddenHandler: function() { this._closeAction(); if (this._$validationMessage) { this._$validationMessage.dxOverlay("option", "position", this._getValidationMessagePosition()) } }, _getValidationMessagePosition: function() { var positionRequest = "below"; if (this._popup && this._popup.option("visible")) { var myTop = positionUtils.setup(this.element()).top, popupTop = positionUtils.setup(this._popup.content()).top; positionRequest = myTop + this.option("popupPosition").offset.v > popupTop ? "below" : "above" } return this.callBase(positionRequest) }, _renderPopupContent: function() { var contentTemplate = this._getTemplateByOption("contentTemplate"); if (!(contentTemplate && this.option("contentTemplate"))) { return } var $popupContent = this._popup.content(); $popupContent.empty(); contentTemplate.render($popupContent) }, _closeOutsideDropDownHandler: function(e) { var $target = $(e.target); var isInputClicked = !!$target.closest(this.element()).length; var isDropButtonClicked = !!$target.closest(this._$dropButton).length; var isOutsideClick = !isInputClicked && !isDropButtonClicked; return isOutsideClick }, _clean: function() { delete this._$dropButton; if (this._$popup) { this._$popup.remove(); delete this._$popup; delete this._popup } this.callBase() }, _setPopupOption: function(optionName, value) { this._setWidgetOption("_popup", arguments) }, _validatedOpening: function() { if (!this.option("readOnly")) { this._toggleOpenState(true) } }, _getPopupToolbarItems: function() { return "useButtons" === this.option("applyValueMode") ? this._popupToolbarItemsConfig() : [] }, _getFirstPopupElement: function() { return this._popup._wrapper().find(".dx-popup-done.dx-button") }, _getLastPopupElement: function() { return this._popup._wrapper().find(".dx-popup-cancel.dx-button") }, _popupElementTabHandler: function(e) { var $element = $(e.currentTarget); if (e.shiftKey && $element.is(this._getFirstPopupElement()) || !e.shiftKey && $element.is(this._getLastPopupElement())) { this._input().focus(); e.preventDefault() } }, _popupElementEscHandler: function(e) { this._input().focus(); this.close() }, _popupButtonInitializedHandler: function(e) { e.component.registerKeyHandler("tab", $.proxy(this._popupElementTabHandler, this)); e.component.registerKeyHandler("escape", $.proxy(this._popupElementEscHandler, this)) }, _popupToolbarItemsConfig: function() { var buttonsConfig = [{ shortcut: "done", options: { onClick: $.proxy(this._applyButtonHandler, this), text: this.option("applyButtonText"), onInitialized: $.proxy(this._popupButtonInitializedHandler, this) } }, { shortcut: "cancel", options: { onClick: $.proxy(this._cancelButtonHandler, this), text: this.option("cancelButtonText"), onInitialized: $.proxy(this._popupButtonInitializedHandler, this) } }]; return this._applyButtonsLocation(buttonsConfig) }, _applyButtonsLocation: function(buttonsConfig) { var buttonsLocation = this.option("buttonsLocation"), resultConfig = buttonsConfig; if ("default" !== buttonsLocation) { var position = commonUtils.splitPair(buttonsLocation); $.each(resultConfig, function(_, element) { $.extend(element, { toolbar: position[0], location: position[1] }) }) } return resultConfig }, _applyButtonHandler: function() { this.close(); this.option("focusStateEnabled") && this.focus() }, _cancelButtonHandler: function() { this.close(); this.option("focusStateEnabled") && this.focus() }, _toggleReadOnlyState: function() { this.callBase(); this._$dropButton && this._$dropButton.dxButton("option", "disabled", this.option("readOnly")) }, _optionChanged: function(args) { switch (args.name) { case "opened": this._renderOpenedState(); break; case "onOpened": case "onClosed": this._initVisibilityActions(); break; case "onPopupInitialized": this._initPopupInitializedAction(); break; case "fieldTemplate": this._renderInputAddons(); break; case "showDropButton": case "contentTemplate": case "acceptCustomValue": case "openOnFieldClick": this._invalidate(); break; case "popupPosition": case "deferRendering": break; case "applyValueMode": case "applyButtonText": case "cancelButtonText": case "buttonsLocation": this._setPopupOption("toolbarItems", this._getPopupToolbarItems()); break; case "showPopupTitle": this._setPopupOption("showTitle", args.value); break; default: this.callBase(args) } }, open: function() { this.option("opened", true) }, close: function() { this.option("opened", false) }, reset: function() { this.option("value", null) }, field: function() { return this._input() }, content: function() { return this._popup ? this._popup.content() : null } }); registerComponent("dxDropDownEditor", DropDownEditor); module.exports = DropDownEditor }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*********************************************************!*\ !*** ./Scripts/ui/scheduler/ui.scheduler.work_space.js ***! \*********************************************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), dateUtils = __webpack_require__( /*! ../../core/utils/date */ 12), messageLocalization = __webpack_require__( /*! ../../localization/message */ 8), dateLocalization = __webpack_require__( /*! ../../localization/date */ 14), toMs = dateUtils.dateToMilliseconds, Widget = __webpack_require__( /*! ../widget/ui.widget */ 19), abstract = Widget.abstract, commonUtils = __webpack_require__( /*! ../../core/utils/common */ 2), registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 3), publisherMixin = __webpack_require__( /*! ./ui.scheduler.publisher_mixin */ 102), eventUtils = __webpack_require__( /*! ../../events/utils */ 4), pointerEvents = __webpack_require__( /*! ../../events/pointer */ 13), errors = __webpack_require__( /*! ../widget/ui.errors */ 20), clickEvent = __webpack_require__( /*! ../../events/click */ 9), dragEvents = __webpack_require__( /*! ../../events/drag */ 62), Scrollable = __webpack_require__( /*! ../scroll_view/ui.scrollable */ 72).default, tableCreator = __webpack_require__( /*! ./ui.scheduler.table_creator */ 228); var COMPONENT_CLASS = "dx-scheduler-work-space", GROUPED_WORKSPACE_CLASS = "dx-scheduler-work-space-grouped", WORKSPACE_WITH_BOTH_SCROLLS_CLASS = "dx-scheduler-work-space-both-scrollbar", TIME_PANEL_CLASS = "dx-scheduler-time-panel", TIME_PANEL_CELL_CLASS = "dx-scheduler-time-panel-cell", TIME_PANEL_ROW_CLASS = "dx-scheduler-time-panel-row", ALL_DAY_PANEL_CLASS = "dx-scheduler-all-day-panel", ALL_DAY_TABLE_CLASS = "dx-scheduler-all-day-table", FIXED_CONTAINER_CLASS = "dx-scheduler-fixed-appointments", ALL_DAY_CONTAINER_CLASS = "dx-scheduler-all-day-appointments", ALL_DAY_TITLE_CLASS = "dx-scheduler-all-day-title", ALL_DAY_TITLE_HIDDEN_CLASS = "dx-scheduler-all-day-title-hidden", ALL_DAY_TABLE_CELL_CLASS = "dx-scheduler-all-day-table-cell", ALL_DAY_TABLE_ROW_CLASS = "dx-scheduler-all-day-table-row", WORKSPACE_WITH_ALL_DAY_CLASS = "dx-scheduler-work-space-all-day", WORKSPACE_WITH_COLLAPSED_ALL_DAY_CLASS = "dx-scheduler-work-space-all-day-collapsed", WORKSPACE_WITH_MOUSE_SELECTION_CLASS = "dx-scheduler-work-space-mouse-selection", HEADER_PANEL_CLASS = "dx-scheduler-header-panel", HEADER_PANEL_CELL_CLASS = "dx-scheduler-header-panel-cell", HEADER_ROW_CLASS = "dx-scheduler-header-row", GROUP_ROW_CLASS = "dx-scheduler-group-row", GROUP_HEADER_CLASS = "dx-scheduler-group-header", GROUP_HEADER_CONTENT_CLASS = "dx-scheduler-group-header-content", DATE_TABLE_CLASS = "dx-scheduler-date-table", DATE_TABLE_CELL_CLASS = "dx-scheduler-date-table-cell", DATE_TABLE_ROW_CLASS = "dx-scheduler-date-table-row", DATE_TABLE_FOCUSED_CELL_CLASS = "dx-scheduler-focused-cell", DATE_TABLE_DROPPABLE_CELL_CLASS = "dx-scheduler-date-table-droppable-cell", SCHEDULER_HEADER_SCROLLABLE_CLASS = "dx-scheduler-header-scrollable", SCHEDULER_SIDEBAR_SCROLLABLE_CLASS = "dx-scheduler-sidebar-scrollable", SCHEDULER_DATE_TABLE_SCROLLABLE_CLASS = "dx-scheduler-date-table-scrollable", SCHEDULER_WORKSPACE_DXPOINTERDOWN_EVENT_NAME = eventUtils.addNamespace(pointerEvents.down, "dxSchedulerWorkSpace"), SCHEDULER_CELL_DXDRAGENTER_EVENT_NAME = eventUtils.addNamespace(dragEvents.enter, "dxSchedulerDateTable"), SCHEDULER_CELL_DXDROP_EVENT_NAME = eventUtils.addNamespace(dragEvents.drop, "dxSchedulerDateTable"), SCHEDULER_CELL_DXCLICK_EVENT_NAME = eventUtils.addNamespace(clickEvent.name, "dxSchedulerDateTable"), SCHEDULER_CELL_DXPOINTERDOWN_EVENT_NAME = eventUtils.addNamespace(pointerEvents.down, "dxSchedulerDateTable"), SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME = eventUtils.addNamespace(pointerEvents.up, "dxSchedulerDateTable"), SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME = eventUtils.addNamespace(pointerEvents.move, "dxSchedulerDateTable"), CELL_DATA = "dxCellData", DATE_TABLE_CELL_WIDTH = 75, DAY_MS = toMs("day"), HOUR_MS = toMs("hour"); var SchedulerWorkSpace = Widget.inherit({ _supportedKeys: function() { var clickHandler = function(e) { e.preventDefault(); e.stopPropagation(); if (this._focusedCells && this._focusedCells.length) { this._showAddAppointmentPopup($(this._focusedCells)) } }, arrowPressHandler = function(e, cell) { e.preventDefault(); e.stopPropagation(); this._moveToCell(cell, e.shiftKey) }; return $.extend(this.callBase(), { enter: clickHandler, space: clickHandler, downArrow: function(e) { var $cell = this._getCellFromNextRow("next", e.shiftKey); arrowPressHandler.call(this, e, $cell) }, upArrow: function(e) { var $cell = this._getCellFromNextRow("prev", e.shiftKey); arrowPressHandler.call(this, e, $cell) }, rightArrow: function(e) { var $rightCell = this._getRightCell(e.shiftKey); arrowPressHandler.call(this, e, $rightCell) }, leftArrow: function(e) { var $leftCell = this._getLeftCell(e.shiftKey); arrowPressHandler.call(this, e, $leftCell) } }) }, _isRTL: function() { return this.option("rtlEnabled") }, _getFocusedCell: function() { return this._$focusedCell || this._$dateTable.find("." + this._getDateTableCellClass()).eq(0) }, _getCellFromNextRow: function(direction, isMultiSelection) { var $currentCell = this._$focusedCell, cellIndex = $currentCell.index(), $row = $currentCell.parent(), $cell = $row[direction]().children().eq(cellIndex); $cell = this._checkForViewBounds($cell); return $cell }, _checkForViewBounds: function($item) { if (!$item.length) { $item = this._$focusedCell } return $item }, _getRightCell: function(isMultiSelection) { var $rightCell, $focusedCell = this._$focusedCell, groupCount = this._getGroupCount(), rowCellCount = isMultiSelection ? this._getCellCount() : this._getTotalCellCount(groupCount), lastIndexInRow = rowCellCount - 1, edgeCellIndex = this._isRTL() ? 0 : lastIndexInRow, currentIndex = $focusedCell.index(), direction = this._isRTL() ? "prev" : "next"; if (currentIndex === edgeCellIndex || isMultiSelection && this._isGroupEndCell($focusedCell)) { var $row = $focusedCell.parent(), sign = this._isRTL() ? 1 : -1; $rightCell = $row[direction]().children().eq(currentIndex + sign * lastIndexInRow); $rightCell = this._checkForViewBounds($rightCell) } else { $rightCell = $focusedCell[direction]() } return $rightCell }, _isGroupEndCell: function($cell) { var cellsInRow = this._getCellCount(), currentCellIndex = $cell.index(), result = currentCellIndex % cellsInRow; return this._isRTL() ? 0 === result : result === cellsInRow - 1 }, _getLeftCell: function(isMultiSelection) { var $leftCell, $focusedCell = this._$focusedCell, groupCount = this._getGroupCount(), rowCellCount = isMultiSelection ? this._getCellCount() : this._getTotalCellCount(groupCount), lastIndexInRow = rowCellCount - 1, edgeCellIndex = this._isRTL() ? lastIndexInRow : 0, currentIndex = $focusedCell.index(), direction = this._isRTL() ? "next" : "prev"; if (currentIndex === edgeCellIndex || isMultiSelection && this._isGroupStartCell($focusedCell)) { var $row = $focusedCell.parent(), sign = this._isRTL() ? -1 : 1; $leftCell = $row[direction]().children().eq(currentIndex + sign * lastIndexInRow); $leftCell = this._checkForViewBounds($leftCell) } else { $leftCell = $focusedCell[direction]() } return $leftCell }, _isGroupStartCell: function($cell) { var cellsInRow = this._getCellCount(), currentCellIndex = $cell.index(), result = currentCellIndex % cellsInRow; return this._isRTL() ? result === cellsInRow - 1 : 0 === result }, _moveToCell: function($cell, isMultiSelection) { isMultiSelection = isMultiSelection && this.option("allowMultipleCellSelection"); this._setFocusedCell($cell, isMultiSelection); this._dateTableScrollable.scrollToElement($cell) }, _setFocusedCell: function($cell, isMultiSelection) { if (!$cell.length) { return } this._releaseFocusedCell(); this._focusedCells = []; if (isMultiSelection) { $cell = this._correctCellForGroup($cell); var $targetCells = this._getCellsBetween($cell, this._$prevCell); this._focusedCells = $targetCells.toArray() } else { this._focusedCells = [$cell.get(0)]; this._$prevCell = $cell } var $focusedCells = $(this._focusedCells); this._toggleFocusClass(true, $focusedCells); this.setAria("label", "Add appointment", $focusedCells); this._toggleFocusedCellClass(true, $cell); this._$focusedCell = $cell }, _correctCellForGroup: function($cell) { var $focusedCell = this._$focusedCell, cellGroupIndex = this._getGroupIndexByCell($cell), focusedCellGroupIndex = this._getGroupIndexByCell($focusedCell), isDifferentTables = this._hasAllDayClass($cell) !== this._hasAllDayClass($focusedCell); return focusedCellGroupIndex !== cellGroupIndex || isDifferentTables ? $focusedCell : $cell }, _getCellsBetween: function($first, $last) { var isAllDayTable = this._hasAllDayClass($last), $cells = this._getCells(isAllDayTable), firstIndex = $cells.index($first), lastIndex = $cells.index($last); if (firstIndex > lastIndex) { var buffer = firstIndex; firstIndex = lastIndex; lastIndex = buffer } $cells = $cells.slice(firstIndex, lastIndex + 1); if (this._getGroupCount() > 1) { var result = [], focusedGroupIndex = this._getGroupIndexByCell($first); $.each($cells, $.proxy(function(_, cell) { var groupIndex = this._getGroupIndexByCell($(cell)); if (focusedGroupIndex === groupIndex) { result.push(cell) } }, this)); $cells = $(result) } return $cells }, _hasAllDayClass: function($cell) { return $cell.hasClass(ALL_DAY_TABLE_CELL_CLASS) }, _getGroupIndexByCell: function($cell) { var cellsInRow = this._getCellCount(), currentCellIndex = $cell.index() + 1, groupIndex = Math.ceil(currentCellIndex / cellsInRow); return groupIndex }, _toggleFocusedCellClass: function(isFocused, $element) { var $focusTarget = $element && $element.length ? $element : this._focusTarget(); $focusTarget.toggleClass(DATE_TABLE_FOCUSED_CELL_CLASS, isFocused) }, _releaseFocusedCell: function($cell) { $cell = $cell || $(this._focusedCells); if (commonUtils.isDefined($cell)) { this._toggleFocusClass(false, $cell); this._toggleFocusedCellClass(false, $cell); this.setAria("label", void 0, $cell) } }, _focusInHandler: function(e) { if ($(e.target).is(this._focusTarget()) && false !== this._isCellClick) { delete this._isCellClick; this.callBase.apply(this, arguments); var $cell = this._getFocusedCell(); this._setFocusedCell($cell) } }, _focusOutHandler: function(e) { this.callBase.apply(this, arguments); this._releaseFocusedCell() }, _focusTarget: function() { return this.element() }, _activeStateUnit: "." + DATE_TABLE_CELL_CLASS + ", ." + ALL_DAY_TABLE_CELL_CLASS, _getDefaultOptions: function() { return $.extend(this.callBase(), { currentDate: new Date, firstDayOfWeek: void 0, startDayHour: 0, endDayHour: 24, hoursInterval: .5, activeStateEnabled: true, hoverStateEnabled: true, groups: [], showAllDayPanel: true, allDayExpanded: false, onCellClick: null, crossScrollingEnabled: false, allowMultipleCellSelection: true }) }, _optionChanged: function(args) { switch (args.name) { case "startDayHour": case "endDayHour": case "hoursInterval": case "firstDayOfWeek": case "currentDate": case "groups": this._cleanView(); this._toggleGroupedClass(); this._renderView(); break; case "showAllDayPanel": this._toggleAllDayVisibility(); break; case "allDayExpanded": this._changeAllDayVisibility(); this.notifyObserver("allDayPanelToggled"); this._attachTablesEvents(); break; case "onCellClick": this._createCellClickAction(); break; case "crossScrollingEnabled": this._toggleHorizontalScrollClass(); this._dateTableScrollable.option(this._dateTableScrollableConfig()); break; case "width": this.callBase(args); this._dimensionChanged(); break; case "allowMultipleCellSelection": break; default: this.callBase(args) } }, _init: function() { this.callBase(); this._toggleHorizontalScrollClass(); this.element().addClass(COMPONENT_CLASS).addClass(this._getElementClass()); this._initWorkSpaceUnits(); this._initDateTableScrollable(); this._createWorkSpaceElements() }, _toggleHorizontalScrollClass: function() { this.element().toggleClass(WORKSPACE_WITH_BOTH_SCROLLS_CLASS, this.option("crossScrollingEnabled")) }, _getTimePanelClass: function() { return TIME_PANEL_CLASS }, _getDateTableClass: function() { return DATE_TABLE_CLASS }, _getDateTableRowClass: function() { return DATE_TABLE_ROW_CLASS }, _getDateTableCellClass: function() { return DATE_TABLE_CELL_CLASS }, _getGroupRowClass: function() { return GROUP_ROW_CLASS }, _getGroupHeaderClass: function() { return GROUP_HEADER_CLASS }, _getGroupHeaderContentClass: function() { return GROUP_HEADER_CONTENT_CLASS }, _initWorkSpaceUnits: function() { this._$headerPanel = $("
").addClass(HEADER_PANEL_CLASS); this._$thead = $("").appendTo(this._$headerPanel); this._$fixedContainer = $("
").addClass(FIXED_CONTAINER_CLASS); this._$allDayContainer = $("
").addClass(ALL_DAY_CONTAINER_CLASS); this._$allDayTitle = $("
").addClass(ALL_DAY_TITLE_CLASS).text(messageLocalization.format("dxScheduler-allDay")).appendTo(this.element()); this._$allDayTable = $("
").addClass(ALL_DAY_TABLE_CLASS); this._$allDayPanel = $("
").addClass(ALL_DAY_PANEL_CLASS).append(this._$allDayTable); this._$timePanel = $("
").addClass(this._getTimePanelClass()); this._$dateTable = $("
").addClass(this._getDateTableClass()) }, _initDateTableScrollable: function() { var $dateTableScrollable = $("
").addClass(SCHEDULER_DATE_TABLE_SCROLLABLE_CLASS); this._dateTableScrollable = this._createComponent($dateTableScrollable, Scrollable, this._dateTableScrollableConfig()) }, _dateTableScrollableConfig: function() { var config = { useKeyboard: false, useNative: false, bounceEnabled: false }; if (this.option("crossScrollingEnabled")) { config = $.extend(config, this._createCrossScrollingConfig()) } return config }, _createCrossScrollingConfig: function() { var config = {}; config.direction = "both"; config.onScroll = $.proxy(function(e) { this._sidebarScrollable.scrollTo({ top: e.scrollOffset.top }); this._headerScrollable.scrollTo({ left: e.scrollOffset.left }) }, this); config.onEnd = $.proxy(function(e) { this.notifyObserver("updateResizableArea", {}) }, this); return config }, _createWorkSpaceElements: function() { if (this.option("crossScrollingEnabled")) { this._createWorkSpaceScrollableElements() } else { this._createWorkSpaceStaticElements() } }, _createWorkSpaceStaticElements: function() { this._dateTableScrollable.content().append(this._$timePanel, this._$dateTable); this.element().append(this._$fixedContainer, this._$headerPanel, this._$allDayContainer, this._$allDayPanel, this._dateTableScrollable.element()) }, _createWorkSpaceScrollableElements: function() { this.element().append(this._$fixedContainer); this._createHeaderScrollable(); this._createSidebarScrollable(); this.element().append(this._dateTableScrollable.element()); this._headerScrollable.content().append(this._$headerPanel, this._$allDayContainer, this._$allDayPanel); this._dateTableScrollable.content().append(this._$dateTable); this._sidebarScrollable.content().append(this._$timePanel) }, _createHeaderScrollable: function() { var $headerScrollable = $("
").addClass(SCHEDULER_HEADER_SCROLLABLE_CLASS).appendTo(this.element()); this._headerScrollable = this._createComponent($headerScrollable, Scrollable, { useKeyboard: false, showScrollbar: false, direction: "horizontal", useNative: false, bounceEnabled: false, onScroll: $.proxy(function(e) { this._dateTableScrollable.scrollTo({ left: e.scrollOffset.left }) }, this) }) }, _createSidebarScrollable: function() { var $timePanelScrollable = $("
").addClass(SCHEDULER_SIDEBAR_SCROLLABLE_CLASS).appendTo(this.element()); this._sidebarScrollable = this._createComponent($timePanelScrollable, Scrollable, { useKeyboard: false, showScrollbar: false, direction: "vertical", useNative: false, bounceEnabled: false, onScroll: $.proxy(function(e) { this._dateTableScrollable.scrollTo({ top: e.scrollOffset.top }) }, this) }) }, _visibilityChanged: function(visible) { if (visible && this.option("crossScrollingEnabled")) { this._setTableSizes() } }, _setTableSizes: function() { var cellWidth = DATE_TABLE_CELL_WIDTH, minWidth = this._getWorkSpaceMinWidth(), $headerCells = this._$headerPanel.find("tr").last().find("th"); var width = cellWidth * $headerCells.length; if (width < minWidth) { width = minWidth } this._$headerPanel.width(width); this._$dateTable.width(width); this._$allDayTable.width(width) }, _getWorkSpaceMinWidth: function() { var minWidth = this._getWorkSpaceWidth(), workspaceContainerWidth = this.element().outerWidth() - this.getTimePanelWidth(); if (minWidth < workspaceContainerWidth) { minWidth = workspaceContainerWidth } return minWidth }, _dimensionChanged: function(e) { if (this.option("crossScrollingEnabled")) { this._setTableSizes() } }, _getElementClass: $.noop, _getRowCount: $.noop, _getCellCount: $.noop, _render: function() { this.callBase(); this._toggleGroupedClass(); this._renderView(); this._attachEvents() }, _toggleGroupedClass: function() { this.element().toggleClass(GROUPED_WORKSPACE_CLASS, this._getGroupCount() > 0) }, _renderView: function() { this._setFirstViewDate(); this._renderGroupHeader(); this._renderDateHeader(); this._renderAllDayPanel(); this._renderTimePanel(); this._renderDateTable() }, _setFirstViewDate: function() { this._firstViewDate = dateUtils.getFirstWeekDate(this.option("currentDate"), this._firstDayOfWeek() || dateLocalization.firstDayOfWeekIndex()); this._setStartDayHour(this._firstViewDate) }, _setStartDayHour: function(date) { if (commonUtils.isDefined(this.option("startDayHour"))) { date.setHours(this.option("startDayHour")) } }, _firstDayOfWeek: function() { return this.option("firstDayOfWeek") }, _attachEvents: function() { var that = this, pointerDownAction = this._createAction(function(e) { that._pointerDownHandler(e.jQueryEvent) }); this._createCellClickAction(); var cellSelector = "." + this._getDateTableCellClass() + ",." + ALL_DAY_TABLE_CELL_CLASS; this.element().off(SCHEDULER_WORKSPACE_DXPOINTERDOWN_EVENT_NAME).off(SCHEDULER_CELL_DXCLICK_EVENT_NAME).on(SCHEDULER_WORKSPACE_DXPOINTERDOWN_EVENT_NAME, function(e) { if (eventUtils.isMouseEvent(e) && e.which > 1) { e.preventDefault(); return } pointerDownAction({ jQueryEvent: e }) }).on(SCHEDULER_CELL_DXCLICK_EVENT_NAME, cellSelector, function(e) { var $cell = $(e.target); that._cellClickAction({ jQueryEvent: e, cellElement: $cell, cellData: that.getCellData($cell) }) }) }, _createCellClickAction: function() { var that = this; this._cellClickAction = this._createActionByOption("onCellClick", { afterExecute: function(e) { that._clickHandler(e.args[0].jQueryEvent) } }) }, _clickHandler: function(e) { var $target = $(e.target); if (this._showPopup && this._hasFocusClass($target)) { delete this._showPopup; this._showAddAppointmentPopup($target) } }, _pointerDownHandler: function(e) { var $target = $(e.target); if (!$target.hasClass(this._getDateTableCellClass()) && !$target.hasClass(ALL_DAY_TABLE_CELL_CLASS)) { this._isCellClick = false; return } this._isCellClick = true; if ($target.hasClass(DATE_TABLE_FOCUSED_CELL_CLASS)) { this._showPopup = true } else { this._setFocusedCell($target) } }, _showAddAppointmentPopup: function($cell) { var firstCellData = this.getCellData($cell.first()), lastCellData = this.getCellData($cell.last()); var args = { startDate: firstCellData.startDate, endDate: lastCellData.endDate }; if (commonUtils.isDefined(lastCellData.allDay)) { args.allDay = lastCellData.allDay } $.extend(args, lastCellData.groups); this.notifyObserver("showAddAppointmentPopup", args) }, _getGroupHeaderContainer: function() { return this._$thead }, _getDateHeaderContainer: function() { return this._$thead }, _renderGroupHeader: function() { var $container = this._getGroupHeaderContainer(); var groupCount = this._getGroupCount(); if (groupCount) { var groupRows = this._makeGroupRows(this.option("groups")); this._attachGroupCountAttr(groupRows.length); $container.append(groupRows) } }, _attachGroupCountAttr: function(groupRowCount) { this.element().attr("dx-group-row-count", groupRowCount) }, _makeGroupRows: function(groups) { return tableCreator.makeGroupedTable(tableCreator.HORIZONTAL, groups, { groupRowClass: this._getGroupRowClass(), groupHeaderClass: this._getGroupHeaderClass(), groupHeaderContentClass: this._getGroupHeaderContentClass() }, this._getCellCount() || 1) }, _renderDateHeader: function() { var $container = this._getDateHeaderContainer(), $headerRow = $("
").addClass(HEADER_ROW_CLASS), count = this._getCellCount(), repeatCount = this._calculateHeaderCellRepeatCount(); for (var j = 0; j < repeatCount; j++) { for (var i = 0; i < count; i++) { var text = this._getHeaderText(i), $cell = $("
").text(text).addClass(HEADER_PANEL_CELL_CLASS).attr("title", text); $headerRow.append($cell) } } $container.append($headerRow); return $headerRow }, _calculateHeaderCellRepeatCount: function() { return this._getGroupCount() || 1 }, _renderAllDayPanel: function() { var cellCount = this._getCellCount() * (this._getGroupCount() || 1); this._renderTableBody({ container: this._$allDayTable, rowCount: 1, cellCount: cellCount, cellClass: ALL_DAY_TABLE_CELL_CLASS, rowClass: ALL_DAY_TABLE_ROW_CLASS, dataGenerator: $.proxy(this._setAllDayCellData, this) }); this._toggleAllDayVisibility() }, _setAllDayCellData: function(cell, rowIndex, cellIndex) { var startDate = this._getDateByCellIndexes(rowIndex, cellIndex); startDate = dateUtils.trimTime(startDate); var data = { startDate: startDate, endDate: new Date(startDate.getTime() + DAY_MS), allDay: true }; var groups = this._getCellGroups(this._getGroupIndex(rowIndex, cellIndex)); if (groups.length) { data.groups = {} } for (var i = 0; i < groups.length; i++) { data.groups[groups[i].name] = groups[i].id } $.data(cell, CELL_DATA, data) }, _toggleAllDayVisibility: function() { var showAllDayPanel = this.option("showAllDayPanel"); this._$allDayPanel.toggle(showAllDayPanel); this._$allDayTitle.toggleClass(ALL_DAY_TITLE_HIDDEN_CLASS, !showAllDayPanel); this.element().toggleClass(WORKSPACE_WITH_ALL_DAY_CLASS, showAllDayPanel); this._changeAllDayVisibility() }, _changeAllDayVisibility: function() { this.element().toggleClass(WORKSPACE_WITH_COLLAPSED_ALL_DAY_CLASS, !this.option("allDayExpanded") && this.option("showAllDayPanel")) }, _renderTimePanel: function() { this._renderTableBody({ container: this._$timePanel, rowCount: this._getTimePanelRowCount(), cellCount: 1, cellClass: TIME_PANEL_CELL_CLASS, rowClass: TIME_PANEL_ROW_CLASS, dataGenerator: $.proxy(this._setTimePanelText, this) }) }, _getTimePanelRowCount: function() { return .5 * this._getCellCountInDay() }, _getCellCountInDay: function() { return Math.floor(this._calculateDayDuration() / this.option("hoursInterval")) }, _calculateDayDuration: function() { return this.option("endDayHour") - this.option("startDayHour") }, _setTimePanelText: function(td, i) { td.innerHTML = this._getTimeText(i) }, _getTimeText: function(i) { var startDayHour = this.option("startDayHour"), timeCellDuration = 2 * this.getCellDuration(), date = new Date(new Date(1970, 0).getTime() + timeCellDuration * i + 36e5 * startDayHour); return dateLocalization.format(date, "shorttime") }, _renderDateTable: function() { var groupCount = this._getGroupCount(); this._renderTableBody({ container: this._$dateTable, rowCount: this._getTotalRowCount(groupCount), cellCount: this._getTotalCellCount(groupCount), cellClass: this._getDateTableCellClass(), rowClass: this._getDateTableRowClass(), dataGenerator: $.proxy(this._setCellData, this) }); this._attachTablesEvents() }, _getTotalCellCount: function(groupCount) { groupCount = groupCount || 1; return this._getCellCount() * groupCount }, _getTotalRowCount: function(groupCount) { return this._getRowCount() }, _setCellData: function(cell, rowIndex, cellIndex) { var data = this._prepareCellData(cell, rowIndex, cellIndex); $.data(cell, CELL_DATA, data) }, _prepareCellData: function(cell, rowIndex, cellIndex) { var startDate = this._getDateByCellIndexes(rowIndex, cellIndex), endDate = this.calculateEndDate(startDate), data = { startDate: startDate, endDate: endDate, allDay: this._getTableAllDay() }, groups = this._getCellGroups(this._getGroupIndex(rowIndex, cellIndex)); if (groups.length) { data.groups = {} } for (var i = 0; i < groups.length; i++) { data.groups[groups[i].name] = groups[i].id } return data }, _getGroupIndex: function(rowIndex, cellIndex) { return Math.floor(cellIndex / this._getCellCount()) }, _getTableAllDay: function() { return false }, calculateEndDate: function(startDate) { return new Date(startDate.getTime() + this._getInterval()) }, _getGroupCount: function() { var groups = this.option("groups"), result = 0; for (var i = 0, len = groups.length; i < len; i++) { if (!i) { result = groups[i].items.length } else { result *= groups[i].items.length } } return result }, _getPathToLeaf: function(leafIndex) { var tree = this.invoke("createResourcesTree", this.option("groups")); function findLeafByIndex(data, index) { for (var i = 0; i < data.length; i++) { if (data[i].leafIndex === index) { return data[i] } else { var leaf = findLeafByIndex(data[i].children, index); if (leaf) { return leaf } } } } function makeBranch(leaf, result) { result = result || []; result.push(leaf.value); if (leaf.parent) { makeBranch(leaf.parent, result) } return result } var leaf = findLeafByIndex(tree, leafIndex); return makeBranch(leaf).reverse() }, _getCellGroups: function(groupIndex) { var result = []; if (this._getGroupCount()) { var groups = this.option("groups"); if (groupIndex < 0) { return } var path = this._getPathToLeaf(groupIndex); for (var i = 0; i < groups.length; i++) { result.push({ name: groups[i].name, id: path[i] }) } } return result }, _attachTablesEvents: function() { this._attachTableEvents(this._getDateTable()); this._attachTableEvents(this._getAllDayTable()) }, _attachTableEvents: function($table) { var cellHeight, cellWidth, that = this, isPointerDown = false; $table.off(SCHEDULER_CELL_DXDRAGENTER_EVENT_NAME).off(SCHEDULER_CELL_DXDROP_EVENT_NAME).off(SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME).off(SCHEDULER_CELL_DXPOINTERDOWN_EVENT_NAME).on(SCHEDULER_CELL_DXDRAGENTER_EVENT_NAME, "td", { itemSizeFunc: function($element) { if (!cellHeight) { cellHeight = $element.height() } if (!cellWidth) { cellWidth = $element.width() } return { width: cellWidth, height: cellHeight } } }, function(e) { if (that._$currentTableTarget) { that._$currentTableTarget.removeClass(DATE_TABLE_DROPPABLE_CELL_CLASS) } that._$currentTableTarget = $(e.target); that._$currentTableTarget.addClass(DATE_TABLE_DROPPABLE_CELL_CLASS) }).on(SCHEDULER_CELL_DXDROP_EVENT_NAME, "td", function(e) { $(e.target).removeClass(DATE_TABLE_DROPPABLE_CELL_CLASS); cellHeight = 0; cellWidth = 0 }).on(SCHEDULER_CELL_DXPOINTERDOWN_EVENT_NAME, "td", function(e) { if (eventUtils.isMouseEvent(e) && 1 === e.which) { isPointerDown = true; that.element().addClass(WORKSPACE_WITH_MOUSE_SELECTION_CLASS); $(document).off(SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME).on(SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME, function() { isPointerDown = false; that.element().removeClass(WORKSPACE_WITH_MOUSE_SELECTION_CLASS) }) } }).on(SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME, "td", function(e) { if (isPointerDown) { e.preventDefault(); e.stopPropagation(); that._moveToCell($(e.target), true) } }) }, _getDateTables: function() { return this._$dateTable.add(this._$allDayTable) }, _getDateTable: function() { return this._$dateTable }, _getAllDayTable: function() { return this._$allDayTable }, _getInterval: function() { if (void 0 === this._interval) { this._interval = this.option("hoursInterval") * HOUR_MS } return this._interval }, _getHeaderText: function(headerIndex) { return dateLocalization.format(this._getDateByIndex(headerIndex), this._getFormat()) }, _getDateByIndex: abstract, _getFormat: abstract, _calculateCellIndex: function(rowIndex, cellIndex) { cellIndex %= this._getCellCount(); return this._getRowCount() * cellIndex + rowIndex }, _renderTableBody: function(options) { options.container.append(tableCreator.makeTable(options)) }, _cleanView: function() { this._$thead.empty(); this._$dateTable.empty(); this._$timePanel.empty(); this._$allDayTable.empty(); delete this._hiddenInterval; delete this._interval }, getWorkArea: function() { return this._dateTableScrollable.content() }, getScrollable: function() { return this._dateTableScrollable }, getScrollableScrollTop: function() { return this._dateTableScrollable.scrollTop() }, getScrollableScrollLeft: function() { return this._dateTableScrollable.scrollLeft() }, getScrollableOuterWidth: function() { return this._dateTableScrollable.scrollWidth() }, getScrollableContainer: function() { return this._dateTableScrollable._container() }, getHeaderPanelHeight: function() { return this._$headerPanel.outerHeight(true) }, getTimePanelWidth: function() { return this._$timePanel.outerWidth() }, _getCellCoordinatesByIndex: function(index) { var cellIndex = Math.floor(index / this._getRowCount()), rowIndex = index - this._getRowCount() * cellIndex; return { cellIndex: cellIndex, rowIndex: rowIndex } }, _getDateByCellIndexes: function(rowIndex, cellIndex) { var firstViewDate = this.getStartViewDate(), currentDate = new Date(firstViewDate.getTime() + this._getMillisecondsOffset(rowIndex, cellIndex)); currentDate.setTime(currentDate.getTime() + dateUtils.getTimezonesDifference(firstViewDate, currentDate)); return currentDate }, _getMillisecondsOffset: function(rowIndex, cellIndex) { return this._getInterval() * this._calculateCellIndex(rowIndex, cellIndex) + this._calculateHiddenInterval(rowIndex, cellIndex) }, _calculateHiddenInterval: function(rowIndex, cellIndex) { var dayCount = cellIndex % this._getCellCount(); return dayCount * this._getHiddenInterval() }, _getHiddenInterval: function() { if (void 0 === this._hiddenInterval) { this._hiddenInterval = DAY_MS - this.option("hoursInterval") * this._getCellCountInDay() * HOUR_MS } return this._hiddenInterval }, _getIntervalBetween: function(currentDate, allDay) { var startDayTime = this.option("startDayHour") * HOUR_MS, firstViewDate = this.getStartViewDate(), timeZoneOffset = dateUtils.getTimezonesDifference(firstViewDate, currentDate), fullInterval = currentDate.getTime() - firstViewDate.getTime() - timeZoneOffset, days = Math.floor((fullInterval + startDayTime) / DAY_MS), result = days * DAY_MS; if (!allDay) { result = fullInterval - days * this._getHiddenInterval() } return result }, _getGroupIndexes: function(appointmentResources) { var result = []; if (appointmentResources && this.option("groups").length) { var tree = this.invoke("createResourcesTree", this.option("groups")); result = this.invoke("getResourceTreeLeaves", tree, appointmentResources) } return result }, _updateIndex: function(index) { return index * this._getRowCount() }, _getDroppableCell: function() { return this._getDateTables().find("." + DATE_TABLE_DROPPABLE_CELL_CLASS) }, _getWorkSpaceWidth: function() { if (this.option("crossScrollingEnabled")) { return this._$dateTable.outerWidth() } return this.element().outerWidth() - this.getTimePanelWidth() }, _getCellPositionByIndex: function(index, groupIndex) { var cellCoordinates = this._getCellCoordinatesByIndex(index), $cell = this._getCellByCoordinates(cellCoordinates, groupIndex); return this._getCellPosition($cell) }, _getCellPosition: function($cell) { var isRtl = this.option("rtlEnabled"), position = $cell.position(); if (isRtl) { position.left += $cell.outerWidth() } return position }, _getCellByCoordinates: function(cellCoordinates, groupIndex) { return this._$dateTable.find("tr").eq(cellCoordinates.rowIndex).find("td").eq(cellCoordinates.cellIndex + groupIndex * this._getCellCount()) }, _getCells: function(allDay) { var cellClass = allDay ? ALL_DAY_TABLE_CELL_CLASS : this._getDateTableCellClass(); return this.element().find("." + cellClass) }, _getGroupHeaderCellsContent: function() { return this.element().find("." + GROUP_HEADER_CONTENT_CLASS) }, _getGroupHeaderCells: function() { return this.element().find("." + GROUP_HEADER_CLASS) }, _getScrollCoordinates: function(hours, minutes, date) { var currentDate = date || new Date(this.option("currentDate")), startDayHour = this.option("startDayHour"), endDayHour = this.option("endDayHour"); if (hours < startDayHour) { hours = startDayHour } if (hours >= endDayHour) { hours = endDayHour - 1 } currentDate.setHours(hours); currentDate.setMinutes(minutes); return this.getCoordinatesByDate(currentDate) }, supportAllDayRow: function() { return true }, getCellData: function($cell) { var data = $cell[0] ? $.data($cell[0], CELL_DATA) : void 0; return $.extend(true, {}, data) }, getCoordinatesByDate: function(date, groupIndex, inAllDayRow) { groupIndex = groupIndex || 0; var index = this.getCellIndexByDate(date, inAllDayRow), position = this._getCellPositionByIndex(index, groupIndex), shift = this.getPositionShift(inAllDayRow ? 0 : this.getTimeShift(date)); if (!position) { throw errors.Error("E0139") } return { top: position.top + shift.top, left: position.left + shift.left, max: this.getMaxAllowedPosition()[groupIndex], groupIndex: groupIndex } }, getCellIndexByDate: function(date, inAllDayRow) { var timeInterval = inAllDayRow ? 864e5 : this._getInterval(), dateTimeStamp = this._getIntervalBetween(date, inAllDayRow); var index = Math.floor(dateTimeStamp / timeInterval); if (inAllDayRow) { index = this._updateIndex(index) } if (index < 0) { index = 0 } return index }, getPositionShift: function(timeShift) { return { top: timeShift * this.getCellHeight(), left: 0 } }, getTimeShift: function(date) { var cellDuration = this.getCellDuration(), currentDayStart = new Date(date); currentDayStart.setMinutes(0); currentDayStart.setHours(this.option("startDayHour")); return (date.getTime() - currentDayStart.getTime()) % cellDuration / cellDuration }, getCoordinatesByDateInGroup: function(date, appointmentResources, inAllDayRow) { var indexes = this._getGroupIndexes(appointmentResources), result = []; if (indexes.length) { for (var i = 0; i < indexes.length; i++) { result.push(this.getCoordinatesByDate(date, indexes[i], inAllDayRow)) } } else { result.push(this.getCoordinatesByDate(date, 0, inAllDayRow)) } return result }, getDroppableCellIndex: function() { var $droppableCell = this._getDroppableCell(), $row = $droppableCell.parent(), rowIndex = $row.index(); return rowIndex * $row.find("td").length + $droppableCell.index() }, getDataByDroppableCell: function() { var cellData = this.getCellData(this._getDroppableCell()); return { date: cellData.startDate, allDay: cellData.allDay, groups: cellData.groups } }, getDateRange: function() { return [this.getStartViewDate(), this.getEndViewDate()]; }, getCellWidth: function() { return this._getCells().first().outerWidth() }, getCellHeight: function() { return this._getCells().first().outerHeight() }, getAllDayHeight: function() { return this.option("showAllDayPanel") ? this._getCells(true).first().outerHeight() : 0 }, getMaxAllowedPosition: function() { var result = [], isRtl = this.option("rtlEnabled"); this._$dateTable.find("tr").first().find("td:nth-child(" + this._getCellCount() + "n)").each(function(_, cell) { var maxPosition = $(cell).position().left; if (!isRtl) { maxPosition += $(cell).outerWidth() } result.push(Math.floor(maxPosition)) }); return result }, getFixedContainer: function() { return this._$fixedContainer }, getAllDayContainer: function() { return this._$allDayContainer }, getCellIndexByCoordinates: function(coordinates, allDay) { var cellCount = this._getTotalCellCount(this._getGroupCount()), timePanelWidth = this.getTimePanelWidth(), cellWidth = Math.floor(this._getWorkSpaceWidth() / cellCount), leftOffset = this._isRTL() || this.option("crossScrollingEnabled") ? 0 : timePanelWidth, topIndex = Math.floor(coordinates.top / (allDay ? this.getAllDayHeight() : this.getCellHeight())), leftIndex = Math.floor((coordinates.left + 5 - leftOffset) / cellWidth); if (this._isRTL()) { leftIndex = cellCount - leftIndex - 1 } return cellCount * topIndex + leftIndex }, getStartViewDate: function() { return this._firstViewDate }, getEndViewDate: function() { var dateOfLastViewCell = this._getDateByCellIndexes(this._getRowCount() - 1, this._getCellCount() - 1); return new Date(dateOfLastViewCell.getTime() + this.getCellDuration() - 6e4) }, getCellDuration: function() { return 36e5 * this.option("hoursInterval") }, getGroupBounds: function(coordinates) { var cellIndex = this.getCellIndexByCoordinates(coordinates), cellCount = this._getCellCount(), groupIndex = Math.floor(cellIndex / cellCount), $cells = this._getCells(), cellWidth = this.getCellWidth(), startCellIndex = groupIndex * cellCount, startOffset = $cells.eq(startCellIndex).offset().left - cellWidth / 2, endOffset = $cells.eq(startCellIndex + cellCount - 1).offset().left + cellWidth + cellWidth / 2; var result = { left: startOffset, right: endOffset }; if (this._isRTL()) { result.left = endOffset - 2 * cellWidth; result.right = startOffset + 2 * cellWidth } return result }, getCellDataByCoordinates: function(coordinates, allDay) { var $cells = this._getCells(allDay), cellIndex = this.getCellIndexByCoordinates(coordinates, allDay), $cell = $cells.eq(cellIndex); return this.getCellData($cell) }, getVisibleBounds: function() { var result = {}, $scrollable = this.getScrollable().element(), cellHeight = this.getCellHeight(), scrolledCellCount = this.getScrollableScrollTop() / cellHeight, totalCellCount = scrolledCellCount + $scrollable.height() / cellHeight; result.top = { hours: Math.floor(scrolledCellCount * this.option("hoursInterval")) + this.option("startDayHour"), minutes: scrolledCellCount % 2 ? 30 : 0 }; result.bottom = { hours: Math.floor(totalCellCount * this.option("hoursInterval")) + this.option("startDayHour"), minutes: Math.floor(totalCellCount) % 2 ? 30 : 0 }; return result }, updateScrollPosition: function(date) { date = this.invoke("convertDateByTimezone", date); var bounds = this.getVisibleBounds(), startDateHour = date.getHours(), startDateMinutes = date.getMinutes(); if (this.needUpdateScrollPosition(startDateHour, startDateMinutes, bounds, date)) { this.scrollToTime(startDateHour, startDateMinutes, date) } }, needUpdateScrollPosition: function(hours, minutes, bounds) { var isUpdateNeeded = false; if (hours < bounds.top.hours || hours > bounds.bottom.hours) { isUpdateNeeded = true } if (hours === bounds.top.hours && minutes < bounds.top.minutes) { isUpdateNeeded = true } if (hours === bounds.bottom.hours && minutes > bounds.top.minutes) { isUpdateNeeded = true } return isUpdateNeeded }, getGroupWidth: function(groupIndex) { var result = this._getCellCount() * this.getCellWidth(), position = this.getMaxAllowedPosition(), currentPosition = position[groupIndex]; if (position.length && currentPosition) { if (this._isRTL()) { result = currentPosition - position[groupIndex + 1] } else { if (0 === groupIndex) { result = currentPosition } else { result = currentPosition - position[groupIndex - 1] } } } return result }, restoreScrollTop: function() { this.element().scrollTop(0) }, scrollToTime: function(hours, minutes, date) { var coordinates = this._getScrollCoordinates(hours, minutes, date), scrollable = this.getScrollable(); scrollable.scrollBy(coordinates.top - scrollable.scrollTop()) }, getDistanceBetweenCells: function(startIndex, endIndex) { var result = 0; this.element().find("." + this._getDateTableRowClass()).first().find("." + this._getDateTableCellClass()).each(function(index) { if (index < startIndex || index > endIndex) { return true } result += $(this).outerWidth() }); return result } }).include(publisherMixin); registerComponent("dxSchedulerWorkSpace", SchedulerWorkSpace); module.exports = SchedulerWorkSpace }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!****************************!*\ !*** ./Scripts/ui/tabs.js ***! \****************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), devices = __webpack_require__( /*! ../core/devices */ 7), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 3), Button = __webpack_require__( /*! ./button */ 24), inkRipple = __webpack_require__( /*! ./widget/utils.ink_ripple */ 48), eventUtils = __webpack_require__( /*! ../events/utils */ 4), domUtils = __webpack_require__( /*! ../core/utils/dom */ 11), pointerEvents = __webpack_require__( /*! ../events/pointer */ 13), themes = __webpack_require__( /*! ./themes */ 23), holdEvent = __webpack_require__( /*! ../events/hold */ 63), Scrollable = __webpack_require__( /*! ./scroll_view/ui.scrollable */ 72).default, CollectionWidget = __webpack_require__( /*! ./collection/ui.collection_widget.edit */ 27); var TABS_CLASS = "dx-tabs", TABS_WRAPPER_CLASS = "dx-tabs-wrapper", TABS_EXPANDED_CLASS = "dx-tabs-expanded", TABS_SCROLLABLE_CLASS = "dx-tabs-scrollable", TABS_NAV_BUTTONS_CLASS = "dx-tabs-nav-buttons", TABS_ITEM_CLASS = "dx-tab", TABS_ITEM_SELECTED_CLASS = "dx-tab-selected", TABS_NAV_BUTTON_CLASS = "dx-tabs-nav-button", TABS_LEFT_NAV_BUTTON_CLASS = "dx-tabs-nav-button-left", TABS_RIGHT_NAV_BUTTON_CLASS = "dx-tabs-nav-button-right", TABS_ITEM_DATA_KEY = "dxTabData", FEEDBACK_HIDE_TIMEOUT = 100, FEEDBACK_DURATION_INTERVAL = 5, FEEDBACK_SCROLL_TIMEOUT = 300, TAB_OFFSET = 30; var Tabs = CollectionWidget.inherit({ _activeStateUnit: "." + TABS_ITEM_CLASS, _getDefaultOptions: function() { return $.extend(this.callBase(), { hoverStateEnabled: true, showNavButtons: false, scrollByContent: true, scrollingEnabled: true, selectionMode: "single", activeStateEnabled: true, selectionRequired: false, selectOnFocus: true, loopItemFocus: false, useInkRipple: false }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: { platform: "generic" }, options: { showNavButtons: true, scrollByContent: false } }, { device: function(device) { return "desktop" === devices.real().deviceType && !devices.isSimulator() }, options: { focusStateEnabled: true } }, { device: function() { return /android5/.test(themes.current()) }, options: { useInkRipple: true } }]) }, _init: function() { this.callBase(); this.setAria("role", "tablist"); this.element().addClass(TABS_CLASS); this._renderMultiple(); this._feedbackHideTimeout = FEEDBACK_HIDE_TIMEOUT }, _itemClass: function() { return TABS_ITEM_CLASS }, _selectedItemClass: function() { return TABS_ITEM_SELECTED_CLASS }, _itemDataKey: function() { return TABS_ITEM_DATA_KEY }, _renderContent: function() { var that = this; this.callBase(); if (this.option("templatesRenderAsynchronously")) { this._resizeEventTimer = setTimeout(function() { domUtils.triggerResizeEvent(that._$content) }, 0) } }, _render: function() { this.callBase(); this._renderWrapper(); this._renderScrolling(); this.setAria("role", "tab", this.itemElements()); this.option("useInkRipple") && this._renderInkRipple() }, _renderScrolling: function() { this.element().removeClass(TABS_EXPANDED_CLASS); if (this._allowScrolling() && !this._scrollable) { this._renderScrollable(); this._renderNavButtons(); this._scrollToItem(this.option("selectedItem")) } if (!this._allowScrolling()) { this._cleanScrolling(); this.element().removeClass(TABS_NAV_BUTTONS_CLASS).addClass(TABS_EXPANDED_CLASS) } }, _cleanNavButtons: function() { if (!this._leftButton || !this._rightButton) { return } this._leftButton.element().remove(); this._rightButton.element().remove(); this._leftButton = null; this._rightButton = null }, _cleanScrolling: function() { if (!this._scrollable) { return } this._scrollable.content().children("." + TABS_WRAPPER_CLASS).appendTo(this._itemContainer()); this._scrollable.element().remove(); this._scrollable = null; this._cleanNavButtons() }, _renderInkRipple: function() { this._inkRipple = inkRipple.render() }, _toggleActiveState: function($element, value, e) { this.callBase.apply(this, arguments); if (!this._inkRipple) { return } var config = { element: $element, jQueryEvent: e }; if (value) { this._inkRipple.showWave(config) } else { this._inkRipple.hideWave(config) } }, _renderMultiple: function() { if ("multiple" === this.option("selectionMode")) { this.option("selectOnFocus", false) } }, _renderWrapper: function() { this.element().wrapInner($("
").addClass(TABS_WRAPPER_CLASS)) }, _renderScrollable: function() { var $itemContainer = this.element().wrapInner($("
").addClass(TABS_SCROLLABLE_CLASS)).children(); this._scrollable = this._createComponent($itemContainer, Scrollable, { direction: "horizontal", showScrollbar: false, useKeyboard: false, useNative: false, scrollByContent: this.option("scrollByContent"), onScroll: $.proxy(this._updateNavButtonsVisibility, this) }); this.element().append(this._scrollable.element()) }, _scrollToItem: function(itemData) { if (!this._scrollable) { return } var $item = this._editStrategy.getItemElement(itemData); this._scrollable.scrollToElement($item) }, _allowScrolling: function() { if (!this.option("scrollingEnabled")) { return false } var tabItemsWidth = 0; this.itemElements().each(function(_, tabItem) { tabItemsWidth += $(tabItem).outerWidth(true) }); return tabItemsWidth - 1 > this.element().width() }, _renderNavButtons: function() { this.element().toggleClass(TABS_NAV_BUTTONS_CLASS, this.option("showNavButtons")); if (!this.option("showNavButtons")) { return } this._leftButton = this._createNavButton(-TAB_OFFSET, "chevronprev"); var $leftButton = this._leftButton.element(); $leftButton.addClass(TABS_LEFT_NAV_BUTTON_CLASS); this.element().prepend($leftButton); this._rightButton = this._createNavButton(TAB_OFFSET, "chevronnext"); var $rightButton = this._rightButton.element(); $rightButton.addClass(TABS_RIGHT_NAV_BUTTON_CLASS); this.element().append($rightButton); this._updateNavButtonsVisibility(); this._scrollable.update(); if (this.option("rtlEnabled")) { this._scrollable.scrollTo({ left: this._scrollable.scrollWidth() - this._scrollable.clientWidth() }) } }, _updateNavButtonsVisibility: function() { this._leftButton && this._leftButton.option("disabled", this._scrollable.scrollLeft() <= 0); this._rightButton && this._rightButton.option("disabled", this._scrollable.scrollLeft() >= this._scrollable.scrollWidth() - this._scrollable.clientWidth()) }, _updateScrollPosition: function(offset, duration) { this._scrollable.update(); this._scrollable.scrollBy(offset / duration) }, _createNavButton: function(offset, icon) { var that = this; var holdAction = that._createAction(function() { that._holdInterval = setInterval(function() { that._updateScrollPosition(offset, FEEDBACK_DURATION_INTERVAL) }, FEEDBACK_DURATION_INTERVAL) }), holdEventName = eventUtils.addNamespace(holdEvent.name, "dxNavButton"), pointerUpEventName = eventUtils.addNamespace(pointerEvents.up, "dxNavButton"), pointerOutEventName = eventUtils.addNamespace(pointerEvents.out, "dxNavButton"); var navButton = this._createComponent($("
").addClass(TABS_NAV_BUTTON_CLASS), Button, { focusStateEnabled: false, icon: icon, onClick: function() { that._updateScrollPosition(offset, 1) }, _templates: {} }); navButton.element().on(holdEventName, { timeout: FEEDBACK_SCROLL_TIMEOUT }, $.proxy(function(e) { holdAction({ jQueryEvent: e }) }, this)).on(pointerUpEventName, function() { that._clearInterval() }).on(pointerOutEventName, function() { that._clearInterval() }); return navButton }, _clearInterval: function() { if (this._holdInterval) { clearInterval(this._holdInterval) } }, _renderSelection: function(addedSelection) { this._scrollable && this._scrollable.scrollToElement(this.itemElements().eq(addedSelection[0]), { left: 1, right: 1 }) }, _visibilityChanged: function(visible) { if (visible) { this._dimensionChanged() } }, _dimensionChanged: function() { if (this.option("scrollingEnabled")) { this._renderScrolling() } }, _itemSelectHandler: function(e) { if ("single" === this.option("selectionMode") && this.isItemSelected(e.currentTarget)) { return } this.callBase(e) }, _clean: function() { this._scrollable = null; clearTimeout(this._resizeEventTimer); this.callBase() }, _optionChanged: function(args) { switch (args.name) { case "useInkRipple": case "scrollingEnabled": case "showNavButtons": this._invalidate(); break; case "scrollByContent": this._scrollable && this._scrollable.option(args.name, args.value); break; case "selectionMode": this._renderMultiple(); this.callBase(args); break; default: this.callBase(args) } } }); registerComponent("dxTabs", Tabs); module.exports = Tabs }.call(exports, __webpack_require__, exports, module), void 0 !== __WEBPACK_AMD_DEFINE_RESULT__ && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) }, /*!*********************************!*\ !*** ./Scripts/ui/tree_view.js ***! \*********************************/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__; !(__WEBPACK_AMD_DEFINE_RESULT__ = function(require, exports, module) { var $ = __webpack_require__( /*! jquery */ 1), messageLocalization = __webpack_require__( /*! ../localization/message */ 8), clickEvent = __webpack_require__( /*! ../events/click */ 9), commonUtils = __webpack_require__( /*! ../core/utils/common */ 2), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 3), CheckBox = __webpack_require__( /*! ./check_box */ 101), HierarchicalCollectionWidget = __webpack_require__( /*! ./hierarchical_collection/ui.hierarchical_collection_widget */ 313), eventUtils = __webpack_require__( /*! ../events/utils */ 4), pointerEvents = __webpack_require__( /*! ../events/pointer */ 13), dblclickEvent = __webpack_require__( /*! ../events/dblclick */ 178), fx = __webpack_require__( /*! ../animation/fx */ 21), Scrollable = __webpack_require__( /*! ./scroll_view/ui.scrollable */ 72).default, LoadIndicator = __webpack_require__( /*! ./load_indicator */ 60); var WIDGET_CLASS = "dx-treeview", NODE_CONTAINER_CLASS = "dx-treeview-node-container", OPENED_NODE_CONTAINER_CLASS = "dx-treeview-node-container-opened", NODE_CLASS = "dx-treeview-node", ITEM_CLASS = "dx-treeview-item", ITEM_WITH_CHECKBOX_CLASS = "dx-treeview-item-with-checkbox", ITEM_DATA_KEY = "dx-treeview-item-data", IS_LEAF = "dx-treeview-node-is-leaf", TOGGLE_ITEM_VISIBILITY_CLASS = "dx-treeview-toggle-item-visibility", TOGGLE_ITEM_VISIBILITY_OPENED_CLASS = "dx-treeview-toggle-item-visibility-opened", SELECT_ALL_ITEM_CLASS = "dx-treeview-select-all-item", DISABLED_STATE_CLASS = "dx-state-disabled", SELECTED_ITEM_CLASS = "dx-state-selected", DATA_ITEM_ID = "data-item-id"; var TreeView = HierarchicalCollectionWidget.inherit({ _supportedKeys: function(e) { var click = function(e) { var $itemElement = this.option("focusedElement"); if (!$itemElement) { return } e.target = $itemElement; e.currentTarget = $itemElement; this._itemClickHandler(e, $itemElement.find(">." + ITEM_CLASS)) }; var select = function(e) { e.preventDefault(); this._changeCheckBoxState(this.option("focusedElement")) }; var toggleExpandedNestedItems = function(state, e) { if (!this.option("expandAllEnabled")) { return } e.preventDefault(); var $rootElement = this.option("focusedElement"); if (!$rootElement) { return } var rootItem = this._getItemData($rootElement.find("." + ITEM_CLASS)); this._toggleExpandedNestedItems([rootItem], state) }; return $.extend(this.callBase(), { enter: this._showCheckboxes() ? select : click, space: this._showCheckboxes() ? select : click, asterisk: $.proxy(toggleExpandedNestedItems, this, true), minus: $.proxy(toggleExpandedNestedItems, this, false) }) }, _changeCheckBoxState: function($element) { var checkboxInstance = this._getCheckBoxInstance($element), currentState = checkboxInstance.option("value"); if (!checkboxInstance.option("disabled")) { this._updateItemSelection(!currentState, $element.find("." + ITEM_CLASS).get(0), true, $element) } }, _toggleExpandedNestedItems: function(items, state) { if (!items) { return } for (var i = 0, len = items.length; i < len; i++) { var item = items[i], node = this._dataAdapter.getNodeByItem(item); this._toggleExpandedState(node, state); this._toggleExpandedNestedItems(item.items, state) } }, _getNodeElement: function(node) { return this.element().find("[" + DATA_ITEM_ID + "='" + commonUtils.normalizeKey(node.internalFields.key) + "']") }, _activeStateUnit: "." + ITEM_CLASS, _widgetClass: function() { return WIDGET_CLASS }, _getDefaultOptions: function() { return $.extend(this.callBase(), { animationEnabled: true, dataStructure: "tree", expandAllEnabled: false, hasItemsExpr: "hasItems", selectNodesRecursive: true, expandNodesRecursive: true, showCheckBoxesMode: "none", selectAllText: messageLocalization.format("dxList-selectAll"), onItemSelectionChanged: null, onItemExpanded: null, onItemCollapsed: null, scrollDirection: "vertical", virtualModeEnabled: false, rootValue: 0, searchValue: "", focusStateEnabled: false, selectionMode: "multiple", expandEvent: "dblclick", selectByClick: false }) }, _setDeprecatedOptions: function() { this.callBase(); $.extend(this._deprecatedOptions, { showCheckBoxes: { since: "15.2", message: "use 'showCheckBoxesMode' option instead" }, selectAllEnabled: { since: "15.2", message: "use 'showCheckBoxesMode' option instead" }, onItemSelected: { since: "16.1", alias: "onItemSelectionChanged" } }) }, _initSelectedItems: $.noop, _syncSelectionOptions: $.noop, _fireSelectionChanged: function() { var selectionChangePromise = this._selectionChangePromise; $.when(selectionChangePromise).done($.proxy(function() { this._createActionByOption("onSelectionChanged", { excludeValidators: ["disabled", "readOnly"] })() }, this)) }, _checkBoxModeChange: function(value, previousValue) { if ("none" === previousValue || "none" === value) { this.repaint(); return } var selectAllExists = this._$selectAllItem && this._$selectAllItem.length; switch (value) { case "selectAll": !selectAllExists && this._renderSelectAllItem(); break; case "normal": if (selectAllExists) { this._$selectAllItem.remove(); delete this._$selectAllItem } } }, _removeSelection: function() { var that = this; $.each(this._dataAdapter.getFullData(), function(_, node) { if (!that._hasChildren(node)) { return } that._dataAdapter.toggleSelection(node.internalFields.key, false, true) }) }, _optionChanged: function(args) { var name = args.name, value = args.value, previousValue = args.previousValue; switch (name) { case "showCheckBoxes": this.option("showCheckBoxesMode", value ? "normal" : "none"); break; case "selectAllEnabled": this.option("showCheckBoxesMode", value ? "selectAll" : "normal"); break; case "selectAllText": if (this._$selectAllItem) { this._$selectAllItem.dxCheckBox("instance").option("text", value) } break; case "showCheckBoxesMode": this._checkBoxModeChange(value, previousValue); break; case "scrollDirection": this._scrollableContainer.option("direction", value); break; case "items": delete this._$selectAllItem; this.callBase(args); break; case "dataSource": this.callBase(args); this._initDataAdapter(); this._filter = {}; break; case "hasItemsExpr": this._initAccessors(); this.repaint(); break; case "expandEvent": this._toggleExpandEvent(args.previousValue, args.value); break; case "dataStructure": case "rootValue": case "searchValue": if ((!value.length || value < previousValue) && "none" !== this.option("showCheckBoxesMode")) { this._removeSelection() } this._initDataAdapter(); this.repaint(); break; case "selectNodesRecursive": case "expandNodesRecursive": case "onItemSelectionChanged": case "onItemExpanded": case "onItemCollapsed": case "expandAllEnabled": case "animationEnabled": case "virtualModeEnabled": case "selectByClick": break; default: this.callBase(args) } }, _initDataSource: function() { var that = this, filter = this._filter; this.callBase(); if (this._isVirtualMode()) { if (!filter.custom) { filter.custom = this._dataSource.filter() } if (!filter.internal) { filter.internal = [this.option("parentIdExpr"), this.option("rootValue")] } var resultFilter = this._combineFilter(); this._dataSource.filter(resultFilter); this._dataSource.on("loadingChanged", function(isLoading) { if (isLoading && !this.isLoaded()) { that.option("items", []); that._dataSource.filter() !== resultFilter && that._dataSource.filter([]) } }) } }, _combineFilter: function() { if (!this._filter.custom || !this._filter.custom.length) { return this._filter.internal } return [this._filter.custom, this._filter.internal] }, _dataSourceLoadErrorHandler: function() { this._renderEmptyMessage() }, _init: function() { this._filter = {}; this.callBase(); this._initStoreChangeHandlers(); this._initCheckBoxesMode() }, _dataSourceChangedHandler: function(newItems) { var isInArray = $.inArray(newItems[0], this.option("items")) + 1; if (!this._initialized || !this._isVirtualMode() || !this.option("items").length) { this.option("items", newItems); return } if (!isInArray) { this.option().items = this.option("items").concat(newItems); this._initDataAdapter() }!this._contentAlreadyRendered && this._renderContent() }, _initStoreChangeHandlers: function() { if ("plain" !== this.option("dataStructure")) { return } var that = this; this._dataSource && this._dataSource.store().on("inserted", function(newItem) { that.option().items = that.option("items").concat(newItem); that._dataAdapter.addItem(newItem); if (!that._isFiltered(newItem)) { return } that._updateLevel(that._parentIdGetter(newItem)) }).on("removed", function(removedKey) { var node = that._dataAdapter.getNodeByKey(removedKey); that.option("items")[that._dataAdapter.getIndexByKey(node.internalFields.key)] = 0; that._markChildrenItemsToRemove(node); that._removeItems(); that._dataAdapter.removeItem(removedKey); that._updateLevel(that._parentIdGetter(node)) }) }, _markChildrenItemsToRemove: function(node) { var that = this, keys = node.internalFields.childrenKeys; $.each(keys, function(_, key) { that.option("items")[that._dataAdapter.getIndexByKey(key)] = 0; that._markChildrenItemsToRemove(that._dataAdapter.getNodeByKey(key)) }) }, _removeItems: function() { var that = this, counter = 0, items = $.extend(true, [], this.option("items")); $.each(items, function(index, item) { if (!item) { that.option("items").splice(index - counter, 1); counter++ } }) }, _isFiltered: function(item) { var value = this.option("searchValue"), reg = new RegExp(value, "i"); return reg.test(this._displayGetter(item)) }, _updateLevel: function(parentId) { var $container = this._getContainerByParentKey(parentId); this._renderItems($container, this._dataAdapter.getChildrenNodes(parentId)) }, _getOldContainer: function($itemElement) { if ($itemElement.length) { return $itemElement.find(" > ." + NODE_CONTAINER_CLASS) } if (this._scrollableContainer) { return this._scrollableContainer.content().children() } return $() }, _getContainerByParentKey: function(parentId) { var $container, node = this._dataAdapter.getNodeByKey(parentId), $itemElement = node ? this._getNodeElement(node) : []; this._getOldContainer($itemElement).remove(); $container = this._renderNodeContainer($itemElement); if (this._isRootLevel(parentId)) { if (!this._scrollableContainer) { this._renderScrollableContainer() } this._scrollableContainer.content().append($container) } return $container }, _isRootLevel: function(parentId) { return parentId === this.option("rootValue") }, _getAccessors: function() { return ["key", "display", "selected", "expanded", "items", "parentId", "disabled", "hasItems"] }, _getDataAdapterOptions: function() { return { rootValue: this.option("rootValue"), multipleSelection: !this._isSingleSelection(), recursiveSelection: this.option("selectNodesRecursive"), recursiveExpansion: this.option("expandNodesRecursive"), searchValue: this.option("searchValue"), dataType: this.option("dataStructure") } }, _render: function() { this._attachPointerEventHandler(); this.callBase(); this.setAria("role", "tree") }, _attachPointerEventHandler: function() { var that = this, event = pointerEvents.down; this.element().off(event).on(event, function(e) { var $target = $(e.target).closest(that._activeStateUnit); if (!$target.length) { e.preventDefault() } }) }, _renderContentImpl: function() { if (!this.option("items").length) { return } var $nodeContainer = this._renderNodeContainer(); this._renderScrollableContainer(); this._scrollableContainer.content().append($nodeContainer); this._renderItems($nodeContainer, this._dataAdapter.getRootNodes()); this._toggleExpandEvent(null, this.option("expandEvent")); if (this._selectAllEnabled()) { this._renderSelectAllItem($nodeContainer) } }, _isVirtualMode: function() { return this.option("virtualModeEnabled") && this._isDataStructurePlain() && this.option("dataSource") }, _isDataStructurePlain: function() { return "plain" === this.option("dataStructure") }, _fireContentReadyAction: function() { this.callBase(); if (this._scrollableContainer && this._scrollableContainer.content().height() > this.element().height()) { this._scrollableContainer.update() } }, _renderScrollableContainer: function() { this._scrollableContainer = this._createComponent($("
").appendTo(this.element()), Scrollable, { direction: this.option("scrollDirection"), useKeyboard: false }) }, _renderNodeContainer: function($parent) { var $container = $("