/*! * DevExtreme (dx.all.debug.js) * Version: 19.1.16 * Build date: Tue Oct 18 2022 * * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ "use strict"; ! function(modules) { var installedModules = {}; function __webpack_require__(moduleId) { if (installedModules[moduleId]) { return installedModules[moduleId].exports } var module = installedModules[moduleId] = { i: moduleId, l: false, exports: {} }; modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); module.l = true; return module.exports } __webpack_require__.m = modules; __webpack_require__.c = installedModules; __webpack_require__.d = function(exports, name, getter) { if (!__webpack_require__.o(exports, name)) { Object.defineProperty(exports, name, { configurable: false, enumerable: true, get: getter }) } }; __webpack_require__.n = function(module) { var getter = module && module.__esModule ? function() { return module.default } : function() { return module }; __webpack_require__.d(getter, "a", getter); return getter }; __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property) }; __webpack_require__.p = ""; return __webpack_require__(__webpack_require__.s = 859) }([ /*!***************************************************!*\ !*** ./artifacts/transpiled/core/utils/extend.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var isPlainObject = __webpack_require__( /*! ./type */ 1).isPlainObject; var extendFromObject = function(target, source, overrideExistingValues) { target = target || {}; for (var prop in source) { if (Object.prototype.hasOwnProperty.call(source, prop)) { var value = source[prop]; if (!(prop in target) || overrideExistingValues) { target[prop] = value } } } return target }; var extend = function extend(target) { target = target || {}; var i = 1; var deep = false; if ("boolean" === typeof target) { deep = target; target = arguments[1] || {}; i++ } for (; i < arguments.length; i++) { var source = arguments[i]; if (null == source) { continue } for (var key in source) { var targetValue = target[key]; var sourceValue = source[key]; var sourceValueIsArray = false; var clone; if ("__proto__" === key || target === sourceValue) { continue } if (deep && sourceValue && (isPlainObject(sourceValue) || (sourceValueIsArray = Array.isArray(sourceValue)))) { if (sourceValueIsArray) { clone = targetValue && Array.isArray(targetValue) ? targetValue : [] } else { clone = targetValue && isPlainObject(targetValue) ? targetValue : {} } target[key] = extend(deep, clone, sourceValue) } else { if (void 0 !== sourceValue) { target[key] = sourceValue } } } } return target }; exports.extend = extend; exports.extendFromObject = extendFromObject }, /*!*************************************************!*\ !*** ./artifacts/transpiled/core/utils/type.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var types = { "[object Array]": "array", "[object Date]": "date", "[object Object]": "object", "[object String]": "string", "[object Null]": "null" }; var type = function(object) { var typeOfObject = Object.prototype.toString.call(object); return "object" === _typeof(object) ? types[typeOfObject] || "object" : _typeof(object) }; var isBoolean = function(object) { return "boolean" === typeof object }; var isExponential = function(value) { return isNumeric(value) && value.toString().indexOf("e") !== -1 }; var isDate = function(object) { return "date" === type(object) }; var isDefined = function(object) { return null !== object && void 0 !== object }; var isFunction = function(object) { return "function" === typeof object }; var isString = function(object) { return "string" === typeof object }; var isNumeric = function(object) { return "number" === typeof object && isFinite(object) || !isNaN(object - parseFloat(object)) }; var isObject = function(object) { return "object" === type(object) }; var isEmptyObject = function(object) { var property; for (property in object) { return false } return true }; var isPlainObject = function(object) { if (!object || "[object Object]" !== Object.prototype.toString.call(object)) { return false } var proto = Object.getPrototypeOf(object); var ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor; return "function" === typeof ctor && Object.toString.call(ctor) === Object.toString.call(Object) }; var isPrimitive = function(value) { return ["object", "array", "function"].indexOf(type(value)) === -1 }; var isWindow = function(object) { return null != object && object === object.window }; var isRenderer = function(object) { return !!(object.jquery || object.dxRenderer) }; var isPromise = function(object) { return object && isFunction(object.then) }; var isDeferred = function(object) { return object && isFunction(object.done) && isFunction(object.fail) }; exports.isBoolean = isBoolean; exports.isExponential = isExponential; exports.isDate = isDate; exports.isDefined = isDefined; exports.isFunction = isFunction; exports.isString = isString; exports.isNumeric = isNumeric; exports.isObject = isObject; exports.isEmptyObject = isEmptyObject; exports.isPlainObject = isPlainObject; exports.isPrimitive = isPrimitive; exports.isWindow = isWindow; exports.isRenderer = isRenderer; exports.isPromise = isPromise; exports.isDeferred = isDeferred; exports.type = type }, /*!***********************************************!*\ !*** ./artifacts/transpiled/core/renderer.js ***! \***********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var rendererBase = __webpack_require__( /*! ./renderer_base */ 253); module.exports = rendererBase.get() }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/core/utils/iterator.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var map = function(values, callback) { if (Array.isArray(values)) { return values.map(callback) } var result = []; for (var key in values) { result.push(callback(values[key], key)) } return result }; var each = function(values, callback) { if (!values) { return } if ("length" in values) { for (var i = 0; i < values.length; i++) { if (false === callback.call(values[i], i, values[i])) { break } } } else { for (var key in values) { if (false === callback.call(values[key], key, values[key])) { break } } } return values }; var reverseEach = function(array, callback) { if (!array || !("length" in array) || 0 === array.length) { return } for (var i = array.length - 1; i >= 0; i--) { if (false === callback.call(array[i], i, array[i])) { break } } }; exports.map = map; exports.each = each; exports.reverseEach = reverseEach }, /*!***************************************************!*\ !*** ./artifacts/transpiled/core/utils/common.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _config = __webpack_require__( /*! ../config */ 31); var _config2 = _interopRequireDefault(_config); var _guid = __webpack_require__( /*! ../guid */ 40); var _guid2 = _interopRequireDefault(_guid); var _deferred = __webpack_require__( /*! ../utils/deferred */ 6); var _iterator = __webpack_require__( /*! ./iterator */ 3); var _data = __webpack_require__( /*! ./data */ 20); var _type = __webpack_require__( /*! ./type */ 1); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var ensureDefined = function(value, defaultValue) { return (0, _type.isDefined)(value) ? value : defaultValue }; var executeAsync = function(action, context) { var deferred = new _deferred.Deferred; var normalizedContext = context || this; var task = { promise: deferred.promise(), abort: function() { clearTimeout(timerId); deferred.rejectWith(normalizedContext) } }; var callback = function() { var result = action.call(normalizedContext); if (result && result.done && (0, _type.isFunction)(result.done)) { result.done(function() { deferred.resolveWith(normalizedContext) }) } else { deferred.resolveWith(normalizedContext) } }; var 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 || new _deferred.Deferred; delayedDeferreds.push(deferred); return deferred } else { var oldExecutingName = executingName; var currentDelayedCount = delayedDeferreds.length; executingName = name; var result = func(); if (!result) { if (delayedDeferreds.length > currentDelayedCount) { result = _deferred.when.apply(this, 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 || (0, _deferred.when)() } }; 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 = []; var maxMatchCount = 0; (0, _iterator.each)(items, function(index, itemSrc) { var matchCount = 0; var item = mapFn ? mapFn(itemSrc) : itemSrc; (0, _iterator.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 (Array.isArray(value) && Array.isArray(targetValue)) { var mismatch = false; (0, _iterator.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 normalizeKey = function(id) { var key = (0, _type.isString)(id) ? id : id.toString(); var arr = key.match(/[^a-zA-Z0-9_]/g); arr && (0, _iterator.each)(arr, function(_, sign) { key = key.replace(sign, "__" + sign.charCodeAt() + "__") }); return key }; var denormalizeKey = function(key) { var arr = key.match(/__\d+__/g); arr && arr.forEach(function(char) { var charCode = parseInt(char.replace("__", "")); key = key.replace(char, String.fromCharCode(charCode)) }); return key }; var isArraysEqualByValue = function(array1, array2, deep) { if (array1.length !== array2.length) { return false } for (var i = 0; i < array1.length; i++) { if (!equalByValue(array1[i], array2[i], deep + 1)) { return false } } return true }; var isObjectsEqualByValue = function(object1, object2, deep) { for (var propertyName in object1) { if (Object.prototype.hasOwnProperty.call(object1, propertyName) && !equalByValue(object1[propertyName], object2[propertyName], deep + 1)) { return false } } for (var _propertyName in object2) { if (!(_propertyName in object1)) { return false } } return true }; var pairToObject = function(raw, preventRound) { var pair = splitPair(raw); var h = preventRound ? parseFloat(pair && pair[0]) : parseInt(pair && pair[0], 10); var v = preventRound ? parseFloat(pair && pair[1]) : parseInt(pair && pair[1], 10); if (!isFinite(h)) { h = 0 } if (!isFinite(v)) { v = h } return { h: h, v: v } }; var maxEqualityDeep = 3; var equalByValue = function(object1, object2, deep) { deep = deep || 0; object1 = (0, _data.toComparable)(object1, true); object2 = (0, _data.toComparable)(object2, true); if (object1 === object2 || deep >= maxEqualityDeep) { return true } if ((0, _type.isObject)(object1) && (0, _type.isObject)(object2)) { return isObjectsEqualByValue(object1, object2, deep) } else { if (Array.isArray(object1) && Array.isArray(object2)) { return isArraysEqualByValue(object1, object2, deep) } } return false }; var getKeyHash = function(key) { if (key instanceof _guid2.default) { return key.toString() } else { if ((0, _type.isObject)(key) || Array.isArray(key)) { try { var keyHash = JSON.stringify(key); return "{}" === keyHash ? key : keyHash } catch (e) { return key } } } return key }; var escapeRegExp = function(string) { return string.replace(/[[\]{}\-()*+?.\\^$|\s]/g, "\\$&") }; var applyServerDecimalSeparator = function(value) { var separator = (0, _config2.default)().serverDecimalSeparator; if ((0, _type.isDefined)(value)) { value = value.toString().replace(".", separator) } return value }; var noop = function() {}; var asyncNoop = function() { return (new _deferred.Deferred).resolve().promise() }; var grep = function(elements, checkFunction, invert) { var result = []; var expectedCheck = !invert; for (var i = 0; i < elements.length; i++) { var check = !!checkFunction(elements[i], i); if (check === expectedCheck) { result.push(elements[i]) } } return result }; exports.ensureDefined = ensureDefined; exports.executeAsync = executeAsync; exports.deferRender = deferRender; exports.deferRenderer = deferRenderer; exports.deferUpdate = deferUpdate; exports.deferUpdater = deferUpdater; exports.pairToObject = pairToObject; exports.splitPair = splitPair; exports.findBestMatches = findBestMatches; exports.normalizeKey = normalizeKey; exports.denormalizeKey = denormalizeKey; exports.equalByValue = equalByValue; exports.getKeyHash = getKeyHash; exports.escapeRegExp = escapeRegExp; exports.applyServerDecimalSeparator = applyServerDecimalSeparator; exports.noop = noop; exports.asyncNoop = asyncNoop; exports.grep = grep }, /*!***********************************************************!*\ !*** ./artifacts/transpiled/events/core/events_engine.js ***! \***********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var registerEventCallbacks = __webpack_require__( /*! ./event_registrator_callbacks */ 122); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7); var window = windowUtils.getWindow(); var injector = __webpack_require__( /*! ../../core/utils/dependency_injector */ 54); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26); var isWindow = typeUtils.isWindow; var isFunction = typeUtils.isFunction; var isString = typeUtils.isString; var errors = __webpack_require__( /*! ../../core/errors */ 21); var WeakMap = __webpack_require__( /*! ../../core/polyfills/weak_map */ 176); var hookTouchProps = __webpack_require__( /*! ../../events/core/hook_touch_props */ 254); var callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 63); var EMPTY_EVENT_NAME = "dxEmptyEventType"; var NATIVE_EVENTS_TO_SUBSCRIBE = { mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }; var NATIVE_EVENTS_TO_TRIGGER = { focusin: "focus", focusout: "blur" }; var NO_BUBBLE_EVENTS = ["blur", "focus", "load"]; var forcePassiveFalseEventNames = ["touchmove", "wheel", "mousewheel", "touchstart"]; var matchesSafe = function(target, selector) { return !isWindow(target) && "#document" !== target.nodeName && domAdapter.elementMatches(target, selector) }; var elementDataMap = new WeakMap; var guid = 0; var skipEvent; var special = function() { var specialData = {}; registerEventCallbacks.add(function(eventName, eventObject) { specialData[eventName] = eventObject }); return { getField: function(eventName, field) { return specialData[eventName] && specialData[eventName][field] }, callMethod: function(eventName, methodName, context, args) { return specialData[eventName] && specialData[eventName][methodName] && specialData[eventName][methodName].apply(context, args) } } }(); var applyForEach = function applyForEach(args, method) { var element = args[0]; if (!element) { return } if (domAdapter.isNode(element) || isWindow(element)) { method.apply(eventsEngine, args) } else { if (!isString(element) && "length" in element) { var itemArgs = Array.prototype.slice.call(args, 0); Array.prototype.forEach.call(element, function(itemElement) { itemArgs[0] = itemElement; applyForEach(itemArgs, method) }) } else { throw errors.Error("E0025") } } }; var getHandler = function(method) { return function() { applyForEach(arguments, method) } }; var detectPassiveEventHandlersSupport = function() { var isSupported = false; try { var options = Object.defineProperty({}, "passive", { get: function() { isSupported = true; return true } }); window.addEventListener("test", null, options) } catch (e) {} return isSupported }; var passiveEventHandlersSupported = callOnce(detectPassiveEventHandlersSupport); var getHandlersController = function(element, eventName) { var elementData = elementDataMap.get(element); eventName = eventName || ""; var eventNameParts = eventName.split("."); var namespaces = eventNameParts.slice(1); var eventNameIsDefined = !!eventNameParts[0]; eventName = eventNameParts[0] || EMPTY_EVENT_NAME; if (!elementData) { elementData = {}; elementDataMap.set(element, elementData) } if (!elementData[eventName]) { elementData[eventName] = { handleObjects: [], nativeHandler: null } } var eventData = elementData[eventName]; return { addHandler: function(handler, selector, data) { var callHandler = function(e, extraParameters) { var handlerArgs = [e]; var target = e.currentTarget; var relatedTarget = e.relatedTarget; var secondaryTargetIsInside; var result; if (eventName in NATIVE_EVENTS_TO_SUBSCRIBE) { secondaryTargetIsInside = relatedTarget && target && (relatedTarget === target || target.contains(relatedTarget)) } if (void 0 !== extraParameters) { handlerArgs.push(extraParameters) } special.callMethod(eventName, "handle", element, [e, data]); if (!secondaryTargetIsInside) { result = handler.apply(target, handlerArgs) } if (false === result) { e.preventDefault(); e.stopPropagation() } }; var wrappedHandler = function(e, extraParameters) { if (skipEvent && e.type === skipEvent) { return } e.data = data; e.delegateTarget = element; if (selector) { var currentTarget = e.target; while (currentTarget && currentTarget !== element) { if (matchesSafe(currentTarget, selector)) { e.currentTarget = currentTarget; callHandler(e, extraParameters) } currentTarget = currentTarget.parentNode } } else { e.currentTarget = e.delegateTarget || e.target; callHandler(e, extraParameters) } }; var handleObject = { handler: handler, wrappedHandler: wrappedHandler, selector: selector, type: eventName, data: data, namespace: namespaces.join("."), namespaces: namespaces, guid: ++guid }; eventData.handleObjects.push(handleObject); var firstHandlerForTheType = 1 === eventData.handleObjects.length; var shouldAddNativeListener = firstHandlerForTheType && eventNameIsDefined; var nativeListenerOptions; if (shouldAddNativeListener) { shouldAddNativeListener = !special.callMethod(eventName, "setup", element, [data, namespaces, handler]) } if (shouldAddNativeListener) { eventData.nativeHandler = getNativeHandler(eventName); if (passiveEventHandlersSupported() && forcePassiveFalseEventNames.indexOf(eventName) > -1) { nativeListenerOptions = { passive: false } } eventData.removeListener = domAdapter.listen(element, NATIVE_EVENTS_TO_SUBSCRIBE[eventName] || eventName, eventData.nativeHandler, nativeListenerOptions) } special.callMethod(eventName, "add", element, [handleObject]) }, removeHandler: function(handler, selector) { var removeByEventName = function(eventName) { var eventData = elementData[eventName]; if (!eventData.handleObjects.length) { delete elementData[eventName]; return } var removedHandler; eventData.handleObjects = eventData.handleObjects.filter(function(handleObject) { var skip = namespaces.length && !isSubset(handleObject.namespaces, namespaces) || handler && handleObject.handler !== handler || selector && handleObject.selector !== selector; if (!skip) { removedHandler = handleObject.handler; special.callMethod(eventName, "remove", element, [handleObject]) } return skip }); var lastHandlerForTheType = !eventData.handleObjects.length; var shouldRemoveNativeListener = lastHandlerForTheType && eventName !== EMPTY_EVENT_NAME; if (shouldRemoveNativeListener) { special.callMethod(eventName, "teardown", element, [namespaces, removedHandler]); if (eventData.nativeHandler) { eventData.removeListener() } delete elementData[eventName] } }; if (eventNameIsDefined) { removeByEventName(eventName) } else { for (var name in elementData) { removeByEventName(name) } } var elementDataIsEmpty = 0 === Object.keys(elementData).length; if (elementDataIsEmpty) { elementDataMap.delete(element) } }, callHandlers: function(event, extraParameters) { var forceStop = false; var handleCallback = function(handleObject) { if (forceStop) { return } if (!namespaces.length || isSubset(handleObject.namespaces, namespaces)) { handleObject.wrappedHandler(event, extraParameters); forceStop = event.isImmediatePropagationStopped() } }; eventData.handleObjects.forEach(handleCallback); if (namespaces.length && elementData[EMPTY_EVENT_NAME]) { elementData[EMPTY_EVENT_NAME].handleObjects.forEach(handleCallback) } } } }; var getNativeHandler = function(subscribeName) { return function(event, extraParameters) { var handlersController = getHandlersController(this, subscribeName); event = eventsEngine.Event(event); handlersController.callHandlers(event, extraParameters) } }; var isSubset = function(original, checked) { for (var i = 0; i < checked.length; i++) { if (original.indexOf(checked[i]) < 0) { return false } } return true }; var normalizeOnArguments = function(callback) { return function(element, eventName, selector, data, handler) { if (!handler) { handler = data; data = void 0 } if ("string" !== typeof selector) { data = selector; selector = void 0 } if (!handler && "string" === typeof eventName) { handler = data || selector; selector = void 0; data = void 0 } callback(element, eventName, selector, data, handler) } }; var normalizeOffArguments = function(callback) { return function(element, eventName, selector, handler) { if ("function" === typeof selector) { handler = selector; selector = void 0 } callback(element, eventName, selector, handler) } }; var normalizeTriggerArguments = function(callback) { return function(element, src, extraParameters) { if ("string" === typeof src) { src = { type: src } } if (!src.target) { src.target = element } src.currentTarget = element; if (!src.delegateTarget) { src.delegateTarget = element } if (!src.type && src.originalEvent) { src.type = src.originalEvent.type } callback(element, src instanceof eventsEngine.Event ? src : eventsEngine.Event(src), extraParameters) } }; var normalizeEventArguments = function(callback) { return function(src, config) { if (!(this instanceof eventsEngine.Event)) { return new eventsEngine.Event(src, config) } if (!src) { src = {} } if ("string" === typeof src) { src = { type: src } } if (!config) { config = {} } callback.call(this, src, config) } }; var iterate = function(callback) { var iterateEventNames = function(element, eventName) { if (eventName && eventName.indexOf(" ") > -1) { var args = Array.prototype.slice.call(arguments, 0); eventName.split(" ").forEach(function(eventName) { args[1] = eventName; callback.apply(this, args) }) } else { callback.apply(this, arguments) } }; return function(element, eventName) { if ("object" === _typeof(eventName)) { var args = Array.prototype.slice.call(arguments, 0); for (var name in eventName) { args[1] = name; args[args.length - 1] = eventName[name]; iterateEventNames.apply(this, args) } } else { iterateEventNames.apply(this, arguments) } } }; var callNativeMethod = function(eventName, element) { var nativeMethodName = NATIVE_EVENTS_TO_TRIGGER[eventName] || eventName; var isLinkClickEvent = function(eventName, element) { return "click" === eventName && "a" === element.localName }; if (isLinkClickEvent(eventName, element)) { return } if (isFunction(element[nativeMethodName])) { skipEvent = eventName; element[nativeMethodName](); skipEvent = void 0 } }; var calculateWhich = function(event) { var setForMouseEvent = function(event) { var mouseEventRegex = /^(?:mouse|pointer|contextmenu|drag|drop)|click/; return !event.which && void 0 !== event.button && mouseEventRegex.test(event.type) }; var setForKeyEvent = function(event) { return null == event.which && 0 === event.type.indexOf("key") }; if (setForKeyEvent(event)) { return null != event.charCode ? event.charCode : event.keyCode } if (setForMouseEvent(event)) { var whichByButton = { 1: 1, 2: 3, 3: 1, 4: 2 }; return whichByButton[event.button] } return event.which }; var eventsEngine = injector({ on: getHandler(normalizeOnArguments(iterate(function(element, eventName, selector, data, handler) { var handlersController = getHandlersController(element, eventName); handlersController.addHandler(handler, selector, data) }))), one: getHandler(normalizeOnArguments(function(element, eventName, selector, data, handler) { var oneTimeHandler = function oneTimeHandler() { eventsEngine.off(element, eventName, selector, oneTimeHandler); handler.apply(this, arguments) }; eventsEngine.on(element, eventName, selector, data, oneTimeHandler) })), off: getHandler(normalizeOffArguments(iterate(function(element, eventName, selector, handler) { var handlersController = getHandlersController(element, eventName); handlersController.removeHandler(handler, selector) }))), trigger: getHandler(normalizeTriggerArguments(function(element, event, extraParameters) { var eventName = event.type; var handlersController = getHandlersController(element, event.type); special.callMethod(eventName, "trigger", element, [event, extraParameters]); handlersController.callHandlers(event, extraParameters); var noBubble = special.getField(eventName, "noBubble") || event.isPropagationStopped() || NO_BUBBLE_EVENTS.indexOf(eventName) !== -1; if (!noBubble) { var parents = []; var getParents = function getParents(element) { var parent = element.parentNode; if (parent) { parents.push(parent); getParents(parent) } }; getParents(element); parents.push(window); var i = 0; while (parents[i] && !event.isPropagationStopped()) { var parentDataByEvent = getHandlersController(parents[i], event.type); parentDataByEvent.callHandlers(extend(event, { currentTarget: parents[i] }), extraParameters); i++ } } if (element.nodeType || isWindow(element)) { special.callMethod(eventName, "_default", element, [event, extraParameters]); callNativeMethod(eventName, element) } })), triggerHandler: getHandler(normalizeTriggerArguments(function(element, event, extraParameters) { var handlersController = getHandlersController(element, event.type); handlersController.callHandlers(event, extraParameters) })) }); var initEvent = function(EventClass) { if (EventClass) { eventsEngine.Event = EventClass; eventsEngine.Event.prototype = EventClass.prototype } }; initEvent(normalizeEventArguments(function(src, config) { var that = this; var propagationStopped = false; var immediatePropagationStopped = false; var defaultPrevented = false; extend(that, src); if (src instanceof eventsEngine.Event || windowUtils.hasWindow() && src instanceof window.Event) { that.originalEvent = src; that.currentTarget = void 0 } if (!(src instanceof eventsEngine.Event)) { extend(that, { isPropagationStopped: function() { return !!(propagationStopped || that.originalEvent && that.originalEvent.propagationStopped) }, stopPropagation: function() { propagationStopped = true; that.originalEvent && that.originalEvent.stopPropagation() }, isImmediatePropagationStopped: function() { return immediatePropagationStopped }, stopImmediatePropagation: function() { this.stopPropagation(); immediatePropagationStopped = true; that.originalEvent && that.originalEvent.stopImmediatePropagation() }, isDefaultPrevented: function() { return !!(defaultPrevented || that.originalEvent && that.originalEvent.defaultPrevented) }, preventDefault: function() { defaultPrevented = true; that.originalEvent && that.originalEvent.preventDefault() } }) } addProperty("which", calculateWhich, that); if (0 === src.type.indexOf("touch")) { delete config.pageX; delete config.pageY } extend(that, config); that.guid = ++guid })); var addProperty = function(propName, hook, eventInstance) { Object.defineProperty(eventInstance || eventsEngine.Event.prototype, propName, { enumerable: true, configurable: true, get: function() { return this.originalEvent && hook(this.originalEvent) }, set: function(value) { Object.defineProperty(this, propName, { enumerable: true, configurable: true, writable: true, value: value }) } }) }; hookTouchProps(addProperty); var beforeSetStrategy = Callbacks(); var afterSetStrategy = Callbacks(); eventsEngine.set = function(engine) { beforeSetStrategy.fire(); eventsEngine.inject(engine); initEvent(engine.Event); afterSetStrategy.fire() }; eventsEngine.subscribeGlobal = function() { applyForEach(arguments, normalizeOnArguments(function() { var args = arguments; eventsEngine.on.apply(this, args); beforeSetStrategy.add(function() { var offArgs = Array.prototype.slice.call(args, 0); offArgs.splice(3, 1); eventsEngine.off.apply(this, offArgs) }); afterSetStrategy.add(function() { eventsEngine.on.apply(this, args) }) })) }; eventsEngine.forcePassiveFalseEventNames = forcePassiveFalseEventNames; eventsEngine.passiveEventHandlersSupported = passiveEventHandlersSupported; eventsEngine.elementDataMap = elementDataMap; eventsEngine.detectPassiveEventHandlersSupport = detectPassiveEventHandlersSupport; module.exports = eventsEngine }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/core/utils/deferred.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var typeUtils = __webpack_require__( /*! ../utils/type */ 1); var isPromise = typeUtils.isPromise; var isDeferred = typeUtils.isDeferred; var extend = __webpack_require__( /*! ../utils/extend */ 0).extend; var Callbacks = __webpack_require__( /*! ../utils/callbacks */ 26); var deferredConfig = [{ method: "resolve", handler: "done", state: "resolved" }, { method: "reject", handler: "fail", state: "rejected" }, { method: "notify", handler: "progress" }]; var _Deferred = function() { var that = this; this._state = "pending"; this._promise = {}; deferredConfig.forEach(function(config) { var methodName = config.method; this[methodName + "Callbacks"] = new Callbacks; this[methodName] = function() { return this[methodName + "With"](this._promise, arguments) }.bind(this); this._promise[config.handler] = function(handler) { if (!handler) { return this } var callbacks = that[methodName + "Callbacks"]; if (callbacks.fired()) { handler.apply(that[methodName + "Context"], that[methodName + "Args"]) } else { callbacks.add(function(context, args) { handler.apply(context, args) }.bind(this)) } return this } }.bind(this)); this._promise.always = function(handler) { return this.done(handler).fail(handler) }; this._promise.catch = function(handler) { return this.then(null, handler) }; this._promise.then = function(resolve, reject) { var result = new _Deferred; ["done", "fail"].forEach(function(method) { var callback = "done" === method ? resolve : reject; this[method](function() { if (!callback) { result["done" === method ? "resolve" : "reject"].apply(this, arguments); return } var callbackResult = callback && callback.apply(this, arguments); if (isDeferred(callbackResult)) { callbackResult.done(result.resolve).fail(result.reject) } else { if (isPromise(callbackResult)) { callbackResult.then(result.resolve, result.reject) } else { result.resolve.apply(this, typeUtils.isDefined(callbackResult) ? [callbackResult] : arguments) } } }) }.bind(this)); return result.promise() }; this._promise.state = function() { return that._state }; this._promise.promise = function(args) { return args ? extend(args, that._promise) : that._promise }; this._promise.promise(this) }; deferredConfig.forEach(function(config) { var methodName = config.method; var state = config.state; _Deferred.prototype[methodName + "With"] = function(context, args) { var callbacks = this[methodName + "Callbacks"]; if ("pending" === this.state()) { this[methodName + "Args"] = args; this[methodName + "Context"] = context; if (state) { this._state = state } callbacks.fire(context, args) } return this } }); exports.fromPromise = function(promise, context) { if (isDeferred(promise)) { return promise } else { if (isPromise(promise)) { var d = new _Deferred; promise.then(function() { d.resolveWith.apply(d, [context].concat([ [].slice.call(arguments) ])) }, function() { d.rejectWith.apply(d, [context].concat([ [].slice.call(arguments) ])) }); return d } } return (new _Deferred).resolveWith(context, [promise]) }; var when = function() { if (1 === arguments.length) { return exports.fromPromise(arguments[0]) } var values = [].slice.call(arguments); var contexts = []; var resolvedCount = 0; var deferred = new _Deferred; var updateState = function(i) { return function(value) { contexts[i] = this; values[i] = arguments.length > 1 ? [].slice.call(arguments) : value; resolvedCount++; if (resolvedCount === values.length) { deferred.resolveWith(contexts, values) } } }; for (var i = 0; i < values.length; i++) { if (isDeferred(values[i])) { values[i].promise().done(updateState(i)).fail(deferred.reject) } else { resolvedCount++ } } if (resolvedCount === values.length) { deferred.resolveWith(contexts, values) } return deferred.promise() }; exports.setStrategy = function(value) { _Deferred = value.Deferred; when = value.when }; exports.Deferred = function() { return new _Deferred }; exports.when = function() { return when.apply(this, arguments) } }, /*!***************************************************!*\ !*** ./artifacts/transpiled/core/utils/window.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11); var _hasWindow = "undefined" !== typeof window; var windowObject = _hasWindow && window; if (!windowObject) { windowObject = {}; windowObject.window = windowObject } module.exports = { hasWindow: function() { return _hasWindow }, getWindow: function() { return windowObject }, hasProperty: function(prop) { return this.hasWindow() && prop in windowObject }, defaultScreenFactorFunc: function(width) { if (width < 768) { return "xs" } else { if (width < 992) { return "sm" } else { if (width < 1200) { return "md" } else { return "lg" } } } }, getCurrentScreenFactor: function(screenFactorCallback) { var screenFactorFunc = screenFactorCallback || this.defaultScreenFactorFunc; var windowWidth = domAdapter.getDocumentElement().clientWidth; return screenFactorFunc(windowWidth) }, getNavigator: function() { return this.hasWindow() ? windowObject.navigator : { userAgent: "" } } } }, /*!**********************************************!*\ !*** ./artifacts/transpiled/events/utils.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _events_engine = __webpack_require__( /*! ./core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _errors = __webpack_require__( /*! ../core/errors */ 21); var _errors2 = _interopRequireDefault(_errors); var _selectors = __webpack_require__( /*! ../ui/widget/selectors */ 66); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var KEY_MAP = { backspace: "backspace", tab: "tab", enter: "enter", escape: "escape", pageup: "pageUp", pagedown: "pageDown", end: "end", home: "home", arrowleft: "leftArrow", arrowup: "upArrow", arrowright: "rightArrow", arrowdown: "downArrow", "delete": "del", " ": "space", f: "F", a: "A", "*": "asterisk", "-": "minus", alt: "alt", control: "control", shift: "shift", left: "leftArrow", up: "upArrow", right: "rightArrow", down: "downArrow", multiply: "asterisk", spacebar: "space", del: "del", subtract: "minus", esc: "escape" }; var LEGACY_KEY_CODES = { 8: "backspace", 9: "tab", 13: "enter", 27: "escape", 33: "pageUp", 34: "pageDown", 35: "end", 36: "home", 37: "leftArrow", 38: "upArrow", 39: "rightArrow", 40: "downArrow", 46: "del", 32: "space", 70: "F", 65: "A", 106: "asterisk", 109: "minus", 189: "minus", 173: "minus", 16: "shift", 17: "control", 18: "alt" }; 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"; (0, _iterator.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 isDxMouseWheelEvent = function(e) { return e && "dxmousewheel" === e.type }; 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; var $target = (0, _renderer2.default)(target); var touchInInput = $target.is("input, textarea, select"); if ($target.is(".dx-skip-gesture-event *, .dx-skip-gesture-event")) { return true } if (isDxMouseWheelEvent(e)) { var isTextArea = $target.is("textarea") && $target.hasClass("dx-texteditor-input"); if (isTextArea) { return false } var isContentEditable = target.isContentEditable || target.hasAttribute("contenteditable"); if (isContentEditable) { return false } var isInputFocused = $target.is("input[type='number'], textarea, select") && $target.is(":focus"); return isInputFocused } if (isMouseEvent(e)) { return touchInInput || e.which > 1 } if (isTouchEvent(e)) { return touchInInput && (0, _selectors.focused)($target) } }; var fixMethod = function(e) { return e }; var setEventFixMethod = function(func) { fixMethod = func }; var copyEvent = function(originalEvent) { return fixMethod(_events_engine2.default.Event(originalEvent, originalEvent), originalEvent) }; var createEvent = function(originalEvent, args) { var event = copyEvent(originalEvent); if (args) { (0, _extend.extend)(event, args) } return event }; var fireEvent = function(props) { var event = createEvent(props.originalEvent, props); _events_engine2.default.trigger(props.delegateTarget || event.target, event); return event }; var addNamespace = function addNamespace(eventNames, namespace) { if (!namespace) { throw _errors2.default.Error("E0017") } if ("string" === typeof eventNames) { if (eventNames.indexOf(" ") === -1) { return eventNames + "." + namespace } return addNamespace(eventNames.split(/\s+/g), namespace) }(0, _iterator.each)(eventNames, function(index, eventName) { eventNames[index] = eventName + "." + namespace }); return eventNames.join(" ") }; var normalizeKeyName = function(event) { var isKeySupported = !!event.key; var key = isKeySupported ? event.key : event.which; if (!key) { return } if (isKeySupported) { key = KEY_MAP[key.toLowerCase()] || key } else { key = LEGACY_KEY_CODES[key] || String.fromCharCode(key) } return key }; var getChar = function(event) { return event.key || String.fromCharCode(event.which) }; module.exports = { eventSource: eventSource, isPointerEvent: isPointerEvent, isMouseEvent: isMouseEvent, isDxMouseWheelEvent: isDxMouseWheelEvent, isTouchEvent: isTouchEvent, isKeyboardEvent: isKeyboardEvent, isFakeClickEvent: isFakeClickEvent, hasTouches: hasTouches, eventData: eventData, eventDelta: eventDelta, needSkipEvent: needSkipEvent, createEvent: createEvent, fireEvent: fireEvent, addNamespace: addNamespace, setEventFixMethod: setEventFixMethod, normalizeKeyName: normalizeKeyName, getChar: getChar } }, /*!************************************************************!*\ !*** ./artifacts/transpiled/core/component_registrator.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ./renderer */ 2); var callbacks = __webpack_require__( /*! ./component_registrator_callbacks */ 153); var errors = __webpack_require__( /*! ./errors */ 21); var publicComponentUtils = __webpack_require__( /*! ./utils/public_component */ 131); var registerComponent = function(name, namespace, componentClass) { if (!componentClass) { componentClass = namespace } else { namespace[name] = componentClass } publicComponentUtils.name(componentClass, name); callbacks.fire(name, componentClass) }; var registerRendererComponent = function(name, componentClass) { $.fn[name] = function(options) { var isMemberInvoke = "string" === typeof options; var result; if (isMemberInvoke) { var memberName = options; var memberArgs = [].slice.call(arguments).slice(1); this.each(function() { var instance = componentClass.getInstance(this); if (!instance) { throw errors.Error("E0009", name) } var member = instance[memberName]; var 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(registerRendererComponent); module.exports = registerComponent }, /*!************************************************!*\ !*** ./artifacts/transpiled/viz/core/utils.js ***! \************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var adjust = __webpack_require__( /*! ../../core/utils/math */ 28).adjust; var dateToMilliseconds = __webpack_require__( /*! ../../core/utils/date */ 22).dateToMilliseconds; var isDefined = typeUtils.isDefined; var isNumber = typeUtils.isNumeric; var isExponential = typeUtils.isExponential; var _math = Math; var _round = _math.round; var _sqrt = Math.sqrt; var PI = Math.PI; var MAX_PIXEL_COUNT = 1e10; var PI_DIV_180 = PI / 180; var LN10 = Math.LN10; var cosFunc = Math.cos; var sinFunc = Math.sin; var abs = Math.abs; var log = Math.log; var floor = Math.floor; var ceil = Math.ceil; var max = Math.max; var _isNaN = isNaN; var _Number = Number; var _NaN = NaN; var getLog = function(value, base) { if (!value) { return _NaN } return Math.log(value) / Math.log(base) }; var getAdjustedLog10 = function(value) { return adjust(getLog(value, 10)) }; 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; var diffY = y2 - y1; return Math.sqrt(diffY * diffY + diffX * diffX) }; var getDecimalOrder = function(number) { var n = abs(number); var cn; 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 order = max(getDecimalOrder(start), getDecimalOrder(end)); var precision = -getDecimalOrder(abs(end - start) / count); var format; 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 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 getPower = function(value) { return value.toExponential().split("e")[1] }; function map(array, callback) { var i = 0; var len = array.length; var result = []; while (i < len) { var value = callback(array[i], i); if (null !== value) { result.push(value) } i++ } return result } 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 } return canvas } function normalizeBBoxField(value) { return -MAX_PIXEL_COUNT < value && value < +MAX_PIXEL_COUNT ? value : 0 } function normalizeBBox(bBox) { var xl = normalizeBBoxField(floor(bBox.x)); var yt = normalizeBBoxField(floor(bBox.y)); var xr = normalizeBBoxField(ceil(bBox.width + bBox.x)); var yb = normalizeBBoxField(ceil(bBox.height + bBox.y)); var result = { x: xl, y: yt, width: xr - xl, height: yb - yt }; 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)); var sin = _Number(sinFunc(angle * PI_DIV_180).toFixed(3)); var w2 = bBox.width / 2; var h2 = bBox.height / 2; var centerX = bBox.x + w2; var centerY = bBox.y + h2; var w2_ = abs(w2 * cos) + abs(h2 * sin); var h2_ = abs(w2 * sin) + abs(h2 * cos); var centerX_ = center[0] + (centerX - center[0]) * cos + (centerY - center[1]) * sin; var centerY_ = center[1] - (centerX - center[0]) * sin + (centerY - center[1]) * cos; return normalizeBBox({ x: centerX_ - w2_, y: centerY_ - 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 stored = {}; var i; var ii; 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 shiftAngle = 90; angle = isDefined(angle) ? angle + startAngle - shiftAngle : 0; var 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); var 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 customizeSeries = typeUtils.isFunction(seriesTemplate.customizeSeries) ? seriesTemplate.customizeSeries : noop; var nameField = seriesTemplate.nameField; var generatedSeries = {}; var seriesOrder = []; var series; var i = 0; items = items || []; for (var length = items.length; i < length; i++) { var data = items[i]; if (nameField in data) { series = generatedSeries[data[nameField]]; if (!series) { series = generatedSeries[data[nameField]] = { name: data[nameField], nameFieldValue: data[nameField] }; seriesOrder.push(series.name) } } } return map(seriesOrder, function(orderedName) { var group = generatedSeries[orderedName]; return extend(group, customizeSeries.call(null, group.name)) }) }, getCategoriesInfo: function(categories, startValue, endValue) { if (0 === categories.length) { return { categories: [] } } startValue = isDefined(startValue) ? startValue : categories[0]; endValue = isDefined(endValue) ? endValue : categories[categories.length - 1]; var categoriesValue = map(categories, function(category) { return isDefined(category) ? category.valueOf() : null }); var indexStartValue = categoriesValue.indexOf(startValue.valueOf()); var indexEndValue = categoriesValue.indexOf(endValue.valueOf()); var inverted = false; indexStartValue < 0 && (indexStartValue = 0); indexEndValue < 0 && (indexEndValue = categories.length - 1); if (indexEndValue < indexStartValue) { var swapBuf = indexEndValue; indexEndValue = indexStartValue; indexStartValue = swapBuf; inverted = true } var visibleCategories = categories.slice(indexStartValue, indexEndValue + 1); var lastIdx = visibleCategories.length - 1; return { categories: visibleCategories, start: visibleCategories[inverted ? lastIdx : 0], end: visibleCategories[inverted ? 0 : lastIdx], 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; var padding = panes.padding || 10; var paneSpace = rotated ? canvas.width - canvas.left - canvas.right : canvas.height - canvas.top - canvas.bottom; var oneWeight = (paneSpace - padding * (panes.length - 1)) / weightSum; var startName = rotated ? "left" : "top"; var endName = rotated ? "right" : "bottom"; each(panes, function(_, pane) { var calcLength = _round(pane.weight * oneWeight); pane.canvas = pane.canvas || {}; extend(pane.canvas, 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; var horizontalOffset1 = (isPositive ? bBox.x : bBox.x + bBox.width) - center.x; var verticalOffset1 = bBox.y - center.y; var verticalOffset2 = verticalOffset1 + dy; var horizontalOffset2 = _round(_sqrt(horizontalOffset1 * horizontalOffset1 + verticalOffset1 * verticalOffset1 - verticalOffset2 * verticalOffset2)); var dx = (isPositive ? +horizontalOffset2 : -horizontalOffset2) || horizontalOffset1; return { x: center.x + (isPositive ? dx : dx - bBox.width), y: bBox.y + dy } }, mergeMarginOptions: function(opt1, opt2) { return { checkInterval: opt1.checkInterval || opt2.checkInterval, size: Math.max(opt1.size || 0, opt2.size || 0), percentStick: opt1.percentStick || opt2.percentStick, sizePointNormalState: Math.max(opt1.sizePointNormalState || 0, opt2.sizePointNormalState || 0) } } }); function getVizRangeObject(value) { if (Array.isArray(value)) { return { startValue: value[0], endValue: value[1] } } else { return value || {} } } function convertVisualRangeObject(visualRange, convertToVisualRange) { if (convertToVisualRange) { return visualRange } return [visualRange.startValue, visualRange.endValue] } function getAddFunction(range, correctZeroLevel) { if ("datetime" === range.dataType) { return function(rangeValue, marginValue) { var sign = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1; return new Date(rangeValue.getTime() + sign * marginValue) } } if ("logarithmic" === range.axisType) { return function(rangeValue, marginValue) { var sign = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1; var log = getLog(rangeValue, range.base) + sign * marginValue; return raiseTo(log, range.base) } } return function(rangeValue, marginValue) { var sign = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1; var newValue = rangeValue + sign * marginValue; return correctZeroLevel && newValue * rangeValue <= 0 ? 0 : newValue } } function adjustVisualRange(options, visualRange, wholeRange, dataRange) { var minDefined = typeUtils.isDefined(visualRange.startValue); var maxDefined = typeUtils.isDefined(visualRange.endValue); var nonDiscrete = "discrete" !== options.axisType; dataRange = dataRange || wholeRange; var add = getAddFunction(options, false); var min = minDefined ? visualRange.startValue : dataRange.min; var max = maxDefined ? visualRange.endValue : dataRange.max; var rangeLength = visualRange.length; var categories = dataRange.categories; if (nonDiscrete && !typeUtils.isDefined(min) && !typeUtils.isDefined(max)) { return { startValue: min, endValue: max } } if (isDefined(rangeLength)) { if (nonDiscrete) { if ("datetime" === options.dataType && !isNumber(rangeLength)) { rangeLength = dateToMilliseconds(rangeLength) } if (maxDefined && !minDefined || !maxDefined && !minDefined) { isDefined(wholeRange.max) && (max = max > wholeRange.max ? wholeRange.max : max); min = add(max, rangeLength, -1) } else { if (minDefined && !maxDefined) { isDefined(wholeRange.min) && (min = min < wholeRange.min ? wholeRange.min : min); max = add(min, rangeLength) } } } else { rangeLength = parseInt(rangeLength); if (!isNaN(rangeLength) && isFinite(rangeLength)) { rangeLength--; if (!maxDefined && !minDefined) { max = categories[categories.length - 1]; min = categories[categories.length - 1 - rangeLength] } else { if (minDefined && !maxDefined) { var categoriesInfo = exports.getCategoriesInfo(categories, min, void 0); max = categoriesInfo.categories[rangeLength] } else { if (!minDefined && maxDefined) { var _categoriesInfo = exports.getCategoriesInfo(categories, void 0, max); min = _categoriesInfo.categories[_categoriesInfo.categories.length - 1 - rangeLength] } } } } } } if (nonDiscrete) { if (isDefined(wholeRange.max) && max > wholeRange.max) { max = wholeRange.max } if (isDefined(wholeRange.min) && min < wholeRange.min) { min = wholeRange.min } } return { startValue: min, endValue: max } } exports.getVizRangeObject = getVizRangeObject; exports.convertVisualRangeObject = convertVisualRangeObject; exports.adjustVisualRange = adjustVisualRange; exports.getAddFunction = getAddFunction; exports.getLog = getLog; exports.getAdjustedLog10 = getAdjustedLog10; 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.roundValue = roundValue; exports.getPower = getPower; exports.rotateBBox = rotateBBox; exports.normalizeBBox = normalizeBBox }, /*!**************************************************!*\ !*** ./artifacts/transpiled/core/dom_adapter.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _dependency_injector = __webpack_require__( /*! ./utils/dependency_injector */ 54); var _dependency_injector2 = _interopRequireDefault(_dependency_injector); var _common = __webpack_require__( /*! ./utils/common */ 4); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var ELEMENT_NODE = 1; var TEXT_NODE = 3; var DOCUMENT_NODE = 9; var nativeDOMAdapterStrategy = { querySelectorAll: function(element, selector) { return element.querySelectorAll(selector) }, elementMatches: function(element, selector) { var _this = this; var matches = element.matches || element.matchesSelector || element.mozMatchesSelector || element.msMatchesSelector || element.oMatchesSelector || element.webkitMatchesSelector || function(selector) { var doc = element.document || element.ownerDocument; if (!doc) { return false } var items = _this.querySelectorAll(doc, selector); for (var i = 0; i < items.length; i++) { if (items[i] === element) { return true } } }; return matches.call(element, selector) }, createElement: function(tagName, context) { context = context || this._document; return context.createElement(tagName) }, createElementNS: function(ns, tagName, context) { context = context || this._document; return context.createElementNS(ns, tagName) }, createTextNode: function(text, context) { context = context || this._document; return context.createTextNode(text) }, isNode: function(element) { return "object" === _typeof(element) && "nodeType" in element }, isElementNode: function(element) { return element && element.nodeType === ELEMENT_NODE }, isTextNode: function(element) { return element && element.nodeType === TEXT_NODE }, isDocument: function(element) { return element && element.nodeType === DOCUMENT_NODE }, removeElement: function(element) { var parentNode = element && element.parentNode; if (parentNode) { parentNode.removeChild(element) } }, insertElement: function(parentElement, newElement, nextSiblingElement) { if (parentElement && newElement && parentElement !== newElement) { if (nextSiblingElement) { parentElement.insertBefore(newElement, nextSiblingElement) } else { parentElement.appendChild(newElement) } } }, getAttribute: function(element, name) { return element.getAttribute(name) }, setAttribute: function(element, name, value) { element.setAttribute(name, value) }, removeAttribute: function(element, name) { element.removeAttribute(name) }, setProperty: function(element, name, value) { element[name] = value }, setText: function(element, text) { if (element) { element.textContent = text } }, setClass: function(element, className, isAdd) { if (1 === element.nodeType && className) { if (element.classList) { if (isAdd) { element.classList.add(className) } else { element.classList.remove(className) } } else { var classNameSupported = "string" === typeof element.className; var elementClass = classNameSupported ? element.className : this.getAttribute(element, "class") || ""; var classNames = elementClass.split(" "); var classIndex = classNames.indexOf(className); var resultClassName; if (isAdd && classIndex < 0) { resultClassName = elementClass ? elementClass + " " + className : className } if (!isAdd && classIndex >= 0) { classNames.splice(classIndex, 1); resultClassName = classNames.join(" ") } if (void 0 !== resultClassName) { if (classNameSupported) { element.className = resultClassName } else { this.setAttribute(element, "class", resultClassName) } } } } }, setStyle: function(element, name, value) { element.style[name] = value || "" }, _document: "undefined" === typeof document ? void 0 : document, getDocument: function() { return this._document }, getActiveElement: function() { return this._document.activeElement }, getBody: function() { return this._document.body }, createDocumentFragment: function() { return this._document.createDocumentFragment() }, getDocumentElement: function() { return this._document.documentElement }, getLocation: function() { return this._document.location }, getSelection: function() { return this._document.selection }, getReadyState: function() { return this._document.readyState }, getHead: function() { return this._document.head }, hasDocumentProperty: function(property) { return property in this._document }, listen: function(element, event, callback, options) { if (!element || !("addEventListener" in element)) { return _common.noop } element.addEventListener(event, callback, options); return function() { element.removeEventListener(event, callback) } } }; module.exports = (0, _dependency_injector2.default)(nativeDOMAdapterStrategy) }, /*!************************************************!*\ !*** ./artifacts/transpiled/core/utils/dom.js ***! \************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var config = __webpack_require__( /*! ../../core/config */ 31); var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var windowUtils = __webpack_require__( /*! ./window */ 7); var window = windowUtils.getWindow(); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var inArray = __webpack_require__( /*! ./array */ 14).inArray; var typeUtils = __webpack_require__( /*! ./type */ 1); var isDefined = typeUtils.isDefined; var isRenderer = typeUtils.isRenderer; var htmlParser = __webpack_require__( /*! ../../core/utils/html_parser */ 255); var elementStrategy; var resetActiveElement = function() { var activeElement = domAdapter.getActiveElement(); var body = domAdapter.getBody(); if (activeElement && activeElement !== body && activeElement.blur) { try { activeElement.blur() } catch (e) { body.blur() } } }; var clearSelection = function() { var selection = window.getSelection(); if (!selection) { return } if ("Caret" === selection.type) { return } if (selection.empty) { selection.empty() } else { if (selection.removeAllRanges) { try { selection.removeAllRanges() } catch (e) {} } } }; var closestCommonParent = function(startTarget, endTarget) { var $startTarget = $(startTarget); var $endTarget = $(endTarget); if ($startTarget[0] === $endTarget[0]) { return $startTarget[0] } var $startParents = $startTarget.parents(); var $endParents = $endTarget.parents(); var startingParent = Math.min($startParents.length, $endParents.length); for (var i = -startingParent; i < 0; i++) { if ($startParents.get(i) === $endParents.get(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.filter(VISIBILITY_CHANGE_SELECTOR).add($element.find(VISIBILITY_CHANGE_SELECTOR)); for (var i = 0; i < changeHandlers.length; i++) { eventsEngine.triggerHandler(changeHandlers[i], eventName) } } }; var uniqueId = function() { var counter = 0; return function(prefix) { return (prefix || "") + counter++ } }(); var dataOptionsAttributeName = "data-options"; var getElementOptions = function(element) { var optionsString = $(element).attr(dataOptionsAttributeName) || ""; return config().optionsParser(optionsString) }; var createComponents = function(elements, componentTypes) { var result = []; var selector = "[" + dataOptionsAttributeName + "]"; var $items = elements.find(selector).add(elements.filter(selector)); $items.each(function(index, element) { var $element = $(element); var 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 $(htmlParser.parseHTML(str)) } var tempElement = $("
"); window.WinJS.Utilities.setInnerHTMLUnsafe(tempElement.get(0), str); return tempElement.contents() }; var extractTemplateMarkup = function(element) { element = $(element); var templateTag = element.length && element.filter(function() { var $node = $(this); return $node.is("script[type]") && $node.attr("type").indexOf("script") < 0 }); if (templateTag.length) { return templateTag.eq(0).html() } else { element = $("
").append(element); return element.html() } }; var normalizeTemplateElement = function normalizeTemplateElement(element) { var $element = isDefined(element) && (element.nodeType || isRenderer(element)) ? $(element) : $("
").html(element).contents(); if (1 === $element.length) { if ($element.is("script")) { $element = normalizeTemplateElement($element.html().trim()) } else { if ($element.is("table")) { $element = $element.children("tbody").contents() } } } return $element }; 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) }; var contains = function(container, element) { if (!element) { return false } element = domAdapter.isTextNode(element) ? element.parentNode : element; return domAdapter.isDocument(container) ? container.documentElement.contains(element) : container.contains(element) }; var getPublicElement = function($element) { return elementStrategy($element) }; var setPublicElementWrapper = function(value) { elementStrategy = value }; setPublicElementWrapper(function(element) { return element && element.get(0) }); var createTextElementHiddenCopy = function(element, text, options) { var elementStyles = window.getComputedStyle($(element).get(0)); var includePaddings = options && options.includePaddings; return $("
").text(text).css({ fontStyle: elementStyles.fontStyle, fontVariant: elementStyles.fontVariant, fontWeight: elementStyles.fontWeight, fontSize: elementStyles.fontSize, fontFamily: elementStyles.fontFamily, letterSpacing: elementStyles.letterSpacing, border: elementStyles.border, paddingTop: includePaddings ? elementStyles.paddingTop : "", paddingRight: includePaddings ? elementStyles.paddingRight : "", paddingBottom: includePaddings ? elementStyles.paddingBottom : "", paddingLeft: includePaddings ? elementStyles.paddingLeft : "", visibility: "hidden", whiteSpace: "nowrap", position: "absolute", "float": "left" }) }; exports.setPublicElementWrapper = setPublicElementWrapper; 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.extractTemplateMarkup = extractTemplateMarkup; exports.normalizeTemplateElement = normalizeTemplateElement; exports.clearSelection = clearSelection; exports.uniqueId = uniqueId; exports.closestCommonParent = closestCommonParent; exports.clipboardText = clipboardText; exports.contains = contains; exports.getPublicElement = getPublicElement; exports.createTextElementHiddenCopy = createTextElementHiddenCopy }, /*!******************************************************!*\ !*** ./artifacts/transpiled/localization/message.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 54); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each; var stringFormat = __webpack_require__( /*! ../core/utils/string */ 44).format; var humanize = __webpack_require__( /*! ../core/utils/inflector */ 33).humanize; var coreLocalization = __webpack_require__( /*! ./core */ 87); __webpack_require__( /*! ./core */ 87); var PARENT_LOCALE_SEPARATOR = "-"; var baseDictionary = extend(true, {}, __webpack_require__( /*! ./default_messages */ 443)); var parentLocales = __webpack_require__( /*! ./cldr-data/parentLocales */ 444); var getParentLocale = function(locale) { var parentLocale = parentLocales[locale]; if (parentLocale) { return "root" !== parentLocale && parentLocale } return locale.substr(0, locale.lastIndexOf(PARENT_LOCALE_SEPARATOR)) }; var getDataByLocale = function(localeData, locale) { return localeData[locale] || {} }; var getValueByClosestLocale = function(localeData, locale, key) { var value = getDataByLocale(localeData, locale)[key]; var isRootLocale; while (!value && !isRootLocale) { locale = getParentLocale(locale); if (locale) { value = getDataByLocale(localeData, locale)[key] } else { isRootLocale = true } } return value }; var newMessages = {}; var messageLocalization = dependencyInjector({ _dictionary: baseDictionary, load: function(messages) { extend(true, this._dictionary, messages) }, _localizablePrefix: "@", setup: function(localizablePrefix) { this._localizablePrefix = localizablePrefix }, localizeString: function(text) { var that = this; var regex = new RegExp("(^|[^a-zA-Z_0-9" + that._localizablePrefix + "-]+)(" + that._localizablePrefix + "{1,2})([a-zA-Z_0-9-]+)", "g"); var escapeString = that._localizablePrefix + that._localizablePrefix; return text.replace(regex, function(str, prefix, escape, localizationKey) { var defaultResult = that._localizablePrefix + localizationKey; var result; if (escape !== escapeString) { result = that.format(localizationKey) } if (!result) { newMessages[localizationKey] = humanize(localizationKey) } return prefix + (result || defaultResult) }) }, _messageLoaded: function(key, locale) { return void 0 !== getValueByClosestLocale(this._dictionary, locale || coreLocalization.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()[coreLocalization.locale()]) }, getFormatter: function(key) { return this._getFormatterBase(key) || this._getFormatterBase(key, "en") }, _getFormatterBase: function(key, locale) { var message = getValueByClosestLocale(this._dictionary, locale || coreLocalization.locale(), 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); var values = Array.prototype.slice.call(arguments, 1); return formatter && formatter.apply(this, values) || "" } }); module.exports = messageLocalization }, /*!**************************************************!*\ !*** ./artifacts/transpiled/core/utils/array.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var isDefined = __webpack_require__( /*! ./type */ 1).isDefined; var each = __webpack_require__( /*! ./iterator */ 3).each; var objectUtils = __webpack_require__( /*! ./object */ 47); var config = __webpack_require__( /*! ../config */ 31); var isEmpty = function(entity) { return Array.isArray(entity) && !entity.length }; var wrapToArray = function(entity) { return Array.isArray(entity) ? entity : [entity] }; var intersection = function(a, b) { if (!Array.isArray(a) || 0 === a.length || !Array.isArray(b) || 0 === b.length) { return [] } var result = []; each(a, function(_, value) { var index = inArray(value, b); if (index !== -1) { result.push(value) } }); return result }; var removeDuplicates = function(from, what) { if (!Array.isArray(from) || 0 === from.length) { return [] } if (!Array.isArray(what) || 0 === what.length) { return from.slice() } var result = []; each(from, function(_, value) { var index = inArray(value, what); if (index === -1) { result.push(value) } }); return result }; var normalizeIndexes = function(items, indexParameterName, currentItem, needIndexCallback) { var indexedItems = {}; var parameterIndex = 0; var useLegacyVisibleIndex = config().useLegacyVisibleIndex; each(items, function(index, item) { index = item[indexParameterName]; if (index >= 0) { indexedItems[index] = indexedItems[index] || []; if (item === currentItem) { indexedItems[index].unshift(item) } else { indexedItems[index].push(item) } } else { item[indexParameterName] = void 0 } }); if (!useLegacyVisibleIndex) { each(items, function() { if (!isDefined(this[indexParameterName]) && (!needIndexCallback || needIndexCallback(this))) { while (indexedItems[parameterIndex]) { parameterIndex++ } indexedItems[parameterIndex] = [this]; parameterIndex++ } }) } parameterIndex = 0; objectUtils.orderEach(indexedItems, function(index, items) { each(items, function() { if (index >= 0) { this[indexParameterName] = parameterIndex++ } }) }); if (useLegacyVisibleIndex) { each(items, function() { if (!isDefined(this[indexParameterName]) && (!needIndexCallback || needIndexCallback(this))) { this[indexParameterName] = parameterIndex++ } }) } return parameterIndex }; var inArray = function(value, object) { if (!object) { return -1 } var array = Array.isArray(object) ? object : object.toArray(); return array.indexOf(value) }; var merge = function(array1, array2) { for (var i = 0; i < array2.length; i++) { array1[array1.length] = array2[i] } return array1 }; var find = function(array, condition) { for (var i = 0; i < array.length; i++) { if (condition(array[i])) { return array[i] } } }; exports.isEmpty = isEmpty; exports.wrapToArray = wrapToArray; exports.intersection = intersection; exports.removeDuplicates = removeDuplicates; exports.normalizeIndexes = normalizeIndexes; exports.inArray = inArray; exports.merge = merge; exports.find = find }, /*!********************************************!*\ !*** ./artifacts/transpiled/core/class.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var errors = __webpack_require__( /*! ./errors */ 21); var typeUtils = __webpack_require__( /*! ./utils/type */ 1); 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 that = this; var overridden; var memberName; var member; 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 classObj = this; var argument; var name; var i; var hasClassObjOwnProperty = Object.prototype.hasOwnProperty.bind(classObj); var isES6Class = !hasClassObjOwnProperty("_includedCtors") && !hasClassObjOwnProperty("_includedPostCtors"); if (isES6Class) { classObj._includedCtors = classObj._includedCtors.slice(0); classObj._includedPostCtors = classObj._includedPostCtors.slice(0) } 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 || typeUtils.isWindow(this) || "function" !== typeof this.constructor) { throw errors.Error("E0003") } var instance = this; var ctor = instance.ctor; var includedCtors = instance.constructor._includedCtors; var includedPostCtors = instance.constructor._includedPostCtors; var i; 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 }, /*!**********************************************!*\ !*** ./artifacts/transpiled/core/devices.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var windowUtils = __webpack_require__( /*! ./utils/window */ 7); var navigator = windowUtils.getNavigator(); var window = windowUtils.getWindow(); var extend = __webpack_require__( /*! ./utils/extend */ 0).extend; var isPlainObject = __webpack_require__( /*! ./utils/type */ 1).isPlainObject; var each = __webpack_require__( /*! ./utils/iterator */ 3).each; var Class = __webpack_require__( /*! ./class */ 15); var errors = __webpack_require__( /*! ./errors */ 21); var Callbacks = __webpack_require__( /*! ./utils/callbacks */ 26); var resizeCallbacks = __webpack_require__( /*! ./utils/resize_callbacks */ 130); var EventsMixin = __webpack_require__( /*! ./events_mixin */ 82); var SessionStorage = __webpack_require__( /*! ./utils/storage */ 280).sessionStorage; var viewPort = __webpack_require__( /*! ./utils/view_port */ 78); var Config = __webpack_require__( /*! ./config */ 31); 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: "Windows 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/); var isTablet = !isPhone && /Windows(.*)arm(.*)Tablet PC/i.test(userAgent); var 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); var 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); var matches = userAgent.match(/os (\d+)_(\d+)_?(\d+)?/i); var version = matches ? [parseInt(matches[1], 10), parseInt(matches[2], 10), parseInt(matches[3] || 0, 10)] : []; var isIPhone4 = 480 === window.screen.height; var 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); var matches = userAgent.match(/android (\d+)\.?(\d+)?\.?(\d+)?/i); var version = matches ? [parseInt(matches[1], 10), parseInt(matches[2] || 0, 10), parseInt(matches[3] || 0, 10)] : []; var worseThan4_4 = version.length > 1 && (version[0] < 4 || 4 === version[0] && version[1] < 4); var 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(); if (windowUtils.hasWindow()) { this._recalculateOrientation(); resizeCallbacks.add(this._recalculateOrientation.bind(this)) } }, current: function(deviceOrName) { if (deviceOrName) { this._currentDevice = this._getDevice(deviceOrName); this._forced = true; this.changed.fire(); 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 || windowUtils.hasWindow() && 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 (windowUtils.hasWindow() && (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 JSON.parse(deviceOrName) } catch (ex) { return deviceOrName } }, _fromConfig: function(config) { var result = extend({}, DEFAULT_DEVICE, this._currentDevice, config); var 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()); var deviceWithOS = DEFAULT_DEVICE; deviceWithOS.mac = isMac; return deviceWithOS }, _changeOrientation: function() { var $window = $(this._window); var 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 }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/ui/widget/ui.errors.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var errorUtils = __webpack_require__( /*! ../../core/utils/error */ 129); var errors = __webpack_require__( /*! ../../core/errors */ 21); module.exports = errorUtils(errors.ERROR_MESSAGES, { E1001: "Module '{0}'. Controller '{1}' is already registered", E1002: "Module '{0}'. Controller '{1}' does not inherit from DevExpress.ui.dxDataGrid.Controller", E1003: "Module '{0}'. View '{1}' is already registered", E1004: "Module '{0}'. View '{1}' does not inherit from DevExpress.ui.dxDataGrid.View", E1005: "Public method '{0}' is already registered", E1006: "Public method '{0}.{1}' does not exist", E1007: "State storing cannot be provided due to the restrictions of the browser", E1010: "The template does not contain the TextBox widget", E1011: 'Items cannot be deleted from the List. Implement the "remove" function in the data store', E1012: "Editing type '{0}' with the name '{1}' is unsupported", E1016: "Unexpected type of data source is provided for a lookup column", E1018: "The 'collapseAll' method cannot be called if you use a remote data source", E1019: "Search mode '{0}' is unavailable", E1020: "The type cannot be changed after initialization", E1021: "{0} '{1}' you are trying to remove does not exist", E1022: 'The "markers" option is given an invalid value. Assign an array instead', E1023: 'The "routes" option is given an invalid value. Assign an array instead', E1025: "This layout is too complex to render", E1026: 'The "calculateCustomSummary" function is missing from a field whose "summaryType" option is set to "custom"', E1030: "Unknown ScrollView refresh strategy: '{0}'", E1031: "Unknown subscription in the Scheduler widget: '{0}'", E1032: "Unknown start date in an appointment: '{0}'", E1033: "Unknown step in the date navigator: '{0}'", E1034: "The browser does not implement an API for saving files", E1035: "The editor cannot be created because of an internal error: {0}", E1037: "Invalid structure of grouped data", E1038: "The browser does not support local storages for local web pages", E1039: "A cell's position cannot be calculated", E1040: "The '{0}' key value is not unique within the data array", E1041: "The '{0}' script is referenced after the DevExtreme scripts or not referenced at all", E1042: "{0} requires the key field to be specified", E1043: "Changes cannot be processed due to the incorrectly set key", E1044: "The key field specified by the keyExpr option does not match the key field specified in the data store", E1045: "Editing requires the key field to be specified in the data store", E1046: "The '{0}' key field is not found in data objects", E1047: 'The "{0}" field is not found in the fields array', E1048: 'The "{0}" operation is not found in the filterOperations array', E1049: "Column '{0}': filtering is allowed but the 'dataField' or 'name' option is not specified", E1050: "The validationRules option does not apply to third-party editors defined in the editCellTemplate", E1051: 'HtmlEditor\'s valueType is "{0}", but the {0} converter was not imported.', E1052: '{0} should have the "dataSource" option specified', E1053: 'The "buttons" option accepts an array that contains only objects or string values', E1054: "All text editor buttons must have names", E1055: 'One or several text editor buttons have invalid or non-unique "name" values', E1056: 'The {0} widget does not support buttons of the "{1}" type', W1001: 'The "key" option cannot be modified after initialization', W1002: "An item with the key '{0}' does not exist", W1003: "A group with the key '{0}' in which you are trying to select items does not exist", W1004: "The item '{0}' you are trying to select in the 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.", W1006: "The map service returned the following error: '{0}'", W1007: "No item with key {0} was found in the data source, but this key was used as the parent key for item {1}", W1008: "Cannot scroll to the '{0}' date because it does not exist on the current view", W1009: "Searching works only if data is specified using the dataSource option", W1010: "The capability to select all items works with source data of plain structure only", W1011: 'The "keyExpr" option is not applied when dataSource is not an array', W1012: "The '{0}' key field is not found in data objects", W1013: 'The "message" field in the dialog component was renamed to "messageHtml". Change your code correspondingly. In addition, if you used HTML code in the message, make sure that it is secure', W1014: "The Floating Action Button exceeds the recommended speed dial action count. If you need to display more speed dial actions, increase the maxSpeedDialActionCount option value in the global config." }) }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/ui/widget/ui.widget.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var errors = __webpack_require__( /*! ./ui.errors */ 17); var Action = __webpack_require__( /*! ../../core/action */ 111); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray; var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12); var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var devices = __webpack_require__( /*! ../../core/devices */ 16); var DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 67); var Template = __webpack_require__( /*! ./template */ 462); var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74); var FunctionTemplate = __webpack_require__( /*! ./function_template */ 83); var EmptyTemplate = __webpack_require__( /*! ./empty_template */ 109); var ChildDefaultTemplate = __webpack_require__( /*! ./child_default_template */ 134); var KeyboardProcessor = __webpack_require__( /*! ./ui.keyboard_processor */ 167); var selectors = __webpack_require__( /*! ./selectors */ 66); var eventUtils = __webpack_require__( /*! ../../events/utils */ 8); var hoverEvents = __webpack_require__( /*! ../../events/hover */ 148); var feedbackEvents = __webpack_require__( /*! ../../events/core/emitter.feedback */ 125); var clickEvent = __webpack_require__( /*! ../../events/click */ 19); var inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33); var UI_FEEDBACK = "UIFeedback"; var WIDGET_CLASS = "dx-widget"; var ACTIVE_STATE_CLASS = "dx-state-active"; var DISABLED_STATE_CLASS = "dx-state-disabled"; var INVISIBLE_STATE_CLASS = "dx-state-invisible"; var HOVER_STATE_CLASS = "dx-state-hover"; var FOCUSED_STATE_CLASS = "dx-state-focused"; var FEEDBACK_SHOW_TIMEOUT = 30; var FEEDBACK_HIDE_TIMEOUT = 400; var FOCUS_NAMESPACE = "Focus"; var ANONYMOUS_TEMPLATE_NAME = "template"; var TEXT_NODE = 3; var TEMPLATE_SELECTOR = "[data-options*='dxTemplate']"; var TEMPLATE_WRAPPER_CLASS = "dx-template-wrapper"; var DX_POLYMORPH_WIDGET_TEMPLATE = new FunctionTemplate(function(options) { var widgetName = options.model.widget; if (widgetName) { var widgetElement = $("
"); var widgetOptions = options.model.options || {}; if ("button" === widgetName || "tabs" === widgetName || "dropDownMenu" === widgetName) { var deprecatedName = widgetName; widgetName = inflector.camelize("dx-" + widgetName); errors.log("W0001", "dxToolbar - 'widget' item field", deprecatedName, "16.1", "Use: '" + widgetName + "' instead") } if (options.parent) { options.parent._createComponent(widgetElement, widgetName, widgetOptions) } else { widgetElement[widgetName](widgetOptions) } return widgetElement } return $() }); 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, integrationOptions: { watchMethod: function(fn, callback, options) { options = options || {}; if (!options.skipImmediate) { callback(fn()) } return commonUtils.noop }, templates: { "dx-polymorph-widget": DX_POLYMORPH_WIDGET_TEMPLATE }, createTemplate: function(element) { return new Template(element) } }, _keyboardProcessor: void 0 }) }, _feedbackShowTimeout: FEEDBACK_SHOW_TIMEOUT, _feedbackHideTimeout: FEEDBACK_HIDE_TIMEOUT, _init: function() { this.callBase(); this._tempTemplates = []; this._defaultTemplates = {}; this._initTemplates(); this._initContentReadyAction() }, _initTemplates: function() { this._extractTemplates(); this._extractAnonymousTemplate() }, _clearInnerOptionCache: function(optionContainer) { this[optionContainer + "Cache"] = {} }, _cacheInnerOptions: function(optionContainer, optionValue) { var cacheName = optionContainer + "Cache"; this[cacheName] = extend(this[cacheName], optionValue) }, _getOptionsFromContainer: function(_ref) { var name = _ref.name, fullName = _ref.fullName, value = _ref.value; var options = {}; if (name === fullName) { options = value } else { var option = fullName.split(".").pop(); options[option] = value } return options }, _innerOptionChanged: function(innerWidget, args) { var options = this._getOptionsFromContainer(args); innerWidget && innerWidget.option(options); this._cacheInnerOptions(args.name, options) }, _getInnerOptionsCache: function(optionContainer) { return this[optionContainer + "Cache"] }, _initInnerOptionCache: function(optionContainer) { this._clearInnerOptionCache(optionContainer); this._cacheInnerOptions(optionContainer, this.option(optionContainer)) }, _bindInnerWidgetOptions: function(innerWidget, optionsContainer) { this._options[optionsContainer] = extend({}, innerWidget.option()); innerWidget.on("optionChanged", function(e) { this._options[optionsContainer] = extend({}, e.component.option()) }.bind(this)) }, _extractTemplates: function() { var 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, function(templateName, value) { var deviceTemplate = this._findTemplateByDevice(value); if (deviceTemplate) { this._saveTemplate(templateName, deviceTemplate) } }.bind(this)) }, _saveTemplate: function(name, template) { var templates = this.option("integrationOptions.templates"); templates[name] = this._createTemplate(template) }, _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("integrationOptions.templates"); var anonymousTemplateName = this._getAnonymousTemplateName(); var $anonymousTemplate = this.$element().contents().detach(); var $notJunkTemplateContent = $anonymousTemplate.filter(function(_, element) { var isTextNode = element.nodeType === TEXT_NODE; var isEmptyText = $(element).text().trim().length < 1; return !(isTextNode && isEmptyText) }); var onlyJunkTemplateContent = $notJunkTemplateContent.length < 1; if (!templates[anonymousTemplateName] && !onlyJunkTemplateContent) { templates[anonymousTemplateName] = this._createTemplate($anonymousTemplate) } }, _getAriaTarget: function() { return this._focusTarget() }, _getAnonymousTemplateName: function() { return ANONYMOUS_TEMPLATE_NAME }, _getTemplateByOption: function(optionName) { return this._getTemplate(this.option(optionName)) }, _getTemplate: function(templateSource) { if (typeUtils.isFunction(templateSource)) { return new FunctionTemplate(function(options) { var templateSourceResult = templateSource.apply(this, this._getNormalizedTemplateArgs(options)); if (!typeUtils.isDefined(templateSourceResult)) { return new EmptyTemplate } var dispose = false; var template = this._acquireTemplate(templateSourceResult, function(templateSource) { if (templateSource.nodeType || typeUtils.isRenderer(templateSource) && !$(templateSource).is("script")) { return new FunctionTemplate(function() { return templateSource }) } dispose = true; return this._createTemplate(templateSource) }.bind(this)); var result = template.render(options); dispose && template.dispose && template.dispose(); return result }.bind(this)) } return this._acquireTemplate(templateSource, this._createTemplateIfNeeded.bind(this)) }, _acquireTemplate: function(templateSource, createTemplate) { if (null == templateSource) { return new EmptyTemplate } if (templateSource instanceof ChildDefaultTemplate) { return this._defaultTemplates[templateSource.name] } if (templateSource instanceof TemplateBase) { return templateSource } if (typeUtils.isFunction(templateSource.render) && !typeUtils.isRenderer(templateSource)) { return this._addOneRenderedCall(templateSource) } if (templateSource.nodeType || typeUtils.isRenderer(templateSource)) { return createTemplate($(templateSource)) } if ("string" === typeof templateSource) { var nonIntegrationTemplates = this.option("integrationOptions.skipTemplates") || []; var integrationTemplate = null; if (nonIntegrationTemplates.indexOf(templateSource) === -1) { integrationTemplate = this._renderIntegrationTemplate(templateSource) } return integrationTemplate || this._defaultTemplates[templateSource] || createTemplate(templateSource) } return this._acquireTemplate(templateSource.toString(), createTemplate) }, _addOneRenderedCall: function(template) { var _render = template.render.bind(template); return extend({}, template, { render: function(options) { var templateResult = _render(options); options && options.onRendered && options.onRendered(); return templateResult } }) }, _renderIntegrationTemplate: function(templateSource) { var integrationTemplate = this.option("integrationOptions.templates")[templateSource]; if (integrationTemplate && !(integrationTemplate instanceof TemplateBase)) { var isAsyncTemplate = this.option("templatesRenderAsynchronously"); if (!isAsyncTemplate) { return this._addOneRenderedCall(integrationTemplate) } } return integrationTemplate }, _createTemplateIfNeeded: function(templateSource) { var templateKey = function(templateSource) { return typeUtils.isRenderer(templateSource) && templateSource[0] || templateSource }; var cachedTemplate = this._tempTemplates.filter(function(t) { templateSource = templateKey(templateSource); return t.source === templateSource })[0]; if (cachedTemplate) { return cachedTemplate.template } var template = this._createTemplate(templateSource); this._tempTemplates.push({ template: template, source: templateKey(templateSource) }); return template }, _createTemplate: function(templateSource) { templateSource = "string" === typeof templateSource ? domUtils.normalizeTemplateElement(templateSource) : templateSource; return this.option("integrationOptions.createTemplate")(templateSource) }, _getNormalizedTemplateArgs: function(options) { var args = []; if ("model" in options) { args.push(options.model) } if ("index" in options) { args.push(options.index) } args.push(options.container); return args }, _cleanTemplates: function() { this._tempTemplates.forEach(function(t) { t.template.dispose && t.template.dispose() }); this._tempTemplates = [] }, _initContentReadyAction: function() { this._contentReadyAction = this._createActionByOption("onContentReady", { excludeValidators: ["disabled", "readOnly"] }) }, _initMarkup: function() { this.$element().addClass(WIDGET_CLASS); this._toggleDisabledState(this.option("disabled")); this._toggleVisibility(this.option("visible")); this._renderHint(); if (this._isFocusable()) { this._renderFocusTarget() } this.callBase() }, _render: function() { this.callBase(); this._renderContent(); this._renderFocusState(); this._attachFeedbackEvents(); this._attachHoverEvents() }, _renderHint: function() { var hint = this.option("hint"); this.$element().attr("title", hint ? hint : null) }, _renderContent: function() { var _this = this; commonUtils.deferRender(function() { if (_this._disposed) { return } return _this._renderContentImpl() }).done(function() { if (_this._disposed) { return } _this._fireContentReadyAction() }) }, _renderContentImpl: commonUtils.noop, _fireContentReadyAction: commonUtils.deferRenderer(function() { this._contentReadyAction() }), _dispose: function() { this._cleanTemplates(); this._contentReadyAction = null; this.callBase() }, _resetActiveState: function() { this._toggleActiveState(this._eventBindingTarget(), false) }, _clean: function() { this._cleanFocusState(); this._resetActiveState(); this.callBase(); this.$element().empty() }, _toggleVisibility: function(visible) { this.$element().toggleClass(INVISIBLE_STATE_CLASS, !visible); this.setAria("hidden", !visible || void 0) }, _renderFocusState: function() { this._attachKeyboardEvents(); if (!this._isFocusable()) { return } this._renderFocusTarget(); this._attachFocusEvents(); this._renderAccessKey() }, _renderAccessKey: function() { var focusTarget = this._focusTarget(); focusTarget.attr("accesskey", this.option("accessKey")); var clickNamespace = eventUtils.addNamespace(clickEvent.name, UI_FEEDBACK); eventsEngine.off(focusTarget, clickNamespace); this.option("accessKey") && eventsEngine.on(focusTarget, clickNamespace, function(e) { if (eventUtils.isFakeClickEvent(e)) { e.stopImmediatePropagation(); this.focus() } }.bind(this)) }, _isFocusable: function() { return this.option("focusStateEnabled") && !this.option("disabled") }, _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._focusEventTarget(); var namespace = this.NAME + FOCUS_NAMESPACE; var focusEvents = eventUtils.addNamespace("focusin", namespace); focusEvents = focusEvents + " " + eventUtils.addNamespace("focusout", namespace); if (domAdapter.hasDocumentProperty("onbeforeactivate")) { focusEvents = focusEvents + " " + eventUtils.addNamespace("beforeactivate", namespace) } eventsEngine.off($element, focusEvents) }, _attachFocusEvents: function() { var namespace = this.NAME + FOCUS_NAMESPACE; var focusInEvent = eventUtils.addNamespace("focusin", namespace); var focusOutEvent = eventUtils.addNamespace("focusout", namespace); var $focusTarget = this._focusEventTarget(); eventsEngine.on($focusTarget, focusInEvent, this._focusInHandler.bind(this)); eventsEngine.on($focusTarget, focusOutEvent, this._focusOutHandler.bind(this)); if (domAdapter.hasDocumentProperty("onbeforeactivate")) { var beforeActivateEvent = eventUtils.addNamespace("beforeactivate", namespace); eventsEngine.on(this._focusEventTarget(), beforeActivateEvent, function(e) { if (!$(e.target).is(selectors.focusable)) { e.preventDefault() } }) } }, _refreshFocusEvent: function() { this._detachFocusEvents(); this._attachFocusEvents() }, _focusEventTarget: function() { return this._focusTarget() }, _focusInHandler: function(e) { if (e.isDefaultPrevented()) { return } var that = this; that._createActionByOption("onFocusIn", { beforeExecute: function() { that._updateFocusState(e, true) }, excludeValidators: ["readOnly"] })({ event: e }) }, _focusOutHandler: function(e) { if (e.isDefaultPrevented()) { return } var that = this; that._createActionByOption("onFocusOut", { beforeExecute: function() { that._updateFocusState(e, false) }, excludeValidators: ["readOnly", "disabled"] })({ event: e }) }, _updateFocusState: function(e, isFocused) { var target = e.target; if (inArray(target, this._focusTarget()) !== -1) { 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) }, _isFocused: function() { return this._hasFocusClass() }, _attachKeyboardEvents: function() { var processor = this.option("_keyboardProcessor"); if (processor) { this._keyboardProcessor = processor.reinitialize(this._keyboardHandler, this) } else { if (this.option("focusStateEnabled")) { this._disposeKeyboardProcessor(); this._keyboardProcessor = new KeyboardProcessor({ element: this._keyboardEventBindingTarget(), handler: this._keyboardHandler, focusTarget: this._focusTarget(), context: this }) } } }, _keyboardHandler: function(options) { var e = options.originalEvent; var keyName = options.keyName; var keyCode = options.which; var keys = this._supportedKeys(e); var func = keys[keyName] || keys[keyCode]; if (void 0 !== func) { var handler = func.bind(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"); this._disposeKeyboardProcessor() }, _disposeKeyboardProcessor: function() { if (this._keyboardProcessor) { this._keyboardProcessor.dispose(); delete this._keyboardProcessor } }, _attachHoverEvents: function() { var that = this; var hoverableSelector = that._activeStateUnit; var nameStart = eventUtils.addNamespace(hoverEvents.start, UI_FEEDBACK); var nameEnd = eventUtils.addNamespace(hoverEvents.end, UI_FEEDBACK); eventsEngine.off(that._eventBindingTarget(), nameStart, hoverableSelector); eventsEngine.off(that._eventBindingTarget(), nameEnd, hoverableSelector); if (that.option("hoverStateEnabled")) { var startAction = new Action(function(args) { that._hoverStartHandler(args.event); that._refreshHoveredElement($(args.element)) }, { excludeValidators: ["readOnly"] }); var $eventBindingTarget = that._eventBindingTarget(); eventsEngine.on($eventBindingTarget, nameStart, hoverableSelector, function(e) { startAction.execute({ element: $(e.target), event: e }) }); eventsEngine.on($eventBindingTarget, nameEnd, hoverableSelector, function(e) { that._hoverEndHandler(e); that._forgetHoveredElement() }) } else { that._toggleHoverClass(false) } }, _hoverStartHandler: commonUtils.noop, _hoverEndHandler: commonUtils.noop, _attachFeedbackEvents: function() { var that = this; var feedbackSelector = that._activeStateUnit; var activeEventName = eventUtils.addNamespace(feedbackEvents.active, UI_FEEDBACK); var inactiveEventName = eventUtils.addNamespace(feedbackEvents.inactive, UI_FEEDBACK); var feedbackAction; var feedbackActionDisabled; eventsEngine.off(that._eventBindingTarget(), activeEventName, feedbackSelector); eventsEngine.off(that._eventBindingTarget(), inactiveEventName, feedbackSelector); if (that.option("activeStateEnabled")) { var feedbackActionHandler = function(args) { var $element = $(args.element); var value = args.value; var dxEvent = args.event; that._toggleActiveState($element, value, dxEvent) }; eventsEngine.on(that._eventBindingTarget(), activeEventName, feedbackSelector, { timeout: that._feedbackShowTimeout }, function(e) { feedbackAction = feedbackAction || new Action(feedbackActionHandler); feedbackAction.execute({ element: $(e.currentTarget), value: true, event: e }) }); eventsEngine.on(that._eventBindingTarget(), inactiveEventName, feedbackSelector, { timeout: that._feedbackHideTimeout }, function(e) { feedbackActionDisabled = feedbackActionDisabled || new Action(feedbackActionHandler, { excludeValidators: ["disabled", "readOnly"] }); feedbackActionDisabled.execute({ element: $(e.currentTarget), value: false, event: 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 (typeUtils.isPlainObject(args[0])) { each(args[0], function(option, value) { this._setWidgetOption(widgetName, [option, value]) }.bind(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) }, _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; 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; var attrValue = option.value; if (typeUtils.isDefined(attrValue)) { attrValue = attrValue.toString() } else { attrValue = null } option.target.attr(attrName, attrValue) }; if (!typeUtils.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() { eventsEngine.trigger(this._focusTarget(), "focus") }, registerKeyHandler: function(key, handler) { var currentKeys = this._supportedKeys(); var addingKeys = {}; addingKeys[key] = handler; this._supportedKeys = function() { return extend(currentKeys, addingKeys) } } }); module.exports = Widget }, /*!**********************************************!*\ !*** ./artifacts/transpiled/events/click.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var devices = __webpack_require__( /*! ../core/devices */ 16); var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11); var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12); var animationFrame = __webpack_require__( /*! ../animation/frame */ 112); var eventUtils = __webpack_require__( /*! ./utils */ 8); var pointerEvents = __webpack_require__( /*! ./pointer */ 23); var Emitter = __webpack_require__( /*! ./core/emitter */ 123); var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95); var compareVersions = __webpack_require__( /*! ../core/utils/version */ 61).compare; var CLICK_EVENT_NAME = "dxclick"; var TOUCH_BOUNDARY = 10; var abs = Math.abs; var isInput = function(element) { return $(element).is("input, textarea, select, button ,:focus, :focus *") }; var misc = { requestAnimationFrame: animationFrame.requestAnimationFrame, cancelAnimationFrame: animationFrame.cancelAnimationFrame }; 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); this._clickAnimationFrame = misc.requestAnimationFrame(function() { this._fireClickEvent(e) }.bind(this)) }, _eventOutOfElement: function(e, element) { var target = e.target; var targetChanged = !domUtils.contains(element, target) && element !== target; var gestureDelta = eventUtils.eventDelta(eventUtils.eventData(e), this._startEventData); var 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) }) }, dispose: function() { misc.cancelAnimationFrame(this._clickAnimationFrame) } }); ! function() { var NATIVE_CLICK_CLASS = "dx-native-click"; var realDevice = devices.real(); var useNativeClick = realDevice.generic || realDevice.ios && compareVersions(realDevice.version, [9, 3]) >= 0 || realDevice.android && compareVersions(realDevice.version, [5]) >= 0; var isNativeClickEvent = function(target) { return useNativeClick || $(target).closest("." + NATIVE_CLICK_CLASS).length }; var prevented = null; var lastFiredEvent = null; var clickHandler = function(e) { var originalEvent = e.originalEvent; var eventAlreadyFired = lastFiredEvent === originalEvent || originalEvent && originalEvent.DXCLICK_FIRED; var leftButton = !e.which || 1 === e.which; if (leftButton && !prevented && isNativeClickEvent(e.target) && !eventAlreadyFired) { if (originalEvent) { originalEvent.DXCLICK_FIRED = true } lastFiredEvent = originalEvent; eventUtils.fireEvent({ type: CLICK_EVENT_NAME, originalEvent: e }) } }; ClickEmitter = ClickEmitter.inherit({ _makeElementClickable: function($element) { if (!isNativeClickEvent($element)) { this.callBase($element) } eventsEngine.on($element, "click", clickHandler) }, configure: function(data) { this.callBase(data); if (data.useNative) { this.getElement().addClass(NATIVE_CLICK_CLASS) } }, start: function(e) { prevented = null; if (!isNativeClickEvent(e.target)) { this.callBase(e) } }, end: function(e) { if (!isNativeClickEvent(e.target)) { this.callBase(e) } }, cancel: function() { prevented = true }, dispose: function() { this.callBase(); eventsEngine.off(this.getElement(), "click", clickHandler) } }); exports.useNativeClick = useNativeClick }(); ! function() { var desktopDevice = devices.real().generic; if (!desktopDevice) { var startTarget = null; var 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"; var document = domAdapter.getDocument(); eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(pointerEvents.down, NATIVE_CLICK_FIXER_NAMESPACE), pointerDownHandler); eventsEngine.subscribeGlobal(document, 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 }, /*!*************************************************!*\ !*** ./artifacts/transpiled/core/utils/data.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var errors = __webpack_require__( /*! ../errors */ 21); var Class = __webpack_require__( /*! ../class */ 15); var objectUtils = __webpack_require__( /*! ./object */ 47); var typeUtils = __webpack_require__( /*! ./type */ 1); var each = __webpack_require__( /*! ./iterator */ 3).each; var variableWrapper = __webpack_require__( /*! ./variable_wrapper */ 86); var unwrapVariable = variableWrapper.unwrap; var isWrapped = variableWrapper.isWrapped; var assign = variableWrapper.assign; var bracketsToDots = function(expr) { return expr.replace(/\[/g, ".").replace(/\]/g, "") }; var readPropValue = function(obj, propName, options) { options = options || {}; if ("this" === propName) { return unwrap(obj, options) } return unwrap(obj[propName], options) }; 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 = [].slice.call(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; var hasDefaultValue = "defaultValue" in options; var current = unwrap(obj, options); for (var i = 0; i < path.length; i++) { if (!current) { if (null == current && hasDefaultValue) { return options.defaultValue } break } var pathPart = path[i]; if (hasDefaultValue && typeUtils.isObject(current) && !(pathPart in current)) { return options.defaultValue } var next = unwrap(current[pathPart], options); if (!functionAsIs && typeUtils.isFunction(next)) { next = next.call(current) } current = next } return current } } if (Array.isArray(expr)) { return combineGetters(expr) } if (typeUtils.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 value = this(obj, options); var current; if (void 0 === value) { return } current = result || (result = {}); var path = name.split("."); var last = path.length - 1; for (var _i = 0; _i < last; _i++) { var pathItem = path[_i]; if (!(pathItem in current)) { current[pathItem] = {} } current = current[pathItem] } current[path[last]] = value }); return result } }; var ensurePropValueDefined = function(obj, propName, value, options) { if (typeUtils.isDefined(value)) { return value } var newValue = {}; assignPropValue(obj, propName, newValue, options); return newValue }; var compileSetter = function(expr) { expr = bracketsToDots(expr || "this").split("."); var lastLevelIndex = expr.length - 1; return function(obj, value, options) { options = prepareOptions(options); var currentValue = unwrap(obj, options); expr.forEach(function(propertyName, levelIndex) { var propertyValue = readPropValue(currentValue, propertyName, options); var isPropertyFunc = !options.functionsAsIs && typeUtils.isFunction(propertyValue) && !isWrapped(propertyValue); if (levelIndex === lastLevelIndex) { if (options.merge && typeUtils.isPlainObject(value) && (!typeUtils.isDefined(propertyValue) || typeUtils.isPlainObject(propertyValue))) { propertyValue = ensurePropValueDefined(currentValue, propertyName, propertyValue, options); objectUtils.deepExtendArraySafe(propertyValue, value, false, true) } else { if (isPropertyFunc) { currentValue[propertyName](value) } else { assignPropValue(currentValue, propertyName, value, options) } } } else { propertyValue = ensurePropValueDefined(currentValue, propertyName, propertyValue, options); if (isPropertyFunc) { propertyValue = propertyValue.call(currentValue) } currentValue = propertyValue } }) } }; 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 }, /*!*********************************************!*\ !*** ./artifacts/transpiled/core/errors.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var errorUtils = __webpack_require__( /*! ./utils/error */ 129); 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", E0024: "DevExtreme bundle already included", E0025: "Unexpected argument type", 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 'customItem' field of the 'onCustomItemCreating' function's parameter should contain a custom item or Promise that is resolved after the item is created.", 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}'", W0007: "'{0}' Globalize culture is not defined", 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", W0013: "'{0}' file is deprecated in {1}. {2}", W0014: "{0} - '{1}' type is deprecated in {2}. {3}", W0015: "Instead of returning a value from the '{0}' function, write it into the '{1}' field of the function's parameter.", W0016: 'The "{0}" option does not accept the "{1}" value since v.{2}. {3}.' }) }, /*!*************************************************!*\ !*** ./artifacts/transpiled/core/utils/date.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var typeUtils = __webpack_require__( /*! ./type */ 1); var adjust = __webpack_require__( /*! ./math */ 28).adjust; var each = __webpack_require__( /*! ./iterator */ 3).each; var camelize = __webpack_require__( /*! ./inflector */ 33).camelize; var isObject = typeUtils.isObject; var isString = typeUtils.isString; var isDate = typeUtils.isDate; var isDefined = typeUtils.isDefined; var dateUnitIntervals = ["millisecond", "second", "minute", "hour", "day", "week", "month", "quarter", "year"]; var toMilliseconds = function toMilliseconds(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(); var 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 dateUnitIntervals = ["millisecond", "second", "minute", "hour", "day", "month", "year"]; var result = {}; for (var i = dateUnitIntervals.length - 1; i >= 0; i--) { var dateUnitInterval = dateUnitIntervals[i]; var 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 maxInterval = -1; if (isString(tickInterval)) { return tickInterval } if (isObject(tickInterval)) { each(tickInterval, function(key, value) { for (var 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, firstDayOfWeek) { date = new Date(date.getTime()); var oldDate = new Date(date.getTime()); var dateUnitInterval = getDateUnitInterval(dateInterval); switch (dateUnitInterval) { case "second": date = new Date(1e3 * Math.floor(oldDate.getTime() / 1e3)); break; case "minute": date = new Date(6e4 * Math.floor(oldDate.getTime() / 6e4)); break; case "hour": date = new Date(36e5 * Math.floor(oldDate.getTime() / 36e5)); break; case "year": date.setMonth(0); case "month": date.setDate(1); case "day": date.setHours(0, 0, 0, 0); break; case "week": date = getFirstWeekDate(date, firstDayOfWeek || 0); date.setHours(0, 0, 0, 0); break; case "quarter": var firstQuarterMonth = getFirstQuarterMonth(date.getMonth()); var month = date.getMonth(); date.setDate(1); date.setHours(0, 0, 0, 0); if (month !== firstQuarterMonth) { date.setMonth(firstQuarterMonth) } } if (withCorrection && "hour" !== dateUnitInterval && "minute" !== dateUnitInterval && "second" !== dateUnitInterval) { fixTimezoneGap(oldDate, date) } return date }; var trimTime = function(date) { return dateUtils.correctDateWithUnitBeginning(date, "day") }; var setToDayEnd = function(date) { var result = dateUtils.trimTime(date); result.setDate(result.getDate() + 1); return new Date(result.getTime() - 1) }; var getDatesDifferences = function(date1, date2) { var counter = 0; var 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(), millisecond: date1.getMilliseconds() !== date2.getMilliseconds() }; each(differences, function(key, value) { if (value) { counter++ } }); if (0 === counter && 0 !== getTimezonesDifference(date1, date2)) { differences.hour = true; counter++ } differences.count = counter; return differences }; function addDateInterval(value, interval, dir) { var result = new Date(value.getTime()); var intervalObject = isString(interval) ? getDateIntervalByString(interval.toLowerCase()) : typeUtils.isNumeric(interval) ? convertMillisecondsToDateUnits(interval) : 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.setTime(result.getTime() + 36e5 * intervalObject.hours * dir) } if (intervalObject.minutes) { result.setTime(result.getTime() + 6e4 * intervalObject.minutes * dir) } if (intervalObject.seconds) { result.setTime(result.getTime() + 1e3 * intervalObject.seconds * dir) } if (intervalObject.milliseconds) { result.setTime(result.getTime() + intervalObject.milliseconds * dir) } return result } var addInterval = function(value, interval, isNegative) { var dir = isNegative ? -1 : 1; return isDate(value) ? addDateInterval(value, interval, dir) : adjust(value + interval * dir, interval) }; var getSequenceByInterval = function(min, max, interval) { var intervals = []; var cur; intervals.push(isDate(min) ? new Date(min.getTime()) : min); cur = min; while (cur < max) { cur = addInterval(cur, interval); intervals.push(cur) } return intervals }; 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); resultDate.setDate(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.weeks = 1; 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 sameDate = function(date1, date2) { return sameMonthAndYear(date1, date2) && date1.getDate() === date2.getDate() }; var sameMonthAndYear = function(date1, date2) { return sameYear(date1, date2) && 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; var 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; var 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/MM/dd" }; 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"); var 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 && dateUtils.correctDateWithUnitBeginning(min, "day"); max = max && dateUtils.correctDateWithUnitBeginning(max, "day"); date = date && dateUtils.correctDateWithUnitBeginning(date, "day") } return normalizeDate(date, min, max) === date }; var dateTimeFromDecimal = function(number) { var hours = Math.floor(number); var minutes = number % 1 * 60; return { hours: hours, minutes: minutes } }; var roundDateByStartDayHour = function(date, startDayHour) { var startTime = this.dateTimeFromDecimal(startDayHour); var result = new Date(date); if (date.getHours() === startTime.hours && date.getMinutes() < startTime.minutes || date.getHours() < startTime.hours) { result.setHours(startTime.hours, startTime.minutes, 0, 0) } return result }; 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 diff = newDate.getHours() - oldDate.getHours(); if (0 === diff) { return } var sign = 1 === diff || diff === -23 ? -1 : 1; var trial = new Date(newDate.getTime() + 36e5 * sign); if (sign > 0 || trial.getDate() === newDate.getDate()) { newDate.setTime(trial.getTime()) } }; var roundToHour = function(date) { date.setHours(date.getHours() + 1); date.setMinutes(0); return date }; var getTimezonesDifference = function(min, max) { return 60 * (max.getTimezoneOffset() - min.getTimezoneOffset()) * 1e3 }; var makeDate = function(date) { return new Date(date) }; var getDatesOfInterval = function(startDate, endDate, step) { var result = []; var currentDate = new Date(startDate.getTime()); if (startDate.getTime() === endDate.getTime()) { result.push(new Date(startDate.getTime())) } while (currentDate < endDate) { result.push(new Date(currentDate.getTime())); currentDate = this.addInterval(currentDate, step) } return result }; var dateUtils = { dateUnitIntervals: dateUnitIntervals, convertMillisecondsToDateUnits: convertMillisecondsToDateUnits, dateToMilliseconds: dateToMilliseconds, getNextDateUnit: getNextDateUnit, convertDateUnitToMilliseconds: convertDateUnitToMilliseconds, getDateUnitInterval: getDateUnitInterval, getDateFormatByTickInterval: getDateFormatByTickInterval, getDatesDifferences: getDatesDifferences, correctDateWithUnitBeginning: correctDateWithUnitBeginning, trimTime: trimTime, setToDayEnd: setToDayEnd, roundDateByStartDayHour: roundDateByStartDayHour, dateTimeFromDecimal: dateTimeFromDecimal, addDateInterval: addDateInterval, addInterval: addInterval, getSequenceByInterval: getSequenceByInterval, getDateIntervalByString: getDateIntervalByString, sameDate: sameDate, 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, roundToHour: roundToHour, normalizeDate: normalizeDate, getViewMinBoundaryDate: getViewMinBoundaryDate, getViewMaxBoundaryDate: getViewMaxBoundaryDate, fixTimezoneGap: fixTimezoneGap, getTimezonesDifference: getTimezonesDifference, makeDate: makeDate, getDatesInterval: getDatesInterval, getDatesOfInterval: getDatesOfInterval }; module.exports = dateUtils }, /*!************************************************!*\ !*** ./artifacts/transpiled/events/pointer.js ***! \************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _support = __webpack_require__( /*! ../core/utils/support */ 43); var _support2 = _interopRequireDefault(_support); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _browser = __webpack_require__( /*! ../core/utils/browser */ 25); var _browser2 = _interopRequireDefault(_browser); var _devices = __webpack_require__( /*! ../core/devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _event_registrator = __webpack_require__( /*! ./core/event_registrator */ 71); var _event_registrator2 = _interopRequireDefault(_event_registrator); var _touch = __webpack_require__( /*! ./pointer/touch */ 265); var _touch2 = _interopRequireDefault(_touch); var _mspointer = __webpack_require__( /*! ./pointer/mspointer */ 447); var _mspointer2 = _interopRequireDefault(_mspointer); var _mouse = __webpack_require__( /*! ./pointer/mouse */ 267); var _mouse2 = _interopRequireDefault(_mouse); var _mouse_and_touch = __webpack_require__( /*! ./pointer/mouse_and_touch */ 448); var _mouse_and_touch2 = _interopRequireDefault(_mouse_and_touch); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var getStrategy = function(support, device, browser) { if (support.pointerEvents && browser.msie) { return _mspointer2.default } var tablet = device.tablet, phone = device.phone; if (support.touch && !(tablet || phone)) { return _mouse_and_touch2.default } if (support.touch) { return _touch2.default } return _mouse2.default }; var EventStrategy = getStrategy(_support2.default, _devices2.default.real(), _browser2.default); (0, _iterator.each)(EventStrategy.map, function(pointerEvent, originalEvents) { (0, _event_registrator2.default)(pointerEvent, new EventStrategy(pointerEvent, originalEvents)) }); var pointer = { down: "dxpointerdown", up: "dxpointerup", move: "dxpointermove", cancel: "dxpointercancel", enter: "dxpointerenter", leave: "dxpointerleave", over: "dxpointerover", out: "dxpointerout" }; pointer.getStrategy = getStrategy; module.exports = pointer }, /*!****************************************************************!*\ !*** ./artifacts/transpiled/ui/data_grid/ui.data_grid.core.js ***! \****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _uiGrid_core = __webpack_require__( /*! ../grid_core/ui.grid_core.utils */ 35); var _uiGrid_core2 = _interopRequireDefault(_uiGrid_core); var _uiGrid_core3 = __webpack_require__( /*! ../grid_core/ui.grid_core.modules */ 37); var _uiGrid_core4 = _interopRequireDefault(_uiGrid_core3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } }(0, _extend.extend)(exports, _uiGrid_core4.default, _uiGrid_core2.default, { modules: [] }) }, /*!****************************************************!*\ !*** ./artifacts/transpiled/core/utils/browser.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var extend = __webpack_require__( /*! ./extend */ 0).extend; var windowUtils = __webpack_require__( /*! ./window */ 7); var navigator = windowUtils.getNavigator(); var webkitRegExp = /(webkit)[ \/]([\w.]+)/; var ieRegExp = /(msie) (\d{1,2}\.\d)/; var ie11RegExp = /(trident).*rv:(\d{1,2}\.\d)/; var msEdge = /(edge)\/((\d+)?[\w.]+)/; var mozillaRegExp = /(mozilla)(?:.*? rv:([\w.]+))/; var browserFromUA = function(ua) { ua = ua.toLowerCase(); var result = {}; var matches = ieRegExp.exec(ua) || ie11RegExp.exec(ua) || msEdge.exec(ua) || ua.indexOf("compatible") < 0 && mozillaRegExp.exec(ua) || webkitRegExp.exec(ua) || []; var browserName = matches[1]; var browserVersion = matches[2]; if ("webkit" === browserName) { result.webkit = true; if (ua.indexOf("chrome") >= 0 || ua.indexOf("crios") >= 0) { browserName = "chrome"; browserVersion = /(?:chrome|crios)\/(\d+\.\d+)/.exec(ua); browserVersion = browserVersion && browserVersion[1] } else { if (ua.indexOf("fxios") >= 0) { browserName = "mozilla"; browserVersion = /fxios\/(\d+\.\d+)/.exec(ua); browserVersion = browserVersion && browserVersion[1] } else { if (ua.indexOf("safari") >= 0 && /version|phantomjs/.test(ua)) { browserName = "safari"; browserVersion = /(?:version|phantomjs)\/([0-9.]+)/.exec(ua); browserVersion = browserVersion && browserVersion[1] } else { browserName = "unknown"; browserVersion = /applewebkit\/([0-9.]+)/.exec(ua); browserVersion = browserVersion && browserVersion[1] } } } } 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)) }, /*!******************************************************!*\ !*** ./artifacts/transpiled/core/utils/callbacks.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Callback = function(options) { this._options = options || {}; this._list = []; this._queue = []; this._firing = false; this._fired = false; this._firingIndexes = [] }; Callback.prototype._fireCore = function(context, args) { var firingIndexes = this._firingIndexes; var list = this._list; var stopOnFalse = this._options.stopOnFalse; var step = firingIndexes.length; for (firingIndexes[step] = 0; firingIndexes[step] < list.length; firingIndexes[step]++) { var result = list[firingIndexes[step]].apply(context, args); if (false === result && stopOnFalse) { break } } firingIndexes.pop() }; Callback.prototype.add = function(fn) { if ("function" === typeof fn && (!this._options.unique || !this.has(fn))) { this._list.push(fn) } return this }; Callback.prototype.remove = function(fn) { var list = this._list; var firingIndexes = this._firingIndexes; var index = list.indexOf(fn); if (index > -1) { list.splice(index, 1); if (this._firing && firingIndexes.length) { for (var step = 0; step < firingIndexes.length; step++) { if (index <= firingIndexes[step]) { firingIndexes[step]-- } } } } return this }; Callback.prototype.has = function(fn) { var list = this._list; return fn ? list.indexOf(fn) > -1 : !!list.length }; Callback.prototype.empty = function(fn) { this._list = []; return this }; Callback.prototype.fireWith = function(context, args) { var queue = this._queue; args = args || []; args = args.slice ? args.slice() : args; if (this._options.syncStrategy) { this._firing = true; this._fireCore(context, args) } else { queue.push([context, args]); if (this._firing) { return } this._firing = true; while (queue.length) { var memory = queue.shift(); this._fireCore(memory[0], memory[1]) } } this._firing = false; this._fired = true; return this }; Callback.prototype.fire = function() { this.fireWith(this, arguments) }; Callback.prototype.fired = function() { return this._fired }; var Callbacks = function(options) { return new Callback(options) }; module.exports = Callbacks }, /*!******************************************************!*\ !*** ./artifacts/transpiled/animation/translator.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var dataUtils = __webpack_require__( /*! ../core/element_data */ 39); var type = __webpack_require__( /*! ../core/utils/type */ 1).type; var TRANSLATOR_DATA_KEY = "dxTranslator"; var TRANSFORM_MATRIX_REGEX = /matrix(3d)?\((.+?)\)/; var TRANSLATE_REGEX = /translate(?:3d)?\((.+?)\)/; var locate = function($element) { var translate = getTranslate($element); return { left: translate.x, top: translate.y } }; var move = function($element, position) { var left = position.left; var top = position.top; var translate; 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 getTranslate = function($element) { var result = $element.length ? dataUtils.data($element.get(0), TRANSLATOR_DATA_KEY) : null; if (!result) { var transformValue = $element.css("transform") || getTranslateCss({ x: 0, y: 0 }); var matrix = transformValue.match(TRANSFORM_MATRIX_REGEX); var 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) { dataUtils.data($element.get(0), TRANSLATOR_DATA_KEY, translate) } }; var clearCache = function($element) { if ($element.length) { dataUtils.removeData($element.get(0), TRANSLATOR_DATA_KEY) } }; var resetPosition = function($element, finishTransition) { var originalTransition; var stylesConfig = { left: 0, top: 0, transform: "none" }; if (finishTransition) { originalTransition = $element.css("transition"); stylesConfig.transition = "none" } $element.css(stylesConfig); clearCache($element); if (finishTransition) { $element.get(0).offsetHeight; $element.css("transition", originalTransition) } }; 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 }, /*!*************************************************!*\ !*** ./artifacts/transpiled/core/utils/math.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var isExponential = __webpack_require__( /*! ./type */ 1).isExponential; var sign = function(value) { if (0 === value) { return 0 } return value / Math.abs(value) }; var fitIntoRange = function(value, minValue, maxValue) { var isMinValueUndefined = !minValue && 0 !== minValue; var isMaxValueUndefined = !maxValue && 0 !== maxValue; isMinValueUndefined && (minValue = !isMaxValueUndefined ? Math.min(value, maxValue) : value); isMaxValueUndefined && (maxValue = !isMinValueUndefined ? Math.max(value, minValue) : value); return Math.min(Math.max(value, minValue), maxValue) }; var inRange = function(value, minValue, maxValue) { return value >= minValue && value <= maxValue }; function getExponent(value) { return Math.abs(parseInt(value.toExponential().split("e")[1])) } function _isEdgeBug() { var value = 3e-4; var correctValue = "0.000300"; var precisionValue = 3; return correctValue !== value.toPrecision(precisionValue) } function adjust(value, interval) { var precision = getPrecision(interval || 0) + 2; var separatedValue = value.toString().split("."); var sourceValue = value; var absValue = Math.abs(value); var isExponentValue = isExponential(value); var integerPart = absValue > 1 ? 10 : 0; if (1 === separatedValue.length) { return value } if (!isExponentValue) { if (isExponential(interval)) { precision = separatedValue[0].length + getExponent(interval) } value = absValue; value = value - Math.floor(value) + integerPart } precision = _isEdgeBug() && getExponent(value) > 6 || precision > 7 ? 15 : 7; if (!isExponentValue) { var separatedAdjustedValue = parseFloat(value.toPrecision(precision)).toString().split("."); if (separatedAdjustedValue[0] === integerPart.toString()) { return parseFloat(separatedValue[0] + "." + separatedAdjustedValue[1]) } } return parseFloat(sourceValue.toPrecision(precision)) } function getPrecision(value) { var str = value.toString(); if (str.indexOf(".") < 0) { return 0 } var mantissa = str.split("."); var positionOfDelimiter = mantissa[1].indexOf("e"); return positionOfDelimiter >= 0 ? positionOfDelimiter : mantissa[1].length } function getRoot(x, n) { if (x < 0 && n % 2 !== 1) { return NaN } var y = Math.pow(Math.abs(x), 1 / n); return n % 2 === 1 && x < 0 ? -y : y } function solveCubicEquation(a, b, c, d) { var min = 1e-8; if (Math.abs(a) < min) { a = b; b = c; c = d; if (Math.abs(a) < min) { a = b; b = c; if (Math.abs(a) < min) { return [] } return [-b / a] } var D2 = b * b - 4 * a * c; if (Math.abs(D2) < min) { return [-b / (2 * a)] } else { if (D2 > 0) { return [(-b + Math.sqrt(D2)) / (2 * a), (-b - Math.sqrt(D2)) / (2 * a)] } } return [] } var p = (3 * a * c - b * b) / (3 * a * a); var q = (2 * b * b * b - 9 * a * b * c + 27 * a * a * d) / (27 * a * a * a); var roots; var u; if (Math.abs(p) < min) { roots = [getRoot(-q, 3)] } else { if (Math.abs(q) < min) { roots = [0].concat(p < 0 ? [Math.sqrt(-p), -Math.sqrt(-p)] : []) } else { var D3 = q * q / 4 + p * p * p / 27; if (Math.abs(D3) < min) { roots = [-1.5 * q / p, 3 * q / p] } else { if (D3 > 0) { u = getRoot(-q / 2 - Math.sqrt(D3), 3); roots = [u - p / (3 * u)] } else { u = 2 * Math.sqrt(-p / 3); var t = Math.acos(3 * q / p / u) / 3; var k = 2 * Math.PI / 3; roots = [u * Math.cos(t), u * Math.cos(t - k), u * Math.cos(t - 2 * k)] } } } } for (var i = 0; i < roots.length; i++) { roots[i] -= b / (3 * a) } return roots } exports.sign = sign; exports.fitIntoRange = fitIntoRange; exports.inRange = inRange; exports.adjust = adjust; exports.getPrecision = getPrecision; exports.getExponent = getExponent; exports.getRoot = getRoot; exports.solveCubicEquation = solveCubicEquation }, /*!****************************************************************!*\ !*** ./artifacts/transpiled/ui/tree_list/ui.tree_list.core.js ***! \****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _uiGrid_core = __webpack_require__( /*! ../grid_core/ui.grid_core.modules */ 37); var _uiGrid_core2 = _interopRequireDefault(_uiGrid_core); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } }(0, _extend.extend)(exports, _uiGrid_core2.default, { modules: [], foreachNodes: function(nodes, callBack) { for (var i = 0; i < nodes.length; i++) { if (false !== callBack(nodes[i]) && nodes[i].hasChildren && nodes[i].children.length) { this.foreachNodes(nodes[i].children, callBack) } } } }) }, /*!*******************************************!*\ !*** ./artifacts/transpiled/ui/themes.js ***! \*******************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11); var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7); var window = windowUtils.getWindow(); var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred; var errors = __webpack_require__( /*! ./widget/ui.errors */ 17); var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12); var readyCallbacks = __webpack_require__( /*! ../core/utils/ready_callbacks */ 48); var ready = readyCallbacks.add; var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each; var devices = __webpack_require__( /*! ../core/devices */ 16); var viewPortUtils = __webpack_require__( /*! ../core/utils/view_port */ 78); var themeReadyCallback = __webpack_require__( /*! ./themes_callback */ 269); var viewPort = viewPortUtils.value; var Promise = __webpack_require__( /*! ../core/polyfills/promise */ 76); var viewPortChanged = viewPortUtils.changeCallback; var DX_LINK_SELECTOR = "link[rel=dx-theme]"; var THEME_ATTR = "data-theme"; var ACTIVE_ATTR = "data-active"; var DX_HAIRLINES_CLASS = "dx-hairlines"; var context; var $activeThemeLink; var knownThemes; var currentThemeName; var pendingThemeName; var timerId; var THEME_MARKER_PREFIX = "dx."; function readThemeMarker() { if (!windowUtils.hasWindow()) { return null } var element = $("
", context).addClass("dx-theme-marker").appendTo(context.documentElement); var result; try { result = element.css("fontFamily"); 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) { var waitStartTime; pendingThemeName = themeName; function handleLoaded() { pendingThemeName = null; themeReadyCallback.fire(); themeReadyCallback.empty() } if (isPendingThemeLoaded()) { handleLoaded() } else { waitStartTime = Date.now(); timerId = setInterval(function() { var isLoaded = isPendingThemeLoaded(); var isTimeout = !isLoaded && Date.now() - waitStartTime > 15e3; if (isTimeout) { errors.log("W0004", pendingThemeName) } if (isLoaded || isTimeout) { clearInterval(timerId); timerId = void 0; 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); var fullThemeName = link.attr(THEME_ATTR); var url = link.attr("href"); var 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("."); var result = null; if (knownThemes) { if (desiredThemeName in knownThemes) { return desiredThemeName } 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 || domAdapter.getDocument()); if (!context) { return } processMarkup(); currentThemeName = void 0; current(options) } function current(options) { if (!arguments.length) { currentThemeName = currentThemeName || readThemeMarker(); return currentThemeName } detachCssClasses(viewPort()); options = options || {}; if ("string" === typeof options) { options = { theme: options } } var isAutoInit = options._autoInit; var loadCallback = options.loadCallback; var currentThemeData; currentThemeName = options.theme || currentThemeName; if (isAutoInit && !currentThemeName) { currentThemeName = themeNameFromDevice(devices.current()) } currentThemeName = resolveFullThemeName(currentThemeName); if (currentThemeName) { currentThemeData = knownThemes[currentThemeName] } if (loadCallback) { themeReadyCallback.add(loadCallback) } if (currentThemeData) { $activeThemeLink.attr("href", knownThemes[currentThemeName].url); if ((themeReadyCallback.has() || options._forceTimeout) && !timerId) { waitForThemeLoad(currentThemeName) } else { if (pendingThemeName) { pendingThemeName = currentThemeName } } } else { if (isAutoInit) { themeReadyCallback.fire(); themeReadyCallback.empty() } else { throw errors.Error("E0021", currentThemeName) } } checkThemeDeprecation(); attachCssClasses(viewPortUtils.originalViewPort(), currentThemeName) } function themeNameFromDevice(device) { var themeName = device.platform; switch (themeName) { case "ios": return "ios7"; case "android": case "win": return "generic" } return themeName } function getCssClasses(themeName) { themeName = themeName || current(); var result = []; var 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] + (isMaterial(themeName) ? "-" + themeNameParts[2] : "")) } } return result } var themeClasses; function attachCssClasses(element, themeName) { themeClasses = getCssClasses(themeName).join(" "); $(element).addClass(themeClasses); var activateHairlines = function() { var pixelRatio = windowUtils.hasWindow() && 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) { $(element).removeClass(themeClasses) } function themeReady(callback) { themeReadyCallback.add(callback) } function isTheme(themeRegExp, themeName) { if (!themeName) { themeName = currentThemeName || readThemeMarker() } return new RegExp(themeRegExp).test(themeName) } function isMaterial(themeName) { return isTheme("material", themeName) } function isIos7(themeName) { return isTheme("ios7", themeName) } function isGeneric(themeName) { return isTheme("generic", themeName) } function checkThemeDeprecation() { if (isIos7()) { errors.log("W0010", "The 'ios7' theme", "19.1", "Use the 'generic' theme instead.") } } function isWebFontLoaded(text, fontWeight) { var testedFont = "Roboto, RobotoFallback, Arial"; var etalonFont = "Arial"; var document = domAdapter.getDocument(); var testElement = document.createElement("span"); testElement.style.position = "absolute"; testElement.style.top = "-9999px"; testElement.style.left = "-9999px"; testElement.style.visibility = "hidden"; testElement.style.fontFamily = etalonFont; testElement.style.fontSize = "250px"; testElement.style.fontWeight = fontWeight; testElement.innerHTML = text; document.body.appendChild(testElement); var etalonFontWidth = testElement.offsetWidth; testElement.style.fontFamily = testedFont; var testedFontWidth = testElement.offsetWidth; testElement.parentNode.removeChild(testElement); return etalonFontWidth !== testedFontWidth } function waitWebFont(text, fontWeight) { var interval = 15; var timeout = 2e3; return new Promise(function(resolve) { var check = function() { if (isWebFontLoaded(text, fontWeight)) { clear() } }; var clear = function() { clearInterval(intervalId); clearTimeout(timeoutId); resolve() }; var intervalId = setInterval(check, interval); var timeoutId = setTimeout(clear, timeout) }) } var initDeferred = new Deferred; function autoInit() { init({ _autoInit: true, _forceTimeout: true }); if ($(DX_LINK_SELECTOR, context).length) { throw errors.Error("E0022") } initDeferred.resolve() } if (windowUtils.hasWindow()) { autoInit() } else { ready(autoInit) } viewPortChanged.add(function(viewPort, prevViewPort) { initDeferred.done(function() { detachCssClasses(prevViewPort); attachCssClasses(viewPort) }) }); devices.changed.add(function() { init({ _autoInit: true }) }); exports.current = current; exports.ready = themeReady; exports.init = init; exports.attachCssClasses = attachCssClasses; exports.detachCssClasses = detachCssClasses; exports.themeNameFromDevice = themeNameFromDevice; exports.waitForThemeLoad = waitForThemeLoad; exports.isMaterial = isMaterial; exports.isIos7 = isIos7; exports.isGeneric = isGeneric; exports.isWebFontLoaded = isWebFontLoaded; exports.waitWebFont = waitWebFont; exports.resetTheme = function() { $activeThemeLink && $activeThemeLink.attr("href", "about:blank"); currentThemeName = null; pendingThemeName = null } }, /*!*********************************************!*\ !*** ./artifacts/transpiled/core/config.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _extend = __webpack_require__( /*! ./utils/extend */ 0); var _extend2 = _interopRequireDefault(_extend); var _errors = __webpack_require__( /*! ./errors */ 21); var _errors2 = _interopRequireDefault(_errors); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var config = { rtlEnabled: false, defaultCurrency: "USD", oDataFilterToLower: true, serverDecimalSeparator: ".", decimalSeparator: ".", thousandsSeparator: ",", forceIsoDateParsing: true, wrapActionsBeforeExecute: true, useLegacyStoreResult: false, useJQuery: void 0, editorStylingMode: void 0, useLegacyVisibleIndex: false, floatingActionButtonConfig: { icon: "add", closeIcon: "close", position: { at: "right bottom", my: "right bottom", offset: { x: -16, y: -16 } }, maxSpeedDialActionCount: 5 }, optionsParser: function(optionsString) { if ("{" !== optionsString.trim().charAt(0)) { optionsString = "{" + optionsString + "}" } try { return new Function("return " + optionsString)() } catch (ex) { throw _errors2.default.Error("E3018", ex, optionsString) } } }; var configMethod = function() { if (!arguments.length) { return config } _extend2.default.extend(config, arguments.length <= 0 ? void 0 : arguments[0]) }; if ("undefined" !== typeof DevExpress && DevExpress.config) { configMethod(DevExpress.config) } module.exports = configMethod }, /*!***************************************************!*\ !*** ./artifacts/transpiled/localization/date.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 54); var isString = __webpack_require__( /*! ../core/utils/type */ 1).isString; var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3); var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray; var getLDMLDateFormatter = __webpack_require__( /*! ./ldml/date.formatter */ 257).getFormatter; var getLDMLDateFormat = __webpack_require__( /*! ./ldml/date.format */ 208).getFormat; var getLDMLDateParser = __webpack_require__( /*! ./ldml/date.parser */ 211).getParser; var defaultDateNames = __webpack_require__( /*! ./default_date_names */ 258); var numberLocalization = __webpack_require__( /*! ./number */ 51); var errors = __webpack_require__( /*! ../core/errors */ 21); __webpack_require__( /*! ./core */ 87); 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 possiblePartPatterns = { year: ["y", "yy", "yyyy"], day: ["d", "dd"], month: ["M", "MM", "MMM", "MMMM"], hours: ["H", "HH", "h", "hh", "ah"], minutes: ["m", "mm"], seconds: ["s", "ss"], milliseconds: ["S", "SS", "SSS"] }; var dateLocalization = dependencyInjector({ _getPatternByFormat: function(format) { return FORMATS_TO_PATTERN_MAP[format.toLowerCase()] }, _expandPattern: function(pattern) { return this._getPatternByFormat(pattern) || pattern }, formatUsesMonthName: function(format) { return this._expandPattern(format).indexOf("MMMM") !== -1 }, formatUsesDayName: function(format) { return this._expandPattern(format).indexOf("EEEE") !== -1 }, getFormatParts: function(format) { var pattern = this._getPatternByFormat(format) || format; var result = []; iteratorUtils.each(pattern.split(/\W+/), function(_, formatPart) { iteratorUtils.each(possiblePartPatterns, function(partName, possiblePatterns) { if (inArray(formatPart, possiblePatterns) > -1) { result.push(partName) } }) }); return result }, getMonthNames: function(format) { return defaultDateNames.getMonthNames(format) }, getDayNames: function(format) { return defaultDateNames.getDayNames(format) }, getQuarterNames: function(format) { return defaultDateNames.getQuarterNames(format) }, getPeriodNames: function(format) { return defaultDateNames.getPeriodNames(format) }, getTimeSeparator: function() { return ":" }, is24HourFormat: function(format) { var amTime = new Date(2017, 0, 20, 11, 0, 0, 0); var pmTime = new Date(2017, 0, 20, 23, 0, 0, 0); var amTimeFormatted = this.format(amTime, format); var pmTimeFormatted = this.format(pmTime, format); for (var i = 0; i < amTimeFormatted.length; i++) { if (amTimeFormatted[i] !== pmTimeFormatted[i]) { return !isNaN(parseInt(amTimeFormatted[i])) } } }, 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; if (isString(_format)) { _format = FORMATS_TO_PATTERN_MAP[_format.toLowerCase()] || _format; return numberLocalization.convertDigits(getLDMLDateFormatter(_format, this)(date)) } } } if (!formatter) { return } return formatter(date) }, parse: function(text, format) { var that = this; var ldmlFormat; if (!text) { return } if (!format) { return this.parse(text, "shortdate") } if (format.parser) { return format.parser(text) } if ("string" === typeof format && !FORMATS_TO_PATTERN_MAP[format.toLowerCase()]) { ldmlFormat = format } else { var formatter = function(value) { var text = that.format(value, format); return numberLocalization.convertDigits(text, true) }; try { ldmlFormat = getLDMLDateFormat(formatter) } catch (e) {} } if (ldmlFormat) { text = numberLocalization.convertDigits(text, true); return getLDMLDateParser(ldmlFormat, this)(text) } errors.log("W0012"); var result = new Date(text); if (!result || isNaN(result.getTime())) { return } return result }, firstDayOfWeekIndex: function() { return 0 } }); module.exports = dateLocalization }, /*!******************************************************!*\ !*** ./artifacts/transpiled/core/utils/inflector.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var map = __webpack_require__( /*! ./iterator */ 3).map; var _normalize = function(text) { if (void 0 === text || null === text) { return "" } return String(text) }; var _upperCaseFirst = 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 = _upperCaseFirst(p) } return p }).join("") }; var humanize = function(text) { return _upperCaseFirst(dasherize(text).replace(/-/g, " ")) }; var titleize = function(text) { return map(_chop(text), function(p) { return _upperCaseFirst(p.toLowerCase()) }).join(" ") }; var DIGIT_CHARS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]; var captionize = function(name) { var captionList = []; var i; var char; var isPrevCharNewWord = false; var isNewWord = false; for (i = 0; i < name.length; i++) { char = name.charAt(i); isNewWord = char === char.toUpperCase() && "-" !== char && ")" !== char && "/" !== char || char in DIGIT_CHARS; 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 }, /*!*******************************************!*\ !*** ./artifacts/transpiled/ui/button.js ***! \*******************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var iconUtils = __webpack_require__( /*! ../core/utils/icon */ 60); var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12); var devices = __webpack_require__( /*! ../core/devices */ 16); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var ValidationMixin = __webpack_require__( /*! ./validation/validation_mixin */ 172); var ValidationEngine = __webpack_require__( /*! ./validation_engine */ 99); var Widget = __webpack_require__( /*! ./widget/ui.widget */ 18); var inkRipple = __webpack_require__( /*! ./widget/utils.ink_ripple */ 69); var eventUtils = __webpack_require__( /*! ../events/utils */ 8); var themes = __webpack_require__( /*! ./themes */ 30); var clickEvent = __webpack_require__( /*! ../events/click */ 19); var FunctionTemplate = __webpack_require__( /*! ./widget/function_template */ 83); var BUTTON_CLASS = "dx-button"; var BUTTON_CONTENT_CLASS = "dx-button-content"; var BUTTON_HAS_TEXT_CLASS = "dx-button-has-text"; var BUTTON_HAS_ICON_CLASS = "dx-button-has-icon"; var BUTTON_ICON_RIGHT_CLASS = "dx-button-icon-right"; var ICON_RIGHT_CLASS = "dx-icon-right"; var BUTTON_STYLING_MODE_CLASS_PREFIX = "dx-button-mode-"; var ALLOWED_STYLE_CLASSES = [BUTTON_STYLING_MODE_CLASS_PREFIX + "contained", BUTTON_STYLING_MODE_CLASS_PREFIX + "text", BUTTON_STYLING_MODE_CLASS_PREFIX + "outlined"]; var TEMPLATE_WRAPPER_CLASS = "dx-template-wrapper"; var BUTTON_TEXT_CLASS = "dx-button-text"; var ANONYMOUS_TEMPLATE_NAME = "content"; var BUTTON_LEFT_ICON_POSITION = "left"; var BUTTON_FEEDBACK_HIDE_TIMEOUT = 100; var Button = Widget.inherit({ _supportedKeys: function() { var that = this; var click = function(e) { e.preventDefault(); that._executeClickAction(e) }; return extend(this.callBase(), { space: click, enter: click }) }, _setDeprecatedOptions: function() { this.callBase() }, _getDefaultOptions: function() { return extend(this.callBase(), { hoverStateEnabled: true, onClick: null, type: "normal", text: "", icon: "", iconPosition: BUTTON_LEFT_ICON_POSITION, validationGroup: void 0, activeStateEnabled: true, template: "content", useSubmitBehavior: false, useInkRipple: false, stylingMode: "contained" }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function() { return "desktop" === devices.real().deviceType && !devices.isSimulator() }, options: { focusStateEnabled: true } }, { device: function() { var themeName = themes.current(); return themes.isMaterial(themeName) }, options: { useInkRipple: true } }]) }, _getAnonymousTemplateName: function() { return ANONYMOUS_TEMPLATE_NAME }, _feedbackHideTimeout: BUTTON_FEEDBACK_HIDE_TIMEOUT, _initTemplates: function() { this.callBase(); var that = this; this._defaultTemplates.content = new FunctionTemplate(function(options) { var data = options.model; var $iconElement = iconUtils.getImageContainer(data && data.icon); var $textContainer = data && data.text ? $("").text(data.text).addClass(BUTTON_TEXT_CLASS) : void 0; var $container = $(options.container); $container.append($textContainer); if (that.option("iconPosition") === BUTTON_LEFT_ICON_POSITION) { $container.prepend($iconElement) } else { $iconElement.addClass(ICON_RIGHT_CLASS); $container.append($iconElement) } }, this) }, _initMarkup: function() { this.$element().addClass(BUTTON_CLASS); this._renderType(); this._renderStylingMode(); this.option("useInkRipple") && this._renderInkRipple(); this._renderClick(); this.setAria("role", "button"); this._updateAriaLabel(); this.callBase(); this._updateContent() }, _renderInkRipple: function() { var isOnlyIconButton = !this.option("text") && this.option("icon") || "back" === this.option("type"); var 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, event: e }; if (value) { this._inkRipple.showWave(config) } else { this._inkRipple.hideWave(config) } }, _updateContent: function() { var $element = this.$element(); var 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_ICON_RIGHT_CLASS, !!data.icon && this.option("iconPosition") !== BUTTON_LEFT_ICON_POSITION).toggleClass(BUTTON_HAS_TEXT_CLASS, !!data.text); var transclude = this._getAnonymousTemplateName() === this.option("template"); var template = this._getTemplateByOption("template"); var $result = $(template.render({ model: data, container: domUtils.getPublicElement(this._$content), transclude: transclude })); if ($result.hasClass(TEMPLATE_WRAPPER_CLASS)) { this._$content.replaceWith($result); this._$content = $result; this._$content.addClass(BUTTON_CONTENT_CLASS) } if (this.option("useSubmitBehavior")) { this._renderSubmitInput() } }, _renderSubmitInput: function() { var submitAction = this._createAction(function(args) { var e = args.event; var validationGroup = ValidationEngine.getGroupConfig(args.component._findGroup()); if (validationGroup && !validationGroup.validate().isValid) { e.preventDefault() } e.stopPropagation() }); this._$submitInput = $("").attr("type", "submit").attr("tabindex", -1).addClass("dx-button-submit-input").appendTo(this._$content); eventsEngine.on(this._$submitInput, "click", function(e) { submitAction({ event: e }) }) }, _getContentData: function() { var icon = this.option("icon"); var text = this.option("text"); var back = "back" === this.option("type"); if (back && !icon) { icon = "back" } return { icon: icon, text: text } }, _renderClick: function() { var that = this; var eventName = eventUtils.addNamespace(clickEvent.name, this.NAME); var actionConfig = { excludeValidators: ["readOnly"] }; if (this.option("useSubmitBehavior")) { actionConfig.afterExecute = function(e) { setTimeout(function() { e.component._$submitInput.get(0).click() }) } } this._clickAction = this._createActionByOption("onClick", actionConfig); eventsEngine.off(this.$element(), eventName); eventsEngine.on(this.$element(), eventName, function(e) { that._executeClickAction(e) }) }, _executeClickAction: function(e) { this._clickAction({ event: e, validationGroup: ValidationEngine.getGroupConfig(this._findGroup()) }) }, _updateAriaLabel: function() { var icon = this.option("icon"); var text = this.option("text"); if ("image" === iconUtils.getImageSourceType(icon)) { if (icon.indexOf("base64") === -1) { icon = icon.replace(/.+\/([^.]+)\..+$/, "$1") } else { icon = "Base64" } } var ariaLabel = text || icon || ""; ariaLabel = ariaLabel.toString().trim(); this.setAria("label", ariaLabel.length ? ariaLabel : null) }, _renderType: function() { var type = this.option("type"); if (type) { this.$element().addClass("dx-button-" + type) } }, _renderStylingMode: function() { var _this = this; var optionName = "stylingMode"; ALLOWED_STYLE_CLASSES.forEach(function(className) { return _this.$element().removeClass(className) }); var stylingModeClass = BUTTON_STYLING_MODE_CLASS_PREFIX + this.option(optionName); if (ALLOWED_STYLE_CLASSES.indexOf(stylingModeClass) === -1) { var defaultOptionValue = this._getDefaultOptions()[optionName]; stylingModeClass = BUTTON_STYLING_MODE_CLASS_PREFIX + defaultOptionValue } this.$element().addClass(stylingModeClass) }, _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._updateContent() } }, _optionChanged: function(args) { switch (args.name) { case "onClick": this._renderClick(); break; case "icon": case "text": this._updateContent(); this._updateAriaLabel(); break; case "type": this._refreshType(args.previousValue); this._updateContent(); this._updateAriaLabel(); break; case "template": case "iconPosition": this._updateContent(); break; case "stylingMode": this._renderStylingMode(); break; case "useInkRipple": case "useSubmitBehavior": this._invalidate(); break; default: this.callBase(args) } }, _clean: function() { delete this._inkRipple; this.callBase(); delete this._$content } }).include(ValidationMixin); registerComponent("dxButton", Button); module.exports = Button }, /*!*****************************************************************!*\ !*** ./artifacts/transpiled/ui/grid_core/ui.grid_core.utils.js ***! \*****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); var _filtering = __webpack_require__( /*! ../shared/filtering */ 162); var _string = __webpack_require__( /*! ../../core/utils/string */ 44); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _data = __webpack_require__( /*! ../../core/utils/data */ 20); var _load_panel = __webpack_require__( /*! ../load_panel */ 186); var _load_panel2 = _interopRequireDefault(_load_panel); var _utils = __webpack_require__( /*! ../../data/utils */ 41); var _format_helper = __webpack_require__( /*! ../../format_helper */ 64); var _format_helper2 = _interopRequireDefault(_format_helper); var _object = __webpack_require__( /*! ../../core/utils/object */ 47); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var DATAGRID_SELECTION_DISABLED_CLASS = "dx-selection-disabled"; var DATAGRID_GROUP_OPENED_CLASS = "dx-datagrid-group-opened"; var DATAGRID_GROUP_CLOSED_CLASS = "dx-datagrid-group-closed"; var DATAGRID_EXPAND_CLASS = "dx-datagrid-expand"; var NO_DATA_CLASS = "nodata"; 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() } }; module.exports = function() { var getIntervalSelector = function() { var data = arguments[1]; var value = this.calculateCellValue(data); if (!(0, _type.isDefined)(value)) { return null } else { if (isDateType(this.dataType)) { var nameIntervalSelector = arguments[0]; return DATE_INTERVAL_SELECTORS[nameIntervalSelector](value) } else { if ("number" === this.dataType) { var groupInterval = arguments[0]; return Math.floor(Number(value) / groupInterval) * groupInterval } } } }; var equalSelectors = function(selector1, selector2) { if ((0, _type.isFunction)(selector1) && (0, _type.isFunction)(selector2)) { if (selector1.originalCallback && selector2.originalCallback) { return selector1.originalCallback === selector2.originalCallback && selector1.columnIndex === selector2.columnIndex } } return selector1 === selector2 }; var isDateType = function(dataType) { return "date" === dataType || "datetime" === dataType }; var setEmptyText = function($container) { $container.get(0).textContent = "\xa0" }; var getWidgetInstance = function($element) { var editorData = $element.data && $element.data(); var dxComponents = editorData && editorData.dxComponents; var widgetName = dxComponents && dxComponents[0]; return widgetName && editorData[widgetName] }; return { renderNoDataText: function($element) { var that = this; $element = $element || this.element(); if (!$element) { return } var noDataClass = that.addWidgetPrefix(NO_DATA_CLASS); var noDataElement = $element.find("." + noDataClass).last(); var isVisible = this._dataController.isEmpty(); var isLoading = this._dataController.isLoading(); if (!noDataElement.length) { noDataElement = (0, _renderer2.default)("").addClass(noDataClass).appendTo($element) } if (isVisible && !isLoading) { noDataElement.removeClass("dx-hidden").text(that._getNoDataText()) } else { noDataElement.addClass("dx-hidden") } }, renderLoadPanel: function($element, $container, isLocalStore) { var that = this; var loadPanelOptions; that._loadPanel && that._loadPanel.$element().remove(); loadPanelOptions = that.option("loadPanel"); if (loadPanelOptions && ("auto" === loadPanelOptions.enabled ? !isLocalStore : loadPanelOptions.enabled)) { loadPanelOptions = (0, _extend.extend)({ shading: false, message: loadPanelOptions.text, position: function() { var $window = (0, _renderer2.default)((0, _window.getWindow)()); if ($element.height() > $window.height()) { return { of: $window, boundary: $element, collision: "fit" } } return { of: $element } }, container: $container }, loadPanelOptions); that._loadPanel = that._createComponent((0, _renderer2.default)("
").appendTo($container), _load_panel2.default, loadPanelOptions) } else { that._loadPanel = null } }, getIndexByKey: function(key, items, keyName) { var index = -1; if (void 0 !== key && Array.isArray(items)) { keyName = arguments.length <= 2 ? "key" : keyName; for (var i = 0; i < items.length; i++) { var item = (0, _type.isDefined)(keyName) ? items[i][keyName] : items[i]; if ((0, _common.equalByValue)(key, item)) { index = i; break } } } return index }, combineFilters: function(filters, operation) { var resultFilter = []; operation = operation || "and"; for (var 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 } }, checkChanges: function(changes, changeNames) { var changesWithChangeNamesCount = 0; for (var i = 0; i < changeNames.length; i++) { if (changes[changeNames[i]]) { changesWithChangeNamesCount++ } } return changes.length && changes.length === changesWithChangeNamesCount }, equalFilterParameters: function(filter1, filter2) { if (Array.isArray(filter1) && Array.isArray(filter2)) { if (filter1.length !== filter2.length) { return false } else { for (var i = 0; i < filter1.length; i++) { if (!module.exports.equalFilterParameters(filter1[i], filter2[i])) { return false } } } return true } else { if ((0, _type.isFunction)(filter1) && filter1.columnIndex >= 0 && (0, _type.isFunction)(filter2) && filter2.columnIndex >= 0) { return filter1.columnIndex === filter2.columnIndex && (0, _data.toComparable)(filter1.filterValue) === (0, _data.toComparable)(filter2.filterValue) } else { return (0, _data.toComparable)(filter1) == (0, _data.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 } } }, formatValue: function(value, options) { var valueText = _format_helper2.default.format(value, options.format) || value && value.toString() || ""; var 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 }, getFormatOptionsByColumn: function(column, target) { return { format: column.format, getDisplayFormat: column.getDisplayFormat, customizeText: column.customizeText, target: target, trueText: column.trueText, falseText: column.falseText } }, 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 && !("group" === rowType && (column.calculateGroupValue || column.calculateDisplayValue))) { return column.lookup.calculateCellValue(value) } } } return value }, getGroupRowSummaryText: function(summaryItems, summaryTexts) { var result = "("; for (var i = 0; i < summaryItems.length; i++) { var summaryItem = summaryItems[i]; result += (i > 0 ? ", " : "") + module.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, getDisplayFormat: function(valueText) { return displayFormat ? (0, _string.format)(displayFormat, valueText, summaryItem.columnCaption) : valueText }, customizeText: summaryItem.customizeText }) }, normalizeSortingInfo: function(sort) { sort = sort || []; var result = (0, _utils.normalizeSortingInfo)(sort); for (var 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"; case "datetime": return "shortDateShortTime" } }, getHeaderFilterGroupParameters: function(column, remoteGrouping) { var result = []; var dataField = column.dataField || column.name; var groupInterval = (0, _filtering.getGroupInterval)(column); if (groupInterval) { (0, _iterator.each)(groupInterval, function(index, interval) { result.push(remoteGrouping ? { selector: dataField, groupInterval: interval, isExpanded: index < groupInterval.length - 1 } : getIntervalSelector.bind(column, interval)) }); return result } if (remoteGrouping) { result = [{ selector: dataField, isExpanded: false }] } else { result = function result(data) { var result = column.calculateCellValue(data); if (void 0 === result || "" === result) { result = null } return result }; if (column.sortingMethod) { result = [{ selector: result, compare: column.sortingMethod.bind(column) }] } } return result }, equalSortParameters: function(sortParameters1, sortParameters2, ignoreIsExpanded) { sortParameters1 = module.exports.normalizeSortingInfo(sortParameters1); sortParameters2 = module.exports.normalizeSortingInfo(sortParameters2); if (Array.isArray(sortParameters1) && Array.isArray(sortParameters2)) { if (sortParameters1.length !== sortParameters2.length) { return false } else { for (var i = 0; i < sortParameters1.length; i++) { if (!equalSelectors(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) } }, getPointsByColumns: function(items, pointCreated, isVertical, startColumnIndex) { var cellsLength = items.length; var notCreatePoint = false; var item; var offset; var columnIndex = startColumnIndex || 0; var result = []; var rtlEnabled; for (var i = 0; i <= cellsLength; i++) { if (i < cellsLength) { item = items.eq(i); offset = item.offset(); rtlEnabled = "rtl" === item.css("direction") } var point = { index: columnIndex, x: offset ? offset.left + (!isVertical && rtlEnabled ^ i === cellsLength ? item[0].getBoundingClientRect().width : 0) : 0, y: offset ? offset.top + (isVertical && i === cellsLength ? item[0].getBoundingClientRect().height : 0) : 0, columnIndex: columnIndex }; if (!isVertical && i > 0) { var 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 }, createObjectWithChanges: function(target, changes) { var result = target ? Object.create(Object.getPrototypeOf(target)) : {}; var targetWithoutPrototype = (0, _extend.extendFromObject)({}, target); (0, _object.deepExtendArraySafe)(result, targetWithoutPrototype, true, true); return (0, _object.deepExtendArraySafe)(result, changes, true, true) }, getExpandCellTemplate: function() { return { allowRenderToDetachedContainer: true, render: function(container, options) { var $container = (0, _renderer2.default)(container); if ((0, _type.isDefined)(options.value) && !(options.data && options.data.isContinuation) && !options.row.isNewRow) { var rowsView = options.component.getView("rowsView"); $container.addClass(DATAGRID_EXPAND_CLASS).addClass(DATAGRID_SELECTION_DISABLED_CLASS); (0, _renderer2.default)("
").addClass(options.value ? DATAGRID_GROUP_OPENED_CLASS : DATAGRID_GROUP_CLOSED_CLASS).appendTo($container); rowsView.setAria("label", options.value ? rowsView.localize("dxDataGrid-ariaCollapse") : rowsView.localize("dxDataGrid-ariaExpand"), $container) } else { setEmptyText($container) } } } }, setEmptyText: setEmptyText, isDateType: isDateType, getSelectionRange: function(focusedElement) { try { if (focusedElement) { return { selectionStart: focusedElement.selectionStart, selectionEnd: focusedElement.selectionEnd } } } catch (e) {} return {} }, setSelectionRange: function(focusedElement, selectionRange) { try { if (focusedElement && focusedElement.setSelectionRange) { focusedElement.setSelectionRange(selectionRange.selectionStart, selectionRange.selectionEnd) } } catch (e) {} }, focusAndSelectElement: function(component, $element) { _events_engine2.default.trigger($element, "focus"); var isSelectTextOnEditingStart = component.option("editing.selectTextOnEditStart"); var keyboardController = component.getController("keyboardNavigation"); var isEditingNavigationMode = keyboardController && keyboardController._isFastEditingStarted(); if (isSelectTextOnEditingStart && !isEditingNavigationMode && $element.is(".dx-texteditor-input")) { var editor = getWidgetInstance($element.closest(".dx-texteditor")); (0, _deferred.when)(editor && editor._loadItemDeferred).done(function() { $element.get(0).select() }) } }, getWidgetInstance: getWidgetInstance, getLastResizableColumnIndex: function(columns, resultWidths) { var hasResizableColumns = columns.some(function(column) { return column && !column.command && !column.fixed && false !== column.allowResizing }); for (var lastColumnIndex = columns.length - 1; columns[lastColumnIndex]; lastColumnIndex--) { var column = columns[lastColumnIndex]; var width = resultWidths && resultWidths[lastColumnIndex]; var allowResizing = !hasResizableColumns || false !== column.allowResizing; if (!column.command && !column.fixed && "adaptiveHidden" !== width && allowResizing) { break } } return lastColumnIndex }, isElementInCurrentGrid: function(controller, $element) { if ($element && $element.length) { var $grid = $element.closest("." + controller.getWidgetContainerClass()).parent(); return $grid.is(controller.component.$element()) } return false } } }() }, /*!*********************************************!*\ !*** ./artifacts/transpiled/data/errors.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var errorUtils = __webpack_require__( /*! ../core/utils/error */ 129); var coreErrors = __webpack_require__( /*! ../core/errors */ 21); var 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 data type is specified for ODataStore: {0}", E4015: "Unknown entity name or alias is used: {0}", E4016: "The compileSetter(expr) method is called with 'self' passed as a parameter", 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}", E4021: "The server response does not provide the totalCount value", E4022: "The server response does not provide the groupCount value", E4023: "Could not parse the following XML: {0}", W4000: "Data returned from the server has an incorrect structure", W4001: 'The {0} field is listed in both "keyType" and "fieldTypes". The value of "fieldTypes" is used.', W4002: "Data loading has failed for some cells due to the following error: {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 }, /*!*******************************************************************!*\ !*** ./artifacts/transpiled/ui/grid_core/ui.grid_core.modules.js ***! \*******************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _class = __webpack_require__( /*! ../../core/class */ 15); var _class2 = _interopRequireDefault(_class); var _callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26); var _callbacks2 = _interopRequireDefault(_callbacks); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _array = __webpack_require__( /*! ../../core/utils/array */ 14); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var _ui = __webpack_require__( /*! ../widget/ui.errors */ 17); var _ui2 = _interopRequireDefault(_ui); var _message = __webpack_require__( /*! ../../localization/message */ 13); var _message2 = _interopRequireDefault(_message); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var WIDGET_WITH_LEGACY_CONTAINER_NAME = "dxDataGrid"; var ModuleItem = _class2.default.inherit({ _endUpdateCore: function() {}, ctor: function(component) { var that = this; that._updateLockCount = 0; that.component = component; that._actions = {}; that._actionConfigs = {}; (0, _iterator.each)(this.callbackNames() || [], function(index, name) { var flags = that.callbackFlags(name) || {}; flags.unique = true, flags.syncStrategy = true; that[this] = (0, _callbacks2.default)(flags) }) }, init: function() {}, callbackNames: function() {}, callbackFlags: function() {}, publicMethods: function() {}, beginUpdate: function() { this._updateLockCount++ }, endUpdate: function() { if (this._updateLockCount > 0) { this._updateLockCount--; if (!this._updateLockCount) { this._endUpdateCore() } } }, option: function(name) { var component = this.component; var optionCache = component._optionCache; if (1 === arguments.length && optionCache) { if (!(name in optionCache)) { optionCache[name] = component.option(name) } return optionCache[name] } return component.option.apply(component, arguments) }, localize: function(name) { var optionCache = this.component._optionCache; if (optionCache) { if (!(name in optionCache)) { optionCache[name] = _message2.default.format(name) } return optionCache[name] } return _message2.default.format(name) }, on: function() { return this.component.on.apply(this.component, arguments) }, off: function() { return this.component.off.apply(this.component, arguments) }, optionChanged: function(args) { if (args.name in this._actions) { this.createAction(args.name, this._actionConfigs[args.name]); args.handled = true } }, getAction: function(actionName) { return this._actions[actionName] }, setAria: function(name, value, $target) { var target = $target.get(0); var prefix = "role" !== name && "id" !== name ? "aria-" : ""; if (target.setAttribute) { target.setAttribute(prefix + name, value) } else { $target.attr(prefix + name, value) } }, _createComponent: function() { return this.component._createComponent.apply(this.component, arguments) }, getController: function(name) { return this.component._controllers[name] }, createAction: function(actionName, config) { if ((0, _type.isFunction)(actionName)) { var action = this.component._createAction(actionName.bind(this), config); return function(e) { action({ event: e }) } } else { this._actions[actionName] = this.component._createActionByOption(actionName, config); this._actionConfigs[actionName] = config } }, executeAction: function(actionName, options) { var action = this._actions[actionName]; return action && action(options) }, dispose: function() { var that = this; (0, _iterator.each)(that.callbackNames() || [], function() { that[this].empty() }) }, addWidgetPrefix: function(className) { var componentName = this.component.NAME; return "dx-" + componentName.slice(2).toLowerCase() + (className ? "-" + className : "") }, getWidgetContainerClass: function() { var containerName = this.component.NAME === WIDGET_WITH_LEGACY_CONTAINER_NAME ? null : "container"; return this.addWidgetPrefix(containerName) } }); var Controller = ModuleItem; var ViewController = Controller.inherit({ getView: function(name) { return this.component._views[name] }, getViews: function() { return this.component._views } }); var View = ModuleItem.inherit({ _isReady: function() { return this.component.isReady() }, _endUpdateCore: function() { this.callBase(); if (!this._isReady() && this._requireReady) { this._requireRender = false; this.component._requireResize = false } if (this._requireRender) { this._requireRender = false; this.render(this._$parent) } }, _invalidate: function(requireResize, requireReady) { this._requireRender = true; this.component._requireResize = (0, _window.hasWindow)() && (this.component._requireResize || requireResize); this._requireReady = this._requireReady || requireReady }, _renderCore: function() {}, _resizeCore: function() {}, _afterRender: function() {}, _parentElement: function() { return this._$parent }, ctor: function(component) { this.callBase(component); this.renderCompleted = (0, _callbacks2.default)(); this.resizeCompleted = (0, _callbacks2.default)() }, element: function() { return this._$element }, getElementHeight: function() { var $element = this.element(); if (!$element) { return 0 } var marginTop = parseFloat($element.css("marginTop")) || 0; var marginBottom = parseFloat($element.css("marginBottom")) || 0; var offsetHeight = $element.get(0).offsetHeight; return offsetHeight + marginTop + marginBottom }, isVisible: function() { return true }, getTemplate: function(name) { return this.component._getTemplate(name) }, render: function($parent, options) { var $element = this._$element; var isVisible = this.isVisible(); if (!$element && !$parent) { return } this._requireReady = false; if (!$element) { $element = this._$element = (0, _renderer2.default)("
").appendTo($parent); this._$parent = $parent } $element.toggleClass("dx-hidden", !isVisible); if (isVisible) { this.component._optionCache = {}; this._renderCore(options); this.component._optionCache = void 0; this._afterRender($parent); this.renderCompleted.fire(options) } }, resize: function() { this.isResizing = true; this._resizeCore(); this.resizeCompleted.fire(); this.isResizing = false }, focus: function() { _events_engine2.default.trigger(this.element(), "focus") } }); var MODULES_ORDER_MAX_INDEX = 1e6; var processModules = function(that, componentClass) { var modules = componentClass.modules; var modulesOrder = componentClass.modulesOrder; var controllerTypes = componentClass.controllerTypes || {}; var viewTypes = componentClass.viewTypes || {}; if (!componentClass.controllerTypes) { if (modulesOrder) { modules.sort(function(module1, module2) { var orderIndex1 = (0, _array.inArray)(module1.name, modulesOrder); var orderIndex2 = (0, _array.inArray)(module2.name, modulesOrder); if (orderIndex1 < 0) { orderIndex1 = MODULES_ORDER_MAX_INDEX } if (orderIndex2 < 0) { orderIndex2 = MODULES_ORDER_MAX_INDEX } return orderIndex1 - orderIndex2 }) }(0, _iterator.each)(modules, function() { var controllers = this.controllers; var moduleName = this.name; var views = this.views; controllers && (0, _iterator.each)(controllers, function(name, type) { if (controllerTypes[name]) { throw _ui2.default.Error("E1001", moduleName, name) } else { if (!(type && type.subclassOf && type.subclassOf(Controller))) { type.subclassOf(Controller); throw _ui2.default.Error("E1002", moduleName, name) } } controllerTypes[name] = type }); views && (0, _iterator.each)(views, function(name, type) { if (viewTypes[name]) { throw _ui2.default.Error("E1003", moduleName, name) } else { if (!(type && type.subclassOf && type.subclassOf(View))) { throw _ui2.default.Error("E1004", moduleName, name) } } viewTypes[name] = type }) }); (0, _iterator.each)(modules, function() { var extenders = this.extenders; if (extenders) { extenders.controllers && (0, _iterator.each)(extenders.controllers, function(name, extender) { if (controllerTypes[name]) { controllerTypes[name] = controllerTypes[name].inherit(extender) } }); extenders.views && (0, _iterator.each)(extenders.views, function(name, extender) { if (viewTypes[name]) { viewTypes[name] = viewTypes[name].inherit(extender) } }) } }); componentClass.controllerTypes = controllerTypes; componentClass.viewTypes = viewTypes } var registerPublicMethods = function(that, name, moduleItem) { var publicMethods = moduleItem.publicMethods(); if (publicMethods) { (0, _iterator.each)(publicMethods, function(index, methodName) { if (moduleItem[methodName]) { if (!that[methodName]) { that[methodName] = function() { return moduleItem[methodName].apply(moduleItem, arguments) } } else { throw _ui2.default.Error("E1005", methodName) } } else { throw _ui2.default.Error("E1006", name, methodName) } }) } }; var createModuleItems = function(moduleTypes) { var moduleItems = {}; (0, _iterator.each)(moduleTypes, function(name, moduleType) { var moduleItem = new moduleType(that); moduleItem.name = name; registerPublicMethods(that, name, moduleItem); moduleItems[name] = moduleItem }); return moduleItems }; that._controllers = createModuleItems(controllerTypes); that._views = createModuleItems(viewTypes) }; var callModuleItemsMethod = function(that, methodName, args) { args = args || []; if (that._controllers) { (0, _iterator.each)(that._controllers, function() { this[methodName] && this[methodName].apply(this, args) }) } if (that._views) { (0, _iterator.each)(that._views, function() { this[methodName] && this[methodName].apply(this, args) }) } }; module.exports = { modules: [], View: View, ViewController: ViewController, Controller: Controller, registerModule: function(name, module) { var modules = this.modules; for (var i = 0; i < modules.length; i++) { if (modules[i].name === name) { return } } module.name = name; modules.push(module); delete this.controllerTypes; delete this.viewTypes }, registerModulesOrder: function(moduleNames) { this.modulesOrder = moduleNames }, unregisterModule: function(name) { this.modules = (0, _common.grep)(this.modules, function(module) { return module.name !== name }); delete this.controllerTypes; delete this.viewTypes }, processModules: processModules, callModuleItemsMethod: callModuleItemsMethod } }, /*!**********************************************!*\ !*** ./artifacts/transpiled/animation/fx.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var $ = __webpack_require__( /*! ../core/renderer */ 2); var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow(); var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var errors = __webpack_require__( /*! ../core/errors */ 21); var getPublicElement = __webpack_require__( /*! ../core/utils/dom */ 12).getPublicElement; var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1); var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3); var translator = __webpack_require__( /*! ./translator */ 27); var easing = __webpack_require__( /*! ./easing */ 264); var animationFrame = __webpack_require__( /*! ./frame */ 112); var support = __webpack_require__( /*! ../core/utils/support */ 43); var positionUtils = __webpack_require__( /*! ./position */ 77); var removeEvent = __webpack_require__( /*! ../core/remove_event */ 132); var eventUtils = __webpack_require__( /*! ../events/utils */ 8); var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6); var when = deferredUtils.when; var Deferred = deferredUtils.Deferred; var removeEventName = eventUtils.addNamespace(removeEvent, "dxFX"); var isFunction = typeUtils.isFunction; var isPlainObject = typeUtils.isPlainObject; var noop = __webpack_require__( /*! ../core/utils/common */ 4).noop; var RELATIVE_VALUE_REGEX = /^([+-])=(.*)/i; var ANIM_DATA_KEY = "dxAnimData"; var ANIM_QUEUE_KEY = "dxAnimQueue"; var 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; var deferred = new Deferred; var cleanupWhen = config.cleanupWhen; config.transitionAnimation = { deferred: deferred, finish: function() { that._finishTransition($element); 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 that = this; var startTime = Date.now() + config.delay; var deferred = new Deferred; var transitionEndFired = new Deferred; var simulatedTransitionEndFired = new Deferred; var simulatedEndEventTimer; var transitionEndEventName = support.transitionEndEventName() + ".dxFX"; config.transitionAnimation.cleanup = function() { clearTimeout(simulatedEndEventTimer); clearTimeout(waitForJSCompleteTimer); eventsEngine.off($element, transitionEndEventName); eventsEngine.off($element, removeEventName) }; eventsEngine.one($element, transitionEndEventName, function() { if (Date.now() - startTime >= config.duration) { transitionEndFired.reject() } }); eventsEngine.off($element, removeEventName); eventsEngine.on($element, removeEventName, function() { that.stop($element, config); deferred.reject() }); var waitForJSCompleteTimer = setTimeout(function() { simulatedEndEventTimer = setTimeout(function() { simulatedTransitionEndFired.reject() }, config.duration + config.delay + fx._simulatedTransitionEndDelay); when(transitionEndFired, simulatedTransitionEndFired).fail(function() { deferred.resolve() }.bind(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) { $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)) { iteratorUtils.each(config.to, function(key) { $element.css(key, $element.css(key)) }) } this._finishTransition($element); this._cleanup($element, config) } } }; var FrameAnimationStrategy = { initAnimation: function($element, config) { setProps($element, config.from) }, animate: function($element, config) { var deferred = new Deferred; var that = this; if (!config) { return deferred.reject().promise() } iteratorUtils.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: easing.convertTransitionTimingFuncToEasing(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] = iteratorUtils.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) { eventsEngine.off($element, removeEventName); eventsEngine.on($element, removeEventName, function() { if (config.frameAnimation) { animationFrame.cancelAnimationFrame(config.frameAnimation.animationFrameId) } }); this._animationStep($element, config) }, _parseTransform: function(transformString) { var result = {}; iteratorUtils.each(transformString.match(/\w+\d*\w*\([^)]*\)\s*/g), function(i, part) { var translateData = translator.parseTranslate(part); var scaleData = part.match(/scale\((.+?)\)/); var 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 calcValueRecursively(from, to) { var result = Array.isArray(to) ? [] : {}; var calcEasedValue = function(propName) { var x = currentDuration / frameAnimation.duration; var t = currentDuration; var b = 1 * from[propName]; var c = to[propName] - from[propName]; var d = frameAnimation.duration; return easing.getEasing(frameAnimation.easing)(x, t, b, c, d) }; iteratorUtils.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() {}, animate: function() { return (new Deferred).resolve().promise() }, stop: noop, isSynchronous: true }; var getAnimationStrategy = function(config) { config = config || {}; var animationStrategies = { transition: support.transition() ? TransitionAnimationStrategy : FrameAnimationStrategy, frame: FrameAnimationStrategy, noAnimation: FallbackToNoAnimationStrategy }; var strategy = config.strategy || "transition"; if ("css" === config.type && !support.transition()) { strategy = "noAnimation" } return animationStrategies[strategy] }; var baseConfigValidator = function(config, animationType, validate, typeMessage) { iteratorUtils.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() {} }; var CssAnimationConfigurator = { validateConfig: function(config) { isStringConfigValidator(config, "css") }, setup: function() {} }; 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) }, _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 } config[TRANSFORM_PROP] = translator.getTranslateCss({ x: position.left, y: position.top }) }, _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 from = config.from; var fromOpacity = isPlainObject(from) ? config.skipElementInitialStyles ? 0 : $element.css("opacity") : String(from); var toOpacity; 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; var to = config.to; var fromOpacity = "opacity" in from ? from.opacity : $element.css("opacity"); var toOpacity = "opacity" in to ? to.opacity : 1; var fromScale = "scale" in from ? from.scale : 0; var 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 }; var defaultCssConfig = { duration: 400, easing: "ease", delay: 0 }; var setupAnimationOnElement = function() { var animation = this; var $element = animation.element; var 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) { var element = getPublicElement($element); config.start.apply(this, [element, config]) } }; var onElementAnimationComplete = function(animation) { var $element = animation.element; var config = animation.config; $element.removeData(ANIM_DATA_KEY); if (config.complete) { var element = getPublicElement($element); config.complete.apply(this, [element, config]) } animation.deferred.resolveWith(this, [$element, config]) }; var startAnimationOnElement = function() { var animation = this; var $element = animation.element; var 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; var $element = animation.element; var config = animation.config; clearTimeout(animation.startTimeout); if (!animation.isStarted) { animation.start() } animation.strategy.stop($element, config, jumpToEnd) }; var scopedRemoveEvent = eventUtils.addNamespace(removeEvent, "dxFXStartAnimation"); var subscribeToRemoveEvent = function(animation) { eventsEngine.off(animation.element, scopedRemoveEvent); eventsEngine.on(animation.element, scopedRemoveEvent, function() { fx.stop(animation.element) }); animation.deferred.always(function() { eventsEngine.off(animation.element, scopedRemoveEvent) }) }; var createAnimation = function(element, initialConfig) { var defaultConfig = "css" === initialConfig.type ? defaultCssConfig : defaultJSConfig; var config = extend(true, {}, defaultConfig, initialConfig); var configurator = getAnimationConfigurator(config); var strategy = getAnimationStrategy(config); var animation = { element: $(element), config: config, configurator: configurator, strategy: strategy, isSynchronous: strategy.isSynchronous, setup: setupAnimationOnElement, start: startAnimationOnElement, stop: stopAnimationOnElement, deferred: new Deferred }; if (isFunction(configurator.validateConfig)) { configurator.validateConfig(config) } subscribeToRemoveEvent(animation); return animation }; var animate = function(element, config) { var $element = $(element); if (!$element.length) { return (new 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 shiftFromAnimationQueue($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() }) } return animation.deferred.promise() }; var setupPosition = function($element, config) { if (!config || !config.position) { return } var win = $(window); var left = 0; var top = 0; var position = positionUtils.calculate($element, config.position); var offset = $element.offset(); var currentPosition = $element.position(); if (currentPosition.top > offset.top) { top = win.scrollTop() } if (currentPosition.left > offset.left) { left = win.scrollLeft() } extend(config, { left: position.h.location - offset.left + currentPosition.left - left, top: position.v.location - offset.top + currentPosition.top - top }); delete config.position }; var setProps = function($element, props) { iteratorUtils.each(props, function(key, value) { try { $element.css(key, typeUtils.isFunction(value) ? value() : value) } catch (e) {} }) }; var stop = function(element, jumpToEnd) { var $element = $(element); var queueData = getAnimQueueData($element); iteratorUtils.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 }; module.exports = fx }, /*!***************************************************!*\ !*** ./artifacts/transpiled/core/element_data.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var WeakMap = __webpack_require__( /*! ./polyfills/weak_map */ 176); var domAdapter = __webpack_require__( /*! ./dom_adapter */ 11); var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var MemorizedCallbacks = __webpack_require__( /*! ./memorized_callbacks */ 177); var dataMap = new WeakMap; var strategy; var strategyChanging = new MemorizedCallbacks; var beforeCleanData = function() {}; var afterCleanData = function() {}; var setDataStrategy = exports.setDataStrategy = function(value) { strategyChanging.fire(value); strategy = value; var cleanData = strategy.cleanData; strategy.cleanData = function(nodes) { beforeCleanData(nodes); var result = cleanData.call(this, nodes); afterCleanData(nodes); return result } }; setDataStrategy({ data: function() { var element = arguments[0]; var key = arguments[1]; var value = arguments[2]; if (!element) { return } var elementData = dataMap.get(element); if (!elementData) { elementData = {}; dataMap.set(element, elementData) } if (void 0 === key) { return elementData } if (2 === arguments.length) { return elementData[key] } elementData[key] = value; return value }, removeData: function(element, key) { if (!element) { return } if (void 0 === key) { dataMap.delete(element) } else { var elementData = dataMap.get(element); if (elementData) { delete elementData[key] } } }, cleanData: function(elements) { for (var i = 0; i < elements.length; i++) { eventsEngine.off(elements[i]); dataMap.delete(elements[i]) } } }); exports.setDataStrategy = setDataStrategy; exports.getDataStrategy = function() { return strategy }; exports.data = function() { return strategy.data.apply(this, arguments) }; exports.strategyChanging = strategyChanging; exports.beforeCleanData = function(callback) { beforeCleanData = callback }; exports.afterCleanData = function(callback) { afterCleanData = callback }; exports.cleanData = function(nodes) { return strategy.cleanData.call(this, nodes) }; exports.removeData = function(element, key) { return strategy.removeData.call(this, element, key) }; exports.cleanDataRecursive = function(element, cleanSelf) { if (!domAdapter.isElementNode(element)) { return } var childElements = element.getElementsByTagName("*"); strategy.cleanData(childElements); if (cleanSelf) { strategy.cleanData([element]) } } }, /*!*******************************************!*\ !*** ./artifacts/transpiled/core/guid.js ***! \*******************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Class = __webpack_require__( /*! ./class */ 15); 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 }, /*!********************************************!*\ !*** ./artifacts/transpiled/data/utils.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _type2 = _interopRequireDefault(_type); var _dom_adapter = __webpack_require__( /*! ../core/dom_adapter */ 11); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); var _ready_callbacks = __webpack_require__( /*! ../core/utils/ready_callbacks */ 48); var _window = __webpack_require__( /*! ../core/utils/window */ 7); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _data = __webpack_require__( /*! ../core/utils/data */ 20); var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread() } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } function _unsupportedIterableToArray(o, minLen) { if (!o) { return } if ("string" === typeof o) { return _arrayLikeToArray(o, minLen) } var n = Object.prototype.toString.call(o).slice(8, -1); if ("Object" === n && o.constructor) { n = o.constructor.name } if ("Map" === n || "Set" === n) { return Array.from(o) } if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) { return _arrayLikeToArray(o, minLen) } } function _iterableToArray(iter) { if ("undefined" !== typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) { return Array.from(iter) } } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { return _arrayLikeToArray(arr) } } function _arrayLikeToArray(arr, len) { if (null == len || len > arr.length) { len = arr.length } for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i] } return arr2 } var XHR_ERROR_UNLOAD = "DEVEXTREME_XHR_ERROR_UNLOAD"; 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 (!Array.isArray(info)) { info = [info] } return (0, _iterator.map)(info, function(i) { var result = { selector: (0, _type.isFunction)(i) || "string" === typeof i ? i : i.getter || i.field || i.selector, desc: !!(i.desc || "d" === String(i.dir).charAt(0).toLowerCase()) }; if (i.compare) { result.compare = i.compare } return result }) }; 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 }; var unloading; (0, _ready_callbacks.add)(function() { var window = (0, _window.getWindow)(); _dom_adapter2.default.listen(window, "beforeunload", function() { unloading = true }) }); return function(xhr, textStatus) { if (unloading) { return XHR_ERROR_UNLOAD } 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 lockCount = 0; var lockDeferred; var obtain = function() { if (0 === lockCount) { lockDeferred = new _deferred.Deferred } lockCount++ }; var release = function() { lockCount--; if (lockCount < 1) { lockDeferred.resolve() } }; var promise = function() { var deferred = 0 === lockCount ? (new _deferred.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 (Array.isArray(keyExpr)) { var names = (0, _iterator.map)(key1, function(v, k) { return k }); var name; for (var i = 0; i < names.length; i++) { name = names[i]; if ((0, _data.toComparable)(key1[name], true) != (0, _data.toComparable)(key2[name], true)) { return false } } return true } return (0, _data.toComparable)(key1, true) == (0, _data.toComparable)(key2, true) }; var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var base64_encode = function(input) { if (!Array.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]; var octet2 = input[i + 1]; var octet3 = input[i + 2]; result += (0, _iterator.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 bytes = []; var code; var i; 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 isUnaryOperation = function(crit) { return "!" === crit[0] && Array.isArray(crit[1]) }; var isGroupOperator = function(value) { return "and" === value || "or" === value }; var isGroupCriterion = function(crit) { var first = crit[0]; var second = crit[1]; if (Array.isArray(first)) { return true } if (_type2.default.isFunction(first)) { if (Array.isArray(second) || _type2.default.isFunction(second) || isGroupOperator(second)) { return true } } return false }; var trivialPromise = function() { var d = new _deferred.Deferred; return d.resolve.apply(d, arguments).promise() }; var rejectedPromise = function() { var d = new _deferred.Deferred; return d.reject.apply(d, arguments).promise() }; function throttle(func, timeout) { var timeoutId; var lastArgs; return function() { var _this = this; lastArgs = arguments; if (!timeoutId) { timeoutId = setTimeout(function() { timeoutId = void 0; if (lastArgs) { func.call(_this, lastArgs) } }, (0, _type.isFunction)(timeout) ? timeout() : timeout) } return timeoutId } } function throttleChanges(func, timeout) { var cache = []; var throttled = throttle(function() { func.call(this, cache); cache = [] }, timeout); return function(changes) { if (Array.isArray(changes)) { var _cache; (_cache = cache).push.apply(_cache, _toConsumableArray(changes)) } return throttled.call(this, cache) } } var utils = { XHR_ERROR_UNLOAD: XHR_ERROR_UNLOAD, normalizeBinaryCriterion: normalizeBinaryCriterion, normalizeSortingInfo: normalizeSortingInfo, errorMessageFromXhr: errorMessageFromXhr, aggregators: aggregators, keysEqual: keysEqual, throttleChanges: throttleChanges, trivialPromise: trivialPromise, rejectedPromise: rejectedPromise, isDisjunctiveOperator: isDisjunctiveOperator, isConjunctiveOperator: isConjunctiveOperator, processRequestResultLock: processRequestResultLock, isUnaryOperation: isUnaryOperation, isGroupCriterion: isGroupCriterion, base64_encode: base64_encode }; module.exports = utils }, /*!********************************************!*\ !*** ./artifacts/transpiled/data/query.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var arrayQueryImpl = __webpack_require__( /*! ./array_query */ 155); var remoteQueryImpl = __webpack_require__( /*! ./remote_query */ 468); var queryImpl = { array: arrayQueryImpl, remote: remoteQueryImpl }; var query = function() { var impl = Array.isArray(arguments[0]) ? "array" : "remote"; return queryImpl[impl].apply(this, arguments) }; module.exports = query; module.exports.queryImpl = queryImpl }, /*!****************************************************!*\ !*** ./artifacts/transpiled/core/utils/support.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _array = __webpack_require__( /*! ./array */ 14); var _dom_adapter = __webpack_require__( /*! ../dom_adapter */ 11); var _common = __webpack_require__( /*! ./common */ 4); var _call_once = __webpack_require__( /*! ./call_once */ 63); var _call_once2 = _interopRequireDefault(_call_once); var _window = __webpack_require__( /*! ./window */ 7); var _window2 = _interopRequireDefault(_window); var _devices = __webpack_require__( /*! ../devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _style = __webpack_require__( /*! ./style */ 85); var _style2 = _interopRequireDefault(_style); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var _windowUtils$getNavig = _window2.default.getNavigator(), maxTouchPoints = _windowUtils$getNavig.maxTouchPoints, msMaxTouchPoints = _windowUtils$getNavig.msMaxTouchPoints, pointerEnabled = _windowUtils$getNavig.pointerEnabled; var hasProperty = _window2.default.hasProperty.bind(_window2.default); var transitionEndEventNames = { webkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd", msTransition: "MsTransitionEnd", transition: "transitionend" }; var supportProp = function(prop) { return !!_style2.default.styleProp(prop) }; var isNativeScrollingSupported = function() { var _devices$real = _devices2.default.real(), platform = _devices$real.platform, version = _devices$real.version, isMac = _devices$real.mac; var isObsoleteAndroid = version && version[0] < 4 && "android" === platform; var isNativeScrollDevice = !isObsoleteAndroid && (0, _array.inArray)(platform, ["ios", "android", "win"]) > -1 || isMac; return isNativeScrollDevice }; var inputType = function(type) { if ("text" === type) { return true } var input = (0, _dom_adapter.createElement)("input"); try { input.setAttribute("type", type); input.value = "wrongValue"; return !input.value } catch (e) { return false } }; var detectTouchEvents = function(hasWindowProperty, maxTouchPoints) { return (hasWindowProperty("ontouchstart") || !!maxTouchPoints) && !hasWindowProperty("callPhantom") }; var detectPointerEvent = function(hasWindowProperty, pointerEnabled) { var isPointerEnabled = (0, _common.ensureDefined)(pointerEnabled, true); var canUsePointerEvent = (0, _common.ensureDefined)(pointerEnabled, false); return hasWindowProperty("PointerEvent") && isPointerEnabled || canUsePointerEvent }; var touchEvents = detectTouchEvents(hasProperty, maxTouchPoints); var pointerEvents = detectPointerEvent(hasProperty, pointerEnabled); var touchPointersPresent = !!maxTouchPoints || !!msMaxTouchPoints; exports.detectTouchEvents = detectTouchEvents; exports.detectPointerEvent = detectPointerEvent; exports.touchEvents = touchEvents; exports.pointerEvents = pointerEvents; exports.touch = touchEvents || pointerEvents && touchPointersPresent; exports.transition = (0, _call_once2.default)(function() { return supportProp("transition") }); exports.transitionEndEventName = (0, _call_once2.default)(function() { return transitionEndEventNames[_style2.default.styleProp("transition")] }); exports.animation = (0, _call_once2.default)(function() { return supportProp("animation") }); exports.nativeScrolling = isNativeScrollingSupported(); exports.styleProp = _style2.default.styleProp; exports.stylePropPrefix = _style2.default.stylePropPrefix; exports.supportProp = supportProp; exports.inputType = inputType }, /*!***************************************************!*\ !*** ./artifacts/transpiled/core/utils/string.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var typeUtils = __webpack_require__( /*! ./type */ 1); 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 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 quadToObject = function(raw) { var quad = splitQuad(raw); var left = parseInt(quad && quad[0], 10); var top = parseInt(quad && quad[1], 10); var right = parseInt(quad && quad[2], 10); var 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 s = arguments[0]; var values = [].slice.call(arguments).slice(1); var replaceDollarCount; var reg; var value; if (typeUtils.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" === typeUtils.type(value) && value.indexOf("$") >= 0) { replaceDollarCount = "$".replace("$", "$$").length; value = value.replace("$", 1 === replaceDollarCount ? "$$$$" : "$$") } s = s.replace(reg, value) } return s }; var replaceAll = function() { var quote = function(str) { return (str + "").replace(/([+*?.[^\]$(){}><|=!:])/g, "\\$1") }; return function(text, searchToken, replacementToken) { return text.replace(new RegExp("(" + quote(searchToken) + ")", "gi"), replacementToken) } }(); var isEmpty = function() { var SPACE_REGEXP = /\s/g; return function(text) { return !text || !text.replace(SPACE_REGEXP, "") } }(); exports.encodeHtml = encodeHtml; exports.quadToObject = quadToObject; exports.format = stringFormat; exports.replaceAll = replaceAll; exports.isEmpty = isEmpty }, /*!**************************************************************!*\ !*** ./artifacts/transpiled/data/data_source/data_source.js ***! \**************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Class = __webpack_require__( /*! ../../core/class */ 15); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4); var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3); var ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var dataUtils = __webpack_require__( /*! ../utils */ 41); var arrayUtils = __webpack_require__( /*! ../array_utils */ 135); var Store = __webpack_require__( /*! ../abstract_store */ 98); var ArrayStore = __webpack_require__( /*! ../array_store */ 68); var CustomStore = __webpack_require__( /*! ../custom_store */ 149); var EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 82); var errors = __webpack_require__( /*! ../errors */ 36).errors; var array = __webpack_require__( /*! ../../core/utils/array */ 14); var queue = __webpack_require__( /*! ../../core/utils/queue */ 263); var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6); var when = deferredUtils.when; var Deferred = deferredUtils.Deferred; var __isString = typeUtils.isString; var __isNumber = typeUtils.isNumeric; var __isBoolean = typeUtils.isBoolean; var __isDefined = typeUtils.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 }; OperationManager.prototype.cancelAll = function() { while (this._counter > -1) { this.cancel(this._counter); this._counter-- } }; function isPending(deferred) { return "pending" === deferred.state() } function normalizeDataSourceOptions(options, normalizationOptions) { var store; function createCustomStoreFromLoadFunc() { var storeConfig = {}; iteratorUtils.each(["useDefaultSearch", "key", "load", "loadMode", "cacheRawData", "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 ajax.sendRequest({ url: url, dataType: "json" }) }, loadMode: normalizationOptions && normalizationOptions.fromUrlLoadMode }) } if ("string" === typeof options) { options = { paginate: false, store: createCustomStoreFromUrl(options) } } if (void 0 === options) { options = [] } if (Array.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 (Array.isArray(store)) { store = new ArrayStore(store) } else { if (typeUtils.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 [].slice.call(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 (!Array.isArray(items)) { return items } return level ? mapGroup(items, level) : iteratorUtils.map(items, mapper) } function mapGroup(group, level) { return iteratorUtils.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) } function normalizeLoadResult(data, extra) { if (data && !Array.isArray(data) && data.data) { extra = data; data = data.data } if (!Array.isArray(data)) { data = [data] } return { data: data, extra: extra } } var DataSource = Class.inherit({ ctor: function(options) { var _this = this; var that = this; options = normalizeDataSourceOptions(options); var onPushHandler = 0 !== options.pushAggregationTimeout ? dataUtils.throttleChanges(this._onPush, function() { if (void 0 === options.pushAggregationTimeout) { return 5 * that._changedTime } return options.pushAggregationTimeout }) : this._onPush; this._changedTime = 0; this._onPushHandler = function(changes) { _this._aggregationTimeoutId = onPushHandler.call(_this, changes) }; this._store = options.store; this._store.on("push", this._onPushHandler); 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; this._reshapeOnPush = __isDefined(options.reshapeOnPush) ? options.reshapeOnPush : false; iteratorUtils.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._operationManager = new OperationManager; 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._store.off("push", this._onPushHandler); this._disposeEvents(); clearTimeout(this._aggregationTimeoutId); delete this._store; if (this._delayedLoadTask) { this._delayedLoadTask.abort() } this._operationManager.cancelAll(); this._disposed = true }, _extractLoadOptions: function(options) { var result = {}; var names = ["sort", "filter", "select", "group", "requireTotalCount"]; var customNames = this._store._customLoadOptions(); if (customNames) { names = names.concat(customNames) } iteratorUtils.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 = [].slice.call(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 }, beginLoading: function() { this._changeLoadingCount(1) }, endLoading: function() { this._changeLoadingCount(-1) }, _createLoadQueue: function() { return queue.create() }, _changeLoadingCount: function(increment) { var oldLoading = this.isLoading(); this._loadingCount += increment; var newLoading = this.isLoading(); if (oldLoading ^ newLoading) { this.fireEvent("loadingChanged", [newLoading]) } }, _scheduleLoadCallbacks: function(deferred) { var that = this; that.beginLoading(); deferred.always(function() { that.endLoading() }) }, _scheduleFailCallbacks: function(deferred) { var that = this; deferred.fail(function() { if (arguments[0] === CANCELED_TOKEN) { return } that.fireEvent("loadError", arguments) }) }, _fireChanged: function(args) { var date = new Date; this.fireEvent("changed", args); this._changedTime = new Date - date }, _scheduleChangedCallbacks: function(deferred) { var _this2 = this; deferred.done(function() { _this2._fireChanged() }) }, loadSingle: function(propName, propValue) { var that = this; var d = new Deferred; var key = this.key(); var store = this._store; var options = this._createStoreLoadOptions(); var handleDone = function(data) { if (!__isDefined(data) || array.isEmpty(data)) { d.reject(new errors.Error("E4009")) } else { if (!Array.isArray(data)) { data = [data] } d.resolve(that._applyMapFunction(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 shouldForceByKey() { return store instanceof CustomStore && !store._byKeyViaLoad() }(function() { if (propName === key || shouldForceByKey()) { 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 that = this; var d = new 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); var 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 }) }, _onPush: function(changes) { var _this3 = this; if (this._reshapeOnPush) { this.load() } else { this.fireEvent("changing", [{ changes: changes }]); var group = this.group(); var items = this.items(); var groupLevel = 0; var dataSourceChanges = this.paginate() || group ? changes.filter(function(item) { return "update" === item.type }) : changes; if (group) { groupLevel = Array.isArray(group) ? group.length : 1 } if (this._mapFunc) { dataSourceChanges.forEach(function(item) { if ("insert" === item.type) { item.data = _this3._mapFunc(item.data) } }) } arrayUtils.applyBatch(this.store(), items, dataSourceChanges, groupLevel, true); this._fireChanged([{ changes: changes }]) } }, _createLoadOperation: function(deferred) { var id = this._operationManager.add(deferred); var options = this._createStoreLoadOptions(); deferred.always(function() { this._operationManager.remove(id) }.bind(this)); return { operationId: id, storeLoadOptions: options } }, reload: function() { var store = this.store(); if (store instanceof CustomStore) { store.clearRawDataCache() } this._init(); return this.load() }, cancel: function(operationId) { return this._operationManager.cancel(operationId) }, cancelAll: function() { return this._operationManager.cancelAll() }, _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; var op = this._searchOperation; var selector = this._searchExpr; var searchFilter = []; if (!value) { return } if (!selector) { selector = "this" } if (!Array.isArray(selector)) { selector = [selector] } iteratorUtils.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 = extend(normalizeLoadResult(data, 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 (new 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 = loadResult.data; var extra = loadResult.extra; var 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 (!typeUtils.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; exports.normalizeLoadResult = normalizeLoadResult }, /*!******************************************!*\ !*** ./artifacts/transpiled/ui/popup.js ***! \******************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow(); var translator = __webpack_require__( /*! ../animation/translator */ 27); var camelize = __webpack_require__( /*! ../core/utils/inflector */ 33).camelize; var noop = __webpack_require__( /*! ../core/utils/common */ 4).noop; var getPublicElement = __webpack_require__( /*! ../core/utils/dom */ 12).getPublicElement; var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each; var isDefined = __webpack_require__( /*! ../core/utils/type */ 1).isDefined; var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray; var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var browser = __webpack_require__( /*! ../core/utils/browser */ 25); var compareVersions = __webpack_require__( /*! ../core/utils/version */ 61).compare; var messageLocalization = __webpack_require__( /*! ../localization/message */ 13); var devices = __webpack_require__( /*! ../core/devices */ 16); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var Button = __webpack_require__( /*! ./button */ 34); var themes = __webpack_require__( /*! ./themes */ 30); var Overlay = __webpack_require__( /*! ./overlay */ 59); var EmptyTemplate = __webpack_require__( /*! ./widget/empty_template */ 109); var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12); var sizeUtils = __webpack_require__( /*! ../core/utils/size */ 171); var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7); __webpack_require__( /*! ./toolbar/ui.toolbar.base */ 289); var POPUP_CLASS = "dx-popup"; var POPUP_WRAPPER_CLASS = "dx-popup-wrapper"; var POPUP_FULL_SCREEN_CLASS = "dx-popup-fullscreen"; var POPUP_FULL_SCREEN_WIDTH_CLASS = "dx-popup-fullscreen-width"; var POPUP_NORMAL_CLASS = "dx-popup-normal"; var POPUP_CONTENT_CLASS = "dx-popup-content"; var POPUP_DRAGGABLE_CLASS = "dx-popup-draggable"; var POPUP_TITLE_CLASS = "dx-popup-title"; var POPUP_TITLE_CLOSEBUTTON_CLASS = "dx-closebutton"; var POPUP_BOTTOM_CLASS = "dx-popup-bottom"; var TEMPLATE_WRAPPER_CLASS = "dx-template-wrapper"; var POPUP_CONTENT_FLEX_HEIGHT_CLASS = "dx-popup-flex-height"; var POPUP_CONTENT_INHERIT_HEIGHT_CLASS = "dx-popup-inherit-height"; var ALLOWED_TOOLBAR_ITEM_ALIASES = ["cancel", "clear", "done"]; var BUTTON_DEFAULT_TYPE = "default"; var BUTTON_NORMAL_TYPE = "normal"; var BUTTON_TEXT_MODE = "text"; var BUTTON_CONTAINED_MODE = "contained"; var IS_IE11 = browser.msie && 11 === parseInt(browser.version); var IS_OLD_SAFARI = browser.safari && compareVersions(browser.version, [11]) < 0; var HEIGHT_STRATEGIES = { "static": "", inherit: POPUP_CONTENT_INHERIT_HEIGHT_CLASS, flex: POPUP_CONTENT_FLEX_HEIGHT_CLASS }; var getButtonPlace = function(name) { var device = devices.current(); var platform = device.platform; var toolbar = "bottom"; var 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", useDefaultToolbarButtons: false, useFlatToolbarButtons: false, autoResizeEnabled: true }) }, _defaultOptionsRules: function() { var themeName = themes.current(); return this.callBase().concat([{ 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() { return "desktop" === devices.real().deviceType && !devices.isSimulator() }, options: { focusStateEnabled: true } }, { device: function() { return themes.isMaterial(themeName) }, options: { useDefaultToolbarButtons: true, useFlatToolbarButtons: true } }]) }, _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 } } }; var 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._toggleFullScreenClass(isFullscreen); this.callBase() }, _toggleFullScreenClass: function(value) { this._$content.toggleClass(POPUP_FULL_SCREEN_CLASS, value).toggleClass(POPUP_NORMAL_CLASS, !value) }, _initTemplates: function() { this.callBase(); this._defaultTemplates.title = new EmptyTemplate(this); this._defaultTemplates.bottom = new EmptyTemplate(this) }, _renderContentImpl: function() { this._renderTitle(); this.callBase(); this._renderBottom() }, _renderTitle: function() { var items = this._getToolbarItems("top"); var titleText = this.option("title"); var 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, additionalToolbarOptions) { var template = this._getTemplateByOption(optionName); var toolbarTemplate = template instanceof EmptyTemplate; if (toolbarTemplate) { var integrationOptions = extend({}, this.option("integrationOptions"), { skipTemplates: ["content", "title"] }); var toolbarOptions = extend(additionalToolbarOptions, { items: data, rtlEnabled: this.option("rtlEnabled"), useDefaultButtons: this.option("useDefaultToolbarButtons"), useFlatButtons: this.option("useFlatToolbarButtons"), integrationOptions: integrationOptions }); this._getTemplate("dx-polymorph-widget").render({ container: $container, model: { widget: "dxToolbarBase", options: toolbarOptions } }); var $toolbar = $container.children("div"); $container.replaceWith($toolbar); return $toolbar } else { var $result = $(template.render({ container: getPublicElement($container) })); if ($result.hasClass(TEMPLATE_WRAPPER_CLASS)) { $container.replaceWith($result); $container = $result } return $container } }, _executeTitleRenderAction: function($titleElement) { this._getTitleRenderAction()({ titleElement: getPublicElement($titleElement) }) }, _getTitleRenderAction: function() { return this._titleRenderAction || this._createTitleRenderAction() }, _createTitleRenderAction: function() { return this._titleRenderAction = this._createActionByOption("onTitleRendered", { element: this.element(), excludeValidators: ["disabled", "readOnly"] }) }, _getCloseButton: function() { return { toolbar: "top", location: "after", template: this._getCloseButtonRenderer() } }, _getCloseButtonRenderer: function() { return function(_, __, container) { var $button = $("
").addClass(POPUP_TITLE_CLOSEBUTTON_CLASS); this._createComponent($button, Button, { icon: "close", onClick: this._createToolbarItemAction(void 0), integrationOptions: {} }); $(container).append($button) }.bind(this) }, _getToolbarItems: function(toolbar) { var toolbarItems = this.option("toolbarItems"); var toolbarsItems = []; this._toolbarItemClasses = []; var currentPlatform = devices.current().platform; var index = 0; each(toolbarItems, function(_, data) { var isShortcut = isDefined(data.shortcut); var item = isShortcut ? getButtonPlace(data.shortcut) : data; if (isShortcut && "ios" === currentPlatform && index < 2) { item.toolbar = "top"; index++ } item.toolbar = data.toolbar || item.toolbar || "top"; 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) } } }.bind(this)); if ("top" === toolbar && this.option("showCloseButton") && this.option("showTitle")) { toolbarsItems.push(this._getCloseButton()) } return toolbarsItems }, _getLocalizationKey: function(itemType) { return "done" === itemType.toLowerCase() ? "OK" : camelize(itemType, true) }, _getToolbarItemByAlias: function(data) { var that = this; var itemType = data.shortcut; if (inArray(itemType, ALLOWED_TOOLBAR_ITEM_ALIASES) < 0) { return false } var itemConfig = extend({ text: messageLocalization.format(this._getLocalizationKey(itemType)), onClick: this._createToolbarItemAction(data.onClick), integrationOptions: {}, type: that.option("useDefaultToolbarButtons") ? BUTTON_DEFAULT_TYPE : BUTTON_NORMAL_TYPE, stylingMode: that.option("useFlatToolbarButtons") ? BUTTON_TEXT_MODE : BUTTON_CONTAINED_MODE }, 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, { compactMode: true }).addClass(POPUP_BOTTOM_CLASS); this._toggleClasses() } else { this._$bottom && this._$bottom.detach() } }, _toggleClasses: function() { var aliases = ALLOWED_TOOLBAR_ITEM_ALIASES; each(aliases, 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) } }.bind(this)) }, _getDragTarget: function() { return this.topToolbar() }, _renderGeometryImpl: function(isDimensionChanged) { if (!isDimensionChanged) { this._resetContentHeight() } this.callBase.apply(this, arguments); this._setContentHeight() }, _resetContentHeight: function() { this._$popupContent.css({ height: "auto", maxHeight: "none" }) }, _renderDrag: function() { this.callBase(); this._$content.toggleClass(POPUP_DRAGGABLE_CLASS, this.option("dragEnabled")) }, _renderResize: function() { this.callBase(); this._resizable.option("onResize", function() { this._setContentHeight(); this._actions.onResize(arguments) }.bind(this)) }, _setContentHeight: function() { (this.option("forceApplyBindings") || noop)(); var overlayContent = this.overlayContent().get(0); var currentHeightStrategyClass = this._chooseHeightStrategy(overlayContent); this.$content().css(this._getHeightCssStyles(currentHeightStrategyClass, overlayContent)); this._setHeightClasses(this.overlayContent(), currentHeightStrategyClass) }, _heightStrategyChangeOffset: function(currentHeightStrategyClass, popupVerticalPaddings) { return currentHeightStrategyClass === HEIGHT_STRATEGIES.flex ? -popupVerticalPaddings : 0 }, _chooseHeightStrategy: function(overlayContent) { var isAutoWidth = "auto" === overlayContent.style.width || "" === overlayContent.style.width; var currentHeightStrategyClass = HEIGHT_STRATEGIES.static; if (this._isAutoHeight() && this.option("autoResizeEnabled")) { if (isAutoWidth || IS_OLD_SAFARI) { if (!IS_IE11) { currentHeightStrategyClass = HEIGHT_STRATEGIES.inherit } } else { currentHeightStrategyClass = HEIGHT_STRATEGIES.flex } } return currentHeightStrategyClass }, _getHeightCssStyles: function(currentHeightStrategyClass, overlayContent) { var cssStyles = {}; var contentMaxHeight = this._getOptionValue("maxHeight", overlayContent); var contentMinHeight = this._getOptionValue("minHeight", overlayContent); var popupHeightParts = this._splitPopupHeight(); var toolbarsAndVerticalOffsetsHeight = popupHeightParts.header + popupHeightParts.footer + popupHeightParts.contentVerticalOffsets + popupHeightParts.popupVerticalOffsets + this._heightStrategyChangeOffset(currentHeightStrategyClass, popupHeightParts.popupVerticalPaddings); if (currentHeightStrategyClass === HEIGHT_STRATEGIES.static) { if (!this._isAutoHeight() || contentMaxHeight || contentMinHeight) { var overlayHeight = this.option("fullScreen") ? Math.min(overlayContent.getBoundingClientRect().height, windowUtils.getWindow().innerHeight) : overlayContent.getBoundingClientRect().height; var contentHeight = overlayHeight - toolbarsAndVerticalOffsetsHeight; cssStyles = { height: Math.max(0, contentHeight), minHeight: "auto", maxHeight: "auto" } } } else { var container = $(this._getContainer()).get(0); var maxHeightValue = sizeUtils.addOffsetToMaxHeight(contentMaxHeight, -toolbarsAndVerticalOffsetsHeight, container); var minHeightValue = sizeUtils.addOffsetToMinHeight(contentMinHeight, -toolbarsAndVerticalOffsetsHeight, container); cssStyles = { height: "auto", minHeight: minHeightValue, maxHeight: maxHeightValue } } return cssStyles }, _setHeightClasses: function($container, currentClass) { var excessClasses = ""; for (var name in HEIGHT_STRATEGIES) { if (HEIGHT_STRATEGIES[name] !== currentClass) { excessClasses += " " + HEIGHT_STRATEGIES[name] } } $container.removeClass(excessClasses).addClass(currentClass) }, _isAutoHeight: function() { return "auto" === this.overlayContent().get(0).style.height }, _splitPopupHeight: function() { var topToolbar = this.topToolbar(); var bottomToolbar = this.bottomToolbar(); return { header: sizeUtils.getVisibleHeight(topToolbar && topToolbar.get(0)), footer: sizeUtils.getVisibleHeight(bottomToolbar && bottomToolbar.get(0)), contentVerticalOffsets: sizeUtils.getVerticalOffsets(this.overlayContent().get(0), true), popupVerticalOffsets: sizeUtils.getVerticalOffsets(this.$content().get(0), true), popupVerticalPaddings: sizeUtils.getVerticalOffsets(this.$content().get(0), false) } }, _useFixedPosition: function() { return this.callBase() || this.option("fullScreen") }, _toggleSafariFullScreen: function(value) { var toggleFullScreenBeforeShown = this._useFixedPosition() && value && !this._isShown; if (toggleFullScreenBeforeShown) { this._bodyScrollTop = value ? window.pageYOffset : void 0 } else { this._toggleSafariScrolling(!value) } }, _renderDimensions: function() { if (this.option("fullScreen")) { this._$content.css({ width: "100%", height: "100%" }) } else { this.callBase.apply(this, arguments) } if (windowUtils.hasWindow()) { 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) } }, refreshPosition: function() { this._renderPosition() }, _renderPosition: function() { if (this.option("fullScreen")) { translator.move(this._$content, { top: 0, left: 0 }) } else { (this.option("forceApplyBindings") || noop)(); 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": case "useDefaultToolbarButtons": case "useFlatToolbarButtons": var shouldRenderGeometry = !args.fullName.match(/^toolbarItems((\[\d+\])(\.(options|visible).*)?)?$/); this._renderTitle(); this._renderBottom(); if (shouldRenderGeometry) { this._renderGeometry() } break; case "dragEnabled": this._renderDrag(); break; case "autoResizeEnabled": this._renderGeometry(); domUtils.triggerResizeEvent(this._$content); break; case "fullScreen": this._toggleFullScreenClass(args.value); this._toggleSafariFullScreen(args.value); this._renderGeometry(); domUtils.triggerResizeEvent(this._$content); break; case "showCloseButton": this._renderTitle(); break; default: this.callBase(args) } }, bottomToolbar: function() { return this._$bottom }, topToolbar: function() { return this._$title }, $content: function() { return this._$popupContent }, content: function() { return getPublicElement(this._$popupContent) }, overlayContent: function() { return this._$content } }); registerComponent("dxPopup", Popup); module.exports = Popup }, /*!***************************************************!*\ !*** ./artifacts/transpiled/core/utils/object.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var typeUtils = __webpack_require__( /*! ./type */ 1); var variableWrapper = __webpack_require__( /*! ./variable_wrapper */ 86); var clone = function() { function Clone() {} return function(obj) { Clone.prototype = obj; return new Clone } }(); var orderEach = function(map, func) { var keys = []; var key; var i; for (key in map) { if (Object.prototype.hasOwnProperty.call(map, key)) { keys.push(key) } } keys.sort(function(x, y) { var isNumberX = typeUtils.isNumeric(x); var isNumberY = typeUtils.isNumeric(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 assignValueToProperty = function(target, property, value, assignByReference) { if (!assignByReference && variableWrapper.isWrapped(target[property])) { variableWrapper.assign(target[property], value) } else { target[property] = value } }; var deepExtendArraySafe = function deepExtendArraySafe(target, changes, extendComplexObject, assignByReference) { var prevValue; var newValue; for (var name in changes) { prevValue = target[name]; newValue = changes[name]; if ("__proto__" === name || target === newValue) { continue } if (typeUtils.isPlainObject(newValue)) { var goDeeper = extendComplexObject ? typeUtils.isObject(prevValue) : typeUtils.isPlainObject(prevValue); newValue = deepExtendArraySafe(goDeeper ? prevValue : {}, newValue, extendComplexObject, assignByReference) } if (void 0 !== newValue && prevValue !== newValue) { assignValueToProperty(target, name, newValue, assignByReference) } } return target }; exports.clone = clone; exports.orderEach = orderEach; exports.deepExtendArraySafe = deepExtendArraySafe }, /*!************************************************************!*\ !*** ./artifacts/transpiled/core/utils/ready_callbacks.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11); var injector = __webpack_require__( /*! ./dependency_injector */ 54); var windowUtils = __webpack_require__( /*! ./window */ 7); var callOnce = __webpack_require__( /*! ./call_once */ 63); var callbacks = []; var isReady = function() { return "complete" === domAdapter.getReadyState() || "loading" !== domAdapter.getReadyState() && !domAdapter.getDocumentElement().doScroll }; var subscribeReady = callOnce(function() { var removeListener = domAdapter.listen(domAdapter.getDocument(), "DOMContentLoaded", function() { readyCallbacks.fire(); removeListener() }) }); var readyCallbacks = { add: function(callback) { var hasWindow = windowUtils.hasWindow(); if (hasWindow && isReady()) { callback() } else { callbacks.push(callback); hasWindow && subscribeReady() } }, fire: function() { callbacks.forEach(function(callback) { return callback() }); callbacks = [] } }; module.exports = injector(readyCallbacks) }, /*!**************************************************!*\ !*** ./artifacts/transpiled/ui/editor/editor.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _string = __webpack_require__( /*! ../../core/utils/string */ 44); var $ = __webpack_require__( /*! ../../core/renderer */ 2); var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39); var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26); var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4); var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7); var Guid = __webpack_require__( /*! ../../core/guid */ 40); var getDefaultAlignment = __webpack_require__( /*! ../../core/utils/position */ 97).getDefaultAlignment; var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var Widget = __webpack_require__( /*! ../widget/ui.widget */ 18); var ValidationMixin = __webpack_require__( /*! ../validation/validation_mixin */ 172); var Overlay = __webpack_require__( /*! ../overlay */ 59); var EventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var eventUtils = __webpack_require__( /*! ../../events/utils */ 8); var READONLY_STATE_CLASS = "dx-state-readonly"; var INVALID_CLASS = "dx-invalid"; var INVALID_MESSAGE = "dx-invalid-message"; var INVALID_MESSAGE_CONTENT = "dx-invalid-message-content"; var INVALID_MESSAGE_AUTO = "dx-invalid-message-auto"; var INVALID_MESSAGE_ALWAYS = "dx-invalid-message-always"; var VALIDATION_TARGET = "dx-validation-target"; var VALIDATION_MESSAGE_MIN_WIDTH = 100; var READONLY_NAMESPACE = "editorReadOnly"; var Editor = Widget.inherit({ ctor: function() { this.showValidationMessageTimeout = null; this.validationRequest = Callbacks(); this.callBase.apply(this, arguments); var $element = this.$element(); if ($element) { dataUtils.data($element[0], VALIDATION_TARGET, this) } }, _init: function() { this.callBase(); this._initInnerOptionCache("validationTooltipOptions") }, _getDefaultOptions: function() { return extend(this.callBase(), { value: null, name: "", onValueChanged: null, readOnly: false, isValid: true, validationError: null, validationMessageMode: "auto", validationBoundary: void 0, validationMessageOffset: { h: 0, v: 0 }, validationTooltipOptions: {} }) }, _attachKeyboardEvents: function() { if (this.option("readOnly")) { return } this.callBase(); if (this._keyboardProcessor) { this._attachChildKeyboardEvents() } }, _attachChildKeyboardEvents: commonUtils.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 }, _initMarkup: function() { this._toggleReadOnlyState(); this._setSubmitElementName(this.option("name")); this.callBase(); this._renderValidationState() }, _raiseValueChangeAction: function(value, previousValue) { if (!this._valueChangeAction) { this._createValueChangeAction() } this._valueChangeAction(this._valueChangeArgs(value, previousValue)) }, _valueChangeArgs: function(value, previousValue) { return { value: value, previousValue: previousValue, event: this._valueChangeEventInstance } }, _saveValueChangeEvent: function(e) { this._valueChangeEventInstance = e }, _focusInHandler: function(e) { var _this = this; var isValidationMessageShownOnFocus = "auto" === this.option("validationMessageMode"); if (this._canValueBeChangedByClick() && isValidationMessageShownOnFocus) { this._$validationMessage && this._$validationMessage.removeClass(INVALID_MESSAGE_AUTO); clearTimeout(this.showValidationMessageTimeout); this.showValidationMessageTimeout = setTimeout(function() { return _this._$validationMessage && _this._$validationMessage.addClass(INVALID_MESSAGE_AUTO) }, 150) } return this.callBase(e) }, _canValueBeChangedByClick: function() { return false }, _renderValidationState: function() { var isValid = this.option("isValid"); var validationError = this.option("validationError"); var validationMessageMode = this.option("validationMessageMode"); var $element = this.$element(); $element.toggleClass(INVALID_CLASS, !isValid); this.setAria("invalid", !isValid || void 0); if (!windowUtils.hasWindow()) { return } if (this._$validationMessage) { this._$validationMessage.remove(); this.setAria("describedby", null); this._$validationMessage = null } if (!isValid && validationError && validationError.message) { this._$validationMessage = $("
").addClass(INVALID_MESSAGE).html((0, _string.encodeHtml)(validationError.message)).appendTo($element); var validationTarget = this._getValidationMessageTarget(); this._validationMessage = this._createComponent(this._$validationMessage, Overlay, extend({ integrationOptions: {}, templatesRenderAsynchronously: false, target: validationTarget, shading: false, width: "auto", height: "auto", container: $element, position: this._getValidationMessagePosition("below"), closeOnOutsideClick: false, closeOnTargetScroll: false, animation: null, visible: true, propagateOutsideClick: true, _checkParentVisibility: false }, this._getInnerOptionsCache("validationTooltipOptions"))); this._$validationMessage.toggleClass(INVALID_MESSAGE_AUTO, "auto" === validationMessageMode).toggleClass(INVALID_MESSAGE_ALWAYS, "always" === validationMessageMode); var messageId = "dx-" + new Guid; this._validationMessage.$content().addClass(INVALID_MESSAGE_CONTENT).attr("id", messageId); this.setAria("describedby", messageId); this._setValidationMessageMaxWidth(); this._bindInnerWidgetOptions(this._validationMessage, "validationTooltipOptions") } }, _setValidationMessageMaxWidth: function() { if (!this._validationMessage) { return } if (0 === this._getValidationMessageTarget().outerWidth()) { this._validationMessage.option("maxWidth", "100%"); 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"); var messagePositionSide = getDefaultAlignment(rtlEnabled); var messageOriginalOffset = this.option("validationMessageOffset"); var messageOffset = { h: messageOriginalOffset.h, v: messageOriginalOffset.v }; var 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() { var readOnly = this.option("readOnly"); this._toggleBackspaceHandler(readOnly); this.$element().toggleClass(READONLY_STATE_CLASS, !!readOnly); this.setAria("readonly", readOnly || void 0) }, _toggleBackspaceHandler: function(isReadOnly) { var $eventTarget = this._keyboardEventBindingTarget(); var eventName = eventUtils.addNamespace("keydown", READONLY_NAMESPACE); EventsEngine.off($eventTarget, eventName); if (isReadOnly) { EventsEngine.on($eventTarget, eventName, function(e) { if ("backspace" === eventUtils.normalizeKeyName(e)) { e.preventDefault() } }) } }, _dispose: function() { var element = this.$element()[0]; dataUtils.data(element, VALIDATION_TARGET, null); clearTimeout(this.showValidationMessageTimeout); this.callBase() }, _setSubmitElementName: function(name) { var $submitElement = this._getSubmitElement(); if (!$submitElement) { return } if (name.length > 0) { $submitElement.attr("name", name) } else { $submitElement.removeAttr("name") } }, _getSubmitElement: function() { return null }, _optionChanged: function(args) { switch (args.name) { case "onValueChanged": this._createValueChangeAction(); break; case "isValid": case "validationError": case "validationBoundary": case "validationMessageMode": this._renderValidationState(); break; case "validationTooltipOptions": this._innerOptionChanged(this._validationMessage, args); break; case "readOnly": this._toggleReadOnlyState(); this._refreshFocusState(); break; case "value": if (args.value != args.previousValue) { this.validationRequest.fire({ value: args.value, editor: this }) } if (!this._valueChangeActionSuppressed) { this._raiseValueChangeAction(args.value, args.previousValue); this._saveValueChangeEvent(void 0) } break; case "width": this.callBase(args); this._setValidationMessageMaxWidth(); break; case "name": this._setSubmitElementName(args.value); break; default: this.callBase(args) } }, reset: function() { var defaultOptions = this._getDefaultOptions(); this.option("value", defaultOptions.value) } }).include(ValidationMixin); module.exports = Editor }, /*!********************************************!*\ !*** ./artifacts/transpiled/viz/themes.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each; var vizUtils = __webpack_require__( /*! ./core/utils */ 10); var uiThemes = __webpack_require__( /*! ../ui/themes */ 30); var themes = {}; var themesMapping = {}; var themesSchemeMapping = {}; var _extend = extend; var _each = each; var _normalizeEnum = vizUtils.normalizeEnum; var currentThemeName = null; var defaultTheme; var nextCacheUid = 0; var widgetsCache = {}; function getTheme(themeName) { var name = _normalizeEnum(themeName); return themes[name] || themes[themesMapping[name] || currentTheme()] } 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 || findThemeNameByName(uiThemes.current()) || defaultTheme } 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, ".") || { name: themeName }; var name = themeInfo.name; var scheme = themeInfo.scheme; if (scheme) { themesMapping[name] = themesMapping[name] || targetThemeName; themesMapping[name + "." + scheme] = targetThemeName } else { themesMapping[name] = targetThemeName } } function registerTheme(theme, baseThemeName) { var themeName = _normalizeEnum(theme && theme.name); if (themeName) { theme.isDefault && (defaultTheme = themeName); registerThemeName(themeName, themeName); themes[themeName] = _extend(true, {}, getTheme(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: {}, funnel: {}, sankey: {}, 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.gridColor); patchAxes(theme); _each(["chart", "pie", "polar", "gauge", "barGauge", "map", "treeMap", "funnel", "rangeSelector", "sparkline", "bullet", "sankey"], function(_, section) { mergeScalar(theme[section], "redrawOnResize", theme); mergeScalar(theme[section], "containerBackgroundColor", null, theme.backgroundColor); mergeObject(theme[section], "tooltip", theme); mergeObject(theme[section], "export", theme) }); _each(["chart", "pie", "polar", "gauge", "barGauge", "map", "treeMap", "funnel", "rangeSelector", "sankey"], function(_, section) { mergeObject(theme[section], "loadingIndicator", 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.gridColor); mergeScalar(theme.treeMap.tile.selectionStyle.border, "color", null, theme.primaryTitleColor); mergeScalar(theme.treeMap.group.selectionStyle.border, "color", null, theme.primaryTitleColor); mergeScalar(theme.map.legend, "backgroundColor", theme); patchMapLayers(theme); return theme } function patchAxes(theme) { var commonAxisSettings = theme["chart:common:axis"]; var colorFieldName = "color"; _each([commonAxisSettings.grid, commonAxisSettings.minorGrid], function(_, obj) { mergeScalar(obj, colorFieldName, null, theme.gridColor) }); _each([commonAxisSettings, commonAxisSettings.tick, commonAxisSettings.minorTick, commonAxisSettings.label.font], function(_, obj) { mergeScalar(obj, colorFieldName, null, theme.axisColor) }); mergeScalar(commonAxisSettings.title.font, colorFieldName, null, theme.secondaryTitleColor); mergeScalar(theme.gauge.scale.label.font, colorFieldName, null, theme.axisColor); mergeScalar(theme.gauge.scale.tick, colorFieldName, null, theme.backgroundColor); mergeScalar(theme.gauge.scale.minorTick, colorFieldName, null, theme.backgroundColor); mergeScalar(theme.rangeSelector.scale.label.font, colorFieldName, null, theme.axisColor) } 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 refreshTheme() { _each(widgetsCache, function() { this.refresh() }); return this } _extend(exports, { currentTheme: currentTheme, registerTheme: registerTheme, getTheme: getTheme, registerThemeAlias: registerThemeAlias, registerThemeSchemeAlias: registerThemeSchemeAlias, refreshTheme: refreshTheme, addCacheItem: addCacheItem, removeCacheItem: removeCacheItem }); _extend(exports, { themes: themes, themesMapping: themesMapping, themesSchemeMapping: themesSchemeMapping, widgetsCache: widgetsCache, resetCurrentTheme: function() { currentThemeName = null } }) }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/localization/number.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest() } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } function _unsupportedIterableToArray(o, minLen) { if (!o) { return } if ("string" === typeof o) { return _arrayLikeToArray(o, minLen) } var n = Object.prototype.toString.call(o).slice(8, -1); if ("Object" === n && o.constructor) { n = o.constructor.name } if ("Map" === n || "Set" === n) { return Array.from(o) } if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) { return _arrayLikeToArray(o, minLen) } } function _arrayLikeToArray(arr, len) { if (null == len || len > arr.length) { len = arr.length } for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i] } return arr2 } function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" !== typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null == _i) { return } var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) { break } } } catch (err) { _d = true; _e = err } finally { try { if (!_n && null != _i.return) { _i.return() } } finally { if (_d) { throw _e } } } return _arr } function _arrayWithHoles(arr) { if (Array.isArray(arr)) { return arr } } var dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 54); var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray; var escapeRegExp = __webpack_require__( /*! ../core/utils/common */ 4).escapeRegExp; var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each; var isPlainObject = __webpack_require__( /*! ../core/utils/type */ 1).isPlainObject; var ldmlNumber = __webpack_require__( /*! ./ldml/number */ 278); var config = __webpack_require__( /*! ../core/config */ 31); var errors = __webpack_require__( /*! ../core/errors */ 21); var toFixed = __webpack_require__( /*! ./utils */ 256).toFixed; var MAX_LARGE_NUMBER_POWER = 4; var 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 formatObject = {}; if (!formatType || "string" !== typeof formatType) { return } var formatList = formatType.toLowerCase().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); var 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 result; 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) } var powerPostfix = this.defaultLargeNumberFormatPostfixes[formatObject.power] || ""; result = this._formatNumberCore(value, formatObject.formatType, formatConfig); result = result.replace(/(\d|.$)(\D*)$/, "$1" + powerPostfix + "$2"); return result }, _formatNumberExponential: function(value, formatConfig) { var power = this._calculateNumberPower(value, DECIMAL_BASE); var 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 } var powString = (power >= 0 ? "+" : "") + power.toString(); return this._formatNumberCore(number, "fixedpoint", formatConfig) + "E" + powString }, _addZeroes: function(value, precision) { var multiplier = Math.pow(10, precision); var sign = value < 0 ? "-" : ""; value = (Math.abs(value) * multiplier >>> 0) / multiplier; var result = value.toString(); while (result.length < precision) { result = "0" + result } return sign + result }, _addGroupSeparators: function(value) { var parts = value.toString().split("."); return parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, config().thousandsSeparator) + (parts[1] ? config().decimalSeparator + parts[1] : "") }, _formatNumberCore: function(value, format, formatConfig) { if ("exponential" === format) { return this._formatNumberExponential(value, formatConfig) } if ("decimal" !== format && null !== formatConfig.precision) { formatConfig.precision = formatConfig.precision || 0 } if ("percent" === format) { value = 100 * value } if (void 0 !== formatConfig.precision) { if ("decimal" === format) { value = this._addZeroes(value, formatConfig.precision) } else { value = null === formatConfig.precision ? value.toPrecision() : toFixed(value, formatConfig.precision) } } if ("decimal" !== format) { value = this._addGroupSeparators(value) } else { value = value.toString().replace(".", config().decimalSeparator) } if ("percent" === format) { value += "%" } return value }, _normalizeFormat: function(format) { if (!format) { return {} } if ("function" === typeof format) { return format } if (!isPlainObject(format)) { format = { type: format } } return format }, _getSeparators: function() { return { decimalSeparator: this.getDecimalSeparator(), thousandsSeparator: this.getThousandsSeparator() } }, getThousandsSeparator: function() { return this.format(1e4, "fixedPoint")[2] }, getDecimalSeparator: function() { return this.format(1.2, { type: "fixedPoint", precision: 1 })[1] }, convertDigits: function(value, toStandard) { var digits = this.format(90, "decimal"); if ("string" !== typeof value || "0" === digits[1]) { return value } var fromFirstDigit = toStandard ? digits[1] : "0"; var toFirstDigit = toStandard ? "0" : digits[1]; var fromLastDigit = toStandard ? digits[0] : "9"; var regExp = new RegExp("[" + fromFirstDigit + "-" + fromLastDigit + "]", "g"); return value.replace(regExp, function(char) { return String.fromCharCode(char.charCodeAt(0) + (toFirstDigit.charCodeAt(0) - fromFirstDigit.charCodeAt(0))) }) }, getSign: function(text, format) { if ("-" === text.replace(/[^0-9-]/g, "").charAt(0)) { return -1 } if (!format) { return 1 } var separators = this._getSeparators(); var regExp = new RegExp("[0-9" + escapeRegExp(separators.decimalSeparator + separators.thousandsSeparator) + "]+", "g"); var negativeEtalon = this.format(-1, format).replace(regExp, "1"); var cleanedText = text.replace(regExp, "1"); return cleanedText === negativeEtalon ? -1 : 1 }, 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 this.convertDigits(ldmlNumber.getFormatter(_format.type, this._getSeparators())(value)) } return this._formatNumber(value, numberConfig, _format) }, parse: function(text, format) { if (!text) { return } if (format && format.parser) { return format.parser(text) } text = this.convertDigits(text, true); if (format && "string" !== typeof format) { errors.log("W0011") } var decimalSeparator = this.getDecimalSeparator(); var regExp = new RegExp("[^0-9" + escapeRegExp(decimalSeparator) + "]", "g"); var cleanedText = text.replace(regExp, "").replace(decimalSeparator, ".").replace(/\.$/g, ""); if ("." === cleanedText || "" === cleanedText) { return null } if (this._calcSignificantDigits(cleanedText) > 15) { return NaN } var parsed = +cleanedText; return parsed * this.getSign(text, format) }, _calcSignificantDigits: function(text) { var _text$split = text.split("."), _text$split2 = _slicedToArray(_text$split, 2), integer = _text$split2[0], fractional = _text$split2[1]; var calcDigitsAfterLeadingZeros = function(digits) { var index = -1; for (var i = 0; i < digits.length; i++) { if ("0" !== digits[i]) { index = i; break } } return index > -1 ? digits.length - index : 0 }; var result = 0; if (integer) { result += calcDigitsAfterLeadingZeros(integer.split("")) } if (fractional) { result += calcDigitsAfterLeadingZeros(fractional.split("").reverse()) } return result } }); module.exports = numberLocalization }, /*!***************************************************************!*\ !*** ./artifacts/transpiled/core/utils/date_serialization.js ***! \***************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var config = __webpack_require__( /*! ../config */ 31); var getLDMLFormatter = __webpack_require__( /*! ../../localization/ldml/date.formatter */ 257).getFormatter; var defaultDateNames = __webpack_require__( /*! ../../localization/default_date_names */ 258); var typeUtils = __webpack_require__( /*! ./type */ 1); var isString = typeUtils.isString; var isDate = typeUtils.isDate; var isNumber = typeUtils.isNumeric; var NUMBER_SERIALIZATION_FORMAT = "number"; var DATE_SERIALIZATION_FORMAT = "yyyy/MM/dd"; var DATETIME_SERIALIZATION_FORMAT = "yyyy/MM/dd HH:mm:ss"; var ISO8601_PATTERN = /^(\d{4,})(-)?(\d{2})(-)?(\d{2})(?:T(\d{2})(:)?(\d{2})?(:)?(\d{2}(?:\.(\d{1,3})\d*)?)?)?(Z|([+-])(\d{2})(:)?(\d{2})?)?$/; var ISO8601_TIME_PATTERN = /^(\d{2}):(\d{2})(:(\d{2}))?$/; var ISO8601_PATTERN_PARTS = ["", "yyyy", "", "MM", "", "dd", "THH", "", "mm", "", "ss", ".SSS"]; var MILLISECOND_LENGHT = 3; var dateParser = function(text, skipISO8601Parsing) { var result; var parsedValue; if (isString(text) && !skipISO8601Parsing) { result = parseISO8601String(text) } if (!result) { parsedValue = !isDate(text) && Date.parse(text); result = isNumber(parsedValue) ? new Date(parsedValue) : text } return result }; var parseISO8601String = function(text) { var parts = text.match(ISO8601_PATTERN); var timePart = function(part) { return +part || 0 }; if (!parts) { parts = text.match(ISO8601_TIME_PATTERN); if (parts) { return new Date(0, 0, 0, timePart(parts[1]), timePart(parts[2]), timePart(parts[4])) } return } var year = parts[1]; var month = --parts[3]; var day = parts[5]; var timeZoneHour = 0; var timeZoneMinute = 0; timeZoneHour = timePart(parts[14]); timeZoneMinute = timePart(parts[16]); if ("-" === parts[13]) { timeZoneHour = -timeZoneHour; timeZoneMinute = -timeZoneMinute } var hour = timePart(parts[6]) - timeZoneHour; var minute = timePart(parts[8]) - timeZoneMinute; var second = timePart(parts[10]); var parseMilliseconds = function(part) { part = part || ""; return timePart(part) * Math.pow(10, MILLISECOND_LENGHT - part.length) }; var millisecond = parseMilliseconds(parts[11]); if (parts[12]) { return new Date(Date.UTC(year, month, day, hour, minute, second, millisecond)) } return new Date(year, month, day, hour, minute, second, millisecond) }; var getIso8601Format = function(text, useUtc) { var parts = text.match(ISO8601_PATTERN); var result = ""; if (!parts) { parts = text.match(ISO8601_TIME_PATTERN); if (parts) { return parts[3] ? "HH:mm:ss" : "HH:mm" } return } for (var i = 1; i < ISO8601_PATTERN_PARTS.length; i++) { if (parts[i]) { result += ISO8601_PATTERN_PARTS[i] || parts[i] } } if ("Z" === parts[12]) { result += "'Z'" } if (parts[14]) { if (parts[15]) { result += "xxx" } else { if (parts[16]) { result += "xx" } else { result += "x" } } } return result }; var deserializeDate = function(value) { if ("number" === typeof value) { return new Date(value) } return dateParser(value, !config().forceIsoDateParsing) }; var serializeDate = function(value, serializationFormat) { if (!serializationFormat) { return value } if (!isDate(value)) { return null } if (serializationFormat === NUMBER_SERIALIZATION_FORMAT) { return value && value.valueOf ? value.valueOf() : null } return getLDMLFormatter(serializationFormat, defaultDateNames)(value) }; var getDateSerializationFormat = function(value) { if ("number" === typeof value) { return NUMBER_SERIALIZATION_FORMAT } else { if (isString(value)) { var format; if (config().forceIsoDateParsing) { format = getIso8601Format(value) } if (format) { return format } else { if (value.indexOf(":") >= 0) { return DATETIME_SERIALIZATION_FORMAT } else { return DATE_SERIALIZATION_FORMAT } } } else { if (value) { return null } } } }; module.exports = { dateParser: dateParser, deserializeDate: deserializeDate, serializeDate: serializeDate, getDateSerializationFormat: getDateSerializationFormat } }, /*!*************************************************************************!*\ !*** ./artifacts/transpiled/ui/collection/ui.collection_widget.edit.js ***! \*************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _uiCollection_widget = __webpack_require__( /*! ./ui.collection_widget.base */ 467); var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget); var _ui = __webpack_require__( /*! ../widget/ui.errors */ 17); var _ui2 = _interopRequireDefault(_ui); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _uiCollection_widgetEditStrategy = __webpack_require__( /*! ./ui.collection_widget.edit.strategy.plain */ 182); var _uiCollection_widgetEditStrategy2 = _interopRequireDefault(_uiCollection_widgetEditStrategy); var _data = __webpack_require__( /*! ../../core/utils/data */ 20); var _data_source = __webpack_require__( /*! ../../data/data_source/data_source */ 45); var _selection = __webpack_require__( /*! ../selection/selection */ 283); var _selection2 = _interopRequireDefault(_selection); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread() } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } function _unsupportedIterableToArray(o, minLen) { if (!o) { return } if ("string" === typeof o) { return _arrayLikeToArray(o, minLen) } var n = Object.prototype.toString.call(o).slice(8, -1); if ("Object" === n && o.constructor) { n = o.constructor.name } if ("Map" === n || "Set" === n) { return Array.from(o) } if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) { return _arrayLikeToArray(o, minLen) } } function _iterableToArray(iter) { if ("undefined" !== typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) { return Array.from(iter) } } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { return _arrayLikeToArray(arr) } } function _arrayLikeToArray(arr, len) { if (null == len || len > arr.length) { len = arr.length } for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i] } return arr2 } var ITEM_DELETING_DATA_KEY = "dxItemDeleting"; var NOT_EXISTING_INDEX = -1; var indexExists = function(index) { return index !== NOT_EXISTING_INDEX }; var CollectionWidget = _uiCollection_widget2.default.inherit({ _setOptionsByReference: function() { this.callBase(); (0, _extend.extend)(this._optionsByReference, { selectedItem: true }) }, _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { selectionMode: "none", selectionRequired: false, selectionByClick: true, selectedItems: [], selectedItemKeys: [], maxFilterLengthInRequest: 1500, keyExpr: null, selectedIndex: NOT_EXISTING_INDEX, selectedItem: null, onSelectionChanged: null, onItemReordered: null, onItemDeleting: null, onItemDeleted: null }) }, ctor: function(element, options) { this._userOptions = options || {}; this.callBase(element, options) }, _init: function() { this._initEditStrategy(); this.callBase(); this._initKeyGetter(); this._initSelectionModule(); if ("multi" === this.option("selectionMode")) { this._showDeprecatedSelectionMode() } }, _initKeyGetter: function() { this._keyGetter = (0, _data.compileGetter)(this.option("keyExpr")) }, _getKeysByItems: function(selectedItems) { return this._editStrategy.getKeysByItems(selectedItems) }, _getItemsByKeys: function(selectedItemKeys, selectedItems) { return this._editStrategy.getItemsByKeys(selectedItemKeys, selectedItems) }, _getKeyByIndex: function(index) { return this._editStrategy.getKeyByIndex(index) }, _getIndexByKey: function(key) { return this._editStrategy.getIndexByKey(key) }, _getIndexByItemData: function(itemData) { return this._editStrategy.getIndexByItemData(itemData) }, _isKeySpecified: function() { return !!(this._dataSource && this._dataSource.key()) }, _getCombinedFilter: function() { return this._dataSource && this._dataSource.filter() }, key: function() { if (this.option("keyExpr")) { return this.option("keyExpr") } return this._dataSource && this._dataSource.key() }, keyOf: function(item) { var key = item; var store = this._dataSource && this._dataSource.store(); if (this.option("keyExpr")) { key = this._keyGetter(item) } else { if (store) { key = store.keyOf(item) } } return key }, _nullValueSelectionSupported: function() { return false }, _initSelectionModule: function() { var that = this; var itemsGetter = that._editStrategy.itemsGetter; this._selection = new _selection2.default({ allowNullValue: this._nullValueSelectionSupported(), mode: this.option("selectionMode"), maxFilterLengthInRequest: this.option("maxFilterLengthInRequest"), equalByReference: !this._isKeySpecified(), onSelectionChanged: function(args) { if (args.addedItemKeys.length || args.removedItemKeys.length) { that.option("selectedItems", that._getItemsByKeys(args.selectedItemKeys, args.selectedItems)); that._updateSelectedItems(args) } }, filter: that._getCombinedFilter.bind(that), totalCount: function() { var items = that.option("items"); var dataSource = that._dataSource; return dataSource && dataSource.totalCount() >= 0 ? dataSource.totalCount() : items.length }, key: that.key.bind(that), keyOf: that.keyOf.bind(that), load: function(options) { if (that._dataSource) { var loadOptions = that._dataSource.loadOptions(); options.customQueryParams = loadOptions.customQueryParams; options.userData = that._dataSource._userData } var store = that._dataSource && that._dataSource.store(); if (store) { return store.load(options).done(function(loadResult) { if (that._disposed) { return } var items = (0, _data_source.normalizeLoadResult)(loadResult).data; that._dataSource._applyMapFunction(items) }) } else { return (new _deferred.Deferred).resolve(this.plainItems()) } }, dataFields: function() { return that._dataSource && that._dataSource.select() }, plainItems: itemsGetter.bind(that._editStrategy) }) }, _initEditStrategy: function() { var Strategy = _uiCollection_widgetEditStrategy2.default; this._editStrategy = new Strategy(this) }, _getSelectedItemIndices: function(keys) { var that = this; var indices = []; keys = keys || this._selection.getSelectedItemKeys(); that._editStrategy.beginCache(); (0, _iterator.each)(keys, function(_, key) { var selectedIndex = that._getIndexByKey(key); if (indexExists(selectedIndex)) { indices.push(selectedIndex) } }); that._editStrategy.endCache(); return indices }, _initMarkup: function() { var _this = this; this._rendering = true; if (!this._dataSource || !this._dataSource.isLoading()) { this._syncSelectionOptions().done(function() { return _this._normalizeSelectedItems() }) } this.callBase() }, _render: function() { this.callBase(); this._rendering = false }, _fireContentReadyAction: function() { this._rendering = false; this._rendered = true; this.callBase.apply(this, arguments) }, _syncSelectionOptions: function(byOption) { byOption = byOption || this._chooseSelectOption(); var selectedItem; var selectedIndex; var selectedItemKeys; var selectedItems; switch (byOption) { case "selectedIndex": selectedItem = this._editStrategy.getItemDataByIndex(this.option("selectedIndex")); if ((0, _type.isDefined)(selectedItem)) { this._setOptionSilent("selectedItems", [selectedItem]); this._setOptionSilent("selectedItem", selectedItem); this._setOptionSilent("selectedItemKeys", this._editStrategy.getKeysByItems([selectedItem])) } else { this._setOptionSilent("selectedItems", []); this._setOptionSilent("selectedItemKeys", []); this._setOptionSilent("selectedItem", null) } break; case "selectedItems": selectedItems = this.option("selectedItems") || []; selectedIndex = this._editStrategy.getIndexByItemData(selectedItems[0]); if (this.option("selectionRequired") && !indexExists(selectedIndex)) { return this._syncSelectionOptions("selectedIndex") } this._setOptionSilent("selectedItem", selectedItems[0]); this._setOptionSilent("selectedIndex", selectedIndex); this._setOptionSilent("selectedItemKeys", this._editStrategy.getKeysByItems(selectedItems)); break; case "selectedItem": selectedItem = this.option("selectedItem"); selectedIndex = this._editStrategy.getIndexByItemData(selectedItem); if (this.option("selectionRequired") && !indexExists(selectedIndex)) { return this._syncSelectionOptions("selectedIndex") } if ((0, _type.isDefined)(selectedItem)) { this._setOptionSilent("selectedItems", [selectedItem]); this._setOptionSilent("selectedIndex", selectedIndex); this._setOptionSilent("selectedItemKeys", this._editStrategy.getKeysByItems([selectedItem])) } else { this._setOptionSilent("selectedItems", []); this._setOptionSilent("selectedItemKeys", []); this._setOptionSilent("selectedIndex", NOT_EXISTING_INDEX) } break; case "selectedItemKeys": selectedItemKeys = this.option("selectedItemKeys"); if (this.option("selectionRequired")) { var selectedItemIndex = this._getIndexByKey(selectedItemKeys[0]); if (!indexExists(selectedItemIndex)) { return this._syncSelectionOptions("selectedIndex") } } return this._selection.setSelection(selectedItemKeys) } return (new _deferred.Deferred).resolve().promise() }, _chooseSelectOption: function() { var optionName = "selectedIndex"; var isOptionDefined = function(optionName) { var optionValue = this.option(optionName); var length = (0, _type.isDefined)(optionValue) && optionValue.length; return length || optionName in this._userOptions }.bind(this); if (isOptionDefined("selectedItems")) { optionName = "selectedItems" } else { if (isOptionDefined("selectedItem")) { optionName = "selectedItem" } else { if (isOptionDefined("selectedItemKeys")) { optionName = "selectedItemKeys" } } } return optionName }, _compareKeys: function(oldKeys, newKeys) { if (oldKeys.length !== newKeys.length) { return false } for (var i = 0; i < newKeys.length; i++) { if (oldKeys[i] !== newKeys[i]) { return false } } return true }, _normalizeSelectedItems: function() { if ("none" === this.option("selectionMode")) { this._setOptionSilent("selectedItems", []); this._syncSelectionOptions("selectedItems") } else { if ("single" === this.option("selectionMode")) { var newSelection = this.option("selectedItems"); if (newSelection.length > 1 || !newSelection.length && this.option("selectionRequired") && this.option("items") && this.option("items").length) { var currentSelection = this._selection.getSelectedItems(); var normalizedSelection = void 0 === newSelection[0] ? currentSelection[0] : newSelection[0]; if (void 0 === normalizedSelection) { normalizedSelection = this._editStrategy.itemsGetter()[0] } if (this.option("grouped") && normalizedSelection && normalizedSelection.items) { normalizedSelection.items = [normalizedSelection.items[0]] } this._selection.setSelection(this._getKeysByItems([normalizedSelection])); this._setOptionSilent("selectedItems", [normalizedSelection]); return this._syncSelectionOptions("selectedItems") } else { this._selection.setSelection(this._getKeysByItems(newSelection)) } } else { var newKeys = this._getKeysByItems(this.option("selectedItems")); var oldKeys = this._selection.getSelectedItemKeys(); if (!this._compareKeys(oldKeys, newKeys)) { this._selection.setSelection(newKeys) } } } return (new _deferred.Deferred).resolve().promise() }, _itemClickHandler: function(e) { this._createAction(function(e) { this._itemSelectHandler(e.event) }.bind(this), { validatingTargetName: "itemElement" })({ itemElement: (0, _renderer2.default)(e.currentTarget), event: 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) { if ("none" !== this.option("selectionMode")) { var $itemElement = (0, _renderer2.default)(args.itemElement); var normalizedItemIndex = this._editStrategy.getNormalizedIndex($itemElement); var isItemSelected = this._isItemSelected(normalizedItemIndex); this._processSelectableItem($itemElement, isItemSelected) } }, _processSelectableItem: function($itemElement, isSelected) { $itemElement.toggleClass(this._selectedItemClass(), isSelected); this._setAriaSelected($itemElement, String(isSelected)) }, _updateSelectedItems: function(args) { var that = this; var addedItemKeys = args.addedItemKeys; var removedItemKeys = args.removedItemKeys; if (that._rendered && (addedItemKeys.length || removedItemKeys.length)) { var selectionChangePromise = that._selectionChangePromise; if (!that._rendering) { var addedSelection = []; var normalizedIndex; var removedSelection = []; that._editStrategy.beginCache(); for (var i = 0; i < addedItemKeys.length; i++) { normalizedIndex = that._getIndexByKey(addedItemKeys[i]); addedSelection.push(normalizedIndex); that._addSelection(normalizedIndex) } for (var _i = 0; _i < removedItemKeys.length; _i++) { normalizedIndex = that._getIndexByKey(removedItemKeys[_i]); removedSelection.push(normalizedIndex); that._removeSelection(normalizedIndex) } that._editStrategy.endCache(); that._updateSelection(addedSelection, removedSelection) }(0, _deferred.when)(selectionChangePromise).done(function() { that._fireSelectionChangeEvent(args.addedItems, args.removedItems) }) } }, _fireSelectionChangeEvent: function(addedItems, removedItems) { this._createActionByOption("onSelectionChanged", { excludeValidators: ["disabled", "readOnly"] })({ addedItems: addedItems, removedItems: removedItems }) }, _updateSelection: _common.noop, _setAriaSelected: function($target, value) { this.setAria("selected", value, $target) }, _removeSelection: function(normalizedIndex) { var $itemElement = this._editStrategy.getItemElement(normalizedIndex); if (indexExists(normalizedIndex)) { this._processSelectableItem($itemElement, false); _events_engine2.default.triggerHandler($itemElement, "stateChanged", false) } }, _showDeprecatedSelectionMode: function() { _ui2.default.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 (indexExists(normalizedIndex)) { this._processSelectableItem($itemElement, true); _events_engine2.default.triggerHandler($itemElement, "stateChanged", true) } }, _isItemSelected: function(index) { var key = this._getKeyByIndex(index); return this._selection.isItemSelected(key) }, _optionChanged: function(args) { var _this2 = this; switch (args.name) { case "selectionMode": if ("multi" === args.value) { this._showDeprecatedSelectionMode() } else { this._invalidate() } break; case "dataSource": if (!args.value || Array.isArray(args.value) && !args.value.length) { this.option("selectedItemKeys", []) } this.callBase(args); break; case "selectedIndex": case "selectedItem": case "selectedItems": case "selectedItemKeys": this._syncSelectionOptions(args.name).done(function() { return _this2._normalizeSelectedItems() }); break; case "keyExpr": this._initKeyGetter(); break; case "selectionRequired": this._normalizeSelectedItems(); break; case "selectionByClick": case "onSelectionChanged": case "onItemDeleting": case "onItemDeleted": case "onItemReordered": case "maxFilterLengthInRequest": break; default: this.callBase(args) } }, _clearSelectedItems: function() { this._setOptionSilent("selectedItems", []); this._syncSelectionOptions("selectedItems") }, _waitDeletingPrepare: function($itemElement) { if ($itemElement.data(ITEM_DELETING_DATA_KEY)) { return (new _deferred.Deferred).resolve().promise() } $itemElement.data(ITEM_DELETING_DATA_KEY, true); var deferred = new _deferred.Deferred; var deletingActionArgs = { cancel: false }; var deletePromise = this._itemEventHandler($itemElement, "onItemDeleting", deletingActionArgs, { excludeValidators: ["disabled", "readOnly"] }); (0, _deferred.when)(deletePromise).always(function(value) { var deletePromiseExists = !deletePromise; var deletePromiseResolved = !deletePromiseExists && "resolved" === deletePromise.state(); var argumentsSpecified = !!arguments.length; var shouldDelete = deletePromiseExists || deletePromiseResolved && !argumentsSpecified || deletePromiseResolved && value; (0, _deferred.when)((0, _deferred.fromPromise)(deletingActionArgs.cancel)).always(function() { $itemElement.data(ITEM_DELETING_DATA_KEY, false) }).done(function(cancel) { shouldDelete && !cancel ? deferred.resolve() : deferred.reject() }).fail(deferred.reject) }.bind(this)); return deferred.promise() }, _deleteItemFromDS: function($item) { if (!this._dataSource) { return (new _deferred.Deferred).resolve().promise() } var deferred = new _deferred.Deferred; var disabledState = this.option("disabled"); var dataStore = this._dataSource.store(); this.option("disabled", true); if (!dataStore.remove) { throw _ui2.default.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(function() { this.option("disabled", disabledState) }.bind(this)); return deferred }, _tryRefreshLastPage: function() { var deferred = new _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(index) { var key = this._getKeyByIndex(index); this._selection.deselect([key]) }, _updateIndicesAfterIndex: function(index) { var itemElements = this._itemElements(); for (var i = index + 1; i < itemElements.length; i++) { (0, _renderer2.default)(itemElements[i]).data(this._itemIndexKey(), i - 1) } }, _simulateOptionChange: function(optionName) { var optionValue = this.option(optionName); if (optionValue instanceof _data_source.DataSource) { return } this._optionChangedAction({ name: optionName, fullName: optionName, value: optionValue }) }, isItemSelected: function(itemElement) { return this._isItemSelected(this._editStrategy.getNormalizedIndex(itemElement)) }, selectItem: function(itemElement) { if ("none" === this.option("selectionMode")) { return } var itemIndex = this._editStrategy.getNormalizedIndex(itemElement); if (!indexExists(itemIndex)) { return } var key = this._getKeyByIndex(itemIndex); if (this._selection.isItemSelected(key)) { return } if ("single" === this.option("selectionMode")) { this._selection.setSelection([key]) } else { var selectedItemKeys = this.option("selectedItemKeys") || []; this._selection.setSelection([].concat(_toConsumableArray(selectedItemKeys), [key])) } }, unselectItem: function(itemElement) { var itemIndex = this._editStrategy.getNormalizedIndex(itemElement); if (!indexExists(itemIndex)) { return } var selectedItemKeys = this._selection.getSelectedItemKeys(); if (this.option("selectionRequired") && selectedItemKeys.length <= 1) { return } var key = this._getKeyByIndex(itemIndex); if (!this._selection.isItemSelected(key)) { return } this._selection.deselect([key]) }, _deleteItemElementByIndex: function(index) { this._updateSelectionAfterDelete(index); this._updateIndicesAfterIndex(index); this._editStrategy.deleteItemAtIndex(index) }, _afterItemElementDeleted: function($item, deletedActionArgs) { var changingOption = this._dataSource ? "dataSource" : "items"; this._simulateOptionChange(changingOption); this._itemEventHandler($item, "onItemDeleted", deletedActionArgs, { beforeExecute: function() { $item.remove() }, excludeValidators: ["disabled", "readOnly"] }); this._renderEmptyMessage() }, deleteItem: function(itemElement) { var that = this; var deferred = new _deferred.Deferred; var $item = this._editStrategy.getItemElement(itemElement); var index = this._editStrategy.getNormalizedIndex(itemElement); var itemResponseWaitClass = this._itemResponseWaitClass(); if (indexExists(index)) { this._waitDeletingPrepare($item).done(function() { $item.addClass(itemResponseWaitClass); var deletedActionArgs = that._extendActionArgs($item); that._deleteItemFromDS($item).done(function() { that._deleteItemElementByIndex(index); that._afterItemElementDeleted($item, deletedActionArgs); 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 = new _deferred.Deferred; var that = this; var strategy = this._editStrategy; var $movingItem = strategy.getItemElement(itemElement); var $destinationItem = strategy.getItemElement(toItemElement); var movingIndex = strategy.getNormalizedIndex(itemElement); var destinationIndex = strategy.getNormalizedIndex(toItemElement); var changingOption = this._dataSource ? "dataSource" : "items"; var canMoveItems = indexExists(movingIndex) && indexExists(destinationIndex) && movingIndex !== destinationIndex; if (canMoveItems) { deferred.resolveWith(this) } else { deferred.rejectWith(this) } return deferred.promise().done(function() { $destinationItem[strategy.itemPlacementFunc(movingIndex, destinationIndex)]($movingItem); strategy.moveItemAtIndexToIndex(movingIndex, destinationIndex); this._updateIndicesAfterIndex(movingIndex); that.option("selectedItems", that._getItemsByKeys(that._selection.getSelectedItemKeys(), that._selection.getSelectedItems())); if ("items" === changingOption) { that._simulateOptionChange(changingOption) } that._itemEventHandler($movingItem, "onItemReordered", { fromIndex: strategy.getIndex(movingIndex), toIndex: strategy.getIndex(destinationIndex) }, { excludeValidators: ["disabled", "readOnly"] }) }) } }); module.exports = CollectionWidget }, /*!****************************************************************!*\ !*** ./artifacts/transpiled/core/utils/dependency_injector.js ***! \****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = function(object) { var extend = __webpack_require__( /*! ./extend */ 0).extend; var isFunction = __webpack_require__( /*! ./type */ 1).isFunction; var each = __webpack_require__( /*! ./iterator */ 3).each; var Class = __webpack_require__( /*! ../class */ 15); var BaseClass = Class.inherit(object); var InjectedClass = BaseClass; var instance = new InjectedClass(object); var 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 } }, /*!********************************!*\ !*** external "window.jQuery" ***! \********************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports) { module.exports = window.jQuery }, /*!*********************************************!*\ !*** ./artifacts/transpiled/events/drag.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var dataUtils = __webpack_require__( /*! ../core/element_data */ 39); var wrapToArray = __webpack_require__( /*! ../core/utils/array */ 14).wrapToArray; var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray; var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3); var contains = __webpack_require__( /*! ../core/utils/dom */ 12).contains; var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71); var eventUtils = __webpack_require__( /*! ./utils */ 8); var GestureEmitter = __webpack_require__( /*! ./gesture/emitter.gesture */ 158); var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95); var DRAG_START_EVENT = "dxdragstart"; var DRAG_EVENT = "dxdrag"; var DRAG_END_EVENT = "dxdragend"; var DRAG_ENTER_EVENT = "dxdragenter"; var DRAG_LEAVE_EVENT = "dxdragleave"; var DROP_EVENT = "dxdrop"; var DX_DRAG_EVENTS_COUNT_KEY = "dxDragEventsCount"; var knownDropTargets = []; var knownDropTargetSelectors = []; var knownDropTargetConfigs = []; var dropTargetRegistration = { setup: function(element, data) { var knownDropTarget = inArray(element, knownDropTargets) !== -1; if (!knownDropTarget) { knownDropTargets.push(element); knownDropTargetSelectors.push([]); knownDropTargetConfigs.push(data || {}) } }, add: function(element, handleObj) { var index = inArray(element, knownDropTargets); this.updateEventsCounter(element, handleObj.type, 1); var selector = handleObj.selector; if (inArray(selector, knownDropTargetSelectors[index]) === -1) { knownDropTargetSelectors[index].push(selector) } }, updateEventsCounter: function(element, event, value) { if ([DRAG_ENTER_EVENT, DRAG_LEAVE_EVENT, DROP_EVENT].indexOf(event) > -1) { var eventsCount = dataUtils.data(element, DX_DRAG_EVENTS_COUNT_KEY) || 0; dataUtils.data(element, DX_DRAG_EVENTS_COUNT_KEY, Math.max(0, eventsCount + value)) } }, remove: function(element, handleObj) { this.updateEventsCounter(element, handleObj.type, -1) }, teardown: function(element) { var handlersCount = dataUtils.data(element, DX_DRAG_EVENTS_COUNT_KEY); if (!handlersCount) { var index = inArray(element, knownDropTargets); knownDropTargets.splice(index, 1); knownDropTargetSelectors.splice(index, 1); knownDropTargetConfigs.splice(index, 1); dataUtils.removeData(element, DX_DRAG_EVENTS_COUNT_KEY) } } }; 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); var dropTargetSelectors = knownDropTargetSelectors[dropTargetIndex]; var $delegatedTargets = $element.find(dropTargetSelectors.join(", ")); if (inArray(void 0, dropTargetSelectors) !== -1) { $delegatedTargets = $delegatedTargets.add($element) } 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.get(0).getBoundingClientRect().width, height: $element.get(0).getBoundingClientRect().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 = iteratorUtils.map(dropTargets, function(element) { return $(element).get(0) }) }, _move: function(e) { var eventData = eventUtils.eventData(e); var dragOffset = this._calculateOffset(eventData); e = this._fireEvent(DRAG_EVENT, e, { offset: dragOffset }); this._processDropTargets(e); if (!e._cancelPreventDefault) { 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) { var target = this._findDropTarget(e); var 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 that = this; var result; iteratorUtils.each(knownDropTargets, function(_, target) { if (!that._checkDropTargetActive(target)) { return } var $target = $(target); iteratorUtils.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; iteratorUtils.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 }, /*!***************************************************************!*\ !*** ./artifacts/transpiled/ui/html_editor/quill_importer.js ***! \***************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getQuill = void 0; var _ui = __webpack_require__( /*! ../widget/ui.errors */ 17); var _ui2 = _interopRequireDefault(_ui); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var Quill; function getQuill() { if (!Quill) { Quill = requestQuill() } return Quill } function requestQuill() { var window = (0, _window.getWindow)(); var quill = window && window.Quill || __webpack_require__( /*! quill */ 317); if (!quill) { throw _ui2.default.Error("E1041", "Quill") } return quill } exports.getQuill = getQuill }, /*!*************************************************!*\ !*** ./artifacts/transpiled/core/utils/ajax.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Deferred = __webpack_require__( /*! ./deferred */ 6).Deferred; var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var httpRequest = __webpack_require__( /*! ../../core/http_request */ 439); var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7); var window = windowUtils.getWindow(); var extendFromObject = __webpack_require__( /*! ./extend */ 0).extendFromObject; var isDefined = __webpack_require__( /*! ./type */ 1).isDefined; var Promise = __webpack_require__( /*! ../polyfills/promise */ 76); var injector = __webpack_require__( /*! ./dependency_injector */ 54); var SUCCESS = "success"; var ERROR = "error"; var TIMEOUT = "timeout"; var NO_CONTENT = "nocontent"; var PARSER_ERROR = "parsererror"; var isStatusSuccess = function(status) { return 200 <= status && status < 300 }; var hasContent = function(status) { return 204 !== status }; var paramsConvert = function(params) { var result = []; for (var name in params) { var value = params[name]; if (void 0 === value) { continue } if (null === value) { value = "" } result.push(encodeURIComponent(name) + "=" + encodeURIComponent(value)) } return result.join("&") }; var createScript = function(options) { var script = domAdapter.createElement("script"); for (var name in options) { script[name] = options[name] } return script }; var removeScript = function(scriptNode) { scriptNode.parentNode.removeChild(scriptNode) }; var appendToHead = function(element) { return domAdapter.getHead().appendChild(element) }; var evalScript = function(code) { var script = createScript({ text: code }); appendToHead(script); removeScript(script) }; var evalCrossDomainScript = function(url) { var script = createScript({ src: url }); return new Promise(function(resolve, reject) { var events = { load: resolve, error: reject }; var loadHandler = function(e) { events[e.type](); removeScript(script) }; for (var event in events) { domAdapter.listen(script, event, loadHandler) } appendToHead(script) }) }; var getAcceptHeader = function(options) { var dataType = options.dataType || "*"; var scriptAccept = "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"; var accepts = { "*": "*/*", text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript", jsonp: scriptAccept, script: scriptAccept }; extendFromObject(accepts, options.accepts, true); return accepts[dataType] ? accepts[dataType] + ("*" !== dataType ? ", */*; q=0.01" : "") : accepts["*"] }; var getContentTypeHeader = function(options) { var defaultContentType; if (options.data && !options.upload && "GET" !== getMethod(options)) { defaultContentType = "application/x-www-form-urlencoded;charset=utf-8" } return options.contentType || defaultContentType }; var getDataFromResponse = function(xhr) { return xhr.responseType && "text" !== xhr.responseType || "string" !== typeof xhr.responseText ? xhr.response : xhr.responseText }; var postProcess = function(deferred, xhr, dataType) { var data = getDataFromResponse(xhr); switch (dataType) { case "jsonp": evalScript(data); break; case "script": evalScript(data); deferred.resolve(data, SUCCESS, xhr); break; case "json": try { deferred.resolve(JSON.parse(data), SUCCESS, xhr) } catch (e) { deferred.reject(xhr, PARSER_ERROR, e) } break; default: deferred.resolve(data, SUCCESS, xhr) } }; var isCrossDomain = function(url) { if (!windowUtils.hasWindow()) { return true } var crossDomain = false; var originAnchor = domAdapter.createElement("a"); var urlAnchor = domAdapter.createElement("a"); originAnchor.href = window.location.href; try { urlAnchor.href = url; urlAnchor.href = urlAnchor.href; crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host } catch (e) { crossDomain = true } return crossDomain }; var setHttpTimeout = function(timeout, xhr) { return timeout && setTimeout(function() { xhr.customStatus = TIMEOUT; xhr.abort() }, timeout) }; var getJsonpOptions = function(options) { if ("jsonp" === options.dataType) { var random = Math.random().toString().replace(/\D/g, ""); var callbackName = options.jsonpCallback || "dxCallback" + Date.now() + "_" + random; var callbackParameter = options.jsonp || "callback"; options.data = options.data || {}; options.data[callbackParameter] = callbackName; return callbackName } }; var getRequestOptions = function(options, headers) { var params = options.data; var paramsAlreadyString = "string" === typeof params; var url = options.url || window.location.href; if (!paramsAlreadyString && !options.cache) { params = params || {}; params._ = Date.now() } if (params && !options.upload) { if (!paramsAlreadyString) { params = paramsConvert(params) } if ("GET" === getMethod(options)) { if ("" !== params) { url += (url.indexOf("?") > -1 ? "&" : "?") + params } params = null } else { if (headers["Content-Type"] && headers["Content-Type"].indexOf("application/x-www-form-urlencoded") > -1) { params = params.replace(/%20/g, "+") } } } return { url: url, parameters: params } }; var getMethod = function(options) { return (options.method || "GET").toUpperCase() }; var getRequestHeaders = function(options) { var headers = options.headers || {}; headers["Content-Type"] = headers["Content-Type"] || getContentTypeHeader(options); headers.Accept = headers.Accept || getAcceptHeader(options); if (!options.crossDomain && !headers["X-Requested-With"]) { headers["X-Requested-With"] = "XMLHttpRequest" } return headers }; var sendRequest = function(options) { var xhr = httpRequest.getXhr(); var d = new Deferred; var result = d.promise(); var async = isDefined(options.async) ? options.async : true; var dataType = options.dataType; var timeout = options.timeout || 0; var timeoutId; options.crossDomain = isCrossDomain(options.url); var needScriptEvaluation = "jsonp" === dataType || "script" === dataType; if (void 0 === options.cache) { options.cache = !needScriptEvaluation } var callbackName = getJsonpOptions(options); var headers = getRequestHeaders(options); var requestOptions = getRequestOptions(options, headers); var url = requestOptions.url; var parameters = requestOptions.parameters; if (callbackName) { window[callbackName] = function(data) { d.resolve(data, SUCCESS, xhr) } } if (options.crossDomain && needScriptEvaluation) { var reject = function() { d.reject(xhr, ERROR) }; var resolve = function() { if ("jsonp" === dataType) { return } d.resolve(null, SUCCESS, xhr) }; evalCrossDomainScript(url).then(resolve, reject); return result } if (options.crossDomain && !("withCredentials" in xhr)) { d.reject(xhr, ERROR); return result } xhr.open(getMethod(options), url, async, options.username, options.password); if (async) { xhr.timeout = timeout; timeoutId = setHttpTimeout(timeout, xhr, d) } xhr.onreadystatechange = function(e) { if (4 === xhr.readyState) { clearTimeout(timeoutId); if (isStatusSuccess(xhr.status)) { if (hasContent(xhr.status)) { postProcess(d, xhr, dataType) } else { d.resolve(null, NO_CONTENT, xhr) } } else { d.reject(xhr, xhr.customStatus || ERROR) } } }; if (options.upload) { xhr.upload.onprogress = options.upload.onprogress; xhr.upload.onloadstart = options.upload.onloadstart; xhr.upload.onabort = options.upload.onabort } if (options.xhrFields) { for (var field in options.xhrFields) { xhr[field] = options.xhrFields[field] } } if ("arraybuffer" === options.responseType) { xhr.responseType = options.responseType } for (var name in headers) { if (Object.prototype.hasOwnProperty.call(headers, name) && isDefined(headers[name])) { xhr.setRequestHeader(name, headers[name]) } } if (options.beforeSend) { options.beforeSend(xhr) } xhr.send(parameters); result.abort = function() { xhr.abort() }; return result }; module.exports = injector({ sendRequest: sendRequest }) }, /*!********************************************!*\ !*** ./artifacts/transpiled/ui/overlay.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./overlay/ui.overlay */ 464) }, /*!*************************************************!*\ !*** ./artifacts/transpiled/core/utils/icon.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var ICON_CLASS = "dx-icon"; var SVG_ICON_CLASS = "dx-svg-icon"; var getImageSourceType = function(source) { if (!source || "string" !== typeof source) { return false } if (/^\s*]*>(.|\r?\n)*?<\/svg>\s*$/i.test(source)) { return "svg" } if (/data:.*base64|\.|[^<\s]\//.test(source)) { return "image" } if (/^[\w-_]+$/.test(source)) { return "dxIcon" } if (/^\s?([\w-_]\s?)+$/.test(source)) { return "fontIcon" } return false }; var getImageContainer = function(source) { switch (getImageSourceType(source)) { case "image": return (0, _renderer2.default)("").attr("src", source).addClass(ICON_CLASS); case "fontIcon": return (0, _renderer2.default)("").addClass("".concat(ICON_CLASS, " ").concat(source)); case "dxIcon": return (0, _renderer2.default)("").addClass("".concat(ICON_CLASS, " ").concat(ICON_CLASS, "-").concat(source)); case "svg": return (0, _renderer2.default)("").addClass("".concat(ICON_CLASS, " ").concat(SVG_ICON_CLASS)).append(source); default: return null } }; exports.getImageSourceType = getImageSourceType; exports.getImageContainer = getImageContainer }, /*!****************************************************!*\ !*** ./artifacts/transpiled/core/utils/version.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { exports.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); var yItem = parseInt(y[i] || 0, 10); if (xItem < yItem) { return -1 } if (xItem > yItem) { return 1 } } return 0 } }, /*!****************************!*\ !*** external "window.ko" ***! \****************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports) { module.exports = window.ko }, /*!******************************************************!*\ !*** ./artifacts/transpiled/core/utils/call_once.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var callOnce = function(handler) { var result; var _wrappedHandler = function() { result = handler.apply(this, arguments); _wrappedHandler = function() { return result }; return result }; return function() { return _wrappedHandler.apply(this, arguments) } }; module.exports = callOnce }, /*!***********************************************!*\ !*** ./artifacts/transpiled/format_helper.js ***! \***********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var typeUtils = __webpack_require__( /*! ./core/utils/type */ 1); var dateUtils = __webpack_require__( /*! ./core/utils/date */ 22); var numberLocalization = __webpack_require__( /*! ./localization/number */ 51); var dateLocalization = __webpack_require__( /*! ./localization/date */ 32); var dependencyInjector = __webpack_require__( /*! ./core/utils/dependency_injector */ 54); __webpack_require__( /*! ./localization/currency */ 152); module.exports = dependencyInjector({ format: function(value, _format) { var formatIsValid = typeUtils.isString(_format) && "" !== _format || typeUtils.isPlainObject(_format) || typeUtils.isFunction(_format); var valueIsValid = typeUtils.isNumeric(value) || typeUtils.isDate(value); if (!formatIsValid || !valueIsValid) { return typeUtils.isDefined(value) ? value.toString() : "" } if (typeUtils.isFunction(_format)) { return _format(value) } if (typeUtils.isString(_format)) { _format = { type: _format } } if (typeUtils.isNumeric(value)) { return numberLocalization.format(value, _format) } if (typeUtils.isDate(value)) { return dateLocalization.format(value, _format) } }, getTimeFormat: function(showSecond) { return showSecond ? "longtime" : "shorttime" }, _normalizeFormat: function(format) { if (!Array.isArray(format)) { return format } if (1 === format.length) { return format[0] } return function(date) { return format.map(function(formatPart) { return dateLocalization.format(date, formatPart) }).join(" ") } }, getDateFormatByDifferences: function(dateDifferences, intervalFormat) { var resultFormat = []; var needSpecialSecondFormatter = intervalFormat && dateDifferences.millisecond && !(dateDifferences.year || dateDifferences.month || dateDifferences.day); if (needSpecialSecondFormatter) { var secondFormatter = function(date) { return date.getSeconds() + date.getMilliseconds() / 1e3 + "s" }; resultFormat.push(secondFormatter) } else { if (dateDifferences.millisecond) { resultFormat.push("millisecond") } } if (dateDifferences.hour || dateDifferences.minute || !needSpecialSecondFormatter && dateDifferences.second) { resultFormat.unshift(this.getTimeFormat(dateDifferences.second)) } if (dateDifferences.year && dateDifferences.month && dateDifferences.day) { if (intervalFormat && "month" === intervalFormat) { return "monthandyear" } else { resultFormat.unshift("shortdate"); return this._normalizeFormat(resultFormat) } } if (dateDifferences.year && dateDifferences.month) { return "monthandyear" } if (dateDifferences.year && dateDifferences.quarter) { return "quarterandyear" } if (dateDifferences.year) { return "year" } if (dateDifferences.quarter) { return "quarter" } if (dateDifferences.month && dateDifferences.day) { if (intervalFormat) { var monthDayFormatter = function(date) { return dateLocalization.getMonthNames("abbreviated")[date.getMonth()] + " " + dateLocalization.format(date, "day") }; resultFormat.unshift(monthDayFormatter) } else { resultFormat.unshift("monthandday") } return this._normalizeFormat(resultFormat) } if (dateDifferences.month) { return "month" } if (dateDifferences.day) { if (intervalFormat) { resultFormat.unshift("day") } else { var dayFormatter = function(date) { return dateLocalization.format(date, "dayofweek") + ", " + dateLocalization.format(date, "day") }; resultFormat.unshift(dayFormatter) } return this._normalizeFormat(resultFormat) } return this._normalizeFormat(resultFormat) }, getDateFormatByTicks: function(ticks) { var maxDiff; if (ticks.length > 1) { maxDiff = dateUtils.getDatesDifferences(ticks[0], ticks[1]); for (var i = 1; i < ticks.length - 1; i++) { var currentDiff = dateUtils.getDatesDifferences(ticks[i], ticks[i + 1]); if (maxDiff.count < currentDiff.count) { maxDiff = currentDiff } } } else { maxDiff = { year: true, month: true, day: true, hour: ticks[0].getHours() > 0, minute: ticks[0].getMinutes() > 0, second: ticks[0].getSeconds() > 0, millisecond: ticks[0].getMilliseconds() > 0 } } var resultFormat = this.getDateFormatByDifferences(maxDiff); return resultFormat }, getDateFormatByTickInterval: function(startValue, endValue, tickInterval) { var dateUnitInterval; var dateDifferencesConverter = { week: "day" }; var 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 } }; var 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 = typeUtils.isString(tickInterval) ? tickInterval.toLowerCase() : tickInterval; var 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; var resultFormat = this.getDateFormatByDifferences(dateDifferences); return resultFormat } }) }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/ui/widget/bindable_template.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var removeEvent = __webpack_require__( /*! ../../core/remove_event */ 132); var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3); var isPrimitive = __webpack_require__( /*! ../../core/utils/type */ 1).isPrimitive; var watchChanges = function() { var start = function(rawData, watchMethod, fields, fieldsMap, callback) { var fieldsDispose; var globalDispose = globalWatch(rawData, watchMethod, function(dataWithRawFields) { fieldsDispose && fieldsDispose(); if (isPrimitive(dataWithRawFields)) { callback(dataWithRawFields); return } fieldsDispose = fieldsWatch(dataWithRawFields, watchMethod, fields, fieldsMap, function(data) { callback(data) }) }); return function() { fieldsDispose && fieldsDispose(); globalDispose && globalDispose() } }; var globalWatch = function(data, watchMethod, callback) { return watchMethod(function() { return data }, callback) }; var fieldsWatch = function(data, watchMethod, fields, fieldsMap, callback) { var resolvedData = {}; var missedFields = fields.slice(); var watchHandlers = iteratorUtils.map(fields, function(name) { var fieldGetter = fieldsMap[name]; return watchMethod(fieldGetter ? function() { return fieldGetter(data) } : function() { return data[name] }, function(value) { resolvedData[name] = value; if (missedFields.length) { var index = missedFields.indexOf(name); if (index >= 0) { missedFields.splice(index, 1) } } if (!missedFields.length) { callback(resolvedData) } }) }); return function() { iteratorUtils.each(watchHandlers, function(_, dispose) { dispose() }) } }; return start }(); module.exports = TemplateBase.inherit({ ctor: function(render, fields, watchMethod, fieldsMap) { this._render = render; this._fields = fields; this._fieldsMap = fieldsMap || {}; this._watchMethod = watchMethod }, _renderCore: function(options) { var $container = $(options.container); var dispose = watchChanges(options.model, this._watchMethod, this._fields, this._fieldsMap, function(data) { $container.empty(); this._render($container, data, options.model) }.bind(this)); eventsEngine.on($container, removeEvent, dispose); return $container.contents() } }) }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/ui/widget/selectors.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var _focusable = function(element, tabIndex) { if (!visible(element)) { return false } var nodeName = element.nodeName.toLowerCase(); var isTabIndexNotNaN = !isNaN(tabIndex); var isDisabled = element.disabled; var isDefaultFocus = /^(input|select|textarea|button|object|iframe)$/.test(nodeName); var isHyperlink = "a" === nodeName; var isFocusable = true; var isContentEditable = element.isContentEditable; if (isDefaultFocus || isContentEditable) { isFocusable = !isDisabled } else { if (isHyperlink) { isFocusable = element.href || isTabIndexNotNaN } else { isFocusable = isTabIndexNotNaN } } return isFocusable }; var visible = function(element) { var $element = $(element); return $element.is(":visible") && "hidden" !== $element.css("visibility") && "hidden" !== $element.parents().css("visibility") }; module.exports = { focusable: function(index, element) { return _focusable(element, $(element).attr("tabIndex")) }, tabbable: function(index, element) { var tabIndex = $(element).attr("tabIndex"); return (isNaN(tabIndex) || tabIndex >= 0) && _focusable(element, tabIndex) }, focused: function($element) { var element = $($element).get(0); return domAdapter.getActiveElement() === element } } }, /*!****************************************************!*\ !*** ./artifacts/transpiled/core/dom_component.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _window = __webpack_require__( /*! ../core/utils/window */ 7); var _window2 = _interopRequireDefault(_window); var _extend = __webpack_require__( /*! ./utils/extend */ 0); var _config = __webpack_require__( /*! ./config */ 31); var _config2 = _interopRequireDefault(_config); var _errors = __webpack_require__( /*! ./errors */ 21); var _errors2 = _interopRequireDefault(_errors); var _dom = __webpack_require__( /*! ../core/utils/dom */ 12); var _resize_callbacks = __webpack_require__( /*! ../core/utils/resize_callbacks */ 130); var _resize_callbacks2 = _interopRequireDefault(_resize_callbacks); var _common = __webpack_require__( /*! ./utils/common */ 4); var _common2 = _interopRequireDefault(_common); var _iterator = __webpack_require__( /*! ./utils/iterator */ 3); var _type = __webpack_require__( /*! ./utils/type */ 1); var _array = __webpack_require__( /*! ./utils/array */ 14); var _public_component = __webpack_require__( /*! ./utils/public_component */ 131); var _public_component2 = _interopRequireDefault(_public_component); var _element_data = __webpack_require__( /*! ./element_data */ 39); var _element_data2 = _interopRequireDefault(_element_data); var _component = __webpack_require__( /*! ./component */ 133); var _component2 = _interopRequireDefault(_component); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var abstract = _component2.default.abstract; var RTL_DIRECTION_CLASS = "dx-rtl"; var VISIBILITY_CHANGE_CLASS = "dx-visibility-change-handler"; var VISIBILITY_CHANGE_EVENTNAMESPACE = "VisibilityChange"; var DOMComponent = _component2.default.inherit({ _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { width: void 0, height: void 0, rtlEnabled: (0, _config2.default)().rtlEnabled, elementAttr: {}, disabled: false, integrationOptions: {} }) }, ctor: function(element, options) { this._$element = (0, _renderer2.default)(element); _public_component2.default.attachInstanceToElement(this._$element, this, this._dispose); this.callBase(options) }, _getSynchronizableOptionsForCreateComponent: function() { return ["rtlEnabled", "disabled", "templatesRenderAsynchronously"] }, _visibilityChanged: abstract, _dimensionChanged: abstract, _init: function() { this.callBase(); this._attachWindowResizeCallback() }, _setOptionsByDevice: function(instanceCustomRules) { this.callBase([].concat(this.constructor._classCustomRules || [], instanceCustomRules || [])) }, _isInitialOptionValue: function(name) { var isCustomOption = this.constructor._classCustomRules && Object.prototype.hasOwnProperty.call(this._convertRulesToOptions(this.constructor._classCustomRules), name); return !isCustomOption && this.callBase(name) }, _attachWindowResizeCallback: function() { if (this._isDimensionChangeSupported()) { var windowResizeCallBack = this._windowResizeCallBack = this._dimensionChanged.bind(this); _resize_callbacks2.default.add(windowResizeCallBack) } }, _isDimensionChangeSupported: function() { return this._dimensionChanged !== abstract }, _renderComponent: function() { this._initMarkup(); if (_window2.default.hasWindow()) { this._render() } }, _initMarkup: function() { this._renderElementAttributes(); this._toggleRTLDirection(this.option("rtlEnabled")); this._renderVisibilityChange(); this._renderDimensions() }, _render: function() { this._attachVisibilityChangeHandlers() }, _renderElementAttributes: function() { var attributes = (0, _extend.extend)({}, this.option("elementAttr")); var classNames = attributes.class; delete attributes.class; this.$element().attr(attributes).addClass(classNames) }, _renderVisibilityChange: function() { if (this._isDimensionChangeSupported()) { this._attachDimensionChangeHandlers() } if (!this._isVisibilityChangeSupported()) { return } this.$element().addClass(VISIBILITY_CHANGE_CLASS) }, _renderDimensions: function() { var $element = this.$element(); var element = $element.get(0); var width = this._getOptionValue("width", element); var height = this._getOptionValue("height", element); if (this._isCssUpdateRequired(element, height, width)) { $element.css({ width: null === width ? "" : width, height: null === height ? "" : height }) } }, _isCssUpdateRequired: function(element, height, width) { return !!((0, _type.isDefined)(width) || (0, _type.isDefined)(height) || element.style.width || element.style.height) }, _attachDimensionChangeHandlers: function() { var that = this; var resizeEventName = "dxresize." + this.NAME + VISIBILITY_CHANGE_EVENTNAMESPACE; _events_engine2.default.off(that.$element(), resizeEventName); _events_engine2.default.on(that.$element(), resizeEventName, function() { that._dimensionChanged() }) }, _attachVisibilityChangeHandlers: function() { if (!this._isVisibilityChangeSupported()) { return } var that = this; var hidingEventName = "dxhiding." + this.NAME + VISIBILITY_CHANGE_EVENTNAMESPACE; var shownEventName = "dxshown." + this.NAME + VISIBILITY_CHANGE_EVENTNAMESPACE; that._isHidden = !that._isVisible(); _events_engine2.default.off(that.$element(), hidingEventName); _events_engine2.default.on(that.$element(), hidingEventName, function() { that._checkVisibilityChanged("hiding") }); _events_engine2.default.off(that.$element(), shownEventName); _events_engine2.default.on(that.$element(), 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 && _window2.default.hasWindow() }, _clean: _common2.default.noop, _modelByElement: function() { var modelByElement = this.option("modelByElement") || _common2.default.noop; return modelByElement(this.$element()) }, _invalidate: function() { if (!this._updateLockCount) { throw _errors2.default.Error("E0007") } this._requireRefresh = true }, _refresh: function() { this._clean(); this._renderComponent() }, _dispose: function() { this.callBase(); this._clean(); this._detachWindowResizeCallback() }, _detachWindowResizeCallback: function() { if (this._isDimensionChangeSupported()) { _resize_callbacks2.default.remove(this._windowResizeCallBack) } }, _toggleRTLDirection: function(rtl) { this.$element().toggleClass(RTL_DIRECTION_CLASS, rtl) }, _createComponent: function(element, component, config) { var _this = this; var that = this; config = config || {}; var synchronizableOptions = _common2.default.grep(this._getSynchronizableOptionsForCreateComponent(), function(value) { return !(value in config) }); var nestedComponentOptions = that.option("nestedComponentOptions") || _common2.default.noop; var nestedComponentConfig = (0, _extend.extend)({ integrationOptions: this.option("integrationOptions") }, nestedComponentOptions(this)); synchronizableOptions.forEach(function(optionName) { nestedComponentConfig[optionName] = _this.option(optionName) }); that._extendConfig(config, nestedComponentConfig); var instance; if ((0, _type.isString)(component)) { var $element = (0, _renderer2.default)(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 ((0, _array.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) { (0, _iterator.each)(extendConfig, function(key, value) { config[key] = Object.prototype.hasOwnProperty.call(config, key) ? config[key] : value }) }, _defaultActionConfig: function() { return (0, _extend.extend)(this.callBase(), { context: this._modelByElement(this.$element()) }) }, _defaultActionArgs: function() { var model = this._modelByElement(this.$element()); return (0, _extend.extend)(this.callBase(), { element: this.element(), model: model }) }, _optionChanged: function(args) { switch (args.name) { case "width": case "height": this._renderDimensions(); break; case "rtlEnabled": this._invalidate(); break; case "elementAttr": this._renderElementAttributes(); break; case "disabled": case "integrationOptions": break; default: this.callBase(args) } }, _removeAttributes: function(element) { var i = element.attributes.length - 1; for (; i >= 0; i--) { var attribute = element.attributes[i]; if (!attribute) { return } var attributeName = attribute.name; if (0 === attributeName.indexOf("aria-") || attributeName.indexOf("dx-") !== -1 || "role" === attributeName || "style" === attributeName || "tabindex" === attributeName) { element.removeAttribute(attributeName) } } }, _removeClasses: function(element) { var classes = element.className.split(" ").filter(function(cssClass) { return 0 !== cssClass.lastIndexOf("dx-", 0) }); element.className = classes.join(" ") }, endUpdate: function() { var requireRender = !this._initializing && !this._initialized; this.callBase.apply(this, arguments); if (!this._updateLockCount) { if (requireRender) { this._renderComponent() } else { if (this._requireRefresh) { this._requireRefresh = false; this._refresh() } } } }, $element: function() { return this._$element }, element: function() { return (0, _dom.getPublicElement)(this.$element()) }, dispose: function() { var element = this.$element().get(0); _element_data2.default.cleanDataRecursive(element, true); element.textContent = ""; this._removeAttributes(element); this._removeClasses(element) } }); DOMComponent.getInstance = function(element) { return _public_component2.default.getInstanceByElement((0, _renderer2.default)(element), this) }; DOMComponent.defaultOptions = function(rule) { this._classCustomRules = this._classCustomRules || []; this._classCustomRules.push(rule) }; module.exports = DOMComponent }, /*!**************************************************!*\ !*** ./artifacts/transpiled/data/array_store.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _utils = __webpack_require__( /*! ./utils */ 41); var _query = __webpack_require__( /*! ./query */ 42); var _query2 = _interopRequireDefault(_query); var _errors = __webpack_require__( /*! ./errors */ 36); var _abstract_store = __webpack_require__( /*! ./abstract_store */ 98); var _abstract_store2 = _interopRequireDefault(_abstract_store); var _array_utils = __webpack_require__( /*! ./array_utils */ 135); var _array_utils2 = _interopRequireDefault(_array_utils); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var ArrayStore = _abstract_store2.default.inherit({ ctor: function(options) { if (Array.isArray(options)) { options = { data: options } } else { options = options || {} } this.callBase(options); var initialArray = options.data; if (initialArray && !Array.isArray(initialArray)) { throw _errors.errors.Error("E4006") } this._array = initialArray || [] }, createQuery: function() { return (0, _query2.default)(this._array, { errorHandler: this._errorHandler }) }, _byKeyImpl: function(key) { var index = _array_utils2.default.indexByKey(this, this._array, key); if (index === -1) { return (0, _utils.rejectedPromise)(_errors.errors.Error("E4009")) } return (0, _utils.trivialPromise)(this._array[index]) }, _insertImpl: function(values) { return _array_utils2.default.insert(this, this._array, values) }, _pushImpl: function(changes) { _array_utils2.default.applyBatch(this, this._array, changes) }, _updateImpl: function(key, values) { return _array_utils2.default.update(this, this._array, key, values) }, _removeImpl: function(key) { return _array_utils2.default.remove(this, this._array, key) }, clear: function() { this.fireEvent("modifying"); this._array = []; this.fireEvent("modified") } }, "array"); module.exports = ArrayStore }, /*!************************************************************!*\ !*** ./artifacts/transpiled/ui/widget/utils.ink_ripple.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var INKRIPPLE_CLASS = "dx-inkripple"; var INKRIPPLE_WAVE_CLASS = "dx-inkripple-wave"; var INKRIPPLE_SHOWING_CLASS = "dx-inkripple-showing"; var INKRIPPLE_HIDING_CLASS = "dx-inkripple-hiding"; var DEFAULT_WAVE_SIZE_COEFFICIENT = 2; var MAX_WAVE_SIZE = 4e3; var ANIMATION_DURATION = 300; var HOLD_ANIMATION_DURATION = 1e3; var 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: showWave.bind(this, config), hideWave: hideWave.bind(this, 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); var result = inkRipple.children("." + INKRIPPLE_WAVE_CLASS).toArray(); 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 element = config.element; var elementWidth = element.outerWidth(); var elementHeight = element.outerHeight(); var elementDiagonal = parseInt(Math.sqrt(elementWidth * elementWidth + elementHeight * elementHeight)); var waveSize = Math.min(MAX_WAVE_SIZE, parseInt(elementDiagonal * args.waveSizeCoefficient)); var left; var top; if (args.isCentered) { left = (elementWidth - waveSize) / 2; top = (elementHeight - waveSize) / 2 } else { var event = config.event; var position = config.element.offset(); var x = event.pageX - position.left; var 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)); args.showingTimeout = setTimeout(showingWaveHandler.bind(this, args, $wave), 0) }; var showingWaveHandler = function(args, $wave) { var durationCss = args.durations.showingScale + "ms"; $wave.addClass(INKRIPPLE_SHOWING_CLASS).css("transitionDuration", 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("transitionDuration", "") }; var hideWave = function(args, config) { args.showingTimeout && clearTimeout(args.showingTimeout); var $wave = getWaves(config.element, config.wavesNumber).eq(config.wave || DEFAULT_WAVE_INDEX); var durations = args.durations; var durationCss = durations.hidingScale + "ms, " + durations.hidingOpacity + "ms"; $wave.addClass(INKRIPPLE_HIDING_CLASS).removeClass(INKRIPPLE_SHOWING_CLASS).css("transitionDuration", durationCss); var animationDuration = Math.max(durations.hidingScale, durations.hidingOpacity); args.hidingTimeout = setTimeout(hideSelectedWave.bind(this, $wave), animationDuration) }; module.exports = { render: render } }, /*!************************************************************!*\ !*** ./artifacts/transpiled/viz/tree_map/tree_map.base.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _common = __webpack_require__( /*! ./common */ 251); var _node = __webpack_require__( /*! ./node */ 166); var _node2 = _interopRequireDefault(_node); var _tiling = __webpack_require__( /*! ./tiling */ 120); var _colorizing = __webpack_require__( /*! ./colorizing */ 121); var _utils = __webpack_require__( /*! ../core/utils */ 10); var _common2 = __webpack_require__( /*! ../../core/utils/common */ 4); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _extend2 = __webpack_require__( /*! ../../core/utils/extend */ 0); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var _max = Math.max; var directions = { lefttoprightbottom: [1, 1], leftbottomrighttop: [1, -1], righttopleftbottom: [-1, 1], rightbottomlefttop: [-1, -1] }; __webpack_require__( /*! ./tiling.squarified */ 419); __webpack_require__( /*! ./tiling */ 120).setDefaultAlgorithm("squarified"); __webpack_require__( /*! ./colorizing.discrete */ 421); __webpack_require__( /*! ./colorizing */ 121).setDefaultColorizer("discrete"); function pickPositiveInteger(val) { return val > 0 ? Math.round(val) : 0 } var dxTreeMap = __webpack_require__( /*! ../core/base_widget */ 96).inherit({ _handlers: { beginBuildNodes: _common2.noop, buildNode: _common2.noop, endBuildNodes: _common2.noop, setTrackerData: _common2.noop, calculateState: function(options) { return (0, _common.buildRectAppearance)(options) } }, _rootClass: "dxtm-tree-map", _rootClassPrefix: "dxtm", _getDefaultSize: function() { return { width: 400, height: 400 } }, _setDeprecatedOptions: function() { this.callBase.apply(this, arguments); (0, _extend2.extend)(this._deprecatedOptions, { resolveLabelOverflow: { since: "19.1", message: "Use the 'tile.label.overflow' and 'group.label.textOverflow' option instead" } }) }, _themeSection: "treeMap", _fontFields: ["tile.label.font", "group.label.font"], _init: function() { var that = this; that._rectOffsets = {}; that._handlers = Object.create(that._handlers); 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: _common.buildTextAppearance }; that._root = that._topNode = { nodes: [] }; that.callBase.apply(that, arguments) }, _initialChanges: ["DATA_SOURCE"], _initCore: function() { var that = this; var renderer = that._renderer; that._createProxyType(); that._tilesGroup = renderer.g().linkOn(renderer.root, "tiles").linkAppend(); that._labelsGroup = renderer.g().linkOn(renderer.root, "labels").linkAppend() }, _createProxyType: _common2.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", resolveLabelOverflow: "LABEL_OVERFLOW" }, _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", "LABEL_OVERFLOW"], _change_DATA_SOURCE: function() { this._changeDataSource() }, _change_TILE_SETTINGS: function() { this._changeTileSettings() }, _change_GROUP_SETTINGS: function() { this._changeGroupSettings() }, _change_LABEL_OVERFLOW: function() { this._changeTileSettings(); 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 that = this; var root = that._root = that._topNode = new _node2.default; 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(); var processedData = that._processDataSourceItems(that._dataSourceItems() || []); 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: _common2.noop, _processDataSourceItems: function(items) { return { items: items, isPlain: false } }, _changeTileSettings: function() { var that = this; var options = that._getOption("tile"); var offsets = that._rectOffsets; var borderWidth = pickPositiveInteger(options.border.width); var edgeOffset = borderWidth / 2; var innerOffset = 1 & borderWidth ? .5 : 0; var labelOptions = options.label; var 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.id); if (offsets.tileEdge !== edgeOffset || offsets.tileInner !== innerOffset) { offsets.tileEdge = edgeOffset; offsets.tileInner = innerOffset; that._change(["TILING"]) } }, _changeGroupSettings: function() { var that = this; var options = that._getOption("group"); var labelOptions = options.label; var offsets = that._rectOffsets; var borderWidth = pickPositiveInteger(options.border.width); var edgeOffset = borderWidth / 2; var innerOffset = 1 & borderWidth ? .5 : 0; var headerHeight = 0; var groupPadding = pickPositiveInteger(options.padding); var 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); var paddingLeftRight = pickPositiveInteger(options.paddingLeftRight); var paddingTopBottom = pickPositiveInteger(options.paddingTopBottom); var tileLabelOptions = this._getOption("tile.label"); var groupLabelOptions = this._getOption("group.label"); settings.labelState = (0, _common.buildTextAppearance)(options, filter); settings.labelState.visible = !("visible" in options) || !!options.visible; this._suppressDeprecatedWarnings(); settings.labelParams = { height: bBox.height, rtlEnabled: this._getOption("rtlEnabled", true), paddingTopBottom: paddingTopBottom, paddingLeftRight: paddingLeftRight, resolveLabelOverflow: this._getOption("resolveLabelOverflow", true), tileLabelWordWrap: tileLabelOptions.wordWrap, tileLabelOverflow: tileLabelOptions.textOverflow, groupLabelOverflow: groupLabelOptions.textOverflow }; this._resumeDeprecatedWarnings() }, _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; var colorizer = (0, _colorizing.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; var context = { algorithm: (0, _tiling.getAlgorithm)(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: _common2.noop, _performLabelsLayout: function() { this._processNodes(null, processLabelsLayout) }, _getTextBBox: function(fontOptions) { var renderer = this._renderer; var text = this._textForCalculations || renderer.text("0", 0, 0); this._textForCalculations = text; text.css((0, _utils.patchFontOptions)(fontOptions)).append(renderer.root); var bBox = text.getBBox(); text.remove(); return bBox } }); function traverseDataItems(root, dataItems, level, params) { var nodes = []; var allNodes = params.nodes; var i; var ii = dataItems.length; var totalValue = 0; for (i = 0; i < ii; ++i) { var dataItem = dataItems[i]; var node = new _node2.default; 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); var 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 nodes = root.nodes; var i; var ii = nodes.length; for (i = 0; i < ii; ++i) { var 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); var 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) } } var emptyRect = [0, 0, 0, 0]; function calculateRects(context, root) { var nodes = root.nodes; var items = []; var rects = []; var sum = 0; var i; var 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 rect = node.parent.rects[node.index]; var rectOffsets = context.rectOffsets; if (node.isNode()) { setRectAttrs(node.tile.outer, buildTileRect(rect, node.parent.innerRect, rectOffsets.headerEdge, rectOffsets.headerInner)); rect = marginateRect(rect, context.groupPadding); var 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; var text = node.text; var bBox = text.getBBox(); var paddingLeftRight = params.paddingLeftRight; var paddingTopBottom = params.paddingTopBottom; var effectiveWidth = rect[2] - rect[0] - 2 * paddingLeftRight; var fitByHeight = bBox.height + paddingTopBottom <= rect[3] - rect[1]; var fitByWidth = bBox.width <= effectiveWidth; var resolveLabelOverflow = params.resolveLabelOverflow; var groupLabelOverflow = params.groupLabelOverflow; var tileLabelOverflow = params.tileLabelOverflow; var tileLabelWordWrap = params.tileLabelWordWrap; if ((0, _type.isDefined)(resolveLabelOverflow)) { if ("ellipsis" === resolveLabelOverflow && fitByHeight) { text.setMaxSize(effectiveWidth, void 0, { wordWrap: "none", textOverflow: "ellipsis" }); if (!fitByWidth) { bBox = text.getBBox(); fitByWidth = bBox.width <= effectiveWidth } } } else { fitByWidth = true; fitByHeight = true; text.setMaxSize(effectiveWidth, rect[3] - rect[1] - paddingTopBottom, node.isNode() ? { textOverflow: groupLabelOverflow, wordWrap: "none" } : { textOverflow: tileLabelOverflow, wordWrap: tileLabelWordWrap, hideOverflowEllipsis: true }) } text.attr({ visibility: fitByHeight && fitByWidth ? "visible" : "hidden" }); if (fitByHeight && fitByWidth) { text.move(params.rtlEnabled ? rect[2] - paddingLeftRight - bBox.x - bBox.width : rect[0] + paddingLeftRight - bBox.x, rect[1] + paddingTopBottom - bBox.y) } } __webpack_require__( /*! ../../core/component_registrator */ 9)("dxTreeMap", dxTreeMap); module.exports = dxTreeMap; dxTreeMap.addPlugin(__webpack_require__( /*! ../core/data_source */ 144).plugin) }, /*!***************************************************************!*\ !*** ./artifacts/transpiled/events/core/event_registrator.js ***! \***************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var callbacks = __webpack_require__( /*! ./event_registrator_callbacks */ 122); 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 = [].slice.call(arguments); args.unshift(this); return eventObject[methodName].apply(eventObject, args) } }); callbacks.fire(name, strategy) }; registerEvent.callbacks = callbacks; module.exports = registerEvent }, /*!***********************************!*\ !*** external "window.Globalize" ***! \***********************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports) { module.exports = window.Globalize }, /*!****************************************************!*\ !*** ./artifacts/transpiled/core/utils/console.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var isFunction = __webpack_require__( /*! ./type */ 1).isFunction; var noop = function() {}; var getConsoleMethod = function(method) { if ("undefined" === typeof console || !isFunction(console[method])) { return noop } return console[method].bind(console) }; var logger = { info: getConsoleMethod("info"), warn: getConsoleMethod("warn"), error: getConsoleMethod("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 }, /*!************************************************************!*\ !*** ./artifacts/transpiled/ui/widget/ui.template_base.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26); var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12); var Class = __webpack_require__( /*! ../../core/class */ 15); var abstract = Class.abstract; var renderedCallbacks = Callbacks({ syncStrategy: true }); var TemplateBase = Class.inherit({ render: function(options) { options = options || {}; var onRendered = options.onRendered; delete options.onRendered; var $result = this._renderCore(options); this._ensureResultInContainer($result, options.container); renderedCallbacks.fire($result, options.container); onRendered && onRendered(); return $result }, _ensureResultInContainer: function($result, container) { if (!container) { return } var $container = $(container); var resultInContainer = domUtils.contains($container.get(0), $result.get(0)); $container.append($result); if (resultInContainer) { return } var resultInBody = domAdapter.getBody().contains($container.get(0)); if (!resultInBody) { return } domUtils.triggerShownEvent($result) }, _renderCore: abstract }); module.exports = TemplateBase; module.exports.renderedCallbacks = renderedCallbacks }, /*!*******************************************************************!*\ !*** ./artifacts/transpiled/ui/pivot_grid/ui.pivot_grid.utils.js ***! \*******************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58); var _data = __webpack_require__( /*! ../../core/utils/data */ 20); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _date = __webpack_require__( /*! ../../localization/date */ 32); var _format_helper = __webpack_require__( /*! ../../format_helper */ 64); var _data_source = __webpack_require__( /*! ../../data/data_source/data_source */ 45); var _array_store = __webpack_require__( /*! ../../data/array_store */ 68); var _array_store2 = _interopRequireDefault(_array_store); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var setFieldProperty = exports.setFieldProperty = function(field, property, value, isInitialization) { var initProperties = field._initProperties = field._initProperties || {}; var initValue = isInitialization ? value : field[property]; if (!Object.prototype.hasOwnProperty.call(initProperties, property) || isInitialization) { initProperties[property] = initValue } field[property] = value }; exports.sendRequest = function(options) { return (0, _ajax.sendRequest)(options) }; var foreachTreeAsyncDate = new Date; function createForeachTreeFunc(isAsync) { var foreachTreeFunc = function foreachTreeFunc(items, callback, parentAtFirst, members, index, isChildrenProcessing) { members = members || []; items = items || []; var i; var deferred; index = index || 0; function createForeachTreeAsyncHandler(deferred, i, isChildrenProcessing) { (0, _deferred.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 = new _deferred.Deferred; setTimeout(createForeachTreeAsyncHandler(deferred, i, false), 0); return deferred } var item = items[i]; if (!isChildrenProcessing) { members.unshift(item); if (parentAtFirst && false === callback(members, i)) { return } if (item.children) { var childrenDeferred = foreachTreeFunc(item.children, callback, parentAtFirst, members); if (isAsync && childrenDeferred) { deferred = new _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) { if (fields && (0, _type.isDefined)(id)) { for (var i = 0; i < fields.length; i++) { var 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: (0, _format_helper.format)(value, options.format) || "" }; return options.customizeText ? options.customizeText.call(options, formatObject) : formatObject.valueText }; exports.getCompareFunction = function(valueSelector) { return function(a, b) { var result = 0; var valueA = valueSelector(a); var valueB = valueSelector(b); var aIsDefined = (0, _type.isDefined)(valueA); var bIsDefined = (0, _type.isDefined)(valueB); if (aIsDefined && bIsDefined) { if (valueA > valueB) { result = 1 } else { if (valueA < valueB) { result = -1 } } } if (aIsDefined && !bIsDefined) { result = 1 } if (!aIsDefined && bIsDefined) { result = -1 } return result } }; exports.createPath = function(items) { var result = []; for (var 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) { index = index || 0; childrenField = childrenField || "children"; if (data.length) { callback(data, index) } for (var i = 0; i < data.length; i++) { var item = data[i]; if (item[childrenField] && item[childrenField].length) { foreachDataLevel(item[childrenField], callback, index + 1, childrenField) } } }; exports.mergeArraysByMaxValue = function(values1, values2) { var result = []; for (var i = 0; i < values1.length; i++) { result.push(Math.max(values1[i] || 0, values2[i] || 0)) } return result }; exports.getExpandedLevel = function(options, axisName) { var dimensions = options[axisName]; var expandLevel = 0; var expandedPaths = ("columns" === axisName ? options.columnExpandedPaths : options.rowExpandedPaths) || []; if (options.headerName === axisName) { expandLevel = options.path.length } else { if (options.headerName && options.headerName !== axisName && options.oppositePath) { expandLevel = options.oppositePath.length } else { (0, _iterator.each)(expandedPaths, function(_, path) { expandLevel = Math.max(expandLevel, path.length) }) } } while (dimensions[expandLevel + 1] && dimensions[expandLevel].expanded) { expandLevel++ } return expandLevel }; function createGroupFields(item) { return (0, _iterator.map)(["year", "quarter", "month"], function(value, index) { return (0, _extend.extend)({}, item, { groupInterval: value, groupIndex: index }) }) } function parseFields(dataSource, fieldsList, path, fieldsDataType) { var result = []; (0, _iterator.each)(fieldsList || [], function(field, value) { if (field && 0 === field.indexOf("__")) { return } var dataIndex = 1; var currentPath = path.length ? path + "." + field : field; var dataType = fieldsDataType[currentPath]; var getter = (0, _data.compileGetter)(currentPath); var items; while (!(0, _type.isDefined)(value) && dataSource[dataIndex]) { value = getter(dataSource[dataIndex]); dataIndex++ } if (!dataType && (0, _type.isDefined)(value)) { dataType = (0, _type.type)(value) } items = [{ dataField: currentPath, dataType: dataType, groupName: "date" === dataType ? field : void 0, groupInterval: void 0, displayFolder: path }]; if ("date" === dataType) { items = items.concat(createGroupFields(items[0])) } else { if ("object" === dataType) { items = parseFields(dataSource, value, currentPath, fieldsDataType) } } result.push.apply(result, items) }); return result } exports.discoverObjectFields = function(items, fields) { var fieldsDataType = exports.getFieldsDataType(fields); return parseFields(items, items[0], "", fieldsDataType) }; exports.getFieldsDataType = function(fields) { var result = {}; (0, _iterator.each)(fields, function(_, field) { result[field.dataField] = result[field.dataField] || field.dataType }); return result }; var DATE_INTERVAL_FORMATS = { month: function(value) { return (0, _date.getMonthNames)()[value - 1] }, quarter: function(value) { return (0, _date.format)(new Date(2e3, 3 * value - 1), "quarter") }, dayOfWeek: function(value) { return (0, _date.getDayNames)()[value] } }; exports.setDefaultFieldValueFormatting = function(field) { if ("date" === field.dataType) { if (!field.format) { setFieldProperty(field, "format", DATE_INTERVAL_FORMATS[field.groupInterval]) } } else { if ("number" === field.dataType) { var groupInterval = (0, _type.isNumeric)(field.groupInterval) && field.groupInterval > 0 && field.groupInterval; if (groupInterval && !field.customizeText) { setFieldProperty(field, "customizeText", function(formatObject) { var secondValue = formatObject.value + groupInterval; var secondValueText = (0, _format_helper.format)(secondValue, field.format); return formatObject.valueText && secondValueText ? formatObject.valueText + " - " + secondValueText : "" }) } } } }; exports.getFiltersByPath = function(fields, path) { var result = []; path = path || []; for (var i = 0; i < path.length; i++) { result.push((0, _extend.extend)({}, fields[i], { groupIndex: null, groupName: null, filterType: "include", filterValues: [path[i]] })) } return result }; exports.storeDrillDownMixin = { createDrillDownDataSource: function(descriptions, params) { var arrayStore; function createCustomStoreMethod(methodName) { return function(options) { var d; if (arrayStore) { d = arrayStore[methodName](options) } else { d = new _deferred.Deferred; (0, _deferred.when)(items).done(function(data) { var arrayStore = new _array_store2.default(data); arrayStore[methodName](options).done(d.resolve).fail(d.reject) }).fail(d.reject) } return d } } var items = this.getDrillDownItems(descriptions, params); var dataSource = new _data_source.DataSource({ load: createCustomStoreMethod("load"), totalCount: createCustomStoreMethod("totalCount"), key: this.key() }); return dataSource } }; exports.capitalizeFirstLetter = function(string) { return string.charAt(0).toUpperCase() + string.slice(1) } }, /*!********************************************************!*\ !*** ./artifacts/transpiled/core/polyfills/promise.js ***! \********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6); var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7); var Deferred = deferredUtils.Deferred; var when = deferredUtils.when; var promise = windowUtils.hasWindow() ? windowUtils.getWindow().Promise : Promise; if (!promise) { promise = function(resolver) { var d = new Deferred; resolver(d.resolve.bind(this), d.reject.bind(this)); return d.promise() }; promise.resolve = function(val) { return (new Deferred).resolve(val).promise() }; promise.reject = function(val) { return (new Deferred).reject(val).promise() }; promise.all = function(promises) { return when.apply(this, promises).then(function() { return [].slice.call(arguments) }) } } module.exports = promise }, /*!****************************************************!*\ !*** ./artifacts/transpiled/animation/position.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4); var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each; var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7); var window = windowUtils.getWindow(); var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11); var isWindow = __webpack_require__( /*! ../core/utils/type */ 1).isWindow; var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var browser = __webpack_require__( /*! ../core/utils/browser */ 25); var translator = __webpack_require__( /*! ./translator */ 27); var support = __webpack_require__( /*! ../core/utils/support */ 43); var horzRe = /left|right/; var vertRe = /top|bottom/; var collisionRe = /fit|flip|none/; var IS_SAFARI = browser.safari; 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 commonUtils.pairToObject(raw) }; var normalizeCollision = function(raw) { var pair = commonUtils.splitPair(raw); var h = String(pair && pair[0]).toLowerCase(); var 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 collisionResolvers = { 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) { data.oversize = 0 } }; var scrollbarWidth; var calculateScrollbarWidth = function() { var $scrollDiv = $("
").css({ width: 100, height: 100, overflow: "scroll", position: "absolute", top: -9999 }).appendTo($("body")); var 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); var currentOffset = $what.offset(); var result = extend(true, {}, defaultPositionResult, { h: { location: currentOffset.left }, v: { location: currentOffset.top } }); if (!options) { return result } var my = normalizeAlign(options.my); var at = normalizeAlign(options.at); var of = $(options.of).length && options.of || window; var offset = normalizeOffset(options.offset); var collision = normalizeCollision(options.collision); var boundary = options.boundary; var 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 [0].innerWidth >= of [0].outerWidth ? of [0].innerWidth : of.width(); v.atSize = of [0].innerHeight >= of [0].outerHeight || IS_SAFARI ? of [0].innerHeight : 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); var windowWidth = win.width(); var windowHeight = win.height(); var left = win.scrollLeft(); var top = win.scrollTop(); var documentElement = domAdapter.getDocumentElement(); var hZoomLevel = support.touch ? documentElement.clientWidth / windowWidth : 1; var vZoomLevel = support.touch ? documentElement.clientHeight / windowHeight : 1; if (void 0 === scrollbarWidth) { calculateScrollbarWidth() } var boundaryWidth = windowWidth; var boundaryHeight = windowHeight; if (boundary) { var $boundary = $(boundary); var 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 (collisionResolvers[h.collision]) { collisionResolvers[h.collision](h, bounds.h) } if (collisionResolvers[v.collision]) { collisionResolvers[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, true); var offset = $what.offset(); var 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 }; var offset = function(element) { element = $(element).get(0); if (isWindow(element)) { return null } else { if (element && "pageY" in element && "pageX" in element) { return { top: element.pageY, left: element.pageX } } } return $(element).offset() }; if (!position.inverseAlign) { position.inverseAlign = inverseAlign } if (!position.normalizeAlign) { position.normalizeAlign = normalizeAlign } module.exports = { calculateScrollbarWidth: calculateScrollbarWidth, calculate: calculatePosition, setup: position, offset: offset } }, /*!******************************************************!*\ !*** ./artifacts/transpiled/core/utils/view_port.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../renderer */ 2); var readyCallbacks = __webpack_require__( /*! ./ready_callbacks */ 48); var ready = readyCallbacks.add; var changeCallback = __webpack_require__( /*! ./callbacks */ 26)(); var $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) } }(); ready(function() { value(".dx-viewport") }); exports.value = value; exports.changeCallback = changeCallback; exports.originalViewPort = function() { return $originalViewPort } }, /*!*****************************************************************!*\ !*** ./artifacts/transpiled/exporter/excel/excel.tag_helper.js ***! \*****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var tagHelper = { toXml: function(tagName, attributes, content) { var result = ["<", tagName]; for (var attributeName in attributes) { var attributeValue = attributes[attributeName]; if ((0, _type.isDefined)(attributeValue)) { result.push(" ", attributeName, '="', attributeValue, '"') } } if ((0, _type.isDefined)(content) && "" !== content) { result.push(">", content, "") } else { result.push(" />") } return result.join("") } }; exports.default = tagHelper }, /*!***************************************************************!*\ !*** ./artifacts/transpiled/integration/jquery/use_jquery.js ***! \***************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var jQuery = __webpack_require__( /*! jquery */ 55); var config = __webpack_require__( /*! ../../core/config */ 31); var useJQuery = config().useJQuery; if (jQuery && false !== useJQuery) { config({ useJQuery: true }) } module.exports = function() { return jQuery && config().useJQuery } }, /*!***************************************************!*\ !*** ./artifacts/transpiled/data/store_helper.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var grep = __webpack_require__( /*! ../core/utils/common */ 4).grep; var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each; var arrayQuery = __webpack_require__( /*! ./array_query */ 155); var normalizeSortingInfo = __webpack_require__( /*! ./utils */ 41).normalizeSortingInfo; function multiLevelGroup(query, groupInfo) { query = query.groupBy(groupInfo[0].selector); if (groupInfo.length > 1) { query = query.select(function(g) { return extend({}, g, { items: multiLevelGroup(arrayQuery(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) } function queryByOptions(query, options, isCountQuery) { options = options || {}; var filter = options.filter; if (filter) { query = query.filter(filter) } if (isCountQuery) { return query } var sort = options.sort; var select = options.select; var group = options.group; var skip = options.skip; var take = options.take; if (group) { group = normalizeSortingInfo(group); group.keepInitialKeyOrder = !!options.group.keepInitialKeyOrder } if (sort || group) { sort = normalizeSortingInfo(sort || []); if (group && !group.keepInitialKeyOrder) { sort = arrangeSortingInfo(group, sort) } each(sort, function(index) { query = query[index ? "thenBy" : "sortBy"](this.selector, this.desc, this.compare) }) } if (select) { query = query.select(select) } if (group) { query = multiLevelGroup(query, group) } if (take || skip) { query = query.slice(skip || 0, take) } return query } module.exports = { multiLevelGroup: multiLevelGroup, arrangeSortingInfo: arrangeSortingInfo, queryByOptions: queryByOptions } }, /*!***************************************************!*\ !*** ./artifacts/transpiled/core/events_mixin.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var DefaultEventsStrategy = __webpack_require__( /*! ./events_strategy */ 445); var each = __webpack_require__( /*! ./utils/iterator */ 3).each; var isPlainObject = __webpack_require__( /*! ./utils/type */ 1).isPlainObject; module.exports = { ctor: function() { this._events = {}; this.setEventsStrategy(new DefaultEventsStrategy(this)) }, setEventsStrategy: function(strategy) { if ("function" === typeof strategy) { strategy = strategy(this) } this._eventsStrategy = strategy }, hasEvent: function(eventName) { return this._eventsStrategy.hasEvent(eventName) }, fireEvent: function(eventName, eventArgs) { this._eventsStrategy.fireEvent(eventName, eventArgs); return this }, on: function(eventName, eventHandler) { if (isPlainObject(eventName)) { each(eventName, function(e, h) { this.on(e, h) }.bind(this)) } else { this._eventsStrategy.on(eventName, eventHandler) } return this }, off: function(eventName, eventHandler) { this._eventsStrategy.off(eventName, eventHandler); return this }, _disposeEvents: function() { this._eventsStrategy.dispose() } } }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/ui/widget/function_template.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74); var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12); var FunctionTemplate = TemplateBase.inherit({ ctor: function(render) { this._render = render }, _renderCore: function(options) { return domUtils.normalizeTemplateElement(this._render(options)) } }); module.exports = FunctionTemplate }, /*!*********************************************!*\ !*** ./artifacts/transpiled/data_helper.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var DataSource = __webpack_require__( /*! ./data/data_source/data_source */ 45).DataSource; var extend = __webpack_require__( /*! ./core/utils/extend */ 0).extend; var normalizeDataSourceOptions = __webpack_require__( /*! ./data/data_source/data_source */ 45).normalizeDataSourceOptions; var DATA_SOURCE_OPTIONS_METHOD = "_dataSourceOptions"; var DATA_SOURCE_CHANGED_METHOD = "_dataSourceChangedHandler"; var DATA_SOURCE_LOAD_ERROR_METHOD = "_dataSourceLoadErrorHandler"; var DATA_SOURCE_LOADING_CHANGED_METHOD = "_dataSourceLoadingChangedHandler"; var DATA_SOURCE_FROM_URL_LOAD_MODE_METHOD = "_dataSourceFromUrlLoadMode"; var SPECIFIC_DATA_SOURCE_OPTION = "_getSpecificDataSourceOption"; var DataHelperMixin = { postCtor: function() { this.on("disposing", function() { this._disposeDataSource() }.bind(this)) }, _refreshDataSource: function() { this._initDataSource(); this._loadDataSource() }, _initDataSource: function() { var dataSourceOptions = SPECIFIC_DATA_SOURCE_OPTION in this ? this[SPECIFIC_DATA_SOURCE_OPTION]() : this.option("dataSource"); var widgetDataSourceOptions; var dataSourceType; 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; dataSourceOptions = normalizeDataSourceOptions(dataSourceOptions, { fromUrlLoadMode: DATA_SOURCE_FROM_URL_LOAD_MODE_METHOD in this && this[DATA_SOURCE_FROM_URL_LOAD_MODE_METHOD]() }); this._dataSource = new dataSourceType(extend(true, {}, widgetDataSourceOptions, 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", function(isLoading) { this._ready && this._ready(!isLoading) }.bind(this)) }, _addDataSourceChangeHandler: function() { var dataSource = this._dataSource; this._proxiedDataSourceChangedHandler = function(e) { this[DATA_SOURCE_CHANGED_METHOD](dataSource.items(), e) }.bind(this); dataSource.on("changed", this._proxiedDataSourceChangedHandler) }, _addDataSourceLoadErrorHandler: function() { this._proxiedDataSourceLoadErrorHandler = this[DATA_SOURCE_LOAD_ERROR_METHOD].bind(this); this._dataSource.on("loadError", this._proxiedDataSourceLoadErrorHandler) }, _addDataSourceLoadingChangedHandler: function() { this._proxiedDataSourceLoadingChangedHandler = this[DATA_SOURCE_LOADING_CHANGED_METHOD].bind(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 } }, getDataSource: function() { return this._dataSource || null } }; module.exports = DataHelperMixin }, /*!**************************************************!*\ !*** ./artifacts/transpiled/core/utils/style.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var camelize = __webpack_require__( /*! ./inflector */ 33).camelize; var callOnce = __webpack_require__( /*! ./call_once */ 63); var typeUtils = __webpack_require__( /*! ./type */ 1); var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11); var jsPrefixes = ["", "Webkit", "Moz", "O", "Ms"]; var cssPrefixes = { "": "", Webkit: "-webkit-", Moz: "-moz-", O: "-o-", ms: "-ms-" }; var getStyles = callOnce(function() { return domAdapter.createElement("dx").style }); 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(name) { if (name in getStyles()) { return name } var originalName = name; name = name.charAt(0).toUpperCase() + name.substr(1); for (var i = 1; i < jsPrefixes.length; i++) { var prefixedProp = jsPrefixes[i].toLowerCase() + name; if (prefixedProp in getStyles()) { return prefixedProp } } return originalName }; var stylePropPrefix = function(prop) { return forEachPrefixes(prop, function(specific, jsPrefix) { if (specific in getStyles()) { return cssPrefixes[jsPrefix] } }) }; var pxExceptions = ["fillOpacity", "columnCount", "flexGrow", "flexShrink", "fontWeight", "lineHeight", "opacity", "zIndex", "zoom"]; var normalizeStyleProp = function(prop, value) { if (typeUtils.isNumeric(value) && pxExceptions.indexOf(prop) === -1) { value += "px" } return value }; var setDimensionProperty = function(elements, propertyName, value) { if (elements) { value = typeUtils.isNumeric(value) ? value += "px" : value; for (var i = 0; i < elements.length; ++i) { elements[i].style[propertyName] = value } } }; var setWidth = function(elements, value) { setDimensionProperty(elements, "width", value) }; var setHeight = function(elements, value) { setDimensionProperty(elements, "height", value) }; exports.styleProp = styleProp; exports.stylePropPrefix = stylePropPrefix; exports.normalizeStyleProp = normalizeStyleProp; exports.setWidth = setWidth; exports.setHeight = setHeight }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/core/utils/variable_wrapper.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var logger = __webpack_require__( /*! ./console */ 73).logger; var dependencyInjector = __webpack_require__( /*! ./dependency_injector */ 54); module.exports = dependencyInjector({ isWrapped: function() { return false }, isWritableWrapped: function() { return false }, wrap: function(value) { return value }, unwrap: function(value) { return value }, assign: function() { logger.error("Method 'assign' should not be used for not wrapped variables. Use 'isWrapped' method for ensuring.") } }) }, /*!***************************************************!*\ !*** ./artifacts/transpiled/localization/core.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 54); module.exports = dependencyInjector({ locale: function() { var currentLocale = "en"; return function(locale) { if (!locale) { return currentLocale } currentLocale = locale } }() }) }, /*!*********************************************!*\ !*** ./artifacts/transpiled/events/hold.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var eventUtils = __webpack_require__( /*! ./utils */ 8); var Emitter = __webpack_require__( /*! ./core/emitter */ 123); var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95); var abs = Math.abs; var HOLD_EVENT_NAME = "dxhold"; var HOLD_TIMEOUT = 750; var 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(function() { this._requestAccept(e); this._fireEvent(HOLD_EVENT_NAME, e, { target: e.target }); this._forgetAccept() }.bind(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() }, dispose: function() { this._stopTimer() } }); registerEmitter({ emitter: HoldEmitter, bubble: true, events: [HOLD_EVENT_NAME] }); module.exports = { name: HOLD_EVENT_NAME } }, /*!*********************************************!*\ !*** ./artifacts/transpiled/ui/text_box.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./text_box/text_box */ 499) }, /*!***************************************************!*\ !*** ./artifacts/transpiled/ui/load_indicator.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7); var navigator = windowUtils.getNavigator(); var support = __webpack_require__( /*! ../core/utils/support */ 43); var themes = __webpack_require__( /*! ./themes */ 30); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var devices = __webpack_require__( /*! ../core/devices */ 16); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var Widget = __webpack_require__( /*! ./widget/ui.widget */ 18); var LOADINDICATOR_CLASS = "dx-loadindicator"; var LOADINDICATOR_WRAPPER_CLASS = "dx-loadindicator-wrapper"; var LOADINDICATOR_CONTENT_CLASS = "dx-loadindicator-content"; var LOADINDICATOR_ICON_CLASS = "dx-loadindicator-icon"; var LOADINDICATOR_SEGMENT_CLASS = "dx-loadindicator-segment"; var LOADINDICATOR_SEGMENT_INNER_CLASS = "dx-loadindicator-segment-inner"; var 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 = themes.current(); return this.callBase().concat([{ device: function() { var realDevice = devices.real(); var obsoleteAndroid = "android" === realDevice.platform && !/chrome/i.test(navigator.userAgent); return obsoleteAndroid }, options: { viaImage: true } }, { device: function() { return themes.isIos7(themeName) }, options: { _animatingSegmentCount: 11 } }, { device: function() { return themes.isMaterial(themeName) }, options: { _animatingSegmentCount: 2, _animatingSegmentInner: true } }, { device: function() { return themes.isGeneric(themeName) }, options: { _animatingSegmentCount: 7 } }]) }, _init: function() { this.callBase(); this.$element().addClass(LOADINDICATOR_CLASS) }, _initMarkup: function() { this.callBase(); this._renderWrapper(); this._renderIndicatorContent(); this._renderMarkup() }, _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("backgroundImage", "url(" + indicatorSrc + ")") } }, _renderDimensions: function() { this.callBase(); this._updateContentSizeForAnimation() }, _updateContentSizeForAnimation: function() { if (!this._$indicator) { return } var width = this.option("width"); var 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, fontSize: 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("backgroundImage", "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 }, /*!**************************************************************!*\ !*** ./artifacts/transpiled/ui/scroll_view/ui.scrollable.js ***! \**************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _support = __webpack_require__( /*! ../../core/utils/support */ 43); var _support2 = _interopRequireDefault(_support); var _browser = __webpack_require__( /*! ../../core/utils/browser */ 25); var _browser2 = _interopRequireDefault(_browser); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _common2 = _interopRequireDefault(_common); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _type2 = _interopRequireDefault(_type); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _dom = __webpack_require__( /*! ../../core/utils/dom */ 12); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); var _window2 = _interopRequireDefault(_window); var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); var _devices = __webpack_require__( /*! ../../core/devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _component_registrator = __webpack_require__( /*! ../../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _dom_component = __webpack_require__( /*! ../../core/dom_component */ 67); var _dom_component2 = _interopRequireDefault(_dom_component); var _selectors = __webpack_require__( /*! ../widget/selectors */ 66); var _selectors2 = _interopRequireDefault(_selectors); var _utils = __webpack_require__( /*! ../../events/utils */ 8); var _utils2 = _interopRequireDefault(_utils); var _uiEventsEmitterGesture = __webpack_require__( /*! ./ui.events.emitter.gesture.scroll */ 218); var _uiEventsEmitterGesture2 = _interopRequireDefault(_uiEventsEmitterGesture); var _uiScrollable = __webpack_require__( /*! ./ui.scrollable.simulated */ 300); var _uiScrollable2 = _interopRequireDefault(_uiScrollable); var _uiScrollable3 = __webpack_require__( /*! ./ui.scrollable.native */ 185); var _uiScrollable4 = _interopRequireDefault(_uiScrollable3); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var SCROLLABLE = "dxScrollable"; var SCROLLABLE_STRATEGY = "dxScrollableStrategy"; var SCROLLABLE_CLASS = "dx-scrollable"; var SCROLLABLE_DISABLED_CLASS = "dx-scrollable-disabled"; var SCROLLABLE_CONTAINER_CLASS = "dx-scrollable-container"; var SCROLLABLE_WRAPPER_CLASS = "dx-scrollable-wrapper"; var SCROLLABLE_CONTENT_CLASS = "dx-scrollable-content"; var SCROLLABLE_CUSTOMIZABLE_SCROLLBARS_CLASS = "dx-scrollable-customizable-scrollbars"; var VERTICAL = "vertical"; var HORIZONTAL = "horizontal"; var BOTH = "both"; var deviceDependentOptions = function() { return [{ device: function() { return !_support2.default.nativeScrolling }, options: { useNative: false } }, { device: function(_device) { return !_devices2.default.isSimulator() && "generic" === _devices2.default.real().platform && "generic" === _device.platform }, options: { bounceEnabled: false, scrollByThumb: true, scrollByContent: _support2.default.touch, showScrollbar: "onHover" } }] }; var Scrollable = _dom_component2.default.inherit({ _getDefaultOptions: function() { return (0, _extend.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() { return _support2.default.nativeScrolling && "android" === _devices2.default.real().platform && !_browser2.default.mozilla }, options: { useSimulatedScrollbar: true } }, { device: function() { return "ios" === _devices2.default.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._initScrollableMarkup(); this._locked = false }, _visibilityChanged: function(visible) { if (visible) { this.update(); this._updateRtlPosition(); this._savedScrollOffset && this.scrollTo(this._savedScrollOffset); delete this._savedScrollOffset } else { this._savedScrollOffset = this.scrollOffset() } }, _initScrollableMarkup: function() { var $element = this.$element().addClass(SCROLLABLE_CLASS); var $container = this._$container = (0, _renderer2.default)("
").addClass(SCROLLABLE_CONTAINER_CLASS); var $wrapper = this._$wrapper = (0, _renderer2.default)("
").addClass(SCROLLABLE_WRAPPER_CLASS); var $content = this._$content = (0, _renderer2.default)("
").addClass(SCROLLABLE_CONTENT_CLASS); if (_dom_adapter2.default.hasDocumentProperty("onbeforeactivate") && _browser2.default.msie && _browser2.default.version < 12) { _events_engine2.default.on($element, _utils2.default.addNamespace("beforeactivate", SCROLLABLE), function(e) { if (!(0, _renderer2.default)(e.target).is(_selectors2.default.focusable)) { e.preventDefault() } }) } $content.append($element.contents()).appendTo($container); $container.appendTo($wrapper); $wrapper.appendTo($element) }, _dimensionChanged: function() { this.update() }, _attachNativeScrollbarsCustomizationCss: function() { if ("desktop" === _devices2.default.real().deviceType && !(_window2.default.getNavigator().platform.indexOf("Mac") > -1 && _browser2.default.webkit)) { this.$element().addClass(SCROLLABLE_CUSTOMIZABLE_SCROLLBARS_CLASS) } }, _initMarkup: function() { this.callBase(); this._renderDirection() }, _render: function() { this._renderStrategy(); this._attachNativeScrollbarsCustomizationCss(); this._attachEventHandlers(); this._renderDisabledState(); this._createActions(); this.update(); this.callBase(); this._updateRtlPosition() }, _updateRtlPosition: function() { var _this = this; this._updateBounds(); if (this.option("rtlEnabled") && this.option("direction") !== VERTICAL) { _common2.default.deferUpdate(function() { var containerElement = _this._container().get(0); var maxLeftOffset = containerElement.scrollWidth - containerElement.clientWidth; _common2.default.deferRender(function() { _this.scrollTo({ left: maxLeftOffset }) }) }) } }, _updateBounds: function() { this._strategy.updateBounds() }, _attachEventHandlers: function() { var strategy = this._strategy; var initEventData = { getDirection: strategy.getDirection.bind(strategy), validate: this._validate.bind(this), isNative: this.option("useNative"), scrollTarget: this._$container }; _events_engine2.default.off(this._$wrapper, "." + SCROLLABLE); _events_engine2.default.on(this._$wrapper, _utils2.default.addNamespace(_uiEventsEmitterGesture2.default.init, SCROLLABLE), initEventData, this._initHandler.bind(this)); _events_engine2.default.on(this._$wrapper, _utils2.default.addNamespace(_uiEventsEmitterGesture2.default.start, SCROLLABLE), strategy.handleStart.bind(strategy)); _events_engine2.default.on(this._$wrapper, _utils2.default.addNamespace(_uiEventsEmitterGesture2.default.move, SCROLLABLE), strategy.handleMove.bind(strategy)); _events_engine2.default.on(this._$wrapper, _utils2.default.addNamespace(_uiEventsEmitterGesture2.default.end, SCROLLABLE), strategy.handleEnd.bind(strategy)); _events_engine2.default.on(this._$wrapper, _utils2.default.addNamespace(_uiEventsEmitterGesture2.default.cancel, SCROLLABLE), strategy.handleCancel.bind(strategy)); _events_engine2.default.on(this._$wrapper, _utils2.default.addNamespace(_uiEventsEmitterGesture2.default.stop, SCROLLABLE), strategy.handleStop.bind(strategy)); _events_engine2.default.off(this._$container, "." + SCROLLABLE); _events_engine2.default.on(this._$container, _utils2.default.addNamespace("scroll", SCROLLABLE), strategy.handleScroll.bind(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 _uiScrollable4.default(this) : new _uiScrollable2.default.SimulatedStrategy(this) }, _createActions: function() { this._strategy && this._strategy.createActions() }, _clean: function() { this._strategy && 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 "scrollByContent": case "scrollByThumb": case "bounceEnabled": case "useKeyboard": case "showScrollbar": case "useSimulatedScrollbar": case "pushBackValue": this._invalidate(); break; case "disabled": this._renderDisabledState(); this._strategy && this._strategy.disabledChanged(); break; case "updateManually": break; case "width": this.callBase(args); this._updateRtlPosition(); break; default: this.callBase(args) } }, _resetInactiveDirection: function() { var inactiveProp = this._getInactiveProp(); if (!inactiveProp || !_window2.default.hasWindow()) { 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 (_type2.default.isPlainObject(location)) { var left = _common2.default.ensureDefined(location.left, location.x); var top = _common2.default.ensureDefined(location.top, location.y); return { left: _type2.default.isDefined(left) ? -left : void 0, top: _type2.default.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 }, content: function() { return (0, _dom.getPublicElement)(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._strategy.verticalOffset() }, clientWidth: function() { return this._$container.width() }, scrollWidth: function() { return this.$content().outerWidth() }, update: function() { if (!this._strategy) { return } return (0, _deferred.when)(this._strategy.update()).done(function() { this._updateAllowedDirection() }.bind(this)) }, 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(); if (!this.option("useNative")) { targetLocation = this._strategy._applyScaleRatio(targetLocation); location = this._strategy._applyScaleRatio(location) } var distance = this._normalizeLocation({ left: location.left - _common2.default.ensureDefined(targetLocation.left, location.left), top: location.top - _common2.default.ensureDefined(targetLocation.top, location.top) }); if (!distance.top && !distance.left) { return } this._strategy.scrollBy(distance) }, scrollToElement: function(element, offset) { offset = offset || {}; var $element = (0, _renderer2.default)(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._strategy.verticalOffset() : 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() } } }); (0, _component_registrator2.default)(SCROLLABLE, Scrollable); module.exports = Scrollable; module.exports.deviceDependentOptions = deviceDependentOptions }, /*!***********************************************!*\ !*** ./artifacts/transpiled/ui/select_box.js ***! \***********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4); var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1); var isDefined = typeUtils.isDefined; var isPromise = typeUtils.isPromise; var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray; var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each; var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6); var getPublicElement = __webpack_require__( /*! ../core/utils/dom */ 12).getPublicElement; var Deferred = deferredUtils.Deferred; var errors = __webpack_require__( /*! ../core/errors */ 21); var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11); var inkRipple = __webpack_require__( /*! ./widget/utils.ink_ripple */ 69); var messageLocalization = __webpack_require__( /*! ../localization/message */ 13); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var DropDownList = __webpack_require__( /*! ./drop_down_editor/ui.drop_down_list */ 216); var DISABLED_STATE_SELECTOR = ".dx-state-disabled"; var SELECTBOX_CLASS = "dx-selectbox"; var SELECTBOX_POPUP_CLASS = "dx-selectbox-popup"; var SELECTBOX_CONTAINER_CLASS = "dx-selectbox-container"; var SELECTBOX_POPUP_WRAPPER_CLASS = "dx-selectbox-popup-wrapper"; var SelectBox = DropDownList.inherit({ _supportedKeys: function() { var that = this; var parent = this.callBase(); var 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() { if (this.option("opened") && "instantly" === this.option("applyValueMode")) { this._cleanInputSelection() } if (this._wasSearch()) { this._clearFilter() } parent.tab && parent.tab.apply(this, arguments) }, upArrow: function() { if (parent.upArrow && parent.upArrow.apply(this, arguments)) { if (!this.option("opened")) { this._setNextValue(-1) } return true } }, downArrow: function() { if (parent.downArrow && parent.downArrow.apply(this, arguments)) { if (!this.option("opened")) { this._setNextValue(1) } return true } }, leftArrow: function() { searchIfNeeded(); parent.leftArrow && parent.leftArrow.apply(this, arguments) }, rightArrow: function() { searchIfNeeded(); parent.rightArrow && parent.rightArrow.apply(this, arguments) }, home: function() { searchIfNeeded(); parent.home && parent.home.apply(this, arguments) }, end: function() { searchIfNeeded(); parent.end && parent.end.apply(this, arguments) }, escape: function() { var result = parent.escape && parent.escape.apply(this, arguments); this._cancelEditing(); return isDefined(result) ? result : true }, enter: function(e) { var isOpened = this.option("opened"); var inputText = this._input().val().trim(); var isCustomText = inputText && this._list && !this._list.option("focusedElement"); if (!inputText && this.option("value") && this.option("allowClearing")) { this.option({ selectedItem: null, value: null }); this.close() } else { if (this.option("acceptCustomValue")) { e.preventDefault(); if (isCustomText) { this._valueChangeEventHandler(e); if (isOpened) { this._toggleOpenState() } } return isOpened } if (parent.enter && parent.enter.apply(this, arguments)) { return isOpened } } }, space: function(e) { var isOpened = this.option("opened"); var isSearchEnabled = this.option("searchEnabled"); var acceptCustomValue = this.option("acceptCustomValue"); if (!isOpened || isSearchEnabled || acceptCustomValue) { return } e.preventDefault(); this._valueChangeEventHandler(e); return true }, backspace: clearSelectBox, del: clearSelectBox }) }, _getDefaultOptions: function() { return extend(this.callBase(), { placeholder: messageLocalization.format("Select"), fieldTemplate: null, valueChangeEvent: "change", acceptCustomValue: false, onCustomItemCreating: function(e) { if (!isDefined(e.customItem)) { e.customItem = e.text } }, showSelectionControls: false, autocompletionEnabled: true, allowClearing: true, tooltipEnabled: false, openOnFieldClick: true, showDropDownButton: true, displayCustomValue: false, _isAdaptablePopupPosition: false, useInkRipple: false, useHiddenSubmitElement: true }) }, _init: function() { this.callBase(); this._initCustomItemCreatingAction() }, _initMarkup: function() { this.$element().addClass(SELECTBOX_CLASS); this._renderTooltip(); this.option("useInkRipple") && this._renderInkRipple(); this.callBase(); 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(), event: 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 }, _cancelEditing: function() { if (!this.option("searchEnabled") && this._list) { this._focusListElement(null); this._updateField(this.option("selectedItem")) } }, _renderOpenedState: function() { this.callBase(); if (this.option("opened")) { this._scrollToSelectedItem(); this._focusSelectedElement() } }, _focusSelectedElement: function() { var searchValue = this._searchValue(); if (!searchValue) { this._focusListElement(null); return } var $listItems = this._list._itemElements(); var index = inArray(this.option("selectedItem"), this.option("items")); var focusedElement = index >= 0 && !this._isCustomItemSelected() ? $listItems.eq(index) : null; this._focusListElement(focusedElement) }, _renderFocusedElement: function() { if (!this._list) { return } var searchValue = this._searchValue(); if (!searchValue || this.option("acceptCustomValue")) { this._focusListElement(null); return } var $listItems = this._list._itemElements(); var focusedElement = $listItems.not(DISABLED_STATE_SELECTOR).eq(0); this._focusListElement(focusedElement) }, _focusListElement: function(element) { this._preventInputValueRender = true; this._list.option("focusedElement", getPublicElement(element)); delete this._preventInputValueRender }, _scrollToSelectedItem: function() { this._list && this._list.scrollToItem(this._list.option("selectedItem")) }, _listContentReadyHandler: function() { this.callBase(); var isPaginate = this._dataSource && this._dataSource.paginate(); if (isPaginate && this._needPopupRepaint()) { return } this._scrollToSelectedItem() }, _renderValue: function() { this._renderInputValue(); this._setSubmitValue(); return (new Deferred).resolve() }, _renderInputValue: function() { return this.callBase().always(function() { this._renderInputValueAsync() }.bind(this)) }, _renderInputValueAsync: function() { this._renderTooltip(); this._renderInputValueImpl().always(function() { this._refreshSelected() }.bind(this)) }, _renderInputValueImpl: function() { this._renderField(); return (new Deferred).resolve() }, _setNextItem: function(step) { var item = this._calcNextItem(step); var value = this._valueGetter(item); this._setValue(value) }, _setNextValue: function(step) { var dataSourceIsLoaded = this._dataSource.isLoaded() ? (new Deferred).resolve() : this._dataSource.load(); dataSourceIsLoaded.done(function() { var selectedIndex = this._getSelectedIndex(); var hasPages = this._dataSource.pageSize(); var isLastPage = this._dataSource.isLastPage(); var isLastItem = selectedIndex === this._items().length - 1; if (hasPages && !isLastPage && isLastItem && step > 0) { if (!this._popup) { this._createPopup() } if (!this._dataSource.isLoading()) { this._list._loadNextPage().done(this._setNextItem.bind(this, step)) } } else { this._setNextItem(step) } }.bind(this)) }, _setSelectedItem: function(item) { var isUnknownItem = !this._isCustomValueAllowed() && void 0 === item; this.callBase(isUnknownItem ? null : item); if (!isUnknownItem && (!this._isEditable() || this._isCustomItemSelected())) { this._setListOption("selectedItem", this.option("selectedItem")) } }, _isCustomValueAllowed: function() { return this.option("acceptCustomValue") || this.callBase() }, _displayValue: function(item) { item = !isDefined(item) && this._isCustomValueAllowed() ? this.option("value") : item; return this.callBase(item) }, _listConfig: function() { var result = extend(this.callBase(), { pageLoadMode: "scrollBottom", onSelectionChanged: this._getSelectionChangeHandler(), selectedItem: this.option("selectedItem"), onFocusedItemChanged: this._listFocusedItemChangeHandler.bind(this) }); if (this.option("showSelectionControls")) { extend(result, { showSelectionControls: true, selectionByClick: true }) } return result }, _listFocusedItemChangeHandler: function(e) { if (this._preventInputValueRender) { return } var list = e.component; var focusedElement = $(list.option("focusedElement")); var focusedItem = list._getItemData(focusedElement); this._updateField(focusedItem) }, _updateField: function(item) { var fieldTemplate = this._getTemplateByOption("fieldTemplate"); if (!(fieldTemplate && this.option("fieldTemplate"))) { this._renderDisplayText(this._displayGetter(item)); return } this._renderField() }, _getSelectionChangeHandler: function() { return this.option("showSelectionControls") ? this._selectionChangeHandler.bind(this) : commonUtils.noop }, _selectionChangeHandler: function(e) { each(e.addedItems || [], function(_, addedItem) { this._setValue(this._valueGetter(addedItem)) }.bind(this)) }, _getActualSearchValue: function() { return this._dataSource.searchValue() }, _toggleOpenState: function(isVisible) { if (this.option("disabled")) { return } isVisible = arguments.length ? isVisible : !this.option("opened"); if (!isVisible) { this._restoreInputText(true) } if (this._wasSearch() && isVisible) { this._wasSearch(false); var showDataImmediately = this.option("showDataBeforeSearch") || 0 === this.option("minSearchLength"); if (showDataImmediately && this._dataSource) { if (this._searchTimer) { return } var searchValue = this._getActualSearchValue(); searchValue && this._wasSearch(true); this._filterDataSource(searchValue || null) } else { this._setListOption("items", []) } } if (isVisible) { this._scrollToSelectedItem() } this.callBase(isVisible) }, _renderTooltip: function() { if (this.option("tooltipEnabled")) { this.$element().attr("title", this.option("displayValue")) } }, _renderDimensions: function() { this.callBase(); this._setPopupOption("width") }, _isValueEqualInputText: function() { var initialSelectedItem = this.option("selectedItem"); var value = this._displayGetter(initialSelectedItem); var displayValue = value ? String(value) : ""; var inputText = this._searchValue(); return displayValue === inputText }, _popupHidingHandler: function() { if (this._isValueEqualInputText()) { this._cancelEditing() } this.callBase() }, _restoreInputText: function(saveEditingValue) { if (this.option("readOnly")) { return } this._loadItemDeferred && this._loadItemDeferred.always(function() { var initialSelectedItem = this.option("selectedItem"); if (this.option("acceptCustomValue")) { if (!saveEditingValue) { this._updateField(initialSelectedItem); this._clearFilter() } return } if (this.option("searchEnabled")) { if (!this._searchValue() && this.option("allowClearing")) { this._clearTextValue(); return } } if (this._isValueEqualInputText()) { return } this._renderInputValue().always(function(selectedItem) { var newSelectedItem = commonUtils.ensureDefined(selectedItem, initialSelectedItem); this._setSelectedItem(newSelectedItem); this._updateField(newSelectedItem); this._clearFilter() }.bind(this)) }.bind(this)) }, _focusOutHandler: function(e) { if (!this._preventNestedFocusEvent(e)) { this._clearSearchTimer(); this._restoreInputText(); var shouldCancelSearch = this._wasSearch() && !this.option("acceptCustomValue") && this.option("searchEnabled") && this.option("opened") && !this._isOverlayNestedTarget(e.relatedTarget); if (shouldCancelSearch) { this._searchCanceled() } } this.callBase(e) }, _isOverlayNestedTarget: function(target) { return !!$(target).closest(".".concat(SELECTBOX_POPUP_WRAPPER_CLASS)).length }, _clearTextValue: function() { this.option("value", null) }, _shouldOpenPopup: function() { return this._needPassDataSourceToList() }, _isFocused: function() { var activeElement = domAdapter.getActiveElement(); return this.callBase() && $(activeElement).closest(this._input()).length > 0 }, _renderValueChangeEvent: function() { if (this._isEditable()) { this.callBase() } }, _isEditable: function() { return this.option("acceptCustomValue") || this.option("searchEnabled") }, _fieldRenderData: function() { var $listFocused = this._list && this.option("opened") && $(this._list.option("focusedElement")); if ($listFocused && $listFocused.length) { return this._list._getItemData($listFocused) } return this.option("selectedItem") }, _readOnlyPropValue: function() { return !this._isEditable() || this.option("readOnly") }, _isSelectedValue: function(value) { return this._isValueEquals(value, this.option("value")) }, _shouldCloseOnItemClick: function() { return !(this.option("showSelectionControls") && "single" !== this.option("selectionMode")) }, _listItemClickHandler: function(e) { var previousValue = this._getCurrentValue(); this._focusListElement($(e.itemElement)); this._saveValueChangeEvent(e.event); if (this._shouldClearFilter()) { this._clearFilter() } this._completeSelection(this._valueGetter(e.itemData)); if (this._shouldCloseOnItemClick()) { this.option("opened", false) } if (this.option("searchEnabled") && previousValue === this._valueGetter(e.itemData)) { this._updateField(e.itemData) } }, _shouldClearFilter: function() { return this._wasSearch() }, _completeSelection: function(value) { this._setValue(value) }, _loadItem: function(value, cache) { var that = this; var deferred = new Deferred; this.callBase(value, cache).done(function(item) { deferred.resolve(item) }.bind(this)).fail(function() { var selectedItem = that.option("selectedItem"); if (that.option("acceptCustomValue") && value === that._valueGetter(selectedItem)) { deferred.resolve(selectedItem) } else { deferred.reject() } }.bind(this)); return deferred.promise() }, _loadInputValue: function(value, callback) { this._loadItemDeferred = this._loadItem(value).always(callback); return this._loadItemDeferred }, _isCustomItemSelected: function() { var selectedItem = this.option("selectedItem"); var searchValue = this._searchValue(); var selectedItemText = this._displayGetter(selectedItem); return !selectedItemText || searchValue !== selectedItemText.toString() }, _valueChangeEventHandler: function(e) { if (this.option("acceptCustomValue") && this._isCustomItemSelected()) { this._customItemAddedHandler(e) } }, _initCustomItemCreatingAction: function() { this._customItemCreatingAction = this._createActionByOption("onCustomItemCreating") }, _createCustomItem: function(text) { var params = { text: text }; var actionResult = this._customItemCreatingAction(params); var item = commonUtils.ensureDefined(actionResult, params.customItem); if (isDefined(actionResult)) { errors.log("W0015", "onCustomItemCreating", "customItem") } return item }, _customItemAddedHandler: function(e) { var searchValue = this._searchValue(); var item = this._createCustomItem(searchValue); this._saveValueChangeEvent(e); if (void 0 === item) { this._renderValue(); throw errors.Error("E0121") } if (isPromise(item)) { deferredUtils.fromPromise(item).done(this._setCustomItem.bind(this)).fail(this._setCustomItem.bind(this, null)) } else { this._setCustomItem(item) } }, _setCustomItem: function(item) { if (this._disposed) { return } item = item || null; this.option("selectedItem", item); if (this._shouldClearFilter()) { this._filterDataSource(null) } this._setValue(this._valueGetter(item)); this._renderDisplayText(this._displayGetter(item)) }, _clearValueHandler: function(e) { this.callBase(e); return false }, _wasSearch: function(value) { if (!arguments.length) { return this._wasSearchValue } this._wasSearchValue = value }, _searchHandler: function(e) { if (this._preventFiltering) { delete this._preventFiltering; return } if (this._needPassDataSourceToList()) { this._wasSearch(true) } this.callBase(e) }, _dataSourceFiltered: function(searchValue) { this.callBase(); if (null !== searchValue) { this._renderInputSubstitution(); this._renderFocusedElement() } }, _valueSubstituted: function() { var input = this._input().get(0); var isAllSelected = 0 === input.selectionStart && input.selectionEnd === this._searchValue().length; var inputHasSelection = input.selectionStart !== input.selectionEnd; return this._wasSearch() && inputHasSelection && !isAllSelected }, _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._getPlainItems(this._list.option("items"))[0]; if (!item) { return } var $input = this._input(); var valueLength = $input.val().length; if (0 === valueLength) { return } var inputElement = $input.get(0); var displayValue = this._displayGetter(item).toString(); inputElement.value = displayValue; this._caret({ start: valueLength, end: displayValue.length }) }, _cleanInputSelection: function() { var inputElement = this._input().get(0); var endPosition = inputElement.value.length; inputElement.selectionStart = endPosition; inputElement.selectionEnd = endPosition }, _dispose: function() { this._renderInputValueAsync = commonUtils.noop; delete this._loadItemDeferred; this.callBase() }, _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; case "allowClearing": break; default: this.callBase(args) } }, _clean: function() { delete this._inkRipple; this.callBase() } }); registerComponent("dxSelectBox", SelectBox); module.exports = SelectBox }, /*!*************************************************!*\ !*** ./artifacts/transpiled/viz/core/export.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.plugin = exports.ExportMenu = exports.combineMarkups = exports.exportWidgets = exports.getMarkup = exports.exportFromMarkup = void 0; var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); var _utils = __webpack_require__( /*! ./utils */ 10); var _exporter = __webpack_require__( /*! ../../exporter */ 170); var _exporter2 = _interopRequireDefault(_exporter); var _message = __webpack_require__( /*! ../../localization/message */ 13); var _message2 = _interopRequireDefault(_message); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _themes = __webpack_require__( /*! ../themes */ 50); var _themes2 = _interopRequireDefault(_themes); var _hover = __webpack_require__( /*! ../../events/hover */ 148); var _hover2 = _interopRequireDefault(_hover); var _pointer = __webpack_require__( /*! ../../events/pointer */ 23); var _pointer2 = _interopRequireDefault(_pointer); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var imageExporter = _exporter2.default.image; var svgExporter = _exporter2.default.svg; var pdfExporter = _exporter2.default.pdf; var pointerActions = [_pointer2.default.down, _pointer2.default.move].join(" "); var BUTTON_SIZE = 35; var 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] ]; var LIST_PADDING_TOP = 4; var LIST_WIDTH = 120; var VERTICAL_TEXT_MARGIN = 8; var HORIZONTAL_TEXT_MARGIN = 15; var MENU_ITEM_HEIGHT = 30; var LIST_STROKE_WIDTH = 1; var MARGIN = 10; var SHADOW_OFFSET = 2; var SHADOW_BLUR = 3; var DEFAULT_EXPORT_FORMAT = "PNG"; var ALLOWED_IMAGE_FORMATS = [DEFAULT_EXPORT_FORMAT, "JPEG", "GIF"]; var ALLOWED_EXTRA_FORMATS = ["PDF", "SVG"]; var EXPORT_CSS_CLASS = "dx-export-menu"; var EXPORT_DATA_KEY = "export-element-type"; var FORMAT_DATA_KEY = "export-element-format"; var GET_COLOR_REGEX = /data-backgroundcolor="([^"]*)"/; function getValidFormats() { var imageFormats = imageExporter.testFormats(ALLOWED_IMAGE_FORMATS); return { unsupported: imageFormats.unsupported, supported: imageFormats.supported.concat(ALLOWED_EXTRA_FORMATS) } } function validateFormat(format, incidentOccurred, validFormats) { validFormats = validFormats || getValidFormats(); format = String(format).toUpperCase(); if (validFormats.supported.indexOf(format) !== -1) { return format } if (validFormats.unsupported.indexOf(format) !== -1) { incidentOccurred && incidentOccurred("W2108", [format]) } } function getCreatorFunc(format) { if ("SVG" === format) { return svgExporter.getData } else { if ("PDF" === format) { return pdfExporter.getData } else { return imageExporter.getData } } } function _print(imageSrc, options) { var document = (0, _window.getWindow)().document; var iFrame = document.createElement("iframe"); iFrame.onload = setPrint(imageSrc, options); iFrame.style.visibility = "hidden"; iFrame.style.position = "fixed"; iFrame.style.right = "0"; iFrame.style.bottom = "0"; document.body.appendChild(iFrame) } function setPrint(imageSrc, options) { return function() { var _this = this; var window = this.contentWindow; var img = window.document.createElement("img"); window.document.body.appendChild(img); var origImageSrc = imageSrc; if (options.__test) { imageSrc = options.__test.imageSrc; window = options.__test.mockWindow } var removeFrame = function() { options.__test && options.__test.checkAssertions(); _this.parentElement.removeChild(_this); options.__test && options.__test.deferred.resolve(origImageSrc) }; img.addEventListener("load", function() { window.focus(); window.print(); removeFrame() }); img.addEventListener("error", removeFrame); img.src = imageSrc } } function getItemAttributes(options, type, itemIndex) { var x = BUTTON_SIZE - LIST_WIDTH; var y = BUTTON_SIZE + LIST_PADDING_TOP + LIST_STROKE_WIDTH + itemIndex * MENU_ITEM_HEIGHT; var attr = { rect: { width: LIST_WIDTH - 2 * LIST_STROKE_WIDTH, height: MENU_ITEM_HEIGHT, x: x + LIST_STROKE_WIDTH, y: y }, text: { x: x + (options.rtl ? LIST_WIDTH - HORIZONTAL_TEXT_MARGIN : HORIZONTAL_TEXT_MARGIN), y: y + MENU_ITEM_HEIGHT - VERTICAL_TEXT_MARGIN } }; if ("printing" === type) { attr.separator = { stroke: options.button.default.borderColor, "stroke-width": LIST_STROKE_WIDTH, cursor: "pointer", sharp: "v", d: "M " + x + " " + (y + MENU_ITEM_HEIGHT - LIST_STROKE_WIDTH) + " L " + (x + LIST_WIDTH) + " " + (y + MENU_ITEM_HEIGHT - LIST_STROKE_WIDTH) } } return attr } function createMenuItem(renderer, options, settings) { var itemData = {}; var type = settings.type; var format = settings.format; var attr = getItemAttributes(options, type, settings.itemIndex); var fontStyle = (0, _utils.patchFontOptions)(options.font); fontStyle["pointer-events"] = "none"; var 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(); rect.attr(attr.rect).css({ cursor: "pointer", "pointer-events": "all" }).data(itemData); rect.on(_hover2.default.start + ".export", function() { return rect.attr({ fill: options.button.hover.backgroundColor }) }).on(_hover2.default.end + ".export", function() { return rect.attr({ fill: null }) }); rect.append(menuItem); var text = renderer.text(settings.text).css(fontStyle).attr(attr.text).append(menuItem); if ("printing" === type) { renderer.path(null, "line").attr(attr.separator).append(menuItem) } return { g: menuItem, rect: rect, resetState: function() { return rect.attr({ fill: null }) }, fixPosition: function() { var textBBox = text.getBBox(); text.move(attr.text.x - textBBox.x - (options.rtl ? textBBox.width : 0)) } } } function createMenuItems(renderer, options) { var items = []; if (options.printingEnabled) { items.push(createMenuItem(renderer, options, { type: "printing", text: _message2.default.format("vizExport-printingButtonText"), itemIndex: items.length })) } items = options.formats.reduce(function(r, format) { r.push(createMenuItem(renderer, options, { type: "exporting", text: _message2.default.getFormatter("vizExport-exportButtonText")(format), format: format, itemIndex: r.length })); return r }, items); return items } function getBackgroundColorFromMarkup(markup) { var parsedMarkup = GET_COLOR_REGEX.exec(markup); return parsedMarkup ? parsedMarkup[1] : void 0 } var exportFromMarkup = exports.exportFromMarkup = function(markup, options) { options.format = validateFormat(options.format) || DEFAULT_EXPORT_FORMAT; options.fileName = options.fileName || "file"; options.exportingAction = options.onExporting; options.exportedAction = options.onExported; options.fileSavingAction = options.onFileSaving; options.margin = (0, _type.isDefined)(options.margin) ? options.margin : MARGIN; options.backgroundColor = (0, _type.isDefined)(options.backgroundColor) ? options.backgroundColor : getBackgroundColorFromMarkup(markup); _exporter2.default.export(markup, options, getCreatorFunc(options.format)) }; exports.getMarkup = function(widgets) { return combineMarkups(widgets).markup }; exports.exportWidgets = function(widgets, options) { options = options || {}; var markupInfo = exports.combineMarkups(widgets, { gridLayout: options.gridLayout, verticalAlignment: options.verticalAlignment, horizontalAlignment: options.horizontalAlignment }); options.width = markupInfo.width; options.height = markupInfo.height; exportFromMarkup(markupInfo.markup, options) }; var combineMarkups = exports.combineMarkups = function(widgets) { var options = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!Array.isArray(widgets)) { widgets = [ [widgets] ] } else { if (!Array.isArray(widgets[0])) { widgets = widgets.map(function(item) { return [item] }) } } var compactView = !options.gridLayout; var exportItems = widgets.reduce(function(r, row, rowIndex) { var rowInfo = row.reduce(function(r, item, colIndex) { var size = item.getSize(); var backgroundColor = item.option("backgroundColor") || _themes2.default.getTheme(item.option("theme")).backgroundColor; backgroundColor && r.backgroundColors.indexOf(backgroundColor) === -1 && r.backgroundColors.push(backgroundColor); r.hOffset = r.width; r.width += size.width; r.height = Math.max(r.height, size.height); r.itemWidth = Math.max(r.itemWidth, size.width); r.items.push({ markup: item.svg(), width: size.width, height: size.height, c: colIndex, r: rowIndex, hOffset: r.hOffset }); return r }, { items: [], height: 0, itemWidth: 0, hOffset: 0, width: 0, backgroundColors: r.backgroundColors }); r.rowOffsets.push(r.totalHeight); r.rowHeights.push(rowInfo.height); r.totalHeight += rowInfo.height; r.items = r.items.concat(rowInfo.items); r.itemWidth = Math.max(r.itemWidth, rowInfo.itemWidth); r.maxItemLen = Math.max(r.maxItemLen, rowInfo.items.length); r.totalWidth = compactView ? Math.max(r.totalWidth, rowInfo.width) : r.maxItemLen * r.itemWidth; return r }, { items: [], rowOffsets: [], rowHeights: [], itemWidth: 0, totalHeight: 0, maxItemLen: 0, totalWidth: 0, backgroundColors: [] }); var backgroundColor = 'data-backgroundcolor="'.concat(1 === exportItems.backgroundColors.length ? exportItems.backgroundColors[0] : "", '" '); var getVOffset = function(item) { var align = options.verticalAlignment; var dy = exportItems.rowHeights[item.r] - item.height; return exportItems.rowOffsets[item.r] + ("bottom" === align ? dy : "center" === align ? dy / 2 : 0) }; var getHOffset = function(item) { if (compactView) { return item.hOffset } var align = options.horizontalAlignment; var colWidth = exportItems.itemWidth; var dx = colWidth - item.width; return item.c * colWidth + ("right" === align ? dx : "center" === align ? dx / 2 : 0) }; var totalHeight = exportItems.totalHeight; var totalWidth = exportItems.totalWidth; return { markup: "' + exportItems.items.map(function(item) { return '').concat(item.markup, "") }).join("") + "", width: totalWidth, height: totalHeight } }; var ExportMenu = exports.ExportMenu = function(params) { var renderer = this._renderer = params.renderer; this._incidentOccurred = params.incidentOccurred; this._exportTo = params.exportTo; this._print = params.print; this._shadow = renderer.shadowFilter("-50%", "-50%", "200%", "200%", SHADOW_OFFSET, 6, SHADOW_BLUR); this._shadow.attr({ opacity: .8 }); this._group = renderer.g().attr({ "class": EXPORT_CSS_CLASS, "hidden-for-export": true }).linkOn(renderer.root, { name: "export-menu", after: "peripheral" }); this._buttonGroup = renderer.g().attr({ "class": EXPORT_CSS_CLASS + "-button" }).append(this._group); this._listGroup = renderer.g().attr({ "class": EXPORT_CSS_CLASS + "-list" }).append(this._group); this._overlay = renderer.rect(-LIST_WIDTH + BUTTON_SIZE, BUTTON_SIZE + LIST_PADDING_TOP, LIST_WIDTH, 0); this._overlay.attr({ "stroke-width": LIST_STROKE_WIDTH, cursor: "pointer", rx: 4, ry: 4, filter: this._shadow.id }); this._overlay.data({ "export-element-type": "list" }); this.validFormats = getValidFormats(); this._subscribeEvents() }; (0, _extend.extend)(ExportMenu.prototype, { getLayoutOptions: function() { if (this._hiddenDueToLayout) { return { width: 0, height: 0, cutSide: "vertical", cutLayoutSide: "top" } } var bBox = this._buttonGroup.getBBox(); bBox.cutSide = "vertical"; bBox.cutLayoutSide = "top"; bBox.height += MARGIN; bBox.position = { vertical: "top", horizontal: "right" }; bBox.verticalAlignment = "top"; bBox.horizontalAlignment = "right"; return bBox }, probeDraw: function() { this._fillSpace(); this.show() }, shift: function(_, y) { this._group.attr({ translateY: this._group.attr("translateY") + y }) }, draw: function(width, height, canvas) { this._group.move(width - BUTTON_SIZE - SHADOW_OFFSET - SHADOW_BLUR + canvas.left, Math.floor(height / 2 - BUTTON_SIZE / 2)); var layoutOptions = this.getLayoutOptions(); if (layoutOptions.width > width || layoutOptions.height > height) { this.freeSpace() } return this }, show: function() { this._group.linkAppend() }, hide: function() { this._group.linkRemove() }, setOptions: function(options) { var _this2 = this; this._options = options; if (options.formats) { options.formats = options.formats.reduce(function(r, format) { format = validateFormat(format, _this2._incidentOccurred, _this2.validFormats); format && r.push(format); return r }, []) } else { options.formats = this.validFormats.supported.slice() } 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() { this._unsubscribeEvents(); this._group.linkRemove().linkOff(); this._group.dispose(); this._shadow.dispose() }, layoutOptions: function() { return this._options.enabled && { horizontalAlignment: "right", verticalAlignment: "top", weak: true } }, measure: function() { this._fillSpace(); var margin = this._options.button.margin; return [BUTTON_SIZE + margin.left + margin.right, BUTTON_SIZE + margin.top + margin.bottom] }, move: function(rect) { var margin = this._options.button.margin; this._group.attr({ translateX: Math.round(rect[0]) + margin.left, translateY: Math.round(rect[1]) + margin.top }) }, _fillSpace: function() { this._hiddenDueToLayout = false; this.show() }, freeSpace: function() { this._incidentOccurred("W2107"); this._hiddenDueToLayout = true; this.hide() }, _hideList: function() { this._listGroup.remove(); this._listShown = false; this._setButtonState("default"); this._menuItems.forEach(function(item) { return item.resetState() }) }, _showList: function() { this._listGroup.append(this._group); this._listShown = true; this._menuItems.forEach(function(item) { return item.fixPosition() }) }, _setButtonState: function(state) { var style = this._options.button[state]; this._button.attr({ stroke: style.borderColor, fill: style.backgroundColor }); this._icon.attr({ fill: style.color }) }, _subscribeEvents: function() { var _this3 = this; this._renderer.root.on(_pointer2.default.up + ".export", function(e) { var elementType = e.target[EXPORT_DATA_KEY]; if (!elementType) { if (_this3._button) { _this3._hideList() } return } if ("button" === elementType) { if (_this3._listShown) { _this3._setButtonState("default"); _this3._hideList() } else { _this3._setButtonState("focus"); _this3._showList() } } else { if ("printing" === elementType) { _this3._print(); _this3._hideList() } else { if ("exporting" === elementType) { _this3._exportTo(e.target[FORMAT_DATA_KEY]); _this3._hideList() } } } }); this._listGroup.on(pointerActions, function(e) { return e.stopPropagation() }); this._buttonGroup.on(_pointer2.default.enter, function() { return _this3._setButtonState("hover") }); this._buttonGroup.on(_pointer2.default.leave, function() { return _this3._setButtonState(_this3._listShown ? "focus" : "default") }); this._buttonGroup.on(_pointer2.default.down + ".export", function() { return _this3._setButtonState("active") }) }, _unsubscribeEvents: function() { this._renderer.root.off(".export"); this._listGroup.off(); this._buttonGroup.off() }, _updateButton: function() { var renderer = this._renderer; var options = this._options; var exportData = { "export-element-type": "button" }; if (!this._button) { this._button = renderer.rect(0, 0, BUTTON_SIZE, BUTTON_SIZE).append(this._buttonGroup); this._button.attr({ rx: 4, ry: 4, fill: options.button.default.backgroundColor, stroke: options.button.default.borderColor, "stroke-width": 1, cursor: "pointer" }); this._button.data(exportData); this._icon = renderer.path(ICON_COORDS).append(this._buttonGroup); this._icon.attr({ fill: options.button.default.color, cursor: "pointer" }); this._icon.data(exportData); this._buttonGroup.setTitle(_message2.default.format("vizExport-titleMenuText")) } }, _updateList: function() { var options = this._options; var buttonDefault = options.button.default; var listGroup = this._listGroup; var items = createMenuItems(this._renderer, options); this._shadow.attr({ color: options.shadowColor }); this._overlay.attr({ height: items.length * MENU_ITEM_HEIGHT + 2 * LIST_STROKE_WIDTH, fill: buttonDefault.backgroundColor, stroke: buttonDefault.borderColor }); listGroup.clear(); this._overlay.append(listGroup); items.forEach(function(item) { return item.g.append(listGroup) }); this._menuItems = items } }); function getExportOptions(widget, exportOptions, fileName, format) { if (format || exportOptions.format) { format = validateFormat(format || exportOptions.format, widget._incidentOccurred) } return { format: format || DEFAULT_EXPORT_FORMAT, fileName: fileName || exportOptions.fileName || "file", proxyUrl: exportOptions.proxyUrl, backgroundColor: exportOptions.backgroundColor, width: widget._canvas.width, height: widget._canvas.height, margin: exportOptions.margin, forceProxy: exportOptions.forceProxy, exportingAction: widget._createActionByOption("onExporting"), exportedAction: widget._createActionByOption("onExported"), fileSavingAction: widget._createActionByOption("onFileSaving") } } exports.plugin = { name: "export", init: function() { var _this4 = this; this._exportMenu = new exports.ExportMenu({ renderer: this._renderer, incidentOccurred: this._incidentOccurred, print: function() { return _this4.print() }, exportTo: function(format) { return _this4.exportTo(void 0, format) } }); this._layout.add(this._exportMenu) }, dispose: function() { this._exportMenu.dispose() }, members: { _getExportMenuOptions: function() { return (0, _extend.extend)({}, this._getOption("export"), { rtl: this._getOption("rtlEnabled", true) }) }, _disablePointerEvents: function() { var pointerEventsValue = this._renderer.root.attr("pointer-events"); this._renderer.root.attr({ "pointer-events": "none" }); return pointerEventsValue }, exportTo: function(fileName, format) { var _this5 = this; var menu = this._exportMenu; var options = getExportOptions(this, this._getOption("export") || {}, fileName, format); menu && menu.hide(); var pointerEventsValue = this._disablePointerEvents(); _exporter2.default.export(this._renderer.root.element, options, getCreatorFunc(options.format)).done(function() { _this5._renderer.root.attr({ "pointer-events": pointerEventsValue }) }); menu && menu.show() }, print: function() { var _this6 = this; var menu = this._exportMenu; var options = getExportOptions(this, this._getOption("export") || {}); options.__test = this._getOption("export").__test; options.exportingAction = null; options.exportedAction = null; options.margin = 0; options.format = "PNG"; options.forceProxy = true; options.fileSavingAction = function(eventArgs) { _print("data:image/png;base64,".concat(eventArgs.data), { __test: options.__test }); eventArgs.cancel = true }; var pointerEventsValue = this._disablePointerEvents(); menu && menu.hide(); _exporter2.default.export(this._renderer.root.element, options, getCreatorFunc(options.format)).done(function() { _this6._renderer.root.attr({ "pointer-events": pointerEventsValue }) }); menu && menu.show() } }, 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" }, fontFields: ["export.font"] } }, /*!***************************************!*\ !*** ./artifacts/transpiled/color.js ***! \***************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { 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); var s = parseInt(colorString[2], 10); var v = parseInt(colorString[3], 10); var 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); var s = parseInt(colorString[2], 10); var l = parseInt(colorString[3], 10); var 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 i = 0; var ii = standardColorTypes.length; var str; 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 max = Math.max(r, g, b); var min = Math.min(r, g, b); var delta = max - min; var H; var S; var V; 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 r; var g; var b; var index = Math.floor(h % 360 / 60); var vMin = (100 - s) * v / 100; var a = (v - vMin) * (h % 60 / 60); var vInc = vMin + a; var vDec = v - a; switch (index) { 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 max = Math.max(r, g, b); var min = Math.min(r, g, b); var maxMinSum = max + min; var h; var s; var 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 makeColorTint(colorPart, h) { var colorTint = h; if ("r" === colorPart) { colorTint = h + 1 / 3 } if ("b" === colorPart) { colorTint = h - 1 / 3 } return colorTint } function modifyColorTint(colorTint) { if (colorTint < 0) { colorTint += 1 } if (colorTint > 1) { colorTint -= 1 } return colorTint } function hueToRgb(p, q, colorTint) { colorTint = modifyColorTint(colorTint); if (colorTint < 1 / 6) { return p + 6 * (q - p) * colorTint } if (colorTint < .5) { return q } if (colorTint < 2 / 3) { return p + (q - p) * (2 / 3 - colorTint) * 6 } return p } function hslToRgb(h, s, l) { var r; var g; var 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; var p = 2 * l - q; r = hueToRgb(p, q, makeColorTint("r", h)); g = hueToRgb(p, q, makeColorTint("g", h)); b = hueToRgb(p, q, makeColorTint("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 isIntegerBetweenMinAndMax(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); var 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 (!isIntegerBetweenMinAndMax(r) || !isIntegerBetweenMinAndMax(g) || !isIntegerBetweenMinAndMax(b)) { return false } return true }, isValidAlpha: function(a) { if (isNaN(a) || a < 0 || a > 1 || "number" !== typeof a) { return false } return true }, colorIsInvalid: false, fromHSL: function(hsl) { var color = new Color; var rgb = hslToRgb(hsl.h, hsl.s, hsl.l); color.r = rgb[0]; color.g = rgb[1]; color.b = rgb[2]; return color } }; module.exports = Color }, /*!*****************************************************************!*\ !*** ./artifacts/transpiled/events/core/emitter_registrator.js ***! \*****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48); var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39); var Class = __webpack_require__( /*! ../../core/class */ 15); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray; var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var registerEvent = __webpack_require__( /*! ./event_registrator */ 71); var eventUtils = __webpack_require__( /*! ../utils */ 8); var pointerEvents = __webpack_require__( /*! ../pointer */ 23); var wheelEvent = __webpack_require__( /*! ./wheel */ 124); var MANAGER_EVENT = "dxEventManager"; var EMITTER_DATA = "dxEmitter"; var EventManager = Class.inherit({ ctor: function() { this._attachHandlers(); this.reset(); this._proxiedCancelHandler = this._cancelHandler.bind(this); this._proxiedAcceptHandler = this._acceptHandler.bind(this) }, _attachHandlers: function() { readyCallbacks.add(function() { var document = domAdapter.getDocument(); eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(pointerEvents.down, MANAGER_EVENT), this._pointerDownHandler.bind(this)); eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(pointerEvents.move, MANAGER_EVENT), this._pointerMoveHandler.bind(this)); eventsEngine.subscribeGlobal(document, eventUtils.addNamespace([pointerEvents.up, pointerEvents.cancel].join(" "), MANAGER_EVENT), this._pointerUpHandler.bind(this)); eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(wheelEvent.name, MANAGER_EVENT), this._mouseWheelHandler.bind(this)) }.bind(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; var result = []; var $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 = dataUtils.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); var verticalGestureDirection = "both" === direction && !e.shiftKey || "vertical" === direction; var 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; var emitterName = emitterConfig.events[0]; var emitterEvents = emitterConfig.events; each(emitterEvents, function(_, eventName) { registerEvent(eventName, { noBubble: !emitterConfig.bubble, setup: function(element) { var subscriptions = dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA) || {}; var emitters = dataUtils.data(element, EMITTER_DATA) || {}; var emitter = emitters[emitterName] || new emitterClass(element); subscriptions[eventName] = true; emitters[emitterName] = emitter; dataUtils.data(element, EMITTER_DATA, emitters); dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA, subscriptions) }, add: function(element, handleObj) { var emitters = dataUtils.data(element, EMITTER_DATA); var emitter = emitters[emitterName]; emitter.configure(extend({ delegateSelector: handleObj.selector }, handleObj.data), handleObj.type) }, teardown: function(element) { var subscriptions = dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA); var emitters = dataUtils.data(element, EMITTER_DATA); var 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 }, /*!******************************************************!*\ !*** ./artifacts/transpiled/viz/core/base_widget.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7); var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var version = __webpack_require__( /*! ../../core/version */ 157); var _windowResizeCallbacks = __webpack_require__( /*! ../../core/utils/resize_callbacks */ 130); var _stringFormat = __webpack_require__( /*! ../../core/utils/string */ 44).format; var _isObject = __webpack_require__( /*! ../../core/utils/type */ 1).isObject; var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var themeManagerModule = __webpack_require__( /*! ../core/base_theme_manager */ 241); var _floor = Math.floor; var DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 67); var helpers = __webpack_require__( /*! ./helpers */ 142); var _parseScalar = __webpack_require__( /*! ./utils */ 10).parseScalar; var errors = __webpack_require__( /*! ./errors_warnings */ 764); var _log = errors.log; var rendererModule = __webpack_require__( /*! ./renderers/renderer */ 175); var _Layout = __webpack_require__( /*! ./layout */ 766); var devices = __webpack_require__( /*! ../../core/devices */ 16); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var OPTION_RTL_ENABLED = "rtlEnabled"; var SIZED_ELEMENT_CLASS = "dx-sized-element"; var _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; var handler = function() { clearTimeout(timeout); timeout = setTimeout(callback, 100) }; handler.dispose = function() { clearTimeout(timeout); return this }; return handler } function defaultOnIncidentOccurred(e) { if (!e.component.hasEvent("incidentOccurred")) { _log.apply(null, [e.target.id].concat(e.target.args || [])) } } var createIncidentOccurred = function(widgetName, eventTrigger) { return function(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(values) { return values.reduce(function(result, value) { return value > 0 && !result ? value : result }, 0) } var getEmptyComponent = function() { var emptyComponentConfig = {}; emptyComponentConfig.ctor = function(element, options) { this.callBase(element, options); var sizedElement = domAdapter.createElement("div"); var width = options && typeUtils.isNumeric(options.width) ? options.width + "px" : "100%"; var height = options && typeUtils.isNumeric(options.height) ? options.height + "px" : this._getDefaultSize().height + "px"; domAdapter.setStyle(sizedElement, "width", width); domAdapter.setStyle(sizedElement, "height", height); domAdapter.setClass(sizedElement, SIZED_ELEMENT_CLASS); domAdapter.insertElement(element, sizedElement) }; var EmptyComponent = DOMComponent.inherit(emptyComponentConfig); var originalInherit = EmptyComponent.inherit; EmptyComponent.inherit = function(config) { for (var field in config) { if (typeUtils.isFunction(config[field]) && "_" !== field.substr(0, 1) || "_dispose" === field || "_optionChanged" === field) { config[field] = noop } } return originalInherit.call(this, config) }; return EmptyComponent }; var isServerSide = !windowUtils.hasWindow(); function sizeIsValid(value) { return typeUtils.isDefined(value) && value > 0 } module.exports = isServerSide ? getEmptyComponent() : DOMComponent.inherit({ _eventsMap: { onIncidentOccurred: { name: "incidentOccurred" }, onDrawn: { name: "drawn" } }, _getDefaultOptions: function() { return extend(this.callBase(), { onIncidentOccurred: defaultOnIncidentOccurred }) }, _useLinks: true, _init: function() { var that = this; that._$element.children("." + SIZED_ELEMENT_CLASS).remove(); that.callBase.apply(that, arguments); that._changesLocker = 0; that._optionChangedLocker = 0; that._changes = helpers.changes(); that._suspendChanges(); that._themeManager = that._createThemeManager(); that._themeManager.setCallback(function() { that._requestChange(that._themeDependentChanges) }); that._renderElementAttributes(); that._initRenderer(); var linkTarget = that._useLinks && that._renderer.root; linkTarget && linkTarget.enableLinks().virtualLink("core").virtualLink("peripheral"); that._renderVisibilityChange(); that._attachVisibilityChangeHandlers(); that._toggleParentsScrollSubscription(this._isVisible()); 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) }, _createThemeManager: function() { return new themeManagerModule.BaseThemeManager(this._getThemeManagerOptions()) }, _getThemeManagerOptions: function() { return { themeSection: this._themeSection, fontFields: this._fontFields } }, _initialChanges: ["LAYOUT", "RESIZE_HANDLER", "THEME", "DISABLED"], _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._applyingChanges) { that._renderer.lock(); that._applyingChanges = true; that._applyChanges(); that._changes.reset(); that._applyingChanges = false; that._renderer.unlock(); if (that._optionsQueue) { that._applyQueuedOptions() } that._optionChangedLocker++; that._notify(); that._optionChangedLocker-- } }, _applyQueuedOptions: function() { var that = this; var queue = that._optionsQueue; that._optionsQueue = null; that.beginUpdate(); each(queue, function(_, action) { action() }); that.endUpdate() }, _requestChange: function(codes) { this._suspendChanges(); this._change(codes); this._resumeChanges() }, _applyChanges: function() { var that = this; var changes = that._changes; var order = that._totalChangesOrder; var i; var 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: ["ELEMENT_ATTR", "CONTAINER_SIZE", "LAYOUT"], _customChangesOrder: ["DISABLED"], _change_EVENTS: function() { this._eventTrigger.applyChanges() }, _change_THEME: function() { this._setThemeAndRtl() }, _change_RENDERER: function() { this._setRendererOptions() }, _change_RESIZE_HANDLER: function() { this._setupResizeHandler() }, _change_ELEMENT_ATTR: function() { this._renderElementAttributes(); this._change(["CONTAINER_SIZE"]) }, _change_CONTAINER_SIZE: function() { this._updateSize() }, _change_LAYOUT: function() { this._setContentSize() }, _change_DISABLED: function() { var renderer = this._renderer; var root = renderer.root; if (this.option("disabled")) { this._initDisabledState = root.attr("pointer-events"); root.attr({ "pointer-events": "none", filter: renderer.getGrayScaleFilter().id }) } else { if ("none" === root.attr("pointer-events")) { root.attr({ "pointer-events": typeUtils.isDefined(this._initDisabledState) ? this._initDisabledState : null, filter: null }) } } }, _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"]); var visible = this._isVisible(); this._toggleParentsScrollSubscription(visible); !visible && this._stopCurrentHandling() }, _toggleParentsScrollSubscription: function(subscribe) { var $parents = $(this._renderer.root.element).parents(); var scrollEvents = "scroll.viz_widgets"; if ("generic" === devices.real().platform) { $parents = $parents.add(windowUtils.getWindow()) } this._proxiedTargetParentsScrollHandler = this._proxiedTargetParentsScrollHandler || function() { this._stopCurrentHandling() }.bind(this); eventsEngine.off($().add(this._$prevRootParents), scrollEvents, this._proxiedTargetParentsScrollHandler); if (subscribe) { eventsEngine.on($parents, scrollEvents, this._proxiedTargetParentsScrollHandler); this._$prevRootParents = $parents } }, _stopCurrentHandling: noop, _dispose: function() { var that = this; that.callBase.apply(that, arguments); that._toggleParentsScrollSubscription(false); 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) { return that._createActionByOption(name) }) }, _calculateCanvas: function() { var that = this; var size = that.option("size") || {}; var margin = that.option("margin") || {}; var defaultCanvas = that._getDefaultSize() || {}; var elementWidth = !sizeIsValid(size.width) && windowUtils.hasWindow() ? that._$element.width() : 0; var elementHeight = !sizeIsValid(size.height) && windowUtils.hasWindow() ? that._$element.height() : 0; var canvas = { width: size.width <= 0 ? 0 : _floor(pickPositiveValue([size.width, elementWidth, defaultCanvas.width])), height: size.height <= 0 ? 0 : _floor(pickPositiveValue([size.height, elementHeight, defaultCanvas.height])), left: pickPositiveValue([margin.left, defaultCanvas.left]), top: pickPositiveValue([margin.top, defaultCanvas.top]), right: pickPositiveValue([margin.right, defaultCanvas.right]), bottom: pickPositiveValue([margin.bottom, defaultCanvas.bottom]) }; 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; var canvas = that._calculateCanvas(); that._renderer.fixPlacement(); if (areCanvasesDifferent(that._canvas, canvas) || that.__forceRender) { that._canvas = canvas; that._recreateSizeDependentObjects(true); that._renderer.resize(canvas.width, canvas.height); that._change(["LAYOUT"]) } }, _recreateSizeDependentObjects: noop, _getMinSize: function() { return [0, 0] }, _getAlignmentRect: noop, _setContentSize: function() { var canvas = this._canvas; var layout = this._layout; var 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, this._getMinSize()); var nextRect = this._applySize(rect) || rect; layout.backward(nextRect, this._getAlignmentRect() || nextRect) }, DEBUG_getCanvas: function() { return this._canvas }, DEBUG_getEventTrigger: function() { return this._eventTrigger }, _getOption: function(name, isScalar) { var theme = this._themeManager.theme(name); var option = this.option(name); return isScalar ? void 0 !== option ? option : theme : extend(true, {}, theme, option) }, _setupResizeHandler: function() { var that = this; var redrawOnResize = _parseScalar(this._getOption("redrawOnResize", true), true); if (that._resizeHandler) { that._removeResizeHandler() } that._resizeHandler = createResizeHandler(function() { if (redrawOnResize) { that._requestChange(["CONTAINER_SIZE"]) } else { that._renderer.fixPlacement() } }); _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; that.callBase.apply(that, arguments); if (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(that._getActionForUpdating(arguments)) } else { return _option.apply(that, arguments) } }, _getActionForUpdating: function(args) { var that = this; return that._deprecatedOptionsSuppressed ? function() { that._suppressDeprecatedWarnings(); _option.apply(that, args); that._resumeDeprecatedWarnings() } : function() { _option.apply(that, args) } }, _clean: noop, _render: noop, _optionChanged: function(arg) { var that = this; if (that._optionChangedLocker) { return } var partialChanges = that.getPartialChangeOptionsName(arg); var changes = []; if (partialChanges.length > 0) { partialChanges.forEach(function(pc) { return changes.push(that._partialOptionChangesMap[pc]) }) } else { changes.push(that._optionChangesMap[arg.name]) } changes = changes.filter(function(c) { return !!c }); if (that._eventTrigger.change(arg.name)) { that._change(["EVENTS"]) } else { if (changes.length > 0) { that._change(changes) } else { that.callBase.apply(that, arguments) } } }, _notify: noop, _optionChangesMap: { size: "CONTAINER_SIZE", margin: "CONTAINER_SIZE", redrawOnResize: "RESIZE_HANDLER", theme: "THEME", rtlEnabled: "THEME", encodeHtml: "THEME", elementAttr: "ELEMENT_ATTR", disabled: "DISABLED" }, _partialOptionChangesMap: {}, _partialOptionChangesPath: {}, getPartialChangeOptionsName: function(changedOption) { var that = this; var fullName = changedOption.fullName; var sections = fullName.split(/[.]/); var name = changedOption.name; var value = changedOption.value; var options = this._partialOptionChangesPath[name]; var partialChangeOptionsName = []; if (options) { if (true === options) { partialChangeOptionsName.push(name) } else { options.forEach(function(op) { fullName.indexOf(op) >= 0 && partialChangeOptionsName.push(op) }); if (1 === sections.length) { if ("object" === typeUtils.type(value)) { that._addOptionsNameForPartialUpdate(value, options, partialChangeOptionsName) } else { if ("array" === typeUtils.type(value)) { if (value.length > 0 && value.every(function(item) { return that._checkOptionsForPartialUpdate(item, options) })) { value.forEach(function(item) { return that._addOptionsNameForPartialUpdate(item, options, partialChangeOptionsName) }) } } } } } } return partialChangeOptionsName.filter(function(value, index, self) { return self.indexOf(value) === index }) }, _checkOptionsForPartialUpdate: function(optionObject, options) { return !Object.keys(optionObject).some(function(key) { return options.indexOf(key) === -1 }) }, _addOptionsNameForPartialUpdate: function(optionObject, options, partialChangeOptionsName) { var optionKeys = Object.keys(optionObject); if (this._checkOptionsForPartialUpdate(optionObject, options)) { optionKeys.forEach(function(key) { return options.indexOf(key) > -1 && partialChangeOptionsName.push(key) }) } }, _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()) }, svg: function() { return this._renderer.svg() }, getSize: function() { var canvas = this._canvas || {}; return { width: canvas.width, height: canvas.height } }, 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) } 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 }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/core/utils/position.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _config = __webpack_require__( /*! ../config */ 31); var _config2 = _interopRequireDefault(_config); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var getDefaultAlignment = function(isRtlEnabled) { var rtlEnabled = null !== isRtlEnabled && void 0 !== isRtlEnabled ? isRtlEnabled : (0, _config2.default)().rtlEnabled; return rtlEnabled ? "right" : "left" }; exports.getDefaultAlignment = getDefaultAlignment }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/data/abstract_store.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Class = __webpack_require__( /*! ../core/class */ 15); var abstract = Class.abstract; var EventsMixin = __webpack_require__( /*! ../core/events_mixin */ 82); var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each; var errorsModule = __webpack_require__( /*! ./errors */ 36); var dataUtils = __webpack_require__( /*! ./utils */ 41); var compileGetter = __webpack_require__( /*! ../core/utils/data */ 20).compileGetter; var storeHelper = __webpack_require__( /*! ./store_helper */ 81); var queryByOptions = storeHelper.queryByOptions; var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred; var noop = __webpack_require__( /*! ../core/utils/common */ 4).noop; var storeImpl = {}; var Store = Class.inherit({ ctor: function(options) { var that = this; options = options || {}; each(["onLoaded", "onLoading", "onInserted", "onInserting", "onUpdated", "onUpdating", "onPush", "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) { that.fireEvent("loaded", [result, options]) }) }, _loadImpl: function(options) { return queryByOptions(this.createQuery(options), options).enumerate() }, _withLock: function(task) { var result = new Deferred; task.done(function() { var that = this; var 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) { return queryByOptions(this.createQuery(options), options, true).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() { that.fireEvent("updated", [key, values]); that.fireEvent("modified") })) }, _updateImpl: abstract, push: function(changes) { this._pushImpl(changes); this.fireEvent("push", [changes]) }, _pushImpl: noop, 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).fail(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.registerClass = function(type, alias) { if (alias) { storeImpl[alias] = type } return type }; Store.inherit = function(inheritor) { return function(members, alias) { var type = inheritor.apply(this, [members]); Store.registerClass(type, alias); return type } }(Store.inherit); module.exports = Store }, /*!******************************************************!*\ !*** ./artifacts/transpiled/ui/validation_engine.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Class = __webpack_require__( /*! ../core/class */ 15); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray; var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each; var EventsMixin = __webpack_require__( /*! ../core/events_mixin */ 82); var errors = __webpack_require__( /*! ../core/errors */ 21); var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4); var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1); var numberLocalization = __webpack_require__( /*! ../localization/number */ 51); var messageLocalization = __webpack_require__( /*! ../localization/message */ 13); var BaseRuleValidator = Class.inherit({ NAME: "base", defaultMessage: function(value) { return messageLocalization.getFormatter("validation-" + this.NAME)(value) }, defaultFormattedMessage: function(value) { return messageLocalization.getFormatter("validation-" + this.NAME + "-formatted")(value) }, _isValueEmpty: function(value) { return !rulesValidators.required.validate(value, {}) }, validate: function(value, rule) { var valueArray = Array.isArray(value) ? value : [value]; var result = true; if (valueArray.length) { valueArray.every(function(itemValue) { result = this._validate(itemValue, rule); return result }, this) } else { result = this._validate(null, rule) } return result } }); var RequiredRuleValidator = BaseRuleValidator.inherit({ NAME: "required", _validate: function(value, rule) { if (!typeUtils.isDefined(value)) { return false } if (false === value) { return false } value = String(value); if (rule.trim || !typeUtils.isDefined(rule.trim)) { value = value.trim() } return "" !== value } }); var NumericRuleValidator = BaseRuleValidator.inherit({ NAME: "numeric", _validate: function(value, rule) { if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } if (rule.useCultureSettings && typeUtils.isString(value)) { return !isNaN(numberLocalization.parse(value)) } else { return typeUtils.isNumeric(value) } } }); var RangeRuleValidator = BaseRuleValidator.inherit({ NAME: "range", _validate: function(value, rule) { if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } var validNumber = rulesValidators.numeric.validate(value, rule); var validValue = typeUtils.isDefined(value) && "" !== value; var number = validNumber ? parseFloat(value) : validValue && value.valueOf(); var min = rule.min; var max = rule.max; if (!(validNumber || typeUtils.isDate(value)) && !validValue) { return false } if (typeUtils.isDefined(min)) { if (typeUtils.isDefined(max)) { return number >= min && number <= max } return number >= min } else { if (typeUtils.isDefined(max)) { return number <= max } else { throw errors.Error("E0101") } } } }); var StringLengthRuleValidator = BaseRuleValidator.inherit({ NAME: "stringLength", _validate: function(value, rule) { value = typeUtils.isDefined(value) ? String(value) : ""; if (rule.trim || !typeUtils.isDefined(rule.trim)) { value = value.trim() } if (rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } return rulesValidators.range.validate(value.length, extend({}, rule)) } }); var CustomRuleValidator = BaseRuleValidator.inherit({ NAME: "custom", validate: function(value, rule) { if (rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } var validator = rule.validator; var dataGetter = validator && typeUtils.isFunction(validator.option) && validator.option("dataGetter"); var data = typeUtils.isFunction(dataGetter) && dataGetter(); var params = { value: value, validator: validator, rule: rule }; if (data) { params.data = data } return rule.validationCallback(params) } }); var CompareRuleValidator = BaseRuleValidator.inherit({ NAME: "compare", _validate: function(value, rule) { if (!rule.comparisonTarget) { throw errors.Error("E0102") } if (rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } extend(rule, { reevaluate: true }); var otherValue = rule.comparisonTarget(); var 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 } } }); var PatternRuleValidator = BaseRuleValidator.inherit({ NAME: "pattern", _validate: function(value, rule) { if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } var pattern = rule.pattern; if (typeUtils.isString(pattern)) { pattern = new RegExp(pattern) } return pattern.test(value) } }); var EmailRuleValidator = BaseRuleValidator.inherit({ NAME: "email", _validate: function(value, rule) { if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } return rulesValidators.pattern.validate(value, extend({}, rule, { pattern: /^[\d\w._-]+@[\d\w._-]+\.[\w]+$/i })) } }); var rulesValidators = { required: new RequiredRuleValidator, numeric: new NumericRuleValidator, range: new RangeRuleValidator, stringLength: new StringLengthRuleValidator, custom: new CustomRuleValidator, compare: new CompareRuleValidator, pattern: new PatternRuleValidator, email: new EmailRuleValidator }; 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 = commonUtils.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); var index = inArray(config, this.groups); if (index > -1) { this.groups.splice(index, 1) } return config }, _setDefaultMessage: function(rule, validator, name) { if (!typeUtils.isDefined(rule.message)) { if (validator.defaultFormattedMessage && typeUtils.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 }; var that = this; each(rules || [], function(_, rule) { var ruleValidator = rulesValidators[rule.type]; var ruleValidationResult; if (ruleValidator) { if (typeUtils.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) } }, _shouldRemoveGroup: function(group, validatorsInGroup) { var isDefaultGroup = void 0 === group; var isValidationGroupInstance = group && "dxValidationGroup" === group.NAME; return !isDefaultGroup && !isValidationGroupInstance && !validatorsInGroup.length }, removeRegisteredValidator: function(group, validator) { var config = ValidationEngine.getGroupConfig(group); var validatorsInGroup = config && config.validators; var index = inArray(validator, validatorsInGroup); if (index > -1) { validatorsInGroup.splice(index, 1); if (this._shouldRemoveGroup(group, validatorsInGroup)) { this.removeGroup(group) } } }, 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 }, /*!*****************************************!*\ !*** ./artifacts/transpiled/ui/list.js ***! \*****************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var ListEdit = __webpack_require__( /*! ./list/ui.list.edit.search */ 508); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); registerComponent("dxList", ListEdit); module.exports = ListEdit }, /*!*************************************************************************!*\ !*** ./artifacts/transpiled/ui/list/ui.list.edit.decorator_registry.js ***! \*************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; 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) } }, /*!**********************************************!*\ !*** ./artifacts/transpiled/ui/check_box.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var devices = __webpack_require__( /*! ../core/devices */ 16); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var inkRipple = __webpack_require__( /*! ./widget/utils.ink_ripple */ 69); var Editor = __webpack_require__( /*! ./editor/editor */ 49); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var eventUtils = __webpack_require__( /*! ../events/utils */ 8); var clickEvent = __webpack_require__( /*! ../events/click */ 19); var CHECKBOX_CLASS = "dx-checkbox"; var CHECKBOX_ICON_CLASS = "dx-checkbox-icon"; var CHECKBOX_CHECKED_CLASS = "dx-checkbox-checked"; var CHECKBOX_CONTAINER_CLASS = "dx-checkbox-container"; var CHECKBOX_TEXT_CLASS = "dx-checkbox-text"; var CHECKBOX_HAS_TEXT_CLASS = "dx-checkbox-has-text"; var CHECKBOX_INDETERMINATE_CLASS = "dx-checkbox-indeterminate"; var CHECKBOX_FEEDBACK_HIDE_TIMEOUT = 100; var CheckBox = Editor.inherit({ _supportedKeys: function() { var click = function(e) { e.preventDefault(); this._clickAction({ event: 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() { return "desktop" === devices.real().deviceType && !devices.isSimulator() }, options: { focusStateEnabled: true } }]) }, _canValueBeChangedByClick: function() { return true }, _feedbackHideTimeout: CHECKBOX_FEEDBACK_HIDE_TIMEOUT, _initMarkup: function() { this._renderSubmitElement(); this._$container = $("
").addClass(CHECKBOX_CONTAINER_CLASS); this.setAria("role", "checkbox"); this.$element().addClass(CHECKBOX_CLASS); this._renderValue(); this._renderIcon(); this._renderText(); this.option("useInkRipple") && this._renderInkRipple(); this.$element().append(this._$container); this.callBase() }, _render: function() { this._renderClick(); this.callBase() }, _renderSubmitElement: function() { this._$submitElement = $("").attr("type", "hidden").appendTo(this.$element()) }, _getSubmitElement: function() { return this._$submitElement }, _renderInkRipple: function() { this._inkRipple = inkRipple.render({ waveSizeCoefficient: 2.5, useHoldAnimation: false, wavesNumber: 2, isCentered: true }) }, _renderInkWave: function(element, dxEvent, doRender, waveIndex) { if (!this._inkRipple) { return } var config = { element: element, event: dxEvent, 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; var eventName = eventUtils.addNamespace(clickEvent.name, that.NAME); that._clickAction = that._createAction(that._clickHandler); eventsEngine.off(that.$element(), eventName); eventsEngine.on(that.$element(), eventName, function(e) { that._clickAction({ event: e }) }) }, _clickHandler: function(args) { var that = args.component; that._saveValueChangeEvent(args.event); that.option("value", !that.option("value")) }, _renderValue: function() { var $element = this.$element(); var checked = this.option("value"); var indeterminate = void 0 === checked; $element.toggleClass(CHECKBOX_CHECKED_CLASS, Boolean(checked)); $element.toggleClass(CHECKBOX_INDETERMINATE_CLASS, indeterminate); this._getSubmitElement().val(checked); 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) } }, _clean: function() { delete this._inkRipple; this.callBase() } }); registerComponent("dxCheckBox", CheckBox); module.exports = CheckBox }, /*!*************************************************!*\ !*** ./artifacts/transpiled/ui/context_menu.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _ui = __webpack_require__( /*! ./context_menu/ui.context_menu */ 330); var _ui2 = _interopRequireDefault(_ui); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } module.exports = _ui2.default }, /*!*********************************************************!*\ !*** ./artifacts/transpiled/ui/shared/accessibility.js ***! \*********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _utils = __webpack_require__( /*! ../../events/utils */ 8); var _utils2 = _interopRequireDefault(_utils); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var FOCUS_STATE_CLASS = "dx-state-focused"; var FOCUS_DISABLED_CLASS = "dx-cell-focus-disabled"; var FOCUSED_ROW_SELECTOR = ".dx-row-focused"; var GRID_ROW_SELECTOR = ".dx-datagrid-rowsview .dx-row"; var GRID_CELL_SELECTOR = "".concat(GRID_ROW_SELECTOR, " > td"); var TREELIST_ROW_SELECTOR = ".dx-treelist-rowsview .dx-row"; var TREELIST_CELL_SELECTOR = "".concat(TREELIST_ROW_SELECTOR, " > td"); var viewItemSelectorMap = { groupPanel: [".dx-datagrid-group-panel .dx-group-panel-item[tabindex]"], columnHeaders: [".dx-datagrid-headers .dx-header-row > td.dx-datagrid-action", ".dx-treelist-headers .dx-header-row > td.dx-treelist-action"], filterRow: [".dx-datagrid-headers .dx-datagrid-filter-row .dx-editor-cell .dx-texteditor-input", ".dx-treelist-headers .dx-treelist-filter-row .dx-editor-cell .dx-texteditor-input"], rowsView: ["".concat(FOCUSED_ROW_SELECTOR), "".concat(GRID_ROW_SELECTOR, "[tabindex]"), "".concat(GRID_CELL_SELECTOR, "[tabindex]"), "".concat(GRID_CELL_SELECTOR), "".concat(TREELIST_ROW_SELECTOR, "[tabindex]"), "".concat(TREELIST_CELL_SELECTOR, "[tabindex]"), "".concat(TREELIST_CELL_SELECTOR)], footer: [".dx-datagrid-total-footer .dx-datagrid-summary-item", ".dx-treelist-total-footer .dx-treelist-summary-item"], filterPanel: [".dx-datagrid-filter-panel .dx-icon-filter", ".dx-treelist-filter-panel .dx-icon-filter"], pager: [".dx-datagrid-pager [tabindex]", ".dx-treelist-pager [tabindex]"] }; var isMouseDown = false; var isHiddenFocusing = false; var focusedElementInfo = null; function processKeyDown(viewName, instance, event, action, $mainElement, executeKeyDown) { var isHandled = fireKeyDownEvent(instance, event.originalEvent, executeKeyDown); if (isHandled) { return } var keyName = _utils2.default.normalizeKeyName(event); if ("enter" === keyName || "space" === keyName) { saveFocusedElementInfo(event.target, instance); action && action({ event: event }) } else { if ("tab" === keyName) { $mainElement.addClass(FOCUS_STATE_CLASS) } else { module.exports.selectView(viewName, instance, event) } } } function saveFocusedElementInfo(target, instance) { var $target = (0, _renderer2.default)(target); var ariaLabel = $target.attr("aria-label"); var $activeElements = getActiveAccessibleElements(ariaLabel, instance.element()); var targetIndex = $activeElements.index($target); focusedElementInfo = (0, _extend.extend)({}, { ariaLabel: ariaLabel, index: targetIndex }, { viewInstance: instance }) } function getActiveAccessibleElements(ariaLabel, viewElement) { var $viewElement = (0, _renderer2.default)(viewElement); var $activeElements; if (ariaLabel) { $activeElements = $viewElement.find('[aria-label="'.concat(ariaLabel, '"][tabindex]')) } else { $activeElements = $viewElement.find("[tabindex]") } return $activeElements } function findFocusedViewElement(viewSelectors) { for (var index in viewSelectors) { var selector = viewSelectors[index]; var $focusViewElement = (0, _renderer2.default)(selector).first(); if ($focusViewElement.length) { return $focusViewElement } } } function fireKeyDownEvent(instance, event, executeAction) { var args = { event: event, handled: false }; if (executeAction) { executeAction(args) } else { instance._createActionByOption("onKeyDown")(args) } return args.handled } module.exports = { hiddenFocus: function(element) { isHiddenFocusing = true; element.focus(); isHiddenFocusing = false }, registerKeyboardAction: function(viewName, instance, $element, selector, action, executeKeyDown) { if (instance.option("useLegacyKeyboardNavigation")) { return } var $mainElement = (0, _renderer2.default)(instance.element()); _events_engine2.default.on($element, "keydown", selector, function(e) { return processKeyDown(viewName, instance, e, action, $mainElement, executeKeyDown) }); _events_engine2.default.on($element, "mousedown", selector, function() { isMouseDown = true; $mainElement.removeClass(FOCUS_STATE_CLASS) }); _events_engine2.default.on($element, "focusin", selector, function() { if (!isMouseDown && !isHiddenFocusing) { $mainElement.addClass(FOCUS_STATE_CLASS) } isMouseDown = false }) }, restoreFocus: function(instance) { if (!instance.option("useLegacyKeyboardNavigation") && focusedElementInfo) { var viewInstance = focusedElementInfo.viewInstance; if (viewInstance) { var $activeElements = getActiveAccessibleElements(focusedElementInfo.ariaLabel, viewInstance.element()); var $targetElement = $activeElements.eq(focusedElementInfo.index); focusedElementInfo = null; _events_engine2.default.trigger($targetElement, "focus") } } }, selectView: function(viewName, instance, event) { var keyName = _utils2.default.normalizeKeyName(event); if (event.ctrlKey && ("upArrow" === keyName || "downArrow" === keyName)) { var viewNames = Object.keys(viewItemSelectorMap); var viewItemIndex = viewNames.indexOf(viewName); while (viewItemIndex >= 0 && viewItemIndex < viewNames.length) { viewItemIndex = "upArrow" === keyName ? --viewItemIndex : ++viewItemIndex; var _viewName = viewNames[viewItemIndex]; var viewSelectors = viewItemSelectorMap[_viewName]; var $focusViewElement = findFocusedViewElement(viewSelectors); if ($focusViewElement && $focusViewElement.length) { $focusViewElement.attr("tabindex", instance.option("tabindex") || 0); _events_engine2.default.trigger($focusViewElement, "focus"); $focusViewElement.removeClass(FOCUS_DISABLED_CLASS); break } } } }, setTabIndex: function(instance, $element) { if (!instance.option("useLegacyKeyboardnavigation")) { $element.attr("tabindex", instance.option("tabindex") || 0) } } } }, /*!************************************************!*\ !*** ./artifacts/transpiled/viz/core/title.js ***! \************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _Number = Number; var _isString = __webpack_require__( /*! ../../core/utils/type */ 1).isString; var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var _patchFontOptions = __webpack_require__( /*! ./utils */ 10).patchFontOptions; var parseHorizontalAlignment = __webpack_require__( /*! ./utils */ 10).enumParser(["left", "center", "right"]); var parseVerticalAlignment = __webpack_require__( /*! ./utils */ 10).enumParser(["top", "bottom"]); var DEFAULT_MARGIN = 10; function hasText(text) { return !!(text && String(text).length > 0) } function processTitleLength(elem, text, width, options, placeholderSize) { if (elem.attr({ text: text }).setMaxSize(width, placeholderSize, options).textChanged) { elem.setTitle(text) } } function pickMarginValue(value) { return value >= 0 ? _Number(value) : DEFAULT_MARGIN } function validateMargin(margin) { var result; if (margin >= 0) { result = { left: _Number(margin), top: _Number(margin), right: _Number(margin), bottom: _Number(margin) } } else { margin = margin || {}; result = { left: pickMarginValue(margin.left), top: pickMarginValue(margin.top), right: pickMarginValue(margin.right), bottom: pickMarginValue(margin.bottom) } } return result } function checkRect(rect, boundingRect) { return rect[2] - rect[0] < boundingRect.width || rect[3] - rect[1] < boundingRect.height } function Title(params) { this._params = params; this._group = params.renderer.g().attr({ "class": params.cssClass }).linkOn(params.root || params.renderer.root, "title"); this._hasText = false } extend(Title.prototype, __webpack_require__( /*! ./layout_element */ 242).LayoutElement.prototype, { dispose: function() { var that = this; that._group.linkRemove(); that._group.linkOff(); if (that._titleElement) { that._clipRect.dispose(); that._titleElement = that._subtitleElement = that._clipRect = null } that._params = that._group = that._options = null }, _updateOptions: function(options) { this._options = options; this._options.horizontalAlignment = parseHorizontalAlignment(options.horizontalAlignment, "center"); this._options.verticalAlignment = parseVerticalAlignment(options.verticalAlignment, "top"); this._options.margin = validateMargin(options.margin) }, _updateStructure: function() { var that = this; var renderer = that._params.renderer; var group = that._group; var options = that._options; var align = options.horizontalAlignment; if (!that._titleElement) { that._titleElement = renderer.text().append(group); that._subtitleElement = renderer.text(); that._clipRect = renderer.clipRect(); group.attr({ "clip-path": that._clipRect.id }) } that._titleElement.attr({ align: align, "class": options.cssClass }); that._subtitleElement.attr({ align: align, "class": options.subtitle.cssClass }); group.linkAppend(); hasText(options.subtitle.text) ? that._subtitleElement.append(group) : that._subtitleElement.remove() }, _updateTexts: function() { var that = this; var options = that._options; var subtitleOptions = options.subtitle; var titleElement = that._titleElement; var subtitleElement = that._subtitleElement; var testText = "A"; var titleBox; titleElement.attr({ text: testText, y: 0 }).css(_patchFontOptions(options.font)); titleBox = titleElement.getBBox(); that._baseLineCorrection = titleBox.height + titleBox.y; titleElement.attr({ text: options.text }); titleBox = titleElement.getBBox(); var y = -titleBox.y; titleElement.attr({ y: y }); if (hasText(subtitleOptions.text)) { subtitleElement.attr({ text: subtitleOptions.text, y: 0 }).css(_patchFontOptions(subtitleOptions.font)) } }, _shiftSubtitle: function() { var that = this; var titleBox = that._titleElement.getBBox(); var element = that._subtitleElement; var offset = that._options.subtitle.offset; element.move(0, titleBox.y + titleBox.height - element.getBBox().y - offset) }, _updateBoundingRectAlignment: function() { var boundingRect = this._boundingRect; var options = this._options; boundingRect.verticalAlignment = options.verticalAlignment; boundingRect.horizontalAlignment = options.horizontalAlignment; boundingRect.cutLayoutSide = options.verticalAlignment; boundingRect.cutSide = "vertical"; boundingRect.position = { horizontal: options.horizontalAlignment, vertical: options.verticalAlignment } }, hasText: function() { return this._hasText }, update: function(themeOptions, userOptions) { var that = this; var options = extend(true, {}, themeOptions, processTitleOptions(userOptions)); var _hasText = hasText(options.text); var isLayoutChanged = _hasText || _hasText !== that._hasText; that._baseLineCorrection = 0; that._updateOptions(options); that._boundingRect = {}; if (_hasText) { that._updateStructure(); that._updateTexts() } else { that._group.linkRemove() } that._updateBoundingRect(); that._updateBoundingRectAlignment(); that._hasText = _hasText; return isLayoutChanged }, draw: function(width, height) { var that = this; if (that._hasText) { that._group.linkAppend(); that._correctTitleLength(width); if (that._group.getBBox().height > height) { this.freeSpace() } } return that }, probeDraw: function(width, height) { this.draw(width, height); return this }, _correctTitleLength: function(width) { var that = this; var options = that._options; var margin = options.margin; var maxWidth = width - margin.left - margin.right; var placeholderSize = options.placeholderSize; processTitleLength(that._titleElement, options.text, maxWidth, options, placeholderSize); if (that._subtitleElement) { if (_Number(placeholderSize) > 0) { placeholderSize -= that._titleElement.getBBox().height } processTitleLength(that._subtitleElement, options.subtitle.text, maxWidth, options.subtitle, placeholderSize); that._shiftSubtitle() } that._updateBoundingRect(); var _this$getCorrectedLay = this.getCorrectedLayoutOptions(), x = _this$getCorrectedLay.x, y = _this$getCorrectedLay.y, height = _this$getCorrectedLay.height; this._clipRect.attr({ x: x, y: y, width: width, height: height }) }, getLayoutOptions: function() { return this._boundingRect || null }, shift: function(x, y) { var that = this; var box = that.getLayoutOptions(); that._group.move(x - box.x, y - box.y); return that }, _updateBoundingRect: function() { var that = this; var options = that._options; var margin = options.margin; var boundingRect = that._boundingRect; var box = that._hasText ? that._group.getBBox() : { width: 0, height: 0, x: 0, y: 0, isEmpty: true }; if (!box.isEmpty) { box.height += margin.top + margin.bottom - that._baseLineCorrection; box.width += margin.left + margin.right; box.x -= margin.left; box.y += that._baseLineCorrection - margin.top } if (options.placeholderSize > 0) { box.height = options.placeholderSize } boundingRect.height = box.height; boundingRect.width = box.width; boundingRect.x = box.x; boundingRect.y = box.y }, getCorrectedLayoutOptions: function() { var srcBox = this.getLayoutOptions(); var correction = this._baseLineCorrection; return extend({}, srcBox, { y: srcBox.y - correction, height: srcBox.height + correction }) }, layoutOptions: function() { if (!this._hasText) { return null } return { horizontalAlignment: this._boundingRect.horizontalAlignment, verticalAlignment: this._boundingRect.verticalAlignment, priority: 0 } }, measure: function(size) { this.draw(size[0], size[1]); return [this._boundingRect.width, this._boundingRect.height] }, move: function(rect, fitRect) { var boundingRect = this._boundingRect; if (checkRect(rect, boundingRect)) { this.shift(fitRect[0], fitRect[1]) } else { this.shift(Math.round(rect[0]), Math.round(rect[1])) } }, freeSpace: function() { var that = this; that._params.incidentOccurred("W2103"); that._group.linkRemove(); that._boundingRect.width = that._boundingRect.height = 0 }, getOptions: function() { return this._options }, changeLink: function(root) { this._group.linkRemove(); this._group.linkOn(root, "title") } }); exports.Title = Title; Title.prototype.DEBUG_getOptions = function() { return this._options }; function processTitleOptions(options) { var newOptions = _isString(options) ? { text: options } : options || {}; newOptions.subtitle = _isString(newOptions.subtitle) ? { text: newOptions.subtitle } : newOptions.subtitle || {}; return newOptions } exports.plugin = { name: "title", init: function() { var that = this; that._title = new exports.Title({ renderer: that._renderer, cssClass: that._rootClassPrefix + "-title", incidentOccurred: that._incidentOccurred }); that._layout.add(that._title) }, dispose: function() { this._title.dispose(); this._title = null }, customize: function(constructor) { constructor.addChange({ code: "TITLE", handler: function() { if (this._title.update(this._themeManager.theme("title"), this.option("title"))) { this._change(["LAYOUT"]) } }, isThemeDependent: true, option: "title", isOptionChange: true }) }, fontFields: ["title.font", "title.subtitle.font"] } }, /*!***********************************************************!*\ !*** ./artifacts/transpiled/viz/series/scatter_series.js ***! \***********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }) } else { obj[key] = value } return obj } var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray; var _each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var rangeCalculator = __webpack_require__( /*! ./helpers/range_data_calculator */ 247); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var vizUtils = __webpack_require__( /*! ../core/utils */ 10); var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var _isDefined = typeUtils.isDefined; var _isString = typeUtils.isString; var _map = vizUtils.map; var _normalizeEnum = vizUtils.normalizeEnum; var math = Math; var _abs = math.abs; var _sqrt = math.sqrt; var _max = math.max; var DEFAULT_TRACKER_WIDTH = 12; var DEFAULT_DURATION = 400; var HIGH_ERROR = "highError"; var LOW_ERROR = "lowError"; var VARIANCE = "variance"; var STANDARD_DEVIATION = "stddeviation"; var STANDARD_ERROR = "stderror"; var PERCENT = "percent"; var FIXED = "fixed"; var UNDEFINED = "undefined"; var DISCRETE = "discrete"; var LOGARITHMIC = "logarithmic"; var DATETIME = "datetime"; exports.chart = {}; exports.polar = {}; function sum(array) { var result = 0; _each(array, function(_, value) { result += value }); return result } function isErrorBarTypeCorrect(type) { return inArray(type, [FIXED, PERCENT, VARIANCE, STANDARD_DEVIATION, STANDARD_ERROR]) !== -1 } function variance(array, expectedValue) { return sum(_map(array, function(value) { return (value - expectedValue) * (value - expectedValue) })) / array.length } function calculateAvgErrorBars(result, data, series) { var errorBarsOptions = series.getOptions().valueErrorBar; var valueField = series.getValueFields()[0]; var lowValueField = errorBarsOptions.lowValueField || LOW_ERROR; var highValueField = errorBarsOptions.highValueField || HIGH_ERROR; if (series.areErrorBarsVisible() && void 0 === errorBarsOptions.type) { var fusionData = data.reduce(function(result, item) { if (_isDefined(item[lowValueField])) { result[0] += item[valueField] - item[lowValueField]; result[1]++ } if (_isDefined(item[highValueField])) { result[2] += item[highValueField] - item[valueField]; result[3]++ } return result }, [0, 0, 0, 0]); if (fusionData[1]) { result[lowValueField] = result[valueField] - fusionData[0] / fusionData[1] } if (fusionData[2]) { result[highValueField] = result[valueField] + fusionData[2] / fusionData[3] } } return result } function calculateSumErrorBars(result, data, series) { var errorBarsOptions = series.getOptions().valueErrorBar; var lowValueField = errorBarsOptions.lowValueField || LOW_ERROR; var highValueField = errorBarsOptions.highValueField || HIGH_ERROR; if (series.areErrorBarsVisible() && void 0 === errorBarsOptions.type) { result[lowValueField] = 0; result[highValueField] = 0; result = data.reduce(function(result, item) { result[lowValueField] += item[lowValueField]; result[highValueField] += item[highValueField]; return result }, result) } return result } function getMinMaxAggregator(compare) { return function(_ref, series) { var intervalStart = _ref.intervalStart, data = _ref.data; var valueField = series.getValueFields()[0]; var targetData = data[0]; targetData = data.reduce(function(result, item) { var value = item[valueField]; if (null === result[valueField]) { result = item } if (null !== value && compare(value, result[valueField])) { return item } return result }, targetData); return _extend({}, targetData, _defineProperty({}, series.getArgumentField(), intervalStart)) } } function checkFields(data, fieldsToCheck, skippedFields) { var allFieldsIsValid = true; for (var field in fieldsToCheck) { var isArgument = "argument" === field; if (isArgument || "size" === field ? !_isDefined(data[field]) : void 0 === data[field]) { var selector = fieldsToCheck[field]; if (!isArgument) { skippedFields[selector] = (skippedFields[selector] || 0) + 1 } allFieldsIsValid = false } } return allFieldsIsValid } var baseScatterMethods = { _defaultDuration: DEFAULT_DURATION, _defaultTrackerWidth: DEFAULT_TRACKER_WIDTH, _applyStyle: _noop, _updateOptions: _noop, _parseStyle: _noop, _prepareSegment: _noop, _drawSegment: _noop, _appendInGroup: function() { this._group.append(this._extGroups.seriesGroup) }, _createLegendState: function(styleOptions, defaultColor) { return { fill: styleOptions.color || defaultColor, hatching: styleOptions.hatching ? _extend({}, styleOptions.hatching, { direction: "right" }) : void 0 } }, _applyElementsClipRect: function(settings) { settings["clip-path"] = this._paneClipRectID }, _applyMarkerClipRect: function(settings) { settings["clip-path"] = 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; var settings = that._createPointStyles(that._getMarkerGroupOptions()).normal; settings.class = "dxc-markers"; settings.opacity = 1; that._applyMarkerClipRect(settings); that._markersGroup.attr(settings) }, getVisibleArea: function() { return this._visibleArea }, areErrorBarsVisible: function() { var errorBarOptions = this._options.valueErrorBar; return errorBarOptions && this._errorBarsEnabled() && "none" !== errorBarOptions.displayMode && (isErrorBarTypeCorrect(_normalizeEnum(errorBarOptions.type)) || _isDefined(errorBarOptions.lowValueField) || _isDefined(errorBarOptions.highValueField)) }, groupPointsByCoords: function(rotated) { var cat = []; _each(this.getVisiblePoints(), function(_, p) { var pointCoord = parseInt(rotated ? p.vy : p.vx); if (!cat[pointCoord]) { cat[pointCoord] = p } else { Array.isArray(cat[pointCoord]) ? cat[pointCoord].push(p) : cat[pointCoord] = [cat[pointCoord], p] } }); return cat }, _createErrorBarGroup: function(animationEnabled) { var that = this; var errorBarOptions = that._options.valueErrorBar; var settings; 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, "clip-path": 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 that = this; var defaultPointOptions; var creatingPointOptions = that._predefinedPointOptions; var normalStyle; 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 }, _getPointOptions: function() { return this._parsePointOptions(this._preparePointOptions(), this._options.label) }, _getOptionsForPoint: function() { return this._options.point }, _parsePointStyle: function(style, defaultColor, defaultBorderColor, defaultSize) { var border = style.border || {}; var sizeValue = void 0 !== style.size ? style.size : defaultSize; return { fill: style.color || defaultColor, stroke: border.color || defaultBorderColor, "stroke-width": border.visible ? border.width : 0, r: sizeValue / 2 + (border.visible && 0 !== sizeValue ? ~~(border.width / 2) || 0 : 0) } }, _createPointStyles: function(pointOptions) { var that = this; var mainPointColor = pointOptions.color || that._options.mainSeriesColor; var containerColor = that._options.containerBackgroundColor; var normalStyle = that._parsePointStyle(pointOptions, mainPointColor, mainPointColor); normalStyle.visibility = pointOptions.visible ? "visible" : "hidden"; return { normal: normalStyle, hover: that._parsePointStyle(pointOptions.hoverStyle, containerColor, mainPointColor, pointOptions.size), selection: that._parsePointStyle(pointOptions.selectionStyle, containerColor, mainPointColor, pointOptions.size) } }, _checkData: function(data, skippedFields, fieldsToCheck) { fieldsToCheck = fieldsToCheck || { value: this.getValueFields()[0] }; fieldsToCheck.argument = this.getArgumentField(); return checkFields(data, fieldsToCheck, skippedFields || {}) && data.value === data.value }, getValueRangeInitialValue: function() { return }, _getRangeData: function() { return rangeCalculator.getRangeData(this) }, _getPointDataSelector: function() { var _this = this; var valueField = this.getValueFields()[0]; var argumentField = this.getArgumentField(); var tagField = this.getTagField(); var areErrorBarsVisible = this.areErrorBarsVisible(); var lowValueField; var highValueField; if (areErrorBarsVisible) { var errorBarOptions = this._options.valueErrorBar; lowValueField = errorBarOptions.lowValueField || LOW_ERROR; highValueField = errorBarOptions.highValueField || HIGH_ERROR } return function(data) { var pointData = { value: _this._processEmptyValue(data[valueField]), argument: data[argumentField], tag: data[tagField], data: data }; if (areErrorBarsVisible) { pointData.lowError = data[lowValueField]; pointData.highError = data[highValueField] } return pointData } }, _errorBarsEnabled: function() { return this.valueAxisType !== DISCRETE && this.valueAxisType !== LOGARITHMIC && this.valueType !== DATETIME }, _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() } }, _animateComplete: function() { var that = this; var 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; var 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 }) }) }, _defaultAggregator: "avg", _aggregators: { avg: function(_ref2, series) { var _calculateAvgErrorBar; var data = _ref2.data, intervalStart = _ref2.intervalStart; if (!data.length) { return } var valueField = series.getValueFields()[0]; var aggregationResult = data.reduce(function(result, item) { var value = item[valueField]; if (_isDefined(value)) { result[0] += value; result[1]++ } else { if (null === value) { result[2]++ } } return result }, [0, 0, 0]); return calculateAvgErrorBars((_calculateAvgErrorBar = {}, _defineProperty(_calculateAvgErrorBar, valueField, aggregationResult[2] === data.length ? null : aggregationResult[0] / aggregationResult[1]), _defineProperty(_calculateAvgErrorBar, series.getArgumentField(), intervalStart), _calculateAvgErrorBar), data, series) }, sum: function(_ref3, series) { var _calculateSumErrorBar; var intervalStart = _ref3.intervalStart, data = _ref3.data; if (!data.length) { return } var valueField = series.getValueFields()[0]; var aggregationResult = data.reduce(function(result, item) { var value = item[valueField]; if (void 0 !== value) { result[0] += value } if (null === value) { result[1]++ } else { if (void 0 === value) { result[2]++ } } return result }, [0, 0, 0]); var value = aggregationResult[0]; if (aggregationResult[1] === data.length) { value = null } if (aggregationResult[2] === data.length) { return } return calculateSumErrorBars((_calculateSumErrorBar = {}, _defineProperty(_calculateSumErrorBar, valueField, value), _defineProperty(_calculateSumErrorBar, series.getArgumentField(), intervalStart), _calculateSumErrorBar), data, series) }, count: function(_ref4, series) { var _ref5; var data = _ref4.data, intervalStart = _ref4.intervalStart; var valueField = series.getValueFields()[0]; return _ref5 = {}, _defineProperty(_ref5, series.getArgumentField(), intervalStart), _defineProperty(_ref5, valueField, data.filter(function(i) { return void 0 !== i[valueField] }).length), _ref5 }, min: getMinMaxAggregator(function(a, b) { return a < b }), max: getMinMaxAggregator(function(a, b) { return a > b }) }, _endUpdateData: function() { delete this._predefinedPointOptions }, getArgumentField: function() { return this._options.argumentField || "arg" }, getValueFields: function() { var options = this._options; var errorBarsOptions = options.valueErrorBar; var valueFields = [options.valueField || "val"]; var lowValueField; var highValueField; 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 that = this; var options = that._options; var errorBarsOptions = options.valueErrorBar; var errorBarType = _normalizeEnum(errorBarsOptions.type); var floatErrorValue = parseFloat(errorBarsOptions.value); var valueField = that.getValueFields()[0]; var value; var lowValueField = errorBarsOptions.lowValueField || LOW_ERROR; var highValueField = errorBarsOptions.highValueField || HIGH_ERROR; var valueArray; var valueArrayLength; var meanValue; var processDataItem; var addSubError = function(_i, item) { value = item.value; item.lowError = value - floatErrorValue; item.highError = value + floatErrorValue }; switch (errorBarType) { case FIXED: processDataItem = addSubError; break; case PERCENT: processDataItem = function(_, item) { value = item.value; var error = value * floatErrorValue / 100; item.lowError = value - error; item.highError = value + error }; break; case UNDEFINED: processDataItem = function(_, item) { item.lowError = item.data[lowValueField]; item.highError = item.data[highValueField] }; break; default: valueArray = _map(data, function(item) { return _isDefined(item.data[valueField]) ? item.data[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.lowError = meanValue - floatErrorValue; item.highError = meanValue + floatErrorValue }; break; case STANDARD_ERROR: floatErrorValue = _sqrt(variance(valueArray, sum(valueArray) / valueArrayLength) / valueArrayLength) * floatErrorValue; processDataItem = addSubError } } processDataItem && _each(data, processDataItem) }, _patchMarginOptions: function(options) { var pointOptions = this._getCreatingPointOptions(); var styles = pointOptions.styles; var maxSize = [styles.normal, styles.hover, styles.selection].reduce(function(max, style) { return _max(max, 2 * style.r + style["stroke-width"]) }, 0); options.size = pointOptions.visible ? maxSize : 0; options.sizePointNormalState = pointOptions.visible ? 2 * styles.normal.r + styles.normal["stroke-width"] : 2; return options }, usePointsToDefineAutoHiding: function() { return true } }; exports.chart = _extend({}, baseScatterMethods, { drawTrackers: function() { var that = this; var trackers; var trackersGroup; var segments = that._segments || []; var rotated = that._options.rotated; 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({ "clip-path": 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 = that.groupPointsByCoords(rotated) }, checkAxisVisibleAreaCoord: function(isArgument, coord) { var axis = isArgument ? this.getArgumentAxis() : this.getValueAxis(); var visibleArea = axis.getVisibleArea(); return _isDefined(coord) && visibleArea[0] <= coord && visibleArea[1] >= coord }, checkSeriesViewportCoord: function(axis, coord) { return true }, getSeriesPairCoord: function(coord, isArgument) { var oppositeCoord = null; var isOpposite = !isArgument && !this._options.rotated || isArgument && this._options.rotated; var coordName = !isOpposite ? "vx" : "vy"; var oppositeCoordName = !isOpposite ? "vy" : "vx"; var points = this.getVisiblePoints(); for (var i = 0; i < points.length; i++) { var p = points[i]; var tmpCoord = p[coordName] === coord ? p[oppositeCoordName] : void 0; if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) { oppositeCoord = tmpCoord; break } } return oppositeCoord }, getNearestPointsByCoord: function(coord, isArgument) { var that = this; var rotated = that.getOptions().rotated; var isOpposite = !isArgument && !rotated || isArgument && rotated; var coordName = isOpposite ? "vy" : "vx"; var points = that.getVisiblePoints(); var allPoints = that.getPoints(); var nearestPoints = []; if (that.isVisible() && allPoints.length > 0) { if (allPoints.length > 1) { that.findNeighborPointsByCoord(coord, coordName, points.slice(0), allPoints, function(point, nextPoint) { nearestPoints.push([point, nextPoint]) }) } else { if (allPoints[0][coordName] === coord) { nearestPoints.push([allPoints[0], allPoints[0]]) } } } return nearestPoints }, findNeighborPointsByCoord: function(coord, coordName, points, allPoints, pushNeighborPoints) { var searchPoints = allPoints; if (points.length > 0) { points.splice(0, 0, allPoints[allPoints.indexOf(points[0]) - 1]); points.splice(points.length, 0, allPoints[allPoints.indexOf(points[points.length - 1]) + 1]); searchPoints = points } searchPoints.forEach(function(p, i) { var np = searchPoints[i + 1]; if (p && np && (p[coordName] <= coord && np[coordName] >= coord || p[coordName] >= coord && np[coordName] <= coord)) { pushNeighborPoints(p, np) } }) }, getNeighborPoint: function(x, y) { var pCoord = this._options.rotated ? y : x; var nCoord = pCoord; var cat = this._trackersTranslator; var point = null; var minDistance; var oppositeCoord = this._options.rotated ? x : y; var 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 (Array.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 }, _applyVisibleArea: function() { var that = this; var rotated = that._options.rotated; var visibleX = (rotated ? that.getValueAxis() : that.getArgumentAxis()).getVisibleArea(); var visibleY = (rotated ? that.getArgumentAxis() : that.getValueAxis()).getVisibleArea(); that._visibleArea = { minX: visibleX[0], maxX: visibleX[1], minY: visibleY[0], maxY: visibleY[1] } }, getPointCenterByArg: function(arg) { var point = this.getPointsByArg(arg)[0]; return point ? point.getCenterCoord() : void 0 } }); exports.polar = _extend({}, baseScatterMethods, { drawTrackers: function() { exports.chart.drawTrackers.call(this); var cat = this._trackersTranslator; var index; 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 = vizUtils.convertXYToPolar(this.getValueAxis().getCenter(), x, y); return exports.chart.getNeighborPoint.call(this, pos.phi, pos.r) }, _applyVisibleArea: function() { var that = this; var canvas = that.getValueAxis().getCanvas(); that._visibleArea = { minX: canvas.left, maxX: canvas.width - canvas.right, minY: canvas.top, maxY: canvas.height - canvas.bottom } } }) }, /*!**************************************************!*\ !*** ./artifacts/transpiled/viz/core/tooltip.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); var _window2 = _interopRequireDefault(_window); var _inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33); var _inflector2 = _interopRequireDefault(_inflector); var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _renderer3 = __webpack_require__( /*! ./renderers/renderer */ 175); var _renderer4 = _interopRequireDefault(_renderer3); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _type2 = _interopRequireDefault(_type); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _utils = __webpack_require__( /*! ./utils */ 10); var _utils2 = _interopRequireDefault(_utils); var _format_helper = __webpack_require__( /*! ../../format_helper */ 64); var _plaque = __webpack_require__( /*! ./plaque */ 403); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var mathCeil = Math.ceil; var mathMax = Math.max; var mathMin = Math.min; var window = _window2.default.getWindow(); function hideElement($element) { $element.css({ left: "-9999px" }).detach() } function getSpecialFormatOptions(options, specialFormat) { var result = options; switch (specialFormat) { case "argument": result = { format: options.argumentFormat }; break; case "percent": result = { format: { type: "percent", precision: options.format && options.format.percentPrecision } } } return result } function Tooltip(params) { var that = this; var renderer; that._eventTrigger = params.eventTrigger; that._widgetRoot = params.widgetRoot; that._wrapper = (0, _renderer2.default)("
").css({ position: "absolute", overflow: "hidden", pointerEvents: "none" }).addClass(params.cssClass); that._renderer = renderer = new _renderer4.default.Renderer({ pathModified: params.pathModified, container: that._wrapper[0] }); var root = renderer.root; root.attr({ "pointer-events": "none" }); that._text = renderer.text(void 0, 0, 0); that._textGroupHtml = (0, _renderer2.default)("
").css({ position: "absolute", padding: 0, margin: 0, border: "0px solid transparent" }).appendTo(that._wrapper); that._textHtml = (0, _renderer2.default)("
").css({ position: "relative", display: "inline-block", padding: 0, margin: 0, border: "0px solid transparent" }).appendTo(that._textGroupHtml) } Tooltip.prototype = { constructor: Tooltip, dispose: function() { this._wrapper.remove(); this._renderer.dispose(); this._options = this._widgetRoot = null }, _getContainer: function() { var options = this._options; var container = (0, _renderer2.default)(this._widgetRoot).closest(options.container); if (0 === container.length) { container = (0, _renderer2.default)(options.container) } return (container.length ? container : (0, _renderer2.default)("body")).get(0) }, setOptions: function(options) { var _this = this; options = options || {}; var that = this; that._options = options; that._textFontStyles = _utils2.default.patchFontOptions(options.font); that._textFontStyles.color = options.font.color; that._wrapper.css({ zIndex: options.zIndex }); that._customizeTooltip = options.customizeTooltip; var textGroupHtml = that._textGroupHtml; var textHtml = that._textHtml; if (this.plaque) { this.plaque.clear() } this.plaque = new _plaque.Plaque({ opacity: that._options.opacity, color: that._options.color, border: that._options.border, paddingLeftRight: that._options.paddingLeftRight, paddingTopBottom: that._options.paddingTopBottom, arrowLength: that._options.arrowLength, arrowWidth: 20, shadow: that._options.shadow, cornerRadius: that._options.cornerRadius }, that, that._renderer.root, function(tooltip, group) { var state = tooltip._state; if (state.html) { if (!state.isRendered) { that._text.attr({ text: "" }); textGroupHtml.css({ color: state.textColor, width: null }); textHtml.html(state.html); state.isRendered = true } } else { that._text.css({ fill: state.textColor }).attr({ text: state.text, "class": options.cssClass }).append(group.attr({ align: options.textAlignment })) } _this.plaque.customizeCloud({ fill: state.color, stroke: state.borderColor }) }, true, function(tooltip, g) { var state = tooltip._state; if (state.html) { var bBox; var getComputedStyle = window.getComputedStyle; if (getComputedStyle) { bBox = getComputedStyle(textHtml.get(0)); bBox = { x: 0, y: 0, width: mathCeil(parseFloat(bBox.width)), height: mathCeil(parseFloat(bBox.height)) } } else { bBox = textHtml.get(0).getBoundingClientRect(); bBox = { x: 0, y: 0, width: mathCeil(bBox.width ? bBox.width : bBox.right - bBox.left), height: mathCeil(bBox.height ? bBox.height : bBox.bottom - bBox.top) } } return bBox } return g.getBBox() }, function(tooltip, g, x, y) { var state = tooltip._state; if (state.html) { that._textGroupHtml.css({ left: x, top: y }) } else { g.move(x, y) } }); return that }, setRendererOptions: function(options) { this._renderer.setOptions(options); this._textGroupHtml.css({ direction: options.rtl ? "rtl" : "ltr" }); return this }, render: function() { var that = this; hideElement(that._wrapper); var normalizedCSS = {}; for (var name in that._textFontStyles) { normalizedCSS[_inflector2.default.camelize(name)] = that._textFontStyles[name] } that._textGroupHtml.css(normalizedCSS); that._text.css(that._textFontStyles); that._eventData = null; return that }, update: function(options) { return this.setOptions(options).render() }, _prepare: function(formatObject, state) { var customizeTooltip = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this._customizeTooltip; var options = this._options; var customize = {}; if (_type2.default.isFunction(customizeTooltip)) { customize = customizeTooltip.call(formatObject, formatObject); customize = _type2.default.isPlainObject(customize) ? customize : {}; if ("text" in customize) { state.text = _type2.default.isDefined(customize.text) ? String(customize.text) : "" } if ("html" in customize) { state.html = _type2.default.isDefined(customize.html) ? String(customize.html) : "" } } if (!("text" in state) && !("html" in state)) { state.text = formatObject.valueText || formatObject.description || "" } state.color = customize.color || options.color; state.borderColor = customize.borderColor || (options.border || {}).color; state.textColor = customize.fontColor || (options.font || {}).color; return !!state.text || !!state.html }, show: function(formatObject, params, eventData, customizeTooltip) { var that = this; var state = {}; if (!that._prepare(formatObject, state, customizeTooltip)) { return false } that._state = state; that._wrapper.appendTo(that._getContainer()); that._textHtml.html(""); this.plaque.clear().draw((0, _extend.extend)({}, that._options, { canvas: that._getCanvas() }, state, { x: params.x, y: params.y, offset: params.offset })); that.moveWrapper(); that._eventData && that._eventTrigger("tooltipHidden", that._eventData); that._eventData = eventData; that._eventTrigger("tooltipShown", that._eventData); return true }, hide: function() { var that = this; hideElement(that._wrapper); that._eventData && that._eventTrigger("tooltipHidden", that._eventData); that._eventData = null }, move: function(x, y, offset) { this.plaque.draw({ x: x, y: y, offset: offset, canvas: this._getCanvas() }); this.moveWrapper() }, moveWrapper: function() { var that = this; var plaqueBBox = this.plaque.getBBox(); that._renderer.resize(plaqueBBox.width, plaqueBBox.height); var offset = that._wrapper.css({ left: 0, top: 0 }).offset(); var left = plaqueBBox.x; var top = plaqueBBox.y; that._wrapper.css({ left: left - offset.left, top: top - offset.top }); this.plaque.moveRoot(-left, -top); if (this._state.html) { that._textHtml.css({ left: -left, top: -top }); that._textGroupHtml.css({ width: plaqueBBox.width }) } }, formatValue: function(value, _specialFormat) { var options = _specialFormat ? getSpecialFormatOptions(this._options, _specialFormat) : this._options; return (0, _format_helper.format)(value, options.format) }, getLocation: function() { return _utils2.default.normalizeEnum(this._options.location) }, isEnabled: function() { return !!this._options.enabled }, isShared: function() { return !!this._options.shared }, _getCanvas: function() { var container = this._getContainer(); var containerBox = container.getBoundingClientRect(); var html = _dom_adapter2.default.getDocumentElement(); var document = _dom_adapter2.default.getDocument(); var left = window.pageXOffset || html.scrollLeft || 0; var top = window.pageYOffset || html.scrollTop || 0; var box = { left: left, top: top, width: html.clientWidth + left || 0, height: mathMax(document.body.scrollHeight, html.scrollHeight, document.body.offsetHeight, html.offsetHeight, document.body.clientHeight, html.clientHeight) || 0, right: 0, bottom: 0 }; if (container !== _dom_adapter2.default.getBody()) { left = mathMax(box.left, box.left + containerBox.left); top = mathMax(box.top, box.top + containerBox.top); box.width = mathMin(containerBox.width, box.width) + left + box.left; box.height = mathMin(containerBox.height, box.height) + top + box.top; box.left = left; box.top = top } return box } }; exports.Tooltip = Tooltip; exports.plugin = { name: "tooltip", init: function() { this._initTooltip() }, dispose: function() { this._disposeTooltip() }, members: { _initTooltip: function() { this._tooltip = new exports.Tooltip({ cssClass: this._rootClassPrefix + "-tooltip", eventTrigger: this._eventTrigger, pathModified: this.option("pathModified"), widgetRoot: this.element() }) }, _disposeTooltip: function() { this._tooltip.dispose(); this._tooltip = null }, _setTooltipRendererOptions: function() { this._tooltip.setRendererOptions(this._getRendererOptions()) }, _setTooltipOptions: function() { this._tooltip.update(this._getOption("tooltip")) } }, extenders: { _stopCurrentHandling: function() { this._tooltip && this._tooltip.hide() } }, customize: function(constructor) { var proto = constructor.prototype; proto._eventsMap.onTooltipShown = { name: "tooltipShown" }; proto._eventsMap.onTooltipHidden = { name: "tooltipHidden" }; constructor.addChange({ code: "TOOLTIP_RENDERER", handler: function() { this._setTooltipRendererOptions() }, isThemeDependent: true, isOptionChange: true }); constructor.addChange({ code: "TOOLTIP", handler: function() { this._setTooltipOptions() }, isThemeDependent: true, isOptionChange: true, option: "tooltip" }) }, fontFields: ["tooltip.font"] } }, /*!*******************************************************!*\ !*** ./artifacts/transpiled/viz/translators/range.js ***! \*******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var _isDefined = typeUtils.isDefined; var _isDate = typeUtils.isDate; var _isFunction = typeUtils.isFunction; var unique = __webpack_require__( /*! ../core/utils */ 10).unique; var minSelector = "min"; var maxSelector = "max"; var minVisibleSelector = "minVisible"; var maxVisibleSelector = "maxVisible"; var baseSelector = "base"; var 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) } } } var _Range = exports.Range = function(range) { range && extend(this, range) }; _Range.prototype = { constructor: _Range, addRange: function(otherRange) { var that = this; var categories = that.categories; var 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] }; checkField("invert"); checkField(axisTypeSelector); checkField("dataType"); checkField("isSpacedMargin"), checkField("checkMinDataVisibility"); checkField("checkMaxDataVisibility"); 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 }, isEmpty: function() { return (!_isDefined(this[minSelector]) || !_isDefined(this[maxSelector])) && (!this.categories || 0 === this.categories.length) }, 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 }, sortCategories: function(sort) { if (false === sort || !this.categories) { return } if (Array.isArray(sort)) { var sortValues = sort.map(function(item) { return item.valueOf() }); var filteredSeriesCategories = this.categories.filter(function(item) { return sortValues.indexOf(item.valueOf()) === -1 }); this.categories = sort.concat(filteredSeriesCategories) } else { var notAFunction = !_isFunction(sort); if (notAFunction && "string" !== this.dataType) { sort = function(a, b) { return a.valueOf() - b.valueOf() } } else { if (notAFunction) { sort = false } } sort && this.categories.sort(sort) } } } }, /*!**********************************************************!*\ !*** ./artifacts/transpiled/ui/widget/empty_template.js ***! \**********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74); var EmptyTemplate = TemplateBase.inherit({ _renderCore: function() { return $() } }); module.exports = EmptyTemplate }, /*!**************************************************!*\ !*** ./artifacts/transpiled/data/odata/utils.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var Class = __webpack_require__( /*! ../../core/class */ 15); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3); var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58); var _Guid = __webpack_require__( /*! ../../core/guid */ 40); var isDefined = typeUtils.isDefined; var isPlainObject = typeUtils.isPlainObject; var grep = __webpack_require__( /*! ../../core/utils/common */ 4).grep; var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred; var errors = __webpack_require__( /*! ../errors */ 36).errors; var dataUtils = __webpack_require__( /*! ../utils */ 41); 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"; var makeArray = function(value) { return "string" === typeUtils.type(value) ? value.split() : value }; var hasDot = function(x) { return /\./.test(x) }; var pad = function(text, length, right) { text = String(text); while (text.length < length) { text = right ? text + "0" : "0" + text } return text }; function formatISO8601(date, skipZeroTime, skipTimezone) { var bag = []; var isZeroTime = function() { return date.getHours() + date.getMinutes() + date.getSeconds() + date.getMilliseconds() < 1 }; var padLeft2 = function(text) { return pad(text, 2) }; bag.push(date.getFullYear()); bag.push("-"); bag.push(padLeft2(date.getMonth() + 1)); bag.push("-"); bag.push(padLeft2(date.getDate())); if (!(skipZeroTime && isZeroTime())) { bag.push("T"); bag.push(padLeft2(date.getHours())); bag.push(":"); bag.push(padLeft2(date.getMinutes())); bag.push(":"); bag.push(padLeft2(date.getSeconds())); if (date.getMilliseconds()) { bag.push("."); bag.push(pad(date.getMilliseconds(), 3)) } if (!skipTimezone) { bag.push("Z") } } return bag.join("") } function parseISO8601(isoString) { var result = new Date(60 * new Date(0).getTimezoneOffset() * 1e3); var chunks = isoString.replace("Z", "").split("T"); var date = /(\d{4})-(\d{2})-(\d{2})/.exec(chunks[0]); var 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 (Array.isArray(time) && time.length) { result.setHours(Number(time[1])); result.setMinutes(Number(time[2])); result.setSeconds(Number(time[3])); var fractional = (time[4] || "").slice(0, 3); fractional = pad(fractional, 3, true); result.setMilliseconds(Number(fractional)) } 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 param = function(params) { var result = []; for (var name in params) { result.push(name + "=" + params[name]) } return result.join("&") }; var ajaxOptionsForRequest = function(protocolVersion, request, options) { request = extend({ async: true, method: "get", url: "", params: {}, payload: null, headers: {}, timeout: 3e4 }, request); options = options || {}; var beforeSend = options.beforeSend; if (beforeSend) { beforeSend(request) } var method = (request.method || "get").toLowerCase(); var isGet = "get" === method; var useJsonp = isGet && options.jsonp; var params = extend({}, request.params); var ajaxData = isGet ? params : formatPayload(request.payload); var qs = !isGet && param(params); var url = request.url; var 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", method: method, async: request.async, timeout: request.timeout, headers: request.headers, contentType: contentType, accepts: { json: [JSON_VERBOSE_MIME_TYPE, "text/plain"].join() }, xhrFields: { withCredentials: options.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 sendRequest(protocolVersion, request, options) { var d = new Deferred; var ajaxOptions = ajaxOptionsForRequest(protocolVersion, request, options); ajax.sendRequest(ajaxOptions).always(function(obj, textStatus) { var transformOptions = { deserializeDates: options.deserializeDates, fieldTypes: options.fieldTypes }; var tuple = interpretJsonFormat(obj, textStatus, transformOptions, ajaxOptions); var error = tuple.error; var data = tuple.data; var nextUrl = tuple.nextUrl; var extra; if (error) { if (error.message !== dataUtils.XHR_ERROR_UNLOAD) { d.reject(error) } } else { if (options.countOnly) { if (isFinite(tuple.count)) { d.resolve(tuple.count) } else { d.reject(new errors.Error("E4018")) } } else { if (nextUrl && !options.isPaged) { if (!isAbsoluteUrl(nextUrl)) { nextUrl = toAbsoluteUrl(ajaxOptions.url, nextUrl) } sendRequest(protocolVersion, { url: nextUrl }, options).fail(d.reject).done(function(nextData) { d.resolve(data.concat(nextData)) }) } else { if (isFinite(tuple.count)) { extra = { totalCount: tuple.count } } d.resolve(data, extra) } } } }); return d.promise() }; var formatDotNetError = function(errorObj) { var message; var 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 && message.indexOf("inner exception") === -1) { break } } return message }; var errorFromResponse = function(obj, textStatus, ajaxOptions) { if ("nocontent" === textStatus) { return null } var message = "Unknown error"; var response = obj; var httpStatus = 200; var errorData = { requestOptions: ajaxOptions }; if ("success" !== textStatus) { httpStatus = obj.status; message = dataUtils.errorMessageFromXhr(obj, textStatus); try { response = JSON.parse(obj.responseText) } catch (x) {} } var errorObj = response && (response.then && response || response.error || response["odata.error"] || response["@odata.error"]); if (errorObj) { message = formatDotNetError(errorObj) || message; errorData.errorDetails = errorObj; if (200 === httpStatus) { httpStatus = 500 } var customCode = Number(errorObj.code); if (isFinite(customCode) && customCode >= 400) { httpStatus = customCode } } if (httpStatus >= 400 || 0 === httpStatus) { errorData.httpStatus = httpStatus; return extend(Error(message), errorData) } return null }; var interpretJsonFormat = function(obj, textStatus, transformOptions, ajaxOptions) { var error = errorFromResponse(obj, textStatus, ajaxOptions); var value; if (error) { return { error: error } } if (!isPlainObject(obj)) { return { data: obj } } if ("d" in obj && (Array.isArray(obj.d) || typeUtils.isObject(obj.d))) { value = interpretVerboseJsonFormat(obj, textStatus) } else { value = interpretLightJsonFormat(obj, textStatus) } transformTypes(value, transformOptions); return value }; var interpretVerboseJsonFormat = function(obj) { var data = obj.d; if (!isDefined(data)) { return { error: Error("Malformed or unsupported JSON response received") } } 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 transformTypes(obj, options) { options = options || {}; each(obj, function(key, value) { if (null !== value && "object" === _typeof(value)) { if ("results" in value) { obj[key] = value.results } transformTypes(obj[key], options) } else { if ("string" === typeof value) { var fieldTypes = options.fieldTypes; var canBeGuid = !fieldTypes || "String" !== fieldTypes[key]; if (canBeGuid && GUID_REGEX.test(value)) { obj[key] = new _Guid(value) } if (false !== options.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 serializeValueV4(value) { if (value instanceof Date) { return formatISO8601(value, false, false) } if (value instanceof _Guid) { return value.valueOf() } if (Array.isArray(value)) { return "[" + value.map(function(item) { return serializeValueV4(item) }).join(",") + "]" } 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") } }; var convertPrimitiveValue = function(type, value) { if (null === value) { return null } var converter = keyConverters[type]; if (!converter) { throw errors.Error("E4014", type) } return converter(value) }; var generateSelect = function(oDataVersion, select) { if (!select) { return } if (oDataVersion < 4) { return serializePropName(select.join()) } return grep(select, hasDot, true).join() }; var generateExpand = function(oDataVersion, expand, select) { var generatorV2 = function() { var hash = {}; if (expand) { iteratorUtils.each(makeArray(expand), function() { hash[serializePropName(this)] = 1 }) } if (select) { iteratorUtils.each(makeArray(select), function() { var path = this.split("."); if (path.length < 2) { return } path.pop(); hash[serializePropName(path.join("."))] = 1 }) } return iteratorUtils.map(hash, function(k, v) { return v }).join() }; var generatorV4 = function() { var format = function(hash) { var formatCore = function formatCore(hash) { var result = ""; var selectValue = []; var expandValue = []; iteratorUtils.each(hash, function(key, value) { if (Array.isArray(value)) { [].push.apply(selectValue, value) } if (isPlainObject(value)) { expandValue.push(key + formatCore(value)) } }); if (selectValue.length || expandValue.length) { result += "("; if (selectValue.length) { result += "$select=" + iteratorUtils.map(selectValue, serializePropName).join() } if (expandValue.length) { if (selectValue.length) { result += ";" } result += "$expand=" + iteratorUtils.map(expandValue, serializePropName).join() } result += ")" } return result }; var result = []; iteratorUtils.each(hash, function(key, value) { result.push(key + formatCore(value)) }); return result.join() }; var parseTree = function(exprs, root, stepper) { var parseCore = function parseCore(exprParts, root, stepper) { var result = stepper(root, exprParts.shift(), exprParts); if (false === result) { return } parseCore(exprParts, result, stepper) }; iteratorUtils.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() }; exports.sendRequest = sendRequest; exports.serializePropName = serializePropName; exports.serializeValue = serializeValue; exports.serializeKey = serializeKey; exports.keyConverters = keyConverters; exports.convertPrimitiveValue = convertPrimitiveValue; exports.generateExpand = generateExpand; exports.generateSelect = generateSelect; exports.EdmLiteral = EdmLiteral; exports.OData__internals = { interpretJsonFormat: interpretJsonFormat } }, /*!*********************************************!*\ !*** ./artifacts/transpiled/core/action.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ./renderer */ 2); var config = __webpack_require__( /*! ./config */ 31); var window = __webpack_require__( /*! ./utils/window */ 7).getWindow(); var typeUtils = __webpack_require__( /*! ./utils/type */ 1); var each = __webpack_require__( /*! ./utils/iterator */ 3).each; var Class = __webpack_require__( /*! ./class */ 15); var errors = __webpack_require__( /*! ./errors */ 21); 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; var afterExecute = this._afterExecute; var argsBag = e.args[0] || {}; if ("jQueryEvent" in argsBag && !argsBag.event) { throw "The jQueryEvent field is deprecated. Please, use the `event` field instead" } if (!("jQueryEvent" in argsBag) && argsBag.event && config().useJQuery) { Object.defineProperty(argsBag, "jQueryEvent", { get: function() { errors.log("W0003", "Handler argument", "jQueryEvent", "17.2", "Use the 'event' field instead"); return argsBag.event }, set: function(value) { errors.log("W0003", "Handler argument", "jQueryEvent", "17.2", "Use the 'event' field instead"); argsBag.event = value } }) } if (!this._validateAction(e)) { return } beforeExecute && beforeExecute.call(this._context, e); if (e.cancel) { return } var result = this._executeAction(e); if (argsBag.cancel) { return } afterExecute && afterExecute.call(this._context, e); return result }, _validateAction: function(e) { var excludeValidators = this._excludeValidators; var 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; var 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 (typeUtils.isPlainObject(name)) { each(name, Action.registerExecutor); return } Action.executors[name] = executor }; Action.unregisterExecutor = function() { var args = [].slice.call(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 (typeUtils.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]; var element = args[e.validatingTargetName] || args.element; if (element && condition($(element))) { e.cancel = true } } }; Action.registerExecutor({ 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 }, /*!*************************************************!*\ !*** ./artifacts/transpiled/animation/frame.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7); var window = windowUtils.hasWindow() ? windowUtils.getWindow() : {}; var callOnce = __webpack_require__( /*! ../core/utils/call_once */ 63); var FRAME_ANIMATION_STEP_TIME = 1e3 / 60; var request = function(callback) { return setTimeout(callback, FRAME_ANIMATION_STEP_TIME) }; var cancel = function(requestID) { clearTimeout(requestID) }; var setAnimationFrameMethods = callOnce(function() { var nativeRequest = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame; var nativeCancel = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame; if (nativeRequest && nativeCancel) { request = nativeRequest; cancel = nativeCancel } if (nativeRequest && !nativeCancel) { var canceledRequests = {}; request = function(callback) { var requestId = nativeRequest.call(window, function() { try { if (requestId in canceledRequests) { return } callback.apply(this, arguments) } finally { delete canceledRequests[requestId] } }); return requestId }; cancel = function(requestId) { canceledRequests[requestId] = true } } }); exports.requestAnimationFrame = function() { setAnimationFrameMethods(); return request.apply(window, arguments) }; exports.cancelAnimationFrame = function() { setAnimationFrameMethods(); cancel.apply(window, arguments) } }, /*!***********************************************************************!*\ !*** ./artifacts/transpiled/ui/file_manager/ui.file_manager.utils.js ***! \***********************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var PATH_SEPARATOR = "/"; var getFileExtension = function(path) { var index = path.lastIndexOf("."); return index !== -1 ? path.substr(index) : "" }; var getName = function(path) { var index = path.lastIndexOf(PATH_SEPARATOR); return index !== -1 ? path.substr(index + PATH_SEPARATOR.length) : path }; var getParentPath = function(path) { var index = path.lastIndexOf(PATH_SEPARATOR); return index !== -1 ? path.substr(0, index) : "" }; var getPathParts = function(path, includeFullPath) { var result = path.split(PATH_SEPARATOR); if (includeFullPath) { for (var i = 0; i < result.length; i++) { result[i] = pathCombine(0 === i ? "" : result[i - 1], result[i]) } } return result }; var pathCombine = function() { var result = ""; (0, _iterator.each)(arguments, function(_, arg) { if (arg) { if (result) { result += PATH_SEPARATOR } result += arg } }); return result }; var getDisplayFileSize = function(byteSize) { var sizesTitles = ["B", "KB", "MB", "GB", "TB"]; var index = 0; var displaySize = byteSize; while (displaySize >= 1024 && index <= sizesTitles.length - 1) { displaySize /= 1024; index++ } displaySize = Math.round(10 * displaySize) / 10; return "".concat(displaySize, " ").concat(sizesTitles[index]) }; module.exports.getFileExtension = getFileExtension; module.exports.getName = getName; module.exports.getParentPath = getParentPath; module.exports.getPathParts = getPathParts; module.exports.pathCombine = pathCombine; module.exports.getDisplayFileSize = getDisplayFileSize }, /*!***********************************************!*\ !*** ./artifacts/transpiled/ui/number_box.js ***! \***********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./number_box/number_box */ 531) }, /*!***********************************************************!*\ !*** ./artifacts/transpiled/ui/date_box/ui.date_utils.js ***! \***********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var $ = __webpack_require__( /*! ../../core/renderer */ 2); var dateSerialization = __webpack_require__( /*! ../../core/utils/date_serialization */ 52); var isDate = __webpack_require__( /*! ../../core/utils/type */ 1).isDate; var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var dateLocalization = __webpack_require__( /*! ../../localization/date */ 32); 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"], 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", "seconds", "milliseconds"] }, datetime: { getStandardPattern: function() { var standardPattern; ! function() { var androidFormatPattern = "yyyy-MM-ddTHH:mmZ"; var testDateString = "2000-01-01T01:01Z"; var $input = $("").attr("type", "datetime"); $input.val(testDateString); if ($input.val()) { standardPattern = androidFormatPattern } }(); if (!standardPattern) { standardPattern = "yyyy-MM-ddTHH:mm:ssZ" } 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" }, SUBMIT_FORMATS_MAP: { date: "date", time: "time", datetime: "datetime-local" }, toStandardDateFormat: function(date, type) { var pattern = dateUtils.FORMATS_INFO[type].getStandardPattern(); return dateSerialization.serializeDate(date, pattern) }, fromStandardDateFormat: function(text) { var date = dateSerialization.dateParser(text); return isDate(date) ? date : void 0 }, getMaxMonthDay: function(year, month) { return new Date(year, month + 1, 0).getDate() }, mergeDates: function(oldValue, newValue, format) { if (!newValue) { return newValue || null } if (!oldValue || isNaN(oldValue.getTime())) { var now = new Date(null); oldValue = new Date(now.getFullYear(), now.getMonth(), now.getDate()) } var result = new Date(oldValue.valueOf()); var formatInfo = dateUtils.FORMATS_INFO[format]; each(formatInfo.components, function() { var componentInfo = dateUtils.DATE_COMPONENTS_INFO[this]; result[componentInfo.setter](newValue[componentInfo.getter]()) }); return result }, getLongestCaptionIndex: function(captionArray) { var longestIndex = 0; var longestCaptionLength = 0; var i; for (i = 0; i < captionArray.length; ++i) { if (captionArray[i].length > longestCaptionLength) { longestIndex = i; longestCaptionLength = captionArray[i].length } } return longestIndex }, formatUsesMonthName: function(format) { return dateLocalization.formatUsesMonthName(format) }, formatUsesDayName: function(format) { return dateLocalization.formatUsesDayName(format) }, getLongestDate: function(format, monthNames, dayNames) { var stringFormat = getStringFormat(format); var 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 }, normalizeTime: function(date) { date.setSeconds(0); date.setMilliseconds(0) } }; dateUtils.DATE_COMPONENTS_INFO = { year: { getter: "getFullYear", setter: "setFullYear", formatter: function(value, showNames, date) { var formatDate = new Date(date.getTime()); formatDate.setFullYear(value); return dateLocalization.format(formatDate, "yyyy") }, startValue: void 0, endValue: void 0 }, day: { getter: "getDate", setter: "setDate", formatter: function(value, showNames, date) { var formatDate = new Date(date.getTime()); formatDate.setDate(value); if (!showNames) { return dateLocalization.format(formatDate, "d") } return dateUtils.DATE_COMPONENT_TEXT_FORMATTER(value, dateLocalization.getDayNames()[formatDate.getDay()]) }, startValue: 1, endValue: void 0 }, month: { getter: "getMonth", setter: "setMonth", 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", formatter: function(value) { return dateLocalization.format(new Date(0, 0, 0, value), "hour") }, startValue: 0, endValue: 23 }, minutes: { getter: "getMinutes", setter: "setMinutes", formatter: function(value) { return dateLocalization.format(new Date(0, 0, 0, 0, value), "minute") }, startValue: 0, endValue: 59 }, seconds: { getter: "getSeconds", setter: "setSeconds", formatter: function(value) { return dateLocalization.format(new Date(0, 0, 0, 0, 0, value), "second") }, startValue: 0, endValue: 59 }, milliseconds: { getter: "getMilliseconds", setter: "setMilliseconds", formatter: function(value) { return dateLocalization.format(new Date(0, 0, 0, 0, 0, 0, value), "millisecond") }, startValue: 0, endValue: 999 } }; module.exports = dateUtils }, /*!***************************************************************************!*\ !*** ./artifacts/transpiled/ui/scheduler/ui.scheduler.publisher_mixin.js ***! \***************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { 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 }, /*!*******************************************************!*\ !*** ./artifacts/transpiled/viz/components/consts.js ***! \*******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { 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" }, radialLabelIndent: 30, pieLabelSpacing: 10, pieSeriesSpacing: 4 } }, /*!****************************************************************!*\ !*** ./artifacts/transpiled/viz/series/points/symbol_point.js ***! \****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend; var each = __webpack_require__( /*! ../../../core/utils/iterator */ 3).each; var noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop; var windowUtils = __webpack_require__( /*! ../../../core/utils/window */ 7); var window = windowUtils.getWindow(); var labelModule = __webpack_require__( /*! ./label */ 246); var _extend = extend; var _isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined; var _normalizeEnum = __webpack_require__( /*! ../../core/utils */ 10).normalizeEnum; var _math = Math; var _round = _math.round; var _floor = _math.floor; var _ceil = _math.ceil; var DEFAULT_IMAGE_WIDTH = 20; var DEFAULT_IMAGE_HEIGHT = 20; var LABEL_OFFSET = 10; var 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); var floorHalfRadius = _floor(r / 2); var 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; var graphic = that.graphic; if (graphic && graphic.attr("visibility")) { graphic.attr({ visibility: null }) } }, isVisible: function() { return this.inVisibleArea && this.series.isVisible() }, setInvisibility: function() { var that = this; var graphic = that.graphic; if (graphic && "hidden" !== graphic.attr("visibility")) { graphic.attr({ visibility: "hidden" }) } that._errorBar && that._errorBar.attr({ visibility: "hidden" }); that._label.draw(false) }, 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; var newSymbol = newOptions.symbol; var symbolChanged = "circle" === oldSymbol && "circle" !== newSymbol || "circle" !== oldSymbol && "circle" === newSymbol; var 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) } }, hasCoords: function() { return null !== this.x && null !== this.y }, correctValue: function(correction) { var that = this; var axis = that.series.getValueAxis(); if (that.hasValue()) { that.value = that.properValue = axis.validateUnit(that.initialValue.valueOf() + correction.valueOf()); that.minValue = axis.validateUnit(correction) } }, resetCorrection: function() { this.value = this.properValue = this.initialValue; this.minValue = CANVAS_POSITION_DEFAULT }, resetValue: function() { var that = this; if (that.hasValue()) { that.value = that.properValue = that.initialValue = 0; that.minValue = 0; that._label.setDataField("value", that.value) } }, _getTranslates: function(animationEnabled) { var translateX = this.x; var 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; var 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; var 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) { var that = this; var 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; var width = image.width || DEFAULT_IMAGE_WIDTH; var height = image.height || DEFAULT_IMAGE_HEIGHT; return { x: x - _round(width / 2), y: y - _round(height / 2), width: width, height: height } }, _getGraphicBBox: function() { var that = this; var options = that._options; var x = that.x; var y = that.y; var bBox; 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 }, hideInsideLabel: noop, _getShiftLabelCoords: function(label) { var coord = this._addLabelAlignmentAndOffset(label, this._getLabelCoords(label)); return this._checkLabelPosition(label, coord) }, _drawLabel: function() { var that = this; var customVisibility = that._getCustomLabelVisibility(); var label = that._label; var isVisible = that._showForZeroValues() && that.hasValue() && false !== customVisibility && (that.series.getLabelVisibility() || customVisibility); label.draw(!!isVisible) }, correctLabelPosition: function(label) { var that = this; var coord = that._getShiftLabelCoords(label); if (!that.hideInsideLabel(label, coord)) { 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); var w2 = bBox.width / 2; var 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; var visibleArea = that._getVisibleArea(); var labelBBox = label.getBoundingRect(); var graphicBBox = that._getGraphicBBox(label.pointPosition); var 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(); var 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; var labelBBox = label.getBoundingRect(); var graphicBBox = that._getGraphicBBox(label.pointPosition); var offset = LABEL_OFFSET; var centerY = graphicBBox.height / 2 - labelBBox.height / 2; var centerX = graphicBBox.width / 2 - labelBBox.width / 2; var x = graphicBBox.x; var 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; var options = that._options; var translates = that._getTranslates(animationEnabled); var 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)) }, _getErrorBarSettings: function() { return { visibility: "visible" } }, _getErrorBarBaseEdgeLength: function() { return 2 * this.getPointRadius() }, _drawErrorBar: function(renderer, group) { if (!this._options.errorBars) { return } var that = this; var options = that._options; var errorBarOptions = options.errorBars; var points = []; var settings; var pos = that._errorBarPos; var high = that._highErrorCoord; var low = that._lowErrorCoord; var displayMode = _normalizeEnum(errorBarOptions.displayMode); var isHighDisplayMode = "high" === displayMode; var isLowDisplayMode = "low" === displayMode; var highErrorOnly = (isHighDisplayMode || !_isDefined(low)) && _isDefined(high) && !isLowDisplayMode; var lowErrorOnly = (isLowDisplayMode || !_isDefined(high)) && _isDefined(low) && !isHighDisplayMode; var edgeLength = errorBarOptions.edgeLength; if (edgeLength <= 1 && edgeLength > 0) { edgeLength = this._getErrorBarBaseEdgeLength() * errorBarOptions.edgeLength } edgeLength = _floor(parseInt(edgeLength) / 2); 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; var graphic = that.graphic; return { x: that.x, y: that.y, offset: graphic ? graphic.getBBox().height / 2 : 0 } }, setPercentValue: function(absTotal, total, leftHoleTotal, rightHoleTotal) { var that = this; var valuePercent = that.value / absTotal || 0; var minValuePercent = that.minValue / absTotal || 0; var percent = valuePercent - minValuePercent; that._label.setDataField("percent", percent); that._label.setDataField("total", total); if (that.series.isFullStackedSeries() && that.hasValue()) { if (that.leftHole) { that.leftHole /= absTotal - leftHoleTotal; that.minLeftHole /= absTotal - leftHoleTotal } if (that.rightHole) { that.rightHole /= absTotal - rightHoleTotal; that.minRightHole /= absTotal - rightHoleTotal } that.value = that.properValue = valuePercent; that.minValue = !minValuePercent ? that.minValue : minValuePercent } }, _storeTrackerR: function() { var that = this; var navigator = window.navigator; var r = that._options.styles.normal.r; navigator = that.__debug_navigator || navigator; that.__debug_browserNavigator = navigator; var minTrackerSize = windowUtils.hasProperty("ontouchstart") || navigator.msPointerEnabled && navigator.msMaxTouchPoints || navigator.pointerEnabled && navigator.maxTouchPoints ? 20 : 6; that._options.trackerR = r < minTrackerSize ? minTrackerSize : r; return that._options.trackerR }, _translateErrorBars: function() { var that = this; var options = that._options; var rotated = options.rotated; var errorBars = options.errorBars; var translator = that._getValTranslator(); if (!errorBars) { return } _isDefined(that.lowError) && (that._lowErrorCoord = translator.translate(that.lowError)); _isDefined(that.highError) && (that._highErrorCoord = translator.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() { var that = this; var valTranslator = that._getValTranslator(); var argTranslator = that._getArgTranslator(); if (that._options.rotated) { that.vx = that.x = valTranslator.translate(that.value); that.vy = that.y = argTranslator.translate(that.argument); that.minX = valTranslator.translate(that.minValue); that.defaultX = valTranslator.translate(CANVAS_POSITION_DEFAULT) } else { that.vy = that.y = valTranslator.translate(that.value); that.vx = that.x = argTranslator.translate(that.argument); that.minY = valTranslator.translate(that.minValue); that.defaultY = valTranslator.translate(CANVAS_POSITION_DEFAULT) } that._translateErrorBars(); that._calculateVisibility(that.x, that.y) }, _updateData: function(data) { var that = this; that.value = that.properValue = 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; var r = that._options.rotated; var value = that.properValue; var 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 style = this._getStyle(); var options = this._options; var r = style.r; var extraSpace; var symbol = options.symbol; var isSquare = "square" === symbol; var 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 that = this; var options = that._options; var settings; var image = options.image; var visibility = !that.isVisible() ? { visibility: "hidden" } : {}; 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; var 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 }, getMinValue: function(noErrorBar) { var errorBarOptions = this._options.errorBars; if (errorBarOptions && !noErrorBar) { var displayMode = errorBarOptions.displayMode; var lowValue = "high" !== displayMode && _isDefined(this.lowError) ? this.lowError : this.value; var highValue = "low" !== displayMode && _isDefined(this.highError) ? this.highError : this.value; return lowValue < highValue ? lowValue : highValue } else { return this.value } }, getMaxValue: function(noErrorBar) { var errorBarOptions = this._options.errorBars; if (errorBarOptions && !noErrorBar) { var displayMode = errorBarOptions.displayMode; var lowValue = "high" !== displayMode && _isDefined(this.lowError) ? this.lowError : this.value; var highValue = "low" !== displayMode && _isDefined(this.highError) ? this.highError : this.value; return lowValue > highValue ? lowValue : highValue } else { return this.value } } } }, /*!************************************************************!*\ !*** ./artifacts/transpiled/viz/core/loading_indicator.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _patchFontOptions = __webpack_require__( /*! ./utils */ 10).patchFontOptions; var STATE_HIDDEN = 0; var STATE_SHOWN = 1; var ANIMATION_EASING = "linear"; var ANIMATION_DURATION = 400; var LOADING_INDICATOR_READY = "loadingIndicatorReady"; function LoadingIndicator(parameters) { var that = this; var renderer = parameters.renderer; that._group = renderer.g().attr({ "class": "dx-loading-indicator" }).linkOn(renderer.root, { name: "loading-indicator", after: "peripheral" }); that._rect = renderer.rect().attr({ opacity: 0 }).append(that._group); that._text = renderer.text().attr({ align: "center" }).append(that._group); that._createStates(parameters.eventTrigger, that._group, renderer.root, parameters.notify) } LoadingIndicator.prototype = { constructor: LoadingIndicator, _createStates: function(eventTrigger, group, root, notify) { var that = this; that._states = [{ opacity: 0, start: function() { notify(false) }, complete: function() { group.linkRemove(); root.css({ "pointer-events": "" }); eventTrigger(LOADING_INDICATOR_READY) } }, { opacity: .85, start: function() { group.linkAppend(); root.css({ "pointer-events": "none" }); notify(true) }, complete: function() { eventTrigger(LOADING_INDICATOR_READY) } }]; that._state = STATE_HIDDEN }, setSize: function(size) { var width = size.width; var height = size.height; this._rect.attr({ width: width, height: height }); this._text.attr({ x: width / 2, y: height / 2 }) }, setOptions: function(options) { this._rect.attr({ fill: options.backgroundColor }); this._text.css(_patchFontOptions(options.font)).attr({ text: options.text, "class": options.cssClass }); this[options.show ? "show" : "hide"]() }, dispose: function() { var that = this; that._group.linkRemove().linkOff(); that._group = that._rect = that._text = that._states = null }, _transit: function(stateId) { var that = this; var state; if (that._state !== stateId) { that._state = stateId; that._isHiding = false; state = that._states[stateId]; that._rect.stopAnimation().animate({ opacity: state.opacity }, { complete: state.complete, easing: ANIMATION_EASING, duration: ANIMATION_DURATION, unstoppable: true }); that._noHiding = true; state.start(); that._noHiding = false } }, show: function() { this._transit(STATE_SHOWN) }, hide: function() { this._transit(STATE_HIDDEN) }, scheduleHiding: function() { if (!this._noHiding) { this._isHiding = true } }, fulfillHiding: function() { if (this._isHiding) { this.hide() } } }; exports.LoadingIndicator = LoadingIndicator; exports.plugin = { name: "loading_indicator", init: function() { var that = this; that._loadingIndicator = new exports.LoadingIndicator({ eventTrigger: that._eventTrigger, renderer: that._renderer, notify: notify }); that._scheduleLoadingIndicatorHiding(); function notify(state) { that._skipLoadingIndicatorOptions = true; that.option("loadingIndicator", { show: state }); that._skipLoadingIndicatorOptions = false; if (state) { that._stopCurrentHandling() } } }, dispose: function() { this._loadingIndicator.dispose(); this._loadingIndicator = null }, members: { _scheduleLoadingIndicatorHiding: function() { this._loadingIndicator.scheduleHiding() }, _fulfillLoadingIndicatorHiding: function() { this._loadingIndicator.fulfillHiding() }, showLoadingIndicator: function() { this._loadingIndicator.show() }, hideLoadingIndicator: function() { this._loadingIndicator.hide() }, _onBeginUpdate: function() { if (!this._optionChangedLocker) { this._scheduleLoadingIndicatorHiding() } } }, extenders: { _dataSourceLoadingChangedHandler: function(isLoading) { if (isLoading && (this._options.loadingIndicator || {}).enabled) { this._loadingIndicator.show() } }, _setContentSize: function() { this._loadingIndicator.setSize(this._canvas) }, endUpdate: function() { if (this._initialized && this._dataIsReady()) { this._fulfillLoadingIndicatorHiding() } } }, customize: function(constructor) { var proto = constructor.prototype; if (proto._dataSourceChangedHandler) { var _dataSourceChangedHandler = proto._dataSourceChangedHandler; proto._dataSourceChangedHandler = function() { this._scheduleLoadingIndicatorHiding(); _dataSourceChangedHandler.apply(this, arguments) } } constructor.addChange({ code: "LOADING_INDICATOR", handler: function() { if (!this._skipLoadingIndicatorOptions) { this._loadingIndicator.setOptions(this._getOption("loadingIndicator")) } this._scheduleLoadingIndicatorHiding() }, isThemeDependent: true, option: "loadingIndicator", isOptionChange: true }); proto._eventsMap.onLoadingIndicatorReady = { name: "loadingIndicatorReady" }; var _drawn = proto._drawn; proto._drawn = function() { _drawn.apply(this, arguments); if (this._dataIsReady()) { this._fulfillLoadingIndicatorHiding() } } }, fontFields: ["loadingIndicator.font"] } }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/viz/tree_map/tiling.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction; var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum; var _round = Math.round; var algorithms = {}; var defaultAlgorithm; 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]; var getStaticSideIndex = function(rect) { return rect[2] - rect[0] < rect[3] - rect[1] ? 0 : 1 }; exports.getStaticSideIndex = getStaticSideIndex; exports.buildSidesData = function(rect, directions, _staticSideIndex) { var staticSideIndex = void 0 !== _staticSideIndex ? _staticSideIndex : getStaticSideIndex(rect); var variedSideIndex = 1 - staticSideIndex; var staticSideDirection = directions[staticSideIndex]; var variedSideDirection = directions[variedSideIndex]; var staticSideIndexOffsets = directionToIndexOffsets[staticSideDirection]; var variedSideIndexOffsets = directionToIndexOffsets[variedSideDirection]; return { staticSide: rect[2 + staticSideIndex] - rect[staticSideIndex], variedSide: rect[2 + variedSideIndex] - rect[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; var ii; var variedSidePart = [0, 0, 0, 0]; var static1 = sidesData.static1; var static2 = sidesData.static2; var position = totalRect[static1]; var dir = sidesData.staticDir; var side = sidesData.staticSide; var sum = rowData.sum; var rect; var delta; 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] } }, /*!*********************************************************!*\ !*** ./artifacts/transpiled/viz/tree_map/colorizing.js ***! \*********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum; var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var colorizers = {}; var defaultColorizerName; 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); var 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 } }, /*!*************************************************************************!*\ !*** ./artifacts/transpiled/events/core/event_registrator_callbacks.js ***! \*************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var MemorizedCallbacks = __webpack_require__( /*! ../../core/memorized_callbacks */ 177); module.exports = new MemorizedCallbacks }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/events/core/emitter.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var Class = __webpack_require__( /*! ../../core/class */ 15); var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var eventUtils = __webpack_require__( /*! ../utils */ 8); 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 !eventUtils.isDxMouseWheelEvent(e) }, validatePointers: function(e) { return 1 === eventUtils.hasTouches(e) }, allowInterruptionByMouseWheel: function() { return true }, configure: 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 }, /*!***************************************************!*\ !*** ./artifacts/transpiled/events/core/wheel.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 63); var registerEvent = __webpack_require__( /*! ./event_registrator */ 71); var eventUtils = __webpack_require__( /*! ../utils */ 8); var EVENT_NAME = "dxmousewheel"; var EVENT_NAMESPACE = "dxWheel"; var getWheelEventName = callOnce(function() { return domAdapter.hasDocumentProperty("onwheel") ? "wheel" : "mousewheel" }); var wheel = { setup: function(element) { var $element = $(element); eventsEngine.on($element, eventUtils.addNamespace(getWheelEventName(), EVENT_NAMESPACE), wheel._wheelHandler.bind(wheel)) }, teardown: function(element) { eventsEngine.off(element, "." + 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 }, /*!**************************************************************!*\ !*** ./artifacts/transpiled/events/core/emitter.feedback.js ***! \**************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Class = __webpack_require__( /*! ../../core/class */ 15); var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4); var contains = __webpack_require__( /*! ../../core/utils/dom */ 12).contains; var devices = __webpack_require__( /*! ../../core/devices */ 16); var eventUtils = __webpack_require__( /*! ../utils */ 8); var pointerEvents = __webpack_require__( /*! ../pointer */ 23); var Emitter = __webpack_require__( /*! ./emitter */ 123); var registerEmitter = __webpack_require__( /*! ./emitter_registrator */ 95); var ACTIVE_EVENT_NAME = "dxactive"; var INACTIVE_EVENT_NAME = "dxinactive"; var ACTIVE_TIMEOUT = 30; var 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.stop(); this._timer = 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, commonUtils.noop); this._inactive = new FeedbackEvent(0, commonUtils.noop) }, configure: 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; var eventTarget = this._getEmitterTarget(e); var mouseEvent = eventUtils.isMouseEvent(e); var isSimulator = devices.isSimulator(); var deferFeedback = isSimulator || !mouseEvent; var activeTimeout = commonUtils.ensureDefined(this.activeTimeout, ACTIVE_TIMEOUT); var 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 this._inactive.force.bind(this._inactive) } }); FeedbackEmitter.lock = function(deferred) { var lockInactive = activeFeedback ? activeFeedback.lockInactive() : commonUtils.noop; deferred.done(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 }, /*!****************************************************!*\ !*** ./artifacts/transpiled/ui/collection/item.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var Class = __webpack_require__( /*! ../../core/class */ 15); var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var publicComponentUtils = __webpack_require__( /*! ../../core/utils/public_component */ 131); var INVISIBLE_STATE_CLASS = "dx-state-invisible"; var DISABLED_STATE_CLASS = "dx-state-disabled"; var ITEM_CONTENT_PLACEHOLDER_CLASS = "dx-item-content-placeholder"; var forcibleWatcher = function(watchMethod, fn, callback) { var filteredCallback = function() { var oldValue; return function(value) { if (oldValue !== value) { callback(value, oldValue); oldValue = value } } }(); return { dispose: watchMethod(fn, filteredCallback), force: function() { filteredCallback(fn()) } } }; var CollectionItem = Class.inherit({ ctor: function($element, options, rawData) { this._$element = $element; this._options = options; this._rawData = rawData; publicComponentUtils.attachInstanceToElement($element, this, this._dispose); this._render() }, _render: function() { var $placeholder = $("
").addClass(ITEM_CONTENT_PLACEHOLDER_CLASS); this._$element.append($placeholder); this._watchers = []; this._renderWatchers() }, _renderWatchers: function() { this._startWatcher("disabled", this._renderDisabled.bind(this)); this._startWatcher("visible", this._renderVisible.bind(this)) }, _startWatcher: function(field, render) { var rawData = this._rawData; var exprGetter = this._options.fieldGetter(field); var watcher = forcibleWatcher(this._options.watchMethod(), function() { return exprGetter(rawData) }, function(value, oldValue) { this._dirty = true; render(value, oldValue) }.bind(this)); this._watchers.push(watcher) }, setDataField: function() { this._dirty = false; each(this._watchers, function(_, watcher) { watcher.force() }); if (this._dirty) { return true } }, _renderDisabled: function(value, oldValue) { this._$element.toggleClass(DISABLED_STATE_CLASS, !!value); this._updateOwnerFocus(value) }, _updateOwnerFocus: function(isDisabled) { var ownerComponent = this._options.owner; if (ownerComponent && isDisabled) { ownerComponent._resetItemFocus(this._$element) } }, _renderVisible: function(value, oldValue) { this._$element.toggleClass(INVISIBLE_STATE_CLASS, void 0 !== value && !value) }, _dispose: function() { each(this._watchers, function(_, watcher) { watcher.dispose() }) } }); CollectionItem.getInstance = function($element) { return publicComponentUtils.getInstanceByElement($element, this) }; module.exports = CollectionItem }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/localization/globalize/core.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Globalize = __webpack_require__( /*! globalize */ 72); var coreLocalization = __webpack_require__( /*! ../core */ 87); if (Globalize && Globalize.load) { 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" } } }; if (!Globalize.locale()) { Globalize.load(likelySubtags); Globalize.locale("en") } coreLocalization.inject({ locale: function(_locale) { if (!_locale) { return Globalize.locale().locale } Globalize.locale(_locale) } }) } }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/events/double_click.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12); var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11); var Class = __webpack_require__( /*! ../core/class */ 15); var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71); var clickEvent = __webpack_require__( /*! ./click */ 19); var eventUtils = __webpack_require__( /*! ./utils */ 8); var DBLCLICK_EVENT_NAME = "dxdblclick"; var DBLCLICK_NAMESPACE = "dxDblClick"; var NAMESPACED_CLICK_EVENT = eventUtils.addNamespace(clickEvent.name, DBLCLICK_NAMESPACE); var DBLCLICK_TIMEOUT = 300; var DblClick = Class.inherit({ ctor: function() { this._handlerCount = 0; this._forgetLastClick() }, _forgetLastClick: function() { this._firstClickTarget = null; this._lastClickTimeStamp = -DBLCLICK_TIMEOUT }, add: function() { if (this._handlerCount <= 0) { eventsEngine.on(domAdapter.getDocument(), NAMESPACED_CLICK_EVENT, this._clickHandler.bind(this)) } this._handlerCount++ }, _clickHandler: function(e) { var timeStamp = e.timeStamp || Date.now(); if (timeStamp - this._lastClickTimeStamp < DBLCLICK_TIMEOUT) { eventUtils.fireEvent({ type: DBLCLICK_EVENT_NAME, target: domUtils.closestCommonParent(this._firstClickTarget, e.target), originalEvent: e }); this._forgetLastClick() } else { this._firstClickTarget = e.target; this._lastClickTimeStamp = timeStamp } }, remove: function() { this._handlerCount--; if (this._handlerCount <= 0) { this._forgetLastClick(); eventsEngine.off(domAdapter.getDocument(), NAMESPACED_CLICK_EVENT) } } }); registerEvent(DBLCLICK_EVENT_NAME, new DblClick); exports.name = DBLCLICK_EVENT_NAME }, /*!**************************************************!*\ !*** ./artifacts/transpiled/core/utils/error.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var extend = __webpack_require__( /*! ./extend */ 0).extend; var consoleUtils = __webpack_require__( /*! ./console */ 73); var stringUtils = __webpack_require__( /*! ./string */ 44); var version = __webpack_require__( /*! ../version */ 157); 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([].slice.call(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([].slice.call(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, getErrorUrl(id)]) }; var makeError = function(args) { var id = args[0]; args = args.slice(1); var details = formatDetails(id, args); var url = getErrorUrl(id); var message = formatMessage(id, details); return extend(new Error(message), { __id: id, __details: details, url: url }) }; var getErrorUrl = function(id) { return ERROR_URL + id }; return exports } }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/core/utils/resize_callbacks.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var windowUtils = __webpack_require__( /*! ./window */ 7); var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11); var Callbacks = __webpack_require__( /*! ./callbacks */ 26); var readyCallbacks = __webpack_require__( /*! ./ready_callbacks */ 48); var callOnce = __webpack_require__( /*! ./call_once */ 63); var resizeCallbacks = function() { var prevSize; var callbacks = Callbacks(); var originalCallbacksAdd = callbacks.add; var originalCallbacksRemove = callbacks.remove; if (!windowUtils.hasWindow()) { return callbacks } var formatSize = function() { var window = windowUtils.getWindow(); return { width: window.innerWidth, height: window.innerHeight } }; var handleResize = function() { var now = formatSize(); if (now.width === prevSize.width && now.height === prevSize.height) { return } var changedDimension; if (now.width === prevSize.width) { changedDimension = "height" } if (now.height === prevSize.height) { changedDimension = "width" } prevSize = now; callbacks.fire(changedDimension) }; var setPrevSize = callOnce(function() { prevSize = formatSize() }); var removeListener; callbacks.add = function() { var result = originalCallbacksAdd.apply(callbacks, arguments); setPrevSize(); readyCallbacks.add(function() { if (!removeListener && callbacks.has()) { removeListener = domAdapter.listen(windowUtils.getWindow(), "resize", handleResize) } }); return result }; callbacks.remove = function() { var result = originalCallbacksRemove.apply(callbacks, arguments); if (!callbacks.has() && removeListener) { removeListener(); removeListener = void 0 } return result }; return callbacks }(); module.exports = resizeCallbacks }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/core/utils/public_component.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var WeakMap = __webpack_require__( /*! ../polyfills/weak_map */ 176); var isDefined = __webpack_require__( /*! ./type */ 1).isDefined; var removeEvent = __webpack_require__( /*! ../remove_event */ 132); var COMPONENT_NAMES_DATA_KEY = "dxComponents"; var ANONYMOUS_COMPONENT_DATA_KEY = "dxPrivateComponent"; var componentNames = new WeakMap; var nextAnonymousComponent = 0; var getName = exports.name = function(componentClass, newName) { if (isDefined(newName)) { componentNames.set(componentClass, newName); return } if (!componentNames.has(componentClass)) { var generatedName = ANONYMOUS_COMPONENT_DATA_KEY + nextAnonymousComponent++; componentNames.set(componentClass, generatedName); return generatedName } return componentNames.get(componentClass) }; exports.attachInstanceToElement = function($element, componentInstance, disposeFn) { var data = dataUtils.data($element.get(0)); var name = getName(componentInstance.constructor); data[name] = componentInstance; if (disposeFn) { eventsEngine.one($element, removeEvent, function() { disposeFn.call(componentInstance) }) } if (!data[COMPONENT_NAMES_DATA_KEY]) { data[COMPONENT_NAMES_DATA_KEY] = [] } data[COMPONENT_NAMES_DATA_KEY].push(name) }; exports.getInstanceByElement = function($element, componentClass) { var name = getName(componentClass); return dataUtils.data($element.get(0), name) } }, /*!***************************************************!*\ !*** ./artifacts/transpiled/core/remove_event.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ./renderer */ 2); var beforeCleanData = __webpack_require__( /*! ./element_data */ 39).beforeCleanData; var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var registerEvent = __webpack_require__( /*! ../events/core/event_registrator */ 71); var eventName = "dxremove"; var eventPropName = "dxRemoveEvent"; beforeCleanData(function(elements) { elements = [].slice.call(elements); for (var i = 0; i < elements.length; i++) { var $element = $(elements[i]); if ($element.prop(eventPropName)) { $element[0][eventPropName] = null; eventsEngine.triggerHandler($element, eventName) } } }); registerEvent(eventName, { noBubble: true, setup: function(element) { $(element).prop(eventPropName, true) } }); module.exports = eventName }, /*!************************************************!*\ !*** ./artifacts/transpiled/core/component.js ***! \************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread() } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } function _unsupportedIterableToArray(o, minLen) { if (!o) { return } if ("string" === typeof o) { return _arrayLikeToArray(o, minLen) } var n = Object.prototype.toString.call(o).slice(8, -1); if ("Object" === n && o.constructor) { n = o.constructor.name } if ("Map" === n || "Set" === n) { return Array.from(o) } if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) { return _arrayLikeToArray(o, minLen) } } function _iterableToArray(iter) { if ("undefined" !== typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) { return Array.from(iter) } } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { return _arrayLikeToArray(arr) } } function _arrayLikeToArray(arr, len) { if (null == len || len > arr.length) { len = arr.length } for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i] } return arr2 } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true } Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) { _defineProperties(Constructor.prototype, protoProps) } if (staticProps) { _defineProperties(Constructor, staticProps) } Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor } var Config = __webpack_require__( /*! ./config */ 31); var domAdapter = __webpack_require__( /*! ./dom_adapter */ 11); var extend = __webpack_require__( /*! ./utils/extend */ 0).extend; var Class = __webpack_require__( /*! ./class */ 15); var Action = __webpack_require__( /*! ./action */ 111); var errors = __webpack_require__( /*! ./errors */ 21); var coreDataUtils = __webpack_require__( /*! ./utils/data */ 20); var commonUtils = __webpack_require__( /*! ./utils/common */ 4); var typeUtils = __webpack_require__( /*! ./utils/type */ 1); var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6); var Deferred = deferredUtils.Deferred; var when = deferredUtils.when; var Callbacks = __webpack_require__( /*! ./utils/callbacks */ 26); var EventsMixin = __webpack_require__( /*! ./events_mixin */ 82); var publicComponentUtils = __webpack_require__( /*! ./utils/public_component */ 131); var devices = __webpack_require__( /*! ./devices */ 16); var isFunction = typeUtils.isFunction; var noop = commonUtils.noop; var cachedGetters = {}; var cachedSetters = {}; var PostponedOperations = function() { function PostponedOperations() { _classCallCheck(this, PostponedOperations); this._postponedOperations = {} } _createClass(PostponedOperations, [{ key: "add", value: function(key, fn, postponedPromise) { if (key in this._postponedOperations) { postponedPromise && this._postponedOperations[key].promises.push(postponedPromise) } else { var completePromise = new Deferred; this._postponedOperations[key] = { fn: fn, completePromise: completePromise, promises: postponedPromise ? [postponedPromise] : [] } } return this._postponedOperations[key].completePromise.promise() } }, { key: "callPostponedOperations", value: function() { for (var key in this._postponedOperations) { var operation = this._postponedOperations[key]; if (typeUtils.isDefined(operation)) { if (operation.promises && operation.promises.length) { when.apply(void 0, _toConsumableArray(operation.promises)).done(operation.fn).then(operation.completePromise.resolve) } else { operation.fn().done(operation.completePromise.resolve) } } } this._postponedOperations = {} } }]); return PostponedOperations }(); var Component = Class.inherit({ _setDeprecatedOptions: function() { this._deprecatedOptions = {} }, _getDeprecatedOptions: function() { return this._deprecatedOptions }, _getOptionAliasesByName: function(optionName) { var _this = this; return Object.keys(this._deprecatedOptions).filter(function(aliasName) { return optionName === _this._deprecatedOptions[aliasName].alias }) }, _getDefaultOptions: function() { return { onInitialized: null, onOptionChanged: null, onDisposing: null, defaultOptionsRules: null } }, _setDefaultOptions: function() { this._options = this._getDefaultOptions() }, _defaultOptionsRules: function() { return [] }, _setOptionsByDevice: function(customRules) { var rules = this._defaultOptionsRules(); if (Array.isArray(customRules)) { rules = rules.concat(customRules) } var rulesOptions = this._convertRulesToOptions(rules); extend(true, this._options, rulesOptions); for (var fieldName in this._optionsByReference) { if (Object.prototype.hasOwnProperty.call(rulesOptions, fieldName)) { this._options[fieldName] = rulesOptions[fieldName] } } }, _convertRulesToOptions: function(rules) { var options = {}; var currentDevice = devices.current(); var deviceMatch = function(device, filter) { var filterArray = []; Array.prototype.push.call(filterArray, filter); return 1 === filterArray.length && typeUtils.isEmptyObject(filterArray[0]) || commonUtils.findBestMatches(device, filterArray).length > 0 }; for (var i = 0; i < rules.length; i++) { var rule = rules[i]; var deviceFilter = rule.device || {}; var match; if (isFunction(deviceFilter)) { match = deviceFilter(currentDevice) } else { match = deviceMatch(currentDevice, deviceFilter) } if (match) { extend(options, rule.options) } } return options }, _isInitialOptionValue: function(name) { var optionValue = this.option(name); var initialOptionValue = this.initialOption(name); var isInitialOption = isFunction(optionValue) && isFunction(initialOptionValue) ? optionValue.toString() === initialOptionValue.toString() : commonUtils.equalByValue(optionValue, initialOptionValue); return isInitialOption }, _setOptionsByReference: function() { this._optionsByReference = {} }, _getOptionsByReference: function() { return this._optionsByReference }, ctor: function(options) { this.NAME = publicComponentUtils.name(this.constructor); options = options || {}; if (options.eventsStrategy) { this.setEventsStrategy(options.eventsStrategy) } this._options = {}; this._updateLockCount = 0; this._optionChangedCallbacks = options._optionChangedCallbacks || Callbacks(); this._disposingCallbacks = options._disposingCallbacks || Callbacks(); this.postponedOperations = new PostponedOperations; this.beginUpdate(); try { this._suppressDeprecatedWarnings(); this._setOptionsByReference(); this._setDeprecatedOptions(); this._setDefaultOptions(); if (options && options.onInitializing) { options.onInitializing.apply(this, [options]) } 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 && typeUtils.isRenderer(oldValue) && typeUtils.isRenderer(newValue)) { return newValue.is(oldValue) } var oldValueIsNaN = oldValue !== oldValue; var newValueIsNaN = newValue !== newValue; if (oldValueIsNaN && newValueIsNaN) { return true } if (null === oldValue || "object" !== _typeof(oldValue) || domAdapter.isElementNode(oldValue)) { return oldValue === newValue } return false }, _init: function() { this._createOptionChangedAction(); this.on("disposing", function(args) { this._disposingCallbacks.fireWith(this, [args]) }.bind(this)) }, _createOptionChangedAction: function() { this._optionChangedAction = this._createActionByOption("onOptionChanged", { excludeValidators: ["disabled", "readOnly"] }) }, _createDisposingAction: function() { this._disposingAction = this._createActionByOption("onDisposing", { excludeValidators: ["disabled", "readOnly"] }) }, _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) { this.postponedOperations.callPostponedOperations(); if (!this._initializing && !this._initialized) { this._initializing = true; try { this._init() } finally { this._initializing = false; this._updateLockCount++; this._createActionByOption("onInitialized", { excludeValidators: ["disabled", "readOnly"] })(); 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]; var 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 && this._cancelOptionChange !== args.name) { that._optionChanged(args) } } } }, initialOption: function(optionName) { var currentOptions; var 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 that = this; var action; return function(e) { if (!arguments.length) { e = {} } if (!typeUtils.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 that = this; var action; var eventName; var actionFunc; var result = function() { if (!eventName) { config = config || {}; if ("string" !== typeof optionName) { throw errors.Error("E0008") } if (0 === optionName.indexOf("on")) { eventName = that._getEventName(optionName) } if (0 !== optionName.indexOf("on")) { 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) { beforeExecute && beforeExecute.apply(that, arguments); that.fireEvent(eventName, args.args) }; that._suppressDeprecatedWarnings(); action = that._createAction(actionFunc, config); that._resumeDeprecatedWarnings() } if (Config().wrapActionsBeforeExecute) { var beforeActionExecute = that.option("beforeActionExecute") || noop; var wrappedAction = beforeActionExecute(that, action, config) || action; return wrappedAction.apply(that, arguments) } return action.apply(that, arguments) }; if (!Config().wrapActionsBeforeExecute) { var onActionCreated = that.option("onActionCreated") || noop; result = onActionCreated(that, result, config) || result } return result }, _getEventName: function(actionName) { return actionName.charAt(2).toLowerCase() + actionName.substr(3) }, hasActionSubscription: function(actionName) { return !!this.option(actionName) || this.hasEvent(this._getEventName(actionName)) }, isOptionDeprecated: function(name) { var deprecatedOptions = this._getDeprecatedOptions(); return Object.prototype.hasOwnProperty.call(deprecatedOptions, name) }, _setOptionSilent: function(name, value) { this._cancelOptionChange = name; this.option(name, value); this._cancelOptionChange = false }, 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 splitNames = fullName.split("."); splitNames.pop(); return splitNames.join(".") }; var getFieldName = function(fullName) { var splitNames = fullName.split("."); return splitNames[splitNames.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); var fieldName = getFieldName(name); var fieldObject = previousFieldName ? getOptionValue(options, previousFieldName, false) : options; if (fieldObject) { delete fieldObject[fieldName] } }; var setOptionsField = function(options, fullName, value) { var fieldName = ""; var fieldObject; 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 prepareOption(that, options, name, value) { if (typeUtils.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) } var path = name.split(/[.[]/); cachedSetters[name](that._options, value, { functionsAsIs: true, merge: !that._getOptionsByReference()[name], unwrapObservables: path.length > 1 && !!that._getOptionsByReference()[path[0]] }) }; 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; var name = options; if (arguments.length < 2 && "object" !== typeUtils.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() } } }(), _getOptionValue: function(name, context) { var value = this.option(name); if (isFunction(value)) { return value.bind(context)() } return value } }).include(EventsMixin); module.exports = Component; module.exports.PostponedOperations = PostponedOperations }, /*!******************************************************************!*\ !*** ./artifacts/transpiled/ui/widget/child_default_template.js ***! \******************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74); module.exports = TemplateBase.inherit({ ctor: function(name) { this.name = name } }) }, /*!**************************************************!*\ !*** ./artifacts/transpiled/data/array_utils.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _config = __webpack_require__( /*! ../core/config */ 31); var _config2 = _interopRequireDefault(_config); var _guid = __webpack_require__( /*! ../core/guid */ 40); var _guid2 = _interopRequireDefault(_guid); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _errors = __webpack_require__( /*! ./errors */ 36); var _object = __webpack_require__( /*! ../core/utils/object */ 47); var _object2 = _interopRequireDefault(_object); var _utils = __webpack_require__( /*! ./utils */ 41); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } function hasKey(target, keyOrKeys) { var keys = "string" === typeof keyOrKeys ? keyOrKeys.split() : keyOrKeys.slice(); while (keys.length) { var key = keys.shift(); if (key in target) { return true } } return false } function findItems(keyInfo, items, key, groupCount) { if (groupCount) { for (var i = 0; i < items.length; i++) { var childItems = items[i].items || items[i].collapsedItems || []; var result = findItems(keyInfo, childItems || [], key, groupCount - 1); if (result) { return result } } } else { if (indexByKey(keyInfo, items, key) >= 0) { return items } } } function getItems(keyInfo, items, key, groupCount) { if (groupCount) { return findItems(keyInfo, items, key, groupCount) || [] } return items } function generateDataByKeyMap(keyInfo, array) { if (keyInfo.key() && !array._dataByKeyMap) { var dataByKeyMap = {}; for (var i = 0, arrayLength = array.length; i < arrayLength; i++) { dataByKeyMap[JSON.stringify(keyInfo.keyOf(array[i]))] = array[i] } array._dataByKeyMap = dataByKeyMap } } function getCacheValue(array, key) { if (array._dataByKeyMap) { return array._dataByKeyMap[JSON.stringify(key)] } } function getHasKeyCacheValue(array, key) { if (array._dataByKeyMap) { return array._dataByKeyMap[JSON.stringify(key)] } return true } function setDataByKeyMapValue(array, key, data) { if (array._dataByKeyMap) { array._dataByKeyMap[JSON.stringify(key)] = data } } function applyBatch(keyInfo, array, batchData, groupCount, useInsertIndex) { batchData.forEach(function(item) { var items = "insert" === item.type ? array : getItems(keyInfo, array, item.key, groupCount); generateDataByKeyMap(keyInfo, items); switch (item.type) { case "update": update(keyInfo, items, item.key, item.data, true); break; case "insert": insert(keyInfo, items, item.data, useInsertIndex && (0, _type.isDefined)(item.index) ? item.index : -1, true); break; case "remove": remove(keyInfo, items, item.key, true) } }) } function update(keyInfo, array, key, data, isBatch) { var target; var extendComplexObject = true; var keyExpr = keyInfo.key(); if (keyExpr) { if (hasKey(data, keyExpr) && !(0, _utils.keysEqual)(keyExpr, key, keyInfo.keyOf(data))) { return !isBatch && (0, _utils.rejectedPromise)(_errors.errors.Error("E4017")) } target = getCacheValue(array, key); if (!target) { var index = indexByKey(keyInfo, array, key); if (index < 0) { return !isBatch && (0, _utils.rejectedPromise)(_errors.errors.Error("E4009")) } target = array[index] } } else { target = key } _object2.default.deepExtendArraySafe(target, data, extendComplexObject); if (!isBatch) { if ((0, _config2.default)().useLegacyStoreResult) { return (0, _utils.trivialPromise)(key, data) } else { return (0, _utils.trivialPromise)(target, key) } } } function insert(keyInfo, array, data, index, isBatch) { var keyValue; var keyExpr = keyInfo.key(); var obj = (0, _type.isPlainObject)(data) ? (0, _extend.extend)({}, data) : data; if (keyExpr) { keyValue = keyInfo.keyOf(obj); if (void 0 === keyValue || "object" === _typeof(keyValue) && (0, _type.isEmptyObject)(keyValue)) { if (Array.isArray(keyExpr)) { throw _errors.errors.Error("E4007") } keyValue = obj[keyExpr] = String(new _guid2.default) } else { if (void 0 !== array[indexByKey(keyInfo, array, keyValue)]) { return !isBatch && (0, _utils.rejectedPromise)(_errors.errors.Error("E4008")) } } } else { keyValue = obj } if (index >= 0) { array.splice(index, 0, obj) } else { array.push(obj) } setDataByKeyMapValue(array, keyValue, obj); if (!isBatch) { return (0, _utils.trivialPromise)((0, _config2.default)().useLegacyStoreResult ? data : obj, keyValue) } } function remove(keyInfo, array, key, isBatch) { var index = indexByKey(keyInfo, array, key); if (index > -1) { array.splice(index, 1) } if (!isBatch) { return (0, _utils.trivialPromise)(key) } } function indexByKey(keyInfo, array, key) { var keyExpr = keyInfo.key(); if (!getHasKeyCacheValue(array, key)) { return -1 } for (var i = 0, arrayLength = array.length; i < arrayLength; i++) { if ((0, _utils.keysEqual)(keyExpr, keyInfo.keyOf(array[i]), key)) { return i } } return -1 } module.exports.applyBatch = applyBatch; module.exports.update = update; module.exports.insert = insert; module.exports.remove = remove; module.exports.indexByKey = indexByKey }, /*!*****************************************************************************!*\ !*** ./artifacts/transpiled/ui/file_manager/file_provider/file_provider.js ***! \*****************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _data = __webpack_require__( /*! ../../../core/utils/data */ 20); var _uiFile_manager = __webpack_require__( /*! ../ui.file_manager.utils */ 113); var _common = __webpack_require__( /*! ../../../core/utils/common */ 4); var _date_serialization = __webpack_require__( /*! ../../../core/utils/date_serialization */ 52); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 3); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true } Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) { _defineProperties(Constructor.prototype, protoProps) } if (staticProps) { _defineProperties(Constructor, staticProps) } Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor } var DEFAULT_FILE_UPLOAD_CHUNK_SIZE = 2e5; var FileProvider = function() { function FileProvider(options) { _classCallCheck(this, FileProvider); options = (0, _common.ensureDefined)(options, {}); this._nameGetter = (0, _data.compileGetter)(this._getNameExpr(options)); this._isDirGetter = (0, _data.compileGetter)(this._getIsDirExpr(options)); this._sizeGetter = (0, _data.compileGetter)(options.sizeExpr || "size"); this._dateModifiedGetter = (0, _data.compileGetter)(options.dateModifiedExpr || "dateModified"); this._thumbnailGetter = (0, _data.compileGetter)(options.thumbnailExpr || "thumbnail") } _createClass(FileProvider, [{ key: "getFolders", value: function(path) { return this.getItems(path, "folder") } }, { key: "getFiles", value: function(path) { return this.getItems(path, "file") } }, { key: "getItems", value: function(path, itemType) { return [] } }, { key: "renameItem", value: function(item, name) {} }, { key: "createFolder", value: function(parentFolder, name) {} }, { key: "deleteItems", value: function(items) {} }, { key: "moveItems", value: function(items, destinationFolder) {} }, { key: "copyItems", value: function(items, destinationFolder) {} }, { key: "initiateFileUpload", value: function(uploadInfo) {} }, { key: "uploadFileChunk", value: function(uploadInfo, chunk) {} }, { key: "finalizeFileUpload", value: function(uploadInfo) {} }, { key: "abortFileUpload", value: function(uploadInfo) {} }, { key: "getFileUploadChunkSize", value: function() { return DEFAULT_FILE_UPLOAD_CHUNK_SIZE } }, { key: "_getItemsByType", value: function(path, folders) { return this.getItems(path).filter(function(item) { return item.isDirectory === folders }) } }, { key: "_convertDataObjectsToFileItems", value: function(entries, path, itemType) { var _this = this; var useFolders = "folder" === itemType; var result = []; (0, _iterator.each)(entries, function(_, entry) { var fileItem = _this._createFileItem(entry, path); if (!itemType || fileItem.isDirectory === useFolders) { result.push(fileItem) } }); return result } }, { key: "_createFileItem", value: function(dataObj, path) { var fileItem = new FileManagerItem(path, this._nameGetter(dataObj), (!!this._isDirGetter(dataObj))); fileItem.size = this._sizeGetter(dataObj); if (void 0 === fileItem.size) { fileItem.size = 0 } fileItem.dateModified = (0, _date_serialization.deserializeDate)(this._dateModifiedGetter(dataObj)); if (void 0 === fileItem.dateModified) { fileItem.dateModified = new Date } if (fileItem.isDirectory) { fileItem.hasSubDirs = this._hasSubDirs(dataObj) } fileItem.thumbnail = this._thumbnailGetter(dataObj) || ""; fileItem.dataItem = dataObj; return fileItem } }, { key: "_hasSubDirs", value: function(dataObj) { return true } }, { key: "_getNameExpr", value: function(options) { return options.nameExpr || "name" } }, { key: "_getIsDirExpr", value: function(options) { return options.isDirectoryExpr || "isDirectory" } }]); return FileProvider }(); var FileManagerItem = function() { function FileManagerItem(parentPath, name, isDirectory) { _classCallCheck(this, FileManagerItem); this.parentPath = parentPath; this.name = name; this.relativeName = (0, _uiFile_manager.pathCombine)(this.parentPath, name); this.isDirectory = isDirectory || false; this.size = 0; this.dateModified = new Date; this.thumbnail = ""; this.tooltipText = "" } _createClass(FileManagerItem, [{ key: "getExtension", value: function() { return this.isDirectory ? "" : (0, _uiFile_manager.getFileExtension)(this.name) } }, { key: "getParent", value: function() { if (this.isRoot()) { return null } return new FileManagerItem((0, _uiFile_manager.getParentPath)(this.parentPath), (0, _uiFile_manager.getName)(this.parentPath), true) } }, { key: "isRoot", value: function() { return !this.relativeName } }, { key: "equals", value: function(item) { return item && this.relativeName === item.relativeName } }, { key: "createClone", value: function() { var result = new FileManagerItem(this.parentPath, this.name, this.isDirectory); result.size = this.size; result.dateModified = this.dateModified; result.thumbnail = this.thumbnail; result.tooltipText = this.tooltipText; result.hasSubDirs = this.hasSubDirs; result.dataItem = this.dataItem; return result } }]); return FileManagerItem }(); module.exports.FileProvider = FileProvider; module.exports.FileManagerItem = FileManagerItem }, /*!********************************************!*\ !*** ./artifacts/transpiled/ui/popover.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var $ = __webpack_require__( /*! ../core/renderer */ 2); var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7); var window = windowUtils.getWindow(); var getPublicElement = __webpack_require__( /*! ../core/utils/dom */ 12).getPublicElement; var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11); var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var browser = __webpack_require__( /*! ../core/utils/browser */ 25); var translator = __webpack_require__( /*! ../animation/translator */ 27); var positionUtils = __webpack_require__( /*! ../animation/position */ 77); var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1); var mathUtils = __webpack_require__( /*! ../core/utils/math */ 28); var eventUtils = __webpack_require__( /*! ../events/utils */ 8); var Popup = __webpack_require__( /*! ./popup */ 46); var POPOVER_CLASS = "dx-popover"; var POPOVER_WRAPPER_CLASS = "dx-popover-wrapper"; var POPOVER_ARROW_CLASS = "dx-popover-arrow"; var POPOVER_WITHOUT_TITLE_CLASS = "dx-popover-without-title"; var POSITION_FLIP_MAP = { left: "right", top: "bottom", right: "left", bottom: "top", center: "center" }; var WEIGHT_OF_SIDES = { left: -1, top: -1, center: 0, right: 1, bottom: 1 }; var 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 SIDE_BORDER_WIDTH_STYLES = { left: "borderLeftWidth", top: "borderTopWidth", right: "borderRightWidth", bottom: "borderBottomWidth" }; var isFirefox = browser.mozilla; var getEventName = function(that, optionName) { var optionValue = that.option(optionName); return getEventNameByOption(optionValue) }; var getEventNameByOption = function(optionValue) { return typeUtils.isObject(optionValue) ? optionValue.name : optionValue }; var getEventDelay = function(that, optionName) { var optionValue = that.option(optionName); return typeUtils.isObject(optionValue) && optionValue.delay }; var attachEvent = function(that, name) { var target = that.option("target"); var isSelector = typeUtils.isString(target); var event = getEventName(that, name + "Event"); if (!event || that.option("disabled")) { return } var eventName = eventUtils.addNamespace(event, that.NAME); var action = that._createAction(function() { var delay = getEventDelay(that, name + "Event"); this._clearEventsTimeouts(); if (delay) { this._timeouts[name] = setTimeout(function() { that[name]() }, delay) } else { that[name]() } }.bind(that), { validatingTargetName: "target" }); var handler = function(e) { action({ event: e, target: $(e.currentTarget) }) }; var EVENT_HANDLER_NAME = "_" + name + "EventHandler"; if (isSelector) { that[EVENT_HANDLER_NAME] = handler; eventsEngine.on(domAdapter.getDocument(), eventName, target, handler) } else { var targetElement = getPublicElement($(target)); that[EVENT_HANDLER_NAME] = void 0; eventsEngine.on(targetElement, eventName, handler) } }; var detachEvent = function(that, target, name, event) { var eventName = event || getEventName(that, name + "Event"); if (!eventName) { return } eventName = eventUtils.addNamespace(eventName, that.NAME); var EVENT_HANDLER_NAME = "_" + name + "EventHandler"; if (that[EVENT_HANDLER_NAME]) { eventsEngine.off(domAdapter.getDocument(), eventName, target, that[EVENT_HANDLER_NAME]) } else { eventsEngine.off(getPublicElement($(target)), eventName) } }; 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" } } }, { device: function() { return !windowUtils.hasWindow() }, options: { animation: null } }] }, _init: function() { this.callBase(); this._renderArrow(); this._timeouts = {}; this.$element().addClass(POPOVER_CLASS); this._wrapper().addClass(POPOVER_WRAPPER_CLASS) }, _render: function() { this.callBase.apply(this, arguments); this._detachEvents(this.option("target")); this._attachEvents() }, _detachEvents: function(target) { detachEvent(this, target, "show"); detachEvent(this, target, "hide") }, _attachEvents: function() { attachEvent(this, "show"); attachEvent(this, "hide") }, _renderArrow: function() { this._$arrow = $("
").addClass(POPOVER_ARROW_CLASS).prependTo(this.overlayContent()) }, _documentDownHandler: function(e) { if (this._isOutsideClick(e)) { return this.callBase(e) } return true }, _isOutsideClick: function(e) { return !$(e.target).closest(this.option("target")).length }, _animate: function(animation) { if (animation && animation.to && "object" === _typeof(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: commonUtils.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); var isArrowVisible = this._isHorizontalSide() || this._isVerticalSide(); if (isArrowVisible) { 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; var newPopupContentHeight = this._$popupContent.height() - containerLocation.v.oversize; this._$content.height(newOverlayContentHeight); this._$popupContent.height(newPopupContentHeight) } }, _getContainerPosition: function() { var offset = commonUtils.pairToObject(this._position.offset || ""); var hOffset = offset.h; var vOffset = offset.v; var isVerticalSide = this._isVerticalSide(); var isHorizontalSide = this._isHorizontalSide(); if (isVerticalSide || isHorizontalSide) { var isPopoverInside = this._isPopoverInside(); var sign = (isPopoverInside ? -1 : 1) * WEIGHT_OF_SIDES[this._positionSide]; var arrowSize = isVerticalSide ? this._$arrow.height() : this._$arrow.width(); var arrowSizeCorrection = this._getContentBorderWidth(this._positionSide); var arrowOffset = sign * (arrowSize - arrowSizeCorrection); isVerticalSide ? vOffset += arrowOffset : hOffset += arrowOffset } return extend({}, this._position, { offset: hOffset + " " + vOffset }) }, _getContentBorderWidth: function(side) { var borderWidth = this._$content.css(SIDE_BORDER_WIDTH_STYLES[side]); 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 = positionUtils.offset($target) || { top: 0, left: 0 }; var contentOffset = positionUtils.offset(this._$content); 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._transformStringPosition(this.option("position"), POSITION_ALIASES); var my = positionUtils.setup.normalizeAlign(position.my); var at = positionUtils.setup.normalizeAlign(position.at); return my.h === at.h && my.v === at.v }, _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._transformStringPosition(this.option("position"), POSITION_ALIASES)); 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); var 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; var horizontalWeight = Math.abs(WEIGHT_OF_SIDES[my.h] - weightSign * WEIGHT_OF_SIDES[at.h]); var verticalWeight = Math.abs(WEIGHT_OF_SIDES[my.v] - weightSign * WEIGHT_OF_SIDES[at.v]); return horizontalWeight > verticalWeight ? at.h : at.v }, _resetContentHeight: function() { this.callBase(); if (isFirefox) { var originalOverflow = this._$popupContent.css("overflow"); this._$popupContent.css("overflow", "visible"); this._$popupContent.css("overflow", originalOverflow) } }, _isVerticalSide: function(side) { side = side || this._positionSide; return "top" === side || "bottom" === side }, _isHorizontalSide: function(side) { side = side || this._positionSide; return "left" === side || "right" === side }, _clearEventTimeout: function(name) { clearTimeout(this._timeouts[name]) }, _clearEventsTimeouts: function() { this._clearEventTimeout("show"); this._clearEventTimeout("hide") }, _clean: function() { this._detachEvents(this.option("target")); this.callBase.apply(this, arguments) }, _optionChanged: function(args) { switch (args.name) { case "boundaryOffset": case "arrowPosition": case "arrowOffset": this._renderGeometry(); break; case "fullScreen": if (args.value) { this.option("fullScreen", false) } break; case "target": args.previousValue && this._detachEvents(args.previousValue); this.callBase(args); break; case "showEvent": case "hideEvent": var name = args.name.substring(0, 4); var event = getEventNameByOption(args.previousValue); this.hide(); detachEvent(this, this.option("target"), name, event); attachEvent(this, name); break; case "visible": this._clearEventTimeout(args.value ? "show" : "hide"); this.callBase(args); break; default: this.callBase(args) } }, show: function(target) { if (target) { this.option("target", target) } return this.callBase() } }); registerComponent("dxPopover", Popover); module.exports = Popover }, /*!****************************************************************!*\ !*** ./artifacts/transpiled/ui/list/ui.list.edit.decorator.js ***! \****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var Class = __webpack_require__( /*! ../../core/class */ 15); var swipeEvents = __webpack_require__( /*! ../../events/swipe */ 174); var eventUtils = __webpack_require__( /*! ../../events/utils */ 8); var LIST_EDIT_DECORATOR = "dxListEditDecorator"; var SWIPE_START_EVENT_NAME = eventUtils.addNamespace(swipeEvents.start, LIST_EDIT_DECORATOR); var SWIPE_UPDATE_EVENT_NAME = eventUtils.addNamespace(swipeEvents.swipe, LIST_EDIT_DECORATOR); var 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: function() { if (this._clearSwipeCache) { this._itemWidthCache = this._list.$element().width(); this._clearSwipeCache = false } return this._itemWidthCache }.bind(this) }; eventsEngine.on(config.$itemElement, SWIPE_START_EVENT_NAME, swipeConfig, this._itemSwipeStartHandler.bind(this)); eventsEngine.on(config.$itemElement, SWIPE_UPDATE_EVENT_NAME, this._itemSwipeUpdateHandler.bind(this)); eventsEngine.on(config.$itemElement, SWIPE_END_EVENT_NAME, this._itemSwipeEndHandler.bind(this)) }, _itemSwipeStartHandler: function(e) { var $itemElement = $(e.currentTarget); if ($itemElement.is(".dx-state-disabled, .dx-state-disabled *")) { e.cancel = true; return } clearTimeout(this._list._inkRippleTimer); 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, handleKeyboardEvents: noop, handleEnterPressing: noop, handleContextMenu: noop, _swipeStartHandler: noop, _swipeUpdateHandler: noop, _swipeEndHandler: noop, visibilityChange: noop, getExcludedSelectors: noop, dispose: noop }); module.exports = EditDecorator }, /*!*****************************************!*\ !*** ./artifacts/transpiled/ui/form.js ***! \*****************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./form/ui.form */ 554) }, /*!**********************************************!*\ !*** ./artifacts/transpiled/ui/tree_view.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./tree_view/ui.tree_view.search */ 350) }, /*!***************************************************************!*\ !*** ./artifacts/transpiled/ui/scheduler/utils.recurrence.js ***! \***************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var errors = __webpack_require__( /*! ../../core/errors */ 21); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray; var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined; var dateUtils = __webpack_require__( /*! ../../core/utils/date */ 22); var toMs = dateUtils.dateToMilliseconds; var leastDaysInWeek = 4; 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) { if (value < 0) { var initialDate = new Date(date); setDateByNegativeValue(initialDate, 1, -1); var daysInMonth = initialDate.getDate(); if (daysInMonth >= Math.abs(value)) { setDateByNegativeValue(date, 1, value) } else { setDateByNegativeValue(date, 2, value) } } else { date.setDate(value); correctDate(date, value) } }, byday: function(date, byDay, appointmentWeekStart, frequency, firstDayOfWeek) { var appointmentDayOfWeek = date.getDay(); var weekStart = days[appointmentWeekStart]; byDay += byDay >= weekStart === weekStart > appointmentDayOfWeek ? 7 : 0; date.setDate(date.getDate() - appointmentDayOfWeek + byDay) }, byweekno: function(date, weekNumber, weekStart) { var initialDate = new Date(date); var firstYearDate = new Date(initialDate.setMonth(0, 1)); var dayShift = firstYearDate.getDay() - days[weekStart]; var firstDayOfYear = firstYearDate.getTime() - dayShift * toMs("day"); var newFirstYearDate = dayShift + 1; if (newFirstYearDate > leastDaysInWeek) { date.setTime(firstDayOfYear + 7 * weekNumber * toMs("day")) } else { date.setTime(firstDayOfYear + 7 * (weekNumber - 1) * toMs("day")) } var timezoneDiff = (date.getTimezoneOffset() - firstYearDate.getTimezoneOffset()) * toMs("minute"); timezoneDiff && date.setTime(date.getTime() + timezoneDiff) }, byyearday: function(date, dayOfYear) { date.setMonth(0, 1); date.setDate(dayOfYear) } }; var setDateByNegativeValue = function(date, month, value) { var initialDate = new Date(date); date.setMonth(date.getMonth() + month); if (date.getMonth() - initialDate.getMonth() > month) { date.setDate(value + 1) } date.setDate(value + 1) }; var dateGetterMap = { bysecond: function(date) { return date.getSeconds() }, byminute: function(date) { return date.getMinutes() }, byhour: function(date) { return date.getHours() }, bymonth: function(date) { return date.getMonth() }, bymonthday: function(date) { return date.getDate() }, byday: function(date) { return date.getDay() }, byweekno: function(date, weekStart) { var current = new Date(date); var diff = leastDaysInWeek - current.getDay() + days[weekStart] - 1; var dayInMilliseconds = toMs("day"); if (date.getDay() < days[weekStart]) { diff -= 7 } current.setHours(0, 0, 0); current.setDate(current.getDate() + diff); var yearStart = new Date(current.getFullYear(), 0, 1); var timezoneDiff = (yearStart.getTimezoneOffset() - current.getTimezoneOffset()) * toMs("minute"); var daysFromYearStart = 1 + (current - yearStart + timezoneDiff) / dayInMilliseconds; return Math.ceil(daysFromYearStart / 7) }, byyearday: function(date) { var yearStart = new Date(date.getFullYear(), 0, 0); var timezoneDiff = date.getTimezoneOffset() - yearStart.getTimezoneOffset(); var diff = date - yearStart - timezoneDiff * toMs("minute"); var dayLength = toMs("day"); return Math.floor(diff / dayLength) } }; var ruleNames = ["freq", "interval", "byday", "byweekno", "byyearday", "bymonth", "bymonthday", "count", "until", "byhour", "byminute", "bysecond", "bysetpos", "wkst"]; var freqNames = ["DAILY", "WEEKLY", "MONTHLY", "YEARLY", "SECONDLY", "MINUTELY", "HOURLY"]; var days = { SU: 0, MO: 1, TU: 2, WE: 3, TH: 4, FR: 5, SA: 6 }; var daysNames = { 0: "SU", 1: "MO", 2: "TU", 3: "WE", 4: "TH", 5: "FR", 6: "SA" }; var getTimeZoneOffset = function() { return (new Date).getTimezoneOffset() }; var dateInRecurrenceRange = function(options) { var result = []; if (options.rule) { result = getDatesByRecurrence(options) } return !!result.length }; var normalizeInterval = function(rule) { var interval = rule.interval; var freq = rule.freq; var intervalObject = {}; var intervalField = intervalMap[freq.toLowerCase()]; if ("MONTHLY" === freq && rule.byday) { intervalField = intervalMap.daily } intervalObject[intervalField] = interval; return intervalObject }; var getDatesByRecurrenceException = function(ruleValues, date) { var result = []; for (var i = 0, len = ruleValues.length; i < len; i++) { result[i] = getDateByAsciiString(ruleValues[i], date) } return result }; var dateIsRecurrenceException = function(date, recurrenceException) { var result = false; if (!recurrenceException) { return result } var splitDates = recurrenceException.split(","); var exceptDates = getDatesByRecurrenceException(splitDates, date); var shortFormat = /\d{8}$/; for (var i = 0, len = exceptDates.length; i < len; i++) { if (splitDates[i].match(shortFormat)) { var diffs = getDatePartDiffs(date, exceptDates[i]); if (0 === diffs.years && 0 === diffs.months && 0 === diffs.days) { result = true } } else { if (date.getTime() === exceptDates[i].getTime()) { result = true } } } return result }; var doNextIteration = function(date, startIntervalDate, endIntervalDate, recurrenceRule, iterationCount) { var matchCountIsCorrect = true; endIntervalDate = endIntervalDate.getTime(); if (recurrenceRule.until) { if (recurrenceRule.until.getTime() < endIntervalDate) { endIntervalDate = recurrenceRule.until.getTime() } } if (recurrenceRule.count) { if (iterationCount === recurrenceRule.count) { matchCountIsCorrect = false } } var dateInInterval = date.getTime() <= endIntervalDate; return dateInInterval && matchCountIsCorrect }; var getDatesByRecurrence = function(options) { var result = []; var recurrenceRule = getRecurrenceRule(options.rule); var iterationResult = {}; var rule = recurrenceRule.rule; var recurrenceStartDate = options.start; if (!recurrenceRule.isValid || !rule.freq) { return result } rule.interval = normalizeInterval(rule); var dateRules = splitDateRules(rule, options.firstDayOfWeek); var duration = options.end ? options.end.getTime() - options.start.getTime() : toMs("day"); var config = { exception: options.exception, min: options.min, dateRules: dateRules, rule: rule, recurrenceStartDate: recurrenceStartDate, recurrenceEndDate: options.end, duration: duration }; if (dateRules.length && rule.count) { var iteration = 0; getDatesByCount(dateRules, new Date(recurrenceStartDate), new Date(recurrenceStartDate), rule).forEach(function(currentDate, i) { if (currentDate < options.max) { iteration++; iterationResult = pushToResult(iteration, iterationResult, currentDate, i, config, true) } }) } else { getDatesByRules(dateRules, new Date(recurrenceStartDate), rule).forEach(function(currentDate, i) { var iteration = 0; while (doNextIteration(currentDate, recurrenceStartDate, options.max, rule, iteration)) { iteration++; iterationResult = pushToResult(iteration, iterationResult, currentDate, i, config); currentDate = incrementDate(currentDate, recurrenceStartDate, rule, i) } }) } if (rule.bysetpos) { each(iterationResult, function(iterationIndex, iterationDates) { iterationResult[iterationIndex] = filterDatesBySetPos(iterationDates, rule.bysetpos) }) } each(iterationResult, function(_, iterationDates) { result = result.concat(iterationDates) }); result.sort(function(a, b) { return a - b }); return result }; var pushToResult = function(iteration, iterationResult, currentDate, i, config, verifiedField) { if (!iterationResult[iteration]) { iterationResult[iteration] = [] } if (checkDate(currentDate, i, config, verifiedField)) { iterationResult[iteration].push(currentDate) } return iterationResult }; var checkDate = function(currentDate, i, config, verifiedField) { if (!dateIsRecurrenceException(currentDate, config.exception)) { var duration = dateUtils.sameDate(currentDate, config.recurrenceEndDate) && config.recurrenceEndDate.getTime() > currentDate.getTime() ? config.recurrenceEndDate.getTime() - currentDate.getTime() : config.duration; if (currentDate.getTime() >= config.recurrenceStartDate.getTime() && currentDate.getTime() + duration > config.min.getTime()) { return verifiedField || checkDateByRule(currentDate, [config.dateRules[i]], config.rule.wkst) } } return false }; var filterDatesBySetPos = function(dates, bySetPos) { var resultArray = []; bySetPos.split(",").forEach(function(index) { index = Number(index); var dateIndex = index > 0 ? index - 1 : dates.length + index; if (dates[dateIndex]) { resultArray.push(dates[dateIndex]) } }); return resultArray }; var correctDate = function(originalDate, date) { if (originalDate.getDate() !== date) { originalDate.setDate(date) } }; var incrementDate = function(date, originalStartDate, rule, iterationStep) { var initialDate = new Date(date); var needCorrect = true; date = dateUtils.addInterval(date, rule.interval); if ("MONTHLY" === rule.freq && !rule.byday) { var expectedDate = originalStartDate.getDate(); if (rule.bymonthday) { expectedDate = Number(rule.bymonthday.split(",")[iterationStep]); if (expectedDate < 0) { initialDate.setMonth(initialDate.getMonth() + 1, 1); dateSetterMap.bymonthday(initialDate, expectedDate); date = initialDate; needCorrect = false } } needCorrect && correctDate(date, expectedDate) } if ("YEARLY" === rule.freq) { if (rule.byyearday) { var dayNumber = Number(rule.byyearday.split(",")[iterationStep]); dateSetterMap.byyearday(date, dayNumber) } var dateRules = splitDateRules(rule); for (var field in dateRules[iterationStep]) { dateSetterMap[field] && dateSetterMap[field](date, dateRules[iterationStep][field], rule.wkst) } } return date }; 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) || inArray(rule.freq, freqNames) === -1 || 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; var until = rule.until; if (void 0 !== until && !(until instanceof Date)) { wrongUntil = true } return wrongUntil }; var wrongCountRule = function(rule) { var wrongCount = false; var count = rule.count; if (count && "string" === typeof count) { wrongCount = true } return wrongCount }; var wrongByMonthDayRule = function(rule) { var wrongByMonthDay = false; var byMonthDay = rule.bymonthday; if (byMonthDay && isNaN(parseInt(byMonthDay))) { wrongByMonthDay = true } return wrongByMonthDay }; var wrongByMonth = function wrongByMonth(rule) { var wrongByMonth = false; var byMonth = rule.bymonth; if (byMonth && isNaN(parseInt(byMonth))) { wrongByMonth = true } return wrongByMonth }; var wrongIntervalRule = function(rule) { var wrongInterval = false; var interval = rule.interval; if (interval && "string" === typeof interval) { wrongInterval = true } return wrongInterval }; var wrongDayOfWeek = function(rule) { var daysByRule = daysFromByDayRule(rule); var brokenDaysExist = false; each(daysByRule, function(_, day) { if (!Object.prototype.hasOwnProperty.call(days, day)) { brokenDaysExist = true; return false } }); return brokenDaysExist }; var brokenRuleNameExists = function(rule) { var brokenRuleExists = false; each(rule, function(ruleName) { if (inArray(ruleName, ruleNames) === -1) { brokenRuleExists = true; return false } }); return brokenRuleExists }; var logBrokenRule = function(recurrence) { if (inArray(recurrence, loggedWarnings) === -1) { errors.log("W0006", recurrence); loggedWarnings.push(recurrence) } }; var parseRecurrenceRule = function(recurrence) { var ruleObject = {}; var ruleParts = recurrence.split(";"); for (var i = 0, len = ruleParts.length; i < len; i++) { var rule = ruleParts[i].split("="); var ruleName = rule[0].toLowerCase(); var 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, initialDate) { if ("string" !== typeof string) { return string } var arrayDate = string.match(/(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2}))?(Z)?/); if (!arrayDate) { return null } var isUTC = void 0 !== arrayDate[8]; var currentOffset = initialDate ? initialDate.getTimezoneOffset() : resultUtils.getTimeZoneOffset(); var date = new(Function.prototype.bind.apply(Date, prepareDateArrayToParse(arrayDate))); currentOffset = 6e4 * currentOffset; if (isUTC) { date = new Date(date.getTime() - currentOffset) } return date }; var prepareDateArrayToParse = function(arrayDate) { arrayDate.shift(); if (void 0 === arrayDate[3]) { arrayDate.splice(3) } else { arrayDate.splice(3, 1); arrayDate.splice(6) } arrayDate[1]--; arrayDate.unshift(null); return arrayDate }; var daysFromByDayRule = function(rule) { var result = []; if (rule.byday) { if (Array.isArray(rule.byday)) { result = rule.byday } else { result = rule.byday.split(",") } } return result }; var getAsciiStringByDate = function(date) { var currentOffset = 6e4 * resultUtils.getTimeZoneOffset(); date = new Date(date.getTime() + currentOffset); 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 firstDayOfWeek = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; var result = []; if (isDefined(firstDayOfWeek)) { rule.fdow = firstDayOfWeek } if (!rule.wkst) { rule.wkst = isDefined(firstDayOfWeek) ? daysNames[firstDayOfWeek] : "MO" } if (rule.byweekno && !rule.byday) { var dayNames = Object.keys(days); for (var i = 0; i < days[rule.wkst]; i++) { dayNames.push(dayNames.shift()) } rule.byday = dayNames.join(",") } for (var field in dateSetterMap) { if (!rule[field]) { continue } var ruleFieldValues = rule[field].split(","); var 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, rule) { var result = []; for (var i = 0, len = dateRules.length; i < len; i++) { var current = dateRules[i]; var updatedDate = prepareDate(startDate, dateRules, rule.wkst); for (var field in current) { dateSetterMap[field] && dateSetterMap[field](updatedDate, current[field], rule.wkst, rule.freq, rule.fdow) } if (Array.isArray(updatedDate)) { result = result.concat(updatedDate) } else { result.push(new Date(updatedDate)) } } if (!result.length) { result.push(startDate) } return result }; var getDatesByCount = function(dateRules, startDate, recurrenceStartDate, rule) { var result = []; var count = rule.count; var counter = 0; var date = prepareDate(startDate, dateRules, rule.wkst); while (counter < count) { var dates = getDatesByRules(dateRules, date, rule); var checkedDates = []; for (var i = 0; i < dates.length; i++) { if (dates[i].getTime() >= recurrenceStartDate.getTime()) { checkedDates.push(dates[i]) } } var length = checkedDates.length; counter += length; var delCount = counter - count; if (counter > count) { checkedDates.splice(length - delCount, delCount) } for (i = 0; i < checkedDates.length; i++) { result.push(checkedDates[i]) } var interval = rule.interval; if ("days" === Object.keys(interval)[0]) { interval = { weeks: 1 } } date = dateUtils.addInterval(date, interval) } return result }; var prepareDate = function(startDate, dateRules, weekStartRule) { var date = new Date(startDate); var day = date.getDay(); if (dateRules.length && isDefined(dateRules[0].byday)) { date.setDate(date.getDate() - day + days[weekStartRule] - (day < days[weekStartRule] ? 7 : 0)) } else { date.setDate(1) } return date }; var checkDateByRule = function(date, rules, weekStart) { var result = false; for (var i = 0; i < rules.length; i++) { var current = rules[i]; var currentRuleResult = true; for (var field in current) { var processNegative = "bymonthday" === field && current[field] < 0; if (dateGetterMap[field] && !processNegative && current[field] !== dateGetterMap[field](date, weekStart)) { 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() }; var resultUtils = { getRecurrenceString: getRecurrenceString, getRecurrenceRule: getRecurrenceRule, getAsciiStringByDate: getAsciiStringByDate, getDatesByRecurrence: getDatesByRecurrence, dateInRecurrenceRange: dateInRecurrenceRange, getDateByAsciiString: getDateByAsciiString, daysFromByDayRule: daysFromByDayRule, getTimeZoneOffset: getTimeZoneOffset }; module.exports = resultUtils }, /*!**************************************************!*\ !*** ./artifacts/transpiled/viz/core/helpers.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7); var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var isServerSide = !windowUtils.hasWindow(); function Flags() { this.reset() } Flags.prototype = { constructor: Flags, add: function(codes) { var i; var ii = codes.length; var flags = this._flags; for (i = 0; i < ii; ++i) { flags[codes[i]] = 1 } this._k += ii }, has: function(code) { return this._flags[code] > 0 }, count: function() { return this._k }, reset: function() { this._flags = {}; this._k = 0 } }; function combineMaps(baseMap, thisMap) { return baseMap !== thisMap ? _extend({}, baseMap, thisMap) : _extend({}, baseMap) } function combineLists(baseList, thisList) { return baseList !== thisList ? baseList.concat(thisList) : baseList.slice() } function buildTotalChanges(proto) { proto._totalChangesOrder = proto._optionChangesOrder.concat(proto._layoutChangesOrder, proto._customChangesOrder) } function addChange(settings) { var proto = this.prototype; var code = settings.code; proto["_change_" + code] = settings.handler; if (settings.isThemeDependent) { proto._themeDependentChanges.push(code) } if (settings.option) { proto._optionChangesMap[settings.option] = code }(settings.isOptionChange ? proto._optionChangesOrder : proto._customChangesOrder).push(code); buildTotalChanges(proto) } function createChainExecutor() { var executeChain = function executeChain() { var i; var ii = executeChain._chain.length; var result; for (i = 0; i < ii; ++i) { result = executeChain._chain[i].apply(this, arguments) } return result }; executeChain._chain = []; executeChain.add = function(item) { executeChain._chain.push(item) }; executeChain.copy = function(executor) { executeChain._chain = executor._chain.slice() }; return executeChain } function expand(target, name, expander) { var current = target[name]; if (!current) { current = expander } else { if (!current.add) { current = createChainExecutor(); current.add(target[name]); current.add(expander) } else { if (false === Object.prototype.hasOwnProperty.call(target, name)) { current = createChainExecutor(); current.copy(target[name]) } current.add(expander) } } target[name] = current } function addPlugin(plugin) { var proto = this.prototype; proto._plugins.push(plugin); plugin.fontFields && proto._fontFields.push.apply(proto._fontFields, plugin.fontFields); if (plugin.members) { _extend(this.prototype, plugin.members) } if (plugin.customize) { plugin.customize(this) } if (plugin.extenders) { Object.keys(plugin.extenders).forEach(function(key) { var func = plugin.extenders[key]; expand(proto, key, func) }, this) } } exports.replaceInherit = isServerSide ? function(widget) { var _inherit = widget.inherit; widget.inherit = function() { var result = _inherit.apply(this, arguments); var proto = result.prototype; ["_plugins", "_eventsMap", "_initialChanges", "_themeDependentChanges", "_optionChangesMap", "_optionChangesOrder", "_layoutChangesOrder", "_customChangesOrder", "_totalChangesOrder"].forEach(function(key) { proto[key] = {} }); result.addPlugin = noop; return result }; widget.addChange = noop; widget.addPlugin = noop } : function(widget) { var _inherit = widget.inherit; widget.inherit = function() { var proto = this.prototype; var plugins = proto._plugins; var fontFields = proto._fontFields; var eventsMap = proto._eventsMap; var initialChanges = proto._initialChanges; var themeDependentChanges = proto._themeDependentChanges; var optionChangesMap = proto._optionChangesMap; var partialOptionChangesMap = proto._partialOptionChangesMap; var partialOptionChangesPath = proto._partialOptionChangesPath; var optionChangesOrder = proto._optionChangesOrder; var layoutChangesOrder = proto._layoutChangesOrder; var customChangesOrder = proto._customChangesOrder; var result = _inherit.apply(this, arguments); proto = result.prototype; proto._plugins = combineLists(plugins, proto._plugins); proto._fontFields = combineLists(fontFields, proto._fontFields); proto._eventsMap = combineMaps(eventsMap, proto._eventsMap); proto._initialChanges = combineLists(initialChanges, proto._initialChanges); proto._themeDependentChanges = combineLists(themeDependentChanges, proto._themeDependentChanges); proto._optionChangesMap = combineMaps(optionChangesMap, proto._optionChangesMap); proto._partialOptionChangesMap = combineMaps(partialOptionChangesMap, proto._partialOptionChangesMap); proto._partialOptionChangesPath = combineMaps(partialOptionChangesPath, proto._partialOptionChangesPath); proto._optionChangesOrder = combineLists(optionChangesOrder, proto._optionChangesOrder); proto._layoutChangesOrder = combineLists(layoutChangesOrder, proto._layoutChangesOrder); proto._customChangesOrder = combineLists(customChangesOrder, proto._customChangesOrder); buildTotalChanges(proto); result.addPlugin = addPlugin; return result }; widget.prototype._plugins = []; widget.prototype._fontFields = []; widget.addChange = addChange; widget.addPlugin = addPlugin }; exports.changes = function() { return new Flags }; exports.expand = expand }, /*!*******************************************************!*\ !*** ./artifacts/transpiled/viz/series/bar_series.js ***! \*******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106); var areaSeries = __webpack_require__( /*! ./area_series */ 165).chart.area; var chartSeries = scatterSeries.chart; var polarSeries = scatterSeries.polar; var _extend = extend; var _each = each; exports.chart = {}; exports.polar = {}; var baseBarSeriesMethods = { _createLegendState: function(styleOptions, defaultColor) { return { fill: styleOptions.color || defaultColor, hatching: styleOptions.hatching } }, _parsePointStyle: function(style, defaultColor, defaultBorderColor) { var color = style.color || defaultColor; var base = chartSeries._parsePointStyle.call(this, style, color, defaultBorderColor); base.fill = color; base.hatching = style.hatching; base.dashStyle = style.border && style.border.dashStyle || "solid"; delete base.r; return base }, _applyMarkerClipRect: function(settings) { settings["clip-path"] = null }, _setGroupsSettings: function(animationEnabled, firstDrawing) { var that = this; var settings = {}; chartSeries._setGroupsSettings.apply(that, arguments); if (animationEnabled && firstDrawing) { settings = this._getAffineCoordOptions() } 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; var mainColor = pointOptions.color || that._getMainColor(); return { normal: that._parsePointStyle(pointOptions, mainColor, mainColor), hover: that._parsePointStyle(pointOptions.hoverStyle || {}, mainColor, mainColor), selection: that._parsePointStyle(pointOptions.selectionStyle || {}, mainColor, 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; var complete = function() { that._animateComplete() }; var 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) }, getValueRangeInitialValue: areaSeries.getValueRangeInitialValue, _patchMarginOptions: function(options) { options.checkInterval = true; return options }, _defaultAggregator: "sum", _defineDrawingState: function() {}, usePointsToDefineAutoHiding: function() { return false } }; exports.chart.bar = _extend({}, chartSeries, baseBarSeriesMethods, { _getAffineCoordOptions: function() { var rotated = this._options.rotated; var direction = rotated ? "X" : "Y"; var settings = { scaleX: rotated ? .001 : 1, scaleY: rotated ? 1 : .001 }; settings["translate" + direction] = this.getValueAxis().getTranslator().translate("canvas_position_default"); return settings }, _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) } }, checkSeriesViewportCoord: function(axis, coord) { if (0 === this._points.length) { return false } if (axis.isArgumentAxis) { return true } var translator = axis.getTranslator(); var range = this.getViewport(); var min = translator.translate(range.categories ? range.categories[0] : range.min); var max = translator.translate(range.categories ? range.categories[range.categories.length - 1] : range.max); var rotated = this.getOptions().rotated; var inverted = axis.getOptions().inverted; return rotated && !inverted || !rotated && inverted ? coord >= min && coord <= max : coord >= max && coord <= min }, getSeriesPairCoord: function(coord, isArgument) { var oppositeCoord = null; var rotated = this._options.rotated; var isOpposite = !isArgument && !rotated || isArgument && rotated; var coordName = isOpposite ? "vy" : "vx"; var oppositeCoordName = isOpposite ? "vx" : "vy"; var points = this.getPoints(); for (var i = 0; i < points.length; i++) { var p = points[i]; var tmpCoord = void 0; if (isArgument) { tmpCoord = p.getCenterCoord()[coordName[1]] === coord ? p[oppositeCoordName] : void 0 } else { tmpCoord = p[coordName] === coord ? p[oppositeCoordName] : void 0 } if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) { oppositeCoord = tmpCoord; break } } return oppositeCoord } }); 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 that = this; var markersSettings = that._createPointStyles(that._getMarkerGroupOptions()).normal; markersSettings.class = "dxc-markers"; that._applyMarkerClipRect(markersSettings); var groupSettings = _extend({}, markersSettings); delete groupSettings.opacity; that._markersGroup.attr(groupSettings) }, _createLegendState: areaSeries._createLegendState }) }, /*!******************************************************!*\ !*** ./artifacts/transpiled/viz/core/data_source.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var DataHelperMixin = __webpack_require__( /*! ../../data_helper */ 84); var postCtor = DataHelperMixin.postCtor; var name; var members = { _dataSourceLoadErrorHandler: function() { this._dataSourceChangedHandler() }, _dataSourceOptions: function() { return { paginate: false } }, _updateDataSource: function() { this._refreshDataSource(); if (!this.option("dataSource")) { this._dataSourceChangedHandler() } }, _dataIsLoaded: function() { return !this._dataSource || this._dataSource.isLoaded() }, _dataSourceItems: function() { return this._dataSource && this._dataSource.items() } }; for (name in DataHelperMixin) { if ("postCtor" === name) { continue } members[name] = DataHelperMixin[name] } exports.plugin = { name: "data_source", init: function() { postCtor.call(this) }, dispose: noop, members: members } }, /*!*******************************************************!*\ !*** ./artifacts/transpiled/viz/gauges/base_gauge.js ***! \*******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _Number = Number; var _getAppropriateFormat = __webpack_require__( /*! ../core/utils */ 10).getAppropriateFormat; var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var translator1DModule = __webpack_require__( /*! ../translators/translator1d */ 412); var _extend = extend; var BaseWidget = __webpack_require__( /*! ../core/base_widget */ 96); var themeManagerModule = __webpack_require__( /*! ./theme_manager */ 794); var Tracker = __webpack_require__( /*! ./tracker */ 795); var dxBaseGauge = BaseWidget.inherit({ _rootClassPrefix: "dxg", _themeSection: "gauge", _createThemeManager: function() { return new themeManagerModule.ThemeManager(this._getThemeManagerOptions()) }, _initCore: function() { var that = this; var root = that._renderer.root; that._valueChangingLocker = 0; that._translator = that._factory.createTranslator(); that._tracker = that._factory.createTracker({ renderer: that._renderer, container: root }); that._setTrackerCallbacks() }, _beginValueChanging: function() { this._resetIsReady(); this._onBeginUpdate(); ++this._valueChangingLocker }, _endValueChanging: function() { if (0 === --this._valueChangingLocker) { this._drawn() } }, _setTrackerCallbacks: function() { var that = this; var renderer = that._renderer; var tooltip = that._tooltip; that._tracker.setCallbacks({ "tooltip-show": function(target, info) { var tooltipParameters = target.getTooltipParameters(); var offset = renderer.getRootOffset(); var 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() } }) }, _dispose: function() { this._cleanCore(); this.callBase.apply(this, arguments) }, _disposeCore: function() { var that = this; that._themeManager.dispose(); that._tracker.dispose(); 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; var 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__( /*! ../../format_helper */ 64).format; var formatValue = function(value, options, extra) { options = options || {}; var text = _format(value, options.format); var formatObject; 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); var 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; var ii = array1.length; var array1ValueIsNaN; var array2ValueIsNaN; for (i = 0; i < ii; ++i) { array1ValueIsNaN = array1[i] !== array1[i]; array2ValueIsNaN = array2[i] !== array2[i]; if (array1ValueIsNaN && array2ValueIsNaN) { continue } if (array1[i] !== array2[i]) { return false } } return true } dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/export */ 93).plugin); dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/title */ 105).plugin); dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin); dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/loading_indicator */ 119).plugin); var _setTooltipOptions = dxBaseGauge.prototype._setTooltipOptions; dxBaseGauge.prototype._setTooltipOptions = function() { _setTooltipOptions.apply(this, arguments); this._tracker && this._tracker.setTooltipState(this._tooltip.isEnabled()) } }, /*!**************************************************!*\ !*** ./artifacts/transpiled/viz/tree_map/api.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype; var nodeProto = __webpack_require__( /*! ./node */ 166).prototype; var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; proto._eventsMap.onNodesInitialized = { name: "nodesInitialized" }; proto._eventsMap.onNodesRendering = { name: "nodesRendering" }; proto._createProxyType = function() { var that = this; var nodes; 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 _nodes = nodes[this._id].nodes; var i; var ii = _nodes && _nodes.length; var 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 node = nodes[this._id]; var result; if (void 0 !== arg) { updateValue(node, arg > 0 ? Number(arg) : 0); change(node, ["TILING"]); result = this } else { result = node.value } return result }, label: function(arg) { var node = nodes[this._id]; var result; if (void 0 !== arg) { node.customLabel = arg ? String(arg) : null; change(node, ["LABELS"]); result = this } else { result = node.customLabel || node.label } return result }, 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 nodes = node.nodes; var i; var 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__( /*! ../../core/utils/common */ 4).noop; 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; var 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 } }, /*!******************************************************!*\ !*** ./artifacts/transpiled/bundles/modules/core.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7); var window = windowUtils.getWindow(); var DevExpress = window.DevExpress = window.DevExpress || {}; var errors = DevExpress.errors = __webpack_require__( /*! ../../core/errors */ 21); if (DevExpress._DEVEXTREME_BUNDLE_INITIALIZED) { throw errors.Error("E0024") } DevExpress._DEVEXTREME_BUNDLE_INITIALIZED = true; DevExpress.clientExporter = __webpack_require__( /*! ../../exporter */ 170); DevExpress.excelExporter = __webpack_require__( /*! ../../exporter/exceljs/excelExporter */ 441); DevExpress.VERSION = __webpack_require__( /*! ../../core/version */ 157); DevExpress.Class = __webpack_require__( /*! ../../core/class */ 15); DevExpress.DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 67); DevExpress.Component = __webpack_require__( /*! ../../core/component */ 133); DevExpress.registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9); DevExpress.devices = __webpack_require__( /*! ../../core/devices */ 16); DevExpress.Color = __webpack_require__( /*! ../../color */ 94); var animationFrame = __webpack_require__( /*! ../../animation/frame */ 112); DevExpress.EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 82); DevExpress.utils = {}; DevExpress.utils.requestAnimationFrame = animationFrame.requestAnimationFrame; DevExpress.utils.cancelAnimationFrame = animationFrame.cancelAnimationFrame; DevExpress.utils.initMobileViewport = __webpack_require__( /*! ../../mobile/init_mobile_viewport/init_mobile_viewport */ 446).initMobileViewport; DevExpress.utils.extendFromObject = __webpack_require__( /*! ../../core/utils/extend */ 0).extendFromObject; DevExpress.utils.createComponents = __webpack_require__( /*! ../../core/utils/dom */ 12).createComponents; DevExpress.utils.triggerShownEvent = __webpack_require__( /*! ../../core/utils/dom */ 12).triggerShownEvent; DevExpress.utils.triggerHidingEvent = __webpack_require__( /*! ../../core/utils/dom */ 12).triggerHidingEvent; DevExpress.utils.resetActiveElement = __webpack_require__( /*! ../../core/utils/dom */ 12).resetActiveElement; DevExpress.utils.findBestMatches = __webpack_require__( /*! ../../core/utils/common */ 4).findBestMatches; DevExpress.createQueue = __webpack_require__( /*! ../../core/utils/queue */ 263).create; DevExpress.utils.dom = __webpack_require__( /*! ../../core/utils/dom */ 12); DevExpress.utils.common = __webpack_require__( /*! ../../core/utils/common */ 4); DevExpress.utils.date = __webpack_require__( /*! ../../core/utils/date */ 22); DevExpress.utils.browser = __webpack_require__( /*! ../../core/utils/browser */ 25); DevExpress.utils.inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33); DevExpress.utils.iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); DevExpress.utils.readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48); DevExpress.utils.resizeCallbacks = __webpack_require__( /*! ../../core/utils/resize_callbacks */ 130); DevExpress.utils.console = __webpack_require__( /*! ../../core/utils/console */ 73); DevExpress.utils.string = __webpack_require__( /*! ../../core/utils/string */ 44); DevExpress.utils.support = __webpack_require__( /*! ../../core/utils/support */ 43); DevExpress.utils.ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58); DevExpress.viewPort = __webpack_require__( /*! ../../core/utils/view_port */ 78).value; DevExpress.hideTopOverlay = __webpack_require__( /*! ../../mobile/hide_top_overlay */ 213); DevExpress.formatHelper = __webpack_require__( /*! ../../format_helper */ 64); DevExpress.config = __webpack_require__( /*! ../../core/config */ 31); DevExpress.animationPresets = __webpack_require__( /*! ../../animation/presets/presets */ 179).presets; DevExpress.fx = __webpack_require__( /*! ../../animation/fx */ 38); DevExpress.TransitionExecutor = __webpack_require__( /*! ../../animation/transition_executor/transition_executor */ 281).TransitionExecutor; DevExpress.AnimationPresetCollection = __webpack_require__( /*! ../../animation/presets/presets */ 179).PresetCollection; DevExpress.events = __webpack_require__( /*! ../../events */ 282); DevExpress.events.click = __webpack_require__( /*! ../../events/click */ 19); DevExpress.events.utils = __webpack_require__( /*! ../../events/utils */ 8); DevExpress.events.GestureEmitter = __webpack_require__( /*! ../../events/gesture/emitter.gesture */ 158); DevExpress.localization = __webpack_require__( /*! ../../localization */ 449); module.exports = DevExpress }, /*!**********************************************!*\ !*** ./artifacts/transpiled/events/hover.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var dataUtils = __webpack_require__( /*! ../core/element_data */ 39); var Class = __webpack_require__( /*! ../core/class */ 15); var devices = __webpack_require__( /*! ../core/devices */ 16); var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71); var eventUtils = __webpack_require__( /*! ./utils */ 8); var pointerEvents = __webpack_require__( /*! ./pointer */ 23); var HOVERSTART_NAMESPACE = "dxHoverStart"; var HOVERSTART = "dxhoverstart"; var POINTERENTER_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(pointerEvents.enter, HOVERSTART_NAMESPACE); var HOVEREND_NAMESPACE = "dxHoverEnd"; var HOVEREND = "dxhoverend"; var POINTERLEAVE_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(pointerEvents.leave, HOVEREND_NAMESPACE); var Hover = Class.inherit({ noBubble: true, ctor: function() { this._handlerArrayKeyPath = this._eventNamespace + "_HandlerStore" }, setup: function(element) { dataUtils.data(element, this._handlerArrayKeyPath, {}) }, add: function(element, handleObj) { var that = this; var handler = function(e) { that._handler(e) }; eventsEngine.on(element, this._originalEventName, handleObj.selector, handler); dataUtils.data(element, this._handlerArrayKeyPath)[handleObj.guid] = handler }, _handler: function(e) { if (eventUtils.isTouchEvent(e) || devices.isSimulator()) { return } eventUtils.fireEvent({ type: this._eventName, originalEvent: e, delegateTarget: e.delegateTarget }) }, remove: function(element, handleObj) { var handler = dataUtils.data(element, this._handlerArrayKeyPath)[handleObj.guid]; eventsEngine.off(element, this._originalEventName, handleObj.selector, handler) }, teardown: function(element) { dataUtils.removeData(element, this._handlerArrayKeyPath) } }); var HoverStart = Hover.inherit({ ctor: function() { this._eventNamespace = HOVERSTART_NAMESPACE; this._eventName = HOVERSTART; this._originalEventName = POINTERENTER_NAMESPACED_EVENT_NAME; this.callBase() }, _handler: function(e) { var pointers = e.pointers || []; if (!pointers.length) { this.callBase(e) } } }); var HoverEnd = Hover.inherit({ ctor: function() { this._eventNamespace = HOVEREND_NAMESPACE; this._eventName = HOVEREND; this._originalEventName = POINTERLEAVE_NAMESPACED_EVENT_NAME; this.callBase() } }); registerEvent(HOVERSTART, new HoverStart); registerEvent(HOVEREND, new HoverEnd); exports.start = HOVERSTART; exports.end = HOVEREND }, /*!***************************************************!*\ !*** ./artifacts/transpiled/data/custom_store.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var dataUtils = __webpack_require__( /*! ./utils */ 41); var arrayUtils = __webpack_require__( /*! ./array_utils */ 135); var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction; var config = __webpack_require__( /*! ../core/config */ 31); var errors = __webpack_require__( /*! ./errors */ 36).errors; var Store = __webpack_require__( /*! ./abstract_store */ 98); var arrayQuery = __webpack_require__( /*! ./array_query */ 155); var queryByOptions = __webpack_require__( /*! ./store_helper */ 81).queryByOptions; var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6); var Deferred = deferredUtils.Deferred; var when = deferredUtils.when; var fromPromise = deferredUtils.fromPromise; var TOTAL_COUNT = "totalCount"; var LOAD = "load"; var BY_KEY = "byKey"; var INSERT = "insert"; var UPDATE = "update"; var REMOVE = "remove"; function isPromise(obj) { return obj && isFunction(obj.then) } function trivialPromise(value) { return (new Deferred).resolve(value).promise() } function ensureRequiredFuncOption(name, obj) { if (!isFunction(obj)) { throw errors.Error("E4011", name) } } function throwInvalidUserFuncResult(name) { throw errors.Error("E4012", name) } function createUserFuncFailureHandler(pendingDeferred) { function errorMessageFromXhr(promiseArguments) { var xhr = promiseArguments[0]; var textStatus = promiseArguments[1]; if (!xhr || !xhr.getResponseHeader) { return null } return dataUtils.errorMessageFromXhr(xhr, textStatus) } return function(arg) { var error; if (arg instanceof Error) { error = arg } else { error = new Error(errorMessageFromXhr(arguments) || arg && String(arg) || "Unknown error") } if (error.message !== dataUtils.XHR_ERROR_UNLOAD) { pendingDeferred.reject(error) } } } function invokeUserLoad(store, options) { var userFunc = store._loadFunc; var userResult; ensureRequiredFuncOption(LOAD, userFunc); userResult = userFunc.apply(store, [options]); if (Array.isArray(userResult)) { userResult = trivialPromise(userResult) } else { if (null === userResult || void 0 === userResult) { userResult = trivialPromise([]) } else { if (!isPromise(userResult)) { throwInvalidUserFuncResult(LOAD) } } } return fromPromise(userResult) } function invokeUserTotalCountFunc(store, options) { var userFunc = store._totalCountFunc; var userResult; if (!isFunction(userFunc)) { throw errors.Error("E4021") } userResult = userFunc.apply(store, [options]); if (!isPromise(userResult)) { userResult = Number(userResult); if (!isFinite(userResult)) { throwInvalidUserFuncResult(TOTAL_COUNT) } userResult = trivialPromise(userResult) } return fromPromise(userResult) } function invokeUserByKeyFunc(store, key, extraOptions) { var userFunc = store._byKeyFunc; var userResult; ensureRequiredFuncOption(BY_KEY, userFunc); userResult = userFunc.apply(store, [key, extraOptions]); if (!isPromise(userResult)) { userResult = trivialPromise(userResult) } return fromPromise(userResult) } function runRawLoad(pendingDeferred, store, userFuncOptions, continuation) { if (store.__rawData) { continuation(store.__rawData) } else { var loadPromise = store.__rawDataPromise || invokeUserLoad(store, userFuncOptions); if (store._cacheRawData) { store.__rawDataPromise = loadPromise } loadPromise.always(function() { delete store.__rawDataPromise }).done(function(rawData) { if (store._cacheRawData) { store.__rawData = rawData } continuation(rawData) }).fail(createUserFuncFailureHandler(pendingDeferred)) } } function runRawLoadWithQuery(pendingDeferred, store, options, countOnly) { options = options || {}; var userFuncOptions = {}; if ("userData" in options) { userFuncOptions.userData = options.userData } runRawLoad(pendingDeferred, store, userFuncOptions, function(rawData) { var rawDataQuery = arrayQuery(rawData, { errorHandler: store._errorHandler }); var itemsQuery; var totalCountQuery; var waitList = []; var items; var totalCount; if (!countOnly) { itemsQuery = queryByOptions(rawDataQuery, options); if (itemsQuery === rawDataQuery) { items = rawData.slice(0) } else { waitList.push(itemsQuery.enumerate().done(function(asyncResult) { items = asyncResult })) } } if (options.requireTotalCount || countOnly) { totalCountQuery = queryByOptions(rawDataQuery, options, true); if (totalCountQuery === rawDataQuery) { totalCount = rawData.length } else { waitList.push(totalCountQuery.count().done(function(asyncResult) { totalCount = asyncResult })) } } when.apply($, waitList).done(function() { if (countOnly) { pendingDeferred.resolve(totalCount) } else { if (options.requireTotalCount) { pendingDeferred.resolve(items, { totalCount: totalCount }) } else { pendingDeferred.resolve(items) } } }).fail(function(x) { pendingDeferred.reject(x) }) }) } function runRawLoadWithKey(pendingDeferred, store, key) { runRawLoad(pendingDeferred, store, {}, function(rawData) { var keyExpr = store.key(); var item; for (var i = 0, len = rawData.length; i < len; i++) { item = rawData[i]; if (dataUtils.keysEqual(keyExpr, store.keyOf(rawData[i]), key)) { pendingDeferred.resolve(item); return } } pendingDeferred.reject(errors.Error("E4009")) }) } var CustomStore = Store.inherit({ ctor: function(options) { options = options || {}; this.callBase(options); this._useDefaultSearch = !!options.useDefaultSearch || "raw" === options.loadMode; this._loadMode = options.loadMode; this._cacheRawData = false !== options.cacheRawData; this._loadFunc = options[LOAD]; this._totalCountFunc = options[TOTAL_COUNT]; this._byKeyFunc = options[BY_KEY]; this._insertFunc = options[INSERT]; this._updateFunc = options[UPDATE]; this._removeFunc = options[REMOVE] }, createQuery: function() { throw errors.Error("E4010") }, clearRawDataCache: function() { delete this.__rawData }, _totalCountImpl: function(options) { var d = new Deferred; if ("raw" === this._loadMode && !this._totalCountFunc) { runRawLoadWithQuery(d, this, options, true) } else { invokeUserTotalCountFunc(this, options).done(function(count) { d.resolve(Number(count)) }).fail(createUserFuncFailureHandler(d)); d = this._addFailHandlers(d) } return d.promise() }, _pushImpl: function(changes) { if (this.__rawData) { arrayUtils.applyBatch(this, this.__rawData, changes) } }, _loadImpl: function(options) { var d = new Deferred; if ("raw" === this._loadMode) { runRawLoadWithQuery(d, this, options, false) } else { invokeUserLoad(this, options).done(function(data, extra) { d.resolve(data, extra) }).fail(createUserFuncFailureHandler(d)); d = this._addFailHandlers(d) } return d.promise() }, _byKeyImpl: function(key, extraOptions) { var d = new Deferred; if (this._byKeyViaLoad()) { this._requireKey(); runRawLoadWithKey(d, this, key) } else { invokeUserByKeyFunc(this, key, extraOptions).done(function(obj) { d.resolve(obj) }).fail(createUserFuncFailureHandler(d)) } return d.promise() }, _byKeyViaLoad: function() { return "raw" === this._loadMode && !this._byKeyFunc }, _insertImpl: function(values) { var that = this; var userFunc = that._insertFunc; var userResult; var d = new Deferred; ensureRequiredFuncOption(INSERT, userFunc); userResult = userFunc.apply(that, [values]); if (!isPromise(userResult)) { userResult = trivialPromise(userResult) } fromPromise(userResult).done(function(serverResponse) { if (config().useLegacyStoreResult) { d.resolve(values, serverResponse) } else { d.resolve(serverResponse || values, that.keyOf(serverResponse)) } }).fail(createUserFuncFailureHandler(d)); return d.promise() }, _updateImpl: function(key, values) { var userFunc = this._updateFunc; var userResult; var d = new Deferred; ensureRequiredFuncOption(UPDATE, userFunc); userResult = userFunc.apply(this, [key, values]); if (!isPromise(userResult)) { userResult = trivialPromise(userResult) } fromPromise(userResult).done(function(serverResponse) { if (config().useLegacyStoreResult) { d.resolve(key, values) } else { d.resolve(serverResponse || values, key) } }).fail(createUserFuncFailureHandler(d)); return d.promise() }, _removeImpl: function(key) { var userFunc = this._removeFunc; var userResult; var d = new Deferred; ensureRequiredFuncOption(REMOVE, userFunc); userResult = userFunc.apply(this, [key]); if (!isPromise(userResult)) { userResult = trivialPromise() } fromPromise(userResult).done(function() { d.resolve(key) }).fail(createUserFuncFailureHandler(d)); return d.promise() } }); module.exports = CustomStore }, /*!************************************************************!*\ !*** ./artifacts/transpiled/ui/widget/swatch_container.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var viewPortUtils = __webpack_require__( /*! ../../core/utils/view_port */ 78); var SWATCH_CONTAINER_CLASS_PREFIX = "dx-swatch-"; var getSwatchContainer = function(element) { var $element = $(element); var swatchContainer = $element.closest('[class^="'.concat(SWATCH_CONTAINER_CLASS_PREFIX, '"], [class*=" ').concat(SWATCH_CONTAINER_CLASS_PREFIX, '"]')); var viewport = viewPortUtils.value(); if (!swatchContainer.length) { return viewport } var swatchClassRegex = new RegExp("(\\s|^)(".concat(SWATCH_CONTAINER_CLASS_PREFIX, ".*?)(\\s|$)")); var swatchClass = swatchContainer[0].className.match(swatchClassRegex)[2]; var viewportSwatchContainer = viewport.children("." + swatchClass); if (!viewportSwatchContainer.length) { viewportSwatchContainer = $("
").addClass(swatchClass).appendTo(viewport) } return viewportSwatchContainer }; module.exports = { getSwatchContainer: getSwatchContainer } }, /*!**********************************************************!*\ !*** ./artifacts/transpiled/events/gesture/swipeable.js ***! \**********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var swipeEvents = __webpack_require__( /*! ../swipe */ 174); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 67); var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var eventUtils = __webpack_require__( /*! ../utils */ 8); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var publicComponentUtils = __webpack_require__( /*! ../../core/utils/public_component */ 131); var DX_SWIPEABLE = "dxSwipeable"; var SWIPEABLE_CLASS = "dx-swipeable"; var 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, function(actionName, eventName) { var action = this._createActionByOption(actionName, { context: this }); eventName = eventUtils.addNamespace(eventName, NAME); eventsEngine.on(this.$element(), eventName, this._eventData, function(e) { return action({ event: e }) }) }.bind(this)) }, _createEventData: function() { this._eventData = { elastic: this.option("elastic"), itemSizeFunc: this.option("itemSizeFunc"), direction: this.option("direction"), immediate: this.option("immediate") } }, _detachEventHandlers: function() { eventsEngine.off(this.$element(), "." + 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) } } }); publicComponentUtils.name(Swipeable, DX_SWIPEABLE); module.exports = Swipeable }, /*!*******************************************************!*\ !*** ./artifacts/transpiled/localization/currency.js ***! \*******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var numberLocalization = __webpack_require__( /*! ./number */ 51); numberLocalization.inject({ _formatNumberCore: function(value, format, formatConfig) { if ("currency" === format) { formatConfig.precision = formatConfig.precision || 0; var result = this.format(value, extend({}, formatConfig, { type: "fixedpoint" })); var currencyPart = this.getCurrencySymbol().symbol.replace("$", "$$$$"); result = result.replace(/^(\D*)(\d.*)/, "$1" + currencyPart + "$2"); return result } return this.callBase.apply(this, arguments) }, getCurrencySymbol: function() { return { symbol: "$" } }, getOpenXmlCurrencyFormat: function() { return "$#,##0{0}_);\\($#,##0{0}\\)" } }) }, /*!**********************************************************************!*\ !*** ./artifacts/transpiled/core/component_registrator_callbacks.js ***! \**********************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var MemorizedCallbacks = __webpack_require__( /*! ./memorized_callbacks */ 177); module.exports = new MemorizedCallbacks }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/events/pointer/base.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var browser = __webpack_require__( /*! ../../core/utils/browser */ 25); var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var Class = __webpack_require__( /*! ../../core/class */ 15); var eventUtils = __webpack_require__( /*! ../utils */ 8); 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) }, _setSelector: function(handleObj) { this._selector = this.noBubble && handleObj ? handleObj.selector : null }, _getSelector: function() { return this._selector }, setup: function() { return true }, add: function(element, handleObj) { if (this._handlerCount <= 0 || this.noBubble) { element = this.noBubble ? element : domAdapter.getDocument(); this._setSelector(handleObj); var that = this; eventsEngine.on(element, this._originalEvents, this._getSelector(), function(e) { that._handler(e) }) } if (!this.noBubble) { this._handlerCount++ } }, remove: function(handleObj) { this._setSelector(handleObj); if (!this.noBubble) { this._handlerCount-- } }, teardown: function(element) { if (this._handlerCount && !this.noBubble) { return } element = this.noBubble ? element : domAdapter.getDocument(); if (this._originalEvents !== "." + POINTER_EVENTS_NAMESPACE) { eventsEngine.off(element, this._originalEvents, this._getSelector()) } }, dispose: function(element) { element = this.noBubble ? element : domAdapter.getDocument(); eventsEngine.off(element, this._originalEvents) } }); module.exports = BaseStrategy }, /*!**************************************************!*\ !*** ./artifacts/transpiled/data/array_query.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Class = __webpack_require__( /*! ../core/class */ 15); var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1); var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3); var compileGetter = __webpack_require__( /*! ../core/utils/data */ 20).compileGetter; var toComparable = __webpack_require__( /*! ../core/utils/data */ 20).toComparable; var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred; var errorsModule = __webpack_require__( /*! ./errors */ 36); var dataUtils = __webpack_require__( /*! ./utils */ 41); var Iterator = Class.inherit({ toArray: function() { var result = []; this.reset(); while (this.next()) { result.push(this.current()) } return result }, countable: function() { return false } }); var ArrayIterator = Iterator.inherit({ ctor: function(array) { this.array = array; this.index = -1 }, next: function() { if (this.index + 1 < this.array.length) { this.index++; return true } return false }, current: function() { return this.array[this.index] }, reset: function() { this.index = -1 }, toArray: function() { return this.array.slice(0) }, countable: function() { return true }, count: function() { return this.array.length } }); var WrappedIterator = Iterator.inherit({ ctor: function(iter) { this.iter = iter }, next: function() { return this.iter.next() }, current: function() { return this.iter.current() }, reset: function() { return this.iter.reset() } }); var MapIterator = WrappedIterator.inherit({ ctor: function(iter, mapper) { this.callBase(iter); this.index = -1; this.mapper = mapper }, current: function() { return this.mapper(this.callBase(), this.index) }, next: function() { var hasNext = this.callBase(); if (hasNext) { this.index++ } return hasNext } }); var defaultCompare = function(xValue, yValue) { xValue = toComparable(xValue); yValue = toComparable(yValue); if (null === xValue && null !== yValue) { return -1 } if (null !== xValue && null === yValue) { return 1 } if (void 0 === xValue && void 0 !== yValue) { return 1 } if (void 0 !== xValue && void 0 === yValue) { return -1 } if (xValue < yValue) { return -1 } if (xValue > yValue) { return 1 } return 0 }; var SortIterator = Iterator.inherit({ ctor: function(iter, getter, desc, compare) { if (!(iter instanceof MapIterator)) { iter = new MapIterator(iter, this._wrap) } this.iter = iter; this.rules = [{ getter: getter, desc: desc, compare: compare }] }, thenBy: function(getter, desc, compare) { var result = new SortIterator(this.sortedIter || this.iter, getter, desc, compare); if (!this.sortedIter) { result.rules = this.rules.concat(result.rules) } return result }, next: function() { this._ensureSorted(); return this.sortedIter.next() }, current: function() { this._ensureSorted(); return this.sortedIter.current() }, reset: function() { delete this.sortedIter }, countable: function() { return this.sortedIter || this.iter.countable() }, count: function() { if (this.sortedIter) { return this.sortedIter.count() } return this.iter.count() }, _ensureSorted: function() { var that = this; if (that.sortedIter) { return } iteratorUtils.each(that.rules, function() { this.getter = compileGetter(this.getter) }); that.sortedIter = new MapIterator(new ArrayIterator(this.iter.toArray().sort(function(x, y) { return that._compare(x, y) })), that._unwrap) }, _wrap: function(record, index) { return { index: index, value: record } }, _unwrap: function(wrappedItem) { return wrappedItem.value }, _compare: function(x, y) { var xIndex = x.index; var yIndex = y.index; x = x.value; y = y.value; if (x === y) { return xIndex - yIndex } for (var i = 0, rulesCount = this.rules.length; i < rulesCount; i++) { var rule = this.rules[i]; var xValue = rule.getter(x); var yValue = rule.getter(y); var compare = rule.compare || defaultCompare; var compareResult = compare(xValue, yValue); if (compareResult) { return rule.desc ? -compareResult : compareResult } } return xIndex - yIndex } }); var compileCriteria = function() { var compileGroup = function(crit) { var ops = []; var isConjunctiveOperator = false; var isConjunctiveNextOperator = false; iteratorUtils.each(crit, function() { if (Array.isArray(this) || typeUtils.isFunction(this)) { if (ops.length > 1 && isConjunctiveOperator !== isConjunctiveNextOperator) { throw new errorsModule.errors.Error("E4019") } ops.push(compileCriteria(this)); isConjunctiveOperator = isConjunctiveNextOperator; isConjunctiveNextOperator = true } else { isConjunctiveNextOperator = dataUtils.isConjunctiveOperator(this) } }); return function(d) { var result = isConjunctiveOperator; for (var i = 0; i < ops.length; i++) { if (ops[i](d) !== isConjunctiveOperator) { result = !isConjunctiveOperator; break } } return result } }; var toString = function(value) { return typeUtils.isDefined(value) ? value.toString() : "" }; var compileBinary = function(crit) { crit = dataUtils.normalizeBinaryCriterion(crit); var getter = compileGetter(crit[0]); var op = crit[1]; var value = crit[2]; value = toComparable(value); switch (op.toLowerCase()) { case "=": return compileEquals(getter, value); case "<>": return compileEquals(getter, value, true); case ">": return function(obj) { return toComparable(getter(obj)) > value }; case "<": return function(obj) { return toComparable(getter(obj)) < value }; case ">=": return function(obj) { return toComparable(getter(obj)) >= value }; case "<=": return function(obj) { return toComparable(getter(obj)) <= value }; case "startswith": return function(obj) { return 0 === toComparable(toString(getter(obj))).indexOf(value) }; case "endswith": return function(obj) { var getterValue = toComparable(toString(getter(obj))); var searchValue = toString(value); if (getterValue.length < searchValue.length) { return false } var index = getterValue.lastIndexOf(value); return index !== -1 && index === getterValue.length - value.length }; case "contains": return function(obj) { return toComparable(toString(getter(obj))).indexOf(value) > -1 }; case "notcontains": return function(obj) { return toComparable(toString(getter(obj))).indexOf(value) === -1 } } throw errorsModule.errors.Error("E4003", op) }; function compileEquals(getter, value, negate) { return function(obj) { obj = toComparable(getter(obj)); var result = useStrictComparison(value) ? obj === value : obj == value; if (negate) { result = !result } return result } } function useStrictComparison(value) { return "" === value || 0 === value || false === value } function compileUnary(crit) { var op = crit[0]; var criteria = compileCriteria(crit[1]); if ("!" === op) { return function(obj) { return !criteria(obj) } } throw errorsModule.errors.Error("E4003", op) } return function(crit) { if (typeUtils.isFunction(crit)) { return crit } if (dataUtils.isGroupCriterion(crit)) { return compileGroup(crit) } if (dataUtils.isUnaryOperation(crit)) { return compileUnary(crit) } return compileBinary(crit) } }(); var FilterIterator = WrappedIterator.inherit({ ctor: function(iter, criteria) { this.callBase(iter); this.criteria = compileCriteria(criteria) }, next: function() { while (this.iter.next()) { if (this.criteria(this.current())) { return true } } return false } }); var GroupIterator = Iterator.inherit({ ctor: function(iter, getter) { this.iter = iter; this.getter = getter }, next: function() { this._ensureGrouped(); return this.groupedIter.next() }, current: function() { this._ensureGrouped(); return this.groupedIter.current() }, reset: function() { delete this.groupedIter }, countable: function() { return !!this.groupedIter }, count: function() { return this.groupedIter.count() }, _ensureGrouped: function() { if (this.groupedIter) { return } var hash = {}; var keys = []; var iter = this.iter; var getter = compileGetter(this.getter); iter.reset(); while (iter.next()) { var current = iter.current(); var key = getter(current); if (key in hash) { hash[key].push(current) } else { hash[key] = [current]; keys.push(key) } } this.groupedIter = new ArrayIterator(iteratorUtils.map(keys, function(key) { return { key: key, items: hash[key] } })) } }); var SelectIterator = WrappedIterator.inherit({ ctor: function(iter, getter) { this.callBase(iter); this.getter = compileGetter(getter) }, current: function() { return this.getter(this.callBase()) }, countable: function() { return this.iter.countable() }, count: function() { return this.iter.count() } }); var SliceIterator = WrappedIterator.inherit({ ctor: function(iter, skip, take) { this.callBase(iter); this.skip = Math.max(0, skip); this.take = Math.max(0, take); this.pos = 0 }, next: function() { if (this.pos >= this.skip + this.take) { return false } while (this.pos < this.skip && this.iter.next()) { this.pos++ } this.pos++; return this.iter.next() }, reset: function() { this.callBase(); this.pos = 0 }, countable: function() { return this.iter.countable() }, count: function() { return Math.min(this.iter.count() - this.skip, this.take) } }); var arrayQueryImpl = function arrayQueryImpl(iter, queryOptions) { queryOptions = queryOptions || {}; if (!(iter instanceof Iterator)) { iter = new ArrayIterator(iter) } var handleError = function(error) { var handler = queryOptions.errorHandler; if (handler) { handler(error) } errorsModule._errorHandler(error) }; var aggregateCore = function(aggregator) { var d = (new Deferred).fail(handleError); var seed; var step = aggregator.step; var finalize = aggregator.finalize; try { iter.reset(); if ("seed" in aggregator) { seed = aggregator.seed } else { seed = iter.next() ? iter.current() : NaN } var accumulator = seed; while (iter.next()) { accumulator = step(accumulator, iter.current()) } d.resolve(finalize ? finalize(accumulator) : accumulator) } catch (x) { d.reject(x) } return d.promise() }; var aggregate = function(seed, step, finalize) { if (arguments.length < 2) { return aggregateCore({ step: arguments[0] }) } return aggregateCore({ seed: seed, step: step, finalize: finalize }) }; var standardAggregate = function(name) { return aggregateCore(dataUtils.aggregators[name]) }; var select = function(getter) { if (!typeUtils.isFunction(getter) && !Array.isArray(getter)) { getter = [].slice.call(arguments) } return chainQuery(new SelectIterator(iter, getter)) }; var selectProp = function(name) { return select(compileGetter(name)) }; var chainQuery = function(iter) { return arrayQueryImpl(iter, queryOptions) }; return { toArray: function() { return iter.toArray() }, enumerate: function() { var d = (new Deferred).fail(handleError); try { d.resolve(iter.toArray()) } catch (x) { d.reject(x) } return d.promise() }, sortBy: function(getter, desc, compare) { return chainQuery(new SortIterator(iter, getter, desc, compare)) }, thenBy: function(getter, desc, compare) { if (iter instanceof SortIterator) { return chainQuery(iter.thenBy(getter, desc, compare)) } throw errorsModule.errors.Error("E4004") }, filter: function(criteria) { if (!Array.isArray(criteria)) { criteria = [].slice.call(arguments) } return chainQuery(new FilterIterator(iter, criteria)) }, slice: function(skip, take) { if (void 0 === take) { take = Number.MAX_VALUE } return chainQuery(new SliceIterator(iter, skip, take)) }, select: select, groupBy: function(getter) { return chainQuery(new GroupIterator(iter, getter)) }, aggregate: aggregate, count: function() { if (iter.countable()) { var d = (new Deferred).fail(handleError); try { d.resolve(iter.count()) } catch (x) { d.reject(x) } return d.promise() } return standardAggregate("count") }, sum: function(getter) { if (getter) { return selectProp(getter).sum() } return standardAggregate("sum") }, min: function(getter) { if (getter) { return selectProp(getter).min() } return standardAggregate("min") }, max: function(getter) { if (getter) { return selectProp(getter).max() } return standardAggregate("max") }, avg: function(getter) { if (getter) { return selectProp(getter).avg() } return standardAggregate("avg") } } }; module.exports = arrayQueryImpl }, /*!**********************************************************!*\ !*** ./artifacts/transpiled/data/odata/query_adapter.js ***! \**********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3); var config = __webpack_require__( /*! ../../core/config */ 31); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var queryAdapters = __webpack_require__( /*! ../query_adapters */ 181); var odataUtils = __webpack_require__( /*! ./utils */ 110); var serializePropName = odataUtils.serializePropName; var errors = __webpack_require__( /*! ../errors */ 36).errors; var dataUtils = __webpack_require__( /*! ../utils */ 41); var isFunction = typeUtils.isFunction; var DEFAULT_PROTOCOL_VERSION = 2; var compileCriteria = function() { var protocolVersion; var forceLowerCase; var fieldTypes; 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 (forceLowerCase) { prop = prop.indexOf("tolower(") === -1 ? "tolower(" + prop + ")" : prop; val = val.toLowerCase() } 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) { criteria = dataUtils.normalizeBinaryCriterion(criteria); var op = criteria[1]; var formatters = 4 === protocolVersion ? formattersV4 : formattersV2; var formatter = formatters[op.toLowerCase()]; if (!formatter) { throw errors.Error("E4003", op) } var fieldName = criteria[0]; var value = criteria[2]; if (fieldTypes && fieldTypes[fieldName]) { value = odataUtils.convertPrimitiveValue(fieldTypes[fieldName], value) } return formatter(serializePropName(fieldName), odataUtils.serializeValue(value, protocolVersion)) }; var compileUnary = function(criteria) { var op = criteria[0]; var crit = compileCore(criteria[1]); if ("!" === op) { return "not (" + crit + ")" } throw errors.Error("E4003", op) }; var compileGroup = function(criteria) { var bag = []; var groupOperator; var nextGroupOperator; iteratorUtils.each(criteria, function(index, criterion) { if (Array.isArray(criterion)) { if (bag.length > 1 && groupOperator !== nextGroupOperator) { throw new errors.Error("E4019") } bag.push("(" + compileCore(criterion) + ")"); groupOperator = nextGroupOperator; nextGroupOperator = "and" } else { nextGroupOperator = dataUtils.isConjunctiveOperator(this) ? "and" : "or" } }); return bag.join(" " + groupOperator + " ") }; var compileCore = function(criteria) { if (Array.isArray(criteria[0])) { return compileGroup(criteria) } if (dataUtils.isUnaryOperation(criteria)) { return compileUnary(criteria) } return compileBinary(criteria) }; return function(criteria, version, types, filterToLower) { fieldTypes = types; forceLowerCase = typeUtils.isDefined(filterToLower) ? filterToLower : config().oDataFilterToLower; protocolVersion = version; return compileCore(criteria) } }(); var createODataQueryAdapter = function(queryOptions) { var _sorting = []; var _criteria = []; var _expand = queryOptions.expand; var _select; var _skip; var _take; var _countQuery; var _oDataVersion = queryOptions.version || DEFAULT_PROTOCOL_VERSION; var hasSlice = function() { return _skip || void 0 !== _take }; var hasFunction = function hasFunction(criterion) { for (var i = 0; i < criterion.length; i++) { if (isFunction(criterion[i])) { return true } if (Array.isArray(criterion[i]) && hasFunction(criterion[i])) { return true } } return false }; 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 } result.$select = odataUtils.generateSelect(_oDataVersion, _select) || void 0; result.$expand = odataUtils.generateExpand(_oDataVersion, _expand, _select) || void 0 } if (_criteria.length) { var criteria = _criteria.length < 2 ? _criteria[0] : _criteria; var fieldTypes = queryOptions && queryOptions.fieldTypes; var filterToLower = queryOptions && queryOptions.filterToLower; result.$filter = compileCriteria(criteria, _oDataVersion, fieldTypes, filterToLower) } if (_countQuery) { result.$top = 0 } if (queryOptions.requireTotalCount || _countQuery) { if (4 !== _oDataVersion) { result.$inlinecount = "allpages" } else { result.$count = "true" } } return result }; function tryLiftSelect(tasks) { var selectIndex = -1; for (var i = 0; i < tasks.length; i++) { if ("select" === tasks[i].name) { selectIndex = i; break } } if (selectIndex < 0 || !isFunction(tasks[selectIndex].args[0])) { return } var nextTask = tasks[1 + selectIndex]; if (!nextTask || "slice" !== nextTask.name) { return } tasks[1 + selectIndex] = tasks[selectIndex]; tasks[selectIndex] = nextTask } return { optimize: function(tasks) { tryLiftSelect(tasks) }, 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, deserializeDates: queryOptions.deserializeDates, fieldTypes: queryOptions.fieldTypes, isPaged: isFinite(_take) }) }, multiSort: function(args) { var rules; if (hasSlice()) { return false } for (var i = 0; i < args.length; i++) { var getter = args[i][0]; var desc = !!args[i][1]; var rule; 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 (!Array.isArray(criterion)) { criterion = [].slice.call(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 (!Array.isArray(expr)) { expr = [].slice.call(arguments) } _select = expr }, count: function() { _countQuery = true } } }; queryAdapters.odata = createODataQueryAdapter; exports.odata = createODataQueryAdapter }, /*!**********************************************!*\ !*** ./artifacts/transpiled/core/version.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = "19.1.16" }, /*!****************************************************************!*\ !*** ./artifacts/transpiled/events/gesture/emitter.gesture.js ***! \****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var devices = __webpack_require__( /*! ../../core/devices */ 16); var styleUtils = __webpack_require__( /*! ../../core/utils/style */ 85); var callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 63); var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12); var readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48); var ready = readyCallbacks.add; var mathUtils = __webpack_require__( /*! ../../core/utils/math */ 28); var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined; var eventUtils = __webpack_require__( /*! ../utils */ 8); var Emitter = __webpack_require__( /*! ../core/emitter */ 123); var sign = mathUtils.sign; var abs = Math.abs; var SLEEP = 0; var INITED = 1; var STARTED = 2; var TOUCH_BOUNDARY = 10; var IMMEDIATE_TOUCH_BOUNDARY = 0; var IMMEDIATE_TIMEOUT = 180; var supportPointerEvents = function() { return styleUtils.styleProp("pointer-events") }; var setGestureCover = callOnce(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"); eventsEngine.subscribeGlobal($cover, "dxmousewheel", function(e) { e.preventDefault() }); ready(function() { $cover.appendTo("body") }); return function(toggle, cursor) { $cover.css("pointerEvents", toggle ? "all" : "none"); toggle && $cover.css("cursor", cursor) } }); var gestureCover = function(toggle, cursor) { var gestureCoverStrategy = setGestureCover(); gestureCoverStrategy(toggle, cursor) }; var GestureEmitter = Emitter.inherit({ gesture: true, configure: 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() { this.callBase.apply(this, arguments); this._toggleGestureCover(false); this._stage = SLEEP }, start: function(e) { if (e._needSkipEvent || eventUtils.needSkipEvent(e)) { this._cancel(e); return } this._startEvent = eventUtils.createEvent(e); this._startEventData = eventUtils.eventData(e); this._stage = INITED; this._init(e); this._setupImmediateTimer() }, _setupImmediateTimer: function() { clearTimeout(this._immediateTimer); this._immediateAccepted = false; if (!this.immediate) { return } this._immediateTimer = setTimeout(function() { this._immediateAccepted = true }.bind(this), IMMEDIATE_TIMEOUT) }, move: function(e) { if (this._stage === INITED && this._directionConfirmed(e)) { this._stage = STARTED; this._resetActiveElement(); this._toggleGestureCover(true); this._clearSelection(e); this._adjustStartEvent(e); this._start(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) } } }, _directionConfirmed: function(e) { var touchBoundary = this._getTouchBoundary(e); var delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e)); var deltaX = abs(delta.x); var deltaY = abs(delta.y); var horizontalMove = this._validateMove(touchBoundary, deltaX, deltaY); var verticalMove = this._validateMove(touchBoundary, deltaY, deltaX); var direction = this.getDirection(e); var bothAccepted = "both" === direction && (horizontalMove || verticalMove); var horizontalAccepted = "horizontal" === direction && horizontalMove; var 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 || eventUtils.isDxMouseWheelEvent(e) ? IMMEDIATE_TOUCH_BOUNDARY : TOUCH_BOUNDARY }, _adjustStartEvent: function(e) { var touchBoundary = this._getTouchBoundary(e); var 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 && this.getElement().find(":focus").length) { domUtils.resetActiveElement() } }, _toggleGestureCover: function(toggle) { this._toggleGestureCoverImpl(toggle) }, _toggleGestureCoverImpl: function(toggle) { var isStarted = this._stage === STARTED; if (isStarted) { gestureCover(toggle, this.getElement().css("cursor")) } }, _clearSelection: function(e) { if (eventUtils.isDxMouseWheelEvent(e) || eventUtils.isTouchEvent(e)) { return } domUtils.clearSelection() }, end: function(e) { this._toggleGestureCover(false); 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 (isDefined(newBoundary)) { TOUCH_BOUNDARY = newBoundary; return } return TOUCH_BOUNDARY }; module.exports = GestureEmitter }, /*!************************************************!*\ !*** ./artifacts/transpiled/ui/scroll_view.js ***! \************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./scroll_view/ui.scroll_view */ 517) }, /*!********************************************!*\ !*** ./artifacts/transpiled/ui/toolbar.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var themes = __webpack_require__( /*! ./themes */ 30); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var grep = __webpack_require__( /*! ../core/utils/common */ 4).grep; var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var arrayUtils = __webpack_require__( /*! ../core/utils/array */ 14); var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3); var ActionSheetStrategy = __webpack_require__( /*! ./toolbar/ui.toolbar.strategy.action_sheet */ 571); var DropDownMenuStrategy = __webpack_require__( /*! ./toolbar/ui.toolbar.strategy.drop_down_menu */ 572); var ToolbarBase = __webpack_require__( /*! ./toolbar/ui.toolbar.base */ 289); var ChildDefaultTemplate = __webpack_require__( /*! ./widget/child_default_template */ 134); var STRATEGIES = { actionSheet: ActionSheetStrategy, dropDownMenu: DropDownMenuStrategy }; var TOOLBAR_AUTO_HIDE_ITEM_CLASS = "dx-toolbar-item-auto-hide"; var TOOLBAR_AUTO_HIDE_TEXT_CLASS = "dx-toolbar-text-auto-hide"; var TOOLBAR_HIDDEN_ITEM = "dx-toolbar-item-invisible"; var Toolbar = ToolbarBase.inherit({ _getDefaultOptions: function() { return extend(this.callBase(), { menuItemTemplate: "menuItem", submenuType: "dropDownMenu", menuContainer: void 0 }) }, _defaultOptionsRules: function() { var themeName = themes.current(); return this.callBase().concat([{ device: function() { return themes.isIos7(themeName) }, options: { submenuType: "actionSheet" } }]) }, _dimensionChanged: function(dimension) { if ("height" === dimension) { return } this._menuStrategy.toggleMenuVisibility(false, true); this.callBase(); this._menuStrategy.renderMenuItems() }, _initTemplates: function() { this.callBase(); this._defaultTemplates.actionSheetItem = new ChildDefaultTemplate("item", this) }, _initMarkup: function() { this.callBase(); this._renderMenu() }, _postProcessRenderItems: function() { this._hideOverflowItems(); this._menuStrategy._updateMenuVisibility(); this.callBase(); this._menuStrategy.renderMenuItems() }, _renderItem: function(index, item, itemContainer, $after) { var itemElement = this.callBase(index, item, itemContainer, $after); if ("auto" === item.locateInMenu) { itemElement.addClass(TOOLBAR_AUTO_HIDE_ITEM_CLASS) } if ("dxButton" === item.widget && "inMenu" === item.showText) { itemElement.toggleClass(TOOLBAR_AUTO_HIDE_TEXT_CLASS) } return itemElement }, _getItemsWidth: function() { return this._getSummaryItemsWidth([this._$beforeSection, this._$centerSection, this._$afterSection]) }, _hideOverflowItems: function(elementWidth) { var overflowItems = this.$element().find("." + TOOLBAR_AUTO_HIDE_ITEM_CLASS); if (!overflowItems.length) { return } elementWidth = elementWidth || this.$element().width(); $(overflowItems).removeClass(TOOLBAR_HIDDEN_ITEM); var itemsWidth = this._getItemsWidth(); while (overflowItems.length && elementWidth < itemsWidth) { var $item = overflowItems.eq(-1); itemsWidth -= $item.outerWidth(); $item.addClass(TOOLBAR_HIDDEN_ITEM); overflowItems.splice(-1, 1) } }, _getMenuItems: function() { var that = this; var menuItems = grep(this.option("items") || [], function(item) { return that._isMenuItem(item) }); var $hiddenItems = this._itemContainer().children("." + TOOLBAR_AUTO_HIDE_ITEM_CLASS + "." + TOOLBAR_HIDDEN_ITEM).not(".dx-state-invisible"); this._restoreItems = this._restoreItems || []; var overflowItems = [].slice.call($hiddenItems).map(function(item) { var itemData = that._getItemData(item); var $itemContainer = $(item).children(); var $itemMarkup = $itemContainer.children(); return extend({ menuItemTemplate: function() { that._restoreItems.push({ container: $itemContainer, item: $itemMarkup }); var $container = $("
").addClass(TOOLBAR_AUTO_HIDE_ITEM_CLASS); return $container.append($itemMarkup) } }, itemData) }); return arrayUtils.merge(overflowItems, menuItems) }, _getToolbarItems: function() { var that = this; return grep(this.option("items") || [], function(item) { return !that._isMenuItem(item) }) }, _renderMenu: function() { this._renderMenuStrategy(); this._menuStrategy.render() }, _renderMenuStrategy: function() { var strategyName = this.option("submenuType"); if (this._requireDropDownStrategy()) { strategyName = "dropDownMenu" } var strategy = STRATEGIES[strategyName]; if (!(this._menuStrategy && this._menuStrategy.NAME === strategyName)) { this._menuStrategy = new strategy(this) } }, _requireDropDownStrategy: function() { var items = this.option("items") || []; var result = false; iteratorUtils.each(items, function(index, item) { if ("auto" === item.locateInMenu) { result = true } else { if ("always" === item.locateInMenu && item.widget) { result = true } } }); return result }, _arrangeItems: function() { if (this.$element().is(":hidden")) { return } this._$centerSection.css({ margin: "0 auto", "float": "none" }); iteratorUtils.each(this._restoreItems || [], function(_, obj) { $(obj.container).append(obj.item) }); this._restoreItems = []; var elementWidth = this.$element().width(); this._hideOverflowItems(elementWidth); this.callBase(elementWidth) }, _itemOptionChanged: function(item, property, value) { if (this._isMenuItem(item)) { this._menuStrategy.renderMenuItems() } else { if (this._isToolbarItem(item)) { this.callBase(item, property, value) } else { this.callBase(item, property, value); this._menuStrategy.renderMenuItems() } } }, _isMenuItem: function(itemData) { return "menu" === itemData.location || "always" === itemData.locateInMenu }, _isToolbarItem: function(itemData) { return void 0 === itemData.location || "never" === itemData.locateInMenu }, _optionChanged: function(args) { var name = args.name; var value = args.value; switch (name) { case "submenuType": this._invalidate(); break; case "visible": this.callBase.apply(this, arguments); this._menuStrategy.handleToolbarVisibilityChange(value); break; case "menuItemTemplate": this._changeMenuOption("itemTemplate", this._getTemplate(value)); break; case "onItemClick": this._changeMenuOption(name, value); this.callBase.apply(this, arguments); break; case "menuContainer": this._changeMenuOption("container", value); break; default: this.callBase.apply(this, arguments) } }, _changeMenuOption: function(name, value) { this._menuStrategy.widgetOption(name, value) } }); registerComponent("dxToolbar", Toolbar); module.exports = Toolbar }, /*!********************************************!*\ !*** ./artifacts/transpiled/ui/tooltip.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./tooltip/tooltip */ 326); module.exports.show = __webpack_require__( /*! ./tooltip/ui.tooltip */ 227).show; module.exports.hide = __webpack_require__( /*! ./tooltip/ui.tooltip */ 227).hide }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/ui/shared/filtering.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray; var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3); var DEFAULT_DATE_INTERVAL = ["year", "month", "day"]; var DEFAULT_DATETIME_INTERVAL = ["year", "month", "day", "hour", "minute"]; module.exports = function() { var getFilterSelector = function(column, target) { var selector = column.dataField || column.selector; if ("search" === target) { selector = column.displayField || column.calculateDisplayValue || selector } return selector }; var isZeroTime = function(date) { return date.getHours() + date.getMinutes() + date.getSeconds() + date.getMilliseconds() < 1 }; var isDateType = function(dataType) { return "date" === dataType || "datetime" === dataType }; var getDateValues = function(dateValue) { if (typeUtils.isDate(dateValue)) { return [dateValue.getFullYear(), dateValue.getMonth(), dateValue.getDate(), dateValue.getHours(), dateValue.getMinutes(), dateValue.getSeconds()] } return iteratorUtils.map(("" + dateValue).split("/"), function(value, index) { return 1 === index ? Number(value) - 1 : Number(value) }) }; var getFilterExpressionByRange = function(filterValue, target) { var column = this; var endFilterValue; var startFilterExpression; var endFilterExpression; var selector = getFilterSelector(column, target); if (Array.isArray(filterValue) && typeUtils.isDefined(filterValue[0]) && typeUtils.isDefined(filterValue[1])) { startFilterExpression = [selector, ">=", filterValue[0]]; endFilterExpression = [selector, "<=", filterValue[1]]; if (isDateType(column.dataType) && isZeroTime(filterValue[1])) { endFilterValue = new Date(filterValue[1].getTime()); if ("date" === column.dataType) { endFilterValue.setDate(filterValue[1].getDate() + 1) } endFilterExpression = [selector, "<", endFilterValue] } return [startFilterExpression, "and", endFilterExpression] } }; var getFilterExpressionForDate = function(filterValue, selectedFilterOperation, target) { var column = this; var dateStart; var dateEnd; var dateInterval; var values = getDateValues(filterValue); var selector = getFilterSelector(column, target); if ("headerFilter" === target) { dateInterval = module.exports.getGroupInterval(column)[values.length - 1] } else { if ("datetime" === column.dataType) { dateInterval = "minute" } } 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 column = this; var selector = getFilterSelector(column, target); var groupInterval = module.exports.getGroupInterval(column); if ("headerFilter" === target && groupInterval && typeUtils.isDefined(filterValue)) { var values = ("" + filterValue).split("/"); var value = Number(values[values.length - 1]); var interval = groupInterval[values.length - 1]; var startFilterValue = [selector, ">=", value]; var endFilterValue = [selector, "<", value + interval]; var condition = [startFilterValue, "and", endFilterValue]; return condition } return [selector, selectedFilterOperation || "=", filterValue] }; return { defaultCalculateFilterExpression: function(filterValue, selectedFilterOperation, target) { var column = this; var selector = getFilterSelector(column, target); var isSearchByDisplayValue = column.calculateDisplayValue && "search" === target; var dataType = isSearchByDisplayValue && column.lookup && column.lookup.dataType || column.dataType; var filter = null; if (("headerFilter" === target || "filterBuilder" === 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, [filterValue, target]) } else { if (isDateType(dataType) && typeUtils.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 }, getGroupInterval: function(column) { var index; var result = []; var dateIntervals = ["year", "month", "day", "hour", "minute", "second"]; var groupInterval = column.headerFilter && column.headerFilter.groupInterval; var interval = "quarter" === groupInterval ? "month" : groupInterval; if (isDateType(column.dataType) && null !== groupInterval) { result = "datetime" === column.dataType ? DEFAULT_DATETIME_INTERVAL : DEFAULT_DATE_INTERVAL; index = inArray(interval, dateIntervals); if (index >= 0) { result = dateIntervals.slice(0, index); result.push(groupInterval); return result } return result } else { if (typeUtils.isDefined(groupInterval)) { return Array.isArray(groupInterval) ? groupInterval : [groupInterval] } } } } }() }, /*!************************************************************************!*\ !*** ./artifacts/transpiled/ui/grid_core/ui.grid_core.columns_view.js ***! \************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _element_data = __webpack_require__( /*! ../../core/element_data */ 39); var _element_data2 = _interopRequireDefault(_element_data); var _pointer = __webpack_require__( /*! ../../events/pointer */ 23); var _pointer2 = _interopRequireDefault(_pointer); var _click = __webpack_require__( /*! ../../events/click */ 19); var _click2 = _interopRequireDefault(_click); var _double_click = __webpack_require__( /*! ../../events/double_click */ 128); var _double_click2 = _interopRequireDefault(_double_click); var _browser = __webpack_require__( /*! ../../core/utils/browser */ 25); var _browser2 = _interopRequireDefault(_browser); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _style = __webpack_require__( /*! ../../core/utils/style */ 85); var _style2 = _interopRequireDefault(_style); var _dom = __webpack_require__( /*! ../../core/utils/dom */ 12); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _type2 = _interopRequireDefault(_type); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var _iterator2 = _interopRequireDefault(_iterator); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _position = __webpack_require__( /*! ../../core/utils/position */ 97); var _uiGrid_core = __webpack_require__( /*! ./ui.grid_core.modules */ 37); var _uiGrid_core2 = _interopRequireDefault(_uiGrid_core); var _uiGrid_core3 = __webpack_require__( /*! ./ui.grid_core.utils */ 35); var _uiGrid_core4 = __webpack_require__( /*! ./ui.grid_core.column_state_mixin */ 335); var _uiGrid_core5 = _interopRequireDefault(_uiGrid_core4); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var SCROLL_CONTAINER_CLASS = "scroll-container"; var GROUP_SPACE_CLASS = "group-space"; var CONTENT_CLASS = "content"; var TABLE_CLASS = "table"; var TABLE_FIXED_CLASS = "table-fixed"; var CONTENT_FIXED_CLASS = "content-fixed"; var ROW_CLASS = "dx-row"; var FIXED_COL_CLASS = "dx-col-fixed"; var GROUP_ROW_CLASS = "dx-group-row"; var DETAIL_ROW_CLASS = "dx-master-detail-row"; var FILTER_ROW_CLASS = "filter-row"; var CELL_UPDATED_ANIMATION_CLASS = "cell-updated-animation"; var HIDDEN_COLUMNS_WIDTH = "0.0001px"; var CELL_HINT_VISIBLE = "dxCellHintVisible"; var FORM_FIELD_ITEM_CONTENT_CLASS = "dx-field-item-content"; var appendElementTemplate = { render: function(options) { options.container.append(options.content) } }; var subscribeToRowEvents = function(that, $table) { var touchTarget; var touchCurrentTarget; var timeoutId; function clearTouchTargets(timeout) { return setTimeout(function() { touchTarget = touchCurrentTarget = null }, timeout) } _events_engine2.default.on($table, "touchstart touchend", ".dx-row", function(e) { clearTimeout(timeoutId); if ("touchstart" === e.type) { touchTarget = e.target; touchCurrentTarget = e.currentTarget; timeoutId = clearTouchTargets(1e3) } else { timeoutId = clearTouchTargets() } }); _events_engine2.default.on($table, [_click2.default.name, _double_click2.default.name, _pointer2.default.down].join(" "), ".dx-row", { useNative: that._isNativeClick() }, that.createAction(function(e) { var event = e.event; if (touchTarget) { event.target = touchTarget; event.currentTarget = touchCurrentTarget } if (!(0, _renderer2.default)(event.target).closest("a").length) { e.rowIndex = that.getRowIndex(event.currentTarget); if (e.rowIndex >= 0) { e.rowElement = (0, _dom.getPublicElement)((0, _renderer2.default)(event.currentTarget)); e.columns = that.getColumns(); if (event.type === _pointer2.default.down) { that._rowPointerDown(e) } else { if (event.type === _click2.default.name) { that._rowClick(e) } else { that._rowDblClick(e) } } } } })) }; var getWidthStyle = function(width) { if ("auto" === width) { return "" } return _type2.default.isNumeric(width) ? width + "px" : width }; var setCellWidth = function(cell, column, width) { cell.style.width = cell.style.maxWidth = "auto" === column.width ? "" : width }; var copyAttributes = function(element, newElement) { if (!element || !newElement) { return } var oldAttributes = element.attributes; var newAttributes = newElement.attributes; var i; for (i = 0; i < oldAttributes.length; i++) { var name = oldAttributes[i].nodeName; if (!newElement.hasAttribute(name)) { element.removeAttribute(name) } } for (i = 0; i < newAttributes.length; i++) { element.setAttribute(newAttributes[i].nodeName, newAttributes[i].nodeValue) } }; exports.ColumnsView = _uiGrid_core2.default.View.inherit(_uiGrid_core5.default).inherit({ _createScrollableOptions: function() { var that = this; var scrollingOptions = that.option("scrolling"); var useNativeScrolling = that.option("scrolling.useNative"); var options = (0, _extend.extend)({ pushBackValue: 0 }, 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; var alignment = column.alignment || (0, _position.getDefaultAlignment)(this.option("rtlEnabled")); var cell = _dom_adapter2.default.createElement("td"); cell.style.textAlign = alignment; var $cell = (0, _renderer2.default)(cell); if ("data" === options.rowType && column.headerId && !column.type) { if (this.component.option("showColumnHeaders")) { this.setAria("describedby", column.headerId, $cell) } } if (column.cssClass) { $cell.addClass(column.cssClass) } if ("expand" === column.command) { $cell.addClass(column.cssClass); $cell.addClass(this.addWidgetPrefix(GROUP_SPACE_CLASS)) } if (column.colspan > 1) { $cell.attr("colSpan", column.colspan) } else { if (!column.isBand && "auto" !== column.visibleWidth && !this.option("legacyRendering") && this.option("columnAutoWidth")) { if (column.width || column.minWidth) { cell.style.minWidth = getWidthStyle(column.minWidth || column.width) } if (column.width) { setCellWidth(cell, column, getWidthStyle(column.width)) } } } if (_browser2.default.mozilla && options.column.fixed) { $cell.addClass(FIXED_COL_CLASS) } return $cell }, _createRow: function(rowObject) { var $element = (0, _renderer2.default)("").addClass(ROW_CLASS); this.setAria("role", "row", $element); return $element }, _createTable: function(columns, isAppend) { var that = this; var $table = (0, _renderer2.default)("").addClass(that.addWidgetPrefix(TABLE_CLASS)).addClass(that.addWidgetPrefix(TABLE_FIXED_CLASS)); if (columns && !isAppend) { $table.append(that._createColGroup(columns)); if (_browser2.default.safari) { $table.append((0, _renderer2.default)("").append("")) } that.setAria("role", "presentation", $table) } else { that.setAria("hidden", true, $table) } this.setAria("role", "presentation", (0, _renderer2.default)("").appendTo($table)); if (isAppend) { return $table } if (_browser2.default.mozilla) { _events_engine2.default.on($table, "mousedown", "td", function(e) { if (e.ctrlKey) { e.preventDefault() } }) } if (that.option("cellHintEnabled")) { _events_engine2.default.on($table, "mousemove", ".dx-row > td", this.createAction(function(args) { var e = args.event; var $element = (0, _renderer2.default)(e.target); var $cell = (0, _renderer2.default)(e.currentTarget); var $row = $cell.parent(); var isDataRow = $row.hasClass("dx-data-row"); var isHeaderRow = $row.hasClass("dx-header-row"); var isGroupRow = $row.hasClass(GROUP_ROW_CLASS); var isMasterDetailRow = $row.hasClass(DETAIL_ROW_CLASS); var isFilterRow = $row.hasClass(that.addWidgetPrefix(FILTER_ROW_CLASS)); var visibleColumns = that._columnsController.getVisibleColumns(); var rowOptions = $row.data("options"); var columnIndex = $cell.index(); var cellOptions = rowOptions && rowOptions.cells && rowOptions.cells[columnIndex]; var column = cellOptions ? cellOptions.column : visibleColumns[columnIndex]; var msieCorrection = _browser2.default.msie ? 1 : 0; if (!isMasterDetailRow && !isFilterRow && (!isDataRow || isDataRow && column && !column.cellTemplate) && (!isHeaderRow || isHeaderRow && column && !column.headerCellTemplate) && (!isGroupRow || isGroupRow && column && (void 0 === column.groupIndex || !column.groupCellTemplate))) { if ($element.data(CELL_HINT_VISIBLE)) { $element.removeAttr("title"); $element.data(CELL_HINT_VISIBLE, false) } var difference = $element[0].scrollWidth - $element[0].clientWidth - msieCorrection; if (difference > 0 && !_type2.default.isDefined($element.attr("title"))) { $element.attr("title", $element.text()); $element.data(CELL_HINT_VISIBLE, true) } } })) } var getOptions = function(event) { var $cell = (0, _renderer2.default)(event.currentTarget); var $fieldItemContent = (0, _renderer2.default)(event.target).closest("." + FORM_FIELD_ITEM_CONTENT_CLASS); var rowOptions = $cell.parent().data("options"); var options = rowOptions && rowOptions.cells && rowOptions.cells[$cell.index()]; if (!$cell.closest("table").is(event.delegateTarget)) { return } var resultOptions = (0, _extend.extend)({}, options, { cellElement: (0, _dom.getPublicElement)($cell), event: event, eventType: event.type }); if ($fieldItemContent.length) { var formItemOptions = $fieldItemContent.data("dx-form-item"); if (formItemOptions.column) { resultOptions.column = formItemOptions.column; resultOptions.columnIndex = that._columnsController.getVisibleIndex(resultOptions.column.index) } } return resultOptions }; _events_engine2.default.on($table, "mouseover", ".dx-row > td", function(e) { var options = getOptions(e); options && that.executeAction("onCellHoverChanged", options) }); _events_engine2.default.on($table, "mouseout", ".dx-row > td", function(e) { var options = getOptions(e); options && that.executeAction("onCellHoverChanged", options) }); _events_engine2.default.on($table, _click2.default.name, ".dx-row > td", function(e) { var options = getOptions(e); options && that.executeAction("onCellClick", options) }); _events_engine2.default.on($table, _double_click2.default.name, ".dx-row > td", function(e) { var options = getOptions(e); options && that.executeAction("onCellDblClick", options) }); subscribeToRowEvents(that, $table); return $table }, _isNativeClick: _common.noop, _rowPointerDown: _common.noop, _rowClick: _common.noop, _rowDblClick: _common.noop, _createColGroup: function(columns) { var colgroupElement = (0, _renderer2.default)(""); for (var i = 0; i < columns.length; i++) { var colspan = columns[i].colspan || 1; for (var 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 = HIDDEN_COLUMNS_WIDTH } var col = (0, _renderer2.default)(""); _style2.default.setWidth(col, width); return col }, renderDelayedTemplates: function() { var delayedTemplates = this._delayedTemplates; var syncTemplates = delayedTemplates.filter(function(template) { return !template.async }); var asyncTemplates = delayedTemplates.filter(function(template) { return template.async }); this._delayedTemplates = []; this._renderDelayedTemplatesCore(syncTemplates); this._renderDelayedTemplatesCoreAsync(asyncTemplates) }, _renderDelayedTemplatesCoreAsync: function(templates) { var that = this; if (templates.length) { (0, _window.getWindow)().setTimeout(function() { that._renderDelayedTemplatesCore(templates, true) }) } }, _renderDelayedTemplatesCore: function(templates, isAsync) { var date = new Date; while (templates.length) { var templateParameters = templates.shift(); var options = templateParameters.options; var model = options.model; var doc = _dom_adapter2.default.getDocument(); if (!isAsync || (0, _renderer2.default)(options.container).closest(doc).length) { templateParameters.template.render(options); if (model && model.column) { this._updateCell(options.container, model) } } if (isAsync && new Date - date > 30) { this._renderDelayedTemplatesCoreAsync(templates); break } } }, _processTemplate: function(template) { var that = this; var renderingTemplate; if (template && template.render && !_type2.default.isRenderer(template)) { renderingTemplate = { allowRenderToDetachedContainer: template.allowRenderToDetachedContainer, render: function(options) { template.render(options.container, options.model) } } } else { if (_type2.default.isFunction(template)) { renderingTemplate = { render: function(options) { var renderedTemplate = template((0, _dom.getPublicElement)(options.container), options.model); if (renderedTemplate && (renderedTemplate.nodeType || _type2.default.isRenderer(renderedTemplate))) { options.container.append(renderedTemplate) } } } } else { var templateID = _type2.default.isString(template) ? template : (0, _renderer2.default)(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, allowRenderToDetachedContainer) { var that = this; var renderingTemplate = that._processTemplate(template, options); var column = options.column; var isDataRow = "data" === options.rowType; if (renderingTemplate) { options.component = that.component; var async = column && (column.renderAsync && isDataRow || that.option("renderAsync") && (false !== column.renderAsync && (column.command || column.showEditorAlways) && isDataRow || "filter" === options.rowType)); if ((renderingTemplate.allowRenderToDetachedContainer || allowRenderToDetachedContainer) && !async) { renderingTemplate.render({ container: container, model: options }); return true } else { that._delayedTemplates.push({ template: renderingTemplate, options: { container: container, model: options }, async: async }) } } return false }, _getBodies: function(tableElement) { return (0, _renderer2.default)(tableElement).children("tbody").not(".dx-header").not(".dx-footer") }, _wrapRowIfNeed: function($table, $row) { var $tBodies = this.option("rowTemplate") && this._getBodies(this._tableElement || $table); if ($tBodies && $tBodies.filter("." + ROW_CLASS).length) { var $tbody = (0, _renderer2.default)("").addClass($row.attr("class")); this.setAria("role", "presentation", $tbody); return $tbody.append($row) } return $row }, _appendRow: function($table, $row, appendTemplate) { appendTemplate = appendTemplate || appendElementTemplate; appendTemplate.render({ content: $row, container: $table }) }, _resizeCore: function() { var scrollLeft = this._scrollLeft; if (scrollLeft >= 0) { this._scrollLeft = 0; this.scrollTo({ left: scrollLeft }) } }, _renderCore: function(e) { var $root = this.element().parent(); if (!$root || $root.parent().length) { this.renderDelayedTemplates(e) } }, _renderTable: function(options) { options = options || {}; options.columns = this._columnsController.getVisibleColumns(); var changeType = options.change && options.change.changeType; var $table = this._createTable(options.columns, "append" === changeType || "prepend" === changeType || "update" === changeType); this._renderRows($table, options); return $table }, _renderRows: function($table, options) { var that = this; var rows = that._getRows(options.change); var columnIndices = options.change && options.change.columnIndices || []; var changeTypes = options.change && options.change.changeTypes || []; for (var i = 0; i < rows.length; i++) { that._renderRow($table, (0, _extend.extend)({ row: rows[i], columnIndices: columnIndices[i], changeType: changeTypes[i] }, options)) } }, _renderRow: function($table, options) { if (!options.columnIndices) { options.row.cells = [] } var $row = this._createRow(options.row); var $wrappedRow = this._wrapRowIfNeed($table, $row); if ("remove" !== options.changeType) { this._renderCells($row, options) } this._appendRow($table, $wrappedRow); var rowOptions = (0, _extend.extend)({ columns: options.columns }, options.row); this._addWatchMethod(rowOptions, options.row); this._rowPrepared($wrappedRow, rowOptions, options.row) }, _renderCells: function($row, options) { var that = this; var columnIndex = 0; var row = options.row; var columns = options.columns; for (var i = 0; i < columns.length; i++) { if (!options.columnIndices || options.columnIndices.indexOf(i) >= 0) { that._renderCell($row, (0, _extend.extend)({ column: columns[i], columnIndex: columnIndex, value: row.values && row.values[columnIndex], oldValue: row.oldValues && row.oldValues[columnIndex] }, options)) } if (columns[i].colspan > 1) { columnIndex += columns[i].colspan } else { columnIndex++ } } }, _updateCells: function($rowElement, $newRowElement, columnIndices) { var $cells = $rowElement.children(); var $newCells = $newRowElement.children(); var highlightChanges = this.option("highlightChanges"); var cellUpdatedClass = this.addWidgetPrefix(CELL_UPDATED_ANIMATION_CLASS); columnIndices.forEach(function(columnIndex, index) { var $cell = $cells.eq(columnIndex); var $newCell = $newCells.eq(index); $cell.replaceWith($newCell); if (highlightChanges && !$newCell.hasClass("dx-command-expand")) { $newCell.addClass(cellUpdatedClass) } }); copyAttributes($rowElement.get(0), $newRowElement.get(0)) }, _setCellAriaAttributes: function($cell, cellOptions) { if ("freeSpace" !== cellOptions.rowType) { this.setAria("selected", false, $cell); this.setAria("role", "gridcell", $cell); this.setAria("colindex", cellOptions.columnIndex + 1, $cell) } }, _renderCell: function($row, options) { var that = this; var cellOptions = that._getCellOptions(options); if (options.columnIndices) { if (options.row.cells) { options.row.cells[cellOptions.columnIndex] = cellOptions } } else { options.row.cells.push(cellOptions) } var $cell = that._createCell(cellOptions); that._setCellAriaAttributes($cell, cellOptions); 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() {}, _getRows: function() { return [] }, _getCellOptions: function(options) { var cellOptions = { column: options.column, columnIndex: options.columnIndex, rowType: options.row.rowType }; this._addWatchMethod(cellOptions); return cellOptions }, _addWatchMethod: function(options, source) { if (!this.option("repaintChangesOnly")) { return } var watchers = []; source = source || options; source.watch = source.watch || function(getter, updateFunc) { var oldValue = getter(source.data); var watcher = function() { var newValue = getter(source.data); if (JSON.stringify(oldValue) !== JSON.stringify(newValue)) { updateFunc(newValue, oldValue); oldValue = newValue } }; watchers.push(watcher); var stopWatch = function() { var index = watchers.indexOf(watcher); if (index >= 0) { watchers.splice(index, 1) } }; return stopWatch }; source.update = source.update || function(row) { this.data = options.data = row.data; this.rowIndex = options.rowIndex = row.rowIndex; this.dataIndex = options.dataIndex = row.dataIndex; this.isExpanded = options.isExpanded = row.isExpanded; if (options.row) { options.row = row } watchers.forEach(function(watcher) { watcher() }) }; if (source !== options) { options.watch = source.watch.bind(source) } return options }, _cellPrepared: function(cell, options) { options.cellElement = (0, _dom.getPublicElement)((0, _renderer2.default)(cell)); this.executeAction("onCellPrepared", options) }, _rowPrepared: function($row, options) { _element_data2.default.data($row.get(0), "options", options); options.rowElement = (0, _dom.getPublicElement)($row); this.executeAction("onRowPrepared", options) }, _columnOptionChanged: function(e) { var optionNames = e.optionNames; if ((0, _uiGrid_core3.checkChanges)(optionNames, ["width", "visibleWidth"])) { var visibleColumns = this._columnsController.getVisibleColumns(); var widths = _iterator2.default.map(visibleColumns, function(column) { var width = column.visibleWidth || column.width; return _type2.default.isDefined(width) ? width : "auto" }); this.setColumnWidths({ widths: widths, optionNames: optionNames }); return } if (!this._requireReady) { this.render() } }, getCellIndex: function($cell) { var cellIndex = $cell.length ? $cell[0].cellIndex : -1; return cellIndex }, getTableElements: function() { return this._tableElement || (0, _renderer2.default)() }, _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 = -1; that._columnsController = that.getController("columns"); that._dataController = that.getController("data"); that._delayedTemplates = []; that._templatesCache = {}; that.createAction("onCellClick"); that.createAction("onRowClick"); that.createAction("onCellDblClick"); that.createAction("onRowDblClick"); that.createAction("onCellHoverChanged", { excludeValidators: ["disabled", "readOnly"] }); that.createAction("onCellPrepared", { excludeValidators: ["disabled", "readOnly"], category: "rendering" }); that.createAction("onRowPrepared", { excludeValidators: ["disabled", "readOnly"], category: "rendering", afterExecute: function(e) { that._afterRowPrepared(e) } }); that._columnsController.columnsChanged.add(that._columnOptionChanged.bind(that)); that._dataController && that._dataController.changed.add(that._handleDataChanged.bind(that)) }, _afterRowPrepared: _common.noop, _handleDataChanged: function() {}, callbackNames: function() { return ["scrollChanged"] }, _updateScrollLeftPosition: function() { var scrollLeft = this._scrollLeft; if (scrollLeft >= 0) { this._scrollLeft = 0; this.scrollTo({ left: scrollLeft }) } }, scrollTo: function(pos) { var $element = this.element(); var $scrollContainer = $element && $element.children("." + this.addWidgetPrefix(SCROLL_CONTAINER_CLASS)).not("." + this.addWidgetPrefix(CONTENT_FIXED_CLASS)); if (_type2.default.isDefined(pos) && _type2.default.isDefined(pos.left) && this._scrollLeft !== pos.left) { this._scrollLeft = pos.left; $scrollContainer && $scrollContainer.scrollLeft(pos.left) } }, _wrapTableInScrollContainer: function($table) { var _this = this; var $scrollContainer = (0, _renderer2.default)("
"); _events_engine2.default.on($scrollContainer, "scroll", function() { var scrollLeft = $scrollContainer.scrollLeft(); if (scrollLeft !== _this._scrollLeft) { _this.scrollChanged.fire({ left: scrollLeft }, _this.name) } }); $scrollContainer.addClass(this.addWidgetPrefix(CONTENT_CLASS)).addClass(this.addWidgetPrefix(SCROLL_CONTAINER_CLASS)).append($table).appendTo(this.element()); this.setAria("role", "presentation", $scrollContainer); return $scrollContainer }, _updateContent: function($newTableElement) { this._setTableElement($newTableElement); this._wrapTableInScrollContainer($newTableElement) }, _findContentElement: _common.noop, _getWidths: function($cellElements) { var result = []; var legacyRendering = this.option("legacyRendering"); var width; if ($cellElements) { _iterator2.default.each($cellElements, function(index, item) { width = item.offsetWidth; if (item.getBoundingClientRect) { var clientRect = item.getBoundingClientRect(); if (clientRect.width > width - 1) { width = legacyRendering ? Math.ceil(clientRect.width) : clientRect.width } } result.push(width) }) } return result }, getColumnWidths: function($tableElement) { var that = this; var result = []; var $rows; var $cells; (this.option("forceApplyBindings") || _common.noop)(); $tableElement = $tableElement || that._getTableElement(); if ($tableElement) { $rows = $tableElement.children("tbody").children(); for (var i = 0; i < $rows.length; i++) { var $row = $rows.eq(i); var isRowVisible = "none" !== $row.get(0).style.display && !$row.hasClass("dx-state-invisible"); if (!$row.is("." + GROUP_ROW_CLASS) && !$row.is("." + DETAIL_ROW_CLASS) && isRowVisible) { $cells = $row.children("td"); break } } result = that._getWidths($cells) } return result }, getVisibleColumnIndex: function(columnIndex, rowIndex) { return columnIndex }, setColumnWidths: function(_ref) { var widths = _ref.widths, $tableElement = _ref.$tableElement, columns = _ref.columns, fixed = _ref.fixed; var $cols; var width; var minWidth; var columnIndex; var columnAutoWidth = this.option("columnAutoWidth"); var legacyRendering = this.option("legacyRendering"); $tableElement = $tableElement || this._getTableElement(); if ($tableElement && $tableElement.length && widths) { columnIndex = 0; $cols = $tableElement.children("colgroup").children("col"); _style2.default.setWidth($cols, "auto"); columns = columns || this.getColumns(null, $tableElement); for (var i = 0; i < columns.length; i++) { if (!legacyRendering && columnAutoWidth && !fixed) { width = columns[i].width; if (width && !columns[i].command) { width = columns[i].visibleWidth || width; width = getWidthStyle(width); minWidth = getWidthStyle(columns[i].minWidth || width); var $rows = $rows || $tableElement.children().children(".dx-row").not("." + GROUP_ROW_CLASS).not("." + DETAIL_ROW_CLASS); for (var rowIndex = 0; rowIndex < $rows.length; rowIndex++) { var visibleIndex = this.getVisibleColumnIndex(i, rowIndex); var cell = $rows[rowIndex].cells[visibleIndex]; if (cell) { setCellWidth(cell, columns[i], width); cell.style.minWidth = minWidth } } } } if (columns[i].colspan) { columnIndex += columns[i].colspan; continue } width = widths[columnIndex]; if ("adaptiveHidden" === width) { width = HIDDEN_COLUMNS_WIDTH } if ("number" === typeof width) { width = width.toFixed(3) + "px" } _style2.default.setWidth($cols.eq(columnIndex), _type2.default.isDefined(width) ? width : "auto"); columnIndex++ } } }, getCellElements: function(rowIndex) { return this._getCellElementsCore(rowIndex) }, _getCellElementsCore: function(rowIndex) { var $row = this._getRowElements().eq(rowIndex); return $row.children() }, _getCellElement: function(rowIndex, columnIdentifier) { var that = this; var $cell; var $cells = that.getCellElements(rowIndex); var columnVisibleIndex = that._getVisibleColumnIndex($cells, rowIndex, columnIdentifier); if ($cells.length && columnVisibleIndex >= 0) { $cell = $cells.eq(columnVisibleIndex) } if ($cell && $cell.length) { return $cell } }, _getRowElement: function(rowIndex) { var that = this; var $rowElement = (0, _renderer2.default)(); var $tableElements = that.getTableElements(); _iterator2.default.each($tableElements, function(_, tableElement) { $rowElement = $rowElement.add(that._getRowElements((0, _renderer2.default)(tableElement)).eq(rowIndex)) }); if ($rowElement.length) { return $rowElement } }, getCellElement: function(rowIndex, columnIdentifier) { return (0, _dom.getPublicElement)(this._getCellElement(rowIndex, columnIdentifier)) }, getRowElement: function(rowIndex) { var $rows = this._getRowElement(rowIndex); var elements = []; if ($rows && !(0, _dom.getPublicElement)($rows).get) { for (var i = 0; i < $rows.length; i++) { elements.push($rows[i]) } } else { elements = $rows } return elements }, _getVisibleColumnIndex: function($cells, rowIndex, columnIdentifier) { if (_type2.default.isString(columnIdentifier)) { var columnIndex = this._columnsController.columnOption(columnIdentifier, "index"); return this._columnsController.getVisibleIndex(columnIndex) } return columnIdentifier }, getColumnElements: function() {}, getColumns: function(rowIndex) { return this._columnsController.getVisibleColumns(rowIndex) }, getCell: function(cellPosition, rows) { var $rows = rows || this._getRowElements(); var $cells; if ($rows.length > 0 && cellPosition.rowIndex >= 0) { if ("virtual" !== this.option("scrolling.mode")) { 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(); if (tableElement) { var tBodies = this.option("rowTemplate") && tableElement.find("> tbody." + ROW_CLASS); return tBodies && tBodies.length ? tBodies : tableElement.find("> tbody > ." + ROW_CLASS + ", > ." + ROW_CLASS) } return (0, _renderer2.default)() }, getRowIndex: function($row) { return this._getRowElements().index($row) }, getBoundingRect: function() {}, getName: function() {}, setScrollerSpacing: function(width) { var that = this; var $element = that.element(); var rtlEnabled = that.option("rtlEnabled"); $element && $element.css(rtlEnabled ? { paddingLeft: width } : { paddingRight: width }) }, isScrollbarVisible: function(isHorizontal) { var $element = this.element(); var $tableElement = this._tableElement; if ($element && $tableElement) { return isHorizontal ? $tableElement.outerWidth() - $element.width() > 0 : $tableElement.outerHeight() - $element.height() > 0 } return false } }) }, /*!*********************************************!*\ !*** ./artifacts/transpiled/viz/palette.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports._DEBUG_palettes = void 0; var _palettes; exports.currentPalette = currentPalette; exports.generateColors = generateColors; exports.getPalette = getPalette; exports.registerPalette = registerPalette; exports.getAccentColor = getAccentColor; exports.createPalette = createPalette; exports.getDiscretePalette = getDiscretePalette; exports.getGradientPalette = getGradientPalette; var _utils = __webpack_require__( /*! ./core/utils */ 10); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _errors = __webpack_require__( /*! ../core/errors */ 21); var _errors2 = _interopRequireDefault(_errors); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }) } else { obj[key] = value } return obj } var _floor = Math.floor; var _ceil = Math.ceil; var _Color = __webpack_require__( /*! ../color */ 94); var _isArray = Array.isArray; var _isString = __webpack_require__( /*! ../core/utils/type */ 1).isString; var HIGHLIGHTING_STEP = 50; var DEFAULT_PALETTE = "material"; var officePalette = { simpleSet: ["#5f8b95", "#ba4d51", "#af8a53", "#955f71", "#859666", "#7e688c"], indicatingSet: ["#a3b97c", "#e1b676", "#ec7f83"], gradientSet: ["#5f8b95", "#ba4d51"], accentColor: "#ba4d51" }; var palettes = (_palettes = {}, _defineProperty(_palettes, DEFAULT_PALETTE, { simpleSet: ["#1db2f5", "#f5564a", "#97c95c", "#ffc720", "#eb3573", "#a63db8"], indicatingSet: ["#97c95c", "#ffc720", "#f5564a"], gradientSet: ["#1db2f5", "#97c95c"], accentColor: "#1db2f5" }), _defineProperty(_palettes, "default", officePalette), _defineProperty(_palettes, "office", officePalette), _defineProperty(_palettes, "harmony light", { simpleSet: ["#fcb65e", "#679ec5", "#ad79ce", "#7abd5c", "#e18e92", "#b6d623", "#b7abea", "#85dbd5"], indicatingSet: ["#b6d623", "#fcb65e", "#e18e92"], gradientSet: ["#7abd5c", "#fcb65e"], accentColor: "#679ec5" }), _defineProperty(_palettes, "soft pastel", { simpleSet: ["#60a69f", "#78b6d9", "#6682bb", "#a37182", "#eeba69", "#90ba58", "#456c68", "#7565a4"], indicatingSet: ["#90ba58", "#eeba69", "#a37182"], gradientSet: ["#78b6d9", "#eeba69"], accentColor: "#60a69f" }), _defineProperty(_palettes, "pastel", { simpleSet: ["#bb7862", "#70b3a1", "#bb626a", "#057d85", "#ab394b", "#dac599", "#153459", "#b1d2c6"], indicatingSet: ["#70b3a1", "#dac599", "#bb626a"], gradientSet: ["#bb7862", "#70b3a1"], accentColor: "#bb7862" }), _defineProperty(_palettes, "bright", { simpleSet: ["#70c92f", "#f8ca00", "#bd1550", "#e97f02", "#9d419c", "#7e4452", "#9ab57e", "#36a3a6"], indicatingSet: ["#70c92f", "#f8ca00", "#bd1550"], gradientSet: ["#e97f02", "#f8ca00"], accentColor: "#e97f02" }), _defineProperty(_palettes, "soft", { simpleSet: ["#cbc87b", "#9ab57e", "#e55253", "#7e4452", "#e8c267", "#565077", "#6babac", "#ad6082"], indicatingSet: ["#9ab57e", "#e8c267", "#e55253"], gradientSet: ["#9ab57e", "#e8c267"], accentColor: "#565077" }), _defineProperty(_palettes, "ocean", { simpleSet: ["#75c099", "#acc371", "#378a8a", "#5fa26a", "#064970", "#38c5d2", "#00a7c6", "#6f84bb"], indicatingSet: ["#c8e394", "#7bc59d", "#397c8b"], gradientSet: ["#acc371", "#38c5d2"], accentColor: "#378a8a" }), _defineProperty(_palettes, "vintage", { simpleSet: ["#dea484", "#efc59c", "#cb715e", "#eb9692", "#a85c4c", "#f2c0b5", "#c96374", "#dd956c"], indicatingSet: ["#ffe5c6", "#f4bb9d", "#e57660"], gradientSet: ["#efc59c", "#cb715e"], accentColor: "#cb715e" }), _defineProperty(_palettes, "violet", { simpleSet: ["#d1a1d1", "#eeacc5", "#7b5685", "#7e7cad", "#a13d73", "#5b41ab", "#e287e2", "#689cc1"], indicatingSet: ["#d8e2f6", "#d0b2da", "#d56a8a"], gradientSet: ["#eeacc5", "#7b5685"], accentColor: "#7b5685" }), _defineProperty(_palettes, "carmine", { simpleSet: ["#fb7764", "#73d47f", "#fed85e", "#d47683", "#dde392", "#757ab2"], indicatingSet: ["#5cb85c", "#f0ad4e", "#d9534f"], gradientSet: ["#fb7764", "#73d47f"], accentColor: "#f05b41" }), _defineProperty(_palettes, "dark moon", { simpleSet: ["#4ddac1", "#f4c99a", "#80dd9b", "#f998b3", "#4aaaa0", "#a5aef1"], indicatingSet: ["#59d8a4", "#f0ad4e", "#f9517e"], gradientSet: ["#4ddac1", "#f4c99a"], accentColor: "#3debd3" }), _defineProperty(_palettes, "soft blue", { simpleSet: ["#7ab8eb", "#97da97", "#facb86", "#e78683", "#839bda", "#4db7be"], indicatingSet: ["#5cb85c", "#f0ad4e", "#d9534f"], gradientSet: ["#7ab8eb", "#97da97"], accentColor: "#7ab8eb" }), _defineProperty(_palettes, "dark violet", { simpleSet: ["#9c63ff", "#64c064", "#eead51", "#d2504b", "#4b6bbf", "#2da7b0"], indicatingSet: ["#5cb85c", "#f0ad4e", "#d9534f"], gradientSet: ["#9c63ff", "#64c064"], accentColor: "#9c63ff" }), _defineProperty(_palettes, "green mist", { simpleSet: ["#3cbab2", "#8ed962", "#5b9d95", "#efcc7c", "#f1929f", "#4d8dab"], indicatingSet: ["#72d63c", "#ffc852", "#f74a5e"], gradientSet: ["#3cbab2", "#8ed962"], accentColor: "#3cbab2" }), _palettes); var currentPaletteName; function currentPalette(name) { if (void 0 === name) { return currentPaletteName || DEFAULT_PALETTE } else { name = (0, _utils.normalizeEnum)(name); currentPaletteName = name in palettes ? name : void 0 } } function generateColors(palette, count) { var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : { keepLastColorInEnd: false }; options.type = options.baseColorSet; options.extensionMode = options.paletteExtensionMode; return createPalette(palette, options).generateColors(count) } function getPalette(palette, parameters) { parameters = parameters || {}; palette = selectPaletteOnSeniority(palette, parameters.themeDefault); var result; var type = parameters.type; if (_isArray(palette)) { return palette.slice(0) } else { if (_isString(palette)) { result = palettes[(0, _utils.normalizeEnum)(palette)] } if (!result) { result = palettes[currentPalette()] } } return type ? result[type].slice(0) : result } function registerPalette(name, palette) { var item = {}; var paletteName; 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; item.accentColor = palette.accentColor } } if (!item.accentColor) { item.accentColor = item.simpleSet && item.simpleSet[0] } if (item.simpleSet || item.indicatingSet || item.gradientSet) { paletteName = (0, _utils.normalizeEnum)(name); (0, _extend.extend)(palettes[paletteName] = palettes[paletteName] || {}, item) } } function getAccentColor(palette, themeDefault) { palette = getPalette(palette, { themeDefault: themeDefault }); return palette.accentColor || palette[0] } 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 getAlternateColorsStrategy(palette, parameters) { var stepHighlight = parameters.useHighlight ? HIGHLIGHTING_STEP : 0; var paletteSteps = new RingBuf([0, stepHighlight, -stepHighlight]); var currentPalette = []; function _reset() { var step = paletteSteps.next(); currentPalette = step ? getAlteredPalette(palette, step) : palette.slice(0) } return { getColor: function(index) { var color = currentPalette[index % palette.length]; if (index % palette.length === palette.length - 1) { _reset() } return color }, generateColors: function(count) { var colors = []; count = count || parameters.count; for (var i = 0; i < count; i++) { colors.push(this.getColor(i)) } return colors }, reset: function() { paletteSteps.reset(); _reset() } } } function getExtrapolateColorsStrategy(palette, parameters) { function convertColor(color, cycleIndex, cycleCount) { var hsl = new _Color(color).hsl; var l = hsl.l / 100; var diapason = cycleCount - 1 / cycleCount; var minL = l - .5 * diapason; var maxL = l + .5 * diapason; var cycleMiddle = (cycleCount - 1) / 2; var cycleDiff = cycleIndex - cycleMiddle; if (minL < Math.min(.5, .9 * l)) { minL = Math.min(.5, .9 * l) } if (maxL > Math.max(.8, l + .15 * (1 - l))) { maxL = Math.max(.8, l + .15 * (1 - l)) } if (cycleDiff < 0) { l -= (minL - l) * cycleDiff / cycleMiddle } else { l += (maxL - l) * (cycleDiff / cycleMiddle) } hsl.l = 100 * l; return _Color.prototype.fromHSL(hsl).toHex() } return { getColor: function(index, count) { var paletteCount = palette.length; var cycles = _floor((count - 1) / paletteCount + 1); var color = palette[index % paletteCount]; if (cycles > 1) { return convertColor(color, _floor(index / paletteCount), cycles) } return color }, generateColors: function(count) { var colors = []; count = count || parameters.count; for (var i = 0; i < count; i++) { colors.push(this.getColor(i, count)) } return colors }, reset: function() {} } } function getColorMixer(palette, parameters) { var paletteCount = palette.length; var extendedPalette = []; function distributeColors(count, colorsCount, startIndex, distribution) { var groupSize = Math.floor(count / colorsCount); var extraItems = count - colorsCount * groupSize; var i = startIndex; var middleIndex; var size; while (i < startIndex + count) { size = groupSize; if (extraItems > 0) { size += 1; extraItems-- } middleIndex = size > 2 ? Math.floor(size / 2) : 0; distribution.push(i + middleIndex); i += size } return distribution.sort(function(a, b) { return a - b }) } function getColorAndDistance(arr, startIndex, count) { startIndex = (count + startIndex) % count; var distance = 0; for (var i = startIndex; i < 2 * count; i += 1) { var index = (count + i) % count; if (arr[index]) { return [arr[index], distance] } distance++ } } function blendColors(paletteWithEmptyColors, paletteLength) { for (var i = 0; i < paletteLength; i++) { var color = paletteWithEmptyColors[i]; if (!color) { var color1 = paletteWithEmptyColors[i - 1]; if (!color1) { continue } else { var c2 = getColorAndDistance(paletteWithEmptyColors, i, paletteLength); var color2 = new _Color(c2[0]); color1 = new _Color(color1); for (var j = 0; j < c2[1]; j++, i++) { paletteWithEmptyColors[i] = color1.blend(color2, (j + 1) / (c2[1] + 1)).toHex() } } } } return paletteWithEmptyColors } function extendPalette(count) { if (count <= paletteCount) { return palette } var result = []; var colorInGroups = paletteCount - 2; var currentColorIndex = 0; var cleanColorIndices = []; if (parameters.keepLastColorInEnd) { cleanColorIndices = distributeColors(count - 2, colorInGroups, 1, [0, count - 1]) } else { cleanColorIndices = distributeColors(count - 1, paletteCount - 1, 1, [0]) } for (var i = 0; i < count; i++) { if (cleanColorIndices.indexOf(i) > -1) { result[i] = palette[currentColorIndex++] } } result = blendColors(result, count); return result } return { getColor: function(index, count) { count = count || parameters.count || paletteCount; if (extendedPalette.length !== count) { extendedPalette = extendPalette(count) } return extendedPalette[index % count] }, generateColors: function(count, repeat) { count = count || parameters.count || paletteCount; if (repeat && count > paletteCount) { var colors = extendPalette(paletteCount); for (var i = 0; i < count - paletteCount; i++) { colors.push(colors[i]) } return colors } else { return paletteCount > 0 ? extendPalette(count).slice(0, count) : [] } }, reset: function() {} } } function createPalette(palette, parameters, themeDefaultPalette) { var paletteObj = { dispose: function() { this._extensionStrategy = null }, getNextColor: function(count) { return this._extensionStrategy.getColor(this._currentColor++, count) }, generateColors: function(count, parameters) { return this._extensionStrategy.generateColors(count, (parameters || {}).repeat) }, reset: function() { this._currentColor = 0; this._extensionStrategy.reset(); return this } }; parameters = parameters || {}; var extensionMode = (parameters.extensionMode || "").toLowerCase(); var colors = getPalette(palette, { type: parameters.type || "simpleSet", themeDefault: themeDefaultPalette }); if ("alternate" === extensionMode) { paletteObj._extensionStrategy = getAlternateColorsStrategy(colors, parameters) } else { if ("extrapolate" === extensionMode) { paletteObj._extensionStrategy = getExtrapolateColorsStrategy(colors, parameters) } else { paletteObj._extensionStrategy = getColorMixer(colors, parameters) } } paletteObj.reset(); return paletteObj } function getAlteredPalette(originalPalette, step) { var palette = []; var i; var 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); var 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 getDiscretePalette(source, size, themeDefaultPalette) { var palette = size > 0 ? createDiscreteColors(getPalette(source, { type: "gradientSet", themeDefault: themeDefaultPalette }), size) : []; return { getColor: function(index) { return palette[index] || null } } } function createDiscreteColors(source, count) { var colorCount = count - 1; var sourceCount = source.length - 1; var colors = []; var gradient = []; var i; function addColor(pos) { var k = sourceCount * pos; var kl = _floor(k); var kr = _ceil(k); gradient.push(colors[kl].blend(colors[kr], k - kl).toHex()) } for (i = 0; i <= sourceCount; ++i) { colors.push(new _Color(source[i])) } if (colorCount > 0) { for (i = 0; i <= colorCount; ++i) { addColor(i / colorCount) } } else { addColor(.5) } return gradient } function getGradientPalette(source, themeDefaultPalette) { var palette = getPalette(source, { type: "gradientSet", themeDefault: themeDefaultPalette }); var color1 = new _Color(palette[0]); var color2 = new _Color(palette[1]); return { getColor: function(ratio) { return 0 <= ratio && ratio <= 1 ? color1.blend(color2, ratio).toHex() : null } } } function selectPaletteOnSeniority(source, themeDefaultPalette) { var result = source || (void 0 === currentPaletteName ? themeDefaultPalette : currentPalette()); if ("default" === result) { _errors2.default.log("W0016", '"palette"', "Default", "18.1", 'Use the "Office" value instead.') } return result } exports._DEBUG_palettes = palettes }, /*!********************************************************!*\ !*** ./artifacts/transpiled/viz/series/area_series.js ***! \********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106).chart; var lineSeries = __webpack_require__( /*! ./line_series */ 203); var chartLineSeries = lineSeries.chart.line; var polarLineSeries = lineSeries.polar.line; var _map = __webpack_require__( /*! ../core/utils */ 10).map; var _extend = extend; var calculateBezierPoints = lineSeries.chart.spline._calculateBezierPoints; exports.chart = {}; exports.polar = {}; var baseAreaMethods = { _createBorderElement: chartLineSeries._createMainElement, _createLegendState: function(styleOptions, defaultColor) { return { fill: styleOptions.color || defaultColor, opacity: styleOptions.opacity, hatching: styleOptions.hatching } }, getValueRangeInitialValue: function() { if ("logarithmic" !== this.valueAxisType && "datetime" !== this.valueType && false !== this.showZero) { return 0 } else { return scatterSeries.getValueRangeInitialValue.call(this) } }, _getDefaultSegment: function(segment) { var defaultSegment = chartLineSeries._getDefaultSegment(segment); defaultSegment.area = defaultSegment.line.concat(defaultSegment.line.slice().reverse()); return defaultSegment }, _updateElement: function(element, segment, animate, complete) { var lineParams = { points: segment.line }; var areaParams = { points: segment.area }; var borderElement = element.line; if (animate) { borderElement && borderElement.animate(lineParams); element.area.animate(areaParams, {}, complete) } else { borderElement && borderElement.attr(lineParams); element.area.attr(areaParams) } }, _removeElement: function(element) { element.line && element.line.remove(); element.area.remove() }, _drawElement: function(segment) { return { line: this._bordersGroup && this._createBorderElement(segment.line, { "stroke-width": this._styles.normal.border["stroke-width"] }).append(this._bordersGroup), area: this._createMainElement(segment.area).append(this._elementsGroup) } }, _applyStyle: function(style) { var that = this; that._elementsGroup && that._elementsGroup.smartAttr(style.elements); that._bordersGroup && that._bordersGroup.attr(style.border); (that._graphics || []).forEach(function(graphic) { graphic.line && graphic.line.attr({ "stroke-width": style.border["stroke-width"] }).sharp() }) }, _parseStyle: function(options, defaultColor, defaultBorderColor) { var borderOptions = options.border || {}; var borderStyle = chartLineSeries._parseLineOptions(borderOptions, defaultBorderColor); borderStyle.stroke = borderOptions.visible && borderStyle["stroke-width"] ? borderStyle.stroke : "none"; borderStyle["stroke-width"] = borderStyle["stroke-width"] || 1; return { border: borderStyle, elements: { stroke: "none", fill: options.color || defaultColor, hatching: options.hatching, opacity: options.opacity } } }, _areBordersVisible: function() { var options = this._options; return options.border.visible || options.hoverStyle.border.visible || options.selectionStyle.border.visible }, _createMainElement: function(points, settings) { return this._renderer.path(points, "area").attr(settings) }, _getTrackerSettings: function(segment) { return { "stroke-width": segment.singlePointSegment ? this._defaultTrackerWidth : 0 } }, _getMainPointsFromSegment: function(segment) { return segment.area } }; function createAreaPoints(points) { return _map(points, function(pt) { return pt.getCoords() }).concat(_map(points.slice().reverse(), function(pt) { return pt.getCoords(true) })) } var areaSeries = exports.chart.area = _extend({}, chartLineSeries, baseAreaMethods, { _prepareSegment: function(points, rotated) { var that = this; var processedPoints = that._processSinglePointsAreaSegment(points, rotated); var areaPoints = createAreaPoints(processedPoints); var argAxis = that.getArgumentAxis(); if (argAxis.getAxisPosition) { var argAxisPosition = argAxis.getAxisPosition(); var axisOptions = argAxis.getOptions(); var edgeOffset = (!rotated ? -1 : 1) * Math.round(axisOptions.width / 2); if (axisOptions.visible) { areaPoints.forEach(function(p, i) { if (p) { var index = 1 === points.length ? 0 : i < points.length ? i : areaPoints.length - 1 - i; rotated && p.x === points[index].defaultX && p.x === argAxisPosition - argAxis.getAxisShift() && (p.x += edgeOffset); !rotated && p.y === points[index].defaultY && p.y === argAxisPosition - argAxis.getAxisShift() && (p.y += edgeOffset) } }) } } return { line: processedPoints, area: areaPoints, singlePointSegment: processedPoints !== points } }, _processSinglePointsAreaSegment: function(points, rotated) { if (points && 1 === points.length) { var p = points[0]; var p1 = objectUtils.clone(p); p1[rotated ? "y" : "x"] += 1; p1.argument = null; return [p, p1] } return points } }); exports.polar.area = _extend({}, polarLineSeries, baseAreaMethods, { _prepareSegment: function(points, rotated, lastSegment) { lastSegment && polarLineSeries._closeSegment.call(this, points); return areaSeries._prepareSegment.call(this, points) }, _processSinglePointsAreaSegment: function(points) { return lineSeries.polar.line._prepareSegment.call(this, points).line } }); exports.chart.steparea = _extend({}, areaSeries, { _prepareSegment: function(points, rotated) { var stepLineSeries = lineSeries.chart.stepline; points = areaSeries._processSinglePointsAreaSegment(points, rotated); return areaSeries._prepareSegment.call(this, stepLineSeries._calculateStepLinePoints.call(this, points), rotated) }, getSeriesPairCoord: lineSeries.chart.stepline.getSeriesPairCoord }); exports.chart.splinearea = _extend({}, areaSeries, { _areaPointsToSplineAreaPoints: function(areaPoints) { var previousMiddlePoint = areaPoints[areaPoints.length / 2 - 1]; var middlePoint = areaPoints[areaPoints.length / 2]; areaPoints.splice(areaPoints.length / 2, 0, { x: previousMiddlePoint.x, y: previousMiddlePoint.y }, { x: middlePoint.x, y: middlePoint.y }); if (previousMiddlePoint.defaultCoords) { areaPoints[areaPoints.length / 2].defaultCoords = true } if (middlePoint.defaultCoords) { areaPoints[areaPoints.length / 2 - 1].defaultCoords = true } }, _prepareSegment: function(points, rotated) { var processedPoints = areaSeries._processSinglePointsAreaSegment(points, rotated); var areaSegment = areaSeries._prepareSegment.call(this, calculateBezierPoints(processedPoints, rotated)); this._areaPointsToSplineAreaPoints(areaSegment.area); areaSegment.singlePointSegment = processedPoints !== points; return areaSegment }, _getDefaultSegment: function(segment) { var areaDefaultSegment = areaSeries._getDefaultSegment(segment); this._areaPointsToSplineAreaPoints(areaDefaultSegment.area); return areaDefaultSegment }, _createMainElement: function(points, settings) { return this._renderer.path(points, "bezierarea").attr(settings) }, _createBorderElement: lineSeries.chart.spline._createMainElement, getSeriesPairCoord: lineSeries.chart.spline.getSeriesPairCoord, getNearestPointsByCoord: lineSeries.chart.spline.getNearestPointsByCoord, obtainCubicBezierTCoef: lineSeries.chart.spline.obtainCubicBezierTCoef }) }, /*!***************************************************!*\ !*** ./artifacts/transpiled/viz/tree_map/node.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; function Node() {} _extend(Node.prototype, { value: 0, isNode: function() { return !!(this.nodes && this.level < this.ctx.maxLevel) }, isActive: function() { var ctx = this.ctx; return this.level >= ctx.minLevel && this.level <= ctx.maxLevel }, updateStyles: function() { var that = this; var isNode = Number(that.isNode()); that.state = that._buildState(that.ctx.settings[isNode].state, !isNode && that.color && { fill: that.color }) }, _buildState: function(state, extra) { var base = _extend({}, state); return extra ? _extend(base, extra) : base }, updateLabelStyle: function() { var settings = this.ctx.settings[Number(this.isNode())]; this.labelState = settings.labelState; this.labelParams = settings.labelParams }, _getState: function() { return this.state }, applyState: function() { updateTile[Number(this.isNode())](this.tile, this._getState()) } }); var updateTile = [updateLeaf, updateGroup]; function updateLeaf(content, attrs) { content.smartAttr(attrs) } function updateGroup(content, attrs) { content.outer.attr({ stroke: attrs.stroke, "stroke-width": attrs["stroke-width"], "stroke-opacity": attrs["stroke-opacity"] }); content.inner.smartAttr({ fill: attrs.fill, opacity: attrs.opacity, hatching: attrs.hatching }) } module.exports = Node }, /*!*****************************************************************!*\ !*** ./artifacts/transpiled/ui/widget/ui.keyboard_processor.js ***! \*****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _class = __webpack_require__( /*! ../../core/class */ 15); var _class2 = _interopRequireDefault(_class); var _array = __webpack_require__( /*! ../../core/utils/array */ 14); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var _utils = __webpack_require__( /*! ../../events/utils */ 8); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var COMPOSITION_START_EVENT = "compositionstart"; var COMPOSITION_END_EVENT = "compositionend"; var KEYDOWN_EVENT = "keydown"; var NAMESPACE = "KeyboardProcessor"; var KeyboardProcessor = _class2.default.inherit({ _keydown: (0, _utils.addNamespace)(KEYDOWN_EVENT, NAMESPACE), _compositionStart: (0, _utils.addNamespace)(COMPOSITION_START_EVENT, NAMESPACE), _compositionEnd: (0, _utils.addNamespace)(COMPOSITION_END_EVENT, NAMESPACE), ctor: function(options) { var _this = this; options = options || {}; if (options.element) { this._element = (0, _renderer2.default)(options.element) } if (options.focusTarget) { this._focusTarget = options.focusTarget } this._handler = options.handler; this._context = options.context; this._childProcessors = []; if (this._element) { this._processFunction = function(e) { var isNotFocusTarget = _this._focusTarget && _this._focusTarget !== e.target && (0, _array.inArray)(e.target, _this._focusTarget) < 0; var shouldSkipProcessing = _this._isComposingJustFinished && 229 === e.which || _this._isComposing || isNotFocusTarget; _this._isComposingJustFinished = false; if (!shouldSkipProcessing) { _this.process(e) } }; this._toggleProcessingWithContext = this.toggleProcessing.bind(this); _events_engine2.default.on(this._element, this._keydown, this._processFunction); _events_engine2.default.on(this._element, this._compositionStart, this._toggleProcessingWithContext); _events_engine2.default.on(this._element, this._compositionEnd, this._toggleProcessingWithContext) } }, dispose: function() { if (this._element) { _events_engine2.default.off(this._element, this._keydown, this._processFunction); _events_engine2.default.off(this._element, this._compositionStart, this._toggleProcessingWithContext); _events_engine2.default.off(this._element, this._compositionEnd, this._toggleProcessingWithContext) } this._element = void 0; this._handler = void 0; this._context = void 0; this._childProcessors = void 0 }, clearChildren: function() { this._childProcessors = [] }, push: function(child) { if (!this._childProcessors) { this.clearChildren() } this._childProcessors.push(child); return child }, attachChildProcessor: function() { var childProcessor = new KeyboardProcessor; this._childProcessors.push(childProcessor); return childProcessor }, reinitialize: function(childHandler, childContext) { this._context = childContext; this._handler = childHandler; return this }, process: function(e) { var args = { keyName: (0, _utils.normalizeKeyName)(e), key: e.key, code: e.code, ctrl: e.ctrlKey, location: e.location, metaKey: e.metaKey, shift: e.shiftKey, alt: e.altKey, which: e.which, originalEvent: e }; var handlerResult = this._handler && this._handler.call(this._context, args); if (handlerResult && this._childProcessors) { (0, _iterator.each)(this._childProcessors, function(index, childProcessor) { childProcessor.process(e) }) } }, toggleProcessing: function(_ref) { var type = _ref.type; this._isComposing = type === COMPOSITION_START_EVENT; this._isComposingJustFinished = !this._isComposing } }); module.exports = KeyboardProcessor }, /*!****************************************************!*\ !*** ./artifacts/transpiled/events/contextmenu.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var support = __webpack_require__( /*! ../core/utils/support */ 43); var devices = __webpack_require__( /*! ../core/devices */ 16); var Class = __webpack_require__( /*! ../core/class */ 15); var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71); var eventUtils = __webpack_require__( /*! ./utils */ 8); var holdEvent = __webpack_require__( /*! ./hold */ 88); var CONTEXTMENU_NAMESPACE = "dxContexMenu"; var CONTEXTMENU_NAMESPACED_EVENT_NAME = eventUtils.addNamespace("contextmenu", CONTEXTMENU_NAMESPACE); var HOLD_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(holdEvent.name, CONTEXTMENU_NAMESPACE); var CONTEXTMENU_EVENT_NAME = "dxcontextmenu"; var ContextMenu = Class.inherit({ setup: function(element) { var $element = $(element); eventsEngine.on($element, CONTEXTMENU_NAMESPACED_EVENT_NAME, this._contextMenuHandler.bind(this)); if (support.touch || devices.isSimulator()) { eventsEngine.on($element, HOLD_NAMESPACED_EVENT_NAME, this._holdHandler.bind(this)) } }, _holdHandler: function(e) { if (eventUtils.isMouseEvent(e) && !devices.isSimulator()) { return } this._fireContextMenu(e) }, _contextMenuHandler: function(e) { this._fireContextMenu(e) }, _fireContextMenu: function(e) { return eventUtils.fireEvent({ type: CONTEXTMENU_EVENT_NAME, originalEvent: e }) }, teardown: function(element) { eventsEngine.off(element, "." + CONTEXTMENU_NAMESPACE) } }); registerEvent(CONTEXTMENU_EVENT_NAME, new ContextMenu); exports.name = CONTEXTMENU_EVENT_NAME }, /*!*************************************************************************!*\ !*** ./artifacts/transpiled/ui/drop_down_editor/ui.drop_down_editor.js ***! \*************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _async_template_mixin = __webpack_require__( /*! ../shared/async_template_mixin */ 286); var _async_template_mixin2 = _interopRequireDefault(_async_template_mixin); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _guid = __webpack_require__( /*! ../../core/guid */ 40); var _guid2 = _interopRequireDefault(_guid); var _component_registrator = __webpack_require__( /*! ../../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _selectors = __webpack_require__( /*! ../widget/selectors */ 66); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _dom = __webpack_require__( /*! ../../core/utils/dom */ 12); var _ui = __webpack_require__( /*! ../widget/ui.errors */ 17); var _ui2 = _interopRequireDefault(_ui); var _position = __webpack_require__( /*! ../../animation/position */ 77); var _position2 = __webpack_require__( /*! ../../core/utils/position */ 97); var _ui3 = __webpack_require__( /*! ./ui.drop_down_button */ 498); var _ui4 = _interopRequireDefault(_ui3); var _message = __webpack_require__( /*! ../../localization/message */ 13); var _utils = __webpack_require__( /*! ../../events/utils */ 8); var _text_box = __webpack_require__( /*! ../text_box */ 89); var _text_box2 = _interopRequireDefault(_text_box); var _click = __webpack_require__( /*! ../../events/click */ 19); var _click2 = _interopRequireDefault(_click); var _devices = __webpack_require__( /*! ../../core/devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _function_template = __webpack_require__( /*! ../widget/function_template */ 83); var _function_template2 = _interopRequireDefault(_function_template); var _popup = __webpack_require__( /*! ../popup */ 46); var _popup2 = _interopRequireDefault(_popup); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var DROP_DOWN_EDITOR_CLASS = "dx-dropdowneditor"; var DROP_DOWN_EDITOR_INPUT_WRAPPER = "dx-dropdowneditor-input-wrapper"; var DROP_DOWN_EDITOR_BUTTON_ICON = "dx-dropdowneditor-icon"; var DROP_DOWN_EDITOR_OVERLAY = "dx-dropdowneditor-overlay"; var DROP_DOWN_EDITOR_OVERLAY_FLIPPED = "dx-dropdowneditor-overlay-flipped"; var DROP_DOWN_EDITOR_ACTIVE = "dx-dropdowneditor-active"; var DROP_DOWN_EDITOR_FIELD_CLICKABLE = "dx-dropdowneditor-field-clickable"; var DROP_DOWN_EDITOR_FIELD_TEMPLATE_WRAPPER = "dx-dropdowneditor-field-template-wrapper"; var isIOs = "ios" === _devices2.default.current().platform; var DropDownEditor = _text_box2.default.inherit({ _supportedKeys: function() { return (0, _extend.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 && _events_engine2.default.trigger($focusableElement, "focus"); e.preventDefault() }, escape: function(e) { if (this.option("opened")) { e.preventDefault() } this.close(); return true }, 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 } }) }, _getDefaultButtons: function() { return this.callBase().concat([{ name: "dropDown", Ctor: _ui4.default }]) }, _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { value: null, onOpened: null, onClosed: null, opened: false, acceptCustomValue: true, applyValueMode: "instantly", deferRendering: true, activeStateEnabled: true, dropDownButtonTemplate: "dropDownButton", fieldTemplate: null, openOnFieldClick: false, showDropDownButton: true, buttons: void 0, dropDownOptions: {}, popupPosition: this._getDefaultPopupPosition(), onPopupInitialized: null, applyButtonText: (0, _message.format)("OK"), cancelButtonText: (0, _message.format)("Cancel"), buttonsLocation: "default", showPopupTitle: false, useHiddenSubmitElement: false }) }, _getDefaultPopupPosition: function(isRtlEnabled) { var position = (0, _position2.getDefaultAlignment)(isRtlEnabled); 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; return isGeneric }, options: { popupPosition: { offset: { v: 0 } } } }]) }, _inputWrapper: function() { return this.$element().find("." + DROP_DOWN_EDITOR_INPUT_WRAPPER) }, _init: function() { this.callBase(); this._initVisibilityActions(); this._initPopupInitializedAction(); this._updatePopupPosition(this.option("rtlEnabled")); this._initInnerOptionCache("dropDownOptions") }, _updatePopupPosition: function(isRtlEnabled) { var _this$_getDefaultPopu = this._getDefaultPopupPosition(isRtlEnabled), my = _this$_getDefaultPopu.my, at = _this$_getDefaultPopu.at; var currentPosition = this.option("popupPosition"); this.option("popupPosition", (0, _extend.extend)({}, currentPosition, { my: my, at: at })) }, _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"] }) }, _initMarkup: function() { this._renderSubmitElement(); this.callBase(); this.$element().addClass(DROP_DOWN_EDITOR_CLASS); this.setAria("role", "combobox") }, _render: function() { this.callBase(); this._renderOpenHandler(); this._attachFocusOutHandler(); this._renderOpenedState() }, _renderContentImpl: function() { if (!this.option("deferRendering")) { this._createPopup() } }, _renderInput: function() { this.callBase(); this.$element().wrapInner((0, _renderer2.default)("
").addClass(DROP_DOWN_EDITOR_INPUT_WRAPPER)); this._$container = this.$element().children().eq(0); this._setDefaultAria() }, _setDefaultAria: function() { this.setAria({ haspopup: "true", autocomplete: "list" }) }, _readOnlyPropValue: function() { return !this.option("acceptCustomValue") || this.callBase() }, _cleanFocusState: function() { this.callBase(); if (this.option("fieldTemplate")) { this._detachFocusEvents() } }, _getFieldTemplate: function() { return this.option("fieldTemplate") && this._getTemplateByOption("fieldTemplate") }, _renderMask: function() { if (this.option("fieldTemplate")) { return } this.callBase() }, _renderField: function() { var fieldTemplate = this._getFieldTemplate(); fieldTemplate && this._renderTemplatedField(fieldTemplate, this._fieldRenderData()) }, _renderPlaceholder: function() { var hasFieldTemplate = !!this._getFieldTemplate(); if (!hasFieldTemplate) { this.callBase() } }, _renderValue: function() { if (this.option("useHiddenSubmitElement")) { this._setSubmitValue() } var promise = this.callBase(); promise.always(this._renderField.bind(this)) }, _renderTemplatedField: function(fieldTemplate, data) { var _this = this; var isFocused = (0, _selectors.focused)(this._input()); var $container = this._$container; this._disposeKeyboardProcessor(); var beforeButtonsContainerParent = this._$beforeButtonsContainer && this._$beforeButtonsContainer[0].parentNode; var afterButtonsContainerParent = this._$afterButtonsContainer && this._$afterButtonsContainer[0].parentNode; beforeButtonsContainerParent && beforeButtonsContainerParent.removeChild(this._$beforeButtonsContainer[0]); afterButtonsContainerParent && afterButtonsContainerParent.removeChild(this._$afterButtonsContainer[0]); this._detachFocusEvents(); $container.empty(); var $templateWrapper = (0, _renderer2.default)("
").addClass(DROP_DOWN_EDITOR_FIELD_TEMPLATE_WRAPPER).appendTo($container); fieldTemplate.render({ model: data, container: (0, _dom.getPublicElement)($templateWrapper), onRendered: function() { var $input = _this._input(); if (!$input.length) { throw _ui2.default.Error("E1010") } _this._refreshEvents(); _this._refreshValueChangeEvent(); _this._renderFocusState(); isFocused && _events_engine2.default.trigger($input, "focus") } }); $container.prepend(this._$beforeButtonsContainer); $container.append(this._$afterButtonsContainer) }, _fieldRenderData: function() { return this.option("value") }, _initTemplates: function() { this.callBase(); this._defaultTemplates.dropDownButton = new _function_template2.default(function(options) { var $icon = (0, _renderer2.default)("
").addClass(DROP_DOWN_EDITOR_BUTTON_ICON); (0, _renderer2.default)(options.container).append($icon) }, this) }, _renderOpenHandler: function() { var $inputWrapper = this._inputWrapper(); var eventName = (0, _utils.addNamespace)(_click2.default.name, this.NAME); var openOnFieldClick = this.option("openOnFieldClick"); _events_engine2.default.off($inputWrapper, eventName); _events_engine2.default.on($inputWrapper, eventName, this._getInputClickHandler(openOnFieldClick)); this.$element().toggleClass(DROP_DOWN_EDITOR_FIELD_CLICKABLE, openOnFieldClick); if (openOnFieldClick) { this._openOnFieldClickAction = this._createAction(this._openHandler.bind(this)) } }, _attachFocusOutHandler: function() { var _this2 = this; if (isIOs) { this._detachFocusOutEvents(); _events_engine2.default.on(this._inputWrapper(), (0, _utils.addNamespace)("focusout", this.NAME), function(event) { var newTarget = event.relatedTarget; var popupWrapper = _this2.content ? (0, _renderer2.default)(_this2.content()).closest("." + DROP_DOWN_EDITOR_OVERLAY) : _this2._$popup; if (newTarget && _this2.option("opened")) { var isNewTargetOutside = 0 === (0, _renderer2.default)(newTarget).closest("." + DROP_DOWN_EDITOR_OVERLAY, popupWrapper).length; if (isNewTargetOutside) { _this2.close() } } }) } }, _detachFocusOutEvents: function() { isIOs && _events_engine2.default.off(this._inputWrapper(), (0, _utils.addNamespace)("focusout", this.NAME)) }, _getInputClickHandler: function(openOnFieldClick) { var _this3 = this; return openOnFieldClick ? function(e) { _this3._executeOpenAction(e) } : function(e) { _this3._focusInput() } }, _openHandler: function() { this._toggleOpenState() }, _executeOpenAction: function(e) { this._openOnFieldClickAction({ event: e }) }, _keyboardEventBindingTarget: function() { return this._input() }, _focusInput: function() { if (this.option("disabled")) { return false } if (this.option("focusStateEnabled") && !(0, _selectors.focused)(this._input())) { _events_engine2.default.trigger(this._input(), "focus") } return true }, _toggleOpenState: function(isVisible) { if (!this._focusInput()) { return } if (!this.option("readOnly")) { isVisible = arguments.length ? isVisible : !this.option("opened"); this.option("opened", isVisible) } }, _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 }); this.setAria("owns", (opened || void 0) && this._popupContentId, this.$element()) }, _createPopup: function() { if (this._$popup) { return } this._$popup = (0, _renderer2.default)("
").addClass(DROP_DOWN_EDITOR_OVERLAY).addClass(this.option("customOverlayCssClass")).appendTo(this.$element()); this._renderPopup(); this._renderPopupContent() }, _renderPopupContent: _common.noop, _renderPopup: function() { this._popup = this._createComponent(this._$popup, _popup2.default, (0, _extend.extend)(this._popupConfig(), this._getInnerOptionsCache("dropDownOptions"))); this._popup.on({ showing: this._popupShowingHandler.bind(this), shown: this._popupShownHandler.bind(this), hiding: this._popupHidingHandler.bind(this), hidden: this._popupHiddenHandler.bind(this) }); this._popup.option("onContentReady", this._contentReadyHandler.bind(this)); this._contentReadyHandler(); this._setPopupContentId(this._popup.$content()); this._bindInnerWidgetOptions(this._popup, "dropDownOptions") }, _setPopupContentId: function($popupContent) { this._popupContentId = "dx-" + new _guid2.default; this.setAria("id", this._popupContentId, $popupContent) }, _contentReadyHandler: _common.noop, _popupConfig: function() { return { onInitialized: this._popupInitializedHandler(), position: (0, _extend.extend)(this.option("popupPosition"), { of: this.$element() }), showTitle: this.option("showPopupTitle"), width: "auto", height: "auto", shading: false, closeOnTargetScroll: true, closeOnOutsideClick: this._closeOutsideDropDownHandler.bind(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: this._popupPositionedHandler.bind(this), fullScreen: false, contentTemplate: null } }, _popupInitializedHandler: function() { var _this4 = this; if (!this.option("onPopupInitialized")) { return } return function(e) { _this4._popupInitializedAction({ popup: e.component }) } }, _popupPositionedHandler: function(e) { e.position && this._popup.overlayContent().toggleClass(DROP_DOWN_EDITOR_OVERLAY_FLIPPED, e.position.v.flip) }, _popupShowingHandler: _common.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 _setupPosition = (0, _position.setup)(this.$element()), myTop = _setupPosition.top; var _setupPosition2 = (0, _position.setup)(this._popup.$content()), popupTop = _setupPosition2.top; positionRequest = myTop + this.option("popupPosition").offset.v > popupTop ? "below" : "above" } return this.callBase(positionRequest) }, _closeOutsideDropDownHandler: function(_ref) { var target = _ref.target; var $target = (0, _renderer2.default)(target); var dropDownButton = this.getButton("dropDown"); var $dropDownButton = dropDownButton && dropDownButton.$element(); var isInputClicked = !!$target.closest(this.$element()).length; var isDropDownButtonClicked = !!$target.closest($dropDownButton).length; var isOutsideClick = !isInputClicked && !isDropDownButtonClicked; return isOutsideClick }, _clean: function() { delete this._openOnFieldClickAction; 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 = (0, _renderer2.default)(e.currentTarget); if (e.shiftKey && $element.is(this._getFirstPopupElement()) || !e.shiftKey && $element.is(this._getLastPopupElement())) { _events_engine2.default.trigger(this._input(), "focus"); e.preventDefault() } }, _popupElementEscHandler: function() { _events_engine2.default.trigger(this._input(), "focus"); this.close() }, _popupButtonInitializedHandler: function(e) { e.component.registerKeyHandler("tab", this._popupElementTabHandler.bind(this)); e.component.registerKeyHandler("escape", this._popupElementEscHandler.bind(this)) }, _popupToolbarItemsConfig: function() { var buttonsConfig = [{ shortcut: "done", options: { onClick: this._applyButtonHandler.bind(this), text: this.option("applyButtonText"), onInitialized: this._popupButtonInitializedHandler.bind(this) } }, { shortcut: "cancel", options: { onClick: this._cancelButtonHandler.bind(this), text: this.option("cancelButtonText"), onInitialized: this._popupButtonInitializedHandler.bind(this) } }]; return this._applyButtonsLocation(buttonsConfig) }, _applyButtonsLocation: function(buttonsConfig) { var buttonsLocation = this.option("buttonsLocation"); var resultConfig = buttonsConfig; if ("default" !== buttonsLocation) { var position = (0, _common.splitPair)(buttonsLocation); (0, _iterator.each)(resultConfig, function(_, element) { (0, _extend.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() }, _updatePopupWidth: _common.noop, _popupOptionChanged: function(args) { var options = this._getOptionsFromContainer(args); this._setPopupOption(options); if (Object.keys(options).indexOf("width") !== -1 && void 0 === options.width) { this._updatePopupWidth() } }, _renderSubmitElement: function() { if (this.option("useHiddenSubmitElement")) { this._$submitElement = (0, _renderer2.default)("").attr("type", "hidden").appendTo(this.$element()) } }, _setSubmitValue: function() { this._getSubmitElement().val(this.option("value")) }, _getSubmitElement: function() { if (this.option("useHiddenSubmitElement")) { return this._$submitElement } else { return this.callBase() } }, _dispose: function() { this._detachFocusOutEvents(); this.callBase() }, _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": if ((0, _type.isDefined)(args.value)) { this._renderField() } else { this._invalidate() } break; case "acceptCustomValue": case "openOnFieldClick": this._invalidate(); break; case "dropDownButtonTemplate": case "showDropDownButton": this._updateButtons(["dropDown"]); break; case "dropDownOptions": this._popupOptionChanged(args); this._cacheInnerOptions("dropDownOptions", args.value); 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; case "useHiddenSubmitElement": if (this._$submitElement) { this._$submitElement.remove(); this._$submitElement = void 0 } this._renderSubmitElement(); break; case "rtlEnabled": this._updatePopupPosition(args.value); this.callBase(args); break; default: this.callBase(args) } }, open: function() { this.option("opened", true) }, close: function() { this.option("opened", false) }, field: function() { return (0, _dom.getPublicElement)(this._input()) }, content: function() { return this._popup ? this._popup.content() : null } }).include(_async_template_mixin2.default); (0, _component_registrator2.default)("dxDropDownEditor", DropDownEditor); module.exports = DropDownEditor }, /*!******************************************!*\ !*** ./artifacts/transpiled/exporter.js ***! \******************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var fileSaver = __webpack_require__( /*! ./exporter/file_saver */ 207).fileSaver; var excelCreator = __webpack_require__( /*! ./exporter/excel_creator */ 431); var imageCreator = __webpack_require__( /*! ./exporter/image_creator */ 262); var svgCreator = __webpack_require__( /*! ./exporter/svg_creator */ 438); var _isFunction = __webpack_require__( /*! ./core/utils/type */ 1).isFunction; var Deferred = __webpack_require__( /*! ./core/utils/deferred */ 6).Deferred; exports.export = function(data, options, getData) { if (!data) { return (new Deferred).resolve() } var exportingAction = options.exportingAction; var exportedAction = options.exportedAction; var fileSavingAction = options.fileSavingAction; var eventArgs = { fileName: options.fileName, format: options.format, cancel: false }; _isFunction(exportingAction) && exportingAction(eventArgs); if (!eventArgs.cancel) { return getData(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, options.forceProxy) } }) } return (new Deferred).resolve() }; exports.fileSaver = fileSaver; exports.excel = { creator: excelCreator.ExcelCreator, getData: excelCreator.getData, formatConverter: __webpack_require__( /*! ./exporter/excel_format_converter */ 178) }; exports.excel.__internals = excelCreator.__internals; exports.image = { creator: imageCreator.imageCreator, getData: imageCreator.getData, testFormats: imageCreator.testFormats }; exports.pdf = { getData: __webpack_require__( /*! ./exporter/pdf_creator */ 440).getData }; exports.svg = { creator: svgCreator.svgCreator, getData: svgCreator.getData } }, /*!*************************************************!*\ !*** ./artifacts/transpiled/core/utils/size.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var window = __webpack_require__( /*! ../../core/utils/window */ 7).getWindow(); var typeUtils = __webpack_require__( /*! ../utils/type */ 1); var SPECIAL_HEIGHT_VALUES = ["auto", "none", "inherit", "initial"]; var getSizeByStyles = function(elementStyles, styles) { var result = 0; styles.forEach(function(style) { result += parseFloat(elementStyles[style]) || 0 }); return result }; var getElementBoxParams = function(name, elementStyles) { var beforeName = "width" === name ? "Left" : "Top"; var afterName = "width" === name ? "Right" : "Bottom"; return { padding: getSizeByStyles(elementStyles, ["padding" + beforeName, "padding" + afterName]), border: getSizeByStyles(elementStyles, ["border" + beforeName + "Width", "border" + afterName + "Width"]), margin: getSizeByStyles(elementStyles, ["margin" + beforeName, "margin" + afterName]) } }; var getBoxSizingOffset = function(name, elementStyles, boxParams) { var size = elementStyles[name]; if ("border-box" === elementStyles.boxSizing && size.length && "%" !== size[size.length - 1]) { return boxParams.border + boxParams.padding } return 0 }; var getSize = function(element, name, include) { var elementStyles = window.getComputedStyle(element); var boxParams = getElementBoxParams(name, elementStyles); var clientRect = element.getClientRects().length; var boundingClientRect = element.getBoundingClientRect()[name]; var result = clientRect ? boundingClientRect : 0; if (result <= 0) { result = parseFloat(elementStyles[name] || element.style[name]) || 0; result -= getBoxSizingOffset(name, elementStyles, boxParams) } else { result -= boxParams.padding + boxParams.border } if (include.paddings) { result += boxParams.padding } if (include.borders) { result += boxParams.border } if (include.margins) { result += boxParams.margin } return result }; var getContainerHeight = function(container) { return typeUtils.isWindow(container) ? container.innerHeight : container.offsetHeight }; var parseHeight = function(value, container) { if (value.indexOf("px") > 0) { value = parseInt(value.replace("px", "")) } else { if (value.indexOf("%") > 0) { value = parseInt(value.replace("%", "")) * getContainerHeight(container) / 100 } else { if (!isNaN(value)) { value = parseInt(value) } } } return value }; var getHeightWithOffset = function(value, offset, container) { if (!value) { return null } if (SPECIAL_HEIGHT_VALUES.indexOf(value) > -1) { return offset ? null : value } if (typeUtils.isString(value)) { value = parseHeight(value, container) } if (typeUtils.isNumeric(value)) { return Math.max(0, value + offset) } var operationString = offset < 0 ? " - " : " "; return "calc(" + value + operationString + Math.abs(offset) + "px)" }; var addOffsetToMaxHeight = function(value, offset, container) { var maxHeight = getHeightWithOffset(value, offset, container); return null !== maxHeight ? maxHeight : "none" }; var addOffsetToMinHeight = function(value, offset, container) { var minHeight = getHeightWithOffset(value, offset, container); return null !== minHeight ? minHeight : 0 }; var getVerticalOffsets = function(element, withMargins) { if (!element) { return 0 } var boxParams = getElementBoxParams("height", window.getComputedStyle(element)); return boxParams.padding + boxParams.border + (withMargins ? boxParams.margin : 0) }; var getVisibleHeight = function(element) { if (element) { var boundingClientRect = element.getBoundingClientRect(); if (boundingClientRect.height) { return boundingClientRect.height } } return 0 }; exports.getSize = getSize; exports.getElementBoxParams = getElementBoxParams; exports.addOffsetToMaxHeight = addOffsetToMaxHeight; exports.addOffsetToMinHeight = addOffsetToMinHeight; exports.getVerticalOffsets = getVerticalOffsets; exports.getVisibleHeight = getVisibleHeight; exports.parseHeight = parseHeight }, /*!****************************************************************!*\ !*** ./artifacts/transpiled/ui/validation/validation_mixin.js ***! \****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var ValidationMixin = { _findGroup: function() { var group = this.option("validationGroup"); var $dxGroup; 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 }, /*!**********************************************!*\ !*** ./artifacts/transpiled/ui/resizable.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray; var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each; var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1); var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7); var translator = __webpack_require__( /*! ../animation/translator */ 27); var fitIntoRange = __webpack_require__( /*! ../core/utils/math */ 28).fitIntoRange; var DOMComponent = __webpack_require__( /*! ../core/dom_component */ 67); var eventUtils = __webpack_require__( /*! ../events/utils */ 8); var dragEvents = __webpack_require__( /*! ../events/drag */ 56); var isPlainObject = typeUtils.isPlainObject; var isFunction = typeUtils.isFunction; var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12); var RESIZABLE = "dxResizable"; var RESIZABLE_CLASS = "dx-resizable"; var RESIZABLE_RESIZING_CLASS = "dx-resizable-resizing"; var RESIZABLE_HANDLE_CLASS = "dx-resizable-handle"; var RESIZABLE_HANDLE_TOP_CLASS = "dx-resizable-handle-top"; var RESIZABLE_HANDLE_BOTTOM_CLASS = "dx-resizable-handle-bottom"; var RESIZABLE_HANDLE_LEFT_CLASS = "dx-resizable-handle-left"; var RESIZABLE_HANDLE_RIGHT_CLASS = "dx-resizable-handle-right"; var RESIZABLE_HANDLE_CORNER_CLASS = "dx-resizable-handle-corner"; var DRAGSTART_START_EVENT_NAME = eventUtils.addNamespace(dragEvents.start, RESIZABLE); var DRAGSTART_EVENT_NAME = eventUtils.addNamespace(dragEvents.move, RESIZABLE); var DRAGSTART_END_EVENT_NAME = eventUtils.addNamespace(dragEvents.end, RESIZABLE); var SIDE_BORDER_WIDTH_STYLES = { left: "borderLeftWidth", top: "borderTopWidth", right: "borderRightWidth", bottom: "borderBottomWidth" }; var Resizable = DOMComponent.inherit({ _getDefaultOptions: function() { return extend(this.callBase(), { handles: "all", step: "1", stepPrecision: "simple", area: void 0, minWidth: 30, maxWidth: 1 / 0, minHeight: 30, maxHeight: 1 / 0, onResizeStart: null, onResize: null, onResizeEnd: null, roundStepValue: true }) }, _init: function() { this.callBase(); this.$element().addClass(RESIZABLE_CLASS) }, _initMarkup: function() { this.callBase(); this._renderHandles() }, _render: function() { this.callBase(); this._renderActions() }, _renderActions: function() { this._resizeStartAction = this._createActionByOption("onResizeStart"); this._resizeEndAction = this._createActionByOption("onResizeEnd"); this._resizeAction = this._createActionByOption("onResize") }, _renderHandles: function() { var handles = this.option("handles"); if ("none" === handles) { return } var directions = "all" === handles ? ["top", "bottom", "left", "right"] : handles.split(" "); each(directions, function(index, handleName) { this._renderHandle(handleName) }.bind(this)); inArray("bottom", directions) + 1 && inArray("right", directions) + 1 && this._renderHandle("corner-bottom-right"); inArray("bottom", directions) + 1 && inArray("left", directions) + 1 && this._renderHandle("corner-bottom-left"); inArray("top", directions) + 1 && inArray("right", directions) + 1 && this._renderHandle("corner-top-right"); inArray("top", directions) + 1 && inArray("left", directions) + 1 && this._renderHandle("corner-top-left") }, _renderHandle: function(handleName) { var $element = this.$element(); var $handle = $("
"); $handle.addClass(RESIZABLE_HANDLE_CLASS).addClass(RESIZABLE_HANDLE_CLASS + "-" + handleName).appendTo($element); this._attachEventHandlers($handle) }, _attachEventHandlers: function($handle) { if (this.option("disabled")) { return } var handlers = {}; handlers[DRAGSTART_START_EVENT_NAME] = this._dragStartHandler.bind(this); handlers[DRAGSTART_EVENT_NAME] = this._dragHandler.bind(this); handlers[DRAGSTART_END_EVENT_NAME] = this._dragEndHandler.bind(this); eventsEngine.on($handle, handlers, { direction: "both", immediate: true }) }, _dragStartHandler: function(e) { var $element = this.$element(); if ($element.is(".dx-state-disabled, .dx-state-disabled *")) { e.cancel = true; return } this._toggleResizingClass(true); this._movingSides = this._getMovingSides(e); this._elementLocation = translator.locate($element); var elementRect = $element.get(0).getBoundingClientRect(); this._elementSize = { width: elementRect.width, height: elementRect.height }; this._renderDragOffsets(e); this._resizeStartAction({ event: e, width: this._elementSize.width, height: this._elementSize.height, handles: this._movingSides }); e.targetElements = null }, _toggleResizingClass: function(value) { this.$element().toggleClass(RESIZABLE_RESIZING_CLASS, value) }, _renderDragOffsets: function(e) { var area = this._getArea(); if (!area) { return } var $handle = $(e.target).closest("." + RESIZABLE_HANDLE_CLASS); var handleWidth = $handle.outerWidth(); var handleHeight = $handle.outerHeight(); var handleOffset = $handle.offset(); var areaOffset = area.offset; var scrollOffset = this._getAreaScrollOffset(); e.maxLeftOffset = handleOffset.left - areaOffset.left - scrollOffset.scrollX; e.maxRightOffset = areaOffset.left + area.width - handleOffset.left - handleWidth + scrollOffset.scrollX; e.maxTopOffset = handleOffset.top - areaOffset.top - scrollOffset.scrollY; e.maxBottomOffset = areaOffset.top + area.height - handleOffset.top - handleHeight + scrollOffset.scrollY }, _getBorderWidth: function($element, direction) { if (typeUtils.isWindow($element.get(0))) { return 0 } var borderWidth = $element.css(SIDE_BORDER_WIDTH_STYLES[direction]); return parseInt(borderWidth) || 0 }, _dragHandler: function(e) { var $element = this.$element(); var sides = this._movingSides; var location = this._elementLocation; var size = this._elementSize; var offset = this._getOffset(e); var width = size.width + offset.x * (sides.left ? -1 : 1); var height = size.height + offset.y * (sides.top ? -1 : 1); if (offset.x || "strict" === this.option("stepPrecision")) { this._renderWidth(width) } if (offset.y || "strict" === this.option("stepPrecision")) { this._renderHeight(height) } var elementRect = $element.get(0).getBoundingClientRect(); var offsetTop = offset.y - ((elementRect.height || height) - height); var offsetLeft = offset.x - ((elementRect.width || width) - width); translator.move($element, { top: location.top + (sides.top ? offsetTop : 0), left: location.left + (sides.left ? offsetLeft : 0) }); this._resizeAction({ event: e, width: this.option("width") || width, height: this.option("height") || height, handles: this._movingSides }); domUtils.triggerResizeEvent($element) }, _getOffset: function(e) { var offset = e.offset; var steps = commonUtils.pairToObject(this.option("step"), !this.option("roundStepValue")); var sides = this._getMovingSides(e); var strictPrecision = "strict" === this.option("stepPrecision"); if (!sides.left && !sides.right) { offset.x = 0 } if (!sides.top && !sides.bottom) { offset.y = 0 } return strictPrecision ? this._getStrictOffset(offset, steps, sides) : this._getSimpleOffset(offset, steps) }, _getSimpleOffset: function(offset, steps) { return { x: offset.x - offset.x % steps.h, y: offset.y - offset.y % steps.v } }, _getStrictOffset: function(offset, steps, sides) { var location = this._elementLocation; var size = this._elementSize; var xPos = sides.left ? location.left : location.left + size.width; var yPos = sides.top ? location.top : location.top + size.height; var newXShift = (xPos + offset.x) % steps.h; var newYShift = (yPos + offset.y) % steps.v; var sign = Math.sign || function(x) { x = +x; if (0 === x || isNaN(x)) { return x } return x > 0 ? 1 : -1 }; var separatorOffset = function(steps, offset) { return (1 + .2 * sign(offset)) % 1 * steps }; var isSmallOffset = function(offset, steps) { return Math.abs(offset) < .2 * steps }; var newOffsetX = offset.x - newXShift; var newOffsetY = offset.y - newYShift; if (newXShift > separatorOffset(steps.h, offset.x)) { newOffsetX += steps.h } if (newYShift > separatorOffset(steps.v, offset.y)) { newOffsetY += steps.v } return { x: (sides.left || sides.right) && !isSmallOffset(offset.x, steps.h) ? newOffsetX : 0, y: (sides.top || sides.bottom) && !isSmallOffset(offset.y, steps.v) ? newOffsetY : 0 } }, _getMovingSides: function(e) { var $target = $(e.target); var hasCornerTopLeftClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-top-left"); var hasCornerTopRightClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-top-right"); var hasCornerBottomLeftClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-bottom-left"); var hasCornerBottomRightClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-bottom-right"); return { top: $target.hasClass(RESIZABLE_HANDLE_TOP_CLASS) || hasCornerTopLeftClass || hasCornerTopRightClass, left: $target.hasClass(RESIZABLE_HANDLE_LEFT_CLASS) || hasCornerTopLeftClass || hasCornerBottomLeftClass, bottom: $target.hasClass(RESIZABLE_HANDLE_BOTTOM_CLASS) || hasCornerBottomLeftClass || hasCornerBottomRightClass, right: $target.hasClass(RESIZABLE_HANDLE_RIGHT_CLASS) || hasCornerTopRightClass || hasCornerBottomRightClass } }, _getArea: function() { var area = this.option("area"); if (isFunction(area)) { area = area.call(this) } if (isPlainObject(area)) { return this._getAreaFromObject(area) } return this._getAreaFromElement(area) }, _getAreaScrollOffset: function() { var area = this.option("area"); var isElement = !isFunction(area) && !isPlainObject(area); var scrollOffset = { scrollY: 0, scrollX: 0 }; if (isElement) { var areaElement = $(area)[0]; if (typeUtils.isWindow(areaElement)) { scrollOffset.scrollX = areaElement.pageXOffset; scrollOffset.scrollY = areaElement.pageYOffset } } return scrollOffset }, _getAreaFromObject: function(area) { var result = { width: area.right - area.left, height: area.bottom - area.top, offset: { left: area.left, top: area.top } }; this._correctAreaGeometry(result); return result }, _getAreaFromElement: function(area) { var $area = $(area); var result; if ($area.length) { result = { width: $area.innerWidth(), height: $area.innerHeight(), offset: extend({ top: 0, left: 0 }, typeUtils.isWindow($area[0]) ? {} : $area.offset()) }; this._correctAreaGeometry(result, $area) } return result }, _correctAreaGeometry: function(result, $area) { var areaBorderLeft = $area ? this._getBorderWidth($area, "left") : 0; var areaBorderTop = $area ? this._getBorderWidth($area, "top") : 0; result.offset.left += areaBorderLeft + this._getBorderWidth(this.$element(), "left"); result.offset.top += areaBorderTop + this._getBorderWidth(this.$element(), "top"); result.width -= this.$element().outerWidth() - this.$element().innerWidth(); result.height -= this.$element().outerHeight() - this.$element().innerHeight() }, _dragEndHandler: function(e) { var $element = this.$element(); this._resizeEndAction({ event: e, width: $element.outerWidth(), height: $element.outerHeight(), handles: this._movingSides }); this._toggleResizingClass(false) }, _renderWidth: function(width) { this.option("width", fitIntoRange(width, this.option("minWidth"), this.option("maxWidth"))) }, _renderHeight: function(height) { this.option("height", fitIntoRange(height, this.option("minHeight"), this.option("maxHeight"))) }, _optionChanged: function(args) { switch (args.name) { case "disabled": case "handles": this._invalidate(); break; case "minWidth": case "maxWidth": windowUtils.hasWindow() && this._renderWidth(this.$element().outerWidth()); break; case "minHeight": case "maxHeight": windowUtils.hasWindow() && this._renderHeight(this.$element().outerHeight()); break; case "onResize": case "onResizeStart": case "onResizeEnd": this._renderActions(); break; case "area": case "stepPrecision": case "step": case "roundStepValue": break; default: this.callBase(args) } }, _clean: function() { this.$element().find("." + RESIZABLE_HANDLE_CLASS).remove() } }); registerComponent(RESIZABLE, Resizable); module.exports = Resizable }, /*!**********************************************!*\ !*** ./artifacts/transpiled/events/swipe.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var eventUtils = __webpack_require__( /*! ./utils */ 8); var GestureEmitter = __webpack_require__( /*! ./gesture/emitter.gesture */ 158); var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95); var SWIPE_START_EVENT = "dxswipestart"; var SWIPE_EVENT = "dxswipe"; var 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(); var moveEventData = eventUtils.eventData(e); var 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(); var offsetRatio = strategy.calcOffsetRatio.call(this, e); var isFast = strategy.isFastSwipe.call(this, e); var startOffset = offsetRatio; var 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(); var 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 }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/viz/core/renderers/renderer.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _dom_adapter = __webpack_require__( /*! ../../../core/dom_adapter */ 11); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); var _window = __webpack_require__( /*! ../../../core/utils/window */ 7); var _window2 = _interopRequireDefault(_window); var _call_once = __webpack_require__( /*! ../../../core/utils/call_once */ 63); var _call_once2 = _interopRequireDefault(_call_once); var _events_engine = __webpack_require__( /*! ../../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _browser = __webpack_require__( /*! ../../../core/utils/browser */ 25); var _browser2 = _interopRequireDefault(_browser); var _svg = __webpack_require__( /*! ../../../core/utils/svg */ 209); var _animation = __webpack_require__( /*! ./animation */ 765); var _animation2 = _interopRequireDefault(_animation); var _utils = __webpack_require__( /*! ../utils */ 10); var _type = __webpack_require__( /*! ../../../core/utils/type */ 1); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest() } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } function _unsupportedIterableToArray(o, minLen) { if (!o) { return } if ("string" === typeof o) { return _arrayLikeToArray(o, minLen) } var n = Object.prototype.toString.call(o).slice(8, -1); if ("Object" === n && o.constructor) { n = o.constructor.name } if ("Map" === n || "Set" === n) { return Array.from(o) } if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) { return _arrayLikeToArray(o, minLen) } } function _arrayLikeToArray(arr, len) { if (null == len || len > arr.length) { len = arr.length } for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i] } return arr2 } function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" !== typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null == _i) { return } var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) { break } } } catch (err) { _d = true; _e = err } finally { try { if (!_n && null != _i.return) { _i.return() } } finally { if (_d) { throw _e } } } return _arr } function _arrayWithHoles(arr) { if (Array.isArray(arr)) { return arr } } var window = _window2.default.getWindow(); var max = Math.max, min = Math.min, floor = Math.floor, round = Math.round, sin = Math.sin, cos = Math.cos, abs = Math.abs, PI = Math.PI; var PI_DIV_180 = PI / 180; var SHARPING_CORRECTION = .5; var ARC_COORD_PREC = 5; var pxAddingExceptions = { "column-count": true, "fill-opacity": true, "flex-grow": true, "flex-shrink": true, "font-weight": true, "line-height": true, opacity: true, order: true, orphans: true, widows: true, "z-index": true, zoom: true }; var KEY_TEXT = "text"; var KEY_STROKE = "stroke"; var KEY_STROKE_WIDTH = "stroke-width"; var KEY_STROKE_OPACITY = "stroke-opacity"; var KEY_FONT_SIZE = "font-size"; var KEY_FONT_STYLE = "font-style"; var KEY_FONT_WEIGHT = "font-weight"; var KEY_TEXT_DECORATION = "text-decoration"; var NONE = "none"; var DEFAULT_FONT_SIZE = 12; var ELLIPSIS = "..."; var objectCreate = function() { if (!Object.create) { return function(proto) { var F = function() {}; F.prototype = proto; return new F } } else { return function(proto) { return Object.create(proto) } } }(); var DEFAULTS = { scaleX: 1, scaleY: 1, "pointer-events": null }; var getBackup = (0, _call_once2.default)(function() { var backupContainer = _dom_adapter2.default.createElement("div"); var backupCounter = 0; backupContainer.style.left = "-9999px"; backupContainer.style.position = "absolute"; return { backupContainer: backupContainer, backupCounter: backupCounter } }); function backupRoot(root) { if (0 === getBackup().backupCounter) { _dom_adapter2.default.getBody().appendChild(getBackup().backupContainer) }++getBackup().backupCounter; root.append({ element: getBackup().backupContainer }) } function restoreRoot(root, container) { root.append({ element: container }); --getBackup().backupCounter; if (0 === getBackup().backupCounter) { _dom_adapter2.default.getBody().removeChild(getBackup().backupContainer) } } var getNextDefsSvgId = function() { var numDefsSvgElements = 1; return function() { return "DevExpress_" + numDefsSvgElements++ } }(); function isObjectArgument(value) { return value && "string" !== typeof value } function createElement(tagName) { return _dom_adapter2.default.createElementNS("http://www.w3.org/2000/svg", tagName) } function getFuncIri(id, pathModified) { return null !== id ? "url(" + (pathModified ? window.location.href.split("#")[0] : "") + "#" + id + ")" : id } function extend(target, source) { var key; for (key in source) { target[key] = source[key] } return target } function roundValue(value, exp) { value = value.toString().split("e"); value = round(+(value[0] + "e" + (value[1] ? +value[1] + exp : exp))); value = value.toString().split("e"); return +(value[0] + "e" + (value[1] ? +value[1] - exp : -exp)) } function getBoundingClientRect(element) { var box; try { box = element.getBoundingClientRect() } catch (e) {} return box || { left: 0, top: 0 } } var preserveAspectRatioMap = { full: NONE, lefttop: "xMinYMin", leftcenter: "xMinYMid", leftbottom: "xMinYMax", centertop: "xMidYMin", center: "xMidYMid", centerbottom: "xMidYMax", righttop: "xMaxYMin", rightcenter: "xMaxYMid", rightbottom: "xMaxYMax" }; function normalizeArcParams(x, y, innerR, outerR, startAngle, endAngle) { var isCircle; var noArc = true; var angleDiff = roundValue(endAngle, 3) - roundValue(startAngle, 3); if (angleDiff) { if (abs(angleDiff) % 360 === 0) { startAngle = 0; endAngle = 360; isCircle = true; endAngle -= .01 } if (startAngle > 360) { startAngle %= 360 } if (endAngle > 360) { endAngle %= 360 } if (startAngle > endAngle) { startAngle -= 360 } noArc = false } startAngle *= PI_DIV_180; endAngle *= PI_DIV_180; return [x, y, min(outerR, innerR), max(outerR, innerR), cos(startAngle), sin(startAngle), cos(endAngle), sin(endAngle), isCircle, floor(abs(endAngle - startAngle) / PI) % 2 ? "1" : "0", noArc] } var buildArcPath = function(x, y, innerR, outerR, startAngleCos, startAngleSin, endAngleCos, endAngleSin, isCircle, longFlag) { return ["M", (x + outerR * startAngleCos).toFixed(ARC_COORD_PREC), (y - outerR * startAngleSin).toFixed(ARC_COORD_PREC), "A", outerR.toFixed(ARC_COORD_PREC), outerR.toFixed(ARC_COORD_PREC), 0, longFlag, 0, (x + outerR * endAngleCos).toFixed(ARC_COORD_PREC), (y - outerR * endAngleSin).toFixed(ARC_COORD_PREC), isCircle ? "M" : "L", (x + innerR * endAngleCos).toFixed(5), (y - innerR * endAngleSin).toFixed(ARC_COORD_PREC), "A", innerR.toFixed(ARC_COORD_PREC), innerR.toFixed(ARC_COORD_PREC), 0, longFlag, 1, (x + innerR * startAngleCos).toFixed(ARC_COORD_PREC), (y - innerR * startAngleSin).toFixed(ARC_COORD_PREC), "Z"].join(" ") }; function buildPathSegments(points, type) { var list = [ ["M", 0, 0] ]; switch (type) { case "line": list = buildLineSegments(points); break; case "area": list = buildLineSegments(points, true); break; case "bezier": list = buildCurveSegments(points); break; case "bezierarea": list = buildCurveSegments(points, true) } return list } function buildLineSegments(points, close) { return buildSegments(points, buildSimpleLineSegment, close) } function buildCurveSegments(points, close) { return buildSegments(points, buildSimpleCurveSegment, close) } function buildSegments(points, buildSimpleSegment, close) { var i; var ii; var list = []; if (points[0] && points[0].length) { for (i = 0, ii = points.length; i < ii; ++i) { buildSimpleSegment(points[i], close, list) } } else { buildSimpleSegment(points, close, list) } return list } function buildSimpleLineSegment(points, close, list) { var i = 0; var k0 = list.length; var k = k0; var ii = (points || []).length; if (ii) { if (void 0 !== points[0].x) { for (; i < ii;) { list[k++] = ["L", points[i].x, points[i++].y] } } else { for (; i < ii;) { list[k++] = ["L", points[i++], points[i++]] } } list[k0][0] = "M" } else { list[k] = ["M", 0, 0] } close && list.push(["Z"]); return list } function buildSimpleCurveSegment(points, close, list) { var i; var k = list.length; var ii = (points || []).length; if (ii) { if (void 0 !== points[0].x) { list[k++] = ["M", points[0].x, points[0].y]; for (i = 1; i < ii;) { list[k++] = ["C", points[i].x, points[i++].y, points[i].x, points[i++].y, points[i].x, points[i++].y] } } else { list[k++] = ["M", points[0], points[1]]; for (i = 2; i < ii;) { list[k++] = ["C", points[i++], points[i++], points[i++], points[i++], points[i++], points[i++]] } } } else { list[k] = ["M", 0, 0] } close && list.push(["Z"]); return list } function combinePathParam(segments) { var d = []; var k = 0; var i; var ii = segments.length; var segment; var j; var jj; for (i = 0; i < ii; ++i) { segment = segments[i]; for (j = 0, jj = segment.length; j < jj; ++j) { d[k++] = segment[j] } } return d.join(" ") } function compensateSegments(oldSegments, newSegments, type) { var oldLength = oldSegments.length; var newLength = newSegments.length; var i; var originalNewSegments; var makeEqualSegments = type.indexOf("area") !== -1 ? makeEqualAreaSegments : makeEqualLineSegments; if (0 === oldLength) { for (i = 0; i < newLength; i++) { oldSegments.push(newSegments[i].slice(0)) } } else { if (oldLength < newLength) { makeEqualSegments(oldSegments, newSegments, type) } else { if (oldLength > newLength) { originalNewSegments = newSegments.slice(0); makeEqualSegments(newSegments, oldSegments, type) } } } return originalNewSegments } function prepareConstSegment(constSeg, type) { var x = constSeg[constSeg.length - 2]; var y = constSeg[constSeg.length - 1]; switch (type) { case "line": case "area": constSeg[0] = "L"; break; case "bezier": case "bezierarea": constSeg[0] = "C"; constSeg[1] = constSeg[3] = constSeg[5] = x; constSeg[2] = constSeg[4] = constSeg[6] = y } } function makeEqualLineSegments(short, long, type) { var constSeg = short[short.length - 1].slice(); var i = short.length; prepareConstSegment(constSeg, type); for (; i < long.length; i++) { short[i] = constSeg.slice(0) } } function makeEqualAreaSegments(short, long, type) { var i; var head; var shortLength = short.length; var longLength = long.length; var constsSeg1; var constsSeg2; if ((shortLength - 1) % 2 === 0 && (longLength - 1) % 2 === 0) { i = (shortLength - 1) / 2 - 1; head = short.slice(0, i + 1); constsSeg1 = head[head.length - 1].slice(0); constsSeg2 = short.slice(i + 1)[0].slice(0); prepareConstSegment(constsSeg1, type); prepareConstSegment(constsSeg2, type); for (var j = i; j < (longLength - 1) / 2 - 1; j++) { short.splice(j + 1, 0, constsSeg1); short.splice(j + 3, 0, constsSeg2) } } } function baseCss(that, styles) { var elemStyles = that._styles; var str = ""; var key; var value; styles = styles || {}; for (key in styles) { value = styles[key]; if ((0, _type.isDefined)(value)) { value += "number" === typeof value && !pxAddingExceptions[key] ? "px" : ""; elemStyles[key] = "" !== value ? value : null } } for (key in elemStyles) { value = elemStyles[key]; if (value) { str += key + ":" + value + ";" } } str && that.element.setAttribute("style", str); return that } function fixFuncIri(wrapper, attribute) { var element = wrapper.element; var id = wrapper.attr(attribute); if (id && id.indexOf("DevExpress") !== -1) { element.removeAttribute(attribute); element.setAttribute(attribute, getFuncIri(id, wrapper.renderer.pathModified)) } } function baseAttr(that, attrs) { attrs = attrs || {}; var settings = that._settings; var attributes = {}; var key; var value; var elem = that.element; var renderer = that.renderer; var rtl = renderer.rtl; var hasTransformations; var recalculateDashStyle; var sw; var i; if (!isObjectArgument(attrs)) { if (attrs in settings) { return settings[attrs] } if (attrs in DEFAULTS) { return DEFAULTS[attrs] } return 0 } extend(attributes, attrs); for (key in attributes) { value = attributes[key]; if (void 0 === value) { continue } settings[key] = value; if ("align" === key) { key = "text-anchor"; value = { left: rtl ? "end" : "start", center: "middle", right: rtl ? "start" : "end" } [value] || null } else { if ("dashStyle" === key) { recalculateDashStyle = true; continue } else { if (key === KEY_STROKE_WIDTH) { recalculateDashStyle = true } else { if (value && ("fill" === key || "clip-path" === key || "filter" === key) && value.indexOf("DevExpress") !== -1) { that._addFixIRICallback(); value = getFuncIri(value, renderer.pathModified) } else { if (/^(translate(X|Y)|rotate[XY]?|scale(X|Y)|sharp|sharpDirection)$/i.test(key)) { hasTransformations = true; continue } else { if (/^(x|y|d)$/i.test(key)) { hasTransformations = true } } } } } } if (null === value) { elem.removeAttribute(key) } else { elem.setAttribute(key, value) } } if (recalculateDashStyle && "dashStyle" in settings) { value = settings.dashStyle; sw = ("_originalSW" in that ? that._originalSW : settings[KEY_STROKE_WIDTH]) || 1; key = "stroke-dasharray"; value = null === value ? "" : (0, _utils.normalizeEnum)(value); if ("" === value || "solid" === value || value === NONE) { that.element.removeAttribute(key) } else { value = value.replace(/longdash/g, "8,3,").replace(/dash/g, "4,3,").replace(/dot/g, "1,3,").replace(/,$/, "").split(","); i = value.length; while (i--) { value[i] = parseInt(value[i]) * sw } that.element.setAttribute(key, value.join(",")) } } if (hasTransformations) { that._applyTransformation() } return that } function pathAttr(attrs) { var that = this; var segments; if (isObjectArgument(attrs)) { attrs = extend({}, attrs); segments = attrs.segments; if ("points" in attrs) { segments = buildPathSegments(attrs.points, that.type); delete attrs.points } if (segments) { attrs.d = combinePathParam(segments); that.segments = segments; delete attrs.segments } } return baseAttr(that, attrs) } function arcAttr(attrs) { var settings = this._settings; var x; var y; var innerRadius; var outerRadius; var startAngle; var endAngle; if (isObjectArgument(attrs)) { attrs = extend({}, attrs); if ("x" in attrs || "y" in attrs || "innerRadius" in attrs || "outerRadius" in attrs || "startAngle" in attrs || "endAngle" in attrs) { settings.x = x = "x" in attrs ? attrs.x : settings.x; delete attrs.x; settings.y = y = "y" in attrs ? attrs.y : settings.y; delete attrs.y; settings.innerRadius = innerRadius = "innerRadius" in attrs ? attrs.innerRadius : settings.innerRadius; delete attrs.innerRadius; settings.outerRadius = outerRadius = "outerRadius" in attrs ? attrs.outerRadius : settings.outerRadius; delete attrs.outerRadius; settings.startAngle = startAngle = "startAngle" in attrs ? attrs.startAngle : settings.startAngle; delete attrs.startAngle; settings.endAngle = endAngle = "endAngle" in attrs ? attrs.endAngle : settings.endAngle; delete attrs.endAngle; attrs.d = buildArcPath.apply(null, normalizeArcParams(x, y, innerRadius, outerRadius, startAngle, endAngle)) } } return baseAttr(this, attrs) } function rectAttr(attrs) { var that = this; var x; var y; var width; var height; var sw; var maxSW; var newSW; if (isObjectArgument(attrs)) { attrs = extend({}, attrs); if (void 0 !== attrs.x || void 0 !== attrs.y || void 0 !== attrs.width || void 0 !== attrs.height || void 0 !== attrs[KEY_STROKE_WIDTH]) { void 0 !== attrs.x ? x = that._originalX = attrs.x : x = that._originalX || 0; void 0 !== attrs.y ? y = that._originalY = attrs.y : y = that._originalY || 0; void 0 !== attrs.width ? width = that._originalWidth = attrs.width : width = that._originalWidth || 0; void 0 !== attrs.height ? height = that._originalHeight = attrs.height : height = that._originalHeight || 0; void 0 !== attrs[KEY_STROKE_WIDTH] ? sw = that._originalSW = attrs[KEY_STROKE_WIDTH] : sw = that._originalSW; maxSW = ~~((width < height ? width : height) / 2); newSW = (sw || 0) < maxSW ? sw || 0 : maxSW; attrs.x = x + newSW / 2; attrs.y = y + newSW / 2; attrs.width = width - newSW; attrs.height = height - newSW; ((sw || 0) !== newSW || !(0 === newSW && void 0 === sw)) && (attrs[KEY_STROKE_WIDTH] = newSW) } if ("sharp" in attrs) { delete attrs.sharp } } return baseAttr(that, attrs) } function textAttr(attrs) { var that = this; var isResetRequired; if (!isObjectArgument(attrs)) { return baseAttr(that, attrs) } attrs = extend({}, attrs); var settings = that._settings; var wasStroked = (0, _type.isDefined)(settings[KEY_STROKE]) && (0, _type.isDefined)(settings[KEY_STROKE_WIDTH]); if (void 0 !== attrs[KEY_TEXT]) { settings[KEY_TEXT] = attrs[KEY_TEXT]; delete attrs[KEY_TEXT]; isResetRequired = true } if (void 0 !== attrs[KEY_STROKE]) { settings[KEY_STROKE] = attrs[KEY_STROKE]; delete attrs[KEY_STROKE] } if (void 0 !== attrs[KEY_STROKE_WIDTH]) { settings[KEY_STROKE_WIDTH] = attrs[KEY_STROKE_WIDTH]; delete attrs[KEY_STROKE_WIDTH] } if (void 0 !== attrs[KEY_STROKE_OPACITY]) { settings[KEY_STROKE_OPACITY] = attrs[KEY_STROKE_OPACITY]; delete attrs[KEY_STROKE_OPACITY] } var isStroked = (0, _type.isDefined)(settings[KEY_STROKE]) && (0, _type.isDefined)(settings[KEY_STROKE_WIDTH]); baseAttr(that, attrs); isResetRequired = isResetRequired || isStroked !== wasStroked && settings[KEY_TEXT]; if (isResetRequired) { createTextNodes(that, settings.text, isStroked); that._hasEllipsis = false } if (isResetRequired || void 0 !== attrs.x || void 0 !== attrs.y) { locateTextNodes(that) } if (isStroked) { strokeTextNodes(that) } return that } function textCss(styles) { styles = styles || {}; baseCss(this, styles); if (KEY_FONT_SIZE in styles) { locateTextNodes(this) } return this } function orderHtmlTree(list, line, node, parentStyle, parentClassName) { var style; var realStyle; var i; var ii; var nodes; if (void 0 !== node.wholeText) { list.push({ value: node.wholeText, style: parentStyle, className: parentClassName, line: line, height: parentStyle[KEY_FONT_SIZE] || 0 }) } else { if ("BR" === node.tagName) { ++line } else { if (_dom_adapter2.default.isElementNode(node)) { extend(style = {}, parentStyle); switch (node.tagName) { case "B": case "STRONG": style[KEY_FONT_WEIGHT] = "bold"; break; case "I": case "EM": style[KEY_FONT_STYLE] = "italic"; break; case "U": style[KEY_TEXT_DECORATION] = "underline" } realStyle = node.style; realStyle.color && (style.fill = realStyle.color); realStyle.fontSize && (style[KEY_FONT_SIZE] = realStyle.fontSize); realStyle.fontStyle && (style[KEY_FONT_STYLE] = realStyle.fontStyle); realStyle.fontWeight && (style[KEY_FONT_WEIGHT] = realStyle.fontWeight); realStyle.textDecoration && (style[KEY_TEXT_DECORATION] = realStyle.textDecoration); for (i = 0, nodes = node.childNodes, ii = nodes.length; i < ii; ++i) { line = orderHtmlTree(list, line, nodes[i], style, node.className || parentClassName) } } } } return line } function adjustLineHeights(items) { var i; var ii; var currentItem = items[0]; var item; for (i = 1, ii = items.length; i < ii; ++i) { item = items[i]; if (item.line === currentItem.line) { currentItem.height = maxLengthFontSize(currentItem.height, item.height); currentItem.inherits = currentItem.inherits || 0 === parseFloat(item.height); item.height = NaN } else { currentItem = item } } } function removeExtraAttrs(html) { var findTagAttrs = /(?:(<[a-z0-9]+\s*))([\s\S]*?)(>|\/>)/gi; var findStyleAndClassAttrs = /(style|class)\s*=\s*(["'])(?:(?!\2).)*\2\s?/gi; return html.replace(findTagAttrs, function(allTagAttrs, p1, p2, p3) { p2 = (p2 && p2.match(findStyleAndClassAttrs) || []).map(function(str) { return str }).join(" "); return p1 + p2 + p3 }) } function parseHTML(text) { var items = []; var div = _dom_adapter2.default.createElement("div"); div.innerHTML = text.replace(/\r/g, "").replace(/\n/g, "
"); orderHtmlTree(items, 0, div, {}, ""); adjustLineHeights(items); return items } function parseMultiline(text) { var texts = text.replace(/\r/g, "").split(/\n/g); var i = 0; var items = []; for (; i < texts.length; i++) { items.push({ value: texts[i].trim(), height: 0, line: i }) } return items } function createTspans(items, element, fieldName) { var i; var ii; var item; for (i = 0, ii = items.length; i < ii; ++i) { item = items[i]; item[fieldName] = createElement("tspan"); item[fieldName].appendChild(_dom_adapter2.default.createTextNode(item.value)); item.style && baseCss({ element: item[fieldName], _styles: {} }, item.style); item.className && item[fieldName].setAttribute("class", item.className); element.appendChild(item[fieldName]) } } function restoreText() { if (this._hasEllipsis) { this.attr({ text: this._settings.text }) } } function applyEllipsis(maxWidth) { var that = this; var lines; var hasEllipsis = false; var i; var ii; var lineParts; var j; var jj; var text; restoreText.call(that); var ellipsis = that.renderer.text(ELLIPSIS).attr(that._styles).append(that.renderer.root); var ellipsisWidth = ellipsis.getBBox().width; if (that._getElementBBox().width > maxWidth) { if (maxWidth - ellipsisWidth < 0) { maxWidth = 0 } else { maxWidth -= ellipsisWidth } lines = prepareLines(that.element, that._texts, maxWidth); for (i = 0, ii = lines.length; i < ii; ++i) { lineParts = lines[i].parts; if (1 === lines[i].commonLength) { continue } for (j = 0, jj = lineParts.length; j < jj; ++j) { text = lineParts[j]; if ((0, _type.isDefined)(text.endIndex)) { setNewText(text, text.endIndex); hasEllipsis = true } else { if (text.startBox > maxWidth) { removeTextSpan(text) } } } } } ellipsis.remove(); that._hasEllipsis = hasEllipsis; return hasEllipsis } function cloneAndRemoveAttrs(node) { var clone; if (node) { clone = node.cloneNode(); clone.removeAttribute("y"); clone.removeAttribute("x") } return clone || node } function detachAndStoreTitleElements(element) { var titleElements = _dom_adapter2.default.querySelectorAll(element, "title"); for (var i = 0; i < titleElements.length; i++) { element.removeChild(titleElements[i]) } return function() { for (var _i = 0; _i < titleElements.length; _i++) { element.appendChild(titleElements[_i]) } } } function setMaxSize(maxWidth, maxHeight) { var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; var that = this; var lines = []; var textChanged = false; var textIsEmpty = false; var ellipsisMaxWidth = maxWidth; restoreText.call(that); var restoreTitleElement = detachAndStoreTitleElements(this.element); var ellipsis = that.renderer.text(ELLIPSIS).attr(that._styles).append(that.renderer.root); var ellipsisWidth = ellipsis.getBBox().width; var _that$_getElementBBox = that._getElementBBox(), width = _that$_getElementBBox.width, height = _that$_getElementBBox.height; if ((width || height) && (width > maxWidth || maxHeight && height > maxHeight)) { if (maxWidth - ellipsisWidth < 0) { ellipsisMaxWidth = 0 } else { ellipsisMaxWidth -= ellipsisWidth } lines = applyOverflowRules(that.element, that._texts, maxWidth, ellipsisMaxWidth, options, maxHeight); lines = setMaxHeight(lines, ellipsisMaxWidth, options, maxHeight, parseFloat(this._getLineHeight())); this._texts = lines.reduce(function(texts, line) { return texts.concat(line.parts) }, []).filter(function(t) { return "" !== t.value }).map(function(t) { t.stroke && t.tspan.parentNode.appendChild(t.stroke); return t }).map(function(t) { t.tspan.parentNode.appendChild(t.tspan); return t }); !this._texts.length && (this._texts = null); textChanged = true; if (this._texts) { locateTextNodes(this) } else { this.element.textContent = ""; textIsEmpty = true } } ellipsis.remove(); that._hasEllipsis = textChanged; restoreTitleElement(); return { rowCount: lines.length, textChanged: textChanged, textIsEmpty: textIsEmpty } } function getIndexForEllipsis(text, maxWidth, startBox, endBox) { var k; var kk; if (startBox <= maxWidth && endBox > maxWidth) { for (k = 1, kk = text.value.length; k <= kk; ++k) { if (startBox + text.tspan.getSubStringLength(0, k) > maxWidth) { return k - 1 } } } } function getTextWidth(text) { return text.value.length ? text.tspan.getSubStringLength(0, text.value.length) : 0 } function prepareLines(element, texts, maxWidth) { var lines = []; var i; var ii; var text; var startBox; var endBox; if (texts) { for (i = 0, ii = texts.length; i < ii; ++i) { text = texts[i]; if (!lines[text.line]) { text.startBox = startBox = 0; lines.push({ commonLength: text.value.length, parts: [text] }) } else { text.startBox = startBox; lines[text.line].parts.push(text); lines[text.line].commonLength += text.value.length } endBox = startBox + text.tspan.getSubStringLength(0, text.value.length); text.endIndex = getIndexForEllipsis(text, maxWidth, startBox, endBox); startBox = endBox } } else { text = { value: element.textContent, tspan: element }; text.startBox = startBox = 0; endBox = startBox + getTextWidth(text); text.endIndex = getIndexForEllipsis(text, maxWidth, startBox, endBox); lines = [{ commonLength: element.textContent.length, parts: [text] }] } return lines } function getSpaceBreakIndex(text, maxWidth) { var initialIndices = text.startBox > 0 ? [0] : []; var spaceIndices = text.value.split("").reduce(function(indices, char, index) { if (" " === char) { indices.push(index) } return indices }, initialIndices); var spaceIndex = 0; while (void 0 !== spaceIndices[spaceIndex + 1] && text.startBox + text.tspan.getSubStringLength(0, spaceIndices[spaceIndex + 1]) < maxWidth) { spaceIndex++ } return spaceIndices[spaceIndex] } function getWordBreakIndex(text, maxWidth) { for (var i = 0; i < text.value.length - 1; i++) { if (text.startBox + text.tspan.getSubStringLength(0, i + 1) > maxWidth) { return i } } } function getEllipsisString(ellipsisMaxWidth, _ref) { var hideOverflowEllipsis = _ref.hideOverflowEllipsis; return hideOverflowEllipsis && 0 === ellipsisMaxWidth ? "" : ELLIPSIS } function setEllipsis(text, ellipsisMaxWidth, options) { var ellipsis = getEllipsisString(ellipsisMaxWidth, options); if (text.value.length && text.tspan.parentNode) { for (var i = text.value.length - 1; i >= 1; i--) { if (text.startBox + text.tspan.getSubStringLength(0, i) < ellipsisMaxWidth) { setNewText(text, i, ellipsis); break } else { if (1 === i) { setNewText(text, 0, ellipsis) } } } } } function wordWrap(text, maxWidth, ellipsisMaxWidth, options) { var wholeText = text.value; var breakIndex; if ("none" !== options.wordWrap) { breakIndex = "normal" === options.wordWrap ? getSpaceBreakIndex(text, maxWidth) : getWordBreakIndex(text, maxWidth) } var restLines = []; var restText; if (isFinite(breakIndex)) { setNewText(text, breakIndex, ""); var newTextOffset = " " === wholeText[breakIndex] ? 1 : 0; var restString = wholeText.slice(breakIndex + newTextOffset); if (restString.length) { var restTspan = cloneAndRemoveAttrs(text.tspan); restTspan.textContent = restString; text.tspan.parentNode.appendChild(restTspan); restText = extend(extend({}, text), { value: restString, startBox: 0, height: 0, tspan: restTspan, stroke: cloneAndRemoveAttrs(text.stroke), endBox: restTspan.getSubStringLength(0, restString.length) }); restText.stroke && (restText.stroke.textContent = restString); if (restText.endBox > maxWidth) { restLines = wordWrap(restText, maxWidth, ellipsisMaxWidth, options); if (!restLines.length) { return [] } } } } if (text.value.length) { if ("ellipsis" === options.textOverflow && text.tspan.getSubStringLength(0, text.value.length) > maxWidth) { setEllipsis(text, ellipsisMaxWidth, options) } if ("hide" === options.textOverflow && text.tspan.getSubStringLength(0, text.value.length) > maxWidth) { return [] } } else { text.tspan.parentNode.removeChild(text.tspan) } var parts = []; if (restText) { parts.push(restText) } return [{ commonLength: wholeText.length, parts: parts }].concat(restLines) } function calculateLineHeight(line, lineHeight) { return line.parts.reduce(function(height, text) { return max(height, getItemLineHeight(text, lineHeight)) }, 0) } function setMaxHeight(lines, ellipsisMaxWidth, options, maxHeight, lineHeight) { var textOverflow = options.textOverflow; if (!isFinite(maxHeight) || 0 === Number(maxHeight) || "none" === textOverflow) { return lines } var result = lines.reduce(function(_ref2, l, index, arr) { var _ref3 = _slicedToArray(_ref2, 2), lines = _ref3[0], commonHeight = _ref3[1]; var height = calculateLineHeight(l, lineHeight); commonHeight += height; if (commonHeight < maxHeight) { lines.push(l) } else { l.parts.forEach(function(item) { removeTextSpan(item) }); if ("ellipsis" === textOverflow) { var prevLine = arr[index - 1]; if (prevLine) { var text = prevLine.parts[prevLine.parts.length - 1]; if (!text.hasEllipsis) { if (0 === ellipsisMaxWidth || text.endBox < ellipsisMaxWidth) { setNewText(text, text.value.length, getEllipsisString(ellipsisMaxWidth, options)) } else { setEllipsis(text, ellipsisMaxWidth, options) } } } } } return [lines, commonHeight] }, [ [], 0 ]); if ("hide" === textOverflow && result[1] > maxHeight) { result[0].forEach(function(l) { l.parts.forEach(function(item) { removeTextSpan(item) }) }); return [] } return result[0] } function applyOverflowRules(element, texts, maxWidth, ellipsisMaxWidth, options) { if (!texts) { var textValue = element.textContent; var text = { value: textValue, height: 0, line: 0 }; element.textContent = ""; createTspans([text], element, "tspan"); texts = [text] } return texts.reduce(function(_ref4, text) { var _ref5 = _slicedToArray(_ref4, 5), lines = _ref5[0], startBox = _ref5[1], endBox = _ref5[2], stop = _ref5[3], lineNumber = _ref5[4]; var line = lines[lines.length - 1]; if (stop) { return [lines, startBox, endBox, stop] } if (!line || text.line !== lineNumber) { text.startBox = startBox = 0; lines.push({ commonLength: text.value.length, parts: [text] }) } else { text.startBox = startBox; if (startBox > ellipsisMaxWidth && "none" === options.wordWrap && "ellipsis" === options.textOverflow) { removeTextSpan(text); return [lines, startBox, endBox, stop, lineNumber] } line.parts.push(text); line.commonLength += text.value.length } text.endBox = endBox = startBox + getTextWidth(text); startBox = endBox; if ((0, _type.isDefined)(maxWidth) && endBox > maxWidth) { var wordWrapLines = wordWrap(text, maxWidth, ellipsisMaxWidth, options); if (!wordWrapLines.length) { lines = []; stop = true } else { lines = lines.concat(wordWrapLines.filter(function(l) { return l.parts.length > 0 })) } } return [lines, startBox, endBox, stop, text.line] }, [ [], 0, 0, false, 0 ])[0] } function setNewText(text, index) { var insertString = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : ELLIPSIS; var newText = text.value.substr(0, index) + insertString; text.value = text.tspan.textContent = newText; text.stroke && (text.stroke.textContent = newText); if (insertString === ELLIPSIS) { text.hasEllipsis = true } } function removeTextSpan(text) { text.tspan.parentNode && text.tspan.parentNode.removeChild(text.tspan); text.stroke && text.stroke.parentNode && text.stroke.parentNode.removeChild(text.stroke) } function createTextNodes(wrapper, text, isStroked) { var items; var parsedHtml; wrapper._texts = null; wrapper.clear(); if (null === text) { return } text = "" + text; if (!wrapper.renderer.encodeHtml && (/<[a-z][\s\S]*>/i.test(text) || text.indexOf("&") !== -1)) { parsedHtml = removeExtraAttrs(text); items = parseHTML(parsedHtml); wrapper.DEBUG_parsedHtml = parsedHtml } else { if (/\n/g.test(text)) { items = parseMultiline(text) } else { if (isStroked) { items = [{ value: text.trim(), height: 0 }] } } } if (items) { if (items.length) { wrapper._texts = items; if (isStroked) { createTspans(items, wrapper.element, KEY_STROKE) } createTspans(items, wrapper.element, "tspan") } } else { wrapper.element.appendChild(_dom_adapter2.default.createTextNode(text)) } } function setTextNodeAttribute(item, name, value) { item.tspan.setAttribute(name, value); item.stroke && item.stroke.setAttribute(name, value) } function getItemLineHeight(item, defaultValue) { return item.inherits ? maxLengthFontSize(item.height, defaultValue) : item.height || defaultValue } function locateTextNodes(wrapper) { if (!wrapper._texts) { return } var items = wrapper._texts; var x = wrapper._settings.x; var lineHeight = wrapper._getLineHeight(); var i; var ii; var item = items[0]; setTextNodeAttribute(item, "x", x); setTextNodeAttribute(item, "y", wrapper._settings.y); for (i = 1, ii = items.length; i < ii; ++i) { item = items[i]; if (parseFloat(item.height) >= 0) { setTextNodeAttribute(item, "x", x); var height = getItemLineHeight(item, lineHeight); setTextNodeAttribute(item, "dy", height) } } } function maxLengthFontSize(fontSize1, fontSize2) { var parsedHeight1 = parseFloat(fontSize1); var parsedHeight2 = parseFloat(fontSize2); var height1 = parsedHeight1 || DEFAULT_FONT_SIZE; var height2 = parsedHeight2 || DEFAULT_FONT_SIZE; return height1 > height2 ? !isNaN(parsedHeight1) ? fontSize1 : height1 : !isNaN(parsedHeight2) ? fontSize2 : height2 } function strokeTextNodes(wrapper) { if (!wrapper._texts) { return } var items = wrapper._texts; var stroke = wrapper._settings[KEY_STROKE]; var strokeWidth = wrapper._settings[KEY_STROKE_WIDTH]; var strokeOpacity = wrapper._settings[KEY_STROKE_OPACITY] || 1; var tspan; var i; var ii; for (i = 0, ii = items.length; i < ii; ++i) { tspan = items[i].stroke; tspan.setAttribute(KEY_STROKE, stroke); tspan.setAttribute(KEY_STROKE_WIDTH, strokeWidth); tspan.setAttribute(KEY_STROKE_OPACITY, strokeOpacity); tspan.setAttribute("stroke-linejoin", "round") } } function baseAnimate(that, params, options, complete) { options = options || {}; var key; var value; var renderer = that.renderer; var settings = that._settings; var animationParams = {}; var defaults = { translateX: 0, translateY: 0, scaleX: 1, scaleY: 1, rotate: 0, rotateX: 0, rotateY: 0 }; if (complete) { options.complete = complete } if (renderer.animationEnabled()) { for (key in params) { value = params[key]; if (/^(translate(X|Y)|rotate[XY]?|scale(X|Y))$/i.test(key)) { animationParams.transform = animationParams.transform || { from: {}, to: {} }; animationParams.transform.from[key] = key in settings ? Number(settings[key].toFixed(3)) : defaults[key]; animationParams.transform.to[key] = value } else { if ("arc" === key || "segments" === key) { animationParams[key] = value } else { animationParams[key] = { from: key in settings ? settings[key] : parseFloat(that.element.getAttribute(key) || 0), to: value } } } } renderer.animateElement(that, animationParams, extend(extend({}, renderer._animation), options)) } else { options.step && options.step.call(that, 1, 1); options.complete && options.complete.call(that); that.attr(params) } return that } function pathAnimate(params, options, complete) { var that = this; var curSegments = that.segments || []; var newSegments; var endSegments; if (that.renderer.animationEnabled() && "points" in params) { newSegments = buildPathSegments(params.points, that.type); endSegments = compensateSegments(curSegments, newSegments, that.type); params.segments = { from: curSegments, to: newSegments, end: endSegments }; delete params.points } return baseAnimate(that, params, options, complete) } function arcAnimate(params, options, complete) { var that = this; var settings = that._settings; var arcParams = { from: {}, to: {} }; if (that.renderer.animationEnabled() && ("x" in params || "y" in params || "innerRadius" in params || "outerRadius" in params || "startAngle" in params || "endAngle" in params)) { arcParams.from.x = settings.x || 0; arcParams.from.y = settings.y || 0; arcParams.from.innerRadius = settings.innerRadius || 0; arcParams.from.outerRadius = settings.outerRadius || 0; arcParams.from.startAngle = settings.startAngle || 0; arcParams.from.endAngle = settings.endAngle || 0; arcParams.to.x = "x" in params ? params.x : settings.x; delete params.x; arcParams.to.y = "y" in params ? params.y : settings.y; delete params.y; arcParams.to.innerRadius = "innerRadius" in params ? params.innerRadius : settings.innerRadius; delete params.innerRadius; arcParams.to.outerRadius = "outerRadius" in params ? params.outerRadius : settings.outerRadius; delete params.outerRadius; arcParams.to.startAngle = "startAngle" in params ? params.startAngle : settings.startAngle; delete params.startAngle; arcParams.to.endAngle = "endAngle" in params ? params.endAngle : settings.endAngle; delete params.endAngle; params.arc = arcParams } return baseAnimate(that, params, options, complete) } exports.DEBUG_set_getNextDefsSvgId = function(newFunction) { getNextDefsSvgId = newFunction }; exports.DEBUG_removeBackupContainer = function() { if (getBackup().backupCounter) { getBackup().backupCounter = 0; _dom_adapter2.default.getBody().removeChild(getBackup().backupContainer) } }; function buildLink(target, parameters) { var obj = { is: false, name: parameters.name || parameters, after: parameters.after }; if (target) { obj.to = target } else { obj.virtual = true } return obj } function SvgElement(renderer, tagName, type) { var that = this; that.renderer = renderer; that.element = createElement(tagName); that._settings = {}; that._styles = {}; if ("path" === tagName) { that.type = type || "line" } } function removeFuncIriCallback(callback) { fixFuncIriCallbacks.remove(callback) } exports.SvgElement = SvgElement; SvgElement.prototype = { constructor: SvgElement, _getJQElement: function() { return this._$element || (this._$element = (0, _renderer2.default)(this.element)) }, _addFixIRICallback: function() { var that = this; var fn = function() { fixFuncIri(that, "fill"); fixFuncIri(that, "clip-path"); fixFuncIri(that, "filter") }; that.element._fixFuncIri = fn; fn.renderer = that.renderer; fixFuncIriCallbacks.add(fn); that._addFixIRICallback = function() {} }, _clearChildrenFuncIri: function() { var clearChildren = function clearChildren(element) { var i; for (i = 0; i < element.childNodes.length; i++) { removeFuncIriCallback(element.childNodes[i]._fixFuncIri); clearChildren(element.childNodes[i]) } }; clearChildren(this.element) }, dispose: function() { removeFuncIriCallback(this.element._fixFuncIri); this._clearChildrenFuncIri(); this._getJQElement().remove(); return this }, append: function(parent) { (parent || this.renderer.root).element.appendChild(this.element); return this }, remove: function() { var element = this.element; element.parentNode && element.parentNode.removeChild(element); return this }, enableLinks: function() { this._links = []; return this }, checkLinks: function() { var count = 0; var links = this._links; var i; var ii = links.length; for (i = 0; i < ii; ++i) { if (!links[i]._link.virtual) { ++count } } if (count > 0) { throw new Error("There are non disposed links!") } }, virtualLink: function(parameters) { linkItem({ _link: buildLink(null, parameters) }, this); return this }, linkAfter: function(name) { this._linkAfter = name; return this }, linkOn: function(target, parameters) { this._link = buildLink(target, parameters); linkItem(this, target); return this }, linkOff: function() { unlinkItem(this); this._link = null; return this }, linkAppend: function() { var link = this._link; var items = link.to._links; var i; var next; for (i = link.i + 1; (next = items[i]) && !next._link.is; ++i) {} this._insert(link.to, next); link.is = true; return this }, _insert: function(parent, next) { parent.element.insertBefore(this.element, next ? next.element : null) }, linkRemove: function() { this.remove(); this._link.is = false; return this }, clear: function() { this._clearChildrenFuncIri(); this._getJQElement().empty(); return this }, toBackground: function() { var elem = this.element; var parent = elem.parentNode; parent && parent.insertBefore(elem, parent.firstChild); return this }, toForeground: function() { var elem = this.element; var parent = elem.parentNode; parent && parent.appendChild(elem); return this }, attr: function(attrs) { return baseAttr(this, attrs) }, smartAttr: function(attrs) { var that = this; if (attrs.hatching && "none" !== (0, _utils.normalizeEnum)(attrs.hatching.direction)) { attrs = extend({}, attrs); attrs.fill = that._hatching = that.renderer.lockHatching(attrs.fill, attrs.hatching, that._hatching); delete attrs.hatching } else { if (that._hatching) { that.renderer.releaseHatching(that._hatching); that._hatching = null } } return that.attr(attrs) }, css: function(styles) { return baseCss(this, styles) }, animate: function(params, options, complete) { return baseAnimate(this, params, options, complete) }, sharp: function(pos, sharpDirection) { return this.attr({ sharp: pos || true, sharpDirection: sharpDirection }) }, _applyTransformation: function() { var tr = this._settings; var rotateX; var rotateY; var transformations = []; var sharpMode = tr.sharp; var trDirection = tr.sharpDirection || 1; var strokeOdd = tr[KEY_STROKE_WIDTH] % 2; var correctionX = strokeOdd && ("h" === sharpMode || true === sharpMode) ? SHARPING_CORRECTION * trDirection : 0; var correctionY = strokeOdd && ("v" === sharpMode || true === sharpMode) ? SHARPING_CORRECTION * trDirection : 0; transformations.push("translate(" + ((tr.translateX || 0) + correctionX) + "," + ((tr.translateY || 0) + correctionY) + ")"); if (tr.rotate) { if ("rotateX" in tr) { rotateX = tr.rotateX } else { rotateX = tr.x } if ("rotateY" in tr) { rotateY = tr.rotateY } else { rotateY = tr.y } transformations.push("rotate(" + tr.rotate + "," + (rotateX || 0) + "," + (rotateY || 0) + ")") } var scaleXDefined = (0, _type.isDefined)(tr.scaleX); var scaleYDefined = (0, _type.isDefined)(tr.scaleY); if (scaleXDefined || scaleYDefined) { transformations.push("scale(" + (scaleXDefined ? tr.scaleX : 1) + "," + (scaleYDefined ? tr.scaleY : 1) + ")") } if (transformations.length) { this.element.setAttribute("transform", transformations.join(" ")) } }, move: function(x, y, animate, animOptions) { var obj = {}; (0, _type.isDefined)(x) && (obj.translateX = x); (0, _type.isDefined)(y) && (obj.translateY = y); if (!animate) { this.attr(obj) } else { this.animate(obj, animOptions) } return this }, rotate: function(angle, x, y, animate, animOptions) { var obj = { rotate: angle || 0 }; (0, _type.isDefined)(x) && (obj.rotateX = x); (0, _type.isDefined)(y) && (obj.rotateY = y); if (!animate) { this.attr(obj) } else { this.animate(obj, animOptions) } return this }, _getElementBBox: function() { var elem = this.element; var bBox; try { bBox = elem.getBBox && elem.getBBox() } catch (e) {} return bBox || { x: 0, y: 0, width: elem.offsetWidth || 0, height: elem.offsetHeight || 0 } }, getBBox: function() { var transformation = this._settings; var bBox = this._getElementBBox(); if (transformation.rotate) { bBox = (0, _utils.rotateBBox)(bBox, [("rotateX" in transformation ? transformation.rotateX : transformation.x) || 0, ("rotateY" in transformation ? transformation.rotateY : transformation.y) || 0], -transformation.rotate) } else { bBox = (0, _utils.normalizeBBox)(bBox) } return bBox }, markup: function() { return (0, _svg.getSvgMarkup)(this.element) }, getOffset: function() { return this._getJQElement().offset() }, stopAnimation: function(disableComplete) { var animation = this.animation; animation && animation.stop(disableComplete); return this }, setTitle: function(text) { var titleElem = createElement("title"); titleElem.textContent = text || ""; this.element.appendChild(titleElem) }, data: function(obj, val) { var elem = this.element; var key; if (void 0 !== val) { elem[obj] = val } else { for (key in obj) { elem[key] = obj[key] } } return this }, on: function() { var args = [this._getJQElement()]; args.push.apply(args, arguments); _events_engine2.default.on.apply(_events_engine2.default, args); return this }, off: function() { var args = [this._getJQElement()]; args.push.apply(args, arguments); _events_engine2.default.off.apply(_events_engine2.default, args); return this }, trigger: function() { var args = [this._getJQElement()]; args.push.apply(args, arguments); _events_engine2.default.trigger.apply(_events_engine2.default, args); return this } }; function PathSvgElement(renderer, type) { SvgElement.call(this, renderer, "path", type) } exports.PathSvgElement = PathSvgElement; PathSvgElement.prototype = objectCreate(SvgElement.prototype); extend(PathSvgElement.prototype, { constructor: PathSvgElement, attr: pathAttr, animate: pathAnimate }); function ArcSvgElement(renderer) { SvgElement.call(this, renderer, "path", "arc") } exports.ArcSvgElement = ArcSvgElement; ArcSvgElement.prototype = objectCreate(SvgElement.prototype); extend(ArcSvgElement.prototype, { constructor: ArcSvgElement, attr: arcAttr, animate: arcAnimate }); function RectSvgElement(renderer) { SvgElement.call(this, renderer, "rect") } exports.RectSvgElement = RectSvgElement; RectSvgElement.prototype = objectCreate(SvgElement.prototype); extend(RectSvgElement.prototype, { constructor: RectSvgElement, attr: rectAttr }); function TextSvgElement(renderer) { SvgElement.call(this, renderer, "text"); this.css({ "white-space": "pre" }) } exports.TextSvgElement = TextSvgElement; TextSvgElement.prototype = objectCreate(SvgElement.prototype); extend(TextSvgElement.prototype, { constructor: TextSvgElement, attr: textAttr, css: textCss, applyEllipsis: applyEllipsis, setMaxSize: setMaxSize, restoreText: restoreText, _getLineHeight: function() { return !isNaN(parseFloat(this._styles[KEY_FONT_SIZE])) ? this._styles[KEY_FONT_SIZE] : DEFAULT_FONT_SIZE } }); function updateIndexes(items, k) { var i; var item; for (i = k; item = items[i]; ++i) { item._link.i = i } } function linkItem(target, container) { var items = container._links; var key = target._link.after = target._link.after || container._linkAfter; var i; var item; if (key) { for (i = 0; (item = items[i]) && item._link.name !== key; ++i) {} if (item) { for (++i; (item = items[i]) && item._link.after === key; ++i) {} } } else { i = items.length } items.splice(i, 0, target); updateIndexes(items, i) } function unlinkItem(target) { var i; var items = target._link.to._links; for (i = 0; items[i] !== target; ++i) {} items.splice(i, 1); updateIndexes(items, i) } function Renderer(options) { var that = this; that.root = that._createElement("svg", { xmlns: "http://www.w3.org/2000/svg", version: "1.1", fill: NONE, stroke: NONE, "stroke-width": 0 }).attr({ "class": options.cssClass }).css({ "line-height": "normal", "-ms-user-select": NONE, "-moz-user-select": NONE, "-webkit-user-select": NONE, "-webkit-tap-highlight-color": "rgba(0, 0, 0, 0)", display: "block", overflow: "hidden" }); that._init(); that.pathModified = !!options.pathModified; that._$container = (0, _renderer2.default)(options.container); that.root.append({ element: options.container }); that.fixPlacement(); that._locker = 0; that._backed = false } exports.Renderer = Renderer; Renderer.prototype = { constructor: Renderer, _init: function() { var that = this; that._defs = that._createElement("defs").append(that.root); that._animationController = new _animation2.default.AnimationController(that.root.element); that._animation = { enabled: true, duration: 1e3, easing: "easeOutCubic" } }, fixPlacement: function() { if (!_browser2.default.mozilla && !_browser2.default.msie) { return } var box = getBoundingClientRect(this._$container.get(0)); var dx = roundValue(box.left % 1, 2); var dy = roundValue(box.top % 1, 2); if (_browser2.default.msie) { this.root.css({ transform: "translate(" + -dx + "px," + -dy + "px)" }) } else { if (_browser2.default.mozilla) { this.root.move(-dx, -dy) } } }, removePlacementFix: function() { if (!_browser2.default.mozilla && !_browser2.default.msie) { return } if (_browser2.default.msie) { this.root.css({ transform: "" }) } else { if (_browser2.default.mozilla) { this.root.attr({ transform: null }) } } }, setOptions: function(options) { var that = this; that.rtl = !!options.rtl; that.encodeHtml = !!options.encodeHtml; that.updateAnimationOptions(options.animation || {}); that.root.attr({ direction: that.rtl ? "rtl" : "ltr" }); return that }, _createElement: function(tagName, attr, type) { var elem = new exports.SvgElement(this, tagName, type); attr && elem.attr(attr); return elem }, lock: function() { var that = this; if (0 === that._locker) { that._backed = !that._$container.is(":visible"); if (that._backed) { backupRoot(that.root) } }++that._locker; return that }, unlock: function() { var that = this; --that._locker; if (0 === that._locker) { if (that._backed) { restoreRoot(that.root, that._$container[0]); that.fixPlacement() } that._backed = false } return that }, resize: function(width, height) { if (width >= 0 && height >= 0) { this.root.attr({ width: width, height: height }) } return this }, dispose: function() { var that = this; var key; that.root.dispose(); that._defs.dispose(); that._animationController.dispose(); fixFuncIriCallbacks.removeByRenderer(that); for (key in that) { that[key] = null } return that }, animationEnabled: function() { return !!this._animation.enabled }, updateAnimationOptions: function(newOptions) { extend(this._animation, newOptions); return this }, stopAllAnimations: function(lock) { this._animationController[lock ? "lock" : "stop"](); return this }, animateElement: function(element, params, options) { this._animationController.animateElement(element, params, options); return this }, svg: function() { this.removePlacementFix(); var markup = this.root.markup(); this.fixPlacement(); return markup }, getRootOffset: function() { return this.root.getOffset() }, onEndAnimation: function(endAnimation) { this._animationController.onEndAnimation(endAnimation) }, rect: function(x, y, width, height) { var elem = new exports.RectSvgElement(this); return elem.attr({ x: x || 0, y: y || 0, width: width || 0, height: height || 0 }) }, simpleRect: function() { return this._createElement("rect") }, circle: function(x, y, r) { return this._createElement("circle", { cx: x || 0, cy: y || 0, r: r || 0 }) }, g: function() { return this._createElement("g") }, image: function image(x, y, w, h, href, location) { var image = this._createElement("image", { x: x || 0, y: y || 0, width: w || 0, height: h || 0, preserveAspectRatio: preserveAspectRatioMap[(0, _utils.normalizeEnum)(location)] || NONE }); image.element.setAttributeNS("http://www.w3.org/1999/xlink", "href", href || ""); return image }, path: function(points, type) { var elem = new exports.PathSvgElement(this, type); return elem.attr({ points: points || [] }) }, arc: function(x, y, innerRadius, outerRadius, startAngle, endAngle) { var elem = new exports.ArcSvgElement(this); return elem.attr({ x: x || 0, y: y || 0, innerRadius: innerRadius || 0, outerRadius: outerRadius || 0, startAngle: startAngle || 0, endAngle: endAngle || 0 }) }, text: function(_text, x, y) { var elem = new exports.TextSvgElement(this); return elem.attr({ text: _text, x: x || 0, y: y || 0 }) }, linearGradient: function(stops) { var id = getNextDefsSvgId(); var that = this; var gradient = that._createElement("linearGradient", { id: id }).append(that._defs); gradient.id = id; stops.forEach(function(stop) { that._createElement("stop", { offset: stop.offset, "stop-color": stop["stop-color"] }).append(gradient) }); return gradient }, pattern: function pattern(color, hatching, _id) { hatching = hatching || {}; var that = this; var step = hatching.step || 6; var stepTo2 = step / 2; var stepBy15 = 1.5 * step; var id = _id || getNextDefsSvgId(); var d = "right" === (0, _utils.normalizeEnum)(hatching.direction) ? "M " + stepTo2 + " " + -stepTo2 + " L " + -stepTo2 + " " + stepTo2 + " M 0 " + step + " L " + step + " 0 M " + stepBy15 + " " + stepTo2 + " L " + stepTo2 + " " + stepBy15 : "M 0 0 L " + step + " " + step + " M " + -stepTo2 + " " + stepTo2 + " L " + stepTo2 + " " + stepBy15 + " M " + stepTo2 + " " + -stepTo2 + " L " + stepBy15 + " " + stepTo2; var pattern = that._createElement("pattern", { id: id, width: step, height: step, patternUnits: "userSpaceOnUse" }).append(that._defs); pattern.id = id; var rect = that.rect(0, 0, step, step).attr({ fill: color, opacity: hatching.opacity }).append(pattern); var path = new exports.PathSvgElement(this).attr({ d: d, "stroke-width": hatching.width || 1, stroke: color }).append(pattern); pattern.rect = rect; pattern.path = path; return pattern }, _getPointsWithYOffset: function(points, offset) { return points.map(function(point, index) { if (index % 2 !== 0) { return point + offset } return point }) }, clipRect: function(x, y, width, height) { var that = this; var id = getNextDefsSvgId(); var clipPath = that._createElement("clipPath", { id: id }).append(that._defs); var rect = that.rect(x, y, width, height).append(clipPath); rect.id = id; rect.clipPath = clipPath; rect.remove = function() { throw "Not implemented" }; rect.dispose = function() { clipPath.dispose(); clipPath = null; return this }; return rect }, shadowFilter: function(x, y, width, height, offsetX, offsetY, blur, color, opacity) { var that = this; var id = getNextDefsSvgId(); var filter = that._createElement("filter", { id: id, x: x || 0, y: y || 0, width: width || 0, height: height || 0 }).append(that._defs); var gaussianBlur = that._createElement("feGaussianBlur", { "in": "SourceGraphic", result: "gaussianBlurResult", stdDeviation: blur || 0 }).append(filter); var offset = that._createElement("feOffset", { "in": "gaussianBlurResult", result: "offsetResult", dx: offsetX || 0, dy: offsetY || 0 }).append(filter); var flood = that._createElement("feFlood", { result: "floodResult", "flood-color": color || "", "flood-opacity": opacity }).append(filter); var composite = that._createElement("feComposite", { "in": "floodResult", in2: "offsetResult", operator: "in", result: "compositeResult" }).append(filter); var finalComposite = that._createElement("feComposite", { "in": "SourceGraphic", in2: "compositeResult", operator: "over" }).append(filter); filter.id = id; filter.gaussianBlur = gaussianBlur; filter.offset = offset; filter.flood = flood; filter.composite = composite; filter.finalComposite = finalComposite; filter.attr = function(attrs) { var that = this; var filterAttrs = {}; var offsetAttrs = {}; var floodAttrs = {}; "x" in attrs && (filterAttrs.x = attrs.x); "y" in attrs && (filterAttrs.y = attrs.y); "width" in attrs && (filterAttrs.width = attrs.width); "height" in attrs && (filterAttrs.height = attrs.height); baseAttr(that, filterAttrs); "blur" in attrs && that.gaussianBlur.attr({ stdDeviation: attrs.blur }); "offsetX" in attrs && (offsetAttrs.dx = attrs.offsetX); "offsetY" in attrs && (offsetAttrs.dy = attrs.offsetY); that.offset.attr(offsetAttrs); "color" in attrs && (floodAttrs["flood-color"] = attrs.color); "opacity" in attrs && (floodAttrs["flood-opacity"] = attrs.opacity); that.flood.attr(floodAttrs); return that }; return filter }, brightFilter: function(type, slope) { var that = this; var id = getNextDefsSvgId(); var filter = that._createElement("filter", { id: id }).append(that._defs); var componentTransferElement = that._createElement("feComponentTransfer").append(filter); var attrs = { type: type, slope: slope }; filter.id = id; that._createElement("feFuncR", attrs).append(componentTransferElement); that._createElement("feFuncG", attrs).append(componentTransferElement); that._createElement("feFuncB", attrs).append(componentTransferElement); return filter }, getGrayScaleFilter: function() { if (this._grayScaleFilter) { return this._grayScaleFilter } var that = this; var id = getNextDefsSvgId(); var filter = that._createElement("filter", { id: id }).append(that._defs); that._createElement("feColorMatrix").attr({ type: "matrix", values: "0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 0.6 0" }).append(filter); filter.id = id; that._grayScaleFilter = filter; return filter }, initHatching: function() { var storage = this._hatchingStorage = this._hatchingStorage || { byHash: {}, baseId: getNextDefsSvgId() }; var byHash = storage.byHash; var name; for (name in byHash) { byHash[name].pattern.dispose() } storage.byHash = {}; storage.refToHash = {}; storage.nextId = 0 }, lockHatching: function(color, hatching, ref) { var storage = this._hatchingStorage; var hash = getHatchingHash(color, hatching); var storageItem; var pattern; if (storage.refToHash[ref] !== hash) { if (ref) { this.releaseHatching(ref) } storageItem = storage.byHash[hash]; if (!storageItem) { pattern = this.pattern(color, hatching, storage.baseId + "-hatching-" + storage.nextId++); storageItem = storage.byHash[hash] = { pattern: pattern, count: 0 }; storage.refToHash[pattern.id] = hash }++storageItem.count; ref = storageItem.pattern.id } return ref }, releaseHatching: function(ref) { var storage = this._hatchingStorage; var hash = storage.refToHash[ref]; var storageItem = storage.byHash[hash]; if (storageItem && 0 === --storageItem.count) { storageItem.pattern.dispose(); delete storage.byHash[hash]; delete storage.refToHash[ref] } } }; function getHatchingHash(color, hatching) { return "@" + color + "::" + hatching.step + ":" + hatching.width + ":" + hatching.opacity + ":" + hatching.direction } var fixFuncIriCallbacks = function() { var callbacks = []; return { add: function(fn) { callbacks.push(fn) }, remove: function(fn) { callbacks = callbacks.filter(function(el) { return el !== fn }) }, removeByRenderer: function(renderer) { callbacks = callbacks.filter(function(el) { return el.renderer !== renderer }) }, fire: function() { callbacks.forEach(function(fn) { fn() }) } } }(); exports.refreshPaths = function() { fixFuncIriCallbacks.fire() } }, /*!*********************************************************!*\ !*** ./artifacts/transpiled/core/polyfills/weak_map.js ***! \*********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray; var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7); var weakMap = windowUtils.hasWindow() ? windowUtils.getWindow().WeakMap : WeakMap; if (!weakMap) { weakMap = function() { var keys = []; var values = []; this.set = function(key, value) { var index = inArray(key, keys); if (index === -1) { keys.push(key); values.push(value) } else { values[index] = value } }; this.get = function(key) { var index = inArray(key, keys); if (index === -1) { return } return values[index] }; this.has = function(key) { var index = inArray(key, keys); if (index === -1) { return false } return true }; this.delete = function(key) { var index = inArray(key, keys); if (index === -1) { return } keys.splice(index, 1); values.splice(index, 1) } } } module.exports = weakMap }, /*!**********************************************************!*\ !*** ./artifacts/transpiled/core/memorized_callbacks.js ***! \**********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each; var Callbacks = __webpack_require__( /*! ./utils/callbacks */ 26); 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 }, /*!*****************************************************************!*\ !*** ./artifacts/transpiled/exporter/excel_format_converter.js ***! \*****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _string = __webpack_require__( /*! ../core/utils/string */ 44); var _string2 = _interopRequireDefault(_string); var _number = __webpack_require__( /*! ../localization/number */ 51); var _number2 = _interopRequireDefault(_number); var _date = __webpack_require__( /*! ../localization/date */ 32); var _date2 = _interopRequireDefault(_date); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _date3 = __webpack_require__( /*! ../localization/ldml/date.format */ 208); var _language_codes = __webpack_require__( /*! ../localization/language_codes */ 279); __webpack_require__( /*! ../localization/currency */ 152); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var ARABIC_ZERO_CODE = 1632; var 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: " " }; var PERIOD_REGEXP = /a+/g; var DAY_REGEXP = /E/g; var DO_REGEXP = /dE+/g; var STANDALONE_MONTH_REGEXP = /L/g; var HOUR_REGEXP = /h/g; var SLASH_REGEXP = /\//g; var SQUARE_OPEN_BRACKET_REGEXP = /\[/g; var SQUARE_CLOSE_BRACKET_REGEXP = /]/g; var ANY_REGEXP = /./g; var excelFormatConverter = module.exports = { _applyPrecision: function(format, precision) { var result; var i; if (precision > 0) { result = "decimal" !== format ? "." : ""; for (i = 0; i < precision; i++) { result += "0" } return result } return "" }, _hasArabicDigits: function(text) { var code; for (var i = 0; i < text.length; i++) { code = text.charCodeAt(i); if (code >= ARABIC_ZERO_CODE && code < ARABIC_ZERO_CODE + 10) { return true } } return false }, _convertDateFormatToOpenXml: function(format) { return format.replace(SLASH_REGEXP, "\\/").split("'").map(function(datePart, index) { if (index % 2 === 0) { return datePart.replace(PERIOD_REGEXP, "AM/PM").replace(DO_REGEXP, "d").replace(DAY_REGEXP, "d").replace(STANDALONE_MONTH_REGEXP, "M").replace(HOUR_REGEXP, "H").replace(SQUARE_OPEN_BRACKET_REGEXP, "\\[").replace(SQUARE_CLOSE_BRACKET_REGEXP, "\\]") } if (datePart) { return datePart.replace(ANY_REGEXP, "\\$&") } return "'" }).join("") }, _convertDateFormat: function(format) { var formattedValue = (_date2.default.format(new Date(2009, 8, 8, 6, 5, 4), format) || "").toString(); var result = (0, _date3.getFormat)(function(value) { return _date2.default.format(value, format) }); if (result) { result = this._convertDateFormatToOpenXml(result); result = this._getLanguageInfo(formattedValue) + result } return result }, _getLanguageInfo: function(defaultPattern) { var languageID = (0, _language_codes.getLanguageId)(); var languageIDStr = languageID ? languageID.toString(16) : ""; var languageInfo = ""; if (this._hasArabicDigits(defaultPattern)) { while (languageIDStr.length < 3) { languageIDStr = "0" + languageIDStr } languageInfo = "[$-2010" + languageIDStr + "]" } else { if (languageIDStr) { languageInfo = "[$-" + languageIDStr + "]" } } return languageInfo }, _convertNumberFormat: function(format, precision, currency) { var result; var excelFormat; if ("currency" === format) { excelFormat = _number2.default.getOpenXmlCurrencyFormat(currency) } else { excelFormat = DEFINED_NUMBER_FORMTATS[format.toLowerCase()] } if (excelFormat) { result = _string2.default.format(excelFormat, this._applyPrecision(format, precision)) } return result }, convertFormat: function(format, precision, type, currency) { if ((0, _type.isDefined)(format)) { if ("date" === type) { return excelFormatConverter._convertDateFormat(format) } else { if ((0, _type.isString)(format) && DEFINED_NUMBER_FORMTATS[format.toLowerCase()]) { return excelFormatConverter._convertNumberFormat(format, precision, currency) } } } } } }, /*!***********************************************************!*\ !*** ./artifacts/transpiled/animation/presets/presets.js ***! \***********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Component = __webpack_require__( /*! ../../core/component */ 133); var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var devices = __webpack_require__( /*! ../../core/devices */ 16); var fx = __webpack_require__( /*! ../fx */ 38); 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._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; var direction = configModifier.direction; var 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; var direction = configModifier.direction; var 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; var 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; var 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; var baseConfig = { type: "css", extraCssClasses: "dx-win-pop-animation", duration: that.option("defaultAnimationDuration") }; return { enter: function($element, configModifier) { var config = baseConfig; var 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; var 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; var 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; var customRules = []; each(this._registeredPresets, function(index, preset) { var rule = { device: preset.config.device, options: {} }; rule.options[that._getPresetOptionName(preset.name)] = preset.config.animation; customRules.push(rule) }); this._setOptionsByDevice(customRules) }, 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 }, /*!************************************************************!*\ !*** ./artifacts/transpiled/integration/angular/module.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var angular = __webpack_require__( /*! angular */ 270); module.exports = angular.module("dx", []) }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/data/query_adapters.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = {} }, /*!****************************************************************************************!*\ !*** ./artifacts/transpiled/ui/collection/ui.collection_widget.edit.strategy.plain.js ***! \****************************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray; var EditStrategy = __webpack_require__( /*! ./ui.collection_widget.edit.strategy */ 469); var PlainEditStrategy = EditStrategy.inherit({ _getPlainItems: function() { return this._collectionWidget.option("items") || [] }, getIndexByItemData: function(itemData) { var keyOf = this._collectionWidget.keyOf.bind(this._collectionWidget); if (keyOf) { return this.getIndexByKey(keyOf(itemData)) } else { return inArray(itemData, this._getPlainItems()) } }, getItemDataByIndex: function(index) { return this._getPlainItems()[index] }, deleteItemAtIndex: function(index) { this._getPlainItems().splice(index, 1) }, itemsGetter: function() { return this._getPlainItems() }, getKeysByItems: function(items) { var keyOf = this._collectionWidget.keyOf.bind(this._collectionWidget); var result = items; if (keyOf) { result = []; for (var i = 0; i < items.length; i++) { result.push(keyOf(items[i])) } } return result }, getIndexByKey: function(key) { var cache = this._cache; var keys = cache && cache.keys || this.getKeysByItems(this._getPlainItems()); if (cache && !cache.keys) { cache.keys = keys } if ("object" === _typeof(key)) { for (var i = 0, length = keys.length; i < length; i++) { if (this._equalKeys(key, keys[i])) { return i } } } else { return keys.indexOf(key) } return -1 }, getItemsByKeys: function(keys, items) { return (items || keys).slice() }, moveItemAtIndexToIndex: function(movingIndex, destinationIndex) { var items = this._getPlainItems(); var 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 }, /*!***************************************************************!*\ !*** ./artifacts/transpiled/localization/globalize/number.js ***! \***************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } __webpack_require__( /*! ./core */ 127); var Globalize = __webpack_require__( /*! globalize */ 72); var numberLocalization = __webpack_require__( /*! ../number */ 51); var errors = __webpack_require__( /*! ../../core/errors */ 21); __webpack_require__( /*! globalize/number */ 72); if (Globalize && Globalize.formatNumber) { 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: "\xd7", perMille: "\u2030", infinity: "\u221e", 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: "\xa0" }, afterCurrency: { currencyMatch: "[:^S:]", surroundingMatch: "[:digit:]", insertBetween: "\xa0" } }, standard: "\xa4#,##0.00", accounting: "\xa4#,##0.00;(\xa4#,##0.00)", "short": { standard: { "1000-count-one": "\xa40K", "1000-count-other": "\xa40K", "10000-count-one": "\xa400K", "10000-count-other": "\xa400K", "100000-count-one": "\xa4000K", "100000-count-other": "\xa4000K", "1000000-count-one": "\xa40M", "1000000-count-other": "\xa40M", "10000000-count-one": "\xa400M", "10000000-count-other": "\xa400M", "100000000-count-one": "\xa4000M", "100000000-count-other": "\xa4000M", "1000000000-count-one": "\xa40B", "1000000000-count-other": "\xa40B", "10000000000-count-one": "\xa400B", "10000000000-count-other": "\xa400B", "100000000000-count-one": "\xa4000B", "100000000000-count-other": "\xa4000B", "1000000000000-count-one": "\xa40T", "1000000000000-count-other": "\xa40T", "10000000000000-count-one": "\xa400T", "10000000000000-count-other": "\xa400T", "100000000000000-count-one": "\xa4000T", "100000000000000-count-other": "\xa4000T" } }, "unitPattern-count-one": "{0} {1}", "unitPattern-count-other": "{0} {1}" }, "miscPatterns-numberSystem-latn": { atLeast: "{0}+", range: "{0}\u2013{1}" } } } } }; if ("en" === Globalize.locale().locale) { Globalize.load(enNumbers); Globalize.locale("en") } var formattersCache = {}; var getFormatter = function(format) { var formatter; var 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, minimumFractionDigits: 0, maximumFractionDigits: 20, round: value < 0 ? "ceil" : "floor" } } else { config = this._getPrecisionConfig(formatConfig.precision) } if ("percent" === format) { config.style = "percent" } return config }, _getPrecisionConfig: function(precision) { var config; if (null === precision) { config = { minimumFractionDigits: 0, maximumFractionDigits: 20 } } else { config = { minimumFractionDigits: precision || 0, maximumFractionDigits: precision || 0 } } 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 || "string" === typeof format)) { return this.callBase.apply(this, arguments) } if (format) { errors.log("W0011") } var result = Globalize.parseNumber(text); if (isNaN(result)) { result = this.callBase.apply(this, arguments) } return result } }; numberLocalization.inject(globalizeNumberLocalization) } }, /*!*********************************************************************************!*\ !*** ./artifacts/transpiled/ui/text_box/texteditor_button_collection/button.js ***! \*********************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _renderer = __webpack_require__( /*! ../../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true } Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) { _defineProperties(Constructor.prototype, protoProps) } if (staticProps) { _defineProperties(Constructor, staticProps) } Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor } var TextEditorButton = function() { function TextEditorButton(name, editor, options) { _classCallCheck(this, TextEditorButton); this.instance = null; this.$container = null; this.$placeMarker = null; this.editor = editor; this.name = name; this.options = options || {} } _createClass(TextEditorButton, [{ key: "_addPlaceMarker", value: function($container) { this.$placeMarker = (0, _renderer2.default)("
").appendTo($container) } }, { key: "_addToContainer", value: function($element) { var $placeMarker = this.$placeMarker, $container = this.$container; $placeMarker ? $placeMarker.replaceWith($element) : $element.appendTo($container) } }, { key: "_attachEvents", value: function() { throw "Not implemented" } }, { key: "_create", value: function() { throw "Not implemented" } }, { key: "_isRendered", value: function() { return !!this.instance } }, { key: "_isVisible", value: function() { var editor = this.editor, options = this.options; return options.visible || !editor.option("readOnly") } }, { key: "_isDisabled", value: function() { throw "Not implemented" } }, { key: "_shouldRender", value: function() { return this._isVisible() && !this._isRendered() } }, { key: "dispose", value: function() { var instance = this.instance, $placeMarker = this.$placeMarker; if (instance) { instance.dispose ? instance.dispose() : instance.remove(); this.instance = null } $placeMarker && $placeMarker.remove() } }, { key: "render", value: function() { var $container = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.$container; this.$container = $container; if (this._isVisible()) { var _this$_create = this._create(), instance = _this$_create.instance, $element = _this$_create.$element; this.instance = instance; this._attachEvents(instance, $element) } else { this._addPlaceMarker($container) } } }, { key: "update", value: function() { if (this._shouldRender()) { this.render() } return !!this.instance } }]); return TextEditorButton }(); exports.default = TextEditorButton }, /*!*********************************************************************!*\ !*** ./artifacts/transpiled/ui/scroll_view/ui.scrollable.native.js ***! \*********************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _utils = __webpack_require__( /*! ../../events/utils */ 8); var _utils2 = _interopRequireDefault(_utils); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var _devices = __webpack_require__( /*! ../../core/devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _class = __webpack_require__( /*! ../../core/class */ 15); var _class2 = _interopRequireDefault(_class); var _ui = __webpack_require__( /*! ./ui.scrollbar */ 299); var _ui2 = _interopRequireDefault(_ui); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var SCROLLABLE_NATIVE = "dxNativeScrollable"; var SCROLLABLE_NATIVE_CLASS = "dx-scrollable-native"; var SCROLLABLE_SCROLLBAR_SIMULATED = "dx-scrollable-scrollbar-simulated"; var SCROLLABLE_SCROLLBARS_HIDDEN = "dx-scrollable-scrollbars-hidden"; var VERTICAL = "vertical"; var HORIZONTAL = "horizontal"; var HIDE_SCROLLBAR_TIMEOUT = 500; var NativeStrategy = _class2.default.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 = scrollable.option.bind(scrollable); this._createActionByOption = scrollable._createActionByOption.bind(scrollable); this._isLocked = scrollable._isLocked.bind(scrollable); this._isDirection = scrollable._isDirection.bind(scrollable); this._allowedDirection = scrollable._allowedDirection.bind(scrollable) }, render: function() { this._renderPushBackOffset(); var device = _devices2.default.real(); var 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() } }, updateBounds: _common.noop, _renderPushBackOffset: function() { var pushBackValue = this.option("pushBackValue"); if (!pushBackValue && !this._component._lastPushBackValue) { return } this._$content.css({ paddingTop: pushBackValue, paddingBottom: pushBackValue }); this._component._lastPushBackValue = pushBackValue }, _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 _ui2.default((0, _renderer2.default)("
").appendTo(this._$element), { direction: direction, expandable: this._component.option("scrollByThumb") }) }, handleInit: _common.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 }, handleCancel: _common.noop, handleStop: _common.noop, _eachScrollbar: function(callback) { callback = callback.bind(this); (0, _iterator.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(); var containerElement = this._$container.get(0); return { event: this._eventForUserAction, scrollOffset: { top: -location.top, left: -location.left }, reachedLeft: this._isDirection(HORIZONTAL) ? location.left >= 0 : void 0, reachedRight: this._isDirection(HORIZONTAL) ? Math.abs(location.left) >= containerElement.scrollWidth - containerElement.clientWidth : void 0, reachedTop: this._isDirection(VERTICAL) ? location.top >= 0 : void 0, reachedBottom: this._isDirection(VERTICAL) ? Math.abs(location.top) >= containerElement.scrollHeight - containerElement.clientHeight - 2 * this.option("pushBackValue") : 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; var scrollTopPos = this._$container.scrollTop(); var 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(); var lastLocation = this._lastLocation || {}; var isTopChanged = lastLocation.top !== currentLocation.top; var 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(function() { this._eachScrollbar(function(scrollbar) { scrollbar.option("visible", false) }) }.bind(this), HIDE_SCROLLBAR_TIMEOUT) }, location: function() { return { left: -this._$container.scrollLeft(), top: this.option("pushBackValue") - this._$container.scrollTop() } }, disabledChanged: _common.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() { var className = this._$element.get(0).className; var scrollableNativeRegexp = new RegExp(SCROLLABLE_NATIVE_CLASS + "\\S*", "g"); if (scrollableNativeRegexp.test(className)) { this._$element.removeClass(className.match(scrollableNativeRegexp).join(" ")) } _events_engine2.default.off(this._$element, "." + SCROLLABLE_NATIVE); _events_engine2.default.off(this._$container, "." + SCROLLABLE_NATIVE); this._removeScrollbars(); clearTimeout(this._hideScrollbarTimeout) }, _removeScrollbars: function() { this._eachScrollbar(function(scrollbar) { scrollbar.$element().remove() }) }, scrollBy: function(distance) { var location = this.location(); this._$container.scrollTop(Math.round(-location.top - distance.top + this.option("pushBackValue"))); this._$container.scrollLeft(Math.round(-location.left - distance.left)) }, validate: function(e) { if (this.option("disabled")) { return false } if (_utils2.default.isDxMouseWheelEvent(e) && this._isScrolledInMaxDirection(e)) { return false } return !!this._allowedDirection() }, _isScrolledInMaxDirection: function(e) { var container = this._$container.get(0); var result; if (e.delta > 0) { result = e.shiftKey ? !container.scrollLeft : !container.scrollTop } else { if (e.shiftKey) { result = container.clientWidth + container.scrollLeft >= container.scrollWidth } else { result = container.clientHeight + container.scrollTop >= container.scrollHeight } } return result }, getDirection: function() { return this._allowedDirection() }, verticalOffset: function() { return this.option("pushBackValue") } }); module.exports = NativeStrategy }, /*!***********************************************!*\ !*** ./artifacts/transpiled/ui/load_panel.js ***! \***********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var noop = __webpack_require__( /*! ../core/utils/common */ 4).noop; var messageLocalization = __webpack_require__( /*! ../localization/message */ 13); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var LoadIndicator = __webpack_require__( /*! ./load_indicator */ 90); var Overlay = __webpack_require__( /*! ./overlay */ 59); var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred; var themes = __webpack_require__( /*! ./themes */ 30); var LOADPANEL_CLASS = "dx-loadpanel"; var LOADPANEL_WRAPPER_CLASS = "dx-loadpanel-wrapper"; var LOADPANEL_INDICATOR_CLASS = "dx-loadpanel-indicator"; var LOADPANEL_MESSAGE_CLASS = "dx-loadpanel-message"; var LOADPANEL_CONTENT_CLASS = "dx-loadpanel-content"; var LOADPANEL_CONTENT_WRAPPER_CLASS = "dx-loadpanel-content-wrapper"; var LOADPANEL_PANE_HIDDEN_CLASS = "dx-loadpanel-pane-hidden"; var LoadPanel = Overlay.inherit({ _supportedKeys: function() { return extend(this.callBase(), { escape: noop }) }, _getDefaultOptions: function() { return extend(this.callBase(), { message: messageLocalization.format("Loading"), width: 222, height: 90, animation: null, showIndicator: true, indicatorSrc: "", showPane: true, delay: 0, closeOnBackButton: false, resizeEnabled: false, focusStateEnabled: false }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: { platform: "generic" }, options: { shadingColor: "transparent" } }, { device: function() { return themes.isMaterial() }, options: { message: "", width: 60, height: 60, maxHeight: 60, maxWidth: 60 } }]) }, _init: function() { this.callBase.apply(this, arguments) }, _initOptions: function() { this.callBase.apply(this, arguments); this.option("templatesRenderAsynchronously", false) }, _render: function() { this.callBase(); this.$element().addClass(LOADPANEL_CLASS); this._wrapper().addClass(LOADPANEL_WRAPPER_CLASS) }, _renderContentImpl: function() { this.callBase(); this.$content().addClass(LOADPANEL_CONTENT_CLASS); this._$contentWrapper = $("
").addClass(LOADPANEL_CONTENT_WRAPPER_CLASS); this._$contentWrapper.appendTo(this._$content); this._togglePaneVisible(); this._cleanPreviousContent(); this._renderLoadIndicator(); this._renderMessage() }, _show: function() { var delay = this.option("delay"); if (!delay) { return this.callBase() } var deferred = new Deferred; var callBase = this.callBase.bind(this); this._clearShowTimeout(); this._showTimeout = setTimeout(function() { callBase().done(function() { deferred.resolve() }) }, delay); return deferred.promise() }, _hide: function() { this._clearShowTimeout(); return this.callBase() }, _clearShowTimeout: function() { clearTimeout(this._showTimeout) }, _renderMessage: function() { if (!this._$contentWrapper) { return } var message = this.option("message"); if (!message) { return } var $message = $("
").addClass(LOADPANEL_MESSAGE_CLASS).text(message); this._$contentWrapper.append($message) }, _renderLoadIndicator: function() { if (!this._$contentWrapper || !this.option("showIndicator")) { return } this._$indicator = $("
").addClass(LOADPANEL_INDICATOR_CLASS).appendTo(this._$contentWrapper); this._createComponent(this._$indicator, LoadIndicator, { indicatorSrc: this.option("indicatorSrc") }) }, _cleanPreviousContent: function() { this.$content().find("." + LOADPANEL_MESSAGE_CLASS).remove(); this.$content().find("." + LOADPANEL_INDICATOR_CLASS).remove() }, _togglePaneVisible: function() { this.$content().toggleClass(LOADPANEL_PANE_HIDDEN_CLASS, !this.option("showPane")) }, _optionChanged: function(args) { switch (args.name) { case "delay": break; case "message": case "showIndicator": this._cleanPreviousContent(); this._renderLoadIndicator(); this._renderMessage(); break; case "showPane": this._togglePaneVisible(); break; case "indicatorSrc": if (this._$indicator) { this._createComponent(this._$indicator, LoadIndicator, { indicatorSrc: this.option("indicatorSrc") }) } break; default: this.callBase(args) } }, _dispose: function() { this._clearShowTimeout(); this.callBase() } }); registerComponent("dxLoadPanel", LoadPanel); module.exports = LoadPanel }, /*!********************************************************************************!*\ !*** ./artifacts/transpiled/ui/collection/ui.collection_widget.live_update.js ***! \********************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _uiCollection_widget = __webpack_require__( /*! ./ui.collection_widget.edit */ 53); var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _array_utils = __webpack_require__( /*! ../../data/array_utils */ 135); var _array_utils2 = _interopRequireDefault(_array_utils); var _utils = __webpack_require__( /*! ../../data/utils */ 41); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); var _array_compare = __webpack_require__( /*! ../../core/utils/array_compare */ 302); var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }) } else { obj[key] = value } return obj } var PRIVATE_KEY_FIELD = "__dx_key__"; exports.default = _uiCollection_widget2.default.inherit({ _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { repaintChangesOnly: false }) }, ctor: function() { var _this = this; this.callBase.apply(this, arguments); this._customizeStoreLoadOptions = function(e) { var dataSource = _this._dataSource; if (dataSource && !dataSource.isLoaded()) { _this._correctionIndex = 0 } if (_this._correctionIndex && e.storeLoadOptions) { e.storeLoadOptions.skip += _this._correctionIndex } }, this._dataSource && this._dataSource.on("customizeStoreLoadOptions", this._customizeStoreLoadOptions) }, reload: function() { this._correctionIndex = 0 }, _init: function() { this.callBase(); this._refreshItemsCache(); this._correctionIndex = 0 }, _findItemElementByKey: function(key) { var _this2 = this; var result = (0, _renderer2.default)(); var keyExpr = this.key(); this.itemElements().each(function(_, item) { var $item = (0, _renderer2.default)(item); var itemData = _this2._getItemData($item); if (keyExpr ? (0, _utils.keysEqual)(keyExpr, _this2.keyOf(itemData), key) : _this2._isItemEquals(itemData, key)) { result = $item; return false } }); return result }, _dataSourceChangedHandler: function(newItems, e) { e && e.changes ? this._modifyByChanges(e.changes) : this.callBase(newItems, e) }, _isItemEquals: function(item1, item2) { if (item1 && item1[PRIVATE_KEY_FIELD]) { item1 = item1.data } try { return JSON.stringify(item1) === JSON.stringify(item2) } catch (e) { return item1 === item2 } }, _partialRefresh: function() { var _this3 = this; if (this.option("repaintChangesOnly")) { var keyOf = function(data) { if (data && void 0 !== data[PRIVATE_KEY_FIELD]) { return data[PRIVATE_KEY_FIELD] } return _this3.keyOf(data) }; var result = (0, _array_compare.findChanges)(this._itemsCache, this._editStrategy.itemsGetter(), keyOf, this._isItemEquals); if (result && this._itemsCache.length) { this._modifyByChanges(result, true); this._renderEmptyMessage(); return true } else { this._refreshItemsCache() } } return false }, _refreshItemsCache: function() { if (this.option("repaintChangesOnly")) { var items = this._editStrategy.itemsGetter(); try { this._itemsCache = (0, _extend.extend)(true, [], items); if (!this.key()) { this._itemsCache = this._itemsCache.map(function(itemCache, index) { var _ref; return _ref = {}, _defineProperty(_ref, PRIVATE_KEY_FIELD, items[index]), _defineProperty(_ref, "data", itemCache), _ref }) } } catch (e) { this._itemsCache = (0, _extend.extend)([], items) } } }, _dispose: function() { this._dataSource && this._dataSource.off("customizeStoreLoadOptions", this._customizeStoreLoadOptions); this.callBase() }, _updateByChange: function(keyInfo, items, change, isPartialRefresh) { var _this4 = this; if (isPartialRefresh) { this._renderItem(change.index, change.data, null, this._findItemElementByKey(change.key)) } else { var changedItem = items[_array_utils2.default.indexByKey(keyInfo, items, change.key)]; if (changedItem) { _array_utils2.default.update(keyInfo, items, change.key, change.data).done(function() { _this4._renderItem(items.indexOf(changedItem), changedItem, null, _this4._findItemElementByKey(change.key)) }) } } }, _insertByChange: function(keyInfo, items, change, isPartialRefresh) { var _this5 = this; (0, _deferred.when)(isPartialRefresh || _array_utils2.default.insert(keyInfo, items, change.data, change.index)).done(function() { _this5._beforeItemElementInserted(change); _this5._renderItem((0, _type.isDefined)(change.index) ? change.index : items.length, change.data); _this5._afterItemElementInserted(); _this5._correctionIndex++ }) }, _updateSelectionAfterRemoveByChange: function(removeIndex) { var selectedIndex = this.option("selectedIndex"); if (selectedIndex > removeIndex) { this.option("selectedIndex", selectedIndex - 1) } else { if (selectedIndex === removeIndex && 1 === this.option("selectedItems").length) { this.option("selectedItems", []) } else { this._normalizeSelectedItems() } } }, _beforeItemElementInserted: function(change) { var selectedIndex = this.option("selectedIndex"); if (change.index <= selectedIndex) { this.option("selectedIndex", selectedIndex + 1) } }, _afterItemElementInserted: _common.noop, _removeByChange: function(keyInfo, items, change, isPartialRefresh) { var _this6 = this; var index = isPartialRefresh ? change.index : _array_utils2.default.indexByKey(keyInfo, items, change.key); var removedItem = isPartialRefresh ? change.oldItem : items[index]; if (removedItem) { var $removedItemElement = this._findItemElementByKey(change.key); var deletedActionArgs = this._extendActionArgs($removedItemElement); this._waitDeletingPrepare($removedItemElement).done(function() { if (isPartialRefresh) { _this6._updateIndicesAfterIndex(index - 1); _this6._afterItemElementDeleted($removedItemElement, deletedActionArgs); _this6._updateSelectionAfterRemoveByChange(index) } else { _this6._deleteItemElementByIndex(index); _this6._afterItemElementDeleted($removedItemElement, deletedActionArgs) } }); this._correctionIndex-- } }, _modifyByChanges: function(changes, isPartialRefresh) { var _this7 = this; var items = this._editStrategy.itemsGetter(); var keyInfo = { key: this.key.bind(this), keyOf: this.keyOf.bind(this) }; var dataSource = this._dataSource; var paginate = dataSource && dataSource.paginate(); var group = dataSource && dataSource.group(); if (paginate || group) { changes = changes.filter(function(item) { return "insert" !== item.type || void 0 !== item.index }) } changes.forEach(function(change) { return _this7["_".concat(change.type, "ByChange")](keyInfo, items, change, isPartialRefresh) }); this._renderedItemsCount = items.length; this._refreshItemsCache(); this._fireContentReadyAction() }, _appendItemToContainer: function($container, $itemFrame, index) { var nextSiblingElement = $container.children(this._itemSelector()).get(index); (0, _dom_adapter.insertElement)($container.get(0), $itemFrame.get(0), nextSiblingElement) }, _optionChanged: function(args) { switch (args.name) { case "items": var isItemsUpdated = this._partialRefresh(args.value); if (!isItemsUpdated) { this.callBase(args) } break; case "dataSource": if (!this.option("repaintChangesOnly") || !args.value) { this.option("items", []) } this.callBase(args); break; case "repaintChangesOnly": break; default: this.callBase(args) } } }) }, /*!****************************************!*\ !*** ./artifacts/transpiled/ui/box.js ***! \****************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var _renderer = __webpack_require__( /*! ../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _common = __webpack_require__( /*! ../core/utils/common */ 4); var _window = __webpack_require__( /*! ../core/utils/window */ 7); var _window2 = _interopRequireDefault(_window); var _inflector = __webpack_require__( /*! ../core/utils/inflector */ 33); var _inflector2 = _interopRequireDefault(_inflector); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _style = __webpack_require__( /*! ../core/utils/style */ 85); var _style2 = _interopRequireDefault(_style); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _browser = __webpack_require__( /*! ../core/utils/browser */ 25); var _browser2 = _interopRequireDefault(_browser); var _item = __webpack_require__( /*! ./collection/item */ 126); var _item2 = _interopRequireDefault(_item); var _devices = __webpack_require__( /*! ../core/devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _uiCollection_widget = __webpack_require__( /*! ./collection/ui.collection_widget.edit */ 53); var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true } Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) { _defineProperties(Constructor.prototype, protoProps) } if (staticProps) { _defineProperties(Constructor, staticProps) } Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor } function _get() { if ("undefined" !== typeof Reflect && Reflect.get) { _get = Reflect.get.bind() } else { _get = function(target, property, receiver) { var base = _superPropBase(target, property); if (!base) { return } var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver) } return desc.value } } return _get.apply(this, arguments) } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (null === object) { break } } return object } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function") } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) { _setPrototypeOf(subClass, superClass) } } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, p) { o.__proto__ = p; return o }; return _setPrototypeOf(o, p) } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function() { var result, Super = _getPrototypeOf(Derived); if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget) } else { result = Super.apply(this, arguments) } return _possibleConstructorReturn(this, result) } } function _possibleConstructorReturn(self, call) { if (call && ("object" === _typeof(call) || "function" === typeof call)) { return call } else { if (void 0 !== call) { throw new TypeError("Derived constructors may only return object or undefined") } } return _assertThisInitialized(self) } function _assertThisInitialized(self) { if (void 0 === self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return self } function _isNativeReflectConstruct() { if ("undefined" === typeof Reflect || !Reflect.construct) { return false } if (Reflect.construct.sham) { return false } if ("function" === typeof Proxy) { return true } try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true } catch (e) { return false } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(o) { return o.__proto__ || Object.getPrototypeOf(o) }; return _getPrototypeOf(o) } var BOX_CLASS = "dx-box"; var BOX_SELECTOR = ".dx-box"; var BOX_ITEM_CLASS = "dx-box-item"; var BOX_ITEM_DATA_KEY = "dxBoxItemData"; 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 setFlexProp = function(element, prop, value) { value = _style2.default.normalizeStyleProp(prop, value); element.style[_style2.default.styleProp(prop)] = value; if (!_window2.default.hasWindow()) { if ("" === value || !(0, _type.isDefined)(value)) { return } var cssName = _inflector2.default.dasherize(prop); var styleExpr = cssName + ": " + value + ";"; if (!element.attributes.style) { element.setAttribute("style", styleExpr) } else { if (element.attributes.style.value.indexOf(styleExpr) < 0) { element.attributes.style.value += " " + styleExpr } } } }; var BOX_EVENTNAMESPACE = "dxBox"; var UPDATE_EVENT = "dxupdate." + BOX_EVENTNAMESPACE; var 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 BoxItem = function(_CollectionWidgetItem) { _inherits(BoxItem, _CollectionWidgetItem); var _super = _createSuper(BoxItem); function BoxItem() { _classCallCheck(this, BoxItem); return _super.apply(this, arguments) } _createClass(BoxItem, [{ key: "_renderVisible", value: function(value, oldValue) { _get(_getPrototypeOf(BoxItem.prototype), "_renderVisible", this).call(this, value); if ((0, _type.isDefined)(oldValue)) { this._options.fireItemStateChangedAction({ name: "visible", state: value, oldState: oldValue }) } } }]); return BoxItem }(_item2.default); var FlexLayoutStrategy = function() { function FlexLayoutStrategy($element, option) { _classCallCheck(this, FlexLayoutStrategy); this._$element = $element; this._option = option; this.initSize = _common.noop; this.update = _common.noop } _createClass(FlexLayoutStrategy, [{ key: "renderBox", value: function() { this._$element.css({ display: _style2.default.stylePropPrefix("flexDirection") + "flex" }); setFlexProp(this._$element.get(0), "flexDirection", FLEX_DIRECTION_MAP[this._option("direction")]) } }, { key: "renderAlign", value: function() { this._$element.css({ justifyContent: this._normalizedAlign() }) } }, { key: "_normalizedAlign", value: function() { var align = this._option("align"); return align in FLEX_JUSTIFY_CONTENT_MAP ? FLEX_JUSTIFY_CONTENT_MAP[align] : align } }, { key: "renderCrossAlign", value: function() { this._$element.css({ alignItems: this._normalizedCrossAlign() }) } }, { key: "_normalizedCrossAlign", value: function() { var crossAlign = this._option("crossAlign"); return crossAlign in FLEX_ALIGN_ITEMS_MAP ? FLEX_ALIGN_ITEMS_MAP[crossAlign] : crossAlign } }, { key: "renderItems", value: function($items) { var flexPropPrefix = _style2.default.stylePropPrefix("flexDirection"); var direction = this._option("direction"); (0, _iterator.each)($items, function() { var $item = (0, _renderer2.default)(this); var item = $item.data(BOX_ITEM_DATA_KEY); $item.css({ display: flexPropPrefix + "flex" }).css(MAXSIZE_MAP[direction], item.maxSize || "none").css(MINSIZE_MAP[direction], item.minSize || "0"); setFlexProp($item.get(0), "flexBasis", item.baseSize || 0); setFlexProp($item.get(0), "flexGrow", item.ratio); setFlexProp($item.get(0), "flexShrink", (0, _type.isDefined)(item.shrink) ? item.shrink : SHRINK); $item.children().each(function(_, itemContent) { (0, _renderer2.default)(itemContent).css({ width: "auto", height: "auto", display: _style2.default.stylePropPrefix("flexDirection") + "flex", flexBasis: 0 }); setFlexProp(itemContent, "flexGrow", 1); setFlexProp(itemContent, "flexDirection", (0, _renderer2.default)(itemContent)[0].style.flexDirection || "column") }) }) } }]); return FlexLayoutStrategy }(); var FallbackLayoutStrategy = function() { function FallbackLayoutStrategy($element, option) { _classCallCheck(this, FallbackLayoutStrategy); this._$element = $element; this._option = option } _createClass(FallbackLayoutStrategy, [{ key: "renderBox", value: function() { this._$element.css({ fontSize: 0, whiteSpace: FALLBACK_WRAP_MAP[this._option("direction")], verticalAlign: "top" }); _events_engine2.default.off(this._$element, UPDATE_EVENT); _events_engine2.default.on(this._$element, UPDATE_EVENT, this.update.bind(this)) } }, { key: "renderAlign", value: function() { var $items = this._$items; if (!$items) { return } var align = this._option("align"); var totalItemSize = this.totalItemSize; var direction = this._option("direction"); var boxSize = this._$element[FALLBACK_MAIN_SIZE_MAP[direction]](); var freeSpace = boxSize - totalItemSize; var shift = 0; 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) } } }, { key: "_setItemsMargins", value: function($items, direction, shift) { $items.css(this._chooseMarginSide(FALLBACK_PRE_MARGIN_MAP[direction]), shift).css(this._chooseMarginSide(FALLBACK_POST_MARGIN_MAP[direction]), shift) } }, { key: "renderCrossAlign", value: function() { var $items = this._$items; if (!$items) { return } var crossAlign = this._option("crossAlign"); var direction = this._option("direction"); var size = this._$element[FALLBACK_CROSS_SIZE_MAP[direction]](); var that = this; switch (crossAlign) { case "start": break; case "end": (0, _iterator.each)($items, function() { var $item = (0, _renderer2.default)(this); var itemSize = $item[FALLBACK_CROSS_SIZE_MAP[direction]](); var shift = size - itemSize; $item.css(that._chooseMarginSide(FALLBACK_CROSS_PRE_MARGIN_MAP[direction]), shift) }); break; case "center": (0, _iterator.each)($items, function() { var $item = (0, _renderer2.default)(this); var itemSize = $item[FALLBACK_CROSS_SIZE_MAP[direction]](); var 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%") } } }, { key: "_chooseMarginSide", value: function(value) { if (!this._option("rtlEnabled")) { return value } return MARGINS_RTL_FLIP_MAP[value] || value } }, { key: "renderItems", value: function($items) { var _this = this; this._$items = $items; var direction = this._option("direction"); var totalRatio = 0; var totalWeightedShrink = 0; var totalBaseSize = 0; (0, _iterator.each)($items, function(_, item) { var $item = (0, _renderer2.default)(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); var ratio = itemData.ratio || 0; var size = _this._baseSize($item); var shrink = (0, _type.isDefined)(itemData.shrink) ? itemData.shrink : SHRINK; totalRatio += ratio; totalWeightedShrink += shrink * size; totalBaseSize += size }); var freeSpaceSize = this._boxSize() - totalBaseSize; var itemSize = function($item) { var itemData = $item.data(BOX_ITEM_DATA_KEY); var size = _this._baseSize($item); var factor = freeSpaceSize >= 0 ? itemData.ratio || 0 : ((0, _type.isDefined)(itemData.shrink) ? itemData.shrink : SHRINK) * size; var totalFactor = freeSpaceSize >= 0 ? totalRatio : totalWeightedShrink; var shift = totalFactor ? Math.round(freeSpaceSize * factor / totalFactor) : 0; return size + shift }; var totalItemSize = 0; (0, _iterator.each)($items, function(_, item) { var $item = (0, _renderer2.default)(item); var itemData = (0, _renderer2.default)(item).data(BOX_ITEM_DATA_KEY); var 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 } }, { key: "_baseSize", value: function(item) { var itemData = (0, _renderer2.default)(item).data(BOX_ITEM_DATA_KEY); return null == itemData.baseSize ? 0 : "auto" === itemData.baseSize ? this._contentSize(item) : this._parseSize(itemData.baseSize) } }, { key: "_contentSize", value: function(item) { return (0, _renderer2.default)(item)[FALLBACK_MAIN_SIZE_MAP[this._option("direction")]]() } }, { key: "_parseSize", value: function(size) { return String(size).match(/.+%$/) ? .01 * parseFloat(size) * this._boxSizeValue : size } }, { key: "_boxSize", value: function(value) { if (!arguments.length) { this._boxSizeValue = this._boxSizeValue || this._totalBaseSize(); return this._boxSizeValue } this._boxSizeValue = value } }, { key: "_totalBaseSize", value: function() { var _this2 = this; var result = 0; (0, _iterator.each)(this._$items, function(_, item) { result += _this2._baseSize(item) }); return result } }, { key: "initSize", value: function() { this._boxSize(this._$element[FALLBACK_MAIN_SIZE_MAP[this._option("direction")]]()) } }, { key: "update", value: 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 === (0, _renderer2.default)(this).parent().closest(BOX_SELECTOR).get(0)) { _events_engine2.default.triggerHandler(this, UPDATE_EVENT) } }) } }]); return FallbackLayoutStrategy }(); var Box = function(_CollectionWidget) { _inherits(Box, _CollectionWidget); var _super2 = _createSuper(Box); function Box() { _classCallCheck(this, Box); return _super2.apply(this, arguments) } _createClass(Box, [{ key: "_getDefaultOptions", value: function() { return (0, _extend.extend)(_get(_getPrototypeOf(Box.prototype), "_getDefaultOptions", this).call(this), { direction: "row", align: "start", crossAlign: "stretch", activeStateEnabled: false, focusStateEnabled: false, onItemStateChanged: void 0, _layoutStrategy: "flex", _queue: void 0 }) } }, { key: "_defaultOptionsRules", value: function() { return _get(_getPrototypeOf(Box.prototype), "_defaultOptionsRules", this).call(this).concat([{ device: function device() { var device = _devices2.default.real(); var isOldAndroid = "android" === device.platform && (device.version[0] < 4 || 4 === device.version[0] && device.version[1] < 4); var isOldIos = "ios" === device.platform && device.version[0] < 7; return "win" === device.platform || _browser2.default.msie || isOldAndroid || isOldIos }, options: { _layoutStrategy: "fallback" } }]) } }, { key: "_itemClass", value: function() { return BOX_ITEM_CLASS } }, { key: "_itemDataKey", value: function() { return BOX_ITEM_DATA_KEY } }, { key: "_itemElements", value: function() { return this._itemContainer().children(this._itemSelector()) } }, { key: "_init", value: function() { _get(_getPrototypeOf(Box.prototype), "_init", this).call(this); this.$element().addClass("".concat(BOX_CLASS, "-").concat(this.option("_layoutStrategy"))); this._initLayout(); this._initBoxQueue() } }, { key: "_initLayout", value: function() { this._layout = "fallback" === this.option("_layoutStrategy") ? new FallbackLayoutStrategy(this.$element(), this.option.bind(this)) : new FlexLayoutStrategy(this.$element(), this.option.bind(this)) } }, { key: "_initBoxQueue", value: function() { this._queue = this.option("_queue") || [] } }, { key: "_queueIsNotEmpty", value: function() { return this.option("_queue") ? false : !!this._queue.length } }, { key: "_pushItemToQueue", value: function($item, config) { this._queue.push({ $item: $item, config: config }) } }, { key: "_shiftItemFromQueue", value: function() { return this._queue.shift() } }, { key: "_initMarkup", value: function() { this.$element().addClass(BOX_CLASS); this._layout.renderBox(); _get(_getPrototypeOf(Box.prototype), "_initMarkup", this).call(this); this._renderAlign(); this._renderActions() } }, { key: "_renderActions", value: function() { this._onItemStateChanged = this._createActionByOption("onItemStateChanged") } }, { key: "_renderAlign", value: function() { this._layout.renderAlign(); this._layout.renderCrossAlign() } }, { key: "_renderItems", value: function(items) { var _this3 = this; this._layout.initSize(); _get(_getPrototypeOf(Box.prototype), "_renderItems", this).call(this, items); while (this._queueIsNotEmpty()) { var item = this._shiftItemFromQueue(); this._createComponent(item.$item, Box, (0, _extend.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(function() { if (!_this3._isUpdated) { _this3._layout.update() } _this3._isUpdated = false; _this3._updateTimer = null }) } }, { key: "_renderItemContent", value: function(args) { var $itemNode = args.itemData && args.itemData.node; if ($itemNode) { return this._renderItemContentByNode(args, $itemNode) } return _get(_getPrototypeOf(Box.prototype), "_renderItemContent", this).call(this, args) } }, { key: "_postprocessRenderItem", value: function(args) { var boxConfig = args.itemData.box; if (!boxConfig) { return } this._pushItemToQueue(args.itemContent, boxConfig) } }, { key: "_createItemByTemplate", value: function(itemTemplate, args) { if (args.itemData.box) { return itemTemplate.source ? itemTemplate.source() : (0, _renderer2.default)() } return _get(_getPrototypeOf(Box.prototype), "_createItemByTemplate", this).call(this, itemTemplate, args) } }, { key: "_visibilityChanged", value: function(visible) { if (visible) { this._dimensionChanged() } } }, { key: "_dimensionChanged", value: function() { if (this._updateTimer) { return } this._isUpdated = true; this._layout.update() } }, { key: "_dispose", value: function() { clearTimeout(this._updateTimer); _get(_getPrototypeOf(Box.prototype), "_dispose", this).apply(this, arguments) } }, { key: "_itemOptionChanged", value: function(item, property, value, oldValue) { if ("visible" === property) { this._onItemStateChanged({ name: property, state: value, oldState: false !== oldValue }) } _get(_getPrototypeOf(Box.prototype), "_itemOptionChanged", this).call(this, item, property, value) } }, { key: "_optionChanged", value: 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: _get(_getPrototypeOf(Box.prototype), "_optionChanged", this).call(this, args) } } }, { key: "_itemOptions", value: function() { var _this4 = this; var options = _get(_getPrototypeOf(Box.prototype), "_itemOptions", this).call(this); options.fireItemStateChangedAction = function(e) { _this4._onItemStateChanged(e) }; return options } }, { key: "repaint", value: function() { this._dimensionChanged() } }]); return Box }(_uiCollection_widget2.default); Box.ItemClass = BoxItem; (0, _component_registrator2.default)("dxBox", Box); module.exports = Box }, /*!*********************************************!*\ !*** ./artifacts/transpiled/ui/date_box.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./date_box/ui.date_box */ 537) }, /*!******************************************************************!*\ !*** ./artifacts/transpiled/ui/date_box/ui.date_box.strategy.js ***! \******************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var Class = __webpack_require__( /*! ../../core/class */ 15); var dateLocalization = __webpack_require__( /*! ../../localization/date */ 32); 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, customizeButtons: noop, attachKeyboardEvents: function(keyboardProcessor) { this._widgetKeyboardProcessor = keyboardProcessor.attachChildProcessor() }, getParsedText: function(text, format) { var value = dateLocalization.parse(text, format); return value ? value : dateLocalization.parse(text) }, renderInputMinMax: noop, renderOpenedState: function() { this._updateValue() }, popupConfig: abstract, renderPopupContent: function() { var popup = this._getPopup(); this._renderWidget(); var $popupContent = popup.$content().parent(); eventsEngine.off($popupContent, "mousedown"); eventsEngine.on($popupContent, "mousedown", this._preventFocusOnPopup.bind(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) } }, useCurrentDateByDefault: noop, getDefaultDate: function() { return new Date }, 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() { if (arguments.length) { return this.dateBox.dateValue.apply(this.dateBox, arguments) } else { return this.dateBox.dateOption.apply(this.dateBox, ["value"]) } } }); module.exports = DateBoxStrategy }, /*!************************************************************************!*\ !*** ./artifacts/transpiled/ui/drawer/ui.drawer.rendering.strategy.js ***! \************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _fx = __webpack_require__( /*! ../../animation/fx */ 38); var _fx2 = _interopRequireDefault(_fx); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); var _inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true } Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) { _defineProperties(Constructor.prototype, protoProps) } if (staticProps) { _defineProperties(Constructor, staticProps) } Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor } var animation = { moveTo: function(config) { var $element = config.$element; var position = config.position; var direction = config.direction || "left"; var toConfig = {}; var animationType; if ("right" === direction) { toConfig.transform = "translate(" + position + "px, 0px)"; animationType = "custom" } if ("left" === direction) { toConfig.left = position; animationType = "slide" } if ("top" === direction || "bottom" === direction) { toConfig.top = position; animationType = "slide" } _fx2.default.animate($element, { type: animationType, to: toConfig, duration: config.duration, complete: config.complete }) }, margin: function margin(config) { var $element = config.$element; var margin = config.margin; var direction = config.direction || "left"; var toConfig = {}; toConfig["margin" + (0, _inflector.camelize)(direction, true)] = margin; _fx2.default.animate($element, { to: toConfig, duration: config.duration, complete: config.complete }) }, fade: function($element, config, duration, completeAction) { _fx2.default.animate($element, { type: "fade", to: config.to, from: config.from, duration: duration, complete: completeAction }) }, size: function size(config) { var $element = config.$element; var size = config.size; var direction = config.direction || "left"; var marginTop = config.marginTop || 0; var duration = config.duration; var toConfig = {}; if ("right" === direction || "left" === direction) { toConfig.width = size } else { toConfig.height = size } if ("bottom" === direction) { toConfig.marginTop = marginTop } _fx2.default.animate($element, { to: toConfig, duration: duration, complete: config.complete }) }, complete: function($element) { _fx2.default.stop($element, true) } }; var DrawerStrategy = function() { function DrawerStrategy(drawer) { _classCallCheck(this, DrawerStrategy); this._drawer = drawer } _createClass(DrawerStrategy, [{ key: "getDrawerInstance", value: function() { return this._drawer } }, { key: "renderPanel", value: function(template, whenPanelRendered) { template && template.render({ container: this.getDrawerInstance().content(), onRendered: function() { whenPanelRendered.resolve() } }) } }, { key: "renderPosition", value: function(offset, animate) { var drawer = this.getDrawerInstance(); var revealMode = drawer.option("revealMode"); this.prepareAnimationDeferreds(animate); var config = this.getPositionRenderingConfig(offset); if (this.useDefaultAnimation()) { this.defaultPositionRendering(config, offset, animate) } else { if ("slide" === revealMode) { this.slidePositionRendering(config, offset, animate) } if ("expand" === revealMode) { this.expandPositionRendering(config, offset, animate) } } } }, { key: "prepareAnimationDeferreds", value: function(animate) { var drawer = this.getDrawerInstance(); this._contentAnimation = new _deferred.Deferred; this._panelAnimation = new _deferred.Deferred; this._shaderAnimation = new _deferred.Deferred; drawer._animations.push(this._contentAnimation, this._panelAnimation, this._shaderAnimation); if (animate) { _deferred.when.apply(_renderer2.default, drawer._animations).done(function() { drawer._animationCompleteHandler() }) } else { drawer.resizeContent() } } }, { key: "getPositionRenderingConfig", value: function(offset) { var drawer = this.getDrawerInstance(); return { direction: drawer.getDrawerPosition(), $panel: (0, _renderer2.default)(drawer.content()), $content: (0, _renderer2.default)(drawer.viewContent()), defaultAnimationConfig: this._defaultAnimationConfig(), size: this._getPanelSize(offset) } } }, { key: "useDefaultAnimation", value: function() { return false } }, { key: "_elementsAnimationCompleteHandler", value: function() { this._contentAnimation.resolve(); this._panelAnimation.resolve() } }, { key: "_defaultAnimationConfig", value: function() { var _this = this; return { complete: function() { _this._elementsAnimationCompleteHandler() } } } }, { key: "_getPanelOffset", value: function(offset) { var drawer = this.getDrawerInstance(); var size = drawer.isHorizontalDirection() ? drawer.getRealPanelWidth() : drawer.getRealPanelHeight(); if (offset) { return -(size - drawer.getMaxSize()) } else { return -(size - drawer.getMinSize()) } } }, { key: "_getPanelSize", value: function(offset) { return offset ? this.getDrawerInstance().getMaxSize() : this.getDrawerInstance().getMinSize() } }, { key: "renderShaderVisibility", value: function(offset, animate, duration) { var _this2 = this; var fadeConfig = this._getFadeConfig(offset); var drawer = this.getDrawerInstance(); if (animate) { animation.fade((0, _renderer2.default)(drawer._$shader), fadeConfig, duration, function() { _this2._drawer._toggleShaderVisibility(offset); _this2._shaderAnimation.resolve() }) } else { drawer._toggleShaderVisibility(offset); drawer._$shader.css("opacity", fadeConfig.to) } } }, { key: "_getFadeConfig", value: function(offset) { if (offset) { return { to: 1, from: 0 } } else { return { to: 0, from: 1 } } } }, { key: "getPanelContent", value: function() { return (0, _renderer2.default)(this.getDrawerInstance().content()) } }, { key: "getWidth", value: function() { return this.getDrawerInstance().$element().get(0).getBoundingClientRect().width } }, { key: "setPanelSize", value: function(keepMaxSize) { var drawer = this.getDrawerInstance(); var panelSize = this._getPanelSize(drawer.option("opened")); if (drawer.isHorizontalDirection()) { (0, _renderer2.default)(drawer.content()).width(keepMaxSize ? drawer.getRealPanelWidth() : panelSize) } else { (0, _renderer2.default)(drawer.content()).height(keepMaxSize ? drawer.getRealPanelHeight() : panelSize) } } }, { key: "needOrderContent", value: function() { return false } }]); return DrawerStrategy }(); module.exports = DrawerStrategy; module.exports.animation = animation }, /*!***************************************************!*\ !*** ./artifacts/transpiled/ui/drop_down_menu.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow(); var devices = __webpack_require__( /*! ../core/devices */ 16); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var Widget = __webpack_require__( /*! ./widget/ui.widget */ 18); var Button = __webpack_require__( /*! ./button */ 34); var Popover = __webpack_require__( /*! ./popover */ 137); var DataHelperMixin = __webpack_require__( /*! ../data_helper */ 84); var List = __webpack_require__( /*! ./list */ 100); var themes = __webpack_require__( /*! ./themes */ 30); var ChildDefaultTemplate = __webpack_require__( /*! ./widget/child_default_template */ 134); var DROP_DOWN_MENU_CLASS = "dx-dropdownmenu"; var DROP_DOWN_MENU_POPUP_CLASS = "dx-dropdownmenu-popup"; var DROP_DOWN_MENU_POPUP_WRAPPER_CLASS = "dx-dropdownmenu-popup-wrapper"; var DROP_DOWN_MENU_LIST_CLASS = "dx-dropdownmenu-list"; var DROP_DOWN_MENU_BUTTON_CLASS = "dx-dropdownmenu-button"; var POPUP_OPTION_MAP = { popupWidth: "width", popupHeight: "height", popupMaxHeight: "maxHeight", popupAutoResizeEnabled: "autoResizeEnabled" }; 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() { this._popup && this._popup.hide() } }) }, _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, popupMaxHeight: void 0, closeOnClick: true, useInkRipple: false, container: void 0, popupAutoResizeEnabled: false }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: { platform: "ios" }, options: { usePopover: true } }, { device: { platform: "generic" }, options: { popupPosition: { offset: { v: 4 } } } }, { device: function() { 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 } } } } }, { device: function() { return themes.isMaterial() }, options: { useInkRipple: true } }]) }, _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") }, _initTemplates: function() { this.callBase(); this._defaultTemplates.content = new ChildDefaultTemplate("content", this) }, _initMarkup: function() { this._renderButton(); this.callBase() }, _render: function() { 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); var config = this._buttonOptions(); this._button = this._createComponent($button, Button, config) }, _toggleActiveState: function($element, value, e) { this._button._toggleActiveState($element, value, e) }, _buttonOptions: function() { return { text: this.option("buttonText"), icon: this.option("buttonIcon"), width: this.option("buttonWidth"), height: this.option("buttonHeight"), useInkRipple: this.option("useInkRipple"), template: this.option("buttonTemplate"), focusStateEnabled: false, onClick: function(e) { this.option("opened", !this.option("opened")); this._buttonClickAction(e) }.bind(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()); var 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"), deferRendering: false, contentTemplate: function(contentElement) { this._renderList(contentElement) }.bind(this), position: this.option("popupPosition"), animation: this.option("popupAnimation"), onOptionChanged: function(args) { if ("visible" === args.name) { this.option("opened", args.value) } }.bind(this), target: this.$element(), height: this.option("popupHeight"), width: this.option("popupWidth"), maxHeight: this.option("popupMaxHeight"), container: this.option("container"), autoResizeEnabled: this.option("popupAutoResizeEnabled") } }, _renderList: function(contentElement) { var $content = $(contentElement); var listConfig = this._listOptions(); $content.addClass(DROP_DOWN_MENU_LIST_CLASS); this._list = this._createComponent($content, this.option("menuWidget"), listConfig); this._list._getAriaTarget = function() { return this.$element() }.bind(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.option("itemTemplate"), onItemClick: function(e) { if (this.option("closeOnClick")) { this.option("opened", false) } this._itemClickAction(e) }.bind(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 && 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": case "popupMaxHeight": case "popupAutoResizeEnabled": this._popup.option(POPUP_OPTION_MAP[name], value); break; case "usePopover": case "menuWidget": case "useInkRipple": 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": case "closeOnClick": break; case "container": this._popup && this._popup.option(args.name, args.value); 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 }, /*!**********************************************!*\ !*** ./artifacts/transpiled/ui/validator.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var dataUtils = __webpack_require__( /*! ../core/element_data */ 39); var Callbacks = __webpack_require__( /*! ../core/utils/callbacks */ 26); var errors = __webpack_require__( /*! ./widget/ui.errors */ 17); var DOMComponent = __webpack_require__( /*! ../core/dom_component */ 67); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var map = __webpack_require__( /*! ../core/utils/iterator */ 3).map; var ValidationMixin = __webpack_require__( /*! ./validation/validation_mixin */ 172); var ValidationEngine = __webpack_require__( /*! ./validation_engine */ 99); var DefaultAdapter = __webpack_require__( /*! ./validation/default_adapter */ 556); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var VALIDATOR_CLASS = "dx-validator"; var Validator = DOMComponent.inherit({ _getDefaultOptions: function() { return extend(this.callBase(), { validationRules: [] }) }, _init: function() { this.callBase(); this._initGroupRegistration(); this._skipValidation = false; this.focused = Callbacks(); this._initAdapter() }, _initGroupRegistration: function() { var group = this._findGroup(); if (!this._groupWasInit) { this.on("disposing", function(args) { ValidationEngine.removeRegisteredValidator(args.component._validationGroup, args.component) }) } if (!this._groupWasInit || this._validationGroup !== group) { ValidationEngine.removeRegisteredValidator(this._validationGroup, this); this._groupWasInit = true; this._validationGroup = group; ValidationEngine.registerValidatorInGroup(group, this) } }, _setOptionsByReference: function() { this.callBase(); extend(this._optionsByReference, { validationGroup: true }) }, _initAdapter: function() { var that = this; var element = that.$element()[0]; var dxStandardEditor = dataUtils.data(element, "dx-validation-target"); var adapter = that.option("adapter"); if (!adapter) { if (dxStandardEditor) { adapter = new DefaultAdapter(dxStandardEditor, this); adapter.validationRequestsCallbacks.add(function(args) { if (that._skipValidation) { return } that.validate(args) }); this.option("adapter", adapter); return } throw errors.Error("E0120") } var callbacks = adapter.validationRequestsCallbacks; if (callbacks) { if (Array.isArray(callbacks)) { callbacks.push(function(args) { that.validate(args) }) } else { errors.log("W0014", "validationRequestsCallbacks", "jQuery.Callbacks", "17.2", "Use the array instead"); callbacks.add(function(args) { that.validate(args) }) } } }, _initMarkup: function() { this.$element().addClass(VALIDATOR_CLASS); this.callBase() }, _toggleRTLDirection: function(isRtl) { var _this$option$editor$o, _this$option, _this$option$editor; var rtlEnabled = null !== (_this$option$editor$o = null === (_this$option = this.option("adapter")) || void 0 === _this$option ? void 0 : null === (_this$option$editor = _this$option.editor) || void 0 === _this$option$editor ? void 0 : _this$option$editor.option("rtlEnabled")) && void 0 !== _this$option$editor$o ? _this$option$editor$o : isRtl; this.callBase(rtlEnabled) }, _visibilityChanged: function(visible) { if (visible) { this._initGroupRegistration() } }, _optionChanged: function(args) { switch (args.name) { case "validationGroup": this._initGroupRegistration(); return; case "validationRules": this._resetValidationRules(); void 0 !== this.option("isValid") && this.validate(); return; case "adapter": this._initAdapter(); break; default: this.callBase(args) } }, _getValidationRules: function() { if (!this._validationRules) { this._validationRules = map(this.option("validationRules"), function(rule) { return extend({}, rule, { validator: this }) }.bind(this)) } return this._validationRules }, _resetValidationRules: function() { delete this._validationRules }, validate: function(args) { var that = this; var adapter = that.option("adapter"); var name = that.option("name"); var bypass = adapter.bypass && adapter.bypass(); var value = args && void 0 !== args.value ? args.value : adapter.getValue(); var currentError = adapter.getCurrentValidationError && adapter.getCurrentValidationError(); var rules = this._getValidationRules(); var result; if (bypass) { result = { isValid: true } } else { if (currentError && currentError.editorSpecific) { currentError.validator = this; result = { isValid: false, brokenRule: currentError } } else { result = ValidationEngine.validate(value, rules, name) } } this._applyValidationResult(result, adapter); return result }, reset: function() { var that = this; var adapter = that.option("adapter"); var result = { isValid: true, brokenRule: null }; this._skipValidation = true; adapter.reset(); this._skipValidation = false; this._resetValidationRules(); this._applyValidationResult(result, adapter) }, _applyValidationResult: function(result, adapter) { var validatedAction = this._createActionByOption("onValidated", { excludeValidators: ["readOnly"] }); result.validator = this; adapter.applyValidationResults && adapter.applyValidationResults(result); this.option({ isValid: result.isValid }); validatedAction(result) }, focus: function() { var adapter = this.option("adapter"); adapter && adapter.focus && adapter.focus() } }).include(ValidationMixin); registerComponent("dxValidator", Validator); module.exports = Validator }, /*!*****************************************!*\ !*** ./artifacts/transpiled/ui/tabs.js ***! \*****************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _devices = __webpack_require__( /*! ../core/devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _button = __webpack_require__( /*! ./button */ 34); var _button2 = _interopRequireDefault(_button); var _utils = __webpack_require__( /*! ./widget/utils.ink_ripple */ 69); var _utils2 = _interopRequireDefault(_utils); var _utils3 = __webpack_require__( /*! ../events/utils */ 8); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _pointer = __webpack_require__( /*! ../events/pointer */ 23); var _pointer2 = _interopRequireDefault(_pointer); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _item = __webpack_require__( /*! ./tabs/item */ 314); var _item2 = _interopRequireDefault(_item); var _themes = __webpack_require__( /*! ./themes */ 30); var _themes2 = _interopRequireDefault(_themes); var _hold = __webpack_require__( /*! ../events/hold */ 88); var _hold2 = _interopRequireDefault(_hold); var _ui = __webpack_require__( /*! ./scroll_view/ui.scrollable */ 91); var _ui2 = _interopRequireDefault(_ui); var _uiCollection_widget = __webpack_require__( /*! ./collection/ui.collection_widget.live_update */ 187); var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget); var _icon = __webpack_require__( /*! ../core/utils/icon */ 60); var _bindable_template = __webpack_require__( /*! ./widget/bindable_template */ 65); var _bindable_template2 = _interopRequireDefault(_bindable_template); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var TABS_CLASS = "dx-tabs"; var TABS_WRAPPER_CLASS = "dx-tabs-wrapper"; var TABS_EXPANDED_CLASS = "dx-tabs-expanded"; var TABS_STRETCHED_CLASS = "dx-tabs-stretched"; var TABS_SCROLLABLE_CLASS = "dx-tabs-scrollable"; var TABS_NAV_BUTTONS_CLASS = "dx-tabs-nav-buttons"; var OVERFLOW_HIDDEN_CLASS = "dx-overflow-hidden"; var TABS_ITEM_CLASS = "dx-tab"; var TABS_ITEM_SELECTED_CLASS = "dx-tab-selected"; var TABS_NAV_BUTTON_CLASS = "dx-tabs-nav-button"; var TABS_LEFT_NAV_BUTTON_CLASS = "dx-tabs-nav-button-left"; var TABS_RIGHT_NAV_BUTTON_CLASS = "dx-tabs-nav-button-right"; var TABS_ITEM_TEXT_CLASS = "dx-tab-text"; var TABS_ITEM_DATA_KEY = "dxTabData"; var BUTTON_NEXT_ICON = "chevronnext"; var BUTTON_PREV_ICON = "chevronprev"; var FEEDBACK_HIDE_TIMEOUT = 100; var FEEDBACK_DURATION_INTERVAL = 5; var FEEDBACK_SCROLL_TIMEOUT = 300; var TAB_OFFSET = 30; var Tabs = _uiCollection_widget2.default.inherit({ _activeStateUnit: "." + TABS_ITEM_CLASS, _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { hoverStateEnabled: true, showNavButtons: true, scrollByContent: true, scrollingEnabled: true, selectionMode: "single", activeStateEnabled: true, selectionRequired: false, selectOnFocus: true, loopItemFocus: false, useInkRipple: false, badgeExpr: function(data) { return data ? data.badge : void 0 } }) }, _defaultOptionsRules: function() { var themeName = _themes2.default.current(); return this.callBase().concat([{ device: function() { return "generic" !== _devices2.default.real().platform }, options: { showNavButtons: false } }, { device: { platform: "generic" }, options: { scrollByContent: false } }, { device: function() { return "desktop" === _devices2.default.real().deviceType && !_devices2.default.isSimulator() }, options: { focusStateEnabled: true } }, { device: function() { return _themes2.default.isMaterial(themeName) }, options: { useInkRipple: true, selectOnFocus: false } }]) }, _init: function() { this.callBase(); this.setAria("role", "tablist"); this.$element().addClass(TABS_CLASS); this._renderWrapper(); this._renderMultiple(); this._feedbackHideTimeout = FEEDBACK_HIDE_TIMEOUT }, _initTemplates: function() { this.callBase(); this._defaultTemplates.item = new _bindable_template2.default(function($container, data) { if ((0, _type.isPlainObject)(data)) { this._prepareDefaultItemTemplate(data, $container) } else { $container.text(String(data)) } var $iconElement = (0, _icon.getImageContainer)(data.icon); $container.wrapInner((0, _renderer2.default)("").addClass(TABS_ITEM_TEXT_CLASS)); $iconElement && $iconElement.prependTo($container) }.bind(this), ["text", "html", "icon"], this.option("integrationOptions.watchMethod")) }, _itemClass: function() { return TABS_ITEM_CLASS }, _selectedItemClass: function() { return TABS_ITEM_SELECTED_CLASS }, _itemDataKey: function() { return TABS_ITEM_DATA_KEY }, _initMarkup: function() { this.callBase(); this.setAria("role", "tab", this.itemElements()); this.option("useInkRipple") && this._renderInkRipple(); this.$element().addClass(OVERFLOW_HIDDEN_CLASS) }, _render: function() { this.callBase(); this._renderScrolling() }, _renderScrolling: function() { var removeClasses = [TABS_STRETCHED_CLASS, TABS_EXPANDED_CLASS, OVERFLOW_HIDDEN_CLASS]; this.$element().removeClass(removeClasses.join(" ")); if (this.option("scrollingEnabled") && this._isItemsWidthExceeded()) { if (!this._scrollable) { this._renderScrollable(); this._renderNavButtons() } this._scrollable.update(); this._updateNavButtonsVisibility(); if (this.option("rtlEnabled")) { this._scrollable.scrollTo({ left: this._scrollable.scrollWidth() - this._scrollable.clientWidth() }) } this._scrollToItem(this.option("selectedItem")) } if (!(this.option("scrollingEnabled") && this._isItemsWidthExceeded())) { this._cleanScrolling(); if (this._needStretchItems() && !this._isItemsWidthExceeded()) { this.$element().addClass(TABS_STRETCHED_CLASS) } this.$element().removeClass(TABS_NAV_BUTTONS_CLASS).addClass(TABS_EXPANDED_CLASS) } }, _isItemsWidthExceeded: function() { var tabItemsWidth = this._getSummaryItemsWidth(this._getVisibleItems(), true); return tabItemsWidth - 1 > this.$element().width() }, _needStretchItems: function() { var $visibleItems = this._getVisibleItems(); var elementWidth = this.$element().width(); var itemsWidth = []; (0, _iterator.each)($visibleItems, function(_, item) { itemsWidth.push((0, _renderer2.default)(item).outerWidth(true)) }); var maxTabWidth = Math.max.apply(null, itemsWidth); return maxTabWidth > elementWidth / $visibleItems.length }, _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._$wrapper.appendTo(this.$element()); this._scrollable.$element().remove(); this._scrollable = null; this._cleanNavButtons() }, _renderInkRipple: function() { this._inkRipple = _utils2.default.render() }, _toggleActiveState: function($element, value, e) { this.callBase.apply(this, arguments); if (!this._inkRipple) { return } var config = { element: $element, event: 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._$wrapper = (0, _renderer2.default)("
").addClass(TABS_WRAPPER_CLASS); this.$element().append(this._$wrapper) }, _itemContainer: function() { return this._$wrapper }, _renderScrollable: function() { var $itemContainer = this.$element().wrapInner((0, _renderer2.default)("
").addClass(TABS_SCROLLABLE_CLASS)).children(); this._scrollable = this._createComponent($itemContainer, _ui2.default, { direction: "horizontal", showScrollbar: false, useKeyboard: false, useNative: false, scrollByContent: this.option("scrollByContent"), onScroll: this._updateNavButtonsVisibility.bind(this) }); this.$element().append(this._scrollable.$element()) }, _scrollToItem: function(itemData) { if (!this._scrollable) { return } var $item = this._editStrategy.getItemElement(itemData); this._scrollable.scrollToElement($item) }, _renderNavButtons: function() { this.$element().toggleClass(TABS_NAV_BUTTONS_CLASS, this.option("showNavButtons")); if (!this.option("showNavButtons")) { return } var rtlEnabled = this.option("rtlEnabled"); this._leftButton = this._createNavButton(-TAB_OFFSET, rtlEnabled ? BUTTON_NEXT_ICON : BUTTON_PREV_ICON); var $leftButton = this._leftButton.$element(); $leftButton.addClass(TABS_LEFT_NAV_BUTTON_CLASS); this.$element().prepend($leftButton); this._rightButton = this._createNavButton(TAB_OFFSET, rtlEnabled ? BUTTON_PREV_ICON : BUTTON_NEXT_ICON); var $rightButton = this._rightButton.$element(); $rightButton.addClass(TABS_RIGHT_NAV_BUTTON_CLASS); this.$element().append($rightButton) }, _updateNavButtonsVisibility: function() { this._leftButton && this._leftButton.option("disabled", this._scrollable.scrollLeft() <= 0); this._rightButton && this._rightButton.option("disabled", this._scrollable.scrollLeft() >= Math.round(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) }); var holdEventName = (0, _utils3.addNamespace)(_hold2.default.name, "dxNavButton"); var pointerUpEventName = (0, _utils3.addNamespace)(_pointer2.default.up, "dxNavButton"); var pointerOutEventName = (0, _utils3.addNamespace)(_pointer2.default.out, "dxNavButton"); var navButton = this._createComponent((0, _renderer2.default)("
").addClass(TABS_NAV_BUTTON_CLASS), _button2.default, { focusStateEnabled: false, icon: icon, onClick: function() { that._updateScrollPosition(offset, 1) }, integrationOptions: {} }); var $navButton = navButton.$element(); _events_engine2.default.on($navButton, holdEventName, { timeout: FEEDBACK_SCROLL_TIMEOUT }, function(e) { holdAction({ event: e }) }.bind(this)); _events_engine2.default.on($navButton, pointerUpEventName, function() { that._clearInterval() }); _events_engine2.default.on($navButton, pointerOutEventName, function() { that._clearInterval() }); return navButton }, _clearInterval: function() { if (this._holdInterval) { clearInterval(this._holdInterval) } }, _updateSelection: 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() { this._renderScrolling() }, _itemSelectHandler: function(e) { if ("single" === this.option("selectionMode") && this.isItemSelected(e.currentTarget)) { return } this.callBase(e) }, _clean: function() { this._cleanScrolling(); 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 "width": this.callBase(args); this._dimensionChanged(); break; case "selectionMode": this._renderMultiple(); this.callBase(args); break; case "badgeExpr": this._invalidate(); break; default: this.callBase(args) } }, _afterItemElementInserted: function() { this.callBase(); this._renderScrolling() }, _afterItemElementDeleted: function($item, deletedActionArgs) { this.callBase($item, deletedActionArgs); this._renderScrolling() } }); Tabs.ItemClass = _item2.default; (0, _component_registrator2.default)("dxTabs", Tabs); module.exports = Tabs; module.exports.getTabsExpandedClass = TABS_EXPANDED_CLASS }, /*!*******************************************************************************!*\ !*** ./artifacts/transpiled/ui/data_grid/ui.data_grid.data_source_adapter.js ***! \*******************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _uiGrid_core = __webpack_require__( /*! ../grid_core/ui.grid_core.data_source_adapter */ 337); var _uiGrid_core2 = _interopRequireDefault(_uiGrid_core); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var dataSourceAdapterType = _uiGrid_core2.default; module.exports = { extend: function(extender) { dataSourceAdapterType = dataSourceAdapterType.inherit(extender) }, create: function(component) { return new dataSourceAdapterType(component) } } }, /*!*********************************************************!*\ !*** ./artifacts/transpiled/ui/filter_builder/utils.js ***! \*********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); var _errors = __webpack_require__( /*! ../../data/errors */ 36); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _data = __webpack_require__( /*! ../../core/utils/data */ 20); var _ui = __webpack_require__( /*! ../widget/ui.errors */ 17); var _ui2 = _interopRequireDefault(_ui); var _filtering = __webpack_require__( /*! ../shared/filtering */ 162); var _filtering2 = _interopRequireDefault(_filtering); var _format_helper = __webpack_require__( /*! ../../format_helper */ 64); var _format_helper2 = _interopRequireDefault(_format_helper); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33); var _inflector2 = _interopRequireDefault(_inflector); var _between = __webpack_require__( /*! ./between */ 630); var _between2 = _interopRequireDefault(_between); var _message = __webpack_require__( /*! ../../localization/message */ 13); var _message2 = _interopRequireDefault(_message); var _data_source = __webpack_require__( /*! ../../data/data_source/data_source */ 45); var _ui3 = __webpack_require__( /*! ./ui.filter_operations_dictionary */ 631); var _ui4 = _interopRequireDefault(_ui3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var DEFAULT_DATA_TYPE = "string"; var EMPTY_MENU_ICON = "icon-none"; var AND_GROUP_OPERATION = "and"; var EQUAL_OPERATION = "="; var NOT_EQUAL_OPERATION = "<>"; var DATATYPE_OPERATIONS = { number: ["=", "<>", "<", ">", "<=", ">=", "isblank", "isnotblank"], string: ["contains", "notcontains", "startswith", "endswith", "=", "<>", "isblank", "isnotblank"], date: ["=", "<>", "<", ">", "<=", ">=", "isblank", "isnotblank"], datetime: ["=", "<>", "<", ">", "<=", ">=", "isblank", "isnotblank"], "boolean": ["=", "<>", "isblank", "isnotblank"], object: ["isblank", "isnotblank"] }; var DEFAULT_FORMAT = { date: "shortDate", datetime: "shortDateShortTime" }; var LOOKUP_OPERATIONS = ["=", "<>", "isblank", "isnotblank"]; var AVAILABLE_FIELD_PROPERTIES = ["caption", "customizeText", "dataField", "dataType", "editorTemplate", "falseText", "editorOptions", "filterOperations", "format", "lookup", "trueText", "calculateFilterExpression", "name"]; function getFormattedValueText(field, value) { var fieldFormat = field.format || DEFAULT_FORMAT[field.dataType]; return _format_helper2.default.format(value, fieldFormat) } function isNegationGroup(group) { return group && group.length > 1 && "!" === group[0] && !isCondition(group) } function getGroupCriteria(group) { return isNegationGroup(group) ? group[1] : group } function setGroupCriteria(group, criteria) { if (isNegationGroup(group)) { group[1] = criteria } else { group = criteria } return group } function convertGroupToNewStructure(group, value) { var isNegationValue = function(value) { return value.indexOf("!") !== -1 }; var convertGroupToNegationGroup = function(group) { var criteria = group.slice(0); group.length = 0; group.push("!", criteria) }; var convertNegationGroupToGroup = function(group) { var criteria = getGroupCriteria(group); group.length = 0; [].push.apply(group, criteria) }; if (isNegationValue(value)) { if (!isNegationGroup(group)) { convertGroupToNegationGroup(group) } } else { if (isNegationGroup(group)) { convertNegationGroupToGroup(group) } } } function setGroupValue(group, value) { convertGroupToNewStructure(group, value); var criteria = getGroupCriteria(group); var i; var getNormalizedGroupValue = function(value) { return value.indexOf("!") === -1 ? value : value.substring(1) }; var changeCriteriaValue = function(criteria, value) { for (i = 0; i < criteria.length; i++) { if (!Array.isArray(criteria[i])) { criteria[i] = value } } }; value = getNormalizedGroupValue(value); changeCriteriaValue(criteria, value); return group } function getGroupMenuItem(group, availableGroups) { var groupValue = getGroupValue(group); return availableGroups.filter(function(item) { return item.value === groupValue })[0] } function getCriteriaOperation(criteria) { if (isCondition(criteria)) { return AND_GROUP_OPERATION } var value = ""; for (var i = 0; i < criteria.length; i++) { var item = criteria[i]; if (!Array.isArray(item)) { if (value && value !== item) { throw new _errors.errors.Error("E4019") } if ("!" !== item) { value = item } } } return value } function getGroupValue(group) { var criteria = getGroupCriteria(group); var value = getCriteriaOperation(criteria); if (!value) { value = AND_GROUP_OPERATION } if (criteria !== group) { value = "!" + value } return value } function getDefaultFilterOperations(field) { return field.lookup && LOOKUP_OPERATIONS || DATATYPE_OPERATIONS[field.dataType || DEFAULT_DATA_TYPE] } function containItems(entity) { return Array.isArray(entity) && entity.length } function getFilterOperations(field) { var result = containItems(field.filterOperations) ? field.filterOperations : getDefaultFilterOperations(field); return (0, _extend.extend)([], result) } function getCaptionByOperation(operation, filterOperationDescriptions) { var operationName = _ui4.default.getNameByFilterOperation(operation); return filterOperationDescriptions && filterOperationDescriptions[operationName] ? filterOperationDescriptions[operationName] : operationName } function getOperationFromAvailable(operation, availableOperations) { for (var i = 0; i < availableOperations.length; i++) { if (availableOperations[i].value === operation) { return availableOperations[i] } } throw new _ui2.default.Error("E1048", operation) } function getCustomOperation(customOperations, name) { var filteredOperations = customOperations.filter(function(item) { return item.name === name }); return filteredOperations.length ? filteredOperations[0] : null } function getAvailableOperations(field, filterOperationDescriptions, customOperations) { var filterOperations = getFilterOperations(field); customOperations.forEach(function(customOperation) { if (!field.filterOperations && filterOperations.indexOf(customOperation.name) === -1) { var dataTypes = customOperation && customOperation.dataTypes; if (dataTypes && dataTypes.indexOf(field.dataType || DEFAULT_DATA_TYPE) >= 0) { filterOperations.push(customOperation.name) } } }); return filterOperations.map(function(operation) { var customOperation = getCustomOperation(customOperations, operation); if (customOperation) { return { icon: customOperation.icon || EMPTY_MENU_ICON, text: customOperation.caption || _inflector2.default.captionize(customOperation.name), value: customOperation.name, isCustom: true } } else { return { icon: _ui4.default.getIconByFilterOperation(operation) || EMPTY_MENU_ICON, text: getCaptionByOperation(operation, filterOperationDescriptions), value: operation } } }) } function getDefaultOperation(field) { return field.defaultFilterOperation || getFilterOperations(field)[0] } function createCondition(field, customOperations) { var condition = [field.dataField, "", ""]; var filterOperation = getDefaultOperation(field); updateConditionByOperation(condition, filterOperation, customOperations); return condition } function removeItem(group, item) { var criteria = getGroupCriteria(group); var index = criteria.indexOf(item); criteria.splice(index, 1); if (1 !== criteria.length) { criteria.splice(index, 1) } return group } function createEmptyGroup(value) { return value.indexOf("not") !== -1 ? ["!", [value.substring(3).toLowerCase()]] : [value] } function isEmptyGroup(group) { var criteria = getGroupCriteria(group); if (isCondition(criteria)) { return false } var hasConditions = criteria.some(function(item) { return isCondition(item) }); return !hasConditions } function addItem(item, group) { var criteria = getGroupCriteria(group); var groupValue = getGroupValue(criteria); 1 === criteria.length ? criteria.unshift(item) : criteria.push(item, groupValue); return group } function getField(dataField, fields) { for (var i = 0; i < fields.length; i++) { if (fields[i].name === dataField) { return fields[i] } if (fields[i].dataField.toLowerCase() === dataField.toLowerCase()) { return fields[i] } } var extendedFields = getItems(fields, true).filter(function(item) { return item.dataField.toLowerCase() === dataField.toLowerCase() }); if (extendedFields.length > 0) { return extendedFields[0] } throw new _ui2.default.Error("E1047", dataField) } function isGroup(criteria) { if (!Array.isArray(criteria)) { return false } return criteria.length < 2 || Array.isArray(criteria[0]) || Array.isArray(criteria[1]) } function isCondition(criteria) { if (!Array.isArray(criteria)) { return false } return criteria.length > 1 && !Array.isArray(criteria[0]) && !Array.isArray(criteria[1]) } function convertToInnerGroup(group, customOperations) { var groupOperation = getCriteriaOperation(group).toLowerCase() || AND_GROUP_OPERATION; var innerGroup = []; for (var i = 0; i < group.length; i++) { if (isGroup(group[i])) { innerGroup.push(convertToInnerStructure(group[i], customOperations)); innerGroup.push(groupOperation) } else { if (isCondition(group[i])) { innerGroup.push(convertToInnerCondition(group[i], customOperations)); innerGroup.push(groupOperation) } } } if (0 === innerGroup.length) { innerGroup.push(groupOperation) } return innerGroup } function conditionHasCustomOperation(condition, customOperations) { var customOperation = getCustomOperation(customOperations, condition[1]); return customOperation && customOperation.name === condition[1] } function convertToInnerCondition(condition, customOperations) { if (conditionHasCustomOperation(condition, customOperations)) { return condition } if (condition.length < 3) { condition[2] = condition[1]; condition[1] = EQUAL_OPERATION } return condition } function convertToInnerStructure(value, customOperations) { if (!value) { return [AND_GROUP_OPERATION] } value = (0, _extend.extend)(true, [], value); if (isCondition(value)) { return [convertToInnerCondition(value, customOperations), AND_GROUP_OPERATION] } if (isNegationGroup(value)) { return ["!", isCondition(value[1]) ? [convertToInnerCondition(value[1], customOperations), AND_GROUP_OPERATION] : isNegationGroup(value[1]) ? [convertToInnerStructure(value[1], customOperations), AND_GROUP_OPERATION] : convertToInnerGroup(value[1], customOperations)] } return convertToInnerGroup(value, customOperations) } function getNormalizedFields(fields) { return fields.reduce(function(result, field) { if ((0, _type.isDefined)(field.dataField)) { var normalizedField = {}; for (var key in field) { if (field[key] && AVAILABLE_FIELD_PROPERTIES.indexOf(key) > -1) { normalizedField[key] = field[key] } } normalizedField.defaultCalculateFilterExpression = _filtering2.default.defaultCalculateFilterExpression; if (!(0, _type.isDefined)(normalizedField.dataType)) { normalizedField.dataType = DEFAULT_DATA_TYPE } result.push(normalizedField) } return result }, []) } function getConditionFilterExpression(condition, fields, customOperations, target) { var field = getField(condition[0], fields); var filterExpression = convertToInnerCondition(condition, customOperations); var customOperation = customOperations.length && getCustomOperation(customOperations, filterExpression[1]); if (customOperation && customOperation.calculateFilterExpression) { return customOperation.calculateFilterExpression.apply(customOperation, [filterExpression[2], field, target]) } else { if (field.createFilterExpression) { return field.createFilterExpression.apply(field, [filterExpression[2], filterExpression[1], target]) } else { if (field.calculateFilterExpression) { return field.calculateFilterExpression.apply(field, [filterExpression[2], filterExpression[1], target]) } else { return field.defaultCalculateFilterExpression.apply(field, [filterExpression[2], filterExpression[1], target]) } } } } function getFilterExpression(value, fields, customOperations, target) { if (!(0, _type.isDefined)(value)) { return null } if (isNegationGroup(value)) { var filterExpression = getFilterExpression(value[1], fields, customOperations, target); return ["!", filterExpression] } var criteria = getGroupCriteria(value); if (isCondition(criteria)) { return getConditionFilterExpression(criteria, fields, customOperations, target) || null } else { var _filterExpression; var groupValue = getGroupValue(criteria); var result = []; for (var i = 0; i < criteria.length; i++) { if (isGroup(criteria[i])) { _filterExpression = getFilterExpression(criteria[i], fields, customOperations, target); if (_filterExpression) { i && result.push(groupValue); result.push(_filterExpression) } } else { if (isCondition(criteria[i])) { _filterExpression = getConditionFilterExpression(criteria[i], fields, customOperations, target); if (_filterExpression) { i && result.push(groupValue); result.push(_filterExpression) } } } } return result.length ? result : null } } function getNormalizedFilter(group) { var criteria = getGroupCriteria(group); var i; if (0 === criteria.length) { return null } var itemsForRemove = []; for (i = 0; i < criteria.length; i++) { if (isGroup(criteria[i])) { var normalizedGroupValue = getNormalizedFilter(criteria[i]); if (normalizedGroupValue) { criteria[i] = normalizedGroupValue } else { itemsForRemove.push(criteria[i]) } } else { if (isCondition(criteria[i])) { if (!isValidCondition(criteria[i])) { itemsForRemove.push(criteria[i]) } } } } for (i = 0; i < itemsForRemove.length; i++) { removeItem(criteria, itemsForRemove[i]) } if (1 === criteria.length) { return null } criteria.splice(criteria.length - 1, 1); if (1 === criteria.length) { group = setGroupCriteria(group, criteria[0]) } if (0 === group.length) { return null } return group } function getCurrentLookupValueText(field, value, handler) { if ("" === value) { handler(""); return } var lookup = field.lookup; if (lookup.items) { handler(lookup.calculateCellValue(value) || "") } else { var dataSource = new _data_source.DataSource(lookup.dataSource); dataSource.loadSingle(lookup.valueExpr, value).done(function(result) { result ? handler(lookup.displayExpr ? (0, _data.compileGetter)(lookup.displayExpr)(result) : result) : handler("") }).fail(function() { handler("") }) } } function getPrimitiveValueText(field, value, customOperation, target) { var valueText; if (true === value) { valueText = field.trueText || _message2.default.format("dxDataGrid-trueText") } else { if (false === value) { valueText = field.falseText || _message2.default.format("dxDataGrid-falseText") } else { valueText = getFormattedValueText(field, value) } } if (field.customizeText) { valueText = field.customizeText.call(field, { value: value, valueText: valueText, target: target }) } if (customOperation && customOperation.customizeText) { valueText = customOperation.customizeText.call(customOperation, { value: value, valueText: valueText, field: field, target: target }) } return valueText } function getArrayValueText(field, value, customOperation, target) { return value.map(function(v) { return getPrimitiveValueText(field, v, customOperation, target) }) } function checkDefaultValue(value) { return "" === value || null === value } function getCurrentValueText(field, value, customOperation) { var target = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "filterBuilder"; if (checkDefaultValue(value)) { return "" } if (Array.isArray(value)) { var result = new _deferred.Deferred; _deferred.when.apply(this, getArrayValueText(field, value, customOperation, target)).done(function() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key] } var text = args.some(function(item) { return !checkDefaultValue(item) }) ? args.map(function(item) { return !checkDefaultValue(item) ? item : "?" }) : ""; result.resolve(text) }); return result } else { return getPrimitiveValueText(field, value, customOperation, target) } } function itemExists(plainItems, parentId) { return plainItems.some(function(item) { return item.dataField === parentId }) } function pushItemAndCheckParent(originalItems, plainItems, item) { var dataField = item.dataField; if (hasParent(dataField)) { item.parentId = getParentIdFromItemDataField(dataField); if (!itemExists(plainItems, item.parentId) && !itemExists(originalItems, item.parentId)) { pushItemAndCheckParent(originalItems, plainItems, { id: item.parentId, dataType: "object", dataField: item.parentId, caption: generateCaptionByDataField(item.parentId, true), filterOperations: ["isblank", "isnotblank"] }) } } plainItems.push(item) } function generateCaptionByDataField(dataField, allowHierarchicalFields) { var caption = ""; if (allowHierarchicalFields) { dataField = dataField.substring(dataField.lastIndexOf(".") + 1) } else { if (hasParent(dataField)) { dataField.split(".").forEach(function(field, index, arr) { caption += _inflector2.default.captionize(field); if (index !== arr.length - 1) { caption += "." } }); return caption } } return _inflector2.default.captionize(dataField) } function getItems(fields, allowHierarchicalFields) { var items = []; for (var i = 0; i < fields.length; i++) { var item = (0, _extend.extend)(true, { caption: generateCaptionByDataField(fields[i].dataField, allowHierarchicalFields) }, fields[i]); item.id = item.name || item.dataField; if (allowHierarchicalFields) { pushItemAndCheckParent(fields, items, item) } else { items.push(item) } } return items } function hasParent(dataField) { return dataField.lastIndexOf(".") !== -1 } function getParentIdFromItemDataField(dataField) { return dataField.substring(0, dataField.lastIndexOf(".")) } function getCaptionWithParents(item, plainItems) { if (hasParent(item.dataField)) { var parentId = getParentIdFromItemDataField(item.dataField); for (var i = 0; i < plainItems.length; i++) { if (plainItems[i].dataField === parentId) { return getCaptionWithParents(plainItems[i], plainItems) + "." + item.caption } } } return item.caption } function updateConditionByOperation(condition, operation, customOperations) { var customOperation = getCustomOperation(customOperations, operation); if (customOperation) { if (false === customOperation.hasValue) { condition[1] = operation; condition.length = 2 } else { condition[1] = operation; condition[2] = "" } return condition } if ("isblank" === operation) { condition[1] = EQUAL_OPERATION; condition[2] = null } else { if ("isnotblank" === operation) { condition[1] = NOT_EQUAL_OPERATION; condition[2] = null } else { customOperation = getCustomOperation(customOperations, condition[1]); if (customOperation || 2 === condition.length || null === condition[2]) { condition[2] = "" } condition[1] = operation } } return condition } function getOperationValue(condition) { var caption; if (null === condition[2]) { if (condition[1] === EQUAL_OPERATION) { caption = "isblank" } else { caption = "isnotblank" } } else { caption = condition[1] } return caption } function isValidCondition(condition) { return "" !== condition[2] } function getMergedOperations(customOperations, betweenCaption) { var result = (0, _extend.extend)(true, [], customOperations); var betweenIndex = -1; result.some(function(customOperation, index) { if ("between" === customOperation.name) { betweenIndex = index; return true } }); if (betweenIndex !== -1) { result[betweenIndex] = (0, _extend.extend)(_between2.default.getConfig(betweenCaption), result[betweenIndex]) } else { result.unshift(_between2.default.getConfig(betweenCaption)) } return result } function isMatchedCondition(filter, addedFilterDataField) { return filter[0] === addedFilterDataField } function removeFieldConditionsFromFilter(filter, dataField) { if (!filter || 0 === filter.length) { return null } if (isCondition(filter)) { var hasMatchedCondition = isMatchedCondition(filter, dataField); return !hasMatchedCondition ? filter : null } else { return syncConditionIntoGroup(filter, [dataField], false) } } function syncConditionIntoGroup(filter, addedFilter, canPush) { var result = []; filter.forEach(function(item) { if (isCondition(item)) { if (isMatchedCondition(item, addedFilter[0])) { if (canPush) { result.push(addedFilter); canPush = false } else { result.splice(result.length - 1, 1) } } else { result.push(item) } } else { (result.length || isGroup(item)) && result.push(item) } }); if (0 === result.length) { return null } if (canPush) { result.push(AND_GROUP_OPERATION); result.push(addedFilter) } return 1 === result.length ? result[0] : result } function syncFilters(filter, addedFilter) { if (null === filter || 0 === filter.length) { return addedFilter } if (isCondition(filter)) { if (isMatchedCondition(filter, addedFilter[0])) { return addedFilter } else { return [filter, AND_GROUP_OPERATION, addedFilter] } } var groupValue = getGroupValue(filter); if (groupValue !== AND_GROUP_OPERATION) { return [addedFilter, "and", filter] } return syncConditionIntoGroup(filter, addedFilter, true) } function getMatchedConditions(filter, dataField) { if (null === filter || 0 === filter.length) { return [] } if (isCondition(filter)) { if (isMatchedCondition(filter, dataField)) { return [filter] } else { return [] } } var groupValue = getGroupValue(filter); if (groupValue !== AND_GROUP_OPERATION) { return [] } var result = filter.filter(function(item) { return isCondition(item) && isMatchedCondition(item, dataField) }); return result } function filterHasField(filter, dataField) { if (null === filter || 0 === filter.length) { return false } if (isCondition(filter)) { return filter[0] === dataField } return filter.some(function(item) { return (isCondition(item) || isGroup(item)) && filterHasField(item, dataField) }) } exports.isValidCondition = isValidCondition; exports.isEmptyGroup = isEmptyGroup; exports.getOperationFromAvailable = getOperationFromAvailable; exports.updateConditionByOperation = updateConditionByOperation; exports.getCaptionWithParents = getCaptionWithParents; exports.getItems = getItems; exports.setGroupValue = setGroupValue; exports.getGroupMenuItem = getGroupMenuItem; exports.getGroupValue = getGroupValue; exports.getAvailableOperations = getAvailableOperations; exports.removeItem = removeItem; exports.createCondition = createCondition; exports.createEmptyGroup = createEmptyGroup; exports.addItem = addItem; exports.getField = getField; exports.isGroup = isGroup; exports.isCondition = isCondition; exports.getNormalizedFields = getNormalizedFields; exports.getNormalizedFilter = getNormalizedFilter; exports.getGroupCriteria = getGroupCriteria; exports.convertToInnerStructure = convertToInnerStructure; exports.getDefaultOperation = getDefaultOperation; exports.getCurrentValueText = getCurrentValueText; exports.getCurrentLookupValueText = getCurrentLookupValueText; exports.getFilterOperations = getFilterOperations; exports.getCaptionByOperation = getCaptionByOperation; exports.getOperationValue = getOperationValue; exports.getFilterExpression = getFilterExpression; exports.getCustomOperation = getCustomOperation; exports.getMergedOperations = getMergedOperations; exports.syncFilters = syncFilters; exports.getMatchedConditions = getMatchedConditions; exports.filterHasField = filterHasField; exports.removeFieldConditionsFromFilter = removeFieldConditionsFromFilter }, /*!***********************************************************!*\ !*** ./artifacts/transpiled/ui/pivot_grid/data_source.js ***! \***********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _data_source = __webpack_require__( /*! ../../data/data_source/data_source */ 45); var _abstract_store = __webpack_require__( /*! ../../data/abstract_store */ 98); var _abstract_store2 = _interopRequireDefault(_abstract_store); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _array = __webpack_require__( /*! ../../core/utils/array */ 14); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); var _class = __webpack_require__( /*! ../../core/class */ 15); var _class2 = _interopRequireDefault(_class); var _events_mixin = __webpack_require__( /*! ../../core/events_mixin */ 82); var _events_mixin2 = _interopRequireDefault(_events_mixin); var _inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33); var _local_store = __webpack_require__( /*! ./local_store */ 683); var _remote_store = __webpack_require__( /*! ./remote_store */ 684); var _remote_store2 = _interopRequireDefault(_remote_store); var _xmla_store = __webpack_require__( /*! ./xmla_store/xmla_store */ 380); var _uiPivot_grid = __webpack_require__( /*! ./ui.pivot_grid.summary_display_modes */ 685); var _uiPivot_grid2 = __webpack_require__( /*! ./ui.pivot_grid.utils */ 75); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var DESCRIPTION_NAME_BY_AREA = { row: "rows", column: "columns", data: "values", filter: "filters" }; var STATE_PROPERTIES = ["area", "areaIndex", "sortOrder", "filterType", "filterValues", "sortBy", "sortBySummaryField", "sortBySummaryPath", "expanded", "summaryType", "summaryDisplayMode"]; var CALCULATED_PROPERTIES = ["format", "selector", "customizeText", "caption"]; var ALL_CALCULATED_PROPERTIES = CALCULATED_PROPERTIES.concat(["allowSorting", "allowSortingBySummary", "allowFiltering", "allowExpandAll"]); function createCaption(field) { var caption = field.dataField || field.groupName || ""; var summaryType = (field.summaryType || "").toLowerCase(); if ((0, _type.isString)(field.groupInterval)) { caption += "_" + field.groupInterval } if (summaryType && "custom" !== summaryType) { summaryType = summaryType.replace(/^./, summaryType[0].toUpperCase()); if (caption.length) { summaryType = " (" + summaryType + ")" } } else { summaryType = "" } return (0, _inflector.titleize)(caption) + summaryType } function resetFieldState(field, properties) { var initialProperties = field._initProperties || {}; (0, _iterator.each)(properties, function(_, prop) { if (Object.prototype.hasOwnProperty.call(initialProperties, prop)) { field[prop] = initialProperties[prop] } }) } function updateCalculatedFieldProperties(field, calculatedProperties) { resetFieldState(field, calculatedProperties); if (!(0, _type.isDefined)(field.caption)) { (0, _uiPivot_grid2.setFieldProperty)(field, "caption", createCaption(field)) } } function areExpressionsUsed(dataFields) { return dataFields.some(function(field) { return field.summaryDisplayMode || field.calculateSummaryValue }) } function isRunningTotalUsed(dataFields) { return dataFields.some(function(field) { return !!field.runningTotal }) } function isDataExists(data) { return data.rows.length || data.columns.length || data.values.length } module.exports = _class2.default.inherit(function() { var findHeaderItem = function(headerItems, path) { if (headerItems._cacheByPath) { return headerItems._cacheByPath[path.join(".")] || null } }; var getHeaderItemsLastIndex = function getHeaderItemsLastIndex(headerItems, grandTotalIndex) { var lastIndex = -1; if (headerItems) { for (var i = 0; i < headerItems.length; i++) { var headerItem = headerItems[i]; if (void 0 !== headerItem.index) { lastIndex = Math.max(lastIndex, headerItem.index) } if (headerItem.children) { lastIndex = Math.max(lastIndex, getHeaderItemsLastIndex(headerItem.children)) } else { if (headerItem.collapsedChildren) { lastIndex = Math.max(lastIndex, getHeaderItemsLastIndex(headerItem.collapsedChildren)) } } } } if ((0, _type.isDefined)(grandTotalIndex)) { lastIndex = Math.max(lastIndex, grandTotalIndex) } return lastIndex }; var updateHeaderItemChildren = function(headerItems, headerItem, children, grandTotalIndex) { var applyingHeaderItemsCount = getHeaderItemsLastIndex(children) + 1; var emptyIndex = getHeaderItemsLastIndex(headerItems, grandTotalIndex) + 1; var index; var applyingItemIndexesToCurrent = []; var needIndexUpdate = false; var d = new _deferred.Deferred; if (headerItem.children && headerItem.children.length === children.length) { for (var i = 0; i < children.length; i++) { var child = children[i]; if (void 0 !== child.index) { if (void 0 === headerItem.children[i].index) { child.index = applyingItemIndexesToCurrent[child.index] = emptyIndex++; headerItem.children[i] = child } else { applyingItemIndexesToCurrent[child.index] = headerItem.children[i].index } } } } else { needIndexUpdate = true; for (index = 0; index < applyingHeaderItemsCount; index++) { applyingItemIndexesToCurrent[index] = emptyIndex++ } headerItem.children = children }(0, _deferred.when)((0, _uiPivot_grid2.foreachTreeAsync)(headerItem.children, function(items) { if (needIndexUpdate) { items[0].index = applyingItemIndexesToCurrent[items[0].index] } })).done(function() { d.resolve(applyingItemIndexesToCurrent) }); return d }; var updateHeaderItems = function(headerItems, newHeaderItems, grandTotalIndex) { var d = new _deferred.Deferred; var emptyIndex = grandTotalIndex >= 0 && getHeaderItemsLastIndex(headerItems, grandTotalIndex) + 1; var applyingItemIndexesToCurrent = []; (0, _deferred.when)((0, _uiPivot_grid2.foreachTreeAsync)(headerItems, function(items) { delete items[0].collapsedChildren })).done(function() { (0, _deferred.when)((0, _uiPivot_grid2.foreachTreeAsync)(newHeaderItems, function(newItems, index) { var newItem = newItems[0]; if (newItem.index >= 0) { var headerItem = findHeaderItem(headerItems, (0, _uiPivot_grid2.createPath)(newItems)); if (headerItem && headerItem.index >= 0) { applyingItemIndexesToCurrent[newItem.index] = headerItem.index } else { if (emptyIndex) { var path = (0, _uiPivot_grid2.createPath)(newItems.slice(1)); headerItem = findHeaderItem(headerItems, path); var parentItems = path.length ? headerItem && headerItem.children : headerItems; if (parentItems) { parentItems[index] = newItem; newItem.index = applyingItemIndexesToCurrent[newItem.index] = emptyIndex++ } } } } })).done(function() { d.resolve(applyingItemIndexesToCurrent) }) }); return d }; var updateDataSourceCells = function(dataSource, newDataSourceCells, newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent) { var rowIndex; var columnIndex; var dataSourceCells = dataSource.values; if (newDataSourceCells) { for (var newRowIndex = 0; newRowIndex <= newDataSourceCells.length; newRowIndex++) { var newRowCells = newDataSourceCells[newRowIndex]; rowIndex = newRowItemIndexesToCurrent[newRowIndex]; if (!(0, _type.isDefined)(rowIndex)) { rowIndex = dataSource.grandTotalRowIndex } if (newRowCells && (0, _type.isDefined)(rowIndex)) { if (!dataSourceCells[rowIndex]) { dataSourceCells[rowIndex] = [] } for (var newColumnIndex = 0; newColumnIndex <= newRowCells.length; newColumnIndex++) { var newCell = newRowCells[newColumnIndex]; columnIndex = newColumnItemIndexesToCurrent[newColumnIndex]; if (!(0, _type.isDefined)(columnIndex)) { columnIndex = dataSource.grandTotalColumnIndex } if ((0, _type.isDefined)(newCell) && (0, _type.isDefined)(columnIndex)) { dataSourceCells[rowIndex][columnIndex] = newCell } } } } } }; function createLocalOrRemoteStore(dataSourceOptions, notifyProgress) { var StoreConstructor = dataSourceOptions.remoteOperations || dataSourceOptions.paginate ? _remote_store2.default : _local_store.LocalStore; return new StoreConstructor((0, _extend.extend)((0, _data_source.normalizeDataSourceOptions)(dataSourceOptions), { onChanged: null, onLoadingChanged: null, onProgressChanged: notifyProgress })) } function createStore(dataSourceOptions, notifyProgress) { var store; if ((0, _type.isPlainObject)(dataSourceOptions) && dataSourceOptions.load) { store = createLocalOrRemoteStore(dataSourceOptions, notifyProgress) } else { if (dataSourceOptions && !dataSourceOptions.store) { dataSourceOptions = { store: dataSourceOptions } } var storeOptions = dataSourceOptions.store; if ("xmla" === storeOptions.type) { store = new _xmla_store.XmlaStore(storeOptions) } else { if ((0, _type.isPlainObject)(storeOptions) && storeOptions.type || storeOptions instanceof _abstract_store2.default || Array.isArray(storeOptions)) { store = createLocalOrRemoteStore(dataSourceOptions, notifyProgress) } else { if (storeOptions instanceof _class2.default) { store = storeOptions } } } } return store } function equalFields(fields, prevFields, count) { for (var i = 0; i < count; i++) { if (!fields[i] || !prevFields[i] || fields[i].index !== prevFields[i].index) { return false } } return true } function getExpandedPaths(dataSource, loadOptions, dimensionName, prevLoadOptions) { var result = []; var fields = loadOptions && loadOptions[dimensionName] || []; var prevFields = prevLoadOptions && prevLoadOptions[dimensionName] || []; (0, _uiPivot_grid2.foreachTree)(dataSource[dimensionName], function(items) { var item = items[0]; var path = (0, _uiPivot_grid2.createPath)(items); if (item.children && fields[path.length - 1] && !fields[path.length - 1].expanded) { if (path.length < fields.length && (!prevLoadOptions || equalFields(fields, prevFields, path.length))) { result.push(path.slice()) } } }, true); return result } function setFieldProperties(field, srcField, skipInitPropertySave, properties) { if (srcField) { (0, _iterator.each)(properties, function(_, name) { if (skipInitPropertySave) { field[name] = srcField[name] } else { if (("summaryType" === name || "summaryDisplayMode" === name) && void 0 === srcField[name]) { return }(0, _uiPivot_grid2.setFieldProperty)(field, name, srcField[name]) } }) } else { resetFieldState(field, properties) } return field } function getFieldsState(fields, properties) { var result = []; (0, _iterator.each)(fields, function(_, field) { result.push(setFieldProperties({ dataField: field.dataField, name: field.name }, field, true, properties)) }); return result } function getFieldStateId(field) { if (field.name) { return field.name } return field.dataField + "" } function getFieldsById(fields, id) { var result = []; (0, _iterator.each)(fields || [], function(_, field) { if (getFieldStateId(field) === id) { result.push(field) } }); return result } function setFieldsStateCore(stateFields, fields) { stateFields = stateFields || []; (0, _iterator.each)(fields, function(index, field) { setFieldProperties(field, stateFields[index], false, STATE_PROPERTIES); updateCalculatedFieldProperties(field, CALCULATED_PROPERTIES) }); return fields } function setFieldsState(stateFields, fields) { stateFields = stateFields || []; var fieldsById = {}; var id; (0, _iterator.each)(fields, function(_, field) { id = getFieldStateId(field); if (!fieldsById[id]) { fieldsById[id] = getFieldsById(fields, getFieldStateId(field)) } }); (0, _iterator.each)(fieldsById, function(id, fields) { setFieldsStateCore(getFieldsById(stateFields, id), fields) }); return fields } function getFieldsByGroup(fields, groupingField) { return fields.filter(function(field) { return field.groupName === groupingField.groupName && (0, _type.isNumeric)(field.groupIndex) && false !== field.visible }).map(function(field) { return (0, _extend.extend)(field, { areaIndex: groupingField.areaIndex, area: groupingField.area, expanded: (0, _type.isDefined)(field.expanded) ? field.expanded : groupingField.expanded, dataField: field.dataField || groupingField.dataField, dataType: field.dataType || groupingField.dataType, sortBy: field.sortBy || groupingField.sortBy, sortOrder: field.sortOrder || groupingField.sortOrder, sortBySummaryField: field.sortBySummaryField || groupingField.sortBySummaryField, sortBySummaryPath: field.sortBySummaryPath || groupingField.sortBySummaryPath, visible: field.visible || groupingField.visible, showTotals: (0, _type.isDefined)(field.showTotals) ? field.showTotals : groupingField.showTotals, showGrandTotals: (0, _type.isDefined)(field.showGrandTotals) ? field.showGrandTotals : groupingField.showGrandTotals }) }).sort(function(a, b) { return a.groupIndex - b.groupIndex }) } function sortFieldsByAreaIndex(fields) { fields.sort(function(field1, field2) { return field1.areaIndex - field2.areaIndex || field1.groupIndex - field2.groupIndex }) } function isAreaField(field, area) { var canAddFieldInArea = "data" === area || false !== field.visible; return field.area === area && !(0, _type.isDefined)(field.groupIndex) && canAddFieldInArea } function getFieldId(field, retrieveFieldsOptionValue) { var groupName = field.groupName || ""; return (field.dataField || groupName) + (field.groupInterval ? groupName + field.groupInterval : "NOGROUP") + (retrieveFieldsOptionValue ? "" : groupName) } function mergeFields(fields, storeFields, retrieveFieldsOptionValue) { var result = []; var fieldsDictionary = {}; var removedFields = {}; var mergedGroups = []; var dataTypes = (0, _uiPivot_grid2.getFieldsDataType)(fields); if (storeFields) { (0, _iterator.each)(storeFields, function(_, field) { fieldsDictionary[getFieldId(field, retrieveFieldsOptionValue)] = field }); (0, _iterator.each)(fields, function(_, field) { var fieldKey = getFieldId(field, retrieveFieldsOptionValue); var storeField = fieldsDictionary[fieldKey] || removedFields[fieldKey]; var mergedField; if (storeField) { if (storeField._initProperties) { resetFieldState(storeField, ALL_CALCULATED_PROPERTIES) } mergedField = (0, _extend.extend)({}, storeField, field, { _initProperties: null }) } else { fieldsDictionary[fieldKey] = mergedField = field }(0, _extend.extend)(mergedField, { dataType: dataTypes[field.dataField] }); delete fieldsDictionary[fieldKey]; removedFields[fieldKey] = storeField; result.push(mergedField) }); if (retrieveFieldsOptionValue) { (0, _iterator.each)(fieldsDictionary, function(_, field) { result.push(field) }) } } else { result = fields } result.push.apply(result, mergedGroups); return result } function getFields(that) { var result = new _deferred.Deferred; var store = that._store; var storeFields = store && store.getFields(that._fields); (0, _deferred.when)(storeFields).done(function(storeFields) { that._storeFields = storeFields; var mergedFields = mergeFields(that._fields, storeFields, that._retrieveFields); result.resolve(mergedFields) }).fail(result.reject); return result } function getSliceIndex(items, path) { var index = null; var pathValue = (path || []).join("."); if (pathValue.length) { (0, _uiPivot_grid2.foreachTree)(items, function(items) { var item = items[0]; var itemPath = (0, _uiPivot_grid2.createPath)(items).join("."); var textPath = (0, _iterator.map)(items, function(item) { return item.text }).reverse().join("."); if (pathValue === itemPath || item.key && textPath === pathValue) { index = items[0].index; return false } }) } return index } function getFieldSummaryValueSelector(field, dataSource, loadOptions, dimensionName) { var values = dataSource.values; var sortBySummaryFieldIndex = (0, _uiPivot_grid2.findField)(loadOptions.values, field.sortBySummaryField); var areRows = "rows" === dimensionName; var sortByDimension = areRows ? dataSource.columns : dataSource.rows; var grandTotalIndex = areRows ? dataSource.grandTotalRowIndex : dataSource.grandTotalColumnIndex; var sortBySummaryPath = field.sortBySummaryPath || []; var sliceIndex = sortBySummaryPath.length ? getSliceIndex(sortByDimension, sortBySummaryPath) : grandTotalIndex; if (values && values.length && sortBySummaryFieldIndex >= 0 && (0, _type.isDefined)(sliceIndex)) { return function(field) { var rowIndex = areRows ? field.index : sliceIndex; var columnIndex = areRows ? sliceIndex : field.index; var value = ((values[rowIndex] || [ [] ])[columnIndex] || [])[sortBySummaryFieldIndex]; return (0, _type.isDefined)(value) ? value : null } } } function getMemberForSortBy(sortBy, getAscOrder) { var member = "text"; if ("none" === sortBy) { member = "index" } else { if (getAscOrder || "displayText" !== sortBy) { member = "value" } } return member } function getSortingMethod(field, dataSource, loadOptions, dimensionName, getAscOrder) { var sortOrder = getAscOrder ? "asc" : field.sortOrder; var sortBy = getMemberForSortBy(field.sortBy, getAscOrder); var defaultCompare = field.sortingMethod ? function(a, b) { return field.sortingMethod(a, b) } : (0, _uiPivot_grid2.getCompareFunction)(function(item) { return item[sortBy] }); var summaryValueSelector = !getAscOrder && getFieldSummaryValueSelector(field, dataSource, loadOptions, dimensionName); var summaryCompare = summaryValueSelector && (0, _uiPivot_grid2.getCompareFunction)(summaryValueSelector); var sortingMethod = function(a, b) { var result = summaryCompare && summaryCompare(a, b) || defaultCompare(a, b); return "desc" === sortOrder ? -result : result }; return sortingMethod } function sortDimension(dataSource, loadOptions, dimensionName, getAscOrder) { var fields = loadOptions[dimensionName] || []; var baseIndex = loadOptions.headerName === dimensionName ? loadOptions.path.length : 0; var sortingMethodByLevel = []; (0, _uiPivot_grid2.foreachDataLevel)(dataSource[dimensionName], function(item, index) { var field = fields[index] || {}; var sortingMethod = sortingMethodByLevel[index] = sortingMethodByLevel[index] || getSortingMethod(field, dataSource, loadOptions, dimensionName, getAscOrder); item.sort(sortingMethod) }, baseIndex) } function sort(loadOptions, dataSource, getAscOrder) { sortDimension(dataSource, loadOptions, "rows", getAscOrder); sortDimension(dataSource, loadOptions, "columns", getAscOrder) } function formatHeaderItems(data, loadOptions, headerName) { return (0, _uiPivot_grid2.foreachTreeAsync)(data[headerName], function(items) { var item = items[0]; item.text = item.text || (0, _uiPivot_grid2.formatValue)(item.value, loadOptions[headerName][(0, _uiPivot_grid2.createPath)(items).length - 1]) }) } function formatHeaders(loadOptions, data) { return (0, _deferred.when)(formatHeaderItems(data, loadOptions, "columns"), formatHeaderItems(data, loadOptions, "rows")) } function updateCache(headerItems) { var d = new _deferred.Deferred; var cacheByPath = {}; (0, _deferred.when)((0, _uiPivot_grid2.foreachTreeAsync)(headerItems, function(items) { var path = (0, _uiPivot_grid2.createPath)(items).join("."); cacheByPath[path] = items[0] })).done(d.resolve); headerItems._cacheByPath = cacheByPath; return d } function _getAreaFields(fields, area) { var areaFields = []; (0, _iterator.each)(fields, function() { if (isAreaField(this, area)) { areaFields.push(this) } }); return areaFields } exports.sort = sort; return { ctor: function(options) { options = options || {}; var that = this; var store = createStore(options, function(progress) { that.fireEvent("progressChanged", [progress]) }); that._store = store; that._paginate = !!options.paginate; that._pageSize = options.pageSize || 40; that._data = { rows: [], columns: [], values: [] }; that._loadingCount = 0; that._isFieldsModified = false; (0, _iterator.each)(["changed", "loadError", "loadingChanged", "progressChanged", "fieldsPrepared", "expandValueChanging"], function(_, eventName) { var optionName = "on" + eventName[0].toUpperCase() + eventName.slice(1); if (Object.prototype.hasOwnProperty.call(options, optionName)) { this.on(eventName, options[optionName]) } }.bind(this)); that._retrieveFields = (0, _type.isDefined)(options.retrieveFields) ? options.retrieveFields : true; that._fields = options.fields || []; that._descriptions = options.descriptions ? (0, _extend.extend)(that._createDescriptions(), options.descriptions) : void 0; if (!store) { (0, _extend.extend)(true, that._data, options.store || options) } }, getData: function() { return this._data }, getAreaFields: function(area, collectGroups) { var areaFields = []; if (collectGroups || "data" === area) { areaFields = _getAreaFields(this._fields, area); sortFieldsByAreaIndex(areaFields) } else { var descriptions = this._descriptions || {}; areaFields = descriptions[DESCRIPTION_NAME_BY_AREA[area]] || [] } return areaFields }, fields: function(_fields) { var that = this; if (_fields) { that._fields = mergeFields(_fields, that._storeFields, that._retrieveFields); that._fieldsPrepared(that._fields) } return that._fields }, field: function field(id, options) { var that = this; var fields = that._fields; var field = fields && fields[(0, _type.isNumeric)(id) ? id : (0, _uiPivot_grid2.findField)(fields, id)]; if (field && options) { (0, _iterator.each)(options, function(optionName, optionValue) { var isInitialization = (0, _array.inArray)(optionName, STATE_PROPERTIES) < 0; (0, _uiPivot_grid2.setFieldProperty)(field, optionName, optionValue, isInitialization); if ("sortOrder" === optionName) { var levels = field.levels || []; for (var i = 0; i < levels.length; i++) { levels[i][optionName] = optionValue } } }); updateCalculatedFieldProperties(field, CALCULATED_PROPERTIES); that._descriptions = that._createDescriptions(field); that._isFieldsModified = true; that.fireEvent("fieldChanged", [field]) } return field }, getFieldValues: function(index, applyFilters, options) { var that = this; var field = this._fields && this._fields[index]; var store = this.store(); var loadFields = []; var loadOptions = { columns: loadFields, rows: [], values: this.getAreaFields("data"), filters: applyFilters ? this._fields.filter(function(f) { return f !== field && f.area && f.filterValues && f.filterValues.length }) : [], skipValues: true }; var searchValue; var d = new _deferred.Deferred; if (options) { searchValue = options.searchValue; loadOptions.columnSkip = options.skip; loadOptions.columnTake = options.take } if (field && store) { (0, _iterator.each)(field.levels || [field], function() { loadFields.push((0, _extend.extend)({}, this, { expanded: true, filterValues: null, sortOrder: "asc", sortBySummaryField: null, searchValue: searchValue })) }); store.load(loadOptions).done(function(data) { if (loadOptions.columnSkip) { data.columns = data.columns.slice(loadOptions.columnSkip) } if (loadOptions.columnTake) { data.columns = data.columns.slice(0, loadOptions.columnTake) } formatHeaders(loadOptions, data); if (!loadOptions.columnTake) { that._sort(loadOptions, data) } d.resolve(data.columns) }).fail(d) } else { d.reject() } return d }, reload: function() { return this.load({ reload: true }) }, filter: function() { var store = this._store; return store.filter.apply(store, arguments) }, load: function(options) { var that = this; var d = new _deferred.Deferred; options = options || {}; that.beginLoading(); d.fail(function(e) { that.fireEvent("loadError", [e]) }).always(function() { that.endLoading() }); function loadTask() { that._delayedLoadTask = void 0; if (!that._descriptions) { (0, _deferred.when)(getFields(that)).done(function(fields) { that._fieldsPrepared(fields); that._loadCore(options, d) }).fail(d.reject).fail(that._loadErrorHandler) } else { that._loadCore(options, d) } } if (that.store()) { that._delayedLoadTask = (0, _common.executeAsync)(loadTask) } else { loadTask() } return d }, createDrillDownDataSource: function(params) { return this._store.createDrillDownDataSource(this._descriptions, params) }, _createDescriptions: function(currentField) { var that = this; var fields = that.fields(); var descriptions = { rows: [], columns: [], values: [], filters: [] }; (0, _iterator.each)(["row", "column", "data", "filter"], function(_, areaName) { (0, _array.normalizeIndexes)(_getAreaFields(fields, areaName), "areaIndex", currentField) }); (0, _iterator.each)(fields || [], function(_, field) { var descriptionName = DESCRIPTION_NAME_BY_AREA[field.area]; var dimension = descriptions[descriptionName]; var groupName = field.groupName; if (groupName && !(0, _type.isNumeric)(field.groupIndex)) { field.levels = getFieldsByGroup(fields, field) } if (!dimension || groupName && (0, _type.isNumeric)(field.groupIndex) || false === field.visible && "data" !== field.area && "filter" !== field.area) { return } if (field.levels && dimension !== descriptions.filters && dimension !== descriptions.values) { dimension.push.apply(dimension, field.levels); if (field.filterValues && field.filterValues.length) { descriptions.filters.push(field) } } else { dimension.push(field) } }); (0, _iterator.each)(descriptions, function(_, fields) { sortFieldsByAreaIndex(fields) }); var indices = {}; (0, _iterator.each)(descriptions.values, function(_, field) { var expression = field.calculateSummaryValue; if ((0, _type.isFunction)(expression)) { var summaryCell = (0, _uiPivot_grid.createMockSummaryCell)(descriptions, fields, indices); expression(summaryCell) } }); return descriptions }, _fieldsPrepared: function(fields) { var that = this; that._fields = fields; (0, _iterator.each)(fields, function(index, field) { field.index = index; updateCalculatedFieldProperties(field, ALL_CALCULATED_PROPERTIES) }); var currentFieldState = getFieldsState(fields, ["caption"]); that.fireEvent("fieldsPrepared", [fields]); for (var i = 0; i < fields.length; i++) { if (fields[i].caption !== currentFieldState[i].caption) { (0, _uiPivot_grid2.setFieldProperty)(fields[i], "caption", fields[i].caption, true) } } that._descriptions = that._createDescriptions() }, isLoading: function() { return this._loadingCount > 0 }, state: function(_state, skipLoading) { var that = this; if (arguments.length) { _state = (0, _extend.extend)({ rowExpandedPaths: [], columnExpandedPaths: [] }, _state); if (!that._descriptions) { that.beginLoading(); (0, _deferred.when)(getFields(that)).done(function(fields) { that._fields = setFieldsState(_state.fields, fields); that._fieldsPrepared(fields); !skipLoading && that.load(_state) }).always(function() { that.endLoading() }) } else { that._fields = setFieldsState(_state.fields, that._fields); that._descriptions = that._createDescriptions(); !skipLoading && that.load(_state) } } else { return { fields: getFieldsState(that._fields, STATE_PROPERTIES), columnExpandedPaths: getExpandedPaths(that._data, that._descriptions, "columns"), rowExpandedPaths: getExpandedPaths(that._data, that._descriptions, "rows") } } }, beginLoading: function() { this._changeLoadingCount(1) }, endLoading: function() { this._changeLoadingCount(-1) }, _changeLoadingCount: function(increment) { var oldLoading = this.isLoading(); this._loadingCount += increment; var newLoading = this.isLoading(); if (oldLoading ^ newLoading) { this.fireEvent("loadingChanged", [newLoading]) } }, _hasPagingValues: function(options, area, oppositeIndex) { var takeField = area + "Take"; var skipField = area + "Skip"; var values = this._data.values; var items = this._data[area + "s"]; var oppositeArea = "row" === area ? "column" : "row"; var indices = []; if (options.path && options.area === area) { var headerItem = findHeaderItem(items, options.path); items = headerItem && headerItem.children; if (!items) { return false } } if (options.oppositePath && options.area === oppositeArea) { var _headerItem = findHeaderItem(items, options.oppositePath); items = _headerItem && _headerItem.children; if (!items) { return false } } for (var i = options[skipField]; i < options[skipField] + options[takeField]; i++) { if (items[i]) { indices.push(items[i].index) } } return indices.every(function(index) { if (void 0 !== index) { if ("row" === area) { return (values[index] || [])[oppositeIndex] } else { return (values[oppositeIndex] || [])[index] } } }) }, _processPagingCacheByArea: function(options, pageSize, area) { var takeField = area + "Take"; var skipField = area + "Skip"; var items = this._data[area + "s"]; var oppositeArea = "row" === area ? "column" : "row"; var item; if (options[takeField]) { if (options.path && options.area === area) { var headerItem = findHeaderItem(items, options.path); items = headerItem && headerItem.children || [] } if (options.oppositePath && options.area === oppositeArea) { var _headerItem2 = findHeaderItem(items, options.oppositePath); items = _headerItem2 && _headerItem2.children || [] } do { item = items[options[skipField]]; if (item && void 0 !== item.index) { if (this._hasPagingValues(options, oppositeArea, item.index)) { options[skipField]++; options[takeField]-- } else { break } } } while (item && void 0 !== item.index && options[takeField]); if (options[takeField]) { var start = Math.floor(options[skipField] / pageSize) * pageSize; var end = Math.ceil((options[skipField] + options[takeField]) / pageSize) * pageSize; options[skipField] = start; options[takeField] = end - start } } }, _processPagingCache: function(storeLoadOptions) { var pageSize = this._pageSize; if (pageSize < 0) { return } for (var i = 0; i < storeLoadOptions.length; i++) { this._processPagingCacheByArea(storeLoadOptions[i], pageSize, "row"); this._processPagingCacheByArea(storeLoadOptions[i], pageSize, "column") } }, _loadCore: function(options, deferred) { var that = this; var store = this._store; var descriptions = this._descriptions; var reload = options.reload || this.paginate() && that._isFieldsModified; var paginate = this.paginate(); var headerName = DESCRIPTION_NAME_BY_AREA[options.area]; options = options || {}; if (store) { (0, _extend.extend)(options, descriptions); options.columnExpandedPaths = options.columnExpandedPaths || getExpandedPaths(this._data, options, "columns", that._lastLoadOptions); options.rowExpandedPaths = options.rowExpandedPaths || getExpandedPaths(this._data, options, "rows", that._lastLoadOptions); if (paginate) { options.pageSize = this._pageSize } if (headerName) { options.headerName = headerName } that.beginLoading(); deferred.always(function() { that.endLoading() }); var storeLoadOptions = [options]; that.fireEvent("customizeStoreLoadOptions", [storeLoadOptions, reload]); if (!reload) { that._processPagingCache(storeLoadOptions) } storeLoadOptions = storeLoadOptions.filter(function(options) { return !(options.rows.length && 0 === options.rowTake) && !(options.columns.length && 0 === options.columnTake) }); if (!storeLoadOptions.length) { that._update(deferred); return } var results = storeLoadOptions.map(function(options) { return store.load(options) }); _deferred.when.apply(null, results).done(function() { var results = arguments; for (var i = 0; i < results.length; i++) { var _options = storeLoadOptions[i]; var data = results[i]; var isLast = i === results.length - 1; if (_options.path) { that.applyPartialDataSource(_options.area, _options.path, data, isLast ? deferred : false, _options.oppositePath) } else { if (paginate && !reload && isDataExists(that._data)) { that.mergePartialDataSource(data, isLast ? deferred : false) } else { (0, _extend.extend)(that._data, data); that._lastLoadOptions = _options; that._update(isLast ? deferred : false) } } } }).fail(deferred.reject) } else { that._update(deferred) } }, _sort: function(descriptions, data, getAscOrder) { var store = this._store; if (store && !this._paginate) { sort(descriptions, data, getAscOrder) } }, paginate: function() { return this._paginate && this._store && this._store.supportPaging() }, isEmpty: function() { var dataFields = this.getAreaFields("data"); var data = this.getData(); return !dataFields.length || !data.values.length }, _update: function(deferred) { var that = this; var descriptions = that._descriptions; var loadedData = that._data; var dataFields = descriptions.values; var expressionsUsed = areExpressionsUsed(dataFields); (0, _deferred.when)(formatHeaders(descriptions, loadedData), updateCache(loadedData.rows), updateCache(loadedData.columns)).done(function() { if (expressionsUsed) { that._sort(descriptions, loadedData, expressionsUsed); !that.isEmpty() && (0, _uiPivot_grid.applyDisplaySummaryMode)(descriptions, loadedData) } that._sort(descriptions, loadedData); !that.isEmpty() && isRunningTotalUsed(dataFields) && (0, _uiPivot_grid.applyRunningTotal)(descriptions, loadedData); that._data = loadedData; false !== deferred && (0, _deferred.when)(deferred).done(function() { that._isFieldsModified = false; that.fireEvent("changed"); if ((0, _type.isDefined)(that._data.grandTotalRowIndex)) { loadedData.grandTotalRowIndex = that._data.grandTotalRowIndex } if ((0, _type.isDefined)(that._data.grandTotalColumnIndex)) { loadedData.grandTotalColumnIndex = that._data.grandTotalColumnIndex } }); deferred && deferred.resolve(that._data) }); return deferred }, store: function() { return this._store }, collapseHeaderItem: function(area, path) { var that = this; var headerItems = "column" === area ? that._data.columns : that._data.rows; var headerItem = findHeaderItem(headerItems, path); var field = that.getAreaFields(area)[path.length - 1]; if (headerItem && headerItem.children) { that.fireEvent("expandValueChanging", [{ area: area, path: path, expanded: false }]); if (field) { field.expanded = false } headerItem.collapsedChildren = headerItem.children; delete headerItem.children; that._update(); if (that.paginate()) { that.load() } return true } return false }, collapseAll: function(id) { var _this = this; var dataChanged = false; var field = this.field(id) || {}; var areaOffsets = [(0, _array.inArray)(field, this.getAreaFields(field.area))]; field.expanded = false; if (field && field.levels) { areaOffsets = []; field.levels.forEach(function(f) { areaOffsets.push((0, _array.inArray)(f, _this.getAreaFields(field.area))); f.expanded = false }) }(0, _uiPivot_grid2.foreachTree)(this._data[field.area + "s"], function(items) { var item = items[0]; var path = (0, _uiPivot_grid2.createPath)(items); if (item && item.children && areaOffsets.indexOf(path.length - 1) !== -1) { item.collapsedChildren = item.children; delete item.children; dataChanged = true } }, true); dataChanged && this._update() }, expandAll: function(id) { var field = this.field(id); if (field && field.area) { field.expanded = true; if (field && field.levels) { field.levels.forEach(function(f) { f.expanded = true }) } this.load() } }, expandHeaderItem: function(area, path) { var that = this; var headerItems = "column" === area ? that._data.columns : that._data.rows; var headerItem = findHeaderItem(headerItems, path); if (headerItem && !headerItem.children) { var hasCache = !!headerItem.collapsedChildren; var options = { area: area, path: path, expanded: true, needExpandData: !hasCache }; that.fireEvent("expandValueChanging", [options]); if (hasCache) { headerItem.children = headerItem.collapsedChildren; delete headerItem.collapsedChildren; that._update() } else { if (this.store()) { that.load(options) } } return hasCache } return false }, mergePartialDataSource: function(dataSource, deferred) { var that = this; var loadedData = that._data; if (dataSource && dataSource.values) { dataSource.rows = dataSource.rows || []; dataSource.columns = dataSource.columns || []; var newRowItemIndexesToCurrent = updateHeaderItems(loadedData.rows, dataSource.rows, loadedData.grandTotalColumnIndex); var newColumnItemIndexesToCurrent = updateHeaderItems(loadedData.columns, dataSource.columns, loadedData.grandTotalColumnIndex); (0, _deferred.when)(newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent).done(function(newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent) { if (newRowItemIndexesToCurrent.length || newColumnItemIndexesToCurrent.length) { updateDataSourceCells(loadedData, dataSource.values, newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent) } that._update(deferred) }) } }, applyPartialDataSource: function(area, path, dataSource, deferred, oppositePath) { var that = this; var loadedData = that._data; var headerItems = "column" === area ? loadedData.columns : loadedData.rows; var oppositeHeaderItems = "column" === area ? loadedData.rows : loadedData.columns; var newRowItemIndexesToCurrent; var newColumnItemIndexesToCurrent; if (dataSource && dataSource.values) { dataSource.rows = dataSource.rows || []; dataSource.columns = dataSource.columns || []; var headerItem = findHeaderItem(headerItems, path); var oppositeHeaderItem = oppositePath && findHeaderItem(oppositeHeaderItems, oppositePath); if (headerItem) { if ("column" === area) { newColumnItemIndexesToCurrent = updateHeaderItemChildren(headerItems, headerItem, dataSource.columns, loadedData.grandTotalColumnIndex); if (oppositeHeaderItem) { newRowItemIndexesToCurrent = updateHeaderItemChildren(oppositeHeaderItems, oppositeHeaderItem, dataSource.rows, loadedData.grandTotalRowIndex) } else { newRowItemIndexesToCurrent = updateHeaderItems(loadedData.rows, dataSource.rows, loadedData.grandTotalRowIndex) } } else { newRowItemIndexesToCurrent = updateHeaderItemChildren(headerItems, headerItem, dataSource.rows, loadedData.grandTotalRowIndex); if (oppositeHeaderItem) { newColumnItemIndexesToCurrent = updateHeaderItemChildren(oppositeHeaderItems, oppositeHeaderItem, dataSource.columns, loadedData.grandTotalColumnIndex) } else { newColumnItemIndexesToCurrent = updateHeaderItems(loadedData.columns, dataSource.columns, loadedData.grandTotalColumnIndex) } }(0, _deferred.when)(newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent).done(function(newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent) { if ("row" === area && newRowItemIndexesToCurrent.length || "column" === area && newColumnItemIndexesToCurrent.length) { updateDataSourceCells(loadedData, dataSource.values, newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent) } that._update(deferred) }) } } }, dispose: function() { var that = this; var delayedLoadTask = that._delayedLoadTask; this._disposeEvents(); if (delayedLoadTask) { delayedLoadTask.abort() } this._isDisposed = true }, isDisposed: function() { return !!this._isDisposed } } }()).include(_events_mixin2.default); module.exports.sort = exports.sort }, /*!*******************************************************************************************!*\ !*** ./artifacts/transpiled/ui/scheduler/workspaces/ui.scheduler.work_space.indicator.js ***! \*******************************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _uiScheduler = __webpack_require__( /*! ./ui.scheduler.work_space */ 384); var _uiScheduler2 = _interopRequireDefault(_uiScheduler); var _component_registrator = __webpack_require__( /*! ../../../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _date = __webpack_require__( /*! ../../../core/utils/date */ 22); var _date2 = _interopRequireDefault(_date); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 0); var _window = __webpack_require__( /*! ../../../core/utils/window */ 7); var _window2 = _interopRequireDefault(_window); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var toMs = _date2.default.dateToMilliseconds; var SCHEDULER_DATE_TIME_INDICATOR_CLASS = "dx-scheduler-date-time-indicator"; var TIME_PANEL_CURRENT_TIME_CELL_CLASS = "dx-scheduler-time-panel-current-time-cell"; var HEADER_CURRENT_TIME_CELL_CLASS = "dx-scheduler-header-panel-current-time-cell"; var SchedulerWorkSpaceIndicator = _uiScheduler2.default.inherit({ _getToday: function() { var date = this.option("indicatorTime") || new Date; return this.invoke("convertDateByTimezone", date) || date }, _needRenderDateTimeIndicator: function() { var today = this._getToday(); var endViewDate = _date2.default.trimTime(this.getEndViewDate()); return _date2.default.dateInRange(today, this._firstViewDate, new Date(endViewDate.getTime() + toMs("day"))) }, needRenderDateTimeIndication: function() { if (!_window2.default.hasWindow()) { return false } var today = this._getToday(); return today >= _date2.default.trimTime(new Date(this.getStartViewDate())) }, _renderDateTimeIndication: function() { if (this.needRenderDateTimeIndication()) { if (this.option("shadeUntilCurrentTime")) { this._shader.render(this) } if (this.option("showCurrentTimeIndicator") && this._needRenderDateTimeIndicator()) { var groupCount = this._getGroupCount() || 1; var $container = this._dateTableScrollable.$content(); var height = this.getIndicationHeight(); var rtlOffset = this._getRtlOffset(this.getCellWidth()); if (height > 0) { this._renderIndicator(height, rtlOffset, $container, groupCount) } } } }, _renderIndicator: function(height, rtlOffset, $container, groupCount) { for (var i = 0; i < groupCount; i++) { var $indicator = this._createIndicator($container); $indicator.width(this.getCellWidth()); this._groupedStrategy.shiftIndicator($indicator, height, rtlOffset, i) } }, _createIndicator: function($container) { var $indicator = (0, _renderer2.default)("
").addClass(SCHEDULER_DATE_TIME_INDICATOR_CLASS); $container.append($indicator); return $indicator }, _getRtlOffset: function(width) { return this.option("rtlEnabled") ? this._dateTableScrollable.$content().get(0).getBoundingClientRect().width - this.getTimePanelWidth() - width : 0 }, _setIndicationUpdateInterval: function() { if (!this.option("showCurrentTimeIndicator") || 0 === this.option("indicatorUpdateInterval")) { return } this._clearIndicatorUpdateInterval(); this._indicatorInterval = setInterval(function() { this._refreshDateTimeIndication() }.bind(this), this.option("indicatorUpdateInterval")) }, _clearIndicatorUpdateInterval: function() { if (this._indicatorInterval) { clearInterval(this._indicatorInterval); delete this._indicatorInterval } }, _isVerticalShader: function() { return true }, getIndicationWidth: function(groupIndex) { var maxWidth = this.getCellWidth() * this._getCellCount(); var difference = this._getIndicatorDuration(); if (difference > this._getCellCount()) { difference = this._getCellCount() } var width = difference * this.getRoundedCellWidth(groupIndex, groupIndex * this._getCellCount(), difference); return maxWidth < width ? maxWidth : width }, getIndicatorOffset: function(groupIndex) { var difference = this._getIndicatorDuration() - 1; var offset = difference * this.getRoundedCellWidth(groupIndex, groupIndex * this._getCellCount(), difference); return offset }, _getIndicatorDuration: function() { var today = this._getToday(); var firstViewDate = new Date(this._firstViewDate); var timeDiff = today.getTime() - firstViewDate.getTime(); if ("workWeek" === this.option("type")) { timeDiff -= this._getWeekendsCount(Math.round(timeDiff / toMs("day"))) * toMs("day") } return Math.ceil((timeDiff + 1) / toMs("day")) }, getIndicationHeight: function() { var today = this._getToday(); var cellHeight = this.getCellHeight(); var date = new Date(this._firstViewDate); if (this._needRenderDateTimeIndicator()) { date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate()) } var duration = today.getTime() - date.getTime(); var cellCount = duration / this.getCellDuration(); return cellCount * cellHeight }, _dispose: function() { this._clearIndicatorUpdateInterval(); this.callBase.apply(this, arguments) }, _refreshDateTimeIndication: function() { this._cleanDateTimeIndicator(); this._shader && this._shader.clean(); this._renderDateTimeIndication() }, _isCurrentTime: function(date) { if (this.option("showCurrentTimeIndicator") && this._needRenderDateTimeIndicator()) { var today = this._getToday(); var result = false; date = new Date(date); date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate()); var startCellDate = new Date(date); var endCellDate = new Date(date); if (_date2.default.sameDate(today, date)) { startCellDate = startCellDate.setMilliseconds(date.getMilliseconds() - this.getCellDuration() + 1); endCellDate = endCellDate.setMilliseconds(date.getMilliseconds() + this.getCellDuration()); result = _date2.default.dateInRange(today, startCellDate, endCellDate) } return result } }, _isCurrentTimeHeaderCell: function(headerIndex) { var result = false; if (this.option("showCurrentTimeIndicator") && this._needRenderDateTimeIndicator()) { var date = this._getDateByIndex(headerIndex); var now = this.option("indicatorTime") || new Date; result = _date2.default.sameDate(date, now) } return result }, _getTimeCellClass: function(i) { var startViewDate = this._getTimeCellDate(i); var cellClass = this.callBase(i); if (this._isCurrentTime(startViewDate)) { return cellClass + " " + TIME_PANEL_CURRENT_TIME_CELL_CLASS } return cellClass }, _getHeaderPanelCellClass: function(i) { var cellClass = this.callBase(i); if (this._isCurrentTimeHeaderCell(i)) { return cellClass + " " + HEADER_CURRENT_TIME_CELL_CLASS } return cellClass }, _cleanView: function() { this.callBase(); this._cleanDateTimeIndicator() }, _dimensionChanged: function() { this.callBase(); this._refreshDateTimeIndication() }, _cleanDateTimeIndicator: function() { this.$element().find("." + SCHEDULER_DATE_TIME_INDICATOR_CLASS).remove() }, _cleanWorkSpace: function() { this.callBase(); this._renderDateTimeIndication(); this._setIndicationUpdateInterval() }, _optionChanged: function(args) { switch (args.name) { case "showCurrentTimeIndicator": case "indicatorTime": this._cleanWorkSpace(); break; case "indicatorUpdateInterval": this._setIndicationUpdateInterval(); break; case "showAllDayPanel": this.callBase(args); this._refreshDateTimeIndication(); break; case "allDayExpanded": this.callBase(args); this._refreshDateTimeIndication(); break; case "crossScrollingEnabled": this.callBase(args); this._refreshDateTimeIndication(); break; case "shadeUntilCurrentTime": this._refreshDateTimeIndication(); break; default: this.callBase(args) } }, _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { showCurrentTimeIndicator: true, indicatorTime: new Date, indicatorUpdateInterval: 5 * toMs("minute"), shadeUntilCurrentTime: true }) } }); (0, _component_registrator2.default)("dxSchedulerWorkSpace", SchedulerWorkSpaceIndicator); module.exports = SchedulerWorkSpaceIndicator }, /*!************************************************************************!*\ !*** ./artifacts/transpiled/ui/file_manager/ui.file_manager.common.js ***! \************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _type2 = _interopRequireDefault(_type); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var ErrorCode = { NoAccess: 0, FileExists: 1, FileNotFound: 2, DirectoryExists: 3, Other: 32767 }; var whenSome = function(arg, onSuccess, onError) { onSuccess = onSuccess || _common.noop; onError = onError || _common.noop; if (!Array.isArray(arg)) { arg = [arg] } var deferreds = arg.map(function(item, index) { return (0, _deferred.when)(item).then(function() { _type2.default.isFunction(onSuccess) && onSuccess() }, function(error) { if (!error) { error = {} } error.index = index; _type2.default.isFunction(onError) && onError(error) }) }); return _deferred.when.apply(null, deferreds) }; module.exports = whenSome; module.exports.ErrorCode = ErrorCode }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/ui/diagram/diagram_importer.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getDiagram = void 0; var _ui = __webpack_require__( /*! ../widget/ui.errors */ 17); var _ui2 = _interopRequireDefault(_ui); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var diagram; function getDiagram() { if (!diagram) { diagram = requestDiagram() } return diagram } function requestDiagram() { var window = (0, _window.getWindow)(); var diagram = window && window.DevExpress && window.DevExpress.diagram || __webpack_require__( /*! devexpress-diagram */ 745); if (!diagram) { throw _ui2.default.Error("E1041", "devexpress-diagram") } return diagram } exports.getDiagram = getDiagram }, /*!*******************************************************!*\ !*** ./artifacts/transpiled/viz/components/legend.js ***! \*******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _utils = __webpack_require__( /*! ../core/utils */ 10); var _extend2 = __webpack_require__( /*! ../../core/utils/extend */ 0); var _layout_element = __webpack_require__( /*! ../core/layout_element */ 242); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _title = __webpack_require__( /*! ../core/title */ 105); var _title2 = _interopRequireDefault(_title); var _object = __webpack_require__( /*! ../../core/utils/object */ 47); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var _Number = Number; var _math = Math; var _round = _math.round; var _max = _math.max; var _min = _math.min; var _ceil = _math.ceil; var _isDefined = _type.isDefined; var _isFunction = _type.isFunction; var _enumParser = _utils.enumParser; var _normalizeEnum = _utils.normalizeEnum; var _extend = _extend2.extend; var DEFAULT_MARGIN = 10; var DEFAULT_MARKER_HATCHING_WIDTH = 2; var DEFAULT_MARKER_HATCHING_STEP = 5; var CENTER = "center"; var RIGHT = "right"; var LEFT = "left"; var TOP = "top"; var BOTTOM = "bottom"; var HORIZONTAL = "horizontal"; var VERTICAL = "vertical"; var INSIDE = "inside"; var OUTSIDE = "outside"; var NONE = "none"; var HEIGHT = "height"; var WIDTH = "width"; var parseHorizontalAlignment = _enumParser([LEFT, CENTER, RIGHT]); var parseVerticalAlignment = _enumParser([TOP, BOTTOM]); var parseOrientation = _enumParser([VERTICAL, HORIZONTAL]); var parseItemTextPosition = _enumParser([LEFT, RIGHT, TOP, BOTTOM]); var parsePosition = _enumParser([OUTSIDE, INSIDE]); var parseItemsAlignment = _enumParser([LEFT, CENTER, RIGHT]); function getState(state, color) { if (!state) { return } var colorFromAction = state.fill; return { fill: colorFromAction === NONE ? color : colorFromAction, hatching: _extend({}, state.hatching, { step: DEFAULT_MARKER_HATCHING_STEP, width: DEFAULT_MARKER_HATCHING_WIDTH }) } } function parseMargins(options) { var margin = options.margin; if (margin >= 0) { margin = _Number(options.margin); margin = { top: margin, bottom: margin, left: margin, right: margin } } else { margin = { top: margin.top >= 0 ? _Number(margin.top) : DEFAULT_MARGIN, bottom: margin.bottom >= 0 ? _Number(margin.bottom) : DEFAULT_MARGIN, left: margin.left >= 0 ? _Number(margin.left) : DEFAULT_MARGIN, right: margin.right >= 0 ? _Number(margin.right) : DEFAULT_MARGIN } } options.margin = margin } function getSizeItem(options, markerSize, labelBBox) { var defaultXMargin = 7; var defaultTopMargin = 4; var width; var height; switch (options.itemTextPosition) { case LEFT: case RIGHT: width = markerSize + defaultXMargin + labelBBox.width; height = _max(markerSize, labelBBox.height); break; case TOP: case BOTTOM: width = _max(markerSize, labelBBox.width); height = markerSize + defaultTopMargin + labelBBox.height } return { width: width, height: height } } function calculateBBoxLabelAndMarker(markerBBox, labelBBox) { var bBox = {}; bBox.left = _min(markerBBox.x, labelBBox.x); bBox.top = _min(markerBBox.y, labelBBox.y); bBox.right = _max(markerBBox.x + markerBBox.width, labelBBox.x + labelBBox.width); bBox.bottom = _max(markerBBox.y + markerBBox.height, labelBBox.y + labelBBox.height); return bBox } function applyMarkerState(id, idToIndexMap, items, stateName) { var item = idToIndexMap && items[idToIndexMap[id]]; if (item) { item.marker.smartAttr(item.states[stateName]) } } function parseOptions(options, textField, allowInsidePosition) { if (!options) { return null } var debug = __webpack_require__( /*! ../../core/utils/console */ 73).debug; debug.assertParam(options.visible, "Visibility was not passed"); debug.assertParam(options.markerSize, "markerSize was not passed"); debug.assertParam(options.font.color, "fontColor was not passed"); debug.assertParam(options.font.family, "fontFamily was not passed"); debug.assertParam(options.font.size, "fontSize was not passed"); debug.assertParam(options.paddingLeftRight, "paddingLeftRight was not passed"); debug.assertParam(options.paddingTopBottom, "paddingTopBottom was not passed"); debug.assertParam(options.columnItemSpacing, "columnItemSpacing was not passed"); debug.assertParam(options.rowItemSpacing, "rowItemSpacing was not passed"); parseMargins(options); options.horizontalAlignment = parseHorizontalAlignment(options.horizontalAlignment, RIGHT); options.verticalAlignment = parseVerticalAlignment(options.verticalAlignment, options.horizontalAlignment === CENTER ? BOTTOM : TOP); options.orientation = parseOrientation(options.orientation, options.horizontalAlignment === CENTER ? HORIZONTAL : VERTICAL); options.itemTextPosition = parseItemTextPosition(options.itemTextPosition, options.orientation === HORIZONTAL ? BOTTOM : RIGHT); options.position = allowInsidePosition ? parsePosition(options.position, OUTSIDE) : OUTSIDE; options.itemsAlignment = parseItemsAlignment(options.itemsAlignment, null); options.hoverMode = _normalizeEnum(options.hoverMode); options.customizeText = _isFunction(options.customizeText) ? options.customizeText : function() { return this[textField] }; options.customizeHint = _isFunction(options.customizeHint) ? options.customizeHint : _common.noop; options._incidentOccurred = options._incidentOccurred || _common.noop; return options } function createSquareMarker(renderer, size) { return renderer.rect(0, 0, size, size) } function createCircleMarker(renderer, size) { return renderer.circle(size / 2, size / 2, size / 2) } function isCircle(type) { return "circle" === _normalizeEnum(type) } function inRect(rect, x, y) { return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom } function checkLinesSize(lines, layoutOptions, countItems, margins) { var position = { x: 0, y: 0 }; var maxMeasureLength = 0; var maxAltMeasureLength = 0; var margin = 0; if ("y" === layoutOptions.direction) { margin = margins.top + margins.bottom } else { margin = margins.left + margins.right } lines.forEach(function(line, i) { var firstItem = line[0]; var lineLength = line.length; line.forEach(function(item, index) { var offset = item.offset || layoutOptions.spacing; position[layoutOptions.direction] += item[layoutOptions.measure] + (index !== lineLength - 1 ? offset : 0); maxMeasureLength = _max(maxMeasureLength, position[layoutOptions.direction]) }); position[layoutOptions.direction] = 0; position[layoutOptions.altDirection] += firstItem[layoutOptions.altMeasure] + firstItem.altOffset || layoutOptions.altSpacing; maxAltMeasureLength = _max(maxAltMeasureLength, position[layoutOptions.altDirection]) }); if (maxMeasureLength + margin > layoutOptions.length) { layoutOptions.countItem = decreaseItemCount(layoutOptions, countItems); return true } } function decreaseItemCount(layoutOptions, countItems) { layoutOptions.altCountItem++; return _ceil(countItems / layoutOptions.altCountItem) } function getLineLength(line, layoutOptions) { return line.reduce(function(lineLength, item) { var offset = item.offset || layoutOptions.spacing; return lineLength + item[layoutOptions.measure] + offset }, 0) } function getMaxLineLength(lines, layoutOptions) { return lines.reduce(function(maxLineLength, line) { return _max(maxLineLength, getLineLength(line, layoutOptions)) }, 0) } function getInitPositionForDirection(line, layoutOptions, maxLineLength) { var lineLength = getLineLength(line, layoutOptions); var initPosition; switch (layoutOptions.itemsAlignment) { case RIGHT: initPosition = maxLineLength - lineLength; break; case CENTER: initPosition = (maxLineLength - lineLength) / 2; break; default: initPosition = 0 } return initPosition } function getPos(layoutOptions) { switch (layoutOptions.itemTextPosition) { case BOTTOM: return { horizontal: CENTER, vertical: TOP }; case TOP: return { horizontal: CENTER, vertical: BOTTOM }; case LEFT: return { horizontal: RIGHT, vertical: CENTER }; case RIGHT: return { horizontal: LEFT, vertical: CENTER } } } function getLines(lines, layoutOptions, itemIndex) { var tableLine = {}; if (itemIndex % layoutOptions.countItem === 0) { if (layoutOptions.markerOffset) { lines.push([], []) } else { lines.push([]) } } if (layoutOptions.markerOffset) { tableLine.firstLine = lines[lines.length - 1]; tableLine.secondLine = lines[lines.length - 2] } else { tableLine.firstLine = tableLine.secondLine = lines[lines.length - 1] } return tableLine } function setMaxInLine(line, measure) { var maxLineSize = line.reduce(function(maxLineSize, item) { var itemMeasure = item ? item[measure] : maxLineSize; return _max(maxLineSize, itemMeasure) }, 0); line.forEach(function(item) { if (item) { item[measure] = maxLineSize } }) } function transpose(array) { var width = array.length; var height = array[0].length; var i; var j; var transposeArray = []; for (i = 0; i < height; i++) { transposeArray[i] = []; for (j = 0; j < width; j++) { transposeArray[i][j] = array[j][i] } } return transposeArray } function getAlign(position) { switch (position) { case TOP: case BOTTOM: return CENTER; case LEFT: return RIGHT; case RIGHT: return LEFT } } var getMarkerCreator = function(type) { return isCircle(type) ? createCircleMarker : createSquareMarker }; function getTitleHorizontalAlignment(options) { if (options.horizontalAlignment === CENTER) { return CENTER } else { if (options.itemTextPosition === RIGHT) { return LEFT } else { if (options.itemTextPosition === LEFT) { return RIGHT } else { return CENTER } } } } var _Legend = exports.Legend = function(settings) { var that = this; that._renderer = settings.renderer; that._legendGroup = settings.group; that._backgroundClass = settings.backgroundClass; that._itemGroupClass = settings.itemGroupClass; that._textField = settings.textField; that._getCustomizeObject = settings.getFormatObject; that._titleGroupClass = settings.titleGroupClass; that._allowInsidePosition = settings.allowInsidePosition }; var legendPrototype = _Legend.prototype = (0, _object.clone)(_layout_element.LayoutElement.prototype); (0, _extend2.extend)(legendPrototype, { constructor: _Legend, getOptions: function() { return this._options }, update: function(data, options) { var themeManagerTitleOptions = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; var that = this; options = that._options = parseOptions(options, that._textField, that._allowInsidePosition) || {}; that._data = data && options.customizeItems && options.customizeItems(data.slice()) || data; that._boundingRect = { width: 0, height: 0, x: 0, y: 0 }; if (that.isVisible() && !that._title) { that._title = new _title2.default.Title({ renderer: that._renderer, cssClass: that._titleGroupClass, root: that._legendGroup }) } if (that._title) { var titleOptions = options.title; themeManagerTitleOptions.horizontalAlignment = getTitleHorizontalAlignment(options); that._title.update(themeManagerTitleOptions, titleOptions) } this.erase(); return that }, isVisible: function() { return this._options && this._options.visible }, draw: function(width, height) { var that = this; var options = that._options; var items = that._getItemData(); that._size = { width: width, height: height }; that.erase(); if (!(that.isVisible() && items && items.length)) { return that } that._insideLegendGroup = that._renderer.g().enableLinks().append(that._legendGroup); that._title.changeLink(that._insideLegendGroup); that._createBackground(); if (that._title.hasText()) { var horizontalPadding = that._background ? 2 * that._options.paddingLeftRight : 0; that._title.draw(width - horizontalPadding, height) } that._markersGroup = that._renderer.g().attr({ "class": that._itemGroupClass }).append(that._insideLegendGroup); that._createItems(items); that._locateElements(options); that._finalUpdate(options); var size = that.getLayoutOptions(); if (size.width > width || size.height > height) { that.freeSpace() } return that }, probeDraw: function(width, height) { return this.draw(width, height) }, _createItems: function(items) { var that = this; var options = that._options; var initMarkerSize = options.markerSize; var renderer = that._renderer; var bBox; var maxBBoxHeight = 0; var createMarker = getMarkerCreator(options.markerShape); that._markersId = {}; that._items = (items || []).map(function(dataItem, i) { var group = that._markersGroup; var markerSize = _Number(dataItem.size > 0 ? dataItem.size : initMarkerSize); var stateOfDataItem = dataItem.states; var normalState = stateOfDataItem.normal; var normalStateFill = normalState.fill; var marker = createMarker(renderer, markerSize).attr({ fill: normalStateFill || options.markerColor || options.defaultColor, opacity: normalState.opacity }).append(group); var label = that._createLabel(dataItem, group); var states = { normal: { fill: normalStateFill }, hovered: getState(stateOfDataItem.hover, normalStateFill), selected: getState(stateOfDataItem.selection, normalStateFill) }; var labelBBox = label.getBBox(); if (void 0 !== dataItem.id) { that._markersId[dataItem.id] = i } bBox = getSizeItem(options, markerSize, labelBBox); maxBBoxHeight = _max(maxBBoxHeight, bBox.height); that._createHint(dataItem, label, marker); return { label: label, labelBBox: labelBBox, group: group, bBox: bBox, marker: marker, markerSize: markerSize, tracker: { id: dataItem.id, argument: dataItem.argument, argumentIndex: dataItem.argumentIndex }, states: states, itemTextPosition: options.itemTextPosition, markerOffset: 0, bBoxes: [] } }); if (options.equalRowHeight) { that._items.forEach(function(item) { return item.bBox.height = maxBBoxHeight }) } }, _getItemData: function() { var items = this._data || []; var options = this._options || {}; if (options.inverted) { items = items.slice().reverse() } return items.filter(function(i) { return i.visible }) }, _finalUpdate: function(options) { this._adjustBackgroundSettings(options); this._setBoundingRect(options.margin) }, erase: function() { var that = this; var insideLegendGroup = that._insideLegendGroup; insideLegendGroup && insideLegendGroup.dispose(); that._insideLegendGroup = that._markersGroup = that._x1 = that._x2 = that._y2 = that._y2 = null; return that }, _locateElements: function(locationOptions) { this._moveInInitialValues(); this._locateRowsColumns(locationOptions) }, _moveInInitialValues: function() { var that = this; that._title.hasText() && that._title.move([0, 0]); that._legendGroup && that._legendGroup.move(0, 0); that._background && that._background.attr({ x: 0, y: 0, width: 0, height: 0 }) }, applySelected: function(id) { applyMarkerState(id, this._markersId, this._items, "selected"); return this }, applyHover: function(id) { applyMarkerState(id, this._markersId, this._items, "hovered"); return this }, resetItem: function(id) { applyMarkerState(id, this._markersId, this._items, "normal"); return this }, _createLabel: function(data, group) { var labelFormatObject = this._getCustomizeObject(data); var options = this._options; var align = getAlign(options.itemTextPosition); var text = options.customizeText.call(labelFormatObject, labelFormatObject); var fontStyle = _isDefined(data.textOpacity) ? _extend({}, options.font, { opacity: data.textOpacity }) : options.font; return this._renderer.text(text, 0, 0).css((0, _utils.patchFontOptions)(fontStyle)).attr({ align: align, "class": options.cssClass }).append(group) }, _createHint: function(data, label, marker) { var labelFormatObject = this._getCustomizeObject(data); var text = this._options.customizeHint.call(labelFormatObject, labelFormatObject); if (_isDefined(text) && "" !== text) { label.setTitle(text); marker.setTitle(text) } }, _createBackground: function() { var that = this; var isInside = that._options.position === INSIDE; var color = that._options.backgroundColor; var fill = color || (isInside ? that._options.containerBackgroundColor : NONE); if (that._options.border.visible || (isInside || color) && color !== NONE) { that._background = that._renderer.rect(0, 0, 0, 0).attr({ fill: fill, "class": that._backgroundClass }).append(that._insideLegendGroup) } }, _locateRowsColumns: function(options) { var that = this; var iteration = 0; var layoutOptions = that._getItemsLayoutOptions(); var countItems = that._items.length; var lines; do { lines = []; that._createLines(lines, layoutOptions); that._alignLines(lines, layoutOptions); iteration++ } while (checkLinesSize(lines, layoutOptions, countItems, options.margin) && iteration < countItems); that._applyItemPosition(lines, layoutOptions) }, _createLines: function(lines, layoutOptions) { this._items.forEach(function(item, i) { var tableLine = getLines(lines, layoutOptions, i); var labelBox = { width: item.labelBBox.width, height: item.labelBBox.height, element: item.label, bBox: item.labelBBox, pos: getPos(layoutOptions), itemIndex: i }; var markerBox = { width: item.markerSize, height: item.markerSize, element: item.marker, pos: { horizontal: CENTER, vertical: CENTER }, bBox: { width: item.markerSize, height: item.markerSize, x: 0, y: 0 }, itemIndex: i }; var firstItem; var secondItem; var offsetDirection = layoutOptions.markerOffset ? "altOffset" : "offset"; if (layoutOptions.inverseLabelPosition) { firstItem = labelBox; secondItem = markerBox } else { firstItem = markerBox; secondItem = labelBox } firstItem[offsetDirection] = layoutOptions.labelOffset; tableLine.secondLine.push(firstItem); tableLine.firstLine.push(secondItem) }) }, _alignLines: function(lines, layoutOptions) { var i; var measure = layoutOptions.altMeasure; lines.forEach(function(line) { return setMaxInLine(line, measure) }); measure = layoutOptions.measure; if (layoutOptions.itemsAlignment) { if (layoutOptions.markerOffset) { for (i = 0; i < lines.length;) { transpose([lines[i++], lines[i++]]).forEach(processLine) } } } else { transpose(lines).forEach(processLine) } function processLine(line) { setMaxInLine(line, measure) } }, _applyItemPosition: function(lines, layoutOptions) { var that = this; var position = { x: 0, y: 0 }; var maxLineLength = getMaxLineLength(lines, layoutOptions); lines.forEach(function(line) { var firstItem = line[0]; var altOffset = firstItem.altOffset || layoutOptions.altSpacing; position[layoutOptions.direction] = getInitPositionForDirection(line, layoutOptions, maxLineLength); line.forEach(function(item) { var offset = item.offset || layoutOptions.spacing; var wrap = new _layout_element.WrapperLayoutElement(item.element, item.bBox); var itemBBoxOptions = { x: position.x, y: position.y, width: item.width, height: item.height }; var itemBBox = new _layout_element.WrapperLayoutElement(null, itemBBoxOptions); var itemLegend = that._items[item.itemIndex]; wrap.position({ of: itemBBox, my: item.pos, at: item.pos }); itemLegend.bBoxes.push(itemBBox); position[layoutOptions.direction] += item[layoutOptions.measure] + offset }); position[layoutOptions.altDirection] += firstItem[layoutOptions.altMeasure] + altOffset }); this._items.forEach(function(item) { var itemBBox = calculateBBoxLabelAndMarker(item.bBoxes[0].getLayoutOptions(), item.bBoxes[1].getLayoutOptions()); var horizontal = that._options.columnItemSpacing / 2; var vertical = that._options.rowItemSpacing / 2; item.tracker.left = itemBBox.left - horizontal; item.tracker.right = itemBBox.right + horizontal; item.tracker.top = itemBBox.top - vertical; item.tracker.bottom = itemBBox.bottom + vertical }) }, _getItemsLayoutOptions: function() { var that = this; var options = that._options; var orientation = options.orientation; var layoutOptions = { itemsAlignment: options.itemsAlignment, orientation: options.orientation }; var width = that._size.width - (that._background ? 2 * options.paddingLeftRight : 0); var height = that._size.height - (that._background ? 2 * options.paddingTopBottom : 0); if (orientation === HORIZONTAL) { layoutOptions.length = width; layoutOptions.spacing = options.columnItemSpacing; layoutOptions.direction = "x"; layoutOptions.measure = WIDTH; layoutOptions.altMeasure = HEIGHT; layoutOptions.altDirection = "y"; layoutOptions.altSpacing = options.rowItemSpacing; layoutOptions.countItem = options.columnCount; layoutOptions.altCountItem = options.rowCount; layoutOptions.marginTextLabel = 4; layoutOptions.labelOffset = 7; if (options.itemTextPosition === BOTTOM || options.itemTextPosition === TOP) { layoutOptions.labelOffset = 4; layoutOptions.markerOffset = true } } else { layoutOptions.length = height; layoutOptions.spacing = options.rowItemSpacing; layoutOptions.direction = "y"; layoutOptions.measure = HEIGHT; layoutOptions.altMeasure = WIDTH; layoutOptions.altDirection = "x"; layoutOptions.altSpacing = options.columnItemSpacing; layoutOptions.countItem = options.rowCount; layoutOptions.altCountItem = options.columnCount; layoutOptions.marginTextLabel = 7; layoutOptions.labelOffset = 4; if (options.itemTextPosition === RIGHT || options.itemTextPosition === LEFT) { layoutOptions.labelOffset = 7; layoutOptions.markerOffset = true } } if (!layoutOptions.countItem) { if (layoutOptions.altCountItem) { layoutOptions.countItem = _ceil(that._items.length / layoutOptions.altCountItem) } else { layoutOptions.countItem = that._items.length } } if (options.itemTextPosition === TOP || options.itemTextPosition === LEFT) { layoutOptions.inverseLabelPosition = true } layoutOptions.itemTextPosition = options.itemTextPosition; layoutOptions.altCountItem = layoutOptions.altCountItem || _ceil(that._items.length / layoutOptions.countItem); return layoutOptions }, _adjustBackgroundSettings: function(locationOptions) { if (!this._background) { return } var border = locationOptions.border; var legendBox = this._calculateTotalBox(); var backgroundSettings = { x: _round(legendBox.x - locationOptions.paddingLeftRight), y: _round(legendBox.y - locationOptions.paddingTopBottom), width: _round(legendBox.width) + 2 * locationOptions.paddingLeftRight, height: _round(legendBox.height), opacity: locationOptions.backgroundOpacity }; if (border.visible && border.width && border.color && border.color !== NONE) { backgroundSettings["stroke-width"] = border.width; backgroundSettings.stroke = border.color; backgroundSettings["stroke-opacity"] = border.opacity; backgroundSettings.dashStyle = border.dashStyle; backgroundSettings.rx = border.cornerRadius || 0; backgroundSettings.ry = border.cornerRadius || 0 } this._background.attr(backgroundSettings) }, _setBoundingRect: function(margin) { if (!this._insideLegendGroup) { return } var box = this._calculateTotalBox(); box.height += margin.top + margin.bottom; box.widthWithoutMargins = box.width; box.width += margin.left + margin.right; box.x -= margin.left; box.y -= margin.top; this._boundingRect = box }, _calculateTotalBox: function() { var markerBox = this._markersGroup.getBBox(); var titleBox = this._title.getCorrectedLayoutOptions(); var box = this._insideLegendGroup.getBBox(); var verticalPadding = this._background ? 2 * this._options.paddingTopBottom : 0; box.height = markerBox.height + titleBox.height + verticalPadding; titleBox.width > box.width && (box.width = titleBox.width); return box }, getActionCallback: function(point) { var that = this; if (that._options.visible) { return function(act) { that[act](point.index) } } else { return _common.noop } }, getLayoutOptions: function() { var options = this._options; var boundingRect = this._insideLegendGroup ? this._boundingRect : { width: 0, height: 0, x: 0, y: 0 }; if (options) { boundingRect.verticalAlignment = options.verticalAlignment; boundingRect.horizontalAlignment = options.horizontalAlignment; if (options.orientation === HORIZONTAL) { boundingRect.cutLayoutSide = options.verticalAlignment; boundingRect.cutSide = "vertical" } else { if (options.horizontalAlignment === CENTER) { boundingRect.cutLayoutSide = options.verticalAlignment; boundingRect.cutSide = "vertical" } else { boundingRect.cutLayoutSide = options.horizontalAlignment; boundingRect.cutSide = "horizontal" } } boundingRect.position = { horizontal: options.horizontalAlignment, vertical: options.verticalAlignment }; return boundingRect } return null }, shift: function(x, y) { var that = this; var box = {}; if (that._insideLegendGroup) { that._insideLegendGroup.attr({ translateX: x - that._boundingRect.x, translateY: y - that._boundingRect.y }) } that._title && that._shiftTitle(that._boundingRect.widthWithoutMargins); that._markersGroup && that._shiftMarkers(); if (that._insideLegendGroup) { box = that._legendGroup.getBBox() } that._x1 = box.x; that._y1 = box.y; that._x2 = box.x + box.width; that._y2 = box.y + box.height; return that }, _shiftTitle: function(boxWidth) { var that = this; var title = that._title; var titleBox = title.getCorrectedLayoutOptions(); if (!titleBox || !title.hasText()) { return } var width = boxWidth - (that._background ? 2 * that._options.paddingLeftRight : 0); var titleOptions = title.getOptions(); var titleY = titleBox.y + titleOptions.margin.top; var titleX = 0; if (titleOptions.verticalAlignment === BOTTOM) { titleY += that._markersGroup.getBBox().height } if (titleOptions.horizontalAlignment === RIGHT) { titleX = width - titleBox.width } else { if (titleOptions.horizontalAlignment === CENTER) { titleX = (width - titleBox.width) / 2 } } title.shift(titleX, titleY) }, _shiftMarkers: function() { var titleBox = this._title.getLayoutOptions(); var markerBox = this._markersGroup.getBBox(); var titleOptions = this._title.getOptions() || {}; var center = 0; var y = 0; if (titleBox.width > markerBox.width && this._options.horizontalAlignment === CENTER) { center = titleBox.width / 2 - markerBox.width / 2 } if (titleOptions.verticalAlignment === TOP) { y = titleBox.height } if (0 !== center || 0 !== y) { this._markersGroup.attr({ translateX: center, translateY: y }); this._items.forEach(function(item) { item.tracker.left += center; item.tracker.right += center; item.tracker.top += y; item.tracker.bottom += y }) } }, getPosition: function() { return this._options.position }, coordsIn: function(x, y) { return x >= this._x1 && x <= this._x2 && y >= this._y1 && y <= this._y2 }, getItemByCoord: function(x, y) { var items = this._items; var legendGroup = this._insideLegendGroup; x -= legendGroup.attr("translateX"); y -= legendGroup.attr("translateY"); for (var i = 0; i < items.length; i++) { if (inRect(items[i].tracker, x, y)) { return items[i].tracker } } return null }, dispose: function() { var that = this; that._title && that._title.dispose(); that._legendGroup = that._insideLegendGroup = that._title = that._renderer = that._options = that._data = that._items = null; return that }, layoutOptions: function() { if (!this.isVisible()) { return null } var pos = this.getLayoutOptions(); return { horizontalAlignment: this._options.horizontalAlignment, verticalAlignment: this._options.verticalAlignment, side: pos.cutSide, priority: 1, position: this.getPosition() } }, measure: function(size) { this.draw(size[0], size[1]); var rect = this.getLayoutOptions(); return [rect.width, rect.height] }, move: function(rect) { this.shift(rect[0], rect[1]) }, freeSpace: function() { this._options._incidentOccurred("W2104"); this.erase() } }); exports.plugin = { name: "legend", init: function() { var that = this; var group = this._renderer.g().attr({ "class": this._rootClassPrefix + "-legend" }).enableLinks().append(that._renderer.root); that._legend = new exports.Legend({ renderer: that._renderer, group: group, itemGroupClass: this._rootClassPrefix + "-item", titleGroupClass: this._rootClassPrefix + "-title", textField: "text", getFormatObject: function(data) { return { item: data.item, text: data.text } } }); that._layout.add(that._legend) }, extenders: { _applyTilesAppearance: function() { var that = this; this._items.forEach(function(item) { that._applyLegendItemStyle(item.id, item.getState()) }) }, _buildNodes: function() { this._createLegendItems() } }, members: { _applyLegendItemStyle: function(id, state) { var legend = this._legend; switch (state) { case "hover": legend.applyHover(id); break; case "selection": legend.applySelected(id); break; default: legend.resetItem(id) } }, _createLegendItems: function() { if (this._legend.update(this._getLegendData(), this._getOption("legend"), this._themeManager.theme("legend").title)) { this._requestChange(["LAYOUT"]) } } }, dispose: function() { this._legend.dispose() }, customize: function(constructor) { constructor.prototype._proxyData.push(function(x, y) { if (this._legend.coordsIn(x, y)) { var item = this._legend.getItemByCoord(x, y); if (item) { return { id: item.id, type: "legend" } } } }); constructor.addChange({ code: "LEGEND", handler: function() { this._createLegendItems() }, isThemeDependent: true, option: "legend", isOptionChange: true }) } }; var __getMarkerCreator = getMarkerCreator; exports._DEBUG_stubMarkerCreator = function(callback) { getMarkerCreator = function() { return callback } }; exports._DEBUG_restoreMarkerCreator = function() { getMarkerCreator = __getMarkerCreator } }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/viz/series/points/bar_point.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend; var _extend = extend; var _math = Math; var _floor = _math.floor; var _abs = _math.abs; var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118); var CANVAS_POSITION_DEFAULT = "canvas_position_default"; var DEFAULT_BAR_TRACKER_SIZE = 9; var CORRECTING_BAR_TRACKER_VALUE = 4; var RIGHT = "right"; var LEFT = "left"; var TOP = "top"; var BOTTOM = "bottom"; module.exports = _extend({}, symbolPoint, { correctCoordinates: function(correctOptions) { var that = this; var correction = _floor(correctOptions.offset - correctOptions.width / 2); if (that._options.rotated) { that.height = correctOptions.width; that.yCorrection = correction; that.xCorrection = null } else { that.width = correctOptions.width; that.xCorrection = correction; that.yCorrection = null } }, _getGraphicBBox: function() { return { x: this.x, y: this.y, width: this.width, height: this.height } }, _getLabelConnector: function(location) { return this._getGraphicBBox(location) }, _getLabelPosition: function() { var that = this; var position; var initialValue = that.initialValue; var invert = that._getValTranslator().getBusinessRange().invert; var isDiscreteValue = "discrete" === that.series.valueAxisType; var isFullStacked = that.series.isFullStackedSeries(); var notAxisInverted = !isDiscreteValue && (initialValue >= 0 && !invert || initialValue < 0 && invert) || isDiscreteValue && !invert || isFullStacked; if (!that._options.rotated) { position = notAxisInverted ? TOP : BOTTOM } else { position = notAxisInverted ? RIGHT : LEFT } return position }, _getLabelCoords: function(label) { var that = this; var coords; if (0 === that.initialValue && that.series.isFullStackedSeries()) { if (!this._options.rotated) { coords = that._getLabelCoordOfPosition(label, TOP) } else { coords = that._getLabelCoordOfPosition(label, RIGHT) } } else { if ("inside" === label.getLayoutOptions().position) { coords = that._getLabelCoordOfPosition(label, "inside") } else { coords = symbolPoint._getLabelCoords.call(this, label) } } return coords }, _checkLabelPosition: function(label, coord) { var that = this; var visibleArea = that._getVisibleArea(); if (that._isPointInVisibleArea(visibleArea, that._getGraphicBBox())) { return that._moveLabelOnCanvas(coord, visibleArea, label.getBoundingRect()) } return coord }, hideInsideLabel: function(label, coord) { var graphicBBox = this._getGraphicBBox(); var labelBBox = label.getBoundingRect(); if (this._options.resolveLabelsOverlapping) { if ((coord.y <= graphicBBox.y && coord.y + labelBBox.height >= graphicBBox.y + graphicBBox.height || coord.x <= graphicBBox.x && coord.x + labelBBox.width >= graphicBBox.x + graphicBBox.width) && !(coord.y > graphicBBox.y + graphicBBox.height || coord.y + labelBBox.height < graphicBBox.y || coord.x > graphicBBox.x + graphicBBox.width || coord.x + labelBBox.width < graphicBBox.x)) { label.draw(false); return true } } return false }, _moveLabelOnCanvas: function(coord, visibleArea, labelBBox) { var x = coord.x; var y = coord.y; if (visibleArea.minX > x) { x = visibleArea.minX } if (visibleArea.maxX < x + labelBBox.width) { x = visibleArea.maxX - labelBBox.width } if (visibleArea.minY > y) { y = visibleArea.minY } if (visibleArea.maxY < y + labelBBox.height) { y = visibleArea.maxY - labelBBox.height } return { x: x, y: y } }, _showForZeroValues: function() { return this._options.label.showForZeroValues || this.initialValue }, _drawMarker: function(renderer, group, animationEnabled) { var that = this; var style = that._getStyle(); var r = that._options.cornerRadius; var rotated = that._options.rotated; var _that$getMarkerCoords = that.getMarkerCoords(), x = _that$getMarkerCoords.x, y = _that$getMarkerCoords.y, width = _that$getMarkerCoords.width, height = _that$getMarkerCoords.height; if (animationEnabled) { if (rotated) { width = 0; x = that.defaultX } else { height = 0; y = that.defaultY } } that.graphic = renderer.rect(x, y, width, height).attr({ rx: r, ry: r }).smartAttr(style).data({ "chart-data-point": that }).append(group) }, _getSettingsForTracker: function() { var that = this; var y = that.y; var height = that.height; var x = that.x; var width = that.width; if (that._options.rotated) { if (1 === width) { width = DEFAULT_BAR_TRACKER_SIZE; x -= CORRECTING_BAR_TRACKER_VALUE } } else { if (1 === height) { height = DEFAULT_BAR_TRACKER_SIZE; y -= CORRECTING_BAR_TRACKER_VALUE } } return { x: x, y: y, width: width, height: height } }, getGraphicSettings: function() { var graphic = this.graphic; return { x: graphic.attr("x"), y: graphic.attr("y"), height: graphic.attr("height"), width: graphic.attr("width") } }, _getEdgeTooltipParams: function() { var isPositive = this.value >= 0; var xCoord; var yCoord; var invertedBusinessRange = this._getValTranslator().getBusinessRange().invert; var x = this.x, y = this.y, width = this.width, height = this.height; if (this._options.rotated) { yCoord = y + height / 2; if (invertedBusinessRange) { xCoord = isPositive ? x : x + width } else { xCoord = isPositive ? x + width : x } } else { xCoord = x + width / 2; if (invertedBusinessRange) { yCoord = isPositive ? y + height : y } else { yCoord = isPositive ? y : y + height } } return { x: xCoord, y: yCoord, offset: 0 } }, getTooltipParams: function(location) { if ("edge" === location) { return this._getEdgeTooltipParams() } var center = this.getCenterCoord(); center.offset = 0; return center }, getCenterCoord: function() { var width = this.width, height = this.height, x = this.x, y = this.y; return { x: x + width / 2, y: y + height / 2 } }, _truncateCoord: function(coord, minBounce, maxBounce) { if (null === coord) { return coord } if (coord < minBounce) { return minBounce } if (coord > maxBounce) { return maxBounce } return coord }, _getErrorBarBaseEdgeLength: function() { return this._options.rotated ? this.height : this.width }, _translateErrorBars: function(argVisibleArea) { symbolPoint._translateErrorBars.call(this); if (this._errorBarPos < argVisibleArea[0] || this._errorBarPos > argVisibleArea[1]) { this._errorBarPos = void 0 } }, _translate: function() { var that = this; var rotated = that._options.rotated; var valAxis = rotated ? "x" : "y"; var argAxis = rotated ? "y" : "x"; var valIntervalName = rotated ? "width" : "height"; var argIntervalName = rotated ? "height" : "width"; var argTranslator = that._getArgTranslator(); var valTranslator = that._getValTranslator(); var argVisibleArea = that.series.getArgumentAxis().getVisibleArea(); var valVisibleArea = that.series.getValueAxis().getVisibleArea(); var arg; var val; var minVal; arg = argTranslator.translate(that.argument); that[argAxis] = arg = null === arg ? arg : arg + (that[argAxis + "Correction"] || 0); val = valTranslator.translate(that.value, 1); minVal = valTranslator.translate(that.minValue); that["v" + valAxis] = val; that["v" + argAxis] = arg + that[argIntervalName] / 2; val = that._truncateCoord(val, valVisibleArea[0], valVisibleArea[1]); minVal = that._truncateCoord(minVal, valVisibleArea[0], valVisibleArea[1]); that[valIntervalName] = _abs(val - minVal); val = val < minVal ? val : minVal; that._calculateVisibility(rotated ? val : arg, rotated ? arg : val, that.width, that.height); that[valAxis] = null === val ? val : val + (that[valAxis + "Correction"] || 0); that["min" + valAxis.toUpperCase()] = null === minVal ? minVal : minVal + (that[valAxis + "Correction"] || 0); that["default" + valAxis.toUpperCase()] = valTranslator.translate(CANVAS_POSITION_DEFAULT); that._translateErrorBars(argVisibleArea); if (that.inVisibleArea && null !== that[argAxis]) { if (that[argAxis] < argVisibleArea[0]) { that[argIntervalName] = that[argIntervalName] - (argVisibleArea[0] - that[argAxis]); that[argAxis] = argVisibleArea[0] } if (that[argAxis] + that[argIntervalName] > argVisibleArea[1]) { that[argIntervalName] = argVisibleArea[1] - that[argAxis] } } }, _updateMarker: function(animationEnabled, style) { this.graphic.smartAttr(_extend({}, style, !animationEnabled ? this.getMarkerCoords() : {})) }, getMarkerCoords: function() { var that = this; var x = that.x; var y = that.y; var width = that.width; var height = that.height; var argAxis = that.series.getArgumentAxis(); var rotated = that._options.rotated; if (argAxis.getAxisPosition) { var axisOptions = argAxis.getOptions(); var edgeOffset = Math.round(axisOptions.width / 2); var argAxisPosition = argAxis.getAxisPosition(); if (axisOptions.visible) { if (!rotated) { height -= that.minY === that.defaultY && that.minY === argAxisPosition - argAxis.getAxisShift() ? edgeOffset : 0; height < 0 && (height = 0) } else { var isStartFromAxis = that.minX === that.defaultX && that.minX === argAxisPosition - argAxis.getAxisShift(); x += isStartFromAxis ? edgeOffset : 0; width -= isStartFromAxis ? edgeOffset : 0; width < 0 && (width = 0) } } } return { x: x, y: y, width: width, height: height } }, coordsIn: function(x, y) { var that = this; return x >= that.x && x <= that.x + that.width && y >= that.y && y <= that.y + that.height } }) }, /*!********************************************************!*\ !*** ./artifacts/transpiled/viz/series/line_series.js ***! \********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var series = __webpack_require__( /*! ./scatter_series */ 106); var chartScatterSeries = series.chart; var polarScatterSeries = series.polar; var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var vizUtils = __webpack_require__( /*! ../core/utils */ 10); var mathUtils = __webpack_require__( /*! ../../core/utils/math */ 28); var normalizeAngle = vizUtils.normalizeAngle; var DISCRETE = "discrete"; var _map = vizUtils.map; var _extend = extend; var _each = each; exports.chart = {}; exports.polar = {}; function clonePoint(point, newX, newY, newAngle) { var p = objectUtils.clone(point); p.x = newX; p.y = newY; p.angle = newAngle; return p } function getTangentPoint(point, prevPoint, centerPoint, tan, nextStepAngle) { var correctAngle = point.angle + nextStepAngle; var cosSin = vizUtils.getCosAndSin(correctAngle); var x = centerPoint.x + (point.radius + tan * nextStepAngle) * cosSin.cos; var y = centerPoint.y - (point.radius + tan * nextStepAngle) * cosSin.sin; return clonePoint(prevPoint, x, y, correctAngle) } function obtainCubicBezierTCoef(p, p0, p1, p2, p3) { var d = p0 - p; var c = 3 * p1 - 3 * p0; var b = 3 * p2 - 6 * p1 + 3 * p0; var a = p3 - 3 * p2 + 3 * p1 - p0; return mathUtils.solveCubicEquation(a, b, c, d) } var lineMethods = { autoHidePointMarkersEnabled: function() { return true }, _applyGroupSettings: function(style, settings, group) { var that = this; settings = _extend(settings, style); that._applyElementsClipRect(settings); group.attr(settings) }, _setGroupsSettings: function(animationEnabled) { var that = this; var style = that._styles.normal; that._applyGroupSettings(style.elements, { "class": "dxc-elements" }, that._elementsGroup); that._bordersGroup && that._applyGroupSettings(style.border, { "class": "dxc-borders" }, that._bordersGroup); chartScatterSeries._setGroupsSettings.call(that, animationEnabled); animationEnabled && that._markersGroup && that._markersGroup.attr({ opacity: .001 }) }, _createGroups: function() { var that = this; that._createGroup("_elementsGroup", that, that._group); that._areBordersVisible() && that._createGroup("_bordersGroup", that, that._group); chartScatterSeries._createGroups.call(that) }, _areBordersVisible: function() { return false }, _getDefaultSegment: function(segment) { return { line: _map(segment.line || [], function(pt) { return pt.getDefaultCoords() }) } }, _prepareSegment: function(points) { return { line: points } }, _parseLineOptions: function(options, defaultColor) { return { stroke: options.color || defaultColor, "stroke-width": options.width, dashStyle: options.dashStyle || "solid" } }, _parseStyle: function(options, defaultColor) { return { elements: this._parseLineOptions(options, defaultColor) } }, _applyStyle: function(style) { var that = this; that._elementsGroup && that._elementsGroup.attr(style.elements); _each(that._graphics || [], function(_, graphic) { graphic.line && graphic.line.attr({ "stroke-width": style.elements["stroke-width"] }).sharp() }) }, _drawElement: function(segment, group) { return { line: this._createMainElement(segment.line, { "stroke-width": this._styles.normal.elements["stroke-width"] }).append(group) } }, _removeElement: function(element) { element.line.remove() }, _updateElement: function(element, segment, animate, animationComplete) { var params = { points: segment.line }; var lineElement = element.line; animate ? lineElement.animate(params, {}, animationComplete) : lineElement.attr(params) }, _animateComplete: function() { var that = this; chartScatterSeries._animateComplete.call(that); that._markersGroup && that._markersGroup.animate({ opacity: 1 }, { duration: that._defaultDuration }) }, _animate: function() { var that = this; var lastIndex = that._graphics.length - 1; _each(that._graphics || [], function(i, elem) { var complete; if (i === lastIndex) { complete = function() { that._animateComplete() } } that._updateElement(elem, that._segments[i], true, complete) }) }, _drawPoint: function(options) { chartScatterSeries._drawPoint.call(this, { point: options.point, groups: options.groups }) }, _createMainElement: function(points, settings) { return this._renderer.path(points, "line").attr(settings).sharp() }, _sortPoints: function(points, rotated) { return rotated ? points.sort(function(p1, p2) { return p2.y - p1.y }) : points.sort(function(p1, p2) { return p1.x - p2.x }) }, _drawSegment: function(points, animationEnabled, segmentCount, lastSegment) { var that = this; var rotated = that._options.rotated; var forceDefaultSegment = false; var segment = that._prepareSegment(points, rotated, lastSegment); that._segments.push(segment); if (!that._graphics[segmentCount]) { that._graphics[segmentCount] = that._drawElement(animationEnabled ? that._getDefaultSegment(segment) : segment, that._elementsGroup) } else { if (!animationEnabled) { that._updateElement(that._graphics[segmentCount], segment) } else { if (forceDefaultSegment) { that._updateElement(that._graphics[segmentCount], that._getDefaultSegment(segment)) } } } }, _getTrackerSettings: function() { var that = this; var defaultTrackerWidth = that._defaultTrackerWidth; var strokeWidthFromElements = that._styles.normal.elements["stroke-width"]; return { "stroke-width": strokeWidthFromElements > defaultTrackerWidth ? strokeWidthFromElements : defaultTrackerWidth, fill: "none" } }, _getMainPointsFromSegment: function(segment) { return segment.line }, _drawTrackerElement: function(segment) { return this._createMainElement(this._getMainPointsFromSegment(segment), this._getTrackerSettings(segment)) }, _updateTrackerElement: function(segment, element) { var settings = this._getTrackerSettings(segment); settings.points = this._getMainPointsFromSegment(segment); element.attr(settings) }, checkSeriesViewportCoord: function(axis, coord) { if (0 === this._points.length) { return false } var range = axis.isArgumentAxis ? this.getArgumentRange() : this.getViewport(); var min = axis.getTranslator().translate(range.categories ? range.categories[0] : range.min); var max = axis.getTranslator().translate(range.categories ? range.categories[range.categories.length - 1] : range.max); var rotated = this.getOptions().rotated; var inverted = axis.getOptions().inverted; return axis.isArgumentAxis && (!rotated && !inverted || rotated && inverted) || !axis.isArgumentAxis && (rotated && !inverted || !rotated && inverted) ? coord >= min && coord <= max : coord >= max && coord <= min }, getSeriesPairCoord: function(coord, isArgument) { var that = this; var oppositeCoord = null; var nearestPoints = this.getNearestPointsByCoord(coord, isArgument); var needValueCoord = isArgument && !that._options.rotated || !isArgument && that._options.rotated; for (var i = 0; i < nearestPoints.length; i++) { var p = nearestPoints[i]; var k = (p[1].vy - p[0].vy) / (p[1].vx - p[0].vx); var b = p[0].vy - p[0].vx * k; var tmpCoord = void 0; if (p[1].vx - p[0].vx === 0) { tmpCoord = needValueCoord ? p[0].vy : p[0].vx } else { tmpCoord = needValueCoord ? k * coord + b : (coord - b) / k } if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) { oppositeCoord = tmpCoord; break } } return oppositeCoord } }; var lineSeries = exports.chart.line = _extend({}, chartScatterSeries, lineMethods, { getPointCenterByArg: function(arg) { var value = this.getArgumentAxis().getTranslator().translate(arg); return { x: value, y: value } } }); exports.chart.stepline = _extend({}, lineSeries, { _calculateStepLinePoints: function(points) { var segment = []; var coordName = this._options.rotated ? "x" : "y"; _each(points, function(i, pt) { var point; if (!i) { segment.push(pt); return } var step = segment[segment.length - 1][coordName]; if (step !== pt[coordName]) { point = objectUtils.clone(pt); point[coordName] = step; segment.push(point) } segment.push(pt) }); return segment }, _prepareSegment: function(points) { return lineSeries._prepareSegment(this._calculateStepLinePoints(points)) }, getSeriesPairCoord: function(coord, isArgument) { var oppositeCoord; var rotated = this._options.rotated; var isOpposite = !isArgument && !rotated || isArgument && rotated; var coordName = !isOpposite ? "vx" : "vy"; var oppositeCoordName = !isOpposite ? "vy" : "vx"; var nearestPoints = this.getNearestPointsByCoord(coord, isArgument); for (var i = 0; i < nearestPoints.length; i++) { var p = nearestPoints[i]; var tmpCoord = void 0; if (isArgument) { tmpCoord = coord !== p[1][coordName] ? p[0][oppositeCoordName] : p[1][oppositeCoordName] } else { tmpCoord = coord === p[0][coordName] ? p[0][oppositeCoordName] : p[1][oppositeCoordName] } if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) { oppositeCoord = tmpCoord; break } } return oppositeCoord } }); exports.chart.spline = _extend({}, lineSeries, { _calculateBezierPoints: function(src, rotated) { var bezierPoints = []; var pointsCopy = src; var checkExtremum = function(otherPointCoord, pointCoord, controlCoord) { return otherPointCoord > pointCoord && controlCoord > otherPointCoord || otherPointCoord < pointCoord && controlCoord < otherPointCoord ? otherPointCoord : controlCoord }; if (1 !== pointsCopy.length) { pointsCopy.forEach(function(curPoint, i) { var leftControlX; var leftControlY; var rightControlX; var rightControlY; var prevPoint = pointsCopy[i - 1]; var nextPoint = pointsCopy[i + 1]; var x1; var x2; var y1; var y2; var lambda = .5; var a; var b; var c; var xc; var yc; var shift; if (!i || i === pointsCopy.length - 1) { bezierPoints.push(curPoint, curPoint); return } var xCur = curPoint.x; var yCur = curPoint.y; x1 = prevPoint.x; x2 = nextPoint.x; y1 = prevPoint.y; y2 = nextPoint.y; var curIsExtremum = !!(!rotated && (yCur <= prevPoint.y && yCur <= nextPoint.y || yCur >= prevPoint.y && yCur >= nextPoint.y) || rotated && (xCur <= prevPoint.x && xCur <= nextPoint.x || xCur >= prevPoint.x && xCur >= nextPoint.x)); if (curIsExtremum) { if (!rotated) { rightControlY = leftControlY = yCur; rightControlX = (xCur + nextPoint.x) / 2; leftControlX = (xCur + prevPoint.x) / 2 } else { rightControlX = leftControlX = xCur; rightControlY = (yCur + nextPoint.y) / 2; leftControlY = (yCur + prevPoint.y) / 2 } } else { a = y2 - y1; b = x1 - x2; c = y1 * x2 - x1 * y2; if (!rotated) { if (!b) { bezierPoints.push(curPoint, curPoint, curPoint); return } xc = xCur; yc = -1 * (a * xc + c) / b; shift = yc - yCur; y1 -= shift; y2 -= shift } else { if (!a) { bezierPoints.push(curPoint, curPoint, curPoint); return } yc = yCur; xc = -1 * (b * yc + c) / a; shift = xc - xCur; x1 -= shift; x2 -= shift } rightControlX = (xCur + lambda * x2) / (1 + lambda); rightControlY = (yCur + lambda * y2) / (1 + lambda); leftControlX = (xCur + lambda * x1) / (1 + lambda); leftControlY = (yCur + lambda * y1) / (1 + lambda) } if (!rotated) { leftControlY = checkExtremum(prevPoint.y, yCur, leftControlY); rightControlY = checkExtremum(nextPoint.y, yCur, rightControlY) } else { leftControlX = checkExtremum(prevPoint.x, xCur, leftControlX); rightControlX = checkExtremum(nextPoint.x, xCur, rightControlX) } var leftPoint = clonePoint(curPoint, leftControlX, leftControlY); var rightPoint = clonePoint(curPoint, rightControlX, rightControlY); bezierPoints.push(leftPoint, curPoint, rightPoint) }) } else { bezierPoints.push(pointsCopy[0]) } return bezierPoints }, _prepareSegment: function(points, rotated) { return lineSeries._prepareSegment(this._calculateBezierPoints(points, rotated)) }, _createMainElement: function(points, settings) { return this._renderer.path(points, "bezier").attr(settings).sharp() }, getSeriesPairCoord: function(coord, isArgument) { var that = this; var oppositeCoord = null; var isOpposite = !isArgument && !this._options.rotated || isArgument && this._options.rotated; var coordName = !isOpposite ? "vx" : "vy"; var bezierCoordName = !isOpposite ? "x" : "y"; var oppositeCoordName = !isOpposite ? "vy" : "vx"; var bezierOppositeCoordName = !isOpposite ? "y" : "x"; var axis = !isArgument ? that.getArgumentAxis() : that.getValueAxis(); var visibleArea = axis.getVisibleArea(); var nearestPoints = this.getNearestPointsByCoord(coord, isArgument); var _loop = function(i) { var p = nearestPoints[i]; if (1 === p.length) { visibleArea[0] <= p[0][oppositeCoordName] && visibleArea[1] >= p[0][oppositeCoordName] && (oppositeCoord = p[0][oppositeCoordName]) } else { var ts = obtainCubicBezierTCoef(coord, p[0][coordName], p[1][bezierCoordName], p[2][bezierCoordName], p[3][coordName]); ts.forEach(function(t) { if (t >= 0 && t <= 1) { var tmpCoord = Math.pow(1 - t, 3) * p[0][oppositeCoordName] + 3 * Math.pow(1 - t, 2) * t * p[1][bezierOppositeCoordName] + 3 * (1 - t) * t * t * p[2][bezierOppositeCoordName] + t * t * t * p[3][oppositeCoordName]; if (visibleArea[0] <= tmpCoord && visibleArea[1] >= tmpCoord) { oppositeCoord = tmpCoord } } }) } if (null !== oppositeCoord) { return "break" } }; for (var i = 0; i < nearestPoints.length; i++) { var _ret = _loop(i); if ("break" === _ret) { break } } return oppositeCoord }, getNearestPointsByCoord: function(coord, isArgument) { var that = this; var rotated = that.getOptions().rotated; var isOpposite = !isArgument && !rotated || isArgument && rotated; var coordName = isOpposite ? "vy" : "vx"; var points = that.getVisiblePoints(); var allPoints = that.getPoints(); var bezierPoints = that._segments.length > 0 ? that._segments.reduce(function(a, seg) { return a.concat(seg.line) }, []) : []; var nearestPoints = []; if (that.isVisible() && allPoints.length > 0) { if (allPoints.length > 1) { that.findNeighborPointsByCoord(coord, coordName, points.slice(0), allPoints, function(point, nextPoint) { var index = bezierPoints.indexOf(point); nearestPoints.push([point, bezierPoints[index + 1], bezierPoints[index + 2], nextPoint]) }) } else { if (allPoints[0][coordName] === coord) { nearestPoints.push([allPoints[0]]) } } } return nearestPoints } }); exports.polar.line = _extend({}, polarScatterSeries, lineMethods, { _sortPoints: function(points) { return points }, _prepareSegment: function(points, rotated, lastSegment) { var preparedPoints = []; var centerPoint = this.getValueAxis().getCenter(); var i; lastSegment && this._closeSegment(points); if (this.argumentAxisType !== DISCRETE && this.valueAxisType !== DISCRETE) { for (i = 1; i < points.length; i++) { preparedPoints = preparedPoints.concat(this._getTangentPoints(points[i], points[i - 1], centerPoint)) } if (!preparedPoints.length) { preparedPoints = points } } else { return lineSeries._prepareSegment.call(this, points) } return { line: preparedPoints } }, _getRemainingAngle: function(angle) { var normAngle = normalizeAngle(angle); return angle >= 0 ? 360 - normAngle : -normAngle }, _closeSegment: function(points) { var point; var differenceAngle; if (this._segments.length) { point = this._segments[0].line[0] } else { point = clonePoint(points[0], points[0].x, points[0].y, points[0].angle) } if (points[points.length - 1].angle !== point.angle) { if (normalizeAngle(Math.round(points[points.length - 1].angle)) === normalizeAngle(Math.round(point.angle))) { point.angle = points[points.length - 1].angle } else { differenceAngle = points[points.length - 1].angle - point.angle; point.angle = points[points.length - 1].angle + this._getRemainingAngle(differenceAngle) } points.push(point) } }, _getTangentPoints: function(point, prevPoint, centerPoint) { var tangentPoints = []; var betweenAngle = Math.round(prevPoint.angle - point.angle); var tan = (prevPoint.radius - point.radius) / betweenAngle; var i; if (0 === betweenAngle) { tangentPoints = [prevPoint, point] } else { if (betweenAngle > 0) { for (i = betweenAngle; i >= 0; i--) { tangentPoints.push(getTangentPoint(point, prevPoint, centerPoint, tan, i)) } } else { for (i = 0; i >= betweenAngle; i--) { tangentPoints.push(getTangentPoint(point, prevPoint, centerPoint, tan, betweenAngle - i)) } } } return tangentPoints } }) }, /*!****************************************************!*\ !*** ./artifacts/transpiled/viz/axes/base_axis.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _smart_formatter = __webpack_require__( /*! ./smart_formatter */ 405); var _utils = __webpack_require__( /*! ../core/utils */ 10); var _utils2 = _interopRequireDefault(_utils); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _axes_constants = __webpack_require__( /*! ./axes_constants */ 248); var _axes_constants2 = _interopRequireDefault(_axes_constants); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _array = __webpack_require__( /*! ../../core/utils/array */ 14); var _format_helper = __webpack_require__( /*! ../../format_helper */ 64); var _format_helper2 = _interopRequireDefault(_format_helper); var _parse_utils = __webpack_require__( /*! ../components/parse_utils */ 244); var _parse_utils2 = _interopRequireDefault(_parse_utils); var _tick_generator = __webpack_require__( /*! ./tick_generator */ 406); var _tick_generator2 = _interopRequireDefault(_tick_generator); var _translator2d = __webpack_require__( /*! ../translators/translator2d */ 249); var _translator2d2 = _interopRequireDefault(_translator2d); var _range = __webpack_require__( /*! ../translators/range */ 108); var _tick = __webpack_require__( /*! ./tick */ 407); var _math2 = __webpack_require__( /*! ../../core/utils/math */ 28); var _date = __webpack_require__( /*! ../../core/utils/date */ 22); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _xy_axes = __webpack_require__( /*! ./xy_axes */ 408); var _xy_axes2 = _interopRequireDefault(_xy_axes); var _polar_axes = __webpack_require__( /*! ./polar_axes */ 784); var _polar_axes2 = _interopRequireDefault(_polar_axes); var _constant_line = __webpack_require__( /*! ./constant_line */ 785); var _constant_line2 = _interopRequireDefault(_constant_line); var _strip = __webpack_require__( /*! ./strip */ 786); var _strip2 = _interopRequireDefault(_strip); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }) } else { obj[key] = value } return obj } var convertTicksToValues = _axes_constants2.default.convertTicksToValues; var patchFontOptions = _utils2.default.patchFontOptions; var getVizRangeObject = _utils2.default.getVizRangeObject; var _math = Math; var _abs = _math.abs; var _max = _math.max; var _min = _math.min; var _isArray = Array.isArray; var DEFAULT_AXIS_LABEL_SPACING = 5; var MAX_GRID_BORDER_ADHENSION = 4; var TOP = _axes_constants2.default.top; var BOTTOM = _axes_constants2.default.bottom; var LEFT = _axes_constants2.default.left; var RIGHT = _axes_constants2.default.right; var CENTER = _axes_constants2.default.center; var KEEP = "keep"; var SHIFT = "shift"; var RESET = "reset"; var ROTATE = "rotate"; var DEFAULT_AXIS_DIVISION_FACTOR = 50; var DEFAULT_MINOR_AXIS_DIVISION_FACTOR = 15; var SCROLL_THRESHOLD = 5; var MAX_MARGIN_VALUE = .8; var dateIntervals = { day: 864e5, week: 6048e5 }; function getTickGenerator(options, incidentOccurred, skipTickGeneration, rangeIsEmpty, adjustDivisionFactor) { return _tick_generator2.default.tickGenerator({ axisType: options.type, dataType: options.dataType, logBase: options.logarithmBase, axisDivisionFactor: adjustDivisionFactor(options.axisDivisionFactor || DEFAULT_AXIS_DIVISION_FACTOR), minorAxisDivisionFactor: adjustDivisionFactor(options.minorAxisDivisionFactor || DEFAULT_MINOR_AXIS_DIVISION_FACTOR), numberMultipliers: options.numberMultipliers, calculateMinors: options.minorTick.visible || options.minorGrid.visible || options.calculateMinors, allowDecimals: options.allowDecimals, endOnTick: options.endOnTick, incidentOccurred: incidentOccurred, firstDayOfWeek: options.workWeek && options.workWeek[0], skipTickGeneration: skipTickGeneration, skipCalculationLimits: options.skipCalculationLimits, generateExtraTick: options.generateExtraTick, minTickInterval: options.minTickInterval, rangeIsEmpty: rangeIsEmpty }) } function createMajorTick(axis, renderer, skippedCategory) { var options = axis.getOptions(); return (0, _tick.tick)(axis, renderer, options.tick, options.grid, skippedCategory, false) } function createMinorTick(axis, renderer) { var options = axis.getOptions(); return (0, _tick.tick)(axis, renderer, options.minorTick, options.minorGrid) } function createBoundaryTick(axis, renderer, isFirst) { var options = axis.getOptions(); return (0, _tick.tick)(axis, renderer, (0, _extend.extend)({}, options.tick, { visible: options.showCustomBoundaryTicks }), options.grid, void 0, false, isFirst ? -1 : 1) } function callAction(elements, action, actionArgument1, actionArgument2) { (elements || []).forEach(function(e) { return e[action](actionArgument1, actionArgument2) }) } function initTickCoords(ticks) { callAction(ticks, "initCoords") } function drawTickMarks(ticks, options) { callAction(ticks, "drawMark", options) } function drawGrids(ticks, drawLine) { callAction(ticks, "drawGrid", drawLine) } function updateTicksPosition(ticks, options, animate) { callAction(ticks, "updateTickPosition", options, animate) } function updateGridsPosition(ticks, animate) { callAction(ticks, "updateGridPosition", animate) } var measureLabels = exports.measureLabels = function(items) { items.forEach(function(item) { item.labelBBox = item.label ? item.label.getBBox() : { x: 0, y: 0, width: 0, height: 0 } }) }; function cleanUpInvalidTicks(ticks) { var i = ticks.length - 1; for (i; i >= 0; i--) { if (!removeInvalidTick(ticks, i)) { break } } for (i = 0; i < ticks.length; i++) { if (removeInvalidTick(ticks, i)) { i-- } else { break } } } function removeInvalidTick(ticks, i) { if (null === ticks[i].coords.x || null === ticks[i].coords.y) { ticks.splice(i, 1); return true } return false } function validateAxisOptions(options) { var labelOptions = options.label; var position = options.position; var defaultPosition = options.isHorizontal ? BOTTOM : LEFT; var secondaryPosition = options.isHorizontal ? TOP : RIGHT; if (position !== defaultPosition && position !== secondaryPosition) { position = defaultPosition } if (position === RIGHT && !labelOptions.userAlignment) { labelOptions.alignment = LEFT } options.position = position; options.hoverMode = options.hoverMode ? options.hoverMode.toLowerCase() : "none"; labelOptions.minSpacing = (0, _type.isDefined)(labelOptions.minSpacing) ? labelOptions.minSpacing : DEFAULT_AXIS_LABEL_SPACING; options.type && (options.type = options.type.toLowerCase()); options.argumentType && (options.argumentType = options.argumentType.toLowerCase()); options.valueType && (options.valueType = options.valueType.toLowerCase()) } function getOptimalAngle(boxes, labelOpt) { var angle = 180 * _math.asin((boxes[0].height + labelOpt.minSpacing) / (boxes[1].x - boxes[0].x)) / _math.PI; return angle < 45 ? -45 : -90 } function updateLabels(ticks, step, func) { ticks.forEach(function(tick, index) { if (tick.label) { if (index % step !== 0) { tick.removeLabel() } else { if (func) { func(tick, index) } } } }) } function valueOf(value) { return value.valueOf() } function getZoomBoundValue(optionValue, dataValue) { if (void 0 === optionValue) { return dataValue } else { if (null === optionValue) { return } else { return optionValue } } } function configureGenerator(options, axisDivisionFactor, viewPort, screenDelta, minTickInterval) { var tickGeneratorOptions = (0, _extend.extend)({}, options, { endOnTick: true, axisDivisionFactor: axisDivisionFactor, skipCalculationLimits: true, generateExtraTick: true, minTickInterval: minTickInterval }); return function(tickInterval, skipTickGeneration, min, max, breaks) { return getTickGenerator(tickGeneratorOptions, _common.noop, skipTickGeneration, viewPort.isEmpty(), function(v) { return v })({ min: min, max: max, categories: viewPort.categories, isSpacedMargin: viewPort.isSpacedMargin, checkMinDataVisibility: viewPort.checkMinDataVisibility, checkMaxDataVisibility: viewPort.checkMaxDataVisibility }, screenDelta, tickInterval, (0, _type.isDefined)(tickInterval), void 0, void 0, void 0, breaks) } } function convertVisualRangeObject(visualRange, optionValue) { return _utils2.default.convertVisualRangeObject(visualRange, !_isArray(optionValue)) } function getConstantLineSharpDirection(coord, axisCanvas) { return Math.max(axisCanvas.start, axisCanvas.end) !== coord ? 1 : -1 } var calculateCanvasMargins = exports.calculateCanvasMargins = function(bBoxes, canvas) { var cLeft = canvas.left; var cTop = canvas.top; var cRight = canvas.width - canvas.right; var cBottom = canvas.height - canvas.bottom; return bBoxes.reduce(function(margins, bBox) { if (!bBox || bBox.isEmpty) { return margins } return { left: _max(margins.left, cLeft - bBox.x), top: _max(margins.top, cTop - bBox.y), right: _max(margins.right, bBox.x + bBox.width - cRight), bottom: _max(margins.bottom, bBox.y + bBox.height - cBottom) } }, { left: 0, right: 0, top: 0, bottom: 0 }) }; var Axis = exports.Axis = function(renderSettings) { var that = this; that._renderer = renderSettings.renderer; that._incidentOccurred = renderSettings.incidentOccurred; that._eventTrigger = renderSettings.eventTrigger; that._stripsGroup = renderSettings.stripsGroup; that._labelAxesGroup = renderSettings.labelAxesGroup; that._constantLinesGroup = renderSettings.constantLinesGroup; that._scaleBreaksGroup = renderSettings.scaleBreaksGroup; that._axesContainerGroup = renderSettings.axesContainerGroup; that._gridContainerGroup = renderSettings.gridGroup; that._axisCssPrefix = renderSettings.widgetClass + "-" + (renderSettings.axisClass ? renderSettings.axisClass + "-" : ""); that._setType(renderSettings.axisType, renderSettings.drawingType); that._createAxisGroups(); that._translator = that._createTranslator(); that.isArgumentAxis = renderSettings.isArgumentAxis; that._viewport = {}; that._firstDrawing = true; that._initRange = {} }; Axis.prototype = { constructor: Axis, _drawAxis: function() { var options = this._options; if (!options.visible) { return } this._axisElement = this._createAxisElement(); this._updateAxisElementPosition(); this._axisElement.attr({ "stroke-width": options.width, stroke: options.color, "stroke-opacity": options.opacity }).sharp(this._getSharpParam(true), this.getAxisSharpDirection()).append(this._axisLineGroup) }, _createPathElement: function(points, attr, sharpDirection) { return this.sharp(this._renderer.path(points, "line").attr(attr), sharpDirection) }, sharp: function(svgElement) { var sharpDirection = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; return svgElement.sharp(this._getSharpParam(), sharpDirection) }, getAxisSharpDirection: function() { var position = this._options.position; return position === TOP || position === LEFT ? 1 : -1 }, getSharpDirectionByCoords: function(coords) { var canvas = this._getCanvasStartEnd(); var maxCoord = Math.max(canvas.start, canvas.end); return this.getRadius ? 0 : maxCoord !== coords[this._isHorizontal ? "x" : "y"] ? 1 : -1 }, _getGridLineDrawer: function() { var that = this; return function(tick, gridStyle) { var grid = that._getGridPoints(tick.coords); if (grid.points) { return that._createPathElement(grid.points, gridStyle, that.getSharpDirectionByCoords(tick.coords)) } return null } }, _getGridPoints: function(coords) { var that = this; var isHorizontal = this._isHorizontal; var tickPositionField = isHorizontal ? "x" : "y"; var orthogonalPositions = this._orthogonalPositions; var positionFrom = orthogonalPositions.start; var positionTo = orthogonalPositions.end; var borderOptions = that.borderOptions; var canvasStart = isHorizontal ? LEFT : TOP; var canvasEnd = isHorizontal ? RIGHT : BOTTOM; var axisCanvas = that.getCanvas(); var canvas = { left: axisCanvas.left, right: axisCanvas.width - axisCanvas.right, top: axisCanvas.top, bottom: axisCanvas.height - axisCanvas.bottom }; var firstBorderLinePosition = borderOptions.visible && borderOptions[canvasStart] ? canvas[canvasStart] : void 0; var lastBorderLinePosition = borderOptions.visible && borderOptions[canvasEnd] ? canvas[canvasEnd] : void 0; var minDelta = MAX_GRID_BORDER_ADHENSION + firstBorderLinePosition; var maxDelta = lastBorderLinePosition - MAX_GRID_BORDER_ADHENSION; if (that.areCoordsOutsideAxis(coords) || void 0 === coords[tickPositionField] || coords[tickPositionField] < minDelta || coords[tickPositionField] > maxDelta) { return { points: null } } return { points: isHorizontal ? null !== coords[tickPositionField] ? [coords[tickPositionField], positionFrom, coords[tickPositionField], positionTo] : null : null !== coords[tickPositionField] ? [positionFrom, coords[tickPositionField], positionTo, coords[tickPositionField]] : null } }, _getConstantLinePos: function(parsedValue, canvasStart, canvasEnd) { var value = this._getTranslatedCoord(parsedValue); if (!(0, _type.isDefined)(value) || value < _min(canvasStart, canvasEnd) || value > _max(canvasStart, canvasEnd)) { return } return value }, _getConstantLineGraphicAttributes: function(value) { var positionFrom = this._orthogonalPositions.start; var positionTo = this._orthogonalPositions.end; return { points: this._isHorizontal ? [value, positionFrom, value, positionTo] : [positionFrom, value, positionTo, value] } }, _createConstantLine: function(value, attr) { return this._createPathElement(this._getConstantLineGraphicAttributes(value).points, attr, getConstantLineSharpDirection(value, this._getCanvasStartEnd())) }, _drawConstantLineLabelText: function(text, x, y, _ref, group) { var font = _ref.font, cssClass = _ref.cssClass; return this._renderer.text(text, x, y).css(patchFontOptions((0, _extend.extend)({}, this._options.label.font, font))).attr({ align: "center", "class": cssClass }).append(group) }, _drawConstantLineLabels: function(parsedValue, lineLabelOptions, value, group) { var that = this; var text = lineLabelOptions.text; var options = that._options; var labelOptions = options.label; that._checkAlignmentConstantLineLabels(lineLabelOptions); text = (0, _type.isDefined)(text) ? text : that.formatLabel(parsedValue, labelOptions); var coords = that._getConstantLineLabelsCoords(value, lineLabelOptions); return that._drawConstantLineLabelText(text, coords.x, coords.y, lineLabelOptions, group) }, _getStripPos: function(startValue, endValue, canvasStart, canvasEnd, range) { var isContinuous = !!(range.minVisible || range.maxVisible); var categories = (range.categories || []).reduce(function(result, cat) { result.push(cat.valueOf()); return result }, []); var start; var end; if (!isContinuous) { if ((0, _type.isDefined)(startValue) && (0, _type.isDefined)(endValue)) { var parsedStartValue = this.parser(startValue); var parsedEndValue = this.parser(endValue); var startCategoryIndex = (0, _array.inArray)((0, _type.isDefined)(parsedStartValue) ? parsedStartValue.valueOf() : void 0, categories); var endCategoryIndex = (0, _array.inArray)((0, _type.isDefined)(parsedEndValue) ? parsedEndValue.valueOf() : void 0, categories); if (startCategoryIndex === -1 || endCategoryIndex === -1) { return { from: 0, to: 0, outOfCanvas: true } } if (startCategoryIndex > endCategoryIndex) { var swap = endValue; endValue = startValue; startValue = swap } } } if ((0, _type.isDefined)(startValue)) { startValue = this.validateUnit(startValue, "E2105", "strip"); start = this._getTranslatedCoord(startValue, -1) } else { start = canvasStart } if ((0, _type.isDefined)(endValue)) { endValue = this.validateUnit(endValue, "E2105", "strip"); end = this._getTranslatedCoord(endValue, 1) } else { end = canvasEnd } var stripPosition = start < end ? { from: start, to: end } : { from: end, to: start }; var visibleArea = this.getVisibleArea(); if (stripPosition.from <= visibleArea[0] && stripPosition.to <= visibleArea[0] || stripPosition.from >= visibleArea[1] && stripPosition.to >= visibleArea[1]) { stripPosition.outOfCanvas = true } return stripPosition }, _getStripGraphicAttributes: function(fromPoint, toPoint) { var x; var y; var width; var height; var orthogonalPositions = this._orthogonalPositions; var positionFrom = orthogonalPositions.start; var positionTo = orthogonalPositions.end; if (this._isHorizontal) { x = fromPoint; y = _min(positionFrom, positionTo); width = toPoint - fromPoint; height = _abs(positionFrom - positionTo) } else { x = _min(positionFrom, positionTo); y = fromPoint; width = _abs(positionFrom - positionTo); height = _abs(fromPoint - toPoint) } return { x: x, y: y, width: width, height: height } }, _createStrip: function(attrs) { return this._renderer.rect(attrs.x, attrs.y, attrs.width, attrs.height) }, _adjustStripLabels: function() { var that = this; this._strips.forEach(function(strip) { if (strip.label) { strip.label.attr(that._getAdjustedStripLabelCoords(strip)) } }) }, _adjustLabelsCoord: function(offset, maxWidth, checkCanvas) { var that = this; that._majorTicks.forEach(function(tick) { if (tick.label) { tick.label.attr(that._getLabelAdjustedCoord(tick, offset + (tick.labelOffset || 0), maxWidth, checkCanvas)) } }) }, _adjustLabels: function(offset) { var that = this; var maxSize = that._majorTicks.reduce(function(size, tick) { if (!tick.label) { return size } var bBox = tick.labelRotationAngle ? _utils2.default.rotateBBox(tick.labelBBox, [tick.labelCoords.x, tick.labelCoords.y], -tick.labelRotationAngle) : tick.labelBBox; return { width: _max(size.width || 0, bBox.width), height: _max(size.height || 0, bBox.height), offset: _max(size.offset || 0, tick.labelOffset || 0) } }, {}); var additionalOffset = that._isHorizontal ? maxSize.height : maxSize.width; that._adjustLabelsCoord(offset, maxSize.width); return offset + additionalOffset + (additionalOffset && that._options.label.indentFromAxis) + maxSize.offset }, _getLabelAdjustedCoord: function(tick, offset, maxWidth) { offset = offset || 0; var that = this; var options = that._options; var box = _utils2.default.rotateBBox(tick.labelBBox, [tick.labelCoords.x, tick.labelCoords.y], -tick.labelRotationAngle || 0); var position = options.position; var textAlign = tick.labelAlignment || options.label.alignment; var isDiscrete = "discrete" === that._options.type; var isFlatLabel = tick.labelRotationAngle % 90 === 0; var indentFromAxis = options.label.indentFromAxis; var axisPosition = that._axisPosition; var labelCoords = tick.labelCoords; var labelX = labelCoords.x; var translateX; var translateY; if (that._isHorizontal) { if (position === BOTTOM) { translateY = axisPosition + indentFromAxis - box.y + offset } else { translateY = axisPosition - indentFromAxis - (box.y + box.height) - offset } if (textAlign === RIGHT) { translateX = isDiscrete && isFlatLabel ? tick.coords.x - (box.x + box.width) : labelX - box.x - box.width } else { if (textAlign === LEFT) { translateX = isDiscrete && isFlatLabel ? labelX - box.x - (tick.coords.x - labelX) : labelX - box.x } else { translateX = labelX - box.x - box.width / 2 } } } else { translateY = labelCoords.y - box.y - box.height / 2; if (position === LEFT) { if (textAlign === LEFT) { translateX = axisPosition - indentFromAxis - maxWidth - box.x } else { if (textAlign === CENTER) { translateX = axisPosition - indentFromAxis - maxWidth / 2 - box.x - box.width / 2 } else { translateX = axisPosition - indentFromAxis - box.x - box.width } } translateX -= offset } else { if (textAlign === RIGHT) { translateX = axisPosition + indentFromAxis + maxWidth - box.x - box.width } else { if (textAlign === CENTER) { translateX = axisPosition + indentFromAxis + maxWidth / 2 - box.x - box.width / 2 } else { translateX = axisPosition + indentFromAxis - box.x } } translateX += offset } } return { translateX: translateX, translateY: translateY } }, _createAxisConstantLineGroups: function() { var that = this; var renderer = that._renderer; var classSelector = that._axisCssPrefix; var constantLinesClass = classSelector + "constant-lines"; var insideGroup = renderer.g().attr({ "class": constantLinesClass }); var outsideGroup1 = renderer.g().attr({ "class": constantLinesClass }); var outsideGroup2 = renderer.g().attr({ "class": constantLinesClass }); return { inside: insideGroup, outside1: outsideGroup1, left: outsideGroup1, top: outsideGroup1, outside2: outsideGroup2, right: outsideGroup2, bottom: outsideGroup2, remove: function() { this.inside.remove(); this.outside1.remove(); this.outside2.remove() }, clear: function() { this.inside.clear(); this.outside1.clear(); this.outside2.clear() } } }, _createAxisGroups: function() { var that = this; var renderer = that._renderer; var classSelector = that._axisCssPrefix; that._axisGroup = renderer.g().attr({ "class": classSelector + "axis" }); that._axisStripGroup = renderer.g().attr({ "class": classSelector + "strips" }); that._axisGridGroup = renderer.g().attr({ "class": classSelector + "grid" }); that._axisElementsGroup = renderer.g().attr({ "class": classSelector + "elements" }).append(that._axisGroup); that._axisLineGroup = renderer.g().attr({ "class": classSelector + "line" }).append(that._axisGroup); that._axisTitleGroup = renderer.g().attr({ "class": classSelector + "title" }).append(that._axisGroup); that._axisConstantLineGroups = { above: that._createAxisConstantLineGroups(), under: that._createAxisConstantLineGroups() }; that._axisStripLabelGroup = renderer.g().attr({ "class": classSelector + "axis-labels" }) }, _clearAxisGroups: function() { var that = this; that._axisGroup.remove(); that._axisStripGroup.remove(); that._axisStripLabelGroup.remove(); that._axisConstantLineGroups.above.remove(); that._axisConstantLineGroups.under.remove(); that._axisGridGroup.remove(); that._axisTitleGroup.clear(); that._axisElementsGroup.clear(); that._axisLineGroup && that._axisLineGroup.clear(); that._axisStripGroup && that._axisStripGroup.clear(); that._axisGridGroup && that._axisGridGroup.clear(); that._axisConstantLineGroups.above.clear(); that._axisConstantLineGroups.under.clear(); that._axisStripLabelGroup && that._axisStripLabelGroup.clear() }, _getLabelFormatObject: function(value, labelOptions, range, point, tickInterval, ticks) { range = range || this._getViewportRange(); var formatObject = { value: value, valueText: (0, _smart_formatter.smartFormatter)(value, { labelOptions: labelOptions, ticks: ticks || convertTicksToValues(this._majorTicks), tickInterval: (0, _type.isDefined)(tickInterval) ? tickInterval : this._tickInterval, dataType: this._options.dataType, logarithmBase: this._options.logarithmBase, type: this._options.type, showTransition: !this._options.marker.visible, point: point }) || "", min: range.minVisible, max: range.maxVisible }; if (point) { formatObject.point = point } return formatObject }, formatLabel: function(value, labelOptions, range, point, tickInterval, ticks) { var formatObject = this._getLabelFormatObject(value, labelOptions, range, point, tickInterval, ticks); return (0, _type.isFunction)(labelOptions.customizeText) ? labelOptions.customizeText.call(formatObject, formatObject) : formatObject.valueText }, formatHint: function(value, labelOptions, range) { var formatObject = this._getLabelFormatObject(value, labelOptions, range); return (0, _type.isFunction)(labelOptions.customizeHint) ? labelOptions.customizeHint.call(formatObject, formatObject) : void 0 }, formatRange: function(startValue, endValue, interval) { return (0, _smart_formatter.formatRange)(startValue, endValue, interval, this.getOptions()) }, _setTickOffset: function() { var options = this._options; var discreteAxisDivisionMode = options.discreteAxisDivisionMode; this._tickOffset = +("crossLabels" !== discreteAxisDivisionMode || !discreteAxisDivisionMode) }, getMargins: function() { var that = this; var options = that._options; var position = options.position; var placeholderSize = options.placeholderSize; var canvas = that.getCanvas(); var cLeft = canvas.left; var cTop = canvas.top; var cRight = canvas.width - canvas.right; var cBottom = canvas.height - canvas.bottom; var edgeMarginCorrection = _max(options.grid.visible && options.grid.width || 0, options.tick.visible && options.tick.width || 0); var constantLineAboveSeries = that._axisConstantLineGroups.above; var constantLineUnderSeries = that._axisConstantLineGroups.under; var boxes = [that._axisElementsGroup, constantLineAboveSeries.outside1, constantLineAboveSeries.outside2, constantLineUnderSeries.outside1, constantLineUnderSeries.outside2, that._axisLineGroup].map(function(group) { return group && group.getBBox() }).concat(function(group) { var box = group && group.getBBox(); if (!box || box.isEmpty) { return box } if (that._isHorizontal) { box.x = cLeft; box.width = cRight - cLeft } else { box.y = cTop; box.height = cBottom - cTop } return box }(that._axisTitleGroup)); var margins = calculateCanvasMargins(boxes, canvas); margins[position] += options.crosshairMargin; if (placeholderSize) { margins[position] = placeholderSize } if (edgeMarginCorrection) { if (that._isHorizontal && canvas.right < edgeMarginCorrection && margins.right < edgeMarginCorrection) { margins.right = edgeMarginCorrection } if (!that._isHorizontal && canvas.bottom < edgeMarginCorrection && margins.bottom < edgeMarginCorrection) { margins.bottom = edgeMarginCorrection } } return margins }, validateUnit: function(unit, idError, parameters) { var that = this; unit = that.parser(unit); if (void 0 === unit && idError) { that._incidentOccurred(idError, [parameters]) } return unit }, _setType: function(axisType, drawingType) { var that = this; var axisTypeMethods; switch (axisType) { case "xyAxes": axisTypeMethods = _xy_axes2.default; break; case "polarAxes": axisTypeMethods = _polar_axes2.default }(0, _extend.extend)(that, axisTypeMethods[drawingType]) }, _getSharpParam: function() { return true }, _disposeBreaksGroup: _common.noop, dispose: function() { var that = this; [that._axisElementsGroup, that._axisStripGroup, that._axisGroup].forEach(function(g) { g.dispose() }); that._strips = that._title = null; that._axisStripGroup = that._axisConstantLineGroups = that._axisStripLabelGroup = that._axisBreaksGroup = null; that._axisLineGroup = that._axisElementsGroup = that._axisGridGroup = null; that._axisGroup = that._axisTitleGroup = null; that._axesContainerGroup = that._stripsGroup = that._constantLinesGroup = null; that._renderer = that._options = that._textOptions = that._textFontStyles = null; that._translator = null; that._majorTicks = that._minorTicks = null; that._disposeBreaksGroup() }, getOptions: function() { return this._options }, setPane: function(pane) { this.pane = pane; this._options.pane = pane }, setTypes: function(type, axisType, typeSelector) { this._options.type = type || this._options.type; this._options[typeSelector] = axisType || this._options[typeSelector]; this._updateTranslator() }, resetTypes: function(typeSelector) { this._options.type = this._initTypes.type; this._options[typeSelector] = this._initTypes[typeSelector] }, getTranslator: function() { return this._translator }, updateOptions: function(options) { var that = this; var labelOpt = options.label; validateAxisOptions(options); that._options = options; options.tick = options.tick || {}; options.minorTick = options.minorTick || {}; options.grid = options.grid || {}; options.minorGrid = options.minorGrid || {}; options.title = options.title || {}; options.marker = options.marker || {}; that._initTypes = { type: options.type, argumentType: options.argumentType, valueType: options.valueType }; that._setTickOffset(); that._isHorizontal = options.isHorizontal; that.pane = options.pane; that.name = options.name; that.priority = options.priority; that._hasLabelFormat = "" !== labelOpt.format && (0, _type.isDefined)(labelOpt.format); that._textOptions = { opacity: labelOpt.opacity, align: "center", "class": labelOpt.cssClass }; that._textFontStyles = _utils2.default.patchFontOptions(labelOpt.font); if (options.type === _axes_constants2.default.logarithmic) { if (options.logarithmBaseError) { that._incidentOccurred("E2104"); delete options.logarithmBaseError } } that._updateTranslator(); that._createConstantLines(); that._strips = (options.strips || []).map(function(o) { return (0, _strip2.default)(that, o) }); that._majorTicks = that._minorTicks = null; that._firstDrawing = true }, calculateInterval: function(value, prevValue) { var options = this._options; return !options || options.type !== _axes_constants2.default.logarithmic ? _abs(value - prevValue) : _utils2.default.getLog(value / prevValue, options.logarithmBase) }, _processCanvas: function(canvas) { return canvas }, updateCanvas: function(canvas) { var positions = this._orthogonalPositions = { start: !this._isHorizontal ? canvas.left : canvas.top, end: !this._isHorizontal ? canvas.width - canvas.right : canvas.height - canvas.bottom }; this._canvas = canvas; positions.center = positions.start + (positions.end - positions.start) / 2; this._translator.updateCanvas(this._processCanvas(canvas)); this._initAxisPositions() }, getCanvas: function() { return this._canvas }, getAxisShift: function() { return this._axisShift || 0 }, hideTitle: function() { var that = this; if (that._options.title.text) { that._incidentOccurred("W2105", [that._isHorizontal ? "horizontal" : "vertical"]); that._axisTitleGroup.clear() } }, getTitle: function() { return this._title }, hideOuterElements: function() { var that = this; var options = that._options; if ((options.label.visible || that._outsideConstantLines.length) && !that._translator.getBusinessRange().isEmpty()) { that._incidentOccurred("W2106", [that._isHorizontal ? "horizontal" : "vertical"]); that._axisElementsGroup.clear(); callAction(that._outsideConstantLines, "removeLabel") } }, adjustViewport: function(businessRange) { var that = this; var options = that._options; var isDiscrete = options.type === _axes_constants2.default.discrete; var categories = that._seriesData && that._seriesData.categories || []; var wholeRange = that.adjustRange(getVizRangeObject(options.wholeRange)); var visualRange = that.getViewport() || {}; var result = new _range.Range(businessRange); that._addConstantLinesToRange(result, "minVisible", "maxVisible"); var minDefined = (0, _type.isDefined)(visualRange.startValue); var maxDefined = (0, _type.isDefined)(visualRange.endValue); if (!isDiscrete) { minDefined = minDefined && (!(0, _type.isDefined)(wholeRange.endValue) || visualRange.startValue < wholeRange.endValue); maxDefined = maxDefined && (!(0, _type.isDefined)(wholeRange.startValue) || visualRange.endValue > wholeRange.startValue) } var minVisible = minDefined ? visualRange.startValue : result.minVisible; var maxVisible = maxDefined ? visualRange.endValue : result.maxVisible; if (!isDiscrete) { result.min = (0, _type.isDefined)(wholeRange.startValue) ? wholeRange.startValue : result.min; result.max = (0, _type.isDefined)(wholeRange.endValue) ? wholeRange.endValue : result.max } else { var categoriesInfo = _utils2.default.getCategoriesInfo(categories, wholeRange.startValue, wholeRange.endValue); categories = categoriesInfo.categories; result.categories = categories } var adjustedVisualRange = _utils2.default.adjustVisualRange({ axisType: options.type, dataType: options.dataType, base: options.logarithmBase }, { startValue: minDefined ? visualRange.startValue : void 0, endValue: maxDefined ? visualRange.endValue : void 0, length: visualRange.length }, { categories: categories, min: wholeRange.startValue, max: wholeRange.endValue }, { categories: categories, min: minVisible, max: maxVisible }); result.minVisible = adjustedVisualRange.startValue; result.maxVisible = adjustedVisualRange.endValue; !(0, _type.isDefined)(result.min) && (result.min = result.minVisible); !(0, _type.isDefined)(result.max) && (result.max = result.maxVisible); result.addRange({}); return result }, adjustRange: function(range) { range = range || {}; var isDiscrete = this._options.type === _axes_constants2.default.discrete; var isLogarithmic = this._options.type === _axes_constants2.default.logarithmic; if (isLogarithmic) { range.startValue = range.startValue <= 0 ? null : range.startValue; range.endValue = range.endValue <= 0 ? null : range.endValue } if (!isDiscrete && (0, _type.isDefined)(range.startValue) && (0, _type.isDefined)(range.endValue) && range.startValue > range.endValue) { var tmp = range.endValue; range.endValue = range.startValue; range.startValue = tmp } return range }, _getVisualRangeUpdateMode: function(viewport, newRange, oppositeValue) { var value = this._options.visualRangeUpdateMode; var translator = this._translator; var range = this._seriesData; if (this.isArgumentAxis) { if ([SHIFT, KEEP, RESET].indexOf(value) === -1) { if (range.axisType === _axes_constants2.default.discrete) { var categories = range.categories; var newCategories = newRange.categories; var visualRange = this.visualRange(); if (categories && newCategories && categories.length && newCategories.map(function(c) { return c.valueOf() }).join(",").indexOf(categories.map(function(c) { return c.valueOf() }).join(",")) !== -1 && (visualRange.startValue.valueOf() !== categories[0].valueOf() || visualRange.endValue.valueOf() !== categories[categories.length - 1].valueOf())) { value = KEEP } else { value = RESET } } else { var minPoint = translator.translate(range.min); var minVisiblePoint = translator.translate(viewport.startValue); var maxPoint = translator.translate(range.max); var maxVisiblePoint = translator.translate(viewport.endValue); if (minPoint === minVisiblePoint && maxPoint === maxVisiblePoint) { value = RESET } else { if (minPoint !== minVisiblePoint && maxPoint === maxVisiblePoint) { value = SHIFT } else { value = KEEP } } } } } else { if ([KEEP, RESET].indexOf(value) === -1) { if (oppositeValue === KEEP) { value = KEEP } else { value = RESET } } } return value }, _handleBusinessRangeChanged: function(oppositeVisualRangeUpdateMode, axisReinitialized, newRange) { var that = this; var visualRange = this.visualRange(); if (axisReinitialized || that._translator.getBusinessRange().isEmpty()) { return } var visualRangeUpdateMode = that._lastVisualRangeUpdateMode = that._getVisualRangeUpdateMode(visualRange, newRange, oppositeVisualRangeUpdateMode); if (!that.isArgumentAxis) { var viewport = that.getViewport(); if (!(0, _type.isDefined)(viewport.startValue) && !(0, _type.isDefined)(viewport.endValue) && !(0, _type.isDefined)(viewport.length)) { visualRangeUpdateMode = RESET } } that._prevDataWasEmpty && (visualRangeUpdateMode = KEEP); if (visualRangeUpdateMode === KEEP) { that._setVisualRange([visualRange.startValue, visualRange.endValue]) } if (visualRangeUpdateMode === RESET) { that._setVisualRange([null, null]) } if (visualRangeUpdateMode === SHIFT) { that._setVisualRange({ length: that.getVisualRangeLength() }) } }, getVisualRangeLength: function(range) { var currentBusinessRange = range || this._translator.getBusinessRange(); var _this$_options = this._options, type = _this$_options.type, logarithmBase = _this$_options.logarithmBase; var length; if (type === _axes_constants2.default.logarithmic) { length = (0, _math2.adjust)(_utils2.default.getLog(currentBusinessRange.maxVisible / currentBusinessRange.minVisible, logarithmBase)) } else { if (type === _axes_constants2.default.discrete) { var categoriesInfo = _utils2.default.getCategoriesInfo(currentBusinessRange.categories, currentBusinessRange.minVisible, currentBusinessRange.maxVisible); length = categoriesInfo.categories.length } else { length = currentBusinessRange.maxVisible - currentBusinessRange.minVisible } } return length }, getVisualRangeCenter: function(range) { var businessRange = this._translator.getBusinessRange(); var currentBusinessRange = range || businessRange; var _this$_options2 = this._options, type = _this$_options2.type, logarithmBase = _this$_options2.logarithmBase; var center; if (!(0, _type.isDefined)(currentBusinessRange.minVisible) || !(0, _type.isDefined)(currentBusinessRange.maxVisible)) { return } if (type === _axes_constants2.default.logarithmic) { center = _utils2.default.raiseTo((0, _math2.adjust)(_utils2.default.getLog(currentBusinessRange.maxVisible * currentBusinessRange.minVisible, logarithmBase)) / 2, logarithmBase) } else { if (type === _axes_constants2.default.discrete) { var categoriesInfo = _utils2.default.getCategoriesInfo(currentBusinessRange.categories, currentBusinessRange.minVisible, currentBusinessRange.maxVisible); var index = Math.ceil(categoriesInfo.categories.length / 2) - 1; center = businessRange.categories.indexOf(categoriesInfo.categories[index]) } else { center = (currentBusinessRange.maxVisible.valueOf() + currentBusinessRange.minVisible.valueOf()) / 2 } } return center }, setBusinessRange: function(range, axisReinitialized, oppositeVisualRangeUpdateMode, argCategories) { var that = this; var options = that._options; var isDiscrete = options.type === _axes_constants2.default.discrete; that._handleBusinessRangeChanged(oppositeVisualRangeUpdateMode, axisReinitialized, range); that._seriesData = new _range.Range(range); var dataIsEmpty = that._seriesData.isEmpty(); that._prevDataWasEmpty = dataIsEmpty; that._seriesData.addRange({ categories: options.categories, dataType: options.dataType, axisType: options.type, base: options.logarithmBase, invert: options.inverted }); if (!isDiscrete) { if (!(0, _type.isDefined)(that._seriesData.min) && !(0, _type.isDefined)(that._seriesData.max)) { var visualRange = that.getViewport(); visualRange && that._seriesData.addRange({ min: visualRange.startValue, max: visualRange.endValue }) } var synchronizedValue = options.synchronizedValue; if ((0, _type.isDefined)(synchronizedValue)) { that._seriesData.addRange({ min: synchronizedValue, max: synchronizedValue }) } } that._seriesData.minVisible = void 0 === that._seriesData.minVisible ? that._seriesData.min : that._seriesData.minVisible; that._seriesData.maxVisible = void 0 === that._seriesData.maxVisible ? that._seriesData.max : that._seriesData.maxVisible; if (!that.isArgumentAxis && options.showZero) { that._seriesData.correctValueZeroLevel() } that._seriesData.sortCategories(that.getCategoriesSorter(argCategories)); that._seriesData.breaks = that._breaks = that._getScaleBreaks(options, that._seriesData, that._series, that.isArgumentAxis); that._translator.updateBusinessRange(that.adjustViewport(that._seriesData)) }, _addConstantLinesToRange: function(dataRange, minValueField, maxValueField) { this._outsideConstantLines.concat(this._insideConstantLines || []).forEach(function(cl) { if (cl.options.extendAxis) { var _dataRange$addRange; var value = cl.getParsedValue(); dataRange.addRange((_dataRange$addRange = {}, _defineProperty(_dataRange$addRange, minValueField, value), _defineProperty(_dataRange$addRange, maxValueField, value), _dataRange$addRange)) } }) }, setGroupSeries: function(series) { this._series = series }, getLabelsPosition: function() { var that = this; var options = that._options; var position = options.position; var labelShift = options.label.indentFromAxis + (that._axisShift || 0) + that._constantLabelOffset; var axisPosition = that._axisPosition; return position === TOP || position === LEFT ? axisPosition - labelShift : axisPosition + labelShift }, getFormattedValue: function(value, options, point) { var labelOptions = this._options.label; return (0, _type.isDefined)(value) ? this.formatLabel(value, (0, _extend.extend)(true, {}, labelOptions, options), void 0, point) : null }, _getBoundaryTicks: function(majors, viewPort) { var that = this; var length = majors.length; var options = that._options; var customBounds = options.customBoundTicks; var min = viewPort.minVisible; var max = viewPort.maxVisible; var addMinMax = options.showCustomBoundaryTicks ? that._boundaryTicksVisibility : {}; var boundaryTicks = []; if (options.type === _axes_constants2.default.discrete) { if (that._tickOffset && 0 !== majors.length) { boundaryTicks = [majors[0], majors[majors.length - 1]] } } else { if (customBounds) { if (addMinMax.min && (0, _type.isDefined)(customBounds[0])) { boundaryTicks.push(customBounds[0]) } if (addMinMax.max && (0, _type.isDefined)(customBounds[1])) { boundaryTicks.push(customBounds[1]) } } else { if (addMinMax.min && (0 === length || majors[0] > min)) { boundaryTicks.push(min) } if (addMinMax.max && (0 === length || majors[length - 1] < max)) { boundaryTicks.push(max) } } } return boundaryTicks }, setPercentLabelFormat: function() { if (!this._hasLabelFormat) { this._options.label.format = "percent" } }, resetAutoLabelFormat: function() { if (!this._hasLabelFormat) { delete this._options.label.format } }, getMultipleAxesSpacing: function() { return this._options.multipleAxesSpacing || 0 }, getTicksValues: function() { return { majorTicksValues: convertTicksToValues(this._majorTicks), minorTicksValues: convertTicksToValues(this._minorTicks) } }, setTicks: function(ticks) { var majors = ticks.majorTicks || []; this._majorTicks = majors.map(createMajorTick(this, this._renderer, this._getSkippedCategory(majors))); this._minorTicks = (ticks.minorTicks || []).map(createMinorTick(this, this._renderer)); this._isSynchronized = true }, _adjustDivisionFactor: function(val) { return val }, _getTicks: function(viewPort, incidentOccurred, skipTickGeneration) { var that = this; var options = that._options; var customTicks = options.customTicks; var customMinorTicks = options.customMinorTicks; return getTickGenerator(options, incidentOccurred || that._incidentOccurred, skipTickGeneration, that._translator.getBusinessRange().isEmpty(), that._adjustDivisionFactor.bind(that))({ min: viewPort.minVisible, max: viewPort.maxVisible, categories: viewPort.categories, isSpacedMargin: viewPort.isSpacedMargin, checkMinDataVisibility: viewPort.checkMinDataVisibility, checkMaxDataVisibility: viewPort.checkMaxDataVisibility }, that._getScreenDelta(), options.tickInterval, "ignore" === options.label.overlappingBehavior || options.forceUserTickInterval, { majors: customTicks, minors: customMinorTicks }, options.minorTickInterval, options.minorTickCount, that._breaks) }, _createTicksAndLabelFormat: function(range, incidentOccurred) { var options = this._options; var ticks = this._getTicks(range, incidentOccurred, false); if (!range.isEmpty() && options.type === _axes_constants2.default.discrete && "datetime" === options.dataType && !this._hasLabelFormat && ticks.ticks.length) { options.label.format = _format_helper2.default.getDateFormatByTicks(ticks.ticks) } return ticks }, getAggregationInfo: function(useAllAggregatedPoints, range) { var that = this; var options = that._options; var marginOptions = that._marginOptions; var businessRange = new _range.Range(that.getTranslator().getBusinessRange()).addRange(range); var visualRange = that.getViewport(); var minVisible = visualRange && (0, _type.isDefined)(visualRange.startValue) ? visualRange.startValue : businessRange.minVisible; var maxVisible = visualRange && (0, _type.isDefined)(visualRange.endValue) ? visualRange.endValue : businessRange.maxVisible; var ticks = []; var aggregationInterval = options.aggregationInterval; var aggregationGroupWidth = options.aggregationGroupWidth; if (!aggregationGroupWidth && marginOptions) { if (marginOptions.checkInterval) { aggregationGroupWidth = options.axisDivisionFactor } if (marginOptions.sizePointNormalState) { aggregationGroupWidth = Math.min(marginOptions.sizePointNormalState, options.axisDivisionFactor) } } var minInterval = !options.aggregationGroupWidth && !aggregationInterval && range.interval; var generateTicks = configureGenerator(options, aggregationGroupWidth, businessRange, that._getScreenDelta(), minInterval); var tickInterval = generateTicks(aggregationInterval, true, minVisible, maxVisible, that._breaks).tickInterval; if (options.type !== _axes_constants2.default.discrete) { var min = useAllAggregatedPoints ? businessRange.min : minVisible; var max = useAllAggregatedPoints ? businessRange.max : maxVisible; if ((0, _type.isDefined)(min) && (0, _type.isDefined)(max)) { var add = _utils2.default.getAddFunction({ base: options.logarithmBase, axisType: options.type, dataType: options.dataType }, false); var start = min; var end = max; if (!useAllAggregatedPoints) { var maxMinDistance = Math.max(that.calculateInterval(max, min), "datetime" === options.dataType ? (0, _date.dateToMilliseconds)(tickInterval) : tickInterval); start = add(min, maxMinDistance, -1); end = add(max, maxMinDistance) } start = start < businessRange.min ? businessRange.min : start; end = end > businessRange.max ? businessRange.max : end; var breaks = that._getScaleBreaks(options, { minVisible: start, maxVisible: end }, that._series, that.isArgumentAxis); ticks = generateTicks(tickInterval, false, start, end, breaks).ticks } } that._aggregationInterval = tickInterval; return { interval: tickInterval, ticks: ticks } }, createTicks: function(canvas) { var that = this; var renderer = that._renderer; var options = that._options; if (!canvas) { return } that._isSynchronized = false; that.updateCanvas(canvas); that._estimatedTickInterval = that._getTicks(that.adjustViewport(this._seriesData), _common.noop, true).tickInterval; var range = that._getViewportRange(); var margins = this._calculateValueMargins(); range.addRange({ minVisible: margins.minValue, maxVisible: margins.maxValue, isSpacedMargin: margins.isSpacedMargin, checkMinDataVisibility: !this.isArgumentAxis && margins.checkInterval && !(0, _type.isDefined)(options.min) && margins.minValue.valueOf() > 0, checkMaxDataVisibility: !this.isArgumentAxis && margins.checkInterval && !(0, _type.isDefined)(options.max) && margins.maxValue.valueOf() < 0 }); var ticks = that._createTicksAndLabelFormat(range); var boundaryTicks = that._getBoundaryTicks(ticks.ticks, that._getViewportRange()); if (options.showCustomBoundaryTicks && boundaryTicks.length) { that._boundaryTicks = [boundaryTicks[0]].map(createBoundaryTick(that, renderer, true)); if (boundaryTicks.length > 1) { that._boundaryTicks = that._boundaryTicks.concat([boundaryTicks[1]].map(createBoundaryTick(that, renderer, false))) } } else { that._boundaryTicks = [] } var minors = (ticks.minorTicks || []).filter(function(minor) { return !boundaryTicks.some(function(boundary) { return valueOf(boundary) === valueOf(minor) }) }); that._tickInterval = ticks.tickInterval; that._minorTickInterval = ticks.minorTickInterval; var oldMajorTicks = that._majorTicks || []; var majorTicksByValues = oldMajorTicks.reduce(function(r, t) { r[t.value.valueOf()] = t; return r }, {}); var sameType = (0, _type.type)(ticks.ticks[0]) === (0, _type.type)(oldMajorTicks[0] && oldMajorTicks[0].value); var skippedCategory = that._getSkippedCategory(ticks.ticks); var majorTicks = ticks.ticks.map(function(v) { var tick = majorTicksByValues[v.valueOf()]; if (tick && sameType) { delete majorTicksByValues[v.valueOf()]; tick.setSkippedCategory(skippedCategory); return tick } else { return createMajorTick(that, renderer, skippedCategory)(v) } }); that._majorTicks = majorTicks; var oldMinorTicks = that._minorTicks || []; that._minorTicks = minors.map(function(v, i) { var minorTick = oldMinorTicks[i]; if (minorTick) { minorTick.updateValue(v); return minorTick } return createMinorTick(that, renderer)(v) }); that._ticksToRemove = Object.keys(majorTicksByValues).map(function(k) { return majorTicksByValues[k] }).concat(oldMinorTicks.slice(that._minorTicks.length, oldMinorTicks.length)); that._correctedBreaks = ticks.breaks; that._reinitTranslator(that._getViewportRange()) }, _reinitTranslator: function(range) { var that = this; var translator = that._translator; if (that._correctedBreaks) { range.breaks = that._correctedBreaks } if (that._isSynchronized) { return } translator.updateBusinessRange(that.adjustViewport(range)) }, _getViewportRange: function() { return this.adjustViewport(this._seriesData) }, setMarginOptions: function(options) { this._marginOptions = options }, getMarginOptions: function() { return (0, _type.isDefined)(this._marginOptions) ? this._marginOptions : {} }, allowToExtendVisualRange: function(isEnd) { var wholeRange = this.adjustRange(getVizRangeObject(this._options.wholeRange)); var bound = isEnd ? wholeRange.endValue : wholeRange.startValue; return !this.isArgumentAxis || !(0, _type.isDefined)(bound) && this.isExtremePosition(isEnd) }, _calculateRangeInterval: function(interval) { var isDateTime = "datetime" === this._options.dataType; var minArgs = []; var addToArgs = function(value) { (0, _type.isDefined)(value) && minArgs.push(isDateTime ? (0, _date.dateToMilliseconds)(value) : value) }; addToArgs(this._tickInterval); addToArgs(this._estimatedTickInterval); (0, _type.isDefined)(interval) && minArgs.push(interval); addToArgs(this._aggregationInterval); return this._calculateWorkWeekInterval(_min.apply(this, minArgs)) }, _calculateWorkWeekInterval: function(businessInterval) { var options = this._options; if ("datetime" === options.dataType && options.workdaysOnly && businessInterval) { var workWeek = options.workWeek.length * dateIntervals.day; var weekend = dateIntervals.week - workWeek; if (workWeek !== businessInterval && weekend < businessInterval) { var weekendsCount = Math.ceil(businessInterval / dateIntervals.week); businessInterval = weekend >= businessInterval ? dateIntervals.day : businessInterval - weekend * weekendsCount } else { if (weekend >= businessInterval && businessInterval > dateIntervals.day) { businessInterval = dateIntervals.day } } } return businessInterval }, _calculateValueMargins: function(ticks) { this._resetMargins(); var that = this; var margins = that.getMarginOptions(); var marginSize = (margins.size || 0) / 2; var options = that._options; var dataRange = this._getViewportRange(); var viewPort = this.getViewport(); var screenDelta = that._getScreenDelta(); var isDiscrete = (options.type || "").indexOf(_axes_constants2.default.discrete) !== -1; var valueMarginsEnabled = options.valueMarginsEnabled && !isDiscrete; var translator = that._translator; var minValueMargin = options.minValueMargin; var maxValueMargin = options.maxValueMargin; var minPadding = 0; var maxPadding = 0; var interval = 0; var rangeInterval; if (dataRange.stubData || !screenDelta) { return { startPadding: 0, endPadding: 0 } } function getConvertIntervalCoefficient(intervalInPx) { var ratioOfCanvasRange = translator.ratioOfCanvasRange(); return ratioOfCanvasRange / (ratioOfCanvasRange * screenDelta / (intervalInPx + screenDelta)) } if (that.isArgumentAxis && margins.checkInterval) { rangeInterval = that._calculateRangeInterval(dataRange.interval); var pxInterval = translator.getInterval(rangeInterval); if (isFinite(pxInterval)) { interval = Math.ceil(pxInterval / (2 * getConvertIntervalCoefficient(pxInterval))) } else { rangeInterval = 0 } } var minPercentPadding; var maxPercentPadding; var maxPaddingValue = screenDelta * MAX_MARGIN_VALUE / 2; if (valueMarginsEnabled) { if ((0, _type.isDefined)(minValueMargin)) { minPercentPadding = isFinite(minValueMargin) ? minValueMargin : 0 } else { minPadding = Math.max(marginSize, interval); minPadding = Math.min(maxPaddingValue, minPadding) } if ((0, _type.isDefined)(maxValueMargin)) { maxPercentPadding = isFinite(maxValueMargin) ? maxValueMargin : 0 } else { maxPadding = Math.max(marginSize, interval); maxPadding = Math.min(maxPaddingValue, maxPadding) } } var percentStick = margins.percentStick && !this.isArgumentAxis; if (percentStick) { if (1 === _abs(dataRange.max)) { maxPadding = 0 } if (1 === _abs(dataRange.min)) { minPadding = 0 } } var canvasStartEnd = that._getCanvasStartEnd(); var commonMargin = 1 + (minPercentPadding || 0) + (maxPercentPadding || 0); var screenDeltaWithMargins = (screenDelta - minPadding - maxPadding) / commonMargin || screenDelta; if (void 0 !== minPercentPadding || void 0 !== maxPercentPadding) { if (void 0 !== minPercentPadding) { minPadding = screenDeltaWithMargins * minPercentPadding } if (void 0 !== maxPercentPadding) { maxPadding = screenDeltaWithMargins * maxPercentPadding } } var minValue; var maxValue; if (options.type !== _axes_constants2.default.discrete && ticks && ticks.length > 1 && !options.skipViewportExtending && !viewPort.action && false !== options.endOnTick) { var length = ticks.length; var firstTickPosition = translator.translate(ticks[0].value); var lastTickPosition = translator.translate(ticks[length - 1].value); var invertMultiplier = firstTickPosition > lastTickPosition ? -1 : 1; var minTickPadding = _max(invertMultiplier * (canvasStartEnd.start - firstTickPosition), 0); var maxTickPadding = _max(invertMultiplier * (lastTickPosition - canvasStartEnd.end), 0); if (minTickPadding > minPadding || maxTickPadding > maxPadding) { var commonPadding = maxTickPadding + minTickPadding; var coeff = getConvertIntervalCoefficient(commonPadding); if (minTickPadding >= minPadding) { minValue = ticks[0].value } if (maxTickPadding >= maxPadding) { maxValue = ticks[length - 1].value } minPadding = _max(minTickPadding, minPadding) / coeff; maxPadding = _max(maxTickPadding, maxPadding) / coeff } } minPercentPadding = void 0 === minPercentPadding ? minPadding / screenDeltaWithMargins : minPercentPadding; maxPercentPadding = void 0 === maxPercentPadding ? maxPadding / screenDeltaWithMargins : maxPercentPadding; if (!isDiscrete) { if (this._translator.isInverted()) { minValue = (0, _type.isDefined)(minValue) ? minValue : translator.from(canvasStartEnd.start + screenDelta * minPercentPadding, -1); maxValue = (0, _type.isDefined)(maxValue) ? maxValue : translator.from(canvasStartEnd.end - screenDelta * maxPercentPadding, 1) } else { minValue = (0, _type.isDefined)(minValue) ? minValue : translator.from(canvasStartEnd.start - screenDelta * minPercentPadding, -1); maxValue = (0, _type.isDefined)(maxValue) ? maxValue : translator.from(canvasStartEnd.end + screenDelta * maxPercentPadding, 1) } } function correctZeroLevel(minPoint, maxPoint) { var minExpectedPadding = _abs(canvasStartEnd.start - minPoint); var maxExpectedPadding = _abs(canvasStartEnd.end - maxPoint); var coeff = getConvertIntervalCoefficient(minExpectedPadding + maxExpectedPadding); minPadding = minExpectedPadding / coeff; maxPadding = maxExpectedPadding / coeff } if (!that.isArgumentAxis) { if (minValue * dataRange.min <= 0 && minValue * dataRange.minVisible <= 0) { correctZeroLevel(translator.translate(0), translator.translate(maxValue)); minValue = 0 } if (maxValue * dataRange.max <= 0 && maxValue * dataRange.maxVisible <= 0) { correctZeroLevel(translator.translate(minValue), translator.translate(0)); maxValue = 0 } } return { startPadding: this._translator.isInverted() ? maxPadding : minPadding, endPadding: this._translator.isInverted() ? minPadding : maxPadding, minValue: minValue, maxValue: maxValue, interval: rangeInterval, isSpacedMargin: minPadding === maxPadding && 0 !== minPadding } }, applyMargins: function() { if (this._isSynchronized) { return } var margins = this._calculateValueMargins(this._majorTicks); var canvas = (0, _extend.extend)({}, this._canvas, { startPadding: margins.startPadding, endPadding: margins.endPadding }); this._translator.updateCanvas(this._processCanvas(canvas)); if (isFinite(margins.interval)) { var br = this._translator.getBusinessRange(); br.addRange({ interval: margins.interval }); this._translator.updateBusinessRange(br) } }, _resetMargins: function() { this._reinitTranslator(this._getViewportRange()); if (this._canvas) { this._translator.updateCanvas(this._processCanvas(this._canvas)) } }, _createConstantLines: function() { var _this = this; var constantLines = (this._options.constantLines || []).map(function(o) { return (0, _constant_line2.default)(_this, o) }); this._outsideConstantLines = constantLines.filter(function(l) { return "outside" === l.labelPosition }); this._insideConstantLines = constantLines.filter(function(l) { return "inside" === l.labelPosition }) }, draw: function(canvas, borderOptions) { var that = this; var options = this._options; that.borderOptions = borderOptions || { visible: false }; that._resetMargins(); that.createTicks(canvas); that.applyMargins(); that._clearAxisGroups(); initTickCoords(that._majorTicks); initTickCoords(that._minorTicks); initTickCoords(that._boundaryTicks); that._axisGroup.append(that._axesContainerGroup); that._drawAxis(); that._drawTitle(); drawTickMarks(that._majorTicks, options.tick); drawTickMarks(that._minorTicks, options.minorTick); drawTickMarks(that._boundaryTicks, options.tick); var drawGridLine = that._getGridLineDrawer(); drawGrids(that._majorTicks, drawGridLine); drawGrids(that._minorTicks, drawGridLine); callAction(that._majorTicks, "drawLabel", that._getViewportRange()); that._majorTicks.forEach(function(tick) { tick.labelRotationAngle = 0; tick.labelAlignment = void 0; tick.labelOffset = 0 }); callAction(that._outsideConstantLines.concat(that._insideConstantLines), "draw"); callAction(that._strips, "draw"); that._dateMarkers = that._drawDateMarkers() || []; that._labelAxesGroup && that._axisStripLabelGroup.append(that._labelAxesGroup); that._gridContainerGroup && that._axisGridGroup.append(that._gridContainerGroup); that._stripsGroup && that._axisStripGroup.append(that._stripsGroup); if (that._constantLinesGroup) { that._axisConstantLineGroups.above.inside.append(that._constantLinesGroup.above); that._axisConstantLineGroups.above.outside1.append(that._constantLinesGroup.above); that._axisConstantLineGroups.above.outside2.append(that._constantLinesGroup.above); that._axisConstantLineGroups.under.inside.append(that._constantLinesGroup.under); that._axisConstantLineGroups.under.outside1.append(that._constantLinesGroup.under); that._axisConstantLineGroups.under.outside2.append(that._constantLinesGroup.under) } that._measureTitle(); measureLabels(that._majorTicks); var textWidth; var textHeight; var convertedTickInterval; var tickInterval = that._tickInterval; if ((0, _type.isDefined)(tickInterval)) { convertedTickInterval = that.getTranslator().getInterval("datetime" === options.dataType ? (0, _date.dateToMilliseconds)(tickInterval) : tickInterval) } if (that._isHorizontal) { textWidth = convertedTickInterval; textHeight = options.placeholderSize } else { textWidth = options.placeholderSize; textHeight = convertedTickInterval } var displayMode = that._validateDisplayMode(options.label.displayMode); var overlappingMode = that._validateOverlappingMode(options.label.overlappingBehavior, displayMode); var wordWrapMode = options.label.wordWrap || "none"; var overflowMode = options.label.textOverflow || "none"; if (("none" !== wordWrapMode || "none" !== overflowMode) && displayMode !== ROTATE && overlappingMode !== ROTATE && "auto" !== overlappingMode) { var correctByWidth = false; var correctByHeight = false; if (textWidth) { if (that._majorTicks.some(function(tick) { return tick.labelBBox.width > textWidth })) { correctByWidth = true } } if (textHeight) { if (that._majorTicks.some(function(tick) { return tick.labelBBox.height > textHeight })) { correctByHeight = true } } if (correctByWidth || correctByHeight) { that._majorTicks.forEach(function(tick) { tick.label && tick.label.setMaxSize(textWidth, textHeight, options.label) }); measureLabels(that._majorTicks) } } measureLabels(that._outsideConstantLines); measureLabels(that._insideConstantLines); measureLabels(that._strips); measureLabels(that._dateMarkers); that._adjustConstantLineLabels(that._insideConstantLines); that._adjustStripLabels(); var offset = that._constantLabelOffset = that._adjustConstantLineLabels(that._outsideConstantLines); if (!that._translator.getBusinessRange().isEmpty()) { that._setLabelsPlacement(); offset = that._adjustLabels(offset) } offset = that._adjustDateMarkers(offset); that._adjustTitle(offset) }, _measureTitle: _common.noop, animate: function() { callAction(this._majorTicks, "animateLabels") }, updateSize: function(canvas, animate) { var updateTitle = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : true; var that = this; that.updateCanvas(canvas); if (updateTitle) { that._checkTitleOverflow(); that._measureTitle(); that._updateTitleCoords() } that._reinitTranslator(that._getViewportRange()); that.applyMargins(); var animationEnabled = !that._firstDrawing && animate; var options = this._options; initTickCoords(that._majorTicks); initTickCoords(that._minorTicks); initTickCoords(that._boundaryTicks); cleanUpInvalidTicks(that._majorTicks); cleanUpInvalidTicks(that._minorTicks); cleanUpInvalidTicks(that._boundaryTicks); if (this._axisElement) { that._updateAxisElementPosition() } updateTicksPosition(that._majorTicks, options.tick, animationEnabled); updateTicksPosition(that._minorTicks, options.minorTick, animationEnabled); updateTicksPosition(that._boundaryTicks, options.tick); callAction(that._majorTicks, "updateLabelPosition", animationEnabled); that._outsideConstantLines.concat(that._insideConstantLines || []).forEach(function(l) { return l.updatePosition(animationEnabled) }); callAction(that._strips, "updatePosition", animationEnabled); updateGridsPosition(that._majorTicks, animationEnabled); updateGridsPosition(that._minorTicks, animationEnabled); if (animationEnabled) { callAction(that._ticksToRemove || [], "fadeOutElements") } that.prepareAnimation(); that._ticksToRemove = null; if (!that._translator.getBusinessRange().isEmpty()) { that._firstDrawing = false } }, prepareAnimation: function() { var that = this; var action = "saveCoords"; callAction(that._majorTicks, action); callAction(that._minorTicks, action); callAction(that._insideConstantLines, action); callAction(that._outsideConstantLines, action); callAction(that._strips, action) }, applyClipRects: function(elementsClipID, canvasClipID) { this._axisGroup.attr({ "clip-path": canvasClipID }); this._axisStripGroup.attr({ "clip-path": elementsClipID }) }, _mergeViewportOptions: function() { var that = this; var options = that._options; var visualRange = {}; var visualRangeOptionValue = options._customVisualRange; if (((0, _type.isDefined)(options.max) || (0, _type.isDefined)(options.min)) && !(0, _type.isDefined)(visualRangeOptionValue.startValue) && !(0, _type.isDefined)(visualRangeOptionValue.endValue) && !(0, _type.isDefined)(visualRangeOptionValue.length)) { visualRange = { startValue: options.min, endValue: options.max } } else { visualRange = visualRangeOptionValue } that._setVisualRange(visualRange) }, _validateVisualRange: function(visualRange) { var range = getVizRangeObject(visualRange); if (void 0 !== range.startValue) { range.startValue = this.validateUnit(range.startValue) } if (void 0 !== range.endValue) { range.endValue = this.validateUnit(range.endValue) } return convertVisualRangeObject(range, visualRange) }, _validateOptions: function(options) { var that = this; if (void 0 !== options.min) { options.min = that.validateUnit(options.min, "E2106") } if (void 0 !== options.max) { options.max = that.validateUnit(options.max, "E2106") } options.wholeRange = that._validateVisualRange(options.wholeRange); options.visualRange = options._customVisualRange = that._validateVisualRange(options._customVisualRange); that._mergeViewportOptions() }, validate: function() { var that = this; var options = that._options; var dataType = that.isArgumentAxis ? options.argumentType : options.valueType; var parser = dataType ? _parse_utils2.default.getParser(dataType) : function(unit) { return unit }; that.parser = parser; options.dataType = dataType; that._validateOptions(options) }, resetVisualRange: function(isSilent) { this._seriesData.minVisible = this._seriesData.min; this._seriesData.maxVisible = this._seriesData.max; this.handleZooming([null, null], { start: !!isSilent, end: !!isSilent }) }, _applyZooming: function(visualRange, allowPartialUpdate) { var that = this; that._resetVisualRangeOption(); that._setVisualRange(visualRange, allowPartialUpdate); var viewPort = that.getViewport(); that._breaks = that._getScaleBreaks(that._options, { minVisible: viewPort.startValue, maxVisible: viewPort.endValue }, that._series, that.isArgumentAxis); that._translator.updateBusinessRange(that._getViewportRange()) }, getZoomStartEventArg: function(event, actionType) { return { axis: this, range: this.visualRange(), cancel: false, event: event, actionType: actionType } }, getZoomEndEventArg: function(previousRange, event, actionType, zoomFactor, shift) { var newRange = this.visualRange(); return { axis: this, previousRange: previousRange, range: newRange, cancel: false, event: event, actionType: actionType, zoomFactor: zoomFactor, shift: shift, rangeStart: newRange.startValue, rangeEnd: newRange.endValue } }, getZoomBounds: function() { var wholeRange = _utils2.default.getVizRangeObject(this._options.wholeRange); var range = this.getTranslator().getBusinessRange(); var secondPriorityRange = { startValue: getZoomBoundValue(this._initRange.startValue, range.min), endValue: getZoomBoundValue(this._initRange.endValue, range.max) }; return { startValue: getZoomBoundValue(wholeRange.startValue, secondPriorityRange.startValue), endValue: getZoomBoundValue(wholeRange.endValue, secondPriorityRange.endValue) } }, setInitRange: function() { this._initRange = {}; if (0 === Object.keys(this._options.wholeRange || {}).length) { this._initRange = this.getZoomBounds() } }, _resetVisualRangeOption: function() { this._options._customVisualRange = {} }, setCustomVisualRange: function(range) { this._options._customVisualRange = range }, visualRange: function visualRange() { var that = this; var args = arguments; var visualRange; if (0 === args.length) { var adjustedRange = that._getAdjustedBusinessRange(); var startValue = adjustedRange.minVisible; var endValue = adjustedRange.maxVisible; if (that._options.type === _axes_constants2.default.discrete) { startValue = (0, _type.isDefined)(startValue) ? startValue : adjustedRange.categories[0]; endValue = (0, _type.isDefined)(endValue) ? endValue : adjustedRange.categories[adjustedRange.categories.length - 1]; return { startValue: startValue, endValue: endValue, categories: _utils2.default.getCategoriesInfo(adjustedRange.categories, startValue, endValue).categories } } return { startValue: startValue, endValue: endValue } } else { if (_isArray(args[0])) { visualRange = args[0] } else { if ((0, _type.isPlainObject)(args[0])) { visualRange = (0, _extend.extend)({}, args[0]) } else { visualRange = [args[0], args[1]] } } } var zoomResults = that.handleZooming(visualRange, args[1]); if (!zoomResults.isPrevented) { that._visualRange(that, zoomResults) } }, handleZooming: function(visualRange, preventEvents, domEvent, action) { var that = this; preventEvents = preventEvents || {}; if ((0, _type.isDefined)(visualRange)) { visualRange = that._validateVisualRange(visualRange); visualRange.action = action } var zoomStartEvent = that.getZoomStartEventArg(domEvent, action); var previousRange = zoomStartEvent.range; !preventEvents.start && that._eventTrigger("zoomStart", zoomStartEvent); var zoomResults = { isPrevented: zoomStartEvent.cancel, skipEventRising: preventEvents.skipEventRising, range: visualRange || zoomStartEvent.range }; if (!zoomStartEvent.cancel) { (0, _type.isDefined)(visualRange) && that._applyZooming(visualRange, preventEvents.allowPartialUpdate); if (!(0, _type.isDefined)(that._storedZoomEndParams)) { that._storedZoomEndParams = { startRange: previousRange, type: this.getOptions().type } } that._storedZoomEndParams.event = domEvent; that._storedZoomEndParams.action = action; that._storedZoomEndParams.prevent = !!preventEvents.end } return zoomResults }, handleZoomEnd: function() { var that = this; if ((0, _type.isDefined)(that._storedZoomEndParams) && !that._storedZoomEndParams.prevent) { var previousRange = that._storedZoomEndParams.startRange; var domEvent = that._storedZoomEndParams.event; var action = that._storedZoomEndParams.action; var previousBusinessRange = { minVisible: previousRange.startValue, maxVisible: previousRange.endValue, categories: previousRange.categories }; var typeIsNotChanged = that.getOptions().type === that._storedZoomEndParams.type; var shift = typeIsNotChanged ? (0, _math2.adjust)(that.getVisualRangeCenter() - that.getVisualRangeCenter(previousBusinessRange)) : NaN; var zoomFactor = typeIsNotChanged ? +(Math.round(that.getVisualRangeLength(previousBusinessRange) / that.getVisualRangeLength() + "e+2") + "e-2") : NaN; var zoomEndEvent = that.getZoomEndEventArg(previousRange, domEvent, action, zoomFactor, shift); zoomEndEvent.cancel = that.isZoomingLowerLimitOvercome(1 === zoomFactor ? "pan" : "zoom", zoomFactor); that._eventTrigger("zoomEnd", zoomEndEvent); if (zoomEndEvent.cancel) { that.restorePreviousVisualRange(previousRange) } that._storedZoomEndParams = null } }, restorePreviousVisualRange: function(previousRange) { var that = this; that._storedZoomEndParams = null; that._applyZooming(previousRange); that._visualRange(that, previousRange) }, isZoomingLowerLimitOvercome: function(actionType, zoomFactor, range) { var that = this; var options = that._options; var minZoom = options.minVisualRangeLength; var isOvercoming = "zoom" === actionType && zoomFactor >= 1; var businessRange = that._translator.getBusinessRange(); var visualRange; if ((0, _type.isDefined)(range)) { visualRange = that.adjustRange(_utils2.default.getVizRangeObject(range)); visualRange = { minVisible: visualRange.startValue, maxVisible: visualRange.endValue, categories: businessRange.categories } } var visualRangeLength = that.getVisualRangeLength(visualRange); if ("discrete" !== options.type) { if ((0, _type.isDefined)(minZoom)) { if ("datetime" === options.dataType && !(0, _type.isNumeric)(minZoom)) { minZoom = (0, _date.dateToMilliseconds)(minZoom) } isOvercoming &= minZoom >= visualRangeLength } else { var canvasLength = that._translator.canvasLength; var fullRange = { minVisible: businessRange.min, maxVisible: businessRange.max, categories: businessRange.categories }; isOvercoming &= that.getVisualRangeLength(fullRange) / canvasLength >= visualRangeLength } } else { !(0, _type.isDefined)(minZoom) && (minZoom = 1); isOvercoming &= (0, _type.isDefined)(range) && that.getVisualRangeLength() === minZoom && visualRangeLength <= minZoom } return !!isOvercoming }, dataVisualRangeIsReduced: function() { var minDataValue; var maxDataValue; var translator = this.getTranslator(); if ("discrete" === this._options.type) { var categories = translator.getBusinessRange().categories; minDataValue = categories[0]; maxDataValue = categories[categories.length - 1] } else { var seriesData = this._seriesData; minDataValue = seriesData.min; maxDataValue = seriesData.max } if (!(0, _type.isDefined)(minDataValue) || !(0, _type.isDefined)(maxDataValue)) { return false } var startPoint = translator.translate(minDataValue); var endPoint = translator.translate(maxDataValue); var edges = [Math.min(startPoint, endPoint), Math.max(startPoint, endPoint)]; var visualRange = this.visualRange(); var visualRangeStartPoint = translator.translate(visualRange.startValue); var visualRangeEndPoint = translator.translate(visualRange.endValue); return visualRangeStartPoint > edges[0] && visualRangeStartPoint < edges[1] || visualRangeEndPoint > edges[0] && visualRangeEndPoint < edges[1] || visualRangeStartPoint === visualRangeEndPoint && edges[0] !== edges[1] }, isExtremePosition: function(isMax) { var extremeDataValue; var seriesData; if ("discrete" === this._options.type) { seriesData = this._translator.getBusinessRange(); extremeDataValue = isMax ? seriesData.categories[seriesData.categories.length - 1] : seriesData.categories[0] } else { seriesData = this.getZoomBounds(); extremeDataValue = isMax ? seriesData.endValue : seriesData.startValue } var translator = this.getTranslator(); var extremePoint = translator.translate(extremeDataValue); var visualRange = this.visualRange(); var visualRangePoint = isMax ? translator.translate(visualRange.endValue) : translator.translate(visualRange.startValue); return _abs(visualRangePoint - extremePoint) < SCROLL_THRESHOLD }, getViewport: function() { return this._viewport }, getFullTicks: function() { var majors = this._majorTicks || []; if (this._options.type === _axes_constants2.default.discrete) { return convertTicksToValues(majors) } else { return convertTicksToValues(majors.concat(this._minorTicks, this._boundaryTicks)).sort(function(a, b) { return valueOf(a) - valueOf(b) }) } }, measureLabels: function(canvas, withIndents) { var that = this; var options = that._options; var widthAxis = options.visible ? options.width : 0; var ticks; var indent = withIndents ? options.label.indentFromAxis + .5 * options.tick.length : 0; var tickInterval; var viewportRange = that._getViewportRange(); if (viewportRange.isEmpty() || !options.label.visible || !that._axisElementsGroup) { return { height: widthAxis, width: widthAxis, x: 0, y: 0 } } if (that._majorTicks) { ticks = convertTicksToValues(that._majorTicks) } else { this.updateCanvas(canvas); ticks = that._createTicksAndLabelFormat(viewportRange, _common.noop); tickInterval = ticks.tickInterval; ticks = ticks.ticks } var maxText = ticks.reduce(function(prevLabel, tick, index) { var label = that.formatLabel(tick, options.label, viewportRange, void 0, tickInterval, ticks); if (prevLabel.length < label.length) { return label } else { return prevLabel } }, that.formatLabel(ticks[0], options.label, viewportRange, void 0, tickInterval, ticks)); var text = that._renderer.text(maxText, 0, 0).css(that._textFontStyles).attr(that._textOptions).append(that._renderer.root); var box = text.getBBox(); text.remove(); return { x: box.x, y: box.y, width: box.width + indent, height: box.height + indent } }, _setLabelsPlacement: function() { if (!this._options.label.visible) { return } var that = this; var labelOpt = that._options.label; var displayMode = that._validateDisplayMode(labelOpt.displayMode); var overlappingMode = that._validateOverlappingMode(labelOpt.overlappingBehavior, displayMode); var ignoreOverlapping = "none" === overlappingMode || "ignore" === overlappingMode; var behavior = { rotationAngle: labelOpt.rotationAngle, staggeringSpacing: labelOpt.staggeringSpacing }; var notRecastStep; var boxes = that._majorTicks.map(function(tick) { return tick.labelBBox }); var step; step = that._getStep(boxes); switch (displayMode) { case ROTATE: if (ignoreOverlapping) { notRecastStep = true; step = 1 } that._applyLabelMode(displayMode, step, boxes, labelOpt, notRecastStep); break; case "stagger": if (ignoreOverlapping) { step = 2 } that._applyLabelMode(displayMode, _max(step, 2), boxes, labelOpt); break; default: that._applyLabelOverlapping(boxes, overlappingMode, step, behavior) } }, _applyLabelOverlapping: function(boxes, mode, step, behavior) { var that = this; var labelOpt = that._options.label; var majorTicks = that._majorTicks; if ("none" === mode || "ignore" === mode) { return } var checkLabels = function(box, index, array) { if (0 === index) { return false } return _axes_constants2.default.areLabelsOverlap(box, array[index - 1], labelOpt.minSpacing, labelOpt.alignment) }; if (step > 1 && boxes.some(checkLabels)) { that._applyLabelMode(mode, step, boxes, behavior) } that._checkBoundedLabelsOverlapping(majorTicks, boxes, mode) }, _applyLabelMode: function(mode, step, boxes, behavior, notRecastStep) { var that = this; var majorTicks = that._majorTicks; var labelOpt = that._options.label; var angle = behavior.rotationAngle; var alignment; var func; switch (mode) { case ROTATE: if (!labelOpt.userAlignment) { alignment = angle < 0 ? RIGHT : LEFT; if (angle % 90 === 0) { alignment = CENTER } } step = notRecastStep ? step : that._getStep(boxes, angle); func = function(tick) { tick.label.rotate(angle); tick.labelRotationAngle = angle; alignment && (tick.labelAlignment = alignment) }; updateLabels(majorTicks, step, func); break; case "stagger": var labelHeight = that._getMaxLabelHeight(boxes, behavior.staggeringSpacing); func = function(tick, index) { if (index / (step - 1) % 2 !== 0) { tick.labelOffset = labelHeight } }; updateLabels(majorTicks, step - 1, func); break; case "auto": case "_auto": if (2 === step) { that._applyLabelMode("stagger", step, boxes, behavior) } else { that._applyLabelMode(ROTATE, step, boxes, { rotationAngle: getOptimalAngle(boxes, labelOpt) }) } break; default: updateLabels(majorTicks, step) } }, getMarkerTrackers: _common.noop, _drawDateMarkers: _common.noop, _adjustDateMarkers: _common.noop, coordsIn: _common.noop, areCoordsOutsideAxis: _common.noop, _getSkippedCategory: _common.noop, _initAxisPositions: _common.noop, _drawTitle: _common.noop, _updateTitleCoords: _common.noop, _adjustConstantLineLabels: _common.noop, _createTranslator: function() { return new _translator2d2.default.Translator2D({}, {}, {}) }, _updateTranslator: function() { var translator = this._translator; translator.update(translator.getBusinessRange(), this._canvas || {}, this._getTranslatorOptions()) }, _getTranslatorOptions: function() { var options = this._options; return { isHorizontal: this._isHorizontal, shiftZeroValue: !this.isArgumentAxis, interval: options.semiDiscreteInterval, stick: this._getStick(), breaksSize: options.breakStyle ? options.breakStyle.width : 0 } }, getVisibleArea: function() { var canvas = this._getCanvasStartEnd(); return [canvas.start, canvas.end].sort(function(a, b) { return a - b }) }, _getCanvasStartEnd: function() { var isHorizontal = this._isHorizontal; var canvas = this._canvas || {}; var invert = this._translator.getBusinessRange().invert; var coords = isHorizontal ? [canvas.left, canvas.width - canvas.right] : [canvas.height - canvas.bottom, canvas.top]; invert && coords.reverse(); return { start: coords[0], end: coords[1] } }, _getScreenDelta: function() { var that = this; var canvas = that._getCanvasStartEnd(); var breaks = that._breaks; var breaksLength = breaks ? breaks.length : 0; var screenDelta = _abs(canvas.start - canvas.end); return screenDelta - (breaksLength ? breaks[breaksLength - 1].cumulativeWidth : 0) }, _getScaleBreaks: function() { return [] }, _adjustTitle: _common.noop, _checkTitleOverflow: _common.noop, getSpiderTicks: _common.noop, setSpiderTicks: _common.noop, _checkBoundedLabelsOverlapping: _common.noop, drawScaleBreaks: _common.noop, _visualRange: _common.noop, _rotateConstantLine: _common.noop, applyVisualRangeSetter: _common.noop, getCategoriesSorter: function(argCategories) { var sort; if (this.isArgumentAxis) { sort = argCategories } else { var categoriesSortingMethod = this._options.categoriesSortingMethod; sort = (0, _type.isDefined)(categoriesSortingMethod) ? categoriesSortingMethod : this._options.categories } return sort }, _getAdjustedBusinessRange: function() { return this.adjustViewport(this._translator.getBusinessRange()) }, _getTickMarkPoints: _common.noop, _validateOverlappingMode: _common.noop, _getStep: _common.noop, _validateDisplayMode: _common.noop, shift: _common.noop } }, /*!***************************************************!*\ !*** ./artifacts/transpiled/viz/gauges/common.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var dxBaseGauge = __webpack_require__( /*! ./base_gauge */ 145).dxBaseGauge; var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var _isDefined = typeUtils.isDefined; var _isArray = Array.isArray; var _isNumber = typeUtils.isNumeric; var axisModule = __webpack_require__( /*! ../axes/base_axis */ 204); var _map = __webpack_require__( /*! ../core/utils */ 10).map; var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum; var _compareArrays = __webpack_require__( /*! ./base_gauge */ 145).compareArrays; var _isFinite = isFinite; var _Number = Number; var _min = Math.min; var _max = Math.max; var _extend = extend; var _each = each; var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var SHIFT_ANGLE = 90; var OPTION_VALUE = "value"; var OPTION_SUBVALUES = "subvalues"; var DEFAULT_MINOR_AXIS_DIVISION_FACTOR = 5; var DEFAULT_NUMBER_MULTIPLIERS = [1, 2, 5]; function processValue(value, fallbackValue) { if (null === value) { return value } return _isFinite(value) ? _Number(value) : fallbackValue } function parseArrayOfNumbers(arg) { return _isArray(arg) ? arg : _isNumber(arg) ? [arg] : null } exports.dxGauge = dxBaseGauge.inherit({ _initCore: function() { var that = this; var renderer = that._renderer; that._setupValue(that.option(OPTION_VALUE)); that.__subvalues = parseArrayOfNumbers(that.option(OPTION_SUBVALUES)); that._setupSubvalues(that.__subvalues); selectMode(that); that.callBase.apply(that, arguments); that._rangeContainer = new that._factory.RangeContainer({ renderer: renderer, container: renderer.root, translator: that._translator, themeManager: that._themeManager }); that._initScale() }, _fontFields: ["scale.label.font", "valueIndicators.rangebar.text.font", "valueIndicators.textcloud.text.font", "indicator.text.font"], _initScale: function() { var that = this; that._scaleGroup = that._renderer.g().attr({ "class": "dxg-scale" }).linkOn(that._renderer.root, "scale"); that._scale = new axisModule.Axis({ incidentOccurred: that._incidentOccurred, renderer: that._renderer, axesContainerGroup: that._scaleGroup, axisType: that._scaleTypes.type, drawingType: that._scaleTypes.drawingType, widgetClass: "dxg" }) }, _disposeCore: function() { var that = this; that.callBase.apply(that, arguments); that._scale.dispose(); that._scaleGroup.linkOff(); that._rangeContainer.dispose(); that._disposeValueIndicators(); that._scale = that._scaleGroup = that._rangeContainer = null }, _disposeValueIndicators: function() { var that = this; that._valueIndicator && that._valueIndicator.dispose(); that._subvalueIndicatorsSet && that._subvalueIndicatorsSet.dispose(); that._valueIndicator = that._subvalueIndicatorsSet = null }, _setupDomainCore: function() { var that = this; var scaleOption = that.option("scale") || {}; var startValue = that.option("startValue"); var endValue = that.option("endValue"); startValue = _isNumber(startValue) ? _Number(startValue) : _isNumber(scaleOption.startValue) ? _Number(scaleOption.startValue) : 0; endValue = _isNumber(endValue) ? _Number(endValue) : _isNumber(scaleOption.endValue) ? _Number(scaleOption.endValue) : 100; that._baseValue = startValue < endValue ? startValue : endValue; that._translator.setDomain(startValue, endValue) }, _cleanContent: function() { var that = this; that._rangeContainer.clean(); that._cleanValueIndicators() }, _measureScale: function(scaleOptions) { var that = this; var majorTick = scaleOptions.tick; var majorTickEnabled = majorTick.visible && majorTick.length > 0 && majorTick.width > 0; var minorTick = scaleOptions.minorTick; var minorTickEnabled = minorTick.visible && minorTick.length > 0 && minorTick.width > 0; var label = scaleOptions.label; var indentFromTick = Number(label.indentFromTick); if (!majorTickEnabled && !minorTickEnabled && !label.visible) { return {} } var textParams = that._scale.measureLabels(extend({}, that._canvas)); var layoutValue = that._getScaleLayoutValue(); var result = { min: layoutValue, max: layoutValue }; var coefs = that._getTicksCoefficients(scaleOptions); var innerCoef = coefs.inner; var outerCoef = coefs.outer; if (majorTickEnabled) { result.min = _min(result.min, layoutValue - innerCoef * majorTick.length); result.max = _max(result.max, layoutValue + outerCoef * majorTick.length) } if (minorTickEnabled) { result.min = _min(result.min, layoutValue - innerCoef * minorTick.length); result.max = _max(result.max, layoutValue + outerCoef * minorTick.length) } label.visible && that._correctScaleIndents(result, indentFromTick, textParams); return result }, _renderContent: function() { var that = this; var scaleOptions = that._prepareScaleSettings(); that._rangeContainer.render(_extend(that._getOption("rangeContainer"), { vertical: that._area.vertical })); that._renderScale(scaleOptions); var elements = _map([that._rangeContainer].concat(that._prepareValueIndicators()), function(element) { return element && element.enabled ? element : null }); that._applyMainLayout(elements, that._measureScale(scaleOptions)); _each(elements, function(_, element) { element.resize(that._getElementLayout(element.getOffset())) }); that._shiftScale(that._getElementLayout(0), scaleOptions); that._beginValueChanging(); that._updateActiveElements(); that._endValueChanging() }, _prepareScaleSettings: function() { var that = this; var userOptions = that.option("scale"); var scaleOptions = extend(true, {}, that._themeManager.theme("scale"), userOptions); scaleOptions.label.indentFromAxis = 0; scaleOptions.isHorizontal = !that._area.vertical; scaleOptions.forceUserTickInterval |= _isDefined(userOptions) && _isDefined(userOptions.tickInterval) && !_isDefined(userOptions.scaleDivisionFactor); scaleOptions.axisDivisionFactor = scaleOptions.scaleDivisionFactor || that._gridSpacingFactor; scaleOptions.minorAxisDivisionFactor = scaleOptions.minorScaleDivisionFactor || DEFAULT_MINOR_AXIS_DIVISION_FACTOR; scaleOptions.numberMultipliers = DEFAULT_NUMBER_MULTIPLIERS; scaleOptions.tickOrientation = that._getTicksOrientation(scaleOptions); if (scaleOptions.label.useRangeColors) { scaleOptions.label.customizeColor = function() { return that._rangeContainer.getColorForValue(this.value) } } return scaleOptions }, _renderScale: function(scaleOptions) { var that = this; var bounds = that._translator.getDomain(); var startValue = bounds[0]; var endValue = bounds[1]; var angles = that._translator.getCodomain(); var invert = startValue > endValue; var min = _min(startValue, endValue); var max = _max(startValue, endValue); scaleOptions.min = min; scaleOptions.max = max; scaleOptions.startAngle = SHIFT_ANGLE - angles[0]; scaleOptions.endAngle = SHIFT_ANGLE - angles[1]; scaleOptions.skipViewportExtending = true; that._scale.updateOptions(scaleOptions); that._scale.setBusinessRange({ axisType: "continuous", dataType: "numeric", min: min, max: max, invert: invert }); that._updateScaleTickIndent(scaleOptions); that._scaleGroup.linkAppend(); that._scale.draw(extend({}, that._canvas)) }, _updateIndicatorSettings: function(settings) { var that = this; settings.currentValue = settings.baseValue = _isFinite(that._translator.translate(settings.baseValue)) ? _Number(settings.baseValue) : that._baseValue; settings.vertical = that._area.vertical; if (settings.text && !settings.text.format) { settings.text.format = that._defaultFormatOptions } }, _prepareIndicatorSettings: function(options, defaultTypeField) { var that = this; var theme = that._themeManager.theme("valueIndicators"); var type = _normalizeEnum(options.type || that._themeManager.theme(defaultTypeField)); var settings = _extend(true, {}, theme._default, theme[type], options); settings.type = type; settings.animation = that._animationSettings; settings.containerBackgroundColor = that._containerBackgroundColor; that._updateIndicatorSettings(settings); return settings }, _cleanValueIndicators: function() { this._valueIndicator && this._valueIndicator.clean(); this._subvalueIndicatorsSet && this._subvalueIndicatorsSet.clean() }, _prepareValueIndicators: function() { var that = this; that._prepareValueIndicator(); null !== that.__subvalues && that._prepareSubvalueIndicators(); return [that._valueIndicator, that._subvalueIndicatorsSet] }, _updateActiveElements: function() { this._updateValueIndicator(); this._updateSubvalueIndicators() }, _prepareValueIndicator: function() { var that = this; var target = that._valueIndicator; var settings = that._prepareIndicatorSettings(that.option("valueIndicator") || {}, "valueIndicatorType"); if (target && target.type !== settings.type) { target.dispose(); target = null } if (!target) { target = that._valueIndicator = that._createIndicator(settings.type, that._renderer.root, "dxg-value-indicator", "value-indicator") } target.render(settings) }, _createSubvalueIndicatorsSet: function() { var that = this; var root = that._renderer.root; return new ValueIndicatorsSet({ createIndicator: function(type, i) { return that._createIndicator(type, root, "dxg-subvalue-indicator", "subvalue-indicator", i) }, createPalette: function(palette) { return that._themeManager.createPalette(palette) } }) }, _prepareSubvalueIndicators: function() { var that = this; var target = that._subvalueIndicatorsSet; var settings = that._prepareIndicatorSettings(that.option("subvalueIndicator") || {}, "subvalueIndicatorType"); if (!target) { target = that._subvalueIndicatorsSet = that._createSubvalueIndicatorsSet() } var isRecreate = settings.type !== target.type; target.type = settings.type; var dummy = that._createIndicator(settings.type, that._renderer.root); if (dummy) { dummy.dispose(); target.render(settings, isRecreate) } }, _setupValue: function(value) { this.__value = processValue(value, this.__value) }, _setupSubvalues: function(subvalues) { var vals = void 0 === subvalues ? this.__subvalues : parseArrayOfNumbers(subvalues); var i; var ii; var list; if (null === vals) { return } for (i = 0, ii = vals.length, list = []; i < ii; ++i) { list.push(processValue(vals[i], this.__subvalues[i])) } this.__subvalues = list }, _updateValueIndicator: function() { var that = this; that._valueIndicator && that._valueIndicator.value(that.__value, that._noAnimation) }, _updateSubvalueIndicators: function() { var that = this; that._subvalueIndicatorsSet && that._subvalueIndicatorsSet.values(that.__subvalues, that._noAnimation) }, value: function(arg) { if (void 0 !== arg) { this._changeValue(arg); return this } return this.__value }, subvalues: function(arg) { if (void 0 !== arg) { this._changeSubvalues(arg); return this } return null !== this.__subvalues ? this.__subvalues.slice() : void 0 }, _changeValue: function(value) { var that = this; that._setupValue(value); that._beginValueChanging(); that._updateValueIndicator(); if (that.__value !== that.option(OPTION_VALUE)) { that.option(OPTION_VALUE, that.__value) } that._endValueChanging() }, _changeSubvalues: function(subvalues) { var that = this; if (null !== that.__subvalues) { that._setupSubvalues(subvalues); that._beginValueChanging(); that._updateSubvalueIndicators(); that._endValueChanging() } else { that.__subvalues = parseArrayOfNumbers(subvalues); that._setContentSize(); that._renderContent() } if (!_compareArrays(that.__subvalues, that.option(OPTION_SUBVALUES))) { that.option(OPTION_SUBVALUES, that.__subvalues) } }, _optionChangesMap: { scale: "DOMAIN", rangeContainer: "MOSTLY_TOTAL", valueIndicator: "MOSTLY_TOTAL", subvalueIndicator: "MOSTLY_TOTAL", containerBackgroundColor: "MOSTLY_TOTAL", value: "VALUE", subvalues: "SUBVALUES", valueIndicators: "MOSTLY_TOTAL" }, _customChangesOrder: ["VALUE", "SUBVALUES"], _change_VALUE: function() { this._changeValue(this.option(OPTION_VALUE)) }, _change_SUBVALUES: function() { this._changeSubvalues(this.option(OPTION_SUBVALUES)) }, _applyMainLayout: null, _getElementLayout: null, _createIndicator: function(type, owner, className, trackerType, trackerIndex, _strict) { var that = this; var indicator = that._factory.createIndicator({ renderer: that._renderer, translator: that._translator, owner: owner, tracker: that._tracker, className: className }, type, _strict); if (indicator) { indicator.type = type; indicator._trackerInfo = { type: trackerType, index: trackerIndex } } return indicator }, _getApproximateScreenRange: null }); function valueGetter(arg) { return arg ? arg.value : null } function setupValues(that, fieldName, optionItems) { var currentValues = that[fieldName]; var newValues = _isArray(optionItems) ? _map(optionItems, valueGetter) : []; var i = 0; var ii = newValues.length; var list = []; for (; i < ii; ++i) { list.push(processValue(newValues[i], currentValues[i])) } that[fieldName] = list } function selectMode(gauge) { if (void 0 === gauge.option(OPTION_VALUE) && void 0 === gauge.option(OPTION_SUBVALUES)) { if (void 0 !== gauge.option("valueIndicators")) { disableDefaultMode(gauge); selectHardMode(gauge) } } } function disableDefaultMode(that) { that.value = that.subvalues = _noop; that._setupValue = that._setupSubvalues = that._updateValueIndicator = that._updateSubvalueIndicators = null } function selectHardMode(that) { that._indicatorValues = []; setupValues(that, "_indicatorValues", that.option("valueIndicators")); that._valueIndicators = []; var _applyMostlyTotalChange = that._applyMostlyTotalChange; that._applyMostlyTotalChange = function() { setupValues(this, "_indicatorValues", this.option("valueIndicators")); _applyMostlyTotalChange.call(this) }; that._updateActiveElements = updateActiveElements_hardMode; that._prepareValueIndicators = prepareValueIndicators_hardMode; that._disposeValueIndicators = disposeValueIndicators_hardMode; that._cleanValueIndicators = cleanValueIndicators_hardMode; that.indicatorValue = indicatorValue_hardMode } function updateActiveElements_hardMode() { var that = this; _each(that._valueIndicators, function(_, valueIndicator) { valueIndicator.value(that._indicatorValues[valueIndicator.index], that._noAnimation) }) } function prepareValueIndicators_hardMode() { var that = this; var valueIndicators = that._valueIndicators || []; var userOptions = that.option("valueIndicators"); var optionList = []; var i = 0; var ii; for (ii = _isArray(userOptions) ? userOptions.length : 0; i < ii; ++i) { optionList.push(userOptions[i]) } for (ii = valueIndicators.length; i < ii; ++i) { optionList.push(null) } var newValueIndicators = []; _each(optionList, function(i, userSettings) { var valueIndicator = valueIndicators[i]; if (!userSettings) { valueIndicator && valueIndicator.dispose(); return } var settings = that._prepareIndicatorSettings(userSettings, "valueIndicatorType"); if (valueIndicator && valueIndicator.type !== settings.type) { valueIndicator.dispose(); valueIndicator = null } if (!valueIndicator) { valueIndicator = that._createIndicator(settings.type, that._renderer.root, "dxg-value-indicator", "value-indicator", i, true) } if (valueIndicator) { valueIndicator.index = i; valueIndicator.render(settings); newValueIndicators.push(valueIndicator) } }); that._valueIndicators = newValueIndicators; return that._valueIndicators } function disposeValueIndicators_hardMode() { _each(this._valueIndicators, function(_, valueIndicator) { valueIndicator.dispose() }); this._valueIndicators = null } function cleanValueIndicators_hardMode() { _each(this._valueIndicators, function(_, valueIndicator) { valueIndicator.clean() }) } function indicatorValue_hardMode(index, value) { return accessPointerValue(this, this._valueIndicators, this._indicatorValues, index, value) } function accessPointerValue(that, pointers, values, index, value) { if (void 0 !== value) { if (void 0 !== values[index]) { values[index] = processValue(value, values[index]); pointers[index] && pointers[index].value(values[index]) } return that } else { return values[index] } } function ValueIndicatorsSet(parameters) { this._parameters = parameters; this._indicators = [] } ValueIndicatorsSet.prototype = { constructor: ValueIndicatorsSet, dispose: function() { var that = this; _each(that._indicators, function(_, indicator) { indicator.dispose() }); that._parameters = that._options = that._indicators = that._colorPalette = that._palette = null; return that }, clean: function() { var that = this; that._sample && that._sample.clean().dispose(); _each(that._indicators, function(_, indicator) { indicator.clean() }); that._sample = that._options = that._palette = null; return that }, render: function(options, isRecreate) { var that = this; that._options = options; that._sample = that._parameters.createIndicator(that.type); that._sample.render(options); that.enabled = that._sample.enabled; that._palette = _isDefined(options.palette) ? that._parameters.createPalette(options.palette) : null; if (that.enabled) { that._generatePalette(that._indicators.length); that._indicators = _map(that._indicators, function(indicator, i) { if (isRecreate) { indicator.dispose(); indicator = that._parameters.createIndicator(that.type, i) } indicator.render(that._getIndicatorOptions(i)); return indicator }) } return that }, getOffset: function() { return this._sample.getOffset() }, resize: function(layout) { var that = this; that._layout = layout; _each(that._indicators, function(_, indicator) { indicator.resize(layout) }); return that }, measure: function(layout) { return this._sample.measure(layout) }, _getIndicatorOptions: function(index) { var result = this._options; if (this._colorPalette) { result = _extend({}, result, { color: this._colorPalette[index] }) } return result }, _generatePalette: function(count) { var that = this; var colors = null; if (that._palette) { that._palette.reset(); colors = that._palette.generateColors(count, { repeat: true }) } that._colorPalette = colors }, _adjustIndicatorsCount: function(count) { var that = this; var indicators = that._indicators; var i; var ii; var indicator; var indicatorsLen = indicators.length; if (indicatorsLen > count) { for (i = count, ii = indicatorsLen; i < ii; ++i) { indicators[i].clean().dispose() } that._indicators = indicators.slice(0, count); that._generatePalette(indicators.length) } else { if (indicatorsLen < count) { that._generatePalette(count); for (i = indicatorsLen, ii = count; i < ii; ++i) { indicator = that._parameters.createIndicator(that.type, i); indicator.render(that._getIndicatorOptions(i)).resize(that._layout); indicators.push(indicator) } } } }, values: function(arg, _noAnimation) { var that = this; if (!that.enabled) { return } if (void 0 !== arg) { if (!_isArray(arg)) { arg = _isFinite(arg) ? [Number(arg)] : null } if (arg) { that._adjustIndicatorsCount(arg.length); _each(that._indicators, function(i, indicator) { indicator.value(arg[i], _noAnimation) }) } return that } return _map(that._indicators, function(indicator) { return indicator.value() }) } }; exports.createIndicatorCreator = function(indicators) { return function(parameters, type, _strict) { var indicatorType = indicators[_normalizeEnum(type)] || !_strict && indicators._default; return indicatorType ? new indicatorType(parameters) : null } } }, /*!***********************************************************!*\ !*** ./artifacts/transpiled/viz/range_selector/common.js ***! \***********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _format = __webpack_require__( /*! ../axes/smart_formatter */ 405).smartFormatter; var isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction; var HEIGHT_COMPACT_MODE = 24; var POINTER_SIZE = 4; var EMPTY_SLIDER_MARKER_TEXT = ". . ."; var utils = { trackerSettings: { fill: "grey", stroke: "grey", opacity: 1e-4 }, animationSettings: { duration: 250 } }; var consts = { emptySliderMarkerText: EMPTY_SLIDER_MARKER_TEXT, pointerSize: POINTER_SIZE }; var formatValue = function(value, formatOptions, tickIntervalsInfo, valueType, type, logarithmBase) { var formatObject = { value: value, valueText: _format(value, { labelOptions: formatOptions, ticks: tickIntervalsInfo ? tickIntervalsInfo.ticks : [], tickInterval: tickIntervalsInfo ? tickIntervalsInfo.tickInterval : void 0, dataType: valueType, type: type, logarithmBase: logarithmBase }) }; return String(isFunction(formatOptions.customizeText) ? formatOptions.customizeText.call(formatObject, formatObject) : formatObject.valueText) }; exports.utils = utils; exports.consts = consts; exports.formatValue = formatValue; exports.HEIGHT_COMPACT_MODE = HEIGHT_COMPACT_MODE }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/exporter/file_saver.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _dom_adapter = __webpack_require__( /*! ../core/dom_adapter */ 11); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); var _window = __webpack_require__( /*! ../core/utils/window */ 7); var _window2 = _interopRequireDefault(_window); var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _ui = __webpack_require__( /*! ../ui/widget/ui.errors */ 17); var _ui2 = _interopRequireDefault(_ui); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _type2 = _interopRequireDefault(_type); var _console = __webpack_require__( /*! ../core/utils/console */ 73); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var window = _window2.default.getWindow(); var navigator = _window2.default.getNavigator(); var FILE_EXTESIONS = { EXCEL: "xlsx", CSS: "css", PNG: "png", JPEG: "jpeg", GIF: "gif", SVG: "svg", PDF: "pdf" }; var MIME_TYPES = exports.MIME_TYPES = { CSS: "text/css", EXCEL: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", PNG: "image/png", JPEG: "image/jpeg", GIF: "image/gif", SVG: "image/svg+xml", PDF: "application/pdf" }; exports.fileSaver = { _revokeObjectURLTimeout: 3e4, _getDataUri: function(format, data) { return "data:" + MIME_TYPES[format] + ";base64," + data }, _linkDownloader: function(fileName, href) { var exportLinkElement = _dom_adapter2.default.createElement("a"); exportLinkElement.download = fileName; exportLinkElement.href = href; exportLinkElement.target = "_blank"; return exportLinkElement }, _formDownloader: function(proxyUrl, fileName, contentType, data) { var formAttributes = { method: "post", action: proxyUrl, enctype: "multipart/form-data" }; var exportForm = (0, _renderer2.default)("
").css({ display: "none" }).attr(formAttributes); exportForm.append(''); exportForm.append(''); exportForm.append(''); exportForm.appendTo("body"); _events_engine2.default.trigger(exportForm, "submit"); if (_events_engine2.default.trigger(exportForm, "submit")) { exportForm.remove() } return exportForm }, _saveByProxy: function(proxyUrl, fileName, format, data) { return this._formDownloader(proxyUrl, fileName, MIME_TYPES[format], data) }, _winJSBlobSave: function(blob, fileName, format) { var savePicker = new Windows.Storage.Pickers.FileSavePicker; savePicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.documentsLibrary; savePicker.fileTypeChoices.insert(MIME_TYPES[format], ["." + FILE_EXTESIONS[format]]); savePicker.suggestedFileName = fileName; savePicker.pickSaveFileAsync().then(function(file) { if (file) { file.openAsync(Windows.Storage.FileAccessMode.readWrite).then(function(outputStream) { var inputStream = blob.msDetachStream(); Windows.Storage.Streams.RandomAccessStream.copyAsync(inputStream, outputStream).then(function() { outputStream.flushAsync().done(function() { inputStream.close(); outputStream.close() }) }) }) } }) }, _click: function(link) { try { link.dispatchEvent(new MouseEvent("click", { cancelable: true })) } catch (e) { var event = _dom_adapter2.default.getDocument().createEvent("MouseEvents"); event.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); link.dispatchEvent(event) } }, _saveBlobAs: function(fileName, format, data) { var _this = this; this._blobSaved = false; if (_type2.default.isDefined(navigator.msSaveOrOpenBlob)) { navigator.msSaveOrOpenBlob(data, fileName); this._blobSaved = true } else { if (_type2.default.isDefined(window.WinJS)) { this._winJSBlobSave(data, fileName, format); this._blobSaved = true } else { var URL = window.URL || window.webkitURL || window.mozURL || window.msURL || window.oURL; if (_type2.default.isDefined(URL)) { var objectURL = URL.createObjectURL(data); var downloadLink = this._linkDownloader(fileName, objectURL); setTimeout(function() { URL.revokeObjectURL(objectURL); _this._objectUrlRevoked = true }, this._revokeObjectURLTimeout); this._click(downloadLink) } else { _console.logger.warn("window.URL || window.webkitURL || window.mozURL || window.msURL || window.oURL is not defined") } } } }, saveAs: function(fileName, format, data, proxyURL, forceProxy) { fileName += "." + FILE_EXTESIONS[format]; if (forceProxy) { this._saveByProxy(proxyURL, fileName, format, data) } else { if (_type2.default.isFunction(window.Blob)) { this._saveBlobAs(fileName, format, data) } else { if (_type2.default.isDefined(proxyURL) && !_type2.default.isDefined(navigator.userAgent.match(/iPad/i))) { this._saveByProxy(proxyURL, fileName, format, data) } else { if (!_type2.default.isDefined(navigator.userAgent.match(/iPad/i))) { _ui2.default.log("E1034") } var downloadLink = this._linkDownloader(fileName, this._getDataUri(format, data)); this._click(downloadLink) } } } } } }, /*!***************************************************************!*\ !*** ./artifacts/transpiled/localization/ldml/date.format.js ***! \***************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var ARABIC_COMMA = "\u060c"; var FORMAT_SEPARATORS = " .,:;/\\<>()-[]" + ARABIC_COMMA; var ARABIC_ZERO_CODE = 1632; var checkDigit = function(char) { var code = char && char.charCodeAt(0); return char >= "0" && char <= "9" || code >= ARABIC_ZERO_CODE && code < ARABIC_ZERO_CODE + 10 }; var checkPatternContinue = function(text, index, isDigit) { var char = text[index]; var prevChar = text[index - 1]; var nextChar = text[index + 1]; if (!isDigit) { if ("." === char || " " === char && "." === prevChar) { return true } if ("-" === char && !checkDigit(nextChar)) { return true } } return FORMAT_SEPARATORS.indexOf(char) < 0 && isDigit === checkDigit(char) }; var getPatternStartIndex = function(defaultPattern, index) { if (!checkDigit(defaultPattern[index])) { while (index > 0 && !checkDigit(defaultPattern[index - 1]) && ("." === defaultPattern[index - 1] || FORMAT_SEPARATORS.indexOf(defaultPattern[index - 1]) < 0)) { index-- } } return index }; var getDifference = function(defaultPattern, patterns, processedIndexes, isDigit) { var i = 0; var result = []; var patternsFilter = function(pattern) { return defaultPattern[i] !== pattern[i] && (void 0 === isDigit || checkDigit(defaultPattern[i]) === isDigit) }; if (!Array.isArray(patterns)) { patterns = [patterns] } for (i = 0; i < defaultPattern.length; i++) { if (processedIndexes.indexOf(i) < 0 && patterns.filter(patternsFilter).length) { i = getPatternStartIndex(defaultPattern, i); do { isDigit = checkDigit(defaultPattern[i]); if (!result.length && !isDigit && checkDigit(patterns[0][i])) { break } result.push(i); processedIndexes.unshift(i); i++ } while (defaultPattern[i] && checkPatternContinue(defaultPattern, i, isDigit)); break } } if (1 === result.length && ("0" === defaultPattern[processedIndexes[0] - 1] || "\u0660" === defaultPattern[processedIndexes[0] - 1])) { processedIndexes.unshift(processedIndexes[0] - 1) } return result }; var replaceCharsCore = function(pattern, indexes, char, patternPositions) { var baseCharIndex = indexes[0]; var patternIndex = baseCharIndex < patternPositions.length ? patternPositions[baseCharIndex] : baseCharIndex; indexes.forEach(function(_, index) { pattern = pattern.substr(0, patternIndex + index) + (char.length > 1 ? char[index] : char) + pattern.substr(patternIndex + index + 1) }); if (1 === indexes.length) { pattern = pattern.replace("0" + char, char + char); pattern = pattern.replace("\u0660" + char, char + char) } return pattern }; var replaceChars = function(pattern, indexes, char, patternPositions) { var i; var index; var patternIndex; if (!checkDigit(pattern[indexes[0]] || "0")) { var letterCount = Math.max(indexes.length <= 3 ? 3 : 4, char.length); while (indexes.length > letterCount) { index = indexes.pop(); patternIndex = patternPositions[index]; patternPositions[index] = -1; for (i = index + 1; i < patternPositions.length; i++) { patternPositions[i]-- } pattern = pattern.substr(0, patternIndex) + pattern.substr(patternIndex + 1) } index = indexes[indexes.length - 1] + 1, patternIndex = index < patternPositions.length ? patternPositions[index] : index; while (indexes.length < letterCount) { indexes.push(indexes[indexes.length - 1] + 1); for (i = index; i < patternPositions.length; i++) { patternPositions[i]++ } pattern = pattern.substr(0, patternIndex) + " " + pattern.substr(patternIndex) } } pattern = replaceCharsCore(pattern, indexes, char, patternPositions); return pattern }; var formatValue = function(value, formatter) { if (Array.isArray(value)) { return value.map(function(value) { return (formatter(value) || "").toString() }) } return (formatter(value) || "").toString() }; var ESCAPE_CHARS_REGEXP = /[a-zA-Z]/g; var escapeChars = function(pattern, defaultPattern, processedIndexes, patternPositions) { var escapeIndexes = defaultPattern.split("").map(function(char, index) { if (processedIndexes.indexOf(index) < 0 && (char.match(ESCAPE_CHARS_REGEXP) || "'" === char)) { return patternPositions[index] } return -1 }); pattern = pattern.split("").map(function(char, index) { var result = char; var isCurrentCharEscaped = escapeIndexes.indexOf(index) >= 0; var isPrevCharEscaped = index > 0 && escapeIndexes.indexOf(index - 1) >= 0; var isNextCharEscaped = escapeIndexes.indexOf(index + 1) >= 0; if (isCurrentCharEscaped) { if (!isPrevCharEscaped) { result = "'" + result } if (!isNextCharEscaped) { result += "'" } } return result }).join(""); return pattern }; var getFormat = function(formatter) { var processedIndexes = []; var defaultPattern = formatValue(new Date(2009, 8, 8, 6, 5, 4), formatter); var patternPositions = defaultPattern.split("").map(function(_, index) { return index }); var result = defaultPattern; var replacedPatterns = {}; var datePatterns = [{ date: new Date(2009, 8, 8, 6, 5, 4, 100), pattern: "S" }, { date: new Date(2009, 8, 8, 6, 5, 2), pattern: "s" }, { date: new Date(2009, 8, 8, 6, 2, 4), pattern: "m" }, { date: new Date(2009, 8, 8, 18, 5, 4), pattern: "H", isDigit: true }, { date: new Date(2009, 8, 8, 2, 5, 4), pattern: "h", isDigit: true }, { date: new Date(2009, 8, 8, 18, 5, 4), pattern: "a", isDigit: false }, { date: new Date(2009, 8, 1, 6, 5, 4), pattern: "d" }, { date: [new Date(2009, 8, 2, 6, 5, 4), new Date(2009, 8, 3, 6, 5, 4), new Date(2009, 8, 4, 6, 5, 4)], pattern: "E" }, { date: new Date(2009, 9, 6, 6, 5, 4), pattern: "M" }, { date: new Date(1998, 8, 8, 6, 5, 4), pattern: "y" }]; if (!result) { return } datePatterns.forEach(function(test) { var diff = getDifference(defaultPattern, formatValue(test.date, formatter), processedIndexes, test.isDigit); var pattern = "M" === test.pattern && !replacedPatterns.d ? "L" : test.pattern; result = replaceChars(result, diff, pattern, patternPositions); replacedPatterns[pattern] = diff.length }); result = escapeChars(result, defaultPattern, processedIndexes, patternPositions); if (processedIndexes.length) { return result } }; exports.getFormat = getFormat }, /*!************************************************!*\ !*** ./artifacts/transpiled/core/utils/svg.js ***! \************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var window = __webpack_require__( /*! ./window */ 7).getWindow(); var $ = __webpack_require__( /*! ../../core/renderer */ 2); function getMarkup(element, backgroundColor) { var temp = domAdapter.createElement("div"); var clone = element.cloneNode(true); if (backgroundColor) { $(clone).css("backgroundColor", backgroundColor) } temp.appendChild(clone); return temp.innerHTML } function fixNamespaces(markup) { var first = true; if (markup.indexOf("xmlns:xlink") === -1) { markup = markup.replace(" 2) { return Object.keys(FORMAT_TYPES).map(function(count) { return ["format", "standalone"].map(function(type) { return dateParts.getMonthNames(FORMAT_TYPES[count], type).join("|") }).join("|") }).join("|") } return "0?[1-9]|1[012]" }; var PATTERN_REGEXPS = { y: function(count) { return "[0-9]+" }, M: monthRegExpGenerator, L: monthRegExpGenerator, Q: function(count, dateParts) { if (count > 2) { return dateParts.getQuarterNames(FORMAT_TYPES[count], "format").join("|") } return "0?[1-4]" }, E: function(count, dateParts) { return "\\D*" }, a: function(count, dateParts) { return dateParts.getPeriodNames(FORMAT_TYPES[count < 3 ? 3 : count], "format").join("|") }, d: function(count) { return "0?[1-9]|[12][0-9]|3[01]" }, H: function(count) { return "0?[0-9]|1[0-9]|2[0-3]" }, h: function(count) { return "0?[1-9]|1[012]" }, m: function(count) { return "0?[0-9]|[1-5][0-9]" }, s: function(count) { return "0?[0-9]|[1-5][0-9]" }, S: function(count) { return "[0-9]{1," + count + "}" } }; var parseNumber = Number; var caseInsensitiveIndexOf = function(array, value) { return array.map(function(item) { return item.toLowerCase() }).indexOf(value.toLowerCase()) }; var monthPatternParser = function(text, count, dateParts) { if (count > 2) { return ["format", "standalone"].map(function(type) { return Object.keys(FORMAT_TYPES).map(function(count) { var monthNames = dateParts.getMonthNames(FORMAT_TYPES[count], type); return caseInsensitiveIndexOf(monthNames, text) }) }).reduce(function(a, b) { return a.concat(b) }).filter(function(index) { return index >= 0 })[0] } return parseNumber(text) - 1 }; var PATTERN_PARSERS = { y: function(text, count) { var year = parseNumber(text); if (2 === count) { return year < 30 ? 2e3 + year : 1900 + year } return year }, M: monthPatternParser, L: monthPatternParser, Q: function(text, count, dateParts) { if (count > 2) { return dateParts.getQuarterNames(FORMAT_TYPES[count], "format").indexOf(text) } return parseNumber(text) - 1 }, E: function(text, count, dateParts) { var dayNames = dateParts.getDayNames(FORMAT_TYPES[count < 3 ? 3 : count], "format"); return caseInsensitiveIndexOf(dayNames, text) }, a: function(text, count, dateParts) { var periodNames = dateParts.getPeriodNames(FORMAT_TYPES[count < 3 ? 3 : count], "format"); return caseInsensitiveIndexOf(periodNames, text) }, d: parseNumber, H: parseNumber, h: parseNumber, m: parseNumber, s: parseNumber, S: function(text, count) { count = Math.max(count, 3); text = text.slice(0, 3); while (count < 3) { text += "0"; count++ } return parseNumber(text) } }; var ORDERED_PATTERNS = ["y", "M", "d", "h", "m", "s", "S"]; var PATTERN_SETTERS = { y: "setFullYear", M: "setMonth", L: "setMonth", a: function(date, value, datePartValues) { var hours = date.getHours(); var hourPartValue = datePartValues.h; if (void 0 !== hourPartValue && hourPartValue !== hours) { hours-- } if (!value && 12 === hours) { hours = 0 } else { if (value && 12 !== hours) { hours += 12 } } date.setHours(hours) }, d: "setDate", H: "setHours", h: "setHours", m: "setMinutes", s: "setSeconds", S: "setMilliseconds" }; var getSameCharCount = function(text, index) { var char = text[index]; var count = 0; do { index++; count++ } while (text[index] === char); return count }; var createPattern = function(char, count) { var result = ""; for (var i = 0; i < count; i++) { result += char } return result }; var getRegExpInfo = function(format, dateParts) { var regexpText = ""; var stubText = ""; var isEscaping; var patterns = []; var addPreviousStub = function() { if (stubText) { patterns.push("'" + stubText + "'"); regexpText += escapeRegExp(stubText) + ")"; stubText = "" } }; for (var i = 0; i < format.length; i++) { var char = format[i]; var isEscapeChar = "'" === char; var regexpPart = PATTERN_REGEXPS[char]; if (isEscapeChar) { isEscaping = !isEscaping; if ("'" !== format[i - 1]) { continue } } if (regexpPart && !isEscaping) { var count = getSameCharCount(format, i); var pattern = createPattern(char, count); addPreviousStub(); patterns.push(pattern); regexpText += "(" + regexpPart(count, dateParts) + ")"; i += count - 1 } else { if (!stubText) { regexpText += "(" } stubText += char } } addPreviousStub(); return { patterns: patterns, regexp: new RegExp("^" + regexpText + "$", "i") } }; var getPatternSetters = function() { return PATTERN_SETTERS }; var setPatternPart = function(date, pattern, text, dateParts, datePartValues) { var patternChar = pattern[0]; var partSetter = PATTERN_SETTERS[patternChar]; var partParser = PATTERN_PARSERS[patternChar]; if (partSetter && partParser) { var value = partParser(text, pattern.length, dateParts); datePartValues[pattern] = value; if (date[partSetter]) { date[partSetter](value) } else { partSetter(date, value, datePartValues) } } }; var setPatternPartFromNow = function(date, pattern, now) { var setterName = PATTERN_SETTERS[pattern]; var getterName = "g" + setterName.substr(1); var value = now[getterName](); date[setterName](value) }; var getShortPatterns = function(fullPatterns) { return fullPatterns.map(function(pattern) { if ("'" === pattern[0]) { return "" } else { return "H" === pattern[0] ? "h" : pattern[0] } }) }; var getMaxOrderedPatternIndex = function(patterns) { var indexes = patterns.map(function(pattern) { return ORDERED_PATTERNS.indexOf(pattern) }); return Math.max.apply(Math, indexes) }; var getOrderedFormatPatterns = function(formatPatterns) { var otherPatterns = formatPatterns.filter(function(pattern) { return ORDERED_PATTERNS.indexOf(pattern) < 0 }); return ORDERED_PATTERNS.concat(otherPatterns) }; var getParser = function(format, dateParts) { var regExpInfo = getRegExpInfo(format, dateParts); return function(text) { var regExpResult = regExpInfo.regexp.exec(text); if (regExpResult) { var now = new Date; var date = new Date(now.getFullYear(), 0, 1); var formatPatterns = getShortPatterns(regExpInfo.patterns); var maxPatternIndex = getMaxOrderedPatternIndex(formatPatterns); var orderedFormatPatterns = getOrderedFormatPatterns(formatPatterns); var datePartValues = {}; orderedFormatPatterns.forEach(function(pattern, index) { if (!pattern || index < ORDERED_PATTERNS.length && index > maxPatternIndex) { return } var patternIndex = formatPatterns.indexOf(pattern); if (patternIndex >= 0) { var regExpPattern = regExpInfo.patterns[patternIndex]; var regExpText = regExpResult[patternIndex + 1]; setPatternPart(date, regExpPattern, regExpText, dateParts, datePartValues) } else { setPatternPartFromNow(date, pattern, now) } }); return date } return null } }; exports.getParser = getParser; exports.getRegExpInfo = getRegExpInfo; exports.getPatternSetters = getPatternSetters }, /*!************************************************************!*\ !*** ./artifacts/transpiled/bundles/modules/parts/core.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var DevExpress = __webpack_require__( /*! ../../../bundles/modules/core */ 147); __webpack_require__( /*! ../../../integration/jquery */ 268); __webpack_require__( /*! ../../../integration/angular */ 460); __webpack_require__( /*! ../../../integration/knockout */ 475); __webpack_require__( /*! ../../../localization/globalize/core */ 127); __webpack_require__( /*! ../../../localization/globalize/message */ 484); __webpack_require__( /*! ../../../localization/globalize/number */ 183); __webpack_require__( /*! ../../../localization/globalize/date */ 485); __webpack_require__( /*! ../../../localization/globalize/currency */ 486); __webpack_require__( /*! ../../../events/click */ 19); __webpack_require__( /*! ../../../events/contextmenu */ 168); __webpack_require__( /*! ../../../events/double_click */ 128); __webpack_require__( /*! ../../../events/drag */ 56); __webpack_require__( /*! ../../../events/hold */ 88); __webpack_require__( /*! ../../../events/hover */ 148); __webpack_require__( /*! ../../../events/pointer */ 23); __webpack_require__( /*! ../../../events/swipe */ 174); __webpack_require__( /*! ../../../events/transform */ 285); module.exports = DevExpress }, /*!*********************************************************!*\ !*** ./artifacts/transpiled/mobile/hide_top_overlay.js ***! \*********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray; var hideCallback = function() { var callbacks = []; return { add: function(callback) { var indexOfCallback = inArray(callback, callbacks); if (indexOfCallback === -1) { callbacks.push(callback) } }, remove: function(callback) { var indexOfCallback = inArray(callback, callbacks); if (indexOfCallback !== -1) { callbacks.splice(indexOfCallback, 1) } }, fire: function() { var callback = callbacks.pop(); var 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 }, /*!*******************************************!*\ !*** ./artifacts/transpiled/ui/dialog.js ***! \*******************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _component = __webpack_require__( /*! ../core/component */ 133); var _component2 = _interopRequireDefault(_component); var _action = __webpack_require__( /*! ../core/action */ 111); var _action2 = _interopRequireDefault(_action); var _devices = __webpack_require__( /*! ../core/devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _config = __webpack_require__( /*! ../core/config */ 31); var _config2 = _interopRequireDefault(_config); var _dom = __webpack_require__( /*! ../core/utils/dom */ 12); var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 6); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _window = __webpack_require__( /*! ../core/utils/window */ 7); var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5); var _view_port = __webpack_require__( /*! ../core/utils/view_port */ 78); var _message = __webpack_require__( /*! ../localization/message */ 13); var _message2 = _interopRequireDefault(_message); var _ui = __webpack_require__( /*! ./widget/ui.errors */ 17); var _ui2 = _interopRequireDefault(_ui); var _popup = __webpack_require__( /*! ./popup */ 46); var _popup2 = _interopRequireDefault(_popup); var _common = __webpack_require__( /*! ../core/utils/common */ 4); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var window = (0, _window.getWindow)(); var DEFAULT_BUTTON = { text: "OK", onClick: function() { return true } }; var DX_DIALOG_CLASSNAME = "dx-dialog"; var DX_DIALOG_WRAPPER_CLASSNAME = "".concat(DX_DIALOG_CLASSNAME, "-wrapper"); var DX_DIALOG_ROOT_CLASSNAME = "".concat(DX_DIALOG_CLASSNAME, "-root"); var DX_DIALOG_CONTENT_CLASSNAME = "".concat(DX_DIALOG_CLASSNAME, "-content"); var DX_DIALOG_MESSAGE_CLASSNAME = "".concat(DX_DIALOG_CLASSNAME, "-message"); var DX_DIALOG_BUTTONS_CLASSNAME = "".concat(DX_DIALOG_CLASSNAME, "-buttons"); var DX_DIALOG_BUTTON_CLASSNAME = "".concat(DX_DIALOG_CLASSNAME, "-button"); var DX_BUTTON_CLASSNAME = "dx-button"; var FakeDialogComponent = _component2.default.inherit({ ctor: function(element, options) { this.callBase(options) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: { platform: "ios" }, options: { width: 276 } }, { device: { platform: "android" }, options: { lWidth: "60%", pWidth: "80%" } }]) } }); exports.FakeDialogComponent = FakeDialogComponent; exports.title = ""; exports.custom = function(options) { var deferred = new _deferred.Deferred; var defaultOptions = (new FakeDialogComponent).option(); options = (0, _extend.extend)(defaultOptions, options); var $element = (0, _renderer2.default)("
").addClass(DX_DIALOG_CLASSNAME).appendTo((0, _view_port.value)()); var isMessageDefined = "message" in options; var isMessageHtmlDefined = "messageHtml" in options; if (isMessageDefined) { _ui2.default.log("W1013") } var messageHtml = String(isMessageHtmlDefined ? options.messageHtml : options.message); var $message = (0, _renderer2.default)("
").addClass(DX_DIALOG_MESSAGE_CLASSNAME).html(messageHtml); var popupToolbarItems = []; var toolbarItemsOption = options.toolbarItems; if (toolbarItemsOption) { _ui2.default.log("W0001", "DevExpress.ui.dialog", "toolbarItems", "16.2", "Use the 'buttons' option instead") } else { toolbarItemsOption = options.buttons }(0, _iterator.each)(toolbarItemsOption || [DEFAULT_BUTTON], function() { var action = new _action2.default(this.onClick, { context: popupInstance }); popupToolbarItems.push({ toolbar: "bottom", location: _devices2.default.current().android ? "after" : "center", widget: "dxButton", options: (0, _extend.extend)({}, this, { onClick: function() { var result = action.execute.apply(action, arguments); hide(result) } }) }) }); var popupInstance = new _popup2.default($element, (0, _extend.extend)({ title: options.title || exports.title, showTitle: (0, _common.ensureDefined)(options.showTitle, true), dragEnabled: (0, _common.ensureDefined)(options.dragEnabled, true), height: "auto", width: function() { var isPortrait = (0, _renderer2.default)(window).height() > (0, _renderer2.default)(window).width(); var key = (isPortrait ? "p" : "l") + "Width"; var widthOption = Object.prototype.hasOwnProperty.call(options, key) ? options[key] : options.width; return (0, _type.isFunction)(widthOption) ? widthOption() : widthOption }, showCloseButton: options.showCloseButton || false, ignoreChildEvents: false, onContentReady: function(args) { args.component.$content().addClass(DX_DIALOG_CONTENT_CLASSNAME).append($message) }, onShowing: function(e) { e.component.bottomToolbar().addClass(DX_DIALOG_BUTTONS_CLASSNAME).find(".".concat(DX_BUTTON_CLASSNAME)).addClass(DX_DIALOG_BUTTON_CLASSNAME); (0, _dom.resetActiveElement)() }, onShown: function(e) { var $firstButton = e.component.bottomToolbar().find(".".concat(DX_BUTTON_CLASSNAME)).first(); (0, _events_engine.trigger)($firstButton, "focus") }, onHiding: function() { deferred.reject() }, toolbarItems: popupToolbarItems, animation: { show: { type: "pop", duration: 400 }, hide: { type: "pop", duration: 400, to: { opacity: 0, scale: 0 }, from: { opacity: 1, scale: 1 } } }, rtlEnabled: (0, _config2.default)().rtlEnabled, boundaryOffset: { h: 10, v: 0 } }, options.popupOptions)); popupInstance._wrapper().addClass(DX_DIALOG_WRAPPER_CLASSNAME); if (options.position) { popupInstance.option("position", options.position) } popupInstance._wrapper().addClass(DX_DIALOG_ROOT_CLASSNAME); function show() { popupInstance.show(); return deferred.promise() } function hide(value) { deferred.resolve(value); popupInstance.hide().done(function() { popupInstance.$element().remove() }) } return { show: show, hide: hide } }; exports.alert = function(messageHtml, title, showTitle) { var options = (0, _type.isPlainObject)(messageHtml) ? messageHtml : { title: title, messageHtml: messageHtml, showTitle: showTitle, dragEnabled: showTitle }; return exports.custom(options).show() }; exports.confirm = function(messageHtml, title, showTitle) { var options = (0, _type.isPlainObject)(messageHtml) ? messageHtml : { title: title, messageHtml: messageHtml, showTitle: showTitle, buttons: [{ text: _message2.default.format("Yes"), onClick: function() { return true } }, { text: _message2.default.format("No"), onClick: function() { return false } }], dragEnabled: showTitle }; return exports.custom(options).show() } }, /*!*************************************************!*\ !*** ./artifacts/transpiled/ui/action_sheet.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow(); var noop = __webpack_require__( /*! ../core/utils/common */ 4).noop; var messageLocalization = __webpack_require__( /*! ../localization/message */ 13); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var Button = __webpack_require__( /*! ./button */ 34); var CollectionWidget = __webpack_require__( /*! ./collection/ui.collection_widget.edit */ 53); var Popup = __webpack_require__( /*! ./popup */ 46); var Popover = __webpack_require__( /*! ./popover */ 137); var BindableTemplate = __webpack_require__( /*! ./widget/bindable_template */ 65); var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred; var ACTION_SHEET_CLASS = "dx-actionsheet"; var ACTION_SHEET_CONTAINER_CLASS = "dx-actionsheet-container"; var ACTION_SHEET_POPUP_WRAPPER_CLASS = "dx-actionsheet-popup-wrapper"; var ACTION_SHEET_POPOVER_WRAPPER_CLASS = "dx-actionsheet-popover-wrapper"; var ACTION_SHEET_CANCEL_BUTTON_CLASS = "dx-actionsheet-cancel"; var ACTION_SHEET_ITEM_CLASS = "dx-actionsheet-item"; var ACTION_SHEET_ITEM_DATA_KEY = "dxActionSheetItemData"; var ACTION_SHEET_WITHOUT_TITLE_CLASS = "dx-actionsheet-without-title"; var ActionSheet = CollectionWidget.inherit({ _getDefaultOptions: function() { return extend(this.callBase(), { usePopover: false, target: null, title: "", showTitle: true, showCancelButton: true, cancelText: messageLocalization.format("Cancel"), onCancelClick: null, visible: false, noDataText: "", focusStateEnabled: false, selectionByClick: false }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: { platform: "ios", tablet: true }, options: { usePopover: true } }]) }, _initTemplates: function() { this.callBase(); this._defaultTemplates.item = new BindableTemplate(function($container, data) { var button = new Button($("
"), extend({ onClick: data && data.click }, data)); $container.append(button.$element()) }, ["disabled", "icon", "text", "type", "onClick", "click"], this.option("integrationOptions.watchMethod")) }, _itemContainer: function() { return this._$itemContainer }, _itemClass: function() { return ACTION_SHEET_ITEM_CLASS }, _itemDataKey: function() { return ACTION_SHEET_ITEM_DATA_KEY }, _toggleVisibility: noop, _renderDimensions: noop, _initMarkup: function() { this.callBase(); this.$element().addClass(ACTION_SHEET_CLASS); this._createItemContainer() }, _render: function() { this._renderPopup() }, _createItemContainer: function() { this._$itemContainer = $("
").addClass(ACTION_SHEET_CONTAINER_CLASS); this._renderDisabled() }, _renderDisabled: function() { this._$itemContainer.toggleClass("dx-state-disabled", this.option("disabled")) }, _renderPopup: function() { this._$popup = $("
").appendTo(this.$element()); this._isPopoverMode() ? this._createPopover() : this._createPopup(); this._renderPopupTitle(); this._mapPopupOption("visible") }, _mapPopupOption: function(optionName) { this._popup && this._popup.option(optionName, this.option(optionName)) }, _isPopoverMode: function() { return this.option("usePopover") && this.option("target") }, _renderPopupTitle: function() { this._mapPopupOption("showTitle"); this._popup && this._popup._wrapper().toggleClass(ACTION_SHEET_WITHOUT_TITLE_CLASS, !this.option("showTitle")) }, _clean: function() { if (this._$popup) { this._$popup.remove() } this.callBase() }, _overlayConfig: function() { return { onInitialized: function(args) { this._popup = args.component }.bind(this), disabled: false, showTitle: true, title: this.option("title"), deferRendering: !window.angular, onContentReady: this._popupContentReadyAction.bind(this), onHidden: this.hide.bind(this) } }, _createPopover: function() { this._createComponent(this._$popup, Popover, extend(this._overlayConfig(), { width: this.option("width") || 200, height: this.option("height") || "auto", target: this.option("target") })); this._popup._wrapper().addClass(ACTION_SHEET_POPOVER_WRAPPER_CLASS) }, _createPopup: function() { this._createComponent(this._$popup, Popup, extend(this._overlayConfig(), { dragEnabled: false, width: this.option("width") || "100%", height: this.option("height") || "auto", showCloseButton: false, position: { my: "bottom", at: "bottom", of: window }, animation: { show: { type: "slide", duration: 400, from: { position: { my: "top", at: "bottom", of: window } }, to: { position: { my: "bottom", at: "bottom", of: window } } }, hide: { type: "slide", duration: 400, from: { position: { my: "bottom", at: "bottom", of: window } }, to: { position: { my: "top", at: "bottom", of: window } } } } })); this._popup._wrapper().addClass(ACTION_SHEET_POPUP_WRAPPER_CLASS) }, _popupContentReadyAction: function() { this._popup.$content().append(this._$itemContainer); this._attachClickEvent(); this._attachHoldEvent(); this._prepareContent(); this._renderContent(); this._renderCancelButton() }, _renderCancelButton: function() { if (this._isPopoverMode()) { return } if (this._$cancelButton) { this._$cancelButton.remove() } if (this.option("showCancelButton")) { var cancelClickAction = this._createActionByOption("onCancelClick") || noop; var that = this; this._$cancelButton = $("
").addClass(ACTION_SHEET_CANCEL_BUTTON_CLASS).appendTo(this._popup && this._popup.$content()); this._createComponent(this._$cancelButton, Button, { disabled: false, text: this.option("cancelText"), onClick: function(e) { var hidingArgs = { event: e, cancel: false }; cancelClickAction(hidingArgs); if (!hidingArgs.cancel) { that.hide() } }, integrationOptions: {} }) } }, _attachItemClickEvent: noop, _itemClickHandler: function(e) { this.callBase(e); if (!$(e.target).is(".dx-state-disabled, .dx-state-disabled *")) { this.hide() } }, _itemHoldHandler: function(e) { this.callBase(e); if (!$(e.target).is(".dx-state-disabled, .dx-state-disabled *")) { this.hide() } }, _optionChanged: function(args) { switch (args.name) { case "width": case "height": case "visible": case "title": this._mapPopupOption(args.name); break; case "disabled": this._renderDisabled(); break; case "showTitle": this._renderPopupTitle(); break; case "showCancelButton": case "onCancelClick": case "cancelText": this._renderCancelButton(); break; case "target": case "usePopover": case "items": this._invalidate(); break; default: this.callBase(args) } }, toggle: function(showing) { var that = this; var d = new Deferred; that._popup.toggle(showing).done(function() { that.option("visible", showing); d.resolveWith(that) }); return d.promise() }, show: function() { return this.toggle(true) }, hide: function() { return this.toggle(false) } }); registerComponent("dxActionSheet", ActionSheet); module.exports = ActionSheet }, /*!***********************************************************************!*\ !*** ./artifacts/transpiled/ui/drop_down_editor/ui.drop_down_list.js ***! \***********************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var $ = __webpack_require__( /*! ../../core/renderer */ 2); var window = __webpack_require__( /*! ../../core/utils/window */ 7).getWindow(); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var Guid = __webpack_require__( /*! ../../core/guid */ 40); var registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9); var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray; var DropDownEditor = __webpack_require__( /*! ./ui.drop_down_editor */ 169); var List = __webpack_require__( /*! ../list */ 100); var errors = __webpack_require__( /*! ../widget/ui.errors */ 17); var eventUtils = __webpack_require__( /*! ../../events/utils */ 8); var devices = __webpack_require__( /*! ../../core/devices */ 16); var dataQuery = __webpack_require__( /*! ../../data/query */ 42); var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var DataExpressionMixin = __webpack_require__( /*! ../editor/ui.data_expression */ 220); var messageLocalization = __webpack_require__( /*! ../../localization/message */ 13); var ChildDefaultTemplate = __webpack_require__( /*! ../widget/child_default_template */ 134); var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred; var DataConverterMixin = __webpack_require__( /*! ../shared/grouped_data_converter_mixin */ 287).default; var LIST_ITEM_SELECTOR = ".dx-list-item"; var LIST_ITEM_DATA_KEY = "dxListItemData"; var DROPDOWNLIST_POPUP_WRAPPER_CLASS = "dx-dropdownlist-popup-wrapper"; var SKIP_GESTURE_EVENT_CLASS = "dx-skip-gesture-event"; var SEARCH_EVENT = "input"; var SEARCH_MODES = ["startswith", "contains", "endwith", "notcontains"]; var DropDownList = DropDownEditor.inherit({ _supportedKeys: function() { var parent = this.callBase(); return extend({}, parent, { tab: function(e) { if (this._allowSelectItemByTab()) { this._saveValueChangeEvent(e); var $focusedItem = $(this._list.option("focusedElement")); $focusedItem.length && this._setSelectedElement($focusedItem) } parent.tab.apply(this, arguments) }, space: commonUtils.noop, home: commonUtils.noop, end: commonUtils.noop }) }, _allowSelectItemByTab: function() { return this.option("opened") && "instantly" === this.option("applyValueMode") }, _setSelectedElement: function($element) { var value = this._valueGetter(this._list._getItemData($element)); this._setValue(value) }, _setValue: function(value) { this.option("value", value) }, _getDefaultOptions: function() { return extend(this.callBase(), extend(DataExpressionMixin._dataExpressionDefaultOptions(), { displayValue: void 0, searchEnabled: false, searchMode: "contains", searchTimeout: 500, minSearchLength: 0, searchExpr: null, valueChangeEvent: "input change keyup", selectedItem: null, noDataText: messageLocalization.format("dxCollectionWidget-noDataText"), onSelectionChanged: null, onItemClick: commonUtils.noop, showDataBeforeSearch: false, grouped: false, groupTemplate: "group", popupPosition: { my: "left top", at: "left bottom", offset: { h: 0, v: 0 }, collision: "flip" }, popupWidthExtension: 0 })) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function(_device) { return "win" === _device.platform && _device.version && 8 === _device.version[0] }, options: { popupPosition: { offset: { v: -6 } } } }, { device: { platform: "ios" }, options: { popupPosition: { offset: { v: -1 } } } }, { device: { platform: "generic" }, options: { buttonsLocation: "bottom center" } }]) }, _setOptionsByReference: function() { this.callBase(); extend(this._optionsByReference, { value: true, selectedItem: true, displayValue: true }) }, _init: function() { this.callBase(); this._initDataExpressions(); this._initActions(); this._setListDataSource(); this._validateSearchMode(); this._clearSelectedItem(); this._initItems() }, _initItems: function() { var items = this.option().items; if (items && !items.length && this._dataSource) { this.option().items = this._dataSource.items() } }, _initActions: function() { this._initContentReadyAction(); this._initSelectionChangedAction(); this._initItemClickAction() }, _initContentReadyAction: function() { this._contentReadyAction = this._createActionByOption("onContentReady", { excludeValidators: ["disabled", "readOnly"] }) }, _initSelectionChangedAction: function() { this._selectionChangedAction = this._createActionByOption("onSelectionChanged", { excludeValidators: ["disabled", "readOnly"] }) }, _initItemClickAction: function() { this._itemClickAction = this._createActionByOption("onItemClick") }, _initTemplates: function() { this.callBase(); this._defaultTemplates.item = new ChildDefaultTemplate("item", this) }, _saveFocusOnWidget: function(e) { if (this._list && this._list.initialOption("focusStateEnabled")) { this._focusInput() } }, _fitIntoRange: function(value, start, end) { if (value > end) { return start } if (value < start) { return end } return value }, _items: function() { var items = this._getPlainItems(!this._list && this._dataSource.items()); var availableItems = new dataQuery(items).filter("disabled", "<>", true).toArray(); return availableItems }, _calcNextItem: function(step) { var items = this._items(); var nextIndex = this._fitIntoRange(this._getSelectedIndex() + step, 0, items.length - 1); return items[nextIndex] }, _getSelectedIndex: function() { var items = this._items(); var selectedItem = this.option("selectedItem"); var result = -1; each(items, function(index, item) { if (this._isValueEquals(item, selectedItem)) { result = index; return false } }.bind(this)); return result }, _createPopup: function() { this.callBase(); this._updateCustomBoundaryContainer(); this._popup._wrapper().addClass(this._popupWrapperClass()); var $popupContent = this._popup.$content(); eventsEngine.off($popupContent, "mouseup"); eventsEngine.on($popupContent, "mouseup", this._saveFocusOnWidget.bind(this)) }, _updateCustomBoundaryContainer: function() { var customContainer = this.option("dropDownOptions.container"); var $container = customContainer && $(customContainer); if ($container && $container.length && !typeUtils.isWindow($container.get(0))) { var $containerWithParents = [].slice.call($container.parents()); $containerWithParents.unshift($container.get(0)); each($containerWithParents, function(i, parent) { if (parent === $("body").get(0)) { return false } else { if ("hidden" === window.getComputedStyle(parent).overflowY) { this._$customBoundaryContainer = $(parent); return false } } }.bind(this)) } }, _popupWrapperClass: function() { return DROPDOWNLIST_POPUP_WRAPPER_CLASS }, _renderInputValue: function() { var value = this._getCurrentValue(); return this._loadInputValue(value, this._setSelectedItem.bind(this)).always(this.callBase.bind(this, value)) }, _loadInputValue: function(value, callback) { return this._loadItem(value).always(callback) }, _getItemFromPlain: function(value, cache) { var plainItems; var selectedItem; if (cache && "object" !== _typeof(value)) { if (!cache.itemByValue) { cache.itemByValue = {}; plainItems = this._getPlainItems(); plainItems.forEach(function(item) { cache.itemByValue[this._valueGetter(item)] = item }, this) } selectedItem = cache.itemByValue[value] } if (!selectedItem) { plainItems = this._getPlainItems(); selectedItem = commonUtils.grep(plainItems, function(item) { return this._isValueEquals(this._valueGetter(item), value) }.bind(this))[0] } return selectedItem }, _loadItem: function(value, cache) { var selectedItem = this._getItemFromPlain(value, cache); return void 0 !== selectedItem ? (new Deferred).resolve(selectedItem).promise() : this._loadValue(value) }, _getPlainItems: function(items) { var plainItems = []; items = items || this.option("items") || this._dataSource.items() || []; for (var i = 0; i < items.length; i++) { if (items[i] && items[i].items) { plainItems = plainItems.concat(items[i].items) } else { plainItems.push(items[i]) } } return plainItems }, _setSelectedItem: function(item) { var displayValue = this._displayValue(item); this.option("selectedItem", commonUtils.ensureDefined(item, null)); this.option("displayValue", displayValue) }, _displayValue: function(item) { return this._displayGetter(item) }, _refreshSelected: function() { var cache = {}; this._listItemElements().each(function(_, itemElement) { var $itemElement = $(itemElement); var itemValue = this._valueGetter($itemElement.data(LIST_ITEM_DATA_KEY)); var isItemSelected = this._isSelectedValue(itemValue, cache); if (isItemSelected) { this._list.selectItem($itemElement) } else { this._list.unselectItem($itemElement) } }.bind(this)) }, _popupShownHandler: function() { this.callBase(); this._setFocusPolicy() }, _setFocusPolicy: function() { if (!this.option("focusStateEnabled") || !this._list) { return } this._list.option("focusedElement", null) }, _isSelectedValue: function(value) { return this._isValueEquals(value, this.option("value")) }, _validateSearchMode: function() { var searchMode = this.option("searchMode"); var normalizedSearchMode = searchMode.toLowerCase(); if (inArray(normalizedSearchMode, SEARCH_MODES) < 0) { throw errors.Error("E1019", searchMode) } }, _clearSelectedItem: function() { this.option("selectedItem", null) }, _processDataSourceChanging: function() { this._setListDataSource(); this._renderInputValue().fail(function() { if (this._isCustomValueAllowed()) { return } this._clearSelectedItem() }.bind(this)) }, _isCustomValueAllowed: function() { return this.option("displayCustomValue") }, reset: function() { this.callBase(); this._clearFilter(); this._clearSelectedItem() }, _listItemElements: function() { return this._$list ? this._$list.find(LIST_ITEM_SELECTOR) : $() }, _popupConfig: function() { var that = this; return extend(this.callBase(), { templatesRenderAsynchronously: false, width: this.option("width"), onShowing: function() { that.$element().addClass(SKIP_GESTURE_EVENT_CLASS) }, onHidden: function() { that.$element().removeClass(SKIP_GESTURE_EVENT_CLASS) }, height: "auto", autoResizeEnabled: false, maxHeight: this._getMaxHeight.bind(this) }) }, _renderPopupContent: function() { this.callBase(); this._renderList() }, _attachChildKeyboardEvents: function() { if (!this._canListHaveFocus()) { this._childKeyboardProcessor = this._keyboardProcessor.attachChildProcessor(); this._setListOption("_keyboardProcessor", this._childKeyboardProcessor) } }, _fireContentReadyAction: commonUtils.noop, _setAriaTargetForList: function() { this._list._getAriaTarget = this._getAriaTarget.bind(this) }, _renderList: function() { this._listId = "dx-" + (new Guid)._value; var $list = this._$list = $("
").attr("id", this._listId).appendTo(this._popup.$content()); this._list = this._createComponent($list, List, this._listConfig()); this._refreshList(); this._setAriaTargetForList(); this._list.option("_listAttributes", { role: "combobox" }); this._renderPreventBlur(this._$list) }, _renderPreventBlur: function($target) { var eventName = eventUtils.addNamespace("mousedown", "dxDropDownList"); eventsEngine.off($target, eventName); eventsEngine.on($target, eventName, function(e) { e.preventDefault() }.bind(this)) }, _renderOpenedState: function() { this.callBase(); var opened = this.option("opened") || void 0; this.setAria({ activedescendant: opened && this._list.getFocusedItemId(), controls: opened && this._listId }) }, _setDefaultAria: function() { this.setAria({ haspopup: "listbox", autocomplete: "list" }) }, _refreshList: function() { if (this._list && this._shouldRefreshDataSource()) { this._setListDataSource() } }, _shouldRefreshDataSource: function() { var dataSourceProvided = !!this._list.option("dataSource"); return dataSourceProvided !== this._needPassDataSourceToList() }, _isDesktopDevice: function() { return "desktop" === devices.real().deviceType }, _listConfig: function() { var options = { selectionMode: "single", _templates: this.option("_templates"), templateProvider: this.option("templateProvider"), noDataText: this.option("noDataText"), grouped: this.option("grouped"), onContentReady: this._listContentReadyHandler.bind(this), itemTemplate: this.option("itemTemplate"), indicateLoading: false, keyExpr: this._getCollectionKeyExpr(), displayExpr: this._displayGetterExpr(), groupTemplate: this.option("groupTemplate"), onItemClick: this._listItemClickAction.bind(this), dataSource: this._getDataSource(), _keyboardProcessor: this._childKeyboardProcessor, hoverStateEnabled: this._isDesktopDevice() ? this.option("hoverStateEnabled") : false, focusStateEnabled: this._isDesktopDevice() ? this.option("focusStateEnabled") : false }; if (!this._canListHaveFocus()) { options.tabIndex = null; options._keyboardProcessor = this._childKeyboardProcessor } return options }, _canListHaveFocus: function() { return false }, _getDataSource: function() { return this._needPassDataSourceToList() ? this._dataSource : null }, _dataSourceOptions: function() { return { paginate: false } }, _getGroupedOption: function() { return this.option("grouped") }, _dataSourceFromUrlLoadMode: function() { return "raw" }, _listContentReadyHandler: function() { this._list = this._list || this._$list.dxList("instance"); if (!this.option("deferRendering")) { this._refreshSelected() } this._dimensionChanged(); this._contentReadyAction() }, _setListOption: function(optionName, value) { this._setWidgetOption("_list", arguments) }, _listItemClickAction: function(e) { this._listItemClickHandler(e); this._itemClickAction(e) }, _listItemClickHandler: commonUtils.noop, _setListDataSource: function() { if (!this._list) { return } this._setListOption("dataSource", this._getDataSource()); if (!this._needPassDataSourceToList()) { this._setListOption("items", []) } }, _needPassDataSourceToList: function() { return this.option("showDataBeforeSearch") || this._isMinSearchLengthExceeded() }, _isMinSearchLengthExceeded: function() { return this._searchValue().toString().length >= this.option("minSearchLength") }, _needClearFilter: function() { return this._canKeepDataSource() ? false : this._needPassDataSourceToList() }, _canKeepDataSource: function() { var _this$_dataSource; var isMinSearchLengthExceeded = this._isMinSearchLengthExceeded(); return (null === (_this$_dataSource = this._dataSource) || void 0 === _this$_dataSource ? void 0 : _this$_dataSource.isLoaded()) && this.option("showDataBeforeSearch") && this.option("minSearchLength") && !isMinSearchLengthExceeded && !this._isLastMinSearchLengthExceeded }, _searchValue: function() { return this._input().val() || "" }, _getSearchEvent: function() { return eventUtils.addNamespace(SEARCH_EVENT, this.NAME + "Search") }, _getSetFocusPolicyEvent: function() { return eventUtils.addNamespace("input", this.NAME + "FocusPolicy") }, _renderEvents: function() { this.callBase(); eventsEngine.on(this._input(), this._getSetFocusPolicyEvent(), this._setFocusPolicy.bind(this)); if (this._shouldRenderSearchEvent()) { eventsEngine.on(this._input(), this._getSearchEvent(), this._searchHandler.bind(this)) } }, _shouldRenderSearchEvent: function() { return this.option("searchEnabled") }, _refreshEvents: function() { eventsEngine.off(this._input(), this._getSearchEvent()); eventsEngine.off(this._input(), this._getSetFocusPolicyEvent()); this.callBase() }, _searchHandler: function() { if (!this._isMinSearchLengthExceeded()) { this._searchCanceled(); return } var searchTimeout = this.option("searchTimeout"); if (searchTimeout) { this._clearSearchTimer(); this._searchTimer = setTimeout(this._searchDataSource.bind(this), searchTimeout) } else { this._searchDataSource() } }, _searchCanceled: function() { this._clearSearchTimer(); if (this._needClearFilter()) { this._filterDataSource(null) } this._refreshList() }, _searchDataSource: function() { this._filterDataSource(this._searchValue()) }, _filterDataSource: function(searchValue) { this._clearSearchTimer(); var dataSource = this._dataSource; if (dataSource) { dataSource.searchExpr(this.option("searchExpr") || this._displayGetterExpr()); dataSource.searchOperation(this.option("searchMode")); dataSource.searchValue(searchValue); dataSource.load().done(this._dataSourceFiltered.bind(this, searchValue)) } }, _clearFilter: function() { var dataSource = this._dataSource; dataSource && dataSource.searchValue() && dataSource.searchValue(null) }, _dataSourceFiltered: function() { this._isLastMinSearchLengthExceeded = this._isMinSearchLengthExceeded(); this._refreshList(); this._refreshPopupVisibility() }, _shouldOpenPopup: function() { return this._hasItemsToShow() }, _refreshPopupVisibility: function() { if (this.option("readOnly") || !this._searchValue()) { return } var shouldOpenPopup = this._shouldOpenPopup(); if (shouldOpenPopup && !this._isFocused()) { return } this.option("opened", shouldOpenPopup); if (shouldOpenPopup) { this._dimensionChanged() } }, _dataSourceChangedHandler: function(newItems) { if (0 === this._dataSource.pageIndex()) { this.option().items = newItems } else { this.option().items = this.option().items.concat(newItems) } }, _hasItemsToShow: function() { var resultItems = this._dataSource && this._dataSource.items() || []; var resultAmount = resultItems.length; var isMinSearchLengthExceeded = this._needPassDataSourceToList(); return !!(isMinSearchLengthExceeded && resultAmount) }, _clearSearchTimer: function() { clearTimeout(this._searchTimer); delete this._searchTimer }, _popupShowingHandler: function() { this._dimensionChanged() }, _dimensionChanged: function() { this._popup && this._updatePopupDimensions() }, _updatePopupDimensions: function() { this._updatePopupWidth(); this._updatePopupHeight() }, _updatePopupWidth: function() { this._setPopupOption("width", this.$element().outerWidth() + this.option("popupWidthExtension")) }, _needPopupRepaint: function() { if (!this._dataSource) { return false } var currentPageIndex = this._dataSource.pageIndex(); var needRepaint = typeUtils.isDefined(this._pageIndex) && currentPageIndex <= this._pageIndex; this._pageIndex = currentPageIndex; return needRepaint }, _updatePopupHeight: function() { if (this._needPopupRepaint()) { this._popup.repaint() } this._list && this._list.updateDimensions() }, _getMaxHeight: function() { var $element = this.$element(); var $customBoundaryContainer = this._$customBoundaryContainer; var offsetTop = $element.offset().top - ($customBoundaryContainer ? $customBoundaryContainer.offset().top : 0); var windowHeight = $(window).outerHeight(); var containerHeight = $customBoundaryContainer ? Math.min($customBoundaryContainer.outerHeight(), windowHeight) : windowHeight; var maxHeight = Math.max(offsetTop, containerHeight - offsetTop - $element.outerHeight()); return Math.min(.5 * containerHeight, maxHeight) }, _clean: function() { if (this._list) { delete this._list } delete this._isLastMinSearchLengthExceeded; this.callBase() }, _dispose: function() { this._clearSearchTimer(); this.callBase() }, _setCollectionWidgetOption: function() { this._setListOption.apply(this, arguments) }, _setSubmitValue: function() { var value = this.option("value"); var submitValue = this._shouldUseDisplayValue(value) ? this._displayGetter(value) : value; this._getSubmitElement().val(submitValue) }, _shouldUseDisplayValue: function(value) { return "this" === this.option("valueExpr") && typeUtils.isObject(value) }, _optionChanged: function(args) { this._dataExpressionOptionChanged(args); switch (args.name) { case "hoverStateEnabled": case "focusStateEnabled": this._isDesktopDevice() && this._setListOption(args.name, args.value); this.callBase(args); break; case "items": if (!this.option("dataSource")) { this._processDataSourceChanging() } break; case "dataSource": this._processDataSourceChanging(); break; case "valueExpr": this._renderValue(); this._setListOption("keyExpr", this._getCollectionKeyExpr()); break; case "displayExpr": this._renderValue(); this._setListOption("displayExpr", this._displayGetterExpr()); break; case "searchMode": this._validateSearchMode(); break; case "minSearchLength": this._refreshList(); break; case "searchEnabled": case "showDataBeforeSearch": case "searchExpr": this._invalidate(); break; case "onContentReady": this._initContentReadyAction(); break; case "onSelectionChanged": this._initSelectionChangedAction(); break; case "onItemClick": this._initItemClickAction(); break; case "grouped": case "groupTemplate": case "noDataText": this._setListOption(args.name); break; case "displayValue": this.option("text", args.value); break; case "itemTemplate": case "searchTimeout": case "popupWidthExtension": break; case "selectedItem": if (args.previousValue !== args.value) { this._selectionChangedAction({ selectedItem: args.value }) } break; default: this.callBase(args) } } }).include(DataExpressionMixin, DataConverterMixin); registerComponent("dxDropDownList", DropDownList); module.exports = DropDownList }, /*!******************************************************!*\ !*** ./artifacts/transpiled/ui/list/ui.list.base.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var iconUtils = __webpack_require__( /*! ../../core/utils/icon */ 60); var getPublicElement = __webpack_require__( /*! ../../core/utils/dom */ 12).getPublicElement; var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var compileGetter = __webpack_require__( /*! ../../core/utils/data */ 20).compileGetter; var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var fx = __webpack_require__( /*! ../../animation/fx */ 38); var clickEvent = __webpack_require__( /*! ../../events/click */ 19); var swipeEvents = __webpack_require__( /*! ../../events/swipe */ 174); var support = __webpack_require__( /*! ../../core/utils/support */ 43); var messageLocalization = __webpack_require__( /*! ../../localization/message */ 13); var inkRipple = __webpack_require__( /*! ../widget/utils.ink_ripple */ 69); var devices = __webpack_require__( /*! ../../core/devices */ 16); var ListItem = __webpack_require__( /*! ./item */ 516); var Button = __webpack_require__( /*! ../button */ 34); var eventUtils = __webpack_require__( /*! ../../events/utils */ 8); var themes = __webpack_require__( /*! ../themes */ 30); var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7); var ScrollView = __webpack_require__( /*! ../scroll_view */ 159); var deviceDependentOptions = __webpack_require__( /*! ../scroll_view/ui.scrollable */ 91).deviceDependentOptions; var CollectionWidget = __webpack_require__( /*! ../collection/ui.collection_widget.live_update */ 187).default; var BindableTemplate = __webpack_require__( /*! ../widget/bindable_template */ 65); var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred; var DataConverterMixin = __webpack_require__( /*! ../shared/grouped_data_converter_mixin */ 287).default; var LIST_CLASS = "dx-list"; var LIST_ITEM_CLASS = "dx-list-item"; var LIST_ITEM_SELECTOR = "." + LIST_ITEM_CLASS; var LIST_ITEM_ICON_CONTAINER_CLASS = "dx-list-item-icon-container"; var LIST_ITEM_ICON_CLASS = "dx-list-item-icon"; var LIST_GROUP_CLASS = "dx-list-group"; var LIST_GROUP_HEADER_CLASS = "dx-list-group-header"; var LIST_GROUP_BODY_CLASS = "dx-list-group-body"; var LIST_COLLAPSIBLE_GROUPS_CLASS = "dx-list-collapsible-groups"; var LIST_GROUP_COLLAPSED_CLASS = "dx-list-group-collapsed"; var LIST_GROUP_HEADER_INDICATOR_CLASS = "dx-list-group-header-indicator"; var LIST_HAS_NEXT_CLASS = "dx-has-next"; var LIST_NEXT_BUTTON_CLASS = "dx-list-next-button"; var SELECT_ALL_ITEM_SELECTOR = ".dx-list-select-all"; var LIST_ITEM_DATA_KEY = "dxListItemData"; var LIST_FEEDBACK_SHOW_TIMEOUT = 70; var groupItemsGetter = compileGetter("items"); var ListBase = CollectionWidget.inherit({ _activeStateUnit: [LIST_ITEM_SELECTOR, SELECT_ALL_ITEM_SELECTOR].join(","), _supportedKeys: function() { var that = this; var moveFocusPerPage = function(direction) { var $item = getEdgeVisibleItem(direction); var isFocusedItem = $item.is(that.option("focusedElement")); if (isFocusedItem) { scrollListTo($item, direction); $item = getEdgeVisibleItem(direction) } that.option("focusedElement", getPublicElement($item)); that.scrollToItem($item) }; var getEdgeVisibleItem = function(direction) { var scrollTop = that.scrollTop(); var containerHeight = that.$element().height(); var $item = $(that.option("focusedElement")); var isItemVisible = true; if (!$item.length) { 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: commonUtils.noop, rightArrow: commonUtils.noop, pageUp: function() { moveFocusPerPage("prev"); return false }, pageDown: function() { moveFocusPerPage("next"); return false } }) }, _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" }, _listAttributes: { role: "listbox" }, useInkRipple: false, showChevronExpr: function(data) { return data ? data.showChevron : void 0 }, badgeExpr: function(data) { return data ? data.badge : void 0 } }) }, _defaultOptionsRules: function() { var themeName = themes.current(); return this.callBase().concat(deviceDependentOptions(), [{ device: function() { 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() { return "desktop" === devices.real().deviceType && !devices.isSimulator() }, options: { focusStateEnabled: true } }, { device: function() { return "win" === devices.current().platform && devices.isSimulator() }, options: { bounceEnabled: false } }, { device: function() { return themes.isMaterial(themeName) }, options: { pullingDownText: "", pulledDownText: "", refreshingText: "", pageLoadingText: "", useInkRipple: true } }]) }, _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 }, _refreshItemElements: function() { if (!this.option("grouped")) { this._itemElementsCache = this._itemContainer().children(this._itemSelector()) } else { this._itemElementsCache = this._itemContainer().children("." + LIST_GROUP_CLASS).children("." + LIST_GROUP_BODY_CLASS).children(this._itemSelector()) } }, _modifyByChanges: function() { this.callBase.apply(this, arguments); this._refreshItemElements() }, reorderItem: function(itemElement, toItemElement) { var promise = this.callBase(itemElement, toItemElement); return promise.done(function() { this._refreshItemElements() }) }, deleteItem: function(itemElement) { var promise = this.callBase(itemElement); return promise.done(function() { this._refreshItemElements() }) }, _itemElements: function() { return this._itemElementsCache }, _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() }, _scrollBottomMode: function() { return "scrollBottom" === this.option("pageLoadMode") }, _nextButtonMode: function() { return "nextButton" === this.option("pageLoadMode") }, _dataSourceOptions: function() { var scrollBottom = this._scrollBottomMode(); var nextButton = this._nextButtonMode(); return extend(this.callBase(), { paginate: commonUtils.ensureDefined(scrollBottom || nextButton, true) }) }, _getGroupedOption: function() { return this.option("grouped") }, _dataSourceFromUrlLoadMode: function() { return "raw" }, _initScrollView: function() { var scrollingEnabled = this.option("scrollingEnabled"); var pullRefreshEnabled = scrollingEnabled && this.option("pullRefreshEnabled"); var autoPagingEnabled = scrollingEnabled && this._scrollBottomMode() && !!this._dataSource; this._scrollView = this._createComponent(this.$element(), ScrollView, { disabled: this.option("disabled") || !scrollingEnabled, onScroll: this._scrollHandler.bind(this), onPullDown: pullRefreshEnabled ? this._pullDownHandler.bind(this) : null, onReachBottom: autoPagingEnabled ? this._scrollBottomHandler.bind(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 && this._scrollAction(e) }, _initTemplates: function() { this.callBase(); this._defaultTemplates.group = new BindableTemplate(function($container, data) { if (typeUtils.isPlainObject(data)) { if (data.key) { $container.text(data.key) } } else { $container.text(String(data)) } }, ["key"], this.option("integrationOptions.watchMethod")) }, _prepareDefaultItemTemplate: function(data, $container) { this.callBase(data, $container); if (data.icon) { var $icon = iconUtils.getImageContainer(data.icon).addClass(LIST_ITEM_ICON_CLASS); var $iconContainer = $("
").addClass(LIST_ITEM_ICON_CONTAINER_CLASS); $iconContainer.append($icon); $container.prepend($iconContainer) } }, _getBindableFields: function() { return ["text", "html", "icon"] }, _updateLoadingState: function(tryLoadMore) { var isDataLoaded = !tryLoadMore || this._isLastPage(); var scrollBottomMode = this._scrollBottomMode(); var stopLoading = isDataLoaded || !scrollBottomMode; var hideLoadIndicator = stopLoading && !this._isDataSourceLoading(); if (stopLoading || this._scrollViewIsFull()) { this._scrollView.release(hideLoadIndicator); this._toggleNextButton(this._shouldRenderNextButton() && !this._isLastPage()); this._loadIndicationSuppressed(false) } else { this._infiniteDataLoading() } }, _shouldRenderNextButton: function() { return this._nextButtonMode() && this._dataSource && this._dataSource.isLoaded() }, _dataSourceLoadingChangedHandler: function(isLoading) { if (this._loadIndicationSuppressed()) { return } if (isLoading && this.option("indicateLoading")) { this._showLoadingIndicatorTimer = setTimeout(function() { var isEmpty = !this._itemElements().length; if (this._scrollView && !isEmpty) { this._scrollView.startLoading() } }.bind(this)) } else { clearTimeout(this._showLoadingIndicatorTimer); this._scrollView && this._scrollView.finishLoading() } }, _dataSourceChangedHandler: function(newItems) { if (!this._shouldAppendItems() && windowUtils.hasWindow()) { this._scrollView && this._scrollView.scrollTo(0) } this.callBase.apply(this, arguments) }, _refreshContent: function() { this._prepareContent(); this._fireContentReadyAction() }, _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.reload() } 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(this._loadNextPage.bind(this)) } }, _scrollBottomHandler: function(e) { this._pageLoadingAction(e); if (!this._isDataSourceLoading() && !this._isLastPage()) { this._loadNextPage() } else { this._updateLoadingState() } }, _renderItems: function(items) { if (this.option("grouped")) { each(items, this._renderGroup.bind(this)); this._attachGroupCollapseEvent(); this._renderEmptyMessage(); if (themes.isMaterial()) { this.attachGroupHeaderInkRippleEvents() } } else { this.callBase.apply(this, arguments) } this._refreshItemElements(); this._updateLoadingState(true) }, _attachGroupCollapseEvent: function() { var eventName = eventUtils.addNamespace(clickEvent.name, this.NAME); var selector = "." + LIST_GROUP_HEADER_CLASS; var $element = this.$element(); var collapsibleGroups = this.option("collapsibleGroups"); $element.toggleClass(LIST_COLLAPSIBLE_GROUPS_CLASS, collapsibleGroups); eventsEngine.off($element, eventName, selector); if (collapsibleGroups) { eventsEngine.on($element, eventName, selector, function(e) { this._createAction(function(e) { var $group = $(e.event.currentTarget).parent(); this._collapseGroupHandler($group); if (this.option("focusStateEnabled")) { this.option("focusedElement", getPublicElement($group.find("." + LIST_ITEM_CLASS).eq(0))) } }.bind(this), { validatingTargetName: "element" })({ event: e }) }.bind(this)) } }, _collapseGroupHandler: function($group, toggle) { var deferred = new Deferred; if ($group.hasClass(LIST_GROUP_COLLAPSED_CLASS) === toggle) { return deferred.resolve() } var $groupBody = $group.children("." + LIST_GROUP_BODY_CLASS); var startHeight = $groupBody.outerHeight(); var endHeight = 0 === startHeight ? $groupBody.height("auto").outerHeight() : 0; $group.toggleClass(LIST_GROUP_COLLAPSED_CLASS, toggle); fx.animate($groupBody, { type: "custom", from: { height: startHeight }, to: { height: endHeight }, duration: 200, complete: function() { this.updateDimensions(); this._updateLoadingState(); deferred.resolve() }.bind(this) }); return deferred.promise() }, _dataSourceLoadErrorHandler: function() { this._forgetNextPageLoading(); if (this._initialized) { this._renderEmptyMessage(); this._updateLoadingState() } }, _initMarkup: function() { this._itemElementsCache = $(); this.$element().addClass(LIST_CLASS); this.callBase(); this.option("useInkRipple") && this._renderInkRipple(); this.setAria("role", this.option("_listAttributes").role) }, _renderInkRipple: function() { this._inkRipple = inkRipple.render() }, _toggleActiveState: function($element, value, e) { this.callBase.apply(this, arguments); var that = this; if (!this._inkRipple) { return } var config = { element: $element, event: e }; if (value) { if (themes.isMaterial()) { this._inkRippleTimer = setTimeout(function() { that._inkRipple.showWave(config) }, LIST_FEEDBACK_SHOW_TIMEOUT / 2) } else { that._inkRipple.showWave(config) } } else { clearTimeout(this._inkRippleTimer); this._inkRipple.hideWave(config) } }, _postprocessRenderItem: function(args) { this._refreshItemElements(); this.callBase.apply(this, arguments); if (this.option("onItemSwipe")) { this._attachSwipeEvent($(args.itemElement)) } }, _attachSwipeEvent: function($itemElement) { var endEventName = eventUtils.addNamespace(swipeEvents.end, this.NAME); eventsEngine.on($itemElement, endEventName, this._itemSwipeEndHandler.bind(this)) }, _itemSwipeEndHandler: function(e) { this._itemDXEventHandler(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"); var groupTemplate = this._getTemplate(group.template || groupTemplateName, group, index, $groupHeaderElement); var renderArgs = { index: index, itemData: group, container: getPublicElement($groupHeaderElement) }; this._createItemByTemplate(groupTemplate, renderArgs); if (themes.isMaterial()) { $("
").addClass(LIST_GROUP_HEADER_INDICATOR_CLASS).prependTo($groupHeaderElement) } this._renderingGroupIndex = index; var $groupBody = $("
").addClass(LIST_GROUP_BODY_CLASS).appendTo($groupElement); each(groupItemsGetter(group) || [], function(index, item) { this._renderItem(index, item, $groupBody) }.bind(this)); this._groupRenderAction({ groupElement: getPublicElement($groupElement), groupIndex: index, groupData: group }) }, downInkRippleHandler: function(e) { this._toggleActiveState($(e.currentTarget), true, e) }, upInkRippleHandler: function(e) { this._toggleActiveState($(e.currentTarget), false) }, attachGroupHeaderInkRippleEvents: function() { var selector = "." + LIST_GROUP_HEADER_CLASS; var $element = this.$element(); this._downInkRippleHandler = this._downInkRippleHandler || this.downInkRippleHandler.bind(this); this._upInkRippleHandler = this._upInkRippleHandler || this.upInkRippleHandler.bind(this); var downArguments = [$element, "dxpointerdown", selector, this._downInkRippleHandler]; var upArguments = [$element, "dxpointerup dxpointerout", selector, this._upInkRippleHandler]; eventsEngine.off.apply(eventsEngine, downArguments); eventsEngine.on.apply(eventsEngine, downArguments); eventsEngine.off.apply(eventsEngine, upArguments); eventsEngine.on.apply(eventsEngine, upArguments) }, _createGroupRenderAction: function() { this._groupRenderAction = this._createActionByOption("onGroupRendered") }, _clean: function() { clearTimeout(this._inkRippleTimer); 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; var $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: this._nextButtonHandler.bind(this), type: themes.isMaterial() ? "default" : void 0, integrationOptions: {} }); return $result }, _moveFocus: function() { this.callBase.apply(this, arguments); this.scrollToItem(this.option("focusedElement")) }, _refresh: function() { if (!windowUtils.hasWindow()) { this.callBase() } else { var scrollTop = this._scrollView.scrollTop(); this.callBase(); scrollTop && this._scrollView.scrollTo(scrollTop) } }, _optionChanged: function(args) { switch (args.name) { case "pageLoadMode": this._toggleNextButton(args.value); this._initScrollView(); 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": 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; case "showChevronExpr": case "badgeExpr": this._invalidate(); break; case "_listAttributes": 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 = new Deferred; var $group = this._itemContainer().find("." + LIST_GROUP_CLASS).eq(groupIndex); this._collapseGroupHandler($group, false).done(function() { deferred.resolveWith(this) }.bind(this)); return deferred.promise() }, collapseGroup: function(groupIndex) { var deferred = new Deferred; var $group = this._itemContainer().find("." + LIST_GROUP_CLASS).eq(groupIndex); this._collapseGroupHandler($group, true).done(function() { deferred.resolveWith(this) }.bind(this)); return deferred }, updateDimensions: function() { var that = this; var deferred = new Deferred; if (that._scrollView) { that._scrollView.update().done(function() { !that._scrollViewIsFull() && that._updateLoadingState(true); deferred.resolveWith(that) }) } else { deferred.resolveWith(that) } return deferred.promise() }, reload: function() { this.callBase(); 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) } }).include(DataConverterMixin); ListBase.ItemClass = ListItem; module.exports = ListBase; module.exports.mockScrollView = function(Mock) { ScrollView = Mock } }, /*!*********************************************************************************!*\ !*** ./artifacts/transpiled/ui/scroll_view/ui.events.emitter.gesture.scroll.js ***! \*********************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var Class = __webpack_require__( /*! ../../core/class */ 15); var abstract = Class.abstract; var eventUtils = __webpack_require__( /*! ../../events/utils */ 8); var GestureEmitter = __webpack_require__( /*! ../../events/gesture/emitter.gesture */ 158); var registerEmitter = __webpack_require__( /*! ../../events/core/emitter_registrator */ 95); var animationFrame = __webpack_require__( /*! ../../animation/frame */ 112); var realDevice = __webpack_require__( /*! ../../core/devices */ 16).real(); var compareVersions = __webpack_require__( /*! ../../core/utils/version */ 61).compare; var SCROLL_INIT_EVENT = "dxscrollinit"; var SCROLL_START_EVENT = "dxscrollstart"; var SCROLL_MOVE_EVENT = "dxscroll"; var SCROLL_END_EVENT = "dxscrollend"; var SCROLL_STOP_EVENT = "dxscrollstop"; var SCROLL_CANCEL_EVENT = "dxscrollcancel"; var Locker = Class.inherit(function() { var NAMESPACED_SCROLL_EVENT = eventUtils.addNamespace("scroll", "dxScrollEmitter"); return { ctor: function(element) { this._element = element; this._locked = false; var that = this; this._proxiedScroll = function(e) { that._scroll(e) }; eventsEngine.on(this._element, NAMESPACED_SCROLL_EVENT, this._proxiedScroll) }, _scroll: abstract, check: function(e, callback) { if (this._locked) { callback() } }, dispose: function() { eventsEngine.off(this._element, NAMESPACED_SCROLL_EVENT, this._proxiedScroll) } } }()); var TimeoutLocker = Locker.inherit(function() { return { ctor: function(element, timeout) { this.callBase(element); this._timeout = timeout }, _scroll: function() { this._prepare(); this._forget() }, _prepare: function() { if (this._timer) { this._clearTimer() } this._locked = true }, _clearTimer: function() { clearTimeout(this._timer); this._locked = false; this._timer = null }, _forget: function() { var that = this; this._timer = setTimeout(function() { that._clearTimer() }, this._timeout) }, dispose: function() { this.callBase(); this._clearTimer() } } }()); var WheelLocker = TimeoutLocker.inherit(function() { var WHEEL_UNLOCK_TIMEOUT = 400; return { ctor: function(element) { this.callBase(element, WHEEL_UNLOCK_TIMEOUT); this._lastWheelDirection = null }, check: function(e, callback) { this._checkDirectionChanged(e); this.callBase(e, callback) }, _checkDirectionChanged: function(e) { if (!eventUtils.isDxMouseWheelEvent(e)) { this._lastWheelDirection = null; return } var direction = e.shiftKey || false; var directionChange = null !== this._lastWheelDirection && direction !== this._lastWheelDirection; this._lastWheelDirection = direction; this._locked = this._locked && !directionChange } } }()); var PointerLocker = TimeoutLocker.inherit(function() { var POINTER_UNLOCK_TIMEOUT = 400; return { ctor: function(element) { this.callBase(element, POINTER_UNLOCK_TIMEOUT) } } }()); ! function() { var ios8_greater = realDevice.ios && compareVersions(realDevice.version, [8]) >= 0; var android5_greater = realDevice.android && compareVersions(realDevice.version, [5]) >= 0; if (!(ios8_greater || android5_greater)) { return } PointerLocker = Locker.inherit(function() { return { _scroll: function() { this._locked = true; var that = this; animationFrame.cancelAnimationFrame(this._scrollFrame); this._scrollFrame = animationFrame.requestAnimationFrame(function() { that._locked = false }) }, check: function(e, callback) { animationFrame.cancelAnimationFrame(this._scrollFrame); animationFrame.cancelAnimationFrame(this._checkFrame); var that = this; var callBase = this.callBase; this._checkFrame = animationFrame.requestAnimationFrame(function() { callBase.call(that, e, callback); that._locked = false }) }, dispose: function() { this.callBase(); animationFrame.cancelAnimationFrame(this._scrollFrame); animationFrame.cancelAnimationFrame(this._checkFrame) } } }()) }(); var ScrollEmitter = GestureEmitter.inherit(function() { var INERTIA_TIMEOUT = 100; var VELOCITY_CALC_TIMEOUT = 200; var FRAME_DURATION = Math.round(1e3 / 60); return { ctor: function(element) { this.callBase.apply(this, arguments); this.direction = "both"; this._pointerLocker = new PointerLocker(element); this._wheelLocker = new WheelLocker(element) }, validate: function() { return true }, configure: function(data) { if (data.scrollTarget) { this._pointerLocker.dispose(); this._wheelLocker.dispose(); this._pointerLocker = new PointerLocker(data.scrollTarget); this._wheelLocker = new WheelLocker(data.scrollTarget) } this.callBase(data) }, _init: function(e) { this._wheelLocker.check(e, function() { if (eventUtils.isDxMouseWheelEvent(e)) { this._accept(e) } }.bind(this)); this._pointerLocker.check(e, function() { var skipCheck = this.isNative && eventUtils.isMouseEvent(e); if (!eventUtils.isDxMouseWheelEvent(e) && !skipCheck) { this._accept(e) } }.bind(this)); this._fireEvent(SCROLL_INIT_EVENT, e); this._prevEventData = eventUtils.eventData(e) }, move: function(e) { this.callBase.apply(this, arguments); e.isScrollingEvent = this.isNative || e.isScrollingEvent }, _start: function(e) { this._savedEventData = eventUtils.eventData(e); this._fireEvent(SCROLL_START_EVENT, e); this._prevEventData = eventUtils.eventData(e) }, _move: function(e) { var currentEventData = eventUtils.eventData(e); this._fireEvent(SCROLL_MOVE_EVENT, e, { delta: eventUtils.eventDelta(this._prevEventData, currentEventData) }); var eventDelta = eventUtils.eventDelta(this._savedEventData, currentEventData); if (eventDelta.time > VELOCITY_CALC_TIMEOUT) { this._savedEventData = this._prevEventData } this._prevEventData = eventUtils.eventData(e) }, _end: function(e) { var endEventDelta = eventUtils.eventDelta(this._prevEventData, eventUtils.eventData(e)); var velocity = { x: 0, y: 0 }; if (!eventUtils.isDxMouseWheelEvent(e) && endEventDelta.time < INERTIA_TIMEOUT) { var eventDelta = eventUtils.eventDelta(this._savedEventData, this._prevEventData); var velocityMultiplier = FRAME_DURATION / eventDelta.time; velocity = { x: eventDelta.x * velocityMultiplier, y: eventDelta.y * velocityMultiplier } } this._fireEvent(SCROLL_END_EVENT, e, { velocity: velocity }) }, _stop: function(e) { this._fireEvent(SCROLL_STOP_EVENT, e) }, cancel: function(e) { this.callBase.apply(this, arguments); this._fireEvent(SCROLL_CANCEL_EVENT, e) }, dispose: function() { this.callBase.apply(this, arguments); this._pointerLocker.dispose(); this._wheelLocker.dispose() }, _clearSelection: function() { if (this.isNative) { return } return this.callBase.apply(this, arguments) }, _toggleGestureCover: function() { if (this.isNative) { return } return this.callBase.apply(this, arguments) } } }()); registerEmitter({ emitter: ScrollEmitter, events: [SCROLL_INIT_EVENT, SCROLL_START_EVENT, SCROLL_MOVE_EVENT, SCROLL_END_EVENT, SCROLL_STOP_EVENT, SCROLL_CANCEL_EVENT] }); module.exports = { init: SCROLL_INIT_EVENT, start: SCROLL_START_EVENT, move: SCROLL_MOVE_EVENT, end: SCROLL_END_EVENT, stop: SCROLL_STOP_EVENT, cancel: SCROLL_CANCEL_EVENT } }, /*!***************************************************************!*\ !*** ./artifacts/transpiled/ui/widget/ui.search_box_mixin.js ***! \***************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _message = __webpack_require__( /*! ../../localization/message */ 13); var _message2 = _interopRequireDefault(_message); var _text_box = __webpack_require__( /*! ../text_box */ 89); var _text_box2 = _interopRequireDefault(_text_box); var _ui = __webpack_require__( /*! ../widget/ui.errors */ 17); var _ui2 = _interopRequireDefault(_ui); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } module.exports = { _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { searchMode: "", searchExpr: null, searchValue: "", searchEnabled: false, searchEditorOptions: {} }) }, _initMarkup: function() { this._renderSearch(); this.callBase() }, _renderSearch: function() { var $element = this.$element(); var searchEnabled = this.option("searchEnabled"); var searchBoxClassName = this._addWidgetPrefix("search"); var rootElementClassName = this._addWidgetPrefix("with-search"); if (!searchEnabled) { $element.removeClass(rootElementClassName); this._removeSearchBox(); return } var editorOptions = this._getSearchEditorOptions(); if (this._searchEditor) { this._searchEditor.option(editorOptions) } else { $element.addClass(rootElementClassName); this._$searchEditorElement = (0, _renderer2.default)("
").addClass(searchBoxClassName).prependTo($element); this._searchEditor = this._createComponent(this._$searchEditorElement, _text_box2.default, editorOptions) } }, _removeSearchBox: function() { this._$searchEditorElement && this._$searchEditorElement.remove(); delete this._$searchEditorElement; delete this._searchEditor }, _getSearchEditorOptions: function() { var that = this; var userEditorOptions = that.option("searchEditorOptions"); var searchText = _message2.default.format("Search"); return (0, _extend.extend)({ mode: "search", placeholder: searchText, tabIndex: that.option("tabIndex"), value: that.option("searchValue"), valueChangeEvent: "input", inputAttr: { "aria-label": searchText }, onValueChanged: function(e) { var searchTimeout = that.option("searchTimeout"); that._valueChangeDeferred = new _deferred.Deferred; clearTimeout(that._valueChangeTimeout); that._valueChangeDeferred.done(function() { this.option("searchValue", e.value) }.bind(that)); if (e.event && "input" === e.event.type && searchTimeout) { that._valueChangeTimeout = setTimeout(function() { that._valueChangeDeferred.resolve() }, searchTimeout) } else { that._valueChangeDeferred.resolve() } } }, userEditorOptions) }, _getAriaTarget: function() { if (this.option("searchEnabled")) { return this._itemContainer(true) } return this.$element() }, _focusTarget: function() { if (this.option("searchEnabled")) { return this._itemContainer(true) } return this.callBase() }, _updateFocusState: function(e, isFocused) { if (this.option("searchEnabled")) { this._toggleFocusClass(isFocused, this.$element()) } this.callBase(e, isFocused) }, getOperationBySearchMode: function(searchMode) { return "equals" === searchMode ? "=" : searchMode }, _cleanAria: function($target) { this.setAria({ role: null, activedescendant: null }, $target); $target.attr("tabIndex", null) }, _optionChanged: function(args) { switch (args.name) { case "searchEnabled": case "searchEditorOptions": this._cleanAria(this.option("searchEnabled") ? this.$element() : this._itemContainer()); this._invalidate(); break; case "searchExpr": case "searchMode": case "searchValue": if (!this._dataSource) { _ui2.default.log("W1009"); return } if ("searchMode" === args.name) { this._dataSource.searchOperation(this.getOperationBySearchMode(args.value)) } else { this._dataSource[args.name](args.value) } this._dataSource.load(); break; case "searchTimeout": break; default: this.callBase(args) } }, focus: function() { if (!this.option("focusedElement") && this.option("searchEnabled")) { this._searchEditor && this._searchEditor.focus(); return } this.callBase() }, _refresh: function() { if (this._valueChangeDeferred) { this._valueChangeDeferred.resolve() } this.callBase() } } }, /*!**************************************************************!*\ !*** ./artifacts/transpiled/ui/editor/ui.data_expression.js ***! \**************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var variableWrapper = __webpack_require__( /*! ../../core/utils/variable_wrapper */ 86); var dataCoreUtils = __webpack_require__( /*! ../../core/utils/data */ 20); var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var DataHelperMixin = __webpack_require__( /*! ../../data_helper */ 84); var DataSourceModule = __webpack_require__( /*! ../../data/data_source/data_source */ 45); var ArrayStore = __webpack_require__( /*! ../../data/array_store */ 68); var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred; var DataExpressionMixin = extend({}, DataHelperMixin, { _dataExpressionDefaultOptions: function() { return { items: [], dataSource: null, itemTemplate: "item", value: null, valueExpr: "this", displayExpr: void 0 } }, _initDataExpressions: function() { this._compileValueGetter(); this._compileDisplayGetter(); this._initDynamicTemplates(); this._initDataSource(); this._itemsToDataSource() }, _itemsToDataSource: function() { if (!this.option("dataSource")) { this._dataSource = new DataSourceModule.DataSource({ store: new ArrayStore(this.option("items")), pageSize: 0 }) } }, _compileDisplayGetter: function() { this._displayGetter = dataCoreUtils.compileGetter(this._displayGetterExpr()) }, _displayGetterExpr: function() { return this.option("displayExpr") }, _compileValueGetter: function() { this._valueGetter = dataCoreUtils.compileGetter(this._valueGetterExpr()) }, _valueGetterExpr: function() { return this.option("valueExpr") || "this" }, _loadValue: function(value) { var deferred = new Deferred; value = this._unwrappedValue(value); if (!typeUtils.isDefined(value)) { return deferred.reject().promise() } this._loadSingle(this._valueGetterExpr(), value).done(function(item) { this._isValueEquals(this._valueGetter(item), value) ? deferred.resolve(item) : deferred.reject() }.bind(this)).fail(function() { deferred.reject() }); return deferred.promise() }, _getCurrentValue: function() { return this.option("value") }, _unwrappedValue: function(value) { value = typeUtils.isDefined(value) ? value : this._getCurrentValue(); if (value && this._dataSource && "this" === this._valueGetterExpr()) { value = this._getItemKey(value) } return variableWrapper.unwrap(value) }, _getItemKey: function(value) { var key = this._dataSource.key(); if (Array.isArray(key)) { var result = {}; for (var i = 0, n = key.length; i < n; i++) { result[key[i]] = value[key[i]] } return result } if (key && "object" === _typeof(value)) { value = value[key] } return value }, _isValueEquals: function(value1, value2) { var dataSourceKey = this._dataSource && this._dataSource.key(); var isDefined = typeUtils.isDefined; var result = this._compareValues(value1, value2); if (!result && dataSourceKey && isDefined(value1) && isDefined(value2)) { if (Array.isArray(dataSourceKey)) { result = this._compareByCompositeKey(value1, value2, dataSourceKey) } else { result = this._compareByKey(value1, value2, dataSourceKey) } } return result }, _compareByCompositeKey: function(value1, value2, key) { var isObject = typeUtils.isObject; if (!isObject(value1) || !isObject(value2)) { return false } for (var i = 0, n = key.length; i < n; i++) { if (value1[key[i]] !== value2[key[i]]) { return false } } return true }, _compareByKey: function(value1, value2, key) { var ensureDefined = commonUtils.ensureDefined; var unwrapObservable = variableWrapper.unwrap; var valueKey1 = ensureDefined(unwrapObservable(value1[key]), value1); var valueKey2 = ensureDefined(unwrapObservable(value2[key]), value2); return this._compareValues(valueKey1, valueKey2) }, _compareValues: function(value1, value2) { return dataCoreUtils.toComparable(value1, true) === dataCoreUtils.toComparable(value2, true) }, _initDynamicTemplates: commonUtils.noop, _setCollectionWidgetItemTemplate: function() { this._initDynamicTemplates(); this._setCollectionWidgetOption("itemTemplate", this.option("itemTemplate")) }, _getCollectionKeyExpr: function() { var valueExpr = this.option("valueExpr"); var isValueExprField = typeUtils.isString(valueExpr) && "this" !== valueExpr || typeUtils.isFunction(valueExpr); return isValueExprField ? valueExpr : null }, _dataExpressionOptionChanged: function(args) { switch (args.name) { case "items": this._itemsToDataSource(); this._setCollectionWidgetOption("items"); break; case "dataSource": this._initDataSource(); break; case "itemTemplate": this._setCollectionWidgetItemTemplate(); break; case "valueExpr": this._compileValueGetter(); break; case "displayExpr": this._compileDisplayGetter(); this._initDynamicTemplates(); this._setCollectionWidgetOption("displayExpr") } } }); module.exports = DataExpressionMixin }, /*!*********************************************!*\ !*** ./artifacts/transpiled/ui/calendar.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./calendar/ui.calendar */ 526) }, /*!**************************************************!*\ !*** ./artifacts/transpiled/ui/overlay/utils.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.getElementMaxHeightByWindow = void 0; var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var WINDOW_HEIGHT_PERCENT = .9; exports.getElementMaxHeightByWindow = function($element, startLocation) { var window = (0, _window.getWindow)(); var actualOffset; if ((0, _type.isNumeric)(startLocation)) { actualOffset = (0, _renderer2.default)(window).innerHeight() - startLocation + (0, _renderer2.default)(window).scrollTop() } else { var offsetTop = $element.offset().top - (0, _renderer2.default)(window).scrollTop(); var offsetBottom = (0, _renderer2.default)(window).innerHeight() - offsetTop - $element.outerHeight(); actualOffset = Math.max(offsetTop, offsetBottom) } return actualOffset * WINDOW_HEIGHT_PERCENT } }, /*!*************************************************!*\ !*** ./artifacts/transpiled/ui/progress_bar.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var TrackBar = __webpack_require__( /*! ./track_bar */ 224); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction; var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var PROGRESSBAR_CLASS = "dx-progressbar"; var PROGRESSBAR_CONTAINER_CLASS = "dx-progressbar-container"; var PROGRESSBAR_RANGE_CONTAINER_CLASS = "dx-progressbar-range-container"; var PROGRESSBAR_RANGE_CLASS = "dx-progressbar-range"; var PROGRESSBAR_WRAPPER_CLASS = "dx-progressbar-wrapper"; var PROGRESSBAR_STATUS_CLASS = "dx-progressbar-status"; var PROGRESSBAR_INDETERMINATE_SEGMENT_CONTAINER = "dx-progressbar-animating-container"; var PROGRESSBAR_INDETERMINATE_SEGMENT = "dx-progressbar-animating-segment"; var ProgressBar = TrackBar.inherit({ _getDefaultOptions: function() { return extend(this.callBase(), { value: 0, statusFormat: function(ratio) { return "Progress: " + Math.round(100 * ratio) + "%" }, showStatus: true, onComplete: null, activeStateEnabled: false, statusPosition: "bottom left", _animatingSegmentCount: 0 }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: { platform: "win" }, options: { _animatingSegmentCount: 5 } }, { device: function(_device) { return "android" === _device.platform }, options: { _animatingSegmentCount: 2 } }]) }, _initMarkup: function() { this._renderStatus(); this._createCompleteAction(); this.callBase(); this.$element().addClass(PROGRESSBAR_CLASS); this._$wrapper.addClass(PROGRESSBAR_WRAPPER_CLASS); this._$bar.addClass(PROGRESSBAR_CONTAINER_CLASS); this.setAria("role", "progressbar"); $("
").addClass(PROGRESSBAR_RANGE_CONTAINER_CLASS).appendTo(this._$wrapper).append(this._$bar); this._$range.addClass(PROGRESSBAR_RANGE_CLASS); this._toggleStatus(this.option("showStatus")) }, _createCompleteAction: function() { this._completeAction = this._createActionByOption("onComplete") }, _renderStatus: function() { this._$status = $("
").addClass(PROGRESSBAR_STATUS_CLASS) }, _renderIndeterminateState: function() { this._$segmentContainer = $("
").addClass(PROGRESSBAR_INDETERMINATE_SEGMENT_CONTAINER); var segments = this.option("_animatingSegmentCount"); for (var i = 0; i < segments; i++) { $("
").addClass(PROGRESSBAR_INDETERMINATE_SEGMENT).addClass(PROGRESSBAR_INDETERMINATE_SEGMENT + "-" + (i + 1)).appendTo(this._$segmentContainer) } this._$segmentContainer.appendTo(this._$wrapper) }, _toggleStatus: function(value) { var splitPosition = this.option("statusPosition").split(" "); if (value) { if ("top" === splitPosition[0] || "left" === splitPosition[0]) { this._$status.prependTo(this._$wrapper) } else { this._$status.appendTo(this._$wrapper) } } else { this._$status.detach() } this._togglePositionClass() }, _togglePositionClass: function() { var position = this.option("statusPosition"); var splitPosition = position.split(" "); this._$wrapper.removeClass("dx-position-top-left dx-position-top-right dx-position-bottom-left dx-position-bottom-right dx-position-left dx-position-right"); var positionClass = "dx-position-" + splitPosition[0]; if (splitPosition[1]) { positionClass += "-" + splitPosition[1] } this._$wrapper.addClass(positionClass) }, _toggleIndeterminateState: function(value) { if (value) { this._renderIndeterminateState(); this._$bar.toggle(false) } else { this._$bar.toggle(true); this._$segmentContainer.remove(); delete this._$segmentContainer } }, _renderValue: function() { var val = this.option("value"); var max = this.option("max"); if (!val && 0 !== val) { this._toggleIndeterminateState(true); return } if (this._$segmentContainer) { this._toggleIndeterminateState(false) } if (val === max) { this._completeAction() } this.callBase(); this._setStatus() }, _setStatus: function() { var format = this.option("statusFormat"); if (isFunction(format)) { format = format.bind(this) } else { format = function(value) { return value } } var statusText = format(this._currentRatio, this.option("value")); this._$status.text(statusText) }, _dispose: function() { this._$status.remove(); this.callBase() }, _optionChanged: function(args) { switch (args.name) { case "statusFormat": this._setStatus(); break; case "showStatus": this._toggleStatus(args.value); break; case "statusPosition": this._toggleStatus(this.option("showStatus")); break; case "onComplete": this._createCompleteAction(); break; case "_animatingSegmentCount": break; default: this.callBase(args) } } }); registerComponent("dxProgressBar", ProgressBar); module.exports = ProgressBar }, /*!**********************************************!*\ !*** ./artifacts/transpiled/ui/track_bar.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var Editor = __webpack_require__( /*! ./editor/editor */ 49); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7); var fx = __webpack_require__( /*! ../animation/fx */ 38); var TRACKBAR_CLASS = "dx-trackbar"; var TRACKBAR_CONTAINER_CLASS = "dx-trackbar-container"; var TRACKBAR_RANGE_CLASS = "dx-trackbar-range"; var TRACKBAR_WRAPPER_CLASS = "dx-trackbar-wrapper"; var TrackBar = Editor.inherit({ _getDefaultOptions: function() { return extend(this.callBase(), { min: 0, max: 100, value: 0 }) }, _initMarkup: function() { this.$element().addClass(TRACKBAR_CLASS); this._renderWrapper(); this._renderContainer(); this._renderRange(); this._renderValue(); this._setRangeStyles(); this.callBase() }, _render: function() { this.callBase(); this._setRangeStyles(this._rangeStylesConfig()) }, _renderWrapper: function() { this._$wrapper = $("
").addClass(TRACKBAR_WRAPPER_CLASS).appendTo(this.$element()) }, _renderContainer: function() { this._$bar = $("
").addClass(TRACKBAR_CONTAINER_CLASS).appendTo(this._$wrapper) }, _renderRange: function() { this._$range = $("
").addClass(TRACKBAR_RANGE_CLASS).appendTo(this._$bar) }, _renderValue: function() { var val = this.option("value"); var min = this.option("min"); var max = this.option("max"); if (min > max) { return } if (val < min) { this.option("value", min); this._currentRatio = 0; return } if (val > max) { this.option("value", max); this._currentRatio = 1; return } var ratio = min === max ? 0 : (val - min) / (max - min); !this._needPreventAnimation && this._setRangeStyles({ width: 100 * ratio + "%" }); this.setAria({ valuemin: this.option("min"), valuemax: max, valuenow: val }); this._currentRatio = ratio }, _rangeStylesConfig: function() { return { width: 100 * this._currentRatio + "%" } }, _setRangeStyles: function(options) { fx.stop(this._$range); if (!options) { this._$range.css({ width: 0 }); return } if (this._needPreventAnimation || !windowUtils.hasWindow()) { return } fx.animate(this._$range, { type: "custom", duration: 100, to: options }) }, _optionChanged: function(args) { switch (args.name) { case "value": this._renderValue(); this.callBase(args); break; case "max": case "min": this._renderValue(); break; default: this.callBase(args) } }, _dispose: function() { fx.stop(this._$range); this.callBase() } }); registerComponent("dxTrackBar", TrackBar); module.exports = TrackBar }, /*!*******************************************************!*\ !*** ./artifacts/transpiled/ui/validation_summary.js ***! \*******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var grep = __webpack_require__( /*! ../core/utils/common */ 4).grep; var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3); var ValidationMixin = __webpack_require__( /*! ./validation/validation_mixin */ 172); var ValidationEngine = __webpack_require__( /*! ./validation_engine */ 99); var CollectionWidget = __webpack_require__( /*! ./collection/ui.collection_widget.edit */ 53); var VALIDATION_SUMMARY_CLASS = "dx-validationsummary"; var ITEM_CLASS = VALIDATION_SUMMARY_CLASS + "-item"; var ITEM_DATA_KEY = VALIDATION_SUMMARY_CLASS + "-item-data"; var ValidationSummary = CollectionWidget.inherit({ _getDefaultOptions: function() { return extend(this.callBase(), { focusStateEnabled: false, noDataText: null }) }, _setOptionsByReference: function() { this.callBase(); extend(this._optionsByReference, { validationGroup: true }) }, _init: function() { this.callBase(); this._initGroupRegistration() }, _initGroupRegistration: function() { var group = this._findGroup(); var groupConfig = ValidationEngine.addGroup(group); this._unsubscribeGroup(); this._groupWasInit = true; this._validationGroup = group; this.groupSubscription = this._groupValidationHandler.bind(this); groupConfig.on("validated", this.groupSubscription) }, _unsubscribeGroup: function() { var groupConfig = ValidationEngine.getGroupConfig(this._validationGroup); groupConfig && groupConfig.off("validated", this.groupSubscription) }, _getOrderedItems: function(validators, items) { var orderedItems = []; iteratorUtils.each(validators, function(_, validator) { var firstItem = grep(items, function(item) { if (item.validator === validator) { return true } })[0]; if (firstItem) { orderedItems.push(firstItem) } }); return orderedItems }, _groupValidationHandler: function(params) { var that = this; var items = that._getOrderedItems(params.validators, iteratorUtils.map(params.brokenRules, function(rule) { return { text: rule.message, validator: rule.validator } })); that.validators = params.validators; iteratorUtils.each(that.validators, function(_, validator) { if (validator._validationSummary !== this) { var handler = that._itemValidationHandler.bind(that); var disposingHandler = function() { validator.off("validated", handler); validator._validationSummary = null; handler = null }; validator.on("validated", handler); validator.on("disposing", disposingHandler); validator._validationSummary = this } }); that.option("items", items) }, _itemValidationHandler: function(itemValidationResult) { var items = this.option("items"); var isValid = itemValidationResult.isValid; var elementIndex; var replacementFound = false; var newMessage = itemValidationResult.brokenRule && itemValidationResult.brokenRule.message; var validator = itemValidationResult.validator; iteratorUtils.each(items, function(index, item) { if (item.validator === validator) { if (isValid) { elementIndex = index } else { item.text = newMessage } replacementFound = true; return false } }); if (isValid ^ replacementFound) { return } if (isValid) { items.splice(elementIndex, 1) } else { items.push({ text: newMessage, validator: validator }) } items = this._getOrderedItems(this.validators, items); this.option("items", items) }, _initMarkup: function() { this.$element().addClass(VALIDATION_SUMMARY_CLASS); this.callBase() }, _optionChanged: function(args) { switch (args.name) { case "validationGroup": this._initGroupRegistration(); break; default: this.callBase(args) } }, _itemClass: function() { return ITEM_CLASS }, _itemDataKey: function() { return ITEM_DATA_KEY }, _postprocessRenderItem: function(params) { eventsEngine.on(params.itemElement, "click", function() { params.itemData.validator && params.itemData.validator.focus && params.itemData.validator.focus() }) }, _dispose: function() { this.callBase(); this._unsubscribeGroup() } }).include(ValidationMixin); registerComponent("dxValidationSummary", ValidationSummary); module.exports = ValidationSummary }, /*!********************************************************************!*\ !*** ./artifacts/transpiled/ui/html_editor/converterController.js ***! \********************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true } Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) { _defineProperties(Constructor.prototype, protoProps) } if (staticProps) { _defineProperties(Constructor, staticProps) } Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor } var ConverterController = function() { function ConverterController() { _classCallCheck(this, ConverterController); this._converters = {} } _createClass(ConverterController, [{ key: "addConverter", value: function(name, converter) { this._converters[name] = converter } }, { key: "getConverter", value: function(name) { return this._converters[name] } }]); return ConverterController }(); var controller = new ConverterController; exports.default = controller }, /*!*******************************************************!*\ !*** ./artifacts/transpiled/ui/tooltip/ui.tooltip.js ***! \*******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var Tooltip = __webpack_require__( /*! ./tooltip */ 326); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred; var viewPortUtils = __webpack_require__( /*! ../../core/utils/view_port */ 78); var tooltip = null; var removeTooltipElement = null; var createTooltip = function(options) { options = extend({ position: "top" }, options); var content = options.content; delete options.content; var $tooltip = $("
").html(content).appendTo(viewPortUtils.value()); removeTooltipElement = function() { $tooltip.remove() }; tooltip = new Tooltip($tooltip, options) }; var removeTooltip = function() { if (!tooltip) { return } removeTooltipElement(); tooltip = null }; exports.show = function(options) { removeTooltip(); createTooltip(options); return tooltip.show() }; exports.hide = function() { if (!tooltip) { return (new Deferred).resolve() } return tooltip.hide().done(removeTooltip).promise() } }, /*!**********************************************!*\ !*** ./artifacts/transpiled/ui/accordion.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _fx = __webpack_require__( /*! ../animation/fx */ 38); var _fx2 = _interopRequireDefault(_fx); var _click = __webpack_require__( /*! ../events/click */ 19); var _click2 = _interopRequireDefault(_click); var _devices = __webpack_require__( /*! ../core/devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _common = __webpack_require__( /*! ../core/utils/common */ 4); var _dom = __webpack_require__( /*! ../core/utils/dom */ 12); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _iterator2 = _interopRequireDefault(_iterator); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _utils = __webpack_require__( /*! ../events/utils */ 8); var _utils2 = _interopRequireDefault(_utils); var _uiCollection_widget = __webpack_require__( /*! ./collection/ui.collection_widget.live_update */ 187); var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget); var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 6); var _bindable_template = __webpack_require__( /*! ./widget/bindable_template */ 65); var _bindable_template2 = _interopRequireDefault(_bindable_template); var _icon = __webpack_require__( /*! ../core/utils/icon */ 60); var _themes = __webpack_require__( /*! ./themes */ 30); var _themes2 = _interopRequireDefault(_themes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var ACCORDION_CLASS = "dx-accordion"; var ACCORDION_WRAPPER_CLASS = "dx-accordion-wrapper"; var ACCORDION_ITEM_CLASS = "dx-accordion-item"; var ACCORDION_ITEM_OPENED_CLASS = "dx-accordion-item-opened"; var ACCORDION_ITEM_CLOSED_CLASS = "dx-accordion-item-closed"; var ACCORDION_ITEM_TITLE_CLASS = "dx-accordion-item-title"; var ACCORDION_ITEM_BODY_CLASS = "dx-accordion-item-body"; var ACCORDION_ITEM_TITLE_CAPTION_CLASS = "dx-accordion-item-title-caption"; var ACCORDION_ITEM_DATA_KEY = "dxAccordionItemData"; var Accordion = _uiCollection_widget2.default.inherit({ _activeStateUnit: "." + ACCORDION_ITEM_CLASS, _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { hoverStateEnabled: true, height: void 0, itemTitleTemplate: "title", onItemTitleClick: null, selectedIndex: 0, collapsible: false, multiple: false, animationDuration: 300, deferRendering: true, selectionByClick: true, activeStateEnabled: true, _itemAttributes: { role: "tab" }, _animationEasing: "ease" }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function() { return "desktop" === _devices2.default.real().deviceType && !_devices2.default.isSimulator() }, options: { focusStateEnabled: true } }, { device: function() { return _themes2.default.isMaterial() }, options: { animationDuration: 200, _animationEasing: "cubic-bezier(0.4, 0, 0.2, 1)" } }]) }, _itemElements: function() { return this._itemContainer().children(this._itemSelector()) }, _init: function() { this.callBase(); this.option("selectionRequired", !this.option("collapsible")); this.option("selectionMode", this.option("multiple") ? "multiple" : "single"); var $element = this.$element(); $element.addClass(ACCORDION_CLASS); this._$container = (0, _renderer2.default)("
").addClass(ACCORDION_WRAPPER_CLASS); $element.append(this._$container) }, _initTemplates: function() { this.callBase(); this._defaultTemplates.title = new _bindable_template2.default(function($container, data) { if ((0, _type.isPlainObject)(data)) { if ((0, _type.isDefined)(data.title) && !(0, _type.isPlainObject)(data.title)) { $container.text(data.title) } var $iconElement = (0, _icon.getImageContainer)(data.icon); $iconElement && $iconElement.appendTo($container) } else { if ((0, _type.isDefined)(data)) { $container.text(String(data)) } } $container.wrapInner((0, _renderer2.default)("
").addClass(ACCORDION_ITEM_TITLE_CAPTION_CLASS)) }, ["title", "icon"], this.option("integrationOptions.watchMethod")) }, _initMarkup: function() { var _this = this; this._deferredItems = []; this.callBase(); this.setAria({ role: "tablist", multiselectable: this.option("multiple") }); (0, _common.deferRender)(function() { var selectedItemIndices = _this._getSelectedItemIndices(); _this._renderSelection(selectedItemIndices, []) }) }, _render: function() { this.callBase(); this._updateItemHeightsWrapper(true) }, _itemDataKey: function() { return ACCORDION_ITEM_DATA_KEY }, _itemClass: function() { return ACCORDION_ITEM_CLASS }, _itemContainer: function() { return this._$container }, _itemTitles: function() { return this._itemElements().find("." + ACCORDION_ITEM_TITLE_CLASS) }, _itemContents: function() { return this._itemElements().find("." + ACCORDION_ITEM_BODY_CLASS) }, _getItemData: function(target) { return (0, _renderer2.default)(target).parent().data(this._itemDataKey()) || this.callBase.apply(this, arguments) }, _executeItemRenderAction: function(itemData) { if (itemData.type) { return } this.callBase.apply(this, arguments) }, _itemSelectHandler: function(e) { if ((0, _renderer2.default)(e.target).closest(this._itemContents()).length) { return } this.callBase.apply(this, arguments) }, _afterItemElementDeleted: function($item, deletedActionArgs) { this._deferredItems.splice(deletedActionArgs.itemIndex, 1); this.callBase.apply(this, arguments) }, _renderItemContent: function(args) { var itemTitle = this.callBase((0, _extend.extend)({}, args, { contentClass: ACCORDION_ITEM_TITLE_CLASS, templateProperty: "titleTemplate", defaultTemplateName: this.option("itemTitleTemplate") })); this._attachItemTitleClickAction(itemTitle); var deferred = new _deferred.Deferred; if ((0, _type.isDefined)(this._deferredItems[args.index])) { this._deferredItems[args.index] = deferred } else { this._deferredItems.push(deferred) } if (!this.option("deferRendering") || this._getSelectedItemIndices().indexOf(args.index) >= 0) { deferred.resolve() } deferred.done(this.callBase.bind(this, (0, _extend.extend)({}, args, { contentClass: ACCORDION_ITEM_BODY_CLASS, container: (0, _dom.getPublicElement)((0, _renderer2.default)("
").appendTo((0, _renderer2.default)(itemTitle).parent())) }))) }, _attachItemTitleClickAction: function(itemTitle) { var eventName = _utils2.default.addNamespace(_click2.default.name, this.NAME); _events_engine2.default.off(itemTitle, eventName); _events_engine2.default.on(itemTitle, eventName, this._itemTitleClickHandler.bind(this)) }, _itemTitleClickHandler: function(e) { this._itemDXEventHandler(e, "onItemTitleClick") }, _renderSelection: function(addedSelection, removedSelection) { this._itemElements().addClass(ACCORDION_ITEM_CLOSED_CLASS); this.setAria("hidden", true, this._itemContents()); this._updateItems(addedSelection, removedSelection) }, _updateSelection: function(addedSelection, removedSelection) { this._updateItems(addedSelection, removedSelection); this._updateItemHeightsWrapper(false) }, _updateItems: function(addedSelection, removedSelection) { var $items = this._itemElements(); var that = this; _iterator2.default.each(addedSelection, function(_, index) { that._deferredItems[index].resolve(); var $item = $items.eq(index).addClass(ACCORDION_ITEM_OPENED_CLASS).removeClass(ACCORDION_ITEM_CLOSED_CLASS); that.setAria("hidden", false, $item.find("." + ACCORDION_ITEM_BODY_CLASS)) }); _iterator2.default.each(removedSelection, function(_, index) { var $item = $items.eq(index).removeClass(ACCORDION_ITEM_OPENED_CLASS); that.setAria("hidden", true, $item.find("." + ACCORDION_ITEM_BODY_CLASS)) }) }, _updateItemHeightsWrapper: function(skipAnimation) { if (this.option("templatesRenderAsynchronously")) { this._animationTimer = setTimeout(function() { this._updateItemHeights(skipAnimation) }.bind(this)) } else { this._updateItemHeights(skipAnimation) } }, _updateItemHeights: function(skipAnimation) { var that = this; var deferredAnimate = that._deferredAnimate; var itemHeight = this._splitFreeSpace(this._calculateFreeSpace()); clearTimeout(this._animationTimer); return _deferred.when.apply(_renderer2.default, [].slice.call(this._itemElements()).map(function(item) { return that._updateItemHeight((0, _renderer2.default)(item), itemHeight, skipAnimation) })).done(function() { if (deferredAnimate) { deferredAnimate.resolveWith(that) } }) }, _updateItemHeight: function($item, itemHeight, skipAnimation) { var $title = $item.children("." + ACCORDION_ITEM_TITLE_CLASS); if (_fx2.default.isAnimating($item)) { _fx2.default.stop($item) } var startItemHeight = $item.outerHeight(); var finalItemHeight = $item.hasClass(ACCORDION_ITEM_OPENED_CLASS) ? itemHeight + $title.outerHeight() || $item.height("auto").outerHeight() : $title.outerHeight(); return this._animateItem($item, startItemHeight, finalItemHeight, skipAnimation, !!itemHeight) }, _animateItem: function($element, startHeight, endHeight, skipAnimation, fixedHeight) { var d; if (skipAnimation || startHeight === endHeight) { $element.css("height", endHeight); d = (new _deferred.Deferred).resolve() } else { d = _fx2.default.animate($element, { type: "custom", from: { height: startHeight }, to: { height: endHeight }, duration: this.option("animationDuration"), easing: this.option("_animationEasing") }) } return d.done(function() { if ($element.hasClass(ACCORDION_ITEM_OPENED_CLASS) && !fixedHeight) { $element.css("height", "") } $element.not("." + ACCORDION_ITEM_OPENED_CLASS).addClass(ACCORDION_ITEM_CLOSED_CLASS) }) }, _splitFreeSpace: function(freeSpace) { if (!freeSpace) { return freeSpace } return freeSpace / this.option("selectedItems").length }, _calculateFreeSpace: function() { var height = this.option("height"); if (void 0 === height || "auto" === height) { return } var $titles = this._itemTitles(); var itemsHeight = 0; _iterator2.default.each($titles, function(_, title) { itemsHeight += (0, _renderer2.default)(title).outerHeight() }); return this.$element().height() - itemsHeight }, _visibilityChanged: function(visible) { if (visible) { this._dimensionChanged() } }, _dimensionChanged: function() { this._updateItemHeights(true) }, _clean: function() { clearTimeout(this._animationTimer); this.callBase() }, _optionChanged: function(args) { switch (args.name) { case "animationDuration": case "onItemTitleClick": case "_animationEasing": break; case "collapsible": this.option("selectionRequired", !this.option("collapsible")); break; case "itemTitleTemplate": case "height": case "deferRendering": this._invalidate(); break; case "multiple": this.option("selectionMode", args.value ? "multiple" : "single"); break; default: this.callBase(args) } }, expandItem: function(index) { this._deferredAnimate = new _deferred.Deferred; this.selectItem(index); return this._deferredAnimate.promise() }, collapseItem: function(index) { this._deferredAnimate = new _deferred.Deferred; this.unselectItem(index); return this._deferredAnimate.promise() }, updateDimensions: function() { return this._updateItemHeights(false) } }); (0, _component_registrator2.default)("dxAccordion", Accordion); module.exports = Accordion }, /*!*************************************************************************!*\ !*** ./artifacts/transpiled/ui/grid_core/ui.grid_core.accessibility.js ***! \*************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _accessibility = __webpack_require__( /*! ../../ui/shared/accessibility */ 104); var _accessibility2 = _interopRequireDefault(_accessibility); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } module.exports = { registerKeyboardAction: function(viewName, instance, $element, selector, action) { if (instance.option("useLegacyKeyboardNavigation")) { return } var executeKeyDown = function(args) { instance.executeAction("onKeyDown", args) }; instance.createAction("onKeyDown"); _accessibility2.default.registerKeyboardAction(viewName, instance, $element, selector, action, executeKeyDown) } } }, /*!*****************************************************************!*\ !*** ./artifacts/transpiled/ui/data_grid/ui.data_grid.utils.js ***! \*****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _uiGrid_core = __webpack_require__( /*! ../grid_core/ui.grid_core.utils */ 35); var _uiGrid_core2 = _interopRequireDefault(_uiGrid_core); var _utils = __webpack_require__( /*! ../../data/utils */ 41); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } exports.createGroupFilter = function(path, storeLoadOptions) { var groups = (0, _utils.normalizeSortingInfo)(storeLoadOptions.group); var filter = []; for (var i = 0; i < path.length; i++) { filter.push([groups[i].selector, "=", path[i]]) } if (storeLoadOptions.filter) { filter.push(storeLoadOptions.filter) } return _uiGrid_core2.default.combineFilters(filter) } }, /*!***********************************************************************!*\ !*** ./artifacts/transpiled/ui/pivot_grid/ui.pivot_grid.area_item.js ***! \***********************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _class = __webpack_require__( /*! ../../core/class */ 15); var _class2 = _interopRequireDefault(_class); var _dom = __webpack_require__( /*! ../../core/utils/dom */ 12); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var PIVOTGRID_EXPAND_CLASS = "dx-expand"; var getRealElementWidth = function(element) { var width = 0; var offsetWidth = element.offsetWidth; if (element.getBoundingClientRect) { var clientRect = element.getBoundingClientRect(); width = clientRect.width; if (!width) { width = clientRect.right - clientRect.left } if (width <= offsetWidth - 1) { width = offsetWidth } } return width > 0 ? width : offsetWidth }; function getFakeTableOffset(scrollPos, elementOffset, tableSize, viewPortSize) { var offset = 0; var halfTableCount = 0; var halfTableSize = tableSize / 2; if (scrollPos + viewPortSize - (elementOffset + tableSize) > 1) { if (scrollPos >= elementOffset + tableSize + halfTableSize) { halfTableCount = parseInt((scrollPos - (elementOffset + tableSize)) / halfTableSize, 10) } offset = elementOffset + tableSize + halfTableSize * halfTableCount } else { if (scrollPos < elementOffset) { if (scrollPos <= elementOffset - halfTableSize) { halfTableCount = parseInt((scrollPos - (elementOffset - halfTableSize)) / halfTableSize, 10) } offset = elementOffset - (tableSize - halfTableSize * halfTableCount) } else { offset = elementOffset } } return offset } exports.getRealElementWidth = getRealElementWidth; exports.AreaItem = _class2.default.inherit({ _getRowElement: function(index) { var that = this; if (that._tableElement && that._tableElement.length > 0) { return that._tableElement[0].rows[index] } return null }, _createGroupElement: function() { return (0, _renderer2.default)("
") }, _createTableElement: function() { return (0, _renderer2.default)("
") }, _getCellText: function(cell, encodeHtml) { var cellText = cell.isWhiteSpace ? " " : cell.text || " "; if (encodeHtml && (cellText.indexOf("<") !== -1 || cellText.indexOf(">") !== -1)) { cellText = (0, _renderer2.default)("
").text(cellText).html() } return cellText }, _getRowClassNames: function() {}, _applyCustomStyles: function(options) { if (options.cell.width) { options.cssArray.push("min-width:" + options.cell.width + "px") } if (options.cell.sorted) { options.classArray.push("dx-pivotgrid-sorted") } }, _getMainElementMarkup: function() { return "
" }, _getCloseMainElementMarkup: function() { return "" }, _renderTableContent: function(tableElement, data) { var that = this; var rowsCount = data.length; var row; var cell; var i; var j; var rowElement; var cellElement; var cellText; var rtlEnabled = that.option("rtlEnabled"); var markupArray = []; var encodeHtml = that.option("encodeHtml"); var rowClassNames; var colspan = "colspan='"; var rowspan = "rowspan='"; tableElement.data("area", that._getAreaName()); tableElement.data("data", data); tableElement.css("width", ""); markupArray.push(that._getMainElementMarkup()); for (i = 0; i < rowsCount; i++) { row = data[i]; var columnMarkupArray = []; rowClassNames = []; markupArray.push(""); if ((0, _type.isDefined)(cell.expanded)) { columnMarkupArray.push("
") } cellText = this._getCellText(cell, encodeHtml) } else { cellText = "" } columnMarkupArray.push("" + cellText + ""); if (cell.sorted) { columnMarkupArray.push("") } columnMarkupArray.push("") } if (rowClassNames.length) { markupArray.push("class='"); markupArray.push(rowClassNames.join(" ")); markupArray.push("'") } markupArray.push(">"); markupArray.push(columnMarkupArray.join("")); markupArray.push("") } markupArray.push(this._getCloseMainElementMarkup()); tableElement.append(markupArray.join("")); this._triggerOnCellPrepared(tableElement, data) }, _triggerOnCellPrepared: function(tableElement, data) { var that = this; var rowElements = tableElement.find("tr"); var areaName = that._getAreaName(); var onCellPrepared = that.option("onCellPrepared"); var hasEvent = that.component.hasEvent("cellPrepared"); var rowElement; var $cellElement; var onCellPreparedArgs; var defaultActionArgs = this.component._defaultActionArgs(); var row; var cell; var rowIndex; var columnIndex; if (onCellPrepared || hasEvent) { for (rowIndex = 0; rowIndex < data.length; rowIndex++) { row = data[rowIndex]; rowElement = rowElements.eq(rowIndex); for (columnIndex = 0; columnIndex < row.length; columnIndex++) { cell = row[columnIndex]; $cellElement = rowElement.children().eq(columnIndex); onCellPreparedArgs = { area: areaName, rowIndex: rowIndex, columnIndex: columnIndex, cellElement: (0, _dom.getPublicElement)($cellElement), cell: cell }; if (hasEvent) { that.component._trigger("onCellPrepared", onCellPreparedArgs) } else { onCellPrepared((0, _extend.extend)(onCellPreparedArgs, defaultActionArgs)) } } } } }, _getRowHeight: function(index) { var row = this._getRowElement(index); var height = 0; var offsetHeight = row.offsetHeight; if (row && row.lastChild) { if (row.getBoundingClientRect) { var clientRect = row.getBoundingClientRect(); height = clientRect.height; if (height <= offsetHeight - 1) { height = offsetHeight } } return height > 0 ? height : offsetHeight } return 0 }, _setRowHeight: function(index, value) { var row = this._getRowElement(index); if (row) { row.style.height = value + "px" } }, ctor: function(component) { this.component = component }, option: function() { return this.component.option.apply(this.component, arguments) }, getRowsLength: function() { var that = this; if (that._tableElement && that._tableElement.length > 0) { return that._tableElement[0].rows.length } return 0 }, getRowsHeight: function() { var that = this; var result = []; var rowsLength = that.getRowsLength(); var i; for (i = 0; i < rowsLength; i++) { result.push(that._getRowHeight(i)) } return result }, setRowsHeight: function(values) { var that = this; var totalHeight = 0; var valuesLength = values.length; var i; for (i = 0; i < valuesLength; i++) { totalHeight += values[i]; that._setRowHeight(i, values[i]) } this._tableHeight = totalHeight; this._tableElement[0].style.height = totalHeight + "px" }, getColumnsWidth: function() { var rowsLength = this.getRowsLength(); var rowIndex; var row; var i; var columnIndex; var processedCells = []; var result = []; var fillCells = function(cells, rowIndex, columnIndex, rowSpan, colSpan) { var rowOffset; var columnOffset; for (rowOffset = 0; rowOffset < rowSpan; rowOffset++) { for (columnOffset = 0; columnOffset < colSpan; columnOffset++) { cells[rowIndex + rowOffset] = cells[rowIndex + rowOffset] || []; cells[rowIndex + rowOffset][columnIndex + columnOffset] = true } } }; if (rowsLength) { for (rowIndex = 0; rowIndex < rowsLength; rowIndex++) { processedCells[rowIndex] = processedCells[rowIndex] || []; row = this._getRowElement(rowIndex); for (i = 0; i < row.cells.length; i++) { for (columnIndex = 0; processedCells[rowIndex][columnIndex]; columnIndex++) {} fillCells(processedCells, rowIndex, columnIndex, row.cells[i].rowSpan, row.cells[i].colSpan); if (1 === row.cells[i].colSpan) { result[columnIndex] = result[columnIndex] || getRealElementWidth(row.cells[i]) } } } } return result }, setColumnsWidth: function(values) { var i; var totalWidth = 0; var tableElement = this._tableElement[0]; var colgroupElementHTML = ""; var columnsCount = this.getColumnsCount(); var columnWidth = []; for (i = 0; i < columnsCount; i++) { columnWidth.push(values[i] || 0) } for (i = columnsCount; i < values.length && values; i++) { columnWidth[columnsCount - 1] += values[i] } for (i = 0; i < columnsCount; i++) { totalWidth += columnWidth[i]; colgroupElementHTML += '' } this._colgroupElement.html(colgroupElementHTML); this._tableWidth = totalWidth - this._groupWidth > .01 ? Math.ceil(totalWidth) : totalWidth; tableElement.style.width = this._tableWidth + "px"; tableElement.style.tableLayout = "fixed" }, resetColumnsWidth: function() { this._colgroupElement.find("col").width("auto"); this._tableElement.css({ width: "", tableLayout: "" }) }, groupWidth: function(value) { if (void 0 === value) { return this._groupElement.width() } else { if (value >= 0) { this._groupWidth = value; return this._groupElement[0].style.width = value + "px" } else { return this._groupElement[0].style.width = value } } }, groupHeight: function(value) { if (void 0 === value) { return this._groupElement.height() } this._groupHeight = null; if (value >= 0) { this._groupHeight = value; this._groupElement[0].style.height = value + "px" } else { this._groupElement[0].style.height = value } }, groupElement: function() { return this._groupElement }, tableElement: function() { return this._tableElement }, element: function() { return this._rootElement }, headElement: function() { return this._tableElement.find("thead") }, _setTableCss: function(styles) { if (this.option("rtlEnabled")) { styles.right = styles.left; delete styles.left } this.tableElement().css(styles) }, setVirtualContentParams: function(params) { this._virtualContent.css({ width: params.width, height: params.height }); this.groupElement().addClass("dx-virtual-mode") }, disableVirtualMode: function() { this.groupElement().removeClass("dx-virtual-mode") }, _renderVirtualContent: function() { var that = this; if (!that._virtualContent && "virtual" === that.option("scrolling.mode")) { that._virtualContent = (0, _renderer2.default)("
").addClass("dx-virtual-content").insertBefore(that._tableElement) } }, reset: function() { var that = this; var tableElement = that._tableElement[0]; that._fakeTable && that._fakeTable.detach(); that._fakeTable = null; that.disableVirtualMode(); that.groupWidth("100%"); that.groupHeight("auto"); that.resetColumnsWidth(); if (tableElement) { for (var i = 0; i < tableElement.rows.length; i++) { tableElement.rows[i].style.height = "" } tableElement.style.height = ""; tableElement.style.width = "100%" } }, _updateFakeTableVisibility: function() { var that = this; var tableElement = that.tableElement()[0]; var horizontalOffsetName = that.option("rtlEnabled") ? "right" : "left"; var fakeTableElement = that._fakeTable[0]; if (tableElement.style.top === fakeTableElement.style.top && fakeTableElement.style[horizontalOffsetName] === tableElement.style[horizontalOffsetName]) { that._fakeTable.addClass("dx-hidden") } else { that._fakeTable.removeClass("dx-hidden") } }, _moveFakeTableHorizontally: function(scrollPos) { var that = this; var rtlEnabled = that.option("rtlEnabled"); var offsetStyleName = rtlEnabled ? "right" : "left"; var tableElementOffset = parseFloat(that.tableElement()[0].style[offsetStyleName]); var offset = getFakeTableOffset(scrollPos, tableElementOffset, that._tableWidth, that._groupWidth); if (parseFloat(that._fakeTable[0].style[offsetStyleName]) !== offset) { that._fakeTable[0].style[offsetStyleName] = offset + "px" } }, _moveFakeTableTop: function(scrollPos) { var that = this; var tableElementOffsetTop = parseFloat(that.tableElement()[0].style.top); var offsetTop = getFakeTableOffset(scrollPos, tableElementOffsetTop, that._tableHeight, that._groupHeight); if (parseFloat(that._fakeTable[0].style.top) !== offsetTop) { that._fakeTable[0].style.top = offsetTop + "px" } }, _moveFakeTable: function() { this._updateFakeTableVisibility() }, _createFakeTable: function() { var that = this; if (!that._fakeTable) { that._fakeTable = that.tableElement().clone().addClass("dx-pivot-grid-fake-table").appendTo(that._virtualContent) } }, render: function(rootElement, data) { var that = this; if (that._tableElement) { try { that._tableElement[0].innerHTML = "" } catch (e) { that._tableElement.empty() } that._tableElement.attr("style", "") } else { that._groupElement = that._createGroupElement(); that._tableElement = that._createTableElement(); that._tableElement.appendTo(that._groupElement); that._groupElement.appendTo(rootElement); that._rootElement = rootElement } that._colgroupElement = (0, _renderer2.default)("
").appendTo(that._tableElement); that._renderTableContent(that._tableElement, data); that._renderVirtualContent() }, _getScrollable: function() { return this.groupElement().data("dxScrollable") }, on: function(eventName, handler) { var that = this; var scrollable = that._getScrollable(); if (scrollable) { scrollable.on(eventName, function(e) { if (that.option("rtlEnabled") && (0, _type.isDefined)(e.scrollOffset.left)) { e.scrollOffset.left = scrollable.$content().width() - scrollable._container().width() - e.scrollOffset.left } handler(e) }) } return this }, off: function(eventName) { var scrollable = this._getScrollable(); if (scrollable) { scrollable.off(eventName) } return this }, scrollTo: function(pos) { var scrollable = this._getScrollable(); var scrollablePos = pos; if (scrollable) { if (this.option("rtlEnabled")) { if ("column" === this._getAreaName()) { scrollablePos = scrollable.$content().width() - scrollable._container().width() - pos } else { if ("data" === this._getAreaName()) { scrollablePos = { x: scrollable.$content().width() - scrollable._container().width() - pos.x, y: pos.y } } } } scrollable.scrollTo(scrollablePos); if (this._virtualContent) { this._createFakeTable(); this._moveFakeTable(pos) } } }, updateScrollable: function() { var scrollable = this._getScrollable(); if (scrollable) { return scrollable.update() } }, getColumnsCount: function() { var columnCount = 0; var row = this._getRowElement(0); var cells; if (row) { cells = row.cells; for (var i = 0, len = cells.length; i < len; ++i) { columnCount += cells[i].colSpan } } return columnCount }, getData: function() { var tableElement = this._tableElement; return tableElement ? tableElement.data("data") : [] } }) }, /*!********************************************************************************!*\ !*** ./artifacts/transpiled/ui/pivot_grid/ui.pivot_grid.field_chooser_base.js ***! \********************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _array_store = __webpack_require__( /*! ../../data/array_store */ 68); var _array_store2 = _interopRequireDefault(_array_store); var _click = __webpack_require__( /*! ../../events/click */ 19); var _click2 = _interopRequireDefault(_click); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _array = __webpack_require__( /*! ../../core/utils/array */ 14); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var _message = __webpack_require__( /*! ../../localization/message */ 13); var _component_registrator = __webpack_require__( /*! ../../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _ui = __webpack_require__( /*! ../widget/ui.widget */ 18); var _ui2 = _interopRequireDefault(_ui); var _uiGrid_core = __webpack_require__( /*! ../grid_core/ui.grid_core.header_filter_core */ 363); var _uiGrid_core2 = _interopRequireDefault(_uiGrid_core); var _uiGrid_core3 = __webpack_require__( /*! ../grid_core/ui.grid_core.column_state_mixin */ 335); var _uiGrid_core4 = _interopRequireDefault(_uiGrid_core3); var _uiGrid_core5 = __webpack_require__( /*! ../grid_core/ui.grid_core.sorting_mixin */ 340); var _uiGrid_core6 = _interopRequireDefault(_uiGrid_core5); var _uiPivot_grid = __webpack_require__( /*! ./ui.pivot_grid.utils */ 75); var _ui3 = __webpack_require__( /*! ./ui.sortable */ 689); var _ui4 = _interopRequireDefault(_ui3); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var IE_FIELD_WIDTH_CORRECTION = 1; var DIV = "
"; var HeaderFilterView = _uiGrid_core2.default.HeaderFilterView.inherit({ _getSearchExpr: function(options) { options.useDefaultSearchExpr = true; return this.callBase(options) } }); var processItems = function(groupItems, field) { var filterValues = []; var isTree = !!field.groupName; var isExcludeFilterType = "exclude" === field.filterType; if (field.filterValues) { (0, _iterator.each)(field.filterValues, function(_, filterValue) { filterValues.push(Array.isArray(filterValue) ? filterValue.join("/") : filterValue && filterValue.valueOf()) }) }(0, _uiPivot_grid.foreachTree)(groupItems, function(items) { var item = items[0]; var path = (0, _uiPivot_grid.createPath)(items); var preparedFilterValueByText = isTree ? (0, _iterator.map)(items, function(item) { return item.text }).reverse().join("/") : item.text; item.value = isTree ? path.slice(0) : item.key || item.value; var preparedFilterValue = isTree ? path.join("/") : item.value && item.value.valueOf(); if (item.children) { item.items = item.children; item.children = null }(0, _uiGrid_core.updateHeaderFilterItemSelectionState)(item, item.key && (0, _array.inArray)(preparedFilterValueByText, filterValues) > -1 || (0, _array.inArray)(preparedFilterValue, filterValues) > -1, isExcludeFilterType) }) }; function getMainGroupField(dataSource, sourceField) { var field = sourceField; if ((0, _type.isDefined)(sourceField.groupIndex)) { field = dataSource.getAreaFields(sourceField.area, true)[sourceField.areaIndex] } return field } function getStringState(state) { state = state || {}; return JSON.stringify([state.fields, state.columnExpandedPaths, state.rowExpandedPaths]) } var FieldChooserBase = _ui2.default.inherit(_uiGrid_core4.default).inherit(_uiGrid_core6.default).inherit(_uiGrid_core.headerFilterMixin).inherit({ _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { allowFieldDragging: true, applyChangesMode: "instantly", state: null, headerFilter: { width: 252, height: 325, searchTimeout: 500, texts: { emptyValue: (0, _message.format)("dxDataGrid-headerFilterEmptyValue"), ok: (0, _message.format)("dxDataGrid-headerFilterOK"), cancel: (0, _message.format)("dxDataGrid-headerFilterCancel") } } }) }, _init: function() { this.callBase(); this._headerFilterView = new HeaderFilterView(this); this._refreshDataSource(); this.subscribeToEvents() }, _refreshDataSource: function() { var dataSource = this.option("dataSource"); if (dataSource && dataSource.fields && dataSource.load) { this._dataSource = dataSource } }, _optionChanged: function(args) { switch (args.name) { case "dataSource": this._refreshDataSource(); break; case "applyChangesMode": break; case "state": if (this._skipStateChange || !this._dataSource) { break } if ("instantly" === this.option("applyChangesMode") && getStringState(this._dataSource.state()) !== getStringState(args.value)) { this._dataSource.state(args.value) } else { this._clean(true); this._renderComponent() } break; case "headerFilter": case "allowFieldDragging": this._invalidate(); break; default: this.callBase(args) } }, renderField: function(field, showColumnLines) { var that = this; var $fieldContent = (0, _renderer2.default)(DIV).addClass("dx-area-field-content").text(field.caption || field.dataField); var $fieldElement = (0, _renderer2.default)(DIV).addClass("dx-area-field").addClass("dx-area-box").data("field", field).append($fieldContent); var mainGroupField = getMainGroupField(that._dataSource, field); if ("data" !== field.area) { if (field.allowSorting) { that._applyColumnState({ name: "sort", rootElement: $fieldElement, column: { alignment: that.option("rtlEnabled") ? "right" : "left", sortOrder: "desc" === field.sortOrder ? "desc" : "asc" }, showColumnLines: showColumnLines }) } that._applyColumnState({ name: "headerFilter", rootElement: $fieldElement, column: { alignment: that.option("rtlEnabled") ? "right" : "left", filterValues: mainGroupField.filterValues, allowFiltering: mainGroupField.allowFiltering && !field.groupIndex }, showColumnLines: showColumnLines }) } if (field.groupName) { $fieldElement.attr("item-group", field.groupName) } return $fieldElement }, _clean: function() {}, _render: function() { this.callBase(); this._headerFilterView.render(this.$element()) }, renderSortable: function() { var that = this; that._createComponent(that.$element(), _ui4.default, (0, _extend.extend)({ allowDragging: that.option("allowFieldDragging"), itemSelector: ".dx-area-field", itemContainerSelector: ".dx-area-field-container", groupSelector: ".dx-area-fields", groupFilter: function() { var dataSource = that._dataSource; var $sortable = (0, _renderer2.default)(this).closest(".dx-sortable"); var pivotGrid = $sortable.data("dxPivotGrid"); var pivotGridFieldChooser = $sortable.data("dxPivotGridFieldChooser"); if (pivotGrid) { return pivotGrid.getDataSource() === dataSource } if (pivotGridFieldChooser) { return pivotGridFieldChooser.option("dataSource") === dataSource } return false }, itemRender: function($sourceItem, target) { var $item; if ($sourceItem.hasClass("dx-area-box")) { $item = $sourceItem.clone(); if ("drag" === target) { (0, _iterator.each)($sourceItem, function(index, sourceItem) { $item.eq(index).css("width", parseInt((0, _renderer2.default)(sourceItem).outerWidth(), 10) + IE_FIELD_WIDTH_CORRECTION) }) } } else { $item = (0, _renderer2.default)(DIV).addClass("dx-area-field").addClass("dx-area-box").text($sourceItem.text()) } if ("drag" === target) { var wrapperContainer = (0, _renderer2.default)(DIV); (0, _iterator.each)($item, function(_, item) { var wrapper = (0, _renderer2.default)("
").addClass("dx-pivotgrid-fields-container").addClass("dx-widget").append((0, _renderer2.default)(item)); wrapperContainer.append(wrapper) }); return wrapperContainer.children() } return $item }, onDragging: function(e) { var field = e.sourceElement.data("field"); var targetGroup = e.targetGroup; e.cancel = false; if (true === field.isMeasure) { if ("column" === targetGroup || "row" === targetGroup || "filter" === targetGroup) { e.cancel = true } } else { if (false === field.isMeasure && "data" === targetGroup) { e.cancel = true } } }, useIndicator: true, onChanged: function(e) { var dataSource = that._dataSource; var field = e.sourceElement.data("field"); e.removeSourceElement = !!e.sourceGroup; that._adjustSortableOnChangedArgs(e); if (field) { that._applyChanges([getMainGroupField(dataSource, field)], { area: e.targetGroup, areaIndex: e.targetIndex }) } } }, that._getSortableOptions())) }, _processDemandState: function(func) { var that = this; var isInstantlyMode = "instantly" === that.option("applyChangesMode"); var dataSource = that._dataSource; if (isInstantlyMode) { func(dataSource, isInstantlyMode) } else { var currentState = dataSource.state(); var pivotGridState = that.option("state"); if (pivotGridState) { dataSource.state(pivotGridState, true) } func(dataSource, isInstantlyMode); dataSource.state(currentState, true) } }, _applyChanges: function(fields, props) { var that = this; that._processDemandState(function(dataSource, isInstantlyMode) { fields.forEach(function(_ref) { var index = _ref.index; dataSource.field(index, props) }); if (isInstantlyMode) { dataSource.load() } else { that._changedHandler() } }) }, _adjustSortableOnChangedArgs: function(e) { e.removeSourceElement = false; e.removeTargetElement = true; e.removeSourceClass = false }, _getSortableOptions: function() { return { direction: "auto" } }, subscribeToEvents: function(element) { var that = this; var func = function(e) { var field = (0, _renderer2.default)(e.currentTarget).data("field"); var mainGroupField = (0, _extend.extend)(true, {}, getMainGroupField(that._dataSource, field)); var isHeaderFilter = (0, _renderer2.default)(e.target).hasClass("dx-header-filter"); var dataSource = that._dataSource; var type = mainGroupField.groupName ? "tree" : "list"; var paginate = dataSource.paginate() && "list" === type; if (isHeaderFilter) { that._headerFilterView.showHeaderFilterMenu((0, _renderer2.default)(e.currentTarget), (0, _extend.extend)(mainGroupField, { type: type, encodeHtml: that.option("encodeHtml"), dataSource: { useDefaultSearch: !paginate, load: function(options) { var userData = options.userData; if (userData.store) { return userData.store.load(options) } else { var d = new _deferred.Deferred; dataSource.getFieldValues(mainGroupField.index, that.option("headerFilter.showRelevantValues"), paginate ? options : void 0).done(function(data) { if (paginate) { d.resolve(data) } else { userData.store = new _array_store2.default(data); userData.store.load(options).done(d.resolve).fail(d.reject) } }).fail(d.reject); return d } }, postProcess: function(data) { processItems(data, mainGroupField); return data } }, apply: function() { that._applyChanges([mainGroupField], { filterValues: this.filterValues, filterType: this.filterType }) } })) } else { if (field.allowSorting && "data" !== field.area) { that._applyChanges([field], { sortOrder: "desc" === field.sortOrder ? "asc" : "desc" }) } } }; if (element) { _events_engine2.default.on(element, _click2.default.name, ".dx-area-field.dx-area-box", func); return } _events_engine2.default.on(that.$element(), _click2.default.name, ".dx-area-field.dx-area-box", func) }, _initTemplates: _common.noop, addWidgetPrefix: function(className) { return "dx-pivotgrid-" + className } }); (0, _component_registrator2.default)("dxPivotGridFieldChooserBase", FieldChooserBase); module.exports = FieldChooserBase }, /*!*************************************************************************!*\ !*** ./artifacts/transpiled/ui/scheduler/ui.scheduler.table_creator.js ***! \*************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var getPublicElement = __webpack_require__( /*! ../../core/utils/dom */ 12).getPublicElement; var ROW_SELECTOR = "tr"; var SchedulerTableCreator = { VERTICAL: "vertical", HORIZONTAL: "horizontal", insertAllDayRow: function(allDayElements, tableBody, index) { if (allDayElements[index]) { var row = allDayElements[index].find(ROW_SELECTOR); if (!row.length) { row = $(domAdapter.createElement(ROW_SELECTOR)); row.append(allDayElements[index].get(0)) } tableBody.appendChild(row.get ? row.get(0) : row) } }, makeTable: function(options) { var tableBody = domAdapter.createElement("tbody"); var templateCallbacks = []; var row; var rowCountInGroup = options.groupCount ? options.rowCount / options.groupCount : options.rowCount; var allDayElementIndex = 0; var allDayElements = options.allDayElements; var groupIndex = options.groupIndex; var rowCount = options.rowCount; $(options.container).append(tableBody); if (allDayElements) { this.insertAllDayRow(allDayElements, tableBody, 0); allDayElementIndex++ } for (var i = 0; i < rowCount; i++) { row = domAdapter.createElement(ROW_SELECTOR); tableBody.appendChild(row); var isLastRowInGroup = (i + 1) % rowCountInGroup === 0; if (options.rowClass) { row.className = options.rowClass } for (var j = 0; j < options.cellCount; j++) { var td = domAdapter.createElement("td"); row.appendChild(td); if (options.cellClass) { if (typeUtils.isFunction(options.cellClass)) { td.className = options.cellClass(i, j) } else { td.className = options.cellClass } } var cellDataObject; var dataKey; var dataValue; if (options.getCellData) { cellDataObject = options.getCellData(td, i, j, groupIndex); dataKey = cellDataObject.key; dataValue = cellDataObject.value; dataKey && dataUtils.data(td, dataKey, dataValue) } if (options.cellTemplate && options.cellTemplate.render) { var templateOptions = { model: { text: options.getCellText ? options.getCellText(i, j) : "", date: options.getCellDate ? options.getCellDate(i) : void 0 }, container: getPublicElement($(td)), index: i * options.cellCount + j }; if (dataValue) { if (dataValue.startDate) { templateOptions.model.startDate = dataValue.startDate } if (dataValue.endDate) { templateOptions.model.endDate = dataValue.endDate } if (dataValue.groups) { templateOptions.model.groups = dataValue.groups } if (dataValue.allDay) { templateOptions.model.allDay = dataValue.allDay } } templateCallbacks.push(options.cellTemplate.render.bind(options.cellTemplate, templateOptions)) } else { if (options.getCellText) { td.innerHTML = "
" + options.getCellText(i, j) + "
" } } } if (allDayElements && isLastRowInGroup) { this.insertAllDayRow(allDayElements, tableBody, allDayElementIndex); allDayElementIndex++ } } return templateCallbacks }, makeGroupedTable: function(type, groups, cssClasses, cellCount, cellTemplate, rowCount, groupByDate) { var rows = []; if (type === this.VERTICAL) { rows = this._makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount) } else { rows = this._makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate) } return rows }, makeGroupedTableFromJSON: function(type, data, config) { var table; var cellStorage = []; var rowIndex = 0; config = config || {}; var cellTag = config.cellTag || "td"; var childrenField = config.childrenField || "children"; var titleField = config.titleField || "title"; var groupTableClass = config.groupTableClass; var groupRowClass = config.groupRowClass; var groupCellClass = config.groupCellClass; var groupCellCustomContent = config.groupCellCustomContent; function createTable() { table = domAdapter.createElement("table"); if (groupTableClass) { table.className = groupTableClass } } function getChildCount(item) { if (item[childrenField]) { return item[childrenField].length } return 0 } function createCell(text, childCount, index, data) { var cell = { element: domAdapter.createElement(cellTag), childCount: childCount }; if (groupCellClass) { cell.element.className = groupCellClass } var cellText = domAdapter.createTextNode(text); if ("function" === typeof groupCellCustomContent) { groupCellCustomContent(cell.element, cellText, index, data) } else { cell.element.appendChild(cellText) } return cell } function generateCells(data) { for (var i = 0; i < data.length; i++) { var childCount = getChildCount(data[i]); var cell = createCell(data[i][titleField], childCount, i, data[i]); if (!cellStorage[rowIndex]) { cellStorage[rowIndex] = [] } cellStorage[rowIndex].push(cell); if (childCount) { generateCells(data[i][childrenField]) } else { rowIndex++ } } } function putCellsToRows() { cellStorage.forEach(function(cells) { var row = domAdapter.createElement(ROW_SELECTOR); if (groupRowClass) { row.className = groupRowClass } var rowspans = []; for (var i = cells.length - 1; i >= 0; i--) { var prev = cells[i + 1]; var rowspan = cells[i].childCount; if (prev && prev.childCount) { rowspan *= prev.childCount } rowspans.push(rowspan) } rowspans.reverse(); cells.forEach(function(cell, index) { if (rowspans[index]) { cell.element.setAttribute("rowSpan", rowspans[index]) } row.appendChild(cell.element) }); table.appendChild(row) }) } createTable(); generateCells(data); putCellsToRows(); return table }, _makeVerticalGroupedRows: function(groups, cssClasses, cellTemplate, rowCount) { var cellTemplates = []; var repeatCount = 1; var arr = []; var i; var cellIterator = function(cell) { if (cell.template) { cellTemplates.push(cell.template) } }; for (i = 0; i < groups.length; i++) { if (i > 0) { repeatCount = groups[i - 1].items.length * repeatCount } var cells = this._makeGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate); cells.forEach(cellIterator); arr.push(cells) } var rows = []; var groupCount = arr.length; var maxCellCount = arr[groupCount - 1].length; for (i = 0; i < maxCellCount; i++) { rows.push($("
").addClass(cssClasses.groupHeaderRowClass)) } for (i = groupCount - 1; i >= 0; i--) { var currentColumnLength = arr[i].length; var rowspan = maxCellCount / currentColumnLength; for (var j = 0; j < currentColumnLength; j++) { var currentRowIndex = j * rowspan; var row = rows[currentRowIndex]; row.prepend(arr[i][j].element.attr("rowSpan", rowspan)) } } return { elements: rows, cellTemplates: cellTemplates } }, _makeHorizontalGroupedRows: function(groups, cssClasses, cellCount, cellTemplate, groupByDate) { var repeatCount = 1; var groupCount = groups.length; var rows = []; var cellTemplates = []; var repeatByDate = groupByDate ? cellCount : 1; var cellIterator = function(cell) { if (cell.template) { cellTemplates.push(cell.template) } return cell.element }; for (var i = 0; i < groupCount; i++) { if (i > 0) { repeatCount = groups[i - 1].items.length * repeatCount } var cells = this._makeGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate, repeatByDate); rows.push($("").addClass(cssClasses.groupRowClass).append(cells.map(cellIterator))) } var maxCellCount = rows[groupCount - 1].find("th").length; for (var j = 0; j < groupCount; j++) { var $cell = rows[j].find("th"); var colspan = maxCellCount / $cell.length; if (!groupByDate) { colspan *= cellCount } if (colspan > 1 && 1 === repeatByDate || groupByDate && groupCount > 1) { $cell.attr("colSpan", colspan) } } return { elements: rows, cellTemplates: cellTemplates } }, _makeGroupedRowCells: function(group, repeatCount, cssClasses, cellTemplate, repeatByDate) { repeatByDate = repeatByDate || 1; repeatCount *= repeatByDate; var cells = []; var items = group.items; var itemCount = items.length; for (var i = 0; i < repeatCount; i++) { for (var j = 0; j < itemCount; j++) { var $container = $("
"); var cell = {}; if (cellTemplate && cellTemplate.render) { var templateOptions = { model: items[j], container: getPublicElement($container), index: i * itemCount + j }; if (group.data) { templateOptions.model.data = group.data[j] } cell.template = cellTemplate.render.bind(cellTemplate, templateOptions) } else { $container.text(items[j].text); $container = $("
").append($container) } $container.addClass(cssClasses.groupHeaderContentClass); var cssClass; if (typeUtils.isFunction(cssClasses.groupHeaderClass)) { cssClass = cssClasses.groupHeaderClass(j) } else { cssClass = cssClasses.groupHeaderClass } cell.element = $("
").addClass(cssClass).append($container); cells.push(cell) } } return cells } }; module.exports = SchedulerTableCreator }, /*!*******************************************************************************!*\ !*** ./artifacts/transpiled/ui/scheduler/workspaces/ui.scheduler.timeline.js ***! \*******************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../../core/renderer */ 2); var noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop; var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend; var registerComponent = __webpack_require__( /*! ../../../core/component_registrator */ 9); var SchedulerWorkSpace = __webpack_require__( /*! ./ui.scheduler.work_space.indicator */ 198); var dateUtils = __webpack_require__( /*! ../../../core/utils/date */ 22); var tableCreator = __webpack_require__( /*! ../ui.scheduler.table_creator */ 233); var HorizontalShader = __webpack_require__( /*! ../shaders/ui.scheduler.current_time_shader.horizontal */ 709); var TIMELINE_CLASS = "dx-scheduler-timeline"; var GROUP_TABLE_CLASS = "dx-scheduler-group-table"; var HORIZONTAL_GROUPED_WORKSPACE_CLASS = "dx-scheduler-work-space-horizontal-grouped"; var HEADER_PANEL_CELL_CLASS = "dx-scheduler-header-panel-cell"; var HEADER_PANEL_WEEK_CELL_CLASS = "dx-scheduler-header-panel-week-cell"; var HEADER_ROW_CLASS = "dx-scheduler-header-row"; var HORIZONTAL = "horizontal"; var DATE_TABLE_CELL_BORDER = 1; var DATE_TABLE_HEADER_MARGIN = 10; var toMs = dateUtils.dateToMilliseconds; var SchedulerTimeline = SchedulerWorkSpace.inherit({ _init: function() { this.callBase(); this.$element().addClass(TIMELINE_CLASS); this._$sidebarTable = $("").addClass(GROUP_TABLE_CLASS) }, _getCellFromNextRow: function(direction, isMultiSelection) { if (!isMultiSelection) { return this.callBase(direction, isMultiSelection) } return this._$focusedCell }, _getDefaultGroupStrategy: function() { return "vertical" }, _toggleGroupingDirectionClass: function() { this.$element().toggleClass(HORIZONTAL_GROUPED_WORKSPACE_CLASS, this._isHorizontalGroupedWorkSpace()) }, _getDefaultOptions: function() { return extend(this.callBase(), { groupOrientation: "vertical" }) }, _getRightCell: function() { var $rightCell; var $focusedCell = this._$focusedCell; var rowCellCount = this._getCellCount(); var edgeCellIndex = this._isRTL() ? 0 : rowCellCount - 1; var direction = this._isRTL() ? "prev" : "next"; if ($focusedCell.index() === edgeCellIndex) { $rightCell = $focusedCell } else { $rightCell = $focusedCell[direction](); $rightCell = this._checkForViewBounds($rightCell) } return $rightCell }, _getLeftCell: function() { var $leftCell; var $focusedCell = this._$focusedCell; var rowCellCount = this._getCellCount(); var edgeCellIndex = this._isRTL() ? rowCellCount - 1 : 0; var direction = this._isRTL() ? "next" : "prev"; if ($focusedCell.index() === edgeCellIndex) { $leftCell = $focusedCell } else { $leftCell = $focusedCell[direction](); $leftCell = this._checkForViewBounds($leftCell) } return $leftCell }, _getRowCount: function() { return 1 }, _getCellCount: function() { return this._getCellCountInDay() * this.option("intervalCount") }, getGroupTableWidth: function() { return this._$sidebarTable ? this._$sidebarTable.outerWidth() : 0 }, _getTotalRowCount: function(groupCount) { if (this._isHorizontalGroupedWorkSpace()) { return this._getRowCount() } else { groupCount = groupCount || 1; return this._getRowCount() * groupCount } }, _getDateByIndex: function(index) { var resultDate = new Date(this._firstViewDate); var dayIndex = Math.floor(index / this._getCellCountInDay()); resultDate.setTime(this._firstViewDate.getTime() + this._calculateCellIndex(0, index) * this._getInterval() + dayIndex * this._getHiddenInterval()); return resultDate }, _getFormat: function() { return "shorttime" }, _needApplyLastGroupCellClass: function() { return true }, _calculateHiddenInterval: function(rowIndex, cellIndex) { var dayIndex = Math.floor(cellIndex / this._getCellCountInDay()); return dayIndex * this._getHiddenInterval() }, _getMillisecondsOffset: function(rowIndex, cellIndex) { cellIndex = this._calculateCellIndex(rowIndex, cellIndex); return this._getInterval() * cellIndex + this._calculateHiddenInterval(rowIndex, cellIndex) }, _createWorkSpaceElements: function() { this._createWorkSpaceScrollableElements() }, _getWorkSpaceHeight: function() { if (this.option("crossScrollingEnabled")) { return this._$dateTable.get(0).getBoundingClientRect().height } return this.$element().get(0).getBoundingClientRect().height }, _dateTableScrollableConfig: function() { var config = this.callBase(); var timelineConfig = { direction: HORIZONTAL }; return this.option("crossScrollingEnabled") ? config : extend(config, timelineConfig) }, _needCreateCrossScrolling: function() { return true }, _headerScrollableConfig: function() { var config = this.callBase(); return extend(config, { scrollByContent: true }) }, _renderTimePanel: noop, _renderAllDayPanel: noop, _getTableAllDay: function() { return false }, _getDateHeaderTemplate: function() { return this.option("timeCellTemplate") }, _toggleAllDayVisibility: noop, _changeAllDayVisibility: noop, supportAllDayRow: function() { return false }, _getGroupHeaderContainer: function() { if (this._isHorizontalGroupedWorkSpace()) { return this._$thead } return this._$sidebarTable }, _insertAllDayRowsIntoDateTable: function() { return false }, _createAllDayPanelElements: noop, _renderDateHeader: function() { var $headerRow = this.callBase(); if (this._needRenderWeekHeader()) { var firstViewDate = new Date(this._firstViewDate); var $cells = []; var colspan = this._getCellCountInDay(); var cellTemplate = this.option("dateCellTemplate"); for (var i = 0; i < this._getWeekDuration() * this.option("intervalCount"); i++) { var $th = $("").addClass(HEADER_ROW_CLASS).append($cells); $headerRow.before($row) } }, _needRenderWeekHeader: function() { return false }, _incrementDate: function(date) { date.setDate(date.getDate() + 1) }, _getWeekDuration: function() { return 1 }, _renderView: function() { this._setFirstViewDate(); var groupCellTemplates = this._renderGroupHeader(); this._renderDateHeader(); this._renderAllDayPanel(); this._renderTimePanel(); this._renderDateTable(); this._shader = new HorizontalShader; this._updateGroupTableHeight(); this._$sidebarTable.appendTo(this._sidebarScrollable.$content()); this._applyCellTemplates(groupCellTemplates) }, _setHorizontalGroupHeaderCellsHeight: noop, getIndicationWidth: function() { var today = this._getToday(); var cellWidth = this.getCellWidth(); var date = this._getIndicationFirstViewDate(); var hiddenInterval = this._getHiddenInterval(); var timeDiff = today.getTime() - date.getTime(); var differenceInDays = Math.ceil(timeDiff / toMs("day")) - 1; var duration = timeDiff - differenceInDays * hiddenInterval; var cellCount = duration / this.getCellDuration(); return cellCount * cellWidth }, _renderIndicator: function(height, rtlOffset, $container, groupCount) { var $indicator; var width = this.getIndicationWidth(); if ("vertical" === this.option("groupOrientation")) { $indicator = this._createIndicator($container); $indicator.height($container.get(0).getBoundingClientRect().height); $indicator.css("left", rtlOffset ? rtlOffset - width : width) } else { for (var i = 0; i < groupCount; i++) { var offset = this._getCellCount() * this.getCellWidth() * i; $indicator = this._createIndicator($container); $indicator.height($container.get(0).getBoundingClientRect().height); $indicator.css("left", rtlOffset ? rtlOffset - width - offset : width + offset) } } }, _isVerticalShader: function() { return false }, _isCurrentTimeHeaderCell: function(headerIndex) { var result = false; if (this.option("showCurrentTimeIndicator") && this._needRenderDateTimeIndicator()) { var date = this._getDateByIndex(headerIndex); var now = this._getToday(); date = new Date(date); if (dateUtils.sameDate(now, date)) { var startCellDate = new Date(date); var endCellDate = new Date(date); endCellDate = endCellDate.setMilliseconds(date.getMilliseconds() + this.getCellDuration()); result = dateUtils.dateInRange(now, startCellDate, endCellDate) } } return result }, _cleanView: function() { this.callBase(); this._$sidebarTable.empty() }, _visibilityChanged: function(visible) { this.callBase(visible) }, _setTableSizes: function() { var cellHeight = this.getCellHeight(); var minHeight = this._getWorkSpaceMinHeight(); var $groupCells = this._$sidebarTable.find("tr"); var height = cellHeight * $groupCells.length; if (height < minHeight) { height = minHeight } this._$sidebarTable.height(height); this._$dateTable.height(height); this.callBase() }, _getWorkSpaceMinHeight: function() { var minHeight = this._getWorkSpaceHeight(); var workspaceContainerHeight = this.$element().outerHeight(true) - this.getHeaderPanelHeight() - 2 * DATE_TABLE_CELL_BORDER - DATE_TABLE_HEADER_MARGIN; if (minHeight < workspaceContainerHeight) { minHeight = workspaceContainerHeight } return minHeight }, _makeGroupRows: function(groups, groupByDate) { var tableCreatorStrategy = "vertical" === this.option("groupOrientation") ? tableCreator.VERTICAL : tableCreator.HORIZONTAL; return tableCreator.makeGroupedTable(tableCreatorStrategy, groups, { groupRowClass: this._getGroupRowClass(), groupHeaderRowClass: this._getGroupRowClass(), groupHeaderClass: this._getGroupHeaderClass.bind(this), groupHeaderContentClass: this._getGroupHeaderContentClass() }, this._getCellCount() || 1, this.option("resourceCellTemplate"), this._getTotalRowCount(this._getGroupCount()), groupByDate) }, _ensureGroupHeaderCellsHeight: function(cellHeight) { var minCellHeight = this._calculateMinCellHeight(); if (cellHeight < minCellHeight) { return minCellHeight } return cellHeight }, _calculateMinCellHeight: function() { var dateTable = this._getDateTable(); var dateTableRowSelector = "." + this._getDateTableRowClass(); return dateTable.get(0).getBoundingClientRect().height / dateTable.find(dateTableRowSelector).length - 2 * DATE_TABLE_CELL_BORDER }, _getCellCoordinatesByIndex: function(index) { return { cellIndex: index % this._getCellCount(), rowIndex: 0 } }, _getCellByCoordinates: function(cellCoordinates, groupIndex) { var indexes = this._groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex); return this._$dateTable.find("tr").eq(indexes.rowIndex).find("td").eq(indexes.cellIndex) }, _getWorkSpaceWidth: function() { return this._$dateTable.outerWidth(true) }, _getGroupIndexByCell: function($cell) { return $cell.parent().index() }, _getIndicationFirstViewDate: function() { return new Date(this._firstViewDate) }, _getIntervalBetween: function(currentDate, allDay) { var startDayHour = this.option("startDayHour"); var endDayHour = this.option("endDayHour"); var firstViewDate = this.getStartViewDate(); var firstViewDateTime = firstViewDate.getTime(); var hiddenInterval = (24 - endDayHour + startDayHour) * toMs("hour"); var timeZoneOffset = dateUtils.getTimezonesDifference(firstViewDate, currentDate); var apptStart = currentDate.getTime(); var fullInterval = apptStart - firstViewDateTime - timeZoneOffset; var fullDays = Math.floor(fullInterval / toMs("day")); var tailDuration = fullInterval - fullDays * toMs("day"); var tailDelta = 0; var cellCount = this._getCellCountInDay() * (fullDays - this._getWeekendsCount(fullDays)); var gapBeforeAppt = apptStart - dateUtils.trimTime(new Date(currentDate)).getTime(); var result = cellCount * this.option("hoursInterval") * toMs("hour"); if (!allDay) { if (currentDate.getHours() < startDayHour) { tailDelta = tailDuration - hiddenInterval + gapBeforeAppt } else { if (currentDate.getHours() >= startDayHour && currentDate.getHours() < endDayHour) { tailDelta = tailDuration } else { if (currentDate.getHours() >= startDayHour && currentDate.getHours() >= endDayHour) { tailDelta = tailDuration - (gapBeforeAppt - endDayHour * toMs("hour")) } else { if (!fullDays) { result = fullInterval } } } } result += tailDelta } return result }, _getWeekendsCount: function() { return 0 }, getAllDayContainer: function() { return null }, getTimePanelWidth: function() { return 0 }, getPositionShift: function(timeShift) { var positionShift = this.callBase(timeShift); var left = this.getCellWidth() * timeShift; if (this.option("rtlEnabled")) { left *= -1 } left += positionShift.left; return { top: 0, left: left, cellPosition: left } }, getVisibleBounds: function() { var isRtl = this.option("rtlEnabled"); var result = {}; var $scrollable = this.getScrollable().$element(); var cellWidth = this.getCellWidth(); var scrollableOffset = isRtl ? this.getScrollableOuterWidth() - this.getScrollableScrollLeft() : this.getScrollableScrollLeft(); var scrolledCellCount = scrollableOffset / cellWidth; var visibleCellCount = $scrollable.width() / cellWidth; var totalCellCount = isRtl ? scrolledCellCount - visibleCellCount : scrolledCellCount + visibleCellCount; var leftDate = this._getDateByIndex(scrolledCellCount); var rightDate = this._getDateByIndex(totalCellCount); if (isRtl) { leftDate = this._getDateByIndex(totalCellCount); rightDate = this._getDateByIndex(scrolledCellCount) } result.left = { hours: leftDate.getHours(), minutes: leftDate.getMinutes() >= 30 ? 30 : 0, date: dateUtils.trimTime(leftDate) }; result.right = { hours: rightDate.getHours(), minutes: rightDate.getMinutes() >= 30 ? 30 : 0, date: dateUtils.trimTime(rightDate) }; return result }, needUpdateScrollPosition: function(hours, minutes, bounds, date) { var isUpdateNeeded = false; isUpdateNeeded = this._dateWithinBounds(bounds, date); if (hours < bounds.left.hours || hours > bounds.right.hours) { isUpdateNeeded = true } if (hours === bounds.left.hours && minutes < bounds.left.minutes) { isUpdateNeeded = true } if (hours === bounds.right.hours && minutes > bounds.right.minutes) { isUpdateNeeded = true } return isUpdateNeeded }, getIntervalDuration: function(allDay) { return this.getCellDuration() }, _dateWithinBounds: function(bounds, date) { var trimmedDate = dateUtils.trimTime(new Date(date)); var isUpdateNeeded = false; if (trimmedDate < bounds.left.date || trimmedDate > bounds.right.date) { isUpdateNeeded = true } return isUpdateNeeded }, _supportCompactDropDownAppointments: function() { return false }, getCellMinWidth: function() { return 0 }, getWorkSpaceLeftOffset: function() { return 0 }, scrollToTime: function(hours, minutes, date) { var coordinates = this._getScrollCoordinates(hours, minutes, date); var scrollable = this.getScrollable(); var offset = this.option("rtlEnabled") ? this.getScrollableContainer().get(0).getBoundingClientRect().width : 0; if (this.option("templatesRenderAsynchronously")) { setTimeout(function() { scrollable.scrollBy({ left: coordinates.left - scrollable.scrollLeft() - offset, top: 0 }) }) } else { scrollable.scrollBy({ left: coordinates.left - scrollable.scrollLeft() - offset, top: 0 }) } } }); registerComponent("dxSchedulerTimeline", SchedulerTimeline); module.exports = SchedulerTimeline }, /*!***********************************************************************************************************!*\ !*** ./artifacts/transpiled/ui/scheduler/rendering_strategies/ui.scheduler.appointments.strategy.base.js ***! \***********************************************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _uiSchedulerAppointmentsPositioningStrategy = __webpack_require__( /*! ./ui.scheduler.appointmentsPositioning.strategy.base */ 389); var _uiSchedulerAppointmentsPositioningStrategy2 = _interopRequireDefault(_uiSchedulerAppointmentsPositioningStrategy); var _uiSchedulerAppointmentsPositioningStrategy3 = __webpack_require__( /*! ./ui.scheduler.appointmentsPositioning.strategy.adaptive */ 719); var _uiSchedulerAppointmentsPositioningStrategy4 = _interopRequireDefault(_uiSchedulerAppointmentsPositioningStrategy3); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 0); var _ui = __webpack_require__( /*! ../../widget/ui.errors */ 17); var _ui2 = _interopRequireDefault(_ui); var _date = __webpack_require__( /*! ../../../core/utils/date */ 22); var _date2 = _interopRequireDefault(_date); var _type = __webpack_require__( /*! ../../../core/utils/type */ 1); var _type2 = _interopRequireDefault(_type); var _themes = __webpack_require__( /*! ../../themes */ 30); var _themes2 = _interopRequireDefault(_themes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true } Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) { _defineProperties(Constructor.prototype, protoProps) } if (staticProps) { _defineProperties(Constructor, staticProps) } Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor } var toMs = _date2.default.dateToMilliseconds; var APPOINTMENT_MIN_SIZE = 2; var COMPACT_APPOINTMENT_DEFAULT_WIDTH = 15; var APPOINTMENT_DEFAULT_HEIGHT = 20; var COMPACT_THEME_APPOINTMENT_DEFAULT_HEIGHT = 18; var DROP_DOWN_BUTTON_ADAPTIVE_SIZE = 28; var BaseRenderingStrategy = function() { function BaseRenderingStrategy(instance) { _classCallCheck(this, BaseRenderingStrategy); this.instance = instance; this._initPositioningStrategy() } _createClass(BaseRenderingStrategy, [{ key: "_initPositioningStrategy", value: function() { this._positioningStrategy = this.instance.fire("isAdaptive") ? new _uiSchedulerAppointmentsPositioningStrategy4.default(this) : new _uiSchedulerAppointmentsPositioningStrategy2.default(this) } }, { key: "getPositioningStrategy", value: function() { return this._positioningStrategy } }, { key: "getAppointmentMinSize", value: function() { return APPOINTMENT_MIN_SIZE } }, { key: "keepAppointmentSettings", value: function() { return false } }, { key: "getDeltaTime", value: function() {} }, { key: "getAppointmentGeometry", value: function(coordinates) { return coordinates } }, { key: "needCorrectAppointmentDates", value: function() { return true } }, { key: "getDirection", value: function() { return "horizontal" } }, { key: "createTaskPositionMap", value: function(items) { delete this._maxAppointmentCountPerCell; var length = items && items.length; if (!length) { return } this._defaultWidth = this.instance._cellWidth; this._defaultHeight = this.instance._cellHeight; this._allDayHeight = this.instance._allDayCellHeight; var map = []; for (var i = 0; i < length; i++) { var coordinates = this._getItemPosition(items[i]); if (this._isRtl()) { coordinates = this._correctRtlCoordinates(coordinates) } map.push(coordinates) } var positionArray = this._getSortedPositions(map); var resultPositions = this._getResultPositions(positionArray); return this._getExtendedPositionMap(map, resultPositions) } }, { key: "_getDeltaWidth", value: function(args, initialSize) { var intervalWidth = this.instance.fire("getResizableStep") || this.getAppointmentMinSize(); var initialWidth = initialSize.width; return Math.round((args.width - initialWidth) / intervalWidth) } }, { key: "_correctRtlCoordinates", value: function(coordinates) { var width = coordinates[0].width || this._getAppointmentMaxWidth(); coordinates.forEach(function(coordinate) { if (!coordinate.appointmentReduced) { coordinate.left -= width } }); return coordinates } }, { key: "_getAppointmentMaxWidth", value: function() { return this.getDefaultCellWidth() } }, { key: "_getItemPosition", value: function(item) { var position = this._getAppointmentCoordinates(item); var allDay = this.isAllDay(item); var result = []; var startDate = new Date(this.instance.fire("getField", "startDate", item)); var isRecurring = !!this.instance.fire("getField", "recurrenceRule", item); for (var j = 0; j < position.length; j++) { var height = this.calculateAppointmentHeight(item, position[j], isRecurring); var width = this.calculateAppointmentWidth(item, position[j], isRecurring); var resultWidth = width; var appointmentReduced = null; var multiWeekAppointmentParts = []; var initialRowIndex = position[j].rowIndex; var initialCellIndex = position[j].cellIndex; if (this._needVerifyItemSize() || allDay) { var currentMaxAllowedPosition = position[j].hMax; if (this.isAppointmentGreaterThan(currentMaxAllowedPosition, { left: position[j].left, width: width })) { appointmentReduced = "head"; initialRowIndex = position[j].rowIndex; initialCellIndex = position[j].cellIndex; resultWidth = this._reduceMultiWeekAppointment(width, { left: position[j].left, right: currentMaxAllowedPosition }); multiWeekAppointmentParts = this._getAppointmentParts({ sourceAppointmentWidth: width, reducedWidth: resultWidth, height: height }, position[j], startDate); if (this._isRtl()) { position[j].left = currentMaxAllowedPosition } } }(0, _extend.extend)(position[j], { height: height, width: resultWidth, allDay: allDay, rowIndex: initialRowIndex, cellIndex: initialCellIndex, appointmentReduced: appointmentReduced }); result = this._getAppointmentPartsPosition(multiWeekAppointmentParts, position[j], result) } return result } }, { key: "_getAppointmentPartsPosition", value: function(appointmentParts, position, result) { if (appointmentParts.length) { appointmentParts.unshift(position); result = result.concat(appointmentParts) } else { result.push(position) } return result } }, { key: "_getAppointmentCoordinates", value: function(itemData) { var coordinates = [{ top: 0, left: 0 }]; this.instance.fire("needCoordinates", { startDate: this.startDate(itemData), originalStartDate: this.startDate(itemData, true), appointmentData: itemData, callback: function(value) { coordinates = value } }); return coordinates } }, { key: "_isRtl", value: function() { return this.instance.option("rtlEnabled") } }, { key: "_getAppointmentParts", value: function() { return [] } }, { key: "_getCompactAppointmentParts", value: function(appointmentWidth) { var cellWidth = this.getDefaultCellWidth() || this.getAppointmentMinSize(); return Math.round(appointmentWidth / cellWidth) } }, { key: "_reduceMultiWeekAppointment", value: function(sourceAppointmentWidth, bound) { if (this._isRtl()) { sourceAppointmentWidth = Math.floor(bound.left - bound.right) } else { sourceAppointmentWidth = bound.right - Math.floor(bound.left) } return sourceAppointmentWidth } }, { key: "calculateAppointmentHeight", value: function() { return 0 } }, { key: "calculateAppointmentWidth", value: function() { return 0 } }, { key: "isAppointmentGreaterThan", value: function(etalon, comparisonParameters) { var result = comparisonParameters.left + comparisonParameters.width - etalon; if (this._isRtl()) { result = etalon + comparisonParameters.width - comparisonParameters.left } return result > this.getDefaultCellWidth() / 2 } }, { key: "isAllDay", value: function() { return false } }, { key: "cropAppointmentWidth", value: function(width, cellWidth) { if (this.instance.fire("isGroupedByDate")) { width = cellWidth } return width } }, { key: "_getSortedPositions", value: function(positionList) { var _this = this; var result = []; var round = function(value) { return Math.round(100 * value) / 100 }; var createItem = function(rowIndex, cellIndex, top, left, bottom, right, position, allDay) { return { i: rowIndex, j: cellIndex, top: round(top), left: round(left), bottom: round(bottom), right: round(right), cellPosition: position, allDay: allDay } }; for (var rowIndex = 0, rowCount = positionList.length; rowIndex < rowCount; rowIndex++) { for (var cellIndex = 0, cellCount = positionList[rowIndex].length; cellIndex < cellCount; cellIndex++) { var _positionList$rowInde = positionList[rowIndex][cellIndex], top = _positionList$rowInde.top, left = _positionList$rowInde.left, height = _positionList$rowInde.height, width = _positionList$rowInde.width, cellPosition = _positionList$rowInde.cellPosition, allDay = _positionList$rowInde.allDay; result.push(createItem(rowIndex, cellIndex, top, left, top + height, left + width, cellPosition, allDay)) } } return result.sort(function(a, b) { return _this._sortCondition(a, b) }) } }, { key: "_sortCondition", value: function() {} }, { key: "_getConditions", value: function(a, b) { var isSomeEdge = this._isSomeEdge(a, b); return { columnCondition: isSomeEdge || this._normalizeCondition(a.left, b.left), rowCondition: isSomeEdge || this._normalizeCondition(a.top, b.top), cellPositionCondition: isSomeEdge || this._normalizeCondition(a.cellPosition, b.cellPosition) } } }, { key: "_rowCondition", value: function(a, b) { var conditions = this._getConditions(a, b); return conditions.columnCondition || conditions.rowCondition } }, { key: "_columnCondition", value: function(a, b) { var conditions = this._getConditions(a, b); return conditions.rowCondition || conditions.columnCondition } }, { key: "_isSomeEdge", value: function(a, b) { return a.i === b.i && a.j === b.j } }, { key: "_normalizeCondition", value: function(first, second) { var result = first - second; return Math.abs(result) > 1 ? result : 0 } }, { key: "_isItemsCross", value: function(item, currentItem, orientation) { var side_1 = Math.floor(item[orientation[0]]); var side_2 = Math.floor(item[orientation[1]]); return item[orientation[2]] === currentItem[orientation[2]] && (side_1 <= currentItem[orientation[0]] && side_2 > currentItem[orientation[0]] || side_1 < currentItem[orientation[1]] && side_2 >= currentItem[orientation[1]] || side_1 === currentItem[orientation[0]] && side_2 === currentItem[orientation[1]]) } }, { key: "_getOrientation", value: function() { return ["top", "bottom", "left"] } }, { key: "_getResultPositions", value: function(sortedArray) { var _this2 = this; var result = []; var i; var sortedIndex = 0; var currentItem; var indexes; var itemIndex; var maxIndexInStack = 0; var stack = {}; var orientation = this._getOrientation(); var findFreeIndex = function findFreeIndex(indexes, index) { var isFind = indexes.some(function(item) { return item === index }); if (isFind) { return findFreeIndex(indexes, ++index) } else { return index } }; var startNewStack = function(currentItem) { stack.items = [createItem(currentItem)]; stack.left = currentItem.left; stack.right = currentItem.right; stack.top = currentItem.top; stack.bottom = currentItem.bottom }; var createItem = function(currentItem, index) { var currentIndex = index || 0; return { index: currentIndex, i: currentItem.i, j: currentItem.j, left: currentItem.left, right: currentItem.right, top: currentItem.top, bottom: currentItem.bottom, sortedIndex: _this2._skipSortedIndex(currentIndex) ? null : sortedIndex++ } }; var pushItemsInResult = function(items) { items.forEach(function(item) { result.push({ index: item.index, count: maxIndexInStack + 1, i: item.i, j: item.j, sortedIndex: item.sortedIndex }) }) }; for (i = 0; i < sortedArray.length; i++) { currentItem = sortedArray[i]; indexes = []; if (!stack.items) { startNewStack(currentItem) } else { if (this._isItemsCross(stack, currentItem, orientation)) { stack.items.forEach(function(item, index) { if (_this2._isItemsCross(item, currentItem, orientation)) { indexes.push(item.index) } }); itemIndex = indexes.length ? findFreeIndex(indexes, 0) : 0; stack.items.push(createItem(currentItem, itemIndex)); maxIndexInStack = Math.max(itemIndex, maxIndexInStack); stack.left = Math.min(stack.left, currentItem.left); stack.right = Math.max(stack.right, currentItem.right); stack.top = Math.min(stack.top, currentItem.top); stack.bottom = Math.max(stack.bottom, currentItem.bottom) } else { pushItemsInResult(stack.items); stack = {}; startNewStack(currentItem); maxIndexInStack = 0 } } } if (stack.items) { pushItemsInResult(stack.items) } return result.sort(function(a, b) { var columnCondition = a.j - b.j; var rowCondition = a.i - b.i; return rowCondition ? rowCondition : columnCondition }) } }, { key: "_skipSortedIndex", value: function(index) { return this.instance.fire("getMaxAppointmentsPerCell") && index > this._getMaxAppointmentCountPerCell() - 1 } }, { key: "_findIndexByKey", value: function(arr, iKey, jKey, iValue, jValue) { var result = 0; for (var i = 0, len = arr.length; i < len; i++) { if (arr[i][iKey] === iValue && arr[i][jKey] === jValue) { result = i; break } } return result } }, { key: "_getExtendedPositionMap", value: function(map, positions) { var positionCounter = 0; var result = []; for (var i = 0, mapLength = map.length; i < mapLength; i++) { var resultString = []; for (var j = 0, itemLength = map[i].length; j < itemLength; j++) { map[i][j].index = positions[positionCounter].index; map[i][j].sortedIndex = positions[positionCounter].sortedIndex; map[i][j].count = positions[positionCounter++].count; resultString.push(map[i][j]); this._checkLongCompactAppointment(map[i][j], resultString) } result.push(resultString) } return result } }, { key: "_checkLongCompactAppointment", value: function() {} }, { key: "_splitLongCompactAppointment", value: function(item, result) { var appointmentCountPerCell = this._getMaxAppointmentCountPerCellByType(item.allDay); var compactCount = 0; if (void 0 !== appointmentCountPerCell && item.index > appointmentCountPerCell - 1) { item.isCompact = true; compactCount = this._getCompactAppointmentParts(item.width); for (var k = 1; k < compactCount; k++) { var compactPart = (0, _extend.extend)(true, {}, item); compactPart.left = this._getCompactLeftCoordinate(item.left, k); compactPart.cellIndex = compactPart.cellIndex + k; compactPart.sortedIndex = null; result.push(compactPart) } } return result } }, { key: "startDate", value: function startDate(appointment, skipNormalize, position) { var startDate = position && position.startDate; var rangeStartDate = this.instance._getStartDate(appointment, skipNormalize); var text = this.instance.fire("getField", "text", appointment); if (startDate && rangeStartDate > startDate || !startDate) { startDate = rangeStartDate } if (isNaN(startDate.getTime())) { throw _ui2.default.Error("E1032", text) } return startDate } }, { key: "endDate", value: function endDate(appointment, position, isRecurring) { var ignoreViewDates = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : false; var endDate = this.instance._getEndDate(appointment, ignoreViewDates); var realStartDate = this.startDate(appointment, true); var viewStartDate = this.startDate(appointment, false, position); if (viewStartDate.getTime() > endDate.getTime() || isRecurring) { var recurrencePartStartDate = position ? position.initialStartDate || position.startDate : realStartDate; var recurrencePartCroppedByViewStartDate = position ? position.startDate : realStartDate; var fullDuration = this._adjustDurationByDaylightDiff(endDate.getTime() - realStartDate.getTime(), realStartDate, endDate); endDate = new Date(viewStartDate.getTime() >= recurrencePartStartDate.getTime() ? recurrencePartStartDate.getTime() : viewStartDate.getTime()); if (isRecurring) { endDate = new Date(endDate.getTime() + fullDuration) } if (!_date2.default.sameDate(realStartDate, endDate) && recurrencePartCroppedByViewStartDate.getTime() < viewStartDate.getTime()) { var headDuration = _date2.default.trimTime(endDate).getTime() - recurrencePartCroppedByViewStartDate.getTime(); var tailDuration = fullDuration - headDuration || fullDuration; endDate = new Date(_date2.default.trimTime(viewStartDate).getTime() + tailDuration) } } if (!this.isAllDay(appointment)) { var viewEndDate = _date2.default.roundToHour(this.instance.fire("getEndViewDate")); if (endDate > viewEndDate) { endDate = viewEndDate } var currentViewEndTime = new Date(new Date(endDate).setHours(this.instance.option("endDayHour"), 0, 0)); if (endDate.getTime() > currentViewEndTime.getTime()) { endDate = currentViewEndTime } } return endDate } }, { key: "_adjustDurationByDaylightDiff", value: function(duration, startDate, endDate) { var daylightDiff = this.instance.fire("getDaylightOffset", startDate, endDate); return this._needAdjustDuration(daylightDiff) ? this._calculateDurationByDaylightDiff(duration, daylightDiff) : duration } }, { key: "_needAdjustDuration", value: function(diff) { return 0 !== diff } }, { key: "_calculateDurationByDaylightDiff", value: function(duration, diff) { return duration + diff * toMs("minute") } }, { key: "_getAppointmentDurationInMs", value: function(startDate, endDate, allDay) { var result; this.instance.fire("getAppointmentDurationInMs", { startDate: startDate, endDate: endDate, allDay: allDay, callback: function(duration) { result = duration } }); return result } }, { key: "_getMaxNeighborAppointmentCount", value: function() { var overlappingMode = this.instance.fire("getMaxAppointmentsPerCell"); if (!overlappingMode) { var outerAppointmentWidth = this.getCompactAppointmentDefaultWidth() + this.getCompactAppointmentLeftOffset(); return Math.floor(this.getDropDownAppointmentWidth() / outerAppointmentWidth) } else { return 0 } } }, { key: "_markAppointmentAsVirtual", value: function(coordinates, isAllDay) { var countFullWidthAppointmentInCell = this._getMaxAppointmentCountPerCellByType(isAllDay); if (coordinates.count - countFullWidthAppointmentInCell > this._getMaxNeighborAppointmentCount()) { coordinates.virtual = { top: coordinates.top, left: coordinates.left, index: "tail" === coordinates.appointmentReduced ? coordinates.groupIndex + "-" + coordinates.rowIndex + "-" + coordinates.cellIndex : coordinates.groupIndex + "-" + coordinates.rowIndex + "-" + coordinates.cellIndex + "-tail", isAllDay: isAllDay } } } }, { key: "_getMaxAppointmentCountPerCellByType", value: function(isAllDay) { var appointmentCountPerCell = this._getMaxAppointmentCountPerCell(); if (_type2.default.isObject(appointmentCountPerCell)) { return isAllDay ? this._getMaxAppointmentCountPerCell().allDay : this._getMaxAppointmentCountPerCell().simple } else { return appointmentCountPerCell } } }, { key: "getDropDownAppointmentWidth", value: function(intervalCount, isAllDay) { return this.getPositioningStrategy().getDropDownAppointmentWidth(intervalCount, isAllDay) } }, { key: "getDropDownAppointmentHeight", value: function() { return this.getPositioningStrategy().getDropDownAppointmentHeight() } }, { key: "getDropDownButtonAdaptiveSize", value: function() { return DROP_DOWN_BUTTON_ADAPTIVE_SIZE } }, { key: "getDefaultCellWidth", value: function() { return this._defaultWidth } }, { key: "getDefaultCellHeight", value: function() { return this._defaultHeight } }, { key: "getDefaultAllDayCellHeight", value: function() { return this._allDayHeight } }, { key: "getCompactAppointmentDefaultWidth", value: function() { return COMPACT_APPOINTMENT_DEFAULT_WIDTH } }, { key: "getCompactAppointmentTopOffset", value: function(allDay) { return this.getPositioningStrategy().getCompactAppointmentTopOffset(allDay) } }, { key: "getCompactAppointmentLeftOffset", value: function() { return this.getPositioningStrategy().getCompactAppointmentLeftOffset() } }, { key: "getAppointmentDataCalculator", value: function() {} }, { key: "_customizeCoordinates", value: function(coordinates, height, appointmentCountPerCell, topOffset, isAllDay) { var index = coordinates.index; var appointmentHeight = height / appointmentCountPerCell; var appointmentTop = coordinates.top + index * appointmentHeight; var top = appointmentTop + topOffset; var width = coordinates.width; var left = coordinates.left; var compactAppointmentDefaultSize; var compactAppointmentLeftOffset; var compactAppointmentTopOffset = this.getCompactAppointmentTopOffset(isAllDay); if (coordinates.isCompact) { compactAppointmentDefaultSize = this.getCompactAppointmentDefaultWidth(); compactAppointmentLeftOffset = this.getCompactAppointmentLeftOffset(); top = coordinates.top + compactAppointmentTopOffset; left = coordinates.left + (index - appointmentCountPerCell) * (compactAppointmentDefaultSize + compactAppointmentLeftOffset) + compactAppointmentLeftOffset; if (this.instance.fire("isAdaptive")) { coordinates.top = top; coordinates.left = coordinates.left + compactAppointmentLeftOffset } appointmentHeight = compactAppointmentDefaultSize; width = compactAppointmentDefaultSize; this._markAppointmentAsVirtual(coordinates, isAllDay) } return { height: appointmentHeight, width: width, top: top, left: left, empty: this._isAppointmentEmpty(height, width) } } }, { key: "_isAppointmentEmpty", value: function(height, width) { return height < this._getAppointmentMinHeight() || width < this._getAppointmentMinWidth() } }, { key: "_calculateGeometryConfig", value: function(coordinates) { var overlappingMode = this.instance.fire("getMaxAppointmentsPerCell"); var offsets = this._getOffsets(); var appointmentDefaultOffset = this._getAppointmentDefaultOffset(); var appointmentCountPerCell = this._getAppointmentCount(overlappingMode, coordinates); var ratio = this._getDefaultRatio(coordinates, appointmentCountPerCell); var maxHeight = this._getMaxHeight(); if (!(0, _type.isNumeric)(appointmentCountPerCell)) { appointmentCountPerCell = coordinates.count; ratio = (maxHeight - offsets.unlimited) / maxHeight } var topOffset = (1 - ratio) * maxHeight; if ("auto" === overlappingMode || (0, _type.isNumeric)(overlappingMode)) { ratio = 1; maxHeight -= appointmentDefaultOffset; topOffset = appointmentDefaultOffset } return { height: ratio * maxHeight, appointmentCountPerCell: appointmentCountPerCell, offset: topOffset } } }, { key: "_getAppointmentCount", value: function() {} }, { key: "_getDefaultRatio", value: function() {} }, { key: "_getOffsets", value: function() {} }, { key: "_getMaxHeight", value: function() {} }, { key: "_needVerifyItemSize", value: function() { return false } }, { key: "needSeparateAppointment", value: function(allDay) { return this.instance.fire("isGroupedByDate") && allDay } }, { key: "_getMaxAppointmentCountPerCell", value: function() { if (!this._maxAppointmentCountPerCell) { var overlappingMode = this.instance.fire("getMaxAppointmentsPerCell"); var appointmentCountPerCell; if (!overlappingMode) { appointmentCountPerCell = 2 } if ((0, _type.isNumeric)(overlappingMode)) { appointmentCountPerCell = overlappingMode } if ("auto" === overlappingMode) { appointmentCountPerCell = this._getDynamicAppointmentCountPerCell() } if ("unlimited" === overlappingMode) { appointmentCountPerCell = void 0 } this._maxAppointmentCountPerCell = appointmentCountPerCell } return this._maxAppointmentCountPerCell } }, { key: "_getDynamicAppointmentCountPerCell", value: function() { return this.getPositioningStrategy().getDynamicAppointmentCountPerCell() } }, { key: "hasAllDayAppointments", value: function() { return false } }, { key: "_isCompactTheme", value: function() { return "compact" === (_themes2.default.current() || "").split(".").pop() } }, { key: "_getAppointmentDefaultOffset", value: function() { return this.getPositioningStrategy().getAppointmentDefaultOffset() } }, { key: "_getAppointmentDefaultHeight", value: function() { return this._getAppointmentHeightByTheme() } }, { key: "_getAppointmentMinHeight", value: function() { return this._getAppointmentDefaultHeight() } }, { key: "_getAppointmentHeightByTheme", value: function() { return this._isCompactTheme() ? COMPACT_THEME_APPOINTMENT_DEFAULT_HEIGHT : APPOINTMENT_DEFAULT_HEIGHT } }, { key: "_getAppointmentDefaultWidth", value: function() { return this.getPositioningStrategy()._getAppointmentDefaultWidth() } }, { key: "_getAppointmentMinWidth", value: function() { return this._getAppointmentDefaultWidth() } }, { key: "_needVerticalGroupBounds", value: function() { return false } }, { key: "_needHorizontalGroupBounds", value: function() { return false } }]); return BaseRenderingStrategy }(); module.exports = BaseRenderingStrategy }, /*!**********************************************************!*\ !*** ./artifacts/transpiled/ui/diagram/diagram.panel.js ***! \**********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _ui = __webpack_require__( /*! ../widget/ui.widget */ 18); var _ui2 = _interopRequireDefault(_ui); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _utils = __webpack_require__( /*! ../../events/utils */ 8); var _utils2 = _interopRequireDefault(_utils); var _pointer = __webpack_require__( /*! ../../events/pointer */ 23); var _pointer2 = _interopRequireDefault(_pointer); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true } Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) { _defineProperties(Constructor.prototype, protoProps) } if (staticProps) { _defineProperties(Constructor, staticProps) } Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor } function _get() { if ("undefined" !== typeof Reflect && Reflect.get) { _get = Reflect.get.bind() } else { _get = function(target, property, receiver) { var base = _superPropBase(target, property); if (!base) { return } var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver) } return desc.value } } return _get.apply(this, arguments) } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (null === object) { break } } return object } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function") } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) { _setPrototypeOf(subClass, superClass) } } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, p) { o.__proto__ = p; return o }; return _setPrototypeOf(o, p) } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function() { var result, Super = _getPrototypeOf(Derived); if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget) } else { result = Super.apply(this, arguments) } return _possibleConstructorReturn(this, result) } } function _possibleConstructorReturn(self, call) { if (call && ("object" === _typeof(call) || "function" === typeof call)) { return call } else { if (void 0 !== call) { throw new TypeError("Derived constructors may only return object or undefined") } } return _assertThisInitialized(self) } function _assertThisInitialized(self) { if (void 0 === self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return self } function _isNativeReflectConstruct() { if ("undefined" === typeof Reflect || !Reflect.construct) { return false } if (Reflect.construct.sham) { return false } if ("function" === typeof Proxy) { return true } try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true } catch (e) { return false } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(o) { return o.__proto__ || Object.getPrototypeOf(o) }; return _getPrototypeOf(o) } var POINTERUP_EVENT_NAME = _utils2.default.addNamespace(_pointer2.default.up, "dxDiagramPanel"); var PREVENT_REFOCUS_SELECTOR = ".dx-textbox"; var DiagramPanel = function(_Widget) { _inherits(DiagramPanel, _Widget); var _super = _createSuper(DiagramPanel); function DiagramPanel() { _classCallCheck(this, DiagramPanel); return _super.apply(this, arguments) } _createClass(DiagramPanel, [{ key: "_init", value: function() { _get(_getPrototypeOf(DiagramPanel.prototype), "_init", this).call(this); this._createOnPointerUpAction() } }, { key: "_render", value: function() { _get(_getPrototypeOf(DiagramPanel.prototype), "_render", this).call(this); this._attachPointerUpEvent() } }, { key: "_attachPointerUpEvent", value: function() { var _this = this; _events_engine2.default.off(this.$element(), POINTERUP_EVENT_NAME); _events_engine2.default.on(this.$element(), POINTERUP_EVENT_NAME, function(e) { if (!(0, _renderer2.default)(e.target).closest(PREVENT_REFOCUS_SELECTOR).length) { _this._onPointerUpAction() } }) } }, { key: "_createOnPointerUpAction", value: function() { this._onPointerUpAction = this._createActionByOption("onPointerUp") } }, { key: "_optionChanged", value: function(args) { switch (args.name) { case "onPointerUp": this._createOnPointerUpAction(); break; default: _get(_getPrototypeOf(DiagramPanel.prototype), "_optionChanged", this).call(this, args) } } }]); return DiagramPanel }(_ui2.default); module.exports = DiagramPanel }, /*!****************************************************************!*\ !*** ./artifacts/transpiled/ui/diagram/ui.diagram.commands.js ***! \****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _diagram_importer = __webpack_require__( /*! ./diagram_importer */ 200); var _file_saver = __webpack_require__( /*! ../../exporter/file_saver */ 207); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); var SEPARATOR = { widget: "separator" }; var CSS_CLASSES = { SMALL_SELECT: "dx-diagram-select-sm", BUTTON_SELECT: "dx-diagram-select-b", BUTTON_COLOR: "dx-diagram-color-b" }; var DiagramCommands = { getToolbar: function() { var _this = this; var _getDiagram = (0, _diagram_importer.getDiagram)(), DiagramCommand = _getDiagram.DiagramCommand; return [{ command: DiagramCommand.Undo, hint: "Undo", icon: "undo", text: "Undo" }, { command: DiagramCommand.Redo, hint: "Redo", icon: "redo", text: "Redo" }, SEPARATOR, { command: DiagramCommand.FontName, beginGroup: true, widget: "dxSelectBox", items: ["Arial", "Arial Black", "Helvetica", "Times New Roman", "Courier New", "Courier", "Verdana", "Georgia", "Comic Sans MS", "Trebuchet MS"] }, { command: DiagramCommand.FontSize, widget: "dxSelectBox", items: ["8pt", "9pt", "10pt", "11pt", "12pt", "14pt", "16pt", "18pt", "20pt", "22pt", "24pt", "26pt", "28pt", "36pt", "48pt", "72pt"], cssClass: CSS_CLASSES.SMALL_SELECT }, SEPARATOR, { command: DiagramCommand.Bold, hint: "Bold", text: "Bold", icon: "bold" }, { command: DiagramCommand.Italic, hint: "Italic", text: "Italic", icon: "italic" }, { command: DiagramCommand.Underline, hint: "Underline", text: "Underline", icon: "underline" }, SEPARATOR, { command: DiagramCommand.FontColor, text: "Text Color", widget: "dxColorBox", icon: "dx-icon dx-icon-color", cssClass: CSS_CLASSES.BUTTON_COLOR }, { command: DiagramCommand.StrokeColor, text: "Line Color", widget: "dxColorBox", icon: "dx-icon dx-icon-background", cssClass: CSS_CLASSES.BUTTON_COLOR }, { command: DiagramCommand.FillColor, text: "Fill Color", widget: "dxColorBox", icon: "dx-diagram-i dx-diagram-i-button-fill", cssClass: CSS_CLASSES.BUTTON_COLOR }, SEPARATOR, { command: DiagramCommand.TextLeftAlign, hint: "Align Left", text: "Align Left", icon: "alignleft", beginGroup: true }, { command: DiagramCommand.TextCenterAlign, hint: "Align Center", text: "Center", icon: "aligncenter" }, { command: DiagramCommand.TextRightAlign, hint: "Align Right", text: "Align Right", icon: "alignright" }, SEPARATOR, { command: DiagramCommand.ConnectorLineOption, widget: "dxSelectBox", hint: "Line Type", items: [{ value: 0, icon: "dx-diagram-i-connector-straight dx-diagram-i", hint: "Straight" }, { value: 1, icon: "dx-diagram-i-connector-orthogonal dx-diagram-i", hint: "Orthogonal" }], displayExpr: "name", valueExpr: "value", cssClass: CSS_CLASSES.BUTTON_SELECT }, { command: DiagramCommand.ConnectorStartLineEnding, widget: "dxSelectBox", items: [{ value: 0, icon: "dx-diagram-i-connector-begin-none dx-diagram-i", hint: "None" }, { value: 1, icon: "dx-diagram-i-connector-begin-arrow dx-diagram-i", hint: "Arrow" }], displayExpr: "name", valueExpr: "value", hint: "Line Start", cssClass: CSS_CLASSES.BUTTON_SELECT }, { command: DiagramCommand.ConnectorEndLineEnding, widget: "dxSelectBox", items: [{ value: 0, icon: "dx-diagram-i-connector-end-none dx-diagram-i", hint: "None" }, { value: 1, icon: "dx-diagram-i-connector-end-arrow dx-diagram-i", hint: "Arrow" }], displayExpr: "name", valueExpr: "value", hint: "Line End", cssClass: CSS_CLASSES.BUTTON_SELECT }, SEPARATOR, { widget: "dxButton", icon: "export", text: "Export", items: [{ command: DiagramCommand.ExportSvg, text: "Export to SVG", getParameter: function(widget) { return function(dataURI) { return _this._exportTo(widget, dataURI, "SVG", "image/svg+xml") } } }, { command: DiagramCommand.ExportPng, text: "Export to PNG", getParameter: function(widget) { return function(dataURI) { return _this._exportTo(widget, dataURI, "PNG", "image/png") } } }, { command: DiagramCommand.ExportJpg, text: "Export to JPEG", getParameter: function(widget) { return function(dataURI) { return _this._exportTo(widget, dataURI, "JPEG", "image/jpeg") } } }] }, { widget: "dxButton", text: "Auto Layout", showText: "always", items: [{ text: "Tree", items: [{ command: DiagramCommand.AutoLayoutTreeVertical, text: "Vertical" }, { command: DiagramCommand.AutoLayoutTreeHorizontal, text: "Horizontal" }] }, { text: "Layered", items: [{ command: DiagramCommand.AutoLayoutLayeredVertical, text: "Vertical" }, { command: DiagramCommand.AutoLayoutLayeredHorizontal, text: "Horizontal" }] }] }, { command: DiagramCommand.Fullscreen, hint: "Fullscreen", text: "Fullscreen", icon: "dx-diagram-i dx-diagram-i-button-fullscreen", cssClass: CSS_CLASSES.BUTTON_COLOR }] }, getOptions: function() { var _getDiagram2 = (0, _diagram_importer.getDiagram)(), DiagramCommand = _getDiagram2.DiagramCommand; return [{ command: DiagramCommand.Units, text: "Units", widget: "dxSelectBox" }, { command: DiagramCommand.PageSize, text: "Page Size", widget: "dxSelectBox", getValue: function(v) { return JSON.parse(v) }, setValue: function(v) { return JSON.stringify(v) } }, { command: DiagramCommand.PageLandscape, text: "Page Landscape", widget: "dxCheckBox" }, { command: DiagramCommand.PageColor, text: "Page Color", widget: "dxColorBox", beginGroup: true }, { command: DiagramCommand.ShowGrid, text: "Show Grid", widget: "dxCheckBox", beginGroup: true }, { command: DiagramCommand.SnapToGrid, text: "Snap to Grid", widget: "dxCheckBox" }, { command: DiagramCommand.GridSize, text: "Grid Size", widget: "dxSelectBox" }, { command: DiagramCommand.ZoomLevel, text: "Zoom Level", widget: "dxSelectBox", beginGroup: true }] }, getContextMenu: function() { var _getDiagram3 = (0, _diagram_importer.getDiagram)(), DiagramCommand = _getDiagram3.DiagramCommand; return [{ command: DiagramCommand.Cut, text: "Cut" }, { command: DiagramCommand.Copy, text: "Copy" }, { command: DiagramCommand.Paste, text: "Paste" }, { command: DiagramCommand.SelectAll, text: "Select All", beginGroup: true }, { command: DiagramCommand.Delete, text: "Delete", beginGroup: true }, { command: DiagramCommand.BringToFront, text: "Bring to Front", beginGroup: true }, { command: DiagramCommand.SendToBack, text: "Send to Back" }, { command: DiagramCommand.Lock, text: "Lock", beginGroup: true }, { command: DiagramCommand.Unlock, text: "Unlock" }] }, _exportTo: function(widget, dataURI, format, mimeString) { var window = (0, _window.getWindow)(); if (window && window.atob && (0, _type.isFunction)(window.Blob)) { var blob = this._getBlobByDataURI(window, dataURI, mimeString); var options = widget.option("export"); _file_saver.fileSaver.saveAs(options.fileName || "foo", format, blob, options.proxyURL) } }, _getBlobByDataURI: function(window, dataURI, mimeString) { var byteString = window.atob(dataURI.split(",")[1]); var arrayBuffer = new ArrayBuffer(byteString.length); var ia = new Uint8Array(arrayBuffer); for (var i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i) } var dataView = new DataView(arrayBuffer); return new window.Blob([dataView], { type: mimeString }) } }; module.exports = DiagramCommands }, /*!********************************************************!*\ !*** ./artifacts/transpiled/ui/diagram/diagram_bar.js ***! \********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _diagram_importer = __webpack_require__( /*! ./diagram_importer */ 200); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true } Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) { _defineProperties(Constructor.prototype, protoProps) } if (staticProps) { _defineProperties(Constructor, staticProps) } Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor } var DiagramBar = function() { function DiagramBar(owner) { _classCallCheck(this, DiagramBar); var _getDiagram = (0, _diagram_importer.getDiagram)(), EventDispatcher = _getDiagram.EventDispatcher; this.onChanged = new EventDispatcher; this._owner = owner } _createClass(DiagramBar, [{ key: "raiseBarCommandExecuted", value: function(key, parameter) { this.onChanged.raise("NotifyBarCommandExecuted", parseInt(key), parameter) } }, { key: "getCommandKeys", value: function() { throw "Not Implemented" } }, { key: "setItemValue", value: function(key, value) {} }, { key: "setItemEnabled", value: function(key, enabled) {} }, { key: "setItemVisible", value: function(key, enabled) {} }, { key: "setEnabled", value: function(enabled) {} }, { key: "setItemSubItems", value: function(key, items) {} }, { key: "isVisible", value: function() { return true } }]); return DiagramBar }(); module.exports = DiagramBar }, /*!********************************************!*\ !*** ./artifacts/transpiled/viz/export.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./core/export */ 93) }, /*!*****************************************************************!*\ !*** ./artifacts/transpiled/viz/chart_components/base_chart.js ***! \*****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4); var noop = commonUtils.noop; var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var iteratorModule = __webpack_require__( /*! ../../core/utils/iterator */ 3); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray; var eventUtils = __webpack_require__( /*! ../../events/utils */ 8); var BaseWidget = __webpack_require__( /*! ../core/base_widget */ 96); var coreDataUtils = __webpack_require__( /*! ../../core/utils/data */ 20); var legendModule = __webpack_require__( /*! ../components/legend */ 201); var dataValidatorModule = __webpack_require__( /*! ../components/data_validator */ 243); var seriesModule = __webpack_require__( /*! ../series/base_series */ 245); var chartThemeManagerModule = __webpack_require__( /*! ../components/chart_theme_manager */ 401); var LayoutManagerModule = __webpack_require__( /*! ./layout_manager */ 402); var trackerModule = __webpack_require__( /*! ./tracker */ 777); var REINIT_REFRESH_ACTION = "_reinit"; var REINIT_DATA_SOURCE_REFRESH_ACTION = "_updateDataSource"; var DATA_INIT_REFRESH_ACTION = "_dataInit"; var FORCE_RENDER_REFRESH_ACTION = "_forceRender"; var RESIZE_REFRESH_ACTION = "_resize"; var ACTIONS_BY_PRIORITY = [REINIT_REFRESH_ACTION, REINIT_DATA_SOURCE_REFRESH_ACTION, DATA_INIT_REFRESH_ACTION, FORCE_RENDER_REFRESH_ACTION, RESIZE_REFRESH_ACTION]; var vizUtils = __webpack_require__( /*! ../core/utils */ 10); var _map = vizUtils.map; var _each = iteratorModule.each; var _reverseEach = iteratorModule.reverseEach; var _extend = extend; var _isArray = Array.isArray; var _isDefined = typeUtils.isDefined; var _setCanvasValues = vizUtils.setCanvasValues; var DEFAULT_OPACITY = .3; var REFRESH_SERIES_DATA_INIT_ACTION_OPTIONS = ["series", "commonSeriesSettings", "dataPrepareSettings", "seriesSelectionMode", "pointSelectionMode", "synchronizeMultiAxes", "resolveLabelsOverlapping"]; var REFRESH_SERIES_FAMILIES_ACTION_OPTIONS = ["equalBarWidth", "minBubbleSize", "maxBubbleSize", "barWidth", "barGroupPadding", "barGroupWidth", "negativesAsZeroes", "negativesAsZeros"]; var FORCE_RENDER_REFRESH_ACTION_OPTIONS = ["adaptiveLayout", "crosshair", "resolveLabelOverlapping", "adjustOnZoom", "zoomingMode", "scrollingMode", "stickyHovering"]; var FONT = "font"; function checkHeightRollingStock(rollingStocks, stubCanvas) { var canvasSize = stubCanvas.end - stubCanvas.start; var size = 0; rollingStocks.forEach(function(rollingStock) { size += rollingStock.getBoundingRect().width }); while (canvasSize < size) { size -= findAndKillSmallValue(rollingStocks) } } function findAndKillSmallValue(rollingStocks) { var smallestObject = rollingStocks.reduce(function(prev, rollingStock, index) { if (!rollingStock) { return prev } var value = rollingStock.value(); return value < prev.value ? { value: value, rollingStock: rollingStock, index: index } : prev }, { rollingStock: void 0, value: 1 / 0, index: void 0 }); smallestObject.rollingStock.getLabels()[0].draw(false); var width = smallestObject.rollingStock.getBoundingRect().width; rollingStocks[smallestObject.index] = null; return width } function checkStackOverlap(rollingStocks) { var i; var j; var iLength; var jLength; var overlap = false; for (i = 0, iLength = rollingStocks.length - 1; i < iLength; i++) { for (j = i + 1, jLength = rollingStocks.length; j < jLength; j++) { if (i !== j && checkStacksOverlapping(rollingStocks[i], rollingStocks[j], true)) { overlap = true; break } } if (overlap) { break } } return overlap } function resolveLabelOverlappingInOneDirection(points, canvas, isRotated, shiftFunction) { var customSorting = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : function() { return 0 }; var rollingStocks = []; var stubCanvas = { start: isRotated ? canvas.left : canvas.top, end: isRotated ? canvas.width - canvas.right : canvas.height - canvas.bottom }; var hasStackedSeries = false; points.forEach(function(p) { if (!p) { return } hasStackedSeries = hasStackedSeries || p.series.isStackedSeries() || p.series.isFullStackedSeries(); p.getLabels().forEach(function(l) { l.isVisible() && rollingStocks.push(new RollingStock(l, isRotated, shiftFunction)) }) }); if (hasStackedSeries) { !isRotated && rollingStocks.reverse() } else { var rollingStocksTmp = rollingStocks.slice(); rollingStocks.sort(function(a, b) { return customSorting(a, b) || a.getInitialPosition() - b.getInitialPosition() || rollingStocksTmp.indexOf(a) - rollingStocksTmp.indexOf(b) }) } if (!checkStackOverlap(rollingStocks)) { return false } checkHeightRollingStock(rollingStocks, stubCanvas); prepareOverlapStacks(rollingStocks); rollingStocks.reverse(); moveRollingStock(rollingStocks, stubCanvas); return true } function checkStacksOverlapping(firstRolling, secondRolling, inTwoSides) { if (!firstRolling || !secondRolling) { return } var firstRect = firstRolling.getBoundingRect(); var secondRect = secondRolling.getBoundingRect(); var oppositeOverlapping = inTwoSides ? firstRect.oppositeStart <= secondRect.oppositeStart && firstRect.oppositeEnd > secondRect.oppositeStart || secondRect.oppositeStart <= firstRect.oppositeStart && secondRect.oppositeEnd > firstRect.oppositeStart : true; return firstRect.end > secondRect.start && oppositeOverlapping } function prepareOverlapStacks(rollingStocks) { var i; var currentRollingStock; var root; for (i = 0; i < rollingStocks.length - 1; i++) { currentRollingStock = root || rollingStocks[i]; if (checkStacksOverlapping(currentRollingStock, rollingStocks[i + 1])) { currentRollingStock.toChain(rollingStocks[i + 1]); rollingStocks[i + 1] = null; root = currentRollingStock } else { root = rollingStocks[i + 1] || currentRollingStock } } } function moveRollingStock(rollingStocks, canvas) { var i; var j; var currentRollingStock; var nextRollingStock; var currentBBox; var nextBBox; for (i = 0; i < rollingStocks.length; i++) { currentRollingStock = rollingStocks[i]; if (rollingStocksIsOut(currentRollingStock, canvas)) { currentBBox = currentRollingStock.getBoundingRect(); for (j = i + 1; j < rollingStocks.length; j++) { nextRollingStock = rollingStocks[j]; if (!nextRollingStock) { continue } nextBBox = nextRollingStock.getBoundingRect(); if (nextBBox.end > currentBBox.start - (currentBBox.end - canvas.end)) { nextRollingStock.toChain(currentRollingStock); rollingStocks[i] = currentRollingStock = null; break } } } currentRollingStock && currentRollingStock.setRollingStockInCanvas(canvas) } } function rollingStocksIsOut(rollingStock, canvas) { return rollingStock && rollingStock.getBoundingRect().end > canvas.end } function RollingStock(label, isRotated, shiftFunction) { var bBox = label.getBoundingRect(); var x = bBox.x; var y = bBox.y; var endX = bBox.x + bBox.width; var endY = bBox.y + bBox.height; this.labels = [label]; this.shiftFunction = shiftFunction; this._bBox = { start: isRotated ? x : y, width: isRotated ? bBox.width : bBox.height, end: isRotated ? endX : endY, oppositeStart: isRotated ? y : x, oppositeEnd: isRotated ? endY : endX }; this._initialPosition = isRotated ? bBox.x : bBox.y; return this } RollingStock.prototype = { toChain: function(nextRollingStock) { var nextRollingStockBBox = nextRollingStock.getBoundingRect(); nextRollingStock.shift(nextRollingStockBBox.start - this._bBox.end); this._changeBoxWidth(nextRollingStockBBox.width); this.labels = this.labels.concat(nextRollingStock.labels) }, getBoundingRect: function() { return this._bBox }, shift: function(shiftLength) { var shiftFunction = this.shiftFunction; _each(this.labels, function(index, label) { var bBox = label.getBoundingRect(); var coords = shiftFunction(bBox, shiftLength); if (!label.hideInsideLabel(coords)) { label.shift(coords.x, coords.y) } }); this._bBox.end -= shiftLength; this._bBox.start -= shiftLength }, setRollingStockInCanvas: function(canvas) { if (this._bBox.end > canvas.end) { this.shift(this._bBox.end - canvas.end) } }, getLabels: function() { return this.labels }, value: function() { return this.labels[0].getData().value }, getInitialPosition: function() { return this._initialPosition }, _changeBoxWidth: function(width) { this._bBox.end += width; this._bBox.width += width } }; function getLegendFields(name) { return { nameField: name + "Name", colorField: name + "Color", indexField: name + "Index" } } function getLegendSettings(legendDataField) { var formatObjectFields = getLegendFields(legendDataField); return { getFormatObject: function(data) { var res = {}; res[formatObjectFields.indexField] = data.id; res[formatObjectFields.colorField] = data.states.normal.fill; res[formatObjectFields.nameField] = data.text; return res }, textField: formatObjectFields.nameField } } function checkOverlapping(firstRect, secondRect) { return (firstRect.x <= secondRect.x && secondRect.x <= firstRect.x + firstRect.width || firstRect.x >= secondRect.x && firstRect.x <= secondRect.x + secondRect.width) && (firstRect.y <= secondRect.y && secondRect.y <= firstRect.y + firstRect.height || firstRect.y >= secondRect.y && firstRect.y <= secondRect.y + secondRect.height) } var overlapping = { resolveLabelOverlappingInOneDirection: resolveLabelOverlappingInOneDirection }; var BaseChart = BaseWidget.inherit({ _eventsMap: { onSeriesClick: { name: "seriesClick" }, onPointClick: { name: "pointClick" }, onArgumentAxisClick: { name: "argumentAxisClick" }, onLegendClick: { name: "legendClick" }, onSeriesSelectionChanged: { name: "seriesSelectionChanged" }, onPointSelectionChanged: { name: "pointSelectionChanged" }, onSeriesHoverChanged: { name: "seriesHoverChanged" }, onPointHoverChanged: { name: "pointHoverChanged" }, onDone: { name: "done" }, onZoomStart: { name: "zoomStart" }, onZoomEnd: { name: "zoomEnd" } }, _fontFields: ["legend." + FONT, "legend.title." + FONT, "legend.title.subtitle." + FONT, "commonSeriesSettings.label." + FONT], _rootClassPrefix: "dxc", _rootClass: "dxc-chart", _initialChanges: ["INIT"], _themeDependentChanges: ["REFRESH_SERIES_REINIT"], _getThemeManagerOptions: function() { var themeOptions = this.callBase.apply(this, arguments); themeOptions.options = this.option(); return themeOptions }, _createThemeManager: function() { var chartOption = this.option(); var themeManager = new chartThemeManagerModule.ThemeManager(this._getThemeManagerOptions()); themeManager.setTheme(chartOption.theme, chartOption.rtlEnabled); return themeManager }, _initCore: function() { var that = this; that._canvasClipRect = that._renderer.clipRect(); that._createHtmlStructure(); that._createLegend(); that._createTracker(); that._needHandleRenderComplete = true; that.layoutManager = new LayoutManagerModule.LayoutManager; that._createScrollBar(); eventsEngine.on(that._$element, "contextmenu", function(event) { that.eventType = "contextmenu"; if (eventUtils.isTouchEvent(event) || eventUtils.isPointerEvent(event)) { event.preventDefault() } }); eventsEngine.on(that._$element, "MSHoldVisual", function(event) { that.eventType = "MSHoldVisual"; event.preventDefault() }) }, _getLayoutItems: noop, _layoutManagerOptions: function() { return this._themeManager.getOptions("adaptiveLayout") }, _reinit: function() { var that = this; _setCanvasValues(that._canvas); that._reinitAxes(); that._requestChange(["DATA_SOURCE", "DATA_INIT", "CORRECT_AXIS", "FULL_RENDER"]) }, _correctAxes: noop, _createHtmlStructure: function() { var that = this; var renderer = that._renderer; var root = renderer.root; var createConstantLinesGroup = function() { return renderer.g().attr({ "class": "dxc-constant-lines-group" }).linkOn(root, "constant-lines") }; that._constantLinesGroup = { dispose: function() { this.under.dispose(); this.above.dispose() }, linkOff: function() { this.under.linkOff(); this.above.linkOff() }, clear: function() { this.under.linkRemove().clear(); this.above.linkRemove().clear() }, linkAppend: function() { this.under.linkAppend(); this.above.linkAppend() } }; that._backgroundRect = renderer.rect().attr({ fill: "gray", opacity: 1e-4 }).append(root); that._panesBackgroundGroup = renderer.g().attr({ "class": "dxc-background" }).append(root); that._stripsGroup = renderer.g().attr({ "class": "dxc-strips-group" }).linkOn(root, "strips"); that._gridGroup = renderer.g().attr({ "class": "dxc-grids-group" }).linkOn(root, "grids"); that._panesBorderGroup = renderer.g().attr({ "class": "dxc-border" }).linkOn(root, "border"); that._axesGroup = renderer.g().attr({ "class": "dxc-axes-group" }).linkOn(root, "axes"); that._labelAxesGroup = renderer.g().attr({ "class": "dxc-strips-labels-group" }).linkOn(root, "strips-labels"); that._constantLinesGroup.under = createConstantLinesGroup(); that._seriesGroup = renderer.g().attr({ "class": "dxc-series-group" }).linkOn(root, "series"); that._constantLinesGroup.above = createConstantLinesGroup(); that._scaleBreaksGroup = renderer.g().attr({ "class": "dxc-scale-breaks" }).linkOn(root, "scale-breaks"); that._labelsGroup = renderer.g().attr({ "class": "dxc-labels-group" }).linkOn(root, "labels"); that._crosshairCursorGroup = renderer.g().attr({ "class": "dxc-crosshair-cursor" }).linkOn(root, "crosshair"); that._legendGroup = renderer.g().attr({ "class": "dxc-legend", "clip-path": that._getCanvasClipRectID() }).linkOn(root, "legend").linkAppend(root).enableLinks(); that._scrollBarGroup = renderer.g().attr({ "class": "dxc-scroll-bar" }).linkOn(root, "scroll-bar") }, _disposeObjectsInArray: function(propName, fieldNames) { _each(this[propName] || [], function(_, item) { if (fieldNames && item) { _each(fieldNames, function(_, field) { item[field] && item[field].dispose() }) } else { item && item.dispose() } }); this[propName] = null }, _disposeCore: function() { var that = this; var disposeObject = function(propName) { if (that[propName]) { that[propName].dispose(); that[propName] = null } }; var unlinkGroup = function(name) { that[name].linkOff() }; var disposeObjectsInArray = this._disposeObjectsInArray; that._renderer.stopAllAnimations(); disposeObjectsInArray.call(that, "series"); disposeObject("_tracker"); disposeObject("_crosshair"); that.layoutManager = that._userOptions = that._canvas = that._groupsData = null; unlinkGroup("_stripsGroup"); unlinkGroup("_gridGroup"); unlinkGroup("_axesGroup"); unlinkGroup("_constantLinesGroup"); unlinkGroup("_labelAxesGroup"); unlinkGroup("_panesBorderGroup"); unlinkGroup("_seriesGroup"); unlinkGroup("_labelsGroup"); unlinkGroup("_crosshairCursorGroup"); unlinkGroup("_legendGroup"); unlinkGroup("_scrollBarGroup"); unlinkGroup("_scaleBreaksGroup"); disposeObject("_canvasClipRect"); disposeObject("_panesBackgroundGroup"); disposeObject("_backgroundRect"); disposeObject("_stripsGroup"); disposeObject("_gridGroup"); disposeObject("_axesGroup"); disposeObject("_constantLinesGroup"); disposeObject("_labelAxesGroup"); disposeObject("_panesBorderGroup"); disposeObject("_seriesGroup"); disposeObject("_labelsGroup"); disposeObject("_crosshairCursorGroup"); disposeObject("_legendGroup"); disposeObject("_scrollBarGroup"); disposeObject("_scaleBreaksGroup") }, _getAnimationOptions: function() { return this._themeManager.getOptions("animation") }, _getDefaultSize: function() { return { width: 400, height: 400 } }, _getOption: function(name) { return this._themeManager.getOptions(name) }, _applySize: function(rect) { this._rect = rect.slice(); if (!this._changes.has("FULL_RENDER")) { this._processRefreshData(RESIZE_REFRESH_ACTION) } }, _resize: function() { this._doRender(this.__renderOptions || { animate: false, isResize: true }) }, _trackerType: "ChartTracker", _createTracker: function() { var that = this; that._tracker = new trackerModule[that._trackerType]({ seriesGroup: that._seriesGroup, renderer: that._renderer, tooltip: that._tooltip, legend: that._legend, eventTrigger: that._eventTrigger }) }, _getTrackerSettings: function() { return this._getSelectionModes() }, _getSelectionModes: function() { var themeManager = this._themeManager; return { seriesSelectionMode: themeManager.getOptions("seriesSelectionMode"), pointSelectionMode: themeManager.getOptions("pointSelectionMode") } }, _updateTracker: function(trackerCanvases) { var that = this; that._tracker.update(that._getTrackerSettings()); that._tracker.setCanvases({ left: 0, right: that._canvas.width, top: 0, bottom: that._canvas.height }, trackerCanvases) }, _createCanvasFromRect: function(rect) { var currentCanvas = this._canvas; return _setCanvasValues({ left: rect[0], top: rect[1], right: currentCanvas.width - rect[2], bottom: currentCanvas.height - rect[3], width: currentCanvas.width, height: currentCanvas.height }) }, _doRender: function(_options) { var that = this; if (0 === that._canvas.width && 0 === that._canvas.height) { return } that._resetIsReady(); var drawOptions = that._prepareDrawOptions(_options); var recreateCanvas = drawOptions.recreateCanvas; that.__originalCanvas = that._canvas; that._canvas = extend({}, that._canvas); if (recreateCanvas) { that.__currentCanvas = that._canvas } else { that._canvas = that.__currentCanvas } that.DEBUG_canvas = _setCanvasValues(that._canvas); recreateCanvas && that._updateCanvasClipRect(that._canvas); this._canvas = this._createCanvasFromRect(this._rect); that._renderer.stopAllAnimations(true); that._cleanGroups(); var startTime = new Date; that._renderElements(drawOptions); that._lastRenderingTime = new Date - startTime }, _layoutAxes: noop, _renderElements: function(drawOptions) { var that = this; var preparedOptions = that._prepareToRender(drawOptions); var isRotated = that._isRotated(); var isLegendInside = that._isLegendInside(); var trackerCanvases = []; var dirtyCanvas = extend({}, that._canvas); var argBusinessRange; var zoomMinArg; var zoomMaxArg; that.DEBUG_dirtyCanvas = dirtyCanvas; that._renderer.lock(); if (drawOptions.drawLegend && that._legend) { that._legendGroup.linkAppend() } that.layoutManager.setOptions(that._layoutManagerOptions()); var layoutTargets = that._getLayoutTargets(); this._layoutAxes(function(needSpace) { var axisDrawOptions = needSpace ? extend({}, drawOptions, { animate: false }) : drawOptions; var canvas = that._renderAxes(axisDrawOptions, preparedOptions); that._shrinkAxes(needSpace, canvas) }); that._applyClipRects(preparedOptions); that._appendSeriesGroups(); that._createCrosshairCursor(); layoutTargets.forEach(function(_ref) { var canvas = _ref.canvas; trackerCanvases.push({ left: canvas.left, right: canvas.width - canvas.right, top: canvas.top, bottom: canvas.height - canvas.bottom }) }); if (that._scrollBar) { argBusinessRange = that._argumentAxes[0].getTranslator().getBusinessRange(); if ("discrete" === argBusinessRange.axisType && argBusinessRange.categories && argBusinessRange.categories.length <= 1 || "discrete" !== argBusinessRange.axisType && argBusinessRange.min === argBusinessRange.max) { zoomMinArg = zoomMaxArg = void 0 } else { zoomMinArg = argBusinessRange.minVisible; zoomMaxArg = argBusinessRange.maxVisible } that._scrollBar.init(argBusinessRange, !that._argumentAxes[0].getOptions().valueMarginsEnabled).setPosition(zoomMinArg, zoomMaxArg) } that._updateTracker(trackerCanvases); that._updateLegendPosition(drawOptions, isLegendInside); that._applyPointMarkersAutoHiding(); that._renderSeries(drawOptions, isRotated, isLegendInside); that._renderer.unlock() }, _createCrosshairCursor: noop, _appendSeriesGroups: function() { this._seriesGroup.linkAppend(); this._labelsGroup.linkAppend(); this._appendAdditionalSeriesGroups() }, _renderSeries: function(drawOptions, isRotated, isLegendInside) { this._calculateSeriesLayout(drawOptions, isRotated); this._renderSeriesElements(drawOptions, isRotated, isLegendInside) }, _calculateSeriesLayout: function(drawOptions, isRotated) { drawOptions.hideLayoutLabels = this.layoutManager.needMoreSpaceForPanesCanvas(this._getLayoutTargets(), isRotated) && !this._themeManager.getOptions("adaptiveLayout").keepLabels; this._updateSeriesDimensions(drawOptions) }, _renderSeriesElements: function(drawOptions, isRotated, isLegendInside) { var that = this; var i; var series = that.series; var singleSeries; var seriesLength = series.length; var resolveLabelOverlapping = that._themeManager.getOptions("resolveLabelOverlapping"); for (i = 0; i < seriesLength; i++) { singleSeries = series[i]; that._applyExtraSettings(singleSeries, drawOptions); singleSeries.draw(drawOptions.animate && singleSeries.getPoints().length <= drawOptions.animationPointsLimit && that._renderer.animationEnabled(), drawOptions.hideLayoutLabels, that._getLegendCallBack(singleSeries)) } if ("none" === resolveLabelOverlapping) { that._adjustSeriesLabels(false) } else { that._locateLabels(resolveLabelOverlapping) } that._renderTrackers(isLegendInside); that._tracker.repairTooltip(); that._clearCanvas(); that._renderExtraElements(); that._drawn(); that._renderCompleteHandler() }, _locateLabels: function(resolveLabelOverlapping) { this._resolveLabelOverlapping(resolveLabelOverlapping) }, _renderExtraElements: function() {}, _clearCanvas: function() { this._canvas = this.__originalCanvas }, _resolveLabelOverlapping: function(resolveLabelOverlapping) { var func; switch (resolveLabelOverlapping) { case "stack": func = this._resolveLabelOverlappingStack; break; case "hide": func = this._resolveLabelOverlappingHide; break; case "shift": func = this._resolveLabelOverlappingShift } return typeUtils.isFunction(func) && func.call(this) }, _getVisibleSeries: function() { return commonUtils.grep(this.getAllSeries(), function(series) { return series.isVisible() }) }, _resolveLabelOverlappingHide: function() { var labels = []; var currentLabel; var nextLabel; var currentLabelRect; var nextLabelRect; var i; var j; var points; var series = this._getVisibleSeries(); for (i = 0; i < series.length; i++) { points = series[i].getVisiblePoints(); for (j = 0; j < points.length; j++) { labels.push.apply(labels, points[j].getLabels()) } } for (i = 0; i < labels.length; i++) { currentLabel = labels[i]; if (!currentLabel.isVisible()) { continue } currentLabelRect = currentLabel.getBoundingRect(); for (j = i + 1; j < labels.length; j++) { nextLabel = labels[j]; nextLabelRect = nextLabel.getBoundingRect(); if (checkOverlapping(currentLabelRect, nextLabelRect)) { nextLabel.draw(false) } } } }, _cleanGroups: function() { var that = this; that._stripsGroup.linkRemove().clear(); that._gridGroup.linkRemove().clear(); that._axesGroup.linkRemove().clear(); that._constantLinesGroup.above.clear(); that._labelAxesGroup.linkRemove().clear(); that._labelsGroup.linkRemove().clear(); that._crosshairCursorGroup.linkRemove().clear(); that._scaleBreaksGroup.linkRemove().clear() }, _allowLegendInsidePosition: function() { return false }, _updateLegendPosition: noop, _createLegend: function() { var that = this; var legendSettings = getLegendSettings(that._legendDataField); that._legend = new legendModule.Legend({ renderer: that._renderer, group: that._legendGroup, backgroundClass: "dxc-border", itemGroupClass: "dxc-item", titleGroupClass: "dxc-title", textField: legendSettings.textField, getFormatObject: legendSettings.getFormatObject, allowInsidePosition: that._allowLegendInsidePosition() }); that._updateLegend(); that._layout.add(that._legend) }, _updateLegend: function() { var that = this; var themeManager = that._themeManager; var legendOptions = themeManager.getOptions("legend"); var legendData = that._getLegendData(); legendOptions.containerBackgroundColor = themeManager.getOptions("containerBackgroundColor"); legendOptions._incidentOccurred = that._incidentOccurred; that._legend.update(legendData, legendOptions, themeManager.theme("legend").title); this._change(["LAYOUT"]) }, _prepareDrawOptions: function(drawOptions) { var animationOptions = this._getAnimationOptions(); var options = extend({}, { force: false, adjustAxes: true, drawLegend: true, drawTitle: true, animate: animationOptions.enabled, animationPointsLimit: animationOptions.maxPointCountSupported }, drawOptions, this.__renderOptions); if (!_isDefined(options.recreateCanvas)) { options.recreateCanvas = options.adjustAxes && options.drawLegend && options.drawTitle } return options }, _processRefreshData: function(newRefreshAction) { var currentRefreshActionPosition = inArray(this._currentRefreshData, ACTIONS_BY_PRIORITY); var newRefreshActionPosition = inArray(newRefreshAction, ACTIONS_BY_PRIORITY); if (!this._currentRefreshData || currentRefreshActionPosition >= 0 && newRefreshActionPosition < currentRefreshActionPosition) { this._currentRefreshData = newRefreshAction } this._requestChange(["REFRESH"]) }, _getLegendData: function() { return _map(this._getLegendTargets(), function(item) { var legendData = item.legendData; var style = item.getLegendStyles; var opacity = style.normal.opacity; if (!item.visible) { if (!_isDefined(opacity) || opacity > DEFAULT_OPACITY) { opacity = DEFAULT_OPACITY } legendData.textOpacity = DEFAULT_OPACITY } legendData.states = { hover: style.hover, selection: style.selection, normal: _extend({}, style.normal, { opacity: opacity }) }; return legendData }) }, _getLegendOptions: function(item) { return { legendData: { text: item[this._legendItemTextField], id: item.index, visible: true }, getLegendStyles: item.getLegendStyles(), visible: item.isVisible() } }, _disposeSeries: function(seriesIndex) { var that = this; if (that.series) { if (_isDefined(seriesIndex)) { that.series[seriesIndex].dispose(); that.series.splice(seriesIndex, 1) } else { _each(that.series, function(_, s) { return s.dispose() }); that.series.length = 0 } } if (!that.series || !that.series.length) { that.series = [] } }, _disposeSeriesFamilies: function() { var that = this; _each(that.seriesFamilies || [], function(_, family) { family.dispose() }); that.seriesFamilies = null; that._needHandleRenderComplete = true }, _simulateOptionChange: function(fullName, value, previousValue) { var that = this; var optionSetter = coreDataUtils.compileSetter(fullName); optionSetter(that._options, value, { functionsAsIs: true, merge: !that._getOptionsByReference()[fullName] }); that._notifyOptionChanged(fullName, value, previousValue); that._changes.reset() }, _optionChanged: function(arg) { this._themeManager.resetOptions(arg.name); this.callBase.apply(this, arguments) }, _applyChanges: function() { var that = this; that._themeManager.update(that._options); that.callBase.apply(that, arguments) }, _optionChangesMap: { animation: "ANIMATION", dataSource: "DATA_SOURCE", palette: "PALETTE", paletteExtensionMode: "PALETTE", legend: "FORCE_DATA_INIT", seriesTemplate: "FORCE_DATA_INIT", "export": "FORCE_RENDER", valueAxis: "AXES_AND_PANES", argumentAxis: "AXES_AND_PANES", commonAxisSettings: "AXES_AND_PANES", panes: "AXES_AND_PANES", defaultPane: "AXES_AND_PANES", useAggregation: "AXES_AND_PANES", containerBackgroundColor: "AXES_AND_PANES", rotated: "ROTATED", autoHidePointMarkers: "REFRESH_SERIES_REINIT", customizePoint: "REFRESH_SERIES_REINIT", customizeLabel: "REFRESH_SERIES_REINIT", scrollBar: "SCROLL_BAR" }, _optionChangesOrder: ["ROTATED", "PALETTE", "REFRESH_SERIES_REINIT", "AXES_AND_PANES", "INIT", "REINIT", "DATA_SOURCE", "REFRESH_SERIES_DATA_INIT", "DATA_INIT", "FORCE_DATA_INIT", "REFRESH_AXES", "CORRECT_AXIS"], _customChangesOrder: ["ANIMATION", "REFRESH_SERIES_FAMILIES", "FORCE_RENDER", "VISUAL_RANGE", "SCROLL_BAR", "CHART_TOOLTIP", "REINIT", "REFRESH", "FULL_RENDER"], _change_ANIMATION: function() { this._renderer.updateAnimationOptions(this._getAnimationOptions()) }, _change_DATA_SOURCE: function() { this._needHandleRenderComplete = true; this._updateDataSource() }, _change_PALETTE: function() { this._themeManager.updatePalette(); this._refreshSeries("DATA_INIT") }, _change_REFRESH_SERIES_DATA_INIT: function() { this._refreshSeries("DATA_INIT") }, _change_DATA_INIT: function() { if ((!this.series || this.needToPopulateSeries) && !this._changes.has("FORCE_DATA_INIT")) { this._dataInit() } }, _change_FORCE_DATA_INIT: function() { this._dataInit() }, _change_REFRESH_SERIES_FAMILIES: function() { this._processSeriesFamilies(); this._populateBusinessRange(); this._processRefreshData(FORCE_RENDER_REFRESH_ACTION) }, _change_FORCE_RENDER: function() { this._processRefreshData(FORCE_RENDER_REFRESH_ACTION) }, _change_AXES_AND_PANES: function() { this._refreshSeries("INIT") }, _change_ROTATED: function() { this._createScrollBar(); this._refreshSeries("INIT") }, _change_REFRESH_SERIES_REINIT: function() { this._refreshSeries("INIT") }, _change_REFRESH_AXES: function() { var that = this; _setCanvasValues(that._canvas); that._reinitAxes(); that._requestChange(["CORRECT_AXIS", "FULL_RENDER"]) }, _change_SCROLL_BAR: function() { this._createScrollBar(); this._processRefreshData(FORCE_RENDER_REFRESH_ACTION) }, _change_CHART_TOOLTIP: function() { this._organizeStackPoints() }, _change_REINIT: function() { this._processRefreshData(REINIT_REFRESH_ACTION) }, _refreshSeries: function(actionName) { this.needToPopulateSeries = true; this._requestChange([actionName]) }, _change_CORRECT_AXIS: function() { this._correctAxes() }, _doRefresh: function() { var methodName = this._currentRefreshData; if (methodName) { this._currentRefreshData = null; this._renderer.stopAllAnimations(true); this[methodName]() } }, _updateCanvasClipRect: function(canvas) { var that = this; var width = Math.max(canvas.width - canvas.left - canvas.right, 0); var height = Math.max(canvas.height - canvas.top - canvas.bottom, 0); that._canvasClipRect.attr({ x: canvas.left, y: canvas.top, width: width, height: height }); that._backgroundRect.attr({ x: canvas.left, y: canvas.top, width: width, height: height }) }, _getCanvasClipRectID: function() { return this._canvasClipRect.id }, _dataSourceChangedHandler: function() { if (this._changes.has("INIT")) { this._requestChange(["DATA_INIT"]) } else { this._requestChange(["FORCE_DATA_INIT"]) } }, _dataInit: function() { this._dataSpecificInit(true) }, _processSingleSeries: function(singleSeries) { singleSeries.createPoints(false) }, _handleSeriesDataUpdated: function() { var _this = this; if (this._getVisibleSeries().some(function(s) { return s.useAggregation() })) { this._populateMarginOptions() } this.series.forEach(function(s) { return _this._processSingleSeries(s) }, this) }, _dataSpecificInit: function(needRedraw) { var that = this; if (!that.series || that.needToPopulateSeries) { that.series = that._populateSeries() } that._repopulateSeries(); that._seriesPopulatedHandlerCore(); that._populateBusinessRange(); that._tracker.updateSeries(that.series, this._changes.has("INIT")); that._updateLegend(); if (needRedraw) { this._requestChange(["FULL_RENDER"]) } }, _forceRender: function() { this._doRender({ force: true }) }, _repopulateSeries: function() { var that = this; var themeManager = that._themeManager; var data = that._dataSourceItems(); var dataValidatorOptions = themeManager.getOptions("dataPrepareSettings"); var seriesTemplate = themeManager.getOptions("seriesTemplate"); if (seriesTemplate) { that._populateSeries(data) } that._groupSeries(); var parsedData = dataValidatorModule.validateData(data, that._groupsData, that._incidentOccurred, dataValidatorOptions); themeManager.resetPalette(); that.series.forEach(function(singleSeries) { singleSeries.updateData(parsedData[singleSeries.getArgumentField()]) }); that._handleSeriesDataUpdated(); that._organizeStackPoints() }, _organizeStackPoints: function() { var that = this; var themeManager = that._themeManager; var sharedTooltip = themeManager.getOptions("tooltip").shared; var stackPoints = {}; _each(that.series || [], function(_, singleSeries) { that._resetStackPoints(singleSeries); sharedTooltip && that._prepareStackPoints(singleSeries, stackPoints) }) }, _renderCompleteHandler: function() { var that = this; var allSeriesInited = true; if (that._needHandleRenderComplete) { _each(that.series, function(_, s) { allSeriesInited = allSeriesInited && s.canRenderCompleteHandle() }); if (allSeriesInited) { that._needHandleRenderComplete = false; that._eventTrigger("done", { target: that }) } } }, _dataIsReady: function() { return _isDefined(this.option("dataSource")) && this._dataIsLoaded() }, _populateSeriesOptions: function(data) { var that = this; var themeManager = that._themeManager; var seriesTemplate = themeManager.getOptions("seriesTemplate"); var seriesOptions = seriesTemplate ? vizUtils.processSeriesTemplate(seriesTemplate, data || []) : that.option("series"); var allSeriesOptions = _isArray(seriesOptions) ? seriesOptions : seriesOptions ? [seriesOptions] : []; var extraOptions = that._getExtraOptions(); var particularSeriesOptions; var seriesTheme; var seriesThemes = []; var seriesVisibilityChanged = function(target) { that._specialProcessSeries(); that._populateBusinessRange(target && target.getValueAxis(), true); that._renderer.stopAllAnimations(true); that._updateLegend(); that._requestChange(["FULL_RENDER"]) }; for (var i = 0; i < allSeriesOptions.length; i++) { particularSeriesOptions = _extend(true, {}, allSeriesOptions[i], extraOptions); if (!particularSeriesOptions.name) { particularSeriesOptions.name = "Series " + (i + 1).toString() } particularSeriesOptions.rotated = that._isRotated(); particularSeriesOptions.customizePoint = themeManager.getOptions("customizePoint"); particularSeriesOptions.customizeLabel = themeManager.getOptions("customizeLabel"); particularSeriesOptions.visibilityChanged = seriesVisibilityChanged; particularSeriesOptions.incidentOccurred = that._incidentOccurred; seriesTheme = themeManager.getOptions("series", particularSeriesOptions, allSeriesOptions.length); if (that._checkPaneName(seriesTheme)) { seriesThemes.push(seriesTheme) } } return seriesThemes }, _populateSeries: function(data) { var that = this; var seriesBasis = []; var incidentOccurred = that._incidentOccurred; var seriesThemes = that._populateSeriesOptions(data); var particularSeries; var disposeSeriesFamilies = false; that.needToPopulateSeries = false; _each(seriesThemes, function(_, theme) { var curSeries = that.series && that.series.filter(function(s) { return s.name === theme.name && seriesBasis.map(function(sb) { return sb.series }).indexOf(s) === -1 })[0]; if (curSeries && curSeries.type === theme.type) { seriesBasis.push({ series: curSeries, options: theme }) } else { seriesBasis.push({ options: theme }); disposeSeriesFamilies = true } }); that._tracker.clearHover(); _reverseEach(that.series, function(index, series) { if (!seriesBasis.some(function(s) { return series === s.series })) { that._disposeSeries(index); disposeSeriesFamilies = true } }); !disposeSeriesFamilies && (disposeSeriesFamilies = seriesBasis.some(function(sb) { return sb.series.name !== seriesThemes[sb.series.index].name; })); that.series = []; disposeSeriesFamilies && that._disposeSeriesFamilies(); that._themeManager.resetPalette(); var eventPipe = function(data) { that.series.forEach(function(currentSeries) { currentSeries.notify(data) }) }; _each(seriesBasis, function(_, basis) { var seriesTheme = basis.options; var renderSettings = { commonSeriesModes: that._getSelectionModes(), argumentAxis: that.getArgumentAxis(), valueAxis: that._getValueAxis(seriesTheme.pane, seriesTheme.axis) }; if (basis.series) { particularSeries = basis.series; particularSeries.updateOptions(seriesTheme, renderSettings) } else { particularSeries = new seriesModule.Series(_extend({ renderer: that._renderer, seriesGroup: that._seriesGroup, labelsGroup: that._labelsGroup, eventTrigger: that._eventTrigger, eventPipe: eventPipe, incidentOccurred: incidentOccurred }, renderSettings), seriesTheme) } if (!particularSeries.isUpdated) { incidentOccurred("E2101", [seriesTheme.type]) } else { particularSeries.index = that.series.length; that.series.push(particularSeries) } }); return that.series }, getAllSeries: function() { return (this.series || []).slice() }, getSeriesByName: function(name) { var found = null; _each(this.series, function(i, singleSeries) { if (singleSeries.name === name) { found = singleSeries; return false } }); return found }, getSeriesByPos: function(pos) { return (this.series || [])[pos] }, clearSelection: function() { this._tracker.clearSelection() }, hideTooltip: function() { this._tracker._hideTooltip() }, clearHover: function() { this._tracker.clearHover() }, render: function(renderOptions) { var that = this; that.__renderOptions = renderOptions; that.__forceRender = renderOptions && renderOptions.force; that.callBase.apply(that, arguments); that.__renderOptions = that.__forceRender = null; return that }, refresh: function() { this._disposeSeries(); this._disposeSeriesFamilies(); this._requestChange(["CONTAINER_SIZE", "REFRESH_SERIES_REINIT"]) }, _getMinSize: function() { var adaptiveLayout = this._layoutManagerOptions(); return [adaptiveLayout.width, adaptiveLayout.height] }, _change_REFRESH: function() { if (!this._changes.has("INIT")) { this._doRefresh() } else { this._currentRefreshData = null } }, _change_FULL_RENDER: function() { this._forceRender() }, _change_INIT: function() { this._reinit() }, _stopCurrentHandling: function() { this._tracker.stopCurrentHandling() } }); REFRESH_SERIES_DATA_INIT_ACTION_OPTIONS.forEach(function(name) { BaseChart.prototype._optionChangesMap[name] = "REFRESH_SERIES_DATA_INIT" }); FORCE_RENDER_REFRESH_ACTION_OPTIONS.forEach(function(name) { BaseChart.prototype._optionChangesMap[name] = "FORCE_RENDER" }); REFRESH_SERIES_FAMILIES_ACTION_OPTIONS.forEach(function(name) { BaseChart.prototype._optionChangesMap[name] = "REFRESH_SERIES_FAMILIES" }); exports.overlapping = overlapping; exports.BaseChart = BaseChart; BaseChart.addPlugin(__webpack_require__( /*! ../core/export */ 93).plugin); BaseChart.addPlugin(__webpack_require__( /*! ../core/title */ 105).plugin); BaseChart.addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin); BaseChart.addPlugin(__webpack_require__( /*! ../core/loading_indicator */ 119).plugin); BaseChart.addPlugin(__webpack_require__( /*! ../core/data_source */ 144).plugin); var _change_TITLE = BaseChart.prototype._change_TITLE; BaseChart.prototype._change_TITLE = function() { _change_TITLE.apply(this, arguments); this._change(["FORCE_RENDER"]) }; var _change_TOOLTIP = BaseChart.prototype._change_TOOLTIP; BaseChart.prototype._change_TOOLTIP = function() { _change_TOOLTIP.apply(this, arguments); this._change(["CHART_TOOLTIP"]) } }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/viz/core/base_theme_manager.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Class = __webpack_require__( /*! ../../core/class */ 15); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var paletteModule = __webpack_require__( /*! ../palette */ 164); var _isString = typeUtils.isString; var _parseScalar = __webpack_require__( /*! ./utils */ 10).parseScalar; var themeModule = __webpack_require__( /*! ../themes */ 50); var _getTheme = themeModule.getTheme; var _addCacheItem = themeModule.addCacheItem; var _removeCacheItem = themeModule.removeCacheItem; var _extend = extend; var _each = each; __webpack_require__( /*! ./themes/generic.light */ 754); __webpack_require__( /*! ./themes/generic.dark */ 755); __webpack_require__( /*! ./themes/generic.contrast */ 756); __webpack_require__( /*! ./themes/generic.carmine */ 757); __webpack_require__( /*! ./themes/generic.darkmoon */ 758); __webpack_require__( /*! ./themes/generic.softblue */ 759); __webpack_require__( /*! ./themes/generic.darkviolet */ 760); __webpack_require__( /*! ./themes/generic.greenmist */ 761); __webpack_require__( /*! ./themes/material */ 762); __webpack_require__( /*! ./themes/ios */ 763); 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(options) { this._themeSection = options.themeSection; this._fontFields = options.fontFields || []; _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; var current = that._current || {}; var theme = _getTheme(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._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 paletteModule.createPalette(palette, options, this._defaultPalette) }, createDiscretePalette: function(palette, count) { return paletteModule.getDiscretePalette(palette, count, this._defaultPalette) }, createGradientPalette: function(palette) { return paletteModule.getGradientPalette(palette, this._defaultPalette) }, getAccentColor: function(palette) { return paletteModule.getAccentColor(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)) } }) }, /*!*********************************************************!*\ !*** ./artifacts/transpiled/viz/core/layout_element.js ***! \*********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var _round = Math.round; var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47); var defaultOffset = { horizontal: 0, vertical: 0 }; var alignFactors = { center: .5, right: 1, bottom: 1, left: 0, top: 0 }; function LayoutElement(options) { this._options = options } LayoutElement.prototype = { constructor: LayoutElement, position: function(options) { var that = this; var ofBBox = options.of.getLayoutOptions(); var myBBox = that.getLayoutOptions(); var at = options.at; var my = options.my; var offset = options.offset || defaultOffset; var shiftX = -alignFactors[my.horizontal] * myBBox.width + ofBBox.x + alignFactors[at.horizontal] * ofBBox.width + parseInt(offset.horizontal); var shiftY = -alignFactors[my.vertical] * myBBox.height + ofBBox.y + alignFactors[at.vertical] * ofBBox.height + parseInt(offset.vertical); that.shift(_round(shiftX), _round(shiftY)) }, getLayoutOptions: noop }; function WrapperLayoutElement(renderElement, bBox) { this._renderElement = renderElement; this._cacheBBox = bBox } var wrapperLayoutElementPrototype = WrapperLayoutElement.prototype = objectUtils.clone(LayoutElement.prototype); wrapperLayoutElementPrototype.constructor = WrapperLayoutElement; wrapperLayoutElementPrototype.getLayoutOptions = function() { return this._cacheBBox || this._renderElement.getBBox() }; wrapperLayoutElementPrototype.shift = function(shiftX, shiftY) { var bBox = this.getLayoutOptions(); this._renderElement.move(_round(shiftX - bBox.x), _round(shiftY - bBox.y)) }; exports.LayoutElement = LayoutElement; exports.WrapperLayoutElement = WrapperLayoutElement }, /*!***************************************************************!*\ !*** ./artifacts/transpiled/viz/components/data_validator.js ***! \***************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var STRING = "string"; var NUMERIC = "numeric"; var DATETIME = "datetime"; var DISCRETE = "discrete"; var SEMIDISCRETE = "semidiscrete"; var CONTINUOUS = "continuous"; var LOGARITHMIC = "logarithmic"; var VALUE_TYPE = "valueType"; var ARGUMENT_TYPE = "argumentType"; var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var axisTypeParser = __webpack_require__( /*! ../core/utils */ 10).enumParser([STRING, NUMERIC, DATETIME]); var _getParser = __webpack_require__( /*! ./parse_utils */ 244).getParser; var _isDefined = typeUtils.isDefined; var _isFunction = typeUtils.isFunction; var _isArray = Array.isArray; var _isString = typeUtils.isString; var _isDate = typeUtils.isDate; var _isNumber = typeUtils.isNumeric; var _isObject = typeUtils.isObject; function groupingValues(data, others, valueField, index) { if (index >= 0) { data.slice(index).forEach(function(cell) { if (_isDefined(cell[valueField])) { others[valueField] += cell[valueField]; cell[valueField] = void 0 } }) } } function processGroups(groups) { groups.forEach(function(group) { group.valueType = group.valueAxisType = null; group.series.forEach(function(series) { series.updateDataType({}) }); group.valueAxis && group.valueAxis.resetTypes(VALUE_TYPE) }) } function sortValues(data, asc, selector) { var func = asc ? function(a, b) { return a - b } : function(a, b) { return b - a }; data.sort(function(a, b) { var valA = selector(a); var valB = selector(b); var aa = _isDefined(valA) ? 1 : 0; var bb = _isDefined(valB) ? 1 : 0; return aa && bb ? func(valA, valB) : func(aa, bb) }); return data } function resetArgumentAxes(axes) { axes && axes.forEach(function(axis) { axis.resetTypes(ARGUMENT_TYPE) }) } function parseCategories(categories, parser) { var newArray = []; categories.forEach(function(category) { var parsedCategory = parser(category); void 0 !== parsedCategory && newArray.push(parsedCategory) }); return newArray } function parseAxisCategories(groupsData, parsers) { var argumentCategories = groupsData.argumentOptions && groupsData.argumentOptions.categories; groupsData.groups.forEach(function(valueGroup, i) { var categories = valueGroup.valueOptions && valueGroup.valueOptions.categories; if (categories) { valueGroup.valueOptions.categories = parseCategories(categories, parsers[i + 1]) } }); if (argumentCategories) { groupsData.argumentOptions.categories = parseCategories(argumentCategories, parsers[0]) } } function filterForLogAxis(val, field, incidentOccurred) { if (val <= 0 && null !== val) { incidentOccurred("E2004", [field]); val = null } return val } function eigen(x) { return x } function getType(unit, type) { var result = type; if (type === STRING || _isString(unit)) { result = STRING } else { if (type === DATETIME || _isDate(unit)) { result = DATETIME } else { if (_isNumber(unit)) { result = NUMERIC } } } return result } function correctAxisType(type, axisType, hasCategories, incidentOccurred) { if (type === STRING && (axisType === CONTINUOUS || axisType === LOGARITHMIC || axisType === SEMIDISCRETE)) { incidentOccurred("E2002") } return axisType === LOGARITHMIC ? LOGARITHMIC : hasCategories || axisType === DISCRETE || type === STRING ? DISCRETE : axisType === SEMIDISCRETE ? SEMIDISCRETE : CONTINUOUS } function validUnit(unit, field, incidentOccurred) { if (unit) { incidentOccurred(!_isNumber(unit) && !_isDate(unit) && !_isString(unit) ? "E2003" : "E2004", [field]) } } function createParserUnit(type, axisType, incidentOccurred) { var parser = type ? _getParser(type) : eigen; var filter = axisType === LOGARITHMIC ? filterForLogAxis : eigen; var filterInfinity = axisType !== DISCRETE ? function(x) { return isFinite(x) || void 0 === x ? x : null } : eigen; return function(unit, field) { var filterLogValues = function(x) { return filter(x, field, incidentOccurred) }; var parseUnit = filterLogValues(filterInfinity(parser(unit))); if (void 0 === parseUnit) { validUnit(unit, field, incidentOccurred) } return parseUnit } } function prepareParsers(groupsData, incidentOccurred) { var argumentParser = createParserUnit(groupsData.argumentType, groupsData.argumentAxisType, incidentOccurred); var sizeParser; var valueParser; var categoryParsers = [argumentParser]; var cache = {}; var list = []; groupsData.groups.forEach(function(group, groupIndex) { group.series.forEach(function(series) { valueParser = createParserUnit(group.valueType, group.valueAxisType, incidentOccurred); sizeParser = createParserUnit(NUMERIC, CONTINUOUS, incidentOccurred); cache[series.getArgumentField()] = argumentParser; series.getValueFields().forEach(function(field) { categoryParsers[groupIndex + 1] = valueParser; cache[field] = valueParser }); if (series.getSizeField()) { cache[series.getSizeField()] = sizeParser } }) }); for (var field in cache) { list.push([field, cache[field]]) } list.length && parseAxisCategories(groupsData, categoryParsers); return list } function getParsedCell(cell, parsers) { var i; var ii = parsers.length; var obj = extend({}, cell); var field; var value; for (i = 0; i < ii; ++i) { field = parsers[i][0]; value = cell[field]; obj[field] = parsers[i][1](value, field) } return obj } function parse(data, parsers) { var parsedData = []; var i; var ii = data.length; parsedData.length = ii; for (i = 0; i < ii; ++i) { parsedData[i] = getParsedCell(data[i], parsers) } return parsedData } function findIndexByThreshold(data, valueField, threshold) { var i; var ii = data.length; var value; for (i = 0; i < ii; ++i) { value = data[i][valueField]; if (_isDefined(value) && threshold > value) { break } } return i } function groupMinSlices(originalData, argumentField, valueField, smallValuesGrouping) { smallValuesGrouping = smallValuesGrouping || {}; var mode = smallValuesGrouping.mode; var others = {}; if (!mode || "none" === mode) { return } others[argumentField] = String(smallValuesGrouping.groupName || "others"); others[valueField] = 0; var data = sortValues(originalData.slice(), false, function(a) { return a[valueField] }); groupingValues(data, others, valueField, "smallValueThreshold" === mode ? findIndexByThreshold(data, valueField, smallValuesGrouping.threshold) : smallValuesGrouping.topCount); others[valueField] && originalData.push(others) } function groupPieData(data, groupsData) { var firstSeries = groupsData.groups[0] && groupsData.groups[0].series[0]; var isPie = firstSeries && ("pie" === firstSeries.type || "doughnut" === firstSeries.type || "donut" === firstSeries.type); if (!isPie) { return } groupsData.groups.forEach(function(group) { group.series.forEach(function(series) { groupMinSlices(data, series.getArgumentField(), series.getValueFields()[0], series.getOptions().smallValuesGrouping) }) }) } function addUniqueItemToCollection(item, collection, itemsHash) { if (!itemsHash[item]) { collection.push(item); itemsHash[item] = true } } function getUniqueArgumentFields(groupsData) { var uniqueArgumentFields = []; var hash = {}; groupsData.groups.forEach(function(group) { group.series.forEach(function(series) { addUniqueItemToCollection(series.getArgumentField(), uniqueArgumentFields, hash) }) }); return uniqueArgumentFields } function sort(a, b) { var result = a - b; if (isNaN(result)) { if (!_isDefined(a)) { return 1 } if (!_isDefined(b)) { return -1 } return 0 } return result } function sortByArgument(data, argumentField) { return data.slice().sort(function(a, b) { return sort(a[argumentField], b[argumentField]) }) } function sortByCallback(data, callback) { return data.slice().sort(callback) } function checkValueTypeOfGroup(group, cell) { group.series.forEach(function(series) { series.getValueFields().forEach(function(field) { group.valueType = getType(cell[field], group.valueType) }) }); return group.valueType } function getSortByCategories(categories) { var hash = {}; categories.forEach(function(value, i) { hash[value] = i }); return function(data, argumentField) { return sortValues(data.slice(), true, function(a) { return hash[a[argumentField]] }) } } function sortData(data, groupsData, options, uniqueArgumentFields) { var dataByArguments = {}; var isDiscrete = groupsData.argumentAxisType === DISCRETE; var userCategories = isDiscrete && groupsData.argumentOptions && groupsData.argumentOptions.categories; var sortFunction = function(data) { return data }; var sortingMethodOption = options.sortingMethod; var reSortCategories; if (!userCategories && _isFunction(sortingMethodOption)) { data = sortByCallback(data, sortingMethodOption) } if (isDiscrete) { groupsData.categories = getCategories(data, uniqueArgumentFields, userCategories) } if (userCategories || !_isFunction(sortingMethodOption) && groupsData.argumentType === STRING && !options._skipArgumentSorting) { sortFunction = getSortByCategories(groupsData.categories) } else { if (true === sortingMethodOption && groupsData.argumentType !== STRING) { sortFunction = sortByArgument; reSortCategories = isDiscrete } } uniqueArgumentFields.forEach(function(field) { dataByArguments[field] = sortFunction(data, field) }); if (reSortCategories) { groupsData.categories = groupsData.categories.sort(sort) } return dataByArguments } function checkItemExistence(collection, item) { return collection.map(function(collectionItem) { return collectionItem.valueOf() }).indexOf(item.valueOf()) === -1 } function getCategories(data, uniqueArgumentFields, userCategories) { var categories = userCategories ? userCategories.slice() : []; uniqueArgumentFields.forEach(function(field) { data.forEach(function(item) { var dataItem = item[field]; _isDefined(dataItem) && checkItemExistence(categories, dataItem) && categories.push(dataItem) }) }); return categories } function checkArgumentTypeOfGroup(series, cell, groupsData) { series.forEach(function(currentSeries) { groupsData.argumentType = getType(cell[currentSeries.getArgumentField()], groupsData.argumentType) }); return groupsData.argumentType } function checkType(data, groupsData, checkTypeForAllData) { var groupsWithUndefinedValueType = []; var groupsWithUndefinedArgumentType = []; var argumentTypeGroup = groupsData.argumentOptions && axisTypeParser(groupsData.argumentOptions.argumentType); var groupsIndexes; groupsData.groups.forEach(function(group) { if (!group.series.length) { return } var valueTypeGroup = group.valueOptions && axisTypeParser(group.valueOptions.valueType); group.valueType = valueTypeGroup; groupsData.argumentType = argumentTypeGroup; !valueTypeGroup && groupsWithUndefinedValueType.push(group); !argumentTypeGroup && groupsWithUndefinedArgumentType.push(group) }); if (groupsWithUndefinedValueType.length || groupsWithUndefinedArgumentType.length) { groupsIndexes = groupsWithUndefinedValueType.map(function(_, index) { return index }); data.some(function(cell) { var defineArg; groupsWithUndefinedValueType.forEach(function(group, groupIndex) { if (checkValueTypeOfGroup(group, cell) && groupsIndexes.indexOf(groupIndex) >= 0) { groupsIndexes.splice(groupIndex, 1) } }); if (!defineArg) { groupsWithUndefinedArgumentType.forEach(function(group) { defineArg = checkArgumentTypeOfGroup(group.series, cell, groupsData) }) } if (!checkTypeForAllData && defineArg && 0 === groupsIndexes.length) { return true } }) } } function checkAxisType(groupsData, incidentOccurred) { var argumentOptions = groupsData.argumentOptions || {}; var userArgumentCategories = argumentOptions && argumentOptions.categories || []; var argumentAxisType = correctAxisType(groupsData.argumentType, argumentOptions.type, !!userArgumentCategories.length, incidentOccurred); groupsData.groups.forEach(function(group) { var valueOptions = group.valueOptions || {}; var valueCategories = valueOptions.categories || []; var valueAxisType = correctAxisType(group.valueType, valueOptions.type, !!valueCategories.length, incidentOccurred); group.series.forEach(function(series) { var optionsSeries = {}; optionsSeries.argumentAxisType = argumentAxisType; optionsSeries.valueAxisType = valueAxisType; groupsData.argumentAxisType = groupsData.argumentAxisType || optionsSeries.argumentAxisType; group.valueAxisType = group.valueAxisType || optionsSeries.valueAxisType; optionsSeries.argumentType = groupsData.argumentType; optionsSeries.valueType = group.valueType; optionsSeries.showZero = valueOptions.showZero; series.updateDataType(optionsSeries) }); group.valueAxisType = group.valueAxisType || valueAxisType; if (group.valueAxis) { group.valueAxis.setTypes(group.valueAxisType, group.valueType, VALUE_TYPE); group.valueAxis.validate() } }); groupsData.argumentAxisType = groupsData.argumentAxisType || argumentAxisType; if (groupsData.argumentAxes) { groupsData.argumentAxes.forEach(function(axis) { axis.setTypes(groupsData.argumentAxisType, groupsData.argumentType, ARGUMENT_TYPE); axis.validate() }) } } function verifyData(source, incidentOccurred) { var data = []; var sourceIsDefined = _isDefined(source); var hasError = sourceIsDefined && !_isArray(source); var i; var ii; var k; var item; if (sourceIsDefined && !hasError) { for (i = 0, ii = source.length, k = 0; i < ii; ++i) { item = source[i]; if (_isObject(item)) { data[k++] = item } else { if (item) { hasError = true } } } } if (hasError) { incidentOccurred("E2001") } return data } function validateData(data, groupsData, incidentOccurred, options) { data = verifyData(data, incidentOccurred); groupsData.argumentType = groupsData.argumentAxisType = null; processGroups(groupsData.groups); resetArgumentAxes(groupsData.argumentAxes); checkType(data, groupsData, options.checkTypeForAllData); checkAxisType(groupsData, incidentOccurred); if (options.convertToAxisDataType) { data = parse(data, prepareParsers(groupsData, incidentOccurred)) } groupPieData(data, groupsData); var dataByArgumentFields = sortData(data, groupsData, options, getUniqueArgumentFields(groupsData)); return dataByArgumentFields } exports.validateData = validateData }, /*!************************************************************!*\ !*** ./artifacts/transpiled/viz/components/parse_utils.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var dateSerialization = __webpack_require__( /*! ../../core/utils/date_serialization */ 52); var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined; var parsers = { string: function(val) { return isDefined(val) ? "" + val : val }, numeric: function(val) { if (!isDefined(val)) { return val } var parsedVal = Number(val); if (isNaN(parsedVal)) { parsedVal = void 0 } return parsedVal }, datetime: function(val) { if (!isDefined(val)) { return val } var parsedVal; var numVal = Number(val); if (!isNaN(numVal)) { parsedVal = new Date(numVal) } else { parsedVal = dateSerialization.deserializeDate(val) } if (isNaN(Number(parsedVal))) { parsedVal = void 0 } return parsedVal } }; function correctValueType(type) { return "numeric" === type || "datetime" === type || "string" === type ? type : "" } module.exports = { correctValueType: correctValueType, getParser: function(valueType) { return parsers[correctValueType(valueType)] || noop } }; module.exports.parsers = parsers }, /*!********************************************************!*\ !*** ./artifacts/transpiled/viz/series/base_series.js ***! \********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var seriesNS = {}; var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var _each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var pointModule = __webpack_require__( /*! ./points/base_point */ 767); var _isDefined = typeUtils.isDefined; var vizUtils = __webpack_require__( /*! ../core/utils */ 10); var _isEmptyObject = typeUtils.isEmptyObject; var _normalizeEnum = vizUtils.normalizeEnum; var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var states = __webpack_require__( /*! ../components/consts */ 117).states; var rangeCalculator = __webpack_require__( /*! ./helpers/range_data_calculator */ 247); var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106); var lineSeries = __webpack_require__( /*! ./line_series */ 203); var areaSeries = __webpack_require__( /*! ./area_series */ 165); var barSeries = __webpack_require__( /*! ./bar_series */ 143); var rangeSeries = __webpack_require__( /*! ./range_series */ 772); var bubbleSeries = __webpack_require__( /*! ./bubble_series */ 773); var pieSeries = __webpack_require__( /*! ./pie_series */ 774); var financialSeries = __webpack_require__( /*! ./financial_series */ 775); var stackedSeries = __webpack_require__( /*! ./stacked_series */ 776); var DISCRETE = "discrete"; var SELECTED_STATE = states.selectedMark; var HOVER_STATE = states.hoverMark; var HOVER = states.hover; var NORMAL = states.normal; var SELECTION = states.selection; var APPLY_SELECTED = states.applySelected; var APPLY_HOVER = states.applyHover; var RESET_ITEM = states.resetItem; var NONE_MODE = "none"; var INCLUDE_POINTS = "includepoints"; var NEAREST_POINT = "nearestpoint"; var SERIES_SELECTION_CHANGED = "seriesSelectionChanged"; var POINT_SELECTION_CHANGED = "pointSelectionChanged"; var SERIES_HOVER_CHANGED = "seriesHoverChanged"; var POINT_HOVER_CHANGED = "pointHoverChanged"; var ALL_SERIES_POINTS = "allseriespoints"; var ALL_ARGUMENT_POINTS = "allargumentpoints"; var POINT_HOVER = "pointHover"; var CLEAR_POINT_HOVER = "clearPointHover"; var SERIES_SELECT = "seriesSelect"; var POINT_SELECT = "pointSelect"; var POINT_DESELECT = "pointDeselect"; var getEmptyBusinessRange = function() { return { arg: {}, val: {} } }; function triggerEvent(element, event, point) { element && element.trigger(event, point) } seriesNS.mixins = { chart: {}, pie: {}, polar: {} }; seriesNS.mixins.chart.scatter = scatterSeries.chart; seriesNS.mixins.polar.scatter = scatterSeries.polar; _extend(seriesNS.mixins.pie, pieSeries); _extend(seriesNS.mixins.chart, lineSeries.chart, areaSeries.chart, barSeries.chart, rangeSeries.chart, bubbleSeries.chart, financialSeries, stackedSeries.chart); _extend(seriesNS.mixins.polar, lineSeries.polar, areaSeries.polar, barSeries.polar, rangeSeries.polar, bubbleSeries.polar, stackedSeries.polar); function includePointsMode(mode) { mode = _normalizeEnum(mode); return mode === INCLUDE_POINTS || mode === ALL_SERIES_POINTS } function getLabelOptions(labelOptions, defaultColor) { var opt = labelOptions || {}; var labelFont = _extend({}, opt.font) || {}; var labelBorder = opt.border || {}; var labelConnector = opt.connector || {}; var backgroundAttr = { fill: opt.backgroundColor || defaultColor, "stroke-width": labelBorder.visible ? labelBorder.width || 0 : 0, stroke: labelBorder.visible && labelBorder.width ? labelBorder.color : "none", dashStyle: labelBorder.dashStyle }; var connectorAttr = { stroke: labelConnector.visible && labelConnector.width ? labelConnector.color || defaultColor : "none", "stroke-width": labelConnector.visible ? labelConnector.width || 0 : 0 }; labelFont.color = "none" === opt.backgroundColor && "#ffffff" === _normalizeEnum(labelFont.color) && "inside" !== opt.position ? defaultColor : labelFont.color; return { alignment: opt.alignment, format: opt.format, argumentFormat: opt.argumentFormat, customizeText: typeUtils.isFunction(opt.customizeText) ? opt.customizeText : void 0, attributes: { font: labelFont }, visible: 0 !== labelFont.size ? opt.visible : false, showForZeroValues: opt.showForZeroValues, horizontalOffset: opt.horizontalOffset, verticalOffset: opt.verticalOffset, radialOffset: opt.radialOffset, background: backgroundAttr, position: opt.position, connector: connectorAttr, rotationAngle: opt.rotationAngle, wordWrap: opt.wordWrap, textOverflow: opt.textOverflow, cssClass: opt.cssClass } } function setPointHoverState(point, legendCallback) { point.fullState |= HOVER_STATE; point.applyView(legendCallback) } function releasePointHoverState(point, legendCallback) { point.fullState &= ~HOVER_STATE; point.applyView(legendCallback); point.releaseHoverState() } function setPointSelectedState(point, legendCallback) { point.fullState |= SELECTED_STATE; point.applyView(legendCallback) } function releasePointSelectedState(point, legendCallback) { point.fullState &= ~SELECTED_STATE; point.applyView(legendCallback) } function mergePointOptionsCore(base, extra) { var options = _extend({}, base, extra); options.border = _extend({}, base && base.border, extra && extra.border); return options } function mergePointOptions(base, extra) { var options = mergePointOptionsCore(base, extra); options.image = _extend(true, {}, base.image, extra.image); options.selectionStyle = mergePointOptionsCore(base.selectionStyle, extra.selectionStyle); options.hoverStyle = mergePointOptionsCore(base.hoverStyle, extra.hoverStyle); return options } function Series(settings, options) { var that = this; that.fullState = 0; that._extGroups = settings; that._renderer = settings.renderer; that._group = settings.renderer.g().attr({ "class": "dxc-series" }); that._eventTrigger = settings.eventTrigger; that._eventPipe = settings.eventPipe; that._incidentOccurred = settings.incidentOccurred; that._legendCallback = _noop; that.updateOptions(options, settings) } function getData(pointData) { return pointData.data } exports.Series = Series; exports.mixins = seriesNS.mixins; Series.prototype = { constructor: Series, _createLegendState: _noop, getLegendStyles: function() { return this._styles.legendStyles }, _createStyles: function(options) { var that = this; var mainSeriesColor = options.mainSeriesColor; that._styles = { normal: that._parseStyle(options, mainSeriesColor, mainSeriesColor), hover: that._parseStyle(options.hoverStyle || {}, mainSeriesColor, mainSeriesColor), selection: that._parseStyle(options.selectionStyle || {}, mainSeriesColor, mainSeriesColor), legendStyles: { normal: that._createLegendState(options, mainSeriesColor), hover: that._createLegendState(options.hoverStyle || {}, mainSeriesColor), selection: that._createLegendState(options.selectionStyle || {}, mainSeriesColor) } } }, setClippingParams: function(baseId, wideId, forceClipping) { this._paneClipRectID = baseId; this._widePaneClipRectID = wideId; this._forceClipping = forceClipping }, applyClip: function() { this._group.attr({ "clip-path": this._paneClipRectID }) }, resetClip: function() { this._group.attr({ "clip-path": null }) }, getTagField: function() { return this._options.tagField || "tag" }, getValueFields: _noop, getSizeField: _noop, getArgumentField: _noop, getPoints: function() { return this._points }, getPointsInViewPort: function() { return rangeCalculator.getPointsInViewPort(this) }, _createPoint: function(data, index, oldPoint) { data.index = index; var that = this; var pointsByArgument = that.pointsByArgument; var options = that._getCreatingPointOptions(data); var arg = data.argument.valueOf(); var point = oldPoint; if (point) { point.update(data, options) } else { point = new pointModule.Point(that, data, options); if (that.isSelected() && includePointsMode(that.lastSelectionMode)) { point.setView(SELECTION) } } var pointByArgument = pointsByArgument[arg]; if (pointByArgument) { pointByArgument.push(point) } else { pointsByArgument[arg] = [point] } if (point.hasValue()) { that.customizePoint(point, data) } return point }, getRangeData: function() { return this._visible ? this._getRangeData() : getEmptyBusinessRange() }, getArgumentRange: function() { return this._visible ? rangeCalculator.getArgumentRange(this) : getEmptyBusinessRange() }, getViewport: function() { return rangeCalculator.getViewport(this) }, _deleteGroup: function(groupName) { var group = this[groupName]; if (group) { group.dispose(); this[groupName] = null } }, updateOptions: function(newOptions, settings) { var that = this; var widgetType = newOptions.widgetType; var oldType = that.type; var newType = newOptions.type; that.type = newType && _normalizeEnum(newType.toString()); if (!that._checkType(widgetType) || that._checkPolarBarType(widgetType, newOptions)) { that.dispose(); that.isUpdated = false; return } if (oldType !== that.type) { that._firstDrawing = true; that._resetType(oldType, widgetType); that._setType(that.type, widgetType) } else { that._defineDrawingState() } that._options = newOptions; that._pointOptions = null; that.name = newOptions.name; that.pane = newOptions.pane; that.tag = newOptions.tag; if (settings) { that._seriesModes = settings.commonSeriesModes || that._seriesModes; that._valueAxis = settings.valueAxis || that._valueAxis; that.axis = that._valueAxis && that._valueAxis.name; that._argumentAxis = settings.argumentAxis || that._argumentAxis } that._createStyles(newOptions); that._stackName = null; that._updateOptions(newOptions); that._visible = newOptions.visible; that.isUpdated = true; that.stack = newOptions.stack; that.barOverlapGroup = newOptions.barOverlapGroup; that._createGroups(); that._processEmptyValue = newOptions.ignoreEmptyPoints ? function(x) { return null === x ? void 0 : x } : function(x) { return x } }, _defineDrawingState: function() { this._firstDrawing = true }, _disposePoints: function(points) { _each(points || [], function(_, p) { p.dispose() }) }, updateDataType: function(settings) { var that = this; that.argumentType = settings.argumentType; that.valueType = settings.valueType; that.argumentAxisType = settings.argumentAxisType; that.valueAxisType = settings.valueAxisType; that.showZero = settings.showZero; return that }, getOptions: function() { return this._options }, _getOldPoint: function(data, oldPointsByArgument, index) { var arg = data.argument && data.argument.valueOf(); var point = (oldPointsByArgument[arg] || [])[0]; if (point) { oldPointsByArgument[arg].splice(0, 1) } return point }, updateData: function(data) { var that = this; var options = that._options; var nameField = options.nameField; data = data || []; if (data.length) { that._canRenderCompleteHandle = true } var dataSelector = this._getPointDataSelector(); var itemsWithoutArgument = 0; that._data = data.reduce(function(data, dataItem, index) { var pointDataItem = dataSelector(dataItem); if (_isDefined(pointDataItem.argument)) { if (!nameField || dataItem[nameField] === options.nameFieldValue) { pointDataItem.index = index; data.push(pointDataItem) } } else { itemsWithoutArgument++ } return data }, []); if (itemsWithoutArgument && itemsWithoutArgument === data.length) { that._incidentOccurred("W2002", [that.name, that.getArgumentField()]) } that._endUpdateData() }, _getData: function() { var data = this._data || []; if (this.useAggregation()) { data = this._resample(this.getArgumentAxis().getAggregationInfo(this._useAllAggregatedPoints, this.argumentAxisType !== DISCRETE ? this.getArgumentRange() : {}), data) } return data }, useAggregation: function() { var aggregation = this.getOptions().aggregation; return aggregation && aggregation.enabled }, autoHidePointMarkersEnabled: _noop, usePointsToDefineAutoHiding: _noop, createPoints: function(useAllAggregatedPoints) { this._normalizeUsingAllAggregatedPoints(useAllAggregatedPoints); this._createPoints() }, _normalizeUsingAllAggregatedPoints: function(useAllAggregatedPoints) { this._useAllAggregatedPoints = this.useAggregation() && (this.argumentAxisType === DISCRETE || (this._data || []).length > 1 && !!useAllAggregatedPoints) }, _createPoints: function() { var that = this; var oldPointsByArgument = that.pointsByArgument || {}; var data = that._getData(); that.pointsByArgument = {}; that._calculateErrorBars(data); var skippedFields = {}; var points = data.reduce(function(points, pointDataItem) { if (that._checkData(pointDataItem, skippedFields)) { var pointIndex = points.length; var oldPoint = that._getOldPoint(pointDataItem, oldPointsByArgument, pointIndex); var point = that._createPoint(pointDataItem, pointIndex, oldPoint); points.push(point) } return points }, []); for (var field in skippedFields) { if (skippedFields[field] === data.length) { that._incidentOccurred("W2002", [that.name, field]) } } Object.keys(oldPointsByArgument).forEach(function(key) { return that._disposePoints(oldPointsByArgument[key]) }); that._points = points }, _removeOldSegments: function() { var that = this; var startIndex = that._segments.length; _each(that._graphics.splice(startIndex, that._graphics.length) || [], function(_, elem) { that._removeElement(elem) }); if (that._trackers) { _each(that._trackers.splice(startIndex, that._trackers.length) || [], function(_, elem) { elem.remove() }) } }, _drawElements: function(animationEnabled, firstDrawing, translateAllPoints) { var that = this; var points = that._points || []; var closeSegment = points[0] && points[0].hasValue() && that._options.closed; var groupForPoint = { markers: that._markersGroup, errorBars: that._errorBarGroup }; that._drawnPoints = []; that._graphics = that._graphics || []; that._segments = []; var segments = points.reduce(function(segments, p) { var segment = segments[segments.length - 1]; if (!p.translated || translateAllPoints) { p.translate(); !translateAllPoints && p.setDefaultCoords() } if (p.hasValue() && p.hasCoords()) { translateAllPoints && that._drawPoint({ point: p, groups: groupForPoint, hasAnimation: animationEnabled, firstDrawing: firstDrawing }); segment.push(p) } else { if (!p.hasValue()) { segment.length && segments.push([]) } else { p.setInvisibility() } } return segments }, [ [] ]); segments.forEach(function(segment, index) { if (segment.length) { that._drawSegment(segment, animationEnabled, index, closeSegment && index === this.length - 1) } }, segments); that._firstDrawing = points.length ? false : true; that._removeOldSegments(); animationEnabled && that._animate(firstDrawing) }, draw: function(animationEnabled, hideLayoutLabels, legendCallback) { var that = this; var firstDrawing = that._firstDrawing; that._legendCallback = legendCallback || that._legendCallback; if (!that._visible) { animationEnabled = false; that._group.remove(); return } that._appendInGroup(); that._applyVisibleArea(); that._setGroupsSettings(animationEnabled, firstDrawing); !firstDrawing && that._drawElements(false, firstDrawing, false); that._drawElements(animationEnabled, firstDrawing, true); hideLayoutLabels && that.hideLabels(); if (that.isSelected()) { that._changeStyle(that.lastSelectionMode, void 0, true) } else { if (that.isHovered()) { that._changeStyle(that.lastHoverMode, void 0, true) } } }, _setLabelGroupSettings: function(animationEnabled) { var settings = { "class": "dxc-labels", "pointer-events": "none" }; this._applyElementsClipRect(settings); this._applyClearingSettings(settings); animationEnabled && (settings.opacity = .001); this._labelsGroup.attr(settings).append(this._extGroups.labelsGroup) }, _checkType: function(widgetType) { return !!seriesNS.mixins[widgetType][this.type] }, _checkPolarBarType: function(widgetType, options) { return "polar" === widgetType && options.spiderWidget && this.type.indexOf("bar") !== -1 }, _resetType: function(seriesType, widgetType) { var methodName; var methods; if (seriesType) { methods = seriesNS.mixins[widgetType][seriesType]; for (methodName in methods) { delete this[methodName] } } }, _setType: function(seriesType, widgetType) { var methodName; var methods = seriesNS.mixins[widgetType][seriesType]; for (methodName in methods) { this[methodName] = methods[methodName] } }, _setPointsView: function(view, target) { this.getPoints().forEach(function(point) { if (target !== point) { point.setView(view) } }) }, _resetPointsView: function(view, target) { this.getPoints().forEach(function(point) { if (target !== point) { point.resetView(view) } }) }, _resetNearestPoint: function() { var that = this; that._nearestPoint && null !== that._nearestPoint.series && that._nearestPoint.resetView(HOVER); that._nearestPoint = null }, _setSelectedState: function(mode) { var that = this; that.lastSelectionMode = _normalizeEnum(mode || that._options.selectionMode); that.fullState = that.fullState | SELECTED_STATE; that._resetNearestPoint(); that._changeStyle(that.lastSelectionMode); if (that.lastSelectionMode !== NONE_MODE && that.isHovered() && includePointsMode(that.lastHoverMode)) { that._resetPointsView(HOVER) } }, _releaseSelectedState: function() { var that = this; that.fullState = that.fullState & ~SELECTED_STATE; that._changeStyle(that.lastSelectionMode, SELECTION); if (that.lastSelectionMode !== NONE_MODE && that.isHovered() && includePointsMode(that.lastHoverMode)) { that._setPointsView(HOVER) } }, isFullStackedSeries: function() { return 0 === this.type.indexOf("fullstacked") }, isStackedSeries: function() { return 0 === this.type.indexOf("stacked") }, isFinancialSeries: function() { return "stock" === this.type || "candlestick" === this.type }, _canChangeView: function() { return !this.isSelected() && _normalizeEnum(this._options.hoverMode) !== NONE_MODE }, _changeStyle: function(mode, resetView, skipPoints) { var that = this; var state = that.fullState; var styles = [NORMAL, HOVER, SELECTION, SELECTION]; if ("none" === that.lastHoverMode) { state &= ~HOVER_STATE } if ("none" === that.lastSelectionMode) { state &= ~SELECTED_STATE } if (includePointsMode(mode) && !skipPoints) { if (!resetView) { that._setPointsView(styles[state]) } else { that._resetPointsView(resetView) } } that._legendCallback([RESET_ITEM, APPLY_HOVER, APPLY_SELECTED, APPLY_SELECTED][state]); that._applyStyle(that._styles[styles[state]]) }, updateHover: function(x, y) { var that = this; var currentNearestPoint = that._nearestPoint; var point = that.isHovered() && that.lastHoverMode === NEAREST_POINT && that.getNeighborPoint(x, y); if (point !== currentNearestPoint && !(that.isSelected() && that.lastSelectionMode !== NONE_MODE)) { that._resetNearestPoint(); if (point) { point.setView(HOVER); that._nearestPoint = point } } }, _getMainAxisName: function() { return this._options.rotated ? "X" : "Y" }, areLabelsVisible: function() { return !_isDefined(this._options.maxLabelCount) || this._points.length <= this._options.maxLabelCount }, getLabelVisibility: function() { return this.areLabelsVisible() && this._options.label && this._options.label.visible }, customizePoint: function customizePoint(point, pointData) { var that = this; var options = that._options; var customizePoint = options.customizePoint; var customizeObject; var pointOptions; var customLabelOptions; var customOptions; var customizeLabel = options.customizeLabel; var useLabelCustomOptions; var usePointCustomOptions; if (customizeLabel && customizeLabel.call) { customizeObject = _extend({ seriesName: that.name }, pointData); customizeObject.series = that; customLabelOptions = customizeLabel.call(customizeObject, customizeObject); useLabelCustomOptions = customLabelOptions && !_isEmptyObject(customLabelOptions); customLabelOptions = useLabelCustomOptions ? _extend(true, {}, options.label, customLabelOptions) : null } if (customizePoint && customizePoint.call) { customizeObject = customizeObject || _extend({ seriesName: that.name }, pointData); customizeObject.series = that; customOptions = customizePoint.call(customizeObject, customizeObject); usePointCustomOptions = customOptions && !_isEmptyObject(customOptions) } if (useLabelCustomOptions || usePointCustomOptions) { pointOptions = that._parsePointOptions(that._preparePointOptions(customOptions), customLabelOptions || options.label, pointData, point); pointOptions.styles.useLabelCustomOptions = useLabelCustomOptions; pointOptions.styles.usePointCustomOptions = usePointCustomOptions; point.updateOptions(pointOptions) } }, show: function() { if (!this._visible) { this._changeVisibility(true) } }, hide: function() { if (this._visible) { this._changeVisibility(false) } }, _changeVisibility: function(visibility) { var that = this; that._visible = that._options.visible = visibility; that._updatePointsVisibility(); that.hidePointTooltip(); that._options.visibilityChanged(that) }, _updatePointsVisibility: _noop, hideLabels: function() { _each(this._points, function(_, point) { point._label.draw(false) }) }, _parsePointOptions: function(pointOptions, labelOptions, data, point) { var that = this; var options = that._options; var styles = that._createPointStyles(pointOptions, data, point); var parsedOptions = _extend({}, pointOptions, { type: options.type, rotated: options.rotated, styles: styles, widgetType: options.widgetType, visibilityChanged: options.visibilityChanged }); parsedOptions.label = getLabelOptions(labelOptions, styles.normal.fill); if (that.areErrorBarsVisible()) { parsedOptions.errorBars = options.valueErrorBar } return parsedOptions }, _preparePointOptions: function(customOptions) { var pointOptions = this._getOptionsForPoint(); return customOptions ? mergePointOptions(pointOptions, customOptions) : pointOptions }, _getMarkerGroupOptions: function() { return _extend(false, {}, this._getOptionsForPoint(), { hoverStyle: {}, selectionStyle: {} }) }, _getAggregationMethod: function(isDiscrete) { var options = this.getOptions().aggregation; var method = _normalizeEnum(options.method); var customAggregator = "custom" === method && options.calculate; var aggregator; if (isDiscrete) { aggregator = function(_ref) { var data = _ref.data; return data[0] } } else { aggregator = this._aggregators[method] || this._aggregators[this._defaultAggregator] } return customAggregator || aggregator }, _resample: function(_ref2, data) { var interval = _ref2.interval, ticks = _ref2.ticks; var that = this; var isDiscrete = that.argumentAxisType === DISCRETE || that.valueAxisType === DISCRETE; var dataIndex = 0; var dataSelector = this._getPointDataSelector(); var options = that.getOptions(); var addAggregatedData = function(target, data, aggregationInfo) { if (!data) { return } var processData = function(d) { var pointData = d && dataSelector(d, options); if (pointData && that._checkData(pointData)) { pointData.aggregationInfo = aggregationInfo; target.push(pointData) } }; if (data.length) { data.forEach(processData) } else { processData(data) } }; var aggregationMethod = this._getAggregationMethod(isDiscrete); if (isDiscrete) { return data.reduce(function(result, dataItem, index, data) { result[1].push(dataItem); if (index === data.length - 1 || (index + 1) % interval === 0) { var dataInInterval = result[1]; var aggregationInfo = { aggregationInterval: interval, data: dataInInterval.map(getData) }; addAggregatedData(result[0], aggregationMethod(aggregationInfo, that)); result[1] = [] } return result }, [ [], [] ])[0] } var aggregatedData = []; for (var i = 1; i < ticks.length; i++) { var intervalEnd = ticks[i]; var intervalStart = ticks[i - 1]; var dataInInterval = []; while (data[dataIndex] && data[dataIndex].argument < intervalEnd) { if (data[dataIndex].argument >= intervalStart) { dataInInterval.push(data[dataIndex]) } dataIndex++ } var aggregationInfo = { intervalStart: intervalStart, intervalEnd: intervalEnd, aggregationInterval: interval, data: dataInInterval.map(getData) }; addAggregatedData(aggregatedData, aggregationMethod(aggregationInfo, that), aggregationInfo) } that._endUpdateData(); return aggregatedData }, canRenderCompleteHandle: function() { var result = this._canRenderCompleteHandle; delete this._canRenderCompleteHandle; return !!result }, isHovered: function() { return !!(1 & this.fullState) }, isSelected: function() { return !!(2 & this.fullState) }, isVisible: function() { return this._visible }, getAllPoints: function() { this._createAllAggregatedPoints(); return (this._points || []).slice() }, getPointByPos: function(pos) { this._createAllAggregatedPoints(); return (this._points || [])[pos] }, getVisiblePoints: function() { return (this._drawnPoints || []).slice() }, selectPoint: function(point) { if (!point.isSelected()) { setPointSelectedState(point, this._legendCallback); this._eventPipe({ action: POINT_SELECT, target: point }); this._eventTrigger(POINT_SELECTION_CHANGED, { target: point }) } }, deselectPoint: function(point) { if (point.isSelected()) { releasePointSelectedState(point, this._legendCallback); this._eventPipe({ action: POINT_DESELECT, target: point }); this._eventTrigger(POINT_SELECTION_CHANGED, { target: point }) } }, hover: function(mode) { var that = this; var eventTrigger = that._eventTrigger; if (that.isHovered()) { return } that.lastHoverMode = _normalizeEnum(mode || that._options.hoverMode); that.fullState = that.fullState | HOVER_STATE; that._changeStyle(that.lastHoverMode, void 0, that.isSelected() && that.lastSelectionMode !== NONE_MODE); eventTrigger(SERIES_HOVER_CHANGED, { target: that }) }, clearHover: function() { var that = this; var eventTrigger = that._eventTrigger; if (!that.isHovered()) { return } that._resetNearestPoint(); that.fullState = that.fullState & ~HOVER_STATE; that._changeStyle(that.lastHoverMode, HOVER, that.isSelected() && that.lastSelectionMode !== NONE_MODE); eventTrigger(SERIES_HOVER_CHANGED, { target: that }) }, hoverPoint: function(point) { var that = this; if (!point.isHovered()) { point.clearHover(); setPointHoverState(point, that._legendCallback); that._canChangeView() && that._applyStyle(that._styles.hover); that._eventPipe({ action: POINT_HOVER, target: point }); that._eventTrigger(POINT_HOVER_CHANGED, { target: point }) } }, clearPointHover: function() { var that = this; that.getPoints().some(function(currentPoint) { if (currentPoint.isHovered()) { releasePointHoverState(currentPoint, that._legendCallback); that._canChangeView() && that._applyStyle(that._styles.normal); that._eventPipe({ action: CLEAR_POINT_HOVER, target: currentPoint }); that._eventTrigger(POINT_HOVER_CHANGED, { target: currentPoint }); return true } return false }) }, showPointTooltip: function(point) { triggerEvent(this._extGroups.seriesGroup, "showpointtooltip", point) }, hidePointTooltip: function(point) { triggerEvent(this._extGroups.seriesGroup, "hidepointtooltip", point) }, select: function() { var that = this; if (!that.isSelected()) { that._setSelectedState(that._options.selectionMode); that._eventPipe({ action: SERIES_SELECT, target: that }); that._group.toForeground(); that._eventTrigger(SERIES_SELECTION_CHANGED, { target: that }) } }, clearSelection: function() { var that = this; if (that.isSelected()) { that._releaseSelectedState(); that._eventTrigger(SERIES_SELECTION_CHANGED, { target: that }) } }, getPointsByArg: function(arg, skipPointsCreation) { var that = this; var argValue = arg.valueOf(); var points = that.pointsByArgument[argValue]; if (!points && !skipPointsCreation && that._createAllAggregatedPoints()) { points = that.pointsByArgument[argValue] } return points || [] }, _createAllAggregatedPoints: function() { if (this.useAggregation() && !this._useAllAggregatedPoints) { this.createPoints(true); return true } return false }, getPointsByKeys: function(arg) { return this.getPointsByArg(arg) }, notify: function(data) { var that = this; var action = data.action; var seriesModes = that._seriesModes; var target = data.target; var targetOptions = target.getOptions(); var pointHoverMode = _normalizeEnum(targetOptions.hoverMode); var selectionModeOfPoint = _normalizeEnum(targetOptions.selectionMode); if (action === POINT_HOVER) { that._hoverPointHandler(target, pointHoverMode, data.notifyLegend) } else { if (action === CLEAR_POINT_HOVER) { that._clearPointHoverHandler(target, pointHoverMode, data.notifyLegend) } else { if (action === SERIES_SELECT) { target !== that && "single" === seriesModes.seriesSelectionMode && that.clearSelection() } else { if (action === POINT_SELECT) { if ("single" === seriesModes.pointSelectionMode) { that.getPoints().some(function(currentPoint) { if (currentPoint !== target && currentPoint.isSelected()) { that.deselectPoint(currentPoint); return true } return false }) } that._selectPointHandler(target, selectionModeOfPoint) } else { if (action === POINT_DESELECT) { that._deselectPointHandler(target, selectionModeOfPoint) } } } } } }, _selectPointHandler: function(target, mode) { var that = this; if (mode === ALL_SERIES_POINTS) { target.series === that && that._setPointsView(SELECTION, target) } else { if (mode === ALL_ARGUMENT_POINTS) { that.getPointsByKeys(target.argument, target.argumentIndex).forEach(function(currentPoint) { currentPoint !== target && currentPoint.setView(SELECTION) }) } } }, _deselectPointHandler: function(target, mode) { if (mode === ALL_SERIES_POINTS) { target.series === this && this._resetPointsView(SELECTION, target) } else { if (mode === ALL_ARGUMENT_POINTS) { this.getPointsByKeys(target.argument, target.argumentIndex).forEach(function(currentPoint) { currentPoint !== target && currentPoint.resetView(SELECTION) }) } } }, _hoverPointHandler: function(target, mode, notifyLegend) { var that = this; if (target.series !== that && mode === ALL_ARGUMENT_POINTS) { that.getPointsByKeys(target.argument, target.argumentIndex).forEach(function(currentPoint) { currentPoint.setView(HOVER) }); notifyLegend && that._legendCallback(target) } else { if (mode === ALL_SERIES_POINTS && target.series === that) { that._setPointsView(HOVER, target) } } }, _clearPointHoverHandler: function(target, mode, notifyLegend) { var that = this; if (mode === ALL_ARGUMENT_POINTS) { target.series !== that && that.getPointsByKeys(target.argument, target.argumentIndex).forEach(function(currentPoint) { currentPoint.resetView(HOVER) }); notifyLegend && that._legendCallback(target) } else { if (mode === ALL_SERIES_POINTS && target.series === that) { that._resetPointsView(HOVER, target) } } }, _deletePoints: function() { var that = this; that._disposePoints(that._points); that._points = that._drawnPoints = null }, _deleteTrackers: function() { var that = this; _each(that._trackers || [], function(_, tracker) { tracker.remove() }); that._trackersGroup && that._trackersGroup.dispose(); that._trackers = that._trackersGroup = null }, dispose: function() { var that = this; that._deletePoints(); that._group.dispose(); that._labelsGroup && that._labelsGroup.dispose(); that._errorBarGroup && that._errorBarGroup.dispose(); that._deleteTrackers(); that._group = that._extGroups = that._markersGroup = that._elementsGroup = that._bordersGroup = that._labelsGroup = that._errorBarGroup = that._graphics = that._rangeData = that._renderer = that._styles = that._options = that._pointOptions = that._drawnPoints = that.pointsByArgument = that._segments = that._prevSeries = null }, correctPosition: _noop, drawTrackers: _noop, getNeighborPoint: _noop, areErrorBarsVisible: _noop, getMarginOptions: function() { return this._patchMarginOptions({ percentStick: this.isFullStackedSeries() }) }, getColor: function() { return this.getLegendStyles().normal.fill }, getOpacity: function() { return this._options.opacity }, getStackName: function() { return this._stackName }, getBarOverlapGroup: function() { return this._options.barOverlapGroup }, getPointByCoord: function(x, y) { var point = this.getNeighborPoint(x, y); return point && point.coordsIn(x, y) ? point : null }, getValueAxis: function() { return this._valueAxis }, getArgumentAxis: function() { return this._argumentAxis }, getMarkersGroup: function() { return this._markersGroup }, getRenderer: function() { return this._renderer } } }, /*!*********************************************************!*\ !*** ./artifacts/transpiled/viz/series/points/label.js ***! \*********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _format_helper = __webpack_require__( /*! ../../../format_helper */ 64); var _utils = __webpack_require__( /*! ../../core/utils */ 10); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 3); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 0); var _math = Math; var _round = _math.round; var _floor = _math.floor; var _abs = _math.abs; var CONNECTOR_LENGTH = 12; var LABEL_BACKGROUND_PADDING_X = 8; var LABEL_BACKGROUND_PADDING_Y = 4; function getClosestCoord(point, coords) { var closestDistance = 1 / 0; var closestCoord; (0, _iterator.each)(coords, function(_, coord) { var x = point[0] - coord[0]; var y = point[1] - coord[1]; var distance = x * x + y * y; if (distance < closestDistance) { closestDistance = distance; closestCoord = coord } }); return [_floor(closestCoord[0]), _floor(closestCoord[1])] } function getCrossCoord(rect, coord, indexOffset) { return (coord - rect[0 + indexOffset]) / (rect[2 + indexOffset] - rect[0 + indexOffset]) * (rect[3 - indexOffset] - rect[1 - indexOffset]) + rect[1 - indexOffset] } var barPointStrategy = { isLabelInside: function(labelPoint, figure) { var xc = labelPoint.x + labelPoint.width / 2; var yc = labelPoint.y + labelPoint.height / 2; return figure.x <= xc && xc <= figure.x + figure.width && figure.y <= yc && yc <= figure.y + figure.height }, prepareLabelPoints: function(bBox, rotatedBBox, isHorizontal, angle, figureCenter) { var x1 = rotatedBBox.x; var xc = x1 + rotatedBBox.width / 2; var x2 = x1 + rotatedBBox.width - 1; var y1 = rotatedBBox.y; var yc = y1 + rotatedBBox.height / 2; var y2 = y1 + rotatedBBox.height - 1; var labelPoints; var isRectangular = _abs(angle) % 90 === 0; if (figureCenter[0] > x1 && figureCenter[0] < x2) { if (isRectangular) { labelPoints = [ [figureCenter[0], _abs(figureCenter[1] - y1) < _abs(figureCenter[1] - y2) ? y1 : y2] ] } else { labelPoints = [ [figureCenter[0], getCrossCoord([x1, y1, x2, y2], figureCenter[0], 0)] ] } } else { if (figureCenter[1] > y1 && figureCenter[1] < y2) { if (isRectangular) { labelPoints = [ [_abs(figureCenter[0] - x1) < _abs(figureCenter[0] - x2) ? x1 : x2, figureCenter[1]] ] } else { labelPoints = [ [getCrossCoord([x1, y1, x2, y2], figureCenter[1], 1), figureCenter[1]] ] } } else { if (isRectangular) { labelPoints = [ [x1, y1], [isHorizontal ? x1 : xc, isHorizontal ? yc : y1], [x2, y1], [x1, y2], [isHorizontal ? x2 : xc, isHorizontal ? yc : y2], [x2, y2] ] } else { labelPoints = [ [xc, yc] ] } } } return labelPoints }, isHorizontal: function(bBox, figure) { return bBox.x > figure.x + figure.width || bBox.x + bBox.width < figure.x }, getFigureCenter: function(figure) { return [_floor(figure.x + figure.width / 2), _floor(figure.y + figure.height / 2)] }, findFigurePoint: function(figure, labelPoint) { var figureCenter = barPointStrategy.getFigureCenter(figure); var point = getClosestCoord(labelPoint, [ [figure.x, figureCenter[1]], [figureCenter[0], figure.y + figure.height], [figure.x + figure.width, figureCenter[1]], [figureCenter[0], figure.y] ]); return point }, adjustPoints: function(points) { var lineIsVertical = _abs(points[1] - points[3]) <= 1; var lineIsHorizontal = _abs(points[0] - points[2]) <= 1; if (lineIsHorizontal) { points[0] = points[2] } if (lineIsVertical) { points[1] = points[3] } return points } }; var symbolPointStrategy = { isLabelInside: function() { return false }, prepareLabelPoints: barPointStrategy.prepareLabelPoints, isHorizontal: function(bBox, figure) { return bBox.x > figure.x + figure.r || bBox.x + bBox.width < figure.x - figure.r }, getFigureCenter: function(figure) { return [figure.x, figure.y] }, findFigurePoint: function(figure, labelPoint) { var angle = Math.atan2(figure.y - labelPoint[1], labelPoint[0] - figure.x); return [_round(figure.x + figure.r * Math.cos(angle)), _round(figure.y - figure.r * Math.sin(angle))] }, adjustPoints: barPointStrategy.adjustPoints }; var piePointStrategy = { isLabelInside: function(_0, _1, isOutside) { return !isOutside }, prepareLabelPoints: function(bBox, rotatedBBox, isHorizontal, angle) { var xl = bBox.x; var xr = xl + bBox.width; var xc = xl + _round(bBox.width / 2); var yt = bBox.y; var yb = yt + bBox.height; var yc = yt + _round(bBox.height / 2); var points = [ [ [xl, yt], [xr, yt] ], [ [xr, yt], [xr, yb] ], [ [xr, yb], [xl, yb] ], [ [xl, yb], [xl, yt] ] ]; var cosSin = (0, _utils.getCosAndSin)(angle); if (0 === angle) { points = isHorizontal ? [ [xl, yc], [xr, yc] ] : [ [xc, yt], [xc, yb] ] } else { points = points.map(function(pair) { return pair.map(function(point) { return [_round((point[0] - xc) * cosSin.cos + (point[1] - yc) * cosSin.sin + xc), _round(-(point[0] - xc) * cosSin.sin + (point[1] - yc) * cosSin.cos + yc)] }) }).reduce(function(r, pair) { var point1x = pair[0][0]; var point1y = pair[0][1]; var point2x = pair[1][0]; var point2y = pair[1][1]; if (isHorizontal) { if (point1y >= yc && yc >= point2y || point1y <= yc && yc <= point2y) { r.push([(yc - point1y) * (point2x - point1x) / (point2y - point1y) + point1x, yc]) } } else { if (point1x >= xc && xc >= point2x || point1x <= xc && xc <= point2x) { r.push([xc, (xc - point1x) * (point2y - point1y) / (point2x - point1x) + point1y]) } } return r }, []) } return points }, isHorizontal: function(bBox, figure) { return bBox.x > figure.x || figure.x > bBox.x + bBox.width }, getFigureCenter: symbolPointStrategy.getFigureCenter, findFigurePoint: function(figure, labelPoint, isHorizontal) { if (!isHorizontal) { return [figure.x, figure.y] } var labelX = labelPoint[0]; var x = _round(figure.x + (figure.y - labelPoint[1]) / Math.tan((0, _utils.degreesToRadians)(figure.angle))); var points = [figure.x, figure.y, x, labelPoint[1]]; if (!(figure.x <= x && x <= labelX) && !(labelX <= x && x <= figure.x)) { if (_abs(figure.x - labelX) < CONNECTOR_LENGTH) { points = [figure.x, figure.y] } else { if (figure.x <= labelX) { points[2] = figure.x + CONNECTOR_LENGTH } else { points[2] = figure.x - CONNECTOR_LENGTH } } } return points }, adjustPoints: function(points) { return points } }; function selectStrategy(figure) { return void 0 !== figure.angle && piePointStrategy || void 0 !== figure.r && symbolPointStrategy || barPointStrategy } function disposeItem(obj, field) { obj[field] && obj[field].dispose(); obj[field] = null } function checkBackground(background) { return background && (background.fill && "none" !== background.fill || background["stroke-width"] > 0 && background.stroke && "none" !== background.stroke) } function checkConnector(connector) { return connector && connector["stroke-width"] > 0 && connector.stroke && "none" !== connector.stroke } function formatText(data, options) { var format = options.format; data.valueText = (0, _format_helper.format)(data.value, format); data.argumentText = (0, _format_helper.format)(data.argument, options.argumentFormat); if (void 0 !== data.percent) { data.percentText = (0, _format_helper.format)(data.percent, { type: "percent", precision: format && format.percentPrecision }) } if (void 0 !== data.total) { data.totalText = (0, _format_helper.format)(data.total, format) } if (void 0 !== data.openValue) { data.openValueText = (0, _format_helper.format)(data.openValue, format) } if (void 0 !== data.closeValue) { data.closeValueText = (0, _format_helper.format)(data.closeValue, format) } if (void 0 !== data.lowValue) { data.lowValueText = (0, _format_helper.format)(data.lowValue, format) } if (void 0 !== data.highValue) { data.highValueText = (0, _format_helper.format)(data.highValue, format) } if (void 0 !== data.reductionValue) { data.reductionValueText = (0, _format_helper.format)(data.reductionValue, format) } return options.customizeText ? options.customizeText.call(data, data) : data.valueText } function Label(renderSettings) { this._renderer = renderSettings.renderer; this._container = renderSettings.labelsGroup; this._point = renderSettings.point; this._strategy = renderSettings.strategy; this._rowCount = 1 } Label.prototype = { constructor: Label, setColor: function(color) { this._color = color }, setOptions: function(options) { this._options = options }, setData: function(data) { this._data = data }, setDataField: function(fieldName, fieldValue) { this._data = this._data || {}; this._data[fieldName] = fieldValue }, getData: function() { return this._data }, setFigureToDrawConnector: function(figure) { this._figure = figure }, dispose: function() { var that = this; disposeItem(that, "_group"); that._data = that._options = that._textContent = that._visible = that._insideGroup = that._text = that._background = that._connector = that._figure = null }, _setVisibility: function(value, state) { this._group && this._group.attr({ visibility: value }); this._visible = state }, isVisible: function() { return this._visible }, hide: function(holdInvisible) { this._holdVisibility = !!holdInvisible; this._hide() }, _hide: function() { this._setVisibility("hidden", false) }, show: function(holdVisible) { var correctPosition = !this._drawn; if (this._point.hasValue()) { this._holdVisibility = !!holdVisible; this._show(); correctPosition && this._point.correctLabelPosition(this) } }, _show: function() { var that = this; var renderer = that._renderer; var container = that._container; var options = that._options || {}; var text = that._textContent = formatText(that._data, that._options) || null; if (text) { if (!that._group) { that._group = renderer.g().append(container); that._insideGroup = renderer.g().append(that._group); that._text = renderer.text("", 0, 0).append(that._insideGroup) } that._text.css(options.attributes ? (0, _utils.patchFontOptions)(options.attributes.font) : {}); if (checkBackground(options.background)) { that._background = that._background || renderer.rect().append(that._insideGroup).toBackground(); that._background.attr(options.background); that._color && that._background.attr({ fill: that._color }) } else { disposeItem(that, "_background") } if (checkConnector(options.connector)) { that._connector = that._connector || renderer.path([], "line").sharp().append(that._group).toBackground(); that._connector.attr(options.connector); that._color && that._connector.attr({ stroke: that._color }) } else { disposeItem(that, "_connector") } that._text.attr({ text: text, align: options.textAlignment, "class": options.cssClass }); that._updateBackground(that._text.getBBox()); that._setVisibility("visible", true); that._drawn = true } else { that._hide() } }, _getLabelVisibility: function(isVisible) { return this._holdVisibility ? this.isVisible() : isVisible }, draw: function(isVisible) { if (this._getLabelVisibility(isVisible)) { this._show(); this._point && this._point.correctLabelPosition(this) } else { this._drawn = false; this._hide() } return this }, _updateBackground: function(bBox) { var that = this; if (that._background) { bBox.x -= LABEL_BACKGROUND_PADDING_X; bBox.y -= LABEL_BACKGROUND_PADDING_Y; bBox.width += 2 * LABEL_BACKGROUND_PADDING_X; bBox.height += 2 * LABEL_BACKGROUND_PADDING_Y; that._background.attr(bBox) } that._bBoxWithoutRotation = (0, _extend.extend)({}, bBox); var rotationAngle = that._options.rotationAngle || 0; that._insideGroup.rotate(rotationAngle, bBox.x + bBox.width / 2, bBox.y + bBox.height / 2); bBox = (0, _utils.rotateBBox)(bBox, [bBox.x + bBox.width / 2, bBox.y + bBox.height / 2], -rotationAngle); that._bBox = bBox }, getFigureCenter: function() { var figure = this._figure; var strategy = this._strategy || selectStrategy(figure); return strategy.getFigureCenter(figure) }, _getConnectorPoints: function() { var that = this; var figure = that._figure; var options = that._options; var strategy = that._strategy || selectStrategy(figure); var bBox = that._shiftBBox(that._bBoxWithoutRotation); var rotatedBBox = that.getBoundingRect(); var labelPoint; var points = []; var isHorizontal; if (!strategy.isLabelInside(bBox, figure, "inside" !== options.position)) { isHorizontal = strategy.isHorizontal(bBox, figure); var figureCenter = that.getFigureCenter(); points = strategy.prepareLabelPoints(bBox, rotatedBBox, isHorizontal, -options.rotationAngle || 0, figureCenter); labelPoint = getClosestCoord(figureCenter, points); points = strategy.findFigurePoint(figure, labelPoint, isHorizontal); points = points.concat(labelPoint) } return strategy.adjustPoints(points) }, fit: function(maxWidth) { var padding = this._background ? 2 * LABEL_BACKGROUND_PADDING_X : 0; var rowCountChanged = false; if (this._text) { var result = this._text.setMaxSize(maxWidth - padding, void 0, this._options); var rowCount = result.rowCount; if (0 === rowCount) { rowCount = 1 } if (rowCount !== this._rowCount) { rowCountChanged = true; this._rowCount = rowCount } result.textIsEmpty && disposeItem(this, "_background") } this._updateBackground(this._text.getBBox()); return rowCountChanged }, resetEllipsis: function() { this._text && this._text.restoreText(); this._updateBackground(this._text.getBBox()) }, setTrackerData: function(point) { this._text.data({ "chart-data-point": point }); this._background && this._background.data({ "chart-data-point": point }) }, hideInsideLabel: function(coords) { return this._point.hideInsideLabel(this, coords) }, getPoint: function() { return this._point }, shift: function(x, y) { var that = this; if (that._textContent) { that._insideGroup.attr({ translateX: that._x = _round(x - that._bBox.x), translateY: that._y = _round(y - that._bBox.y) }); if (that._connector) { that._connector.attr({ points: that._getConnectorPoints() }) } } return that }, getBoundingRect: function() { return this._shiftBBox(this._bBox) }, _shiftBBox: function(bBox) { return this._textContent ? { x: bBox.x + this._x, y: bBox.y + this._y, width: bBox.width, height: bBox.height } : {} }, getLayoutOptions: function() { var options = this._options; return { alignment: options.alignment, background: checkBackground(options.background), horizontalOffset: options.horizontalOffset, verticalOffset: options.verticalOffset, radialOffset: options.radialOffset, position: options.position, connectorOffset: (checkConnector(options.connector) ? CONNECTOR_LENGTH : 0) + (checkBackground(options.background) ? LABEL_BACKGROUND_PADDING_X : 0) } } }; exports.Label = Label; Label._DEBUG_formatText = formatText }, /*!**************************************************************************!*\ !*** ./artifacts/transpiled/viz/series/helpers/range_data_calculator.js ***! \**************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _require = __webpack_require__( /*! ../../core/utils */ 10), unique = _require.unique, getAddFunction = _require.getAddFunction; var _isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined; var noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop; var DISCRETE = "discrete"; function continuousRangeCalculator(range, minValue, maxValue) { range.min = range.min < minValue ? range.min : minValue; range.max = range.max > maxValue ? range.max : maxValue } function getRangeCalculator(axisType, axis) { if (axisType === DISCRETE) { return function(range, minValue, maxValue) { if (minValue !== maxValue) { range.categories.push(maxValue) } range.categories.push(minValue) } } if (axis) { return function(range, value) { var interval = axis.calculateInterval(value, range.prevValue); var minInterval = range.interval; range.interval = (minInterval < interval ? minInterval : interval) || minInterval; range.prevValue = value; continuousRangeCalculator(range, value, value) } } return continuousRangeCalculator } function getInitialRange(axisType, dataType, firstValue) { var range = { axisType: axisType, dataType: dataType }; if (axisType === DISCRETE) { range.categories = [] } else { range.min = firstValue; range.max = firstValue } return range } function processCategories(range) { if (range.categories) { range.categories = unique(range.categories) } } function getValueForArgument(point, extraPoint, x, range) { if (extraPoint && _isDefined(extraPoint.value)) { var y1 = point.value; var y2 = extraPoint.value; var x1 = point.argument; var x2 = extraPoint.argument; var r = (x - x1) * (y2 - y1) / (x2 - x1) + y1.valueOf(); return "datetime" === range.dataType ? new Date(r) : r } else { return point.value } } function calculateRangeBetweenPoints(rangeCalculator, range, point, prevPoint, bound) { var value = getValueForArgument(point, prevPoint, bound, range); rangeCalculator(range, value, value) } function isLineSeries(series) { return series.type.toLowerCase().indexOf("line") >= 0 || series.type.toLowerCase().indexOf("area") >= 0 } function getViewportReducer(series) { var rangeCalculator = getRangeCalculator(series.valueAxisType); var axis = series.getArgumentAxis(); var viewport = axis && series.getArgumentAxis().visualRange() || {}; var calculatePointBetweenPoints = isLineSeries(series) ? calculateRangeBetweenPoints : noop; if (axis && axis.getMarginOptions().checkInterval) { var range = series.getArgumentAxis().getTranslator().getBusinessRange(); var add = getAddFunction(range, false); var interval = range.interval; if (isFinite(interval) && _isDefined(viewport.startValue) && _isDefined(viewport.endValue)) { viewport.startValue = add(viewport.startValue, interval, -1); viewport.endValue = add(viewport.endValue, interval) } } var viewportFilter = getViewPortFilter(viewport); return function(range, point, index, points) { var argument = point.argument; if (!point.hasValue()) { return range } if (viewportFilter(argument)) { if (!range.startCalc) { range.startCalc = true; calculatePointBetweenPoints(rangeCalculator, range, point, points[index - 1], viewport.startValue) } rangeCalculator(range, point.getMinValue(), point.getMaxValue()) } else { if (!viewport.categories && _isDefined(viewport.startValue) && argument > viewport.startValue) { if (!range.startCalc) { calculatePointBetweenPoints(rangeCalculator, range, point, points[index - 1], viewport.startValue) } range.endCalc = true; calculatePointBetweenPoints(rangeCalculator, range, point, points[index - 1], viewport.endValue) } } return range } } function getViewPortFilter(viewport) { if (viewport.categories) { var dictionary = viewport.categories.reduce(function(result, category) { result[category.valueOf()] = true; return result }, {}); return function(argument) { return _isDefined(argument) && dictionary[argument.valueOf()] } } if (!_isDefined(viewport.startValue) && !_isDefined(viewport.endValue)) { return function() { return true } } if (!_isDefined(viewport.endValue)) { return function(argument) { return argument >= viewport.startValue } } if (!_isDefined(viewport.startValue)) { return function(argument) { return argument <= viewport.endValue } } return function(argument) { return argument >= viewport.startValue && argument <= viewport.endValue } } module.exports = { getViewPortFilter: getViewPortFilter, getArgumentRange: function(series) { var data = series._data || []; var range = {}; if (data.length) { if (series.argumentAxisType === DISCRETE) { range = { categories: data.map(function(item) { return item.argument }) } } else { var interval; if (data.length > 1) { var i1 = series.getArgumentAxis().calculateInterval(data[0].argument, data[1].argument); var i2 = series.getArgumentAxis().calculateInterval(data[data.length - 1].argument, data[data.length - 2].argument); interval = Math.min(i1, i2) } range = { min: data[0].argument, max: data[data.length - 1].argument, interval: interval } } } return range }, getRangeData: function(series) { var points = series.getPoints(); var useAggregation = series.useAggregation(); var argumentCalculator = getRangeCalculator(series.argumentAxisType, points.length > 1 && series.getArgumentAxis()); var valueRangeCalculator = getRangeCalculator(series.valueAxisType); var viewportReducer = getViewportReducer(series); var range = points.reduce(function(range, point, index, points) { var argument = point.argument; argumentCalculator(range.arg, argument, argument); if (point.hasValue()) { valueRangeCalculator(range.val, point.getMinValue(), point.getMaxValue()); viewportReducer(range.viewport, point, index, points) } return range }, { arg: getInitialRange(series.argumentAxisType, series.argumentType, points.length ? points[0].argument : void 0), val: getInitialRange(series.valueAxisType, series.valueType, points.length ? series.getValueRangeInitialValue() : void 0), viewport: getInitialRange(series.valueAxisType, series.valueType, points.length ? series.getValueRangeInitialValue() : void 0) }); if (useAggregation) { var argumentRange = this.getArgumentRange(series); if (series.argumentAxisType === DISCRETE) { range.arg = argumentRange } else { var viewport = series.getArgumentAxis().getViewport(); if (_isDefined(viewport.startValue) || _isDefined(viewport.length)) { argumentCalculator(range.arg, argumentRange.min, argumentRange.min) } if (_isDefined(viewport.endValue) || _isDefined(viewport.length) && _isDefined(viewport.startValue)) { argumentCalculator(range.arg, argumentRange.max, argumentRange.max) } } } processCategories(range.arg); processCategories(range.val); return range }, getViewport: function(series) { var points = series.getPoints(); var range = {}; var reducer = getViewportReducer(series); range = getInitialRange(series.valueAxisType, series.valueType, points.length ? series.getValueRangeInitialValue() : void 0); points.some(function(point, index) { reducer(range, point, index, points); return range.endCalc }); return range }, getPointsInViewPort: function(series) { var argumentViewPortFilter = getViewPortFilter(series.getArgumentAxis().visualRange() || {}); var valueViewPort = series.getValueAxis().visualRange() || {}; var valueViewPortFilter = getViewPortFilter(valueViewPort); var points = series.getPoints(); var addValue = function(values, point, isEdge) { var minValue = point.getMinValue(); var maxValue = point.getMaxValue(); var isMinValueInViewPort = valueViewPortFilter(minValue); var isMaxValueInViewPort = valueViewPortFilter(maxValue); if (isMinValueInViewPort) { values.push(minValue) } if (maxValue !== minValue && isMaxValueInViewPort) { values.push(maxValue) } if (isEdge && !isMinValueInViewPort && !isMaxValueInViewPort) { if (!values.length) { values.push(valueViewPort.startValue) } else { values.push(valueViewPort.endValue) } } }; var addEdgePoints = isLineSeries(series) ? function(result, points, index) { var point = points[index]; var prevPoint = points[index - 1]; var nextPoint = points[index + 1]; if (nextPoint && argumentViewPortFilter(nextPoint.argument)) { addValue(result[1], point, true) } if (prevPoint && argumentViewPortFilter(prevPoint.argument)) { addValue(result[1], point, true) } } : noop; var checkPointInViewport = function(result, point, index) { if (argumentViewPortFilter(point.argument)) { addValue(result[0], point) } else { addEdgePoints(result, points, index) } return result }; return points.reduce(checkPointInViewport, [ [], [] ]) } } }, /*!*********************************************************!*\ !*** ./artifacts/transpiled/viz/axes/axes_constants.js ***! \*********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _map = __webpack_require__( /*! ../core/utils */ 10).map; module.exports = { logarithmic: "logarithmic", discrete: "discrete", numeric: "numeric", left: "left", right: "right", top: "top", bottom: "bottom", center: "center", horizontal: "horizontal", vertical: "vertical", convertTicksToValues: function(ticks) { return _map(ticks || [], function(item) { return item.value }) }, validateOverlappingMode: function(mode) { return "ignore" === mode || "none" === mode ? mode : "hide" }, getTicksCountInRange: function(ticks, valueKey, range) { var i = 1; if (ticks.length > 1) { for (; i < ticks.length; i++) { if (Math.abs(ticks[i].coords[valueKey] - ticks[0].coords[valueKey]) >= range) { break } } } return i }, areLabelsOverlap: function(bBox1, bBox2, spacing, alignment) { var horizontalInverted = bBox1.x > bBox2.x; var verticalInverted = bBox1.y > bBox2.y; var x1 = bBox1.x; var x2 = bBox2.x; var width1 = bBox1.width; var width2 = bBox2.width; if ("left" === alignment) { x1 += width1 / 2; x2 += width2 / 2 } else { if ("right" === alignment) { x1 -= width1 / 2; x2 -= width2 / 2 } } var hasHorizontalOverlapping = horizontalInverted ? x2 + width2 + spacing > x1 : x1 + width1 + spacing > x2; var hasVerticalOverlapping = verticalInverted ? bBox2.y + bBox2.height > bBox1.y : bBox1.y + bBox1.height > bBox2.y; return hasHorizontalOverlapping && hasVerticalOverlapping } } }, /*!**************************************************************!*\ !*** ./artifacts/transpiled/viz/translators/translator2d.js ***! \**************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var Range = __webpack_require__( /*! ./range */ 108).Range; var categoryTranslator = __webpack_require__( /*! ./category_translator */ 779); var intervalTranslator = __webpack_require__( /*! ./interval_translator */ 780); var datetimeTranslator = __webpack_require__( /*! ./datetime_translator */ 781); var logarithmicTranslator = __webpack_require__( /*! ./logarithmic_translator */ 782); var vizUtils = __webpack_require__( /*! ../core/utils */ 10); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var getLog = vizUtils.getLog; var getPower = vizUtils.getPower; var isDefined = typeUtils.isDefined; var adjust = __webpack_require__( /*! ../../core/utils/math */ 28).adjust; var _abs = Math.abs; var CANVAS_PROP = ["width", "height", "left", "top", "bottom", "right"]; var _Translator2d; var addInterval = __webpack_require__( /*! ../../core/utils/date */ 22).addInterval; var dummyTranslator = { to: function(value) { var coord = this._canvasOptions.startPoint + (this._options.conversionValue ? value : Math.round(value)); return coord > this._canvasOptions.endPoint ? this._canvasOptions.endPoint : coord }, from: function(value) { return value - this._canvasOptions.startPoint } }; var validateCanvas = function(canvas) { each(CANVAS_PROP, function(_, prop) { canvas[prop] = parseInt(canvas[prop]) || 0 }); return canvas }; var makeCategoriesToPoints = function(categories) { var categoriesToPoints = {}; categories.forEach(function(item, i) { categoriesToPoints[item.valueOf()] = i }); return categoriesToPoints }; var validateBusinessRange = function(businessRange) { if (!(businessRange instanceof Range)) { businessRange = new Range(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 prepareBreaks(breaks, range) { var transform = "logarithmic" === range.axisType ? function(value) { return getLog(value, range.base) } : function(value) { return value }; var array = []; var br; var transformFrom; var transformTo; var i; var length = breaks.length; var sum = 0; for (i = 0; i < length; i++) { br = breaks[i]; transformFrom = transform(br.from); transformTo = transform(br.to); sum += transformTo - transformFrom; array.push({ trFrom: transformFrom, trTo: transformTo, from: br.from, to: br.to, length: sum, cumulativeWidth: br.cumulativeWidth }) } return array } function getCanvasBounds(range) { var min = range.min; var max = range.max; var minVisible = range.minVisible; var maxVisible = range.maxVisible; var isLogarithmic = "logarithmic" === range.axisType; if (isLogarithmic) { maxVisible = getLog(maxVisible, range.base); minVisible = getLog(minVisible, range.base); min = getLog(min, range.base); max = getLog(max, range.base) } return { base: range.base, rangeMin: min, rangeMax: max, rangeMinVisible: minVisible, rangeMaxVisible: maxVisible } } function getCheckingMethodsAboutBreaks(inverted) { return { isStartSide: !inverted ? function(pos, breaks, start, end) { return pos < breaks[0][start] } : function(pos, breaks, start, end) { return pos <= breaks[breaks.length - 1][end] }, isEndSide: !inverted ? function(pos, breaks, start, end) { return pos >= breaks[breaks.length - 1][end] } : function(pos, breaks, start, end) { return pos > breaks[0][start] }, isInBreak: !inverted ? function(pos, br, start, end) { return pos >= br[start] && pos < br[end] } : function(pos, br, start, end) { return pos > br[end] && pos <= br[start] }, isBetweenBreaks: !inverted ? function(pos, br, prevBreak, start, end) { return pos < br[start] && pos >= prevBreak[end] } : function(pos, br, prevBreak, start, end) { return pos >= br[end] && pos < prevBreak[start] }, getLength: !inverted ? function(br) { return br.length } : function(br, lastBreak) { return lastBreak.length - br.length }, getBreaksSize: !inverted ? function(br) { return br.cumulativeWidth } : function(br, lastBreak) { return lastBreak.cumulativeWidth - br.cumulativeWidth } } } exports.Translator2D = _Translator2d = function(businessRange, canvas, options) { this.update(businessRange, canvas, options) }; _Translator2d.prototype = { constructor: _Translator2d, reinit: function() { var that = this; var options = that._options; var range = that._businessRange; var categories = range.categories || []; var script = {}; var canvasOptions = that._prepareCanvasOptions(); var visibleCategories = vizUtils.getCategoriesInfo(categories, range.minVisible, range.maxVisible).categories; var categoriesLength = visibleCategories.length; if (range.isEmpty()) { script = dummyTranslator } else { switch (range.axisType) { case "logarithmic": script = logarithmicTranslator; break; case "semidiscrete": script = intervalTranslator; canvasOptions.ratioOfCanvasRange = canvasOptions.canvasLength / (addInterval(canvasOptions.rangeMaxVisible, options.interval) - canvasOptions.rangeMinVisible); break; case "discrete": script = categoryTranslator; that._categories = categories; canvasOptions.interval = that._getDiscreteInterval(options.addSpiderCategory ? categoriesLength + 1 : categoriesLength, canvasOptions); that._categoriesToPoints = makeCategoriesToPoints(categories, canvasOptions.invert); if (categoriesLength) { canvasOptions.startPointIndex = that._categoriesToPoints[visibleCategories[0].valueOf()]; that.visibleCategories = visibleCategories } break; default: if ("datetime" === range.dataType) { script = datetimeTranslator } } }(that._oldMethods || []).forEach(function(methodName) { delete that[methodName] }); that._oldMethods = Object.keys(script); extend(that, script); that._conversionValue = options.conversionValue ? function(value) { return value } : function(value) { return Math.round(value) }; that.sc = {}; that._checkingMethodsAboutBreaks = [getCheckingMethodsAboutBreaks(false), getCheckingMethodsAboutBreaks(that.isInverted())]; that._translateBreaks(); that._calculateSpecialValues() }, _translateBreaks: function() { var breaks = this._breaks; var size = this._options.breaksSize; var i; var b; var end; var length; if (void 0 === breaks) { return } for (i = 0, length = breaks.length; i < length; i++) { b = breaks[i]; end = this.translate(b.to); b.end = end; b.start = !b.gapSize ? !this.isInverted() ? end - size : end + size : end } }, _checkValueAboutBreaks: function(breaks, pos, start, end, methods) { var i; var length; var prop = { length: 0, breaksSize: void 0, inBreak: false }; var br; var prevBreak; var lastBreak = breaks[breaks.length - 1]; if (methods.isStartSide(pos, breaks, start, end)) { return prop } else { if (methods.isEndSide(pos, breaks, start, end)) { return { length: lastBreak.length, breaksSize: lastBreak.cumulativeWidth, inBreak: false } } } for (i = 0, length = breaks.length; i < length; i++) { br = breaks[i]; prevBreak = breaks[i - 1]; if (methods.isInBreak(pos, br, start, end)) { prop.inBreak = true; prop.break = br; break } if (prevBreak && methods.isBetweenBreaks(pos, br, prevBreak, start, end)) { prop = { length: methods.getLength(prevBreak, lastBreak), breaksSize: methods.getBreaksSize(prevBreak, lastBreak), inBreak: false }; break } } return prop }, isInverted: function() { return !(this._options.isHorizontal ^ this._businessRange.invert) }, _getDiscreteInterval: function(categoriesLength, canvasOptions) { var correctedCategoriesCount = categoriesLength - (this._options.stick ? 1 : 0); return correctedCategoriesCount > 0 ? canvasOptions.canvasLength / correctedCategoriesCount : canvasOptions.canvasLength }, _prepareCanvasOptions: function() { var that = this; var businessRange = that._businessRange; var canvasOptions = that._canvasOptions = getCanvasBounds(businessRange); var canvas = that._canvas; var breaks = that._breaks; var length; canvasOptions.startPadding = canvas.startPadding || 0; canvasOptions.endPadding = canvas.endPadding || 0; if (that._options.isHorizontal) { canvasOptions.startPoint = canvas.left + canvasOptions.startPadding; length = canvas.width; canvasOptions.endPoint = canvas.width - canvas.right - canvasOptions.endPadding; canvasOptions.invert = businessRange.invert } else { canvasOptions.startPoint = canvas.top + canvasOptions.startPadding; length = canvas.height; canvasOptions.endPoint = canvas.height - canvas.bottom - canvasOptions.endPadding; 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); if (void 0 !== breaks) { canvasOptions.ratioOfCanvasRange = (canvasOptions.canvasLength - breaks[breaks.length - 1].cumulativeWidth) / (canvasOptions.rangeMaxVisible - canvasOptions.rangeMinVisible - breaks[breaks.length - 1].length) } return canvasOptions }, updateCanvas: function(canvas) { this._canvas = validateCanvas(canvas); this.reinit() }, updateBusinessRange: function(businessRange) { var that = this; var breaks = businessRange.breaks || []; that._businessRange = validateBusinessRange(businessRange); that._breaks = breaks.length ? prepareBreaks(breaks, that._businessRange) : void 0; that.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 }, getEventScale: function(zoomEvent) { return zoomEvent.deltaScale || 1 }, getCanvasVisibleArea: function() { return { min: this._canvasOptions.startPoint, max: this._canvasOptions.endPoint } }, _calculateSpecialValues: function() { var that = this; var canvasOptions = that._canvasOptions; var startPoint = canvasOptions.startPoint - canvasOptions.startPadding; var endPoint = canvasOptions.endPoint + canvasOptions.endPadding; var range = that._businessRange; var minVisible = range.minVisible; var maxVisible = range.maxVisible; var canvas_position_center_middle = startPoint + canvasOptions.canvasLength / 2; var canvas_position_default; if (minVisible < 0 && maxVisible > 0 && minVisible !== maxVisible) { canvas_position_default = that.translate(0, 1) } if (!isDefined(canvas_position_default)) { var invert = range.invert ^ (minVisible < 0 && maxVisible <= 0); if (that._options.isHorizontal) { canvas_position_default = invert ? endPoint : startPoint } else { canvas_position_default = invert ? startPoint : endPoint } } 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 }, getMinBarSize: function(minBarSize) { var visibleArea = this.getCanvasVisibleArea(); var minValue = this.from(visibleArea.min + minBarSize); return _abs(this.from(visibleArea.min) - (!isDefined(minValue) ? this.from(visibleArea.max) : minValue)) }, checkMinBarSize: function(value, minShownValue, stackValue) { return _abs(value) < minShownValue ? value >= 0 ? minShownValue : -minShownValue : value }, translate: function(bp, direction) { var specialValue = this.translateSpecialCase(bp); if (isDefined(specialValue)) { return Math.round(specialValue) } if (isNaN(bp)) { return null } return this.to(bp, direction) }, getInterval: function(interval) { var canvasOptions = this._canvasOptions; interval = isDefined(interval) ? interval : this._businessRange.interval; if (interval) { return Math.round(canvasOptions.ratioOfCanvasRange * interval) } return Math.round(canvasOptions.endPoint - canvasOptions.startPoint) }, zoom: function(translate, scale, wholeRange) { var canvasOptions = this._canvasOptions; if (canvasOptions.rangeMinVisible.valueOf() === canvasOptions.rangeMaxVisible.valueOf() && 0 !== translate) { return this.zoomZeroLengthRange(translate, scale) } var startPoint = canvasOptions.startPoint; var endPoint = canvasOptions.endPoint; var isInverted = this.isInverted(); var newStart = (startPoint + translate) / scale; var newEnd = (endPoint + translate) / scale; wholeRange = wholeRange || {}; var minPoint = this.to(isInverted ? wholeRange.endValue : wholeRange.startValue); var maxPoint = this.to(isInverted ? wholeRange.startValue : wholeRange.endValue); var min; var max; if (minPoint > newStart) { newEnd -= newStart - minPoint; newStart = minPoint; min = isInverted ? wholeRange.endValue : wholeRange.startValue } if (maxPoint < newEnd) { newStart -= newEnd - maxPoint; newEnd = maxPoint; max = isInverted ? wholeRange.startValue : wholeRange.endValue } if (maxPoint - minPoint < newEnd - newStart) { newStart = minPoint; newEnd = maxPoint } translate = (endPoint - startPoint) * newStart / (newEnd - newStart) - startPoint; scale = (startPoint + translate) / newStart || 1; min = isDefined(min) ? min : adjust(this.from(newStart, 1)); max = isDefined(max) ? max : adjust(this.from(newEnd, -1)); if (min > max) { min = min > wholeRange.endValue ? wholeRange.endValue : min; max = max < wholeRange.startValue ? wholeRange.startValue : max } else { min = min < wholeRange.startValue ? wholeRange.startValue : min; max = max > wholeRange.endValue ? wholeRange.endValue : max } return { min: min, max: max, translate: adjust(translate), scale: adjust(scale) } }, zoomZeroLengthRange: function(translate, scale) { var canvasOptions = this._canvasOptions; var min = canvasOptions.rangeMin; var max = canvasOptions.rangeMax; var correction = (max.valueOf() !== min.valueOf() ? max.valueOf() - min.valueOf() : _abs(canvasOptions.rangeMinVisible.valueOf() - min.valueOf())) / canvasOptions.canvasLength; var isDateTime = typeUtils.isDate(max) || typeUtils.isDate(min); var isLogarithmic = "logarithmic" === this._businessRange.axisType; var newMin = canvasOptions.rangeMinVisible.valueOf() - correction; var newMax = canvasOptions.rangeMaxVisible.valueOf() + correction; newMin = isLogarithmic ? adjust(Math.pow(canvasOptions.base, newMin)) : isDateTime ? new Date(newMin) : newMin; newMax = isLogarithmic ? adjust(Math.pow(canvasOptions.base, newMax)) : isDateTime ? new Date(newMax) : newMax; return { min: newMin, max: newMax, translate: translate, scale: scale } }, getMinScale: function(zoom) { return zoom ? 1.1 : .9 }, getScale: function(val1, val2) { var canvasOptions = this._canvasOptions; if (canvasOptions.rangeMax === canvasOptions.rangeMin) { return 1 } val1 = isDefined(val1) ? this._fromValue(val1) : canvasOptions.rangeMin; val2 = isDefined(val2) ? this._fromValue(val2) : canvasOptions.rangeMax; return (canvasOptions.rangeMax - canvasOptions.rangeMin) / Math.abs(val1 - val2) }, isValid: function(value) { var co = this._canvasOptions; value = this._fromValue(value); return null !== value && !isNaN(value) && value.valueOf() + co.rangeDoubleError >= co.rangeMin && value.valueOf() - co.rangeDoubleError <= co.rangeMax }, getCorrectValue: function(value, direction) { var that = this; var breaks = that._breaks; var prop; value = that._fromValue(value); if (that._breaks) { prop = that._checkValueAboutBreaks(breaks, value, "trFrom", "trTo", that._checkingMethodsAboutBreaks[0]); if (true === prop.inBreak) { return that._toValue(direction > 0 ? prop.break.trTo : prop.break.trFrom) } } return that._toValue(value) }, to: function(bp, direction) { var range = this.getBusinessRange(); if (isDefined(range.maxVisible) && isDefined(range.minVisible) && range.maxVisible.valueOf() === range.minVisible.valueOf()) { if (!isDefined(bp) || range.maxVisible.valueOf() !== bp.valueOf()) { return null } return this.translateSpecialCase(0 === bp && this._options.shiftZeroValue ? "canvas_position_default" : "canvas_position_middle") } bp = this._fromValue(bp); var that = this; var canvasOptions = that._canvasOptions; var breaks = that._breaks; var prop = { length: 0 }; var commonBreakSize = 0; if (void 0 !== breaks) { prop = that._checkValueAboutBreaks(breaks, bp, "trFrom", "trTo", that._checkingMethodsAboutBreaks[0]); commonBreakSize = isDefined(prop.breaksSize) ? prop.breaksSize : 0 } if (true === prop.inBreak) { if (direction > 0) { return prop.break.start } else { if (direction < 0) { return prop.break.end } else { return null } } } return that._conversionValue(that._calculateProjection((bp - canvasOptions.rangeMinVisible - prop.length) * canvasOptions.ratioOfCanvasRange + commonBreakSize)) }, from: function(pos, direction) { var that = this; var breaks = that._breaks; var prop = { length: 0 }; var canvasOptions = that._canvasOptions; var startPoint = canvasOptions.startPoint; var commonBreakSize = 0; if (void 0 !== breaks) { prop = that._checkValueAboutBreaks(breaks, pos, "start", "end", that._checkingMethodsAboutBreaks[1]); commonBreakSize = isDefined(prop.breaksSize) ? prop.breaksSize : 0 } if (true === prop.inBreak) { if (direction > 0) { return that._toValue(prop.break.trTo) } else { if (direction < 0) { return that._toValue(prop.break.trFrom) } else { return null } } } return that._toValue(that._calculateUnProjection((pos - startPoint - commonBreakSize) / canvasOptions.ratioOfCanvasRange + prop.length)) }, isValueProlonged: false, getRange: function() { return [this._toValue(this._canvasOptions.rangeMin), this._toValue(this._canvasOptions.rangeMax)] }, 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) }, _add: function(value, diff, coeff) { return this._toValue(this._fromValue(value) + diff * coeff) }, _fromValue: function(value) { return null !== value ? Number(value) : null }, _toValue: function(value) { return null !== value ? Number(value) : null }, ratioOfCanvasRange: function() { return this._canvasOptions.ratioOfCanvasRange } } }, /*!************************************************************!*\ !*** ./artifacts/transpiled/viz/gauges/base_indicators.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var _isFinite = isFinite; var _Number = Number; var _round = Math.round; var baseGaugeModule = __webpack_require__( /*! ./base_gauge */ 145); var _formatValue = baseGaugeModule.formatValue; var _getSampleText = baseGaugeModule.getSampleText; var _patchFontOptions = __webpack_require__( /*! ../core/utils */ 10).patchFontOptions; var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var Class = __webpack_require__( /*! ../../core/class */ 15); var BaseElement = Class.inherit({ ctor: function(parameters) { var that = this; each(parameters, function(name, value) { that["_" + name] = value }); that._init() }, dispose: function() { var that = this; that._dispose(); each(that, function(name) { that[name] = null }); return that }, getOffset: function() { return _Number(this._options.offset) || 0 } }); var BaseIndicator = BaseElement.inherit({ _init: function() { var that = this; that._rootElement = that._createRoot().linkOn(that._owner, { name: "value-indicator", after: "core" }); that._trackerElement = that._createTracker() }, _dispose: function() { this._rootElement.linkOff() }, _setupAnimation: function() { var that = this; if (that._options.animation) { that._animation = { step: function(pos) { that._actualValue = that._animation.start + that._animation.delta * pos; that._actualPosition = that._translator.translate(that._actualValue); that._move() }, duration: that._options.animation.duration > 0 ? _Number(that._options.animation.duration) : 0, easing: that._options.animation.easing } } }, _runAnimation: function(value) { var that = this; var animation = that._animation; animation.start = that._actualValue; animation.delta = value - that._actualValue; that._rootElement.animate({ _: 0 }, { step: animation.step, duration: animation.duration, easing: animation.easing }) }, _createRoot: function() { return this._renderer.g().attr({ "class": this._className }) }, _createTracker: function() { return this._renderer.path([], "area") }, _getTrackerSettings: noop, clean: function() { var that = this; that._animation && that._rootElement.stopAnimation(); that._rootElement.linkRemove().clear(); that._clear(); that._tracker.detach(that._trackerElement); that._options = that.enabled = that._animation = null; return that }, render: function(options) { var that = this; that.type = options.type; that._options = options; that._actualValue = that._currentValue = that._translator.adjust(that._options.currentValue); that.enabled = that._isEnabled(); if (that.enabled) { that._setupAnimation(); that._rootElement.attr({ fill: that._options.color }).linkAppend(); that._tracker.attach(that._trackerElement, that, that._trackerInfo) } return that }, resize: function(layout) { var that = this; that._rootElement.clear(); that._clear(); that.visible = that._isVisible(layout); if (that.visible) { extend(that._options, layout); that._actualPosition = that._translator.translate(that._actualValue); that._render(); that._trackerElement.attr(that._getTrackerSettings()); that._move() } return that }, value: function(arg, _noAnimation) { var that = this; var val; var rootElement = this._rootElement; var visibility = null; if (void 0 === arg) { return that._currentValue } if (null === arg) { visibility = "hidden"; that._currentValue = arg } else { val = that._translator.adjust(arg); if (that._currentValue !== val && _isFinite(val)) { that._currentValue = val; if (that.visible) { if (that._animation && !_noAnimation) { that._runAnimation(val) } else { that._actualValue = val; that._actualPosition = that._translator.translate(val); that._move() } } } } rootElement.attr({ visibility: visibility }); return that }, _isEnabled: null, _isVisible: null, _render: null, _clear: null, _move: null }); var COEFFICIENTS_MAP = {}; COEFFICIENTS_MAP["right-bottom"] = COEFFICIENTS_MAP.rb = [0, -1, -1, 0, 0, 1, 1, 0]; COEFFICIENTS_MAP["bottom-right"] = COEFFICIENTS_MAP.br = [-1, 0, 0, -1, 1, 0, 0, 1]; COEFFICIENTS_MAP["left-bottom"] = COEFFICIENTS_MAP.lb = [0, -1, 1, 0, 0, 1, -1, 0]; COEFFICIENTS_MAP["bottom-left"] = COEFFICIENTS_MAP.bl = [1, 0, 0, -1, -1, 0, 0, 1]; COEFFICIENTS_MAP["left-top"] = COEFFICIENTS_MAP.lt = [0, 1, 1, 0, 0, -1, -1, 0]; COEFFICIENTS_MAP["top-left"] = COEFFICIENTS_MAP.tl = [1, 0, 0, 1, -1, 0, 0, -1]; COEFFICIENTS_MAP["right-top"] = COEFFICIENTS_MAP.rt = [0, 1, -1, 0, 0, -1, 1, 0]; COEFFICIENTS_MAP["top-right"] = COEFFICIENTS_MAP.tr = [-1, 0, 0, 1, 1, 0, 0, -1]; function getTextCloudInfo(options) { var x = options.x; var y = options.y; var type = COEFFICIENTS_MAP[options.type]; var cloudWidth = options.textWidth + 2 * options.horMargin; var cloudHeight = options.textHeight + 2 * options.verMargin; var tailWidth; var tailHeight; var cx = x; var cy = y; tailWidth = tailHeight = options.tailLength; if (1 & type[0]) { tailHeight = Math.min(tailHeight, cloudHeight / 3) } else { tailWidth = Math.min(tailWidth, cloudWidth / 3) } return { cx: _round(cx + type[0] * tailWidth + (type[0] + type[2]) * cloudWidth / 2), cy: _round(cy + type[1] * tailHeight + (type[1] + type[3]) * cloudHeight / 2), points: [_round(x), _round(y), _round(x += type[0] * (cloudWidth + tailWidth)), _round(y += type[1] * (cloudHeight + tailHeight)), _round(x += type[2] * cloudWidth), _round(y += type[3] * cloudHeight), _round(x += type[4] * cloudWidth), _round(y += type[5] * cloudHeight), _round(x += type[6] * (cloudWidth - tailWidth)), _round(y += type[7] * (cloudHeight - tailHeight))] } } var BaseTextCloudMarker = BaseIndicator.inherit({ _move: function() { var that = this; var textCloudOptions = that._getTextCloudOptions(); var text = _formatValue(that._actualValue, that._options.text); that._text.attr({ text: text }); var bBox = that._text.getBBox(); var info = getTextCloudInfo({ x: textCloudOptions.x, y: textCloudOptions.y, textWidth: bBox.width || text.length * that._textUnitWidth, textHeight: bBox.height || that._textHeight, horMargin: that._options.horizontalOffset, verMargin: that._options.verticalOffset, tailLength: that._options.arrowLength, type: textCloudOptions.type }); that._text.attr({ x: info.cx, y: info.cy + that._textVerticalOffset }); that._cloud.attr({ points: info.points }); that._trackerElement && that._trackerElement.attr({ points: info.points }) }, _measureText: function() { var that = this; var root; var text; var bBox; var sampleText; if (!that._textVerticalOffset) { root = that._createRoot().append(that._owner); sampleText = _getSampleText(that._translator, that._options.text); text = that._renderer.text(sampleText, 0, 0).attr({ align: "center" }).css(_patchFontOptions(that._options.text.font)).append(root); bBox = text.getBBox(); root.remove(); that._textVerticalOffset = -bBox.y - bBox.height / 2; that._textWidth = bBox.width; that._textHeight = bBox.height; that._textUnitWidth = that._textWidth / sampleText.length; that._textFullWidth = that._textWidth + 2 * that._options.horizontalOffset; that._textFullHeight = that._textHeight + 2 * that._options.verticalOffset } }, _render: function() { var that = this; that._measureText(); that._cloud = that._cloud || that._renderer.path([], "area").append(that._rootElement); that._text = that._text || that._renderer.text().append(that._rootElement); that._text.attr({ align: "center" }).css(_patchFontOptions(that._options.text.font)) }, _clear: function() { delete this._cloud; delete this._text }, getTooltipParameters: function() { var position = this._getTextCloudOptions(); return { x: position.x, y: position.y, value: this._currentValue, color: this._options.color } } }); var BaseRangeBar = BaseIndicator.inherit({ _measureText: function() { var that = this; var root; var text; var bBox; that._hasText = that._isTextVisible(); if (that._hasText && !that._textVerticalOffset) { root = that._createRoot().append(that._owner); text = that._renderer.text(_getSampleText(that._translator, that._options.text), 0, 0).attr({ "class": "dxg-text", align: "center" }).css(_patchFontOptions(that._options.text.font)).append(root); bBox = text.getBBox(); root.remove(); that._textVerticalOffset = -bBox.y - bBox.height / 2; that._textWidth = bBox.width; that._textHeight = bBox.height } }, _move: function() { var that = this; that._updateBarItemsPositions(); if (that._hasText) { that._text.attr({ text: _formatValue(that._actualValue, that._options.text) }); that._updateTextPosition(); that._updateLinePosition() } }, _updateBarItems: function() { var that = this; var options = that._options; var spaceColor; var translator = that._translator; that._setBarSides(); that._startPosition = translator.translate(translator.getDomainStart()); that._endPosition = translator.translate(translator.getDomainEnd()); that._basePosition = translator.translate(options.baseValue); that._space = that._getSpace(); var backgroundColor = options.backgroundColor || "none"; if ("none" !== backgroundColor && that._space > 0) { spaceColor = options.containerBackgroundColor || "none" } else { that._space = 0; spaceColor = "none" } that._backItem1.attr({ fill: backgroundColor }); that._backItem2.attr({ fill: backgroundColor }); that._spaceItem1.attr({ fill: spaceColor }); that._spaceItem2.attr({ fill: spaceColor }) }, _getSpace: function() { return 0 }, _updateTextItems: function() { var that = this; if (that._hasText) { that._line = that._line || that._renderer.path([], "line").attr({ "class": "dxg-main-bar", "stroke-linecap": "square" }).append(that._rootElement); that._text = that._text || that._renderer.text("", 0, 0).attr({ "class": "dxg-text" }).append(that._rootElement); that._text.attr({ align: that._getTextAlign() }).css(that._getFontOptions()); that._setTextItemsSides() } else { if (that._line) { that._line.remove(); delete that._line } if (that._text) { that._text.remove(); delete that._text } } }, _isTextVisible: function() { return false }, _getTextAlign: function() { return "center" }, _getFontOptions: function() { var options = this._options; var font = options.text.font; if (!font || !font.color) { font = extend({}, font, { color: options.color }) } return _patchFontOptions(font) }, _updateBarItemsPositions: function() { var that = this; var positions = that._getPositions(); that._backItem1.attr(that._buildItemSettings(positions.start, positions.back1)); that._backItem2.attr(that._buildItemSettings(positions.back2, positions.end)); that._spaceItem1.attr(that._buildItemSettings(positions.back1, positions.main1)); that._spaceItem2.attr(that._buildItemSettings(positions.main2, positions.back2)); that._mainItem.attr(that._buildItemSettings(positions.main1, positions.main2)); that._trackerElement && that._trackerElement.attr(that._buildItemSettings(positions.main1, positions.main2)) }, _render: function() { var that = this; that._measureText(); if (!that._backItem1) { that._backItem1 = that._createBarItem(); that._backItem1.attr({ "class": "dxg-back-bar" }) } if (!that._backItem2) { that._backItem2 = that._createBarItem(); that._backItem2.attr({ "class": "dxg-back-bar" }) } if (!that._spaceItem1) { that._spaceItem1 = that._createBarItem(); that._spaceItem1.attr({ "class": "dxg-space-bar" }) } if (!that._spaceItem2) { that._spaceItem2 = that._createBarItem(); that._spaceItem2.attr({ "class": "dxg-space-bar" }) } if (!that._mainItem) { that._mainItem = that._createBarItem(); that._mainItem.attr({ "class": "dxg-main-bar" }) } that._updateBarItems(); that._updateTextItems() }, _clear: function() { var that = this; delete that._backItem1; delete that._backItem2; delete that._spaceItem1; delete that._spaceItem2; delete that._mainItem; delete that._hasText; delete that._line; delete that._text }, getTooltipParameters: function() { var position = this._getTooltipPosition(); return { x: position.x, y: position.y, value: this._currentValue, color: this._options.color, offset: 0 } } }); exports.BaseElement = BaseElement; exports.BaseIndicator = BaseIndicator; exports.BaseTextCloudMarker = BaseTextCloudMarker; exports.BaseRangeBar = BaseRangeBar; exports.getTextCloudInfo = getTextCloudInfo }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/viz/tree_map/common.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _patchFontOptions = __webpack_require__( /*! ../core/utils */ 10).patchFontOptions; 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) } } }, /*!********************************************************!*\ !*** ./artifacts/transpiled/viz/components/tracker.js ***! \********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _eventData = __webpack_require__( /*! ../../events/utils */ 8).eventData; var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var clickEventName = __webpack_require__( /*! ../../events/click */ 19).name; var downPointerEventName = __webpack_require__( /*! ../../events/pointer */ 23).down; var movePointerEventName = __webpack_require__( /*! ../../events/pointer */ 23).move; var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); function Tracker(parameters) { this._initHandlers(parameters) } Tracker.prototype = { constructor: Tracker, _initHandlers: function(parameters) { var document = domAdapter.getDocument(); parameters.getCoords = function(e) { var data = _eventData(e); var offset = parameters.widget._renderer.getRootOffset(); return [data.x - offset.left, data.y - offset.top] }; parameters.root.on(clickEventName, clickHandler); parameters.root.on(downPointerEventName, downHandler); eventsEngine.on(document, downPointerEventName, downHandler); eventsEngine.on(document, movePointerEventName, moveHandler); this._disposeHandlers = function() { parameters.root.off(clickEventName, clickHandler); parameters.root.off(downPointerEventName, downHandler); eventsEngine.off(document, downPointerEventName, downHandler); eventsEngine.off(document, movePointerEventName, moveHandler) }; function clickHandler(e) { processClick(e, parameters) } var isRootDown = false; function downHandler(e) { if (isRootDown) { isRootDown = false } else { if (void 0 !== parameters.getData(e)) { isRootDown = true } moveHandler(e) } } function moveHandler(e) { processHover(e, parameters); parameters.widget._getOption("tooltip").enabled && processTooltip(e, parameters) } }, dispose: function() { this._disposeHandlers() } }; function processClick(e, params) { var id = params.getData(e); if (id >= 0) { params.click({ node: params.getNode(id), coords: params.getCoords(e), event: e }) } } function processHover(e, params) { var id = params.getData(e); if (id >= 0) { params.getNode(id).setHover() } else { params.widget.clearHover() } } function processTooltip(e, params) { var id = params.getData(e, true); var coords; if (id >= 0) { coords = _eventData(e); params.getNode(id).showTooltip([coords.x, coords.y]) } else { params.widget.hideTooltip() } } module.exports.Tracker = Tracker }, /*!****************************************************!*\ !*** ./artifacts/transpiled/core/renderer_base.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var dataUtils = __webpack_require__( /*! ./element_data */ 39); var domAdapter = __webpack_require__( /*! ./dom_adapter */ 11); var windowUtils = __webpack_require__( /*! ./utils/window */ 7); var window = windowUtils.getWindow(); var typeUtils = __webpack_require__( /*! ./utils/type */ 1); var styleUtils = __webpack_require__( /*! ./utils/style */ 85); var sizeUtils = __webpack_require__( /*! ./utils/size */ 171); var htmlParser = __webpack_require__( /*! ./utils/html_parser */ 255); var renderer = function(selector, context) { return new initRender(selector, context) }; var initRender = function(selector, context) { if (!selector) { this.length = 0; return this } if ("string" === typeof selector) { if ("body" === selector) { this[0] = context ? context.body : domAdapter.getBody(); this.length = 1; return this } context = context || domAdapter.getDocument(); if ("<" === selector[0]) { this[0] = domAdapter.createElement(selector.slice(1, -1), context); this.length = 1; return this } [].push.apply(this, domAdapter.querySelectorAll(context, selector)); return this } else { if (domAdapter.isNode(selector) || typeUtils.isWindow(selector)) { this[0] = selector; this.length = 1; return this } else { if (Array.isArray(selector)) { [].push.apply(this, selector); return this } } } return renderer(selector.toArray ? selector.toArray() : [selector]) }; renderer.fn = { dxRenderer: true }; initRender.prototype = renderer.fn; var repeatMethod = function(methodName, args) { for (var i = 0; i < this.length; i++) { var item = renderer(this[i]); item[methodName].apply(item, args) } return this }; var setAttributeValue = function(element, attrName, value) { if (void 0 !== value && null !== value) { domAdapter.setAttribute(element, attrName, value) } else { domAdapter.removeAttribute(element, attrName) } }; initRender.prototype.show = function() { return this.toggle(true) }; initRender.prototype.hide = function() { return this.toggle(false) }; initRender.prototype.toggle = function(value) { if (this[0]) { this.toggleClass("dx-state-invisible", !value) } return this }; initRender.prototype.attr = function(attrName, value) { if (this.length > 1 && arguments.length > 1) { return repeatMethod.call(this, "attr", arguments) } if (!this[0]) { if (typeUtils.isObject(attrName) || void 0 !== value) { return this } else { return } } if (!this[0].getAttribute) { return this.prop(attrName, value) } if ("string" === typeof attrName && 1 === arguments.length) { var result = this[0].getAttribute(attrName); return null == result ? void 0 : result } else { if (typeUtils.isPlainObject(attrName)) { for (var key in attrName) { this.attr(key, attrName[key]) } } else { setAttributeValue(this[0], attrName, value) } } return this }; initRender.prototype.removeAttr = function(attrName) { this[0] && domAdapter.removeAttribute(this[0], attrName); return this }; initRender.prototype.prop = function(propName, value) { if (!this[0]) { return this } if ("string" === typeof propName && 1 === arguments.length) { return this[0][propName] } else { if (typeUtils.isPlainObject(propName)) { for (var key in propName) { this.prop(key, propName[key]) } } else { domAdapter.setProperty(this[0], propName, value) } } return this }; initRender.prototype.addClass = function(className) { return this.toggleClass(className, true) }; initRender.prototype.removeClass = function(className) { return this.toggleClass(className, false) }; initRender.prototype.hasClass = function(className) { if (!this[0] || void 0 === this[0].className) { return false } var classNames = className.split(" "); for (var i = 0; i < classNames.length; i++) { if (this[0].classList) { if (this[0].classList.contains(classNames[i])) { return true } } else { var _className = typeUtils.isString(this[0].className) ? this[0].className : domAdapter.getAttribute(this[0], "class"); if ((_className || "").split(" ").indexOf(classNames[i]) >= 0) { return true } } } return false }; initRender.prototype.toggleClass = function(className, value) { if (this.length > 1) { return repeatMethod.call(this, "toggleClass", arguments) } if (!this[0] || !className) { return this } value = void 0 === value ? !this.hasClass(className) : value; var classNames = className.split(" "); for (var i = 0; i < classNames.length; i++) { domAdapter.setClass(this[0], classNames[i], value) } return this }; ["width", "height", "outerWidth", "outerHeight", "innerWidth", "innerHeight"].forEach(function(methodName) { var partialName = methodName.toLowerCase().indexOf("width") >= 0 ? "Width" : "Height"; var propName = partialName.toLowerCase(); var isOuter = 0 === methodName.indexOf("outer"); var isInner = 0 === methodName.indexOf("inner"); initRender.prototype[methodName] = function(value) { if (this.length > 1 && arguments.length > 0) { return repeatMethod.call(this, methodName, arguments) } var element = this[0]; if (!element) { return } if (typeUtils.isWindow(element)) { return isOuter ? element["inner" + partialName] : domAdapter.getDocumentElement()["client" + partialName] } if (domAdapter.isDocument(element)) { var documentElement = domAdapter.getDocumentElement(); var body = domAdapter.getBody(); return Math.max(body["scroll" + partialName], body["offset" + partialName], documentElement["scroll" + partialName], documentElement["offset" + partialName], documentElement["client" + partialName]) } if (0 === arguments.length || "boolean" === typeof value) { var include = { paddings: isInner || isOuter, borders: isOuter, margins: value }; return sizeUtils.getSize(element, propName, include) } if (void 0 === value || null === value) { return this } if (typeUtils.isNumeric(value)) { var elementStyles = window.getComputedStyle(element); var sizeAdjustment = sizeUtils.getElementBoxParams(propName, elementStyles); var isBorderBox = "border-box" === elementStyles.boxSizing; value = Number(value); if (isOuter) { value -= isBorderBox ? 0 : sizeAdjustment.border + sizeAdjustment.padding } else { if (isInner) { value += isBorderBox ? sizeAdjustment.border : -sizeAdjustment.padding } else { if (isBorderBox) { value += sizeAdjustment.border + sizeAdjustment.padding } } } } value += typeUtils.isNumeric(value) ? "px" : ""; domAdapter.setStyle(element, propName, value); return this } }); initRender.prototype.html = function(value) { if (!arguments.length) { return this[0].innerHTML } this.empty(); if ("string" === typeof value && !htmlParser.isTablePart(value) || "number" === typeof value) { this[0].innerHTML = value; return this } return this.append(htmlParser.parseHTML(value)) }; var appendElements = function(element, nextSibling) { if (!this[0] || !element) { return } if ("string" === typeof element) { element = htmlParser.parseHTML(element) } else { if (element.nodeType) { element = [element] } else { if (typeUtils.isNumeric(element)) { element = [domAdapter.createTextNode(element)] } } } for (var i = 0; i < element.length; i++) { var item = element[i]; var container = this[0]; var wrapTR = "TABLE" === container.tagName && "TR" === item.tagName; if (wrapTR && container.tBodies && container.tBodies.length) { container = container.tBodies[0] } domAdapter.insertElement(container, item.nodeType ? item : item[0], nextSibling) } }; var setCss = function(name, value) { if (!this[0] || !this[0].style) { return } if (null === value || "number" === typeof value && isNaN(value)) { return } name = styleUtils.styleProp(name); for (var i = 0; i < this.length; i++) { this[i].style[name] = styleUtils.normalizeStyleProp(name, value) } }; initRender.prototype.css = function(name, value) { if (typeUtils.isString(name)) { if (2 === arguments.length) { setCss.call(this, name, value) } else { if (!this[0]) { return } name = styleUtils.styleProp(name); var result = window.getComputedStyle(this[0])[name] || this[0].style[name]; return typeUtils.isNumeric(result) ? result.toString() : result } } else { if (typeUtils.isPlainObject(name)) { for (var key in name) { setCss.call(this, key, name[key]) } } } return this }; initRender.prototype.prepend = function(element) { if (arguments.length > 1) { for (var i = 0; i < arguments.length; i++) { this.prepend(arguments[i]) } return this } appendElements.apply(this, [element, this[0].firstChild]); return this }; initRender.prototype.append = function(element) { if (arguments.length > 1) { for (var i = 0; i < arguments.length; i++) { this.append(arguments[i]) } return this } appendElements.apply(this, [element]); return this }; initRender.prototype.prependTo = function(element) { if (this.length > 1) { for (var i = this.length - 1; i >= 0; i--) { renderer(this[i]).prependTo(element) } return this } element = renderer(element); if (element[0]) { domAdapter.insertElement(element[0], this[0], element[0].firstChild) } return this }; initRender.prototype.appendTo = function(element) { if (this.length > 1) { return repeatMethod.call(this, "appendTo", arguments) } domAdapter.insertElement(renderer(element)[0], this[0]); return this }; initRender.prototype.insertBefore = function(element) { if (element && element[0]) { domAdapter.insertElement(element[0].parentNode, this[0], element[0]) } return this }; initRender.prototype.insertAfter = function(element) { if (element && element[0]) { domAdapter.insertElement(element[0].parentNode, this[0], element[0].nextSibling) } return this }; initRender.prototype.before = function(element) { if (this[0]) { domAdapter.insertElement(this[0].parentNode, element[0], this[0]) } return this }; initRender.prototype.after = function(element) { if (this[0]) { domAdapter.insertElement(this[0].parentNode, element[0], this[0].nextSibling) } return this }; initRender.prototype.wrap = function(wrapper) { if (this[0]) { var wrap = renderer(wrapper); wrap.insertBefore(this); wrap.append(this) } return this }; initRender.prototype.wrapInner = function(wrapper) { var contents = this.contents(); if (contents.length) { contents.wrap(wrapper) } else { this.append(wrapper) } return this }; initRender.prototype.replaceWith = function(element) { if (!(element && element[0])) { return } if (element.is(this)) { return this } element.insertBefore(this); this.remove(); return element }; initRender.prototype.remove = function() { if (this.length > 1) { return repeatMethod.call(this, "remove", arguments) } dataUtils.cleanDataRecursive(this[0], true); domAdapter.removeElement(this[0]); return this }; initRender.prototype.detach = function() { if (this.length > 1) { return repeatMethod.call(this, "detach", arguments) } domAdapter.removeElement(this[0]); return this }; initRender.prototype.empty = function() { if (this.length > 1) { return repeatMethod.call(this, "empty", arguments) } dataUtils.cleanDataRecursive(this[0]); domAdapter.setText(this[0], ""); return this }; initRender.prototype.clone = function() { var result = []; for (var i = 0; i < this.length; i++) { result.push(this[i].cloneNode(true)) } return renderer(result) }; initRender.prototype.text = function(value) { if (!arguments.length) { var result = ""; for (var i = 0; i < this.length; i++) { result += this[i] && this[i].textContent || "" } return result } var text = typeUtils.isFunction(value) ? value() : value; dataUtils.cleanDataRecursive(this[0], false); domAdapter.setText(this[0], typeUtils.isDefined(text) ? text : ""); return this }; initRender.prototype.val = function(value) { if (1 === arguments.length) { return this.prop("value", typeUtils.isDefined(value) ? value : "") } return this.prop("value") }; initRender.prototype.contents = function() { if (!this[0]) { return renderer() } var result = []; result.push.apply(result, this[0].childNodes); return renderer(result) }; initRender.prototype.find = function(selector) { var result = renderer(); if (!selector) { return result } var nodes = []; var i; if ("string" === typeof selector) { selector = selector.trim(); for (i = 0; i < this.length; i++) { var element = this[i]; if (domAdapter.isElementNode(element)) { var elementId = element.getAttribute("id"); var queryId = elementId || "dx-query-children"; if (!elementId) { setAttributeValue(element, "id", queryId) } queryId = "[id='" + queryId + "'] "; var querySelector = queryId + selector.replace(/([^\\])(,)/g, "$1, " + queryId); nodes.push.apply(nodes, domAdapter.querySelectorAll(element, querySelector)); setAttributeValue(element, "id", elementId) } else { if (domAdapter.isDocument(element)) { nodes.push.apply(nodes, domAdapter.querySelectorAll(element, selector)) } } } } else { for (i = 0; i < this.length; i++) { selector = domAdapter.isNode(selector) ? selector : selector[0]; if (this[i] !== selector && this[i].contains(selector)) { nodes.push(selector) } } } return result.add(nodes) }; var isVisible = function(_, element) { if (!element.nodeType) { return true } return !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length) }; initRender.prototype.filter = function(selector) { if (!selector) { return renderer() } if (":visible" === selector) { return this.filter(isVisible) } else { if (":hidden" === selector) { return this.filter(function(_, element) { return !isVisible(_, element) }) } } var result = []; for (var i = 0; i < this.length; i++) { var item = this[i]; if (domAdapter.isElementNode(item) && "string" === typeUtils.type(selector)) { domAdapter.elementMatches(item, selector) && result.push(item) } else { if (domAdapter.isNode(selector) || typeUtils.isWindow(selector)) { selector === item && result.push(item) } else { if (typeUtils.isFunction(selector)) { selector.call(item, i, item) && result.push(item) } else { for (var j = 0; j < selector.length; j++) { selector[j] === item && result.push(item) } } } } } return renderer(result) }; initRender.prototype.not = function(selector) { var result = []; var nodes = this.filter(selector).toArray(); for (var i = 0; i < this.length; i++) { if (nodes.indexOf(this[i]) === -1) { result.push(this[i]) } } return renderer(result) }; initRender.prototype.is = function(selector) { return !!this.filter(selector).length }; initRender.prototype.children = function(selector) { var result = []; for (var i = 0; i < this.length; i++) { var nodes = this[i] ? this[i].childNodes : []; for (var j = 0; j < nodes.length; j++) { if (domAdapter.isElementNode(nodes[j])) { result.push(nodes[j]) } } } result = renderer(result); return selector ? result.filter(selector) : result }; initRender.prototype.siblings = function() { var element = this[0]; if (!element || !element.parentNode) { return renderer() } var result = []; var parentChildNodes = element.parentNode.childNodes || []; for (var i = 0; i < parentChildNodes.length; i++) { var node = parentChildNodes[i]; if (domAdapter.isElementNode(node) && node !== element) { result.push(node) } } return renderer(result) }; initRender.prototype.each = function(callback) { for (var i = 0; i < this.length; i++) { if (false === callback.call(this[i], i, this[i])) { break } } }; initRender.prototype.index = function(element) { if (!element) { return this.parent().children().index(this) } element = renderer(element); return this.toArray().indexOf(element[0]) }; initRender.prototype.get = function(index) { return this[index < 0 ? this.length + index : index] }; initRender.prototype.eq = function(index) { index = index < 0 ? this.length + index : index; return renderer(this[index]) }; initRender.prototype.first = function() { return this.eq(0) }; initRender.prototype.last = function() { return this.eq(-1) }; initRender.prototype.parent = function(selector) { if (!this[0]) { return renderer() } var result = renderer(this[0].parentNode); return !selector || result.is(selector) ? result : renderer() }; initRender.prototype.parents = function(selector) { var result = []; var parent = this.parent(); while (parent && parent[0] && !domAdapter.isDocument(parent[0])) { if (domAdapter.isElementNode(parent[0])) { if (!selector || selector && parent.is(selector)) { result.push(parent.get(0)) } } parent = parent.parent() } return renderer(result) }; initRender.prototype.closest = function(selector) { if (this.is(selector)) { return this } var parent = this.parent(); while (parent && parent.length) { if (parent.is(selector)) { return parent } parent = parent.parent() } return renderer() }; initRender.prototype.next = function(selector) { if (!this[0]) { return renderer() } var next = renderer(this[0].nextSibling); if (!arguments.length) { return next } while (next && next.length) { if (next.is(selector)) { return next } next = next.next() } return renderer() }; initRender.prototype.prev = function() { if (!this[0]) { return renderer() } return renderer(this[0].previousSibling) }; initRender.prototype.add = function(selector) { var targets = renderer(selector); var result = this.toArray(); for (var i = 0; i < targets.length; i++) { var target = targets[i]; if (result.indexOf(target) === -1) { result.push(target) } } return renderer(result) }; var emptyArray = []; initRender.prototype.splice = function() { return renderer(emptyArray.splice.apply(this, arguments)) }; initRender.prototype.slice = function() { return renderer(emptyArray.slice.apply(this, arguments)) }; initRender.prototype.toArray = function() { return emptyArray.slice.call(this) }; var getWindowByElement = function(element) { return typeUtils.isWindow(element) ? element : element.defaultView }; initRender.prototype.offset = function() { if (!this[0]) { return } if (!this[0].getClientRects().length) { return { top: 0, left: 0 } } var rect = this[0].getBoundingClientRect(); var win = getWindowByElement(this[0].ownerDocument); var docElem = this[0].ownerDocument.documentElement; return { top: rect.top + win.pageYOffset - docElem.clientTop, left: rect.left + win.pageXOffset - docElem.clientLeft } }; initRender.prototype.offsetParent = function() { if (!this[0]) { return renderer() } var offsetParent = renderer(this[0].offsetParent); while (offsetParent[0] && "static" === offsetParent.css("position")) { offsetParent = renderer(offsetParent[0].offsetParent) } offsetParent = offsetParent[0] ? offsetParent : renderer(domAdapter.getDocumentElement()); return offsetParent }; initRender.prototype.position = function() { if (!this[0]) { return } var offset; var marginTop = parseFloat(this.css("marginTop")); var marginLeft = parseFloat(this.css("marginLeft")); if ("fixed" === this.css("position")) { offset = this[0].getBoundingClientRect(); return { top: offset.top - marginTop, left: offset.left - marginLeft } } offset = this.offset(); var offsetParent = this.offsetParent(); var parentOffset = { top: 0, left: 0 }; if ("HTML" !== offsetParent[0].nodeName) { parentOffset = offsetParent.offset() } parentOffset = { top: parentOffset.top + parseFloat(offsetParent.css("borderTopWidth")), left: parentOffset.left + parseFloat(offsetParent.css("borderLeftWidth")) }; return { top: offset.top - parentOffset.top - marginTop, left: offset.left - parentOffset.left - marginLeft } }; [{ name: "scrollLeft", offsetProp: "pageXOffset", scrollWindow: function(win, value) { win.scrollTo(value, win.pageYOffset) } }, { name: "scrollTop", offsetProp: "pageYOffset", scrollWindow: function(win, value) { win.scrollTo(win.pageXOffset, value) } }].forEach(function(directionStrategy) { var propName = directionStrategy.name; initRender.prototype[propName] = function(value) { if (!this[0]) { return } var window = getWindowByElement(this[0]); if (void 0 === value) { return window ? window[directionStrategy.offsetProp] : this[0][propName] } if (window) { directionStrategy.scrollWindow(window, value) } else { this[0][propName] = value } return this } }); initRender.prototype.data = function(key, value) { if (!this[0]) { return } if (arguments.length < 2) { return dataUtils.data.call(renderer, this[0], key) } dataUtils.data.call(renderer, this[0], key, value); return this }; initRender.prototype.removeData = function(key) { this[0] && dataUtils.removeData(this[0], key); return this }; var rendererWrapper = function() { return renderer.apply(this, arguments) }; Object.defineProperty(rendererWrapper, "fn", { enumerable: true, configurable: true, get: function() { return renderer.fn }, set: function(value) { renderer.fn = value } }); module.exports = { set: function(strategy) { renderer = strategy }, get: function() { return rendererWrapper } } }, /*!**************************************************************!*\ !*** ./artifacts/transpiled/events/core/hook_touch_props.js ***! \**************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var touchPropsToHook = ["pageX", "pageY", "screenX", "screenY", "clientX", "clientY"]; var touchPropHook = function(name, event) { if (event[name] && !event.touches || !event.touches) { return event[name] } var touches = event.touches.length ? event.touches : event.changedTouches; if (!touches.length) { return } return touches[0][name] }; module.exports = function(callback) { touchPropsToHook.forEach(function(name) { callback(name, function(event) { return touchPropHook(name, event) }) }, this) } }, /*!********************************************************!*\ !*** ./artifacts/transpiled/core/utils/html_parser.js ***! \********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var merge = __webpack_require__( /*! ./array */ 14).merge; var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11); var isTagName = /<([a-z][^\/\0>\x20\t\r\n\f]+)/i; var tagWrappers = { "default": { tagsCount: 0, startTags: "", endTags: "" }, thead: { tagsCount: 1, startTags: "
"); var text = this._formatWeekdayAndDay(firstViewDate); if (cellTemplate) { var templateOptions = { model: { text: text, date: new Date(firstViewDate) }, container: $th, index: i }; cellTemplate.render(templateOptions) } else { $th.text(text) } $th.addClass(HEADER_PANEL_CELL_CLASS).addClass(HEADER_PANEL_WEEK_CELL_CLASS).attr("colSpan", colspan); $cells.push($th); this._incrementDate(firstViewDate) } var $row = $("
", endTags: "
" }, td: { tagsCount: 3, startTags: "", endTags: "
" }, col: { tagsCount: 2, startTags: "", endTags: "
" }, tr: { tagsCount: 2, startTags: "", endTags: "
" } }; tagWrappers.tbody = tagWrappers.colgroup = tagWrappers.caption = tagWrappers.tfoot = tagWrappers.thead; tagWrappers.th = tagWrappers.td; var parseHTML = function(html) { if ("string" !== typeof html) { return null } var fragment = domAdapter.createDocumentFragment(); var container = fragment.appendChild(domAdapter.createElement("div")); var tags = isTagName.exec(html); var firstRootTag = tags && tags[1].toLowerCase(); var tagWrapper = tagWrappers[firstRootTag] || tagWrappers.default; container.innerHTML = tagWrapper.startTags + html + tagWrapper.endTags; for (var i = 0; i < tagWrapper.tagsCount; i++) { container = container.lastChild } return merge([], container.childNodes) }; var isTablePart = function(html) { var tags = isTagName.exec(html); return tags && tags[1] in tagWrappers }; exports.parseHTML = parseHTML; exports.isTablePart = isTablePart }, /*!****************************************************!*\ !*** ./artifacts/transpiled/localization/utils.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.toFixed = void 0; var _math = __webpack_require__( /*! ../core/utils/math */ 28); var DECIMAL_BASE = 10; function roundByAbs(value) { var valueSign = (0, _math.sign)(value); return valueSign * Math.round(Math.abs(value)) } function adjustValue(value, precision) { var precisionMultiplier = Math.pow(DECIMAL_BASE, precision); var roundMultiplier = precisionMultiplier * DECIMAL_BASE; var intermediateValue = value * roundMultiplier / DECIMAL_BASE; return roundByAbs(intermediateValue) / precisionMultiplier } function toFixed(value, precision) { var valuePrecision = precision || 0; var adjustedValue = valuePrecision > 0 ? adjustValue.apply(void 0, arguments) : value; return adjustedValue.toFixed(valuePrecision) } exports.toFixed = toFixed }, /*!******************************************************************!*\ !*** ./artifacts/transpiled/localization/ldml/date.formatter.js ***! \******************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function leftPad(text, length) { while (text.length < length) { text = "0" + text } return text } var FORMAT_TYPES = { 3: "abbreviated", 4: "wide", 5: "narrow" }; var LDML_FORMATTERS = { y: function(date, count, useUtc) { var year = date[useUtc ? "getUTCFullYear" : "getFullYear"](); if (2 === count) { year %= 100 } return leftPad(year.toString(), count) }, M: function(date, count, useUtc, dateParts) { var month = date[useUtc ? "getUTCMonth" : "getMonth"](); var formatType = FORMAT_TYPES[count]; if (formatType) { return dateParts.getMonthNames(formatType, "format")[month] } return leftPad((month + 1).toString(), Math.min(count, 2)) }, L: function(date, count, useUtc, dateParts) { var month = date[useUtc ? "getUTCMonth" : "getMonth"](); var formatType = FORMAT_TYPES[count]; if (formatType) { return dateParts.getMonthNames(formatType, "standalone")[month] } return leftPad((month + 1).toString(), Math.min(count, 2)) }, Q: function(date, count, useUtc, dateParts) { var month = date[useUtc ? "getUTCMonth" : "getMonth"](); var quarter = Math.floor(month / 3); var formatType = FORMAT_TYPES[count]; if (formatType) { return dateParts.getQuarterNames(formatType)[quarter] } return leftPad((quarter + 1).toString(), Math.min(count, 2)) }, E: function(date, count, useUtc, dateParts) { var day = date[useUtc ? "getUTCDay" : "getDay"](); var formatType = FORMAT_TYPES[count < 3 ? 3 : count]; return dateParts.getDayNames(formatType)[day] }, a: function(date, count, useUtc, dateParts) { var hours = date[useUtc ? "getUTCHours" : "getHours"](); var period = hours < 12 ? 0 : 1; var formatType = FORMAT_TYPES[count]; return dateParts.getPeriodNames(formatType)[period] }, d: function(date, count, useUtc) { return leftPad(date[useUtc ? "getUTCDate" : "getDate"]().toString(), Math.min(count, 2)) }, H: function(date, count, useUtc) { return leftPad(date[useUtc ? "getUTCHours" : "getHours"]().toString(), Math.min(count, 2)) }, h: function(date, count, useUtc) { var hours = date[useUtc ? "getUTCHours" : "getHours"](); return leftPad((hours % 12 || 12).toString(), Math.min(count, 2)) }, m: function(date, count, useUtc) { return leftPad(date[useUtc ? "getUTCMinutes" : "getMinutes"]().toString(), Math.min(count, 2)) }, s: function(date, count, useUtc) { return leftPad(date[useUtc ? "getUTCSeconds" : "getSeconds"]().toString(), Math.min(count, 2)) }, S: function(date, count, useUtc) { return leftPad(date[useUtc ? "getUTCMilliseconds" : "getMilliseconds"]().toString(), 3).substr(0, count) }, x: function(date, count, useUtc) { var timezoneOffset = useUtc ? 0 : date.getTimezoneOffset(); var signPart = timezoneOffset > 0 ? "-" : "+"; var timezoneOffsetAbs = Math.abs(timezoneOffset); var hours = Math.floor(timezoneOffsetAbs / 60); var minutes = timezoneOffsetAbs % 60; var hoursPart = leftPad(hours.toString(), 2); var minutesPart = leftPad(minutes.toString(), 2); return signPart + hoursPart + (count >= 3 ? ":" : "") + (count > 1 || minutes ? minutesPart : "") }, X: function(date, count, useUtc) { if (useUtc || !date.getTimezoneOffset()) { return "Z" } return LDML_FORMATTERS.x(date, count, useUtc) }, Z: function(date, count, useUtc) { return LDML_FORMATTERS.X(date, count >= 5 ? 3 : 2, useUtc) } }; var getFormatter = function(format, dateParts) { return function(date) { var charIndex; var formatter; var char; var charCount = 0; var separator = "'"; var isEscaping = false; var isCurrentCharEqualsNext; var result = ""; if (!date) { return null } if (!format) { return date } var useUtc = "Z" === format[format.length - 1] || "'Z'" === format.slice(-3); for (charIndex = 0; charIndex < format.length; charIndex++) { char = format[charIndex]; formatter = LDML_FORMATTERS[char]; isCurrentCharEqualsNext = char === format[charIndex + 1]; charCount++; if (!isCurrentCharEqualsNext) { if (formatter && !isEscaping) { result += formatter(date, charCount, useUtc, dateParts) } charCount = 0 } if (char === separator && !isCurrentCharEqualsNext) { isEscaping = !isEscaping } else { if (isEscaping || !formatter) { result += char } } if (char === separator && isCurrentCharEqualsNext) { charIndex++ } } return result } }; module.exports.getFormatter = getFormatter }, /*!*****************************************************************!*\ !*** ./artifacts/transpiled/localization/default_date_names.js ***! \*****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3); var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; var DAYS = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; var PERIODS = ["AM", "PM"]; var QUARTERS = ["Q1", "Q2", "Q3", "Q4"]; var cutCaptions = function(captions, format) { var lengthByFormat = { abbreviated: 3, "short": 2, narrow: 1 }; return iteratorUtils.map(captions, function(caption) { return caption.substr(0, lengthByFormat[format]) }) }; module.exports = { getMonthNames: function(format) { return cutCaptions(MONTHS, format) }, getDayNames: function(format) { return cutCaptions(DAYS, format) }, getQuarterNames: function(format) { return QUARTERS }, getPeriodNames: function(format) { return PERIODS } } }, /*!******************************************************************!*\ !*** ./artifacts/transpiled/exporter/excel/excel.fill_helper.js ***! \******************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79); var _excel2 = _interopRequireDefault(_excel); var _excel3 = __webpack_require__( /*! ./excel.pattern_fill_helper */ 436); var _excel4 = _interopRequireDefault(_excel3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var fillHelper = { tryCreateTag: function(sourceObj) { var result = null; if ((0, _type.isDefined)(sourceObj)) { result = { patternFill: _excel4.default.tryCreateTag(sourceObj.patternFill) }; if (fillHelper.isEmpty(result)) { result = null } } return result }, tryCreateFillFromSimpleFormat: function() { var _ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, backgroundColor = _ref.backgroundColor, fillPatternType = _ref.fillPatternType, fillPatternColor = _ref.fillPatternColor; if ((0, _type.isDefined)(backgroundColor) && !((0, _type.isDefined)(fillPatternType) && (0, _type.isDefined)(fillPatternColor))) { return { patternFill: { patternType: "solid", foregroundColor: { rgb: backgroundColor } } } } else { if ((0, _type.isDefined)(fillPatternType) && (0, _type.isDefined)(fillPatternColor)) { return { patternFill: { patternType: fillPatternType, foregroundColor: { rgb: fillPatternColor }, backgroundColor: { rgb: backgroundColor } } } } } }, copySimpleFormat: function(source, target) { if (void 0 !== source.backgroundColor) { target.backgroundColor = source.backgroundColor } if (void 0 !== source.fillPatternType) { target.fillPatternType = source.fillPatternType } if (void 0 !== source.fillPatternColor) { target.fillPatternColor = source.fillPatternColor } }, copy: function(source) { var result = null; if ((0, _type.isDefined)(source)) { result = {}; if (void 0 !== source.patternFill) { result.patternFill = _excel4.default.copy(source.patternFill) } } return result }, areEqual: function(leftTag, rightTag) { return fillHelper.isEmpty(leftTag) && fillHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && _excel4.default.areEqual(leftTag.patternFill, rightTag.patternFill) }, isEmpty: function(tag) { return !(0, _type.isDefined)(tag) || _excel4.default.isEmpty(tag.patternFill) }, toXml: function(tag) { return _excel2.default.toXml("fill", {}, _excel4.default.toXml(tag.patternFill)) } }; exports.default = fillHelper }, /*!*******************************************************************!*\ !*** ./artifacts/transpiled/exporter/excel/excel.color_helper.js ***! \*******************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79); var _excel2 = _interopRequireDefault(_excel); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var colorHelper = { _tryConvertColor: function(source) { if ("string" !== typeof source) { return source } var result; if (source.length > 0 && "#" === source[0]) { var colorCode = source.substr(1, source.length); if (6 === colorCode.length) { result = "FF" + colorCode } else { if (8 === colorCode.length) { result = colorCode[6] + colorCode[7] + colorCode.substr(0, 6) } else { result = colorCode } } } else { result = source } return result }, tryCreateTag: function(sourceObj) { var result = null; if ((0, _type.isDefined)(sourceObj)) { if ("string" === typeof sourceObj) { result = { rgb: this._tryConvertColor(sourceObj) } } else { result = { rgb: this._tryConvertColor(sourceObj.rgb), theme: sourceObj.theme } } if (colorHelper.isEmpty(result)) { result = null } } return result }, copy: function(source) { var result = null; if ((0, _type.isDefined)(source)) { if ("string" === typeof source) { result = source } else { result = {}; if (void 0 !== source.rgb) { result.rgb = source.rgb } if (void 0 !== source.theme) { result.theme = source.theme } } } return result }, isEmpty: function(tag) { return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.rgb) && !(0, _type.isDefined)(tag.theme) }, areEqual: function(leftTag, rightTag) { return colorHelper.isEmpty(leftTag) && colorHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.rgb === rightTag.rgb && leftTag.theme === rightTag.theme }, toXml: function(tagName, tag) { return _excel2.default.toXml(tagName, { rgb: tag.rgb, theme: tag.theme }) } }; exports.default = colorHelper }, /*!******************************************************************!*\ !*** ./artifacts/transpiled/exporter/excel/excel.font_helper.js ***! \******************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79); var _excel2 = _interopRequireDefault(_excel); var _excel3 = __webpack_require__( /*! ./excel.color_helper */ 260); var _excel4 = _interopRequireDefault(_excel3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var fontHelper = { tryCreateTag: function(sourceObj) { var result = null; if ((0, _type.isDefined)(sourceObj)) { result = { size: sourceObj.size, name: sourceObj.name, family: sourceObj.family, scheme: sourceObj.scheme, bold: sourceObj.bold, italic: sourceObj.italic, underline: sourceObj.underline, color: _excel4.default.tryCreateTag(sourceObj.color) }; if (fontHelper.isEmpty(result)) { result = null } } return result }, copy: function(source) { var result = null; if ((0, _type.isDefined)(source)) { result = {}; if (void 0 !== source.size) { result.size = source.size } if (void 0 !== source.name) { result.name = source.name } if (void 0 !== source.family) { result.family = source.family } if (void 0 !== source.scheme) { result.scheme = source.scheme } if (void 0 !== source.bold) { result.bold = source.bold } if (void 0 !== source.italic) { result.italic = source.italic } if (void 0 !== source.underline) { result.underline = source.underline } if (void 0 !== source.color) { result.color = _excel4.default.copy(source.color) } } return result }, areEqual: function(leftTag, rightTag) { return fontHelper.isEmpty(leftTag) && fontHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.size === rightTag.size && leftTag.name === rightTag.name && leftTag.family === rightTag.family && leftTag.scheme === rightTag.scheme && (leftTag.bold === rightTag.bold || !leftTag.bold === !rightTag.bold) && (leftTag.italic === rightTag.italic || !leftTag.italic === !rightTag.italic) && leftTag.underline === rightTag.underline && _excel4.default.areEqual(leftTag.color, rightTag.color) }, isEmpty: function(tag) { return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.size) && !(0, _type.isDefined)(tag.name) && !(0, _type.isDefined)(tag.family) && !(0, _type.isDefined)(tag.scheme) && (!(0, _type.isDefined)(tag.bold) || !tag.bold) && (!(0, _type.isDefined)(tag.italic) || !tag.italic) && !(0, _type.isDefined)(tag.underline) && _excel4.default.isEmpty(tag.color) }, toXml: function(tag) { var content = [(0, _type.isDefined)(tag.bold) && tag.bold ? _excel2.default.toXml("b", {}) : "", (0, _type.isDefined)(tag.size) ? _excel2.default.toXml("sz", { val: tag.size }) : "", (0, _type.isDefined)(tag.color) ? _excel4.default.toXml("color", tag.color) : "", (0, _type.isDefined)(tag.name) ? _excel2.default.toXml("name", { val: tag.name }) : "", (0, _type.isDefined)(tag.family) ? _excel2.default.toXml("family", { val: tag.family }) : "", (0, _type.isDefined)(tag.scheme) ? _excel2.default.toXml("scheme", { val: tag.scheme }) : "", (0, _type.isDefined)(tag.italic) && tag.italic ? _excel2.default.toXml("i", {}) : "", (0, _type.isDefined)(tag.underline) ? _excel2.default.toXml("u", { val: tag.underline }) : ""].join(""); return _excel2.default.toXml("font", {}, content) } }; exports.default = fontHelper }, /*!********************************************************!*\ !*** ./artifacts/transpiled/exporter/image_creator.js ***! \********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _color = __webpack_require__( /*! ../color */ 94); var _color2 = _interopRequireDefault(_color); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _svg = __webpack_require__( /*! ../core/utils/svg */ 209); var _svg2 = _interopRequireDefault(_svg); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _dom_adapter = __webpack_require__( /*! ../core/dom_adapter */ 11); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); var _dom = __webpack_require__( /*! ../core/utils/dom */ 12); var _dom2 = _interopRequireDefault(_dom); var _window = __webpack_require__( /*! ../core/utils/window */ 7); var _window2 = _interopRequireDefault(_window); var _inflector = __webpack_require__( /*! ../core/utils/inflector */ 33); var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var window = _window2.default.getWindow(); var _math = Math; var PI = _math.PI; var _min = _math.min; var _abs = _math.abs; var _sqrt = _math.sqrt; var _pow = _math.pow; var _atan2 = _math.atan2; var _cos = _math.cos; var _sin = _math.sin; var _number = Number; var IMAGE_QUALITY = 1; var TEXT_DECORATION_LINE_WIDTH_COEFF = .05; var DEFAULT_FONT_SIZE = "10px"; var DEFAULT_FONT_FAMILY = "sans-serif"; var DEFAULT_TEXT_COLOR = "#000"; function createCanvas(width, height, margin) { var canvas = (0, _renderer2.default)("")[0]; canvas.width = width + 2 * margin; canvas.height = height + 2 * margin; canvas.hidden = true; return canvas } function getStringFromCanvas(canvas, mimeType) { var dataURL = canvas.toDataURL(mimeType, IMAGE_QUALITY); var imageData = window.atob(dataURL.substring(("data:" + mimeType + ";base64,").length)); return imageData } function arcTo(x1, y1, x2, y2, radius, largeArcFlag, clockwise, context) { var cBx = (x1 + x2) / 2; var cBy = (y1 + y2) / 2; var aB = _atan2(y1 - y2, x1 - x2); var k = largeArcFlag ? 1 : -1; aB += 90 * (PI / 180) * (clockwise ? 1 : -1); var opSide = _sqrt(_pow(x2 - x1, 2) + _pow(y2 - y1, 2)) / 2; var adjSide = _sqrt(_abs(_pow(radius, 2) - _pow(opSide, 2))); var centerX = cBx + k * (adjSide * _cos(aB)); var centerY = cBy + k * (adjSide * _sin(aB)); var startAngle = _atan2(y1 - centerY, x1 - centerX); var endAngle = _atan2(y2 - centerY, x2 - centerX); context.arc(centerX, centerY, radius, startAngle, endAngle, !clockwise) } function getElementOptions(element, rootAppended) { var attr = parseAttributes(element.attributes || {}); var options = (0, _extend.extend)({}, attr, { text: element.textContent.replace(/\s+/g, " "), textAlign: "middle" === attr["text-anchor"] ? "center" : attr["text-anchor"] }); var transform = attr.transform; var coords; 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]) } coords = transform.match(/scale\(-*\d+([.]\d+)*(,*\s*-*\d+([.]\d+)*)*/); if (coords) { coords = coords[0].match(/-*\d+([.]\d+)*/g); options.scaleX = _number(coords[0]); if (coords.length > 1) { options.scaleY = _number(coords[1]) } else { options.scaleY = options.scaleX } } } parseStyles(element, options, rootAppended); return options } function drawRect(context, options) { var x = options.x; var y = options.y; var width = options.width; var height = options.height; var cornerRadius = options.rx; if (!cornerRadius) { context.rect(x, y, width, 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, shared) { var d = new _deferred.Deferred; var image = new window.Image; image.onload = function() { context.save(); context.globalAlpha = options.globalAlpha; transformElement(context, options); clipElement(context, options, shared); context.drawImage(image, options.x, options.y, options.width, options.height); context.restore(); d.resolve() }; image.onerror = function() { d.resolve() }; image.setAttribute("crossOrigin", "anonymous"); image.src = options.href || options["xlink:href"]; return d } function drawPath(context, dAttr) { var dArray = dAttr.replace(/,/g, " ").split(/([A-Z])/i).filter(function(item) { return "" !== item.trim() }); var i = 0; var prevParams; var prevParamsLen; do { var params = (dArray[i + 1] || "").trim().split(" "); switch (dArray[i]) { case "M": context.moveTo(_number(params[0]), _number(params[1])); i += 2; break; case "L": for (var j = 0; j < params.length / 2; j++) { context.lineTo(_number(params[2 * j]), _number(params[2 * j + 1])) } i += 2; break; case "C": context.bezierCurveTo(_number(params[0]), _number(params[1]), _number(params[2]), _number(params[3]), _number(params[4]), _number(params[5])); i += 2; break; case "a": prevParams = dArray[i - 1].trim().split(" "); prevParamsLen = prevParams.length - 1; arcTo(_number(prevParams[prevParamsLen - 1]), _number(prevParams[prevParamsLen]), _number(prevParams[prevParamsLen - 1]) + _number(params[5]), _number(prevParams[prevParamsLen]) + _number(params[6]), _number(params[0]), _number(params[3]), _number(params[4]), context); i += 2; break; case "A": prevParams = dArray[i - 1].trim().split(" "); prevParamsLen = prevParams.length - 1; arcTo(_number(prevParams[prevParamsLen - 1]), _number(prevParams[prevParamsLen]), _number(params[5]), _number(params[6]), _number(params[0]), _number(params[3]), _number(params[4]), context); i += 2; break; case "Z": context.closePath(); i += 1 } } while (i < dArray.length) } function parseStyles(element, options, rootAppended) { var style = element.style || {}; var field; for (field in style) { if ("" !== style[field]) { options[(0, _inflector.camelize)(field)] = style[field] } } if (rootAppended && _dom_adapter2.default.isElementNode(element)) { style = window.getComputedStyle(element); ["fill", "stroke", "stroke-width", "font-family", "font-size", "font-style", "font-weight"].forEach(function(prop) { if (prop in style && "" !== style[prop]) { options[(0, _inflector.camelize)(prop)] = style[prop] } }); ["opacity", "fill-opacity", "stroke-opacity"].forEach(function(prop) { if (prop in style && "" !== style[prop] && "1" !== style[prop]) { options[prop] = _number(style[prop]) } }) } options.textDecoration = options.textDecoration || options.textDecorationLine; options.globalAlpha = (0, _type.isDefined)(options.opacity) ? options.opacity : options.globalAlpha } function parseUrl(urlString) { var matches = urlString && urlString.match(/url\(.*#(.*?)["']?\)/i); return matches && matches[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, shared) { setFontStyle(context, options); applyFilter(context, options, shared); options.text && context.fillText(options.text, options.x || 0, options.y || 0); strokeElement(context, options, true); drawTextDecoration(context, options, shared) } function drawTextDecoration(context, options, shared) { if (!options.textDecoration || "none" === options.textDecoration) { return } var x = options.x; var textWidth = context.measureText(options.text).width; var textHeight = parseInt(options.fontSize, 10); var lineHeight = textHeight * TEXT_DECORATION_LINE_WIDTH_COEFF < 1 ? 1 : textHeight * TEXT_DECORATION_LINE_WIDTH_COEFF; var y = options.y; 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, shared); strokeElement(context, options) } 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 hasTspan(element) { var nodes = element.childNodes; for (var i = 0; i < nodes.length; i++) { if ("tspan" === nodes[i].tagName) { return true } } return false } function drawTextElement(childNodes, context, options, shared) { var lines = []; var line; var offset = 0; for (var i = 0; i < childNodes.length; i++) { var element = childNodes[i]; if (void 0 === element.tagName) { drawElement(element, context, options, shared) } else { if ("tspan" === element.tagName || "text" === element.tagName) { var elementOptions = getElementOptions(element, shared.rootAppended); var mergedOptions = (0, _extend.extend)({}, options, elementOptions); if ("tspan" === element.tagName && hasTspan(element)) { drawTextElement(element.childNodes, context, mergedOptions, shared); continue } mergedOptions.textAlign = "start"; if (!line || void 0 !== elementOptions.x) { line = { elements: [], options: [], widths: [], offsets: [] }; lines.push(line) } if (void 0 !== elementOptions.y) { offset = 0 } if (void 0 !== elementOptions.dy) { offset += parseFloat(elementOptions.dy) } line.elements.push(element); line.options.push(mergedOptions); line.offsets.push(offset); setFontStyle(context, mergedOptions); line.widths.push(context.measureText(mergedOptions.text).width) } } } lines.forEach(function(line) { var commonWidth = line.widths.reduce(function(commonWidth, width) { return commonWidth + width }, 0); var xDiff = 0; var currentOffset = 0; if ("center" === options.textAlign) { xDiff = commonWidth / 2 } if ("end" === options.textAlign) { xDiff = commonWidth } line.options.forEach(function(o, index) { var width = line.widths[index]; o.x = o.x - xDiff + currentOffset; o.y += line.offsets[index]; currentOffset += width }); line.elements.forEach(function(element, index) { drawTextElement(element.childNodes, context, line.options[index], shared) }) }) } function drawElement(element, context, parentOptions, shared) { var tagName = element.tagName; var isText = "text" === tagName || "tspan" === tagName || void 0 === tagName; var isImage = "image" === tagName; var options = (0, _extend.extend)({}, parentOptions, getElementOptions(element, shared.rootAppended)); if ("hidden" === options.visibility || options["hidden-for-export"]) { return } context.save(); !isImage && transformElement(context, options); clipElement(context, options, shared); aggregateOpacity(options); var promise; context.beginPath(); switch (element.tagName) { case void 0: drawText(context, options, shared); break; case "text": case "tspan": drawTextElement(element.childNodes, context, options, shared); break; case "image": promise = drawImage(context, options, shared); 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) } if (!isText) { applyFilter(context, options, shared); fillElement(context, options, shared); strokeElement(context, options) } applyGradient(context, options, shared, element); context.restore(); return promise } function applyGradient(context, options, _ref, element) { var gradients = _ref.gradients; if (0 === gradients.length) { return } var id = parseUrl(options.fill); if (id && gradients[id]) { var box = element.getBBox(); var gradient = context.createLinearGradient(box.x, 0, box.x + box.width, 0); gradients[id].forEach(function(opt) { var offset = parseInt(opt.offset.replace(/%/, "")); gradient.addColorStop(offset / 100, opt.stopColor) }); context.globalAlpha = options.opacity; context.fillStyle = gradient; context.fill() } } function applyFilter(context, options, shared) { var filterOptions; var id = parseUrl(options.filter); if (id) { filterOptions = shared.filters[id]; 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); options.translateX = void 0; options.translateY = void 0; 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)); options.rotationAngle = void 0; options.rotationX = void 0; options.rotationY = void 0 } if (isFinite(options.scaleX)) { context.scale(options.scaleX, options.scaleY); options.scaleX = void 0; options.scaleY = void 0 } } function clipElement(context, options, shared) { if (options["clip-path"]) { drawElement(shared.clipPaths[parseUrl(options["clip-path"])], context, {}, shared); context.clip(); options["clip-path"] = void 0 } } function hex2rgba(hexColor, alpha) { var color = new _color2.default(hexColor); return "rgba(" + color.r + "," + color.g + "," + color.b + "," + alpha + ")" } function createGradient(element) { var options = []; (0, _iterator.each)(element.childNodes, function(_, _ref2) { var attributes = _ref2.attributes; options.push({ offset: attributes.offset.value, stopColor: attributes["stop-color"].value }) }); return options } function createFilter(element) { var color; var filterOptions = {}; (0, _iterator.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"; var opacity = attr["flood-opacity"] ? attr["flood-opacity"].value : 1; filterOptions.color = hex2rgba(color, opacity) } }); return filterOptions } function asyncEach(array, callback) { var d = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : new _deferred.Deferred; if (0 === array.length) { return d.resolve() } var result = callback(array[0]); function next() { asyncEach(Array.prototype.slice.call(array, 1), callback, d) } if ((0, _type.isPromise)(result)) { result.then(next) } else { next() } return d } function drawCanvasElements(elements, context, parentOptions, shared) { return asyncEach(elements, function(element) { switch (element.tagName && element.tagName.toLowerCase()) { case "g": case "svg": var options = (0, _extend.extend)({}, parentOptions, getElementOptions(element, shared.rootAppended)); context.save(); transformElement(context, options); clipElement(context, options, shared); var onDone = function() { context.restore() }; var d = drawCanvasElements(element.childNodes, context, options, shared); if ((0, _type.isPromise)(d)) { d.then(onDone) } else { onDone() } return d; case "defs": return drawCanvasElements(element.childNodes, context, {}, shared); case "clippath": shared.clipPaths[element.attributes.id.textContent] = element.childNodes[0]; break; case "pattern": shared.patterns[element.attributes.id.textContent] = element; break; case "filter": shared.filters[element.id] = createFilter(element); break; case "lineargradient": shared.gradients[element.attributes.id.textContent] = createGradient(element); break; default: return drawElement(element, context, parentOptions, shared) } }) } function setLineDash(context, options) { var matches = options["stroke-dasharray"] && options["stroke-dasharray"].match(/(\d+)/g); if (matches && matches.length) { matches = (0, _iterator.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(); context.globalAlpha = 1 } } function getPattern(context, pattern, shared) { var options = getElementOptions(pattern, shared.rootAppended); var patternCanvas = createCanvas(options.width, options.height, 0); var patternContext = patternCanvas.getContext("2d"); drawCanvasElements(pattern.childNodes, patternContext, options, shared); return context.createPattern(patternCanvas, "repeat") } function fillElement(context, options, shared) { var fill = options.fill; if (fill && "none" !== fill) { if (fill.search(/url/) === -1) { context.fillStyle = fill } else { var pattern = shared.patterns[parseUrl(fill)]; if (!pattern) { return } context.fillStyle = getPattern(context, pattern, shared) } context.globalAlpha = options.fillOpacity; context.fill(); context.globalAlpha = 1 } } var parseAttributes = function(attributes) { var newAttributes = {}; var attr; (0, _iterator.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, margin) { context.fillStyle = backgroundColor || "#ffffff"; context.fillRect(-margin, -margin, width + 2 * margin, height + 2 * margin) } function createInvisibleDiv() { var invisibleDiv = _dom_adapter2.default.createElement("div"); invisibleDiv.style.left = "-9999px"; invisibleDiv.style.position = "absolute"; return invisibleDiv } function getCanvasFromSvg(markup, width, height, backgroundColor, margin) { var canvas = createCanvas(width, height, margin); var context = canvas.getContext("2d"); var svgElem = _svg2.default.getSvgElement(markup); var invisibleDiv; var markupIsDomElement = _dom_adapter2.default.isElementNode(markup); context.translate(margin, margin); _dom_adapter2.default.getBody().appendChild(canvas); if (!markupIsDomElement) { invisibleDiv = createInvisibleDiv(); invisibleDiv.appendChild(svgElem); _dom_adapter2.default.getBody().appendChild(invisibleDiv) } if (svgElem.attributes.direction) { canvas.dir = svgElem.attributes.direction.textContent } drawBackground(context, width, height, backgroundColor, margin); return drawCanvasElements(svgElem.childNodes, context, {}, { clipPaths: {}, patterns: {}, filters: {}, gradients: {}, rootAppended: markupIsDomElement && _dom2.default.contains(_dom_adapter2.default.getBody(), markup) }).then(function() { invisibleDiv && _dom_adapter2.default.getBody().removeChild(invisibleDiv); _dom_adapter2.default.getBody().removeChild(canvas); return canvas }) } exports.imageCreator = { getImageData: function(markup, options) { var mimeType = "image/" + options.format; var width = options.width; var height = options.height; var backgroundColor = options.backgroundColor; if ((0, _type.isFunction)(options.__parseAttributesFn)) { parseAttributes = options.__parseAttributesFn } var deferred = new _deferred.Deferred; getCanvasFromSvg(markup, width, height, backgroundColor, options.margin).then(function(canvas) { deferred.resolve(getStringFromCanvas(canvas, mimeType)) }); return deferred }, getData: function(markup, options) { var that = this; var deferred = new _deferred.Deferred; exports.imageCreator.getImageData(markup, options).then(function(binaryData) { var mimeType = "image/" + options.format; var data = (0, _type.isFunction)(window.Blob) && !options.forceProxy ? that._getBlob(binaryData, mimeType) : that._getBase64(binaryData); deferred.resolve(data) }); return deferred }, _getBlob: function(binaryData, mimeType) { var dataArray = new Uint8Array(binaryData.length); for (var i = 0; i < binaryData.length; i++) { dataArray[i] = binaryData.charCodeAt(i) } return new window.Blob([dataArray.buffer], { type: mimeType }) }, _getBase64: function(binaryData) { return window.btoa(binaryData) } }; exports.getData = function(data, options, callback) { return exports.imageCreator.getData(data, options).then(callback) }; exports.testFormats = function(formats) { var canvas = createCanvas(100, 100, 0); return formats.reduce(function(r, f) { var mimeType = ("image/" + f).toLowerCase(); if (canvas.toDataURL(mimeType).indexOf(mimeType) !== -1) { r.supported.push(f) } else { r.unsupported.push(f) } return r }, { supported: [], unsupported: [] }) } }, /*!**************************************************!*\ !*** ./artifacts/transpiled/core/utils/queue.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var errors = __webpack_require__( /*! ../errors */ 21); var when = __webpack_require__( /*! ../../core/utils/deferred */ 6).when; function createQueue(discardPendingTasks) { var _tasks = []; var _busy = false; function exec() { while (_tasks.length) { _busy = true; var task = _tasks.shift(); var 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 }, /*!**************************************************!*\ !*** ./artifacts/transpiled/animation/easing.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction; var CSS_TRANSITION_EASING_REGEX = /cubic-bezier\((\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\)/; var TransitionTimingFuncMap = { linear: "cubic-bezier(0, 0, 1, 1)", swing: "cubic-bezier(0.445, 0.05, 0.55, 0.95)", 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 polynomBezier = function(x1, y1, x2, y2) { var Cx = 3 * x1; var Bx = 3 * (x2 - x1) - Cx; var Ax = 1 - Cx - Bx; var Cy = 3 * y1; var By = 3 * (y2 - y1) - Cy; var 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 x = t; var i = 0; var z; 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)) } }; var easing = {}; var convertTransitionTimingFuncToEasing = function(cssTransitionEasing) { cssTransitionEasing = TransitionTimingFuncMap[cssTransitionEasing] || cssTransitionEasing; var coeffs = cssTransitionEasing.match(CSS_TRANSITION_EASING_REGEX); var forceName; if (!coeffs) { forceName = "linear"; coeffs = TransitionTimingFuncMap[forceName].match(CSS_TRANSITION_EASING_REGEX) } coeffs = coeffs.slice(1, 5); for (var i = 0; i < coeffs.length; i++) { coeffs[i] = parseFloat(coeffs[i]) } var easingName = forceName || "cubicbezier_" + coeffs.join("_").replace(/\./g, "p"); if (!isFunction(easing[easingName])) { easing[easingName] = function(x, t, b, c, d) { return c * polynomBezier(coeffs[0], coeffs[1], coeffs[2], coeffs[3])(t / d) + b } } return easingName }; exports.setEasing = function(value) { easing = value }; exports.getEasing = function(name) { return easing[name] }; exports.convertTransitionTimingFuncToEasing = convertTransitionTimingFuncToEasing }, /*!******************************************************!*\ !*** ./artifacts/transpiled/events/pointer/touch.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var devices = __webpack_require__( /*! ../../core/devices */ 16); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var BaseStrategy = __webpack_require__( /*! ./base */ 154); var eventMap = { dxpointerdown: "touchstart", dxpointermove: "touchmove", dxpointerup: "touchend", dxpointercancel: "touchcancel", dxpointerover: "", dxpointerout: "", dxpointerenter: "", dxpointerleave: "" }; var normalizeTouchEvent = function(e) { var pointers = []; each(e.touches, function(_, touch) { pointers.push(extend({ pointerId: touch.identifier }, touch)) }); return { pointers: pointers, pointerId: e.changedTouches[0].identifier } }; var skipTouchWithSameIdentifier = function(pointerEvent) { return "ios" === devices.real().platform && ("dxpointerdown" === pointerEvent || "dxpointerup" === pointerEvent) }; var TouchStrategy = BaseStrategy.inherit({ ctor: function() { this.callBase.apply(this, arguments); this._pointerId = 0 }, _handler: function(e) { if (skipTouchWithSameIdentifier(this._eventName)) { var touch = e.changedTouches[0]; if (this._pointerId === touch.identifier && 0 !== this._pointerId) { return } this._pointerId = touch.identifier } return this.callBase.apply(this, arguments) }, _fireEvent: function(args) { return this.callBase(extend(normalizeTouchEvent(args.originalEvent), args)) } }); TouchStrategy.map = eventMap; TouchStrategy.normalize = normalizeTouchEvent; module.exports = TouchStrategy }, /*!*********************************************************!*\ !*** ./artifacts/transpiled/events/pointer/observer.js ***! \*********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each; var readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48); var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var addEventsListener = function(events, handler) { readyCallbacks.add(function() { events.split(" ").forEach(function(event) { domAdapter.listen(domAdapter.getDocument(), event, handler, true) }) }) }; var Observer = function(eventMap, pointerEquals, onPointerAdding) { onPointerAdding = onPointerAdding || function() {}; var pointers = []; var getPointerIndex = function(e) { var index = -1; each(pointers, function(i, pointer) { if (!pointerEquals(e, pointer)) { return true } index = i; return false }); return index }; var addPointer = function(e) { if (getPointerIndex(e) === -1) { onPointerAdding(e); pointers.push(e) } }; var removePointer = function(e) { var index = getPointerIndex(e); if (index > -1) { pointers.splice(index, 1) } }; var updatePointer = function(e) { pointers[getPointerIndex(e)] = e }; addEventsListener(eventMap.dxpointerdown, addPointer); addEventsListener(eventMap.dxpointermove, updatePointer); addEventsListener(eventMap.dxpointerup, removePointer); addEventsListener(eventMap.dxpointercancel, removePointer); this.pointers = function() { return pointers }; this.reset = function() { pointers = [] } }; module.exports = Observer }, /*!******************************************************!*\ !*** ./artifacts/transpiled/events/pointer/mouse.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var BaseStrategy = __webpack_require__( /*! ./base */ 154); var Observer = __webpack_require__( /*! ./observer */ 266); var eventMap = { dxpointerdown: "mousedown", dxpointermove: "mousemove", dxpointerup: "mouseup", dxpointercancel: "", dxpointerover: "mouseover", dxpointerout: "mouseout", dxpointerenter: "mouseenter", dxpointerleave: "mouseleave" }; var normalizeMouseEvent = function(e) { e.pointerId = 1; return { pointers: observer.pointers(), pointerId: 1 } }; var observer; var activated = false; var activateStrategy = function() { if (activated) { return } observer = new Observer(eventMap, function() { return true }); activated = true }; var MouseStrategy = BaseStrategy.inherit({ ctor: function() { this.callBase.apply(this, arguments); activateStrategy() }, _fireEvent: function(args) { return this.callBase(extend(normalizeMouseEvent(args.originalEvent), args)) } }); MouseStrategy.map = eventMap; MouseStrategy.normalize = normalizeMouseEvent; MouseStrategy.activate = activateStrategy; MouseStrategy.resetObserver = function() { observer.reset() }; module.exports = MouseStrategy }, /*!****************************************************!*\ !*** ./artifacts/transpiled/integration/jquery.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var jQuery = __webpack_require__( /*! jquery */ 55); var compareVersions = __webpack_require__( /*! ../core/utils/version */ 61).compare; var errors = __webpack_require__( /*! ../core/utils/error */ 129); var useJQuery = __webpack_require__( /*! ./jquery/use_jquery */ 80)(); if (useJQuery && compareVersions(jQuery.fn.jquery, [1, 10]) < 0) { throw errors.Error("E0012") } __webpack_require__( /*! ./jquery/renderer */ 450); __webpack_require__( /*! ./jquery/hooks */ 451); __webpack_require__( /*! ./jquery/deferred */ 452); __webpack_require__( /*! ./jquery/hold_ready */ 453); __webpack_require__( /*! ./jquery/events */ 454); __webpack_require__( /*! ./jquery/easing */ 455); __webpack_require__( /*! ./jquery/element_data */ 456); __webpack_require__( /*! ./jquery/element */ 457); __webpack_require__( /*! ./jquery/component_registrator */ 458); __webpack_require__( /*! ./jquery/ajax */ 459) }, /*!****************************************************!*\ !*** ./artifacts/transpiled/ui/themes_callback.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Callbacks = __webpack_require__( /*! ../core/utils/callbacks */ 26); module.exports = new Callbacks }, /*!*********************************!*\ !*** external "window.angular" ***! \*********************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports) { module.exports = window.angular }, /*!***************************************************!*\ !*** ./artifacts/transpiled/core/utils/locker.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var errors = __webpack_require__( /*! ../errors */ 21); var Locker = function() { var info = {}; var currentCount = function(lockName) { return info[lockName] || 0 }; return { obtain: function(lockName) { info[lockName] = currentCount(lockName) + 1 }, release: function(lockName) { var count = currentCount(lockName); if (count < 1) { throw errors.Error("E0014") } if (1 === count) { delete info[lockName] } else { info[lockName] = count - 1 } }, locked: function(lockName) { return currentCount(lockName) > 0 } } }; module.exports = Locker }, /*!*****************************************************************!*\ !*** ./artifacts/transpiled/ui/selection/selection.strategy.js ***! \*****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var dataQuery = __webpack_require__( /*! ../../data/query */ 42); var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var getKeyHash = commonUtils.getKeyHash; var Class = __webpack_require__( /*! ../../core/class */ 15); var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred; module.exports = Class.inherit({ ctor: function(options) { this.options = options; this._clearItemKeys() }, _clearItemKeys: function() { this._setOption("addedItemKeys", []); this._setOption("removedItemKeys", []); this._setOption("removedItems", []); this._setOption("addedItems", []) }, validate: commonUtils.noop, _setOption: function(name, value) { this.options[name] = value }, onSelectionChanged: function onSelectionChanged() { var addedItemKeys = this.options.addedItemKeys; var removedItemKeys = this.options.removedItemKeys; var addedItems = this.options.addedItems; var removedItems = this.options.removedItems; var selectedItems = this.options.selectedItems; var selectedItemKeys = this.options.selectedItemKeys; var onSelectionChanged = this.options.onSelectionChanged || commonUtils.noop; this._clearItemKeys(); onSelectionChanged({ selectedItems: selectedItems, selectedItemKeys: selectedItemKeys, addedItemKeys: addedItemKeys, removedItemKeys: removedItemKeys, addedItems: addedItems, removedItems: removedItems }) }, equalKeys: function(key1, key2) { if (this.options.equalByReference) { if (typeUtils.isObject(key1) && typeUtils.isObject(key2)) { return key1 === key2 } } return commonUtils.equalByValue(key1, key2) }, _clearSelection: function(keys, preserve, isDeselect, isSelectAll) { keys = keys || []; keys = Array.isArray(keys) ? keys : [keys]; this.validate(); return this.selectedItemKeys(keys, preserve, isDeselect, isSelectAll) }, _loadFilteredData: function(remoteFilter, localFilter, select, isSelectAll) { var filterLength = encodeURI(JSON.stringify(remoteFilter)).length; var needLoadAllData = this.options.maxFilterLengthInRequest && filterLength > this.options.maxFilterLengthInRequest; var deferred = new Deferred; var loadOptions = { filter: needLoadAllData ? void 0 : remoteFilter, select: needLoadAllData ? this.options.dataFields() : select || this.options.dataFields() }; if (remoteFilter && 0 === remoteFilter.length) { deferred.resolve([]) } else { this.options.load(loadOptions).done(function(items) { var filteredItems = typeUtils.isPlainObject(items) ? items.data : items; if (localFilter && !isSelectAll) { filteredItems = filteredItems.filter(localFilter) } else { if (needLoadAllData) { filteredItems = dataQuery(filteredItems).filter(remoteFilter).toArray() } } deferred.resolve(filteredItems) }).fail(deferred.reject.bind(deferred)) } return deferred }, updateSelectedItemKeyHash: function(keys) { for (var i = 0; i < keys.length; i++) { var keyHash = getKeyHash(keys[i]); if (!typeUtils.isObject(keyHash)) { this.options.keyHashIndices[keyHash] = this.options.keyHashIndices[keyHash] || []; var keyIndices = this.options.keyHashIndices[keyHash]; keyIndices.push(i) } } }, _isAnyItemSelected: function(items) { for (var i = 0; i < items.length; i++) { if (this.options.isItemSelected(items[i])) { return } } return false }, _getFullSelectAllState: function() { var items = this.options.plainItems(); var dataFilter = this.options.filter(); var selectedItems = this.options.selectedItems; if (dataFilter) { selectedItems = dataQuery(selectedItems).filter(dataFilter).toArray() } var selectedItemsLength = selectedItems.length; if (!selectedItemsLength) { return this._isAnyItemSelected(items) } if (selectedItemsLength >= this.options.totalCount()) { return true } return }, _getVisibleSelectAllState: function() { var items = this.options.plainItems(); var hasSelectedItems = false; var hasUnselectedItems = false; for (var i = 0; i < items.length; i++) { var item = items[i]; var itemData = this.options.getItemData(item); var key = this.options.keyOf(itemData); if (this.options.isSelectableItem(item)) { if (this.isItemKeySelected(key)) { hasSelectedItems = true } else { hasUnselectedItems = true } } } if (hasSelectedItems) { return !hasUnselectedItems ? true : void 0 } else { return false } } }) }, /*!************************************************************!*\ !*** ./artifacts/transpiled/integration/knockout/utils.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var ko = __webpack_require__( /*! knockout */ 62); var getClosestNodeWithContext = function getClosestNodeWithContext(node) { var context = ko.contextFor(node); if (!context && node.parentNode) { return getClosestNodeWithContext(node.parentNode) } return node }; module.exports.getClosestNodeWithContext = getClosestNodeWithContext }, /*!******************************************************!*\ !*** ./artifacts/transpiled/bundles/modules/data.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var DevExpress = __webpack_require__( /*! ./core */ 147); module.exports = DevExpress.data = DevExpress.data || {}; Object.defineProperty(DevExpress.data, "errorHandler", { get: function() { /*! ../../data/errors */ return __webpack_require__(36).errorHandler }, set: function(value) { __webpack_require__( /*! ../../data/errors */ 36).errorHandler = value } }); Object.defineProperty(DevExpress.data, "_errorHandler", { get: function() { /*! ../../data/errors */ return __webpack_require__(36)._errorHandler }, set: function(value) { __webpack_require__( /*! ../../data/errors */ 36)._errorHandler = value } }); DevExpress.data.DataSource = __webpack_require__( /*! ../../data/data_source */ 487); DevExpress.data.query = __webpack_require__( /*! ../../data/query */ 42); DevExpress.data.Store = __webpack_require__( /*! ../../data/abstract_store */ 98); DevExpress.data.ArrayStore = __webpack_require__( /*! ../../data/array_store */ 68); DevExpress.data.CustomStore = __webpack_require__( /*! ../../data/custom_store */ 149); DevExpress.data.LocalStore = __webpack_require__( /*! ../../data/local_store */ 488); DevExpress.data.base64_encode = __webpack_require__( /*! ../../data/utils */ 41).base64_encode; DevExpress.data.Guid = __webpack_require__( /*! ../../core/guid */ 40); DevExpress.data.utils = {}; DevExpress.data.utils.compileGetter = __webpack_require__( /*! ../../core/utils/data */ 20).compileGetter; DevExpress.data.utils.compileSetter = __webpack_require__( /*! ../../core/utils/data */ 20).compileSetter; DevExpress.EndpointSelector = __webpack_require__( /*! ../../data/endpoint_selector */ 489); DevExpress.data.queryImpl = __webpack_require__( /*! ../../data/query */ 42).queryImpl; DevExpress.data.queryAdapters = __webpack_require__( /*! ../../data/query_adapters */ 181); var dataUtils = __webpack_require__( /*! ../../data/utils */ 41); DevExpress.data.utils.normalizeBinaryCriterion = dataUtils.normalizeBinaryCriterion; DevExpress.data.utils.normalizeSortingInfo = dataUtils.normalizeSortingInfo; DevExpress.data.utils.errorMessageFromXhr = dataUtils.errorMessageFromXhr; DevExpress.data.utils.aggregators = dataUtils.aggregators; DevExpress.data.utils.keysEqual = dataUtils.keysEqual; DevExpress.data.utils.isDisjunctiveOperator = dataUtils.isDisjunctiveOperator; DevExpress.data.utils.isConjunctiveOperator = dataUtils.isConjunctiveOperator; DevExpress.data.utils.processRequestResultLock = dataUtils.processRequestResultLock; DevExpress.data.utils.toComparable = __webpack_require__( /*! ../../core/utils/data */ 20).toComparable; DevExpress.data.utils.multiLevelGroup = __webpack_require__( /*! ../../data/store_helper */ 81).multiLevelGroup; DevExpress.data.utils.arrangeSortingInfo = __webpack_require__( /*! ../../data/store_helper */ 81).arrangeSortingInfo; DevExpress.data.utils.normalizeDataSourceOptions = __webpack_require__( /*! ../../data/data_source/data_source */ 45).normalizeDataSourceOptions }, /*!**********************************************************!*\ !*** ./artifacts/transpiled/data/proxy_url_formatter.js ***! \**********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each; var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11); var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow(); var callOnce = __webpack_require__( /*! ../core/utils/call_once */ 63); var DXPROXY_HOST = "dxproxy.devexpress.com:8000"; var urlMapping = {}; var getUrlParser = callOnce(function() { var a = domAdapter.createElement("a"); var props = ["protocol", "hostname", "port", "pathname", "search", "hash"]; var normalizePath = function(value) { if ("/" !== value.charAt(0)) { value = "/" + value } return value }; return function(url) { a.href = url; var result = {}; each(props, function() { result[this] = a[this] }); result.pathname = normalizePath(result.pathname); return result } }); var parseUrl = function(url) { var urlParser = getUrlParser(); return urlParser(url) }; var extractProxyAppId = function() { return window.location.pathname.split("/")[1] }; module.exports = { parseUrl: parseUrl, isProxyUsed: function() { return window.location.host === DXPROXY_HOST }, formatProxyUrl: function(localUrl) { var urlData = parseUrl(localUrl); if (!/^(localhost$|127\.)/i.test(urlData.hostname)) { return localUrl } var proxyUrlPart = DXPROXY_HOST + "/" + extractProxyAppId() + "_" + urlData.port; urlMapping[proxyUrlPart] = urlData.hostname + ":" + urlData.port; var resultUrl = "http://" + proxyUrlPart + urlData.pathname + urlData.search; return resultUrl }, formatLocalUrl: function(proxyUrl) { if (proxyUrl.indexOf(DXPROXY_HOST) < 0) { return proxyUrl } var resultUrl = proxyUrl; for (var proxyUrlPart in urlMapping) { if (Object.prototype.hasOwnProperty.call(urlMapping, proxyUrlPart)) { if (proxyUrl.indexOf(proxyUrlPart) >= 0) { resultUrl = proxyUrl.replace(proxyUrlPart, urlMapping[proxyUrlPart]); break } } } return resultUrl } } }, /*!**************************************************!*\ !*** ./artifacts/transpiled/data/odata/store.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined; var config = __webpack_require__( /*! ../../core/config */ 31); var odataUtils = __webpack_require__( /*! ./utils */ 110); var proxyUrlFormatter = __webpack_require__( /*! ../proxy_url_formatter */ 275); var errors = __webpack_require__( /*! ../errors */ 36).errors; var query = __webpack_require__( /*! ../query */ 42); var Store = __webpack_require__( /*! ../abstract_store */ 98); var mixins = __webpack_require__( /*! ./mixins */ 277); var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6); var when = deferredUtils.when; var Deferred = deferredUtils.Deferred; __webpack_require__( /*! ./query_adapter */ 156); var ANONYMOUS_KEY_NAME = "5d46402c-7899-4ea9-bd81-8b73c47c7683"; function expandKeyType(key, keyType) { var result = {}; result[key] = keyType; return result } function mergeFieldTypesWithKeyType(fieldTypes, keyType) { var result = {}; for (var field in fieldTypes) { result[field] = fieldTypes[field] } for (var keyName in keyType) { if (keyName in result) { if (result[keyName] !== keyType[keyName]) { errors.log("W4001", keyName) } } else { result[keyName] = keyType[keyName] } } return result } var ODataStore = Store.inherit({ ctor: function(options) { this.callBase(options); this._extractServiceOptions(options); var key = this.key(); var fieldTypes = options.fieldTypes; var keyType = options.keyType; if (keyType) { var keyTypeIsString = "string" === typeof keyType; if (!key) { key = keyTypeIsString ? ANONYMOUS_KEY_NAME : Object.keys(keyType); this._legacyAnonymousKey = key } if (keyTypeIsString) { keyType = expandKeyType(key, keyType) } fieldTypes = mergeFieldTypesWithKeyType(fieldTypes, keyType) } this._fieldTypes = fieldTypes || {}; if (2 === this.version()) { this._updateMethod = "MERGE" } else { this._updateMethod = "PATCH" } }, _customLoadOptions: function() { return ["expand", "customQueryParams"] }, _byKeyImpl: function(key, extraOptions) { var params = {}; if (extraOptions) { params.$expand = odataUtils.generateExpand(this._version, extraOptions.expand, extraOptions.select) || void 0; params.$select = odataUtils.generateSelect(this._version, extraOptions.select) || void 0 } return this._sendRequest(this._byKeyUrl(key), "GET", params) }, createQuery: function(loadOptions) { var url; loadOptions = loadOptions || {}; var queryOptions = { adapter: "odata", beforeSend: this._beforeSend, errorHandler: this._errorHandler, jsonp: this._jsonp, version: this._version, withCredentials: this._withCredentials, expand: loadOptions.expand, requireTotalCount: loadOptions.requireTotalCount, deserializeDates: this._deserializeDates, fieldTypes: this._fieldTypes }; if (isDefined(loadOptions.urlOverride)) { url = loadOptions.urlOverride } else { url = this._url } if (isDefined(this._filterToLower)) { queryOptions.filterToLower = this._filterToLower } if (loadOptions.customQueryParams) { var params = mixins.escapeServiceOperationParams(loadOptions.customQueryParams, this.version()); if (4 === this.version()) { url = mixins.formatFunctionInvocationUrl(url, params) } else { queryOptions.params = params } } return query(url, queryOptions) }, _insertImpl: function(values) { this._requireKey(); var that = this; var d = new Deferred; when(this._sendRequest(this._url, "POST", null, values)).done(function(serverResponse) { d.resolve(config().useLegacyStoreResult ? values : serverResponse || values, that.keyOf(serverResponse)) }).fail(d.reject); return d.promise() }, _updateImpl: function(key, values) { var d = new Deferred; when(this._sendRequest(this._byKeyUrl(key), this._updateMethod, null, values)).done(function(serverResponse) { if (config().useLegacyStoreResult) { d.resolve(key, values) } else { d.resolve(serverResponse || values, key) } }).fail(d.reject); return d.promise() }, _removeImpl: function(key) { var d = new Deferred; when(this._sendRequest(this._byKeyUrl(key), "DELETE")).done(function() { d.resolve(key) }).fail(d.reject); return d.promise() }, _convertKey: function(value) { var result = value; var fieldTypes = this._fieldTypes; var key = this.key() || this._legacyAnonymousKey; if (Array.isArray(key)) { result = {}; for (var i = 0; i < key.length; i++) { var keyName = key[i]; result[keyName] = odataUtils.convertPrimitiveValue(fieldTypes[keyName], value[keyName]) } } else { if (fieldTypes[key]) { result = odataUtils.convertPrimitiveValue(fieldTypes[key], value) } } return result }, _byKeyUrl: function(value, useOriginalHost) { var baseUrl = useOriginalHost ? proxyUrlFormatter.formatLocalUrl(this._url) : this._url; var convertedKey = this._convertKey(value); return baseUrl + "(" + encodeURIComponent(odataUtils.serializeKey(convertedKey, this._version)) + ")" } }, "odata").include(mixins.SharedMethods); module.exports = ODataStore }, /*!***************************************************!*\ !*** ./artifacts/transpiled/data/odata/mixins.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var stringUtils = __webpack_require__( /*! ../../core/utils/string */ 44); var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3); var odataUtils = __webpack_require__( /*! ./utils */ 110); __webpack_require__( /*! ./query_adapter */ 156); var DEFAULT_PROTOCOL_VERSION = 2; var formatFunctionInvocationUrl = function(baseUrl, args) { return stringUtils.format("{0}({1})", baseUrl, iteratorUtils.map(args || {}, function(value, key) { return stringUtils.format("{0}={1}", key, value) }).join(",")) }; var escapeServiceOperationParams = function(params, version) { if (!params) { return params } var result = {}; iteratorUtils.each(params, function(k, v) { result[k] = odataUtils.serializeValue(v, version) }); return result }; var SharedMethods = { _extractServiceOptions: function(options) { options = options || {}; this._url = String(options.url).replace(/\/+$/, ""); this._beforeSend = options.beforeSend; this._jsonp = options.jsonp; this._version = options.version || DEFAULT_PROTOCOL_VERSION; this._withCredentials = options.withCredentials; this._deserializeDates = options.deserializeDates; this._filterToLower = options.filterToLower }, _sendRequest: function(url, method, params, payload) { return odataUtils.sendRequest(this.version(), { url: url, method: method, params: params || {}, payload: payload }, { beforeSend: this._beforeSend, jsonp: this._jsonp, withCredentials: this._withCredentials, deserializeDates: this._deserializeDates }) }, version: function() { return this._version } }; exports.SharedMethods = SharedMethods; exports.escapeServiceOperationParams = escapeServiceOperationParams; exports.formatFunctionInvocationUrl = formatFunctionInvocationUrl }, /*!**********************************************************!*\ !*** ./artifacts/transpiled/localization/ldml/number.js ***! \**********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var fitIntoRange = __webpack_require__( /*! ../../core/utils/math */ 28).fitIntoRange; var toFixed = __webpack_require__( /*! ../utils */ 256).toFixed; var DEFAULT_CONFIG = { thousandsSeparator: ",", decimalSeparator: "." }; var ESCAPING_CHAR = "'"; var MAXIMUM_NUMBER_LENGTH = 15; function getGroupSizes(formatString) { return formatString.split(",").slice(1).map(function(str) { return str.split("").filter(function(char) { return "#" === char || "0" === char }).length }) } function getSignParts(format) { var signParts = format.split(";"); if (1 === signParts.length) { signParts.push("-" + signParts[0]) } return signParts } function reverseString(str) { return str.toString().split("").reverse().join("") } function isPercentFormat(format) { return format.indexOf("%") !== -1 && !format.match(/'[^']*%[^']*'/g) } function getNonRequiredDigitCount(floatFormat) { if (!floatFormat) { return 0 } return floatFormat.length - floatFormat.replace(/[#]/g, "").length } function getRequiredDigitCount(floatFormat) { if (!floatFormat) { return 0 } return floatFormat.length - floatFormat.replace(/[0]/g, "").length } function normalizeValueString(valuePart, minDigitCount, maxDigitCount) { if (!valuePart) { return "" } if (valuePart.length > maxDigitCount) { valuePart = valuePart.substr(0, maxDigitCount) } while (valuePart.length > minDigitCount && "0" === valuePart.slice(-1)) { valuePart = valuePart.substr(0, valuePart.length - 1) } while (valuePart.length < minDigitCount) { valuePart += "0" } return valuePart } function applyGroups(valueString, groupSizes, thousandsSeparator) { if (!groupSizes.length) { return valueString } var groups = []; var index = 0; while (valueString) { var groupSize = groupSizes[index]; groups.push(valueString.slice(0, groupSize)); valueString = valueString.slice(groupSize); if (index < groupSizes.length - 1) { index++ } } return groups.join(thousandsSeparator) } function formatNumberPart(format, valueString) { return format.split(ESCAPING_CHAR).map(function(formatPart, escapeIndex) { var isEscape = escapeIndex % 2; if (!formatPart && isEscape) { return ESCAPING_CHAR } return isEscape ? formatPart : formatPart.replace(/[,#0]+/, valueString) }).join("") } function getFloatPointIndex(format) { var isEscape = false; for (var index = 0; index < format.length; index++) { if ("'" === format[index]) { isEscape = !isEscape } if ("." === format[index] && !isEscape) { return index } } return format.length } function getFormatter(format, config) { config = config || DEFAULT_CONFIG; return function(value) { if ("number" !== typeof value || isNaN(value)) { return "" } var signFormatParts = getSignParts(format); var isPositiveZero = 1 / value === 1 / 0; var isPositive = value > 0 || isPositiveZero; var numberFormat = signFormatParts[isPositive ? 0 : 1]; if (isPercentFormat(numberFormat)) { value = 100 * value } if (!isPositive) { value = -value } var floatPointIndex = getFloatPointIndex(numberFormat); var floatFormatParts = [numberFormat.substr(0, floatPointIndex), numberFormat.substr(floatPointIndex + 1)]; var minFloatPrecision = getRequiredDigitCount(floatFormatParts[1]); var maxFloatPrecision = minFloatPrecision + getNonRequiredDigitCount(floatFormatParts[1]); var minIntegerPrecision = getRequiredDigitCount(floatFormatParts[0]); var maxIntegerPrecision = getNonRequiredDigitCount(floatFormatParts[0]) ? void 0 : minIntegerPrecision; var integerLength = Math.floor(value).toString().length; var floatPrecision = fitIntoRange(maxFloatPrecision, 0, MAXIMUM_NUMBER_LENGTH - integerLength); var groupSizes = getGroupSizes(floatFormatParts[0]).reverse(); var valueParts = toFixed(value, floatPrecision < 0 ? 0 : floatPrecision).split("."); var valueIntegerPart = normalizeValueString(reverseString(valueParts[0]), minIntegerPrecision, maxIntegerPrecision); var valueFloatPart = normalizeValueString(valueParts[1], minFloatPrecision, maxFloatPrecision); valueIntegerPart = applyGroups(valueIntegerPart, groupSizes, config.thousandsSeparator); var integerString = reverseString(formatNumberPart(reverseString(floatFormatParts[0]), valueIntegerPart)); var floatString = maxFloatPrecision ? formatNumberPart(floatFormatParts[1], valueFloatPart) : ""; var result = integerString + (floatString.match(/\d/) ? config.decimalSeparator : "") + floatString; return result } } function parseValue(text, isPercent, isNegative) { var value = (isPercent ? .01 : 1) * parseFloat(text) || 0; return isNegative ? -value : value } function prepareValueText(valueText, formatter, isPercent, isIntegerPart) { var nextValueText = valueText; var char; var text; var nextText; do { if (nextText) { char = text.length === nextText.length ? "0" : "1"; valueText = isIntegerPart ? char + valueText : valueText + char } text = nextText || formatter(parseValue(nextValueText, isPercent)); nextValueText = isIntegerPart ? "1" + nextValueText : nextValueText + "1"; nextText = formatter(parseValue(nextValueText, isPercent)) } while (text !== nextText && (isIntegerPart ? text.length === nextText.length : text.length <= nextText.length)); if (isIntegerPart && nextText.length > text.length) { var hasGroups = formatter(12345).indexOf("12345") === -1; do { valueText = "1" + valueText } while (hasGroups && parseValue(valueText, isPercent) < 1e5) } return valueText } function getFormatByValueText(valueText, formatter, isPercent, isNegative) { var format = formatter(parseValue(valueText, isPercent, isNegative)); var valueTextParts = valueText.split("."); var valueTextWithModifiedFloat = valueTextParts[0] + ".3" + valueTextParts[1].slice(1); var valueWithModifiedFloat = parseValue(valueTextWithModifiedFloat, isPercent, isNegative); var decimalSeparatorIndex = formatter(valueWithModifiedFloat).indexOf("3") - 1; format = format.replace(/(\d)\D(\d)/g, "$1,$2"); if (decimalSeparatorIndex >= 0) { format = format.slice(0, decimalSeparatorIndex) + "." + format.slice(decimalSeparatorIndex + 1) } format = format.replace(/1+/, "1").replace(/1/g, "#"); if (!isPercent) { format = format.replace("%", "'%'") } return format } function getFormat(formatter) { var valueText = "."; var isPercent = formatter(1).indexOf("100") >= 0; valueText = prepareValueText(valueText, formatter, isPercent, true); valueText = prepareValueText(valueText, formatter, isPercent, false); var positiveFormat = getFormatByValueText(valueText, formatter, isPercent, false); var negativeFormat = getFormatByValueText(valueText, formatter, isPercent, true); return negativeFormat === "-" + positiveFormat ? positiveFormat : positiveFormat + ";" + negativeFormat } exports.getFormatter = getFormatter; exports.getFormat = getFormat }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/localization/language_codes.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var locale = __webpack_require__( /*! ./core */ 87).locale; var LANGUAGE_CODES = { ar: 1, bg: 2, ca: 3, "zh-Hans": 4, cs: 5, da: 6, de: 7, el: 8, en: 9, es: 10, fi: 11, fr: 12, he: 13, hu: 14, is: 15, it: 16, ja: 17, ko: 18, nl: 19, no: 20, pl: 21, pt: 22, rm: 23, ro: 24, ru: 25, hr: 26, sk: 27, sq: 28, sv: 29, th: 30, tr: 31, ur: 32, id: 33, uk: 34, be: 35, sl: 36, et: 37, lv: 38, lt: 39, tg: 40, fa: 41, vi: 42, hy: 43, az: 44, eu: 45, hsb: 46, mk: 47, tn: 50, xh: 52, zu: 53, af: 54, ka: 55, fo: 56, hi: 57, mt: 58, se: 59, ga: 60, ms: 62, kk: 63, ky: 64, sw: 65, tk: 66, uz: 67, tt: 68, bn: 69, pa: 70, gu: 71, or: 72, ta: 73, te: 74, kn: 75, ml: 76, as: 77, mr: 78, sa: 79, mn: 80, bo: 81, cy: 82, km: 83, lo: 84, gl: 86, kok: 87, syr: 90, si: 91, iu: 93, am: 94, tzm: 95, ne: 97, fy: 98, ps: 99, fil: 100, dv: 101, ha: 104, yo: 106, quz: 107, nso: 108, ba: 109, lb: 110, kl: 111, ig: 112, ii: 120, arn: 122, moh: 124, br: 126, ug: 128, mi: 129, oc: 130, co: 131, gsw: 132, sah: 133, qut: 134, rw: 135, wo: 136, prs: 140, gd: 145, "ar-SA": 1025, "bg-BG": 1026, "ca-ES": 1027, "zh-TW": 1028, "cs-CZ": 1029, "da-DK": 1030, "de-DE": 1031, "el-GR": 1032, "en-US": 1033, "fi-FI": 1035, "fr-FR": 1036, "he-IL": 1037, "hu-HU": 1038, "is-IS": 1039, "it-IT": 1040, "ja-JP": 1041, "ko-KR": 1042, "nl-NL": 1043, "nb-NO": 1044, "pl-PL": 1045, "pt-BR": 1046, "rm-CH": 1047, "ro-RO": 1048, "ru-RU": 1049, "hr-HR": 1050, "sk-SK": 1051, "sq-AL": 1052, "sv-SE": 1053, "th-TH": 1054, "tr-TR": 1055, "ur-PK": 1056, "id-ID": 1057, "uk-UA": 1058, "be-BY": 1059, "sl-SI": 1060, "et-EE": 1061, "lv-LV": 1062, "lt-LT": 1063, "tg-Cyrl-TJ": 1064, "fa-IR": 1065, "vi-VN": 1066, "hy-AM": 1067, "az-Latn-AZ": 1068, "eu-ES": 1069, "hsb-DE": 1070, "mk-MK": 1071, "tn-ZA": 1074, "xh-ZA": 1076, "zu-ZA": 1077, "af-ZA": 1078, "ka-GE": 1079, "fo-FO": 1080, "hi-IN": 1081, "mt-MT": 1082, "se-NO": 1083, "ms-MY": 1086, "kk-KZ": 1087, "ky-KG": 1088, "sw-KE": 1089, "tk-TM": 1090, "uz-Latn-UZ": 1091, "tt-RU": 1092, "bn-IN": 1093, "pa-IN": 1094, "gu-IN": 1095, "or-IN": 1096, "ta-IN": 1097, "te-IN": 1098, "kn-IN": 1099, "ml-IN": 1100, "as-IN": 1101, "mr-IN": 1102, "sa-IN": 1103, "mn-MN": 1104, "bo-CN": 1105, "cy-GB": 1106, "km-KH": 1107, "lo-LA": 1108, "gl-ES": 1110, "kok-IN": 1111, "syr-SY": 1114, "si-LK": 1115, "iu-Cans-CA": 1117, "am-ET": 1118, "ne-NP": 1121, "fy-NL": 1122, "ps-AF": 1123, "fil-PH": 1124, "dv-MV": 1125, "ha-Latn-NG": 1128, "yo-NG": 1130, "quz-BO": 1131, "nso-ZA": 1132, "ba-RU": 1133, "lb-LU": 1134, "kl-GL": 1135, "ig-NG": 1136, "ii-CN": 1144, "arn-CL": 1146, "moh-CA": 1148, "br-FR": 1150, "ug-CN": 1152, "mi-NZ": 1153, "oc-FR": 1154, "co-FR": 1155, "gsw-FR": 1156, "sah-RU": 1157, "qut-GT": 1158, "rw-RW": 1159, "wo-SN": 1160, "prs-AF": 1164, "gd-GB": 1169, "ar-IQ": 2049, "zh-CN": 2052, "de-CH": 2055, "en-GB": 2057, "es-MX": 2058, "fr-BE": 2060, "it-CH": 2064, "nl-BE": 2067, "nn-NO": 2068, "pt-PT": 2070, "sr-Latn-CS": 2074, "sv-FI": 2077, "az-Cyrl-AZ": 2092, "dsb-DE": 2094, "se-SE": 2107, "ga-IE": 2108, "ms-BN": 2110, "uz-Cyrl-UZ": 2115, "bn-BD": 2117, "mn-Mong-CN": 2128, "iu-Latn-CA": 2141, "tzm-Latn-DZ": 2143, "quz-EC": 2155, "ar-EG": 3073, "zh-HK": 3076, "de-AT": 3079, "en-AU": 3081, "es-ES": 3082, "fr-CA": 3084, "sr-Cyrl-CS": 3098, "se-FI": 3131, "quz-PE": 3179, "ar-LY": 4097, "zh-SG": 4100, "de-LU": 4103, "en-CA": 4105, "es-GT": 4106, "fr-CH": 4108, "hr-BA": 4122, "smj-NO": 4155, "ar-DZ": 5121, "zh-MO": 5124, "de-LI": 5127, "en-NZ": 5129, "es-CR": 5130, "fr-LU": 5132, "bs-Latn-BA": 5146, "smj-SE": 5179, "ar-MA": 6145, "en-IE": 6153, "es-PA": 6154, "fr-MC": 6156, "sr-Latn-BA": 6170, "sma-NO": 6203, "ar-TN": 7169, "en-ZA": 7177, "es-DO": 7178, "sr-Cyrl-BA": 7194, "sma-SE": 7227, "ar-OM": 8193, "en-JM": 8201, "es-VE": 8202, "bs-Cyrl-BA": 8218, "sms-FI": 8251, "ar-YE": 9217, "en-029": 9225, "es-CO": 9226, "sr-Latn-RS": 9242, "smn-FI": 9275, "ar-SY": 10241, "en-BZ": 10249, "es-PE": 10250, "sr-Cyrl-RS": 10266, "ar-JO": 11265, "en-TT": 11273, "es-AR": 11274, "sr-Latn-ME": 11290, "ar-LB": 12289, "en-ZW": 12297, "es-EC": 12298, "sr-Cyrl-ME": 12314, "ar-KW": 13313, "en-PH": 13321, "es-CL": 13322, "ar-AE": 14337, "es-UY": 14346, "ar-BH": 15361, "es-PY": 15370, "ar-QA": 16385, "en-IN": 16393, "es-BO": 16394, "en-MY": 17417, "es-SV": 17418, "en-SG": 18441, "es-HN": 18442, "es-NI": 19466, "es-PR": 20490, "es-US": 21514, "bs-Cyrl": 25626, "bs-Latn": 26650, "sr-Cyrl": 27674, "sr-Latn": 28698, smn: 28731, "az-Cyrl": 29740, sms: 29755, zh: 30724, nn: 30740, bs: 30746, "az-Latn": 30764, sma: 30779, "uz-Cyrl": 30787, "mn-Cyrl": 30800, "iu-Cans": 30813, "zh-Hant": 31748, nb: 31764, sr: 31770, "tg-Cyrl": 31784, dsb: 31790, smj: 31803, "uz-Latn": 31811, "mn-Mong": 31824, "iu-Latn": 31837, "tzm-Latn": 31839, "ha-Latn": 31848 }; exports.getLanguageId = function() { return LANGUAGE_CODES[locale()] } }, /*!****************************************************!*\ !*** ./artifacts/transpiled/core/utils/storage.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var window = __webpack_require__( /*! ../../core/utils/window */ 7).getWindow(); var getSessionStorage = function() { var sessionStorage; try { sessionStorage = window.sessionStorage } catch (e) {} return sessionStorage }; exports.sessionStorage = getSessionStorage }, /*!***********************************************************************************!*\ !*** ./artifacts/transpiled/animation/transition_executor/transition_executor.js ***! \***********************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var Class = __webpack_require__( /*! ../../core/class */ 15); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3); var fx = __webpack_require__( /*! ../fx */ 38); var animationPresetsModule = __webpack_require__( /*! ../presets/presets */ 179); var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6); var when = deferredUtils.when; var Deferred = deferredUtils.Deferred; var directionPostfixes = { forward: " dx-forward", backward: " dx-backward", none: " dx-no-direction", undefined: " dx-no-direction" }; var 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 that = this; var result = []; configModifier = configModifier || {}; var 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 (typeUtils.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; var 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 (typeUtils.isPlainObject(animationConfig)) { result = fx.createAnimation($element, animationConfig) } else { if (typeUtils.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 = new 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 that = this; var result; if (!this._animations.length) { that.reset(); result = (new Deferred).resolve().promise() } else { var animationDeferreds = iteratorUtils.map(this._animations, function(animation) { var result = new 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 }, /*!****************************************!*\ !*** ./artifacts/transpiled/events.js ***! \****************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var eventsEngine = __webpack_require__( /*! ./events/core/events_engine */ 5); exports.on = eventsEngine.on; exports.one = eventsEngine.one; exports.off = eventsEngine.off; exports.trigger = eventsEngine.trigger; exports.triggerHandler = eventsEngine.triggerHandler; exports.Event = eventsEngine.Event }, /*!********************************************************!*\ !*** ./artifacts/transpiled/ui/selection/selection.js ***! \********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Class = __webpack_require__( /*! ../../core/class */ 15); var deferredStrategy = __webpack_require__( /*! ./selection.strategy.deferred */ 470); var standardStrategy = __webpack_require__( /*! ./selection.strategy.standard */ 471); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined; var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred; module.exports = Class.inherit({ ctor: function(options) { this.options = extend(this._getDefaultOptions(), options, { selectedItemKeys: options.selectedKeys || [] }); this._selectionStrategy = this.options.deferred ? new deferredStrategy(this.options) : new standardStrategy(this.options); this._focusedItemIndex = -1; if (!this.options.equalByReference) { this._selectionStrategy.updateSelectedItemKeyHash(this.options.selectedItemKeys) } }, _getDefaultOptions: function() { return { allowNullValue: false, deferred: false, equalByReference: false, mode: "multiple", selectedItems: [], selectionFilter: [], maxFilterLengthInRequest: 0, onSelectionChanged: noop, key: noop, keyOf: function(item) { return item }, load: function() { return (new Deferred).resolve([]) }, totalCount: function() { return -1 }, isSelectableItem: function() { return true }, isItemSelected: function() { return false }, getItemData: function(item) { return item }, dataFields: noop, filter: noop } }, validate: function() { this._selectionStrategy.validate() }, getSelectedItemKeys: function() { return this._selectionStrategy.getSelectedItemKeys() }, getSelectedItems: function() { return this._selectionStrategy.getSelectedItems() }, selectionFilter: function(value) { if (void 0 === value) { return this.options.selectionFilter } var filterIsChanged = this.options.selectionFilter !== value && JSON.stringify(this.options.selectionFilter) !== JSON.stringify(value); this.options.selectionFilter = value; filterIsChanged && this.onSelectionChanged() }, setSelection: function(keys) { return this.selectedItemKeys(keys) }, select: function(keys) { return this.selectedItemKeys(keys, true) }, deselect: function(keys) { return this.selectedItemKeys(keys, true, true) }, selectedItemKeys: function(keys, preserve, isDeselect, isSelectAll) { var that = this; keys = keys || []; keys = Array.isArray(keys) ? keys : [keys]; that.validate(); return this._selectionStrategy.selectedItemKeys(keys, preserve, isDeselect, isSelectAll) }, clearSelection: function() { return this.selectedItemKeys([]) }, _addSelectedItem: function(itemData, key) { this._selectionStrategy.addSelectedItem(key, itemData) }, _removeSelectedItem: function(key) { this._selectionStrategy.removeSelectedItem(key) }, _setSelectedItems: function(keys, items) { this._selectionStrategy.setSelectedItems(keys, items) }, onSelectionChanged: function() { this._selectionStrategy.onSelectionChanged() }, changeItemSelection: function(itemIndex, keys) { var isSelectedItemsChanged; var items = this.options.plainItems(); var item = items[itemIndex]; if (!this.isSelectable() || !this.isDataItem(item)) { return false } var itemData = this.options.getItemData(item); var itemKey = this.options.keyOf(itemData); keys = keys || {}; if (keys.shift && "multiple" === this.options.mode && this._focusedItemIndex >= 0) { isSelectedItemsChanged = this.changeItemSelectionWhenShiftKeyPressed(itemIndex, items) } else { if (keys.control) { this._resetItemSelectionWhenShiftKeyPressed(); var isSelected = this._selectionStrategy.isItemDataSelected(itemData); if ("single" === this.options.mode) { this.clearSelectedItems() } if (isSelected) { this._removeSelectedItem(itemKey) } else { this._addSelectedItem(itemData, itemKey) } isSelectedItemsChanged = true } else { this._resetItemSelectionWhenShiftKeyPressed(); var isKeysEqual = this._selectionStrategy.equalKeys(this.options.selectedItemKeys[0], itemKey); if (1 !== this.options.selectedItemKeys.length || !isKeysEqual) { this._setSelectedItems([itemKey], [itemData]); isSelectedItemsChanged = true } } } if (isSelectedItemsChanged) { this._focusedItemIndex = itemIndex; this.onSelectionChanged(); return true } }, isDataItem: function(item) { return this.options.isSelectableItem(item) }, isSelectable: function() { return "single" === this.options.mode || "multiple" === this.options.mode }, isItemDataSelected: function(data) { return this._selectionStrategy.isItemDataSelected(data) }, isItemSelected: function(arg) { return this._selectionStrategy.isItemKeySelected(arg) }, _resetItemSelectionWhenShiftKeyPressed: function() { delete this._shiftFocusedItemIndex }, _resetFocusedItemIndex: function() { this._focusedItemIndex = -1 }, changeItemSelectionWhenShiftKeyPressed: function(itemIndex, items) { var isSelectedItemsChanged = false; var itemIndexStep; var index; var keyOf = this.options.keyOf; var focusedItem = items[this._focusedItemIndex]; var focusedData = this.options.getItemData(focusedItem); var focusedKey = keyOf(focusedData); var isFocusedItemSelected = focusedItem && this.isItemDataSelected(focusedData); if (!isDefined(this._shiftFocusedItemIndex)) { this._shiftFocusedItemIndex = this._focusedItemIndex } var data; var itemKey; if (this._shiftFocusedItemIndex !== this._focusedItemIndex) { itemIndexStep = this._focusedItemIndex < this._shiftFocusedItemIndex ? 1 : -1; for (index = this._focusedItemIndex; index !== this._shiftFocusedItemIndex; index += itemIndexStep) { if (this.isDataItem(items[index])) { itemKey = keyOf(this.options.getItemData(items[index])); this._removeSelectedItem(itemKey); isSelectedItemsChanged = true } } } if (itemIndex !== this._shiftFocusedItemIndex) { itemIndexStep = itemIndex < this._shiftFocusedItemIndex ? 1 : -1; for (index = itemIndex; index !== this._shiftFocusedItemIndex; index += itemIndexStep) { if (this.isDataItem(items[index])) { data = this.options.getItemData(items[index]); itemKey = keyOf(data); this._addSelectedItem(data, itemKey); isSelectedItemsChanged = true } } } if (this.isDataItem(focusedItem) && !isFocusedItemSelected) { this._addSelectedItem(focusedData, focusedKey); isSelectedItemsChanged = true } return isSelectedItemsChanged }, clearSelectedItems: function() { this._setSelectedItems([], []) }, selectAll: function(isOnePage) { this._resetFocusedItemIndex(); if (isOnePage) { return this._onePageSelectAll(false) } else { return this.selectedItemKeys([], true, false, true) } }, deselectAll: function(isOnePage) { this._resetFocusedItemIndex(); if (isOnePage) { return this._onePageSelectAll(true) } else { return this.selectedItemKeys([], true, true, true) } }, _onePageSelectAll: function(isDeselect) { var items = this.options.plainItems(); for (var i = 0; i < items.length; i++) { var item = items[i]; if (this.isDataItem(item)) { var itemData = this.options.getItemData(item); var itemKey = this.options.keyOf(itemData); var isSelected = this.isItemSelected(itemKey); if (!isSelected && !isDeselect) { this._addSelectedItem(itemData, itemKey) } if (isSelected && isDeselect) { this._removeSelectedItem(itemKey) } } } this.onSelectionChanged(); return (new Deferred).resolve() }, getSelectAllState: function(visibleOnly) { return this._selectionStrategy.getSelectAllState(visibleOnly) } }) }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/core/utils/selection_filter.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var getKeyHash = __webpack_require__( /*! ./common */ 4).getKeyHash; var equalByValue = __webpack_require__( /*! ./common */ 4).equalByValue; var typeUtils = __webpack_require__( /*! ./type */ 1); var SelectionFilterCreator = function(selectedItemKeys, isSelectAll) { this.getLocalFilter = function(keyGetter, equalKeys, equalByReference, keyExpr) { equalKeys = void 0 === equalKeys ? equalByValue : equalKeys; return functionFilter.bind(this, equalKeys, keyGetter, equalByReference, keyExpr) }; this.getExpr = function(keyExpr) { if (!keyExpr) { return } var filterExpr; selectedItemKeys.forEach(function(key, index) { filterExpr = filterExpr || []; var filterExprPart; if (index > 0) { filterExpr.push(isSelectAll ? "and" : "or") } if (typeUtils.isString(keyExpr)) { filterExprPart = getFilterForPlainKey(keyExpr, key) } else { filterExprPart = getFilterForCompositeKey(keyExpr, key) } filterExpr.push(filterExprPart) }); if (filterExpr && 1 === filterExpr.length) { filterExpr = filterExpr[0] } return filterExpr }; this.getCombinedFilter = function(keyExpr, dataSourceFilter) { var filterExpr = this.getExpr(keyExpr); var combinedFilter = filterExpr; if (isSelectAll && dataSourceFilter) { if (filterExpr) { combinedFilter = []; combinedFilter.push(filterExpr); combinedFilter.push(dataSourceFilter) } else { combinedFilter = dataSourceFilter } } return combinedFilter }; var selectedItemKeyHashesMap; var getSelectedItemKeyHashesMap = function(selectedItemKeys) { if (!selectedItemKeyHashesMap) { selectedItemKeyHashesMap = {}; for (var i = 0; i < selectedItemKeys.length; i++) { selectedItemKeyHashesMap[getKeyHash(selectedItemKeys[i])] = true } } return selectedItemKeyHashesMap }; var normalizeKeys = function(keys, keyOf, keyExpr) { return Array.isArray(keyExpr) ? keys.map(function(key) { return keyOf(key) }) : keys }; var functionFilter = function(equalKeys, keyOf, equalByReference, keyExpr, item) { var key = keyOf(item); var keyHash; var i; if (!equalByReference) { keyHash = getKeyHash(key); if (!typeUtils.isObject(keyHash)) { var selectedKeyHashesMap = getSelectedItemKeyHashesMap(normalizeKeys(selectedItemKeys, keyOf, keyExpr)); if (selectedKeyHashesMap[keyHash]) { return !isSelectAll } return !!isSelectAll } } for (i = 0; i < selectedItemKeys.length; i++) { if (equalKeys(selectedItemKeys[i], key)) { return !isSelectAll } } return !!isSelectAll }; var getFilterForPlainKey = function(keyExpr, keyValue) { if (void 0 === keyValue) { return } return [keyExpr, isSelectAll ? "<>" : "=", keyValue] }; var getFilterForCompositeKey = function(keyExpr, itemKeyValue) { var filterExpr = []; for (var i = 0, length = keyExpr.length; i < length; i++) { var currentKeyExpr = keyExpr[i]; var currentKeyValue = itemKeyValue && itemKeyValue[currentKeyExpr]; var filterExprPart = getFilterForPlainKey(currentKeyExpr, currentKeyValue); if (!filterExprPart) { break } if (i > 0) { filterExpr.push(isSelectAll ? "or" : "and") } filterExpr.push(filterExprPart) } return filterExpr } }; exports.SelectionFilterCreator = SelectionFilterCreator }, /*!**************************************************!*\ !*** ./artifacts/transpiled/events/transform.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var mathUtils = __webpack_require__( /*! ../core/utils/math */ 28); var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3); var errors = __webpack_require__( /*! ../core/errors */ 21); var eventUtils = __webpack_require__( /*! ./utils */ 8); var Emitter = __webpack_require__( /*! ./core/emitter */ 123); var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95); var DX_PREFIX = "dx"; var TRANSFORM = "transform"; var TRANSLATE = "translate"; var ZOOM = "zoom"; var PINCH = "pinch"; var ROTATE = "rotate"; var START_POSTFIX = "start"; var UPDATE_POSTFIX = ""; var END_POSTFIX = "end"; var eventAliases = []; var addAlias = function(eventName, eventArgs) { eventAliases.push({ name: eventName, args: eventArgs }) }; addAlias(TRANSFORM, { scale: true, deltaScale: true, rotation: true, deltaRotation: true, translation: true, deltaTranslation: true }); addAlias(TRANSLATE, { translation: true, deltaTranslation: true }); addAlias(ZOOM, { scale: true, deltaScale: true }); addAlias(PINCH, { scale: true, deltaScale: true }); addAlias(ROTATE, { rotation: true, deltaRotation: true }); var getVector = function(first, second) { return { x: second.pageX - first.pageX, y: -second.pageY + first.pageY, centerX: .5 * (second.pageX + first.pageX), centerY: .5 * (second.pageY + first.pageY) } }; var getEventVector = function(e) { var pointers = e.pointers; return getVector(pointers[0], pointers[1]) }; var getDistance = function(vector) { return Math.sqrt(vector.x * vector.x + vector.y * vector.y) }; var getScale = function(firstVector, secondVector) { return getDistance(firstVector) / getDistance(secondVector) }; var getRotation = function(firstVector, secondVector) { var scalarProduct = firstVector.x * secondVector.x + firstVector.y * secondVector.y; var distanceProduct = getDistance(firstVector) * getDistance(secondVector); if (0 === distanceProduct) { return 0 } var sign = mathUtils.sign(firstVector.x * secondVector.y - secondVector.x * firstVector.y); var angle = Math.acos(mathUtils.fitIntoRange(scalarProduct / distanceProduct, -1, 1)); return sign * angle }; var getTranslation = function(firstVector, secondVector) { return { x: firstVector.centerX - secondVector.centerX, y: firstVector.centerY - secondVector.centerY } }; var TransformEmitter = Emitter.inherit({ configure: function(data, eventName) { if (eventName.indexOf(ZOOM) > -1) { errors.log("W0005", eventName, "15.1", "Use '" + eventName.replace(ZOOM, PINCH) + "' event instead") } this.callBase(data) }, validatePointers: function(e) { return eventUtils.hasTouches(e) > 1 }, start: function(e) { this._accept(e); var startVector = getEventVector(e); this._startVector = startVector; this._prevVector = startVector; this._fireEventAliases(START_POSTFIX, e) }, move: function(e) { var currentVector = getEventVector(e); var eventArgs = this._getEventArgs(currentVector); this._fireEventAliases(UPDATE_POSTFIX, e, eventArgs); this._prevVector = currentVector }, end: function(e) { var eventArgs = this._getEventArgs(this._prevVector); this._fireEventAliases(END_POSTFIX, e, eventArgs) }, _getEventArgs: function(vector) { return { scale: getScale(vector, this._startVector), deltaScale: getScale(vector, this._prevVector), rotation: getRotation(vector, this._startVector), deltaRotation: getRotation(vector, this._prevVector), translation: getTranslation(vector, this._startVector), deltaTranslation: getTranslation(vector, this._prevVector) } }, _fireEventAliases: function(eventPostfix, originalEvent, eventArgs) { eventArgs = eventArgs || {}; iteratorUtils.each(eventAliases, function(_, eventAlias) { var args = {}; iteratorUtils.each(eventAlias.args, function(name) { if (name in eventArgs) { args[name] = eventArgs[name] } }); this._fireEvent(DX_PREFIX + eventAlias.name + eventPostfix, originalEvent, args) }.bind(this)) } }); var eventNames = eventAliases.reduce(function(result, eventAlias) { [START_POSTFIX, UPDATE_POSTFIX, END_POSTFIX].forEach(function(eventPostfix) { result.push(DX_PREFIX + eventAlias.name + eventPostfix) }); return result }, []); registerEmitter({ emitter: TransformEmitter, events: eventNames }); iteratorUtils.each(eventNames, function(_, eventName) { exports[eventName.substring(DX_PREFIX.length)] = eventName }) }, /*!****************************************************************!*\ !*** ./artifacts/transpiled/ui/shared/async_template_mixin.js ***! \****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = { _waitAsyncTemplates: function(callback) { if (this._options.templatesRenderAsynchronously) { this._asyncTemplatesTimers = this._asyncTemplatesTimers || []; var timer = setTimeout(function() { callback.call(this); clearTimeout(timer) }.bind(this)); this._asyncTemplatesTimers.push(timer) } else { callback.call(this) } }, _cleanAsyncTemplatesTimer: function() { var timers = this._asyncTemplatesTimers || []; for (var i = 0; i < timers.length; i++) { clearTimeout(timers[i]) } delete this._asyncTemplatesTimers } } }, /*!************************************************************************!*\ !*** ./artifacts/transpiled/ui/shared/grouped_data_converter_mixin.js ***! \************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var isCorrectStructure = function(data) { return Array.isArray(data) && data.every(function(item) { var hasTwoFields = 2 === Object.keys(item).length; var hasCorrectFields = "key" in item && "items" in item; return hasTwoFields && hasCorrectFields && Array.isArray(item.items) }) }; exports.default = { _getSpecificDataSourceOption: function() { var groupKey = "key"; var dataSource = this.option("dataSource"); var hasSimpleItems = false; var data = {}; if (this._getGroupedOption() && isCorrectStructure(dataSource)) { data = dataSource.reduce(function(accumulator, item) { var items = item.items.map(function(innerItem) { if (!(0, _type.isObject)(innerItem)) { innerItem = { text: innerItem }; hasSimpleItems = true } if (!(groupKey in innerItem)) { innerItem[groupKey] = item.key } return innerItem }); return accumulator.concat(items) }, []); dataSource = { store: { type: "array", data: data }, group: { selector: "key", keepInitialKeyOrder: true } }; if (hasSimpleItems) { dataSource.searchExpr = "text" } } return dataSource } } }, /*!************************************************************!*\ !*** ./artifacts/transpiled/bundles/modules/parts/data.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var DevExpress = __webpack_require__( /*! ./core */ 212); var data = DevExpress.data = __webpack_require__( /*! ../../../bundles/modules/data */ 274); data.odata = __webpack_require__( /*! ../../../bundles/modules/data.odata */ 490); module.exports = data }, /*!************************************************************!*\ !*** ./artifacts/transpiled/ui/toolbar/ui.toolbar.base.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _themes = __webpack_require__( /*! ../themes */ 30); var _themes2 = _interopRequireDefault(_themes); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _common2 = _interopRequireDefault(_common); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _component_registrator = __webpack_require__( /*! ../../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _array = __webpack_require__( /*! ../../core/utils/array */ 14); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var _uiCollection_widget = __webpack_require__( /*! ../collection/ui.collection_widget.async */ 494); var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget); var _promise = __webpack_require__( /*! ../../core/polyfills/promise */ 76); var _promise2 = _interopRequireDefault(_promise); var _bindable_template = __webpack_require__( /*! ../widget/bindable_template */ 65); var _bindable_template2 = _interopRequireDefault(_bindable_template); var _fx = __webpack_require__( /*! ../../animation/fx */ 38); var _fx2 = _interopRequireDefault(_fx); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var TOOLBAR_CLASS = "dx-toolbar"; var TOOLBAR_BEFORE_CLASS = "dx-toolbar-before"; var TOOLBAR_CENTER_CLASS = "dx-toolbar-center"; var TOOLBAR_AFTER_CLASS = "dx-toolbar-after"; var TOOLBAR_BOTTOM_CLASS = "dx-toolbar-bottom"; var TOOLBAR_MINI_CLASS = "dx-toolbar-mini"; var TOOLBAR_ITEM_CLASS = "dx-toolbar-item"; var TOOLBAR_LABEL_CLASS = "dx-toolbar-label"; var TOOLBAR_BUTTON_CLASS = "dx-toolbar-button"; var TOOLBAR_ITEMS_CONTAINER_CLASS = "dx-toolbar-items-container"; var TOOLBAR_GROUP_CLASS = "dx-toolbar-group"; var TOOLBAR_COMPACT_CLASS = "dx-toolbar-compact"; var TOOLBAR_LABEL_SELECTOR = "." + TOOLBAR_LABEL_CLASS; var TEXT_BUTTON_MODE = "text"; var DEFAULT_BUTTON_TYPE = "default"; var TOOLBAR_ITEM_DATA_KEY = "dxToolbarItemDataKey"; var ToolbarBase = _uiCollection_widget2.default.inherit({ compactMode: false, ctor: function(element, options) { this._userOptions = options || {}; this.callBase(element, options) }, _getSynchronizableOptionsForCreateComponent: function() { return this.callBase().filter(function(item) { return "disabled" !== item }) }, _initTemplates: function() { this.callBase(); var template = new _bindable_template2.default(function($container, data, rawModel) { if ((0, _type.isPlainObject)(data)) { if (data.text) { $container.text(data.text).wrapInner("
") } if (data.html) { $container.html(data.html) } if ("dxButton" === data.widget) { if (this.option("useFlatButtons")) { data.options = data.options || {}; data.options.stylingMode = data.options.stylingMode || TEXT_BUTTON_MODE } if (this.option("useDefaultButtons")) { data.options = data.options || {}; data.options.type = data.options.type || DEFAULT_BUTTON_TYPE } } } else { $container.text(String(data)) } this._getTemplate("dx-polymorph-widget").render({ container: $container, model: rawModel, parent: this }) }.bind(this), ["text", "html", "widget", "options"], this.option("integrationOptions.watchMethod")); this._defaultTemplates.item = template; this._defaultTemplates.menuItem = template }, _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { renderAs: "topToolbar", grouped: false, useFlatButtons: false, useDefaultButtons: false }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function() { return _themes2.default.isMaterial() }, options: { useFlatButtons: true } }]) }, _itemContainer: function() { return this._$toolbarItemsContainer.find(["." + TOOLBAR_BEFORE_CLASS, "." + TOOLBAR_CENTER_CLASS, "." + TOOLBAR_AFTER_CLASS].join(",")) }, _itemClass: function() { return TOOLBAR_ITEM_CLASS }, _itemDataKey: function() { return TOOLBAR_ITEM_DATA_KEY }, _buttonClass: function() { return TOOLBAR_BUTTON_CLASS }, _dimensionChanged: function() { this._arrangeItems(); this._applyCompactMode() }, _initMarkup: function() { this._renderToolbar(); this._renderSections(); this.callBase(); this.setAria("role", "toolbar") }, _waitParentAnimationFinished: function() { var $element = this.$element(); var timeout = 15; return new _promise2.default(function(resolve) { var check = function() { var readyToResolve = true; $element.parents().each(function(_, parent) { if (_fx2.default.isAnimating((0, _renderer2.default)(parent))) { readyToResolve = false; return false } }); if (readyToResolve) { resolve() } return readyToResolve }; var runCheck = function runCheck() { setTimeout(function() { return check() || runCheck() }, timeout) }; $element.width() > 0 && check() || runCheck() }) }, _render: function() { this.callBase(); this._renderItemsAsync(); if (_themes2.default.isMaterial()) { _promise2.default.all([this._waitParentAnimationFinished(), this._checkWebFontForLabelsLoaded()]).then(this._dimensionChanged.bind(this)) } }, _postProcessRenderItems: function() { this._arrangeItems() }, _renderToolbar: function() { this.$element().addClass(TOOLBAR_CLASS).toggleClass(TOOLBAR_BOTTOM_CLASS, "bottomToolbar" === this.option("renderAs")); this._$toolbarItemsContainer = (0, _renderer2.default)("
").addClass(TOOLBAR_ITEMS_CONTAINER_CLASS).appendTo(this.$element()) }, _renderSections: function() { var $container = this._$toolbarItemsContainer; var that = this; (0, _iterator.each)(["before", "center", "after"], function() { var sectionClass = "dx-toolbar-" + this; var $section = $container.find("." + sectionClass); if (!$section.length) { that["_$" + this + "Section"] = $section = (0, _renderer2.default)("
").addClass(sectionClass).appendTo($container) } }) }, _checkWebFontForLabelsLoaded: function() { var $labels = this.$element().find(TOOLBAR_LABEL_SELECTOR); var promises = []; $labels.each(function(_, label) { var text = (0, _renderer2.default)(label).text(); var fontWeight = (0, _renderer2.default)(label).css("fontWeight"); promises.push(_themes2.default.waitWebFont(text, fontWeight)) }); return _promise2.default.all(promises) }, _arrangeItems: function(elementWidth) { elementWidth = elementWidth || this.$element().width(); this._$centerSection.css({ margin: "0 auto", "float": "none" }); var beforeRect = this._$beforeSection.get(0).getBoundingClientRect(); var afterRect = this._$afterSection.get(0).getBoundingClientRect(); this._alignCenterSection(beforeRect, afterRect, elementWidth); var $label = this._$toolbarItemsContainer.find(TOOLBAR_LABEL_SELECTOR).eq(0); var $section = $label.parent(); if (!$label.length) { return } var labelOffset = beforeRect.width ? beforeRect.width : $label.position().left; var widthBeforeSection = $section.hasClass(TOOLBAR_BEFORE_CLASS) ? 0 : labelOffset; var widthAfterSection = $section.hasClass(TOOLBAR_AFTER_CLASS) ? 0 : afterRect.width; var elemsAtSectionWidth = 0; $section.children().not(TOOLBAR_LABEL_SELECTOR).each(function() { elemsAtSectionWidth += (0, _renderer2.default)(this).outerWidth() }); var freeSpace = elementWidth - elemsAtSectionWidth; var sectionMaxWidth = Math.max(freeSpace - widthBeforeSection - widthAfterSection, 0); if ($section.hasClass(TOOLBAR_BEFORE_CLASS)) { this._alignSection(this._$beforeSection, sectionMaxWidth) } else { var labelPaddings = $label.outerWidth() - $label.width(); $label.css("maxWidth", sectionMaxWidth - labelPaddings) } }, _alignCenterSection: function(beforeRect, afterRect, elementWidth) { this._alignSection(this._$centerSection, elementWidth - beforeRect.width - afterRect.width); var isRTL = this.option("rtlEnabled"); var leftRect = isRTL ? afterRect : beforeRect; var rightRect = isRTL ? beforeRect : afterRect; var centerRect = this._$centerSection.get(0).getBoundingClientRect(); if (leftRect.right > centerRect.left || centerRect.right > rightRect.left) { this._$centerSection.css({ marginLeft: leftRect.width, marginRight: rightRect.width, "float": leftRect.width > rightRect.width ? "none" : "right" }) } }, _alignSection: function($section, maxWidth) { var $labels = $section.find(TOOLBAR_LABEL_SELECTOR); var labels = $labels.toArray(); maxWidth -= this._getCurrentLabelsPaddings(labels); var currentWidth = this._getCurrentLabelsWidth(labels); var difference = Math.abs(currentWidth - maxWidth); if (maxWidth < currentWidth) { labels = labels.reverse(); this._alignSectionLabels(labels, difference, false) } else { this._alignSectionLabels(labels, difference, true) } }, _alignSectionLabels: function(labels, difference, expanding) { var getRealLabelWidth = function(label) { return label.getBoundingClientRect().width }; for (var i = 0; i < labels.length; i++) { var $label = (0, _renderer2.default)(labels[i]); var currentLabelWidth = Math.ceil(getRealLabelWidth(labels[i])); var labelMaxWidth; if (expanding) { $label.css("maxWidth", "inherit") } var possibleLabelWidth = Math.ceil(expanding ? getRealLabelWidth(labels[i]) : currentLabelWidth); if (possibleLabelWidth < difference) { labelMaxWidth = expanding ? possibleLabelWidth : 0; difference -= possibleLabelWidth } else { labelMaxWidth = expanding ? currentLabelWidth + difference : currentLabelWidth - difference; $label.css("maxWidth", labelMaxWidth); break } $label.css("maxWidth", labelMaxWidth) } }, _applyCompactMode: function() { var $element = this.$element(); $element.removeClass(TOOLBAR_COMPACT_CLASS); if (this.option("compactMode") && this._getSummaryItemsWidth(this.itemElements(), true) > $element.width()) { $element.addClass(TOOLBAR_COMPACT_CLASS) } }, _getCurrentLabelsWidth: function(labels) { var width = 0; labels.forEach(function(label, index) { width += (0, _renderer2.default)(label).outerWidth() }); return width }, _getCurrentLabelsPaddings: function(labels) { var padding = 0; labels.forEach(function(label, index) { padding += (0, _renderer2.default)(label).outerWidth() - (0, _renderer2.default)(label).width() }); return padding }, _renderItem: function(index, item, itemContainer, $after) { var location = item.location || "center"; var container = itemContainer || this["_$" + location + "Section"]; var itemHasText = !!(item.text || item.html); var itemElement = this.callBase(index, item, container, $after); itemElement.toggleClass(this._buttonClass(), !itemHasText).toggleClass(TOOLBAR_LABEL_CLASS, itemHasText).addClass(item.cssClass); return itemElement }, _renderGroupedItems: function() { var that = this; (0, _iterator.each)(this.option("items"), function(groupIndex, group) { var groupItems = group.items; var $container = (0, _renderer2.default)("
").addClass(TOOLBAR_GROUP_CLASS); var location = group.location || "center"; if (!groupItems || !groupItems.length) { return }(0, _iterator.each)(groupItems, function(itemIndex, item) { that._renderItem(itemIndex, item, $container, null) }); that._$toolbarItemsContainer.find(".dx-toolbar-" + location).append($container) }) }, _renderItems: function(items) { var grouped = this.option("grouped") && items.length && items[0].items; grouped ? this._renderGroupedItems() : this.callBase(items) }, _getToolbarItems: function() { return this.option("items") || [] }, _renderContentImpl: function() { var items = this._getToolbarItems(); this.$element().toggleClass(TOOLBAR_MINI_CLASS, 0 === items.length); if (this._renderedItemsCount) { this._renderItems(items.slice(this._renderedItemsCount)) } else { this._renderItems(items) } this._applyCompactMode() }, _renderEmptyMessage: _common2.default.noop, _clean: function() { this._$toolbarItemsContainer.children().empty(); this.$element().empty() }, _visibilityChanged: function(visible) { if (visible) { this._arrangeItems() } }, _isVisible: function() { return this.$element().width() > 0 && this.$element().height() > 0 }, _getIndexByItem: function(item) { return (0, _array.inArray)(item, this._getToolbarItems()) }, _itemOptionChanged: function(item, property, value) { this.callBase.apply(this, [item, property, value]); this._arrangeItems() }, _optionChanged: function(args) { var name = args.name; switch (name) { case "width": this.callBase.apply(this, arguments); this._dimensionChanged(); break; case "renderAs": case "useFlatButtons": case "useDefaultButtons": this._invalidate(); break; case "compactMode": this._applyCompactMode(); break; case "grouped": break; default: this.callBase.apply(this, arguments) } } }); (0, _component_registrator2.default)("dxToolbarBase", ToolbarBase); module.exports = ToolbarBase }, /*!*******************************************!*\ !*** ./artifacts/transpiled/ui/notify.js ***! \*******************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var Action = __webpack_require__( /*! ../core/action */ 111); var viewPortUtils = __webpack_require__( /*! ../core/utils/view_port */ 78); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var isPlainObject = __webpack_require__( /*! ../core/utils/type */ 1).isPlainObject; var Toast = __webpack_require__( /*! ./toast */ 291); var $notify = null; var notify = function(message, type, displayTime) { var options = isPlainObject(message) ? message : { message: message }; var userHiddenAction = options.onHidden; extend(options, { type: type, displayTime: displayTime, onHidden: function(args) { $(args.element).remove(); new Action(userHiddenAction, { context: args.model }).execute(arguments) } }); $notify = $("
").appendTo(viewPortUtils.value()); new Toast($notify, options).show() }; module.exports = notify }, /*!******************************************!*\ !*** ./artifacts/transpiled/ui/toast.js ***! \******************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2); var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow(); var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11); var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var ready = __webpack_require__( /*! ../core/utils/ready_callbacks */ 48).add; var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4); var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1); var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend; var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray; var pointerEvents = __webpack_require__( /*! ../events/pointer */ 23); var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var Overlay = __webpack_require__( /*! ./overlay */ 59); var themes = __webpack_require__( /*! ./themes */ 30); var TOAST_CLASS = "dx-toast"; var TOAST_CLASS_PREFIX = TOAST_CLASS + "-"; var TOAST_WRAPPER_CLASS = TOAST_CLASS_PREFIX + "wrapper"; var TOAST_CONTENT_CLASS = TOAST_CLASS_PREFIX + "content"; var TOAST_MESSAGE_CLASS = TOAST_CLASS_PREFIX + "message"; var TOAST_ICON_CLASS = TOAST_CLASS_PREFIX + "icon"; var WIDGET_NAME = "dxToast"; var toastTypes = ["info", "warning", "error", "success"]; var TOAST_STACK = []; var FIRST_Z_INDEX_OFFSET = 8e3; var visibleToastInstance = null; var POSITION_ALIASES = { top: { my: "top", at: "top", of: null, offset: "0 0" }, bottom: { my: "bottom", at: "bottom", of: null, offset: "0 -20" }, center: { my: "center", at: "center", of: null, offset: "0 0" }, right: { my: "center right", at: "center right", of: null, offset: "0 0" }, left: { my: "center left", at: "center left", of: null, offset: "0 0" } }; ready(function() { eventsEngine.subscribeGlobal(domAdapter.getDocument(), pointerEvents.down, function(e) { for (var i = TOAST_STACK.length - 1; i >= 0; i--) { if (!TOAST_STACK[i]._proxiedDocumentDownHandler(e)) { return } } }) }); var Toast = Overlay.inherit({ _getDefaultOptions: function() { return extend(this.callBase(), { message: "", type: "info", displayTime: 2e3, position: "bottom center", animation: { show: { type: "fade", duration: 400, from: 0, to: 1 }, hide: { type: "fade", duration: 400, to: 0 } }, shading: false, height: "auto", closeOnBackButton: false, closeOnSwipe: true, closeOnClick: false, resizeEnabled: false }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function(_device) { return "win" === _device.platform && _device.version && 8 === _device.version[0] }, options: { position: "top center", width: function() { return $(window).width() } } }, { device: function(_device2) { return "win" === _device2.platform && _device2.version && 10 === _device2.version[0] }, options: { position: "bottom right", width: "auto" } }, { device: { platform: "android" }, options: { closeOnOutsideClick: true, width: "auto", position: { at: "bottom left", my: "bottom left", offset: "20 -20" }, animation: { show: { type: "slide", duration: 200, from: { position: { my: "top", at: "bottom", of: window } } }, hide: { type: "slide", duration: 200, to: { position: { my: "top", at: "bottom", of: window } } } } } }, { device: function(_device3) { var isPhone = "phone" === _device3.deviceType; var isAndroid = "android" === _device3.platform; var isWin10 = "win" === _device3.platform && _device3.version && 10 === _device3.version[0]; return isPhone && (isAndroid || isWin10) }, options: { width: function() { return $(window).width() }, position: { at: "bottom center", my: "bottom center", offset: "0 0" } } }, { device: function() { return themes.isMaterial() }, options: { minWidth: 344, maxWidth: 568, displayTime: 4e3 } }]) }, _init: function() { this.callBase(); this._posStringToObject() }, _renderContentImpl: function() { if (this.option("message")) { this._message = $("
").addClass(TOAST_MESSAGE_CLASS).text(this.option("message")).appendTo(this.$content()) } this.setAria("role", "alert", this._message); if (inArray(this.option("type").toLowerCase(), toastTypes) > -1) { this.$content().prepend($("
").addClass(TOAST_ICON_CLASS)) } this.callBase() }, _render: function() { this.callBase(); this.$element().addClass(TOAST_CLASS); this._wrapper().addClass(TOAST_WRAPPER_CLASS); this._$content.addClass(TOAST_CLASS_PREFIX + String(this.option("type")).toLowerCase()); this.$content().addClass(TOAST_CONTENT_CLASS); this._toggleCloseEvents("Swipe"); this._toggleCloseEvents("Click") }, _renderScrollTerminator: commonUtils.noop, _toggleCloseEvents: function(event) { var dxEvent = "dx" + event.toLowerCase(); eventsEngine.off(this._$content, dxEvent); this.option("closeOn" + event) && eventsEngine.on(this._$content, dxEvent, this.hide.bind(this)) }, _posStringToObject: function() { if (!typeUtils.isString(this.option("position"))) { return } var verticalPosition = this.option("position").split(" ")[0]; var horizontalPosition = this.option("position").split(" ")[1]; this.option("position", extend({}, POSITION_ALIASES[verticalPosition])); switch (horizontalPosition) { case "center": case "left": case "right": this.option("position").at += " " + horizontalPosition; this.option("position").my += " " + horizontalPosition } }, _show: function() { if (visibleToastInstance && visibleToastInstance !== this) { clearTimeout(visibleToastInstance._hideTimeout); visibleToastInstance.hide() } visibleToastInstance = this; return this.callBase.apply(this, arguments).done(function() { clearTimeout(this._hideTimeout); this._hideTimeout = setTimeout(this.hide.bind(this), this.option("displayTime")) }.bind(this)) }, _hide: function() { visibleToastInstance = null; return this.callBase.apply(this, arguments) }, _overlayStack: function() { return TOAST_STACK }, _zIndexInitValue: function() { return this.callBase() + FIRST_Z_INDEX_OFFSET }, _dispose: function() { clearTimeout(this._hideTimeout); visibleToastInstance = null; this.callBase() }, _optionChanged: function(args) { switch (args.name) { case "type": this._$content.removeClass(TOAST_CLASS_PREFIX + args.previousValue); this._$content.addClass(TOAST_CLASS_PREFIX + String(args.value).toLowerCase()); break; case "message": if (this._message) { this._message.text(args.value) } break; case "closeOnSwipe": this._toggleCloseEvents("Swipe"); break; case "closeOnClick": this._toggleCloseEvents("Click"); break; case "displayTime": case "position": break; default: this.callBase(args) } } }); registerComponent(WIDGET_NAME, Toast); module.exports = Toast }, /*!***************************************************************************!*\ !*** ./artifacts/transpiled/ui/speed_dial_action/speed_dial_main_item.js ***! \***************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj }, _typeof(obj) } var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _config = __webpack_require__( /*! ../../core/config */ 31); var _config2 = _interopRequireDefault(_config); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _ui = __webpack_require__( /*! ../widget/ui.errors */ 17); var _ui2 = _interopRequireDefault(_ui); var _swatch_container = __webpack_require__( /*! ../widget/swatch_container */ 150); var _speed_dial_item = __webpack_require__( /*! ./speed_dial_item */ 496); var _speed_dial_item2 = _interopRequireDefault(_speed_dial_item); var _themes = __webpack_require__( /*! ../themes */ 30); var _themes2 = _interopRequireDefault(_themes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true } Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) { _defineProperties(Constructor.prototype, protoProps) } if (staticProps) { _defineProperties(Constructor, staticProps) } Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor } function _get() { if ("undefined" !== typeof Reflect && Reflect.get) { _get = Reflect.get.bind() } else { _get = function(target, property, receiver) { var base = _superPropBase(target, property); if (!base) { return } var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver) } return desc.value } } return _get.apply(this, arguments) } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (null === object) { break } } return object } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function") } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) { _setPrototypeOf(subClass, superClass) } } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, p) { o.__proto__ = p; return o }; return _setPrototypeOf(o, p) } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function() { var result, Super = _getPrototypeOf(Derived); if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget) } else { result = Super.apply(this, arguments) } return _possibleConstructorReturn(this, result) } } function _possibleConstructorReturn(self, call) { if (call && ("object" === _typeof(call) || "function" === typeof call)) { return call } else { if (void 0 !== call) { throw new TypeError("Derived constructors may only return object or undefined") } } return _assertThisInitialized(self) } function _assertThisInitialized(self) { if (void 0 === self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return self } function _isNativeReflectConstruct() { if ("undefined" === typeof Reflect || !Reflect.construct) { return false } if (Reflect.construct.sham) { return false } if ("function" === typeof Proxy) { return true } try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); return true } catch (e) { return false } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(o) { return o.__proto__ || Object.getPrototypeOf(o) }; return _getPrototypeOf(o) } var FAB_MAIN_CLASS = "dx-fa-button-main"; var FAB_CLOSE_ICON_CLASS = "dx-fa-button-icon-close"; var INVISIBLE_STATE_CLASS = "dx-state-invisible"; var speedDialMainItem = null; var modifyActionOptions = function(action) { return (0, _extend.extend)({}, action._options, { onInitialized: null, onDisposing: null }) }; var SpeedDialMainItem = function(_SpeedDialItem) { _inherits(SpeedDialMainItem, _SpeedDialItem); var _super = _createSuper(SpeedDialMainItem); function SpeedDialMainItem() { _classCallCheck(this, SpeedDialMainItem); return _super.apply(this, arguments) } _createClass(SpeedDialMainItem, [{ key: "_getDefaultOptions", value: function() { var defaultOptions = { icon: "add", closeIcon: "close", position: { at: "right bottom", my: "right bottom", offset: { x: -16, y: -16 } }, maxSpeedDialActionCount: 5, hint: "", actions: [], visible: true, activeStateEnabled: true, hoverStateEnabled: true, indent: 56, childIndent: 40, callOverlayRenderShading: true }; return (0, _extend.extend)(_get(_getPrototypeOf(SpeedDialMainItem.prototype), "_getDefaultOptions", this).call(this), (0, _extend.extend)(defaultOptions, (0, _config2.default)().floatingActionButtonConfig)) } }, { key: "_defaultOptionsRules", value: function() { return _get(_getPrototypeOf(SpeedDialMainItem.prototype), "_defaultOptionsRules", this).call(this).concat([{ device: function() { return _themes2.default.isMaterial() }, options: { indent: 72, childIndent: 56 } }]) } }, { key: "_render", value: function() { this.$element().addClass(FAB_MAIN_CLASS); _get(_getPrototypeOf(SpeedDialMainItem.prototype), "_render", this).call(this); this._moveToContainer(); this._renderCloseIcon(); this._renderClick() } }, { key: "_renderCloseIcon", value: function() { this._$closeIcon = this._renderButtonIcon(this._$closeIcon, this._options.closeIcon, FAB_CLOSE_ICON_CLASS); this._$closeIcon.addClass(INVISIBLE_STATE_CLASS) } }, { key: "_renderClick", value: function() { this._clickAction = 1 === this.option("actions").length ? this._getActionComponent()._createActionByOption("onClick") : this._createAction(this._clickHandler.bind(this)); this._setClickAction() } }, { key: "_clickHandler", value: function() { var _this = this; var actions = this._actionItems; actions.forEach(function(action) { action.toggle(); if (action.option("visible")) { action._$wrapper.css("position", _this._$wrapper.css("position")) } }); this._$icon.toggleClass(INVISIBLE_STATE_CLASS); this._$closeIcon.toggleClass(INVISIBLE_STATE_CLASS) } }, { key: "_renderActions", value: function() { var _this2 = this; var actions = this.option("actions"); var lastActionIndex = actions.length - 1; var minActionButtonCount = 1; if (this._actionItems && this._actionItems.length) { this._actionItems.forEach(function(actionItem) { actionItem.dispose(); actionItem.$element().remove() }) } this._actionItems = []; if (actions.length === minActionButtonCount) { return } for (var i = 0; i < actions.length; i++) { var action = actions[i]; var $actionElement = (0, _renderer2.default)("
").appendTo((0, _swatch_container.getSwatchContainer)(action.$element())); _events_engine2.default.off($actionElement, "click"); _events_engine2.default.on($actionElement, "click", function() { _this2._clickHandler() }); var actionOffsetY = this.initialOption("indent") + this.initialOption("childIndent") * i; var actionAnimationDelay = 30; action._options.position = { of: this.$content(), at: "center", my: "center", offset: { x: 0, y: -actionOffsetY } }; action._options.animation.show.delay = actionAnimationDelay * i; action._options.animation.hide.delay = actionAnimationDelay * (lastActionIndex - i); action._options.actionComponent = action; this._actionItems.push(this._createComponent($actionElement, _speed_dial_item2.default, modifyActionOptions(action))) } } }, { key: "_setPosition", value: function() { this._hide(); this._show() } }, { key: "_optionChanged", value: function(args) { switch (args.name) { case "actions": this._renderIcon(); this._renderCloseIcon(); this._renderClick(); this._renderActions(); break; case "maxSpeedDialActionCount": this._renderActions(); break; case "closeIcon": this._renderCloseIcon(); break; case "position": if (!(0, _common.equalByValue)(args.value, args.previousValue)) { this._setPosition() } break; default: _get(_getPrototypeOf(SpeedDialMainItem.prototype), "_optionChanged", this).call(this, args) } } }]); return SpeedDialMainItem }(_speed_dial_item2.default); exports.initAction = function(newAction) { delete newAction._options.onInitializing; var isActionExist = false; if (!speedDialMainItem) { var $fabMainElement = (0, _renderer2.default)("
").appendTo((0, _swatch_container.getSwatchContainer)(newAction.$element())); speedDialMainItem = newAction._createComponent($fabMainElement, SpeedDialMainItem, (0, _extend.extend)({}, modifyActionOptions(newAction), { actions: [newAction], visible: true })) } else { var savedActions = speedDialMainItem.option("actions"); savedActions.forEach(function(action) { if (action._options.id === newAction._options.id) { isActionExist = true; return newAction } }); if (!isActionExist) { if (savedActions.length >= speedDialMainItem.option("maxSpeedDialActionCount")) { newAction.dispose(); _ui2.default.log("W1014"); return } savedActions.push(newAction); speedDialMainItem.option((0, _extend.extend)(speedDialMainItem._getDefaultOptions(), { actions: savedActions })) } else { if (1 === savedActions.length) { speedDialMainItem.option((0, _extend.extend)({}, modifyActionOptions(savedActions[0]), { actions: savedActions, visible: true, position: speedDialMainItem._getDefaultOptions().position })) } else { speedDialMainItem.option({ actions: savedActions, position: speedDialMainItem._getDefaultOptions().position }) } } } }; exports.disposeAction = function(actionId) { if (!speedDialMainItem) { return } var savedActions = speedDialMainItem.option("actions"); var savedActionsCount = savedActions.length; savedActions = savedActions.filter(function(action) { return action._options.id !== actionId }); if (savedActionsCount === savedActions.length) { return } if (!savedActions.length) { speedDialMainItem.dispose(); speedDialMainItem.$element().remove(); speedDialMainItem = null } else { if (1 === savedActions.length) { speedDialMainItem.option((0, _extend.extend)({}, modifyActionOptions(savedActions[0]), { actions: savedActions, visible: true, position: speedDialMainItem._getDefaultOptions().position })) } else { speedDialMainItem.option({ actions: savedActions }) } } }; exports.repaint = function() { if (!speedDialMainItem) { return } var icon = 1 === speedDialMainItem.option("actions").length ? speedDialMainItem.option("actions")[0].option("icon") : speedDialMainItem._getDefaultOptions().icon; speedDialMainItem.option({ actions: speedDialMainItem.option("actions"), icon: icon, closeIcon: speedDialMainItem._getDefaultOptions().closeIcon, position: speedDialMainItem._getDefaultOptions().position, maxSpeedDialActionCount: speedDialMainItem._getDefaultOptions().maxSpeedDialActionCount }) } }, /*!************************************************************!*\ !*** ./artifacts/transpiled/ui/text_box/ui.text_editor.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9); var TextEditorMask = __webpack_require__( /*! ./ui.text_editor.mask */ 500); registerComponent("dxTextEditor", TextEditorMask); module.exports = TextEditorMask }, /*!*********************************************************!*\ !*** ./artifacts/transpiled/ui/text_box/utils.caret.js ***! \*********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _browser = __webpack_require__( /*! ../../core/utils/browser */ 25); var _browser2 = _interopRequireDefault(_browser); var _devices = __webpack_require__( /*! ../../core/devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var _devices$real = _devices2.default.real(), ios = _devices$real.ios, mac = _devices$real.mac; var isFocusingOnCaretChange = _browser2.default.msie || ios || mac; var getCaret = function(input) { var range; try { range = { start: input.selectionStart, end: input.selectionEnd } } catch (e) { range = { start: 0, end: 0 } } return range }; var setCaret = function(input, position) { if (!_dom_adapter2.default.getBody().contains(input)) { return } try { input.selectionStart = position.start; input.selectionEnd = position.end } catch (e) {} }; var caret = function(input, position) { input = (0, _renderer2.default)(input).get(0); if (!(0, _type.isDefined)(position)) { return getCaret(input) } if (isFocusingOnCaretChange && _dom_adapter2.default.getActiveElement() !== input) { return } setCaret(input, position) }; module.exports = caret }, /*!*******************************************************************************!*\ !*** ./artifacts/transpiled/ui/text_box/ui.text_editor.mask.strategy.base.js ***! \*******************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _utils = __webpack_require__( /*! ../../events/utils */ 8); var _browser = __webpack_require__( /*! ../../core/utils/browser */ 25); var _browser2 = _interopRequireDefault(_browser); var _array = __webpack_require__( /*! ../../core/utils/array */ 14); var _dom = __webpack_require__( /*! ../../core/utils/dom */ 12); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true } Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) { _defineProperties(Constructor.prototype, protoProps) } if (staticProps) { _defineProperties(Constructor, staticProps) } Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor } var MASK_EVENT_NAMESPACE = "dxMask"; var BLUR_EVENT = "blur beforedeactivate"; var EMPTY_CHAR = " "; var BaseMaskStrategy = function() { function BaseMaskStrategy(editor) { _classCallCheck(this, BaseMaskStrategy); this.editor = editor; this.DIRECTION = { FORWARD: "forward", BACKWARD: "backward" }; this.NAME = this._getStrategyName() } _createClass(BaseMaskStrategy, [{ key: "_getStrategyName", value: function() { return "base" } }, { key: "editorOption", value: function() { var _this$editor; return (_this$editor = this.editor).option.apply(_this$editor, arguments) } }, { key: "editorInput", value: function() { return this.editor._input() } }, { key: "editorCaret", value: function(newCaret) { if (!newCaret) { return this.editor._caret() } this.editor._caret(newCaret) } }, { key: "getHandler", value: function(handlerName) { var handler = this["_".concat(handlerName, "Handler")] || function() {}; return handler.bind(this) } }, { key: "attachEvents", value: function() { var _this = this; var $input = this.editorInput(); this.getHandleEventNames().forEach(function(eventName) { var subscriptionName = (0, _utils.addNamespace)(eventName.toLowerCase(), MASK_EVENT_NAMESPACE); _events_engine2.default.on($input, subscriptionName, _this.getEventHandler(eventName)) }); this._attachChangeEventHandlers() } }, { key: "getHandleEventNames", value: function() { return ["focusIn", "focusOut", "keyDown", "input", "paste", "cut", "drop"] } }, { key: "getEventHandler", value: function(eventName) { return this["_".concat(eventName, "Handler")].bind(this) } }, { key: "detachEvents", value: function() { _events_engine2.default.off(this.editorInput(), ".".concat(MASK_EVENT_NAMESPACE)) } }, { key: "_attachChangeEventHandlers", value: function() { if ((0, _array.inArray)("change", this.editorOption("valueChangeEvent").split(" ")) === -1) { return } _events_engine2.default.on(this.editorInput(), (0, _utils.addNamespace)(BLUR_EVENT, MASK_EVENT_NAMESPACE), function(e) { this._suppressCaretChanging(this._changeHandler, [e]); this._changeHandler(e) }.bind(this.editor)) } }, { key: "_focusInHandler", value: function() { this.editor._showMaskPlaceholder(); this.editor._direction(this.DIRECTION.FORWARD); if (!this.editor._isValueEmpty() && this.editorOption("isValid")) { this.editor._adjustCaret() } else { var caret = this.editor._maskRulesChain.first(); this._caretTimeout = setTimeout(function() { this._caret({ start: caret, end: caret }) }.bind(this.editor), 0) } } }, { key: "_focusOutHandler", value: function(event) { this.editor._changeHandler(event); if ("onFocus" === this.editorOption("showMaskMode") && this.editor._isValueEmpty()) { this.editorOption("text", ""); this.editor._renderDisplayText("") } } }, { key: "_cutHandler", value: function(event) { var caret = this.editorCaret(); var selectedText = this.editorInput().val().substring(caret.start, caret.end); this.editor._maskKeyHandler(event, function() { return (0, _dom.clipboardText)(event, selectedText) }) } }, { key: "_dropHandler", value: function() { this._clearDragTimer(); this._dragTimer = setTimeout(function() { this.option("value", this._convertToValue(this._input().val())) }.bind(this.editor)) } }, { key: "_clearDragTimer", value: function() { clearTimeout(this._dragTimer) } }, { key: "_keyDownHandler", value: function() { this._keyPressHandled = false } }, { key: "_pasteHandler", value: function(event) { var editor = this.editor; this._keyPressHandled = true; var caret = this.editorCaret(); editor._maskKeyHandler(event, function() { var pastedText = (0, _dom.clipboardText)(event); var restText = editor._maskRulesChain.text().substring(caret.end); var accepted = editor._handleChain({ text: pastedText, start: caret.start, length: pastedText.length }); var newCaret = caret.start + accepted; editor._handleChain({ text: restText, start: newCaret, length: restText.length }); editor._caret({ start: newCaret, end: newCaret }) }) } }, { key: "_autoFillHandler", value: function(event) { var _this2 = this; var editor = this.editor; var inputVal = this.editorInput().val(); this._inputHandlerTimer = setTimeout(function() { _this2._keyPressHandled = true; if (_this2._isAutoFill()) { _this2._keyPressHandled = true; editor._maskKeyHandler(event, function() { editor._handleChain({ text: inputVal, start: 0, length: inputVal.length }) }); editor._validateMask() } }) } }, { key: "_isAutoFill", value: function() { var $input = this.editor._input(); var result = false; if (_browser2.default.msie && _browser2.default.version > 11) { result = $input.hasClass("edge-autofilled") } else { if (_browser2.default.webkit) { var input = $input.get(0); result = input && input.matches(":-webkit-autofill") } } return result } }, { key: "runWithoutEventProcessing", value: function(action) { var keyPressHandled = this._keyPressHandled; this._keyPressHandled = true; action(); this._keyPressHandled = keyPressHandled } }, { key: "_backspaceHandler", value: function() {} }, { key: "_delHandler", value: function(event) { var editor = this.editor; this._keyPressHandled = true; editor._maskKeyHandler(event, function() { return !editor._hasSelection() && editor._handleKey(EMPTY_CHAR) }) } }, { key: "clean", value: function() { this._clearDragTimer(); clearTimeout(this._backspaceHandlerTimeout); clearTimeout(this._caretTimeout); clearTimeout(this._inputHandlerTimer) } }]); return BaseMaskStrategy }(); exports.default = BaseMaskStrategy }, /*!******************************************************!*\ !*** ./artifacts/transpiled/ui/list/ui.list.edit.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _utils = __webpack_require__( /*! ../../events/utils */ 8); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _uiListEditStrategy = __webpack_require__( /*! ./ui.list.edit.strategy.grouped */ 509); var _uiListEditStrategy2 = _interopRequireDefault(_uiListEditStrategy); var _message = __webpack_require__( /*! ../../localization/message */ 13); var _uiListEdit = __webpack_require__( /*! ./ui.list.edit.provider */ 510); var _uiListEdit2 = _interopRequireDefault(_uiListEdit); var _uiList = __webpack_require__( /*! ./ui.list.base */ 217); var _uiList2 = _interopRequireDefault(_uiList); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var LIST_ITEM_SELECTED_CLASS = "dx-list-item-selected"; var LIST_ITEM_RESPONSE_WAIT_CLASS = "dx-list-item-response-wait"; var ListEdit = _uiList2.default.inherit({ _supportedKeys: function() { var _this = this; var that = this; var parent = this.callBase(); var deleteFocusedItem = function(e) { if (that.option("allowItemDeleting")) { e.preventDefault(); that.deleteItem(that.option("focusedElement")) } }; var moveFocusedItem = function(e, moveUp) { var editStrategy = _this._editStrategy; var focusedElement = _this.option("focusedElement"); var focusedItemIndex = editStrategy.getNormalizedIndex(focusedElement); var isLastIndexFocused = focusedItemIndex === _this._getLastItemIndex(); if (isLastIndexFocused && _this._isDataSourceLoading()) { return } if (e.shiftKey && that.option("allowItemReordering")) { var nextItemIndex = focusedItemIndex + (moveUp ? -1 : 1); var $nextItem = editStrategy.getItemElement(nextItemIndex); _this.reorderItem(focusedElement, $nextItem); _this.scrollToItem(focusedElement); e.preventDefault() } else { var editProvider = _this._editProvider; var isInternalMoving = editProvider.handleKeyboardEvents(focusedItemIndex, moveUp); if (!isInternalMoving) { moveUp ? parent.upArrow(e) : parent.downArrow(e) } } }; var enter = function(e) { if (!this._editProvider.handleEnterPressing()) { parent.enter.apply(this, arguments) } }; var space = function(e) { if (!this._editProvider.handleEnterPressing()) { parent.space.apply(this, arguments) } }; return (0, _extend.extend)({}, parent, { del: deleteFocusedItem, upArrow: function(e) { return moveFocusedItem(e, true) }, downArrow: moveFocusedItem, enter: enter, space: space }) }, _updateSelection: function() { this._editProvider.afterItemsRendered(); this.callBase() }, _getLastItemIndex: function() { return this._itemElements().length - 1 }, _refreshItemElements: function() { this.callBase(); var excludedSelectors = this._editProvider.getExcludedItemSelectors(); if (excludedSelectors.length) { this._itemElementsCache = this._itemElementsCache.not(excludedSelectors) } }, _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { showSelectionControls: false, selectionMode: "none", selectAllMode: "page", onSelectAllValueChanged: null, selectAllText: (0, _message.format)("dxList-selectAll"), menuItems: [], menuMode: "context", allowItemDeleting: false, itemDeleteMode: "static", allowItemReordering: false }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function(_device) { return "ios" === _device.platform }, options: { menuMode: "slide", itemDeleteMode: "slideItem" } }, { device: { platform: "android" }, options: { itemDeleteMode: "swipe" } }, { device: { platform: "win" }, options: { itemDeleteMode: "context" } }]) }, _init: function() { this.callBase(); this._initEditProvider() }, _initDataSource: function() { this.callBase(); if (!this._isPageSelectAll()) { this._dataSource && this._dataSource.requireTotalCount(true) } }, _isPageSelectAll: function() { return "page" === this.option("selectAllMode") }, _initEditProvider: function() { this._editProvider = new _uiListEdit2.default(this) }, _disposeEditProvider: function() { if (this._editProvider) { this._editProvider.dispose() } }, _refreshEditProvider: function() { this._disposeEditProvider(); this._initEditProvider() }, _initEditStrategy: function() { if (this.option("grouped")) { this._editStrategy = new _uiListEditStrategy2.default(this) } else { this.callBase() } }, _initMarkup: function() { this._refreshEditProvider(); this.callBase() }, _renderItems: function() { this.callBase.apply(this, arguments); this._editProvider.afterItemsRendered() }, _selectedItemClass: function() { return LIST_ITEM_SELECTED_CLASS }, _itemResponseWaitClass: function() { return LIST_ITEM_RESPONSE_WAIT_CLASS }, _itemClickHandler: function(e) { var $itemElement = (0, _renderer2.default)(e.currentTarget); if ($itemElement.is(".dx-state-disabled, .dx-state-disabled *")) { return } var handledByEditProvider = this._editProvider.handleClick($itemElement, e); if (handledByEditProvider) { return } this.callBase.apply(this, arguments) }, _shouldFireContextMenuEvent: function() { return this.callBase.apply(this, arguments) || this._editProvider.contextMenuHandlerExists() }, _itemHoldHandler: function(e) { var $itemElement = (0, _renderer2.default)(e.currentTarget); if ($itemElement.is(".dx-state-disabled, .dx-state-disabled *")) { return } var handledByEditProvider = (0, _utils.isTouchEvent)(e) && this._editProvider.handleContextMenu($itemElement, e); if (handledByEditProvider) { e.handledByEditProvider = true; return } this.callBase.apply(this, arguments) }, _itemContextMenuHandler: function(e) { var $itemElement = (0, _renderer2.default)(e.currentTarget); if ($itemElement.is(".dx-state-disabled, .dx-state-disabled *")) { return } var handledByEditProvider = !e.handledByEditProvider && this._editProvider.handleContextMenu($itemElement, e); if (handledByEditProvider) { e.preventDefault(); return } this.callBase.apply(this, arguments) }, _postprocessRenderItem: function(args) { this.callBase.apply(this, arguments); this._editProvider.modifyItemElement(args) }, _clean: function() { this._disposeEditProvider(); this.callBase() }, focusListItem: function(index) { var $item = this._editStrategy.getItemElement(index); this.option("focusedElement", $item); this.focus(); this.scrollToItem(this.option("focusedElement")) }, _optionChanged: function(args) { switch (args.name) { case "selectAllMode": this._initDataSource(); this._dataSource.pageIndex(0); this._dataSource.load(); break; case "grouped": this._clearSelectedItems(); delete this._renderingGroupIndex; this._initEditStrategy(); this.callBase(args); break; case "showSelectionControls": case "menuItems": case "menuMode": case "allowItemDeleting": case "itemDeleteMode": case "allowItemReordering": case "selectAllText": this._invalidate(); break; case "onSelectAllValueChanged": break; default: this.callBase(args) } }, selectAll: function() { return this._selection.selectAll(this._isPageSelectAll()) }, unselectAll: function() { return this._selection.deselectAll(this._isPageSelectAll()) }, isSelectAll: function() { return this._selection.getSelectAllState(this._isPageSelectAll()) }, getFlatIndexByItemElement: function(itemElement) { return this._itemElements().index(itemElement) }, getItemElementByFlatIndex: function(flatIndex) { var $itemElements = this._itemElements(); if (flatIndex < 0 || flatIndex >= $itemElements.length) { return (0, _renderer2.default)() } return $itemElements.eq(flatIndex) }, getItemByIndex: function(index) { return this._editStrategy.getItemDataByIndex(index) } }); module.exports = ListEdit }, /*!***************************************************************************!*\ !*** ./artifacts/transpiled/ui/list/ui.list.edit.decorator.switchable.js ***! \***************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var EditDecorator = __webpack_require__( /*! ./ui.list.edit.decorator */ 138); var abstract = EditDecorator.abstract; var eventUtils = __webpack_require__( /*! ../../events/utils */ 8); var pointerEvents = __webpack_require__( /*! ../../events/pointer */ 23); var feedbackEvents = __webpack_require__( /*! ../../events/core/emitter.feedback */ 125); var LIST_EDIT_DECORATOR = "dxListEditDecorator"; var POINTER_DOWN_EVENT_NAME = eventUtils.addNamespace(pointerEvents.down, LIST_EDIT_DECORATOR); var ACTIVE_EVENT_NAME = eventUtils.addNamespace(feedbackEvents.active, LIST_EDIT_DECORATOR); var LIST_ITEM_CONTENT_CLASS = "dx-list-item-content"; var SWITCHABLE_DELETE_READY_CLASS = "dx-list-switchable-delete-ready"; var SWITCHABLE_MENU_SHIELD_POSITIONING_CLASS = "dx-list-switchable-menu-shield-positioning"; var SWITCHABLE_DELETE_TOP_SHIELD_CLASS = "dx-list-switchable-delete-top-shield"; var SWITCHABLE_DELETE_BOTTOM_SHIELD_CLASS = "dx-list-switchable-delete-bottom-shield"; var SWITCHABLE_MENU_ITEM_SHIELD_POSITIONING_CLASS = "dx-list-switchable-menu-item-shield-positioning"; var SWITCHABLE_DELETE_ITEM_CONTENT_SHIELD_CLASS = "dx-list-switchable-delete-item-content-shield"; var SWITCHABLE_DELETE_BUTTON_CONTAINER_CLASS = "dx-list-switchable-delete-button-container"; var SwitchableEditDecorator = EditDecorator.inherit({ _init: function() { this._$topShield = $("
").addClass(SWITCHABLE_DELETE_TOP_SHIELD_CLASS); this._$bottomShield = $("
").addClass(SWITCHABLE_DELETE_BOTTOM_SHIELD_CLASS); this._$itemContentShield = $("
").addClass(SWITCHABLE_DELETE_ITEM_CONTENT_SHIELD_CLASS); eventsEngine.on(this._$topShield, POINTER_DOWN_EVENT_NAME, this._cancelDeleteReadyItem.bind(this)); eventsEngine.on(this._$bottomShield, POINTER_DOWN_EVENT_NAME, this._cancelDeleteReadyItem.bind(this)); this._list.$element().append(this._$topShield.toggle(false)).append(this._$bottomShield.toggle(false)) }, handleClick: function() { return this._cancelDeleteReadyItem() }, _cancelDeleteReadyItem: function() { if (!this._$readyToDeleteItem) { return false } this._cancelDelete(this._$readyToDeleteItem); return true }, _cancelDelete: function($itemElement) { this._toggleDeleteReady($itemElement, false) }, _toggleDeleteReady: function($itemElement, readyToDelete) { if (void 0 === readyToDelete) { readyToDelete = !this._isReadyToDelete($itemElement) } this._toggleShields($itemElement, readyToDelete); this._toggleScrolling(readyToDelete); this._cacheReadyToDeleteItem($itemElement, readyToDelete); this._animateToggleDelete($itemElement, readyToDelete) }, _isReadyToDelete: function($itemElement) { return $itemElement.hasClass(SWITCHABLE_DELETE_READY_CLASS) }, _toggleShields: function($itemElement, enabled) { this._list.$element().toggleClass(SWITCHABLE_MENU_SHIELD_POSITIONING_CLASS, enabled); this._$topShield.toggle(enabled); this._$bottomShield.toggle(enabled); if (enabled) { this._updateShieldsHeight($itemElement) } this._toggleContentShield($itemElement, enabled) }, _updateShieldsHeight: function($itemElement) { var $list = this._list.$element(); var listTopOffset = $list.offset().top; var listHeight = $list.outerHeight(); var itemTopOffset = $itemElement.offset().top; var itemHeight = $itemElement.outerHeight(); var dirtyTopShieldHeight = itemTopOffset - listTopOffset; var dirtyBottomShieldHeight = listHeight - itemHeight - dirtyTopShieldHeight; this._$topShield.height(Math.max(dirtyTopShieldHeight, 0)); this._$bottomShield.height(Math.max(dirtyBottomShieldHeight, 0)) }, _toggleContentShield: function($itemElement, enabled) { if (enabled) { $itemElement.find("." + LIST_ITEM_CONTENT_CLASS).first().append(this._$itemContentShield) } else { this._$itemContentShield.detach() } }, _toggleScrolling: function(readyToDelete) { var scrollView = this._list.$element().dxScrollView("instance"); if (readyToDelete) { scrollView.on("start", this._cancelScrolling) } else { scrollView.off("start", this._cancelScrolling) } }, _cancelScrolling: function(args) { args.event.cancel = true }, _cacheReadyToDeleteItem: function($itemElement, cache) { if (cache) { this._$readyToDeleteItem = $itemElement } else { delete this._$readyToDeleteItem } }, _animateToggleDelete: function($itemElement, readyToDelete) { if (readyToDelete) { this._enablePositioning($itemElement); this._prepareDeleteReady($itemElement); this._animatePrepareDeleteReady($itemElement); eventsEngine.off($itemElement, pointerEvents.up) } else { this._forgetDeleteReady($itemElement); this._animateForgetDeleteReady($itemElement).done(this._disablePositioning.bind(this, $itemElement)) } }, _enablePositioning: function($itemElement) { $itemElement.addClass(SWITCHABLE_MENU_ITEM_SHIELD_POSITIONING_CLASS); eventsEngine.on($itemElement, ACTIVE_EVENT_NAME, noop); eventsEngine.one($itemElement, pointerEvents.up, this._disablePositioning.bind(this, $itemElement)) }, _disablePositioning: function($itemElement) { $itemElement.removeClass(SWITCHABLE_MENU_ITEM_SHIELD_POSITIONING_CLASS); eventsEngine.off($itemElement, ACTIVE_EVENT_NAME) }, _prepareDeleteReady: function($itemElement) { $itemElement.addClass(SWITCHABLE_DELETE_READY_CLASS) }, _forgetDeleteReady: function($itemElement) { $itemElement.removeClass(SWITCHABLE_DELETE_READY_CLASS) }, _animatePrepareDeleteReady: abstract, _animateForgetDeleteReady: abstract, _getDeleteButtonContainer: function($itemElement) { $itemElement = $itemElement || this._$readyToDeleteItem; return $itemElement.children("." + SWITCHABLE_DELETE_BUTTON_CONTAINER_CLASS) }, _deleteItem: function($itemElement) { $itemElement = $itemElement || this._$readyToDeleteItem; this._getDeleteButtonContainer($itemElement).detach(); if ($itemElement.is(".dx-state-disabled, .dx-state-disabled *")) { return } this._list.deleteItem($itemElement).always(this._cancelDelete.bind(this, $itemElement)) }, _isRtlEnabled: function() { return this._list.option("rtlEnabled") }, dispose: function() { if (this._$topShield) { this._$topShield.remove() } if (this._$bottomShield) { this._$bottomShield.remove() } this.callBase.apply(this, arguments) } }); module.exports = SwitchableEditDecorator }, /*!****************************************************************************!*\ !*** ./artifacts/transpiled/ui/list/ui.list.edit.decorator_menu_helper.js ***! \****************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var EditDecoratorMenuHelperMixin = { _menuEnabled: function() { return !!this._menuItems().length }, _menuItems: function() { return this._list.option("menuItems") }, _deleteEnabled: function() { return this._list.option("allowItemDeleting") }, _fireMenuAction: function($itemElement, action) { this._list._itemEventHandlerByHandler($itemElement, action, {}, { excludeValidators: ["disabled", "readOnly"] }) } }; module.exports = EditDecoratorMenuHelperMixin }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/ui/scroll_view/ui.scrollbar.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _ready_callbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48); var _ready_callbacks2 = _interopRequireDefault(_ready_callbacks); var _translator = __webpack_require__( /*! ../../animation/translator */ 27); var _translator2 = _interopRequireDefault(_translator); var _ui = __webpack_require__( /*! ../widget/ui.widget */ 18); var _ui2 = _interopRequireDefault(_ui); var _utils = __webpack_require__( /*! ../../events/utils */ 8); var _utils2 = _interopRequireDefault(_utils); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _common2 = _interopRequireDefault(_common); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _pointer = __webpack_require__( /*! ../../events/pointer */ 23); var _pointer2 = _interopRequireDefault(_pointer); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var SCROLLBAR = "dxScrollbar"; var SCROLLABLE_SCROLLBAR_CLASS = "dx-scrollable-scrollbar"; var SCROLLABLE_SCROLLBAR_ACTIVE_CLASS = "".concat(SCROLLABLE_SCROLLBAR_CLASS, "-active"); var SCROLLABLE_SCROLL_CLASS = "dx-scrollable-scroll"; var SCROLLABLE_SCROLL_CONTENT_CLASS = "dx-scrollable-scroll-content"; var HOVER_ENABLED_STATE = "dx-scrollbar-hoverable"; var HORIZONTAL = "horizontal"; var THUMB_MIN_SIZE = 15; var SCROLLBAR_VISIBLE = { onScroll: "onScroll", onHover: "onHover", always: "always", never: "never" }; var Scrollbar = _ui2.default.inherit({ _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { direction: null, visible: false, activeStateEnabled: false, visibilityMode: SCROLLBAR_VISIBLE.onScroll, containerSize: 0, contentSize: 0, expandable: true, scaleRatio: 1 }) }, _init: function() { this.callBase(); this._isHovered = false }, _initMarkup: function() { this._renderThumb(); this.callBase() }, _render: function() { this.callBase(); this._renderDirection(); this._update(); this._attachPointerDownHandler(); this.option("hoverStateEnabled", this._isHoverMode()); this.$element().toggleClass(HOVER_ENABLED_STATE, this.option("hoverStateEnabled")) }, _renderThumb: function() { this._$thumb = (0, _renderer2.default)("
").addClass(SCROLLABLE_SCROLL_CLASS); (0, _renderer2.default)("
").addClass(SCROLLABLE_SCROLL_CONTENT_CLASS).appendTo(this._$thumb); this.$element().addClass(SCROLLABLE_SCROLLBAR_CLASS).append(this._$thumb) }, isThumb: function($element) { return !!this.$element().find($element).length }, _isHoverMode: function() { var visibilityMode = this.option("visibilityMode"); return (visibilityMode === SCROLLBAR_VISIBLE.onHover || visibilityMode === SCROLLBAR_VISIBLE.always) && this.option("expandable") }, _renderDirection: function() { var direction = this.option("direction"); this.$element().addClass("dx-scrollbar-" + direction); this._dimension = direction === HORIZONTAL ? "width" : "height"; this._prop = direction === HORIZONTAL ? "left" : "top" }, _attachPointerDownHandler: function() { _events_engine2.default.on(this._$thumb, _utils2.default.addNamespace(_pointer2.default.down, SCROLLBAR), this.feedbackOn.bind(this)) }, feedbackOn: function() { this.$element().addClass(SCROLLABLE_SCROLLBAR_ACTIVE_CLASS); activeScrollbar = this }, feedbackOff: function() { this.$element().removeClass(SCROLLABLE_SCROLLBAR_ACTIVE_CLASS); activeScrollbar = null }, cursorEnter: function() { this._isHovered = true; if (this._needScrollbar()) { this.option("visible", true) } }, cursorLeave: function() { this._isHovered = false; this.option("visible", false) }, _renderDimensions: function() { this._$thumb.css({ width: this.option("width"), height: this.option("height") }) }, _toggleVisibility: function(visible) { if (this.option("visibilityMode") === SCROLLBAR_VISIBLE.onScroll) { this._$thumb.css("opacity") } visible = this._adjustVisibility(visible); this.option().visible = visible; this._$thumb.toggleClass("dx-state-invisible", !visible) }, _adjustVisibility: function(visible) { if (this._baseContainerToContentRatio && !this._needScrollbar()) { return false } switch (this.option("visibilityMode")) { case SCROLLBAR_VISIBLE.onScroll: break; case SCROLLBAR_VISIBLE.onHover: visible = visible || !!this._isHovered; break; case SCROLLBAR_VISIBLE.never: visible = false; break; case SCROLLBAR_VISIBLE.always: visible = true } return visible }, moveTo: function(location) { if (this._isHidden()) { return } if ((0, _type.isPlainObject)(location)) { location = location[this._prop] || 0 } var scrollBarLocation = {}; scrollBarLocation[this._prop] = this._calculateScrollBarPosition(location); _translator2.default.move(this._$thumb, scrollBarLocation) }, _calculateScrollBarPosition: function(location) { return -location * this._thumbRatio }, _update: function() { var containerSize = Math.round(this.option("containerSize")); var contentSize = Math.round(this.option("contentSize")); var baseContainerSize = Math.round(this.option("baseContainerSize")); var baseContentSize = Math.round(this.option("baseContentSize")); if (isNaN(baseContainerSize)) { baseContainerSize = containerSize; baseContentSize = contentSize } this._baseContainerToContentRatio = baseContentSize ? baseContainerSize / baseContentSize : baseContainerSize; this._realContainerToContentRatio = contentSize ? containerSize / contentSize : containerSize; var thumbSize = Math.round(Math.max(Math.round(containerSize * this._realContainerToContentRatio), THUMB_MIN_SIZE)); this._thumbRatio = (containerSize - thumbSize) / (this.option("scaleRatio") * (contentSize - containerSize)); this.option(this._dimension, thumbSize / this.option("scaleRatio")); this.$element().css("display", this._needScrollbar() ? "" : "none") }, _isHidden: function() { return this.option("visibilityMode") === SCROLLBAR_VISIBLE.never }, _needScrollbar: function() { return !this._isHidden() && this._baseContainerToContentRatio < 1 }, containerToContentRatio: function() { return this._realContainerToContentRatio }, _normalizeSize: function(size) { return (0, _type.isPlainObject)(size) ? size[this._dimension] || 0 : size }, _clean: function() { this.callBase(); if (this === activeScrollbar) { activeScrollbar = null } _events_engine2.default.off(this._$thumb, "." + SCROLLBAR) }, _optionChanged: function(args) { if (this._isHidden()) { return } switch (args.name) { case "containerSize": case "contentSize": this.option()[args.name] = this._normalizeSize(args.value); this._update(); break; case "baseContentSize": case "baseContainerSize": this._update(); break; case "visibilityMode": case "direction": this._invalidate(); break; case "scaleRatio": this._update(); break; default: this.callBase.apply(this, arguments) } }, update: _common2.default.deferRenderer(function() { this._adjustVisibility() && this.option("visible", true) }) }); var activeScrollbar = null; _ready_callbacks2.default.add(function() { _events_engine2.default.subscribeGlobal(_dom_adapter2.default.getDocument(), _utils2.default.addNamespace(_pointer2.default.up, SCROLLBAR), function() { if (activeScrollbar) { activeScrollbar.feedbackOff() } }) }); module.exports = Scrollbar }, /*!************************************************************************!*\ !*** ./artifacts/transpiled/ui/scroll_view/ui.scrollable.simulated.js ***! \************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _translator = __webpack_require__( /*! ../../animation/translator */ 27); var _translator2 = _interopRequireDefault(_translator); var _class = __webpack_require__( /*! ../../core/class */ 15); var _class2 = _interopRequireDefault(_class); var _animator = __webpack_require__( /*! ./animator */ 301); var _animator2 = _interopRequireDefault(_animator); var _devices = __webpack_require__( /*! ../../core/devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _utils = __webpack_require__( /*! ../../events/utils */ 8); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _ui = __webpack_require__( /*! ./ui.scrollbar */ 299); var _ui2 = _interopRequireDefault(_ui); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var realDevice = _devices2.default.real; var isSluggishPlatform = "win" === realDevice.platform || "android" === realDevice.platform; var SCROLLABLE_SIMULATED = "dxSimulatedScrollable"; var SCROLLABLE_STRATEGY = "dxScrollableStrategy"; var SCROLLABLE_SIMULATED_CURSOR = SCROLLABLE_SIMULATED + "Cursor"; var SCROLLABLE_SIMULATED_KEYBOARD = SCROLLABLE_SIMULATED + "Keyboard"; var SCROLLABLE_SIMULATED_CLASS = "dx-scrollable-simulated"; var SCROLLABLE_SCROLLBARS_HIDDEN = "dx-scrollable-scrollbars-hidden"; var SCROLLABLE_SCROLLBARS_ALWAYSVISIBLE = "dx-scrollable-scrollbars-alwaysvisible"; var SCROLLABLE_SCROLLBAR_CLASS = "dx-scrollable-scrollbar"; var VERTICAL = "vertical"; var HORIZONTAL = "horizontal"; var ACCELERATION = isSluggishPlatform ? .95 : .92; var OUT_BOUNDS_ACCELERATION = .5; var MIN_VELOCITY_LIMIT = 1; var FRAME_DURATION = Math.round(1e3 / 60); var SCROLL_LINE_HEIGHT = 40; var VALIDATE_WHEEL_TIMEOUT = 500; var BOUNCE_MIN_VELOCITY_LIMIT = MIN_VELOCITY_LIMIT / 5; var BOUNCE_DURATION = isSluggishPlatform ? 300 : 400; var BOUNCE_FRAMES = BOUNCE_DURATION / FRAME_DURATION; var BOUNCE_ACCELERATION_SUM = (1 - Math.pow(ACCELERATION, BOUNCE_FRAMES)) / (1 - ACCELERATION); var KEY_CODES = { PAGE_UP: "pageUp", PAGE_DOWN: "pageDown", END: "end", HOME: "home", LEFT: "leftArrow", UP: "upArrow", RIGHT: "rightArrow", DOWN: "downArrow", TAB: "tab" }; var InertiaAnimator = _animator2.default.inherit({ ctor: function(scroller) { this.callBase(); this.scroller = scroller }, VELOCITY_LIMIT: MIN_VELOCITY_LIMIT, _isFinished: function() { return Math.abs(this.scroller._velocity) <= this.VELOCITY_LIMIT }, _step: function() { this.scroller._scrollStep(this.scroller._velocity); this.scroller._velocity *= this._acceleration() }, _acceleration: function() { return this.scroller._inBounds() ? ACCELERATION : OUT_BOUNDS_ACCELERATION }, _complete: function() { this.scroller._scrollComplete() }, _stop: function() { this.scroller._stopComplete() } }); var BounceAnimator = InertiaAnimator.inherit({ VELOCITY_LIMIT: BOUNCE_MIN_VELOCITY_LIMIT, _isFinished: function() { return this.scroller._crossBoundOnNextStep() || this.callBase() }, _acceleration: function() { return ACCELERATION }, _complete: function() { this.scroller._move(this.scroller._bounceLocation); this.callBase() } }); var Scroller = _class2.default.inherit({ ctor: function(options) { this._initOptions(options); this._initAnimators(); this._initScrollbar() }, _initOptions: function(options) { var _this = this; this._location = 0; this._topReached = false; this._bottomReached = false; this._axis = options.direction === HORIZONTAL ? "x" : "y"; this._prop = options.direction === HORIZONTAL ? "left" : "top"; this._dimension = options.direction === HORIZONTAL ? "width" : "height"; this._scrollProp = options.direction === HORIZONTAL ? "scrollLeft" : "scrollTop"; (0, _iterator.each)(options, function(optionName, optionValue) { _this["_" + optionName] = optionValue }) }, _initAnimators: function() { this._inertiaAnimator = new InertiaAnimator(this); this._bounceAnimator = new BounceAnimator(this) }, _initScrollbar: function() { this._scrollbar = new _ui2.default((0, _renderer2.default)("
").appendTo(this._$container), { direction: this._direction, visible: this._scrollByThumb, visibilityMode: this._visibilityModeNormalize(this._scrollbarVisible), expandable: this._scrollByThumb }); this._$scrollbar = this._scrollbar.$element() }, _visibilityModeNormalize: function(mode) { return true === mode ? "onScroll" : false === mode ? "never" : mode }, _scrollStep: function(delta) { var prevLocation = this._location; this._location += delta; this._suppressBounce(); this._move(); if (Math.abs(prevLocation - this._location) < 1) { return } _events_engine2.default.triggerHandler(this._$container, { type: "scroll" }) }, _suppressBounce: function() { if (this._bounceEnabled || this._inBounds(this._location)) { return } this._velocity = 0; this._location = this._boundLocation() }, _boundLocation: function(location) { location = void 0 !== location ? location : this._location; return Math.max(Math.min(location, this._maxOffset), this._minOffset) }, _move: function(location) { this._location = void 0 !== location ? location * this._getScaleRatio() : this._location; this._moveContent(); this._moveScrollbar() }, _moveContent: function() { var location = this._location; this._$container[this._scrollProp](-location / this._getScaleRatio()); this._moveContentByTranslator(location) }, _getScaleRatio: function() { if ((0, _window.hasWindow)() && !this._scaleRatio) { var element = this._$element.get(0); var realDimension = this._getRealDimension(element, this._dimension); var baseDimension = this._getBaseDimension(element, this._dimension); this._scaleRatio = Math.round(realDimension / baseDimension * 100) / 100 } return this._scaleRatio || 1 }, _getRealDimension: function(element, dimension) { return Math.round(element.getBoundingClientRect()[dimension]) }, _getBaseDimension: function(element, dimension) { var dimensionName = "offset" + (0, _inflector.titleize)(dimension); return element[dimensionName] }, _moveContentByTranslator: function(location) { var translateOffset; var minOffset = -this._maxScrollPropValue; if (location > 0) { translateOffset = location } else { if (location <= minOffset) { translateOffset = location - minOffset } else { translateOffset = location % 1 } } if (this._translateOffset === translateOffset) { return } var targetLocation = {}; targetLocation[this._prop] = translateOffset; this._translateOffset = translateOffset; if (0 === translateOffset) { _translator2.default.resetPosition(this._$content); return } _translator2.default.move(this._$content, targetLocation) }, _moveScrollbar: function() { this._scrollbar.moveTo(this._location) }, _scrollComplete: function() { if (this._inBounds()) { this._hideScrollbar(); if (this._completeDeferred) { this._completeDeferred.resolve() } } this._scrollToBounds() }, _scrollToBounds: function() { if (this._inBounds()) { return } this._bounceAction(); this._setupBounce(); this._bounceAnimator.start() }, _setupBounce: function() { var boundLocation = this._bounceLocation = this._boundLocation(); var bounceDistance = boundLocation - this._location; this._velocity = bounceDistance / BOUNCE_ACCELERATION_SUM }, _inBounds: function(location) { location = void 0 !== location ? location : this._location; return this._boundLocation(location) === location }, _crossBoundOnNextStep: function() { var location = this._location; var nextLocation = location + this._velocity; return location < this._minOffset && nextLocation >= this._minOffset || location > this._maxOffset && nextLocation <= this._maxOffset }, _initHandler: function(e) { this._stopDeferred = new _deferred.Deferred; this._stopScrolling(); this._prepareThumbScrolling(e); return this._stopDeferred.promise() }, _stopScrolling: (0, _common.deferRenderer)(function() { this._hideScrollbar(); this._inertiaAnimator.stop(); this._bounceAnimator.stop() }), _prepareThumbScrolling: function(e) { if ((0, _utils.isDxMouseWheelEvent)(e.originalEvent)) { return } var $target = (0, _renderer2.default)(e.originalEvent.target); var scrollbarClicked = this._isScrollbar($target); if (scrollbarClicked) { this._moveToMouseLocation(e) } this._thumbScrolling = scrollbarClicked || this._isThumb($target); this._crossThumbScrolling = !this._thumbScrolling && this._isAnyThumbScrolling($target); if (this._thumbScrolling) { this._scrollbar.feedbackOn() } }, _isThumbScrollingHandler: function($target) { return this._isThumb($target) }, _moveToMouseLocation: function(e) { var mouseLocation = e["page" + this._axis.toUpperCase()] - this._$element.offset()[this._prop]; var location = this._location + mouseLocation / this._containerToContentRatio() - this._$container.height() / 2; this._scrollStep(-Math.round(location)) }, _stopComplete: function() { if (this._stopDeferred) { this._stopDeferred.resolve() } }, _startHandler: function() { this._showScrollbar() }, _moveHandler: function(delta) { if (this._crossThumbScrolling) { return } if (this._thumbScrolling) { delta[this._axis] = -Math.round(delta[this._axis] / this._containerToContentRatio()) } this._scrollBy(delta) }, _scrollBy: function(delta) { delta = delta[this._axis]; if (!this._inBounds()) { delta *= OUT_BOUNDS_ACCELERATION } this._scrollStep(delta) }, _scrollByHandler: function(delta) { this._scrollBy(delta); this._scrollComplete() }, _containerToContentRatio: function() { return this._scrollbar.containerToContentRatio() }, _endHandler: function(velocity) { this._completeDeferred = new _deferred.Deferred; this._velocity = velocity[this._axis]; this._inertiaHandler(); this._resetThumbScrolling(); return this._completeDeferred.promise() }, _inertiaHandler: function() { this._suppressInertia(); this._inertiaAnimator.start() }, _suppressInertia: function() { if (!this._inertiaEnabled || this._thumbScrolling) { this._velocity = 0 } }, _resetThumbScrolling: function() { this._thumbScrolling = false; this._crossThumbScrolling = false }, _stopHandler: function() { if (this._thumbScrolling) { this._scrollComplete() } this._resetThumbScrolling(); this._scrollToBounds() }, _disposeHandler: function() { this._stopScrolling(); this._$scrollbar.remove() }, _updateHandler: function() { this._update(); this._moveToBounds() }, _update: function() { var _this2 = this; this._stopScrolling(); return (0, _common.deferUpdate)(function() { _this2._resetScaleRatio(); _this2._updateLocation(); _this2._updateBounds(); _this2._updateScrollbar(); (0, _common.deferRender)(function() { _this2._moveScrollbar(); _this2._scrollbar.update() }) }) }, _resetScaleRatio: function() { this._scaleRatio = null }, _updateLocation: function() { this._location = (_translator2.default.locate(this._$content)[this._prop] - this._$container[this._scrollProp]()) * this._getScaleRatio() }, _updateBounds: function() { this._maxOffset = Math.round(this._getMaxOffset()); this._minOffset = Math.round(this._getMinOffset()) }, _getMaxOffset: function() { return 0 }, _getMinOffset: function() { this._maxScrollPropValue = Math.max(this._contentSize() - this._containerSize(), 0); return -this._maxScrollPropValue }, _updateScrollbar: (0, _common.deferUpdater)(function() { var _this3 = this; var containerSize = this._containerSize(); var contentSize = this._contentSize(); var baseContainerSize = this._getBaseDimension(this._$container.get(0), this._dimension); var baseContentSize = this._getBaseDimension(this._$content.get(0), this._dimension); (0, _common.deferRender)(function() { _this3._scrollbar.option({ containerSize: containerSize, contentSize: contentSize, baseContainerSize: baseContainerSize, baseContentSize: baseContentSize, scaleRatio: _this3._getScaleRatio() }) }) }), _moveToBounds: (0, _common.deferRenderer)((0, _common.deferUpdater)((0, _common.deferRenderer)(function() { var location = this._boundLocation(); var locationChanged = location !== this._location; this._location = location; this._move(); if (locationChanged) { this._scrollAction() } }))), _createActionsHandler: function(actions) { this._scrollAction = actions.scroll; this._bounceAction = actions.bounce }, _showScrollbar: function() { this._scrollbar.option("visible", true) }, _hideScrollbar: function() { this._scrollbar.option("visible", false) }, _containerSize: function() { return this._getRealDimension(this._$container.get(0), this._dimension) }, _contentSize: function() { var isOverflowHidden = "hidden" === this._$content.css("overflow" + this._axis.toUpperCase()); var contentSize = this._getRealDimension(this._$content.get(0), this._dimension); if (!isOverflowHidden) { var containerScrollSize = this._$content[0]["scroll" + (0, _inflector.titleize)(this._dimension)] * this._getScaleRatio(); contentSize = Math.max(containerScrollSize, contentSize) } return contentSize }, _validateEvent: function(e) { var $target = (0, _renderer2.default)(e.originalEvent.target); return this._isThumb($target) || this._isScrollbar($target) || this._isContent($target) }, _isThumb: function($element) { return this._scrollByThumb && this._scrollbar.isThumb($element) }, _isScrollbar: function($element) { return this._scrollByThumb && $element && $element.is(this._$scrollbar) }, _isContent: function($element) { return this._scrollByContent && !!$element.closest(this._$element).length }, _reachedMin: function() { return this._location <= this._minOffset }, _reachedMax: function() { return this._location >= this._maxOffset }, _cursorEnterHandler: function() { this._resetScaleRatio(); this._updateScrollbar(); this._scrollbar.cursorEnter() }, _cursorLeaveHandler: function() { this._scrollbar.cursorLeave() }, dispose: _common.noop }); var hoveredScrollable; var activeScrollable; var SimulatedStrategy = _class2.default.inherit({ ctor: function(scrollable) { this._init(scrollable) }, _init: function(scrollable) { this._component = scrollable; this._$element = scrollable.$element(); this._$container = scrollable._$container; this._$wrapper = scrollable._$wrapper; this._$content = scrollable._$content; this.option = scrollable.option.bind(scrollable); this._createActionByOption = scrollable._createActionByOption.bind(scrollable); this._isLocked = scrollable._isLocked.bind(scrollable); this._isDirection = scrollable._isDirection.bind(scrollable); this._allowedDirection = scrollable._allowedDirection.bind(scrollable) }, render: function() { this._$element.addClass(SCROLLABLE_SIMULATED_CLASS); this._createScrollers(); if (this.option("useKeyboard")) { this._$container.prop("tabIndex", 0) } this._attachKeyboardHandler(); this._attachCursorHandlers() }, _createScrollers: function() { this._scrollers = {}; if (this._isDirection(HORIZONTAL)) { this._createScroller(HORIZONTAL) } if (this._isDirection(VERTICAL)) { this._createScroller(VERTICAL) } this._$element.toggleClass(SCROLLABLE_SCROLLBARS_ALWAYSVISIBLE, "always" === this.option("showScrollbar")); this._$element.toggleClass(SCROLLABLE_SCROLLBARS_HIDDEN, !this.option("showScrollbar")) }, _createScroller: function(direction) { this._scrollers[direction] = new Scroller(this._scrollerOptions(direction)) }, _scrollerOptions: function(direction) { return { direction: direction, $content: this._$content, $container: this._$container, $wrapper: this._$wrapper, $element: this._$element, scrollByContent: this.option("scrollByContent"), scrollByThumb: this.option("scrollByThumb"), scrollbarVisible: this.option("showScrollbar"), bounceEnabled: this.option("bounceEnabled"), inertiaEnabled: this.option("inertiaEnabled"), isAnyThumbScrolling: this._isAnyThumbScrolling.bind(this) } }, _applyScaleRatio: function(targetLocation) { for (var direction in this._scrollers) { var prop = this._getPropByDirection(direction); if ((0, _type.isDefined)(targetLocation[prop])) { var scroller = this._scrollers[direction]; targetLocation[prop] *= scroller._getScaleRatio() } } return targetLocation }, _isAnyThumbScrolling: function($target) { var result = false; this._eventHandler("isThumbScrolling", $target).done(function(isThumbScrollingVertical, isThumbScrollingHorizontal) { result = isThumbScrollingVertical || isThumbScrollingHorizontal }); return result }, handleInit: function(e) { this._suppressDirections(e); this._eventForUserAction = e; this._eventHandler("init", e).done(this._stopAction) }, _suppressDirections: function(e) { if ((0, _utils.isDxMouseWheelEvent)(e.originalEvent)) { this._prepareDirections(true); return } this._prepareDirections(); this._eachScroller(function(scroller, direction) { var isValid = scroller._validateEvent(e); this._validDirections[direction] = isValid }) }, _prepareDirections: function(value) { value = value || false; this._validDirections = {}; this._validDirections[HORIZONTAL] = value; this._validDirections[VERTICAL] = value }, _eachScroller: function(callback) { callback = callback.bind(this); (0, _iterator.each)(this._scrollers, function(direction, scroller) { callback(scroller, direction) }) }, handleStart: function(e) { this._eventForUserAction = e; this._eventHandler("start").done(this._startAction) }, _saveActive: function() { activeScrollable = this }, _resetActive: function() { if (activeScrollable === this) { activeScrollable = null } }, handleMove: function(e) { if (this._isLocked()) { e.cancel = true; this._resetActive(); return } this._saveActive(); e.preventDefault && e.preventDefault(); this._adjustDistance(e, e.delta); this._eventForUserAction = e; this._eventHandler("move", e.delta) }, _adjustDistance: function(e, distance) { distance.x *= this._validDirections[HORIZONTAL]; distance.y *= this._validDirections[VERTICAL]; var devicePixelRatio = this._tryGetDevicePixelRatio(); if (devicePixelRatio && (0, _utils.isDxMouseWheelEvent)(e.originalEvent)) { distance.x = Math.round(distance.x / devicePixelRatio * 100) / 100; distance.y = Math.round(distance.y / devicePixelRatio * 100) / 100 } }, _tryGetDevicePixelRatio: function() { if ((0, _window.hasWindow)()) { return (0, _window.getWindow)().devicePixelRatio } }, handleEnd: function(e) { this._resetActive(); this._refreshCursorState(e.originalEvent && e.originalEvent.target); this._adjustDistance(e, e.velocity); this._eventForUserAction = e; return this._eventHandler("end", e.velocity).done(this._endAction) }, handleCancel: function(e) { this._resetActive(); this._eventForUserAction = e; return this._eventHandler("end", { x: 0, y: 0 }) }, handleStop: function() { this._resetActive(); this._eventHandler("stop") }, handleScroll: function() { this._scrollAction() }, _attachKeyboardHandler: function() { _events_engine2.default.off(this._$element, ".".concat(SCROLLABLE_SIMULATED_KEYBOARD)); if (!this.option("disabled") && this.option("useKeyboard")) { _events_engine2.default.on(this._$element, (0, _utils.addNamespace)("keydown", SCROLLABLE_SIMULATED_KEYBOARD), this._keyDownHandler.bind(this)) } }, _keyDownHandler: function(e) { var _this4 = this; clearTimeout(this._updateHandlerTimeout); this._updateHandlerTimeout = setTimeout(function() { if ((0, _utils.normalizeKeyName)(e) === KEY_CODES.TAB) { _this4._eachScroller(function(scroller) { scroller._updateHandler() }) } }); if (!this._$container.is(_dom_adapter2.default.getActiveElement())) { return } var handled = true; switch ((0, _utils.normalizeKeyName)(e)) { case KEY_CODES.DOWN: this._scrollByLine({ y: 1 }); break; case KEY_CODES.UP: this._scrollByLine({ y: -1 }); break; case KEY_CODES.RIGHT: this._scrollByLine({ x: 1 }); break; case KEY_CODES.LEFT: this._scrollByLine({ x: -1 }); break; case KEY_CODES.PAGE_DOWN: this._scrollByPage(1); break; case KEY_CODES.PAGE_UP: this._scrollByPage(-1); break; case KEY_CODES.HOME: this._scrollToHome(); break; case KEY_CODES.END: this._scrollToEnd(); break; default: handled = false } if (handled) { e.stopPropagation(); e.preventDefault() } }, _scrollByLine: function(lines) { var devicePixelRatio = this._tryGetDevicePixelRatio(); var scrollOffset = SCROLL_LINE_HEIGHT; if (devicePixelRatio) { scrollOffset = Math.abs(scrollOffset / devicePixelRatio * 100) / 100 } this.scrollBy({ top: (lines.y || 0) * -scrollOffset, left: (lines.x || 0) * -scrollOffset }) }, _scrollByPage: function(page) { var prop = this._wheelProp(); var dimension = this._dimensionByProp(prop); var distance = {}; distance[prop] = page * -this._$container[dimension](); this.scrollBy(distance) }, _dimensionByProp: function(prop) { return "left" === prop ? "width" : "height" }, _getPropByDirection: function(direction) { return direction === HORIZONTAL ? "left" : "top" }, _scrollToHome: function() { var prop = this._wheelProp(); var distance = {}; distance[prop] = 0; this._component.scrollTo(distance) }, _scrollToEnd: function() { var prop = this._wheelProp(); var dimension = this._dimensionByProp(prop); var distance = {}; distance[prop] = this._$content[dimension]() - this._$container[dimension](); this._component.scrollTo(distance) }, createActions: function() { this._startAction = this._createActionHandler("onStart"); this._stopAction = this._createActionHandler("onStop"); this._endAction = this._createActionHandler("onEnd"); this._updateAction = this._createActionHandler("onUpdated"); this._createScrollerActions() }, _createScrollerActions: function() { this._scrollAction = this._createActionHandler("onScroll"); this._bounceAction = this._createActionHandler("onBounce"); this._eventHandler("createActions", { scroll: this._scrollAction, bounce: this._bounceAction }) }, _createActionHandler: function(optionName) { var _arguments = arguments, _this5 = this; var actionHandler = this._createActionByOption(optionName); return function() { actionHandler((0, _extend.extend)(_this5._createActionArgs(), _arguments)) } }, _createActionArgs: function() { var scrollerX = this._scrollers[HORIZONTAL]; var scrollerY = this._scrollers[VERTICAL]; var location = this.location(); this._scrollOffset = { top: scrollerY && -location.top, left: scrollerX && -location.left }; return { event: this._eventForUserAction, scrollOffset: this._scrollOffset, reachedLeft: scrollerX && scrollerX._reachedMax(), reachedRight: scrollerX && scrollerX._reachedMin(), reachedTop: scrollerY && scrollerY._reachedMax(), reachedBottom: scrollerY && scrollerY._reachedMin() } }, _eventHandler: function(eventName) { var args = [].slice.call(arguments).slice(1); var deferreds = (0, _iterator.map)(this._scrollers, function(scroller) { return scroller["_" + eventName + "Handler"].apply(scroller, args) }); return _deferred.when.apply(_renderer2.default, deferreds).promise() }, location: function location() { var location = _translator2.default.locate(this._$content); location.top -= this._$container.scrollTop(); location.left -= this._$container.scrollLeft(); return location }, disabledChanged: function() { this._attachCursorHandlers() }, _attachCursorHandlers: function() { _events_engine2.default.off(this._$element, ".".concat(SCROLLABLE_SIMULATED_CURSOR)); if (!this.option("disabled") && this._isHoverMode()) { _events_engine2.default.on(this._$element, (0, _utils.addNamespace)("mouseenter", SCROLLABLE_SIMULATED_CURSOR), this._cursorEnterHandler.bind(this)); _events_engine2.default.on(this._$element, (0, _utils.addNamespace)("mouseleave", SCROLLABLE_SIMULATED_CURSOR), this._cursorLeaveHandler.bind(this)) } }, _isHoverMode: function() { return "onHover" === this.option("showScrollbar") }, _cursorEnterHandler: function(e) { e = e || {}; e.originalEvent = e.originalEvent || {}; if (activeScrollable || e.originalEvent._hoverHandled) { return } if (hoveredScrollable) { hoveredScrollable._cursorLeaveHandler() } hoveredScrollable = this; this._eventHandler("cursorEnter"); e.originalEvent._hoverHandled = true }, _cursorLeaveHandler: function(e) { if (hoveredScrollable !== this || activeScrollable === hoveredScrollable) { return } this._eventHandler("cursorLeave"); hoveredScrollable = null; this._refreshCursorState(e && e.relatedTarget) }, _refreshCursorState: function(target) { if (!this._isHoverMode() && (!target || activeScrollable)) { return } var $target = (0, _renderer2.default)(target); var $scrollable = $target.closest(".".concat(SCROLLABLE_SIMULATED_CLASS, ":not(.dx-state-disabled)")); var targetScrollable = $scrollable.length && $scrollable.data(SCROLLABLE_STRATEGY); if (hoveredScrollable && hoveredScrollable !== targetScrollable) { hoveredScrollable._cursorLeaveHandler() } if (targetScrollable) { targetScrollable._cursorEnterHandler() } }, update: function() { var _this6 = this; var result = this._eventHandler("update").done(this._updateAction); return (0, _deferred.when)(result, (0, _common.deferUpdate)(function() { var allowedDirections = _this6._allowedDirections(); (0, _common.deferRender)(function() { var touchDirection = allowedDirections.vertical ? "pan-x" : ""; touchDirection = allowedDirections.horizontal ? "pan-y" : touchDirection; touchDirection = allowedDirections.vertical && allowedDirections.horizontal ? "none" : touchDirection; _this6._$container.css("touchAction", touchDirection) }); return (0, _deferred.when)().promise() })) }, _allowedDirections: function() { var bounceEnabled = this.option("bounceEnabled"); var verticalScroller = this._scrollers[VERTICAL]; var horizontalScroller = this._scrollers[HORIZONTAL]; return { vertical: verticalScroller && (verticalScroller._minOffset < 0 || bounceEnabled), horizontal: horizontalScroller && (horizontalScroller._minOffset < 0 || bounceEnabled) } }, updateBounds: function() { this._scrollers[HORIZONTAL] && this._scrollers[HORIZONTAL]._updateBounds() }, scrollBy: function(distance) { var verticalScroller = this._scrollers[VERTICAL]; var horizontalScroller = this._scrollers[HORIZONTAL]; if (verticalScroller) { distance.top = verticalScroller._boundLocation(distance.top + verticalScroller._location) - verticalScroller._location } if (horizontalScroller) { distance.left = horizontalScroller._boundLocation(distance.left + horizontalScroller._location) - horizontalScroller._location } this._prepareDirections(true); this._startAction(); this._eventHandler("scrollBy", { x: distance.left, y: distance.top }); this._endAction() }, validate: function(e) { if (this.option("disabled")) { return false } if (this.option("bounceEnabled")) { return true } return (0, _utils.isDxMouseWheelEvent)(e) ? this._validateWheel(e) : this._validateMove(e) }, _validateWheel: function(e) { var _this7 = this; var scroller = this._scrollers[this._wheelDirection(e)]; var reachedMin = scroller._reachedMin(); var reachedMax = scroller._reachedMax(); var contentGreaterThanContainer = !reachedMin || !reachedMax; var locatedNotAtBound = !reachedMin && !reachedMax; var scrollFromMin = reachedMin && e.delta > 0; var scrollFromMax = reachedMax && e.delta < 0; var validated = contentGreaterThanContainer && (locatedNotAtBound || scrollFromMin || scrollFromMax); validated = validated || void 0 !== this._validateWheelTimer; if (validated) { clearTimeout(this._validateWheelTimer); this._validateWheelTimer = setTimeout(function() { _this7._validateWheelTimer = void 0 }, VALIDATE_WHEEL_TIMEOUT) } return validated }, _validateMove: function(e) { if (!this.option("scrollByContent") && !(0, _renderer2.default)(e.target).closest(".".concat(SCROLLABLE_SCROLLBAR_CLASS)).length) { return false } return this._allowedDirection() }, getDirection: function(e) { return (0, _utils.isDxMouseWheelEvent)(e) ? this._wheelDirection(e) : this._allowedDirection() }, _wheelProp: function() { return this._wheelDirection() === HORIZONTAL ? "left" : "top" }, _wheelDirection: function(e) { switch (this.option("direction")) { case HORIZONTAL: return HORIZONTAL; case VERTICAL: return VERTICAL; default: return e && e.shiftKey ? HORIZONTAL : VERTICAL } }, verticalOffset: function() { return 0 }, dispose: function() { this._resetActive(); if (hoveredScrollable === this) { hoveredScrollable = null } this._eventHandler("dispose"); this._detachEventHandlers(); this._$element.removeClass(SCROLLABLE_SIMULATED_CLASS); this._eventForUserAction = null; clearTimeout(this._validateWheelTimer); clearTimeout(this._updateHandlerTimeout) }, _detachEventHandlers: function() { _events_engine2.default.off(this._$element, ".".concat(SCROLLABLE_SIMULATED_CURSOR)); _events_engine2.default.off(this._$container, ".".concat(SCROLLABLE_SIMULATED_KEYBOARD)) } }); exports.SimulatedStrategy = SimulatedStrategy; exports.Scroller = Scroller; exports.ACCELERATION = ACCELERATION; exports.MIN_VELOCITY_LIMIT = MIN_VELOCITY_LIMIT; exports.FRAME_DURATION = FRAME_DURATION; exports.SCROLL_LINE_HEIGHT = SCROLL_LINE_HEIGHT }, /*!*********************************************************!*\ !*** ./artifacts/transpiled/ui/scroll_view/animator.js ***! \*********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop; var Class = __webpack_require__( /*! ../../core/class */ 15); var abstract = Class.abstract; var animationFrame = __webpack_require__( /*! ../../animation/frame */ 112); var Animator = Class.inherit({ ctor: function() { this._finished = true; this._stopped = false; this._proxiedStepCore = this._stepCore.bind(this) }, start: function() { this._stopped = false; this._finished = false; this._stepCore() }, stop: function() { this._stopped = true; animationFrame.cancelAnimationFrame(this._stepAnimationFrame) }, _stepCore: function() { if (this._isStopped()) { this._stop(); return } if (this._isFinished()) { this._finished = true; this._complete(); return } this._step(); this._stepAnimationFrame = animationFrame.requestAnimationFrame(this._proxiedStepCore) }, _step: abstract, _isFinished: noop, _stop: noop, _complete: noop, _isStopped: function() { return this._stopped }, inProgress: function() { return !(this._stopped || this._finished) } }); module.exports = Animator }, /*!**********************************************************!*\ !*** ./artifacts/transpiled/core/utils/array_compare.js ***! \**********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.findChanges = void 0; var _type = __webpack_require__( /*! ./type */ 1); var getKeyWrapper = function(item, getKey) { var key = getKey(item); if ((0, _type.isObject)(key)) { try { return JSON.stringify(key) } catch (e) { return key } } return key }; var getSameNewByOld = function(oldItem, newItems, newIndexByKey, getKey) { var key = getKeyWrapper(oldItem, getKey); return newItems[newIndexByKey[key]] }; exports.findChanges = function(oldItems, newItems, getKey, isItemEquals) { var oldIndexByKey = {}; var newIndexByKey = {}; var addedCount = 0; var removeCount = 0; var result = []; oldItems.forEach(function(item, index) { var key = getKeyWrapper(item, getKey); oldIndexByKey[key] = index }); newItems.forEach(function(item, index) { var key = getKeyWrapper(item, getKey); newIndexByKey[key] = index }); var itemCount = Math.max(oldItems.length, newItems.length); for (var index = 0; index < itemCount + addedCount; index++) { var newItem = newItems[index]; var oldNextIndex = index - addedCount + removeCount; var nextOldItem = oldItems[oldNextIndex]; var isRemoved = !newItem || nextOldItem && !getSameNewByOld(nextOldItem, newItems, newIndexByKey, getKey); if (isRemoved) { if (nextOldItem) { result.push({ type: "remove", key: getKey(nextOldItem), index: index, oldItem: nextOldItem }); removeCount++; index-- } } else { var key = getKeyWrapper(newItem, getKey); var oldIndex = oldIndexByKey[key]; var oldItem = oldItems[oldIndex]; if (!oldItem) { addedCount++; result.push({ type: "insert", data: newItem, index: index }) } else { if (oldIndex === oldNextIndex) { if (!isItemEquals(oldItem, newItem)) { result.push({ type: "update", data: newItem, key: getKey(newItem), index: index, oldItem: oldItem }) } } else { return } } } } return result } }, /*!*************************************************!*\ !*** ./artifacts/transpiled/ui/button_group.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _ui = __webpack_require__( /*! ./widget/ui.widget */ 18); var _ui2 = _interopRequireDefault(_ui); var _button = __webpack_require__( /*! ./button */ 34); var _button2 = _interopRequireDefault(_button); var _uiCollection_widget = __webpack_require__( /*! ./collection/ui.collection_widget.edit */ 53); var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget); var _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _bindable_template = __webpack_require__( /*! ./widget/bindable_template */ 65); var _bindable_template2 = _interopRequireDefault(_bindable_template); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var BUTTON_GROUP_CLASS = "dx-buttongroup"; var BUTTON_GROUP_WRAPPER_CLASS = BUTTON_GROUP_CLASS + "-wrapper"; var BUTTON_GROUP_ITEM_CLASS = BUTTON_GROUP_CLASS + "-item"; var BUTTON_GROUP_FIRST_ITEM_CLASS = BUTTON_GROUP_CLASS + "-first-item"; var BUTTON_GROUP_LAST_ITEM_CLASS = BUTTON_GROUP_CLASS + "-last-item"; var BUTTON_GROUP_ITEM_HAS_WIDTH = BUTTON_GROUP_ITEM_CLASS + "-has-width"; var SHAPE_STANDARD_CLASS = "dx-shape-standard"; var ButtonCollection = _uiCollection_widget2.default.inherit({ _renderItemContent: function(options) { options.container = (0, _renderer2.default)(options.container).parent(); this.callBase(options) }, _focusTarget: function() { return this.$element().parent() }, _keyboardEventBindingTarget: function() { return this._focusTarget() }, _refreshContent: function() { this._prepareContent(); this._renderContent() }, _itemClass: function() { return BUTTON_GROUP_ITEM_CLASS }, _itemSelectHandler: function(e) { if ("single" === this.option("selectionMode") && this.isItemSelected(e.currentTarget)) { return } this.callBase(e) } }); var ButtonGroup = _ui2.default.inherit({ _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { hoverStateEnabled: true, focusStateEnabled: true, selectionMode: "single", selectedItems: [], selectedItemKeys: [], stylingMode: "contained", keyExpr: "text", items: [], itemTemplate: "item", onSelectionChanged: null, onItemClick: null }) }, _prepareItemStyles: function($item) { var itemIndex = $item.data("dxItemIndex"); 0 === itemIndex && $item.addClass(BUTTON_GROUP_FIRST_ITEM_CLASS); var items = this.option("items"); items && itemIndex === items.length - 1 && $item.addClass(BUTTON_GROUP_LAST_ITEM_CLASS); $item.addClass(SHAPE_STANDARD_CLASS) }, _initTemplates: function() { var _this = this; this.callBase(); this._defaultTemplates.item = new _bindable_template2.default(function($container, data, model) { _this._prepareItemStyles($container); _this._createComponent($container, _button2.default, (0, _extend.extend)({}, model, data, _this._getBasicButtonOptions())) }, ["text", "type", "icon", "disabled", "visible", "hint"], this.option("integrationOptions.watchMethod")) }, _init: function() { this.callBase(); this._createItemClickAction() }, _createItemClickAction: function() { this._itemClickAction = this._createActionByOption("onItemClick") }, _initMarkup: function() { this.setAria("role", "group"); this.$element().addClass(BUTTON_GROUP_CLASS); this._renderButtons(); this._syncSelectionOptions(); this.callBase() }, _fireSelectionChangeEvent: function(addedItems, removedItems) { this._createActionByOption("onSelectionChanged", { excludeValidators: ["disabled", "readOnly"] })({ addedItems: addedItems, removedItems: removedItems }) }, _getBasicButtonOptions: function() { return { focusStateEnabled: false, stylingMode: this.option("stylingMode"), hoverStateEnabled: this.option("hoverStateEnabled"), activeStateEnabled: this.option("activeStateEnabled"), onClick: null } }, _renderButtons: function() { var _this2 = this; var $buttons = (0, _renderer2.default)("
").addClass(BUTTON_GROUP_WRAPPER_CLASS).appendTo(this.$element()); var selectedItems = this.option("selectedItems"); var options = { selectionMode: this.option("selectionMode"), items: this.option("items"), keyExpr: this.option("keyExpr"), itemTemplate: this._getTemplateByOption("itemTemplate"), scrollingEnabled: false, selectedItemKeys: this.option("selectedItemKeys"), focusStateEnabled: this.option("focusStateEnabled"), accessKey: this.option("accessKey"), tabIndex: this.option("tabIndex"), noDataText: "", selectionRequired: false, onItemRendered: function(e) { var width = _this2.option("width"); (0, _type.isDefined)(width) && (0, _renderer2.default)(e.itemElement).addClass(BUTTON_GROUP_ITEM_HAS_WIDTH) }, onSelectionChanged: function(e) { _this2._syncSelectionOptions(); _this2._fireSelectionChangeEvent(e.addedItems, e.removedItems) }, onItemClick: function(e) { _this2._itemClickAction(e) } }; if ((0, _type.isDefined)(selectedItems) && selectedItems.length) { options.selectedItems = selectedItems } this._buttonsCollection = this._createComponent($buttons, ButtonCollection, options) }, _syncSelectionOptions: function() { this._setOptionSilent("selectedItems", this._buttonsCollection.option("selectedItems")); this._setOptionSilent("selectedItemKeys", this._buttonsCollection.option("selectedItemKeys")) }, _optionChanged: function(args) { switch (args.name) { case "stylingMode": case "selectionMode": case "keyExpr": case "itemTemplate": case "items": case "activeStateEnabled": case "focusStateEnabled": case "hoverStateEnabled": case "tabIndex": this._invalidate(); break; case "selectedItemKeys": case "selectedItems": this._buttonsCollection.option(args.name, args.value); break; case "onItemClick": this._createItemClickAction(); break; case "onSelectionChanged": break; case "width": this.callBase(args); this._buttonsCollection.itemElements().toggleClass(BUTTON_GROUP_ITEM_HAS_WIDTH, !!args.value); break; default: this.callBase(args) } } }); (0, _component_registrator2.default)("dxButtonGroup", ButtonGroup); module.exports = ButtonGroup }, /*!**********************************************!*\ !*** ./artifacts/transpiled/ui/color_box.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./color_box/color_box */ 530) }, /*!*********************************************************!*\ !*** ./artifacts/transpiled/ui/color_box/color_view.js ***! \*********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2); var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var translator = __webpack_require__( /*! ../../animation/translator */ 27); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var Color = __webpack_require__( /*! ../../color */ 94); var messageLocalization = __webpack_require__( /*! ../../localization/message */ 13); var devices = __webpack_require__( /*! ../../core/devices */ 16); var registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9); var Editor = __webpack_require__( /*! ../editor/editor */ 49); var NumberBox = __webpack_require__( /*! ../number_box */ 114); var TextBox = __webpack_require__( /*! ../text_box */ 89); var Draggable = __webpack_require__( /*! ../draggable */ 306); var clickEvent = __webpack_require__( /*! ../../events/click */ 19); var COLOR_VIEW_CLASS = "dx-colorview"; var COLOR_VIEW_CONTAINER_CLASS = "dx-colorview-container"; var COLOR_VIEW_ROW_CLASS = "dx-colorview-container-row"; var COLOR_VIEW_CELL_CLASS = "dx-colorview-container-cell"; var COLOR_VIEW_PALETTE_CLASS = "dx-colorview-palette"; var COLOR_VIEW_PALETTE_CELL_CLASS = "dx-colorview-palette-cell"; var COLOR_VIEW_PALETTE_HANDLE_CLASS = "dx-colorview-palette-handle"; var COLOR_VIEW_PALETTE_GRADIENT_CLASS = "dx-colorview-palette-gradient"; var COLOR_VIEW_PALETTE_GRADIENT_WHITE_CLASS = "dx-colorview-palette-gradient-white"; var COLOR_VIEW_PALETTE_GRADIENT_BLACK_CLASS = "dx-colorview-palette-gradient-black"; var COLOR_VIEW_HUE_SCALE_CLASS = "dx-colorview-hue-scale"; var COLOR_VIEW_HUE_SCALE_CELL_CLASS = "dx-colorview-hue-scale-cell"; var COLOR_VIEW_HUE_SCALE_HANDLE_CLASS = "dx-colorview-hue-scale-handle"; var COLOR_VIEW_HUE_SCALE_WRAPPER_CLASS = "dx-colorview-hue-scale-wrapper"; var COLOR_VIEW_CONTROLS_CONTAINER_CLASS = "dx-colorview-controls-container"; var COLOR_VIEW_RED_LABEL_CLASS = "dx-colorview-label-red"; var COLOR_VIEW_GREEN_LABEL_CLASS = "dx-colorview-label-green"; var COLOR_VIEW_BLUE_LABEL_CLASS = "dx-colorview-label-blue"; var COLOR_VIEW_HEX_LABEL_CLASS = "dx-colorview-label-hex"; var COLOR_VIEW_ALPHA_CHANNEL_SCALE_CLASS = "dx-colorview-alpha-channel-scale"; var COLOR_VIEW_APLHA_CHANNEL_ROW_CLASS = "dx-colorview-alpha-channel-row"; var COLOR_VIEW_ALPHA_CHANNEL_SCALE_WRAPPER_CLASS = "dx-colorview-alpha-channel-wrapper"; var COLOR_VIEW_ALPHA_CHANNEL_LABEL_CLASS = "dx-colorview-alpha-channel-label"; var COLOR_VIEW_ALPHA_CHANNEL_HANDLE_CLASS = "dx-colorview-alpha-channel-handle"; var COLOR_VIEW_ALPHA_CHANNEL_CELL_CLASS = "dx-colorview-alpha-channel-cell"; var COLOR_VIEW_ALPHA_CHANNEL_BORDER_CLASS = "dx-colorview-alpha-channel-border"; var COLOR_VIEW_COLOR_PREVIEW = "dx-colorview-color-preview"; var COLOR_VIEW_COLOR_PREVIEW_CONTAINER_CLASS = "dx-colorview-color-preview-container"; var COLOR_VIEW_COLOR_PREVIEW_CONTAINER_INNER_CLASS = "dx-colorview-color-preview-container-inner"; var COLOR_VIEW_COLOR_PREVIEW_COLOR_CURRENT = "dx-colorview-color-preview-color-current"; var COLOR_VIEW_COLOR_PREVIEW_COLOR_NEW = "dx-colorview-color-preview-color-new"; var ColorView = Editor.inherit({ _supportedKeys: function() { var isRTL = this.option("rtlEnabled"); var that = this; var getHorizontalPaletteStep = function(e) { var step = 100 / that._paletteWidth; if (e.shiftKey) { step *= that.option("keyStep") } step = step > 1 ? step : 1; return Math.round(step) }; var updateHorizontalPaletteValue = function(step) { var value = that._currentColor.hsv.s + step; if (value > 100) { value = 100 } else { if (value < 0) { value = 0 } } that._currentColor.hsv.s = value; updatePaletteValue() }; var getVerticalPaletteStep = function(e) { var step = 100 / that._paletteHeight; if (e.shiftKey) { step *= that.option("keyStep") } step = step > 1 ? step : 1; return Math.round(step) }; var updateVerticalPaletteValue = function(step) { var value = that._currentColor.hsv.v + step; if (value > 100) { value = 100 } else { if (value < 0) { value = 0 } } that._currentColor.hsv.v = value; updatePaletteValue() }; var updatePaletteValue = function() { that._placePaletteHandle(); that._updateColorFromHsv(that._currentColor.hsv.h, that._currentColor.hsv.s, that._currentColor.hsv.v) }; var getHueScaleStep = function(e) { var step = 360 / (that._hueScaleWrapperHeight - that._hueScaleHandleHeight); if (e.shiftKey) { step *= that.option("keyStep") } step = step > 1 ? step : 1; return step }; var updateHueScaleValue = function(step) { that._currentColor.hsv.h += step; that._placeHueScaleHandle(); var handleLocation = translator.locate(that._$hueScaleHandle); that._updateColorHue(handleLocation.top + that._hueScaleHandleHeight / 2) }; var getAlphaScaleStep = function(e) { var step = 1 / that._alphaChannelScaleWorkWidth; if (e.shiftKey) { step *= that.option("keyStep") } step = step > .01 ? step : .01; step = isRTL ? -step : step; return step }; var updateAlphaScaleValue = function(step) { that._currentColor.a += step; that._placeAlphaChannelHandle(); var handleLocation = translator.locate(that._$alphaChannelHandle); that._calculateColorTransparencyByScaleWidth(handleLocation.left + that._alphaChannelHandleWidth / 2) }; return extend(this.callBase(), { upArrow: function(e) { e.preventDefault(); e.stopPropagation(); if (e.ctrlKey) { if (this._currentColor.hsv.h <= 360 && !this._isTopColorHue) { updateHueScaleValue(getHueScaleStep(e)) } } else { if (this._currentColor.hsv.v < 100) { updateVerticalPaletteValue(getVerticalPaletteStep(e)) } } }, downArrow: function(e) { e.preventDefault(); e.stopPropagation(); if (e.ctrlKey) { if (this._currentColor.hsv.h >= 0) { if (this._isTopColorHue) { this._currentColor.hsv.h = 360 } updateHueScaleValue(-getHueScaleStep(e)) } } else { if (this._currentColor.hsv.v > 0) { updateVerticalPaletteValue(-getVerticalPaletteStep(e)) } } }, rightArrow: function(e) { e.preventDefault(); e.stopPropagation(); if (e.ctrlKey) { if (isRTL ? this._currentColor.a < 1 : this._currentColor.a > 0 && this.option("editAlphaChannel")) { updateAlphaScaleValue(-getAlphaScaleStep(e)) } } else { if (this._currentColor.hsv.s < 100) { updateHorizontalPaletteValue(getHorizontalPaletteStep(e)) } } }, leftArrow: function(e) { e.preventDefault(); e.stopPropagation(); if (e.ctrlKey) { if (isRTL ? this._currentColor.a > 0 : this._currentColor.a < 1 && this.option("editAlphaChannel")) { updateAlphaScaleValue(getAlphaScaleStep(e)) } } else { if (this._currentColor.hsv.s > 0) { updateHorizontalPaletteValue(-getHorizontalPaletteStep(e)) } } }, enter: function(e) { this._fireEnterKeyPressed(e) } }) }, _getDefaultOptions: function() { return extend(this.callBase(), { value: null, matchValue: null, onEnterKeyPressed: void 0, editAlphaChannel: false, keyStep: 1, stylingMode: void 0 }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function() { return "desktop" === devices.real().deviceType && !devices.isSimulator() }, options: { focusStateEnabled: true } }]) }, _init: function() { this.callBase(); this._initColorAndOpacity(); this._initEnterKeyPressedAction() }, _initEnterKeyPressedAction: function() { this._onEnterKeyPressedAction = this._createActionByOption("onEnterKeyPressed") }, _fireEnterKeyPressed: function(e) { if (!this._onEnterKeyPressedAction) { return } this._onEnterKeyPressedAction({ event: e }) }, _initColorAndOpacity: function() { this._setCurrentColor(this.option("value")) }, _setCurrentColor: function(value) { value = value || "#000000"; var newColor = new Color(value); if (!newColor.colorIsInvalid) { if (!this._currentColor || this._makeRgba(this._currentColor) !== this._makeRgba(newColor)) { this._currentColor = newColor; if (this._$currentColor) { this._makeTransparentBackground(this._$currentColor, newColor) } } } else { this.option("value", this._currentColor.baseColor) } }, _setBaseColor: function(value) { var color = value || "#000000"; var newColor = new Color(color); if (!newColor.colorIsInvalid) { var isBaseColorChanged = this._makeRgba(this.option("matchValue") !== this._makeRgba(newColor)); if (isBaseColorChanged) { if (this._$baseColor) { this._makeTransparentBackground(this._$baseColor, newColor) } } } }, _initMarkup: function() { this.callBase(); this.$element().addClass(COLOR_VIEW_CLASS); this._renderColorPickerContainer() }, _render: function() { this.callBase(); this._renderPalette(); this._renderHueScale(); this._renderControlsContainer(); this._renderControls(); this._renderAlphaChannelElements() }, _makeTransparentBackground: function($el, color) { if (!(color instanceof Color)) { color = new Color(color) } $el.css("backgroundColor", this._makeRgba(color)) }, _makeRgba: function(color) { if (!(color instanceof Color)) { color = new Color(color) } return "rgba(" + [color.r, color.g, color.b, color.a].join(", ") + ")" }, _renderValue: function() { this.callBase(this.option("editAlphaChannel") ? this._makeRgba(this._currentColor) : this.option("value")) }, _renderColorPickerContainer: function() { var $parent = this.$element(); this._$colorPickerContainer = $("
").addClass(COLOR_VIEW_CONTAINER_CLASS).appendTo($parent); this._renderHtmlRows() }, _renderHtmlRows: function(updatedOption) { var $renderedRows = this._$colorPickerContainer.find("." + COLOR_VIEW_ROW_CLASS); var renderedRowsCount = $renderedRows.length; var rowCount = this.option("editAlphaChannel") ? 2 : 1; var delta = renderedRowsCount - rowCount; if (delta > 0) { $renderedRows.eq(-1).remove() } if (delta < 0) { delta = Math.abs(delta); var rows = []; var i; for (i = 0; i < delta; i++) { rows.push($("
").addClass(COLOR_VIEW_ROW_CLASS)) } if (renderedRowsCount) { for (i = 0; i < rows.length; i++) { $renderedRows.eq(0).after(rows[i]) } } else { this._$colorPickerContainer.append(rows) } } }, _renderHtmlCellInsideRow: function(index, $rowParent, additionalClass) { return $("
").addClass(COLOR_VIEW_CELL_CLASS).addClass(additionalClass).appendTo($rowParent.find("." + COLOR_VIEW_ROW_CLASS).eq(index)) }, _renderPalette: function() { var $paletteCell = this._renderHtmlCellInsideRow(0, this._$colorPickerContainer, COLOR_VIEW_PALETTE_CELL_CLASS); var $paletteGradientWhite = $("
").addClass([COLOR_VIEW_PALETTE_GRADIENT_CLASS, COLOR_VIEW_PALETTE_GRADIENT_WHITE_CLASS].join(" ")); var $paletteGradientBlack = $("
").addClass([COLOR_VIEW_PALETTE_GRADIENT_CLASS, COLOR_VIEW_PALETTE_GRADIENT_BLACK_CLASS].join(" ")); this._$palette = $("
").addClass(COLOR_VIEW_PALETTE_CLASS).css("backgroundColor", this._currentColor.getPureColor().toHex()).appendTo($paletteCell); this._paletteHeight = this._$palette.height(); this._paletteWidth = this._$palette.width(); this._renderPaletteHandle(); this._$palette.append([$paletteGradientWhite, $paletteGradientBlack]) }, _renderPaletteHandle: function() { this._$paletteHandle = $("
").addClass(COLOR_VIEW_PALETTE_HANDLE_CLASS).appendTo(this._$palette); this._createComponent(this._$paletteHandle, Draggable, { area: this._$palette, allowMoveByClick: true, boundOffset: function() { return -this._paletteHandleHeight / 2 }.bind(this), onDrag: function() { var paletteHandlePosition = translator.locate(this._$paletteHandle); this._updateByDrag = true; this._updateColorFromHsv(this._currentColor.hsv.h, this._calculateColorSaturation(paletteHandlePosition), this._calculateColorValue(paletteHandlePosition)) }.bind(this) }); this._paletteHandleWidth = this._$paletteHandle.width(); this._paletteHandleHeight = this._$paletteHandle.height(); this._placePaletteHandle() }, _placePaletteHandle: function() { translator.move(this._$paletteHandle, { left: Math.round(this._paletteWidth * this._currentColor.hsv.s / 100 - this._paletteHandleWidth / 2), top: Math.round(this._paletteHeight - this._paletteHeight * this._currentColor.hsv.v / 100 - this._paletteHandleHeight / 2) }) }, _calculateColorValue: function(paletteHandlePosition) { var value = Math.floor(paletteHandlePosition.top + this._paletteHandleHeight / 2); return 100 - Math.round(100 * value / this._paletteHeight) }, _calculateColorSaturation: function(paletteHandlePosition) { var saturation = Math.floor(paletteHandlePosition.left + this._paletteHandleWidth / 2); return Math.round(100 * saturation / this._paletteWidth) }, _updateColorFromHsv: function(hue, saturation, value) { var a = this._currentColor.a; this._currentColor = new Color("hsv(" + [hue, saturation, value].join(",") + ")"); this._currentColor.a = a; this._updateColorParamsAndColorPreview(); this.applyColor() }, _renderHueScale: function() { var $hueScaleCell = this._renderHtmlCellInsideRow(0, this._$colorPickerContainer, COLOR_VIEW_HUE_SCALE_CELL_CLASS); this._$hueScaleWrapper = $("
").addClass(COLOR_VIEW_HUE_SCALE_WRAPPER_CLASS).appendTo($hueScaleCell); this._$hueScale = $("
").addClass(COLOR_VIEW_HUE_SCALE_CLASS).appendTo(this._$hueScaleWrapper); this._hueScaleHeight = this._$hueScale.height(); this._hueScaleWrapperHeight = this._$hueScaleWrapper.outerHeight(); this._renderHueScaleHandle() }, _renderHueScaleHandle: function() { this._$hueScaleHandle = $("
").addClass(COLOR_VIEW_HUE_SCALE_HANDLE_CLASS).appendTo(this._$hueScaleWrapper); this._createComponent(this._$hueScaleHandle, Draggable, { area: this._$hueScaleWrapper, allowMoveByClick: true, direction: "vertical", onDrag: function() { this._updateByDrag = true; this._updateColorHue(translator.locate(this._$hueScaleHandle).top + this._hueScaleHandleHeight / 2) }.bind(this) }); this._hueScaleHandleHeight = this._$hueScaleHandle.height(); this._placeHueScaleHandle() }, _placeHueScaleHandle: function() { var hueScaleHeight = this._hueScaleWrapperHeight; var handleHeight = this._hueScaleHandleHeight; var top = (hueScaleHeight - handleHeight) * (360 - this._currentColor.hsv.h) / 360; if (hueScaleHeight < top + handleHeight) { top = hueScaleHeight - handleHeight } if (top < 0) { top = 0 } translator.move(this._$hueScaleHandle, { top: Math.round(top) }) }, _updateColorHue: function(handlePosition) { var hue = 360 - Math.round(360 * (handlePosition - this._hueScaleHandleHeight / 2) / (this._hueScaleWrapperHeight - this._hueScaleHandleHeight)); var saturation = this._currentColor.hsv.s; var value = this._currentColor.hsv.v; this._isTopColorHue = false; hue = hue < 0 ? 0 : hue; if (hue >= 360) { this._isTopColorHue = true; hue = 0 } this._updateColorFromHsv(hue, saturation, value); this._$palette.css("backgroundColor", this._currentColor.getPureColor().toHex()) }, _renderControlsContainer: function() { var $controlsContainerCell = this._renderHtmlCellInsideRow(0, this._$colorPickerContainer); this._$controlsContainer = $("
").addClass(COLOR_VIEW_CONTROLS_CONTAINER_CLASS).appendTo($controlsContainerCell) }, _renderControls: function() { this._renderColorsPreview(); this._renderRgbInputs(); this._renderHexInput() }, _renderColorsPreview: function() { var $colorsPreviewContainer = $("
").addClass(COLOR_VIEW_COLOR_PREVIEW_CONTAINER_CLASS).appendTo(this._$controlsContainer); var $colorsPreviewContainerInner = $("
").addClass(COLOR_VIEW_COLOR_PREVIEW_CONTAINER_INNER_CLASS).appendTo($colorsPreviewContainer); this._$currentColor = $("
").addClass([COLOR_VIEW_COLOR_PREVIEW, COLOR_VIEW_COLOR_PREVIEW_COLOR_NEW].join(" ")); this._$baseColor = $("
").addClass([COLOR_VIEW_COLOR_PREVIEW, COLOR_VIEW_COLOR_PREVIEW_COLOR_CURRENT].join(" ")); this._makeTransparentBackground(this._$baseColor, this.option("matchValue")); this._makeTransparentBackground(this._$currentColor, this._currentColor); $colorsPreviewContainerInner.append([this._$baseColor, this._$currentColor]) }, _renderAlphaChannelElements: function() { if (this.option("editAlphaChannel")) { this._$colorPickerContainer.find("." + COLOR_VIEW_ROW_CLASS).eq(1).addClass(COLOR_VIEW_APLHA_CHANNEL_ROW_CLASS); this._renderAlphaChannelScale(); this._renderAlphaChannelInput() } }, _renderRgbInputs: function() { this._rgbInputsWithLabels = [this._renderEditorWithLabel({ editorType: NumberBox, value: this._currentColor.r, onValueChanged: this._updateColor.bind(this, false), labelText: "R", labelAriaText: messageLocalization.format("dxColorView-ariaRed"), labelClass: COLOR_VIEW_RED_LABEL_CLASS }), this._renderEditorWithLabel({ editorType: NumberBox, value: this._currentColor.g, onValueChanged: this._updateColor.bind(this, false), labelText: "G", labelAriaText: messageLocalization.format("dxColorView-ariaGreen"), labelClass: COLOR_VIEW_GREEN_LABEL_CLASS }), this._renderEditorWithLabel({ editorType: NumberBox, value: this._currentColor.b, onValueChanged: this._updateColor.bind(this, false), labelText: "B", labelAriaText: messageLocalization.format("dxColorView-ariaBlue"), labelClass: COLOR_VIEW_BLUE_LABEL_CLASS })]; this._$controlsContainer.append(this._rgbInputsWithLabels); this._rgbInputs = [this._rgbInputsWithLabels[0].find(".dx-numberbox").dxNumberBox("instance"), this._rgbInputsWithLabels[1].find(".dx-numberbox").dxNumberBox("instance"), this._rgbInputsWithLabels[2].find(".dx-numberbox").dxNumberBox("instance")] }, _renderEditorWithLabel: function(options) { var $editor = $("
"); var $label = $("