/*! * DevExtreme (dx.viz-web.debug.js) * Version: 19.2.5 * Build date: Mon Dec 16 2019 * * Copyright (c) 2012 - 2019 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 = 896) }([ /*!***************************************************!*\ !*** ./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, 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 clone, targetValue = target[key], sourceValue = source[key], sourceValueIsArray = false; 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__) { var _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 }; 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" === ("undefined" === typeof object ? "undefined" : _typeof(object)) ? types[typeOfObject] || "object" : "undefined" === typeof object ? "undefined" : _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), 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 */ 258); 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 _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 }; var _config = __webpack_require__( /*! ../config */ 29); var _config2 = _interopRequireDefault(_config); var _guid = __webpack_require__( /*! ../guid */ 34); var _guid2 = _interopRequireDefault(_guid); var _deferred = __webpack_require__( /*! ../utils/deferred */ 6); var _data = __webpack_require__( /*! ./data */ 18); var _iterator = __webpack_require__( /*! ./iterator */ 3); var _type = __webpack_require__( /*! ./type */ 1); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": 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 timerId = void 0; 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) } }; timerId = (arguments[2] || setTimeout)(callback, "number" === typeof context ? context : 0); return task }; var delayedFuncs = []; var delayedNames = []; var delayedDeferreds = []; var executingName = void 0; 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 ("undefined" === typeof raw ? "undefined" : _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 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 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 check = void 0; var expectedCheck = !invert; for (var i = 0; i < elements.length; i++) { check = !!checkFunction(elements[i], i); if (check === expectedCheck) { result.push(elements[i]) } } return result }; var arraysEqualByValue = function(array1, array2, depth) { if (array1.length !== array2.length) { return false } for (var i = 0; i < array1.length; i++) { if (!equalByValue(array1[i], array2[i], depth + 1)) { return false } } return true }; var objectsEqualByValue = function(object1, object2, depth) { for (var propertyName in object1) { if (Object.prototype.hasOwnProperty.call(object1, propertyName) && !equalByValue(object1[propertyName], object2[propertyName], depth + 1)) { return false } } for (var _propertyName in object2) { if (!(_propertyName in object1)) { return false } } return true }; var maxEqualityDepth = 3; var equalByValue = function(object1, object2, depth) { depth = depth || 0; object1 = (0, _data.toComparable)(object1, true); object2 = (0, _data.toComparable)(object2, true); if (object1 === object2 || depth >= maxEqualityDepth) { return true } if ((0, _type.isObject)(object1) && (0, _type.isObject)(object2)) { return objectsEqualByValue(object1, object2, depth) } else { if (Array.isArray(object1) && Array.isArray(object2)) { return arraysEqualByValue(object1, object2, depth) } } return false }; 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.getKeyHash = getKeyHash; exports.escapeRegExp = escapeRegExp; exports.applyServerDecimalSeparator = applyServerDecimalSeparator; exports.noop = noop; exports.asyncNoop = asyncNoop; exports.grep = grep; exports.equalByValue = equalByValue }, /*!***********************************************************!*\ !*** ./artifacts/transpiled/events/core/events_engine.js ***! \***********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _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 }; var registerEventCallbacks = __webpack_require__( /*! ./event_registrator_callbacks */ 124); var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 13); var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7); var window = windowUtils.getWindow(); var injector = __webpack_require__( /*! ../../core/utils/dependency_injector */ 56); var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1); var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 27); 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 */ 179); var hookTouchProps = __webpack_require__( /*! ../../events/core/hook_touch_props */ 259); var callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 61); 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 secondaryTargetIsInside, result, handlerArgs = [e], target = e.currentTarget, relatedTarget = e.relatedTarget; 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" === ("undefined" === typeof eventName ? "undefined" : _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 */ 27); 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), contexts = [], resolvedCount = 0, 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 */ 13); 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 */ 154); var errors = __webpack_require__( /*! ./errors */ 21); var publicComponentUtils = __webpack_require__( /*! ./utils/public_component */ 135); 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 result, isMemberInvoke = "string" === typeof options; if (isMemberInvoke) { var memberName = options, 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], 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/localization/message.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _dependency_injector = __webpack_require__( /*! ../core/utils/dependency_injector */ 56); var _dependency_injector2 = _interopRequireDefault(_dependency_injector); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _string = __webpack_require__( /*! ../core/utils/string */ 45); var _inflector = __webpack_require__( /*! ../core/utils/inflector */ 33); var _core = __webpack_require__( /*! ./core */ 80); var _core2 = _interopRequireDefault(_core); var _default_messages = __webpack_require__( /*! ./default_messages */ 463); var _default_messages2 = _interopRequireDefault(_default_messages); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var baseDictionary = (0, _extend.extend)(true, {}, _default_messages2.default); var getDataByLocale = function(localeData, locale) { return localeData[locale] || {} }; var newMessages = {}; var messageLocalization = (0, _dependency_injector2.default)({ engine: function() { return "base" }, _dictionary: baseDictionary, load: function(messages) { (0, _extend.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 = void 0; if (escape !== escapeString) { result = that.format(localizationKey) } if (!result) { newMessages[localizationKey] = (0, _inflector.humanize)(localizationKey) } return prefix + (result || defaultResult) }) }, localizeNode: function(node) { var that = this; (0, _renderer2.default)(node).each(function(index, nodeItem) { if (!nodeItem.nodeType) { return } if (3 === nodeItem.nodeType) { nodeItem.nodeValue = that.localizeString(nodeItem.nodeValue) } else { if (!(0, _renderer2.default)(nodeItem).is("iframe")) { (0, _iterator.each)(nodeItem.attributes || [], function(index, attr) { if ("string" === typeof attr.value) { var localizedValue = that.localizeString(attr.value); if (attr.value !== localizedValue) { attr.value = localizedValue } } }); (0, _renderer2.default)(nodeItem).contents().each(function(index, node) { that.localizeNode(node) }) } } }) }, getMessagesByLocales: function() { return this._dictionary }, getDictionary: function(onlyNew) { if (onlyNew) { return newMessages } return (0, _extend.extend)({}, newMessages, this.getMessagesByLocales()[_core2.default.locale()]) }, getFormatter: function(key) { return this._getFormatterBase(key) || this._getFormatterBase(key, "en") }, _getFormatterBase: function(key, locale) { var _this = this; var message = _core2.default.getValueByClosestLocale(function(locale) { return getDataByLocale(_this._dictionary, 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 _string.format.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/dom.js ***! \************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var elementStrategy, $ = __webpack_require__( /*! ../../core/renderer */ 2), config = __webpack_require__( /*! ../../core/config */ 29), domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 13), windowUtils = __webpack_require__( /*! ./window */ 7), window = windowUtils.getWindow(), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), inArray = __webpack_require__( /*! ./array */ 14).inArray, typeUtils = __webpack_require__( /*! ./type */ 1), isDefined = typeUtils.isDefined, isRenderer = typeUtils.isRenderer, htmlParser = __webpack_require__( /*! ../../core/utils/html_parser */ 260); var resetActiveElement = function() { var activeElement = domAdapter.getActiveElement(), 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), $endTarget = $(endTarget); if ($startTarget[0] === $endTarget[0]) { return $startTarget[0] } var $startParents = $startTarget.parents(), $endParents = $endTarget.parents(), 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 = [], selector = "[" + dataOptionsAttributeName + "]"; var $items = elements.find(selector).add(elements.filter(selector)); $items.each(function(index, element) { var $element = $(element), options = getElementOptions(element); for (var componentName in options) { if (!componentTypes || inArray(componentName, componentTypes) > -1) { if ($element[componentName]) { $element[componentName](options[componentName]); result.push($element[componentName]("instance")) } } } }); return result }; var createMarkupFromString = function(str) { if (!window.WinJS) { return $(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/viz/core/utils.js ***! \************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, mathUtils = __webpack_require__( /*! ../../core/utils/math */ 30), dateToMilliseconds = __webpack_require__( /*! ../../core/utils/date */ 22).dateToMilliseconds, domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 13), Color = __webpack_require__( /*! ../../color */ 86), isDefined = typeUtils.isDefined, isNumber = typeUtils.isNumeric, isExponential = typeUtils.isExponential, _math = Math, _round = _math.round, _sqrt = Math.sqrt; var PI = Math.PI, MAX_PIXEL_COUNT = 1e10, PI_DIV_180 = PI / 180, LN10 = Math.LN10; var cosFunc = Math.cos, sinFunc = Math.sin, abs = Math.abs, log = Math.log, floor = Math.floor, ceil = Math.ceil, max = Math.max, _isNaN = isNaN, _Number = Number, _NaN = NaN; var adjust = mathUtils.adjust, sign = mathUtils.sign; var PANE_PADDING = 10; 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, diffY = y2 - y1; return Math.sqrt(diffY * diffY + diffX * diffX) }; var getDecimalOrder = function(number) { var cn, n = abs(number); if (!_isNaN(n)) { if (n > 0) { n = log(n) / LN10; cn = ceil(n); return cn - n < DECIMAL_ORDER_THRESHOLD ? cn : floor(n) } return 0 } return _NaN }; var getAppropriateFormat = function(start, end, count) { var format, order = max(getDecimalOrder(start), getDecimalOrder(end)), precision = -getDecimalOrder(abs(end - start) / count); if (!_isNaN(order) && !_isNaN(precision)) { if (abs(order) <= 4) { format = "fixedPoint"; precision < 0 && (precision = 0); precision > 4 && (precision = 4) } else { format = "exponential"; precision += order - 1; precision > 3 && (precision = 3) } return { type: format, precision: precision } } return null }; var 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 value, i = 0, len = array.length, result = []; while (i < len) { 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)), yt = normalizeBBoxField(floor(bBox.y)), xr = normalizeBBoxField(ceil(bBox.width + bBox.x)), yb = normalizeBBoxField(ceil(bBox.height + bBox.y)), 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)), sin = _Number(sinFunc(angle * PI_DIV_180).toFixed(3)), w2 = bBox.width / 2, h2 = bBox.height / 2, centerX = bBox.x + w2, centerY = bBox.y + h2, w2_ = abs(w2 * cos) + abs(h2 * sin), h2_ = abs(w2 * sin) + abs(h2 * cos), centerX_ = center[0] + (centerX - center[0]) * cos + (centerY - center[1]) * sin, 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 i, ii, stored = {}; for (i = 0, ii = values.length; i < ii; ++i) { stored[normalizeEnum(values[i])] = 1 } return function(value, defaultValue) { var _value = normalizeEnum(value); return stored[_value] ? _value : defaultValue } }, patchFontOptions: function(options) { var fontOptions = {}; each(options || {}, function(key, value) { if (/^(cursor)$/i.test(key)) {} else { if ("opacity" === key) { value = null } else { if ("color" === key) { key = "fill"; if ("opacity" in options) { var color = new Color(value); value = "rgba(" + color.r + "," + color.g + "," + color.b + "," + options.opacity + ")" } } else { key = "font-" + key } } } fontOptions[key] = value }); return fontOptions }, checkElementHasPropertyFromStyleSheet: function(element, property) { var slice = Array.prototype.slice; var cssRules = slice.call(domAdapter.getDocument().styleSheets).reduce(function(rules, styleSheet) { return rules.concat(slice.call(styleSheet.cssRules || styleSheet.rules)) }, []); var elementRules = cssRules.filter(function(rule) { try { return domAdapter.elementMatches(element, rule.selectorText) } catch (e) { return false } }); return elementRules.some(function(rule) { return !!rule.style[property] }) }, convertPolarToXY: function(centerCoords, startAngle, angle, radius) { var shiftAngle = 90; var normalizedRadius = radius > 0 ? radius : 0; angle = isDefined(angle) ? angle + startAngle - shiftAngle : 0; var cosSin = getCosAndSin(angle); return { x: _round(centerCoords.x + normalizedRadius * cosSin.cos), y: _round(centerCoords.y + normalizedRadius * cosSin.sin) } }, convertXYToPolar: function(centerCoords, x, y) { var radius = getDistance(centerCoords.x, centerCoords.y, x, y), angle = _math.atan2(y - centerCoords.y, x - centerCoords.x); return { phi: _round(normalizeAngle(180 * angle / _math.PI)), r: _round(radius) } }, processSeriesTemplate: function(seriesTemplate, items) { var series, length, data, customizeSeries = typeUtils.isFunction(seriesTemplate.customizeSeries) ? seriesTemplate.customizeSeries : noop, nameField = seriesTemplate.nameField, generatedSeries = {}, seriesOrder = [], i = 0; items = items || []; for (length = items.length; i < length; i++) { data = items[i]; if (nameField in data) { series = generatedSeries[data[nameField]]; if (!series) { series = generatedSeries[data[nameField]] = { name: data[nameField], 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 visibleCategories, swapBuf, lastIdx, categoriesValue = map(categories, function(category) { return isDefined(category) ? category.valueOf() : null }), indexStartValue = categoriesValue.indexOf(startValue.valueOf()), indexEndValue = categoriesValue.indexOf(endValue.valueOf()), inverted = false; indexStartValue < 0 && (indexStartValue = 0); indexEndValue < 0 && (indexEndValue = categories.length - 1); if (indexEndValue < indexStartValue) { swapBuf = indexEndValue; indexEndValue = indexStartValue; indexStartValue = swapBuf; inverted = true } visibleCategories = categories.slice(indexStartValue, indexEndValue + 1); lastIdx = visibleCategories.length - 1; return { categories: visibleCategories, start: visibleCategories[inverted ? lastIdx : 0], end: visibleCategories[inverted ? 0 : lastIdx], inverted: inverted } }, setCanvasValues: setCanvasValues, normalizePanesHeight: function(panes) { panes.forEach(function(pane) { var height = pane.height; var unit = 0; var parsedHeight = parseFloat(height) || void 0; if (typeUtils.isString(height) && height.indexOf("px") > -1 || typeUtils.isNumeric(height) && height > 1) { parsedHeight = _round(parsedHeight); unit = 1 } if (!unit && parsedHeight) { if (typeUtils.isString(height) && height.indexOf("%") > -1) { parsedHeight /= 100 } else { if (parsedHeight < 0) { parsedHeight = parsedHeight < -1 ? 1 : _math.abs(parsedHeight) } } } pane.height = parsedHeight; pane.unit = unit }); var weightSum = panes.filter(function(pane) { return !pane.unit }).reduce(function(prev, next) { return prev + (next.height || 0) }, 0); var weightHeightCount = panes.filter(function(pane) { return !pane.unit }).length; var emptyHeightCount = panes.filter(function(pane) { return !pane.unit && !pane.height }).length; if (weightSum < 1 && emptyHeightCount) { panes.filter(function(pane) { return !pane.unit && !pane.height }).forEach(function(pane) { return pane.height = (1 - weightSum) / emptyHeightCount }) } else { if (weightSum > 1 || weightSum < 1 && !emptyHeightCount || 1 === weightSum && emptyHeightCount) { if (emptyHeightCount) { var weightForEmpty = weightSum / weightHeightCount; var emptyWeightSum = emptyHeightCount * weightForEmpty; panes.filter(function(pane) { return !pane.unit && pane.height }).forEach(function(pane) { return pane.height *= (weightSum - emptyWeightSum) / weightSum }); panes.filter(function(pane) { return !pane.unit && !pane.height }).forEach(function(pane) { return pane.height = weightForEmpty }) } panes.forEach(function(pane) { return !pane.unit && (pane.height *= 1 / weightSum) }) } } }, updatePanesCanvases: function(panes, canvas, rotated) { var distributedSpace = 0; var padding = PANE_PADDING; var paneSpace = rotated ? canvas.width - canvas.left - canvas.right : canvas.height - canvas.top - canvas.bottom; var usefulSpace = paneSpace - padding * (panes.length - 1); var startName = rotated ? "left" : "top"; var endName = rotated ? "right" : "bottom"; var totalCustomSpace = panes.reduce(function(prev, cur) { return prev + (cur.unit ? cur.height : 0) }, 0); usefulSpace -= totalCustomSpace; panes.forEach(function(pane) { var calcLength = pane.unit ? pane.height : _round(pane.height * usefulSpace); 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, horizontalOffset1 = (isPositive ? bBox.x : bBox.x + bBox.width) - center.x, verticalOffset1 = bBox.y - center.y, verticalOffset2 = verticalOffset1 + dy, horizontalOffset2 = _round(_sqrt(horizontalOffset1 * horizontalOffset1 + verticalOffset1 * verticalOffset1 - verticalOffset2 * verticalOffset2)), 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 = getLogExt(rangeValue, range.base) + sign * marginValue; return raiseToExt(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 } } function getLogExt(value, base) { var allowNegatives = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : false; var linearThreshold = arguments[3]; if (!allowNegatives) { return getLog(value, base) } if (0 === value) { return 0 } var transformValue = getLog(Math.abs(value), base) - (linearThreshold - 1); if (transformValue < 0) { return 0 } return adjust(sign(value) * transformValue, Number(Math.pow(base, linearThreshold - 1).toFixed(Math.abs(linearThreshold)))) } function raiseToExt(value, base) { var allowNegatives = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : false; var linearThreshold = arguments[3]; if (!allowNegatives) { return raiseTo(value, base) } if (0 === value) { return 0 } var transformValue = raiseTo(Math.abs(value) + (linearThreshold - 1), base); if (transformValue < 0) { return 0 } return adjust(sign(value) * transformValue, Number(Math.pow(base, linearThreshold).toFixed(Math.abs(linearThreshold)))) } function rangesAreEqual(range, rangeFromOptions) { if (Array.isArray(rangeFromOptions)) { return range.length === rangeFromOptions.length && range.every(function(item, i) { return item === rangeFromOptions[i] }) } else { return range.startValue === rangeFromOptions.startValue && range.endValue === rangeFromOptions.endValue } } exports.getVizRangeObject = getVizRangeObject; exports.convertVisualRangeObject = convertVisualRangeObject; exports.adjustVisualRange = adjustVisualRange; exports.getAddFunction = getAddFunction; exports.getLog = getLog; exports.getLogExt = getLogExt; exports.getAdjustedLog10 = getAdjustedLog10; exports.raiseTo = raiseTo; exports.raiseToExt = raiseToExt; 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; exports.PANE_PADDING = PANE_PADDING; exports.rangesAreEqual = rangesAreEqual }, /*!**************************************************!*\ !*** ./artifacts/transpiled/core/dom_adapter.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _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 }; var _dependency_injector = __webpack_require__( /*! ./utils/dependency_injector */ 56); var _dependency_injector2 = _interopRequireDefault(_dependency_injector); var _common = __webpack_require__( /*! ./utils/common */ 4); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": 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" === ("undefined" === typeof element ? "undefined" : _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 = void 0; 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/array.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var isDefined = __webpack_require__( /*! ./type */ 1).isDefined, each = __webpack_require__( /*! ./iterator */ 3).each, objectUtils = __webpack_require__( /*! ./object */ 47), config = __webpack_require__( /*! ../config */ 29); 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 = {}, parameterIndex = 0, 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), 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 overridden, memberName, member, that = this; if (!members) { return that } for (memberName in members) { member = members[memberName]; overridden = "function" === typeof that.prototype[memberName] && "function" === typeof member; that.prototype[memberName] = overridden ? wrapOverridden(that.parent.prototype, memberName, member) : member } return that }; var include = function() { var argument, name, i, classObj = this; 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) { var hasParentProperty = Object.prototype.hasOwnProperty.bind(this)("parent"); var isES6Class = !hasParentProperty && this.parent; if (isES6Class) { var baseClass = Object.getPrototypeOf(this); return baseClass === parentClass || baseClass.subclassOf(parentClass) } else { 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 i, instance = this, ctor = instance.ctor, includedCtors = instance.constructor._includedCtors, includedPostCtors = instance.constructor._includedPostCtors; for (i = 0; i < includedCtors.length; i++) { includedCtors[i].call(instance) } if (ctor) { ctor.apply(instance, arguments) } for (i = 0; i < includedPostCtors.length; i++) { includedPostCtors[i].call(instance) } }; inheritor.prototype = clonePrototype(this); copyStatic(this, inheritor); inheritor.inherit = this.inherit; inheritor.abstract = abstract; inheritor.redefine = redefine; inheritor.include = include; inheritor.subclassOf = subclassOf; inheritor.parent = this; inheritor._includedCtors = this._includedCtors ? this._includedCtors.slice(0) : []; inheritor._includedPostCtors = this._includedPostCtors ? this._includedPostCtors.slice(0) : []; inheritor.prototype.constructor = inheritor; inheritor.redefine(members); return inheritor }; classImpl.abstract = abstract; module.exports = classImpl }, /*!**********************************************!*\ !*** ./artifacts/transpiled/core/devices.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2), windowUtils = __webpack_require__( /*! ./utils/window */ 7), navigator = windowUtils.getNavigator(), window = windowUtils.getWindow(), extend = __webpack_require__( /*! ./utils/extend */ 0).extend, isPlainObject = __webpack_require__( /*! ./utils/type */ 1).isPlainObject, each = __webpack_require__( /*! ./utils/iterator */ 3).each, Class = __webpack_require__( /*! ./class */ 15), errors = __webpack_require__( /*! ./errors */ 21), Callbacks = __webpack_require__( /*! ./utils/callbacks */ 27), resizeCallbacks = __webpack_require__( /*! ./utils/resize_callbacks */ 134), EventsMixin = __webpack_require__( /*! ./events_mixin */ 85), SessionStorage = __webpack_require__( /*! ./utils/storage */ 287).sessionStorage, viewPort = __webpack_require__( /*! ./utils/view_port */ 73), Config = __webpack_require__( /*! ./config */ 29); var KNOWN_UA_TABLE = { iPhone: "iPhone", iPhone5: "iPhone", iPhone6: "iPhone", iPhone6plus: "iPhone", iPad: "iPad", iPadMini: "iPad Mini", androidPhone: "Android Mobile", androidTablet: "Android", msSurface: "Windows ARM Tablet PC", desktop: "desktop" }; var DEFAULT_DEVICE = { deviceType: "desktop", platform: "generic", version: [], phone: false, tablet: false, android: false, ios: false, generic: true, grade: "A", mac: false }; var uaParsers = { generic: function(userAgent) { var isPhone = /windows phone/i.test(userAgent) || userAgent.match(/WPDesktop/), isTablet = !isPhone && /Windows(.*)arm(.*)Tablet PC/i.test(userAgent), isDesktop = !isPhone && !isTablet && /msapphost/i.test(userAgent), isMac = /((intel|ppc) mac os x)/.test(userAgent.toLowerCase()); if (!(isPhone || isTablet || isDesktop || isMac)) { return } return { deviceType: isPhone ? "phone" : isTablet ? "tablet" : "desktop", platform: "generic", version: [], grade: "A", mac: isMac } }, ios: function(userAgent) { if (!/ip(hone|od|ad)/i.test(userAgent)) { return } var isPhone = /ip(hone|od)/i.test(userAgent), matches = userAgent.match(/os (\d+)_(\d+)_?(\d+)?/i), version = matches ? [parseInt(matches[1], 10), parseInt(matches[2], 10), parseInt(matches[3] || 0, 10)] : [], isIPhone4 = 480 === window.screen.height, grade = isIPhone4 ? "B" : "A"; return { deviceType: isPhone ? "phone" : "tablet", platform: "ios", version: version, grade: grade } }, android: function(userAgent) { if (!/android|htc_|silk/i.test(userAgent)) { return } var isPhone = /mobile/i.test(userAgent), matches = userAgent.match(/android (\d+)\.?(\d+)?\.?(\d+)?/i), version = matches ? [parseInt(matches[1], 10), parseInt(matches[2] || 0, 10), parseInt(matches[3] || 0, 10)] : [], worseThan4_4 = version.length > 1 && (version[0] < 4 || 4 === version[0] && version[1] < 4), grade = worseThan4_4 ? "B" : "A"; return { deviceType: isPhone ? "phone" : "tablet", platform: "android", version: version, grade: grade } } }; var Devices = Class.inherit({ ctor: function(options) { this._window = options && options.window || window; this._realDevice = this._getDevice(); this._currentDevice = void 0; this._currentOrientation = void 0; this.changed = Callbacks(); 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), shortcuts = { phone: "phone" === result.deviceType, tablet: "tablet" === result.deviceType, android: "android" === result.platform, ios: "ios" === 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) } return DEFAULT_DEVICE }, _changeOrientation: function() { var $window = $(this._window), orientation = $window.height() > $window.width() ? "portrait" : "landscape"; if (this._currentOrientation === orientation) { return } this._currentOrientation = orientation; this.fireEvent("orientationChanged", [{ orientation: orientation }]) }, _recalculateOrientation: function() { var windowWidth = $(this._window).width(); if (this._currentWidth === windowWidth) { return } this._currentWidth = windowWidth; this._changeOrientation() } }).include(EventsMixin); var devices = new Devices; viewPort.changeCallback.add(function(viewPort, prevViewport) { devices.detachCssClasses(prevViewport); devices.attachCssClasses(viewPort) }); module.exports = devices }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/ui/widget/ui.widget.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), Action = __webpack_require__( /*! ../../core/action */ 111), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray, each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4), typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 13), DOMComponentWithTemplate = __webpack_require__( /*! ../../core/dom_component_with_template */ 171), KeyboardProcessor = __webpack_require__( /*! ./ui.keyboard_processor */ 172), selectors = __webpack_require__( /*! ./selectors */ 66), eventUtils = __webpack_require__( /*! ../../events/utils */ 8), hoverEvents = __webpack_require__( /*! ../../events/hover */ 150), feedbackEvents = __webpack_require__( /*! ../../events/core/emitter.feedback */ 128), clickEvent = __webpack_require__( /*! ../../events/click */ 20); var UI_FEEDBACK = "UIFeedback", WIDGET_CLASS = "dx-widget", ACTIVE_STATE_CLASS = "dx-state-active", DISABLED_STATE_CLASS = "dx-state-disabled", INVISIBLE_STATE_CLASS = "dx-state-invisible", HOVER_STATE_CLASS = "dx-state-hover", FOCUSED_STATE_CLASS = "dx-state-focused", FEEDBACK_SHOW_TIMEOUT = 30, FEEDBACK_HIDE_TIMEOUT = 400, FOCUS_NAMESPACE = "Focus"; var Widget = DOMComponentWithTemplate.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, _keyboardProcessor: void 0 }) }, _feedbackShowTimeout: FEEDBACK_SHOW_TIMEOUT, _feedbackHideTimeout: FEEDBACK_HIDE_TIMEOUT, _init: function() { this.callBase(); this._initContentReadyAction() }, _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)) }, _getAriaTarget: function() { return this._focusTarget() }, _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._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(), namespace = this.NAME + FOCUS_NAMESPACE, 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, focusInEvent = eventUtils.addNamespace("focusin", namespace), 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), 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, hoverableSelector = that._activeStateUnit, nameStart = eventUtils.addNamespace(hoverEvents.start, UI_FEEDBACK), 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 feedbackAction, feedbackActionDisabled, that = this, feedbackSelector = that._activeStateUnit, activeEventName = eventUtils.addNamespace(feedbackEvents.active, UI_FEEDBACK), inactiveEventName = eventUtils.addNamespace(feedbackEvents.inactive, UI_FEEDBACK); eventsEngine.off(that._eventBindingTarget(), activeEventName, feedbackSelector); eventsEngine.off(that._eventBindingTarget(), inactiveEventName, feedbackSelector); if (that.option("activeStateEnabled")) { var feedbackActionHandler = function(args) { var $element = $(args.element), value = args.value, 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, 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(), addingKeys = {}; addingKeys[key] = handler; this._supportedKeys = function() { return extend(currentKeys, addingKeys) } } }); module.exports = Widget }, /*!*************************************************!*\ !*** ./artifacts/transpiled/core/utils/data.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var errors = __webpack_require__( /*! ../errors */ 21), Class = __webpack_require__( /*! ../class */ 15), objectUtils = __webpack_require__( /*! ./object */ 47), typeUtils = __webpack_require__( /*! ./type */ 1), each = __webpack_require__( /*! ./iterator */ 3).each, variableWrapper = __webpack_require__( /*! ./variable_wrapper */ 89), unwrapVariable = variableWrapper.unwrap, isWrapped = variableWrapper.isWrapped, 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, hasDefaultValue = "defaultValue" in options, 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 current, path, pathItem, last, i, value = this(obj, options); if (void 0 === value) { return } current = result || (result = {}); path = name.split("."); last = path.length - 1; for (i = 0; i < last; i++) { 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), 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; exports.bracketsToDots = bracketsToDots }, /*!*****************************************************!*\ !*** ./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 */ 132), 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', E1057: 'The {0} widget does not support asynchronous validation rules in the "{1}" edit mode', 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/events/click.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2), eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5), devices = __webpack_require__( /*! ../core/devices */ 16), domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 13), domUtils = __webpack_require__( /*! ../core/utils/dom */ 11), animationFrame = __webpack_require__( /*! ../animation/frame */ 113), eventUtils = __webpack_require__( /*! ./utils */ 8), pointerEvents = __webpack_require__( /*! ./pointer */ 23), Emitter = __webpack_require__( /*! ./core/emitter */ 126), registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 96), compareVersions = __webpack_require__( /*! ../core/utils/version */ 53).compare; var CLICK_EVENT_NAME = "dxclick", TOUCH_BOUNDARY = 10, abs = Math.abs; var isInput = function(element) { return $(element).is("input, textarea, select, button ,:focus, :focus *") }; var misc = { requestAnimationFrame: animationFrame.requestAnimationFrame, 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, targetChanged = !domUtils.contains(element, target) && element !== target, gestureDelta = eventUtils.eventDelta(eventUtils.eventData(e), this._startEventData), boundsExceeded = abs(gestureDelta.x) > TOUCH_BOUNDARY || abs(gestureDelta.y) > TOUCH_BOUNDARY; return targetChanged || boundsExceeded }, _fireClickEvent: function(e) { this._fireEvent(CLICK_EVENT_NAME, e, { target: domUtils.closestCommonParent(this._startTarget, e.target) }) }, dispose: function() { misc.cancelAnimationFrame(this._clickAnimationFrame) } }); ! function() { var NATIVE_CLICK_CLASS = "dx-native-click"; var realDevice = devices.real(), 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, lastFiredEvent = null; var clickHandler = function(e) { var originalEvent = e.originalEvent, eventAlreadyFired = lastFiredEvent === originalEvent || originalEvent && originalEvent.DXCLICK_FIRED, 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, blurPrevented = false; var pointerDownHandler = function(e) { startTarget = e.target; blurPrevented = e.isDefaultPrevented() }; var clickHandler = function(e) { var $target = $(e.target); if (!blurPrevented && startTarget && !$target.is(startTarget) && !$(startTarget).is("label") && isInput($target)) { domUtils.resetActiveElement() } startTarget = null; blurPrevented = false }; var NATIVE_CLICK_FIXER_NAMESPACE = "NATIVE_CLICK_FIXER", document = 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/errors.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var errorUtils = __webpack_require__( /*! ./utils/error */ 132); 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", E0103: "validationCallback of an asynchronous rule should return a jQuery or a native promise", 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), adjust = __webpack_require__( /*! ./math */ 30).adjust, each = __webpack_require__( /*! ./iterator */ 3).each, camelize = __webpack_require__( /*! ./inflector */ 33).camelize, isObject = typeUtils.isObject, isString = typeUtils.isString, isDate = typeUtils.isDate, 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(), millisecondCount = toMilliseconds(intervalUnit) || 1; return Math.floor(delta / millisecondCount) }; var getNextDateUnit = function(unit, withWeeks) { var interval = getDateUnitInterval(unit); switch (interval) { case "millisecond": return "second"; case "second": return "minute"; case "minute": return "hour"; case "hour": return "day"; case "day": return withWeeks ? "week" : "month"; case "week": return "month"; case "month": return "quarter"; case "quarter": return "year"; case "year": return "year"; default: return 0 } }; var convertMillisecondsToDateUnits = function(value) { var i, dateUnitCount, dateUnitInterval, dateUnitIntervals = ["millisecond", "second", "minute", "hour", "day", "month", "year"], result = {}; for (i = dateUnitIntervals.length - 1; i >= 0; i--) { dateUnitInterval = dateUnitIntervals[i]; dateUnitCount = Math.floor(value / toMilliseconds(dateUnitInterval)); if (dateUnitCount > 0) { result[dateUnitInterval + "s"] = dateUnitCount; value -= convertDateUnitToMilliseconds(dateUnitInterval, dateUnitCount) } } return result }; var dateToMilliseconds = function(tickInterval) { var milliseconds = 0; if (isObject(tickInterval)) { each(tickInterval, function(key, value) { milliseconds += convertDateUnitToMilliseconds(key.substr(0, key.length - 1), value) }) } if (isString(tickInterval)) { milliseconds = convertDateUnitToMilliseconds(tickInterval, 1) } return milliseconds }; var convertDateUnitToMilliseconds = function(dateUnit, count) { return toMilliseconds(dateUnit) * count }; var getDateUnitInterval = function(tickInterval) { var i, maxInterval = -1; if (isString(tickInterval)) { return tickInterval } if (isObject(tickInterval)) { each(tickInterval, function(key, value) { for (i = 0; i < dateUnitIntervals.length; i++) { if (value && (key === dateUnitIntervals[i] + "s" || key === dateUnitIntervals[i]) && maxInterval < i) { maxInterval = i } } }); return dateUnitIntervals[maxInterval] } return "" }; var tickIntervalToFormatMap = { millisecond: "millisecond", second: "longtime", minute: "shorttime", hour: "shorttime", day: "day", week: "day", month: "month", quarter: "quarter", year: "year" }; function getDateFormatByTickInterval(tickInterval) { return tickIntervalToFormatMap[getDateUnitInterval(tickInterval)] || "" } var getQuarter = function(month) { return Math.floor(month / 3) }; var getFirstQuarterMonth = function(month) { return 3 * getQuarter(month) }; var correctDateWithUnitBeginning = function(date, dateInterval, withCorrection, firstDayOfWeek) { date = new Date(date.getTime()); var firstQuarterMonth, month, oldDate = new Date(date.getTime()), 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": firstQuarterMonth = getFirstQuarterMonth(date.getMonth()); 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 differences, counter = 0; differences = { year: date1.getFullYear() !== date2.getFullYear(), month: date1.getMonth() !== date2.getMonth(), day: date1.getDate() !== date2.getDate(), hour: date1.getHours() !== date2.getHours(), minute: date1.getMinutes() !== date2.getMinutes(), second: date1.getSeconds() !== date2.getSeconds(), 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()), 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 cur, intervals = []; 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, startDecadeDate2 = date2.getFullYear() - date2.getFullYear() % 10; return date1 && date2 && startDecadeDate1 === startDecadeDate2 }; var sameCentury = function(date1, date2) { if (!isDefined(date1) || !isDefined(date2)) { return } var startCenturyDate1 = date1.getFullYear() - date1.getFullYear() % 100, startCenturyDate2 = date2.getFullYear() - date2.getFullYear() % 100; return date1 && date2 && startCenturyDate1 === startCenturyDate2 }; var getFirstDecadeInCentury = function(date) { return date && date.getFullYear() - date.getFullYear() % 100 }; var getFirstYearInDecade = function(date) { return date && date.getFullYear() - date.getFullYear() % 10 }; var getShortDateFormat = function() { return "yyyy/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"), 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), minutes = number % 1 * 60; return { hours: hours, minutes: minutes } }; var roundDateByStartDayHour = function(date, startDayHour) { var startTime = this.dateTimeFromDecimal(startDayHour), 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 sign, trial, diff = newDate.getHours() - oldDate.getHours(); if (0 === diff) { return } sign = 1 === diff || diff === -23 ? -1 : 1; 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 currentDate = new Date(startDate.getTime()), result = []; 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 */ 44); 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 */ 72); var _event_registrator2 = _interopRequireDefault(_event_registrator); var _touch = __webpack_require__( /*! ./pointer/touch */ 272); var _touch2 = _interopRequireDefault(_touch); var _mspointer = __webpack_require__( /*! ./pointer/mspointer */ 460); var _mspointer2 = _interopRequireDefault(_mspointer); var _mouse = __webpack_require__( /*! ./pointer/mouse */ 274); var _mouse2 = _interopRequireDefault(_mouse); var _mouse_and_touch = __webpack_require__( /*! ./pointer/mouse_and_touch */ 461); 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 */ 36); var _uiGrid_core2 = _interopRequireDefault(_uiGrid_core); var _uiGrid_core3 = __webpack_require__( /*! ../grid_core/ui.grid_core.modules */ 38); 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, windowUtils = __webpack_require__( /*! ./window */ 7), navigator = windowUtils.getNavigator(); var webkitRegExp = /(webkit)[ \/]([\w.]+)/, ieRegExp = /(msie) (\d{1,2}\.\d)/, ie11RegExp = /(trident).*rv:(\d{1,2}\.\d)/, msEdge = /(edge)\/((\d+)?[\w.]+)/, mozillaRegExp = /(mozilla)(?:.*? rv:([\w.]+))/; var browserFromUA = function(ua) { ua = ua.toLowerCase(); var result = {}, matches = ieRegExp.exec(ua) || ie11RegExp.exec(ua) || msEdge.exec(ua) || ua.indexOf("compatible") < 0 && mozillaRegExp.exec(ua) || webkitRegExp.exec(ua) || [], browserName = matches[1], browserVersion = matches[2]; if ("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/animation/translator.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var dataUtils = __webpack_require__( /*! ../core/element_data */ 40), type = __webpack_require__( /*! ../core/utils/type */ 1).type; var TRANSLATOR_DATA_KEY = "dxTranslator", TRANSFORM_MATRIX_REGEX = /matrix(3d)?\((.+?)\)/, 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 translate, left = position.left, top = position.top; if (void 0 === left) { translate = getTranslate($element); translate.y = top || 0 } else { if (void 0 === top) { translate = getTranslate($element); translate.x = left || 0 } else { translate = { x: left || 0, y: top || 0, z: 0 }; cacheTranslate($element, translate) } } $element.css({ transform: getTranslateCss(translate) }); if (isPercentValue(left) || isPercentValue(top)) { clearCache($element) } }; var isPercentValue = function(value) { return "string" === type(value) && "%" === value[value.length - 1] }; var 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 }), matrix = transformValue.match(TRANSFORM_MATRIX_REGEX), is3D = matrix && matrix[1]; if (matrix) { matrix = matrix[2].split(","); if ("3d" === is3D) { matrix = matrix.slice(12, 15) } else { matrix.push(0); matrix = matrix.slice(4, 7) } } else { matrix = [0, 0, 0] } result = { x: parseFloat(matrix[0]), y: parseFloat(matrix[1]), z: parseFloat(matrix[2]) }; cacheTranslate($element, result) } return result }; var cacheTranslate = function($element, translate) { if ($element.length) { 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, 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/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, list = this._list, stopOnFalse = this._options.stopOnFalse, 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, firingIndexes = this._firingIndexes, 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/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 */ 38); 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/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", label: "", position: { at: "right bottom", my: "right bottom", offset: { x: -16, y: -16 } }, maxSpeedDialActionCount: 5, shading: false, direction: "auto" }, 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 deprecatedFields = ["decimalSeparator", "thousandsSeparator"]; var configMethod = function() { if (!arguments.length) { return config } var newConfig = arguments.length <= 0 ? void 0 : arguments[0]; deprecatedFields.forEach(function(deprecatedField) { if (newConfig[deprecatedField]) { var message = "Now, the " + deprecatedField + " is selected based on the specified locale."; _errors2.default.log("W0003", "config", deprecatedField, "19.2", message) } }); _extend2.default.extend(config, newConfig) }; if ("undefined" !== typeof DevExpress && DevExpress.config) { configMethod(DevExpress.config) } module.exports = configMethod }, /*!*************************************************!*\ !*** ./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, 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, correctValue = "0.000300", precisionValue = 3; return correctValue !== value.toPrecision(precisionValue) } function adjust(value, interval) { var separatedAdjustedValue, precision = getPrecision(interval || 0) + 2, separatedValue = value.toString().split("."), sourceValue = value, absValue = Math.abs(value), isExponentValue = isExponential(value), 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) { 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 mantissa, positionOfDelimiter, str = value.toString(); if (str.indexOf(".") < 0) { return 0 } mantissa = str.split("."); 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/themes.js ***! \*******************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2), domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 13), windowUtils = __webpack_require__( /*! ../core/utils/window */ 7), window = windowUtils.getWindow(), Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred, errors = __webpack_require__( /*! ./widget/ui.errors */ 19), domUtils = __webpack_require__( /*! ../core/utils/dom */ 11), readyCallbacks = __webpack_require__( /*! ../core/utils/ready_callbacks */ 49), ready = readyCallbacks.add, each = __webpack_require__( /*! ../core/utils/iterator */ 3).each, devices = __webpack_require__( /*! ../core/devices */ 16), viewPortUtils = __webpack_require__( /*! ../core/utils/view_port */ 73), themeReadyCallback = __webpack_require__( /*! ./themes_callback */ 276), viewPort = viewPortUtils.value, Promise = __webpack_require__( /*! ../core/polyfills/promise */ 67), viewPortChanged = viewPortUtils.changeCallback; var DX_LINK_SELECTOR = "link[rel=dx-theme]", THEME_ATTR = "data-theme", ACTIVE_ATTR = "data-active", DX_HAIRLINES_CLASS = "dx-hairlines"; var context, $activeThemeLink, knownThemes, currentThemeName, pendingThemeName; var timerId; var THEME_MARKER_PREFIX = "dx."; function readThemeMarker() { if (!windowUtils.hasWindow()) { return null } var result, element = $("
", context).addClass("dx-theme-marker").appendTo(context.documentElement); 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(), 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), fullThemeName = link.attr(THEME_ATTR), url = link.attr("href"), isActive = "true" === link.attr(ACTIVE_ATTR); knownThemes[fullThemeName] = { url: url, isActive: isActive } }); $allThemeLinks.last().after($activeThemeLink); $allThemeLinks.remove() } function resolveFullThemeName(desiredThemeName) { var desiredThemeParts = desiredThemeName ? desiredThemeName.split(".") : [], result = null; if (knownThemes) { if (desiredThemeName in knownThemes) { return desiredThemeName } each(knownThemes, function(knownThemeName, themeData) { var knownThemeParts = knownThemeName.split("."); if (desiredThemeParts[0] && 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 currentThemeData, isAutoInit = options._autoInit, loadCallback = options.loadCallback; currentThemeName = resolveFullThemeName(options.theme || 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 getCssClasses(themeName) { themeName = themeName || current(); var result = [], themeNameParts = themeName && themeName.split("."); if (themeNameParts) { result.push("dx-theme-" + themeNameParts[0], "dx-theme-" + themeNameParts[0] + "-typography"); if (themeNameParts.length > 1) { result.push("dx-color-scheme-" + themeNameParts[1] + (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 isDark(themeName) { return isTheme("dark", 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.waitForThemeLoad = waitForThemeLoad; exports.isMaterial = isMaterial; exports.isIos7 = isIos7; exports.isGeneric = isGeneric; exports.isDark = isDark; exports.isWebFontLoaded = isWebFontLoaded; exports.waitWebFont = waitWebFont; exports.resetTheme = function() { $activeThemeLink && $activeThemeLink.attr("href", "about:blank"); currentThemeName = null; pendingThemeName = null } }, /*!***************************************************!*\ !*** ./artifacts/transpiled/localization/date.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _dependency_injector = __webpack_require__( /*! ../core/utils/dependency_injector */ 56); var _dependency_injector2 = _interopRequireDefault(_dependency_injector); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _iterator2 = _interopRequireDefault(_iterator); var _array = __webpack_require__( /*! ../core/utils/array */ 14); var _errors = __webpack_require__( /*! ../core/errors */ 21); var _errors2 = _interopRequireDefault(_errors); var _date = __webpack_require__( /*! ./ldml/date.formatter */ 263); var _date2 = __webpack_require__( /*! ./ldml/date.format */ 209); var _date3 = __webpack_require__( /*! ./ldml/date.parser */ 211); var _default_date_names = __webpack_require__( /*! ./default_date_names */ 264); var _default_date_names2 = _interopRequireDefault(_default_date_names); var _first_day_of_week_data = __webpack_require__( /*! ./cldr-data/first_day_of_week_data */ 445); var _first_day_of_week_data2 = _interopRequireDefault(_first_day_of_week_data); var _core = __webpack_require__( /*! ./core */ 80); var _number = __webpack_require__( /*! ./number */ 51); var _number2 = _interopRequireDefault(_number); var _date4 = __webpack_require__( /*! ./intl/date */ 446); var _date5 = _interopRequireDefault(_date4); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var DEFAULT_DAY_OF_WEEK_INDEX = 0; var hasIntl = "undefined" !== typeof Intl; 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 = (0, _dependency_injector2.default)({ engine: function() { return "base" }, _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 = []; _iterator2.default.each(pattern.split(/\W+/), function(_, formatPart) { _iterator2.default.each(possiblePartPatterns, function(partName, possiblePatterns) { if ((0, _array.inArray)(formatPart, possiblePatterns) > -1) { result.push(partName) } }) }); return result }, getMonthNames: function(format) { return _default_date_names2.default.getMonthNames(format) }, getDayNames: function(format) { return _default_date_names2.default.getDayNames(format) }, getQuarterNames: function(format) { return _default_date_names2.default.getQuarterNames(format) }, getPeriodNames: function(format) { return _default_date_names2.default.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 = void 0; if ("function" === typeof _format) { formatter = _format } else { if (_format.formatter) { formatter = _format.formatter } else { _format = _format.type || _format; if ((0, _type.isString)(_format)) { _format = FORMATS_TO_PATTERN_MAP[_format.toLowerCase()] || _format; return _number2.default.convertDigits((0, _date.getFormatter)(_format, this)(date)) } } } if (!formatter) { return } return formatter(date) }, parse: function(text, format) { var that = this; var result = void 0; var ldmlFormat = void 0; var formatter = void 0; 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 { formatter = function(value) { var text = that.format(value, format); return _number2.default.convertDigits(text, true) }; try { ldmlFormat = (0, _date2.getFormat)(formatter) } catch (e) {} } if (ldmlFormat) { text = _number2.default.convertDigits(text, true); return (0, _date3.getParser)(ldmlFormat, this)(text) } _errors2.default.log("W0012"); result = new Date(text); if (!result || isNaN(result.getTime())) { return } return result }, firstDayOfWeekIndex: function() { var index = (0, _core.getValueByClosestLocale)(function(locale) { return _first_day_of_week_data2.default[locale] }); return void 0 === index ? DEFAULT_DAY_OF_WEEK_INDEX : index } }); if (hasIntl) { dateLocalization.inject(_date5.default) } 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 i, char, captionList = [], isPrevCharNewWord = false, 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/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/ui/button.js ***! \*******************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _get = function get(object, property, receiver) { if (null === object) { object = Function.prototype } var desc = Object.getOwnPropertyDescriptor(object, property); if (void 0 === desc) { var parent = Object.getPrototypeOf(object); if (null === parent) { return } else { return get(parent, property, receiver) } } else { if ("value" in desc) { return desc.value } else { var getter = desc.get; if (void 0 === getter) { return } return getter.call(receiver) } } }; var _renderer = __webpack_require__( /*! ../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _devices = __webpack_require__( /*! ../core/devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _utils = __webpack_require__( /*! ./widget/utils.ink_ripple */ 70); var _utils2 = _interopRequireDefault(_utils); var _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _themes = __webpack_require__( /*! ./themes */ 31); var _themes2 = _interopRequireDefault(_themes); var _validation_engine = __webpack_require__( /*! ./validation_engine */ 87); var _validation_engine2 = _interopRequireDefault(_validation_engine); var _ui = __webpack_require__( /*! ./widget/ui.widget */ 17); var _ui2 = _interopRequireDefault(_ui); var _utils3 = __webpack_require__( /*! ../events/utils */ 8); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _function_template = __webpack_require__( /*! ../core/templates/function_template */ 99); var _icon = __webpack_require__( /*! ../core/utils/icon */ 54); var _dom = __webpack_require__( /*! ../core/utils/dom */ 11); var _click = __webpack_require__( /*! ../events/click */ 20); 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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && ("object" === typeof call || "function" === typeof call) ? call : self } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } } var Button = function(_Widget) { _inherits(Button, _Widget); function Button() { var _ref; _classCallCheck(this, Button); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key] } var _this = _possibleConstructorReturn(this, (_ref = Button.__proto__ || Object.getPrototypeOf(Button)).call.apply(_ref, [this].concat(args))); _this._feedbackHideTimeout = 100; return _this } _createClass(Button, [{ key: "_clean", value: function() { delete this._inkRipple; delete this._$content; _get(Button.prototype.__proto__ || Object.getPrototypeOf(Button.prototype), "_clean", this).call(this) } }, { key: "_defaultOptionsRules", value: function() { return _get(Button.prototype.__proto__ || Object.getPrototypeOf(Button.prototype), "_defaultOptionsRules", this).call(this).concat([{ device: function() { return "desktop" === _devices2.default.real().deviceType && !_devices2.default.isSimulator() }, options: { focusStateEnabled: true } }, { device: function() { return _themes2.default.isMaterial(_themes2.default.current()) }, options: { useInkRipple: true } }]) } }, { key: "_executeClickAction", value: function(event) { this._clickAction({ validationGroup: this._validationGroupConfig, event: event }) } }, { key: "_findGroup", value: function() { var $element = this.$element(); return this.option("validationGroup") || _validation_engine2.default.findGroup($element, this._modelByElement($element)) } }, { key: "_getAnonymousTemplateName", value: function() { return "content" } }, { key: "_getContentData", value: function() { var _option = this.option(), icon = _option.icon, text = _option.text, type = _option.type, _templateData = _option._templateData; return (0, _extend.extend)({ icon: "back" === type && !icon ? "back" : icon, text: text }, _templateData) } }, { key: "_getDefaultOptions", value: function() { return (0, _extend.extend)(_get(Button.prototype.__proto__ || Object.getPrototypeOf(Button.prototype), "_getDefaultOptions", this).call(this), { hoverStateEnabled: true, onClick: null, type: "normal", text: "", icon: "", iconPosition: "left", validationGroup: void 0, activeStateEnabled: true, template: "content", useSubmitBehavior: false, useInkRipple: false, _templateData: {}, stylingMode: "contained" }) } }, { key: "_getSubmitAction", value: function() { var _this2 = this; return this._createAction(function(_ref2) { var e = _ref2.event; if (_this2._needValidate) { var validationGroup = _this2._validationGroupConfig; if (validationGroup) { var _validationGroup$vali = validationGroup.validate(), status = _validationGroup$vali.status, complete = _validationGroup$vali.complete; _this2._validationStatus = status; if ("pending" === status) { _this2._needValidate = false; _this2._setDisabled(true); _this2._waitForValidationCompleting(complete) } } } else { _this2._needValidate = true } "valid" !== _this2._validationStatus && e.preventDefault(); e.stopPropagation() }) } }, { key: "_initMarkup", value: function() { this.$element().addClass("dx-button"); this._renderType(); this._renderStylingMode(); this.option("useInkRipple") && this._renderInkRipple(); this._renderClick(); this.setAria("role", "button"); this._updateAriaLabel(); _get(Button.prototype.__proto__ || Object.getPrototypeOf(Button.prototype), "_initMarkup", this).call(this); this._updateContent() } }, { key: "_initTemplates", value: function() { var _this3 = this; _get(Button.prototype.__proto__ || Object.getPrototypeOf(Button.prototype), "_initTemplates", this).call(this); this._defaultTemplates.content = new _function_template.FunctionTemplate(function(_ref3) { var _ref3$model = _ref3.model, model = void 0 === _ref3$model ? {} : _ref3$model, container = _ref3.container; var text = model.text, icon = model.icon; var $icon = (0, _icon.getImageContainer)(icon); var $textContainer = text && (0, _renderer2.default)("").text(text).addClass("dx-button-text"); var $container = (0, _renderer2.default)(container); $container.append($textContainer); if ("left" === _this3.option("iconPosition")) { $container.prepend($icon) } else { $icon.addClass("dx-icon-right"); $container.append($icon) } }) } }, { key: "_optionChanged", value: function(args) { var name = args.name, previousValue = args.previousValue; switch (name) { case "onClick": this._renderClick(); break; case "icon": case "text": this._updateContent(); this._updateAriaLabel(); break; case "type": this._refreshType(previousValue); this._updateContent(); this._updateAriaLabel(); break; case "_templateData": break; case "template": case "iconPosition": this._updateContent(); break; case "stylingMode": this._renderStylingMode(); break; case "useInkRipple": case "useSubmitBehavior": this._invalidate(); break; default: _get(Button.prototype.__proto__ || Object.getPrototypeOf(Button.prototype), "_optionChanged", this).call(this, args) } } }, { key: "_refreshType", value: function(prevType) { var type = this.option("type"); var $element = this.$element(); prevType && $element.removeClass("dx-button-" + prevType).addClass("dx-button-" + type); if (!$element.hasClass("dx-button-has-icon") && "back" === type) { this._updateContent() } } }, { key: "_renderClick", value: function() { var actionConfig = { excludeValidators: ["readOnly"] }; if (this.option("useSubmitBehavior")) { actionConfig.afterExecute = function(_ref4) { var component = _ref4.component; return setTimeout(function() { return component._$submitInput.get(0).click() }) } } this._clickAction = this._createActionByOption("onClick", actionConfig); var $element = this.$element(); var eventName = (0, _utils3.addNamespace)(_click.name, this.NAME); _events_engine2.default.off($element, eventName); _events_engine2.default.on($element, eventName, this._executeClickAction.bind(this)) } }, { key: "_renderInkRipple", value: function() { var _option2 = this.option(), text = _option2.text, icon = _option2.icon, type = _option2.type; var isOnlyIconButton = !text && icon || "back" === type; var config = {}; if (isOnlyIconButton) { (0, _extend.extend)(config, { waveSizeCoefficient: 1, useHoldAnimation: false, isCentered: true }) } this._inkRipple = _utils2.default.render(config) } }, { key: "_renderStylingMode", value: function() { var $element = this.$element(); var stylingMode = this.option("stylingMode"); var stylingModeClass = "dx-button-mode-" + stylingMode; ["dx-button-mode-contained", "dx-button-mode-text", "dx-button-mode-outlined"].forEach($element.removeClass.bind($element)); if (["contained", "text", "outlined"].indexOf(stylingMode) === -1) { var defaultOptionValue = this._getDefaultOptions().stylingMode; stylingModeClass = "dx-button-mode-" + defaultOptionValue } $element.addClass(stylingModeClass) } }, { key: "_renderSubmitInput", value: function() { var submitAction = this._getSubmitAction(); this._needValidate = true; this._validationStatus = "valid"; this._$submitInput = (0, _renderer2.default)("").attr("type", "submit").attr("tabindex", -1).addClass("dx-button-submit-input").appendTo(this._$content); _events_engine2.default.on(this._$submitInput, "click", function(e) { return submitAction({ event: e }) }) } }, { key: "_renderType", value: function() { var type = this.option("type"); type && this.$element().addClass("dx-button-" + type) } }, { key: "_setDisabled", value: function(value) { this.option("disabled", value) } }, { key: "_supportedKeys", value: function() { var _this4 = this; var click = function(e) { e.preventDefault(); _this4._executeClickAction(e) }; return (0, _extend.extend)(_get(Button.prototype.__proto__ || Object.getPrototypeOf(Button.prototype), "_supportedKeys", this).call(this), { space: click, enter: click }) } }, { key: "_toggleActiveState", value: function($el, value, event) { _get(Button.prototype.__proto__ || Object.getPrototypeOf(Button.prototype), "_toggleActiveState", this).call(this, $el, value, event); if (this._inkRipple) { var config = { element: this._$content, event: event }; value ? this._inkRipple.showWave(config) : this._inkRipple.hideWave(config) } } }, { key: "_updateAriaLabel", value: function() { var _option3 = this.option(), icon = _option3.icon, text = _option3.text; if ("image" === (0, _icon.getImageSourceType)(icon)) { icon = icon.indexOf("base64") === -1 ? icon.replace(/.+\/([^.]+)\..+$/, "$1") : "Base64" } var ariaLabel = text || icon || ""; ariaLabel = ariaLabel.toString().trim(); this.setAria("label", ariaLabel.length ? ariaLabel : null) } }, { key: "_updateContent", value: function() { var $element = this.$element(); var data = this._getContentData(); var icon = data.icon, text = data.text; this._$content ? this._$content.empty() : this._$content = (0, _renderer2.default)("
").addClass("dx-button-content").appendTo($element); $element.toggleClass("dx-button-has-icon", !!icon).toggleClass("dx-button-icon-right", !!icon && "left" !== this.option("iconPosition")).toggleClass("dx-button-has-text", !!text); var transclude = this._getAnonymousTemplateName() === this.option("template"); var template = this._getTemplateByOption("template"); var $result = (0, _renderer2.default)(template.render({ model: data, container: (0, _dom.getPublicElement)(this._$content), transclude: transclude })); if ($result.hasClass("dx-template-wrapper")) { this._$content.replaceWith($result); this._$content = $result; this._$content.addClass("dx-button-content") } this.option("useSubmitBehavior") && this._renderSubmitInput() } }, { key: "_waitForValidationCompleting", value: function(complete) { var _this5 = this; complete.then(function(result) { _this5._validationStatus = result.status; _this5._setDisabled(false); "valid" === _this5._validationStatus && _this5._$submitInput.get(0).click(); return result }) } }, { key: "_validationGroupConfig", get: function() { return _validation_engine2.default.getGroupConfig(this._findGroup()) } }]); return Button }(_ui2.default); (0, _component_registrator2.default)("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 _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); var _filtering = __webpack_require__( /*! ../shared/filtering */ 166); var _string = __webpack_require__( /*! ../../core/utils/string */ 45); var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _data = __webpack_require__( /*! ../../core/utils/data */ 18); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _load_panel = __webpack_require__( /*! ../load_panel */ 163); var _load_panel2 = _interopRequireDefault(_load_panel); var _utils = __webpack_require__( /*! ../../data/utils */ 41); var _format_helper = __webpack_require__( /*! ../../format_helper */ 63); 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", DATAGRID_GROUP_OPENED_CLASS = "dx-datagrid-group-opened", DATAGRID_GROUP_CLOSED_CLASS = "dx-datagrid-group-closed", DATAGRID_EXPAND_CLASS = "dx-datagrid-expand", NO_DATA_CLASS = "nodata", 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 groupInterval, nameIntervalSelector, data = arguments[1], value = this.calculateCellValue(data); if (!(0, _type.isDefined)(value)) { return null } else { if (isDateType(this.dataType)) { nameIntervalSelector = arguments[0]; return DATE_INTERVAL_SELECTORS[nameIntervalSelector](value) } else { if ("number" === this.dataType) { groupInterval = arguments[0]; return Math.floor(Number(value) / groupInterval) * groupInterval } } } }; var equalSelectors = function(selector1, selector2) { if ((0, _type.isFunction)(selector1) && (0, _type.isFunction)(selector2)) { if (selector1.originalCallback && selector2.originalCallback) { return selector1.originalCallback === selector2.originalCallback } } 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(), dxComponents = editorData && editorData.dxComponents, 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), noDataElement = $element.find("." + noDataClass).last(), isVisible = this._dataController.isEmpty(), 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 loadPanelOptions, that = this; 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 item, index = -1; if (void 0 !== key && Array.isArray(items)) { keyName = arguments.length <= 2 ? "key" : keyName; for (var i = 0; i < items.length; i++) { 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 i, resultFilter = []; operation = operation || "and"; for (i = 0; i < filters.length; i++) { if (!filters[i]) { continue } if (resultFilter.length) { resultFilter.push(operation) } resultFilter.push(filters[i]) } if (1 === resultFilter.length) { resultFilter = resultFilter[0] } if (resultFilter.length) { return resultFilter } }, checkChanges: function(changes, changeNames) { var i, changesWithChangeNamesCount = 0; for (i = 0; i < changeNames.length; i++) { if (changes[changeNames[i]]) { changesWithChangeNamesCount++ } } return changes.length && changes.length === changesWithChangeNamesCount }, equalFilterParameters: function(filter1, filter2) { var i; if (Array.isArray(filter1) && Array.isArray(filter2)) { if (filter1.length !== filter2.length) { return false } else { for (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() || "", 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 i, summaryItem, result = "("; for (i = 0; i < summaryItems.length; i++) { 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, i; result = (0, _utils.normalizeSortingInfo)(sort); for (i = 0; i < sort.length; i++) { if (sort && sort[i] && void 0 !== sort[i].isExpanded) { result[i].isExpanded = sort[i].isExpanded } if (sort && sort[i] && void 0 !== sort[i].groupInterval) { result[i].groupInterval = sort[i].groupInterval } } return result }, getFormatByDataType: function(dataType) { switch (dataType) { case "date": return "shortDate"; case "datetime": return "shortDateShortTime" } }, getHeaderFilterGroupParameters: function(column, remoteGrouping) { var result = [], dataField = column.dataField || column.name, 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) { var i; 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 (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 point, i, item, offset, prevItemOffset, rtlEnabled, cellsLength = items.length, notCreatePoint = false, columnIndex = startColumnIndex || 0, result = []; for (i = 0; i <= cellsLength; i++) { if (i < cellsLength) { item = items.eq(i); offset = item.offset(); rtlEnabled = "rtl" === item.css("direction") } point = { index: columnIndex, x: offset ? offset.left + (!isVertical && rtlEnabled ^ i === cellsLength ? item[0].getBoundingClientRect().width : 0) : 0, y: offset ? offset.top + (isVertical && i === cellsLength ? item[0].getBoundingClientRect().height : 0) : 0, columnIndex: columnIndex }; if (!isVertical && i > 0) { prevItemOffset = items.eq(i - 1).offset(); if (prevItemOffset.top < point.y) { point.y = prevItemOffset.top } } if (pointCreated) { notCreatePoint = pointCreated(point) } if (!notCreatePoint) { result.push(point) } columnIndex++ } return result }, createObjectWithChanges: function(target, changes) { var result = target ? Object.create(Object.getPrototypeOf(target)) : {}, 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 rowsView, $container = (0, _renderer2.default)(container); if ((0, _type.isDefined)(options.value) && !(options.data && options.data.isContinuation) && !options.row.isNewRow) { 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"), keyboardController = component.getController("keyboardNavigation"), 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], width = resultWidths && resultWidths[lastColumnIndex], 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 */ 132), coreErrors = __webpack_require__( /*! ../core/errors */ 21), 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 */ 27); 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 */ 19); var _ui2 = _interopRequireDefault(_ui); var _message = __webpack_require__( /*! ../../localization/message */ 10); 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, 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), 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) { var action; if ((0, _type.isFunction)(actionName)) { 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, marginBottom = parseFloat($element.css("marginBottom")) || 0, 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, 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, modulesOrder = componentClass.modulesOrder, controllerTypes = componentClass.controllerTypes || {}, 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, moduleName = this.name, 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 i, modules = this.modules; for (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__) { var _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 }; var $ = __webpack_require__( /*! ../core/renderer */ 2), window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow(), eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5), errors = __webpack_require__( /*! ../core/errors */ 21), getPublicElement = __webpack_require__( /*! ../core/utils/dom */ 11).getPublicElement, extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, typeUtils = __webpack_require__( /*! ../core/utils/type */ 1), iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3), translator = __webpack_require__( /*! ./translator */ 26), easing = __webpack_require__( /*! ./easing */ 271), animationFrame = __webpack_require__( /*! ./frame */ 113), support = __webpack_require__( /*! ../core/utils/support */ 44), positionUtils = __webpack_require__( /*! ./position */ 78), removeEvent = __webpack_require__( /*! ../core/remove_event */ 136), eventUtils = __webpack_require__( /*! ../events/utils */ 8), deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6), when = deferredUtils.when, Deferred = deferredUtils.Deferred, removeEventName = eventUtils.addNamespace(removeEvent, "dxFX"), isFunction = typeUtils.isFunction, isPlainObject = typeUtils.isPlainObject, noop = __webpack_require__( /*! ../core/utils/common */ 4).noop; var RELATIVE_VALUE_REGEX = /^([+-])=(.*)/i, ANIM_DATA_KEY = "dxAnimData", ANIM_QUEUE_KEY = "dxAnimQueue", TRANSFORM_PROP = "transform"; var TransitionAnimationStrategy = { initAnimation: function($element, config) { $element.css({ transitionProperty: "none" }); if ("string" === typeof config.from) { $element.addClass(config.from) } else { setProps($element, config.from) } var that = this, deferred = new Deferred, 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 simulatedEndEventTimer, waitForJSCompleteTimer, that = this, startTime = Date.now() + config.delay, deferred = new Deferred, transitionEndFired = new Deferred, simulatedTransitionEndFired = new Deferred, 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() }); 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, 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)+\([^)]*\)\s*/g), function(i, part) { var translateData = translator.parseTranslate(part), scaleData = part.match(/scale\((.+?)\)/), rotateData = part.match(/(rotate.)\((.+)deg\)/); if (translateData) { result.translate = translateData } if (scaleData && scaleData[1]) { result.scale = parseFloat(scaleData[1]) } if (rotateData && rotateData[1]) { result[rotateData[1]] = parseFloat(rotateData[2]) } }); return result }, stop: function($element, config, jumpToEnd) { var frameAnimation = config && config.frameAnimation; if (!frameAnimation) { return } animationFrame.cancelAnimationFrame(frameAnimation.animationFrameId); clearTimeout(frameAnimation.delayTimeout); if (jumpToEnd) { frameAnimation.finish() } delete config.frameAnimation }, _animationStep: function($element, config) { var frameAnimation = config && config.frameAnimation; if (!frameAnimation) { return } var now = (new Date).valueOf(); if (now >= frameAnimation.startTime + frameAnimation.duration) { frameAnimation.finish(); return } frameAnimation.currentValue = this._calcStepValue(frameAnimation, now - frameAnimation.startTime); frameAnimation.draw(); var that = this; frameAnimation.animationFrameId = animationFrame.requestAnimationFrame(function() { that._animationStep($element, config) }) }, _calcStepValue: function(frameAnimation, currentDuration) { var calcValueRecursively = function calcValueRecursively(from, to) { var result = Array.isArray(to) ? [] : {}; var calcEasedValue = function(propName) { var x = currentDuration / frameAnimation.duration, t = currentDuration, b = 1 * from[propName], c = to[propName] - from[propName], d = frameAnimation.duration; return easing.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" === ("undefined" === typeof endPropValue ? "undefined" : _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 toOpacity, from = config.from, fromOpacity = isPlainObject(from) ? config.skipElementInitialStyles ? 0 : $element.css("opacity") : String(from); switch (config.type) { case "fadeIn": toOpacity = 1; break; case "fadeOut": toOpacity = 0; break; default: toOpacity = String(config.to) } config.from = { visibility: "visible", opacity: fromOpacity }; config.to = { opacity: toOpacity } } }; var PopAnimationConfigurator = { validateConfig: function(config) { isObjectConfigValidator(config, "pop") }, setup: function($element, config) { var from = config.from, to = config.to, fromOpacity = "opacity" in from ? from.opacity : $element.css("opacity"), toOpacity = "opacity" in to ? to.opacity : 1, fromScale = "scale" in from ? from.scale : 0, toScale = "scale" in to ? to.scale : 1; config.from = { opacity: fromOpacity }; var translate = translator.getTranslate($element); config.from[TRANSFORM_PROP] = this._getCssTransform(translate, fromScale); config.to = { opacity: toOpacity }; config.to[TRANSFORM_PROP] = this._getCssTransform(translate, toScale) }, _getCssTransform: function(translate, scale) { return translator.getTranslateCss(translate) + "scale(" + scale + ")" } }; var animationConfigurators = { custom: CustomAnimationConfigurator, slide: SlideAnimationConfigurator, slideIn: SlideAnimationConfigurator, slideOut: SlideAnimationConfigurator, fade: FadeAnimationConfigurator, fadeIn: FadeAnimationConfigurator, fadeOut: FadeAnimationConfigurator, pop: PopAnimationConfigurator, css: CssAnimationConfigurator }; var getAnimationConfigurator = function(config) { var result = animationConfigurators[config.type]; if (!result) { throw errors.Error("E0011", config.type) } return result }; var defaultJSConfig = { type: "custom", from: {}, to: {}, duration: 400, start: noop, complete: noop, easing: "ease", delay: 0 }, defaultCssConfig = { duration: 400, easing: "ease", delay: 0 }; var setupAnimationOnElement = function() { var animation = this, $element = animation.element, config = animation.config; setupPosition($element, config.from); setupPosition($element, config.to); animation.configurator.setup($element, config); $element.data(ANIM_DATA_KEY, animation); if (fx.off) { config.duration = 0; config.delay = 0 } animation.strategy.initAnimation($element, config); if (config.start) { var element = getPublicElement($element); config.start.apply(this, [element, config]) } }; var onElementAnimationComplete = function(animation) { var $element = animation.element, config = animation.config; $element.removeData(ANIM_DATA_KEY); if (config.complete) { var element = getPublicElement($element); config.complete.apply(this, [element, config]) } animation.deferred.resolveWith(this, [$element, config]) }; var startAnimationOnElement = function() { var animation = this, $element = animation.element, config = animation.config; animation.isStarted = true; return animation.strategy.animate($element, config).done(function() { onElementAnimationComplete(animation) }).fail(function() { animation.deferred.rejectWith(this, [$element, config]) }) }; var stopAnimationOnElement = function(jumpToEnd) { var animation = this, $element = animation.element, config = animation.config; clearTimeout(animation.startTimeout); if (!animation.isStarted) { animation.start() } animation.strategy.stop($element, config, jumpToEnd) }; var 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, config = extend(true, {}, defaultConfig, initialConfig), configurator = getAnimationConfigurator(config), strategy = getAnimationStrategy(config), animation = { element: $(element), config: config, configurator: configurator, strategy: strategy, isSynchronous: strategy.isSynchronous, setup: setupAnimationOnElement, start: startAnimationOnElement, stop: stopAnimationOnElement, deferred: 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), left = 0, top = 0, position = positionUtils.calculate($element, config.position), offset = $element.offset(), 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), 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 */ 179); var domAdapter = __webpack_require__( /*! ./dom_adapter */ 13); var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var MemorizedCallbacks = __webpack_require__( /*! ./memorized_callbacks */ 180); 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/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 */ 13); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); var _ready_callbacks = __webpack_require__( /*! ../core/utils/ready_callbacks */ 49); var _window = __webpack_require__( /*! ../core/utils/window */ 7); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _data = __webpack_require__( /*! ../core/utils/data */ 18); var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i] } return arr2 } else { return Array.from(arr) } } 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 lockDeferred, lockCount = 0; 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 name, names = (0, _iterator.map)(key1, function(v, k) { return k }); 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], octet2 = input[i + 1], 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 code, i, bytes = []; for (i = 0; i < str.length; i++) { code = str.charCodeAt(i); if (code < 128) { bytes.push(code) } else { if (code < 2048) { bytes.push(192 + (code >> 6), 128 + (63 & code)) } else { if (code < 65536) { bytes.push(224 + (code >> 12), 128 + (code >> 6 & 63), 128 + (63 & code)) } else { if (code < 2097152) { bytes.push(240 + (code >> 18), 128 + (code >> 12 & 63), 128 + (code >> 6 & 63), 128 + (63 & code)) } } } } } return bytes }; var 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], 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, 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 = [], 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 */ 156), remoteQueryImpl = __webpack_require__( /*! ./remote_query */ 482); 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/ui/popup.js ***! \******************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2), window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow(), translator = __webpack_require__( /*! ../animation/translator */ 26), camelize = __webpack_require__( /*! ../core/utils/inflector */ 33).camelize, noop = __webpack_require__( /*! ../core/utils/common */ 4).noop, getPublicElement = __webpack_require__( /*! ../core/utils/dom */ 11).getPublicElement, each = __webpack_require__( /*! ../core/utils/iterator */ 3).each, isDefined = __webpack_require__( /*! ../core/utils/type */ 1).isDefined, inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray, extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, browser = __webpack_require__( /*! ../core/utils/browser */ 25), compareVersions = __webpack_require__( /*! ../core/utils/version */ 53).compare, messageLocalization = __webpack_require__( /*! ../localization/message */ 10), devices = __webpack_require__( /*! ../core/devices */ 16), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9), Button = __webpack_require__( /*! ./button */ 35), themes = __webpack_require__( /*! ./themes */ 31), Overlay = __webpack_require__( /*! ./overlay */ 59), EmptyTemplate = __webpack_require__( /*! ../core/templates/empty_template */ 97).EmptyTemplate, domUtils = __webpack_require__( /*! ../core/utils/dom */ 11), sizeUtils = __webpack_require__( /*! ../core/utils/size */ 176), windowUtils = __webpack_require__( /*! ../core/utils/window */ 7); __webpack_require__( /*! ./toolbar/ui.toolbar.base */ 296); var POPUP_CLASS = "dx-popup", POPUP_WRAPPER_CLASS = "dx-popup-wrapper", POPUP_FULL_SCREEN_CLASS = "dx-popup-fullscreen", POPUP_FULL_SCREEN_WIDTH_CLASS = "dx-popup-fullscreen-width", POPUP_NORMAL_CLASS = "dx-popup-normal", POPUP_CONTENT_CLASS = "dx-popup-content", POPUP_DRAGGABLE_CLASS = "dx-popup-draggable", POPUP_TITLE_CLASS = "dx-popup-title", POPUP_TITLE_CLOSEBUTTON_CLASS = "dx-closebutton", POPUP_BOTTOM_CLASS = "dx-popup-bottom", TEMPLATE_WRAPPER_CLASS = "dx-template-wrapper", POPUP_CONTENT_FLEX_HEIGHT_CLASS = "dx-popup-flex-height", POPUP_CONTENT_INHERIT_HEIGHT_CLASS = "dx-popup-inherit-height", ALLOWED_TOOLBAR_ITEM_ALIASES = ["cancel", "clear", "done"], BUTTON_DEFAULT_TYPE = "default", BUTTON_NORMAL_TYPE = "normal", BUTTON_TEXT_MODE = "text", 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(), platform = device.platform, toolbar = "bottom", location = "before"; if ("ios" === platform) { switch (name) { case "cancel": toolbar = "top"; break; case "clear": toolbar = "top"; location = "after"; break; case "done": location = "after" } } else { if ("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 "desktop" === devices.real().deviceType && "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 } } }, 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._defaultTemplates.bottom = new EmptyTemplate }, _renderContentImpl: function() { this._renderTitle(); this.callBase(); this._renderBottom() }, _renderTitle: function() { var items = this._getToolbarItems("top"), titleText = this.option("title"), showTitle = this.option("showTitle"); if (showTitle && !!titleText) { items.unshift({ location: devices.current().ios ? "center" : "before", text: titleText }) } if (showTitle || items.length > 0) { this._$title && this._$title.remove(); var $title = $("
").addClass(POPUP_TITLE_CLASS).insertBefore(this.$content()); this._$title = this._renderTemplateByType("titleTemplate", items, $title).addClass(POPUP_TITLE_CLASS); this._renderDrag(); this._executeTitleRenderAction(this._$title) } else { if (this._$title) { this._$title.detach() } } }, _renderTemplateByType: function(optionName, data, $container, additionalToolbarOptions) { var template = this._getTemplateByOption(optionName), toolbarTemplate = template instanceof EmptyTemplate; if (toolbarTemplate) { var toolbarOptions = extend(additionalToolbarOptions, { items: data, rtlEnabled: this.option("rtlEnabled"), useDefaultButtons: this.option("useDefaultToolbarButtons"), useFlatButtons: this.option("useFlatToolbarButtons") }); 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, index = 0; each(toolbarItems, function(_, data) { var isShortcut = isDefined(data.shortcut), 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 = "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, 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)) }, _getContainer: function() { if (this.option("fullScreen")) { return $(window) } return this.callBase() }, _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" }) }, _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), 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, 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 = {}, contentMaxHeight = this._getOptionValue("maxHeight", overlayContent), contentMinHeight = this._getOptionValue("minHeight", overlayContent), popupHeightParts = this._splitPopupHeight(), 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 contentHeight = overlayContent.getBoundingClientRect().height - toolbarsAndVerticalOffsetsHeight; cssStyles = { height: Math.max(0, contentHeight), minHeight: "auto", maxHeight: "auto" } } } else { var container = $(this._getContainer()).get(0), maxHeightValue = sizeUtils.addOffsetToMaxHeight(contentMaxHeight, -toolbarsAndVerticalOffsetsHeight, container), 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(), 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()) }, 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/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 */ 13); var _common = __webpack_require__( /*! ./common */ 4); var _call_once = __webpack_require__( /*! ./call_once */ 61); 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 */ 88); 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"]) > -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__) { var _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 }; 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 ("undefined" === typeof raw ? "undefined" : _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), left = parseInt(quad && quad[0], 10), top = parseInt(quad && quad[1], 10), right = parseInt(quad && quad[2], 10), bottom = parseInt(quad && quad[3], 10); if (!isFinite(left)) { left = 0 } if (!isFinite(top)) { top = left } if (!isFinite(right)) { right = left } if (!isFinite(bottom)) { bottom = top } return { top: top, right: right, bottom: bottom, left: left } }; var stringFormat = function() { var replaceDollarCount, reg, value, s = arguments[0], values = [].slice.call(arguments).slice(1); 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), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4), iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3), ajax = __webpack_require__( /*! ../../core/utils/ajax */ 62), typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), dataUtils = __webpack_require__( /*! ../utils */ 41), arrayUtils = __webpack_require__( /*! ../array_utils */ 138), Store = __webpack_require__( /*! ../abstract_store */ 101), ArrayStore = __webpack_require__( /*! ../array_store */ 69), CustomStore = __webpack_require__( /*! ../custom_store */ 151), EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 85), errors = __webpack_require__( /*! ../errors */ 37).errors, array = __webpack_require__( /*! ../../core/utils/array */ 14), queue = __webpack_require__( /*! ../../core/utils/queue */ 270), deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6), when = deferredUtils.when, Deferred = deferredUtils.Deferred, __isString = typeUtils.isString, __isNumber = typeUtils.isNumeric, __isBoolean = typeUtils.isBoolean, __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 = {}, names = ["sort", "filter", "select", "group", "requireTotalCount"], 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 newLoading, oldLoading = this.isLoading(); this._loadingCount += increment; 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, key = this.key(), store = this._store, options = this._createStoreLoadOptions(), handleDone = function(data) { if (!__isDefined(data) || array.isEmpty(data)) { d.reject(new errors.Error("E4009")) } else { 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 loadOperation, that = this, 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); 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(), items = this.items(), groupLevel = 0, 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), 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, op = this._searchOperation, selector = this._searchExpr, 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, data = loadResult.data, extra = loadResult.extra, storeLoadOptions = loadResult.storeLoadOptions; function resolvePendingDeferred() { that._isLoaded = true; that._totalCount = isFinite(extra.totalCount) ? extra.totalCount : -1; return pendingDeferred.resolve(data, extra) } function proceedLoadingTotalCount() { that.store().totalCount(storeLoadOptions).done(function(count) { extra.totalCount = count; resolvePendingDeferred() }).fail(pendingDeferred.reject) } if (that._disposed) { return } data = that._applyPostProcessFunction(that._applyMapFunction(data)); if (!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/core/utils/object.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var typeUtils = __webpack_require__( /*! ./type */ 1), variableWrapper = __webpack_require__( /*! ./variable_wrapper */ 89); var clone = function() { function Clone() {} return function(obj) { Clone.prototype = obj; return new Clone } }(); var orderEach = function(map, func) { var key, i, keys = []; for (key in map) { if (Object.prototype.hasOwnProperty.call(map, key)) { keys.push(key) } } keys.sort(function(x, y) { var isNumberX = typeUtils.isNumeric(x), 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, 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/ui/editor/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 _element_data = __webpack_require__( /*! ../../core/element_data */ 40); var _element_data2 = _interopRequireDefault(_element_data); var _callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 27); var _callbacks2 = _interopRequireDefault(_callbacks); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _common2 = _interopRequireDefault(_common); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); var _window2 = _interopRequireDefault(_window); var _utils = __webpack_require__( /*! ../../events/utils */ 8); var _position = __webpack_require__( /*! ../../core/utils/position */ 100); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _guid = __webpack_require__( /*! ../../core/guid */ 34); var _guid2 = _interopRequireDefault(_guid); var _ui = __webpack_require__( /*! ../widget/ui.widget */ 17); var _ui2 = _interopRequireDefault(_ui); var _overlay = __webpack_require__( /*! ../overlay */ 59); var _overlay2 = _interopRequireDefault(_overlay); var _validation_engine = __webpack_require__( /*! ../validation_engine */ 87); var _validation_engine2 = _interopRequireDefault(_validation_engine); 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 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 DX_INVALID_BADGE_CLASS = "dx-show-invalid-badge"; var VALIDATION_TARGET = "dx-validation-target"; var VALIDATION_MESSAGE_MIN_WIDTH = 100; var VALIDATION_STATUS_VALID = "valid"; var VALIDATION_STATUS_INVALID = "invalid"; var READONLY_NAMESPACE = "editorReadOnly"; var getValidationErrorMessage = function(validationErrors) { var validationErrorMessage = ""; if (validationErrors) { validationErrors.forEach(function(err) { if (err.message) { validationErrorMessage += (validationErrorMessage ? "
" : "") + err.message } }) } return validationErrorMessage }; var Editor = _ui2.default.inherit({ ctor: function() { this.showValidationMessageTimeout = null; this.validationRequest = (0, _callbacks2.default)(); this.callBase.apply(this, arguments); var $element = this.$element(); if ($element) { _element_data2.default.data($element[0], VALIDATION_TARGET, this) } }, _initOptions: function(options) { this.callBase.apply(this, arguments); this.option(_validation_engine2.default.initValidationOptions(options)) }, _init: function() { this.callBase(); this._initInnerOptionCache("validationTooltipOptions"); var $element = this.$element(); $element.addClass(DX_INVALID_BADGE_CLASS) }, _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { value: null, name: "", onValueChanged: null, readOnly: false, isValid: true, validationError: null, validationErrors: null, validationStatus: VALIDATION_STATUS_VALID, 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: _common2.default.noop, _setOptionsByReference: function() { this.callBase(); (0, _extend.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") && this.option("validationStatus") !== VALIDATION_STATUS_INVALID; var validationMessageMode = this.option("validationMessageMode"); var $element = this.$element(); var validationErrors = this.option("validationErrors"); if (!validationErrors && this.option("validationError")) { validationErrors = [this.option("validationError")] } $element.toggleClass(INVALID_CLASS, !isValid); this.setAria(VALIDATION_STATUS_INVALID, !isValid || void 0); if (!_window2.default.hasWindow()) { return } if (this._$validationMessage) { this._$validationMessage.remove(); this.setAria("describedby", null); this._$validationMessage = null } var validationErrorMessage = getValidationErrorMessage(validationErrors); if (!isValid && validationErrorMessage) { this._$validationMessage = (0, _renderer2.default)("
").addClass(INVALID_MESSAGE).html(validationErrorMessage).appendTo($element); var validationTarget = this._getValidationMessageTarget(); this._validationMessage = this._createComponent(this._$validationMessage, _overlay2.default, (0, _extend.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 _guid2.default; 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 = (0, _position.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 = (0, _utils.addNamespace)("keydown", READONLY_NAMESPACE); _events_engine2.default.off($eventTarget, eventName); if (isReadOnly) { _events_engine2.default.on($eventTarget, eventName, function(e) { if ("backspace" === (0, _utils.normalizeKeyName)(e)) { e.preventDefault() } }) } }, _dispose: function() { var element = this.$element()[0]; _element_data2.default.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": this.option(_validation_engine2.default.synchronizeValidationOptions(args, this.option())); break; case "validationErrors": case "validationStatus": this.option(_validation_engine2.default.synchronizeValidationOptions(args, this.option())); this._renderValidationState(); break; 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 (!this._valueChangeActionSuppressed) { this._raiseValueChangeAction(args.value, args.previousValue); this._saveValueChangeEvent(void 0) } if (args.value != args.previousValue) { this.validationRequest.fire({ value: args.value, editor: this }) } break; case "width": this.callBase(args); this._setValidationMessageMaxWidth(); break; case "name": this._setSubmitElementName(args.value); break; default: this.callBase(args) } }, reset: function() { var defaultOptions = this._getDefaultOptions(); this.option("value", defaultOptions.value) } }); module.exports = Editor }, /*!************************************************************!*\ !*** ./artifacts/transpiled/core/utils/ready_callbacks.js ***! \************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var domAdapter = __webpack_require__( /*! ../dom_adapter */ 13); var injector = __webpack_require__( /*! ./dependency_injector */ 56); var windowUtils = __webpack_require__( /*! ./window */ 7); var callOnce = __webpack_require__( /*! ./call_once */ 61); 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/viz/themes.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var defaultTheme, extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, each = __webpack_require__( /*! ../core/utils/iterator */ 3).each, vizUtils = __webpack_require__( /*! ./core/utils */ 12), uiThemes = __webpack_require__( /*! ../ui/themes */ 31), themes = {}, themesMapping = {}, themesSchemeMapping = {}, _extend = extend, _each = each, _normalizeEnum = vizUtils.normalizeEnum, currentThemeName = null, nextCacheUid = 0, 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 }, name = themeInfo.name, 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"], 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__) { var _slicedToArray = function() { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = void 0; try { for (var _s, _i = arr[Symbol.iterator](); !(_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 && _i.return) { _i.return() } } finally { if (_d) { throw _e } } } return _arr } return function(arr, i) { if (Array.isArray(arr)) { return arr } else { if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i) } else { throw new TypeError("Invalid attempt to destructure non-iterable instance") } } } }(); var _dependency_injector = __webpack_require__( /*! ../core/utils/dependency_injector */ 56); var _dependency_injector2 = _interopRequireDefault(_dependency_injector); var _array = __webpack_require__( /*! ../core/utils/array */ 14); var _common = __webpack_require__( /*! ../core/utils/common */ 4); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _number = __webpack_require__( /*! ./ldml/number */ 285); var _number2 = _interopRequireDefault(_number); var _config = __webpack_require__( /*! ../core/config */ 29); var _config2 = _interopRequireDefault(_config); var _errors = __webpack_require__( /*! ../core/errors */ 21); var _errors2 = _interopRequireDefault(_errors); var _utils = __webpack_require__( /*! ./utils */ 261); var _currency = __webpack_require__( /*! ./currency */ 125); var _currency2 = _interopRequireDefault(_currency); var _number3 = __webpack_require__( /*! ./intl/number */ 441); var _number4 = _interopRequireDefault(_number3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var hasIntl = "undefined" !== typeof Intl; 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 = (0, _dependency_injector2.default)({ engine: function() { return "base" }, numericFormats: NUMERIC_FORMATS, defaultLargeNumberFormatPostfixes: LargeNumberFormatPostfixes, _parseNumberFormatString: function(formatType) { var formatList = void 0; var formatObject = {}; if (!formatType || "string" !== typeof formatType) { return } formatList = formatType.toLowerCase().split(" "); (0, _iterator.each)(formatList, function(index, value) { if ((0, _array.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 powerPostfix = void 0; var result = void 0; if ("auto" === formatObject.power) { formatObject.power = this._calculateNumberPower(value, 1e3, 0, MAX_LARGE_NUMBER_POWER) } if (formatObject.power) { value = this._getNumberByPower(value, formatObject.power, 1e3) } powerPostfix = this.defaultLargeNumberFormatPostfixes[formatObject.power] || ""; 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); var powString = void 0; if (void 0 === formatConfig.precision) { formatConfig.precision = 1 } if (number.toFixed(formatConfig.precision || 0) >= DECIMAL_BASE) { power++; number /= DECIMAL_BASE } powString = (power >= 0 ? "+" : "") + power.toString(); return this._formatNumberCore(number, "fixedpoint", formatConfig) + "E" + powString }, _addZeroes: function(value, precision) { var multiplier = Math.pow(10, precision); 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, (0, _config2.default)().thousandsSeparator) + (parts[1] ? (0, _config2.default)().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() : (0, _utils.toFixed)(value, formatConfig.precision) } } if ("decimal" !== format) { value = this._addGroupSeparators(value) } else { value = value.toString().replace(".", (0, _config2.default)().decimalSeparator) } if ("percent" === format) { value += "%" } return value }, _normalizeFormat: function(format) { if (!format) { return {} } if ("function" === typeof format) { return format } if (!(0, _type.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" + (0, _common.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(_number2.default.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) { _errors2.default.log("W0011") } var decimalSeparator = this.getDecimalSeparator(); var regExp = new RegExp("[^0-9" + (0, _common.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 } }); numberLocalization.inject(_currency2.default); if (hasIntl) { numberLocalization.inject(_number4.default) } module.exports = numberLocalization }, /*!*************************************************************************!*\ !*** ./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 */ 481); var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget); var _ui = __webpack_require__( /*! ../widget/ui.errors */ 19); 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 */ 185); var _uiCollection_widgetEditStrategy2 = _interopRequireDefault(_uiCollection_widgetEditStrategy); var _data = __webpack_require__( /*! ../../core/utils/data */ 18); var _data_source = __webpack_require__( /*! ../../data/data_source/data_source */ 46); var _selection = __webpack_require__( /*! ../selection/selection */ 290); 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) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i] } return arr2 } else { return Array.from(arr) } } 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, 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, 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 = void 0; var selectedIndex = void 0; var selectedItemKeys = void 0; var selectedItems = void 0; 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), 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), normalizedItemIndex = this._editStrategy.getNormalizedIndex($itemElement), 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, addedItemKeys = args.addedItemKeys, removedItemKeys = args.removedItemKeys; if (that._rendered && (addedItemKeys.length || removedItemKeys.length)) { var selectionChangePromise = that._selectionChangePromise; if (!that._rendering) { var addedSelection = []; var normalizedIndex = void 0; 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, deletingActionArgs = { cancel: false }, deletePromise = this._itemEventHandler($itemElement, "onItemDeleting", deletingActionArgs, { excludeValidators: ["disabled", "readOnly"] }); (0, _deferred.when)(deletePromise).always(function(value) { var deletePromiseExists = !deletePromise, deletePromiseResolved = !deletePromiseExists && "resolved" === deletePromise.state(), argumentsSpecified = !!arguments.length, 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, disabledState = this.option("disabled"), 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, deferred = new _deferred.Deferred, $item = this._editStrategy.getItemElement(itemElement), index = this._editStrategy.getNormalizedIndex(itemElement), 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, that = this, strategy = this._editStrategy, $movingItem = strategy.getItemElement(itemElement), $destinationItem = strategy.getItemElement(toItemElement), movingIndex = strategy.getNormalizedIndex(itemElement), destinationIndex = strategy.getNormalizedIndex(toItemElement), changingOption = this._dataSource ? "dataSource" : "items"; var canMoveItems = 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/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), yItem = parseInt(y[i] || 0, 10); if (xItem < yItem) { return -1 } if (xItem > yItem) { return 1 } } return 0 } }, /*!*************************************************!*\ !*** ./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|\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(ICON_CLASS + " " + source); case "dxIcon": return (0, _renderer2.default)("").addClass(ICON_CLASS + " " + ICON_CLASS + "-" + source); case "svg": return (0, _renderer2.default)("").addClass(ICON_CLASS + " " + SVG_ICON_CLASS).append(source); default: return null } }; exports.getImageSourceType = getImageSourceType; exports.getImageContainer = getImageContainer }, /*!***************************************************************!*\ !*** ./artifacts/transpiled/core/utils/date_serialization.js ***! \***************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var config = __webpack_require__( /*! ../config */ 29), getLDMLFormatter = __webpack_require__( /*! ../../localization/ldml/date.formatter */ 263).getFormatter, defaultDateNames = __webpack_require__( /*! ../../localization/default_date_names */ 264), typeUtils = __webpack_require__( /*! ./type */ 1), isString = typeUtils.isString, isDate = typeUtils.isDate, isNumber = typeUtils.isNumeric; var NUMBER_SERIALIZATION_FORMAT = "number", DATE_SERIALIZATION_FORMAT = "yyyy/MM/dd", 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], month = --parts[3], day = parts[5], timeZoneHour = 0, timeZoneMinute = 0; timeZoneHour = timePart(parts[14]); timeZoneMinute = timePart(parts[16]); if ("-" === parts[13]) { timeZoneHour = -timeZoneHour; timeZoneMinute = -timeZoneMinute } var hour = timePart(parts[6]) - timeZoneHour, minute = timePart(parts[8]) - timeZoneMinute, second = timePart(parts[10]), parseMilliseconds = function(part) { part = part || ""; return timePart(part) * Math.pow(10, MILLISECOND_LENGHT - part.length) }, 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), 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/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, isFunction = __webpack_require__( /*! ./type */ 1).isFunction, each = __webpack_require__( /*! ./iterator */ 3).each, Class = __webpack_require__( /*! ../class */ 15); var BaseClass = Class.inherit(object), InjectedClass = BaseClass, instance = new InjectedClass(object), initialFields = {}; var injectFields = function(injectionObject, initial) { each(injectionObject, function(key) { if (isFunction(instance[key])) { if (initial || !object[key]) { object[key] = function() { return instance[key].apply(object, arguments) } } } else { if (initial) { initialFields[key] = object[key] } object[key] = instance[key] } }) }; injectFields(object, true); object.inject = function(injectionObject) { InjectedClass = InjectedClass.inherit(injectionObject); instance = new InjectedClass; injectFields(injectionObject) }; object.resetInjection = function() { extend(object, initialFields); InjectedClass = BaseClass; instance = new BaseClass }; return object } }, /*!********************************!*\ !*** external "window.jQuery" ***! \********************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports) { module.exports = window.jQuery }, /*!***************************************************************!*\ !*** ./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 */ 19); var _ui2 = _interopRequireDefault(_ui); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var Quill = void 0; function getQuill() { if (!Quill) { Quill = requestQuill() } return Quill } function requestQuill() { var window = (0, _window.getWindow)(); var quill = window && window.Quill || __webpack_require__( /*! quill */ 574); if (!quill) { throw _ui2.default.Error("E1041", "Quill") } return quill } exports.getQuill = getQuill }, /*!********************************************!*\ !*** ./artifacts/transpiled/ui/overlay.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./overlay/ui.overlay */ 478) }, /*!****************************!*\ !*** 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/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 */ 13); var httpRequest = __webpack_require__( /*! ../../core/http_request */ 453); 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 */ 67); var injector = __webpack_require__( /*! ./dependency_injector */ 56); var SUCCESS = "success", ERROR = "error", TIMEOUT = "timeout", NO_CONTENT = "nocontent", 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 || "*", scriptAccept = "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript", 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, originAnchor = domAdapter.createElement("a"), 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, ""), callbackName = options.jsonpCallback || "dxCallback" + Date.now() + "_" + random, callbackParameter = options.jsonp || "callback"; options.data = options.data || {}; options.data[callbackParameter] = callbackName; return callbackName } }; var getRequestOptions = function(options, headers) { var params = options.data, paramsAlreadyString = "string" === typeof params, 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 timeoutId, xhr = httpRequest.getXhr(), d = new Deferred, result = d.promise(), async = isDefined(options.async) ? options.async : true, dataType = options.dataType, timeout = options.timeout || 0; options.crossDomain = isCrossDomain(options.url); var needScriptEvaluation = "jsonp" === dataType || "script" === dataType; if (void 0 === options.cache) { options.cache = !needScriptEvaluation } var callbackName = getJsonpOptions(options), headers = getRequestHeaders(options), requestOptions = getRequestOptions(options, headers), url = requestOptions.url, 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) }, 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/format_helper.js ***! \***********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var typeUtils = __webpack_require__( /*! ./core/utils/type */ 1), dateUtils = __webpack_require__( /*! ./core/utils/date */ 22), numberLocalization = __webpack_require__( /*! ./localization/number */ 51), dateLocalization = __webpack_require__( /*! ./localization/date */ 32), dependencyInjector = __webpack_require__( /*! ./core/utils/dependency_injector */ 56); __webpack_require__( /*! ./localization/currency */ 125); module.exports = dependencyInjector({ format: function(value, _format) { var formatIsValid = typeUtils.isString(_format) && "" !== _format || typeUtils.isPlainObject(_format) || typeUtils.isFunction(_format), 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 = [], 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 resultFormat, maxDiff, currentDiff, i; if (ticks.length > 1) { maxDiff = dateUtils.getDatesDifferences(ticks[0], ticks[1]); for (i = 1; i < ticks.length - 1; i++) { 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 } } resultFormat = this.getDateFormatByDifferences(maxDiff); return resultFormat }, getDateFormatByTickInterval: function(startValue, endValue, tickInterval) { var resultFormat, dateDifferences, dateUnitInterval, dateDifferencesConverter = { week: "day" }, correctDateDifferences = function(dateDifferences, tickInterval, value) { switch (tickInterval) { case "year": case "quarter": dateDifferences.month = value; case "month": dateDifferences.day = value; case "week": case "day": dateDifferences.hour = value; case "hour": dateDifferences.minute = value; case "minute": dateDifferences.second = value; case "second": dateDifferences.millisecond = value } }, correctDifferencesByMaxDate = function(differences, minDate, maxDate) { if (!maxDate.getMilliseconds() && maxDate.getSeconds()) { if (maxDate.getSeconds() - minDate.getSeconds() === 1) { differences.millisecond = true; differences.second = false } } else { if (!maxDate.getSeconds() && maxDate.getMinutes()) { if (maxDate.getMinutes() - minDate.getMinutes() === 1) { differences.second = true; differences.minute = false } } else { if (!maxDate.getMinutes() && maxDate.getHours()) { if (maxDate.getHours() - minDate.getHours() === 1) { differences.minute = true; differences.hour = false } } else { if (!maxDate.getHours() && maxDate.getDate() > 1) { if (maxDate.getDate() - minDate.getDate() === 1) { differences.hour = true; differences.day = false } } else { if (1 === maxDate.getDate() && maxDate.getMonth()) { if (maxDate.getMonth() - minDate.getMonth() === 1) { differences.day = true; differences.month = false } } else { if (!maxDate.getMonth() && maxDate.getFullYear()) { if (maxDate.getFullYear() - minDate.getFullYear() === 1) { differences.month = true; differences.year = false } } } } } } } }; tickInterval = typeUtils.isString(tickInterval) ? tickInterval.toLowerCase() : tickInterval; dateDifferences = dateUtils.getDatesDifferences(startValue, endValue); if (startValue !== endValue) { correctDifferencesByMaxDate(dateDifferences, startValue > endValue ? endValue : startValue, startValue > endValue ? startValue : endValue) } dateUnitInterval = dateUtils.getDateUnitInterval(dateDifferences); correctDateDifferences(dateDifferences, dateUnitInterval, true); dateUnitInterval = dateUtils.getDateUnitInterval(tickInterval || "second"); correctDateDifferences(dateDifferences, dateUnitInterval, false); dateDifferences[dateDifferencesConverter[dateUnitInterval] || dateUnitInterval] = true; resultFormat = this.getDateFormatByDifferences(dateDifferences); return resultFormat } }) }, /*!******************************************************************!*\ !*** ./artifacts/transpiled/core/templates/bindable_template.js ***! \******************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.BindableTemplate = void 0; var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _renderer = __webpack_require__( /*! ../renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _template_base = __webpack_require__( /*! ./template_base */ 74); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _remove_event = __webpack_require__( /*! ../remove_event */ 136); var _remove_event2 = _interopRequireDefault(_remove_event); var _type = __webpack_require__( /*! ../utils/type */ 1); 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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && ("object" === typeof call || "function" === typeof call) ? call : self } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } } var watchChanges = function() { 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 = fields.map(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() { watchHandlers.forEach(function(dispose) { return dispose() }) } }; return function(rawData, watchMethod, fields, fieldsMap, callback) { var fieldsDispose = void 0; var globalDispose = globalWatch(rawData, watchMethod, function(dataWithRawFields) { fieldsDispose && fieldsDispose(); if ((0, _type.isPrimitive)(dataWithRawFields)) { callback(dataWithRawFields); return } fieldsDispose = fieldsWatch(dataWithRawFields, watchMethod, fields, fieldsMap, callback) }); return function() { fieldsDispose && fieldsDispose(); globalDispose && globalDispose() } } }(); exports.BindableTemplate = function(_TemplateBase) { _inherits(BindableTemplate, _TemplateBase); function BindableTemplate(render, fields, watchMethod, fieldsMap) { _classCallCheck(this, BindableTemplate); var _this = _possibleConstructorReturn(this, (BindableTemplate.__proto__ || Object.getPrototypeOf(BindableTemplate)).call(this)); _this._render = render; _this._fields = fields; _this._fieldsMap = fieldsMap || {}; _this._watchMethod = watchMethod; return _this } _createClass(BindableTemplate, [{ key: "_renderCore", value: function(options) { var _this2 = this; var $container = (0, _renderer2.default)(options.container); var dispose = watchChanges(options.model, this._watchMethod, this._fields, this._fieldsMap, function(data) { $container.empty(); _this2._render($container, data, options.model) }); (0, _events_engine.on)($container, _remove_event2.default, dispose); return $container.contents() } }]); return BindableTemplate }(_template_base.TemplateBase) }, /*!****************************************************!*\ !*** ./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/selectors.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2), domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 13); var _focusable = function(element, tabIndex) { if (!visible(element)) { return false } var nodeName = element.nodeName.toLowerCase(), isTabIndexNotNaN = !isNaN(tabIndex), isDisabled = element.disabled, isDefaultFocus = /^(input|select|textarea|button|object|iframe)$/.test(nodeName), isHyperlink = "a" === nodeName, isFocusable = true, 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/polyfills/promise.js ***! \********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6), windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7), Deferred = deferredUtils.Deferred, when = deferredUtils.when, 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/events/drag.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2), dataUtils = __webpack_require__( /*! ../core/element_data */ 40), wrapToArray = __webpack_require__( /*! ../core/utils/array */ 14).wrapToArray, inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray, iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3), contains = __webpack_require__( /*! ../core/utils/dom */ 11).contains, registerEvent = __webpack_require__( /*! ./core/event_registrator */ 72), eventUtils = __webpack_require__( /*! ./utils */ 8), GestureEmitter = __webpack_require__( /*! ./gesture/emitter.gesture */ 159), registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 96); var DRAG_START_EVENT = "dxdragstart", DRAG_EVENT = "dxdrag", DRAG_END_EVENT = "dxdragend", DRAG_ENTER_EVENT = "dxdragenter", DRAG_LEAVE_EVENT = "dxdragleave", DROP_EVENT = "dxdrop", DX_DRAG_EVENTS_COUNT_KEY = "dxDragEventsCount"; var knownDropTargets = [], knownDropTargetSelectors = [], 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), dropTargetSelectors = knownDropTargetSelectors[dropTargetIndex].filter(function(selector) { return selector }); var $delegatedTargets = $element.find(dropTargetSelectors.join(", ")); if (inArray(void 0, knownDropTargetSelectors[dropTargetIndex]) !== -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), 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), sameTarget = target === this._currentDropTarget; if (!sameTarget) { this._fireDropTargetEvent(e, DRAG_LEAVE_EVENT); this._currentDropTarget = target; this._fireDropTargetEvent(e, DRAG_ENTER_EVENT) } }, _fireDropTargetEvent: function(event, eventName) { if (!this._currentDropTarget) { return } var eventData = { type: eventName, originalEvent: event, draggingElement: this._$element.get(0), target: this._currentDropTarget }; eventUtils.fireEvent(eventData) }, _findDropTarget: function(e) { var result, that = this; 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) === $(e.target).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 } if (config.checkDropTarget && !config.checkDropTarget($target, e)) { 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/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 */ 37); var _abstract_store = __webpack_require__( /*! ./abstract_store */ 101); var _abstract_store2 = _interopRequireDefault(_abstract_store); var _array_utils = __webpack_require__( /*! ./array_utils */ 138); 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", INKRIPPLE_WAVE_CLASS = "dx-inkripple-wave", INKRIPPLE_SHOWING_CLASS = "dx-inkripple-showing", INKRIPPLE_HIDING_CLASS = "dx-inkripple-hiding"; var DEFAULT_WAVE_SIZE_COEFFICIENT = 2, MAX_WAVE_SIZE = 4e3, ANIMATION_DURATION = 300, HOLD_ANIMATION_DURATION = 1e3, DEFAULT_WAVE_INDEX = 0; var render = function(args) { args = args || {}; if (void 0 === args.useHoldAnimation) { args.useHoldAnimation = true } var config = { waveSizeCoefficient: args.waveSizeCoefficient || DEFAULT_WAVE_SIZE_COEFFICIENT, isCentered: args.isCentered || false, wavesNumber: args.wavesNumber || 1, durations: getDurations(args.useHoldAnimation) }; return { showWave: 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), 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 left, top, element = config.element, elementWidth = element.outerWidth(), elementHeight = element.outerHeight(), elementDiagonal = parseInt(Math.sqrt(elementWidth * elementWidth + elementHeight * elementHeight)), waveSize = Math.min(MAX_WAVE_SIZE, parseInt(elementDiagonal * args.waveSizeCoefficient)); if (args.isCentered) { left = (elementWidth - waveSize) / 2; top = (elementHeight - waveSize) / 2 } else { var event = config.event, position = config.element.offset(), x = event.pageX - position.left, y = event.pageY - position.top; left = x - waveSize / 2; top = y - waveSize / 2 } return { left: left, top: top, height: waveSize, width: waveSize } }; var showWave = function(args, config) { var $wave = getWaves(config.element, args.wavesNumber).eq(config.wave || DEFAULT_WAVE_INDEX); args.hidingTimeout && clearTimeout(args.hidingTimeout); hideSelectedWave($wave); $wave.css(getWaveStyleConfig(args, config)); 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), durations = args.durations, 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 */ 256); var _node = __webpack_require__( /*! ./node */ 170); var _node2 = _interopRequireDefault(_node); var _tiling = __webpack_require__( /*! ./tiling */ 122); var _colorizing = __webpack_require__( /*! ./colorizing */ 123); var _utils = __webpack_require__( /*! ../core/utils */ 12); 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 */ 427); __webpack_require__( /*! ./tiling */ 122).setDefaultAlgorithm("squarified"); __webpack_require__( /*! ./colorizing.discrete */ 429); __webpack_require__( /*! ./colorizing */ 123).setDefaultColorizer("discrete"); function pickPositiveInteger(val) { return val > 0 ? Math.round(val) : 0 } var dxTreeMap = __webpack_require__( /*! ../core/base_widget */ 98).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, 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 processedData, that = this, 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(); 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, options = that._getOption("tile"), offsets = that._rectOffsets, borderWidth = pickPositiveInteger(options.border.width), edgeOffset = borderWidth / 2, innerOffset = 1 & borderWidth ? .5 : 0, labelOptions = options.label, settings = that._context.settings[0]; that._change(["TILES", "LABELS"]); settings.state = that._handlers.calculateState(options); that._filter = that._filter || that._renderer.shadowFilter("-50%", "-50%", "200%", "200%"); that._filter.attr(labelOptions.shadow); that._calculateLabelSettings(settings, labelOptions, that._filter.id); if (offsets.tileEdge !== edgeOffset || offsets.tileInner !== innerOffset) { offsets.tileEdge = edgeOffset; offsets.tileInner = innerOffset; that._change(["TILING"]) } }, _changeGroupSettings: function() { var that = this, options = that._getOption("group"), labelOptions = options.label, offsets = that._rectOffsets, borderWidth = pickPositiveInteger(options.border.width), edgeOffset = borderWidth / 2, innerOffset = 1 & borderWidth ? .5 : 0, headerHeight = 0, groupPadding = pickPositiveInteger(options.padding), settings = that._context.settings[1]; that._change(["TILES", "LABELS"]); settings.state = that._handlers.calculateState(options); that._calculateLabelSettings(settings, labelOptions); if (options.headerHeight >= 0) { headerHeight = pickPositiveInteger(options.headerHeight) } else { headerHeight = settings.labelParams.height + 2 * pickPositiveInteger(labelOptions.paddingTopBottom) } if (that._headerHeight !== headerHeight) { that._headerHeight = headerHeight; that._change(["TILING"]) } if (that._groupPadding !== groupPadding) { that._groupPadding = groupPadding; that._change(["TILING"]) } if (offsets.headerEdge !== edgeOffset || offsets.headerInner !== innerOffset) { offsets.headerEdge = edgeOffset; offsets.headerInner = innerOffset; that._change(["TILING"]) } }, _calculateLabelSettings: function(settings, options, filter) { var bBox = this._getTextBBox(options.font), paddingLeftRight = pickPositiveInteger(options.paddingLeftRight), paddingTopBottom = pickPositiveInteger(options.paddingTopBottom), tileLabelOptions = this._getOption("tile.label"), groupLabelOptions = this._getOption("group.label"); settings.labelState = (0, _common.buildTextAppearance)(options, filter); settings.labelState.visible = !("visible" in options) || !!options.visible; settings.labelParams = { height: bBox.height, rtlEnabled: this._getOption("rtlEnabled", true), paddingTopBottom: paddingTopBottom, paddingLeftRight: paddingLeftRight, resolveLabelOverflow: this._getOptionByStealth("resolveLabelOverflow"), tileLabelWordWrap: tileLabelOptions.wordWrap, tileLabelOverflow: tileLabelOptions.textOverflow, groupLabelOverflow: groupLabelOptions.textOverflow } }, _changeMaxDepth: function() { var maxDepth = this._getOption("maxDepth", true); maxDepth = maxDepth >= 1 ? Math.round(maxDepth) : 1 / 0; if (this._maxDepth !== maxDepth) { this._maxDepth = maxDepth; this._change(["NODES_RESET"]) } }, _resetNodes: function() { var that = this; that._tilesGroup.clear(); that._renderer.initHatching(); that._context.forceReset = true; that._context.minLevel = that._topNode.level + 1; that._context.maxLevel = that._context.minLevel + that._maxDepth - 1; that._change(["TILES", "LABELS", "TILING"]) }, _processNodes: function(context, process) { processNodes(context, this._topNode, process) }, _applyTilesAppearance: function() { var that = this, colorizer = (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, 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 bBox, renderer = this._renderer, text = this._textForCalculations || renderer.text("0", 0, 0); this._textForCalculations = text; text.css((0, _utils.patchFontOptions)(fontOptions)).append(renderer.root); bBox = text.getBBox(); text.remove(); return bBox } }); function traverseDataItems(root, dataItems, level, params) { var node, i, dataItem, items, nodes = [], allNodes = params.nodes, ii = dataItems.length, totalValue = 0; for (i = 0; i < ii; ++i) { dataItem = dataItems[i]; node = new _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); items = dataItem[params.itemsField]; if (items && items.length) { traverseDataItems(node, items, level + 1, params) } if (dataItem[params.valueField] > 0) { node.value = Number(dataItem[params.valueField]) } totalValue += node.value } root.nodes = nodes; root.value = totalValue } function processNodes(context, root, process) { var node, i, nodes = root.nodes, ii = nodes.length; for (i = 0; i < ii; ++i) { node = nodes[i]; process(context, node); if (node.isNode()) { processNodes(context, node, process) } } } function processTileAppearance(context, node) { node.color = node.data[context.colorField] || context.getColor(node) || node.parent.color; node.updateStyles(); node.tile = !node.ctx.forceReset && node.tile || createTile[Number(node.isNode())](context, node); node.applyState() } var createTile = [createLeaf, createGroup]; function createLeaf(context, node) { var tile = context.renderer.simpleRect().append(context.group); context.setTrackerData(node, tile); return tile } function createGroup(context, node) { var outer = context.renderer.simpleRect().append(context.group), inner = context.renderer.simpleRect().append(context.group); context.setTrackerData(node, inner); return { outer: outer, inner: inner } } function processLabelAppearance(context, node) { node.updateLabelStyle(); if (node.labelState.visible) { createLabel(context, node, node.labelState, node.labelParams) } } function createLabel(context, currentNode, settings, params) { var textData = currentNode.data[context.labelField]; currentNode.label = textData ? String(textData) : null; textData = currentNode.customLabel || currentNode.label; if (textData) { currentNode.text = context.renderer.text(textData).attr(settings.attr).css(settings.css).append(context.group); context.setTrackerData(currentNode, currentNode.text) } } var emptyRect = [0, 0, 0, 0]; function calculateRects(context, root) { var i, nodes = root.nodes, items = [], rects = [], sum = 0, ii = items.length = rects.length = nodes.length; for (i = 0; i < ii; ++i) { sum += nodes[i].value; items[i] = { value: nodes[i].value, i: i } } if (sum > 0) { context.algorithm({ items: items.slice(), sum: sum, rect: root.innerRect.slice(), isRotated: 1 & nodes[0].level, directions: context.directions }) } for (i = 0; i < ii; ++i) { rects[i] = items[i].rect || emptyRect } root.rects = rects } function processTiling(context, node) { var headerHeight, rect = node.parent.rects[node.index], rectOffsets = context.rectOffsets; if (node.isNode()) { setRectAttrs(node.tile.outer, buildTileRect(rect, node.parent.innerRect, rectOffsets.headerEdge, rectOffsets.headerInner)); rect = marginateRect(rect, context.groupPadding); headerHeight = Math.min(context.headerHeight, rect[3] - rect[1]); node.rect = [rect[0], rect[1], rect[2], rect[1] + headerHeight]; setRectAttrs(node.tile.inner, marginateRect(node.rect, rectOffsets.headerEdge)); rect[1] += headerHeight; node.innerRect = rect; calculateRects(context, node) } else { node.rect = rect; setRectAttrs(node.tile, buildTileRect(rect, node.parent.innerRect, rectOffsets.tileEdge, rectOffsets.tileInner)) } } function marginateRect(rect, margin) { return [rect[0] + margin, rect[1] + margin, rect[2] - margin, rect[3] - margin] } function buildTileRect(rect, outer, edgeOffset, innerOffset) { return [rect[0] + (rect[0] === outer[0] ? edgeOffset : +innerOffset), rect[1] + (rect[1] === outer[1] ? edgeOffset : +innerOffset), rect[2] - (rect[2] === outer[2] ? edgeOffset : -innerOffset), rect[3] - (rect[3] === outer[3] ? edgeOffset : -innerOffset)] } function setRectAttrs(element, rect) { element.attr({ x: rect[0], y: rect[1], width: _max(rect[2] - rect[0], 0), height: _max(rect[3] - rect[1], 0) }) } function processLabelsLayout(context, node) { if (node.text && node.labelState.visible) { layoutTextNode(node, node.labelParams) } } function layoutTextNode(node, params) { var rect = node.rect, text = node.text, bBox = text.getBBox(), paddingLeftRight = params.paddingLeftRight, paddingTopBottom = params.paddingTopBottom, effectiveWidth = rect[2] - rect[0] - 2 * paddingLeftRight, fitByHeight = bBox.height + paddingTopBottom <= rect[3] - rect[1], fitByWidth = bBox.width <= effectiveWidth, resolveLabelOverflow = params.resolveLabelOverflow, groupLabelOverflow = params.groupLabelOverflow, tileLabelOverflow = params.tileLabelOverflow, 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 */ 146).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, callbacks = __webpack_require__( /*! ./event_registrator_callbacks */ 124); 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 }, /*!******************************************************!*\ !*** ./artifacts/transpiled/core/utils/view_port.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../renderer */ 2), readyCallbacks = __webpack_require__( /*! ./ready_callbacks */ 49), ready = readyCallbacks.add, changeCallback = __webpack_require__( /*! ./callbacks */ 27)(), $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/core/templates/template_base.js ***! \**************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.TemplateBase = exports.renderedCallbacks = void 0; var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _renderer = __webpack_require__( /*! ../renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _dom_adapter = __webpack_require__( /*! ../dom_adapter */ 13); var _callbacks = __webpack_require__( /*! ../utils/callbacks */ 27); var _callbacks2 = _interopRequireDefault(_callbacks); var _dom = __webpack_require__( /*! ../utils/dom */ 11); var _errors = __webpack_require__( /*! ../errors */ 21); var _errors2 = _interopRequireDefault(_errors); 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") } } var renderedCallbacks = exports.renderedCallbacks = (0, _callbacks2.default)({ syncStrategy: true }); exports.TemplateBase = function() { function TemplateBase() { _classCallCheck(this, TemplateBase) } _createClass(TemplateBase, [{ key: "render", value: 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 } }, { key: "_ensureResultInContainer", value: function($result, container) { if (!container) { return } var $container = (0, _renderer2.default)(container); var resultInContainer = (0, _dom.contains)($container.get(0), $result.get(0)); $container.append($result); if (resultInContainer) { return } var resultInBody = (0, _dom_adapter.getBody)().contains($container.get(0)); if (!resultInBody) { return }(0, _dom.triggerShownEvent)($result) } }, { key: "_renderCore", value: function() { throw _errors2.default.Error("E0001") } }]); return TemplateBase }() }, /*!***********************************!*\ !*** external "window.Globalize" ***! \***********************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports) { module.exports = window.Globalize }, /*!***************************************************!*\ !*** ./artifacts/transpiled/ui/load_indicator.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2), windowUtils = __webpack_require__( /*! ../core/utils/window */ 7), navigator = windowUtils.getNavigator(), support = __webpack_require__( /*! ../core/utils/support */ 44), themes = __webpack_require__( /*! ./themes */ 31), extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, devices = __webpack_require__( /*! ../core/devices */ 16), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9), Widget = __webpack_require__( /*! ./widget/ui.widget */ 17); var LOADINDICATOR_CLASS = "dx-loadindicator", LOADINDICATOR_WRAPPER_CLASS = "dx-loadindicator-wrapper", LOADINDICATOR_CONTENT_CLASS = "dx-loadindicator-content", LOADINDICATOR_ICON_CLASS = "dx-loadindicator-icon", LOADINDICATOR_SEGMENT_CLASS = "dx-loadindicator-segment", LOADINDICATOR_SEGMENT_INNER_CLASS = "dx-loadindicator-segment-inner", LOADINDICATOR_IMAGE_CLASS = "dx-loadindicator-image"; var LoadIndicator = Widget.inherit({ _getDefaultOptions: function() { return extend(this.callBase(), { indicatorSrc: "", activeStateEnabled: false, hoverStateEnabled: false, _animatingSegmentCount: 1, _animatingSegmentInner: false }) }, _defaultOptionsRules: function() { var themeName = themes.current(); return this.callBase().concat([{ device: function() { var realDevice = devices.real(), 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"), 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/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 */ 62); var _data = __webpack_require__( /*! ../../core/utils/data */ 18); 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 */ 63); var _data_source = __webpack_require__( /*! ../../data/data_source/data_source */ 46); var _array_store = __webpack_require__( /*! ../../data/array_store */ 69); 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 || {}, 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 item, i, deferred, childrenDeferred; 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 } item = items[i]; if (!isChildrenProcessing) { members.unshift(item); if (parentAtFirst && false === callback(members, i)) { return } if (item.children) { childrenDeferred = foreachTreeFunc(item.children, callback, parentAtFirst, members); if (isAsync && childrenDeferred) { deferred = 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) { var i, field; if (fields && (0, _type.isDefined)(id)) { for (i = 0; i < fields.length; i++) { field = fields[i]; if (field.name === id || field.caption === id || field.dataField === id || field.index === id) { return i } } } return -1 }; exports.formatValue = function(value, options) { var formatObject = { value: value, valueText: (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, valueA = valueSelector(a), valueB = valueSelector(b), aIsDefined = (0, _type.isDefined)(valueA), 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 i, result = []; for (i = items.length - 1; i >= 0; i--) { result.push(items[i].key || items[i].value) } return result }; exports.foreachDataLevel = function foreachDataLevel(data, callback, index, childrenField) { var item, i; index = index || 0; childrenField = childrenField || "children"; if (data.length) { callback(data, index) } for (i = 0; i < data.length; i++) { item = data[i]; if (item[childrenField] && item[childrenField].length) { foreachDataLevel(item[childrenField], callback, index + 1, childrenField) } } }; exports.mergeArraysByMaxValue = function(values1, values2) { var i, result = []; for (i = 0; i < values1.length; i++) { result.push(Math.max(values1[i] || 0, values2[i] || 0)) } return result }; exports.getExpandedLevel = function(options, axisName) { var dimensions = options[axisName], expandLevel = 0, 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 items, dataIndex = 1, currentPath = path.length ? path + "." + field : field, dataType = fieldsDataType[currentPath], getter = (0, _data.compileGetter)(currentPath); 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, 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) { 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) { arrayStore = new _array_store2.default(data); arrayStore[methodName](options).done(d.resolve).fail(d.reject) }).fail(d.reject) } return d } } var arrayStore, items = this.getDrillDownItems(descriptions, params), 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/animation/position.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2), commonUtils = __webpack_require__( /*! ../core/utils/common */ 4), each = __webpack_require__( /*! ../core/utils/iterator */ 3).each, windowUtils = __webpack_require__( /*! ../core/utils/window */ 7), window = windowUtils.getWindow(), domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 13), isWindow = __webpack_require__( /*! ../core/utils/type */ 1).isWindow, extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, browser = __webpack_require__( /*! ../core/utils/browser */ 25), translator = __webpack_require__( /*! ./translator */ 26), support = __webpack_require__( /*! ../core/utils/support */ 44); var horzRe = /left|right/, vertRe = /top|bottom/, collisionRe = /fit|flip|none/, 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), h = String(pair && pair[0]).toLowerCase(), v = String(pair && pair[1]).toLowerCase(); if (!collisionRe.test(h)) { h = "none" } if (!collisionRe.test(v)) { v = h } return { h: h, v: v } }; var getAlignFactor = function(align) { switch (align) { case "center": return .5; case "right": case "bottom": return 1; default: return 0 } }; var inverseAlign = function(align) { switch (align) { case "left": return "right"; case "right": return "left"; case "top": return "bottom"; case "bottom": return "top"; default: return align } }; var calculateOversize = function(data, bounds) { var oversize = 0; if (data.myLocation < bounds.min) { oversize += bounds.min - data.myLocation } if (data.myLocation > bounds.max) { oversize += data.myLocation - bounds.max } return oversize }; var collisionSide = function(direction, data, bounds) { if (data.myLocation < bounds.min) { return "h" === direction ? "left" : "top" } if (data.myLocation > bounds.max) { return "h" === direction ? "right" : "bottom" } return "none" }; var initMyLocation = function(data) { data.myLocation = data.atLocation + getAlignFactor(data.atAlign) * data.atSize - getAlignFactor(data.myAlign) * data.mySize + data.offset }; var 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")), result = $scrollDiv.get(0).offsetWidth - $scrollDiv.get(0).clientWidth; $scrollDiv.remove(); scrollbarWidth = result }; var defaultPositionResult = { h: { location: 0, flip: false, fit: false, oversize: 0 }, v: { location: 0, flip: false, fit: false, oversize: 0 } }; var calculatePosition = function(what, options) { var $what = $(what), currentOffset = $what.offset(), result = extend(true, {}, defaultPositionResult, { h: { location: currentOffset.left }, v: { location: currentOffset.top } }); if (!options) { return result } var my = normalizeAlign(options.my), at = normalizeAlign(options.at), of = $(options.of).length && options.of || window, offset = normalizeOffset(options.offset), collision = normalizeCollision(options.collision), boundary = options.boundary, boundaryOffset = normalizeOffset(options.boundaryOffset); var h = { mySize: $what.outerWidth(), myAlign: my.h, atAlign: at.h, offset: offset.h, collision: collision.h, boundaryOffset: boundaryOffset.h }; var v = { mySize: $what.outerHeight(), myAlign: my.v, atAlign: at.v, offset: offset.v, collision: collision.v, boundaryOffset: boundaryOffset.v }; if ( of .preventDefault) { h.atLocation = of .pageX; v.atLocation = of .pageY; h.atSize = 0; v.atSize = 0 } else { of = $( of ); if (isWindow( of [0])) { h.atLocation = of .scrollLeft(); v.atLocation = of .scrollTop(); h.atSize = of [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), windowWidth = win.width(), windowHeight = win.height(), left = win.scrollLeft(), top = win.scrollTop(), documentElement = domAdapter.getDocumentElement(), hZoomLevel = support.touch ? documentElement.clientWidth / windowWidth : 1, vZoomLevel = support.touch ? documentElement.clientHeight / windowHeight : 1; if (void 0 === scrollbarWidth) { calculateScrollbarWidth() } var boundaryWidth = windowWidth, boundaryHeight = windowHeight; if (boundary) { var $boundary = $(boundary), boundaryPosition = $boundary.offset(); left = boundaryPosition.left; top = boundaryPosition.top; boundaryWidth = $boundary.width(); boundaryHeight = $boundary.height() } return { h: { min: left + h.boundaryOffset, max: left + boundaryWidth / hZoomLevel - h.mySize - h.boundaryOffset }, v: { min: top + v.boundaryOffset, max: top + boundaryHeight / vZoomLevel - v.mySize - v.boundaryOffset } } }(); h.oversize = calculateOversize(h, bounds.h); v.oversize = calculateOversize(v, bounds.v); h.collisionSide = collisionSide("h", h, bounds.h); v.collisionSide = collisionSide("v", v, bounds.v); if (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(), 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/data_helper.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var DataSource = __webpack_require__( /*! ./data/data_source/data_source */ 46).DataSource, extend = __webpack_require__( /*! ./core/utils/extend */ 0).extend, normalizeDataSourceOptions = __webpack_require__( /*! ./data/data_source/data_source */ 46).normalizeDataSourceOptions; var DATA_SOURCE_OPTIONS_METHOD = "_dataSourceOptions", DATA_SOURCE_CHANGED_METHOD = "_dataSourceChangedHandler", DATA_SOURCE_LOAD_ERROR_METHOD = "_dataSourceLoadErrorHandler", DATA_SOURCE_LOADING_CHANGED_METHOD = "_dataSourceLoadingChangedHandler", DATA_SOURCE_FROM_URL_LOAD_MODE_METHOD = "_dataSourceFromUrlLoadMode", 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 widgetDataSourceOptions, dataSourceType, dataSourceOptions = SPECIFIC_DATA_SOURCE_OPTION in this ? this[SPECIFIC_DATA_SOURCE_OPTION]() : this.option("dataSource"); this._disposeDataSource(); if (dataSourceOptions) { if (dataSourceOptions instanceof DataSource) { this._isSharedDataSource = true; this._dataSource = dataSourceOptions } else { widgetDataSourceOptions = DATA_SOURCE_OPTIONS_METHOD in this ? this[DATA_SOURCE_OPTIONS_METHOD]() : {}; dataSourceType = this._dataSourceType ? this._dataSourceType() : DataSource; 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/localization/core.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _dependency_injector = __webpack_require__( /*! ../core/utils/dependency_injector */ 56); var _dependency_injector2 = _interopRequireDefault(_dependency_injector); var _parent_locales = __webpack_require__( /*! ./cldr-data/parent_locales */ 442); var _parent_locales2 = _interopRequireDefault(_parent_locales); var _parentLocale = __webpack_require__( /*! ./parentLocale */ 443); var _parentLocale2 = _interopRequireDefault(_parentLocale); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var DEFAULT_LOCALE = "en"; module.exports = (0, _dependency_injector2.default)({ locale: function() { var currentLocale = DEFAULT_LOCALE; return function(locale) { if (!locale) { return currentLocale } currentLocale = locale } }(), getValueByClosestLocale: function(getter) { var locale = this.locale(); var value = getter(locale); var isRootLocale = void 0; while (!value && !isRootLocale) { locale = (0, _parentLocale2.default)(_parent_locales2.default, locale); if (locale) { value = getter(locale) } else { isRootLocale = true } } if (void 0 === value && locale !== DEFAULT_LOCALE) { return getter(DEFAULT_LOCALE) } return value } }) }, /*!*****************************************************************!*\ !*** ./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 */ 57); var config = __webpack_require__( /*! ../../core/config */ 29); 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, extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, each = __webpack_require__( /*! ../core/utils/iterator */ 3).each, arrayQuery = __webpack_require__( /*! ./array_query */ 156), 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, select = options.select, group = options.group, skip = options.skip, 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/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 */ 29); var _config2 = _interopRequireDefault(_config); var _errors = __webpack_require__( /*! ./errors */ 21); var _errors2 = _interopRequireDefault(_errors); var _dom = __webpack_require__( /*! ../core/utils/dom */ 11); var _resize_callbacks = __webpack_require__( /*! ../core/utils/resize_callbacks */ 134); 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 */ 135); var _public_component2 = _interopRequireDefault(_public_component); var _element_data = __webpack_require__( /*! ./element_data */ 40); var _element_data2 = _interopRequireDefault(_element_data); var _component = __webpack_require__( /*! ./component */ 112); 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")), 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) }, resetOption: function(optionName) { this.callBase(optionName); if (("width" === optionName || "height" === optionName) && !(0, _type.isDefined)(this.initialOption(optionName))) { this.$element().css(optionName, "") } } }); 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/core/events_mixin.js ***! \***************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var DefaultEventsStrategy = __webpack_require__( /*! ./events_strategy */ 458), each = __webpack_require__( /*! ./utils/iterator */ 3).each, 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/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), s = parseInt(colorString[2], 10), v = parseInt(colorString[3], 10), rgb = hsvToRgb(h, s, v); return [rgb[0], rgb[1], rgb[2], 1, [h, s, v]] } }, { re: /^hsl\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, process: function(colorString) { var h = parseInt(colorString[1], 10), s = parseInt(colorString[2], 10), l = parseInt(colorString[3], 10), rgb = hslToRgb(h, s, l); return [rgb[0], rgb[1], rgb[2], 1, null, [h, s, l]] } }]; function Color(value) { this.baseColor = value; var color; if (value) { color = String(value).toLowerCase().replace(/ /g, ""); color = standardColorNames[color] ? "#" + standardColorNames[color] : color; color = parseColor(color) } if (!color) { this.colorIsInvalid = true } color = color || {}; this.r = normalize(color[0]); this.g = normalize(color[1]); this.b = normalize(color[2]); this.a = normalize(color[3], 1, 1); if (color[4]) { this.hsv = { h: color[4][0], s: color[4][1], v: color[4][2] } } else { this.hsv = toHsvFromRgb(this.r, this.g, this.b) } if (color[5]) { this.hsl = { h: color[5][0], s: color[5][1], l: color[5][2] } } else { this.hsl = toHslFromRgb(this.r, this.g, this.b) } } function parseColor(color) { if ("transparent" === color) { return [0, 0, 0, 0] } var str, i = 0, ii = standardColorTypes.length; for (; i < ii; ++i) { str = standardColorTypes[i].re.exec(color); if (str) { return standardColorTypes[i].process(str) } } return null } function normalize(colorComponent, def, max) { def = def || 0; max = max || 255; return colorComponent < 0 || isNaN(colorComponent) ? def : colorComponent > max ? max : colorComponent } function toHexFromRgb(r, g, b) { return "#" + (16777216 | r << 16 | g << 8 | b).toString(16).slice(1) } function toHsvFromRgb(r, g, b) { var H, S, V, max = Math.max(r, g, b), min = Math.min(r, g, b), delta = max - min; V = max; S = 0 === max ? 0 : 1 - min / max; if (max === min) { H = 0 } else { switch (max) { case r: H = 60 * ((g - b) / delta); if (g < b) { H += 360 } break; case g: H = 60 * ((b - r) / delta) + 120; break; case b: H = 60 * ((r - g) / delta) + 240 } } S *= 100; V *= 100 / 255; return { h: Math.round(H), s: Math.round(S), v: Math.round(V) } } function hsvToRgb(h, s, v) { var vDec, vInc, vMin, index, a, r, g, b; index = Math.floor(h % 360 / 60); vMin = (100 - s) * v / 100; a = (v - vMin) * (h % 60 / 60); vInc = vMin + a; 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 h, s, max = Math.max(r, g, b), min = Math.min(r, g, b), maxMinSum = max + min, l = maxMinSum / 2; if (max === min) { h = s = 0 } else { var delta = max - min; if (l > .5) { s = delta / (2 - maxMinSum) } else { s = delta / maxMinSum } h = calculateHue(r, g, b, delta); h /= 6 } return { h: _round(360 * h), s: _round(100 * s), l: _round(100 * l) } } function 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, g, b; h = convertTo01Bounds(h, 360); s = convertTo01Bounds(s, 100); l = convertTo01Bounds(l, 100); if (0 === s) { r = g = b = l } else { var q = l < .5 ? l * (1 + s) : l + s - l * s, p = 2 * l - q; r = hueToRgb(p, q, 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), 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, 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/ui/validation_engine.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _class = __webpack_require__( /*! ../core/class */ 15); var _class2 = _interopRequireDefault(_class); 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 _events_mixin = __webpack_require__( /*! ../core/events_mixin */ 85); var _events_mixin2 = _interopRequireDefault(_events_mixin); var _errors = __webpack_require__( /*! ../core/errors */ 21); var _errors2 = _interopRequireDefault(_errors); var _common = __webpack_require__( /*! ../core/utils/common */ 4); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _type2 = _interopRequireDefault(_type); var _number = __webpack_require__( /*! ../localization/number */ 51); var _number2 = _interopRequireDefault(_number); var _message = __webpack_require__( /*! ../localization/message */ 10); var _message2 = _interopRequireDefault(_message); var _promise = __webpack_require__( /*! ../core/polyfills/promise */ 67); var _promise2 = _interopRequireDefault(_promise); var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && ("object" === typeof call || "function" === typeof call) ? call : self } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } var STATUS = { valid: "valid", invalid: "invalid", pending: "pending" }; var BaseRuleValidator = function() { function BaseRuleValidator() { _classCallCheck(this, BaseRuleValidator); this.NAME = "base" } _createClass(BaseRuleValidator, [{ key: "defaultMessage", value: function(value) { return _message2.default.getFormatter("validation-" + this.NAME)(value) } }, { key: "defaultFormattedMessage", value: function(value) { return _message2.default.getFormatter("validation-" + this.NAME + "-formatted")(value) } }, { key: "_isValueEmpty", value: function(value) { return !rulesValidators.required.validate(value, {}) } }, { key: "validate", value: function(value, rule) { var _this = this; var valueArray = Array.isArray(value) ? value : [value]; var result = true; if (valueArray.length) { valueArray.every(function(itemValue) { result = _this._validate(itemValue, rule); return result }) } else { result = this._validate(null, rule) } return result } }]); return BaseRuleValidator }(); var RequiredRuleValidator = function(_BaseRuleValidator) { _inherits(RequiredRuleValidator, _BaseRuleValidator); function RequiredRuleValidator() { _classCallCheck(this, RequiredRuleValidator); var _this2 = _possibleConstructorReturn(this, (RequiredRuleValidator.__proto__ || Object.getPrototypeOf(RequiredRuleValidator)).call(this)); _this2.NAME = "required"; return _this2 } _createClass(RequiredRuleValidator, [{ key: "_validate", value: function(value, rule) { if (!_type2.default.isDefined(value)) { return false } if (false === value) { return false } value = String(value); if (rule.trim || !_type2.default.isDefined(rule.trim)) { value = value.trim() } return "" !== value } }]); return RequiredRuleValidator }(BaseRuleValidator); var NumericRuleValidator = function(_BaseRuleValidator2) { _inherits(NumericRuleValidator, _BaseRuleValidator2); function NumericRuleValidator() { _classCallCheck(this, NumericRuleValidator); var _this3 = _possibleConstructorReturn(this, (NumericRuleValidator.__proto__ || Object.getPrototypeOf(NumericRuleValidator)).call(this)); _this3.NAME = "numeric"; return _this3 } _createClass(NumericRuleValidator, [{ key: "_validate", value: function(value, rule) { if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } if (rule.useCultureSettings && _type2.default.isString(value)) { return !isNaN(_number2.default.parse(value)) } else { return _type2.default.isNumeric(value) } } }]); return NumericRuleValidator }(BaseRuleValidator); var RangeRuleValidator = function(_BaseRuleValidator3) { _inherits(RangeRuleValidator, _BaseRuleValidator3); function RangeRuleValidator() { _classCallCheck(this, RangeRuleValidator); var _this4 = _possibleConstructorReturn(this, (RangeRuleValidator.__proto__ || Object.getPrototypeOf(RangeRuleValidator)).call(this)); _this4.NAME = "range"; return _this4 } _createClass(RangeRuleValidator, [{ key: "_validate", value: function(value, rule) { if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } var validNumber = rulesValidators.numeric.validate(value, rule), validValue = _type2.default.isDefined(value) && "" !== value, number = validNumber ? parseFloat(value) : validValue && value.valueOf(), min = rule.min, max = rule.max; if (!(validNumber || _type2.default.isDate(value)) && !validValue) { return false } if (_type2.default.isDefined(min)) { if (_type2.default.isDefined(max)) { return number >= min && number <= max } return number >= min } else { if (_type2.default.isDefined(max)) { return number <= max } else { throw _errors2.default.Error("E0101") } } } }]); return RangeRuleValidator }(BaseRuleValidator); var StringLengthRuleValidator = function(_BaseRuleValidator4) { _inherits(StringLengthRuleValidator, _BaseRuleValidator4); function StringLengthRuleValidator() { _classCallCheck(this, StringLengthRuleValidator); var _this5 = _possibleConstructorReturn(this, (StringLengthRuleValidator.__proto__ || Object.getPrototypeOf(StringLengthRuleValidator)).call(this)); _this5.NAME = "stringLength"; return _this5 } _createClass(StringLengthRuleValidator, [{ key: "_validate", value: function(value, rule) { value = _type2.default.isDefined(value) ? String(value) : ""; if (rule.trim || !_type2.default.isDefined(rule.trim)) { value = value.trim() } if (rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } return rulesValidators.range.validate(value.length, (0, _extend.extend)({}, rule)) } }]); return StringLengthRuleValidator }(BaseRuleValidator); var CustomRuleValidator = function(_BaseRuleValidator5) { _inherits(CustomRuleValidator, _BaseRuleValidator5); function CustomRuleValidator() { _classCallCheck(this, CustomRuleValidator); var _this6 = _possibleConstructorReturn(this, (CustomRuleValidator.__proto__ || Object.getPrototypeOf(CustomRuleValidator)).call(this)); _this6.NAME = "custom"; return _this6 } _createClass(CustomRuleValidator, [{ key: "validate", value: function(value, rule) { if (rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } var validator = rule.validator, dataGetter = validator && _type2.default.isFunction(validator.option) && validator.option("dataGetter"), extraParams = _type2.default.isFunction(dataGetter) && dataGetter(), params = { value: value, validator: validator, rule: rule }; if (extraParams) { (0, _extend.extend)(params, extraParams) } return rule.validationCallback(params) } }]); return CustomRuleValidator }(BaseRuleValidator); var AsyncRuleValidator = function(_CustomRuleValidator) { _inherits(AsyncRuleValidator, _CustomRuleValidator); function AsyncRuleValidator() { _classCallCheck(this, AsyncRuleValidator); var _this7 = _possibleConstructorReturn(this, (AsyncRuleValidator.__proto__ || Object.getPrototypeOf(AsyncRuleValidator)).call(this)); _this7.NAME = "async"; return _this7 } _createClass(AsyncRuleValidator, [{ key: "validate", value: function(value, rule) { if (!_type2.default.isDefined(rule.reevaluate)) { (0, _extend.extend)(rule, { reevaluate: true }) } if (rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } var validator = rule.validator, dataGetter = validator && _type2.default.isFunction(validator.option) && validator.option("dataGetter"), extraParams = _type2.default.isFunction(dataGetter) && dataGetter(), params = { value: value, validator: validator, rule: rule }; if (extraParams) { (0, _extend.extend)(params, extraParams) } var callbackResult = rule.validationCallback(params); if (!_type2.default.isPromise(callbackResult)) { throw _errors2.default.Error("E0103") } return this._getWrappedPromise((0, _deferred.fromPromise)(callbackResult).promise()) } }, { key: "_getWrappedPromise", value: function(promise) { var deferred = new _deferred.Deferred; promise.then(function(res) { deferred.resolve(res) }, function(err) { var res = { isValid: false }; if (_type2.default.isDefined(err)) { if (_type2.default.isString(err)) { res.message = err } else { if (_type2.default.isObject(err) && _type2.default.isDefined(err.message) && _type2.default.isString(err.message)) { res.message = err.message } } } deferred.resolve(res) }); return deferred.promise() } }]); return AsyncRuleValidator }(CustomRuleValidator); var CompareRuleValidator = function(_BaseRuleValidator6) { _inherits(CompareRuleValidator, _BaseRuleValidator6); function CompareRuleValidator() { _classCallCheck(this, CompareRuleValidator); var _this8 = _possibleConstructorReturn(this, (CompareRuleValidator.__proto__ || Object.getPrototypeOf(CompareRuleValidator)).call(this)); _this8.NAME = "compare"; return _this8 } _createClass(CompareRuleValidator, [{ key: "_validate", value: function(value, rule) { if (!rule.comparisonTarget) { throw _errors2.default.Error("E0102") } if (rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true }(0, _extend.extend)(rule, { reevaluate: true }); var otherValue = rule.comparisonTarget(), type = rule.comparisonType || "=="; switch (type) { case "==": return value == otherValue; case "!=": return value != otherValue; case "===": return value === otherValue; case "!==": return value !== otherValue; case ">": return value > otherValue; case ">=": return value >= otherValue; case "<": return value < otherValue; case "<=": return value <= otherValue } } }]); return CompareRuleValidator }(BaseRuleValidator); var PatternRuleValidator = function(_BaseRuleValidator7) { _inherits(PatternRuleValidator, _BaseRuleValidator7); function PatternRuleValidator() { _classCallCheck(this, PatternRuleValidator); var _this9 = _possibleConstructorReturn(this, (PatternRuleValidator.__proto__ || Object.getPrototypeOf(PatternRuleValidator)).call(this)); _this9.NAME = "pattern"; return _this9 } _createClass(PatternRuleValidator, [{ key: "_validate", value: function(value, rule) { if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } var pattern = rule.pattern; if (_type2.default.isString(pattern)) { pattern = new RegExp(pattern) } return pattern.test(value) } }]); return PatternRuleValidator }(BaseRuleValidator); var EmailRuleValidator = function(_BaseRuleValidator8) { _inherits(EmailRuleValidator, _BaseRuleValidator8); function EmailRuleValidator() { _classCallCheck(this, EmailRuleValidator); var _this10 = _possibleConstructorReturn(this, (EmailRuleValidator.__proto__ || Object.getPrototypeOf(EmailRuleValidator)).call(this)); _this10.NAME = "email"; return _this10 } _createClass(EmailRuleValidator, [{ key: "_validate", value: function(value, rule) { if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) { return true } return rulesValidators.pattern.validate(value, (0, _extend.extend)({}, rule, { pattern: /^[\d\w._-]+@([\d\w._-]+\.)+[\w]+$/i })) } }]); return EmailRuleValidator }(BaseRuleValidator); var rulesValidators = { required: new RequiredRuleValidator, numeric: new NumericRuleValidator, range: new RangeRuleValidator, stringLength: new StringLengthRuleValidator, custom: new CustomRuleValidator, async: new AsyncRuleValidator, compare: new CompareRuleValidator, pattern: new PatternRuleValidator, email: new EmailRuleValidator }; var GroupConfig = _class2.default.inherit({ ctor: function(group) { this.group = group; this.validators = []; this._pendingValidators = []; this._onValidatorStatusChanged = this._onValidatorStatusChanged.bind(this); this._resetValidationInfo() }, validate: function() { var _this11 = this; var result = { isValid: true, brokenRules: [], validators: [], status: STATUS.valid, complete: null }; this._unsubscribeFromAllChangeEvents(); this._pendingValidators = []; this._resetValidationInfo(); (0, _iterator.each)(this.validators, function(_, validator) { var validatorResult = validator.validate(); result.isValid = result.isValid && validatorResult.isValid; if (validatorResult.brokenRules) { result.brokenRules = result.brokenRules.concat(validatorResult.brokenRules) } result.validators.push(validator); if (validatorResult.status === STATUS.pending) { _this11._addPendingValidator(validator) } _this11._subscribeToChangeEvents(validator) }); if (this._pendingValidators.length) { result.status = STATUS.pending } else { result.status = result.isValid ? STATUS.valid : STATUS.invalid; this._unsubscribeFromAllChangeEvents(); this._raiseValidatedEvent(result) } this._updateValidationInfo(result); return (0, _extend.extend)({}, this._validationInfo.result) }, _subscribeToChangeEvents: function(validator) { validator.on("validating", this._onValidatorStatusChanged); validator.on("validated", this._onValidatorStatusChanged) }, _unsubscribeFromChangeEvents: function(validator) { validator.off("validating", this._onValidatorStatusChanged); validator.off("validated", this._onValidatorStatusChanged) }, _unsubscribeFromAllChangeEvents: function() { var _this12 = this; (0, _iterator.each)(this.validators, function(_, validator) { _this12._unsubscribeFromChangeEvents(validator) }) }, _updateValidationInfo: function(result) { this._validationInfo.result = result; if (result.status !== STATUS.pending) { return } if (!this._validationInfo.deferred) { this._validationInfo.deferred = new _deferred.Deferred; this._validationInfo.result.complete = this._validationInfo.deferred.promise() } }, _addPendingValidator: function(validator) { var foundValidator = (0, _common.grep)(this._pendingValidators, function(val) { return val === validator })[0]; if (!foundValidator) { this._pendingValidators.push(validator) } }, _removePendingValidator: function(validator) { var index = (0, _array.inArray)(validator, this._pendingValidators); if (index >= 0) { this._pendingValidators.splice(index, 1) } }, _orderBrokenRules: function(brokenRules) { var orderedRules = []; (0, _iterator.each)(this.validators, function(_, validator) { var foundRules = (0, _common.grep)(brokenRules, function(rule) { return rule.validator === validator }); if (foundRules.length) { orderedRules = orderedRules.concat(foundRules) } }); return orderedRules }, _updateBrokenRules: function(result) { if (!this._validationInfo.result) { return } var brokenRules = this._validationInfo.result.brokenRules; var rules = (0, _common.grep)(brokenRules, function(rule) { return rule.validator !== result.validator }); if (result.brokenRules) { brokenRules = rules.concat(result.brokenRules) } this._validationInfo.result.brokenRules = this._orderBrokenRules(brokenRules) }, _onValidatorStatusChanged: function(result) { if (result.status === STATUS.pending) { this._addPendingValidator(result.validator); return } this._resolveIfComplete(result) }, _resolveIfComplete: function(result) { this._removePendingValidator(result.validator); this._updateBrokenRules(result); if (!this._pendingValidators.length) { this._unsubscribeFromAllChangeEvents(); if (!this._validationInfo.result) { return } this._validationInfo.result.status = 0 === this._validationInfo.result.brokenRules.length ? STATUS.valid : STATUS.invalid; this._validationInfo.result.isValid = this._validationInfo.result.status === STATUS.valid; var res = (0, _extend.extend)({}, this._validationInfo.result, { complete: null }), deferred = this._validationInfo.deferred; this._resetValidationInfo(); this._raiseValidatedEvent(res); deferred && setTimeout(function() { deferred.resolve(res) }) } }, _raiseValidatedEvent: function(result) { this.fireEvent("validated", [result]) }, _resetValidationInfo: function() { this._validationInfo = { result: null, deferred: null } }, _synchronizeValidationInfo: function() { if (this._validationInfo.result) { this._validationInfo.result.validators = this.validators } }, removeRegisteredValidator: function(validator) { var index = (0, _array.inArray)(validator, this.validators); if (index > -1) { this.validators.splice(index, 1); this._synchronizeValidationInfo(); this._resolveIfComplete({ validator: validator }) } }, registerValidator: function(validator) { if ((0, _array.inArray)(validator, this.validators) < 0) { this.validators.push(validator); this._synchronizeValidationInfo() } }, reset: function() { (0, _iterator.each)(this.validators, function(_, validator) { validator.reset() }); this._pendingValidators = []; this._resetValidationInfo() } }).include(_events_mixin2.default); var ValidationEngine = { groups: [], getGroupConfig: function(group) { var result = (0, _common.grep)(this.groups, function(config) { return config.group === group }); if (result.length) { return result[0] } }, findGroup: function($element, model) { var $dxGroup = $element.parents(".dx-validationgroup").first(); if ($dxGroup.length) { return $dxGroup.dxValidationGroup("instance") } return model }, initGroups: function() { this.groups = []; this.addGroup() }, addGroup: function(group) { var config = this.getGroupConfig(group); if (!config) { config = new GroupConfig(group); this.groups.push(config) } return config }, removeGroup: function(group) { var config = this.getGroupConfig(group), index = (0, _array.inArray)(config, this.groups); if (index > -1) { this.groups.splice(index, 1) } return config }, _setDefaultMessage: function(info) { var rule = info.rule, validator = info.validator, name = info.name; if (!_type2.default.isDefined(rule.message)) { if (validator.defaultFormattedMessage && _type2.default.isDefined(name)) { rule.message = validator.defaultFormattedMessage(name) } else { rule.message = validator.defaultMessage() } } }, _addBrokenRule: function(info) { var result = info.result, rule = info.rule; if (!result.brokenRule) { result.brokenRule = rule } if (!result.brokenRules) { result.brokenRules = [] } result.brokenRules.push(rule) }, validate: function(value, rules, name) { var _this13 = this; var result = { name: name, value: value, brokenRule: null, brokenRules: null, isValid: true, validationRules: rules, pendingRules: null, status: STATUS.valid, complete: null }; var asyncRuleItems = []; (0, _iterator.each)(rules || [], function(_, rule) { var ruleValidator = rulesValidators[rule.type]; var ruleValidationResult = void 0; if (ruleValidator) { if (_type2.default.isDefined(rule.isValid) && rule.value === value && !rule.reevaluate) { if (!rule.isValid) { result.isValid = false; _this13._addBrokenRule({ result: result, rule: rule }); return false } return true } rule.value = value; if ("async" === rule.type) { asyncRuleItems.push({ rule: rule, ruleValidator: ruleValidator }); return true } ruleValidationResult = ruleValidator.validate(value, rule); rule.isValid = ruleValidationResult; if (!ruleValidationResult) { result.isValid = false; _this13._setDefaultMessage({ rule: rule, validator: ruleValidator, name: name }); _this13._addBrokenRule({ result: result, rule: rule }) } if (!rule.isValid) { return false } } else { throw _errors2.default.Error("E0100") } }); if (result.isValid && !result.brokenRules && asyncRuleItems.length) { result = this._validateAsyncRules({ value: value, items: asyncRuleItems, result: result, name: name }) } result.status = result.pendingRules ? STATUS.pending : result.isValid ? STATUS.valid : STATUS.invalid; return result }, _validateAsyncRules: function(_ref) { var _this14 = this; var result = _ref.result, value = _ref.value, items = _ref.items, name = _ref.name; var asyncResults = []; (0, _iterator.each)(items, function(_, item) { var validateResult = item.ruleValidator.validate(value, item.rule); if (!_type2.default.isPromise(validateResult)) { _this14._updateRuleConfig({ rule: item.rule, ruleResult: _this14._getPatchedRuleResult(validateResult), validator: item.ruleValidator, name: name }) } else { if (!result.pendingRules) { result.pendingRules = [] } result.pendingRules.push(item.rule); var asyncResult = validateResult.then(function(res) { var ruleResult = _this14._getPatchedRuleResult(res); _this14._updateRuleConfig({ rule: item.rule, ruleResult: ruleResult, validator: item.ruleValidator, name: name }); return ruleResult }); asyncResults.push(asyncResult) } }); if (asyncResults.length) { result.complete = _promise2.default.all(asyncResults).then(function(values) { return _this14._getAsyncRulesResult({ result: result, values: values }) }) } return result }, _updateRuleConfig: function(_ref2) { var rule = _ref2.rule, ruleResult = _ref2.ruleResult, validator = _ref2.validator, name = _ref2.name; rule.isValid = ruleResult.isValid; if (!ruleResult.isValid) { if (_type2.default.isDefined(ruleResult.message) && _type2.default.isString(ruleResult.message) && ruleResult.message.length) { rule.message = ruleResult.message } else { this._setDefaultMessage({ rule: rule, validator: validator, name: name }) } } }, _getPatchedRuleResult: function(ruleResult) { var result = void 0; var isValid = true; if (_type2.default.isObject(ruleResult)) { result = (0, _extend.extend)({}, ruleResult); if (!_type2.default.isDefined(result.isValid)) { result.isValid = isValid } } else { result = { isValid: _type2.default.isBoolean(ruleResult) ? ruleResult : isValid } } return result }, _getAsyncRulesResult: function(_ref3) { var _this15 = this; var values = _ref3.values, result = _ref3.result; (0, _iterator.each)(values, function(index, val) { if (false === val.isValid) { result.isValid = val.isValid; var rule = result.pendingRules[index]; _this15._addBrokenRule({ result: result, rule: rule }) } }); result.pendingRules = null; result.complete = null; result.status = result.isValid ? STATUS.valid : STATUS.invalid; return result }, registerValidatorInGroup: function(group, validator) { var groupConfig = ValidationEngine.addGroup(group); groupConfig.registerValidator.call(groupConfig, validator) }, _shouldRemoveGroup: function(group, validatorsInGroup) { var isDefaultGroup = void 0 === group, isValidationGroupInstance = group && "dxValidationGroup" === group.NAME; return !isDefaultGroup && !isValidationGroupInstance && !validatorsInGroup.length }, removeRegisteredValidator: function(group, validator) { var config = ValidationEngine.getGroupConfig(group); if (config) { config.removeRegisteredValidator.call(config, validator); var validatorsInGroup = config.validators; if (this._shouldRemoveGroup(group, validatorsInGroup)) { this.removeGroup(group) } } }, initValidationOptions: function(options) { var _this16 = this; var initedOptions = {}; if (options) { var syncOptions = ["isValid", "validationStatus", "validationError", "validationErrors"]; syncOptions.forEach(function(prop) { if (prop in options) { (0, _extend.extend)(initedOptions, _this16.synchronizeValidationOptions({ name: prop, value: options[prop] }, options)) } }) } return initedOptions }, synchronizeValidationOptions: function(_ref4, options) { var name = _ref4.name, value = _ref4.value; switch (name) { case "validationStatus": var isValid = value === STATUS.valid || value === STATUS.pending; return options.isValid !== isValid ? { isValid: isValid } : {}; case "isValid": var validationStatus = options.validationStatus; var newStatus = validationStatus; if (value && validationStatus === STATUS.invalid) { newStatus = STATUS.valid } else { if (!value && validationStatus !== STATUS.invalid) { newStatus = STATUS.invalid } } return newStatus !== validationStatus ? { validationStatus: newStatus } : {}; case "validationErrors": var validationError = !value || !value.length ? null : value[0]; return options.validationError !== validationError ? { validationError: validationError } : {}; case "validationError": var validationErrors = options.validationErrors; if (!value && validationErrors) { return { validationErrors: null } } else { if (value && !validationErrors) { return { validationErrors: [value] } } else { if (value && validationErrors && value !== validationErrors[0]) { validationErrors[0] = value; return { validationErrors: validationErrors.slice() } } } } } return {} }, validateGroup: function(group) { var groupConfig = ValidationEngine.getGroupConfig(group); if (!groupConfig) { throw _errors2.default.Error("E0110") } return groupConfig.validate() }, resetGroup: function(group) { var groupConfig = ValidationEngine.getGroupConfig(group); if (!groupConfig) { throw _errors2.default.Error("E0110") } return groupConfig.reset() } }; ValidationEngine.initGroups(); module.exports = ValidationEngine }, /*!**************************************************!*\ !*** ./artifacts/transpiled/core/utils/style.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var camelize = __webpack_require__( /*! ./inflector */ 33).camelize, callOnce = __webpack_require__( /*! ./call_once */ 61), typeUtils = __webpack_require__( /*! ./type */ 1), domAdapter = __webpack_require__( /*! ../dom_adapter */ 13); var jsPrefixes = ["", "Webkit", "Moz", "O", "Ms"], cssPrefixes = { "": "", Webkit: "-webkit-", Moz: "-moz-", O: "-o-", ms: "-ms-" }, 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 */ 65).logger, dependencyInjector = __webpack_require__( /*! ./dependency_injector */ 56); 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/events/hold.js ***! \*********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var eventUtils = __webpack_require__( /*! ./utils */ 8), Emitter = __webpack_require__( /*! ./core/emitter */ 126), registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 96), abs = Math.abs; var HOLD_EVENT_NAME = "dxhold", HOLD_TIMEOUT = 750, TOUCH_BOUNDARY = 5; var HoldEmitter = Emitter.inherit({ start: function(e) { this._startEventData = eventUtils.eventData(e); this._startTimer(e) }, _startTimer: function(e) { var holdTimeout = "timeout" in this ? this.timeout : HOLD_TIMEOUT; this._holdTimer = setTimeout(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 */ 512) }, /*!**************************************************************!*\ !*** ./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 */ 44); 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 */ 11); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); var _window2 = _interopRequireDefault(_window); var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 13); 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 */ 84); 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 */ 219); var _uiEventsEmitterGesture2 = _interopRequireDefault(_uiEventsEmitterGesture); var _uiScrollable = __webpack_require__( /*! ./ui.scrollable.simulated */ 308); var _uiScrollable2 = _interopRequireDefault(_uiScrollable); var _uiScrollable3 = __webpack_require__( /*! ./ui.scrollable.native */ 218); 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() && "desktop" === _devices2.default.real().deviceType && "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), $container = this._$container = (0, _renderer2.default)("
").addClass(SCROLLABLE_CONTAINER_CLASS), $wrapper = this._$wrapper = (0, _renderer2.default)("
").addClass(SCROLLABLE_WRAPPER_CLASS), $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) { 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.getScrollElementPosition($element, HORIZONTAL, offset) } if (direction !== HORIZONTAL) { scrollPosition.top = this.getScrollElementPosition($element, VERTICAL, offset) } this.scrollTo(scrollPosition) }, getScrollElementPosition: function($element, direction, offset) { offset = 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), commonUtils = __webpack_require__( /*! ../core/utils/common */ 4), typeUtils = __webpack_require__( /*! ../core/utils/type */ 1), isDefined = typeUtils.isDefined, isPromise = typeUtils.isPromise, extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray, each = __webpack_require__( /*! ../core/utils/iterator */ 3).each, deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6), getPublicElement = __webpack_require__( /*! ../core/utils/dom */ 11).getPublicElement, Deferred = deferredUtils.Deferred, errors = __webpack_require__( /*! ../core/errors */ 21), domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 13), inkRipple = __webpack_require__( /*! ./widget/utils.ink_ripple */ 70), messageLocalization = __webpack_require__( /*! ../localization/message */ 10), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9), DropDownList = __webpack_require__( /*! ./drop_down_editor/ui.drop_down_list */ 216); var DISABLED_STATE_SELECTOR = ".dx-state-disabled", SELECTBOX_CLASS = "dx-selectbox", SELECTBOX_POPUP_CLASS = "dx-selectbox-popup", SELECTBOX_CONTAINER_CLASS = "dx-selectbox-container", SELECTBOX_POPUP_WRAPPER_CLASS = "dx-selectbox-popup-wrapper"; var SelectBox = DropDownList.inherit({ _supportedKeys: function() { var that = this, parent = this.callBase(), clearSelectBox = function(e) { var isEditable = this._isEditable(); if (!isEditable) { if (this.option("showClearButton")) { e.preventDefault(); this.reset() } } else { if (this._valueSubstituted()) { this._preventFiltering = true } } this._preventSubstitution = true }; var searchIfNeeded = function() { if (that.option("searchEnabled") && that._valueSubstituted()) { that._searchHandler() } }; return extend({}, parent, { tab: function() { 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(); if (isOpened) { this._toggleOpenState() } } return isOpened } if (parent.enter && parent.enter.apply(this, arguments)) { return isOpened } } }, space: function(e) { var isOpened = this.option("opened"), isSearchEnabled = this.option("searchEnabled"), 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(), index = inArray(this.option("selectedItem"), this.option("items")), 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(), 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), 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(), hasPages = this._dataSource.pageSize(), isLastPage = this._dataSource.isLastPage(), isLastItem = selectedIndex === this._items().length - 1; if (hasPages && !isLastPage && isLastItem && step > 0) { if (!this._popup) { this._createPopup() } 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._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, focusedElement = $(list.option("focusedElement")), 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() } 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() { if (this.option("readOnly")) { return } this._loadItemDeferred && this._loadItemDeferred.always(function() { var initialSelectedItem = this.option("selectedItem"); if (this.option("acceptCustomValue")) { this._updateField(initialSelectedItem); 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() } this.callBase(e) }, _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, 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"), searchValue = this._searchValue(), selectedItemText = this._displayGetter(selectedItem); return !selectedItemText || searchValue !== selectedItemText.toString() }, _valueChangeEventHandler: function() { if (this.option("acceptCustomValue") && this._isCustomItemSelected()) { this._customItemAddedHandler() } }, _initCustomItemCreatingAction: function() { this._customItemCreatingAction = this._createActionByOption("onCustomItemCreating") }, _createCustomItem: function(text) { var params = { text: text }, actionResult = this._customItemCreatingAction(params), item = commonUtils.ensureDefined(actionResult, params.customItem); if (isDefined(actionResult)) { errors.log("W0015", "onCustomItemCreating", "customItem") } return item }, _customItemAddedHandler: function() { var searchValue = this._searchValue(), item = this._createCustomItem(searchValue); 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), isAllSelected = 0 === input.selectionStart && input.selectionEnd === this._searchValue().length, 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(), valueLength = $input.val().length; if (0 === valueLength) { return } var inputElement = $input.get(0), displayValue = this._displayGetter(item).toString(); inputElement.value = displayValue; this._caret({ start: valueLength, end: displayValue.length }) }, _cleanInputSelection: function() { var inputElement = this._input().get(0), 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 "selectedItem": if (args.previousValue !== args.value) { this.callBase(args) } break; case "allowClearing": break; default: this.callBase(args) } }, _clean: function() { delete this._inkRipple; this.callBase() } }); registerComponent("dxSelectBox", SelectBox); module.exports = SelectBox }, /*!*************************************************!*\ !*** ./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 */ 335); var _ui2 = _interopRequireDefault(_ui); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } module.exports = _ui2.default }, /*!*************************************************!*\ !*** ./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 */ 12); var _exporter = __webpack_require__( /*! ../../exporter */ 175); var _exporter2 = _interopRequireDefault(_exporter); var _message = __webpack_require__( /*! ../../localization/message */ 10); 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 */ 150); var _hover2 = _interopRequireDefault(_hover); var _pointer = __webpack_require__( /*! ../../events/pointer */ 23); var _pointer2 = _interopRequireDefault(_pointer); var _console = __webpack_require__( /*! ../../core/utils/console */ 65); 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) || _themes2.default.getTheme().backgroundColor; _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="' + (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 '' + 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, svgToCanvas: exportOptions.svgToCanvas, 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(); var promise = _exporter2.default.export(this._renderer.root.element, options, getCreatorFunc(options.format)).fail(_console.logger.error).always(function() { _this5._renderer.root.attr({ "pointer-events": pointerEventsValue }) }); menu && menu.show(); return promise }, 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," + eventArgs.data, { __test: options.__test }); eventArgs.cancel = true }; var pointerEventsValue = this._disablePointerEvents(); menu && menu.hide(); var promise = _exporter2.default.export(this._renderer.root.element, options, getCreatorFunc(options.format)).fail(_console.logger.error).always(function() { _this6._renderer.root.attr({ "pointer-events": pointerEventsValue }) }); menu && menu.show(); return promise } }, 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/events/core/emitter_registrator.js ***! \*****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2), readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 49), domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 13), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), dataUtils = __webpack_require__( /*! ../../core/element_data */ 40), Class = __webpack_require__( /*! ../../core/class */ 15), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray, each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, registerEvent = __webpack_require__( /*! ./event_registrator */ 72), eventUtils = __webpack_require__( /*! ../utils */ 8), pointerEvents = __webpack_require__( /*! ../pointer */ 23), wheelEvent = __webpack_require__( /*! ./wheel */ 127); var MANAGER_EVENT = "dxEventManager", 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, result = [], $element = $(e.target); function handleEmitter(_, emitter) { if (!!emitter && emitter.validatePointers(e) && emitter.validate(e)) { emitter.addCancelCallback(that._proxiedCancelHandler); emitter.addAcceptCallback(that._proxiedAcceptHandler); result.push(emitter) } } while ($element.length) { var emitters = 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), verticalGestureDirection = "both" === direction && !e.shiftKey || "vertical" === direction, prop = verticalGestureDirection ? "pageY" : "pageX"; e[prop] += e.delta }, isActive: function(element) { var result = false; this._eachEmitter(function(emitter) { result = result || emitter.getElement().is(element) }); return result } }); var eventManager = new EventManager; var EMITTER_SUBSCRIPTION_DATA = "dxEmitterSubscription"; var registerEmitter = function(emitterConfig) { var emitterClass = emitterConfig.emitter, emitterName = emitterConfig.events[0], emitterEvents = emitterConfig.events; each(emitterEvents, function(_, eventName) { registerEvent(eventName, { noBubble: !emitterConfig.bubble, setup: function(element) { var subscriptions = dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA) || {}, emitters = dataUtils.data(element, EMITTER_DATA) || {}, 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), emitter = emitters[emitterName]; emitter.configure(extend({ delegateSelector: handleObj.selector }, handleObj.data), handleObj.type) }, teardown: function(element) { var subscriptions = dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA), emitters = dataUtils.data(element, EMITTER_DATA), emitter = emitters[emitterName]; delete subscriptions[eventName]; var disposeEmitter = true; each(emitterEvents, function(_, eventName) { disposeEmitter = disposeEmitter && !subscriptions[eventName]; return disposeEmitter }); if (disposeEmitter) { if (eventManager.isActive(element)) { eventManager.resetEmitter(emitter) } emitter && emitter.dispose(); delete emitters[emitterName] } } }) }) }; module.exports = registerEmitter }, /*!***************************************************************!*\ !*** ./artifacts/transpiled/core/templates/empty_template.js ***! \***************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.EmptyTemplate = void 0; var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _renderer = __webpack_require__( /*! ../renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _template_base = __webpack_require__( /*! ./template_base */ 74); 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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && ("object" === typeof call || "function" === typeof call) ? call : self } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } } exports.EmptyTemplate = function(_TemplateBase) { _inherits(EmptyTemplate, _TemplateBase); function EmptyTemplate() { _classCallCheck(this, EmptyTemplate); return _possibleConstructorReturn(this, (EmptyTemplate.__proto__ || Object.getPrototypeOf(EmptyTemplate)).apply(this, arguments)) } _createClass(EmptyTemplate, [{ key: "_renderCore", value: function() { return (0, _renderer2.default)() } }]); return EmptyTemplate }(_template_base.TemplateBase) }, /*!******************************************************!*\ !*** ./artifacts/transpiled/viz/core/base_widget.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2), noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7), domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 13), typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, version = __webpack_require__( /*! ../../core/version */ 133), _windowResizeCallbacks = __webpack_require__( /*! ../../core/utils/resize_callbacks */ 134), _stringFormat = __webpack_require__( /*! ../../core/utils/string */ 45).format, _isObject = __webpack_require__( /*! ../../core/utils/type */ 1).isObject, extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, themeManagerModule = __webpack_require__( /*! ../core/base_theme_manager */ 246), _floor = Math.floor, DOMComponentWithTemplate = __webpack_require__( /*! ../../core/dom_component_with_template */ 171), helpers = __webpack_require__( /*! ./helpers */ 144), _parseScalar = __webpack_require__( /*! ./utils */ 12).parseScalar, errors = __webpack_require__( /*! ./errors_warnings */ 793), _log = errors.log, rendererModule = __webpack_require__( /*! ./renderers/renderer */ 158), _Layout = __webpack_require__( /*! ./layout */ 795), devices = __webpack_require__( /*! ../../core/devices */ 16), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), OPTION_RTL_ENABLED = "rtlEnabled", SIZED_ELEMENT_CLASS = "dx-sized-element", _option = DOMComponentWithTemplate.prototype.option; function getTrue() { return true } function getFalse() { return false } function areCanvasesDifferent(canvas1, canvas2) { return !(canvas1.width === canvas2.width && canvas1.height === canvas2.height && canvas1.left === canvas2.left && canvas1.top === canvas2.top && canvas1.right === canvas2.right && canvas1.bottom === canvas2.bottom) } function createResizeHandler(callback) { var timeout, handler = function() { clearTimeout(timeout); timeout = setTimeout(callback, 100) }; handler.dispose = function() { clearTimeout(timeout); return this }; return handler } function defaultOnIncidentOccurred(e) { 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 = { _initTemplates: function() {}, 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 = DOMComponentWithTemplate.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() : DOMComponentWithTemplate.inherit({ _eventsMap: { onIncidentOccurred: { name: "incidentOccurred" }, onDrawn: { name: "drawn" } }, _getDefaultOptions: function() { return extend(this.callBase(), { onIncidentOccurred: defaultOnIncidentOccurred }) }, _extractAnonymousTemplate: function() {}, _useLinks: true, _init: function() { var linkTarget, 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(); 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, 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 i, that = this, changes = that._changes, order = that._totalChangesOrder, ii = order.length; for (i = 0; i < ii; ++i) { if (changes.has(order[i])) { that["_change_" + order[i]]() } } }, _optionChangesOrder: ["EVENTS", "THEME", "RENDERER", "RESIZE_HANDLER"], _layoutChangesOrder: ["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, 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(), 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, size = that.option("size") || {}, margin = that.option("margin") || {}, defaultCanvas = that._getDefaultSize() || {}, elementWidth = !sizeIsValid(size.width) && windowUtils.hasWindow() ? that._$element.width() : 0, elementHeight = !sizeIsValid(size.height) && windowUtils.hasWindow() ? that._$element.height() : 0, 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, 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 nextRect, canvas = this._canvas, layout = this._layout, rect = canvas.width > 0 && canvas.height > 0 ? [canvas.left, canvas.top, canvas.width - canvas.right, canvas.height - canvas.bottom] : [0, 0, 0, 0]; rect = layout.forward(rect, this._getMinSize()); 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), option = this.option(name); return isScalar ? void 0 !== option ? option : theme : extend(true, {}, theme, option) }, _setupResizeHandler: function() { var that = this, 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 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/templates/function_template.js ***! \******************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.FunctionTemplate = void 0; var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _template_base = __webpack_require__( /*! ./template_base */ 74); var _dom = __webpack_require__( /*! ../utils/dom */ 11); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && ("object" === typeof call || "function" === typeof call) ? call : self } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } } exports.FunctionTemplate = function(_TemplateBase) { _inherits(FunctionTemplate, _TemplateBase); function FunctionTemplate(render) { _classCallCheck(this, FunctionTemplate); var _this = _possibleConstructorReturn(this, (FunctionTemplate.__proto__ || Object.getPrototypeOf(FunctionTemplate)).call(this)); _this._render = render; return _this } _createClass(FunctionTemplate, [{ key: "_renderCore", value: function(options) { return (0, _dom.normalizeTemplateElement)(this._render(options)) } }]); return FunctionTemplate }(_template_base.TemplateBase) }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/core/utils/position.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var config = __webpack_require__( /*! ../config */ 29); var getDefaultAlignment = function(isRtlEnabled) { var rtlEnabled = isRtlEnabled || config().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), abstract = Class.abstract, EventsMixin = __webpack_require__( /*! ../core/events_mixin */ 85), each = __webpack_require__( /*! ../core/utils/iterator */ 3).each, errorsModule = __webpack_require__( /*! ./errors */ 37), dataUtils = __webpack_require__( /*! ./utils */ 41), compileGetter = __webpack_require__( /*! ../core/utils/data */ 18).compileGetter, storeHelper = __webpack_require__( /*! ./store_helper */ 83), queryByOptions = storeHelper.queryByOptions, Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred, noop = __webpack_require__( /*! ../core/utils/common */ 4).noop, 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, 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/list.js ***! \*****************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var ListEdit = __webpack_require__( /*! ./list/ui.list.edit.search */ 521), 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), eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5), devices = __webpack_require__( /*! ../core/devices */ 16), extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, inkRipple = __webpack_require__( /*! ./widget/utils.ink_ripple */ 70), Editor = __webpack_require__( /*! ./editor/editor */ 48), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9), eventUtils = __webpack_require__( /*! ../events/utils */ 8), clickEvent = __webpack_require__( /*! ../events/click */ 20); var CHECKBOX_CLASS = "dx-checkbox", CHECKBOX_ICON_CLASS = "dx-checkbox-icon", CHECKBOX_CHECKED_CLASS = "dx-checkbox-checked", CHECKBOX_CONTAINER_CLASS = "dx-checkbox-container", CHECKBOX_TEXT_CLASS = "dx-checkbox-text", CHECKBOX_HAS_TEXT_CLASS = "dx-checkbox-has-text", CHECKBOX_INDETERMINATE_CLASS = "dx-checkbox-indeterminate", CHECKBOX_FEEDBACK_HIDE_TIMEOUT = 100; var CheckBox = Editor.inherit({ _supportedKeys: function() { var click = function(e) { e.preventDefault(); this._clickAction({ 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, 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(), checked = this.option("value"), 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/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", FOCUS_DISABLED_CLASS = "dx-cell-focus-disabled", FOCUSED_ROW_SELECTOR = ".dx-row-focused", GRID_ROW_SELECTOR = ".dx-datagrid-rowsview .dx-row", GRID_CELL_SELECTOR = GRID_ROW_SELECTOR + " > td", TREELIST_ROW_SELECTOR = ".dx-treelist-rowsview .dx-row", TREELIST_CELL_SELECTOR = TREELIST_ROW_SELECTOR + " > td", 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: ["" + FOCUSED_ROW_SELECTOR, GRID_ROW_SELECTOR + "[tabindex]", GRID_CELL_SELECTOR + "[tabindex]", "" + GRID_CELL_SELECTOR, TREELIST_ROW_SELECTOR + "[tabindex]", TREELIST_CELL_SELECTOR + "[tabindex]", "" + 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, isHiddenFocusing = false, 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), ariaLabel = $target.attr("aria-label"), $activeElements = getActiveAccessibleElements(ariaLabel, instance.element()), targetIndex = $activeElements.index($target); focusedElementInfo = (0, _extend.extend)({}, { ariaLabel: ariaLabel, index: targetIndex }, { viewInstance: instance }) } function getActiveAccessibleElements(ariaLabel, viewElement) { var $activeElements, $viewElement = (0, _renderer2.default)(viewElement); if (ariaLabel) { $activeElements = $viewElement.find('[aria-label="' + ariaLabel + '"][tabindex]') } else { $activeElements = $viewElement.find("[tabindex]") } return $activeElements } function findFocusedViewElement(viewSelectors) { for (var index in viewSelectors) { var selector = viewSelectors[index], $focusViewElement = void 0; $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()), $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), viewItemIndex = viewNames.indexOf(viewName); while (viewItemIndex >= 0 && viewItemIndex < viewNames.length) { viewItemIndex = "upArrow" === keyName ? --viewItemIndex : ++viewItemIndex; var _viewName = viewNames[viewItemIndex], viewSelectors = viewItemSelectorMap[_viewName], $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, _isString = __webpack_require__( /*! ../../core/utils/type */ 1).isString, extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, _patchFontOptions = __webpack_require__( /*! ./utils */ 12).patchFontOptions, parseHorizontalAlignment = __webpack_require__( /*! ./utils */ 12).enumParser(["left", "center", "right"]), parseVerticalAlignment = __webpack_require__( /*! ./utils */ 12).enumParser(["top", "bottom"]), 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 */ 247).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 titleBox, y, that = this, options = that._options, subtitleOptions = options.subtitle, titleElement = that._titleElement, subtitleElement = that._subtitleElement, testText = "A"; 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(); 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, 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, options = extend(true, {}, themeOptions, processTitleOptions(userOptions)), _hasText = hasText(options.text), 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 _getCorrectedLayoutOp = this.getCorrectedLayoutOptions(), x = _getCorrectedLayoutOp.x, y = _getCorrectedLayoutOp.y, height = _getCorrectedLayoutOp.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, box = that.getLayoutOptions(); that._group.move(x - box.x, y - box.y); return that }, _updateBoundingRect: function() { var box, that = this, options = that._options, margin = options.margin, boundingRect = that._boundingRect; 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, inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray, _each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, rangeCalculator = __webpack_require__( /*! ./helpers/range_data_calculator */ 252), typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), vizUtils = __webpack_require__( /*! ../core/utils */ 12), _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, _isDefined = typeUtils.isDefined, _isString = typeUtils.isString, _map = vizUtils.map, _normalizeEnum = vizUtils.normalizeEnum, math = Math, _abs = math.abs, _sqrt = math.sqrt, _max = math.max, DEFAULT_TRACKER_WIDTH = 12, DEFAULT_DURATION = 400, HIGH_ERROR = "highError", LOW_ERROR = "lowError", VARIANCE = "variance", STANDARD_DEVIATION = "stddeviation", STANDARD_ERROR = "stderror", PERCENT = "percent", FIXED = "fixed", UNDEFINED = "undefined", DISCRETE = "discrete", LOGARITHMIC = "logarithmic", DATETIME = "datetime"; exports.chart = {}; exports.polar = {}; function sum(array) { var result = 0; _each(array, function(_, value) { result += value }); return result } function isErrorBarTypeCorrect(type) { return 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, valueField = series.getValueFields()[0], lowValueField = errorBarsOptions.lowValueField || LOW_ERROR, 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, lowValueField = errorBarsOptions.lowValueField || LOW_ERROR, 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, 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 settings, that = this, errorBarOptions = that._options.valueErrorBar; if (that.areErrorBarsVisible()) { settings = { "class": "dxc-error-bars", stroke: errorBarOptions.color, "stroke-width": errorBarOptions.lineWidth, opacity: animationEnabled ? .001 : errorBarOptions.opacity || 1, "stroke-linecap": "square", sharp: true, "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 defaultPointOptions, normalStyle, that = this, creatingPointOptions = that._predefinedPointOptions; if (!creatingPointOptions) { defaultPointOptions = that._getPointOptions(); that._predefinedPointOptions = creatingPointOptions = _extend(true, { styles: {} }, defaultPointOptions); normalStyle = defaultPointOptions.styles && defaultPointOptions.styles.normal || {}; creatingPointOptions.styles = creatingPointOptions.styles || {}; creatingPointOptions.styles.normal = { "stroke-width": normalStyle["stroke-width"], r: normalStyle.r, opacity: normalStyle.opacity } } return creatingPointOptions }, _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 || {}, 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, mainPointColor = pointOptions.color || that._options.mainSeriesColor, containerColor = that._options.containerBackgroundColor, normalStyle = that._parsePointStyle(pointOptions, mainPointColor, mainPointColor); normalStyle.visibility = pointOptions.visible ? "visible" : "hidden"; return { normal: normalStyle, hover: that._parsePointStyle(pointOptions.hoverStyle, containerColor, mainPointColor, 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 = void 0, highValueField = void 0; 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, animationSettings = { duration: that._defaultDuration }; that._labelsGroup && that._labelsGroup.animate({ opacity: 1 }, animationSettings); that._errorBarGroup && that._errorBarGroup.animate({ opacity: that._options.valueErrorBar.opacity || 1 }, animationSettings) }, _animate: function() { var that = this, lastPointIndex = that._drawnPoints.length - 1; _each(that._drawnPoints || [], function(i, p) { p.animate(i === lastPointIndex ? function() { that._animateComplete() } : void 0, { translateX: p.x, translateY: p.y }) }) }, _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 lowValueField, highValueField, options = this._options, errorBarsOptions = options.valueErrorBar, valueFields = [options.valueField || "val"]; if (errorBarsOptions) { lowValueField = errorBarsOptions.lowValueField; highValueField = errorBarsOptions.highValueField; _isString(lowValueField) && valueFields.push(lowValueField); _isString(highValueField) && valueFields.push(highValueField) } return valueFields }, _calculateErrorBars: function(data) { if (!this.areErrorBarsVisible()) { return } var value, valueArray, valueArrayLength, meanValue, processDataItem, that = this, options = that._options, errorBarsOptions = options.valueErrorBar, errorBarType = _normalizeEnum(errorBarsOptions.type), floatErrorValue = parseFloat(errorBarsOptions.value), valueField = that.getValueFields()[0], lowValueField = errorBarsOptions.lowValueField || LOW_ERROR, highValueField = errorBarsOptions.highValueField || HIGH_ERROR, addSubError = function(_i, item) { value = item.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(), styles = pointOptions.styles, 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 trackers, trackersGroup, that = this, segments = that._segments || [], 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 minDistance, pCoord = this._options.rotated ? y : x, nCoord = pCoord, cat = this._trackersTranslator, point = null, oppositeCoord = this._options.rotated ? x : y, oppositeCoordName = this._options.rotated ? "vx" : "vy"; if (this.isVisible() && cat) { point = cat[pCoord]; do { point = cat[nCoord] || cat[pCoord]; pCoord--; nCoord++ } while ((pCoord >= 0 || nCoord < cat.length) && !point); if (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, rotated = that._options.rotated, visibleX = (rotated ? that.getValueAxis() : that.getArgumentAxis()).getVisibleArea(), 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 index, cat = this._trackersTranslator; if (!this.isVisible()) { return } _each(cat, function(i, category) { if (category) { index = i; return false } }); cat[index + 360] = cat[index] }, getNeighborPoint: function(x, y) { var pos = vizUtils.convertXYToPolar(this.getValueAxis().getCenter(), x, y); return exports.chart.getNeighborPoint.call(this, pos.phi, pos.r) }, _applyVisibleArea: function() { var that = this, 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 */ 13); 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 */ 158); 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 */ 12); var _utils2 = _interopRequireDefault(_utils); var _format_helper = __webpack_require__( /*! ../../format_helper */ 63); var _plaque = __webpack_require__( /*! ./plaque */ 411); 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(); var DEFAULT_HTML_GROUP_WIDTH = 3e3; 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 renderer, root, that = this; that._eventTrigger = params.eventTrigger; that._widgetRoot = params.widgetRoot; that._widget = params.widget; 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] }); 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, 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) }, setTemplate: function(contentTemplate) { var that = this; that._template = contentTemplate ? that._widget._getTemplate(contentTemplate) : null }, 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.setTemplate(options.contentTemplate); var drawTooltip = function(tooltip, group) { var state = tooltip._state; var template = tooltip._template; var useTemplate = template && !state.formatObject.skipTemplate; if (state.html || useTemplate) { if (!state.isRendered) { if (useTemplate) { template.render({ model: state.formatObject, container: textHtml }); state.html = textHtml.html(); if (!state.html) { _this.plaque.clear(); return } } else { that._text.attr({ text: "" }); textHtml.html(state.html) } textGroupHtml.css({ color: state.textColor, width: DEFAULT_HTML_GROUP_WIDTH }); state.isRendered = true } } else { that._text.css({ fill: state.textColor }).attr({ text: state.text, "class": options.cssClass }).append(group.attr({ align: options.textAlignment })) } tooltip.plaque.customizeCloud({ fill: state.color, stroke: state.borderColor }) }; 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, drawTooltip, true, function(tooltip, g) { var state = tooltip._state; if (state.html) { var bBox = void 0; 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 || !!this._template }, show: function(formatObject, params, eventData, customizeTooltip) { var that = this, state = { formatObject: formatObject }; if (!that._prepare(formatObject, state, customizeTooltip)) { return false } that._state = state; that._wrapper.appendTo(that._getContainer()); that._clear(); 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); if (that._eventData) { that._eventTrigger("tooltipHidden", that._eventData); that._clear(); that._eventData = null } }, _clear: function() { this._textHtml.empty() }, 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(), widget: this }) }, _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 _Range, typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, _isDefined = typeUtils.isDefined, _isDate = typeUtils.isDate, _isFunction = typeUtils.isFunction, unique = __webpack_require__( /*! ../core/utils */ 12).unique, minSelector = "min", maxSelector = "max", minVisibleSelector = "minVisible", maxVisibleSelector = "maxVisible", baseSelector = "base", axisTypeSelector = "axisType"; function otherLessThan(thisValue, otherValue) { return otherValue < thisValue } function otherGreaterThan(thisValue, otherValue) { return otherValue > thisValue } function compareAndReplace(thisValue, otherValue, setValue, compare) { var otherValueDefined = _isDefined(otherValue); if (_isDefined(thisValue)) { if (otherValueDefined && compare(thisValue, otherValue)) { setValue(otherValue) } } else { if (otherValueDefined) { setValue(otherValue) } } } _Range = exports.Range = function(range) { range && extend(this, range) }; _Range.prototype = { constructor: _Range, addRange: function(otherRange) { var that = this, categories = that.categories, otherCategories = otherRange.categories; var compareAndReplaceByField = function(field, compare) { compareAndReplace(that[field], otherRange[field], function(value) { that[field] = value }, compare) }; var controlValuesByVisibleBounds = function(valueField, visibleValueField, compare) { compareAndReplace(that[valueField], that[visibleValueField], function(value) { _isDefined(that[valueField]) && (that[valueField] = value) }, compare) }; var checkField = function(field) { that[field] = that[field] || otherRange[field] }; 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 } if ("logarithmic" === that[axisTypeSelector]) { checkField("allowNegatives"); compareAndReplaceByField("linearThreshold", otherLessThan) } 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/data/odata/utils.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _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 }; var Class = __webpack_require__( /*! ../../core/class */ 15), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3), each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, ajax = __webpack_require__( /*! ../../core/utils/ajax */ 62), _Guid = __webpack_require__( /*! ../../core/guid */ 34), isDefined = typeUtils.isDefined, isPlainObject = typeUtils.isPlainObject, grep = __webpack_require__( /*! ../../core/utils/common */ 4).grep, Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred, errors = __webpack_require__( /*! ../errors */ 37).errors, 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), chunks = isoString.replace("Z", "").split("T"), date = /(\d{4})-(\d{2})-(\d{2})/.exec(chunks[0]), time = /(\d{2}):(\d{2}):(\d{2})\.?(\d{0,7})?/.exec(chunks[1]); result.setFullYear(Number(date[1])); result.setMonth(Number(date[2]) - 1); result.setDate(Number(date[3])); if (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(), isGet = "get" === method, useJsonp = isGet && options.jsonp, params = extend({}, request.params), ajaxData = isGet ? params : formatPayload(request.payload), qs = !isGet && param(params), url = request.url, contentType = !isGet && JSON_VERBOSE_MIME_TYPE; if (qs) { url += (url.indexOf("?") > -1 ? "&" : "?") + qs } if (useJsonp) { ajaxData.$format = "json" } return { url: url, data: ajaxData, dataType: useJsonp ? "jsonp" : "json", jsonp: useJsonp && "$callback", 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 extra, transformOptions = { deserializeDates: options.deserializeDates, fieldTypes: options.fieldTypes }, tuple = interpretJsonFormat(obj, textStatus, transformOptions, ajaxOptions), error = tuple.error, data = tuple.data, nextUrl = tuple.nextUrl; 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, 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", response = obj, httpStatus = 200, 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 value, error = errorFromResponse(obj, textStatus, ajaxOptions); 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" === ("undefined" === typeof value ? "undefined" : _typeof(value))) { if ("results" in value) { obj[key] = value.results } transformTypes(obj[key], options) } else { if ("string" === typeof value) { var fieldTypes = options.fieldTypes, 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 = "", selectValue = [], 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), config = __webpack_require__( /*! ./config */ 29), window = __webpack_require__( /*! ./utils/window */ 7).getWindow(), typeUtils = __webpack_require__( /*! ./utils/type */ 1), each = __webpack_require__( /*! ./utils/iterator */ 3).each, Class = __webpack_require__( /*! ./class */ 15), 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, 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, executors = Action.executors; for (var name in executors) { if (!excludeValidators[name]) { var executor = executors[name]; if (executor.validate) { executor.validate(e) } if (e.cancel) { return false } } } return true }, _executeAction: function(e) { var result, executors = Action.executors; for (var name in executors) { var executor = executors[name]; if (executor.execute) { executor.execute(e) } if (e.handled) { result = e.result; break } } return result } }); Action.executors = {}; Action.registerExecutor = function(name, executor) { if (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], 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/core/component.js ***! \************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i] } return arr2 } else { return Array.from(arr) } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } var Config = __webpack_require__( /*! ./config */ 29), extend = __webpack_require__( /*! ./utils/extend */ 0).extend, optionManager = __webpack_require__( /*! ./option_manager */ 457).OptionManager, bracketsToDots = __webpack_require__( /*! ./utils/data */ 18).bracketsToDots, Class = __webpack_require__( /*! ./class */ 15), Action = __webpack_require__( /*! ./action */ 111), errors = __webpack_require__( /*! ./errors */ 21), commonUtils = __webpack_require__( /*! ./utils/common */ 4), typeUtils = __webpack_require__( /*! ./utils/type */ 1), objectUtils = __webpack_require__( /*! ./utils/object */ 47), deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6), Deferred = deferredUtils.Deferred, when = deferredUtils.when, Callbacks = __webpack_require__( /*! ./utils/callbacks */ 27), EventsMixin = __webpack_require__( /*! ./events_mixin */ 85), publicComponentUtils = __webpack_require__( /*! ./utils/public_component */ 135), devices = __webpack_require__( /*! ./devices */ 16), isFunction = typeUtils.isFunction, noop = commonUtils.noop; 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 normalizeOptions = function(options, value) { if ("string" !== typeof options) { return options } var result = {}; result[options] = value; return result }; 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 } }, _defaultOptionsRules: function() { return [] }, _getOptionByRules: function(customRules) { var rules = this._defaultOptionsRules(); if (Array.isArray(customRules)) { rules = rules.concat(customRules) } return this._convertRulesToOptions(rules) }, _setOptionsByDevice: function(customRules) { var rulesOptions = this._getOptionByRules(customRules); this._setOptionByStealth(rulesOptions) }, _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 match, rule = rules[i], deviceFilter = rule.device || {}; if (isFunction(deviceFilter)) { match = deviceFilter(currentDevice) } else { match = deviceMatch(currentDevice, deviceFilter) } if (match) { extend(options, rule.options) } } return options }, _isInitialOptionValue: function(name) { var optionValue = this.option(name), initialOptionValue = this.initialOption(name), 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) { var _this2 = this; 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._setOptionsByReference(); this._setDeprecatedOptions(); this._options = this._getDefaultOptions(); this._optionManager = new optionManager(this._options, this._getOptionsByReference(), this._deprecatedOptions); this._optionManager.onChanging(function(name, previousValue, value) { if (_this2._initialized) { _this2._optionChanging(name, previousValue, value) } }); this._optionManager.onDeprecated(function(option, info) { _this2._logDeprecatedWarning(option, info) }); this._optionManager.onChanged(function(name, value, previousValue) { _this2._notifyOptionChanged(name, value, previousValue) }); if (options && options.onInitializing) { options.onInitializing.apply(this, [options]) } this._setOptionsByDevice(options.defaultOptionsRules); this._initOptions(options) } finally { this.endUpdate() } }, _initOptions: function(options) { this.option(options) }, _init: function() { this._createOptionChangedAction(); this.on("disposing", function(args) { this._disposingCallbacks.fireWith(this, [args]) }.bind(this)) }, _logDeprecatedWarning: function(option, info) { var message = info.message || "Use the '" + info.alias + "' option instead"; errors.log("W0001", this.NAME, option, info.since, message) }, _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._optionManager.dispose(); 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 } } } }, _optionChanging: noop, _notifyOptionChanged: function(option, value, previousValue) { var that = this; if (this._initialized) { var optionNames = [option].concat(that._getOptionAliasesByName(option)); for (var i = 0; i < optionNames.length; i++) { var name = optionNames[i], args = { name: name.split(/[.[]/)[0], fullName: name, value: value, previousValue: previousValue }; that._optionChangedCallbacks.fireWith(that, [extend(that._defaultActionArgs(), args)]); that._optionChangedAction(extend({}, args)); if (!that._disposed && this._cancelOptionChange !== args.name) { that._optionChanged(args) } } } }, initialOption: function(optionName) { if (!this._initialOptions) { this._initialOptions = this._getDefaultOptions(); var rulesOptions = this._getOptionByRules(this._getOptionByStealth("defaultOptionsRules")); this._optionManager.setValueByReference(this._initialOptions, rulesOptions) } return this._initialOptions[optionName] }, _defaultActionConfig: function() { return { context: this, component: this } }, _defaultActionArgs: function() { return { component: this } }, _createAction: function(actionSource, config) { var action, that = this; return function(e) { if (!arguments.length) { e = {} } if (!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 action, eventName, actionFunc, that = this; var result = function() { if (!eventName) { config = config || {}; if ("string" !== typeof optionName) { throw errors.Error("E0008") } if (0 === optionName.indexOf("on")) { eventName = 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) }; action = that._createAction(actionFunc, config) } 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 }, _getOptionByStealth: function(name) { return this._optionManager.getValueSilently(name) }, _setOptionByStealth: function(options, value) { this._optionManager.setValueSilently(normalizeOptions(options, value)) }, _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 }, _getOptionValue: function(name, context) { var value = this.option(name); if (isFunction(value)) { return value.bind(context)() } return value }, option: function(options, value) { if (arguments.length < 2 && "object" !== typeUtils.type(options)) { return this._optionManager.getValue(options) } this.beginUpdate(); try { this._optionManager.setValue(normalizeOptions(options, value)) } finally { this.endUpdate() } }, resetOption: function(name) { var _this3 = this; if (!name) { return } var defaultValue = void 0; if (name.search(/\.|\[/) !== -1) { name = bracketsToDots(name); var fullPath = name.split("."); fullPath.forEach(function(path) { defaultValue = defaultValue ? defaultValue[path] : _this3.initialOption(path) }) } else { defaultValue = this.initialOption(name) } defaultValue = typeUtils.isObject(defaultValue) ? objectUtils.clone(defaultValue) : defaultValue; this.beginUpdate(); this._optionManager.setValue(normalizeOptions(name, defaultValue), false); this.endUpdate() } }).include(EventsMixin); module.exports = Component; module.exports.PostponedOperations = PostponedOperations }, /*!*************************************************!*\ !*** ./artifacts/transpiled/animation/frame.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7), window = windowUtils.hasWindow() ? windowUtils.getWindow() : {}, callOnce = __webpack_require__( /*! ../core/utils/call_once */ 61); var FRAME_ANIMATION_STEP_TIME = 1e3 / 60, request = function(callback) { return setTimeout(callback, FRAME_ANIMATION_STEP_TIME) }, cancel = function(requestID) { clearTimeout(requestID) }; var setAnimationFrameMethods = callOnce(function() { var nativeRequest = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame, 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/scroll_view.js ***! \************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./scroll_view/ui.scroll_view */ 306) }, /*!***********************************************!*\ !*** ./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 */ 542) }, /*!***********************************************************!*\ !*** ./artifacts/transpiled/ui/date_box/ui.date_utils.js ***! \***********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _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 }; var $ = __webpack_require__( /*! ../../core/renderer */ 2), dateSerialization = __webpack_require__( /*! ../../core/utils/date_serialization */ 55), isDate = __webpack_require__( /*! ../../core/utils/type */ 1).isDate, each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, 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 = "undefined" === typeof format ? "undefined" : _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", 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 i, longestIndex = 0, longestCaptionLength = 0; for (i = 0; i < captionArray.length; ++i) { if (captionArray[i].length > longestCaptionLength) { longestIndex = i; longestCaptionLength = captionArray[i].length } } return longestIndex }, formatUsesMonthName: function(format) { return dateLocalization.formatUsesMonthName(format) }, formatUsesDayName: function(format) { return dateLocalization.formatUsesDayName(format) }, getLongestDate: function(format, monthNames, dayNames) { var stringFormat = getStringFormat(format), month = 9; if (!stringFormat || dateUtils.formatUsesMonthName(stringFormat)) { month = dateUtils.getLongestCaptionIndex(monthNames) } var longestDate = new Date(1888, month, 21, 23, 59, 59, 999); if (!stringFormat || dateUtils.formatUsesDayName(stringFormat)) { var date = longestDate.getDate() - longestDate.getDay() + dateUtils.getLongestCaptionIndex(dayNames); longestDate.setDate(date) } return longestDate }, normalizeTime: function(date) { date.setSeconds(0); date.setMilliseconds(0) } }; dateUtils.DATE_COMPONENTS_INFO = { year: { getter: "getFullYear", setter: "setFullYear", formatter: function(value, 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, date) { var formatDate = new Date(date.getTime()); formatDate.setDate(value); return dateLocalization.format(formatDate, "d") }, startValue: 1, endValue: void 0 }, month: { getter: "getMonth", setter: "setMonth", formatter: function(value) { return dateLocalization.getMonthNames()[value] }, 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/form.js ***! \*****************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./form/ui.form */ 564) }, /*!***************************************************************************!*\ !*** ./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, each = __webpack_require__( /*! ../../../core/utils/iterator */ 3).each, noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop, windowUtils = __webpack_require__( /*! ../../../core/utils/window */ 7), window = windowUtils.getWindow(), labelModule = __webpack_require__( /*! ./label */ 251), _extend = extend, _isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined, _normalizeEnum = __webpack_require__( /*! ../../core/utils */ 12).normalizeEnum, _math = Math, _round = _math.round, _floor = _math.floor, _ceil = _math.ceil, DEFAULT_IMAGE_WIDTH = 20, DEFAULT_IMAGE_HEIGHT = 20, LABEL_OFFSET = 10, CANVAS_POSITION_DEFAULT = "canvas_position_default"; function getSquareMarkerCoords(radius) { return [-radius, -radius, radius, -radius, radius, radius, -radius, radius, -radius, -radius] } function getPolygonMarkerCoords(radius) { var r = _ceil(radius); return [-r, 0, 0, -r, r, 0, 0, r, -r, 0] } function getCrossMarkerCoords(radius) { var r = _ceil(radius), floorHalfRadius = _floor(r / 2), ceilHalfRadius = _ceil(r / 2); return [-r, -floorHalfRadius, -floorHalfRadius, -r, 0, -ceilHalfRadius, floorHalfRadius, -r, r, -floorHalfRadius, ceilHalfRadius, 0, r, floorHalfRadius, floorHalfRadius, r, 0, ceilHalfRadius, -floorHalfRadius, r, -r, floorHalfRadius, -ceilHalfRadius, 0] } function getTriangleDownMarkerCoords(radius) { return [-radius, -radius, radius, -radius, 0, radius, -radius, -radius] } function getTriangleUpMarkerCoords(radius) { return [-radius, radius, radius, radius, 0, -radius, -radius, radius] } module.exports = { deleteLabel: function() { this._label.dispose(); this._label = null }, _hasGraphic: function() { return this.graphic }, clearVisibility: function() { var that = this, graphic = that.graphic; if (graphic && graphic.attr("visibility")) { graphic.attr({ visibility: null }) } }, isVisible: function() { return this.inVisibleArea && this.series.isVisible() }, setInvisibility: function() { var that = this, graphic = that.graphic; if (graphic && "hidden" !== graphic.attr("visibility")) { graphic.attr({ visibility: "hidden" }) } that._errorBar && that._errorBar.attr({ visibility: "hidden" }); that._label.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, newSymbol = newOptions.symbol, symbolChanged = "circle" === oldSymbol && "circle" !== newSymbol || "circle" !== oldSymbol && "circle" === newSymbol, imageChanged = this._checkImage(oldOptions.image) !== this._checkImage(newOptions.image); return !!(symbolChanged || imageChanged) }, _populatePointShape: function(symbol, radius) { switch (symbol) { case "square": return getSquareMarkerCoords(radius); case "polygon": return getPolygonMarkerCoords(radius); case "triangle": case "triangleDown": return getTriangleDownMarkerCoords(radius); case "triangleUp": return getTriangleUpMarkerCoords(radius); case "cross": return getCrossMarkerCoords(radius) } }, 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, translateY = this.y; if (animationEnabled) { if (this._options.rotated) { translateX = this.defaultX } else { translateY = this.defaultY } } return { x: translateX, y: translateY } }, _createImageMarker: function(renderer, settings, options) { var width = options.width || DEFAULT_IMAGE_WIDTH, height = options.height || DEFAULT_IMAGE_HEIGHT; return renderer.image(-_round(.5 * width), -_round(.5 * height), width, height, options.url ? options.url.toString() : options.toString(), "center").attr({ translateX: settings.translateX, translateY: settings.translateY, visibility: settings.visibility }) }, _createSymbolMarker: function(renderer, pointSettings) { var marker, symbol = this._options.symbol; if ("circle" === symbol) { delete pointSettings.points; marker = renderer.circle().attr(pointSettings) } else { if ("square" === symbol || "polygon" === symbol || "triangle" === symbol || "triangleDown" === symbol || "triangleUp" === symbol || "cross" === symbol) { marker = renderer.path([], "area").attr(pointSettings).sharp() } } return marker }, _createMarker: function(renderer, group, image, settings) { var that = this, marker = that._checkImage(image) ? that._createImageMarker(renderer, settings, image) : that._createSymbolMarker(renderer, settings); if (marker) { marker.data({ "chart-data-point": that }).append(group) } return marker }, _getSymbolBBox: function(x, y, r) { return { x: x - r, y: y - r, width: 2 * r, height: 2 * r } }, _getImageBBox: function(x, y) { var image = this._options.image, width = image.width || DEFAULT_IMAGE_WIDTH, height = image.height || DEFAULT_IMAGE_HEIGHT; return { x: x - _round(width / 2), y: y - _round(height / 2), width: width, height: height } }, _getGraphicBBox: function() { var bBox, that = this, options = that._options, x = that.x, y = that.y; if (options.visible) { bBox = that._checkImage(options.image) ? that._getImageBBox(x, y) : that._getSymbolBBox(x, y, options.styles.normal.r) } else { bBox = { x: x, y: y, width: 0, height: 0 } } return bBox }, hideInsideLabel: noop, _getShiftLabelCoords: function(label) { var coord = this._addLabelAlignmentAndOffset(label, this._getLabelCoords(label)); return this._checkLabelPosition(label, coord) }, _drawLabel: function() { var that = this, customVisibility = that._getCustomLabelVisibility(), label = that._label, isVisible = that._showForZeroValues() && that.hasValue() && false !== customVisibility && (that.series.getLabelVisibility() || customVisibility); label.draw(!!isVisible) }, correctLabelPosition: function(label) { var that = this, 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), w2 = bBox.width / 2, h2 = bBox.height / 2; return { x: bBox.x + w2, y: bBox.y + h2, r: this._options.visible ? Math.max(w2, h2) : 0 } }, _getPositionFromLocation: function() { return { x: this.x, y: this.y } }, _isPointInVisibleArea: function(visibleArea, graphicBBox) { return visibleArea.minX <= graphicBBox.x + graphicBBox.width && visibleArea.maxX >= graphicBBox.x && visibleArea.minY <= graphicBBox.y + graphicBBox.height && visibleArea.maxY >= graphicBBox.y }, _checkLabelPosition: function(label, coord) { var that = this, visibleArea = that._getVisibleArea(), labelBBox = label.getBoundingRect(), graphicBBox = that._getGraphicBBox(label.pointPosition), offset = LABEL_OFFSET; if (that._isPointInVisibleArea(visibleArea, graphicBBox)) { if (!that._options.rotated) { if (visibleArea.minX > coord.x) { coord.x = visibleArea.minX } if (visibleArea.maxX < coord.x + labelBBox.width) { coord.x = visibleArea.maxX - labelBBox.width } if (visibleArea.minY > coord.y) { coord.y = graphicBBox.y + graphicBBox.height + offset } if (visibleArea.maxY < coord.y + labelBBox.height) { coord.y = graphicBBox.y - labelBBox.height - offset } } else { if (visibleArea.minX > coord.x) { coord.x = graphicBBox.x + graphicBBox.width + offset } if (visibleArea.maxX < coord.x + labelBBox.width) { coord.x = graphicBBox.x - offset - labelBBox.width } if (visibleArea.minY > coord.y) { coord.y = visibleArea.minY } if (visibleArea.maxY < coord.y + labelBBox.height) { coord.y = visibleArea.maxY - labelBBox.height } } } return coord }, _addLabelAlignmentAndOffset: function(label, coord) { var labelBBox = label.getBoundingRect(), labelOptions = label.getLayoutOptions(); if (!this._options.rotated) { if ("left" === labelOptions.alignment) { coord.x += labelBBox.width / 2 } else { if ("right" === labelOptions.alignment) { coord.x -= labelBBox.width / 2 } } } coord.x += labelOptions.horizontalOffset; coord.y += labelOptions.verticalOffset; return coord }, _getLabelCoords: function(label) { return this._getLabelCoordOfPosition(label, this._getLabelPosition(label.pointPosition)) }, _getLabelCoordOfPosition: function(label, position) { var that = this, labelBBox = label.getBoundingRect(), graphicBBox = that._getGraphicBBox(label.pointPosition), offset = LABEL_OFFSET, centerY = graphicBBox.height / 2 - labelBBox.height / 2, centerX = graphicBBox.width / 2 - labelBBox.width / 2, x = graphicBBox.x, y = graphicBBox.y; switch (position) { case "left": x -= labelBBox.width + offset; y += centerY; break; case "right": x += graphicBBox.width + offset; y += centerY; break; case "top": x += centerX; y -= labelBBox.height + offset; break; case "bottom": x += centerX; y += graphicBBox.height + offset; break; case "inside": x += centerX; y += centerY } return { x: x, y: y } }, _drawMarker: function(renderer, group, animationEnabled) { var that = this, options = that._options, translates = that._getTranslates(animationEnabled), style = that._getStyle(); that.graphic = that._createMarker(renderer, group, options.image, _extend({ translateX: translates.x, translateY: translates.y, points: that._populatePointShape(options.symbol, style.r) }, style)) }, _getErrorBarSettings: function() { return { visibility: "visible" } }, _getErrorBarBaseEdgeLength: function() { return 2 * this.getPointRadius() }, _drawErrorBar: function(renderer, group) { if (!this._options.errorBars) { return } var settings, that = this, options = that._options, errorBarOptions = options.errorBars, points = [], pos = that._errorBarPos, high = that._highErrorCoord, low = that._lowErrorCoord, displayMode = _normalizeEnum(errorBarOptions.displayMode), isHighDisplayMode = "high" === displayMode, isLowDisplayMode = "low" === displayMode, highErrorOnly = (isHighDisplayMode || !_isDefined(low)) && _isDefined(high) && !isLowDisplayMode, 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, 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, valuePercent = that.value / absTotal || 0, minValuePercent = that.minValue / absTotal || 0, percent = valuePercent - minValuePercent; that._label.setDataField("percent", percent); that._label.setDataField("total", total); if (that.series.isFullStackedSeries() && that.hasValue()) { if (that.leftHole) { that.leftHole /= 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 minTrackerSize, that = this, navigator = window.navigator, r = that._options.styles.normal.r; navigator = that.__debug_navigator || navigator; that.__debug_browserNavigator = navigator; 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, options = that._options, rotated = options.rotated, errorBars = options.errorBars, 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, valTranslator = that._getValTranslator(), 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, r = that._options.rotated, value = that.properValue, argument = that.argument; return { x: that.vx, y: that.vy, xValue: r ? value : argument, yValue: r ? argument : value, axis: that.series.axis } }, getPointRadius: function() { var extraSpace, style = this._getStyle(), options = this._options, r = style.r, symbol = options.symbol, isSquare = "square" === symbol, isTriangle = "triangle" === symbol || "triangleDown" === symbol || "triangleUp" === symbol; if (options.visible && !options.image && r) { extraSpace = style["stroke-width"] / 2; return (isSquare || isTriangle ? 1.4 * r : r) + extraSpace } return 0 }, _updateMarker: function(animationEnabled, style) { var settings, that = this, options = that._options, image = options.image, visibility = !that.isVisible() ? { visibility: "hidden" } : {}; if (that._checkImage(image)) { settings = _extend({}, { visibility: style.visibility }, visibility, that._getImageSettings(image)) } else { settings = _extend({}, style, visibility, { points: that._populatePointShape(options.symbol, style.r) }) } if (!animationEnabled) { settings.translateX = that.x; settings.translateY = that.y } that.graphic.attr(settings).sharp() }, _getLabelFormatObject: function() { var that = this; return { argument: that.initialArgument, value: that.initialValue, originalArgument: that.originalArgument, originalValue: that.originalValue, seriesName: that.series.name, lowErrorValue: that.lowError, highErrorValue: that.highError, point: that } }, _getLabelPosition: function() { var rotated = this._options.rotated; if (this.initialValue > 0) { return rotated ? "right" : "top" } else { return rotated ? "left" : "bottom" } }, _getFormatObject: function(tooltip) { var that = this, labelFormatObject = that._label.getData(); return _extend({}, labelFormatObject, { argumentText: tooltip.formatValue(that.initialArgument, "argument"), valueText: tooltip.formatValue(that.initialValue) }, _isDefined(labelFormatObject.percent) ? { percentText: tooltip.formatValue(labelFormatObject.percent, "percent") } : {}, _isDefined(labelFormatObject.total) ? { totalText: tooltip.formatValue(labelFormatObject.total) } : {}) }, getMarkerVisibility: function() { return this._options.visible }, coordsIn: function(x, y) { var trackerRadius = this._storeTrackerR(); return x >= this.x - trackerRadius && x <= this.x + trackerRadius && y >= this.y - trackerRadius && y <= this.y + trackerRadius }, 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 */ 12).patchFontOptions, STATE_HIDDEN = 0, STATE_SHOWN = 1, ANIMATION_EASING = "linear", ANIMATION_DURATION = 400, LOADING_INDICATOR_READY = "loadingIndicatorReady"; function LoadingIndicator(parameters) { var that = this, 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, 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 state, that = this; 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 defaultAlgorithm, _isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction, _normalizeEnum = __webpack_require__( /*! ../core/utils */ 12).normalizeEnum, _round = Math.round, algorithms = {}; exports.getAlgorithm = function(value) { return algorithms[_normalizeEnum(value)] || _isFunction(value) && value || defaultAlgorithm }; exports.addAlgorithm = function(name, callback) { algorithms[name] = callback }; exports.setDefaultAlgorithm = function(name) { defaultAlgorithm = algorithms[name] }; var directionToIndexOffsets = {}; directionToIndexOffsets[-1] = [2, 0]; directionToIndexOffsets[1] = [0, 2]; 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), variedSideIndex = 1 - staticSideIndex, staticSideDirection = directions[staticSideIndex], variedSideDirection = directions[variedSideIndex], staticSideIndexOffsets = directionToIndexOffsets[staticSideDirection], 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, ii, rect, delta, variedSidePart = [0, 0, 0, 0], static1 = sidesData.static1, static2 = sidesData.static2, position = totalRect[static1], dir = sidesData.staticDir, side = sidesData.staticSide, sum = rowData.sum; variedSidePart[sidesData.varied1] = totalRect[sidesData.varied1]; variedSidePart[sidesData.varied2] = totalRect[sidesData.varied1] + sidesData.variedDir * rowData.side; for (i = head, ii = head + rowData.count; i < ii; ++i) { rect = variedSidePart.slice(); rect[static1] = position; delta = _round(side * nodes[i].value / sum) || 0; sum -= nodes[i].value; side -= delta; position += dir * delta; rect[static2] = position; nodes[i].rect = rect } totalRect[sidesData.varied1] = variedSidePart[sidesData.varied2] } }, /*!*********************************************************!*\ !*** ./artifacts/transpiled/viz/tree_map/colorizing.js ***! \*********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var defaultColorizerName, _normalizeEnum = __webpack_require__( /*! ../core/utils */ 12).normalizeEnum, _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, colorizers = {}; function wrapLeafColorGetter(getter) { return function(node) { return !node.isNode() ? getter(node) : void 0 } } function wrapGroupColorGetter(getter) { return function(node) { var parent = !node.isNode() && node.parent; return parent ? parent._groupColor = parent._groupColor || getter(parent) : void 0 } } exports.getColorizer = function(options, themeManager, root) { var type = _normalizeEnum(options.type || defaultColorizerName), colorizer = colorizers[type] && colorizers[type](options, themeManager, root); return colorizer ? (options.colorizeGroups ? wrapGroupColorGetter : wrapLeafColorGetter)(colorizer) : _noop }; exports.addColorizer = function(name, colorizer) { colorizers[name] = colorizer }; exports.setDefaultColorizer = function(name) { defaultColorizerName = name }; function getValueAsColorCode(node) { return node.value } function createColorCodeGetter(colorCodeField) { return function(node) { return Number(node.data[colorCodeField]) } } exports.createColorCodeGetter = function(options) { return options.colorCodeField ? createColorCodeGetter(options.colorCodeField) : getValueAsColorCode } }, /*!*************************************************************************!*\ !*** ./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 */ 180); module.exports = new MemorizedCallbacks }, /*!*******************************************************!*\ !*** ./artifacts/transpiled/localization/currency.js ***! \*******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); module.exports = { _formatNumberCore: function(value, format, formatConfig) { if ("currency" === format) { formatConfig.precision = formatConfig.precision || 0; var result = this.format(value, (0, _extend.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/events/core/emitter.js ***! \*****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2), noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, Class = __webpack_require__( /*! ../../core/class */ 15), Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 27), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, 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), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 13), callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 61), registerEvent = __webpack_require__( /*! ./event_registrator */ 72), eventUtils = __webpack_require__( /*! ../utils */ 8); var EVENT_NAME = "dxmousewheel", 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), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4), contains = __webpack_require__( /*! ../../core/utils/dom */ 11).contains, devices = __webpack_require__( /*! ../../core/devices */ 16), eventUtils = __webpack_require__( /*! ../utils */ 8), pointerEvents = __webpack_require__( /*! ../pointer */ 23), Emitter = __webpack_require__( /*! ./emitter */ 126), registerEmitter = __webpack_require__( /*! ./emitter_registrator */ 96); var ACTIVE_EVENT_NAME = "dxactive", INACTIVE_EVENT_NAME = "dxinactive", ACTIVE_TIMEOUT = 30, INACTIVE_TIMEOUT = 400; var FeedbackEvent = Class.inherit({ ctor: function(timeout, fire) { this._timeout = timeout; this._fire = fire }, start: function() { var that = this; this._schedule(function() { that.force() }) }, _schedule: function(fn) { this.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, eventTarget = this._getEmitterTarget(e), mouseEvent = eventUtils.isMouseEvent(e), isSimulator = devices.isSimulator(), deferFeedback = isSimulator || !mouseEvent, activeTimeout = commonUtils.ensureDefined(this.activeTimeout, ACTIVE_TIMEOUT), inactiveTimeout = commonUtils.ensureDefined(this.inactiveTimeout, INACTIVE_TIMEOUT); this._active = new FeedbackEvent(deferFeedback ? activeTimeout : 0, function() { that._fireEvent(ACTIVE_EVENT_NAME, e, { target: eventTarget }) }); this._inactive = new FeedbackEvent(deferFeedback ? inactiveTimeout : 0, function() { that._fireEvent(INACTIVE_EVENT_NAME, e, { target: eventTarget }); activeFeedback = null }) }, cancel: function(e) { this.end(e) }, end: function(e) { var skipTimers = e.type !== pointerEvents.up; if (skipTimers) { this._active.stop() } else { this._active.force() } this._inactive.start(); if (skipTimers) { this._inactive.force() } }, dispose: function() { this._active.stop(); this._inactive.stop(); this.callBase() }, lockInactive: function() { this._active.force(); this._inactive.stop(); activeFeedback = null; this._cancel(); return 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), Class = __webpack_require__( /*! ../../core/class */ 15), each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, publicComponentUtils = __webpack_require__( /*! ../../core/utils/public_component */ 135); var INVISIBLE_STATE_CLASS = "dx-state-invisible", DISABLED_STATE_CLASS = "dx-state-disabled", 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, 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 */ 75); var _globalize2 = _interopRequireDefault(_globalize); var _core = __webpack_require__( /*! ../core */ 80); var _core2 = _interopRequireDefault(_core); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } if (_globalize2.default && _globalize2.default.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 (!_globalize2.default.locale()) { _globalize2.default.load(likelySubtags); _globalize2.default.locale("en") } _core2.default.inject({ locale: function(_locale) { if (!_locale) { return _globalize2.default.locale().locale } _globalize2.default.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), domUtils = __webpack_require__( /*! ../core/utils/dom */ 11), domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 13), Class = __webpack_require__( /*! ../core/class */ 15), registerEvent = __webpack_require__( /*! ./core/event_registrator */ 72), clickEvent = __webpack_require__( /*! ./click */ 20), eventUtils = __webpack_require__( /*! ./utils */ 8); var DBLCLICK_EVENT_NAME = "dxdblclick", DBLCLICK_NAMESPACE = "dxDblClick", NAMESPACED_CLICK_EVENT = eventUtils.addNamespace(clickEvent.name, DBLCLICK_NAMESPACE), 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, consoleUtils = __webpack_require__( /*! ./console */ 65), stringUtils = __webpack_require__( /*! ./string */ 45), version = __webpack_require__( /*! ../version */ 133); 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, details, message, url; id = args[0]; args = args.slice(1); details = formatDetails(id, args); url = getErrorUrl(id); 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/version.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = "19.2.5" }, /*!*************************************************************!*\ !*** ./artifacts/transpiled/core/utils/resize_callbacks.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var windowUtils = __webpack_require__( /*! ./window */ 7), domAdapter = __webpack_require__( /*! ../dom_adapter */ 13), Callbacks = __webpack_require__( /*! ./callbacks */ 27), readyCallbacks = __webpack_require__( /*! ./ready_callbacks */ 49), callOnce = __webpack_require__( /*! ./call_once */ 61); var resizeCallbacks = function() { var prevSize, callbacks = Callbacks(), originalCallbacksAdd = callbacks.add, originalCallbacksRemove = callbacks.remove; if (!windowUtils.hasWindow()) { return callbacks } var formatSize = function() { var documentElement = domAdapter.getDocumentElement(); return { width: documentElement.clientWidth, height: documentElement.clientHeight } }; 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 */ 40), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), WeakMap = __webpack_require__( /*! ../polyfills/weak_map */ 179), isDefined = __webpack_require__( /*! ./type */ 1).isDefined, removeEvent = __webpack_require__( /*! ../remove_event */ 136); var COMPONENT_NAMES_DATA_KEY = "dxComponents", ANONYMOUS_COMPONENT_DATA_KEY = "dxPrivateComponent"; var componentNames = new WeakMap, 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)), 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 */ 40).beforeCleanData; var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5); var registerEvent = __webpack_require__( /*! ../events/core/event_registrator */ 72); 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/templates/child_default_template.js ***! \***********************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.ChildDefaultTemplate = void 0; var _template_base = __webpack_require__( /*! ./template_base */ 74); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && ("object" === typeof call || "function" === typeof call) ? call : self } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } } exports.ChildDefaultTemplate = function(_TemplateBase) { _inherits(ChildDefaultTemplate, _TemplateBase); function ChildDefaultTemplate(name) { _classCallCheck(this, ChildDefaultTemplate); var _this = _possibleConstructorReturn(this, (ChildDefaultTemplate.__proto__ || Object.getPrototypeOf(ChildDefaultTemplate)).call(this)); _this.name = name; return _this } return ChildDefaultTemplate }(_template_base.TemplateBase) }, /*!**************************************************!*\ !*** ./artifacts/transpiled/data/array_utils.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _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 }; var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _config = __webpack_require__( /*! ../core/config */ 29); var _config2 = _interopRequireDefault(_config); var _guid = __webpack_require__( /*! ../core/guid */ 34); var _guid2 = _interopRequireDefault(_guid); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _errors = __webpack_require__( /*! ./errors */ 37); 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 hasKey(target, keyOrKeys) { var key, keys = "string" === typeof keyOrKeys ? keyOrKeys.split() : keyOrKeys.slice(); while (keys.length) { key = keys.shift(); if (key in target) { return true } } return false } function findItems(keyInfo, items, key, groupCount) { var childItems, result; if (groupCount) { for (var i = 0; i < items.length; i++) { childItems = items[i].items || items[i].collapsedItems || []; 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, extendComplexObject = true, 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, obj, keyExpr = keyInfo.key(); obj = (0, _type.isPlainObject)(data) ? (0, _extend.extend)({}, data) : data; if (keyExpr) { keyValue = keyInfo.keyOf(obj); if (void 0 === keyValue || "object" === ("undefined" === typeof keyValue ? "undefined" : _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/popover.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _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 }; var $ = __webpack_require__( /*! ../core/renderer */ 2), windowUtils = __webpack_require__( /*! ../core/utils/window */ 7), window = windowUtils.getWindow(), getPublicElement = __webpack_require__( /*! ../core/utils/dom */ 11).getPublicElement, domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 13), eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9), commonUtils = __webpack_require__( /*! ../core/utils/common */ 4), extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, browser = __webpack_require__( /*! ../core/utils/browser */ 25), translator = __webpack_require__( /*! ../animation/translator */ 26), positionUtils = __webpack_require__( /*! ../animation/position */ 78), typeUtils = __webpack_require__( /*! ../core/utils/type */ 1), mathUtils = __webpack_require__( /*! ../core/utils/math */ 30), eventUtils = __webpack_require__( /*! ../events/utils */ 8), Popup = __webpack_require__( /*! ./popup */ 43); var POPOVER_CLASS = "dx-popover", POPOVER_WRAPPER_CLASS = "dx-popover-wrapper", POPOVER_ARROW_CLASS = "dx-popover-arrow", POPOVER_WITHOUT_TITLE_CLASS = "dx-popover-without-title", POSITION_FLIP_MAP = { left: "right", top: "bottom", right: "left", bottom: "top", center: "center" }, WEIGHT_OF_SIDES = { left: -1, top: -1, center: 0, right: 1, bottom: 1 }, POSITION_ALIASES = { top: { my: "bottom center", at: "top center", collision: "fit flip" }, bottom: { my: "top center", at: "bottom center", collision: "fit flip" }, right: { my: "left center", at: "right center", collision: "flip fit" }, left: { my: "right center", at: "left center", collision: "flip fit" } }, SIDE_BORDER_WIDTH_STYLES = { left: "borderLeftWidth", top: "borderTopWidth", right: "borderRightWidth", bottom: "borderBottomWidth" }, isFirefox = browser.mozilla, getEventName = function(that, optionName) { var optionValue = that.option(optionName); return getEventNameByOption(optionValue) }, getEventNameByOption = function(optionValue) { return typeUtils.isObject(optionValue) ? optionValue.name : optionValue }, getEventDelay = function(that, optionName) { var optionValue = that.option(optionName); return typeUtils.isObject(optionValue) && optionValue.delay }, attachEvent = function(that, name) { var delay, action, handler, eventName, target = that.option("target"), isSelector = typeUtils.isString(target), event = getEventName(that, name + "Event"); if (!event || that.option("disabled")) { return } eventName = eventUtils.addNamespace(event, that.NAME); action = that._createAction(function() { delay = getEventDelay(that, name + "Event"); this._clearEventsTimeouts(); if (delay) { this._timeouts[name] = setTimeout(function() { that[name]() }, delay) } else { that[name]() } }.bind(that), { validatingTargetName: "target" }); 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) } }, 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, 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() } }, _renderWrapperPosition: function() { if (this.option("shading")) { this._$wrapper.css({ top: 0, left: 0 }) } }, _renderWrapperDimensions: 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), at = positionUtils.setup.normalizeAlign(position.at); var weightSign = WEIGHT_OF_SIDES[my.h] === WEIGHT_OF_SIDES[at.h] && WEIGHT_OF_SIDES[my.v] === WEIGHT_OF_SIDES[at.v] ? -1 : 1, horizontalWeight = Math.abs(WEIGHT_OF_SIDES[my.h] - weightSign * WEIGHT_OF_SIDES[at.h]), verticalWeight = Math.abs(WEIGHT_OF_SIDES[my.v] - weightSign * WEIGHT_OF_SIDES[at.v]); return horizontalWeight > verticalWeight ? at.h : at.v }, _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), 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), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, Class = __webpack_require__( /*! ../../core/class */ 15), swipeEvents = __webpack_require__( /*! ../../events/swipe */ 178), eventUtils = __webpack_require__( /*! ../../events/utils */ 8); var LIST_EDIT_DECORATOR = "dxListEditDecorator", SWIPE_START_EVENT_NAME = eventUtils.addNamespace(swipeEvents.start, LIST_EDIT_DECORATOR), SWIPE_UPDATE_EVENT_NAME = eventUtils.addNamespace(swipeEvents.swipe, LIST_EDIT_DECORATOR), SWIPE_END_EVENT_NAME = eventUtils.addNamespace(swipeEvents.end, LIST_EDIT_DECORATOR); var EditDecorator = Class.inherit({ ctor: function(list) { this._list = list; this._init() }, _init: noop, _shouldHandleSwipe: false, _attachSwipeEvent: function(config) { var swipeConfig = { itemSizeFunc: 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/tree_view.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./tree_view/ui.tree_view.search */ 355) }, /*!***************************************************************!*\ !*** ./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), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray, isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined, 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(), 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), firstYearDate = new Date(initialDate.setMonth(0, 1)), dayShift = firstYearDate.getDay() - days[weekStart], firstDayOfYear = firstYearDate.getTime() - dayShift * toMs("day"), 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 daysFromYearStart, current = new Date(date), diff = leastDaysInWeek - current.getDay() + days[weekStart] - 1, 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), timezoneDiff = (yearStart.getTimezoneOffset() - current.getTimezoneOffset()) * toMs("minute"); daysFromYearStart = 1 + (current - yearStart + timezoneDiff) / dayInMilliseconds; return Math.ceil(daysFromYearStart / 7) }, byyearday: function(date) { var yearStart = new Date(date.getFullYear(), 0, 0), timezoneDiff = date.getTimezoneOffset() - yearStart.getTimezoneOffset(), diff = date - yearStart - timezoneDiff * toMs("minute"), dayLength = toMs("day"); return Math.floor(diff / dayLength) } }; var ruleNames = ["freq", "interval", "byday", "byweekno", "byyearday", "bymonth", "bymonthday", "count", "until", "byhour", "byminute", "bysecond", "bysetpos", "wkst"], freqNames = ["DAILY", "WEEKLY", "MONTHLY", "YEARLY", "SECONDLY", "MINUTELY", "HOURLY"], days = { SU: 0, MO: 1, TU: 2, WE: 3, TH: 4, FR: 5, SA: 6 }, 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, freq = rule.freq, intervalObject = {}, 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(","), exceptDates = getDatesByRecurrenceException(splitDates, date), 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 dateInInterval, 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 } } dateInInterval = date.getTime() <= endIntervalDate; return dateInInterval && matchCountIsCorrect }; var getDatesByRecurrence = function(options) { var dateRules, result = [], recurrenceRule = getRecurrenceRule(options.rule), iterationResult = {}, rule = recurrenceRule.rule, recurrenceStartDate = options.start; if (!recurrenceRule.isValid || !rule.freq) { return result } rule.interval = normalizeInterval(rule); 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), needCorrect = true; date = dateUtils.addInterval(date, rule.interval); if ("DAILY" === rule.freq && !isDefined(rule.byhour) && originalStartDate.getHours() !== date.getHours()) { date = new Date(date.getTime() - (initialDate.getHours() - originalStartDate.getHours()) * toMs("hour")) } 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, until = rule.until; if (void 0 !== until && !(until instanceof Date)) { wrongUntil = true } return wrongUntil }; var wrongCountRule = function(rule) { var wrongCount = false, count = rule.count; if (count && "string" === typeof count) { wrongCount = true } return wrongCount }; var wrongByMonthDayRule = function(rule) { var wrongByMonthDay = false, byMonthDay = rule.bymonthday; if (byMonthDay && isNaN(parseInt(byMonthDay))) { wrongByMonthDay = true } return wrongByMonthDay }; var wrongByMonth = function wrongByMonth(rule) { var wrongByMonth = false, byMonth = rule.bymonth; if (byMonth && isNaN(parseInt(byMonth))) { wrongByMonth = true } return wrongByMonth }; var wrongIntervalRule = function(rule) { var wrongInterval = false, interval = rule.interval; if (interval && "string" === typeof interval) { wrongInterval = true } return wrongInterval }; var wrongDayOfWeek = function(rule) { var daysByRule = daysFromByDayRule(rule), brokenDaysExist = false; each(daysByRule, function(_, day) { if (!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 = {}, ruleParts = recurrence.split(";"); for (var i = 0, len = ruleParts.length; i < len; i++) { var rule = ruleParts[i].split("="), ruleName = rule[0].toLowerCase(), ruleValue = rule[1]; ruleObject[ruleName] = ruleValue } var count = parseInt(ruleObject.count); if (!isNaN(count)) { ruleObject.count = count } if (ruleObject.interval) { var interval = parseInt(ruleObject.interval); if (!isNaN(interval)) { ruleObject.interval = interval } } else { ruleObject.interval = 1 } if (ruleObject.freq && ruleObject.until) { ruleObject.until = getDateByAsciiString(ruleObject.until) } return ruleObject }; var getDateByAsciiString = function(string, 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], currentOffset = initialDate ? initialDate.getTimezoneOffset() : resultUtils.getTimeZoneOffset(), 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(","), 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], 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 = [], count = rule.count, counter = 0, 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), 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], 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/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 */ 19); var _ui2 = _interopRequireDefault(_ui); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var diagram = void 0; 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 */ 762); if (!diagram) { throw _ui2.default.Error("E1041", "devexpress-diagram") } return diagram } exports.getDiagram = getDiagram }, /*!**************************************************!*\ !*** ./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, ii = codes.length, 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, 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, result, ii = executeChain._chain.length; 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, plugins = proto._plugins, fontFields = proto._fontFields, eventsMap = proto._eventsMap, initialChanges = proto._initialChanges, themeDependentChanges = proto._themeDependentChanges, optionChangesMap = proto._optionChangesMap, partialOptionChangesMap = proto._partialOptionChangesMap, partialOptionChangesPath = proto._partialOptionChangesPath, optionChangesOrder = proto._optionChangesOrder, layoutChangesOrder = proto._layoutChangesOrder, customChangesOrder = proto._customChangesOrder, 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, each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, scatterSeries = __webpack_require__( /*! ./scatter_series */ 107), areaSeries = __webpack_require__( /*! ./area_series */ 169).chart.area, chartSeries = scatterSeries.chart, polarSeries = scatterSeries.polar, _extend = extend, _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, 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, 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, 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, complete = function() { that._animateComplete() }, animateFunc = function(drawnPoints, complete) { var lastPointIndex = drawnPoints.length - 1; _each(drawnPoints || [], function(i, point) { point.animate(i === lastPointIndex ? complete : void 0, point.getMarkerCoords()) }) }; that._animatePoints(firstDrawing, complete, animateFunc) }, 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, direction = rotated ? "X" : "Y", 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 groupSettings, that = this, markersSettings = that._createPointStyles(that._getMarkerGroupOptions()).normal; markersSettings.class = "dxc-markers"; that._applyMarkerClipRect(markersSettings); groupSettings = _extend({}, markersSettings); delete groupSettings.opacity; that._markersGroup.attr(groupSettings) }, _createLegendState: areaSeries._createLegendState }) }, /*!******************************************************!*\ !*** ./artifacts/transpiled/viz/core/data_source.js ***! \******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var name, noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, DataHelperMixin = __webpack_require__( /*! ../../data_helper */ 79), postCtor = DataHelperMixin.postCtor, 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, _getAppropriateFormat = __webpack_require__( /*! ../core/utils */ 12).getAppropriateFormat, extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, translator1DModule = __webpack_require__( /*! ../translators/translator1d */ 420), _extend = extend, BaseWidget = __webpack_require__( /*! ../core/base_widget */ 98), themeManagerModule = __webpack_require__( /*! ./theme_manager */ 823), Tracker = __webpack_require__( /*! ./tracker */ 824); var dxBaseGauge = BaseWidget.inherit({ _rootClassPrefix: "dxg", _themeSection: "gauge", _createThemeManager: function() { return new themeManagerModule.ThemeManager(this._getThemeManagerOptions()) }, _initCore: function() { var that = this, 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, renderer = that._renderer, tooltip = that._tooltip; that._tracker.setCallbacks({ "tooltip-show": function(target, info) { var tooltipParameters = target.getTooltipParameters(), offset = renderer.getRootOffset(), formatObject = _extend({ value: tooltipParameters.value, valueText: tooltip.formatValue(tooltipParameters.value), color: tooltipParameters.color }, info); return tooltip.show(formatObject, { x: tooltipParameters.x + offset.left, y: tooltipParameters.y + offset.top, offset: tooltipParameters.offset }, { target: info }) }, "tooltip-hide": function() { return tooltip.hide() } }) }, _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, 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 */ 63).format; var formatValue = function(value, options, extra) { options = options || {}; var formatObject, text = _format(value, options.format); if ("function" === typeof options.customizeText) { formatObject = _extend({ value: value, valueText: text }, extra); return String(options.customizeText.call(formatObject, formatObject)) } return text }; var getSampleText = function(translator, options) { var text1 = formatValue(translator.getDomainStart(), options), text2 = formatValue(translator.getDomainEnd(), options); return text1.length >= text2.length ? text1 : text2 }; exports.formatValue = formatValue; exports.getSampleText = getSampleText; exports.compareArrays = function(array1, array2) { return array1 && array2 && array1.length === array2.length && compareArraysElements(array1, array2) }; function compareArraysElements(array1, array2) { var i, array1ValueIsNaN, array2ValueIsNaN, ii = array1.length; 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 */ 95).plugin); dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/title */ 106).plugin); dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/tooltip */ 108).plugin); dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/loading_indicator */ 121).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 */ 71).prototype, nodeProto = __webpack_require__( /*! ./node */ 170).prototype, _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend; proto._eventsMap.onNodesInitialized = { name: "nodesInitialized" }; proto._eventsMap.onNodesRendering = { name: "nodesRendering" }; proto._createProxyType = function() { var nodes, that = this; Proxy.prototype = { constructor: Proxy, getParent: function() { return nodes[this._id].parent.proxy || null }, getChild: function(index) { var _nodes = nodes[this._id].nodes; return _nodes ? _nodes[index].proxy : null }, getChildrenCount: function() { var _nodes = nodes[this._id].nodes; return _nodes ? _nodes.length : 0 }, getAllChildren: function() { var i, _nodes = nodes[this._id].nodes, ii = _nodes && _nodes.length, list = []; for (i = 0; i < ii; ++i) { list.push(_nodes[i].proxy) } return list }, getAllNodes: function() { var list = []; collectNodes(nodes[this._id], list); return list }, isLeaf: function() { return !nodes[this._id].isNode() }, isActive: function() { return nodes[this._id].isActive() }, value: function(arg) { var result, node = nodes[this._id]; 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 result, node = nodes[this._id]; 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 i, nodes = node.nodes, ii = nodes && nodes.length; for (i = 0; i < ii; ++i) { list.push(nodes[i].proxy); collectNodes(nodes[i], list) } } function updateValue(node, value) { var delta = value - node.value; while (node) { node.value += delta; node = node.parent } } proto._extendProxyType = __webpack_require__( /*! ../../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, 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 */ 175); DevExpress.excelExporter = __webpack_require__( /*! ../../exporter/exceljs/excelExporter */ 455); DevExpress.VERSION = __webpack_require__( /*! ../../core/version */ 133); DevExpress.Class = __webpack_require__( /*! ../../core/class */ 15); DevExpress.DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 84); DevExpress.Component = __webpack_require__( /*! ../../core/component */ 112); DevExpress.registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9); DevExpress.devices = __webpack_require__( /*! ../../core/devices */ 16); DevExpress.Color = __webpack_require__( /*! ../../color */ 86); var animationFrame = __webpack_require__( /*! ../../animation/frame */ 113); DevExpress.EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 85); DevExpress.utils = {}; DevExpress.utils.requestAnimationFrame = animationFrame.requestAnimationFrame; DevExpress.utils.cancelAnimationFrame = animationFrame.cancelAnimationFrame; DevExpress.utils.initMobileViewport = __webpack_require__( /*! ../../mobile/init_mobile_viewport/init_mobile_viewport */ 459).initMobileViewport; DevExpress.utils.extendFromObject = __webpack_require__( /*! ../../core/utils/extend */ 0).extendFromObject; DevExpress.utils.createComponents = __webpack_require__( /*! ../../core/utils/dom */ 11).createComponents; DevExpress.utils.triggerShownEvent = __webpack_require__( /*! ../../core/utils/dom */ 11).triggerShownEvent; DevExpress.utils.triggerHidingEvent = __webpack_require__( /*! ../../core/utils/dom */ 11).triggerHidingEvent; DevExpress.utils.resetActiveElement = __webpack_require__( /*! ../../core/utils/dom */ 11).resetActiveElement; DevExpress.utils.findBestMatches = __webpack_require__( /*! ../../core/utils/common */ 4).findBestMatches; DevExpress.createQueue = __webpack_require__( /*! ../../core/utils/queue */ 270).create; DevExpress.utils.dom = __webpack_require__( /*! ../../core/utils/dom */ 11); 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 */ 49); DevExpress.utils.resizeCallbacks = __webpack_require__( /*! ../../core/utils/resize_callbacks */ 134); DevExpress.utils.console = __webpack_require__( /*! ../../core/utils/console */ 65); DevExpress.utils.string = __webpack_require__( /*! ../../core/utils/string */ 45); DevExpress.utils.support = __webpack_require__( /*! ../../core/utils/support */ 44); DevExpress.utils.ajax = __webpack_require__( /*! ../../core/utils/ajax */ 62); DevExpress.viewPort = __webpack_require__( /*! ../../core/utils/view_port */ 73).value; DevExpress.hideTopOverlay = __webpack_require__( /*! ../../mobile/hide_top_overlay */ 213); DevExpress.formatHelper = __webpack_require__( /*! ../../format_helper */ 63); DevExpress.config = __webpack_require__( /*! ../../core/config */ 29); DevExpress.animationPresets = __webpack_require__( /*! ../../animation/presets/presets */ 182).presets; DevExpress.fx = __webpack_require__( /*! ../../animation/fx */ 39); DevExpress.TransitionExecutor = __webpack_require__( /*! ../../animation/transition_executor/transition_executor */ 288).TransitionExecutor; DevExpress.AnimationPresetCollection = __webpack_require__( /*! ../../animation/presets/presets */ 182).PresetCollection; DevExpress.events = __webpack_require__( /*! ../../events */ 289); DevExpress.events.click = __webpack_require__( /*! ../../events/click */ 20); DevExpress.events.utils = __webpack_require__( /*! ../../events/utils */ 8); DevExpress.events.GestureEmitter = __webpack_require__( /*! ../../events/gesture/emitter.gesture */ 159); DevExpress.localization = __webpack_require__( /*! ../../localization */ 462); DevExpress.templateRendered = __webpack_require__( /*! ../../core/templates/template_base */ 74).renderedCallbacks; DevExpress.setTemplateEngine = __webpack_require__( /*! ../../core/templates/template_engine_registry */ 160).setTemplateEngine; 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), dataUtils = __webpack_require__( /*! ../core/element_data */ 40), Class = __webpack_require__( /*! ../core/class */ 15), devices = __webpack_require__( /*! ../core/devices */ 16), registerEvent = __webpack_require__( /*! ./core/event_registrator */ 72), eventUtils = __webpack_require__( /*! ./utils */ 8), pointerEvents = __webpack_require__( /*! ./pointer */ 23); var HOVERSTART_NAMESPACE = "dxHoverStart", HOVERSTART = "dxhoverstart", POINTERENTER_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(pointerEvents.enter, HOVERSTART_NAMESPACE), HOVEREND_NAMESPACE = "dxHoverEnd", HOVEREND = "dxhoverend", POINTERLEAVE_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(pointerEvents.leave, HOVEREND_NAMESPACE); var Hover = Class.inherit({ noBubble: true, ctor: function() { this._handlerArrayKeyPath = this._eventNamespace + "_HandlerStore" }, setup: function(element) { dataUtils.data(element, this._handlerArrayKeyPath, {}) }, add: function(element, handleObj) { var that = this, 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), dataUtils = __webpack_require__( /*! ./utils */ 41), arrayUtils = __webpack_require__( /*! ./array_utils */ 138), isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction, config = __webpack_require__( /*! ../core/config */ 29), errors = __webpack_require__( /*! ./errors */ 37).errors, Store = __webpack_require__( /*! ./abstract_store */ 101), arrayQuery = __webpack_require__( /*! ./array_query */ 156), queryByOptions = __webpack_require__( /*! ./store_helper */ 83).queryByOptions, deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6), Deferred = deferredUtils.Deferred, when = deferredUtils.when, fromPromise = deferredUtils.fromPromise; var TOTAL_COUNT = "totalCount", LOAD = "load", BY_KEY = "byKey", INSERT = "insert", UPDATE = "update", 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], 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 userResult, userFunc = store._loadFunc; 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 userResult, userFunc = store._totalCountFunc; 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 userResult, userFunc = store._byKeyFunc; 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 itemsQuery, totalCountQuery, rawDataQuery = arrayQuery(rawData, { errorHandler: store._errorHandler }), waitList = []; var items, 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 item, keyExpr = store.key(); 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 userResult, that = this, userFunc = that._insertFunc, 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 userResult, userFunc = this._updateFunc, 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 userResult, userFunc = this._removeFunc, 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 */ 73); var SWATCH_CONTAINER_CLASS_PREFIX = "dx-swatch-"; var getSwatchContainer = function(element) { var $element = $(element); var swatchContainer = $element.closest('[class^="' + SWATCH_CONTAINER_CLASS_PREFIX + '"], [class*=" ' + SWATCH_CONTAINER_CLASS_PREFIX + '"]'); var viewport = viewPortUtils.value(); if (!swatchContainer.length) { return viewport } var swatchClassRegex = new RegExp("(\\s|^)(" + 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 */ 178), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 84), each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, eventUtils = __webpack_require__( /*! ../utils */ 8), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, publicComponentUtils = __webpack_require__( /*! ../../core/utils/public_component */ 135); var DX_SWIPEABLE = "dxSwipeable", SWIPEABLE_CLASS = "dx-swipeable", ACTION_TO_EVENT_MAP = { onStart: swipeEvents.start, onUpdated: swipeEvents.swipe, onEnd: swipeEvents.end, onCancel: "dxswipecancel" }; var Swipeable = DOMComponent.inherit({ _getDefaultOptions: function() { return extend(this.callBase(), { elastic: true, immediate: false, direction: "horizontal", itemSizeFunc: null, onStart: null, onUpdated: null, onEnd: null, onCancel: null }) }, _render: function() { this.callBase(); this.$element().addClass(SWIPEABLE_CLASS); this._attachEventHandlers() }, _attachEventHandlers: function() { this._detachEventHandlers(); if (this.option("disabled")) { return } var NAME = this.NAME; this._createEventData(); each(ACTION_TO_EVENT_MAP, 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/core/component_registrator_callbacks.js ***! \**********************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var MemorizedCallbacks = __webpack_require__( /*! ./memorized_callbacks */ 180); 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), browser = __webpack_require__( /*! ../../core/utils/browser */ 25), domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 13), Class = __webpack_require__( /*! ../../core/class */ 15), 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), typeUtils = __webpack_require__( /*! ../core/utils/type */ 1), iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3), compileGetter = __webpack_require__( /*! ../core/utils/data */ 18).compileGetter, toComparable = __webpack_require__( /*! ../core/utils/data */ 18).toComparable, Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred, errorsModule = __webpack_require__( /*! ./errors */ 37), 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, 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], xValue = rule.getter(x), yValue = rule.getter(y), compare = rule.compare || defaultCompare, 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]), op = crit[1], 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))), searchValue = toString(value); if (getterValue.length < searchValue.length) { return false } return getterValue.lastIndexOf(value) === 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], 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 = {}, keys = [], iter = this.iter, getter = compileGetter(this.getter); iter.reset(); while (iter.next()) { var current = iter.current(), 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 seed, d = (new Deferred).fail(handleError), step = aggregator.step, 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), iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3), config = __webpack_require__( /*! ../../core/config */ 29), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, queryAdapters = __webpack_require__( /*! ../query_adapters */ 184), odataUtils = __webpack_require__( /*! ./utils */ 110), serializePropName = odataUtils.serializePropName, errors = __webpack_require__( /*! ../errors */ 37).errors, dataUtils = __webpack_require__( /*! ../utils */ 41), isFunction = typeUtils.isFunction; var DEFAULT_PROTOCOL_VERSION = 2; var compileCriteria = function() { var protocolVersion, forceLowerCase, 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], formatters = 4 === protocolVersion ? formattersV4 : formattersV2, formatter = formatters[op.toLowerCase()]; if (!formatter) { throw errors.Error("E4003", op) } var fieldName = criteria[0], 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], crit = compileCore(criteria[1]); if ("!" === op) { return "not (" + crit + ")" } throw errors.Error("E4003", op) }; var compileGroup = function(criteria) { var groupOperator, nextGroupOperator, bag = []; 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 _select, _skip, _take, _countQuery, _sorting = [], _criteria = [], _expand = queryOptions.expand, _oDataVersion = queryOptions.version || DEFAULT_PROTOCOL_VERSION; var hasSlice = function() { return _skip || void 0 !== _take }; var hasFunction = function 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, fieldTypes = queryOptions && queryOptions.fieldTypes, 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 rule, getter = args[i][0], desc = !!args[i][1]; if ("string" !== typeof getter) { return false } rule = serializePropName(getter); if (desc) { rule += " desc" } rules = rules || []; rules.push(rule) } _sorting = rules }, slice: function(skipCount, takeCount) { if (hasSlice()) { return false } _skip = skipCount; _take = takeCount }, filter: function(criterion) { if (hasSlice()) { return false } if (!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/viz/core/renderers/renderer.js ***! \*************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _slicedToArray = function() { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = void 0; try { for (var _s, _i = arr[Symbol.iterator](); !(_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 && _i.return) { _i.return() } } finally { if (_d) { throw _e } } } return _arr } return function(arr, i) { if (Array.isArray(arr)) { return arr } else { if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i) } else { throw new TypeError("Invalid attempt to destructure non-iterable instance") } } } }(); var _renderer = __webpack_require__( /*! ../../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _dom_adapter = __webpack_require__( /*! ../../../core/dom_adapter */ 13); 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 */ 61); 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 */ 210); var _animation = __webpack_require__( /*! ./animation */ 794); var _animation2 = _interopRequireDefault(_animation); var _utils = __webpack_require__( /*! ../utils */ 12); var _type = __webpack_require__( /*! ../../../core/utils/type */ 1); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } 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 KEY_TEXTS_ALIGNMENT = "textsAlignment"; 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"), 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 } module.exports.getFuncIri = getFuncIri; function extend(target, source) { var key = void 0; 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 = void 0; 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 processHatchingAttrs(element, attrs) { if (attrs.hatching && "none" !== (0, _utils.normalizeEnum)(attrs.hatching.direction)) { attrs = extend({}, attrs); attrs.fill = element._hatching = element.renderer.lockHatching(attrs.fill, attrs.hatching, element._hatching); delete attrs.hatching } else { if (element._hatching) { element.renderer.releaseHatching(element._hatching); element._hatching = null } } return attrs } module.exports.processHatchingAttrs = processHatchingAttrs; function normalizeArcParams(x, y, innerR, outerR, startAngle, endAngle) { var isCircle = void 0, noArc = true, 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 = void 0, ii = void 0, 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, k0 = list.length, k = k0, 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 = void 0, k = list.length, 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 = [], k = 0, i = void 0, ii = segments.length, segment = void 0, j = void 0, jj = void 0; 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, newLength = newSegments.length, i = void 0, originalNewSegments = void 0, 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], 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(), i = short.length; prepareConstSegment(constSeg, type); for (; i < long.length; i++) { short[i] = constSeg.slice(0) } } function makeEqualAreaSegments(short, long, type) { var i = void 0, head = void 0, shortLength = short.length, longLength = long.length, constsSeg1 = void 0, constsSeg2 = void 0; 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, str = "", key = void 0, value = void 0; 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, 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, attributes = {}, key = void 0, value = void 0, elem = that.element, renderer = that.renderer, rtl = renderer.rtl, hasTransformations = void 0, recalculateDashStyle = void 0, sw = void 0, i = void 0; 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) && 0 === value.indexOf("DevExpress")) { 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, segments = void 0; 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, x = void 0, y = void 0, innerRadius = void 0, outerRadius = void 0, startAngle = void 0, endAngle = void 0; 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, x = void 0, y = void 0, width = void 0, height = void 0, sw = void 0, maxSW = void 0, newSW = void 0; 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, settings = void 0, isResetRequired = void 0, wasStroked = void 0, isStroked = void 0; if (!isObjectArgument(attrs)) { return baseAttr(that, attrs) } attrs = extend({}, attrs); settings = that._settings; 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] } if (void 0 !== attrs[KEY_TEXTS_ALIGNMENT]) { alignTextNodes(that, attrs[KEY_TEXTS_ALIGNMENT]); delete attrs[KEY_TEXTS_ALIGNMENT] } 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 = void 0, realStyle = void 0, i = void 0, ii = void 0, nodes = void 0; 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 = void 0, ii = void 0, currentItem = items[0], item = void 0; 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, 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 = [], 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), i = 0, 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 = void 0, ii = void 0, item = void 0; 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, lines = void 0, hasEllipsis = false, i = void 0, ii = void 0, lineParts = void 0, j = void 0, jj = void 0, text = void 0, ellipsis = void 0, ellipsisWidth = void 0; restoreText.call(that); ellipsis = that.renderer.text(ELLIPSIS).attr(that._styles).append(that.renderer.root); 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 = void 0; 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, lines = [], textChanged = false, textIsEmpty = false, ellipsis = void 0, ellipsisWidth = void 0, ellipsisMaxWidth = maxWidth; restoreText.call(that); var restoreTitleElement = detachAndStoreTitleElements(this.element); ellipsis = that.renderer.text(ELLIPSIS).attr(that._styles).append(that.renderer.root); 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 = void 0, kk = void 0; 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 = [], i = void 0, ii = void 0, text = void 0, startBox = void 0, endBox = void 0; 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 = void 0; if ("none" !== options.wordWrap) { breakIndex = "normal" === options.wordWrap ? getSpaceBreakIndex(text, maxWidth) : getWordBreakIndex(text, maxWidth) } var restLines = []; var restText = void 0; 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 = void 0, parsedHtml = void 0; 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, x = wrapper._settings.x, lineHeight = wrapper._getLineHeight(), i = void 0, ii = void 0, 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 alignTextNodes(wrapper, alignment) { if (!wrapper._texts || "center" === alignment) { return } var items = wrapper._texts; var direction = "left" === alignment ? -1 : 1; var maxTextWidth = Math.max.apply(Math, items.map(function(t) { return getTextWidth(t) })); for (var i = 0; i < items.length; i++) { var item = items[i]; var textWidth = getTextWidth(item); if (0 !== maxTextWidth && maxTextWidth !== textWidth) { setTextNodeAttribute(item, "dx", direction * round((maxTextWidth - textWidth) / 2 * 10) / 10) } } } function maxLengthFontSize(fontSize1, fontSize2) { var parsedHeight1 = parseFloat(fontSize1), parsedHeight2 = parseFloat(fontSize2), height1 = parsedHeight1 || DEFAULT_FONT_SIZE, 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, stroke = wrapper._settings[KEY_STROKE], strokeWidth = wrapper._settings[KEY_STROKE_WIDTH], strokeOpacity = wrapper._settings[KEY_STROKE_OPACITY] || 1, tspan = void 0, i = void 0, ii = void 0; 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 = void 0, value = void 0, renderer = that.renderer, settings = that._settings, 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, curSegments = that.segments || [], newSegments = void 0, endSegments = void 0; 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, settings = that._settings, 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, 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 = void 0; 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, links = this._links, i = void 0, 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, items = link.to._links, i = void 0, next = void 0; 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, parent = elem.parentNode; parent && parent.insertBefore(elem, parent.firstChild); return this }, toForeground: function() { var elem = this.element, parent = elem.parentNode; parent && parent.appendChild(elem); return this }, attr: function(attrs) { return baseAttr(this, attrs) }, smartAttr: function(attrs) { return this.attr(processHatchingAttrs(this, 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 scaleXDefined = void 0; var scaleYDefined = void 0; var rotateX = void 0; var rotateY = void 0; 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) + ")") } scaleXDefined = (0, _type.isDefined)(tr.scaleX); 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, bBox = void 0; 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, 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, key = void 0; 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 = void 0, item = void 0; for (i = k; item = items[i]; ++i) { item._link.i = i } } function linkItem(target, container) { var items = container._links, key = target._link.after = target._link.after || container._linkAfter, i = void 0, item = void 0; 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 = void 0, 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)), dx = roundValue(box.left % 1, 2), 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, key = void 0; 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 gradient = void 0, id = getNextDefsSvgId(), that = this; 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, id = void 0, d = void 0, pattern = void 0, rect = void 0, path = void 0, step = hatching.step || 6, stepTo2 = step / 2, stepBy15 = 1.5 * step; id = _id || getNextDefsSvgId(); 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; pattern = that._createElement("pattern", { id: id, width: step, height: step, patternUnits: "userSpaceOnUse" }).append(that._defs); pattern.id = id; rect = that.rect(0, 0, step, step).attr({ fill: color, opacity: hatching.opacity }).append(pattern); 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 }) }, clipShape: function(method, methodArgs) { var that = this; var id = getNextDefsSvgId(); var clipPath = that._createElement("clipPath", { id: id }).append(that._defs); var shape = method.apply(that, methodArgs).append(clipPath); shape.id = id; shape.clipPath = clipPath; shape.remove = function() { throw "Not implemented" }; shape.dispose = function() { clipPath.dispose(); clipPath = null; return this }; return shape }, clipRect: function(x, y, width, height) { return this.clipShape(this.rect, arguments) }, clipCircle: function(x, y, radius) { return this.clipShape(this.circle, arguments) }, shadowFilter: function(x, y, width, height, offsetX, offsetY, blur, color, opacity) { var that = this, id = getNextDefsSvgId(), filter = that._createElement("filter", { id: id, x: x || 0, y: y || 0, width: width || 0, height: height || 0 }).append(that._defs), gaussianBlur = that._createElement("feGaussianBlur", { "in": "SourceGraphic", result: "gaussianBlurResult", stdDeviation: blur || 0 }).append(filter), offset = that._createElement("feOffset", { "in": "gaussianBlurResult", result: "offsetResult", dx: offsetX || 0, dy: offsetY || 0 }).append(filter), flood = that._createElement("feFlood", { result: "floodResult", "flood-color": color || "", "flood-opacity": opacity }).append(filter), composite = that._createElement("feComposite", { "in": "floodResult", in2: "offsetResult", operator: "in", result: "compositeResult" }).append(filter), 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, filterAttrs = {}, offsetAttrs = {}, 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, id = getNextDefsSvgId(), filter = that._createElement("filter", { id: id }).append(that._defs), componentTransferElement = that._createElement("feComponentTransfer").append(filter), 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, id = getNextDefsSvgId(), 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() }, byHash = storage.byHash, name = void 0; for (name in byHash) { byHash[name].pattern.dispose() } storage.byHash = {}; storage.refToHash = {}; storage.nextId = 0 }, lockHatching: function(color, hatching, ref) { var storage = this._hatchingStorage, hash = getHatchingHash(color, hatching), storageItem = void 0, pattern = void 0; 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, hash = storage.refToHash[ref], 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/events/gesture/emitter.gesture.js ***! \****************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), devices = __webpack_require__( /*! ../../core/devices */ 16), styleUtils = __webpack_require__( /*! ../../core/utils/style */ 88), callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 61), domUtils = __webpack_require__( /*! ../../core/utils/dom */ 11), readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 49), ready = readyCallbacks.add, mathUtils = __webpack_require__( /*! ../../core/utils/math */ 30), noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined, eventUtils = __webpack_require__( /*! ../utils */ 8), Emitter = __webpack_require__( /*! ../core/emitter */ 126), sign = mathUtils.sign, abs = Math.abs; var SLEEP = 0, INITED = 1, STARTED = 2, TOUCH_BOUNDARY = 10, IMMEDIATE_TOUCH_BOUNDARY = 0, IMMEDIATE_TIMEOUT = 180; var supportPointerEvents = function() { return styleUtils.styleProp("pointer-events") }; var setGestureCover = callOnce(function() { var GESTURE_COVER_CLASS = "dx-gesture-cover"; var isDesktop = "desktop" === devices.real().deviceType; 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), delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e)), deltaX = abs(delta.x), deltaY = abs(delta.y); var horizontalMove = this._validateMove(touchBoundary, deltaX, deltaY), verticalMove = this._validateMove(touchBoundary, deltaY, deltaX); var direction = this.getDirection(e), bothAccepted = "both" === direction && (horizontalMove || verticalMove), horizontalAccepted = "horizontal" === direction && horizontalMove, verticalAccepted = "vertical" === direction && verticalMove; return bothAccepted || horizontalAccepted || verticalAccepted || this._immediateAccepted }, _validateMove: function(touchBoundary, mainAxis, crossAxis) { return mainAxis && mainAxis >= touchBoundary && (this.immediate ? mainAxis >= crossAxis : true) }, _getTouchBoundary: function(e) { return this.immediate || eventUtils.isDxMouseWheelEvent(e) ? IMMEDIATE_TOUCH_BOUNDARY : TOUCH_BOUNDARY }, _adjustStartEvent: function(e) { var touchBoundary = this._getTouchBoundary(e), delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e)); this._startEvent.pageX += sign(delta.x) * touchBoundary; this._startEvent.pageY += sign(delta.y) * touchBoundary }, _resetActiveElement: function() { if ("ios" === devices.real().platform && 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/core/templates/template_engine_registry.js ***! \*************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", { value: true }); exports.registerTemplateEngine = registerTemplateEngine; exports.setTemplateEngine = setTemplateEngine; exports.getCurrentTemplateEngine = getCurrentTemplateEngine; var _type = __webpack_require__( /*! ../utils/type */ 1); var _errors = __webpack_require__( /*! ../errors */ 21); var _errors2 = _interopRequireDefault(_errors); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var templateEngines = {}; var currentTemplateEngine = void 0; function registerTemplateEngine(name, templateEngine) { templateEngines[name] = templateEngine } function setTemplateEngine(templateEngine) { if ((0, _type.isString)(templateEngine)) { currentTemplateEngine = templateEngines[templateEngine]; if (!currentTemplateEngine) { throw _errors2.default.Error("E0020", templateEngine) } } else { currentTemplateEngine = templateEngine } } function getCurrentTemplateEngine() { return currentTemplateEngine } }, /*!*****************************************************************************!*\ !*** ./artifacts/transpiled/ui/file_manager/file_provider/file_provider.js ***! \*****************************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _data = __webpack_require__( /*! ../../../core/utils/data */ 18); var _uiFile_manager = __webpack_require__( /*! ../ui.file_manager.utils */ 162); var _common = __webpack_require__( /*! ../../../core/utils/common */ 4); var _date_serialization = __webpack_require__( /*! ../../../core/utils/date_serialization */ 55); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 3); function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && ("object" === typeof call || "function" === typeof call) ? call : self } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i] } return arr2 } else { return Array.from(arr) } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } var DEFAULT_FILE_UPLOAD_CHUNK_SIZE = 2e5; var FileProvider = function() { function FileProvider(options) { _classCallCheck(this, FileProvider); options = (0, _common.ensureDefined)(options, {}); this._keyGetter = (0, _data.compileGetter)(this._getKeyExpr(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: "getItems", value: function(pathInfo) { 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: "uploadFileChunk", value: function(fileData, chunksInfo, destinationDirectory) {} }, { key: "abortFileUpload", value: function(fileData, chunksInfo, destinationDirectory) {} }, { key: "downloadItems", value: function(items) {} }, { key: "getItemContent", value: function(items) {} }, { 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, pathInfo) { var _this = this; var result = []; (0, _iterator.each)(entries, function(_, entry) { var fileItem = _this._createFileItem(entry, pathInfo); result.push(fileItem) }); return result } }, { key: "_createFileItem", value: function(dataObj, pathInfo) { var fileItem = new FileManagerItem(pathInfo, 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.key = this._keyGetter(dataObj); if (!fileItem.key) { fileItem.key = fileItem.relativeName } fileItem.thumbnail = this._thumbnailGetter(dataObj) || ""; fileItem.dataItem = dataObj; return fileItem } }, { key: "_hasSubDirs", value: function(dataObj) { return true } }, { key: "_getKeyExpr", value: function(options) { return options.keyExpr || this._defaultKeyExpr } }, { key: "_defaultKeyExpr", value: function(fileItem) { if (2 === arguments.length) { fileItem.__KEY__ = arguments[1]; return } return Object.prototype.hasOwnProperty.call(fileItem, "__KEY__") ? fileItem.__KEY__ : null } }, { 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(pathInfo, name, isDirectory) { _classCallCheck(this, FileManagerItem); this.name = name; this.pathInfo = pathInfo && [].concat(_toConsumableArray(pathInfo)) || []; this.parentPath = this._getPathByPathInfo(this.pathInfo); this.key = this.relativeName = (0, _uiFile_manager.pathCombine)(this.parentPath, name); this.isDirectory = isDirectory || false; this.isRoot = false; this.size = 0; this.dateModified = new Date; this.thumbnail = ""; this.tooltipText = "" } _createClass(FileManagerItem, [{ key: "getFullPathInfo", value: function() { var pathInfo = [].concat(_toConsumableArray(this.pathInfo)); !this.isRoot && pathInfo.push({ key: this.key, name: this.name }); return pathInfo } }, { key: "getExtension", value: function() { return this.isDirectory ? "" : (0, _uiFile_manager.getFileExtension)(this.name) } }, { key: "equals", value: function(item) { return item && this.key === item.key } }, { key: "createClone", value: function() { var result = new FileManagerItem(this.pathInfo, this.name, this.isDirectory); result.key = this.key; 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 } }, { key: "_getPathByPathInfo", value: function(pathInfo) { return pathInfo.map(function(info) { return info.name }).join(_uiFile_manager.PATH_SEPARATOR) } }]); return FileManagerItem }(); var FileManagerRootItem = function(_FileManagerItem) { _inherits(FileManagerRootItem, _FileManagerItem); function FileManagerRootItem() { _classCallCheck(this, FileManagerRootItem); var _this2 = _possibleConstructorReturn(this, (FileManagerRootItem.__proto__ || Object.getPrototypeOf(FileManagerRootItem)).call(this, null, "Files", true)); _this2.key = "__dxfmroot_394CED1B-58CF-4925-A5F8-042BC0822B31_51558CB8-C170-4655-A9E0-C454ED8EA2C1"; _this2.relativeName = ""; _this2.isRoot = true; return _this2 } return FileManagerRootItem }(FileManagerItem); module.exports.FileProvider = FileProvider; module.exports.FileManagerItem = FileManagerItem; module.exports.FileManagerRootItem = FileManagerRootItem }, /*!***********************************************************************!*\ !*** ./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) { if (!path || "/" === path) { return [] } var result = []; var pathPart = ""; for (var i = 0; i < path.length; i++) { var char = path.charAt(i); if (char === PATH_SEPARATOR) { var nextChar = path.charAt(i + 1); if (nextChar !== PATH_SEPARATOR) { if (pathPart) { result.push(pathPart); pathPart = "" } char = nextChar } i++ } pathPart += char } if (pathPart) { result.push(pathPart) } if (includeFullPath) { for (var _i = 0; _i < result.length; _i++) { result[_i] = pathCombine(0 === _i ? "" : result[_i - 1], result[_i]) } } return result }; var getEscapedFileName = function(fileName) { return fileName.replace(/\//g, "//") }; 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 displaySize + " " + sizesTitles[index] }; module.exports.getFileExtension = getFileExtension; module.exports.getName = getName; module.exports.getParentPath = getParentPath; module.exports.getPathParts = getPathParts; module.exports.getEscapedFileName = getEscapedFileName; module.exports.pathCombine = pathCombine; module.exports.getDisplayFileSize = getDisplayFileSize; module.exports.PATH_SEPARATOR = PATH_SEPARATOR }, /*!***********************************************!*\ !*** ./artifacts/transpiled/ui/load_panel.js ***! \***********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2), noop = __webpack_require__( /*! ../core/utils/common */ 4).noop, messageLocalization = __webpack_require__( /*! ../localization/message */ 10), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9), extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, LoadIndicator = __webpack_require__( /*! ./load_indicator */ 76), Overlay = __webpack_require__( /*! ./overlay */ 59), Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred, themes = __webpack_require__( /*! ./themes */ 31); var LOADPANEL_CLASS = "dx-loadpanel", LOADPANEL_WRAPPER_CLASS = "dx-loadpanel-wrapper", LOADPANEL_INDICATOR_CLASS = "dx-loadpanel-indicator", LOADPANEL_MESSAGE_CLASS = "dx-loadpanel-message", LOADPANEL_CONTENT_CLASS = "dx-loadpanel-content", LOADPANEL_CONTENT_WRAPPER_CLASS = "dx-loadpanel-content-wrapper", 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/toolbar.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2), themes = __webpack_require__( /*! ./themes */ 31), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9), grep = __webpack_require__( /*! ../core/utils/common */ 4).grep, extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, arrayUtils = __webpack_require__( /*! ../core/utils/array */ 14), iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3), ActionSheetStrategy = __webpack_require__( /*! ./toolbar/ui.toolbar.strategy.action_sheet */ 582), DropDownMenuStrategy = __webpack_require__( /*! ./toolbar/ui.toolbar.strategy.drop_down_menu */ 583), ToolbarBase = __webpack_require__( /*! ./toolbar/ui.toolbar.base */ 296), ChildDefaultTemplate = __webpack_require__( /*! ../core/templates/child_default_template */ 137).ChildDefaultTemplate; var STRATEGIES = { actionSheet: ActionSheetStrategy, dropDownMenu: DropDownMenuStrategy }; var TOOLBAR_AUTO_HIDE_ITEM_CLASS = "dx-toolbar-item-auto-hide", TOOLBAR_AUTO_HIDE_TEXT_CLASS = "dx-toolbar-text-auto-hide", 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") }, _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), $itemContainer = $(item).children(), $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") || [], 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 */ 332); module.exports.show = __webpack_require__( /*! ./tooltip/ui.tooltip */ 231).show; module.exports.hide = __webpack_require__( /*! ./tooltip/ui.tooltip */ 231).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), inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray, iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3); var DEFAULT_DATE_INTERVAL = ["year", "month", "day"], 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 endFilterValue, startFilterExpression, endFilterExpression, column = this, 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 dateStart, dateEnd, dateInterval, column = this, values = getDateValues(filterValue), 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, selector = getFilterSelector(column, target), groupInterval = module.exports.getGroupInterval(column); if ("headerFilter" === target && groupInterval && typeUtils.isDefined(filterValue)) { var interval, startFilterValue, endFilterValue, values = ("" + filterValue).split("/"), value = Number(values[values.length - 1]); interval = groupInterval[values.length - 1]; startFilterValue = [selector, ">=", value]; endFilterValue = [selector, "<", value + interval]; var condition = [startFilterValue, "and", endFilterValue]; return condition } return [selector, selectedFilterOperation || "=", filterValue] }; return { defaultCalculateFilterExpression: function(filterValue, selectedFilterOperation, target) { var column = this, selector = getFilterSelector(column, target), isSearchByDisplayValue = column.calculateDisplayValue && "search" === target, dataType = isSearchByDisplayValue && column.lookup && column.lookup.dataType || column.dataType, filter = null; if (("headerFilter" === target || "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, result = [], dateIntervals = ["year", "month", "day", "hour", "minute", "second"], groupInterval = column.headerFilter && column.headerFilter.groupInterval, 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 */ 13); 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 */ 40); var _element_data2 = _interopRequireDefault(_element_data); var _pointer = __webpack_require__( /*! ../../events/pointer */ 23); var _pointer2 = _interopRequireDefault(_pointer); var _click = __webpack_require__( /*! ../../events/click */ 20); var _click2 = _interopRequireDefault(_click); var _double_click = __webpack_require__( /*! ../../events/double_click */ 131); 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 */ 88); var _style2 = _interopRequireDefault(_style); var _dom = __webpack_require__( /*! ../../core/utils/dom */ 11); 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 */ 100); var _uiGrid_core = __webpack_require__( /*! ./ui.grid_core.modules */ 38); var _uiGrid_core2 = _interopRequireDefault(_uiGrid_core); var _uiGrid_core3 = __webpack_require__( /*! ./ui.grid_core.utils */ 36); var _uiGrid_core4 = __webpack_require__( /*! ./ui.grid_core.column_state_mixin */ 340); var _uiGrid_core5 = _interopRequireDefault(_uiGrid_core4); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var SCROLL_CONTAINER_CLASS = "scroll-container", GROUP_SPACE_CLASS = "group-space", CONTENT_CLASS = "content", TABLE_CLASS = "table", TABLE_FIXED_CLASS = "table-fixed", CONTENT_FIXED_CLASS = "content-fixed", ROW_CLASS = "dx-row", FIXED_COL_CLASS = "dx-col-fixed", GROUP_ROW_CLASS = "dx-group-row", DETAIL_ROW_CLASS = "dx-master-detail-row", FILTER_ROW_CLASS = "filter-row", CELL_UPDATED_ANIMATION_CLASS = "cell-updated-animation", HIDDEN_COLUMNS_WIDTH = "0.0001px", CELL_HINT_VISIBLE = "dxCellHintVisible", 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, touchCurrentTarget, 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 name, i, oldAttributes = element.attributes, newAttributes = newElement.attributes; for (i = 0; i < oldAttributes.length; i++) { 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, scrollingOptions = that.option("scrolling"), 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, 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, $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 difference, e = args.event, $element = (0, _renderer2.default)(e.target), $cell = (0, _renderer2.default)(e.currentTarget), $row = $cell.parent(), isDataRow = $row.hasClass("dx-data-row"), isHeaderRow = $row.hasClass("dx-header-row"), isGroupRow = $row.hasClass(GROUP_ROW_CLASS), isMasterDetailRow = $row.hasClass(DETAIL_ROW_CLASS), isFilterRow = $row.hasClass(that.addWidgetPrefix(FILTER_ROW_CLASS)), visibleColumns = that._columnsController.getVisibleColumns(), rowOptions = $row.data("options"), columnIndex = $cell.index(), cellOptions = rowOptions && rowOptions.cells && rowOptions.cells[columnIndex], column = cellOptions ? cellOptions.column : visibleColumns[columnIndex], 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) } 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 formItemOptions, resultOptions, $cell = (0, _renderer2.default)(event.currentTarget), $fieldItemContent = (0, _renderer2.default)(event.target).closest("." + FORM_FIELD_ITEM_CONTENT_CLASS), rowOptions = $cell.parent().data("options"), options = rowOptions && rowOptions.cells && rowOptions.cells[$cell.index()]; if (!$cell.closest("table").is(event.delegateTarget)) { return } resultOptions = (0, _extend.extend)({}, options, { cellElement: (0, _dom.getPublicElement)($cell), event: event, eventType: event.type }); if ($fieldItemContent.length) { 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 i, j, colspan, colgroupElement = (0, _renderer2.default)(""); for (i = 0; i < columns.length; i++) { colspan = columns[i].colspan || 1; for (j = 0; j < colspan; j++) { colgroupElement.append(this._createCol(columns[i])) } } return colgroupElement }, _createCol: function(column) { var width = column.visibleWidth || column.width; if ("adaptiveHidden" === width) { width = HIDDEN_COLUMNS_WIDTH } var col = (0, _renderer2.default)(""); _style2.default.setWidth(col, width); return col }, renderDelayedTemplates: function() { var delayedTemplates = this._delayedTemplates, syncTemplates = delayedTemplates.filter(function(template) { return !template.async }), 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 templateParameters, date = new Date; while (templates.length) { templateParameters = templates.shift(); var options = templateParameters.options, model = options.model, 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 templateID, renderingTemplate, that = this; 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 { 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 async, that = this, renderingTemplate = that._processTemplate(template, options), column = options.column, isDataRow = "data" === options.rowType; if (renderingTemplate) { options.component = that.component; 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 that = this, scrollLeft = that._scrollLeft; if (scrollLeft >= 0) { that._scrollLeft = 0; that.scrollTo({ left: scrollLeft }) } }, _renderCore: function(e) { var $root = this.element().parent(); if (!$root || $root.parent().length) { this.renderDelayedTemplates(e) } }, _renderTable: function(options) { options = options || {}; var $table, that = this; options.columns = that._columnsController.getVisibleColumns(); var changeType = options.change && options.change.changeType; $table = that._createTable(options.columns, "append" === changeType || "prepend" === changeType || "update" === changeType); that._renderRows($table, options); return $table }, _renderRows: function($table, options) { var i, that = this, rows = that._getRows(options.change), columnIndices = options.change && options.change.columnIndices || [], changeTypes = options.change && options.change.changeTypes || []; for (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) { var $row, $wrappedRow, that = this; if (!options.columnIndices) { options.row.cells = [] } $row = that._createRow(options.row); $wrappedRow = that._wrapRowIfNeed($table, $row); if ("remove" !== options.changeType) { that._renderCells($row, options) } that._appendRow($table, $wrappedRow); var rowOptions = (0, _extend.extend)({ columns: options.columns }, options.row); that._addWatchMethod(rowOptions, options.row); that._rowPrepared($wrappedRow, rowOptions, options.row) }, _needRenderCell: function(columnIndex, columnIndices) { return !columnIndices || columnIndices.indexOf(columnIndex) >= 0 }, _renderCells: function($row, options) { var i, that = this, columnIndex = 0, row = options.row, columns = options.columns; for (i = 0; i < columns.length; i++) { if (this._needRenderCell(i, options.columnIndices)) { 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(), $newCells = $newRowElement.children(), highlightChanges = this.option("highlightChanges"), cellUpdatedClass = this.addWidgetPrefix(CELL_UPDATED_ANIMATION_CLASS); columnIndices.forEach(function(columnIndex, index) { var $cell = $cells.eq(columnIndex), $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 $cell, that = this, cellOptions = that._getCellOptions(options); if (options.columnIndices) { if (options.row.cells) { options.row.cells[cellOptions.columnIndex] = cellOptions } } else { options.row.cells.push(cellOptions) } $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"] }, scrollTo: function(pos) { var that = this, $element = that.element(), $scrollContainer = $element && $element.children("." + that.addWidgetPrefix(SCROLL_CONTAINER_CLASS)).not("." + that.addWidgetPrefix(CONTENT_FIXED_CLASS)); that._skipScrollChanged = false; if (_type2.default.isDefined(pos) && _type2.default.isDefined(pos.left) && that._scrollLeft !== pos.left) { that._scrollLeft = pos.left; $scrollContainer && $scrollContainer.scrollLeft(Math.round(pos.left)); that._skipScrollChanged = true } }, _wrapTableInScrollContainer: function($table) { var $scrollContainer, that = this; $scrollContainer = (0, _renderer2.default)("
"); _events_engine2.default.on($scrollContainer, "scroll", function() { !that._skipScrollChanged && that.scrollChanged.fire({ left: $scrollContainer.scrollLeft() }, that.name); that._skipScrollChanged = false }); $scrollContainer.addClass(that.addWidgetPrefix(CONTENT_CLASS)).addClass(that.addWidgetPrefix(SCROLL_CONTAINER_CLASS)).append($table).appendTo(that.element()); that.setAria("role", "presentation", $scrollContainer); return $scrollContainer }, _updateContent: function($newTableElement) { this._setTableElement($newTableElement); this._wrapTableInScrollContainer($newTableElement) }, _findContentElement: _common.noop, _getWidths: function($cellElements) { var width, clientRect, result = [], legacyRendering = this.option("legacyRendering"); if ($cellElements) { _iterator2.default.each($cellElements, function(index, item) { width = item.offsetWidth; if (item.getBoundingClientRect) { 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 $rows, $cells, that = this, result = []; (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, i, width, minWidth, columnIndex, columnAutoWidth = this.option("columnAutoWidth"), 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 (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 $cell, that = this, $cells = that.getCellElements(rowIndex), 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, $rowElement = (0, _renderer2.default)(), $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), 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) { var columnIndex; if (_type2.default.isString(columnIdentifier)) { 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 $cells, $rows = rows || this._getRowElements(); 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 }, _getRowElementsCore: 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)() }, _getRowElements: function(tableElement) { return this._getRowElementsCore(tableElement) }, getRowIndex: function($row) { return this._getRowElements().index($row) }, getBoundingRect: function() {}, getName: function() {}, setScrollerSpacing: function(width) { var that = this, $element = that.element(), rtlEnabled = that.option("rtlEnabled"); $element && $element.css(rtlEnabled ? { paddingLeft: width } : { paddingRight: width }) }, isScrollbarVisible: function(isHorizontal) { var $element = this.element(), $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 */ 12); 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 */ 86); 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 = void 0; 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, 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 paletteName, item = {}; if (_isArray(palette)) { item.simpleSet = palette.slice(0) } else { if (palette) { item.simpleSet = _isArray(palette.simpleSet) ? palette.simpleSet.slice(0) : void 0; item.indicatingSet = _isArray(palette.indicatingSet) ? palette.indicatingSet.slice(0) : void 0; item.gradientSet = _isArray(palette.gradientSet) ? palette.gradientSet.slice(0) : void 0; 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, paletteSteps = new RingBuf([0, stepHighlight, -stepHighlight]), 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, l = hsl.l / 100, diapason = cycleCount - 1 / cycleCount, minL = l - .5 * diapason, maxL = l + .5 * diapason, cycleMiddle = (cycleCount - 1) / 2, 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, cycles = _floor((count - 1) / paletteCount + 1), 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, extendedPalette = []; function distributeColors(count, colorsCount, startIndex, distribution) { var middleIndex, size, groupSize = Math.floor(count / colorsCount), extraItems = count - colorsCount * groupSize, i = startIndex; 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), 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 = [], colorInGroups = paletteCount - 2, currentColorIndex = 0, 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(), 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 i, palette = [], ii = originalPalette.length; for (i = 0; i < ii; ++i) { palette.push(getNewColor(originalPalette[i], step)) } return palette } function getNewColor(currentColor, step) { var newColor = new _Color(currentColor).alter(step), lightness = getLightness(newColor); if (lightness > 200 || lightness < 55) { newColor = new _Color(currentColor).alter(-step / 2) } return newColor.toHex() } function getLightness(color) { return .3 * color.r + .59 * color.g + .11 * color.b } function 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 i, colorCount = count - 1, sourceCount = source.length - 1, colors = [], gradient = []; function addColor(pos) { var k = sourceCount * pos, kl = _floor(k), 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 }), color1 = new _Color(palette[0]), 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), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, scatterSeries = __webpack_require__( /*! ./scatter_series */ 107).chart, lineSeries = __webpack_require__( /*! ./line_series */ 204), chartLineSeries = lineSeries.chart.line, polarLineSeries = lineSeries.polar.line, _map = __webpack_require__( /*! ../core/utils */ 12).map, _extend = extend, 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 }, areaParams = { points: segment.area }, 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 || {}, 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], 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], 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), 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, 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/core/dom_component_with_template.js ***! \******************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _renderer = __webpack_require__( /*! ./renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _type = __webpack_require__( /*! ./utils/type */ 1); var _common = __webpack_require__( /*! ./utils/common */ 4); var _extend = __webpack_require__( /*! ./utils/extend */ 0); var _errors = __webpack_require__( /*! ./errors */ 21); var _dom = __webpack_require__( /*! ./utils/dom */ 11); var _devices = __webpack_require__( /*! ./devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _dom_component = __webpack_require__( /*! ./dom_component */ 84); var _dom_component2 = _interopRequireDefault(_dom_component); var _template = __webpack_require__( /*! ./templates/template */ 476); var _template_base = __webpack_require__( /*! ./templates/template_base */ 74); var _function_template = __webpack_require__( /*! ./templates/function_template */ 99); var _empty_template = __webpack_require__( /*! ./templates/empty_template */ 97); var _child_default_template = __webpack_require__( /*! ./templates/child_default_template */ 137); var _inflector = __webpack_require__( /*! ./utils/inflector */ 33); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var TEXT_NODE = 3; var ANONYMOUS_TEMPLATE_NAME = "template"; var TEMPLATE_SELECTOR = "[data-options*='dxTemplate']"; var TEMPLATE_WRAPPER_CLASS = "dx-template-wrapper"; var DX_POLYMORPH_WIDGET_TEMPLATE = new _function_template.FunctionTemplate(function(options) { var widgetName = options.model.widget; if (widgetName) { var widgetElement = (0, _renderer2.default)("
"), widgetOptions = options.model.options || {}; if ("button" === widgetName || "tabs" === widgetName || "dropDownMenu" === widgetName) { var deprecatedName = widgetName; widgetName = (0, _inflector.camelize)("dx-" + widgetName); (0, _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 (0, _renderer2.default)() }); var DOMComponentWithTemplate = _dom_component2.default.inherit({ _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { integrationOptions: { watchMethod: function(fn, callback, options) { options = options || {}; if (!options.skipImmediate) { callback(fn()) } return _common.noop }, templates: { "dx-polymorph-widget": DX_POLYMORPH_WIDGET_TEMPLATE }, createTemplate: function(element) { return new _template.Template(element) } } }) }, _init: function() { this.callBase(); this._tempTemplates = []; this._defaultTemplates = {}; this._initTemplates() }, _dispose: function() { this._cleanTemplates(); this.callBase() }, _cleanTemplates: function() { this._tempTemplates.forEach(function(t) { t.template.dispose && t.template.dispose() }); this._tempTemplates = [] }, _initTemplates: function() { this._extractTemplates(); this._extractAnonymousTemplate() }, _extractTemplates: function() { var templateElements = this.$element().contents().filter(TEMPLATE_SELECTOR); var templatesMap = {}; templateElements.each(function(_, template) { var templateOptions = (0, _dom.getElementOptions)(template).dxTemplate; if (!templateOptions) { return } if (!templateOptions.name) { throw (0, _errors.Error)("E0023") }(0, _renderer2.default)(template).addClass(TEMPLATE_WRAPPER_CLASS).detach(); templatesMap[templateOptions.name] = templatesMap[templateOptions.name] || []; templatesMap[templateOptions.name].push(template) }); for (var templateName in templatesMap) { var deviceTemplate = this._findTemplateByDevice(templatesMap[templateName]); if (deviceTemplate) { this._saveTemplate(templateName, deviceTemplate) } } }, _saveTemplate: function(name, template) { var templates = this.option("integrationOptions.templates"); templates[name] = this._createTemplate(template) }, _findTemplateByDevice: function(templates) { var suitableTemplate = (0, _common.findBestMatches)(_devices2.default.current(), templates, function(template) { return (0, _dom.getElementOptions)(template).dxTemplate })[0]; templates.forEach(function(template) { if (template !== suitableTemplate) { (0, _renderer2.default)(template).remove() } }); return suitableTemplate }, _extractAnonymousTemplate: function() { var templates = this.option("integrationOptions.templates"), anonymousTemplateName = this._getAnonymousTemplateName(), $anonymousTemplate = this.$element().contents().detach(); var $notJunkTemplateContent = $anonymousTemplate.filter(function(_, element) { var isTextNode = element.nodeType === TEXT_NODE, isEmptyText = (0, _renderer2.default)(element).text().trim().length < 1; return !(isTextNode && isEmptyText) }), onlyJunkTemplateContent = $notJunkTemplateContent.length < 1; if (!templates[anonymousTemplateName] && !onlyJunkTemplateContent) { templates[anonymousTemplateName] = this._createTemplate($anonymousTemplate) } }, _getAnonymousTemplateName: function() { return ANONYMOUS_TEMPLATE_NAME }, _createTemplateIfNeeded: function(templateSource) { var templateKey = function(templateSource) { return (0, _type.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 ? (0, _dom.normalizeTemplateElement)(templateSource) : templateSource; return this.option("integrationOptions.createTemplate")(templateSource) }, _getTemplateByOption: function(optionName) { return this._getTemplate(this.option(optionName)) }, _getTemplate: function(templateSource) { if ((0, _type.isFunction)(templateSource)) { return new _function_template.FunctionTemplate(function(options) { var templateSourceResult = templateSource.apply(this, this._getNormalizedTemplateArgs(options)); if (!(0, _type.isDefined)(templateSourceResult)) { return new _empty_template.EmptyTemplate } var dispose = false; var template = this._acquireTemplate(templateSourceResult, function(templateSource) { if (templateSource.nodeType || (0, _type.isRenderer)(templateSource) && !(0, _renderer2.default)(templateSource).is("script")) { return new _function_template.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 _empty_template.EmptyTemplate } if (templateSource instanceof _child_default_template.ChildDefaultTemplate) { return this._defaultTemplates[templateSource.name] } if (templateSource instanceof _template_base.TemplateBase) { return templateSource } if ((0, _type.isFunction)(templateSource.render) && !(0, _type.isRenderer)(templateSource)) { return this._addOneRenderedCall(templateSource) } if (templateSource.nodeType || (0, _type.isRenderer)(templateSource)) { return createTemplate((0, _renderer2.default)(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) }, _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 }, _addOneRenderedCall: function(template) { var _render = template.render.bind(template); return (0, _extend.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 _template_base.TemplateBase)) { var isAsyncTemplate = this.option("templatesRenderAsynchronously"); if (!isAsyncTemplate) { return this._addOneRenderedCall(integrationTemplate) } } return integrationTemplate } }); module.exports = DOMComponentWithTemplate }, /*!*****************************************************************!*\ !*** ./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), eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5), support = __webpack_require__( /*! ../core/utils/support */ 44), devices = __webpack_require__( /*! ../core/devices */ 16), Class = __webpack_require__( /*! ../core/class */ 15), registerEvent = __webpack_require__( /*! ./core/event_registrator */ 72), eventUtils = __webpack_require__( /*! ./utils */ 8), holdEvent = __webpack_require__( /*! ./hold */ 90); var CONTEXTMENU_NAMESPACE = "dxContexMenu", CONTEXTMENU_NAMESPACED_EVENT_NAME = eventUtils.addNamespace("contextmenu", CONTEXTMENU_NAMESPACE), HOLD_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(holdEvent.name, CONTEXTMENU_NAMESPACE), 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 $ = __webpack_require__( /*! ../../core/renderer */ 2), AsyncTemplateMixin = __webpack_require__( /*! ../shared/async_template_mixin */ 293), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), Guid = __webpack_require__( /*! ../../core/guid */ 34), registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4), domUtils = __webpack_require__( /*! ../../core/utils/dom */ 11), focused = __webpack_require__( /*! ../widget/selectors */ 66).focused, each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined, extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, getPublicElement = __webpack_require__( /*! ../../core/utils/dom */ 11).getPublicElement, errors = __webpack_require__( /*! ../widget/ui.errors */ 19), positionUtils = __webpack_require__( /*! ../../animation/position */ 78), getDefaultAlignment = __webpack_require__( /*! ../../core/utils/position */ 100).getDefaultAlignment, DropDownButton = __webpack_require__( /*! ./ui.drop_down_button */ 511).default, messageLocalization = __webpack_require__( /*! ../../localization/message */ 10), eventUtils = __webpack_require__( /*! ../../events/utils */ 8), TextBox = __webpack_require__( /*! ../text_box */ 91), clickEvent = __webpack_require__( /*! ../../events/click */ 20), devices = __webpack_require__( /*! ../../core/devices */ 16), FunctionTemplate = __webpack_require__( /*! ../../core/templates/function_template */ 99).FunctionTemplate, Popup = __webpack_require__( /*! ../popup */ 43); var DROP_DOWN_EDITOR_CLASS = "dx-dropdowneditor", DROP_DOWN_EDITOR_INPUT_WRAPPER = "dx-dropdowneditor-input-wrapper", DROP_DOWN_EDITOR_BUTTON_ICON = "dx-dropdowneditor-icon", DROP_DOWN_EDITOR_OVERLAY = "dx-dropdowneditor-overlay", DROP_DOWN_EDITOR_OVERLAY_FLIPPED = "dx-dropdowneditor-overlay-flipped", DROP_DOWN_EDITOR_ACTIVE = "dx-dropdowneditor-active", DROP_DOWN_EDITOR_FIELD_CLICKABLE = "dx-dropdowneditor-field-clickable", DROP_DOWN_EDITOR_FIELD_TEMPLATE_WRAPPER = "dx-dropdowneditor-field-template-wrapper"; var isIOs = "ios" === devices.current().platform; var DropDownEditor = TextBox.inherit({ _supportedKeys: function() { var homeEndHandler = function(e) { if (this.option("opened")) { e.preventDefault(); return true } return false }; return extend({}, this.callBase(), { tab: function(e) { if (!this.option("opened")) { return } if ("instantly" === this.option("applyValueMode")) { this.close(); return } var $focusableElement = e.shiftKey ? this._getLastPopupElement() : this._getFirstPopupElement(); $focusableElement && eventsEngine.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 }, home: homeEndHandler, end: homeEndHandler }) }, _getDefaultButtons: function() { return this.callBase().concat([{ name: "dropDown", Ctor: DropDownButton }]) }, _getDefaultOptions: function() { return extend(this.callBase(), { value: null, onOpened: null, onClosed: null, opened: false, acceptCustomValue: true, applyValueMode: "instantly", deferRendering: true, activeStateEnabled: true, dropDownButtonTemplate: "dropDownButton", fieldTemplate: null, contentTemplate: null, openOnFieldClick: false, showDropDownButton: true, buttons: void 0, dropDownOptions: {}, popupPosition: this._getDefaultPopupPosition(), onPopupInitialized: null, applyButtonText: messageLocalization.format("OK"), cancelButtonText: messageLocalization.format("Cancel"), buttonsLocation: "default", showPopupTitle: false, useHiddenSubmitElement: false }) }, _getDefaultPopupPosition: function() { var position = getDefaultAlignment(); 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._initInnerOptionCache("dropDownOptions") }, _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($("
").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") }, _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 = 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 = $("
").addClass(DROP_DOWN_EDITOR_FIELD_TEMPLATE_WRAPPER).appendTo($container); fieldTemplate.render({ model: data, container: domUtils.getPublicElement($templateWrapper), onRendered: function() { var $input = _this._input(); if (!$input.length) { throw errors.Error("E1010") } _this._refreshEvents(); _this._refreshValueChangeEvent(); _this._renderFocusState(); isFocused && eventsEngine.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 FunctionTemplate(function(options) { var $icon = $("
").addClass(DROP_DOWN_EDITOR_BUTTON_ICON); $(options.container).append($icon) }) }, _renderOpenHandler: function() { var that = this, $inputWrapper = that._inputWrapper(), eventName = eventUtils.addNamespace(clickEvent.name, that.NAME), openOnFieldClick = that.option("openOnFieldClick"); eventsEngine.off($inputWrapper, eventName); eventsEngine.on($inputWrapper, eventName, that._getInputClickHandler(openOnFieldClick)); that.$element().toggleClass(DROP_DOWN_EDITOR_FIELD_CLICKABLE, openOnFieldClick); if (openOnFieldClick) { that._openOnFieldClickAction = that._createAction(that._openHandler.bind(that)) } }, _attachFocusOutHandler: function() { if (isIOs) { this._detachFocusOutEvents(); eventsEngine.on(this._inputWrapper(), eventUtils.addNamespace("focusout", this.NAME), function(event) { var newTarget = event.relatedTarget; var popupWrapper = this.content ? $(this.content()).closest("." + DROP_DOWN_EDITOR_OVERLAY) : this._$popup; if (newTarget && this.option("opened")) { var isNewTargetOutside = 0 === $(newTarget).closest("." + DROP_DOWN_EDITOR_OVERLAY, popupWrapper).length; if (isNewTargetOutside) { this.close() } } }.bind(this)) } }, _detachFocusOutEvents: function() { isIOs && eventsEngine.off(this._inputWrapper(), eventUtils.addNamespace("focusout", this.NAME)) }, _getInputClickHandler: function(openOnFieldClick) { var that = this; return openOnFieldClick ? function(e) { that._executeOpenAction(e) } : function(e) { that._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") && !focused(this._input())) { eventsEngine.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 = $("
").addClass(DROP_DOWN_EDITOR_OVERLAY).addClass(this.option("customOverlayCssClass")).appendTo(this.$element()); this._renderPopup(); this._renderPopupContent() }, _renderPopup: function() { this._popup = this._createComponent(this._$popup, Popup, 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 Guid; this.setAria("id", this._popupContentId, $popupContent) }, _contentReadyHandler: commonUtils.noop, _popupConfig: function() { return { onInitialized: this._popupInitializedHandler(), position: extend(this.option("popupPosition"), { of: this.$element() }), showTitle: this.option("showPopupTitle"), width: "auto", height: "auto", shading: false, closeOnTargetScroll: true, closeOnOutsideClick: 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 } }, _popupInitializedHandler: function() { if (!this.option("onPopupInitialized")) { return } return function(e) { this._popupInitializedAction({ popup: e.component }) }.bind(this) }, _popupPositionedHandler: function(e) { e.position && this._popup.overlayContent().toggleClass(DROP_DOWN_EDITOR_OVERLAY_FLIPPED, e.position.v.flip) }, _popupShowingHandler: commonUtils.noop, _popupHidingHandler: function() { this.option("opened", false) }, _popupShownHandler: function() { this._openAction(); if (this._$validationMessage) { this._$validationMessage.dxOverlay("option", "position", this._getValidationMessagePosition()) } }, _popupHiddenHandler: function() { this._closeAction(); if (this._$validationMessage) { this._$validationMessage.dxOverlay("option", "position", this._getValidationMessagePosition()) } }, _getValidationMessagePosition: function() { var positionRequest = "below"; if (this._popup && this._popup.option("visible")) { var myTop = positionUtils.setup(this.$element()).top, popupTop = positionUtils.setup(this._popup.$content()).top; positionRequest = myTop + this.option("popupPosition").offset.v > popupTop ? "below" : "above" } return this.callBase(positionRequest) }, _renderPopupContent: function() { var contentTemplate = this._getTemplateByOption("contentTemplate"); if (!(contentTemplate && this.option("contentTemplate"))) { return } var $popupContent = this._popup.$content(), templateData = { value: this._fieldRenderData(), component: this }; $popupContent.empty(); contentTemplate.render({ container: domUtils.getPublicElement($popupContent), model: templateData }) }, _closeOutsideDropDownHandler: function(_ref) { var target = _ref.target; var $target = $(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 = $(e.currentTarget); if (e.shiftKey && $element.is(this._getFirstPopupElement()) || !e.shiftKey && $element.is(this._getLastPopupElement())) { eventsEngine.trigger(this._input(), "focus"); e.preventDefault() } }, _popupElementEscHandler: function() { eventsEngine.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"), resultConfig = buttonsConfig; if ("default" !== buttonsLocation) { var position = commonUtils.splitPair(buttonsLocation); each(resultConfig, function(_, element) { extend(element, { toolbar: position[0], location: position[1] }) }) } return resultConfig }, _applyButtonHandler: function() { this.close(); this.option("focusStateEnabled") && this.focus() }, _cancelButtonHandler: function() { this.close(); this.option("focusStateEnabled") && this.focus() }, _updatePopupWidth: commonUtils.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 = $("").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 (isDefined(args.value)) { this._renderField() } else { this._invalidate() } break; case "contentTemplate": 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; default: this.callBase(args) } }, open: function() { this.option("opened", true) }, close: function() { this.option("opened", false) }, field: function() { return getPublicElement(this._input()) }, content: function() { return this._popup ? this._popup.content() : null } }).include(AsyncTemplateMixin); registerComponent("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 */ 208).fileSaver, excelCreator = __webpack_require__( /*! ./exporter/excel_creator */ 439), imageCreator = __webpack_require__( /*! ./exporter/image_creator */ 268), svgCreator = __webpack_require__( /*! ./exporter/svg_creator */ 452), _isFunction = __webpack_require__( /*! ./core/utils/type */ 1).isFunction, Deferred = __webpack_require__( /*! ./core/utils/deferred */ 6).Deferred; exports.export = function(data, options, getData) { if (!data) { return (new Deferred).resolve() } var exportingAction = options.exportingAction, exportedAction = options.exportedAction, fileSavingAction = options.fileSavingAction, eventArgs = { fileName: options.fileName, format: options.format, cancel: false }; _isFunction(exportingAction) && exportingAction(eventArgs); if (!eventArgs.cancel) { return getData(data, options).then(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 */ 181) }; exports.excel.__internals = excelCreator.__internals; exports.image = { creator: imageCreator.imageCreator, getData: imageCreator.getData, testFormats: imageCreator.testFormats }; exports.pdf = { getData: __webpack_require__( /*! ./exporter/pdf_creator */ 454).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/resizable.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2), eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9), commonUtils = __webpack_require__( /*! ../core/utils/common */ 4), extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray, each = __webpack_require__( /*! ../core/utils/iterator */ 3).each, typeUtils = __webpack_require__( /*! ../core/utils/type */ 1), windowUtils = __webpack_require__( /*! ../core/utils/window */ 7), translator = __webpack_require__( /*! ../animation/translator */ 26), fitIntoRange = __webpack_require__( /*! ../core/utils/math */ 30).fitIntoRange, DOMComponent = __webpack_require__( /*! ../core/dom_component */ 84), eventUtils = __webpack_require__( /*! ../events/utils */ 8), dragEvents = __webpack_require__( /*! ../events/drag */ 68), isPlainObject = typeUtils.isPlainObject, isFunction = typeUtils.isFunction, domUtils = __webpack_require__( /*! ../core/utils/dom */ 11); var RESIZABLE = "dxResizable", RESIZABLE_CLASS = "dx-resizable", RESIZABLE_RESIZING_CLASS = "dx-resizable-resizing", RESIZABLE_HANDLE_CLASS = "dx-resizable-handle", RESIZABLE_HANDLE_TOP_CLASS = "dx-resizable-handle-top", RESIZABLE_HANDLE_BOTTOM_CLASS = "dx-resizable-handle-bottom", RESIZABLE_HANDLE_LEFT_CLASS = "dx-resizable-handle-left", RESIZABLE_HANDLE_RIGHT_CLASS = "dx-resizable-handle-right", RESIZABLE_HANDLE_CORNER_CLASS = "dx-resizable-handle-corner", DRAGSTART_START_EVENT_NAME = eventUtils.addNamespace(dragEvents.start, RESIZABLE), DRAGSTART_EVENT_NAME = eventUtils.addNamespace(dragEvents.move, RESIZABLE), 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(), $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), handleWidth = $handle.outerWidth(), handleHeight = $handle.outerHeight(), handleOffset = $handle.offset(), areaOffset = area.offset, 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(), sides = this._movingSides; var location = this._elementLocation, size = this._elementSize, offset = this._getOffset(e); var width = size.width + offset.x * (sides.left ? -1 : 1), 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(), offsetTop = offset.y - ((elementRect.height || height) - height), 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, steps = commonUtils.pairToObject(this.option("step"), !this.option("roundStepValue")), sides = this._getMovingSides(e), 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, size = this._elementSize, xPos = sides.left ? location.left : location.left + size.width, yPos = sides.top ? location.top : location.top + size.height, newXShift = (xPos + offset.x) % steps.h, newYShift = (yPos + offset.y) % steps.v, sign = Math.sign || function(x) { x = +x; if (0 === x || isNaN(x)) { return x } return x > 0 ? 1 : -1 }, separatorOffset = function(steps, offset) { return (1 + .2 * sign(offset)) % 1 * steps }, isSmallOffset = function(offset, steps) { return Math.abs(offset) < .2 * steps }; var newOffsetX = offset.x - newXShift, 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), hasCornerTopLeftClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-top-left"), hasCornerTopRightClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-top-right"), hasCornerBottomLeftClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-bottom-left"), 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 result, $area = $(area); 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, 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), GestureEmitter = __webpack_require__( /*! ./gesture/emitter.gesture */ 159), registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 96); var SWIPE_START_EVENT = "dxswipestart", SWIPE_EVENT = "dxswipe", SWIPE_END_EVENT = "dxswipeend"; var HorizontalStrategy = { defaultItemSizeFunc: function() { return this.getElement().width() }, getBounds: function() { return [this._maxLeftOffset, this._maxRightOffset] }, calcOffsetRatio: function(e) { var endEventData = eventUtils.eventData(e); return (endEventData.x - (this._savedEventData && this._savedEventData.x || 0)) / this._itemSizeFunc().call(this, e) }, isFastSwipe: function(e) { var endEventData = eventUtils.eventData(e); return this.FAST_SWIPE_SPEED_LIMIT * Math.abs(endEventData.x - this._tickData.x) >= endEventData.time - this._tickData.time } }; var VerticalStrategy = { defaultItemSizeFunc: function() { return this.getElement().height() }, getBounds: function() { return [this._maxTopOffset, this._maxBottomOffset] }, calcOffsetRatio: function(e) { var endEventData = eventUtils.eventData(e); return (endEventData.y - (this._savedEventData && this._savedEventData.y || 0)) / this._itemSizeFunc().call(this, e) }, isFastSwipe: function(e) { var endEventData = eventUtils.eventData(e); return this.FAST_SWIPE_SPEED_LIMIT * Math.abs(endEventData.y - this._tickData.y) >= endEventData.time - this._tickData.time } }; var STRATEGIES = { horizontal: HorizontalStrategy, vertical: VerticalStrategy }; var SwipeEmitter = GestureEmitter.inherit({ TICK_INTERVAL: 300, FAST_SWIPE_SPEED_LIMIT: 10, ctor: function(element) { this.callBase(element); this.direction = "horizontal"; this.elastic = true }, _getStrategy: function() { return STRATEGIES[this.direction] }, _defaultItemSizeFunc: function() { return this._getStrategy().defaultItemSizeFunc.call(this) }, _itemSizeFunc: function() { return this.itemSizeFunc || this._defaultItemSizeFunc }, _init: function(e) { this._tickData = eventUtils.eventData(e) }, _start: function(e) { this._savedEventData = eventUtils.eventData(e); e = this._fireEvent(SWIPE_START_EVENT, e); if (!e.cancel) { this._maxLeftOffset = e.maxLeftOffset; this._maxRightOffset = e.maxRightOffset; this._maxTopOffset = e.maxTopOffset; this._maxBottomOffset = e.maxBottomOffset } }, _move: function(e) { var strategy = this._getStrategy(), moveEventData = eventUtils.eventData(e), offset = strategy.calcOffsetRatio.call(this, e); offset = this._fitOffset(offset, this.elastic); if (moveEventData.time - this._tickData.time > this.TICK_INTERVAL) { this._tickData = moveEventData } this._fireEvent(SWIPE_EVENT, e, { offset: offset }); e.preventDefault() }, _end: function(e) { var strategy = this._getStrategy(), offsetRatio = strategy.calcOffsetRatio.call(this, e), isFast = strategy.isFastSwipe.call(this, e), startOffset = offsetRatio, targetOffset = this._calcTargetOffset(offsetRatio, isFast); startOffset = this._fitOffset(startOffset, this.elastic); targetOffset = this._fitOffset(targetOffset, false); this._fireEvent(SWIPE_END_EVENT, e, { offset: startOffset, targetOffset: targetOffset }) }, _fitOffset: function(offset, elastic) { var strategy = this._getStrategy(), bounds = strategy.getBounds.call(this); if (offset < -bounds[0]) { return elastic ? (-2 * bounds[0] + offset) / 3 : -bounds[0] } if (offset > bounds[1]) { return elastic ? (2 * bounds[1] + offset) / 3 : bounds[1] } return offset }, _calcTargetOffset: function(offsetRatio, isFast) { var result; if (isFast) { result = Math.ceil(Math.abs(offsetRatio)); if (offsetRatio < 0) { result = -result } } else { result = Math.round(offsetRatio) } return result } }); registerEmitter({ emitter: SwipeEmitter, events: [SWIPE_START_EVENT, SWIPE_EVENT, SWIPE_END_EVENT] }); exports.swipe = SWIPE_EVENT; exports.start = SWIPE_START_EVENT; exports.end = SWIPE_END_EVENT }, /*!*********************************************************!*\ !*** ./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, windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7), weakMap = windowUtils.hasWindow() ? windowUtils.getWindow().WeakMap : WeakMap; if (!weakMap) { weakMap = function() { var keys = [], 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, Callbacks = __webpack_require__( /*! ./utils/callbacks */ 27); 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 */ 45); 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 */ 209); var _language_codes = __webpack_require__( /*! ../localization/language_codes */ 286); __webpack_require__( /*! ../localization/currency */ 125); 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, 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)(), languageIDStr = languageID ? languageID.toString(16) : "", 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 = void 0, excelFormat = void 0; 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 */ 112), each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, devices = __webpack_require__( /*! ../../core/devices */ 16), fx = __webpack_require__( /*! ../fx */ 39); 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, direction = configModifier.direction, config = createBaseConfig(configModifier); config.to = { left: 0, opacity: 1 }; if ("forward" === direction) { config.from = { left: width, opacity: throughOpacity } } else { if ("backward" === direction) { config.from = { left: -width, opacity: throughOpacity } } else { config.from = { left: 0, opacity: 0 } } } return fx.createAnimation($element, config) }, leave: function($element, configModifier) { var width = $element.parent().width() * widthMultiplier, direction = configModifier.direction, config = createBaseConfig(configModifier); config.from = { left: 0, opacity: 1 }; if ("forward" === direction) { config.to = { left: -width, opacity: throughOpacity } } else { if ("backward" === direction) { config.to = { left: width, opacity: throughOpacity } } else { config.to = { left: 0, opacity: 0 } } } return fx.createAnimation($element, config) } } }, _createOpenDoorConfig: function() { var that = this; var createBaseConfig = function(configModifier) { return { type: "css", extraCssClasses: "dx-opendoor-animation", delay: void 0 === configModifier.delay ? that.option("defaultAnimationDelay") : configModifier.delay, duration: void 0 === configModifier.duration ? that.option("defaultAnimationDuration") : configModifier.duration } }; return { enter: function($element, configModifier) { var direction = configModifier.direction, config = createBaseConfig(configModifier); config.delay = "none" === direction ? config.delay : config.duration; config.from = "dx-enter dx-opendoor-animation" + directionPostfixes[direction]; config.to = "dx-enter-active"; return fx.createAnimation($element, config) }, leave: function($element, configModifier) { var direction = configModifier.direction, config = createBaseConfig(configModifier); config.from = "dx-leave dx-opendoor-animation" + directionPostfixes[direction]; config.to = "dx-leave-active"; return fx.createAnimation($element, config) } } }, _createWinPopConfig: function() { var that = this, baseConfig = { type: "css", extraCssClasses: "dx-win-pop-animation", duration: that.option("defaultAnimationDuration") }; return { enter: function($element, configModifier) { var config = baseConfig, direction = configModifier.direction; config.delay = "none" === direction ? that.option("defaultAnimationDelay") : that.option("defaultAnimationDuration") / 2; config.from = "dx-enter dx-win-pop-animation" + directionPostfixes[direction]; config.to = "dx-enter-active"; return fx.createAnimation($element, config) }, leave: function($element, configModifier) { var config = baseConfig, direction = configModifier.direction; config.delay = that.option("defaultAnimationDelay"); config.from = "dx-leave dx-win-pop-animation" + directionPostfixes[direction]; config.to = "dx-leave-active"; return fx.createAnimation($element, config) } } }, resetToDefaults: function() { this.clear(); this.registerDefaultPresets(); this.applyChanges() }, clear: function(name) { var that = this, newRegisteredPresets = []; each(this._registeredPresets, function(index, preset) { if (!name || name === preset.name) { that.option(that._getPresetOptionName(preset.name), void 0) } else { newRegisteredPresets.push(preset) } }); this._registeredPresets = newRegisteredPresets; this.applyChanges() }, registerPreset: function(name, config) { this._registeredPresets.push({ name: name, config: config }) }, applyChanges: function() { var that = this; 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 */ 277); 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__) { var _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 }; var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray, EditStrategy = __webpack_require__( /*! ./ui.collection_widget.edit.strategy */ 483); 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, keys = cache && cache.keys || this.getKeysByItems(this._getPlainItems()); if (cache && !cache.keys) { cache.keys = keys } if ("object" === ("undefined" === typeof key ? "undefined" : _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(), 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__) { var _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 }; __webpack_require__( /*! ./core */ 130); var _globalize = __webpack_require__( /*! globalize */ 75); var _globalize2 = _interopRequireDefault(_globalize); var _number = __webpack_require__( /*! ../number */ 51); var _number2 = _interopRequireDefault(_number); var _errors = __webpack_require__( /*! ../../core/errors */ 21); var _errors2 = _interopRequireDefault(_errors); __webpack_require__( /*! globalize/number */ 75); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } if (_globalize2.default && _globalize2.default.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" === _globalize2.default.locale().locale) { _globalize2.default.load(enNumbers); _globalize2.default.locale("en") } var formattersCache = {}; var getFormatter = function(format) { var formatter = void 0; var formatCacheKey = void 0; if ("object" === ("undefined" === typeof format ? "undefined" : _typeof(format))) { formatCacheKey = _globalize2.default.locale().locale + ":" + JSON.stringify(format) } else { formatCacheKey = _globalize2.default.locale().locale + ":" + format } formatter = formattersCache[formatCacheKey]; if (!formatter) { formatter = formattersCache[formatCacheKey] = _globalize2.default.numberFormatter(format) } return formatter }; var globalizeNumberLocalization = { engine: function() { return "globalize" }, _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 = void 0; 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 = void 0; 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) { _errors2.default.log("W0011") } var result = _globalize2.default.parseNumber(text); if (isNaN(result)) { result = this.callBase.apply(this, arguments) } return result } }; _number2.default.resetInjection(); _number2.default.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 }); var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); 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") } } 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 _create2 = this._create(), instance = _create2.instance, $element = _create2.$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/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 */ 52); 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 */ 138); 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 */ 310); var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 13); 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), 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), removedItem = isPartialRefresh ? change.oldItem : items[index]; if (removedItem) { var $removedItemElement = this._findItemElementByKey(change.key), 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(), keyInfo = { key: this.key.bind(this), keyOf: this.keyOf.bind(this) }, dataSource = this._dataSource, paginate = dataSource && dataSource.paginate(), 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["_" + 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/draggable.js ***! \**********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } var $ = __webpack_require__( /*! ../core/renderer */ 2), window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow(), eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5), stringUtils = __webpack_require__( /*! ../core/utils/string */ 45), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9), translator = __webpack_require__( /*! ../animation/translator */ 26), Animator = __webpack_require__( /*! ./scroll_view/animator */ 309), browser = __webpack_require__( /*! ../core/utils/browser */ 25), dasherize = __webpack_require__( /*! ../core/utils/inflector */ 33).dasherize, extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, DOMComponentWithTemplate = __webpack_require__( /*! ../core/dom_component_with_template */ 171), getPublicElement = __webpack_require__( /*! ../core/utils/dom */ 11).getPublicElement, eventUtils = __webpack_require__( /*! ../events/utils */ 8), pointerEvents = __webpack_require__( /*! ../events/pointer */ 23), dragEvents = __webpack_require__( /*! ../events/drag */ 68), positionUtils = __webpack_require__( /*! ../animation/position */ 78), typeUtils = __webpack_require__( /*! ../core/utils/type */ 1), noop = __webpack_require__( /*! ../core/utils/common */ 4).noop, viewPortUtils = __webpack_require__( /*! ../core/utils/view_port */ 73), commonUtils = __webpack_require__( /*! ../core/utils/common */ 4), EmptyTemplate = __webpack_require__( /*! ../core/templates/empty_template */ 97).EmptyTemplate, deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6), when = deferredUtils.when, fromPromise = deferredUtils.fromPromise; var DRAGGABLE = "dxDraggable", DRAGSTART_EVENT_NAME = eventUtils.addNamespace(dragEvents.start, DRAGGABLE), DRAG_EVENT_NAME = eventUtils.addNamespace(dragEvents.move, DRAGGABLE), DRAGEND_EVENT_NAME = eventUtils.addNamespace(dragEvents.end, DRAGGABLE), DRAG_ENTER_EVENT_NAME = eventUtils.addNamespace(dragEvents.enter, DRAGGABLE), DRAGEND_LEAVE_EVENT_NAME = eventUtils.addNamespace(dragEvents.leave, DRAGGABLE), POINTERDOWN_EVENT_NAME = eventUtils.addNamespace(pointerEvents.down, DRAGGABLE), CLONE_CLASS = "clone"; var targetDraggable, sourceDraggable; var ScrollHelper = function() { function ScrollHelper(orientation, component) { _classCallCheck(this, ScrollHelper); this._preventScroll = true; this._component = component; if ("vertical" === orientation) { this._scrollValue = "scrollTop"; this._overFlowAttr = "overflowY"; this._sizeAttr = "height"; this._scrollSizeProp = "scrollHeight"; this._limitProps = { start: "top", end: "bottom" } } else { this._scrollValue = "scrollLeft"; this._overFlowAttr = "overflowX"; this._sizeAttr = "width"; this._scrollSizeProp = "scrollWidth"; this._limitProps = { start: "left", end: "right" } } } _createClass(ScrollHelper, [{ key: "updateScrollable", value: function(elements, mousePosition) { var that = this; if (!elements.some(function(element) { return that._trySetScrollable(element, mousePosition) })) { that._$scrollable = null; that._scrollSpeed = 0 } } }, { key: "isScrolling", value: function() { return !!this._scrollSpeed } }, { key: "isScrollable", value: function($element) { var that = this; return ("auto" === $element.css(that._overFlowAttr) || $element.hasClass("dx-scrollable-container")) && $element.prop(that._scrollSizeProp) > $element[that._sizeAttr]() } }, { key: "_trySetScrollable", value: function(element, mousePosition) { var distanceToBorders, that = this, $element = $(element), sensitivity = that._component.option("scrollSensitivity"), isScrollable = that.isScrollable($element); if (isScrollable) { distanceToBorders = that._calculateDistanceToBorders($element, mousePosition); if (sensitivity > distanceToBorders[that._limitProps.start]) { if (!that._preventScroll) { that._scrollSpeed = -that._calculateScrollSpeed(distanceToBorders[that._limitProps.start]); that._$scrollable = $element } } else { if (sensitivity > distanceToBorders[that._limitProps.end]) { if (!that._preventScroll) { that._scrollSpeed = that._calculateScrollSpeed(distanceToBorders[that._limitProps.end]); that._$scrollable = $element } } else { isScrollable = false; that._preventScroll = false } } } return isScrollable } }, { key: "_calculateDistanceToBorders", value: function($area, mousePosition) { var areaBoundingRect, area = $area.get(0); if (area) { areaBoundingRect = area.getBoundingClientRect(); return { left: mousePosition.x - areaBoundingRect.left, top: mousePosition.y - areaBoundingRect.top, right: areaBoundingRect.right - mousePosition.x, bottom: areaBoundingRect.bottom - mousePosition.y } } else { return {} } } }, { key: "_calculateScrollSpeed", value: function(distance) { var component = this._component, sensitivity = component.option("scrollSensitivity"), maxSpeed = component.option("scrollSpeed"); return Math.ceil(Math.pow((sensitivity - distance) / sensitivity, 2) * maxSpeed) } }, { key: "scrollByStep", value: function() { var nextScrollPosition, that = this; if (that._$scrollable && that._scrollSpeed) { if (that._$scrollable.hasClass("dx-scrollable-container")) { var $scrollable = that._$scrollable.closest(".dx-scrollable"), scrollableInstance = $scrollable.data("dxScrollable") || $scrollable.data("dxScrollView"); if (scrollableInstance) { nextScrollPosition = scrollableInstance.scrollOffset(); nextScrollPosition[that._limitProps.start] += that._scrollSpeed; scrollableInstance.scrollTo(nextScrollPosition) } } else { nextScrollPosition = that._$scrollable[that._scrollValue]() + that._scrollSpeed; that._$scrollable[that._scrollValue](nextScrollPosition) } var dragMoveArgs = that._component._dragMoveArgs; if (dragMoveArgs) { that._component._dragMoveHandler(dragMoveArgs) } } } }, { key: "reset", value: function() { this._$scrollable = null; this._scrollSpeed = 0; this._preventScroll = true } }, { key: "isOutsideScrollable", value: function(target, event) { var component = this._component; if (!component._$scrollable || !target.closest(component._$scrollable).length) { return false } var scrollableSize = component._$scrollable.get(0).getBoundingClientRect(); var start = scrollableSize[this._limitProps.start]; var size = scrollableSize[this._sizeAttr]; var location = "width" === this._sizeAttr ? event.pageX : event.pageY; return location < start || location > start + size } }]); return ScrollHelper }(); var ScrollAnimator = Animator.inherit({ ctor: function(strategy) { this.callBase(); this._strategy = strategy }, _step: function() { var horizontalScrollHelper = this._strategy._horizontalScrollHelper, verticalScrollHelper = this._strategy._verticalScrollHelper; horizontalScrollHelper && horizontalScrollHelper.scrollByStep(); verticalScrollHelper && verticalScrollHelper.scrollByStep() } }); var Draggable = DOMComponentWithTemplate.inherit({ reset: noop, dragMove: noop, dragEnter: noop, dragLeave: noop, dragEnd: noop, _getDefaultOptions: function() { return extend(this.callBase(), { onDragStart: null, onDragMove: null, onDragEnd: null, onDrop: null, immediate: true, dragDirection: "both", boundary: void 0, boundOffset: 0, allowMoveByClick: false, itemData: null, container: void 0, dragTemplate: void 0, contentTemplate: "content", handle: "", filter: "", clone: false, autoScroll: true, scrollSpeed: 30, scrollSensitivity: 60, group: void 0, data: void 0 }) }, _setOptionsByReference: function() { this.callBase.apply(this, arguments); extend(this._optionsByReference, { component: true, group: true, itemData: true, data: true }) }, _init: function() { this.callBase(); this._attachEventHandlers(); this._scrollAnimator = new ScrollAnimator(this); this._horizontalScrollHelper = new ScrollHelper("horizontal", this); this._verticalScrollHelper = new ScrollHelper("vertical", this) }, _normalizeCursorOffset: function(offset) { if (typeUtils.isObject(offset)) { offset = { h: offset.x, v: offset.y } } offset = commonUtils.splitPair(offset).map(function(value) { return parseFloat(value) }); return { left: offset[0], top: 1 === offset.length ? offset[0] : offset[1] } }, _getNormalizedCursorOffset: function(offset, options) { if (typeUtils.isFunction(offset)) { offset = offset.call(this, options) } return this._normalizeCursorOffset(offset) }, _calculateElementOffset: function(options) { var elementOffset = void 0, dragElementOffset = void 0, event = options.event, $element = $(options.itemElement), $dragElement = $(options.dragElement), isCloned = this._dragElementIsCloned(), cursorOffset = this.option("cursorOffset"), normalizedCursorOffset = { left: 0, top: 0 }, currentLocate = this._initialLocate = translator.locate($dragElement); if (isCloned || options.initialOffset || cursorOffset) { elementOffset = options.initialOffset || $element.offset(); if (cursorOffset) { normalizedCursorOffset = this._getNormalizedCursorOffset(cursorOffset, options); if (isFinite(normalizedCursorOffset.left)) { elementOffset.left = event.pageX } if (isFinite(normalizedCursorOffset.top)) { elementOffset.top = event.pageY } } dragElementOffset = $dragElement.offset(); elementOffset.top -= dragElementOffset.top + (normalizedCursorOffset.top || 0) - currentLocate.top; elementOffset.left -= dragElementOffset.left + (normalizedCursorOffset.left || 0) - currentLocate.left } return elementOffset }, _initPosition: function(options) { var $dragElement = $(options.dragElement), elementOffset = this._calculateElementOffset(options); if (elementOffset) { this._move(elementOffset, $dragElement) } this._startPosition = translator.locate($dragElement) }, _startAnimator: function() { if (!this._scrollAnimator.inProgress()) { this._scrollAnimator.start() } }, _stopAnimator: function() { this._scrollAnimator.stop() }, _addWidgetPrefix: function(className) { var componentName = this.NAME; return dasherize(componentName) + (className ? "-" + className : "") }, _getItemsSelector: function() { return this.option("filter") || "" }, _$content: function() { var $element = this.$element(), $wrapper = $element.children(".dx-template-wrapper"); return $wrapper.length ? $wrapper : $element }, _attachEventHandlers: function() { var _this = this; if (this.option("disabled")) { return } var $element = this._$content(), itemsSelector = this._getItemsSelector(), allowMoveByClick = this.option("allowMoveByClick"), data = { direction: this.option("dragDirection"), immediate: this.option("immediate"), checkDropTarget: function(target, event) { var targetGroup = _this.option("group"), sourceGroup = _this._getSourceDraggable().option("group"); if (_this._verticalScrollHelper.isOutsideScrollable(target, event) || _this._horizontalScrollHelper.isOutsideScrollable(target, event)) { return false } return sourceGroup && sourceGroup === targetGroup } }; if (allowMoveByClick) { $element = this._getArea(); eventsEngine.on($element, POINTERDOWN_EVENT_NAME, data, this._pointerDownHandler.bind(this)) } if (">" === itemsSelector[0]) { itemsSelector = itemsSelector.slice(1) } eventsEngine.on($element, DRAGSTART_EVENT_NAME, itemsSelector, data, this._dragStartHandler.bind(this)); eventsEngine.on($element, DRAG_EVENT_NAME, data, this._dragMoveHandler.bind(this)); eventsEngine.on($element, DRAGEND_EVENT_NAME, data, this._dragEndHandler.bind(this)); eventsEngine.on($element, DRAG_ENTER_EVENT_NAME, data, this._dragEnterHandler.bind(this)); eventsEngine.on($element, DRAGEND_LEAVE_EVENT_NAME, data, this._dragLeaveHandler.bind(this)) }, _dragElementIsCloned: function() { return this._$dragElement && this._$dragElement.hasClass(this._addWidgetPrefix(CLONE_CLASS)) }, _getDragTemplateArgs: function($element, $container) { return { container: getPublicElement($container), model: { itemData: this.option("itemData"), itemElement: getPublicElement($element) } } }, _createDragElement: function($element) { var result = $element, clone = this.option("clone"), $container = this._getContainer(), template = this.option("dragTemplate"); if (template) { template = this._getTemplate(template); result = $("
").appendTo($container); template.render(this._getDragTemplateArgs($element, result)) } else { if (clone) { result = $("
").appendTo($container); $element.clone().css({ width: $element.css("width"), height: $element.css("height") }).appendTo(result) } } return result.toggleClass(this._addWidgetPrefix(CLONE_CLASS), result.get(0) !== $element.get(0)) }, _resetDragElement: function() { if (this._dragElementIsCloned()) { this._$dragElement.remove() } else { this._toggleDraggingClass(false) } this._$dragElement = null }, _resetSourceElement: function() { this._toggleDragSourceClass(false); this._$sourceElement = null }, _detachEventHandlers: function() { eventsEngine.off(this._$content(), "." + DRAGGABLE); eventsEngine.off(this._getArea(), "." + DRAGGABLE) }, _move: function(position, $element) { translator.move($element || this._$dragElement, position) }, _getDraggableElement: function(e) { var $sourceElement = this._getSourceElement(); if ($sourceElement) { return $sourceElement } var allowMoveByClick = this.option("allowMoveByClick"); if (allowMoveByClick) { return this.$element() } var $target = $(e && e.target), itemsSelector = this._getItemsSelector(); if (">" === itemsSelector[0]) { var $items = this._$content().find(itemsSelector); if (!$items.is($target)) { $target = $target.closest($items) } } return $target }, _getSourceElement: function() { var draggable = this._getSourceDraggable(); return draggable._$sourceElement }, _pointerDownHandler: function(e) { if (eventUtils.needSkipEvent(e)) { return } var position = {}, $element = this.$element(), dragDirection = this.option("dragDirection"); if ("horizontal" === dragDirection || "both" === dragDirection) { position.left = e.pageX - $element.offset().left + translator.locate($element).left - $element.width() / 2 } if ("vertical" === dragDirection || "both" === dragDirection) { position.top = e.pageY - $element.offset().top + translator.locate($element).top - $element.height() / 2 } this._move(position, $element); this._getAction("onDragMove")(this._getEventArgs(e)) }, _isValidElement: function(event, $element) { var handle = this.option("handle"), $target = $(event.originalEvent && event.originalEvent.target); if (handle && !$target.closest(handle).length) { return false } if (!$element.length) { return false } return !$element.is(".dx-state-disabled, .dx-state-disabled *") }, _dragStartHandler: function(e) { var $dragElement = void 0, initialOffset = void 0, isFixedPosition = void 0, $element = this._getDraggableElement(e); if (this._$sourceElement) { return } if (!this._isValidElement(e, $element)) { e.cancel = true; return } var dragStartArgs = this._getDragStartArgs(e, $element); this._getAction("onDragStart")(dragStartArgs); if (dragStartArgs.cancel) { e.cancel = true; return } this.option("itemData", dragStartArgs.itemData); this._setSourceDraggable(); this._$sourceElement = $element; initialOffset = $element.offset(); $dragElement = this._$dragElement = this._createDragElement($element); this._toggleDraggingClass(true); this._toggleDragSourceClass(true); isFixedPosition = "fixed" === $dragElement.css("position"); this._initPosition(extend({}, dragStartArgs, { dragElement: $dragElement.get(0), initialOffset: isFixedPosition && initialOffset })); var $area = this._getArea(), areaOffset = this._getAreaOffset($area), boundOffset = this._getBoundOffset(), areaWidth = $area.outerWidth(), areaHeight = $area.outerHeight(), elementWidth = $dragElement.width(), elementHeight = $dragElement.height(); var startOffset = { left: $dragElement.offset().left - areaOffset.left, top: $dragElement.offset().top - areaOffset.top }; if ($area.length) { e.maxLeftOffset = startOffset.left - boundOffset.left; e.maxRightOffset = areaWidth - startOffset.left - elementWidth - boundOffset.right; e.maxTopOffset = startOffset.top - boundOffset.top; e.maxBottomOffset = areaHeight - startOffset.top - elementHeight - boundOffset.bottom } if (this.option("autoScroll")) { this._startAnimator() } }, _getAreaOffset: function($area) { var offset = $area && positionUtils.offset($area); return offset ? offset : { left: 0, top: 0 } }, _toggleDraggingClass: function(value) { this._$dragElement && this._$dragElement.toggleClass(this._addWidgetPrefix("dragging"), value) }, _toggleDragSourceClass: function(value, $element) { var $sourceElement = $element || this._$sourceElement; $sourceElement && $sourceElement.toggleClass(this._addWidgetPrefix("source"), value) }, _getBoundOffset: function() { var boundOffset = this.option("boundOffset"); if (typeUtils.isFunction(boundOffset)) { boundOffset = boundOffset.call(this) } return stringUtils.quadToObject(boundOffset) }, _getArea: function() { var area = this.option("boundary"); if (typeUtils.isFunction(area)) { area = area.call(this) } return $(area) }, _getContainer: function() { var container = this.option("container"); if (void 0 === container) { container = viewPortUtils.value() } return $(container) }, _dragMoveHandler: function(e) { this._dragMoveArgs = e; if (!this._$dragElement) { e.cancel = true; return } var offset = e.offset, startPosition = this._startPosition; this._move({ left: startPosition.left + offset.x, top: startPosition.top + offset.y }); this._updateScrollable(e); var eventArgs = this._getEventArgs(e); this._getAction("onDragMove")(eventArgs); if (true === eventArgs.cancel) { return } var targetDraggable = this._getTargetDraggable(); targetDraggable.dragMove(e) }, _updateScrollable: function(e) { var that = this, $sourceElement = that._getSourceElement(); that._$scrollable = null; $sourceElement.parents().toArray().some(function(element) { var $element = $(element); if (that._horizontalScrollHelper.isScrollable($element) || that._verticalScrollHelper.isScrollable($element)) { that._$scrollable = $element; return true } }); if (that.option("autoScroll")) { var $window = $(window), mousePosition = { x: e.pageX - $window.scrollLeft(), y: e.pageY - $window.scrollTop() }, allObjects = that.getElementsFromPoint(mousePosition); that._verticalScrollHelper.updateScrollable(allObjects, mousePosition); that._horizontalScrollHelper.updateScrollable(allObjects, mousePosition) } }, getElementsFromPoint: function(position) { var ownerDocument = this._$dragElement.get(0).ownerDocument; if (browser.msie) { var msElements = ownerDocument.msElementsFromPoint(position.x, position.y); if (msElements) { return Array.prototype.slice.call(msElements) } return [] } return ownerDocument.elementsFromPoint(position.x, position.y) }, _defaultActionArgs: function() { var args = this.callBase.apply(this, arguments), component = this.option("component"); if (component) { args.component = component; args.element = component.element() } return args }, _getEventArgs: function(e) { var sourceDraggable = this._getSourceDraggable(), targetDraggable = this._getTargetDraggable(); return { event: e, itemData: sourceDraggable.option("itemData"), itemElement: getPublicElement(sourceDraggable._$sourceElement), fromComponent: sourceDraggable.option("component") || sourceDraggable, toComponent: targetDraggable.option("component") || targetDraggable, fromData: sourceDraggable.option("data"), toData: targetDraggable.option("data") } }, _getDragStartArgs: function(e, $itemElement) { var args = this._getEventArgs(e); return { event: args.event, itemData: args.itemData, itemElement: $itemElement, fromData: args.fromData } }, _revertItemToInitialPosition: function() { !this._dragElementIsCloned() && this._move(this._initialLocate, this._$sourceElement) }, _dragEndHandler: function(e) { var _this2 = this; var dragEndEventArgs = this._getEventArgs(e), dropEventArgs = this._getEventArgs(e), targetDraggable = this._getTargetDraggable(), needRevertPosition = true; try { this._getAction("onDragEnd")(dragEndEventArgs) } finally { when(fromPromise(dragEndEventArgs.cancel)).done(function(cancel) { if (!cancel) { if (targetDraggable !== _this2) { targetDraggable._getAction("onDrop")(dropEventArgs) } if (!dropEventArgs.cancel) { targetDraggable.dragEnd(dragEndEventArgs); needRevertPosition = false } } }).always(function() { if (needRevertPosition) { _this2._revertItemToInitialPosition() } _this2.reset(); targetDraggable.reset(); _this2._stopAnimator(); _this2._horizontalScrollHelper.reset(); _this2._verticalScrollHelper.reset(); _this2._resetDragElement(); _this2._resetSourceElement(); _this2._resetTargetDraggable(); _this2._resetSourceDraggable() }) } }, _dragEnterHandler: function(e) { this._setTargetDraggable(); var sourceDraggable = this._getSourceDraggable(); sourceDraggable.dragEnter(e) }, _dragLeaveHandler: function(e) { this._resetTargetDraggable(); if (this !== this._getSourceDraggable()) { this.reset() } var sourceDraggable = this._getSourceDraggable(); sourceDraggable.dragLeave(e) }, _getAction: function(name) { return this["_" + name + "Action"] || this._createActionByOption(name) }, _getAnonymousTemplateName: function() { return "content" }, _initTemplates: function() { if (!this.option("contentTemplate")) { return } this.callBase.apply(this, arguments); this._defaultTemplates.content = new EmptyTemplate }, _render: function() { this.callBase(); this.$element().addClass(this._addWidgetPrefix()); var transclude = this._getAnonymousTemplateName() === this.option("contentTemplate"), template = this._getTemplateByOption("contentTemplate"); if (template) { $(template.render({ container: this.element(), transclude: transclude })) } }, _optionChanged: function(args) { var name = args.name; switch (name) { case "onDragStart": case "onDragMove": case "onDragEnd": case "onDrop": this["_" + name + "Action"] = this._createActionByOption(name); break; case "dragTemplate": case "contentTemplate": case "container": case "clone": this._resetDragElement(); break; case "allowMoveByClick": case "dragDirection": case "disabled": case "boundary": case "filter": case "immediate": this._resetDragElement(); this._detachEventHandlers(); this._attachEventHandlers(); break; case "autoScroll": this._verticalScrollHelper.reset(); this._horizontalScrollHelper.reset(); break; case "scrollSensitivity": case "scrollSpeed": case "boundOffset": case "handle": case "group": case "data": case "itemData": break; default: this.callBase(args) } }, _getTargetDraggable: function() { return targetDraggable || this }, _getSourceDraggable: function() { return sourceDraggable || this }, _setTargetDraggable: function() { var currentGroup = this.option("group"), sourceDraggable = this._getSourceDraggable(); if (currentGroup && currentGroup === sourceDraggable.option("group")) { targetDraggable = this } }, _setSourceDraggable: function() { sourceDraggable = this }, _resetSourceDraggable: function() { sourceDraggable = null }, _resetTargetDraggable: function() { targetDraggable = null }, _dispose: function() { this.callBase(); this._detachEventHandlers(); this._resetDragElement(); this._resetTargetDraggable(); this._resetSourceDraggable(); this._$sourceElement = null; this._stopAnimator() } }); registerComponent(DRAGGABLE, Draggable); module.exports = Draggable }, /*!****************************************!*\ !*** ./artifacts/transpiled/ui/box.js ***! \****************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _get = function get(object, property, receiver) { if (null === object) { object = Function.prototype } var desc = Object.getOwnPropertyDescriptor(object, property); if (void 0 === desc) { var parent = Object.getPrototypeOf(object); if (null === parent) { return } else { return get(parent, property, receiver) } } else { if ("value" in desc) { return desc.value } else { var getter = desc.get; if (void 0 === getter) { return } return getter.call(receiver) } } }; 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 */ 88); 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 */ 129); var _item2 = _interopRequireDefault(_item); var _uiCollection_widget = __webpack_require__( /*! ./collection/ui.collection_widget.edit */ 52); 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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && ("object" === typeof call || "function" === typeof call) ? call : self } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } } 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); function BoxItem() { _classCallCheck(this, BoxItem); return _possibleConstructorReturn(this, (BoxItem.__proto__ || Object.getPrototypeOf(BoxItem)).apply(this, arguments)) } _createClass(BoxItem, [{ key: "_renderVisible", value: function(value, oldValue) { _get(BoxItem.prototype.__proto__ || Object.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), itemSize = $item[FALLBACK_CROSS_SIZE_MAP[direction]](), 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), itemSize = $item[FALLBACK_CROSS_SIZE_MAP[direction]](), shift = .5 * (size - itemSize); $item.css(that._chooseMarginSide(FALLBACK_CROSS_PRE_MARGIN_MAP[direction]), shift).css(that._chooseMarginSide(FALLBACK_CROSS_POST_MARGIN_MAP[direction]), shift) }); break; case "stretch": $items.css(that._chooseMarginSide(FALLBACK_CROSS_PRE_MARGIN_MAP[direction]), 0).css(that._chooseMarginSide(FALLBACK_CROSS_POST_MARGIN_MAP[direction]), 0).css(FALLBACK_CROSS_SIZE_MAP[direction], "100%") } } }, { key: "_chooseMarginSide", value: function(value) { if (!this._option("rtlEnabled")) { return value } return MARGINS_RTL_FLIP_MAP[value] || value } }, { key: "renderItems", value: function($items) { var _this2 = 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 = _this2._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), size = _this2._baseSize($item), factor = freeSpaceSize >= 0 ? itemData.ratio || 0 : ((0, _type.isDefined)(itemData.shrink) ? itemData.shrink : SHRINK) * size, totalFactor = freeSpaceSize >= 0 ? totalRatio : totalWeightedShrink, 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 _this3 = this; var result = 0; (0, _iterator.each)(this._$items, function(_, item) { result += _this3._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); function Box() { _classCallCheck(this, Box); return _possibleConstructorReturn(this, (Box.__proto__ || Object.getPrototypeOf(Box)).apply(this, arguments)) } _createClass(Box, [{ key: "_getDefaultOptions", value: function() { return (0, _extend.extend)(_get(Box.prototype.__proto__ || Object.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(Box.prototype.__proto__ || Object.getPrototypeOf(Box.prototype), "_defaultOptionsRules", this).call(this).concat([{ device: function() { return _browser2.default.msie }, 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(Box.prototype.__proto__ || Object.getPrototypeOf(Box.prototype), "_init", this).call(this); this.$element().addClass(BOX_CLASS + "-" + 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(Box.prototype.__proto__ || Object.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 _this5 = this; this._layout.initSize(); _get(Box.prototype.__proto__ || Object.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 (!_this5._isUpdated) { _this5._layout.update() } _this5._isUpdated = false; _this5._updateTimer = null }) } }, { key: "_renderItemContent", value: function(args) { var $itemNode = args.itemData && args.itemData.node; if ($itemNode) { return this._renderItemContentByNode(args, $itemNode) } return _get(Box.prototype.__proto__ || Object.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(Box.prototype.__proto__ || Object.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(Box.prototype.__proto__ || Object.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(Box.prototype.__proto__ || Object.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(Box.prototype.__proto__ || Object.getPrototypeOf(Box.prototype), "_optionChanged", this).call(this, args) } } }, { key: "_itemOptions", value: function() { var _this6 = this; var options = _get(Box.prototype.__proto__ || Object.getPrototypeOf(Box.prototype), "_itemOptions", this).call(this); options.fireItemStateChangedAction = function(e) { _this6._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 */ 548) }, /*!******************************************************************!*\ !*** ./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), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, Class = __webpack_require__( /*! ../../core/class */ 15), 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 _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _fx = __webpack_require__( /*! ../../animation/fx */ 39); 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") } } var animation = { moveTo: function(config) { var $element = config.$element, position = config.position, direction = config.direction || "left", toConfig = {}, animationType = void 0; 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, margin = config.margin, direction = config.direction || "left", 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, size = config.size, direction = config.direction || "left", marginTop = config.marginTop || 0, duration = config.duration, 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), window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow(), devices = __webpack_require__( /*! ../core/devices */ 16), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9), extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, Widget = __webpack_require__( /*! ./widget/ui.widget */ 17), Button = __webpack_require__( /*! ./button */ 35), Popover = __webpack_require__( /*! ./popover */ 139), DataHelperMixin = __webpack_require__( /*! ../data_helper */ 79), List = __webpack_require__( /*! ./list */ 102), themes = __webpack_require__( /*! ./themes */ 31), ChildDefaultTemplate = __webpack_require__( /*! ../core/templates/child_default_template */ 137).ChildDefaultTemplate; var DROP_DOWN_MENU_CLASS = "dx-dropdownmenu", DROP_DOWN_MENU_POPUP_CLASS = "dx-dropdownmenu-popup", DROP_DOWN_MENU_POPUP_WRAPPER_CLASS = "dx-dropdownmenu-popup-wrapper", DROP_DOWN_MENU_LIST_CLASS = "dx-dropdownmenu-list", DROP_DOWN_MENU_BUTTON_CLASS = "dx-dropdownmenu-button"; var POPUP_OPTION_MAP = { popupWidth: "width", popupHeight: "height", 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") }, _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), 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()), 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), 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 _element_data = __webpack_require__( /*! ../core/element_data */ 40); var _element_data2 = _interopRequireDefault(_element_data); var _callbacks = __webpack_require__( /*! ../core/utils/callbacks */ 27); var _callbacks2 = _interopRequireDefault(_callbacks); var _ui = __webpack_require__( /*! ./widget/ui.errors */ 19); var _ui2 = _interopRequireDefault(_ui); var _dom_component = __webpack_require__( /*! ../core/dom_component */ 84); var _dom_component2 = _interopRequireDefault(_dom_component); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _validation_engine = __webpack_require__( /*! ./validation_engine */ 87); var _validation_engine2 = _interopRequireDefault(_validation_engine); var _default_adapter = __webpack_require__( /*! ./validation/default_adapter */ 566); var _default_adapter2 = _interopRequireDefault(_default_adapter); var _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 6); var _guid = __webpack_require__( /*! ../core/guid */ 34); var _guid2 = _interopRequireDefault(_guid); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var VALIDATOR_CLASS = "dx-validator", VALIDATION_STATUS_VALID = "valid", VALIDATION_STATUS_INVALID = "invalid", VALIDATION_STATUS_PENDING = "pending"; var Validator = _dom_component2.default.inherit({ _initOptions: function(options) { this.callBase.apply(this, arguments); this.option(_validation_engine2.default.initValidationOptions(options)) }, _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { validationRules: [] }) }, _init: function() { this.callBase(); this._initGroupRegistration(); this.focused = (0, _callbacks2.default)(); this._initAdapter(); this._validationInfo = { result: null, deferred: null, skipValidation: false } }, _initGroupRegistration: function() { var group = this._findGroup(); if (!this._groupWasInit) { this.on("disposing", function(args) { _validation_engine2.default.removeRegisteredValidator(args.component._validationGroup, args.component) }) } if (!this._groupWasInit || this._validationGroup !== group) { _validation_engine2.default.removeRegisteredValidator(this._validationGroup, this); this._groupWasInit = true; this._validationGroup = group; _validation_engine2.default.registerValidatorInGroup(group, this) } }, _setOptionsByReference: function() { this.callBase(); (0, _extend.extend)(this._optionsByReference, { validationGroup: true }) }, _initAdapter: function() { var _this = this; var element = this.$element()[0], dxStandardEditor = _element_data2.default.data(element, "dx-validation-target"); var adapter = this.option("adapter"); if (!adapter) { if (dxStandardEditor) { adapter = new _default_adapter2.default(dxStandardEditor, this); adapter.validationRequestsCallbacks.add(function(args) { if (_this._validationInfo.skipValidation) { return } _this.validate(args) }); this.option("adapter", adapter); return } throw _ui2.default.Error("E0120") } var callbacks = adapter.validationRequestsCallbacks; if (callbacks) { if (Array.isArray(callbacks)) { callbacks.push(function(args) { _this.validate(args) }) } else { _ui2.default.log("W0014", "validationRequestsCallbacks", "jQuery.Callbacks", "17.2", "Use the array instead"); callbacks.add(function(args) { _this.validate(args) }) } } }, _initMarkup: function() { this.$element().addClass(VALIDATOR_CLASS); this.callBase() }, _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; case "isValid": case "validationStatus": this.option(_validation_engine2.default.synchronizeValidationOptions(args, this.option())); break; default: this.callBase(args) } }, _getValidationRules: function() { var _this2 = this; if (!this._validationRules) { this._validationRules = (0, _iterator.map)(this.option("validationRules"), function(rule, index) { return (0, _extend.extend)({}, rule, { validator: _this2, index: index }) }) } return this._validationRules }, _findGroup: function() { var $element = this.$element(); return this.option("validationGroup") || _validation_engine2.default.findGroup($element, this._modelByElement($element)) }, _resetValidationRules: function() { delete this._validationRules }, validate: function(args) { var _this3 = this; var adapter = this.option("adapter"), name = this.option("name"), bypass = adapter.bypass && adapter.bypass(), value = args && void 0 !== args.value ? args.value : adapter.getValue(), currentError = adapter.getCurrentValidationError && adapter.getCurrentValidationError(), rules = this._getValidationRules(); var currentResult = this._validationInfo && this._validationInfo.result; if (currentResult && currentResult.status === VALIDATION_STATUS_PENDING && currentResult.value === value) { return (0, _extend.extend)({}, currentResult) } var result = void 0; if (bypass) { result = { isValid: true, status: VALIDATION_STATUS_VALID } } else { if (currentError && currentError.editorSpecific) { currentError.validator = this; result = { isValid: false, status: VALIDATION_STATUS_INVALID, brokenRule: currentError, brokenRules: [currentError] } } else { result = _validation_engine2.default.validate(value, rules, name) } } result.id = (new _guid2.default).toString(); this._applyValidationResult(result, adapter); result.complete && result.complete.then(function(res) { if (res.id === _this3._validationInfo.result.id) { _this3._applyValidationResult(res, adapter) } }); return (0, _extend.extend)({}, this._validationInfo.result) }, reset: function() { var adapter = this.option("adapter"), result = { id: null, isValid: true, brokenRule: null, brokenRules: null, pendingRules: null, status: VALIDATION_STATUS_VALID, complete: null }; this._validationInfo.skipValidation = true; adapter.reset(); this._validationInfo.skipValidation = false; this._resetValidationRules(); this._applyValidationResult(result, adapter) }, _updateValidationResult: function(result) { if (!this._validationInfo.result || this._validationInfo.result.id !== result.id) { var complete = this._validationInfo.deferred && this._validationInfo.result.complete; this._validationInfo.result = (0, _extend.extend)({}, result, { complete: complete }) } else { for (var prop in result) { if ("id" !== prop && "complete" !== prop) { this._validationInfo.result[prop] = result[prop] } } } }, _applyValidationResult: function(result, adapter) { var validatedAction = this._createActionByOption("onValidated"); result.validator = this; this._updateValidationResult(result); adapter.applyValidationResults && adapter.applyValidationResults(this._validationInfo.result); this.option({ validationStatus: this._validationInfo.result.status }); if (this._validationInfo.result.status === VALIDATION_STATUS_PENDING) { if (!this._validationInfo.deferred) { this._validationInfo.deferred = new _deferred.Deferred; this._validationInfo.result.complete = this._validationInfo.deferred.promise() } this.fireEvent("validating", [this._validationInfo.result]); return } if (this._validationInfo.result.status !== VALIDATION_STATUS_PENDING) { validatedAction(result); if (this._validationInfo.deferred) { this._validationInfo.deferred.resolve(result); this._validationInfo.deferred = null } } }, focus: function() { var adapter = this.option("adapter"); adapter && adapter.focus && adapter.focus() } }); (0, _component_registrator2.default)("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 */ 35); var _button2 = _interopRequireDefault(_button); var _utils = __webpack_require__( /*! ./widget/utils.ink_ripple */ 70); 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 */ 320); var _item2 = _interopRequireDefault(_item); var _themes = __webpack_require__( /*! ./themes */ 31); var _themes2 = _interopRequireDefault(_themes); var _hold = __webpack_require__( /*! ../events/hold */ 90); var _hold2 = _interopRequireDefault(_hold); var _ui = __webpack_require__( /*! ./scroll_view/ui.scrollable */ 92); var _ui2 = _interopRequireDefault(_ui); var _uiCollection_widget = __webpack_require__( /*! ./collection/ui.collection_widget.live_update */ 188); var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget); var _icon = __webpack_require__( /*! ../core/utils/icon */ 54); var _bindable_template = __webpack_require__( /*! ../core/templates/bindable_template */ 64); 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 "desktop" !== _devices2.default.real().deviceType }, options: { showNavButtons: false } }, { device: { deviceType: "desktop" }, 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_template.BindableTemplate(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(), elementWidth = this.$element().width(), 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) }), holdEventName = (0, _utils3.addNamespace)(_hold2.default.name, "dxNavButton"), pointerUpEventName = (0, _utils3.addNamespace)(_pointer2.default.up, "dxNavButton"), 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 */ 342); 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 */ 37); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _data = __webpack_require__( /*! ../../core/utils/data */ 18); var _ui = __webpack_require__( /*! ../widget/ui.errors */ 19); var _ui2 = _interopRequireDefault(_ui); var _filtering = __webpack_require__( /*! ../shared/filtering */ 166); var _filtering2 = _interopRequireDefault(_filtering); var _format_helper = __webpack_require__( /*! ../../format_helper */ 63); 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 */ 641); var _between2 = _interopRequireDefault(_between); var _message = __webpack_require__( /*! ../../localization/message */ 10); var _message2 = _interopRequireDefault(_message); var _data_source = __webpack_require__( /*! ../../data/data_source/data_source */ 46); var _ui3 = __webpack_require__( /*! ./ui.filter_operations_dictionary */ 642); var _ui4 = _interopRequireDefault(_ui3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var DEFAULT_DATA_TYPE = "string", EMPTY_MENU_ICON = "icon-none", AND_GROUP_OPERATION = "and", EQUAL_OPERATION = "=", NOT_EQUAL_OPERATION = "<>", DATATYPE_OPERATIONS = { number: ["=", "<>", "<", ">", "<=", ">=", "isblank", "isnotblank"], string: ["contains", "notcontains", "startswith", "endswith", "=", "<>", "isblank", "isnotblank"], date: ["=", "<>", "<", ">", "<=", ">=", "isblank", "isnotblank"], datetime: ["=", "<>", "<", ">", "<=", ">=", "isblank", "isnotblank"], "boolean": ["=", "<>", "isblank", "isnotblank"], object: ["isblank", "isnotblank"] }, DEFAULT_FORMAT = { date: "shortDate", datetime: "shortDateShortTime" }, LOOKUP_OPERATIONS = ["=", "<>", "isblank", "isnotblank"], 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 }, convertGroupToNegationGroup = function(group) { var criteria = group.slice(0); group.length = 0; group.push("!", criteria) }, 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 i, criteria = getGroupCriteria(group), getNormalizedGroupValue = function(value) { return value.indexOf("!") === -1 ? value : value.substring(1) }, 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), 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, "", ""], filterOperation = getDefaultOperation(field); updateConditionByOperation(condition, filterOperation, customOperations); return condition } function removeItem(group, item) { var criteria = getGroupCriteria(group), 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), 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, 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), filterExpression = convertToInnerCondition(condition, customOperations), 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 = void 0, groupValue = getGroupValue(criteria), 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 i, criteria = getGroupCriteria(group); 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 = 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), 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/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 */ 391); 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", TIME_PANEL_CURRENT_TIME_CELL_CLASS = "dx-scheduler-time-panel-current-time-cell", 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(), 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, $container = this._dateTableScrollable.$content(), height = this.getIndicationHeight(), 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, offset = difference * this.getRoundedCellWidth(groupIndex, groupIndex * this._getCellCount(), difference); return offset }, _getIndicatorDuration: function() { var today = this._getToday(), 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(), cellHeight = this.getCellHeight(), date = new Date(this._firstViewDate); if (this._needRenderDateTimeIndicator()) { date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate()) } var duration = today.getTime() - date.getTime(), 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(), result = false; date = new Date(date); date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate()); var startCellDate = new Date(date), 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), now = this.option("indicatorTime") || new Date; result = _date2.default.sameDate(date, now) } return result }, _getTimeCellClass: function(i) { var startViewDate = this._getTimeCellDate(i), 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, DirectoryNotFound: 4, WrongFileExtension: 5, MaxFileSizeExceeded: 6, InvalidSymbols: 7, 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(result) { _type2.default.isFunction(onSuccess) && onSuccess({ item: item, index: index, result: result }); return result }, function(error) { if (!error) { error = {} } error.index = index; _type2.default.isFunction(onError) && onError(error); return (new _deferred.Deferred).resolve().promise() }) }); return _deferred.when.apply(null, deferreds) }; module.exports = whenSome; module.exports.ErrorCode = ErrorCode }, /*!********************************************************!*\ !*** ./artifacts/transpiled/ui/diagram/diagram_bar.js ***! \********************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _diagram_importer = __webpack_require__( /*! ./diagram_importer */ 143); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 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/components/legend.js ***! \*******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _utils = __webpack_require__( /*! ../core/utils */ 12); var _extend2 = __webpack_require__( /*! ../../core/utils/extend */ 0); var _layout_element = __webpack_require__( /*! ../core/layout_element */ 247); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _title = __webpack_require__( /*! ../core/title */ 106); var _title2 = _interopRequireDefault(_title); var _object = __webpack_require__( /*! ../../core/utils/object */ 47); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _renderer = __webpack_require__( /*! ../core/renderers/renderer */ 158); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var _Number = Number, _math = Math, _round = _math.round, _max = _math.max, _min = _math.min, _ceil = _math.ceil, _isDefined = _type.isDefined, _isFunction = _type.isFunction, _enumParser = _utils.enumParser, _normalizeEnum = _utils.normalizeEnum, _extend = _extend2.extend, DEFAULT_MARGIN = 10, DEFAULT_MARKER_HATCHING_WIDTH = 2, DEFAULT_MARKER_HATCHING_STEP = 5, CENTER = "center", RIGHT = "right", LEFT = "left", TOP = "top", BOTTOM = "bottom", HORIZONTAL = "horizontal", VERTICAL = "vertical", INSIDE = "inside", OUTSIDE = "outside", NONE = "none", HEIGHT = "height", WIDTH = "width", parseHorizontalAlignment = _enumParser([LEFT, CENTER, RIGHT]), parseVerticalAlignment = _enumParser([TOP, BOTTOM]), parseOrientation = _enumParser([VERTICAL, HORIZONTAL]), parseItemTextPosition = _enumParser([LEFT, RIGHT, TOP, BOTTOM]), parsePosition = _enumParser([OUTSIDE, INSIDE]), parseItemsAlignment = _enumParser([LEFT, CENTER, RIGHT]); function getState(state, color, stateName) { if (!state) { return } var colorFromAction = state.fill; return (0, _extend2.extend)({}, { state: stateName, fill: colorFromAction === NONE ? color : colorFromAction, opacity: state.opacity, hatching: _extend({}, state.hatching, { step: DEFAULT_MARKER_HATCHING_STEP, width: DEFAULT_MARKER_HATCHING_WIDTH }) }) } function getAttributes(item, state, size) { var attrs = (0, _renderer.processHatchingAttrs)(item, state); if (attrs.fill && 0 === attrs.fill.indexOf("DevExpress")) { attrs.fill = (0, _renderer.getFuncIri)(attrs.fill) } attrs.opacity = attrs.opacity >= 0 ? attrs.opacity : 1; return (0, _extend2.extend)({}, attrs, { size: size }) } 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, markerBBox, labelBBox) { var width, height, defaultXMargin = 7, defaultTopMargin = 4; switch (options.itemTextPosition) { case LEFT: case RIGHT: width = markerBBox.width + defaultXMargin + labelBBox.width; height = _max(markerBBox.height, labelBBox.height); break; case TOP: case BOTTOM: width = _max(markerBBox.width, labelBBox.width); height = markerBBox.height + 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.renderMarker(item.states[stateName]) } } function parseOptions(options, textField, allowInsidePosition) { if (!options) { return null } var debug = __webpack_require__( /*! ../../core/utils/console */ 65).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 }, maxMeasureLength = 0, maxAltMeasureLength = 0, 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], 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 initPosition, lineLength = getLineLength(line, layoutOptions); 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 i, j, width = array.length, height = array[0].length, 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; that._widget = settings.widget }; var legendPrototype = _Legend.prototype = (0, _object.clone)(_layout_element.LayoutElement.prototype); (0, _extend2.extend)(legendPrototype, { constructor: _Legend, getOptions: function() { return this._options }, update: function() { var data = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; var options = arguments[1]; var themeManagerTitleOptions = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; var that = this; options = that._options = parseOptions(options, that._textField, that._allowInsidePosition) || {}; var initMarkerSize = options.markerSize; this._data = data.map(function(dataItem) { dataItem.size = _Number(dataItem.size > 0 ? dataItem.size : initMarkerSize); dataItem.marker = getAttributes(dataItem, dataItem.states.normal); Object.defineProperty(dataItem.marker, "size", { get: function() { return dataItem.size }, set: function(value) { dataItem.size = value } }); Object.defineProperty(dataItem.marker, "opacity", { get: function() { return dataItem.states.normal.opacity }, set: function(value) { dataItem.states.normal.opacity = dataItem.states.hover.opacity = dataItem.states.selection.opacity = value } }); return dataItem }); if (options.customizeItems) { that._data = 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, options = that._options, 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, options = that._options, renderer = that._renderer, maxBBoxHeight = 0, createMarker = getMarkerCreator(options.markerShape); that._markersId = {}; var templateFunction = !options.markerTemplate ? function(dataItem, group) { var attrs = dataItem.marker; createMarker(renderer, attrs.size).attr({ fill: attrs.fill, opacity: attrs.opacity }).append({ element: group }) } : options.markerTemplate; var template = that._widget._getTemplate(templateFunction); var markersGroup = that._markersGroup; markersGroup.css((0, _utils.patchFontOptions)(options.font)); that._items = (items || []).map(function(dataItem, i) { var stateOfDataItem = dataItem.states; var normalState = stateOfDataItem.normal; var normalStateFill = normalState.fill; dataItem.size = dataItem.marker.size; var states = { normal: (0, _extend2.extend)(normalState, { fill: normalStateFill || options.markerColor || options.defaultColor, state: "normal" }), hover: getState(stateOfDataItem.hover, normalStateFill, "hovered"), selection: getState(stateOfDataItem.selection, normalStateFill, "selected") }; dataItem.states = states; var itemGroup = renderer.g().append(markersGroup); var markerGroup = renderer.g().attr({ "class": "dxl-marker" }).append(itemGroup); var item = { label: that._createLabel(dataItem, itemGroup), marker: markerGroup, renderer: renderer, group: itemGroup, tracker: { id: dataItem.id, argument: dataItem.argument, argumentIndex: dataItem.argumentIndex }, states: states, itemTextPosition: options.itemTextPosition, markerOffset: 0, bBoxes: [], renderMarker: function(state) { dataItem.marker = getAttributes(item, state, dataItem.size); markerGroup.clear(); var isRendered = false; template.render({ model: dataItem, container: markerGroup.element, onRendered: function() { isRendered = true; if (isAsyncRendering) { that._widget._requestChange(["LAYOUT"]) } } }); var isAsyncRendering = !isRendered && 0 === markerGroup.element.childNodes.length } }; item.renderMarker(states.normal); that._createHint(dataItem, itemGroup); if (void 0 !== dataItem.id) { that._markersId[dataItem.id] = i } return item }).map(function(item) { var labelBBox = item.label.getBBox(); var markerBBox = item.marker.getBBox(); item.markerBBox = markerBBox; item.markerSize = Math.max(markerBBox.width, markerBBox.height); var bBox = getSizeItem(options, markerBBox, labelBBox); item.labelBBox = labelBBox; item.bBox = bBox; maxBBoxHeight = _max(maxBBoxHeight, bBox.height); return item }); 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, 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, "selection"); return this }, applyHover: function(id) { applyMarkerState(id, this._markersId, this._items, "hover"); 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) ? { color: options.font.color, opacity: data.textOpacity } : {}; return this._renderer.text(text, 0, 0).css((0, _utils.patchFontOptions)(fontStyle)).attr({ align: align, "class": options.cssClass }).append(group) }, _createHint: function(data, group) { var labelFormatObject = this._getCustomizeObject(data), text = this._options.customizeHint.call(labelFormatObject, labelFormatObject); if (_isDefined(text) && "" !== text) { group.setTitle(text) } }, _createBackground: function() { var that = this, isInside = that._options.position === INSIDE, color = that._options.backgroundColor, 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 lines, that = this, iteration = 0, layoutOptions = that._getItemsLayoutOptions(), countItems = that._items.length; 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 firstItem, secondItem, tableLine = getLines(lines, layoutOptions, i), labelBox = { width: item.labelBBox.width, height: item.labelBBox.height, element: item.label, bBox: item.labelBBox, pos: getPos(layoutOptions), itemIndex: i }, markerBox = { width: item.markerBBox.width, height: item.markerBBox.height, element: item.marker, pos: { horizontal: CENTER, vertical: CENTER }, bBox: { width: item.markerBBox.width, height: item.markerBBox.height, x: item.markerBBox.x, y: item.markerBBox.y }, itemIndex: i }, 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, 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, position = { x: 0, y: 0 }, maxLineLength = getMaxLineLength(lines, layoutOptions); lines.forEach(function(line) { var firstItem = line[0], altOffset = firstItem.altOffset || layoutOptions.altSpacing; position[layoutOptions.direction] = getInitPositionForDirection(line, layoutOptions, maxLineLength); line.forEach(function(item) { var offset = item.offset || layoutOptions.spacing, wrap = new _layout_element.WrapperLayoutElement(item.element, item.bBox), itemBBoxOptions = { x: position.x, y: position.y, width: item.width, height: item.height }, itemBBox = new _layout_element.WrapperLayoutElement(null, itemBBoxOptions), 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()), horizontal = that._options.columnItemSpacing / 2, 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, options = that._options, orientation = options.orientation, layoutOptions = { itemsAlignment: options.itemsAlignment, orientation: options.orientation }, width = that._size.width - (that._background ? 2 * options.paddingLeftRight : 0), 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, legendBox = this._calculateTotalBox(), 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, 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, 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, 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, group = this._renderer.g().attr({ "class": this._rootClassPrefix + "-legend" }).enableLinks().append(that._renderer.root); that._legend = new exports.Legend({ renderer: that._renderer, group: group, widget: this, 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, _extend = extend, _math = Math, _floor = _math.floor, _abs = _math.abs, symbolPoint = __webpack_require__( /*! ./symbol_point */ 120), CANVAS_POSITION_DEFAULT = "canvas_position_default", DEFAULT_BAR_TRACKER_SIZE = 9, CORRECTING_BAR_TRACKER_VALUE = 4, RIGHT = "right", LEFT = "left", TOP = "top", 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 position, that = this, initialValue = that.initialValue, invert = that._getValTranslator().getBusinessRange().invert, isDiscreteValue = "discrete" === that.series.valueAxisType, isFullStacked = that.series.isFullStackedSeries(), 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 coords, that = this; 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, 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(), 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, 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, y = that.y, height = that.height, x = that.x, 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 = void 0; var yCoord = void 0; 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 arg, val, minVal, that = this, rotated = that._options.rotated, valAxis = rotated ? "x" : "y", argAxis = rotated ? "y" : "x", valIntervalName = rotated ? "width" : "height", argIntervalName = rotated ? "height" : "width", argTranslator = that._getArgTranslator(), valTranslator = that._getValTranslator(), argVisibleArea = that.series.getArgumentAxis().getVisibleArea(), valVisibleArea = that.series.getValueAxis().getVisibleArea(); 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 */ 107), chartScatterSeries = series.chart, polarScatterSeries = series.polar, objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, vizUtils = __webpack_require__( /*! ../core/utils */ 12), mathUtils = __webpack_require__( /*! ../../core/utils/math */ 30), normalizeAngle = vizUtils.normalizeAngle, DISCRETE = "discrete", _map = vizUtils.map, _extend = extend, _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, cosSin = vizUtils.getCosAndSin(correctAngle), x = centerPoint.x + (point.radius + tan * nextStepAngle) * cosSin.cos, 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, 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 }, 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, 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, rotated = that._options.rotated, forceDefaultSegment = false, 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, defaultTrackerWidth = that._defaultTrackerWidth, 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 = void 0; 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 = void 0; 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 = [], pointsCopy = src, 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, leftControlY, rightControlX, rightControlY, xCur, yCur, x1, x2, y1, y2, curIsExtremum, leftPoint, rightPoint, a, b, c, xc, yc, shift, prevPoint = pointsCopy[i - 1], nextPoint = pointsCopy[i + 1], lambda = .5; if (!i || i === pointsCopy.length - 1) { bezierPoints.push(curPoint, curPoint); return } xCur = curPoint.x; yCur = curPoint.y; x1 = prevPoint.x; x2 = nextPoint.x; y1 = prevPoint.y; y2 = nextPoint.y; 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) } leftPoint = clonePoint(curPoint, leftControlX, leftControlY); 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 i, preparedPoints = [], centerPoint = this.getValueAxis().getCenter(); 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, 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 i, tangentPoints = [], betweenAngle = Math.round(prevPoint.angle - point.angle), tan = (prevPoint.radius - point.radius) / betweenAngle; 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 */ 413); var _utils = __webpack_require__( /*! ../core/utils */ 12); var _utils2 = _interopRequireDefault(_utils); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _axes_constants = __webpack_require__( /*! ./axes_constants */ 253); 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 */ 63); var _format_helper2 = _interopRequireDefault(_format_helper); var _parse_utils = __webpack_require__( /*! ../components/parse_utils */ 249); var _parse_utils2 = _interopRequireDefault(_parse_utils); var _tick_generator = __webpack_require__( /*! ./tick_generator */ 414); var _tick_generator2 = _interopRequireDefault(_tick_generator); var _translator2d = __webpack_require__( /*! ../translators/translator2d */ 254); var _translator2d2 = _interopRequireDefault(_translator2d); var _range = __webpack_require__( /*! ../translators/range */ 109); var _tick = __webpack_require__( /*! ./tick */ 415); var _math2 = __webpack_require__( /*! ../../core/utils/math */ 30); var _date = __webpack_require__( /*! ../../core/utils/date */ 22); var _common = __webpack_require__( /*! ../../core/utils/common */ 4); var _xy_axes = __webpack_require__( /*! ./xy_axes */ 416); var _xy_axes2 = _interopRequireDefault(_xy_axes); var _polar_axes = __webpack_require__( /*! ./polar_axes */ 813); var _polar_axes2 = _interopRequireDefault(_polar_axes); var _constant_line = __webpack_require__( /*! ./constant_line */ 814); var _constant_line2 = _interopRequireDefault(_constant_line); var _strip = __webpack_require__( /*! ./strip */ 815); 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 getLog = _utils2.default.getLogExt; var raiseTo = _utils2.default.raiseToExt; 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, _ref) { var allowNegatives = _ref.allowNegatives, linearThreshold = _ref.linearThreshold; return _tick_generator2.default.tickGenerator({ axisType: options.type, dataType: options.dataType, logBase: options.logarithmBase, allowNegatives: allowNegatives, linearThreshold: linearThreshold, 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, position = options.position, defaultPosition = options.isHorizontal ? BOTTOM : LEFT, 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 }, viewPort)({ 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, isHorizontal = this._isHorizontal, tickPositionField = isHorizontal ? "x" : "y", orthogonalPositions = this._orthogonalPositions, positionFrom = orthogonalPositions.start, positionTo = orthogonalPositions.end; var borderOptions = that.borderOptions; var canvasStart = isHorizontal ? LEFT : TOP, canvasEnd = isHorizontal ? RIGHT : BOTTOM, axisCanvas = that.getCanvas(), canvas = { left: axisCanvas.left, right: axisCanvas.width - axisCanvas.right, top: axisCanvas.top, bottom: axisCanvas.height - axisCanvas.bottom }, firstBorderLinePosition = borderOptions.visible && borderOptions[canvasStart] ? canvas[canvasStart] : void 0, lastBorderLinePosition = borderOptions.visible && borderOptions[canvasEnd] ? canvas[canvasEnd] : void 0, minDelta = MAX_GRID_BORDER_ADHENSION + firstBorderLinePosition, 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, 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, _ref2, group) { var font = _ref2.font, cssClass = _ref2.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 coords, that = this, text = lineLabelOptions.text, options = that._options, labelOptions = options.label; that._checkAlignmentConstantLineLabels(lineLabelOptions); text = (0, _type.isDefined)(text) ? text : that.formatLabel(parsedValue, labelOptions); coords = that._getConstantLineLabelsCoords(value, lineLabelOptions); return that._drawConstantLineLabelText(text, coords.x, coords.y, lineLabelOptions, group) }, _getStripPos: function(startValue, endValue, canvasStart, canvasEnd, range) { var start, end, swap, startCategoryIndex, endCategoryIndex, isContinuous = !!(range.minVisible || range.maxVisible), categories = (range.categories || []).reduce(function(result, cat) { result.push(cat.valueOf()); return result }, []), min = range.minVisible; if (!isContinuous) { if ((0, _type.isDefined)(startValue) && (0, _type.isDefined)(endValue)) { var parsedStartValue = this.parser(startValue); var parsedEndValue = this.parser(endValue); startCategoryIndex = (0, _array.inArray)((0, _type.isDefined)(parsedStartValue) ? parsedStartValue.valueOf() : void 0, categories); endCategoryIndex = (0, _array.inArray)((0, _type.isDefined)(parsedEndValue) ? parsedEndValue.valueOf() : void 0, categories); if (startCategoryIndex === -1 || endCategoryIndex === -1) { return { from: 0, to: 0 } } if (startCategoryIndex > endCategoryIndex) { swap = endValue; endValue = startValue; startValue = swap } } } if ((0, _type.isDefined)(startValue)) { startValue = this.validateUnit(startValue, "E2105", "strip"); start = this._getTranslatedCoord(startValue, -1); if (!(0, _type.isDefined)(start) && isContinuous) { start = startValue < min ? canvasStart : canvasEnd } } else { start = canvasStart } if ((0, _type.isDefined)(endValue)) { endValue = this.validateUnit(endValue, "E2105", "strip"); end = this._getTranslatedCoord(endValue, 1); if (!(0, _type.isDefined)(end) && isContinuous) { end = endValue > min ? canvasEnd : canvasStart } } else { end = canvasEnd } return start < end ? { from: start, to: end } : { from: end, to: start } }, _getStripGraphicAttributes: function(fromPoint, toPoint) { var x, y, width, height, orthogonalPositions = this._orthogonalPositions, positionFrom = orthogonalPositions.start, 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.updateMultilineTextAlignment(); tick.label.attr(that._getLabelAdjustedCoord(tick, offset + (tick.labelOffset || 0), maxWidth, checkCanvas)) } }) }, _adjustLabels: function(offset) { var that = this, 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) } }, {}), 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 translateX, translateY, that = this, options = that._options, box = _utils2.default.rotateBBox(tick.labelBBox, [tick.labelCoords.x, tick.labelCoords.y], -tick.labelRotationAngle || 0), position = options.position, textAlign = tick.labelAlignment || options.label.alignment, isDiscrete = "discrete" === that._options.type, isFlatLabel = tick.labelRotationAngle % 90 === 0, indentFromAxis = options.label.indentFromAxis, axisPosition = that._axisPosition, labelCoords = tick.labelCoords, labelX = labelCoords.x; 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 insideGroup, outsideGroup1, outsideGroup2, that = this, renderer = that._renderer, classSelector = that._axisCssPrefix, constantLinesClass = classSelector + "constant-lines"; insideGroup = renderer.g().attr({ "class": constantLinesClass }); outsideGroup1 = renderer.g().attr({ "class": constantLinesClass }); 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, renderer = that._renderer, 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, discreteAxisDivisionMode = options.discreteAxisDivisionMode; this._tickOffset = +("crossLabels" !== discreteAxisDivisionMode || !discreteAxisDivisionMode) }, getMargins: function() { var that = this, options = that._options, position = options.position, placeholderSize = options.placeholderSize, canvas = that.getCanvas(), cLeft = canvas.left, cTop = canvas.top, cRight = canvas.width - canvas.right, cBottom = canvas.height - canvas.bottom, edgeMarginCorrection = _max(options.grid.visible && options.grid.width || 0, options.tick.visible && options.tick.width || 0), constantLineAboveSeries = that._axisConstantLineGroups.above, constantLineUnderSeries = that._axisConstantLineGroups.under, 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 axisTypeMethods, that = this; 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, 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; if (!options || options.type !== _axes_constants2.default.logarithmic) { return _abs(value - prevValue) } var _ref3 = new _range.Range(this.getTranslator().getBusinessRange()), allowNegatives = _ref3.allowNegatives, linearThreshold = _ref3.linearThreshold; return _abs(getLog(value, options.logarithmBase, allowNegatives, linearThreshold) - getLog(prevValue, options.logarithmBase, allowNegatives, linearThreshold)) }, _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, 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; var disabledNegatives = false === this._options.allowNegatives; if (isLogarithmic) { range.startValue = disabledNegatives && range.startValue <= 0 ? null : range.startValue; range.endValue = disabledNegatives && 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 type = this._options.type; var length = void 0; if (type === _axes_constants2.default.logarithmic) { length = (0, _math2.adjust)(this.calculateInterval(currentBusinessRange.maxVisible, currentBusinessRange.minVisible)) } 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 _options = this._options, type = _options.type, logarithmBase = _options.logarithmBase; var center = void 0; if (!(0, _type.isDefined)(currentBusinessRange.minVisible) || !(0, _type.isDefined)(currentBusinessRange.maxVisible)) { return } if (type === _axes_constants2.default.logarithmic) { var allowNegatives = currentBusinessRange.allowNegatives, linearThreshold = currentBusinessRange.linearThreshold, minVisible = currentBusinessRange.minVisible, maxVisible = currentBusinessRange.maxVisible; center = raiseTo((0, _math2.adjust)(getLog(maxVisible, logarithmBase, allowNegatives, linearThreshold) + getLog(minVisible, logarithmBase, allowNegatives, linearThreshold)) / 2, logarithmBase, allowNegatives, linearThreshold) } 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 (options.type === _axes_constants2.default.logarithmic) { that._seriesData.addRange({ allowNegatives: void 0 !== options.allowNegatives ? options.allowNegatives : range.min <= 0 }); if (!isNaN(options.linearThreshold)) { that._seriesData.linearThreshold = options.linearThreshold } } 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, options = that._options, position = options.position, labelShift = options.label.indentFromAxis + (that._axisShift || 0) + that._constantLabelOffset, 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, length = majors.length, options = that._options, customBounds = options.customBoundTicks, min = viewPort.minVisible, max = viewPort.maxVisible, addMinMax = options.showCustomBoundaryTicks ? that._boundaryTicksVisibility : {}, 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, options = that._options, customTicks = options.customTicks, customMinorTicks = options.customMinorTicks; return getTickGenerator(options, incidentOccurred || that._incidentOccurred, skipTickGeneration, that._translator.getBusinessRange().isEmpty(), that._adjustDivisionFactor.bind(that), viewPort)({ 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 ticks, options = this._options; 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, options = that._options, marginOptions = that._marginOptions, businessRange = new _range.Range(that.getTranslator().getBusinessRange()).addRange(range), visualRange = that.getViewport(), minVisible = visualRange && (0, _type.isDefined)(visualRange.startValue) ? visualRange.startValue : businessRange.minVisible, maxVisible = visualRange && (0, _type.isDefined)(visualRange.endValue) ? visualRange.endValue : businessRange.maxVisible, ticks = []; if (options.type === _axes_constants2.default.discrete && options.aggregateByCategory) { return { aggregateByCategory: true } } 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 ticks, boundaryTicks, range, that = this, renderer = that._renderer, options = that._options; if (!canvas) { return } that._isSynchronized = false; that.updateCanvas(canvas); that._estimatedTickInterval = that._getTicks(that.adjustViewport(this._seriesData), _common.noop, true).tickInterval; 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 }); ticks = that._createTicksAndLabelFormat(range); 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, 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, minArgs = [], 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 = void 0; 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 = void 0; var maxPercentPadding = void 0; 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 = void 0; var maxValue = void 0; 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 = void 0; var textHeight = void 0; var convertedTickInterval = void 0; 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 }) }, _setVisualRange: function(visualRange, allowPartialUpdate) { var range = this.adjustRange(_utils2.default.getVizRangeObject(visualRange)); if (allowPartialUpdate) { (0, _type.isDefined)(range.startValue) && (this._viewport.startValue = range.startValue); (0, _type.isDefined)(range.endValue) && (this._viewport.endValue = range.endValue) } else { this._viewport = range } }, _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 = void 0; 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 = void 0; 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 = void 0; var maxDataValue = void 0; 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 = void 0; var seriesData = void 0; 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 ticks, maxText, text, box, tickInterval, that = this, options = that._options, widthAxis = options.visible ? options.width : 0, indent = withIndents ? options.label.indentFromAxis + .5 * options.tick.length : 0, 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 } 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)); text = that._renderer.text(maxText, 0, 0).css(that._textFontStyles).attr(that._textOptions).append(that._renderer.root); 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 notRecastStep, step, that = this, labelOpt = that._options.label, displayMode = that._validateDisplayMode(labelOpt.displayMode), overlappingMode = that._validateOverlappingMode(labelOpt.overlappingBehavior, displayMode), ignoreOverlapping = "none" === overlappingMode || "ignore" === overlappingMode, behavior = { rotationAngle: labelOpt.rotationAngle, staggeringSpacing: labelOpt.staggeringSpacing }, boxes = that._majorTicks.map(function(tick) { return tick.labelBBox }); 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, labelOpt = that._options.label, 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 labelHeight, alignment, func, that = this, majorTicks = that._majorTicks, labelOpt = that._options.label, angle = behavior.rotationAngle; 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": 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, canvas = this._canvas || {}, invert = this._translator.getBusinessRange().invert, 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, canvas = that._getCanvasStartEnd(), breaks = that._breaks, breaksLength = breaks ? breaks.length : 0, 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: function(visualRangeSetter) { this._visualRange = visualRangeSetter }, getCategoriesSorter: function(argCategories) { var sort = void 0; 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 */ 147).dxBaseGauge, typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, _isDefined = typeUtils.isDefined, _isArray = Array.isArray, _isNumber = typeUtils.isNumeric, axisModule = __webpack_require__( /*! ../axes/base_axis */ 205), _map = __webpack_require__( /*! ../core/utils */ 12).map, _normalizeEnum = __webpack_require__( /*! ../core/utils */ 12).normalizeEnum, _compareArrays = __webpack_require__( /*! ./base_gauge */ 147).compareArrays, _isFinite = isFinite, _Number = Number, _min = Math.min, _max = Math.max, _extend = extend, _each = each, _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, SHIFT_ANGLE = 90, OPTION_VALUE = "value", OPTION_SUBVALUES = "subvalues", DEFAULT_MINOR_AXIS_DIVISION_FACTOR = 5, 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, 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, scaleOption = that.option("scale") || {}, startValue = that.option("startValue"), 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 textParams, layoutValue, result, coefs, innerCoef, outerCoef, that = this, majorTick = scaleOptions.tick, majorTickEnabled = majorTick.visible && majorTick.length > 0 && majorTick.width > 0, minorTick = scaleOptions.minorTick, minorTickEnabled = minorTick.visible && minorTick.length > 0 && minorTick.width > 0, label = scaleOptions.label, indentFromTick = Number(label.indentFromTick); if (!majorTickEnabled && !minorTickEnabled && !label.visible) { return {} } textParams = that._scale.measureLabels(extend({}, that._canvas)); layoutValue = that._getScaleLayoutValue(); result = { min: layoutValue, max: layoutValue }; coefs = that._getTicksCoefficients(scaleOptions); innerCoef = coefs.inner; 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 elements, that = this, scaleOptions = that._prepareScaleSettings(); that._rangeContainer.render(_extend(that._getOption("rangeContainer"), { vertical: that._area.vertical })); that._renderScale(scaleOptions); 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, userOptions = that.option("scale"), 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, bounds = that._translator.getDomain(), startValue = bounds[0], endValue = bounds[1], angles = that._translator.getCodomain(), invert = startValue > endValue, min = _min(startValue, endValue), 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, theme = that._themeManager.theme("valueIndicators"), type = _normalizeEnum(options.type || that._themeManager.theme(defaultTypeField)), 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, target = that._valueIndicator, 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, 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 isRecreate, dummy, that = this, target = that._subvalueIndicatorsSet, settings = that._prepareIndicatorSettings(that.option("subvalueIndicator") || {}, "subvalueIndicatorType"); if (!target) { target = that._subvalueIndicatorsSet = that._createSubvalueIndicatorsSet() } isRecreate = settings.type !== target.type; target.type = settings.type; 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 i, ii, list, vals = void 0 === subvalues ? this.__subvalues : parseArrayOfNumbers(subvalues); 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, 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], newValues = _isArray(optionItems) ? _map(optionItems, valueGetter) : [], i = 0, ii = newValues.length, 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 ii, that = this, valueIndicators = that._valueIndicators || [], userOptions = that.option("valueIndicators"), optionList = [], i = 0; 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, colors = null; if (that._palette) { that._palette.reset(); colors = that._palette.generateColors(count, { repeat: true }) } that._colorPalette = colors }, _adjustIndicatorsCount: function(count) { var i, ii, indicator, that = this, indicators = that._indicators, 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 */ 413).smartFormatter, isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction, HEIGHT_COMPACT_MODE = 24, POINTER_SIZE = 4, 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 */ 13); 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 */ 19); var _ui2 = _interopRequireDefault(_ui); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _type2 = _interopRequireDefault(_type); var _console = __webpack_require__( /*! ../core/utils/console */ 65); 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" }, 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 (_type2.default.isDefined(proxyURL)) { _ui2.default.log("W0001", "Export", "proxyURL", "19.2", "This option is no longer required") } 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", FORMAT_SEPARATORS = " .,:;/\\<>()-[]" + ARABIC_COMMA, 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], prevChar = text[index - 1], 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, 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, index, 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, isCurrentCharEscaped = escapeIndexes.indexOf(index) >= 0, isPrevCharEscaped = index > 0 && escapeIndexes.indexOf(index - 1) >= 0, 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 = [], defaultPattern = formatValue(new Date(2009, 8, 8, 6, 5, 4), formatter), patternPositions = defaultPattern.split("").map(function(_, index) { return index }), result = defaultPattern, replacedPatterns = {}, 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), 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 */ 13), window = __webpack_require__( /*! ./window */ 7).getWindow(), $ = __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) { var hours = date.getHours(); if (!value && 12 === hours) { date.setHours(0) } else { if (value && 12 !== hours) { date.setHours(hours + 12) } } }, d: "setDate", H: "setHours", h: "setHours", m: "setMinutes", s: "setSeconds", S: "setMilliseconds" }; var getSameCharCount = function(text, index) { var char = text[index], 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 isEscaping, regexpText = "", stubText = "", 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], isEscapeChar = "'" === char, regexpPart = PATTERN_REGEXPS[char]; if (isEscapeChar) { isEscaping = !isEscaping; if ("'" !== format[i - 1]) { continue } } if (regexpPart && !isEscaping) { var count = getSameCharCount(format, i), 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) { var patternChar = pattern[0], partSetter = PATTERN_SETTERS[patternChar], partParser = PATTERN_PARSERS[patternChar]; if (partSetter && partParser) { var value = partParser(text, pattern.length, dateParts); if (date[partSetter]) { date[partSetter](value) } else { partSetter(date, value) } } }; var setPatternPartFromNow = function(date, pattern, now) { var setterName = PATTERN_SETTERS[pattern], getterName = "g" + setterName.substr(1); date[setterName](now[getterName]()) }; 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, date = new Date(now.getFullYear(), 0, 1), formatPatterns = getShortPatterns(regExpInfo.patterns), maxPatternIndex = getMaxOrderedPatternIndex(formatPatterns), orderedFormatPatterns = getOrderedFormatPatterns(formatPatterns); orderedFormatPatterns.forEach(function(pattern, index) { if (!pattern || index < ORDERED_PATTERNS.length && index > maxPatternIndex) { return } var patternIndex = formatPatterns.indexOf(pattern); if (patternIndex >= 0) { setPatternPart(date, regExpInfo.patterns[patternIndex], regExpResult[patternIndex + 1], dateParts) } 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 */ 149); __webpack_require__( /*! ../../../integration/jquery */ 275); __webpack_require__( /*! ../../../integration/angular */ 474); __webpack_require__( /*! ../../../integration/knockout */ 489); __webpack_require__( /*! ../../../localization/globalize/core */ 130); __webpack_require__( /*! ../../../localization/globalize/message */ 498); __webpack_require__( /*! ../../../localization/globalize/number */ 186); __webpack_require__( /*! ../../../localization/globalize/date */ 499); __webpack_require__( /*! ../../../localization/globalize/currency */ 500); __webpack_require__( /*! ../../../events/click */ 20); __webpack_require__( /*! ../../../events/contextmenu */ 173); __webpack_require__( /*! ../../../events/double_click */ 131); __webpack_require__( /*! ../../../events/drag */ 68); __webpack_require__( /*! ../../../events/hold */ 90); __webpack_require__( /*! ../../../events/hover */ 150); __webpack_require__( /*! ../../../events/pointer */ 23); __webpack_require__( /*! ../../../events/swipe */ 178); __webpack_require__( /*! ../../../events/transform */ 292); 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(), 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 */ 112); 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 */ 29); var _config2 = _interopRequireDefault(_config); var _dom = __webpack_require__( /*! ../core/utils/dom */ 11); 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 */ 73); var _message = __webpack_require__( /*! ../localization/message */ 10); var _message2 = _interopRequireDefault(_message); var _ui = __webpack_require__( /*! ./widget/ui.errors */ 19); var _ui2 = _interopRequireDefault(_ui); var _popup = __webpack_require__( /*! ./popup */ 43); 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 = DX_DIALOG_CLASSNAME + "-wrapper"; var DX_DIALOG_ROOT_CLASSNAME = DX_DIALOG_CLASSNAME + "-root"; var DX_DIALOG_CONTENT_CLASSNAME = DX_DIALOG_CLASSNAME + "-content"; var DX_DIALOG_MESSAGE_CLASSNAME = DX_DIALOG_CLASSNAME + "-message"; var DX_DIALOG_BUTTONS_CLASSNAME = DX_DIALOG_CLASSNAME + "-buttons"; var DX_DIALOG_BUTTON_CLASSNAME = 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(), key = (isPortrait ? "p" : "l") + "Width", 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("." + DX_BUTTON_CLASSNAME).addClass(DX_DIALOG_BUTTON_CLASSNAME); (0, _dom.resetActiveElement)() }, onShown: function(e) { var $firstButton = e.component.bottomToolbar().find("." + 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), window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow(), noop = __webpack_require__( /*! ../core/utils/common */ 4).noop, messageLocalization = __webpack_require__( /*! ../localization/message */ 10), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9), extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, Button = __webpack_require__( /*! ./button */ 35), CollectionWidget = __webpack_require__( /*! ./collection/ui.collection_widget.edit */ 52), Popup = __webpack_require__( /*! ./popup */ 43), Popover = __webpack_require__( /*! ./popover */ 139), BindableTemplate = __webpack_require__( /*! ../core/templates/bindable_template */ 64).BindableTemplate, Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred; var ACTION_SHEET_CLASS = "dx-actionsheet", ACTION_SHEET_CONTAINER_CLASS = "dx-actionsheet-container", ACTION_SHEET_POPUP_WRAPPER_CLASS = "dx-actionsheet-popup-wrapper", ACTION_SHEET_POPOVER_WRAPPER_CLASS = "dx-actionsheet-popover-wrapper", ACTION_SHEET_CANCEL_BUTTON_CLASS = "dx-actionsheet-cancel", ACTION_SHEET_ITEM_CLASS = "dx-actionsheet-item", ACTION_SHEET_ITEM_DATA_KEY = "dxActionSheetItemData", 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, 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, 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__) { var _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 }; var $ = __webpack_require__( /*! ../../core/renderer */ 2), window = __webpack_require__( /*! ../../core/utils/window */ 7).getWindow(), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), Guid = __webpack_require__( /*! ../../core/guid */ 34), registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4), typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray, DropDownEditor = __webpack_require__( /*! ./ui.drop_down_editor */ 174), List = __webpack_require__( /*! ../list */ 102), errors = __webpack_require__( /*! ../widget/ui.errors */ 19), eventUtils = __webpack_require__( /*! ../../events/utils */ 8), devices = __webpack_require__( /*! ../../core/devices */ 16), dataQuery = __webpack_require__( /*! ../../data/query */ 42), each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, DataExpressionMixin = __webpack_require__( /*! ../editor/ui.data_expression */ 222), messageLocalization = __webpack_require__( /*! ../../localization/message */ 10), ChildDefaultTemplate = __webpack_require__( /*! ../../core/templates/child_default_template */ 137).ChildDefaultTemplate, Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred, DataConverterMixin = __webpack_require__( /*! ../shared/grouped_data_converter_mixin */ 294).default; var LIST_ITEM_SELECTOR = ".dx-list-item", LIST_ITEM_DATA_KEY = "dxListItemData", DROPDOWNLIST_POPUP_WRAPPER_CLASS = "dx-dropdownlist-popup-wrapper", SKIP_GESTURE_EVENT_CLASS = "dx-skip-gesture-event", SEARCH_EVENT = "input", 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" }, wrapItemText: false, popupWidthExtension: 0 })) }, _defaultOptionsRules: function() { return this.callBase().concat([{ 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") }, _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, selectedItem; if (cache && "object" !== ("undefined" === typeof value ? "undefined" : _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"), 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._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"), wrapItemText: this.option("wrapItemText"), 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") }, _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._needPassDataSourceToList()) { this._filterDataSource(null) } this._refreshList() }, _searchDataSource: function() { this._filterDataSource(this._searchValue()) }, _filterDataSource: function(searchValue) { this._clearSearchTimer(); var dataSource = this._dataSource; dataSource.searchExpr(this.option("searchExpr") || this._displayGetterExpr()); dataSource.searchOperation(this.option("searchMode")); dataSource.searchValue(searchValue); return dataSource.load().done(this._dataSourceFiltered.bind(this, searchValue)) }, _clearFilter: function() { var dataSource = this._dataSource; dataSource && dataSource.searchValue() && dataSource.searchValue(null) }, _dataSourceFiltered: function() { 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(), 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(), $customBoundaryContainer = this._$customBoundaryContainer, offsetTop = $element.offset().top - ($customBoundaryContainer ? $customBoundaryContainer.offset().top : 0), containerHeight = ($customBoundaryContainer || $(window)).outerHeight(), maxHeight = Math.max(offsetTop, containerHeight - offsetTop - $element.outerHeight()); return Math.min(.5 * containerHeight, maxHeight) }, _clean: function() { if (this._list) { delete this._list } this.callBase() }, _dispose: function() { this._clearSearchTimer(); this.callBase() }, _setCollectionWidgetOption: function() { this._setListOption.apply(this, arguments) }, _setSubmitValue: function() { var value = this.option("value"), 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 "wrapItemText": case "noDataText": this._setListOption(args.name); break; case "displayValue": this.option("text", args.value); break; case "itemTemplate": case "searchTimeout": case "popupWidthExtension": break; case "selectedItem": 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), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4), typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), iconUtils = __webpack_require__( /*! ../../core/utils/icon */ 54), getPublicElement = __webpack_require__( /*! ../../core/utils/dom */ 11).getPublicElement, each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, compileGetter = __webpack_require__( /*! ../../core/utils/data */ 18).compileGetter, extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, fx = __webpack_require__( /*! ../../animation/fx */ 39), clickEvent = __webpack_require__( /*! ../../events/click */ 20), swipeEvents = __webpack_require__( /*! ../../events/swipe */ 178), support = __webpack_require__( /*! ../../core/utils/support */ 44), messageLocalization = __webpack_require__( /*! ../../localization/message */ 10), inkRipple = __webpack_require__( /*! ../widget/utils.ink_ripple */ 70), devices = __webpack_require__( /*! ../../core/devices */ 16), ListItem = __webpack_require__( /*! ./item */ 529), Button = __webpack_require__( /*! ../button */ 35), eventUtils = __webpack_require__( /*! ../../events/utils */ 8), themes = __webpack_require__( /*! ../themes */ 31), windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7), ScrollView = __webpack_require__( /*! ../scroll_view */ 114), deviceDependentOptions = __webpack_require__( /*! ../scroll_view/ui.scrollable */ 92).deviceDependentOptions, CollectionWidget = __webpack_require__( /*! ../collection/ui.collection_widget.live_update */ 188).default, BindableTemplate = __webpack_require__( /*! ../../core/templates/bindable_template */ 64).BindableTemplate, Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred, DataConverterMixin = __webpack_require__( /*! ../shared/grouped_data_converter_mixin */ 294).default; var LIST_CLASS = "dx-list", LIST_ITEM_CLASS = "dx-list-item", LIST_ITEM_SELECTOR = "." + LIST_ITEM_CLASS, LIST_ITEM_ICON_CONTAINER_CLASS = "dx-list-item-icon-container", LIST_ITEM_ICON_CLASS = "dx-list-item-icon", LIST_GROUP_CLASS = "dx-list-group", LIST_GROUP_HEADER_CLASS = "dx-list-group-header", LIST_GROUP_BODY_CLASS = "dx-list-group-body", LIST_COLLAPSIBLE_GROUPS_CLASS = "dx-list-collapsible-groups", LIST_GROUP_COLLAPSED_CLASS = "dx-list-group-collapsed", LIST_GROUP_HEADER_INDICATOR_CLASS = "dx-list-group-header-indicator", LIST_HAS_NEXT_CLASS = "dx-has-next", LIST_NEXT_BUTTON_CLASS = "dx-list-next-button", WRAP_ITEM_TEXT_CLASS = "dx-wrap-item-text", SELECT_ALL_ITEM_SELECTOR = ".dx-list-select-all", LIST_ITEM_DATA_KEY = "dxListItemData", 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), 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(), containerHeight = that.$element().height(); var $item = $(that.option("focusedElement")), 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, wrapItemText: 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() && "desktop" === devices.real().deviceType && "generic" === _device.platform }, options: { showScrollbar: "onHover", pageLoadMode: "nextButton" } }, { device: function() { return "desktop" === devices.real().deviceType && !devices.isSimulator() }, options: { focusStateEnabled: true } }, { 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(); this._updateLoadingState() }, 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(), 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"), pullRefreshEnabled = scrollingEnabled && this.option("pullRefreshEnabled"), 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()); if (this.option("wrapItemText")) { this._$container.addClass(WRAP_ITEM_TEXT_CLASS) } 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), $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(), scrollBottomMode = this._scrollBottomMode(), stopLoading = isDataLoaded || !scrollBottomMode, 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), selector = "." + LIST_GROUP_HEADER_CLASS, $element = this.$element(), 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"), groupTemplate = this._getTemplate(group.template || groupTemplateName, group, index, $groupHeaderElement), 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 }) }, attachGroupHeaderInkRippleEvents: function() { var that = this, selector = "." + LIST_GROUP_HEADER_CLASS, $element = this.$element(); eventsEngine.on($element, "dxpointerdown", selector, function(e) { that._toggleActiveState($(e.currentTarget), true, e) }); eventsEngine.on($element, "dxpointerup dxhoverend", selector, function(e) { that._toggleActiveState($(e.currentTarget), false) }) }, _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, $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 "wrapItemText": this._$container.toggleClass(WRAP_ITEM_TEXT_CLASS, args.value); 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, $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, $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, 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.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 */ 307); 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(), 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, scrollTopPos = this._$container.scrollTop(), scrollBottomPos = scrollOffset + scrollTopPos - 2 * pushBackValue; if (!scrollTopPos) { this._$container.scrollTop(pushBackValue) } else { if (!scrollBottomPos) { this._$container.scrollTop(pushBackValue - scrollOffset) } } }, _isScrollLocationChanged: function() { var currentLocation = this.location(), lastLocation = this._lastLocation || {}, isTopChanged = lastLocation.top !== currentLocation.top, isLeftChanged = lastLocation.left !== currentLocation.left; return isTopChanged || isLeftChanged }, _moveScrollbars: function() { this._eachScrollbar(function(scrollbar) { scrollbar.moveTo(this.location()); scrollbar.option("visible", true) }); this._hideScrollbars() }, _hideScrollbars: function() { clearTimeout(this._hideScrollbarTimeout); this._hideScrollbarTimeout = setTimeout(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 = void 0; 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/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), Class = __webpack_require__( /*! ../../core/class */ 15), abstract = Class.abstract, eventUtils = __webpack_require__( /*! ../../events/utils */ 8), GestureEmitter = __webpack_require__( /*! ../../events/gesture/emitter.gesture */ 159), registerEmitter = __webpack_require__( /*! ../../events/core/emitter_registrator */ 96), animationFrame = __webpack_require__( /*! ../../animation/frame */ 113), realDevice = __webpack_require__( /*! ../../core/devices */ 16).real(), compareVersions = __webpack_require__( /*! ../../core/utils/version */ 53).compare; var SCROLL_INIT_EVENT = "dxscrollinit", SCROLL_START_EVENT = "dxscrollstart", SCROLL_MOVE_EVENT = "dxscroll", SCROLL_END_EVENT = "dxscrollend", SCROLL_STOP_EVENT = "dxscrollstop", 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, 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, 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, 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, VELOCITY_CALC_TIMEOUT = 200, 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), 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/sortable.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_registrator = __webpack_require__( /*! ../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _draggable = __webpack_require__( /*! ./draggable */ 189); var _draggable2 = _interopRequireDefault(_draggable); var _dom = __webpack_require__( /*! ../core/utils/dom */ 11); var _translator = __webpack_require__( /*! ../animation/translator */ 26); var _translator2 = _interopRequireDefault(_translator); var _fx = __webpack_require__( /*! ../animation/fx */ 39); var _fx2 = _interopRequireDefault(_fx); 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 SORTABLE = "dxSortable", PLACEHOLDER_CLASS = "placeholder", CLONE_CLASS = "clone"; var Sortable = _draggable2.default.inherit({ _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { clone: true, filter: "> *", itemOrientation: "vertical", dropFeedbackMode: "push", allowDropInsideItem: false, allowReordering: true, moveItemOnDrop: false, onDragChange: null, onAdd: null, onRemove: null, onReorder: null, onPlaceholderPrepared: null, animation: { type: "slide", duration: 300 }, fromIndex: null, toIndex: null, dropInsideItem: false, itemPoints: null }) }, reset: function() { this.option({ dropInsideItem: false, toIndex: null, fromIndex: null }); if (this._$placeholderElement) { this._$placeholderElement.remove() } this._$placeholderElement = null; if (!this._isIndicateMode() && this._$modifiedItem) { this._$modifiedItem.css("marginBottom", this._modifiedItemMargin); this._$modifiedItem = null } }, _dragStartHandler: function(e) { this.callBase.apply(this, arguments); if (true === e.cancel) { return } var $sourceElement = this._getSourceElement(); this._updateItemPoints(); this.option("fromIndex", this._getElementIndex($sourceElement)) }, _dragEnterHandler: function() { this.callBase.apply(this, arguments); if (this === this._getSourceDraggable()) { return } this._updateItemPoints(); this.option("fromIndex", -1); if (!this._isIndicateMode()) { var itemPoints = this.option("itemPoints"), lastItemPoint = itemPoints[itemPoints.length - 1]; if (lastItemPoint) { var $element = this.$element(), $sourceElement = this._getSourceElement(), isVertical = this._isVerticalOrientation(), sourceElementSize = isVertical ? $sourceElement.outerHeight(true) : $sourceElement.outerWidth(true), scrollSize = $element.get(0)[isVertical ? "scrollHeight" : "scrollWidth"], scrollPosition = $element.get(0)[isVertical ? "scrollTop" : "scrollLeft"], positionProp = isVertical ? "top" : "left", lastPointPosition = lastItemPoint[positionProp], elementPosition = $element.offset()[positionProp], freeSize = elementPosition + scrollSize - scrollPosition - lastPointPosition; if (freeSize < sourceElementSize) { if (isVertical) { var $lastItem = (0, _renderer2.default)(this._getItems()).last(); this._$modifiedItem = $lastItem; this._modifiedItemMargin = $lastItem.get(0).style.marginBottom; $lastItem.css("marginBottom", sourceElementSize - freeSize); var $sortable = $lastItem.closest(".dx-sortable"), sortable = $sortable.data("dxScrollable") || $sortable.data("dxScrollView"); sortable && sortable.update() } } } } }, dragEnter: function() { if (this === this._getTargetDraggable()) { this.option("toIndex", this.option("fromIndex")) } else { this.option("toIndex", -1) } }, dragLeave: function() { if (this === this._getTargetDraggable()) { this.option("toIndex", -1) } else { this.option("toIndex", this.option("fromIndex")) } }, dragEnd: function(sourceEvent) { var $sourceElement = this._getSourceElement(), sourceDraggable = this._getSourceDraggable(), isSourceDraggable = sourceDraggable.NAME !== this.NAME, toIndex = this.option("toIndex"); if (null !== toIndex && toIndex >= 0) { var cancelAdd = void 0, cancelRemove = void 0; if (sourceDraggable !== this) { cancelAdd = this._fireAddEvent(sourceEvent); if (!cancelAdd) { cancelRemove = this._fireRemoveEvent(sourceEvent) } } if (isSourceDraggable) { _translator2.default.resetPosition($sourceElement) } if (this.option("moveItemOnDrop")) { !cancelAdd && this._moveItem($sourceElement, toIndex, cancelRemove) } if (sourceDraggable === this) { this._fireReorderEvent(sourceEvent) } } }, dragMove: function(e) { var itemPoints = this.option("itemPoints"); if (!itemPoints) { return } var isVertical = this._isVerticalOrientation(), axisName = isVertical ? "top" : "left", cursorPosition = isVertical ? e.pageY : e.pageX, itemPoint = void 0; for (var i = itemPoints.length - 1; i >= 0; i--) { var centerPosition = itemPoints[i + 1] && (itemPoints[i][axisName] + itemPoints[i + 1][axisName]) / 2; if (centerPosition > cursorPosition || void 0 === centerPosition) { itemPoint = itemPoints[i] } else { break } } if (itemPoint) { this._updatePlaceholderPosition(e, itemPoint); if (this._verticalScrollHelper.isScrolling() && this._isIndicateMode()) { this._movePlaceholder() } } }, _isIndicateMode: function() { return "indicate" === this.option("dropFeedbackMode") || this.option("allowDropInsideItem") }, _createPlaceholder: function() { var $placeholderContainer = void 0; if (this._isIndicateMode()) { $placeholderContainer = (0, _renderer2.default)("
").addClass(this._addWidgetPrefix(PLACEHOLDER_CLASS)).insertBefore(this._getSourceDraggable()._$dragElement) } this._$placeholderElement = $placeholderContainer; return $placeholderContainer }, _getItems: function() { var itemsSelector = this._getItemsSelector(); return this._$content().find(itemsSelector).not("." + this._addWidgetPrefix(PLACEHOLDER_CLASS)).not("." + this._addWidgetPrefix(CLONE_CLASS)).toArray() }, _allowReordering: function() { var sourceDraggable = this._getSourceDraggable(), targetDraggable = this._getTargetDraggable(); return sourceDraggable !== targetDraggable || this.option("allowReordering") }, _isValidPoint: function($items, itemPointIndex, dropInsideItem) { var allowReordering = dropInsideItem || this._allowReordering(); if (!allowReordering && 0 !== itemPointIndex) { return false } if (!this._isIndicateMode()) { return true } var $draggableItem = this._getDraggableElement(), draggableItemIndex = $items.indexOf($draggableItem.get(0)); return draggableItemIndex === -1 || itemPointIndex !== draggableItemIndex && (dropInsideItem || itemPointIndex !== draggableItemIndex + 1) }, _getItemPoints: function() { var that = this, result = void 0, isVertical = that._isVerticalOrientation(), $items = that._getItems(); result = $items.map(function(item, index) { var offset = (0, _renderer2.default)(item).offset(); return { dropInsideItem: false, left: offset.left, top: offset.top, index: index, $item: (0, _renderer2.default)(item), width: (0, _renderer2.default)(item).outerWidth(), height: (0, _renderer2.default)(item).outerHeight(), isValid: that._isValidPoint($items, index) } }); if (result.length) { var lastItem = result[result.length - 1]; result.push({ dropInsideItem: false, index: result.length, top: isVertical ? lastItem.top + lastItem.height : lastItem.top, left: !isVertical ? lastItem.left + lastItem.width : lastItem.left, isValid: this._isValidPoint($items, result.length) }); if (this.option("allowDropInsideItem")) { var points = result; result = []; for (var i = 0; i < points.length; i++) { result.push(points[i]); if (points[i + 1]) { result.push((0, _extend.extend)({}, points[i], { dropInsideItem: true, top: Math.floor((points[i].top + points[i + 1].top) / 2), left: Math.floor((points[i].left + points[i + 1].left) / 2), isValid: this._isValidPoint($items, i, true) })) } } } } else { result.push({ dropInsideItem: false, index: 0, isValid: true }) } return result }, _updateItemPoints: function() { this.option("itemPoints", this._getItemPoints()) }, _getElementIndex: function($itemElement) { return this._getItems().indexOf($itemElement.get(0)) }, _getDragTemplateArgs: function($element) { var args = this.callBase.apply(this, arguments); args.model.fromIndex = this._getElementIndex($element); return args }, _togglePlaceholder: function(value) { this._$placeholderElement && this._$placeholderElement.toggle(value) }, _isVerticalOrientation: function() { return "vertical" === this.option("itemOrientation") }, _normalizeToIndex: function(toIndex, dropInsideItem) { var isAnotherDraggable = this._getSourceDraggable() !== this._getTargetDraggable(), fromIndex = this.option("fromIndex"); if (null === toIndex) { return fromIndex } return Math.max(isAnotherDraggable || fromIndex >= toIndex || dropInsideItem ? toIndex : toIndex - 1, 0) }, _updatePlaceholderPosition: function(e, itemPoint) { var sourceDraggable = this._getSourceDraggable(), toIndex = this._normalizeToIndex(itemPoint.index, itemPoint.dropInsideItem); var eventArgs = (0, _extend.extend)(this._getEventArgs(e), { toIndex: toIndex, dropInsideItem: itemPoint.dropInsideItem }); itemPoint.isValid && this._getAction("onDragChange")(eventArgs); if (eventArgs.cancel || !itemPoint.isValid) { if (!itemPoint.isValid) { this.option({ dropInsideItem: false, toIndex: null }) } return } this.option({ dropInsideItem: itemPoint.dropInsideItem, toIndex: itemPoint.index }); this._getAction("onPlaceholderPrepared")((0, _extend.extend)(this._getEventArgs(e), { placeholderElement: (0, _dom.getPublicElement)(this._$placeholderElement), dragElement: (0, _dom.getPublicElement)(sourceDraggable._$dragElement) })); this._updateItemPoints() }, _makeWidthCorrection: function($item, width) { var that = this; if (that._$scrollable && that._$scrollable.width() < width) { var scrollableWidth = that._$scrollable.width(), offsetLeft = $item.offset().left - that._$scrollable.offset().left, offsetRight = scrollableWidth - $item.outerWidth() - offsetLeft; if (offsetLeft > 0) { width = scrollableWidth - offsetLeft } else { if (offsetRight > 0) { width = scrollableWidth - offsetRight } else { width = scrollableWidth } } } return width }, _updatePlaceholderSizes: function($placeholderElement, itemElement) { var that = this, dropInsideItem = that.option("dropInsideItem"), $item = itemElement ? (0, _renderer2.default)(itemElement) : that._getSourceElement(), isVertical = that._isVerticalOrientation(), width = "", height = ""; $placeholderElement.toggleClass(that._addWidgetPrefix("placeholder-inside"), dropInsideItem); if (isVertical || dropInsideItem) { width = $item.outerWidth() } if (!isVertical || dropInsideItem) { height = $item.outerHeight() } width = that._makeWidthCorrection($item, width); $placeholderElement.css({ width: width, height: height }) }, _moveItem: function($itemElement, index, cancelRemove) { var $prevTargetItemElement = void 0, $itemElements = this._getItems(), $targetItemElement = $itemElements[index], sourceDraggable = this._getSourceDraggable(); if (cancelRemove) { $itemElement = $itemElement.clone(); sourceDraggable._toggleDragSourceClass(false, $itemElement) } if (!$targetItemElement) { $prevTargetItemElement = $itemElements[index - 1] } this._moveItemCore($itemElement, $targetItemElement, $prevTargetItemElement) }, _moveItemCore: function($targetItem, item, prevItem) { if (!item && !prevItem) { $targetItem.appendTo(this.$element()) } else { if (prevItem) { $targetItem.insertAfter((0, _renderer2.default)(prevItem)) } else { $targetItem.insertBefore((0, _renderer2.default)(item)) } } }, _getDragStartArgs: function(e, $itemElement) { return (0, _extend.extend)(this.callBase.apply(this, arguments), { fromIndex: this._getElementIndex($itemElement) }) }, _getEventArgs: function(e) { var sourceDraggable = this._getSourceDraggable(), targetDraggable = this._getTargetDraggable(), dropInsideItem = targetDraggable.option("dropInsideItem"); return (0, _extend.extend)(this.callBase.apply(this, arguments), { fromIndex: sourceDraggable.option("fromIndex"), toIndex: this._normalizeToIndex(targetDraggable.option("toIndex"), dropInsideItem), dropInsideItem: dropInsideItem }) }, _optionChanged: function(args) { var name = args.name; switch (name) { case "onDragChange": case "onPlaceholderPrepared": case "onAdd": case "onRemove": case "onReorder": this["_" + name + "Action"] = this._createActionByOption(name); break; case "itemOrientation": case "allowDropInsideItem": case "moveItemOnDrop": case "dropFeedbackMode": case "itemPoints": case "fromIndex": case "animation": case "allowReordering": break; case "dropInsideItem": this._optionChangedDropInsideItem(args); break; case "toIndex": this._optionChangedToIndex(args); break; default: this.callBase(args) } }, _optionChangedDropInsideItem: function(args) { if (this._isIndicateMode() && this._$placeholderElement) { var toIndex = this.option("toIndex"), itemElement = this._getItems()[toIndex]; this._updatePlaceholderSizes(this._$placeholderElement, itemElement) } }, _isPositionVisible: function(position) { var scrollContainer, $element = this.$element(); if ("hidden" !== $element.css("overflow")) { scrollContainer = $element.get(0) } else { $element.parents().each(function() { if ("visible" !== (0, _renderer2.default)(this).css("overflow")) { scrollContainer = this; return false } }) } if (scrollContainer) { var clientRect = scrollContainer.getBoundingClientRect(), isVerticalOrientation = this._isVerticalOrientation(), start = isVerticalOrientation ? "top" : "left", end = isVerticalOrientation ? "bottom" : "right"; if (position[start] < clientRect[start] || position[start] > clientRect[end]) { return false } } return true }, _optionChangedToIndex: function(args) { var toIndex = args.value; if (this._isIndicateMode()) { var showPlaceholder = null !== toIndex && toIndex >= 0; this._togglePlaceholder(showPlaceholder); if (showPlaceholder) { this._movePlaceholder() } } else { this._moveItems(args.previousValue, args.value) } }, _makeLeftCorrection: function(left, leftMargin) { var that = this, $scrollable = that._$scrollable; if ($scrollable && that._isVerticalOrientation() && $scrollable.scrollLeft() > leftMargin) { left += $scrollable.scrollLeft() - leftMargin } return left }, _movePlaceholder: function() { var that = this, $placeholderElement = that._$placeholderElement || that._createPlaceholder(), items = that._getItems(), toIndex = that.option("toIndex"), itemElement = items[toIndex], prevItemElement = items[toIndex - 1], isVerticalOrientation = that._isVerticalOrientation(), position = null, leftMargin = 0; that._updatePlaceholderSizes($placeholderElement, itemElement); if (itemElement) { var $itemElement = (0, _renderer2.default)(itemElement); position = $itemElement.offset(); leftMargin = parseFloat($itemElement.css("marginLeft")) } else { if (prevItemElement) { position = (0, _renderer2.default)(prevItemElement).offset(); position.top += isVerticalOrientation ? (0, _renderer2.default)(prevItemElement).outerHeight(true) : (0, _renderer2.default)(prevItemElement).outerWidth(true) } } if (position && !that._isPositionVisible(position)) { position = null } if (position) { position.left = that._makeLeftCorrection(position.left, leftMargin); that._move(position, $placeholderElement) } $placeholderElement.toggle(!!position) }, _getPositions: function(items, elementSize, fromIndex, toIndex) { var positions = []; for (var i = 0; i < items.length; i++) { var position = 0; if (null === toIndex || null === fromIndex) { positions.push(position); continue } if (fromIndex === -1) { if (i >= toIndex) { position = elementSize } } else { if (toIndex === -1) { if (i > fromIndex) { position = -elementSize } } else { if (fromIndex < toIndex) { if (i > fromIndex && i < toIndex) { position = -elementSize } } else { if (fromIndex > toIndex) { if (i >= toIndex && i < fromIndex) { position = elementSize } } } } } positions.push(position) } return positions }, _moveItems: function(prevToIndex, toIndex) { var fromIndex = this.option("fromIndex"), isVerticalOrientation = this._isVerticalOrientation(), positionPropName = isVerticalOrientation ? "top" : "left", $draggableItem = this._getDraggableElement(), elementSize = isVerticalOrientation ? ($draggableItem.outerHeight() + $draggableItem.outerHeight(true)) / 2 : ($draggableItem.outerWidth() + $draggableItem.outerWidth(true)) / 2, items = this._getItems(), prevPositions = this._getPositions(items, elementSize, fromIndex, prevToIndex), positions = this._getPositions(items, elementSize, fromIndex, toIndex), animationConfig = this.option("animation"); for (var i = 0; i < items.length; i++) { var $item = (0, _renderer2.default)(items[i]), prevPosition = prevPositions[i], position = positions[i]; if (null === toIndex || null === fromIndex) { _fx2.default.stop($item); _translator2.default.resetPosition($item) } else { if (prevPosition !== position) { _fx2.default.stop($item); _fx2.default.animate($item, (0, _extend.extend)({}, animationConfig, { to: _defineProperty({}, positionPropName, position) })) } } } }, _toggleDragSourceClass: function(value, $element) { var $sourceElement = $element || this._$sourceElement; this.callBase.apply(this, arguments); if (!this._isIndicateMode()) { $sourceElement && $sourceElement.toggleClass(this._addWidgetPrefix("source-hidden"), value) } }, _dispose: function() { this.reset(); this.callBase() }, _fireAddEvent: function(sourceEvent) { var args = this._getEventArgs(sourceEvent); this._getAction("onAdd")(args); return args.cancel }, _fireRemoveEvent: function(sourceEvent) { var sourceDraggable = this._getSourceDraggable(), args = this._getEventArgs(sourceEvent); sourceDraggable._getAction("onRemove")(args); return args.cancel }, _fireReorderEvent: function(sourceEvent) { var args = this._getEventArgs(sourceEvent); this._getAction("onReorder")(args) } }); (0, _component_registrator2.default)(SORTABLE, Sortable); module.exports = Sortable }, /*!***************************************************************!*\ !*** ./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 */ 10); var _message2 = _interopRequireDefault(_message); var _text_box = __webpack_require__( /*! ../text_box */ 91); var _text_box2 = _interopRequireDefault(_text_box); var _ui = __webpack_require__( /*! ../widget/ui.errors */ 19); 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 editorOptions, $element = this.$element(), searchEnabled = this.option("searchEnabled"), searchBoxClassName = this._addWidgetPrefix("search"), rootElementClassName = this._addWidgetPrefix("with-search"); if (!searchEnabled) { $element.removeClass(rootElementClassName); this._removeSearchBox(); return } 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, userEditorOptions = that.option("searchEditorOptions"), 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__) { var _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 }; var variableWrapper = __webpack_require__( /*! ../../core/utils/variable_wrapper */ 89), dataCoreUtils = __webpack_require__( /*! ../../core/utils/data */ 18), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4), typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, DataHelperMixin = __webpack_require__( /*! ../../data_helper */ 79), DataSourceModule = __webpack_require__( /*! ../../data/data_source/data_source */ 46), ArrayStore = __webpack_require__( /*! ../../data/array_store */ 69), 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" === ("undefined" === typeof value ? "undefined" : _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 */ 537) }, /*!*****************************************************!*\ !*** ./artifacts/transpiled/ui/drawer/ui.drawer.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 _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _type2 = _interopRequireDefault(_type); var _dom = __webpack_require__( /*! ../../core/utils/dom */ 11); var _component_registrator = __webpack_require__( /*! ../../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _ui = __webpack_require__( /*! ../widget/ui.widget */ 17); var _ui2 = _interopRequireDefault(_ui); var _empty_template = __webpack_require__( /*! ../../core/templates/empty_template */ 97); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); var _uiDrawerRenderingStrategy = __webpack_require__( /*! ./ui.drawer.rendering.strategy.push */ 559); var _uiDrawerRenderingStrategy2 = _interopRequireDefault(_uiDrawerRenderingStrategy); var _uiDrawerRenderingStrategy3 = __webpack_require__( /*! ./ui.drawer.rendering.strategy.shrink */ 560); var _uiDrawerRenderingStrategy4 = _interopRequireDefault(_uiDrawerRenderingStrategy3); var _uiDrawerRenderingStrategy5 = __webpack_require__( /*! ./ui.drawer.rendering.strategy.overlap */ 561); var _uiDrawerRenderingStrategy6 = _interopRequireDefault(_uiDrawerRenderingStrategy5); var _uiDrawerRendering = __webpack_require__( /*! ./ui.drawer.rendering.strategy */ 193); var _click = __webpack_require__( /*! ../../events/click */ 20); var _click2 = _interopRequireDefault(_click); var _fx = __webpack_require__( /*! ../../animation/fx */ 39); var _fx2 = _interopRequireDefault(_fx); var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var DRAWER_CLASS = "dx-drawer"; var DRAWER_WRAPPER_CLASS = "dx-drawer-wrapper"; var DRAWER_PANEL_CONTENT_CLASS = "dx-drawer-panel-content"; var DRAWER_CONTENT_CLASS = "dx-drawer-content"; var DRAWER_SHADER_CLASS = "dx-drawer-shader"; var INVISIBLE_STATE_CLASS = "dx-state-invisible"; var OPENED_STATE_CLASS = "dx-drawer-opened"; var ANONYMOUS_TEMPLATE_NAME = "content"; var Drawer = _ui2.default.inherit({ _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { position: "left", opened: false, minSize: null, maxSize: null, shading: false, template: "panel", openedStateMode: "shrink", revealMode: "slide", animationEnabled: true, animationDuration: 400, closeOnOutsideClick: false, contentTemplate: "content", target: void 0 }) }, _getAnonymousTemplateName: function() { return ANONYMOUS_TEMPLATE_NAME }, _init: function() { this.callBase(); this._initStrategy(); this.$element().addClass(DRAWER_CLASS); this._animations = []; this._animationPromise = void 0; this._whenPanelRendered = void 0; this._whenPanelRefreshed = void 0; this._initHideTopOverlayHandler(); this._initContentMarkup() }, _initStrategy: function() { var mode = this.option("openedStateMode"); var Strategy = this._getDefaultStrategy(); if ("push" === mode) { Strategy = _uiDrawerRenderingStrategy2.default } if ("shrink" === mode) { Strategy = _uiDrawerRenderingStrategy4.default } if ("overlap" === mode) { Strategy = _uiDrawerRenderingStrategy6.default } this._strategy = new Strategy(this) }, _initContentMarkup: function() { this._$wrapper = (0, _renderer2.default)("
").addClass(DRAWER_WRAPPER_CLASS); this._$contentWrapper = (0, _renderer2.default)("
").addClass(DRAWER_CONTENT_CLASS); this._$wrapper.append(this._$contentWrapper); this.$element().append(this._$wrapper) }, _getDefaultStrategy: function() { return _uiDrawerRenderingStrategy2.default }, _initHideTopOverlayHandler: function() { this._hideMenuHandler = this.hide.bind(this) }, _initTemplates: function() { this.callBase(); this._defaultTemplates.panel = new _empty_template.EmptyTemplate; this._defaultTemplates.content = new _empty_template.EmptyTemplate }, _initCloseOnOutsideClickHandler: function() { _events_engine2.default.off(this._$contentWrapper, _click2.default.name); _events_engine2.default.on(this._$contentWrapper, _click2.default.name, this._outsideClickHandler.bind(this)) }, _outsideClickHandler: function(e) { var closeOnOutsideClick = this.option("closeOnOutsideClick"); if (_type2.default.isFunction(closeOnOutsideClick)) { closeOnOutsideClick = closeOnOutsideClick(e) } if (closeOnOutsideClick && this.option("opened")) { this.stopAnimations(); if (this.option("shading")) { e.preventDefault() } this.hide(); this._toggleShaderVisibility(false) } }, _initMarkup: function() { this.callBase(); this._toggleVisibleClass(this.option("opened")); this._renderPanelElement(); this._refreshModeClass(); this._refreshRevealModeClass(); this._renderShader(); this._whenPanelRendered = new _deferred.Deferred; this._strategy.renderPanel(this._getTemplate(this.option("template")), this._whenPanelRendered); var contentTemplateOption = this.option("contentTemplate"), contentTemplate = this._getTemplate(contentTemplateOption), transclude = this._getAnonymousTemplateName() === contentTemplateOption; contentTemplate && contentTemplate.render({ container: this.viewContent(), noModel: true, transclude: transclude }); this._initCloseOnOutsideClickHandler(); this._refreshPositionClass() }, _render: function() { var _this = this; this._initSize(); this.callBase(); this._whenPanelRendered.always(function() { _this._initSize(); _this._strategy.setPanelSize("slide" === _this.option("revealMode") || !_this.isHorizontalDirection()); _this._renderPosition(_this.option("opened"), false) }) }, _renderPanelElement: function() { this._$panel = (0, _renderer2.default)("
").addClass(DRAWER_PANEL_CONTENT_CLASS); this._$wrapper.append(this._$panel) }, _refreshModeClass: function(prevClass) { prevClass && this.$element().removeClass(DRAWER_CLASS + "-" + prevClass); this.$element().addClass(DRAWER_CLASS + "-" + this.option("openedStateMode")) }, _refreshPositionClass: function(prevClass) { prevClass && this.$element().removeClass(DRAWER_CLASS + "-" + prevClass); var position = this.getDrawerPosition(); this.$element().addClass(DRAWER_CLASS + "-" + position); this._orderContent(position) }, _orderContent: function(position) { if (this._strategy.needOrderContent(position, this.option("rtlEnabled"))) { this._$wrapper.prepend(this._$contentWrapper) } else { this._$wrapper.prepend(this._$panel) } }, _refreshRevealModeClass: function(prevClass) { prevClass && this.$element().removeClass(DRAWER_CLASS + "-" + prevClass); this.$element().addClass(DRAWER_CLASS + "-" + this.option("revealMode")) }, _renderShader: function() { this._$shader = this._$shader || (0, _renderer2.default)("
").addClass(DRAWER_SHADER_CLASS); this._$shader.appendTo(this.viewContent()); this._toggleShaderVisibility(this.option("opened")) }, _initSize: function() { var realPanelSize = this.isHorizontalDirection() ? this.getRealPanelWidth() : this.getRealPanelHeight(); this._maxSize = this.option("maxSize") || realPanelSize; this._minSize = this.option("minSize") || 0 }, getDrawerPosition: function() { var position = this.option("position"); var rtl = this.option("rtlEnabled"); if ("before" === position) { return rtl ? "right" : "left" } if ("after" === position) { return rtl ? "left" : "right" } return position }, getOverlayTarget: function() { return this.option("target") || this._$wrapper }, getOverlay: function() { return this._overlay }, getMaxSize: function() { return this._maxSize }, getMinSize: function() { return this._minSize }, getRealPanelWidth: function() { if ((0, _window.hasWindow)()) { if (_type2.default.isDefined(this.option("templateSize"))) { return this.option("templateSize") } else { return this.getElementWidth(this._strategy.getPanelContent()) } } else { return 0 } }, getElementWidth: function($element) { var $children = $element.children(); return $children.length ? $children.eq(0).get(0).getBoundingClientRect().width : $element.get(0).getBoundingClientRect().width }, getRealPanelHeight: function() { if ((0, _window.hasWindow)()) { if (_type2.default.isDefined(this.option("templateSize"))) { return this.option("templateSize") } else { return this.getElementHeight(this._strategy.getPanelContent()) } } else { return 0 } }, getElementHeight: function($element) { var $children = $element.children(); return $children.length ? $children.eq(0).get(0).getBoundingClientRect().height : $element.get(0).getBoundingClientRect().height }, isHorizontalDirection: function() { var position = this.getDrawerPosition(); return "left" === position || "right" === position }, stopAnimations: function(jumpToEnd) { _fx2.default.stop(this._$shader, jumpToEnd); _fx2.default.stop((0, _renderer2.default)(this.content()), jumpToEnd); _fx2.default.stop((0, _renderer2.default)(this.viewContent()), jumpToEnd); var overlay = this.getOverlay(); overlay && _fx2.default.stop((0, _renderer2.default)(overlay.$content()), jumpToEnd) }, setZIndex: function(zIndex) { this._$shader.css("zIndex", zIndex - 1); this._$panel.css("zIndex", zIndex) }, resizeContent: function() { (0, _dom.triggerResizeEvent)(this.viewContent()) }, _isInvertedPosition: function() { var position = this.getDrawerPosition(); return "right" === position || "bottom" === position }, _renderPosition: function(offset, animate, jumpToEnd) { this.stopAnimations(jumpToEnd); this._animations = []; animate = _type2.default.isDefined(animate) ? animate && this.option("animationEnabled") : this.option("animationEnabled"); if (!(0, _window.hasWindow)()) { return } var duration = this.option("animationDuration"); offset && this._toggleShaderVisibility(offset); this._strategy.renderPosition(offset, animate); this._strategy.renderShaderVisibility(offset, animate, duration) }, _animationCompleteHandler: function() { this.resizeContent(); if (this._animationPromise) { this._animationPromise.resolve(); this._animations = [] } }, _getPositionCorrection: function() { return this._isInvertedPosition() ? -1 : 1 }, _dispose: function() { _uiDrawerRendering.animation.complete((0, _renderer2.default)(this.viewContent())); this.callBase() }, _visibilityChanged: function(visible) { if (visible) { this._dimensionChanged() } }, _dimensionChanged: function() { this._initSize(); this._strategy.setPanelSize("slide" === this.option("revealMode")) }, _toggleShaderVisibility: function(visible) { if (this.option("shading")) { this._$shader.toggleClass(INVISIBLE_STATE_CLASS, !visible); this._$shader.css("visibility", visible ? "visible" : "hidden") } else { this._$shader.toggleClass(INVISIBLE_STATE_CLASS, true) } }, _toggleVisibleClass: function(opened) { this.$element().toggleClass(OPENED_STATE_CLASS, opened) }, _refreshPanel: function() { var _this2 = this; this._setInitialViewContentPosition(); this._cleanPanel(); this._renderPanelElement(); this._orderContent(this.getDrawerPosition()); this._whenPanelRefreshed = new _deferred.Deferred; this._strategy.renderPanel(this._getTemplate(this.option("template")), this._whenPanelRefreshed); (0, _window.hasWindow)() && this._whenPanelRefreshed.always(function() { _this2._strategy.setPanelSize("slide" === _this2.option("revealMode")); _this2._renderPosition(_this2.option("opened"), false, true) }) }, _setInitialViewContentPosition: function() { (0, _renderer2.default)(this.viewContent()).css("paddingLeft", 0); (0, _renderer2.default)(this.viewContent()).css("left", 0); (0, _renderer2.default)(this.viewContent()).css("transform", "translate(0px, 0px)") }, _clean: function() { this._cleanFocusState(); this._cleanPanel() }, _cleanPanel: function() { if (this._$panel) { this._$panel.remove() } if (this._overlay) { this._overlay.dispose(); delete this._overlay; delete this._$panel } }, _optionChanged: function(args) { switch (args.name) { case "width": this.callBase(args); this._dimensionChanged(); break; case "opened": this._renderPosition(args.value); this._toggleVisibleClass(args.value); break; case "position": this._refreshPositionClass(args.previousValue); this._invalidate(); break; case "contentTemplate": case "template": this._invalidate(); break; case "openedStateMode": case "target": this._initStrategy(); this._refreshModeClass(args.previousValue); this._refreshPanel(); break; case "minSize": case "maxSize": this._initSize(); this._renderPosition(this.option("opened"), false); break; case "revealMode": this._refreshRevealModeClass(args.previousValue); this._refreshPanel(); break; case "shading": this._toggleShaderVisibility(this.option("opened")); break; case "animationEnabled": case "animationDuration": case "closeOnOutsideClick": break; default: this.callBase(args) } }, content: function() { return (0, _dom.getPublicElement)(this._$panel) }, viewContent: function() { return (0, _dom.getPublicElement)(this._$contentWrapper) }, show: function() { return this.toggle(true) }, hide: function() { return this.toggle(false) }, toggle: function(showing) { showing = void 0 === showing ? !this.option("opened") : showing; this._animationPromise = new _deferred.Deferred; this.option("opened", showing); return this._animationPromise.promise() } }); (0, _component_registrator2.default)("dxDrawer", Drawer); module.exports = Drawer }, /*!**************************************************!*\ !*** ./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); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var WINDOW_HEIGHT_PERCENT = .9; exports.getElementMaxHeightByWindow = function($element) { var window = (0, _window.getWindow)(), offsetTop = $element.offset().top - (0, _renderer2.default)(window).scrollTop(), offsetBottom = (0, _renderer2.default)(window).innerHeight() - offsetTop - $element.outerHeight(); return Math.max(offsetTop, offsetBottom) * WINDOW_HEIGHT_PERCENT } }, /*!**************************************************!*\ !*** ./artifacts/transpiled/ui/file_uploader.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _get = function get(object, property, receiver) { if (null === object) { object = Function.prototype } var desc = Object.getOwnPropertyDescriptor(object, property); if (void 0 === desc) { var parent = Object.getPrototypeOf(object); if (null === parent) { return } else { return get(parent, property, receiver) } } else { if ("value" in desc) { return desc.value } else { var getter = desc.get; if (void 0 === getter) { return } return getter.call(receiver) } } }; var _renderer = __webpack_require__( /*! ../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _guid = __webpack_require__( /*! ../core/guid */ 34); var _guid2 = _interopRequireDefault(_guid); 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 _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _callbacks = __webpack_require__( /*! ../core/utils/callbacks */ 27); var _callbacks2 = _interopRequireDefault(_callbacks); 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 _array = __webpack_require__( /*! ../core/utils/array */ 14); var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 6); var _ajax = __webpack_require__( /*! ../core/utils/ajax */ 62); var _ajax2 = _interopRequireDefault(_ajax); var _editor = __webpack_require__( /*! ./editor/editor */ 48); var _editor2 = _interopRequireDefault(_editor); var _button = __webpack_require__( /*! ./button */ 35); var _button2 = _interopRequireDefault(_button); var _progress_bar = __webpack_require__( /*! ./progress_bar */ 227); var _progress_bar2 = _interopRequireDefault(_progress_bar); var _browser = __webpack_require__( /*! ../core/utils/browser */ 25); var _browser2 = _interopRequireDefault(_browser); var _devices = __webpack_require__( /*! ../core/devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _utils = __webpack_require__( /*! ../events/utils */ 8); var _utils2 = _interopRequireDefault(_utils); var _click = __webpack_require__( /*! ../events/click */ 20); var _click2 = _interopRequireDefault(_click); var _message = __webpack_require__( /*! ../localization/message */ 10); var _message2 = _interopRequireDefault(_message); var _themes = __webpack_require__( /*! ./themes */ 31); 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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && ("object" === typeof call || "function" === typeof call) ? call : self } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } } var window = (0, _window.getWindow)(); var FILEUPLOADER_CLASS = "dx-fileuploader", FILEUPLOADER_EMPTY_CLASS = "dx-fileuploader-empty", FILEUPLOADER_SHOW_FILE_LIST_CLASS = "dx-fileuploader-show-file-list", FILEUPLOADER_DRAGOVER_CLASS = "dx-fileuploader-dragover", FILEUPLOADER_WRAPPER_CLASS = "dx-fileuploader-wrapper", FILEUPLOADER_CONTAINER_CLASS = "dx-fileuploader-container", FILEUPLOADER_CONTENT_CLASS = "dx-fileuploader-content", FILEUPLOADER_INPUT_WRAPPER_CLASS = "dx-fileuploader-input-wrapper", FILEUPLOADER_INPUT_CONTAINER_CLASS = "dx-fileuploader-input-container", FILEUPLOADER_INPUT_LABEL_CLASS = "dx-fileuploader-input-label", FILEUPLOADER_INPUT_CLASS = "dx-fileuploader-input", FILEUPLOADER_FILES_CONTAINER_CLASS = "dx-fileuploader-files-container", FILEUPLOADER_FILE_CONTAINER_CLASS = "dx-fileuploader-file-container", FILEUPLOADER_FILE_INFO_CLASS = "dx-fileuploader-file-info", FILEUPLOADER_FILE_STATUS_MESSAGE_CLASS = "dx-fileuploader-file-status-message", FILEUPLOADER_FILE_CLASS = "dx-fileuploader-file", FILEUPLOADER_FILE_NAME_CLASS = "dx-fileuploader-file-name", FILEUPLOADER_FILE_SIZE_CLASS = "dx-fileuploader-file-size", FILEUPLOADER_BUTTON_CLASS = "dx-fileuploader-button", FILEUPLOADER_BUTTON_CONTAINER_CLASS = "dx-fileuploader-button-container", FILEUPLOADER_CANCEL_BUTTON_CLASS = "dx-fileuploader-cancel-button", FILEUPLOADER_UPLOAD_BUTTON_CLASS = "dx-fileuploader-upload-button", FILEUPLOADER_INVALID_CLASS = "dx-fileuploader-invalid", FILEUPLOADER_AFTER_LOAD_DELAY = 400, FILEUPLOADER_CHUNK_META_DATA_NAME = "chunkMetadata"; var renderFileUploaderInput = function() { return (0, _renderer2.default)("").attr("type", "file") }; var isFormDataSupported = function() { return !!window.FormData }; var FileUploader = function(_Editor) { _inherits(FileUploader, _Editor); function FileUploader() { _classCallCheck(this, FileUploader); return _possibleConstructorReturn(this, (FileUploader.__proto__ || Object.getPrototypeOf(FileUploader)).apply(this, arguments)) } _createClass(FileUploader, [{ key: "_supportedKeys", value: function() { var _this2 = this; var click = function(e) { e.preventDefault(); var $selectButton = _this2._selectButton.$element(); _events_engine2.default.trigger($selectButton, _click2.default.name) }; return (0, _extend.extend)(_get(FileUploader.prototype.__proto__ || Object.getPrototypeOf(FileUploader.prototype), "_supportedKeys", this).call(this), { space: click, enter: click }) } }, { key: "_setOptionsByReference", value: function() { _get(FileUploader.prototype.__proto__ || Object.getPrototypeOf(FileUploader.prototype), "_setOptionsByReference", this).call(this); (0, _extend.extend)(this._optionsByReference, { value: true }) } }, { key: "_getDefaultOptions", value: function() { return (0, _extend.extend)(_get(FileUploader.prototype.__proto__ || Object.getPrototypeOf(FileUploader.prototype), "_getDefaultOptions", this).call(this), { chunkSize: 0, value: [], selectButtonText: _message2.default.format("dxFileUploader-selectFile"), uploadButtonText: _message2.default.format("dxFileUploader-upload"), labelText: _message2.default.format("dxFileUploader-dropFile"), name: "files[]", multiple: false, accept: "", uploadUrl: "/", allowCanceling: true, showFileList: true, progress: 0, readyToUploadMessage: _message2.default.format("dxFileUploader-readyToUpload"), uploadedMessage: _message2.default.format("dxFileUploader-uploaded"), uploadFailedMessage: _message2.default.format("dxFileUploader-uploadFailedMessage"), uploadMode: "instantly", uploadMethod: "POST", uploadHeaders: {}, onUploadStarted: null, onUploaded: null, onProgress: null, onUploadError: null, onUploadAborted: null, allowedFileExtensions: [], maxFileSize: 0, minFileSize: 0, invalidFileExtensionMessage: _message2.default.format("dxFileUploader-invalidFileExtension"), invalidMaxFileSizeMessage: _message2.default.format("dxFileUploader-invalidMaxFileSize"), invalidMinFileSizeMessage: _message2.default.format("dxFileUploader-invalidMinFileSize"), extendSelection: true, validationMessageMode: "always", uploadFile: null, uploadChunk: null, abortUpload: null, validationMessageOffset: { h: 0, v: 0 }, useNativeInputClick: false, useDragOver: true, nativeDropSupported: true, _uploadButtonType: "normal" }) } }, { key: "_defaultOptionsRules", value: function() { return _get(FileUploader.prototype.__proto__ || Object.getPrototypeOf(FileUploader.prototype), "_defaultOptionsRules", this).call(this).concat([{ device: function() { return "desktop" === _devices2.default.real().deviceType && !_devices2.default.isSimulator() }, options: { focusStateEnabled: true } }, { device: [{ platform: "android" }], options: { validationMessageOffset: { v: 0 } } }, { device: function() { return "desktop" !== _devices2.default.real().deviceType }, options: { useDragOver: false } }, { device: function() { return !isFormDataSupported() }, options: { uploadMode: "useForm" } }, { device: function() { return _browser2.default.msie || "desktop" !== _devices2.default.real().deviceType }, options: { nativeDropSupported: false } }, { device: function() { return _themes2.default.isMaterial() }, options: { _uploadButtonType: "default" } }]) } }, { key: "_init", value: function() { _get(FileUploader.prototype.__proto__ || Object.getPrototypeOf(FileUploader.prototype), "_init", this).call(this); this._initFileInput(); this._initLabel(); this._setUploadStrategy(); this._createFiles(); this._createUploadStartedAction(); this._createUploadedAction(); this._createProgressAction(); this._createUploadErrorAction(); this._createUploadAbortedAction() } }, { key: "_setUploadStrategy", value: function() { var strategy = null; if (this.option("chunkSize") > 0) { var uploadChunk = this.option("uploadChunk"); strategy = uploadChunk && (0, _type.isFunction)(uploadChunk) ? new CustomChunksFileUploadStrategy(this) : new DefaultChunksFileUploadStrategy(this) } else { var uploadFile = this.option("uploadFile"); strategy = uploadFile && (0, _type.isFunction)(uploadFile) ? new CustomWholeFileUploadStrategy(this) : new DefaultWholeFileUploadStrategy(this) } this._uploadStrategy = strategy } }, { key: "_initFileInput", value: function() { var _this3 = this; this._isCustomClickEvent = false; if (!this._$fileInput) { this._$fileInput = renderFileUploaderInput(); _events_engine2.default.on(this._$fileInput, "change", this._inputChangeHandler.bind(this)); _events_engine2.default.on(this._$fileInput, "click", function(e) { e.stopPropagation(); return _this3.option("useNativeInputClick") || _this3._isCustomClickEvent }) } this._$fileInput.prop({ multiple: this.option("multiple"), accept: this.option("accept"), tabIndex: -1 }) } }, { key: "_inputChangeHandler", value: function() { if (this._doPreventInputChange) { return } var fileName = this._$fileInput.val().replace(/^.*\\/, ""), files = this._$fileInput.prop("files"); if (files && !files.length) { return } var value = files ? this._getFiles(files) : [{ name: fileName }]; this._changeValue(value); if ("instantly" === this.option("uploadMode")) { this._uploadFiles() } } }, { key: "_shouldFileListBeExtended", value: function() { return "useForm" !== this.option("uploadMode") && this.option("extendSelection") && this.option("multiple") } }, { key: "_removeDuplicates", value: function(files, value) { var result = []; for (var i = 0; i < value.length; i++) { if (!this._isFileInArray(files, value[i])) { result.push(value[i]) } } return result } }, { key: "_isFileInArray", value: function(files, file) { for (var i = 0; i < files.length; i++) { var item = files[i]; if (item.size === file.size && item.name === file.name) { return true } } return false } }, { key: "_changeValue", value: function(value) { var files = this._shouldFileListBeExtended() ? this.option("value").slice() : []; if ("instantly" !== this.option("uploadMode")) { value = this._removeDuplicates(files, value) } this.option("value", files.concat(value)) } }, { key: "_getFiles", value: function(fileList) { var values = []; (0, _iterator.each)(fileList, function(_, value) { return values.push(value) }); return values } }, { key: "_initLabel", value: function() { if (!this._$inputLabel) { this._$inputLabel = (0, _renderer2.default)("
") } this._$inputLabel.text(this.option("labelText")) } }, { key: "_focusTarget", value: function() { return this.$element().find("." + FILEUPLOADER_BUTTON_CLASS) } }, { key: "_getSubmitElement", value: function() { return this._$fileInput } }, { key: "_initMarkup", value: function() { _get(FileUploader.prototype.__proto__ || Object.getPrototypeOf(FileUploader.prototype), "_initMarkup", this).call(this); this.$element().addClass(FILEUPLOADER_CLASS); this._renderWrapper(); this._renderInputWrapper(); this._renderSelectButton(); this._renderInputContainer(); this._renderUploadButton(); this._preventRecreatingFiles = true } }, { key: "_render", value: function() { this._preventRecreatingFiles = false; this._renderDragEvents(); this._renderFiles(); _get(FileUploader.prototype.__proto__ || Object.getPrototypeOf(FileUploader.prototype), "_render", this).call(this) } }, { key: "_createFileProgressBar", value: function(file) { file.progressBar = this._createProgressBar(file.value.size); file.progressBar.$element().appendTo(file.$file); this._initStatusMessage(file); this._initCancelButton(file) } }, { key: "_setStatusMessage", value: function(file, key) { var _this4 = this; setTimeout(function() { if (_this4.option("showFileList")) { file.$statusMessage.text(_this4.option(key)); file.$statusMessage.css("display", ""); file.progressBar.$element().remove() } }, FILEUPLOADER_AFTER_LOAD_DELAY) } }, { key: "_createFiles", value: function() { var _this5 = this; var value = this.option("value"); if (this._files && (0 === value.length || !this._shouldFileListBeExtended())) { this._preventFilesUploading(this._files); this._files = null } if (!this._files) { this._files = [] }(0, _iterator.each)(value.slice(this._files.length), function(_, value) { var file = _this5._createFile(value); _this5._validateFile(file); _this5._files.push(file) }) } }, { key: "_preventFilesUploading", value: function(files) { var _this6 = this; files.forEach(function(file) { return _this6._uploadStrategy.abortUpload(file) }) } }, { key: "_validateFile", value: function(file) { file.isValidFileExtension = this._validateFileExtension(file); file.isValidMinSize = this._validateMinFileSize(file); file.isValidMaxSize = this._validateMaxFileSize(file) } }, { key: "_validateFileExtension", value: function(file) { var allowedExtensions = this.option("allowedFileExtensions"), fileExtension = file.value.name.substring(file.value.name.lastIndexOf(".")).toLowerCase(); if (0 === allowedExtensions.length) { return true } for (var i = 0; i < allowedExtensions.length; i++) { if (fileExtension === allowedExtensions[i].toLowerCase()) { return true } } return false } }, { key: "_validateMaxFileSize", value: function(file) { var fileSize = file.value.size, maxFileSize = this.option("maxFileSize"); return maxFileSize > 0 ? fileSize <= maxFileSize : true } }, { key: "_validateMinFileSize", value: function(file) { var fileSize = file.value.size, minFileSize = this.option("minFileSize"); return minFileSize > 0 ? fileSize >= minFileSize : true } }, { key: "_createUploadStartedAction", value: function() { this._uploadStartedAction = this._createActionByOption("onUploadStarted") } }, { key: "_createUploadedAction", value: function() { this._uploadedAction = this._createActionByOption("onUploaded") } }, { key: "_createProgressAction", value: function() { this._progressAction = this._createActionByOption("onProgress") } }, { key: "_createUploadAbortedAction", value: function() { this._uploadAbortedAction = this._createActionByOption("onUploadAborted") } }, { key: "_createUploadErrorAction", value: function() { this._uploadErrorAction = this._createActionByOption("onUploadError") } }, { key: "_createFile", value: function(value) { return { value: value, loadedSize: 0, onProgress: (0, _callbacks2.default)(), onAbort: (0, _callbacks2.default)(), onLoad: (0, _callbacks2.default)(), onError: (0, _callbacks2.default)(), onLoadStart: (0, _callbacks2.default)(), isValidFileExtension: true, isValidMaxSize: true, isValidMinSize: true, isValid: function() { return this.isValidFileExtension && this.isValidMaxSize && this.isValidMinSize } } } }, { key: "_renderFiles", value: function() { var _this7 = this; var value = this.option("value"); if (!this._$filesContainer) { this._$filesContainer = (0, _renderer2.default)("
").addClass(FILEUPLOADER_FILES_CONTAINER_CLASS).appendTo(this._$content) } else { if (!this._shouldFileListBeExtended() || 0 === value.length) { this._$filesContainer.empty() } } var showFileList = this.option("showFileList"); if (showFileList) { (0, _iterator.each)(this._files, function(_, file) { if (!file.$file) { _this7._renderFile(file) } }) } this.$element().toggleClass(FILEUPLOADER_SHOW_FILE_LIST_CLASS, showFileList); this._toggleFileUploaderEmptyClassName(); this._updateFileNameMaxWidth(); this._$validationMessage && this._$validationMessage.dxOverlay("instance").repaint() } }, { key: "_renderFile", value: function(file) { var value = file.value; var $fileContainer = (0, _renderer2.default)("
").addClass(FILEUPLOADER_FILE_CONTAINER_CLASS).appendTo(this._$filesContainer); this._renderFileButtons(file, $fileContainer); file.$file = (0, _renderer2.default)("
").addClass(FILEUPLOADER_FILE_CLASS).appendTo($fileContainer); var $fileInfo = (0, _renderer2.default)("
").addClass(FILEUPLOADER_FILE_INFO_CLASS).appendTo(file.$file); file.$statusMessage = (0, _renderer2.default)("
").addClass(FILEUPLOADER_FILE_STATUS_MESSAGE_CLASS).appendTo(file.$file); (0, _renderer2.default)("
").addClass(FILEUPLOADER_FILE_NAME_CLASS).text(value.name).appendTo($fileInfo); if ((0, _type.isDefined)(value.size)) { (0, _renderer2.default)("
").addClass(FILEUPLOADER_FILE_SIZE_CLASS).text(this._getFileSize(value.size)).appendTo($fileInfo) } if (file.isValid()) { file.$statusMessage.text(this.option("readyToUploadMessage")) } else { if (!file.isValidFileExtension) { file.$statusMessage.append(this._createValidationElement("invalidFileExtensionMessage")) } if (!file.isValidMaxSize) { file.$statusMessage.append(this._createValidationElement("invalidMaxFileSizeMessage")) } if (!file.isValidMinSize) { file.$statusMessage.append(this._createValidationElement("invalidMinFileSizeMessage")) } $fileContainer.addClass(FILEUPLOADER_INVALID_CLASS) } } }, { key: "_createValidationElement", value: function(key) { return (0, _renderer2.default)("").text(this.option(key)) } }, { key: "_updateFileNameMaxWidth", value: function() { var cancelButtonsCount = this.option("allowCanceling") && "useForm" !== this.option("uploadMode") ? 1 : 0, uploadButtonsCount = "useButtons" === this.option("uploadMode") ? 1 : 0, filesContainerWidth = this._$filesContainer.find("." + FILEUPLOADER_FILE_CONTAINER_CLASS).first().width() || this._$filesContainer.width(), $buttonContainer = this._$filesContainer.find("." + FILEUPLOADER_BUTTON_CONTAINER_CLASS).eq(0), buttonsWidth = $buttonContainer.width() * (cancelButtonsCount + uploadButtonsCount), $fileSize = this._$filesContainer.find("." + FILEUPLOADER_FILE_SIZE_CLASS).eq(0); var prevFileSize = $fileSize.text(); $fileSize.text("1000 Mb"); var fileSizeWidth = $fileSize.width(); $fileSize.text(prevFileSize); this._$filesContainer.find("." + FILEUPLOADER_FILE_NAME_CLASS).css("maxWidth", filesContainerWidth - buttonsWidth - fileSizeWidth) } }, { key: "_renderFileButtons", value: function(file, $container) { var $cancelButton = this._getCancelButton(file); $cancelButton && $container.append($cancelButton); var $uploadButton = this._getUploadButton(file); $uploadButton && $container.append($uploadButton) } }, { key: "_getCancelButton", value: function(file) { var _this8 = this; if ("useForm" === this.option("uploadMode")) { return null } file.cancelButton = this._createComponent((0, _renderer2.default)("
").addClass(FILEUPLOADER_BUTTON_CLASS + " " + FILEUPLOADER_CANCEL_BUTTON_CLASS), _button2.default, { onClick: function() { return _this8._removeFile(file) }, icon: "close", visible: this.option("allowCanceling"), integrationOptions: {} }); return (0, _renderer2.default)("
").addClass(FILEUPLOADER_BUTTON_CONTAINER_CLASS).append(file.cancelButton.$element()) } }, { key: "_getUploadButton", value: function(file) { var _this9 = this; if (!file.isValid() || "useButtons" !== this.option("uploadMode")) { return null } file.uploadButton = this._createComponent((0, _renderer2.default)("
").addClass(FILEUPLOADER_BUTTON_CLASS + " " + FILEUPLOADER_UPLOAD_BUTTON_CLASS), _button2.default, { onClick: function() { return _this9._uploadFile(file) }, icon: "upload" }); file.onLoadStart.add(function() { return file.uploadButton.$element().remove() }); return (0, _renderer2.default)("
").addClass(FILEUPLOADER_BUTTON_CONTAINER_CLASS).append(file.uploadButton.$element()) } }, { key: "_removeFile", value: function(file) { file.$file.parent().remove(); this._files.splice((0, _array.inArray)(file, this._files), 1); var value = this.option("value").slice(); value.splice((0, _array.inArray)(file.value, value), 1); this._preventRecreatingFiles = true; this.option("value", value); this._preventRecreatingFiles = false; this._toggleFileUploaderEmptyClassName(); this._doPreventInputChange = true; this._$fileInput.val(""); this._doPreventInputChange = false } }, { key: "_toggleFileUploaderEmptyClassName", value: function() { this.$element().toggleClass(FILEUPLOADER_EMPTY_CLASS, !this._files.length || this._hasInvalidFile(this._files)) } }, { key: "_hasInvalidFile", value: function(files) { for (var i = 0; i < files.length; i++) { if (!files[i].isValid()) { return true } } return false } }, { key: "_getFileSize", value: function(size) { var i = 0; var labels = [_message2.default.format("dxFileUploader-bytes"), _message2.default.format("dxFileUploader-kb"), _message2.default.format("dxFileUploader-Mb"), _message2.default.format("dxFileUploader-Gb")], count = labels.length - 1; while (i < count && size >= 1024) { size /= 1024; i++ } return Math.round(size) + " " + labels[i] } }, { key: "_renderSelectButton", value: function() { var $button = (0, _renderer2.default)("
").addClass(FILEUPLOADER_BUTTON_CLASS).appendTo(this._$inputWrapper); this._selectButton = this._createComponent($button, _button2.default, { text: this.option("selectButtonText"), focusStateEnabled: false, integrationOptions: {} }); if ("desktop" === _devices2.default.real().deviceType) { this._selectButton.option("onClick", this._selectButtonClickHandler.bind(this)) } else { _events_engine2.default.off($button, "click"); _events_engine2.default.on($button, "click", this._selectButtonClickHandler.bind(this)) } } }, { key: "_selectButtonClickHandler", value: function() { if (this.option("useNativeInputClick")) { return } if (this.option("disabled")) { return false } this._isCustomClickEvent = true; _events_engine2.default.trigger(this._$fileInput, "click"); this._isCustomClickEvent = false } }, { key: "_renderUploadButton", value: function() { if ("useButtons" !== this.option("uploadMode")) { return } var $uploadButton = (0, _renderer2.default)("
").addClass(FILEUPLOADER_BUTTON_CLASS).addClass(FILEUPLOADER_UPLOAD_BUTTON_CLASS).appendTo(this._$content); this._uploadButton = this._createComponent($uploadButton, _button2.default, { text: this.option("uploadButtonText"), onClick: this._uploadButtonClickHandler.bind(this), type: this.option("_uploadButtonType"), integrationOptions: {} }) } }, { key: "_uploadButtonClickHandler", value: function() { this._uploadFiles() } }, { key: "_shouldDragOverBeRendered", value: function() { return "useForm" !== this.option("uploadMode") || this.option("nativeDropSupported") } }, { key: "_renderInputContainer", value: function() { this._$inputContainer = (0, _renderer2.default)("
").addClass(FILEUPLOADER_INPUT_CONTAINER_CLASS).appendTo(this._$inputWrapper); if (!this._shouldDragOverBeRendered()) { this._$inputContainer.css("display", "none") } this._$fileInput.addClass(FILEUPLOADER_INPUT_CLASS); this._renderInput(); this._$inputLabel.addClass(FILEUPLOADER_INPUT_LABEL_CLASS).appendTo(this._$inputContainer) } }, { key: "_renderInput", value: function() { if (this.option("useNativeInputClick")) { this._selectButton.option("template", this._selectButtonInputTemplate.bind(this)) } else { this._$fileInput.appendTo(this._$inputContainer); this._selectButton.option("template", "content") } } }, { key: "_selectButtonInputTemplate", value: function(data, content) { var $content = (0, _renderer2.default)(content); var $text = (0, _renderer2.default)("").addClass("dx-button-text").text(data.text); $content.append($text).append(this._$fileInput); return $content } }, { key: "_renderInputWrapper", value: function() { this._$inputWrapper = (0, _renderer2.default)("
").addClass(FILEUPLOADER_INPUT_WRAPPER_CLASS).appendTo(this._$content) } }, { key: "_renderDragEvents", value: function() { _events_engine2.default.off(this._$inputWrapper, "." + this.NAME); if (!this._shouldDragOverBeRendered()) { return } this._dragEventsTargets = []; _events_engine2.default.on(this._$inputWrapper, _utils2.default.addNamespace("dragenter", this.NAME), this._dragEnterHandler.bind(this)); _events_engine2.default.on(this._$inputWrapper, _utils2.default.addNamespace("dragover", this.NAME), this._dragOverHandler.bind(this)); _events_engine2.default.on(this._$inputWrapper, _utils2.default.addNamespace("dragleave", this.NAME), this._dragLeaveHandler.bind(this)); _events_engine2.default.on(this._$inputWrapper, _utils2.default.addNamespace("drop", this.NAME), this._dropHandler.bind(this)) } }, { key: "_useInputForDrop", value: function() { return this.option("nativeDropSupported") && "useForm" === this.option("uploadMode") } }, { key: "_dragEnterHandler", value: function(e) { if (this.option("disabled")) { return false } if (!this._useInputForDrop()) { e.preventDefault() } this._updateEventTargets(e); this.$element().addClass(FILEUPLOADER_DRAGOVER_CLASS) } }, { key: "_dragOverHandler", value: function(e) { if (!this._useInputForDrop()) { e.preventDefault() } } }, { key: "_dragLeaveHandler", value: function(e) { if (!this._useInputForDrop()) { e.preventDefault() } this._updateEventTargets(e); if (!this._dragEventsTargets.length) { this.$element().removeClass(FILEUPLOADER_DRAGOVER_CLASS) } } }, { key: "_updateEventTargets", value: function(e) { var targetIndex = this._dragEventsTargets.indexOf(e.target), isTargetExists = targetIndex !== -1; if ("dragenter" === e.type) { !isTargetExists && this._dragEventsTargets.push(e.target) } else { isTargetExists && this._dragEventsTargets.splice(targetIndex, 1) } } }, { key: "_dropHandler", value: function(e) { this._dragEventsTargets = []; this.$element().removeClass(FILEUPLOADER_DRAGOVER_CLASS); if (this._useInputForDrop()) { return } e.preventDefault(); var fileList = e.originalEvent.dataTransfer.files, files = this._getFiles(fileList); if (!this.option("multiple") && files.length > 1) { return } this._changeValue(this._filterFiles(files)); if ("instantly" === this.option("uploadMode")) { this._uploadFiles() } } }, { key: "_filterFiles", value: function(files) { if (!files.length) { return files } var accept = this.option("accept"); if (!accept.length) { return files } var result = [], allowedTypes = this._getAllowedFileTypes(accept); for (var i = 0, n = files.length; i < n; i++) { if (this._isFileTypeAllowed(files[i], allowedTypes)) { result.push(files[i]) } } return result } }, { key: "_getAllowedFileTypes", value: function(acceptSting) { if (!acceptSting.length) { return [] } return acceptSting.split(",").map(function(item) { return item.trim() }) } }, { key: "_isFileTypeAllowed", value: function(file, allowedTypes) { for (var i = 0, n = allowedTypes.length; i < n; i++) { var allowedType = allowedTypes[i]; if ("." === allowedType[0]) { allowedType = allowedType.replace(".", "\\."); if (file.name.match(new RegExp(allowedType + "$", "i"))) { return true } } else { allowedType = allowedType.replace("*", ""); if (file.type.match(new RegExp(allowedType, "i"))) { return true } } } return false } }, { key: "_renderWrapper", value: function() { var $wrapper = (0, _renderer2.default)("
").addClass(FILEUPLOADER_WRAPPER_CLASS).appendTo(this.$element()); var $container = (0, _renderer2.default)("
").addClass(FILEUPLOADER_CONTAINER_CLASS).appendTo($wrapper); this._$content = (0, _renderer2.default)("
").addClass(FILEUPLOADER_CONTENT_CLASS).appendTo($container) } }, { key: "_clean", value: function() { this._$fileInput.detach(); delete this._$filesContainer; if (this._files) { this._files.forEach(function(file) { file.$file = null; file.$statusMessage = null }) } _get(FileUploader.prototype.__proto__ || Object.getPrototypeOf(FileUploader.prototype), "_clean", this).call(this) } }, { key: "_uploadFiles", value: function() { var _this10 = this; if (isFormDataSupported()) { (0, _iterator.each)(this._files, function(_, file) { return _this10._uploadFile(file) }) } } }, { key: "_uploadFile", value: function(file) { this._uploadStrategy.upload(file) } }, { key: "_updateProgressBar", value: function(file, loadedFileData) { file.progressBar && file.progressBar.option({ value: loadedFileData.loaded, showStatus: true }); this._progressAction({ file: file.value, segmentSize: loadedFileData.currentSegmentSize, bytesLoaded: loadedFileData.loaded, bytesTotal: loadedFileData.total, event: loadedFileData.event, request: file.request }) } }, { key: "_updateTotalProgress", value: function(totalFilesSize, totalLoadedFilesSize) { var progress = totalFilesSize ? Math.round(totalLoadedFilesSize / totalFilesSize * 100) : 0; this.option("progress", progress); this._setLoadedSize(totalLoadedFilesSize) } }, { key: "_initStatusMessage", value: function(file) { file.$statusMessage.css("display", "none") } }, { key: "_initCancelButton", value: function(file) { var _this11 = this; file.cancelButton.option("onClick", function() { _this11._preventFilesUploading([file]); _this11._removeFile(file) }); var hideCancelButton = function() { setTimeout(function() { file.cancelButton.option({ visible: false }) }, FILEUPLOADER_AFTER_LOAD_DELAY) }; file.onLoad.add(hideCancelButton); file.onError.add(hideCancelButton) } }, { key: "_createProgressBar", value: function(fileSize) { return this._createComponent((0, _renderer2.default)("
"), _progress_bar2.default, { value: void 0, min: 0, max: fileSize, statusFormat: function(ratio) { return Math.round(100 * ratio) + "%" }, showStatus: false, statusPosition: "right" }) } }, { key: "_getTotalFilesSize", value: function() { var _this12 = this; if (!this._totalFilesSize) { this._totalFilesSize = 0; (0, _iterator.each)(this._files, function(_, file) { _this12._totalFilesSize += file.value.size }) } return this._totalFilesSize } }, { key: "_getTotalLoadedFilesSize", value: function() { var _this13 = this; if (!this._totalLoadedFilesSize) { this._totalLoadedFilesSize = 0; (0, _iterator.each)(this._files, function(_, file) { _this13._totalLoadedFilesSize += file.loadedSize }) } return this._totalLoadedFilesSize } }, { key: "_setLoadedSize", value: function(value) { this._totalLoadedFilesSize = value } }, { key: "_recalculateProgress", value: function() { this._totalFilesSize = 0; this._totalLoadedFilesSize = 0; this._updateTotalProgress(this._getTotalFilesSize(), this._getTotalLoadedFilesSize()) } }, { key: "_getValidationMessageTarget", value: function() { return this._$inputWrapper } }, { key: "_optionChanged", value: function(args) { var value = args.value; switch (args.name) { case "height": case "width": this._updateFileNameMaxWidth(); _get(FileUploader.prototype.__proto__ || Object.getPrototypeOf(FileUploader.prototype), "_optionChanged", this).call(this, args); break; case "value": !value.length && this._$fileInput.val(""); if (!this._preventRecreatingFiles) { this._createFiles(); this._renderFiles() } this._recalculateProgress(); _get(FileUploader.prototype.__proto__ || Object.getPrototypeOf(FileUploader.prototype), "_optionChanged", this).call(this, args); break; case "name": this._initFileInput(); _get(FileUploader.prototype.__proto__ || Object.getPrototypeOf(FileUploader.prototype), "_optionChanged", this).call(this, args); break; case "accept": this._initFileInput(); break; case "multiple": this._initFileInput(); if (!args.value) { this.reset() } break; case "selectButtonText": this._selectButton.option("text", value); break; case "uploadButtonText": this._uploadButton && this._uploadButton.option("text", value); break; case "_uploadButtonType": this._uploadButton && this._uploadButton.option("type", value); break; case "maxFileSize": case "minFileSize": case "allowedFileExtensions": case "invalidFileExtensionMessage": case "invalidMaxFileSizeMessage": case "invalidMinFileSizeMessage": case "readyToUploadMessage": case "uploadedMessage": case "uploadFailedMessage": this._invalidate(); break; case "labelText": this._$inputLabel.text(value); break; case "showFileList": if (!this._preventRecreatingFiles) { this._renderFiles() } break; case "uploadFile": case "uploadChunk": case "chunkSize": this._setUploadStrategy(); break; case "abortUpload": case "uploadUrl": case "progress": case "uploadMethod": case "uploadHeaders": case "extendSelection": break; case "allowCanceling": case "uploadMode": this.reset(); this._invalidate(); break; case "onUploadStarted": this._createUploadStartedAction(); break; case "onUploaded": this._createUploadedAction(); break; case "onProgress": this._createProgressAction(); break; case "onUploadError": this._createUploadErrorAction(); break; case "onUploadAborted": this._createUploadAbortedAction(); break; case "useNativeInputClick": this._renderInput(); break; case "useDragOver": this._renderDragEvents(); break; case "nativeDropSupported": this._invalidate(); break; default: _get(FileUploader.prototype.__proto__ || Object.getPrototypeOf(FileUploader.prototype), "_optionChanged", this).call(this, args) } } }, { key: "reset", value: function() { this.option("value", []) } }]); return FileUploader }(_editor2.default); FileUploader.__internals = { changeFileInputRenderer: function(renderer) { renderFileUploaderInput = renderer }, resetFileInputTag: function() { renderFileUploaderInput = function() { return (0, _renderer2.default)("").attr("type", "file") } } }; var FileBlobReader = function() { function FileBlobReader(file, chunkSize) { _classCallCheck(this, FileBlobReader); this.file = file; this.chunkSize = chunkSize; this.index = 0 } _createClass(FileBlobReader, [{ key: "read", value: function() { if (!this.file) { return null } var result = this.createBlobResult(this.file, this.index, this.chunkSize); if (result.isCompleted) { this.file = null } this.index++; return result } }, { key: "createBlobResult", value: function(file, index, chunkSize) { var currentPosition = index * chunkSize; return { blob: this.sliceFile(file, currentPosition, chunkSize), index: index, isCompleted: currentPosition + chunkSize >= file.size } } }, { key: "sliceFile", value: function(file, startPos, length) { if (file.slice) { return file.slice(startPos, startPos + length) } if (file.webkitSlice) { return file.webkitSlice(startPos, startPos + length) } return null } }]); return FileBlobReader }(); var FileUploadStrategyBase = function() { function FileUploadStrategyBase(fileUploader) { _classCallCheck(this, FileUploadStrategyBase); this.fileUploader = fileUploader } _createClass(FileUploadStrategyBase, [{ key: "upload", value: function(file) { if (file.isValid() && !file.uploadStarted) { this._prepareFileBeforeUpload(file); this._uploadCore(file) } } }, { key: "abortUpload", value: function abortUpload(file) { var _this14 = this; if (file._isError || file._isLoaded || file.isAborted) { return } file.request && file.request.abort(); file.isAborted = true; if (this._isCustomAbortUpload()) { var abortUpload = this.fileUploader.option("abortUpload"); var arg = this._createAbortUploadArgument(file); var deferred = null; try { var result = abortUpload(file.value, arg); deferred = (0, _deferred.when)(result) } catch (error) { deferred = (new _deferred.Deferred).reject(error).promise() } deferred.done(function() { return file.onAbort.fire() }).fail(function(error) { return _this14._handleFileError(file, error) }) } } }, { key: "_createAbortUploadArgument", value: function(file) {} }, { key: "_uploadCore", value: function(file) {} }, { key: "_isCustomAbortUpload", value: function() { var callback = this.fileUploader.option("abortUpload"); return callback && (0, _type.isFunction)(callback) } }, { key: "_handleFileError", value: function(file, error) { file._isError = true; file.onError.fire(error) } }, { key: "_prepareFileBeforeUpload", value: function(file) { if (file.$file) { this.fileUploader._createFileProgressBar(file) } file.onLoadStart.add(this._onUploadStarted.bind(this, file)); file.onLoad.add(this._onLoadedHandler.bind(this, file)); file.onError.add(this._onErrorHandler.bind(this, file)); file.onAbort.add(this._onAbortHandler.bind(this, file)); file.onProgress.add(this._onProgressHandler.bind(this, file)) } }, { key: "_isStatusError", value: function(status) { return 400 <= status && status < 500 || 500 <= status && status < 600 } }, { key: "_onUploadStarted", value: function(file, e) { file.uploadStarted = true; this.fileUploader._uploadStartedAction({ file: file.value, event: e, request: file.request }) } }, { key: "_onAbortHandler", value: function(file, e) { this.fileUploader._uploadAbortedAction({ file: file.value, event: e, request: file.request }) } }, { key: "_onErrorHandler", value: function(file, error) { this.fileUploader._setStatusMessage(file, "uploadFailedMessage"); this.fileUploader._uploadErrorAction({ file: file.value, event: void 0, request: file.request, error: error }) } }, { key: "_onLoadedHandler", value: function(file, e) { file._isLoaded = true; this.fileUploader._setStatusMessage(file, "uploadedMessage"); this.fileUploader._uploadedAction({ file: file.value, event: e, request: file.request }) } }, { key: "_onProgressHandler", value: function(file, e) { if (file) { var totalFilesSize = this.fileUploader._getTotalFilesSize(); var totalLoadedFilesSize = this.fileUploader._getTotalLoadedFilesSize(); var loadedSize = Math.min(e.loaded, file.value.size); var segmentSize = loadedSize - file.loadedSize; file.loadedSize = loadedSize; this.fileUploader._updateTotalProgress(totalFilesSize, totalLoadedFilesSize + segmentSize); this.fileUploader._updateProgressBar(file, this._getLoadedData(loadedSize, e.total, segmentSize, e)) } } }, { key: "_getLoadedData", value: function(loaded, total, currentSegmentSize, event) { return { loaded: loaded, total: total, currentSegmentSize: currentSegmentSize } } }]); return FileUploadStrategyBase }(); var ChunksFileUploadStrategyBase = function(_FileUploadStrategyBa) { _inherits(ChunksFileUploadStrategyBase, _FileUploadStrategyBa); function ChunksFileUploadStrategyBase(fileUploader) { _classCallCheck(this, ChunksFileUploadStrategyBase); var _this15 = _possibleConstructorReturn(this, (ChunksFileUploadStrategyBase.__proto__ || Object.getPrototypeOf(ChunksFileUploadStrategyBase)).call(this, fileUploader)); _this15.chunkSize = _this15.fileUploader.option("chunkSize"); return _this15 } _createClass(ChunksFileUploadStrategyBase, [{ key: "_uploadCore", value: function(file) { var realFile = file.value; var chunksData = { name: realFile.name, loadedBytes: 0, type: realFile.type, blobReader: new FileBlobReader(realFile, this.chunkSize), guid: new _guid2.default, fileSize: realFile.size, count: Math.ceil(realFile.size / this.chunkSize), customData: {} }; file.chunksData = chunksData; this._sendChunk(file, chunksData) } }, { key: "_sendChunk", value: function(file, chunksData) { var _this16 = this; var chunk = chunksData.blobReader.read(); chunksData.currentChunk = chunk; if (chunk) { this._sendChunkCore(file, chunksData, chunk).done(function() { if (file.isAborted) { return } chunksData.loadedBytes += chunk.blob.size; file.onProgress.fire({ loaded: chunksData.loadedBytes, total: file.value.size }); if (chunk.isCompleted) { file.onLoad.fire() } _this16._sendChunk(file, chunksData) }).fail(function(error) { if (_this16._shouldHandleError(error)) { _this16._handleFileError(file, error) } }) } } }, { key: "_sendChunkCore", value: function(file, chunksData, chunk) {} }, { key: "_shouldHandleError", value: function(error) {} }, { key: "_tryRaiseStartLoad", value: function(file) { if (!file.isStartLoad) { file.isStartLoad = true; file.onLoadStart.fire() } } }, { key: "_getEvent", value: function(e) { return null } }]); return ChunksFileUploadStrategyBase }(FileUploadStrategyBase); var DefaultChunksFileUploadStrategy = function(_ChunksFileUploadStra) { _inherits(DefaultChunksFileUploadStrategy, _ChunksFileUploadStra); function DefaultChunksFileUploadStrategy() { _classCallCheck(this, DefaultChunksFileUploadStrategy); return _possibleConstructorReturn(this, (DefaultChunksFileUploadStrategy.__proto__ || Object.getPrototypeOf(DefaultChunksFileUploadStrategy)).apply(this, arguments)) } _createClass(DefaultChunksFileUploadStrategy, [{ key: "_sendChunkCore", value: function(file, chunksData, chunk) { var _this18 = this; return _ajax2.default.sendRequest({ url: this.fileUploader.option("uploadUrl"), method: this.fileUploader.option("uploadMethod"), headers: this.fileUploader.option("uploadHeaders"), beforeSend: function(xhr) { file.request = xhr }, upload: { onloadstart: function() { return _this18._tryRaiseStartLoad(file) }, onabort: function() { return file.onAbort.fire() } }, data: this._createFormData({ fileName: chunksData.name, blobName: this.fileUploader.option("name"), blob: chunk.blob, index: chunk.index, count: chunksData.count, type: chunksData.type, guid: chunksData.guid, size: chunksData.fileSize }) }) } }, { key: "_shouldHandleError", value: function(e) { return this._isStatusError(e.status) } }, { key: "_createFormData", value: function(options) { var formData = new window.FormData; formData.append(options.blobName, options.blob); formData.append(FILEUPLOADER_CHUNK_META_DATA_NAME, JSON.stringify({ FileName: options.fileName, Index: options.index, TotalCount: options.count, FileSize: options.size, FileType: options.type, FileGuid: options.guid })); return formData } }]); return DefaultChunksFileUploadStrategy }(ChunksFileUploadStrategyBase); var CustomChunksFileUploadStrategy = function(_ChunksFileUploadStra2) { _inherits(CustomChunksFileUploadStrategy, _ChunksFileUploadStra2); function CustomChunksFileUploadStrategy() { _classCallCheck(this, CustomChunksFileUploadStrategy); return _possibleConstructorReturn(this, (CustomChunksFileUploadStrategy.__proto__ || Object.getPrototypeOf(CustomChunksFileUploadStrategy)).apply(this, arguments)) } _createClass(CustomChunksFileUploadStrategy, [{ key: "_sendChunkCore", value: function(file, chunksData) { this._tryRaiseStartLoad(file); var chunksInfo = this._createChunksInfo(chunksData); var uploadChunk = this.fileUploader.option("uploadChunk"); try { var result = uploadChunk(file.value, chunksInfo); return (0, _deferred.when)(result) } catch (error) { return (new _deferred.Deferred).reject(error).promise() } } }, { key: "_createAbortUploadArgument", value: function(file) { return this._createChunksInfo(file.chunksData) } }, { key: "_shouldHandleError", value: function(e) { return true } }, { key: "_createChunksInfo", value: function(chunksData) { return { bytesUploaded: chunksData.loadedBytes, chunkCount: chunksData.count, customData: chunksData.customData, chunkBlob: chunksData.currentChunk.blob, chunkIndex: chunksData.currentChunk.index } } }]); return CustomChunksFileUploadStrategy }(ChunksFileUploadStrategyBase); var WholeFileUploadStrategyBase = function(_FileUploadStrategyBa2) { _inherits(WholeFileUploadStrategyBase, _FileUploadStrategyBa2); function WholeFileUploadStrategyBase() { _classCallCheck(this, WholeFileUploadStrategyBase); return _possibleConstructorReturn(this, (WholeFileUploadStrategyBase.__proto__ || Object.getPrototypeOf(WholeFileUploadStrategyBase)).apply(this, arguments)) } _createClass(WholeFileUploadStrategyBase, [{ key: "_uploadCore", value: function(file) { var _this21 = this; file.loadedSize = 0; this._uploadFile(file).done(function() { if (!file.isAborted) { file.onLoad.fire() } }).fail(function(error) { if (_this21._shouldHandleError(file, error)) { _this21._handleFileError(file, error) } }) } }, { key: "_uploadFile", value: function(file) {} }, { key: "_shouldHandleError", value: function(file, e) {} }, { key: "_handleProgress", value: function(file, e) { if (file._isError) { return } file._isProgressStarted = true; file.onProgress.fire(e) } }, { key: "_getLoadedData", value: function(loaded, total, segmentSize, event) { var result = _get(WholeFileUploadStrategyBase.prototype.__proto__ || Object.getPrototypeOf(WholeFileUploadStrategyBase.prototype), "_getLoadedData", this).call(this, loaded, total, segmentSize, event); result.event = event; return result } }]); return WholeFileUploadStrategyBase }(FileUploadStrategyBase); var DefaultWholeFileUploadStrategy = function(_WholeFileUploadStrat) { _inherits(DefaultWholeFileUploadStrategy, _WholeFileUploadStrat); function DefaultWholeFileUploadStrategy() { _classCallCheck(this, DefaultWholeFileUploadStrategy); return _possibleConstructorReturn(this, (DefaultWholeFileUploadStrategy.__proto__ || Object.getPrototypeOf(DefaultWholeFileUploadStrategy)).apply(this, arguments)) } _createClass(DefaultWholeFileUploadStrategy, [{ key: "_uploadFile", value: function(file) { var _this23 = this; return _ajax2.default.sendRequest({ url: this.fileUploader.option("uploadUrl"), method: this.fileUploader.option("uploadMethod"), headers: this.fileUploader.option("uploadHeaders"), beforeSend: function(xhr) { file.request = xhr }, upload: { onprogress: function(e) { return _this23._handleProgress(file, e) }, onloadstart: function() { return file.onLoadStart.fire() }, onabort: function() { return file.onAbort.fire() } }, data: this._createFormData(this.fileUploader.option("name"), file.value) }) } }, { key: "_shouldHandleError", value: function(file, e) { return this._isStatusError(e.status) || !file._isProgressStarted } }, { key: "_createFormData", value: function(fieldName, fieldValue) { var formData = new window.FormData; formData.append(fieldName, fieldValue); return formData } }]); return DefaultWholeFileUploadStrategy }(WholeFileUploadStrategyBase); var CustomWholeFileUploadStrategy = function(_WholeFileUploadStrat2) { _inherits(CustomWholeFileUploadStrategy, _WholeFileUploadStrat2); function CustomWholeFileUploadStrategy() { _classCallCheck(this, CustomWholeFileUploadStrategy); return _possibleConstructorReturn(this, (CustomWholeFileUploadStrategy.__proto__ || Object.getPrototypeOf(CustomWholeFileUploadStrategy)).apply(this, arguments)) } _createClass(CustomWholeFileUploadStrategy, [{ key: "_uploadFile", value: function(file) { var _this25 = this; file.onLoadStart.fire(); var progressCallback = function(loadedBytes) { var arg = { loaded: loadedBytes, total: file.size }; _this25._handleProgress(file, arg) }; var uploadFile = this.fileUploader.option("uploadFile"); try { var result = uploadFile(file, progressCallback); return (0, _deferred.when)(result) } catch (error) { return (new _deferred.Deferred).reject(error).promise() } } }, { key: "_shouldHandleError", value: function(file, e) { return true } }]); return CustomWholeFileUploadStrategy }(WholeFileUploadStrategyBase); (0, _component_registrator2.default)("dxFileUploader", FileUploader); module.exports = FileUploader }, /*!*************************************************!*\ !*** ./artifacts/transpiled/ui/progress_bar.js ***! \*************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../core/renderer */ 2), TrackBar = __webpack_require__( /*! ./track_bar */ 228), extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction, registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9); var PROGRESSBAR_CLASS = "dx-progressbar", PROGRESSBAR_CONTAINER_CLASS = "dx-progressbar-container", PROGRESSBAR_RANGE_CONTAINER_CLASS = "dx-progressbar-range-container", PROGRESSBAR_RANGE_CLASS = "dx-progressbar-range", PROGRESSBAR_WRAPPER_CLASS = "dx-progressbar-wrapper", PROGRESSBAR_STATUS_CLASS = "dx-progressbar-status", PROGRESSBAR_INDETERMINATE_SEGMENT_CONTAINER = "dx-progressbar-animating-container", 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: 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"), 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"), 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), Editor = __webpack_require__( /*! ./editor/editor */ 48), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9), extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, windowUtils = __webpack_require__( /*! ../core/utils/window */ 7), fx = __webpack_require__( /*! ../animation/fx */ 39); var TRACKBAR_CLASS = "dx-trackbar", TRACKBAR_CONTAINER_CLASS = "dx-trackbar-container", TRACKBAR_RANGE_CLASS = "dx-trackbar-range", 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"), min = this.option("min"), 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 _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _common = __webpack_require__( /*! ../core/utils/common */ 4); var _extend = __webpack_require__( /*! ../core/utils/extend */ 0); var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _iterator2 = _interopRequireDefault(_iterator); var _validation_engine = __webpack_require__( /*! ./validation_engine */ 87); var _validation_engine2 = _interopRequireDefault(_validation_engine); var _uiCollection_widget = __webpack_require__( /*! ./collection/ui.collection_widget.edit */ 52); var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var VALIDATION_SUMMARY_CLASS = "dx-validationsummary", ITEM_CLASS = VALIDATION_SUMMARY_CLASS + "-item", ITEM_DATA_KEY = VALIDATION_SUMMARY_CLASS + "-item-data"; var ValidationSummary = _uiCollection_widget2.default.inherit({ _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { focusStateEnabled: false, noDataText: null }) }, _setOptionsByReference: function() { this.callBase(); (0, _extend.extend)(this._optionsByReference, { validationGroup: true }) }, _init: function() { this.callBase(); this._initGroupRegistration() }, _initGroupRegistration: function() { var $element = this.$element(); var group = this.option("validationGroup") || _validation_engine2.default.findGroup($element, this._modelByElement($element)); var groupConfig = _validation_engine2.default.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 = _validation_engine2.default.getGroupConfig(this._validationGroup); groupConfig && groupConfig.off("validated", this.groupSubscription) }, _getOrderedItems: function(validators, items) { var orderedItems = []; _iterator2.default.each(validators, function(_, validator) { var foundItems = (0, _common.grep)(items, function(item) { if (item.validator === validator) { return true } }); if (foundItems.length) { orderedItems = orderedItems.concat(foundItems) } }); return orderedItems }, _groupValidationHandler: function(params) { var _this = this; var items = this._getOrderedItems(params.validators, _iterator2.default.map(params.brokenRules, function(rule) { return { text: rule.message, validator: rule.validator, index: rule.index } })); this.validators = params.validators; _iterator2.default.each(this.validators, function(_, validator) { if (validator._validationSummary !== _this) { var handler = _this._itemValidationHandler.bind(_this), disposingHandler = function() { validator.off("validated", handler); validator._validationSummary = null; handler = null }; validator.on("validated", handler); validator.on("disposing", disposingHandler); validator._validationSummary = _this } }); this.option("items", items) }, _itemValidationHandler: function(_ref) { var isValid = _ref.isValid, validator = _ref.validator, brokenRules = _ref.brokenRules; var items = this.option("items"), itemsChanged = false; var itemIndex = 0; var _loop = function() { var item = items[itemIndex]; if (item.validator === validator) { var foundRule = (0, _common.grep)(brokenRules || [], function(rule) { return rule.index === item.index })[0]; if (isValid || !foundRule) { items.splice(itemIndex, 1); itemsChanged = true; return "continue" } if (foundRule.message !== item.text) { item.text = foundRule.message; itemsChanged = true } } itemIndex++ }; while (itemIndex < items.length) { var _ret = _loop(); if ("continue" === _ret) { continue } } _iterator2.default.each(brokenRules, function(_, rule) { var foundItem = (0, _common.grep)(items, function(item) { return item.validator === validator && item.index === rule.index })[0]; if (!foundItem) { items.push({ text: rule.message, validator: validator, index: rule.index }); itemsChanged = true } }); if (itemsChanged) { 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) { _events_engine2.default.on(params.itemElement, "click", function() { params.itemData.validator && params.itemData.validator.focus && params.itemData.validator.focus() }) }, _dispose: function() { this.callBase(); this._unsubscribeGroup() } }); (0, _component_registrator2.default)("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 }); var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function") } } 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), Tooltip = __webpack_require__( /*! ./tooltip */ 332), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred, viewPortUtils = __webpack_require__( /*! ../../core/utils/view_port */ 73); 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/tag_box.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _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 }; var _renderer = __webpack_require__( /*! ../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _devices = __webpack_require__( /*! ../core/devices */ 16); var _devices2 = _interopRequireDefault(_devices); var _element_data = __webpack_require__( /*! ../core/element_data */ 40); var _element_data2 = _interopRequireDefault(_element_data); 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 _browser = __webpack_require__( /*! ../core/utils/browser */ 25); var _browser2 = _interopRequireDefault(_browser); var _common = __webpack_require__( /*! ../core/utils/common */ 4); var _selection_filter = __webpack_require__( /*! ../core/utils/selection_filter */ 291); var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 6); var _dom = __webpack_require__( /*! ../core/utils/dom */ 11); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _window = __webpack_require__( /*! ../core/utils/window */ 7); 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 _message = __webpack_require__( /*! ../localization/message */ 10); var _message2 = _interopRequireDefault(_message); var _utils = __webpack_require__( /*! ../events/utils */ 8); var _click = __webpack_require__( /*! ../events/click */ 20); var _utils2 = __webpack_require__( /*! ./text_box/utils.caret */ 301); var _utils3 = _interopRequireDefault(_utils2); var _data_source = __webpack_require__( /*! ../data/data_source/data_source */ 46); var _select_box = __webpack_require__( /*! ./select_box */ 93); var _select_box2 = _interopRequireDefault(_select_box); var _bindable_template = __webpack_require__( /*! ../core/templates/bindable_template */ 64); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var TAGBOX_TAG_DATA_KEY = "dxTagData"; var TAGBOX_CLASS = "dx-tagbox"; var TAGBOX_TAG_CONTAINER_CLASS = "dx-tag-container"; var TAGBOX_TAG_CLASS = "dx-tag"; var TAGBOX_MULTI_TAG_CLASS = "dx-tagbox-multi-tag"; var TAGBOX_CUSTOM_TAG_CLASS = "dx-tag-custom"; var TAGBOX_TAG_REMOVE_BUTTON_CLASS = "dx-tag-remove-button"; var TAGBOX_ONLY_SELECT_CLASS = "dx-tagbox-only-select"; var TAGBOX_SINGLE_LINE_CLASS = "dx-tagbox-single-line"; var TAGBOX_POPUP_WRAPPER_CLASS = "dx-tagbox-popup-wrapper"; var TAGBOX_TAG_CONTENT_CLASS = "dx-tag-content"; var TAGBOX_DEFAULT_FIELD_TEMPLATE_CLASS = "dx-tagbox-default-template"; var TAGBOX_CUSTOM_FIELD_TEMPLATE_CLASS = "dx-tagbox-custom-template"; var NATIVE_CLICK_CLASS = "dx-native-click"; var TAGBOX_MOUSE_WHEEL_DELTA_MULTIPLIER = -.3; var TagBox = _select_box2.default.inherit({ _supportedKeys: function() { var _this = this, _arguments = arguments; var parent = this.callBase(); var sendToList = function(e) { return _this._list._keyboardProcessor.process(e) }; return (0, _extend.extend)({}, parent, { backspace: function(e) { if (!this._isCaretAtTheStart()) { return } e.preventDefault(); e.stopPropagation(); this._isTagRemoved = true; var $tagToDelete = this._$focusedTag || this._tagElements().last(); if (this._$focusedTag) { this._moveTagFocus("prev", true) } if (0 === $tagToDelete.length) { return } this._preserveFocusedTag = true; this._removeTagElement($tagToDelete); delete this._preserveFocusedTag }, upArrow: function(e) { var handler = e.altKey || !_this._list ? parent.upArrow : sendToList; return handler.apply(_this, _arguments) }, downArrow: function(e) { var handler = e.altKey || !_this._list ? parent.downArrow : sendToList; return handler.apply(_this, _arguments) }, del: function(e) { if (!this._$focusedTag || !this._isCaretAtTheStart()) { return } e.preventDefault(); e.stopPropagation(); this._isTagRemoved = true; var $tagToDelete = this._$focusedTag; this._moveTagFocus("next", true); this._preserveFocusedTag = true; this._removeTagElement($tagToDelete); delete this._preserveFocusedTag }, enter: function(e) { var isListItemFocused = this._list && null !== this._list.option("focusedElement"); var isCustomItem = this.option("acceptCustomValue") && !isListItemFocused; if (isCustomItem) { e.preventDefault(); "" !== this._searchValue() && this._customItemAddedHandler(); return } if (this.option("opened")) { sendToList(e); e.preventDefault() } }, space: function(e) { var isOpened = this.option("opened"); var isInputActive = this._shouldRenderSearchEvent(); if (isOpened && !isInputActive) { sendToList(e); e.preventDefault() } }, leftArrow: function(e) { if (!this._isCaretAtTheStart()) { return } var rtlEnabled = this.option("rtlEnabled"); if (this._isEditable() && rtlEnabled && !this._$focusedTag) { return } e.preventDefault(); var direction = rtlEnabled ? "next" : "prev"; this._moveTagFocus(direction); !this.option("multiline") && this._scrollContainer(direction) }, rightArrow: function(e) { if (!this._isCaretAtTheStart()) { return } var rtlEnabled = this.option("rtlEnabled"); if (this._isEditable() && !rtlEnabled && !this._$focusedTag) { return } e.preventDefault(); var direction = rtlEnabled ? "prev" : "next"; this._moveTagFocus(direction); !this.option("multiline") && this._scrollContainer(direction) } }) }, _allowSelectItemByTab: function() { return false }, _isCaretAtTheStart: function() { var position = (0, _utils3.default)(this._input()); return 0 === position.start && 0 === position.end }, _moveTagFocus: function(direction, clearOnBoundary) { if (!this._$focusedTag) { var tagElements = this._tagElements(); this._$focusedTag = "next" === direction ? tagElements.first() : tagElements.last(); this._toggleFocusClass(true, this._$focusedTag); return } var $nextFocusedTag = this._$focusedTag[direction]("." + TAGBOX_TAG_CLASS); if ($nextFocusedTag.length > 0) { this._replaceFocusedTag($nextFocusedTag) } else { if (clearOnBoundary || "next" === direction && this._isEditable()) { this._clearTagFocus() } } }, _replaceFocusedTag: function($nextFocusedTag) { this._toggleFocusClass(false, this._$focusedTag); this._$focusedTag = $nextFocusedTag; this._toggleFocusClass(true, this._$focusedTag) }, _clearTagFocus: function() { if (!this._$focusedTag) { return } this._toggleFocusClass(false, this._$focusedTag); delete this._$focusedTag }, _focusClassTarget: function($element) { if ($element && $element.length && $element[0] !== this._focusTarget()[0]) { return $element } return this.callBase() }, _scrollContainer: function(direction) { if (this.option("multiline") || !(0, _window.hasWindow)()) { return } if (!this._$tagsContainer) { return } var scrollPosition = this._getScrollPosition(direction); this._$tagsContainer.scrollLeft(scrollPosition) }, _getScrollPosition: function(direction) { if ("start" === direction || "end" === direction) { return this._getBorderPosition(direction) } return this._$focusedTag ? this._getFocusedTagPosition(direction) : this._getBorderPosition("end") }, _getBorderPosition: function(direction) { var rtlEnabled = this.option("rtlEnabled"); var isScrollLeft = "end" === direction ^ rtlEnabled; var isScrollReverted = rtlEnabled && !_browser2.default.webkit; var scrollSign = !rtlEnabled || _browser2.default.webkit || _browser2.default.msie ? 1 : -1; return isScrollLeft ^ !isScrollReverted ? 0 : scrollSign * (this._$tagsContainer.get(0).scrollWidth - this._$tagsContainer.outerWidth()) }, _getFocusedTagPosition: function(direction) { var rtlEnabled = this.option("rtlEnabled"); var isScrollLeft = "next" === direction ^ rtlEnabled; var _$focusedTag$position = this._$focusedTag.position(), scrollOffset = _$focusedTag$position.left; var scrollLeft = this._$tagsContainer.scrollLeft(); if (isScrollLeft) { scrollOffset += this._$focusedTag.outerWidth(true) - this._$tagsContainer.outerWidth() } if (isScrollLeft ^ scrollOffset < 0) { var scrollCorrection = rtlEnabled && _browser2.default.msie ? -1 : 1; scrollLeft += scrollOffset * scrollCorrection } return scrollLeft }, _setNextValue: _common.noop, _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { value: [], showDropDownButton: false, maxFilterLength: 1500, tagTemplate: "tag", selectAllText: _message2.default.format("dxList-selectAll"), hideSelectedItems: false, selectedItems: [], selectAllMode: "page", onSelectAllValueChanged: null, maxDisplayedTags: void 0, showMultiTagOnly: true, onMultiTagPreparing: null, multiline: true, useSubmitBehavior: true }) }, _init: function() { this.callBase(); this._selectedItems = []; this._initSelectAllValueChangedAction() }, _initActions: function() { this.callBase(); this._initMultiTagPreparingAction() }, _initMultiTagPreparingAction: function() { this._multiTagPreparingAction = this._createActionByOption("onMultiTagPreparing", { beforeExecute: function(e) { this._multiTagPreparingHandler(e.args[0]) }.bind(this), excludeValidators: ["disabled", "readOnly"] }) }, _multiTagPreparingHandler: function(args) { var _getValue = this._getValue(), selectedCount = _getValue.length; if (!this.option("showMultiTagOnly")) { args.text = _message2.default.getFormatter("dxTagBox-moreSelected")(selectedCount - this.option("maxDisplayedTags") + 1) } else { args.text = _message2.default.getFormatter("dxTagBox-selected")(selectedCount) } }, _initDynamicTemplates: function() { this.callBase(); this._defaultTemplates.tag = new _bindable_template.BindableTemplate(function($container, data) { var $tagContent = (0, _renderer2.default)("
").addClass(TAGBOX_TAG_CONTENT_CLASS); (0, _renderer2.default)("").text(data.text || data).appendTo($tagContent); (0, _renderer2.default)("
").addClass(TAGBOX_TAG_REMOVE_BUTTON_CLASS).appendTo($tagContent); $container.append($tagContent) }, ["text"], this.option("integrationOptions.watchMethod"), { text: this._displayGetter }) }, _toggleSubmitElement: function(enabled) { if (enabled) { this._renderSubmitElement(); this._setSubmitValue() } else { this._$submitElement && this._$submitElement.remove(); delete this._$submitElement } }, _renderSubmitElement: function() { if (!this.option("useSubmitBehavior")) { return } this._$submitElement = (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 row, cell, i, j, rowElement, cellElement, cellText, rowClassNames, that = this, rowsCount = data.length, rtlEnabled = that.option("rtlEnabled"), markupArray = [], encodeHtml = that.option("encodeHtml"), colspan = "colspan='", 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 rowElement, $cellElement, onCellPreparedArgs, row, cell, rowIndex, columnIndex, that = this, rowElements = tableElement.find("tr"), areaName = that._getAreaName(), onCellPrepared = that.option("onCellPrepared"), hasEvent = that.component.hasEvent("cellPrepared"), defaultActionArgs = this.component._defaultActionArgs(); 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 i, that = this, result = [], rowsLength = that.getRowsLength(); for (i = 0; i < rowsLength; i++) { result.push(that._getRowHeight(i)) } return result }, setRowsHeight: function(values) { var i, that = this, totalHeight = 0, valuesLength = values.length; 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 rowIndex, row, i, columnIndex, rowsLength = this.getRowsLength(), processedCells = [], result = [], fillCells = function(cells, rowIndex, columnIndex, rowSpan, colSpan) { var rowOffset, 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, totalWidth = 0, tableElement = this._tableElement[0], colgroupElementHTML = "", columnsCount = this.getColumnsCount(), 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, 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, tableElement = that.tableElement()[0], horizontalOffsetName = that.option("rtlEnabled") ? "right" : "left", 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, rtlEnabled = that.option("rtlEnabled"), offsetStyleName = rtlEnabled ? "right" : "left", tableElementOffset = parseFloat(that.tableElement()[0].style[offsetStyleName]), 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, tableElementOffsetTop = parseFloat(that.tableElement()[0].style.top), 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, 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(), 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 cells, columnCount = 0, row = this._getRowElement(0); 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 */ 69); var _array_store2 = _interopRequireDefault(_array_store); var _click = __webpack_require__( /*! ../../events/click */ 20); 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 */ 10); var _component_registrator = __webpack_require__( /*! ../../core/component_registrator */ 9); var _component_registrator2 = _interopRequireDefault(_component_registrator); var _ui = __webpack_require__( /*! ../widget/ui.widget */ 17); var _ui2 = _interopRequireDefault(_ui); var _uiGrid_core = __webpack_require__( /*! ../grid_core/ui.grid_core.header_filter_core */ 368); var _uiGrid_core2 = _interopRequireDefault(_uiGrid_core); var _uiGrid_core3 = __webpack_require__( /*! ../grid_core/ui.grid_core.column_state_mixin */ 340); var _uiGrid_core4 = _interopRequireDefault(_uiGrid_core3); var _uiGrid_core5 = __webpack_require__( /*! ../grid_core/ui.grid_core.sorting_mixin */ 345); var _uiGrid_core6 = _interopRequireDefault(_uiGrid_core5); var _uiPivot_grid = __webpack_require__( /*! ./ui.pivot_grid.utils */ 77); var _ui3 = __webpack_require__( /*! ./ui.sortable */ 701); 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, 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 = [], isTree = !!field.groupName, 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 preparedFilterValue, item = items[0], path = (0, _uiPivot_grid.createPath)(items), 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; 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, $fieldContent = (0, _renderer2.default)(DIV).addClass("dx-area-field-content").text(field.caption || field.dataField), $fieldElement = (0, _renderer2.default)(DIV).addClass("dx-area-field").addClass("dx-area-box").data("field", field).append($fieldContent), 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, $sortable = (0, _renderer2.default)(this).closest(".dx-sortable-old"), pivotGrid = $sortable.data("dxPivotGrid"), 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"), 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, 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, isInstantlyMode = "instantly" === that.option("applyChangesMode"), 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, func = function(e) { var field = (0, _renderer2.default)(e.currentTarget).data("field"), mainGroupField = (0, _extend.extend)(true, {}, getMainGroupField(that._dataSource, field)), isHeaderFilter = (0, _renderer2.default)(e.target).hasClass("dx-header-filter"), dataSource = that._dataSource, type = mainGroupField.groupName ? "tree" : "list", 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 _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 13); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); var _element_data = __webpack_require__( /*! ../../core/element_data */ 40); var _element_data2 = _interopRequireDefault(_element_data); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _type2 = _interopRequireDefault(_type); var _dom = __webpack_require__( /*! ../../core/utils/dom */ 11); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } 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 = (0, _renderer2.default)(_dom_adapter2.default.createElement(ROW_SELECTOR)); row.append(allDayElements[index].get(0)) } tableBody.appendChild(row.get ? row.get(0) : row) } }, makeTable: function(options) { var row, tableBody = _dom_adapter2.default.createElement("tbody"), templateCallbacks = [], rowCountInGroup = options.groupCount ? options.rowCount / options.groupCount : options.rowCount, allDayElementIndex = 0, allDayElements = options.allDayElements, groupIndex = options.groupIndex, rowCount = options.rowCount; (0, _renderer2.default)(options.container).append(tableBody); if (allDayElements) { this.insertAllDayRow(allDayElements, tableBody, 0); allDayElementIndex++ } for (var i = 0; i < rowCount; i++) { row = _dom_adapter2.default.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 = _dom_adapter2.default.createElement("td"); row.appendChild(td); if (options.cellClass) { if (_type2.default.isFunction(options.cellClass)) { td.className = options.cellClass(i, j) } else { td.className = options.cellClass } } var cellDataObject, dataKey, dataValue; if (options.getCellData) { cellDataObject = options.getCellData(td, i, j, groupIndex); dataKey = cellDataObject.key; dataValue = cellDataObject.value; dataKey && _element_data2.default.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: (0, _dom.getPublicElement)((0, _renderer2.default)(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, cellStorage = [], rowIndex = 0; config = config || {}; var cellTag = config.cellTag || "td", childrenField = config.childrenField || "children", titleField = config.titleField || "title", groupTableClass = config.groupTableClass, groupRowClass = config.groupRowClass, groupCellClass = config.groupCellClass, groupCellCustomContent = config.groupCellCustomContent; function createTable() { table = _dom_adapter2.default.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: _dom_adapter2.default.createElement(cellTag), childCount: childCount }; if (groupCellClass) { cell.element.className = groupCellClass } var cellText = _dom_adapter2.default.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]), 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 = _dom_adapter2.default.createElement(ROW_SELECTOR); if (groupRowClass) { row.className = groupRowClass } var rowspans = []; for (var i = cells.length - 1; i >= 0; i--) { var prev = cells[i + 1], 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 }, _makeFlexGroupedRowCells: function(group, repeatCount, cssClasses, cellTemplate) { var repeatByDate = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1; var cells = [], items = group.items, itemCount = items.length; for (var i = 0; i < repeatCount * repeatByDate; i++) { for (var j = 0; j < itemCount; j++) { var $container = (0, _renderer2.default)("
"), cell = {}; if (cellTemplate && cellTemplate.render) { var templateOptions = { model: items[j], container: (0, _dom.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) } var cssClass = _type2.default.isFunction(cssClasses.groupHeaderClass) ? cssClasses.groupHeaderClass(j) : cssClasses.groupHeaderClass; cell.element = (0, _renderer2.default)("
").addClass(cssClass).append($container); cells.push(cell) } } return cells }, _makeVerticalGroupedRows: function(groups, cssClasses, cellTemplate) { var cellTemplates = [], repeatCount = 1, cellsArray = []; var cellIterator = function(cell) { if (cell.template) { cellTemplates.push(cell.template) } }; for (var i = 0; i < groups.length; i++) { if (i > 0) { repeatCount = groups[i - 1].items.length * repeatCount } var cells = this._makeFlexGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate); cells.forEach(cellIterator); cellsArray.push(cells) } var rows = [], groupCount = cellsArray.length; for (var _i = 0; _i < groupCount; _i++) { rows.push((0, _renderer2.default)("
").addClass(cssClasses.groupHeaderRowClass)) } for (var _i2 = groupCount - 1; _i2 >= 0; _i2--) { var currentColumnLength = cellsArray[_i2].length; for (var j = 0; j < currentColumnLength; j++) { rows[_i2].append(cellsArray[_i2][j].element) } } return { elements: (0, _renderer2.default)("
").addClass("dx-scheduler-group-flex-container").append(rows), cellTemplates: cellTemplates } }, _makeHorizontalGroupedRows: function(groups, cssClasses, cellCount, cellTemplate, groupByDate) { var repeatCount = 1, groupCount = groups.length, rows = [], cellTemplates = [], 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((0, _renderer2.default)("
").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"), 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 = [], items = group.items, itemCount = items.length; for (var i = 0; i < repeatCount; i++) { for (var j = 0; j < itemCount; j++) { var $container = (0, _renderer2.default)("
"), cell = {}; if (cellTemplate && cellTemplate.render) { var templateOptions = { model: items[j], container: (0, _dom.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 = (0, _renderer2.default)("
").append($container) } $container.addClass(cssClasses.groupHeaderContentClass); var cssClass; if (_type2.default.isFunction(cssClasses.groupHeaderClass)) { cssClass = cssClasses.groupHeaderClass(j) } else { cssClass = cssClasses.groupHeaderClass } cell.element = (0, _renderer2.default)("
").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(), cellWidth = this.getCellWidth(), date = this._getIndicationFirstViewDate(), hiddenInterval = this._getHiddenInterval(), timeDiff = today.getTime() - date.getTime(); var differenceInDays = Math.ceil(timeDiff / toMs("day")) - 1, duration = timeDiff - differenceInDays * hiddenInterval, cellCount = duration / this.getCellDuration(); return cellCount * cellWidth }, _renderIndicator: function(height, rtlOffset, $container, groupCount) { var $indicator, 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), 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(), minHeight = this._getWorkSpaceMinHeight(), $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(), 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(), 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"), endDayHour = this.option("endDayHour"), firstViewDate = this.getStartViewDate(), firstViewDateTime = firstViewDate.getTime(), hiddenInterval = (24 - endDayHour + startDayHour) * toMs("hour"), timeZoneOffset = dateUtils.getTimezonesDifference(firstViewDate, currentDate), apptStart = currentDate.getTime(), fullInterval = apptStart - firstViewDateTime - timeZoneOffset, fullDays = Math.floor(fullInterval / toMs("day")), tailDuration = fullInterval - fullDays * toMs("day"), tailDelta = 0, cellCount = this._getCellCountInDay() * (fullDays - this._getWeekendsCount(fullDays)), gapBeforeAppt = apptStart - dateUtils.trimTime(new Date(currentDate)).getTime(), 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), 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 = {}, $scrollable = this.getScrollable().$element(), cellWidth = this.getCellWidth(), scrollableOffset = isRtl ? this.getScrollableOuterWidth() - this.getScrollableScrollLeft() : this.getScrollableScrollLeft(), scrolledCellCount = scrollableOffset / cellWidth, visibleCellCount = $scrollable.width() / cellWidth, totalCellCount = isRtl ? scrolledCellCount - visibleCellCount : scrolledCellCount + visibleCellCount, leftDate = this._getDateByIndex(scrolledCellCount), 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)), 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), scrollable = this.getScrollable(), 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 _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _uiSchedulerAppointmentsPositioningStrategy = __webpack_require__( /*! ./ui.scheduler.appointmentsPositioning.strategy.base */ 396); var _uiSchedulerAppointmentsPositioningStrategy2 = _interopRequireDefault(_uiSchedulerAppointmentsPositioningStrategy); var _uiSchedulerAppointmentsPositioningStrategy3 = __webpack_require__( /*! ./ui.scheduler.appointmentsPositioning.strategy.adaptive */ 736); var _uiSchedulerAppointmentsPositioningStrategy4 = _interopRequireDefault(_uiSchedulerAppointmentsPositioningStrategy3); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 0); var _ui = __webpack_require__( /*! ../../widget/ui.errors */ 19); 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 */ 31); 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") } } var toMs = _date2.default.dateToMilliseconds; var APPOINTMENT_MIN_SIZE = 2, COMPACT_APPOINTMENT_DEFAULT_WIDTH = 15, APPOINTMENT_DEFAULT_HEIGHT = 20, COMPACT_THEME_APPOINTMENT_DEFAULT_HEIGHT = 18, DROP_DOWN_BUTTON_ADAPTIVE_SIZE = 28; var BaseRenderingStrategy = function() { function BaseRenderingStrategy(instance) { _classCallCheck(this, BaseRenderingStrategy); this.instance = instance; this._initPositioningStrategy() } _createClass(BaseRenderingStrategy, [{ key: "_isAdaptive", value: function() { return this.instance.fire("isAdaptive") } }, { key: "_correctCompactAppointmentCoordinatesInAdaptive", value: function(coordinates, isAllDay) { coordinates.top = coordinates.top + this.getCompactAppointmentTopOffset(isAllDay); coordinates.left = coordinates.left + this.getCompactAppointmentLeftOffset() } }, { key: "_initPositioningStrategy", value: function() { this._positioningStrategy = this._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), resultPositions = this._getResultPositions(positionArray); return this._getExtendedPositionMap(map, resultPositions) } }, { key: "_getDeltaWidth", value: function(args, initialSize) { var intervalWidth = this.instance.fire("getResizableStep") || this.getAppointmentMinSize(), 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), allDay = this.isAllDay(item), result = [], startDate = new Date(this.instance.fire("getField", "startDate", item)), isRecurring = !!this.instance.fire("getField", "recurrenceRule", item); for (var j = 0; j < position.length; j++) { var height = this.calculateAppointmentHeight(item, position[j], isRecurring), width = this.calculateAppointmentWidth(item, position[j], isRecurring), resultWidth = width, appointmentReduced = null, multiWeekAppointmentParts = [], initialRowIndex = position[j].rowIndex, 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 createSortedItem = function(rowIndex, cellIndex, top, left, position, isStart, allDay, tmpIndex) { return { i: rowIndex, j: cellIndex, top: round(top), left: round(left), cellPosition: position, isStart: isStart, allDay: allDay, __tmpIndex: tmpIndex } }; var tmpIndex = 0; 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; var start = createSortedItem(rowIndex, cellIndex, top, left, cellPosition, true, allDay, tmpIndex); tmpIndex++; var end = createSortedItem(rowIndex, cellIndex, top + height, left + width, cellPosition, false, allDay, tmpIndex); tmpIndex++; result.push(start, end) } } return result.sort(function(a, b) { return _this._sortCondition(a, b) }) } }, { key: "_fixUnstableSorting", value: function(comparisonResult, a, b) { if (0 === comparisonResult) { if (a.__tmpIndex < b.__tmpIndex) { return -1 } if (a.__tmpIndex > b.__tmpIndex) { return 1 } } return comparisonResult } }, { key: "_sortCondition", value: function() {} }, { key: "_rowCondition", value: function(a, b) { var isSomeEdge = this._isSomeEdge(a, b); var columnCondition = this._normalizeCondition(a.left, b.left, isSomeEdge), rowCondition = this._normalizeCondition(a.top, b.top, isSomeEdge); return columnCondition ? columnCondition : rowCondition ? rowCondition : a.isStart - b.isStart } }, { key: "_columnCondition", value: function(a, b) { var isSomeEdge = this._isSomeEdge(a, b); var columnCondition = this._normalizeCondition(a.left, b.left, isSomeEdge), rowCondition = this._normalizeCondition(a.top, b.top, isSomeEdge); return rowCondition ? rowCondition : columnCondition ? columnCondition : a.isStart - b.isStart } }, { key: "_isSomeEdge", value: function(a, b) { return a.i === b.i && a.j === b.j } }, { key: "_normalizeCondition", value: function(first, second, isSomeEdge) { var result = first - second; return isSomeEdge || Math.abs(result) > 1 ? result : 0 } }, { key: "_getResultPositions", value: function(sortedArray) { var position, stack = [], indexes = [], result = [], intersectPositions = [], intersectPositionCount = 0, sortedIndex = 0; for (var i = 0; i < sortedArray.length; i++) { var j, current = sortedArray[i]; if (current.isStart) { position = void 0; for (j = 0; j < indexes.length; j++) { if (!indexes[j]) { position = j; indexes[j] = true; break } } if (void 0 === position) { position = indexes.length; indexes.push(true); for (j = 0; j < stack.length; j++) { stack[j].count++ } } stack.push({ index: position, count: indexes.length, i: current.i, j: current.j, sortedIndex: this._skipSortedIndex(position) ? null : sortedIndex++ }); if (intersectPositionCount < indexes.length) { intersectPositionCount = indexes.length } } else { var removeIndex = this._findIndexByKey(stack, "i", "j", current.i, current.j), resultItem = stack[removeIndex]; stack.splice(removeIndex, 1); indexes[resultItem.index] = false; intersectPositions.push(resultItem); if (!stack.length) { indexes = []; for (var k = 0; k < intersectPositions.length; k++) { intersectPositions[k].count = intersectPositionCount } intersectPositions = []; intersectPositionCount = 0 } result.push(resultItem) } } return result.sort(function(a, b) { var columnCondition = a.j - b.j, 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, 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, rangeStartDate = this.instance._getStartDate(appointment, skipNormalize), 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 endDate = this.instance._getEndDate(appointment), realStartDate = this.startDate(appointment, true), viewStartDate = this.startDate(appointment, false, position); if (viewStartDate.getTime() > endDate.getTime() || isRecurring) { var recurrencePartStartDate = position ? position.initialStartDate || position.startDate : realStartDate, recurrencePartCroppedByViewStartDate = position ? position.startDate : realStartDate, fullDuration = viewStartDate.getTime() > endDate.getTime() ? this.instance.fire("getField", "endDate", appointment).getTime() - this.instance.fire("getField", "startDate", appointment).getTime() : endDate.getTime() - realStartDate.getTime(); fullDuration = this._adjustDurationByDaylightDiff(fullDuration, 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(), 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 } } 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 compactAppointmentDefaultSize, compactAppointmentLeftOffset, index = coordinates.index, appointmentHeight = height / appointmentCountPerCell, appointmentTop = coordinates.top + index * appointmentHeight, top = appointmentTop + topOffset, width = coordinates.width, left = coordinates.left, 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; this._isAdaptive() && this._correctCompactAppointmentCoordinatesInAdaptive(coordinates, isAllDay); 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"), offsets = this._getOffsets(), 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 appointmentCountPerCell, overlappingMode = this.instance.fire("getMaxAppointmentsPerCell"); 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__) { var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _get = function get(object, property, receiver) { if (null === object) { object = Function.prototype } var desc = Object.getOwnPropertyDescriptor(object, property); if (void 0 === desc) { var parent = Object.getPrototypeOf(object); if (null === parent) { return } else { return get(parent, property, receiver) } } else { if ("value" in desc) { return desc.value } else { var getter = desc.get; if (void 0 === getter) { return } return getter.call(receiver) } } }; var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _ui = __webpack_require__( /*! ../widget/ui.widget */ 17); 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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && ("object" === typeof call || "function" === typeof call) ? call : self } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } } var POINTERUP_EVENT_NAME = _utils2.default.addNamespace(_pointer2.default.up, "dxDiagramPanel"); var PREVENT_REFOCUS_SELECTOR = ".dx-textbox"; var DiagramPanel = function(_Widget) { _inherits(DiagramPanel, _Widget); function DiagramPanel() { _classCallCheck(this, DiagramPanel); return _possibleConstructorReturn(this, (DiagramPanel.__proto__ || Object.getPrototypeOf(DiagramPanel)).apply(this, arguments)) } _createClass(DiagramPanel, [{ key: "_init", value: function() { _get(DiagramPanel.prototype.__proto__ || Object.getPrototypeOf(DiagramPanel.prototype), "_init", this).call(this); this._createOnPointerUpAction() } }, { key: "_render", value: function() { _get(DiagramPanel.prototype.__proto__ || Object.getPrototypeOf(DiagramPanel.prototype), "_render", this).call(this); this._attachPointerUpEvent() } }, { key: "_attachPointerUpEvent", value: function() { var _this2 = 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) { _this2._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(DiagramPanel.prototype.__proto__ || Object.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 */ 143); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _file_saver = __webpack_require__( /*! ../../exporter/file_saver */ 208); var _type = __webpack_require__( /*! ../../core/utils/type */ 1); var _window = __webpack_require__( /*! ../../core/utils/window */ 7); var _message = __webpack_require__( /*! ../../localization/message */ 10); var _message2 = _interopRequireDefault(_message); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } 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 = { getAllToolbarCommands: function() { var _this = this; var _getDiagram = (0, _diagram_importer.getDiagram)(), DiagramCommand = _getDiagram.DiagramCommand; return this.toolbarCommands || (this.toolbarCommands = { separator: SEPARATOR, "export": { widget: "dxButton", icon: "export", text: _message2.default.format("dxDiagram-commandExport"), hint: _message2.default.format("dxDiagram-commandExport"), items: [{ command: DiagramCommand.ExportSvg, text: _message2.default.format("dxDiagram-commandExportToSvg"), getParameter: function(widget) { return function(dataURI) { return _this._exportTo(widget, dataURI, "SVG", "image/svg+xml") } } }, { command: DiagramCommand.ExportPng, text: _message2.default.format("dxDiagram-commandExportToPng"), getParameter: function(widget) { return function(dataURI) { return _this._exportTo(widget, dataURI, "PNG", "image/png") } } }, { command: DiagramCommand.ExportJpg, text: _message2.default.format("dxDiagram-commandExportToJpg"), getParameter: function(widget) { return function(dataURI) { return _this._exportTo(widget, dataURI, "JPEG", "image/jpeg") } } }] }, undo: { command: DiagramCommand.Undo, hint: _message2.default.format("dxDiagram-commandUndo"), text: _message2.default.format("dxDiagram-commandUndo"), icon: "undo" }, redo: { command: DiagramCommand.Redo, hint: _message2.default.format("dxDiagram-commandRedo"), text: _message2.default.format("dxDiagram-commandRedo"), icon: "redo" }, cut: { command: DiagramCommand.Cut, hint: _message2.default.format("dxDiagram-commandCut"), text: _message2.default.format("dxDiagram-commandCut"), icon: "cut" }, copy: { command: DiagramCommand.Copy, hint: _message2.default.format("dxDiagram-commandCopy"), text: _message2.default.format("dxDiagram-commandCopy"), icon: "copy" }, paste: { command: DiagramCommand.PasteInPosition, hint: _message2.default.format("dxDiagram-commandPaste"), text: _message2.default.format("dxDiagram-commandPaste"), icon: "paste", getParameter: function(diagramContextMenu) { return diagramContextMenu.clickPosition } }, selectAll: { command: DiagramCommand.SelectAll, hint: _message2.default.format("dxDiagram-commandSelectAll"), text: _message2.default.format("dxDiagram-commandSelectAll"), icon: "dx-diagram-i-button-select-all dx-diagram-i" }, "delete": { command: DiagramCommand.Delete, hint: _message2.default.format("dxDiagram-commandDelete"), text: _message2.default.format("dxDiagram-commandDelete"), icon: "remove" }, fontName: { command: DiagramCommand.FontName, hint: _message2.default.format("dxDiagram-commandFontName"), widget: "dxSelectBox", items: ["Arial", "Arial Black", "Helvetica", "Times New Roman", "Courier New", "Courier", "Verdana", "Georgia", "Comic Sans MS", "Trebuchet MS"] }, fontSize: { command: DiagramCommand.FontSize, hint: _message2.default.format("dxDiagram-commandFontSize"), widget: "dxSelectBox", items: ["8pt", "9pt", "10pt", "11pt", "12pt", "14pt", "16pt", "18pt", "20pt", "22pt", "24pt", "26pt", "28pt", "36pt", "48pt", "72pt"], cssClass: CSS_CLASSES.SMALL_SELECT }, bold: { command: DiagramCommand.Bold, hint: _message2.default.format("dxDiagram-commandBold"), text: _message2.default.format("dxDiagram-commandBold"), icon: "bold" }, italic: { command: DiagramCommand.Italic, hint: _message2.default.format("dxDiagram-commandItalic"), text: _message2.default.format("dxDiagram-commandItalic"), icon: "italic" }, underline: { command: DiagramCommand.Underline, hint: _message2.default.format("dxDiagram-commandUnderline"), text: _message2.default.format("dxDiagram-commandUnderline"), icon: "underline" }, fontColor: { command: DiagramCommand.FontColor, text: _message2.default.format("dxDiagram-commandTextColor"), hint: _message2.default.format("dxDiagram-commandTextColor"), widget: "dxColorBox", icon: "dx-icon dx-icon-color", cssClass: CSS_CLASSES.BUTTON_COLOR }, lineColor: { command: DiagramCommand.StrokeColor, text: _message2.default.format("dxDiagram-commandLineColor"), hint: _message2.default.format("dxDiagram-commandLineColor"), widget: "dxColorBox", icon: "dx-icon dx-icon-background", cssClass: CSS_CLASSES.BUTTON_COLOR }, fillColor: { command: DiagramCommand.FillColor, text: _message2.default.format("dxDiagram-commandFillColor"), hint: _message2.default.format("dxDiagram-commandFillColor"), widget: "dxColorBox", icon: "dx-diagram-i dx-diagram-i-button-fill", cssClass: CSS_CLASSES.BUTTON_COLOR }, textAlignLeft: { command: DiagramCommand.TextLeftAlign, hint: _message2.default.format("dxDiagram-commandAlignLeft"), text: _message2.default.format("dxDiagram-commandAlignLeft"), icon: "alignleft" }, textAlignCenter: { command: DiagramCommand.TextCenterAlign, hint: _message2.default.format("dxDiagram-commandAlignCenter"), text: _message2.default.format("dxDiagram-commandAlignCenter"), icon: "aligncenter" }, textAlignRight: { command: DiagramCommand.TextRightAlign, hint: _message2.default.format("dxDiagram-commandAlignRight"), text: _message2.default.format("dxDiagram-commandAlignRight"), icon: "alignright" }, lock: { command: DiagramCommand.Lock, hint: _message2.default.format("dxDiagram-commandLock"), text: _message2.default.format("dxDiagram-commandLock"), icon: "dx-diagram-i-button-lock dx-diagram-i" }, unlock: { command: DiagramCommand.Unlock, hint: _message2.default.format("dxDiagram-commandUnlock"), text: _message2.default.format("dxDiagram-commandUnlock"), icon: "dx-diagram-i-button-unlock dx-diagram-i" }, bringToFront: { command: DiagramCommand.BringToFront, hint: _message2.default.format("dxDiagram-commandBringToFront"), text: _message2.default.format("dxDiagram-commandBringToFront"), icon: "dx-diagram-i-button-bring-to-front dx-diagram-i" }, sendToBack: { command: DiagramCommand.SendToBack, hint: _message2.default.format("dxDiagram-commandSendToBack"), text: _message2.default.format("dxDiagram-commandSendToBack"), icon: "dx-diagram-i-button-send-to-back dx-diagram-i" }, insertShapeImage: { command: DiagramCommand.InsertShapeImage, text: _message2.default.format("dxDiagram-commandInsertShapeImage"), icon: "dx-diagram-i-button-image-insert dx-diagram-i" }, editShapeImage: { command: DiagramCommand.EditShapeImage, text: _message2.default.format("dxDiagram-commandEditShapeImage"), icon: "dx-diagram-i-button-image-edit dx-diagram-i" }, deleteShapeImage: { command: DiagramCommand.DeleteShapeImage, text: _message2.default.format("dxDiagram-commandDeleteShapeImage"), icon: "dx-diagram-i-button-image-delete dx-diagram-i" }, connectorLineType: { command: DiagramCommand.ConnectorLineOption, widget: "dxSelectBox", hint: _message2.default.format("dxDiagram-commandConnectorLineType"), items: [{ value: 0, icon: "dx-diagram-i-connector-straight dx-diagram-i", hint: _message2.default.format("dxDiagram-commandConnectorLineStraight") }, { value: 1, icon: "dx-diagram-i-connector-orthogonal dx-diagram-i", hint: _message2.default.format("dxDiagram-commandConnectorLineOrthogonal") }], displayExpr: "name", valueExpr: "value", cssClass: CSS_CLASSES.BUTTON_SELECT }, connectorLineStart: { command: DiagramCommand.ConnectorStartLineEnding, widget: "dxSelectBox", items: [{ value: 0, icon: "dx-diagram-i-connector-begin-none dx-diagram-i", hint: _message2.default.format("dxDiagram-commandConnectorLineNone") }, { value: 1, icon: "dx-diagram-i-connector-begin-arrow dx-diagram-i", hint: _message2.default.format("dxDiagram-commandConnectorLineArrow") }], displayExpr: "name", valueExpr: "value", hint: _message2.default.format("dxDiagram-commandConnectorLineStart"), cssClass: CSS_CLASSES.BUTTON_SELECT }, connectorLineEnd: { command: DiagramCommand.ConnectorEndLineEnding, widget: "dxSelectBox", items: [{ value: 0, icon: "dx-diagram-i-connector-begin-none dx-diagram-i", hint: _message2.default.format("dxDiagram-commandConnectorLineNone") }, { value: 1, icon: "dx-diagram-i-connector-begin-arrow dx-diagram-i", hint: _message2.default.format("dxDiagram-commandConnectorLineArrow") }], displayExpr: "name", valueExpr: "value", hint: _message2.default.format("dxDiagram-commandConnectorLineEnd"), cssClass: CSS_CLASSES.BUTTON_SELECT }, autoLayout: { widget: "dxButton", text: _message2.default.format("dxDiagram-commandAutoLayout"), showText: "always", items: [{ text: _message2.default.format("dxDiagram-commandAutoLayoutTree"), items: [{ command: DiagramCommand.AutoLayoutTreeVertical, text: _message2.default.format("dxDiagram-commandAutoLayoutVertical") }, { command: DiagramCommand.AutoLayoutTreeHorizontal, text: _message2.default.format("dxDiagram-commandAutoLayoutHorizontal") }] }, { text: _message2.default.format("dxDiagram-commandAutoLayoutLayered"), items: [{ command: DiagramCommand.AutoLayoutLayeredVertical, text: _message2.default.format("dxDiagram-commandAutoLayoutVertical") }, { command: DiagramCommand.AutoLayoutLayeredHorizontal, text: _message2.default.format("dxDiagram-commandAutoLayoutHorizontal") }] }] }, fullScreen: { command: DiagramCommand.Fullscreen, hint: _message2.default.format("dxDiagram-commandFullscreen"), text: _message2.default.format("dxDiagram-commandFullscreen"), icon: "dx-diagram-i dx-diagram-i-button-fullscreen", cssClass: CSS_CLASSES.BUTTON_COLOR } }) }, getToolbarCommands: function(commandNames) { var commands = this.getAllToolbarCommands(); if (commandNames) { return commandNames.map(function(cn) { return commands[cn] }).filter(function(c) { return c }) } return [commands.export, commands.separator, commands.undo, commands.redo, commands.separator, commands.fontName, commands.fontSize, commands.separator, commands.bold, commands.italic, commands.underline, commands.separator, commands.fontColor, commands.lineColor, commands.fillColor, commands.separator, commands.textAlignLeft, commands.textAlignCenter, commands.textAlignRight, commands.separator, commands.connectorLineType, commands.connectorLineStart, commands.connectorLineEnd, commands.separator, commands.autoLayout, commands.separator, commands.fullScreen] }, getAllPropertyPanelCommands: function() { var _getDiagram2 = (0, _diagram_importer.getDiagram)(), DiagramCommand = _getDiagram2.DiagramCommand; return this.propertyPanelCommands || (this.propertyPanelCommands = { units: { command: DiagramCommand.ViewUnits, text: _message2.default.format("dxDiagram-commandUnits"), widget: "dxSelectBox" }, pageSize: { command: DiagramCommand.PageSize, text: _message2.default.format("dxDiagram-commandPageSize"), widget: "dxSelectBox", getValue: function(v) { return JSON.parse(v) }, setValue: function(v) { return JSON.stringify(v) } }, pageOrientation: { command: DiagramCommand.PageLandscape, text: _message2.default.format("dxDiagram-commandPageOrientation"), widget: "dxSelectBox", items: [{ value: true, title: _message2.default.format("dxDiagram-commandPageOrientationLandscape") }, { value: false, title: _message2.default.format("dxDiagram-commandPageOrientationPortrait") }] }, pageColor: { command: DiagramCommand.PageColor, text: _message2.default.format("dxDiagram-commandPageColor"), widget: "dxColorBox" }, showGrid: { command: DiagramCommand.ShowGrid, text: _message2.default.format("dxDiagram-commandShowGrid"), widget: "dxCheckBox" }, snapToGrid: { command: DiagramCommand.SnapToGrid, text: _message2.default.format("dxDiagram-commandSnapToGrid"), widget: "dxCheckBox" }, gridSize: { command: DiagramCommand.GridSize, text: _message2.default.format("dxDiagram-commandGridSize"), widget: "dxSelectBox" }, zoomLevel: { command: DiagramCommand.ZoomLevel, text: _message2.default.format("dxDiagram-commandZoomLevel"), widget: "dxSelectBox" }, autoZoom: { command: DiagramCommand.ToggleAutoZoom, text: _message2.default.format("dxDiagram-commandAutoZoom"), widget: "dxCheckBox" }, simpleView: { command: DiagramCommand.ToggleSimpleView, text: _message2.default.format("dxDiagram-commandSimpleView"), widget: "dxCheckBox" } }) }, getDefaultPropertyPanelCommandGroups: function() { return [{ commands: ["units"] }, { commands: ["pageSize", "pageOrientation", "pageColor"] }, { commands: ["showGrid", "snapToGrid", "gridSize"] }, { commands: ["zoomLevel", "autoZoom", "simpleView"] }] }, getPropertyPanelCommandsByGroups: function(groups) { var commands = DiagramCommands.getAllPropertyPanelCommands(); var result = []; groups.forEach(function(g, gi) { g.commands.forEach(function(cn, ci) { result.push((0, _extend.extend)(commands[cn], { beginGroup: gi > 0 && 0 === ci })) }) }); return result }, getPropertyPanelCommands: function(commandGroups) { commandGroups = commandGroups || DiagramCommands.getDefaultPropertyPanelCommandGroups(); return DiagramCommands.getPropertyPanelCommandsByGroups(commandGroups) }, getAllContextMenuCommands: function() { var _getDiagram3 = (0, _diagram_importer.getDiagram)(), DiagramCommand = _getDiagram3.DiagramCommand; return this.contextMenuCommands || (this.contextMenuCommands = { separator: SEPARATOR, cut: { command: DiagramCommand.Cut, text: _message2.default.format("dxDiagram-commandCut"), icon: "cut" }, copy: { command: DiagramCommand.Copy, text: _message2.default.format("dxDiagram-commandCopy"), icon: "copy" }, paste: { command: DiagramCommand.PasteInPosition, text: _message2.default.format("dxDiagram-commandPaste"), getParameter: function(diagramContextMenu) { return diagramContextMenu.clickPosition }, icon: "paste" }, selectAll: { command: DiagramCommand.SelectAll, text: _message2.default.format("dxDiagram-commandSelectAll"), icon: "dx-diagram-i-menu-select-all dx-diagram-i" }, "delete": { command: DiagramCommand.Delete, text: _message2.default.format("dxDiagram-commandDelete"), icon: "remove" }, bringToFront: { command: DiagramCommand.BringToFront, text: _message2.default.format("dxDiagram-commandBringToFront"), icon: "dx-diagram-i-menu-bring-to-front dx-diagram-i" }, sendToBack: { command: DiagramCommand.SendToBack, text: _message2.default.format("dxDiagram-commandSendToBack"), icon: "dx-diagram-i-menu-send-to-back dx-diagram-i" }, lock: { command: DiagramCommand.Lock, text: _message2.default.format("dxDiagram-commandLock"), icon: "dx-diagram-i-menu-lock dx-diagram-i" }, unlock: { command: DiagramCommand.Unlock, text: _message2.default.format("dxDiagram-commandUnlock"), icon: "dx-diagram-i-menu-unlock dx-diagram-i" }, insertShapeImage: { command: DiagramCommand.InsertShapeImage, text: _message2.default.format("dxDiagram-commandInsertShapeImage"), icon: "dx-diagram-i-menu-image-insert dx-diagram-i" }, editShapeImage: { command: DiagramCommand.EditShapeImage, text: _message2.default.format("dxDiagram-commandEditShapeImage"), icon: "dx-diagram-i-menu-image-edit dx-diagram-i" }, deleteShapeImage: { command: DiagramCommand.DeleteShapeImage, text: _message2.default.format("dxDiagram-commandDeleteShapeImage"), icon: "dx-diagram-i-menu-image-delete dx-diagram-i" } }) }, getContextMenuCommands: function(commandNames) { var commands = this.getAllContextMenuCommands(); if (commandNames) { return commandNames.map(function(cn) { return commands[cn] }).filter(function(c) { return c }) } return [commands.cut, commands.copy, commands.paste, commands.delete, commands.separator, commands.selectAll, commands.separator, commands.bringToFront, commands.sendToBack, commands.separator, commands.lock, commands.unlock, commands.separator, commands.insertShapeImage, commands.editShapeImage, commands.deleteShapeImage] }, _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 ia = new Uint8Array(byteString.length); for (var i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i) } return new window.Blob([ia.buffer], { type: mimeString }) } }; module.exports = DiagramCommands }, /*!********************************************!*\ !*** ./artifacts/transpiled/viz/export.js ***! \********************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = __webpack_require__( /*! ./core/export */ 95) }, /*!*****************************************************************!*\ !*** ./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), noop = commonUtils.noop, eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), iteratorModule = __webpack_require__( /*! ../../core/utils/iterator */ 3), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray, eventUtils = __webpack_require__( /*! ../../events/utils */ 8), BaseWidget = __webpack_require__( /*! ../core/base_widget */ 98), coreDataUtils = __webpack_require__( /*! ../../core/utils/data */ 18), legendModule = __webpack_require__( /*! ../components/legend */ 202), dataValidatorModule = __webpack_require__( /*! ../components/data_validator */ 248), seriesModule = __webpack_require__( /*! ../series/base_series */ 250), chartThemeManagerModule = __webpack_require__( /*! ../components/chart_theme_manager */ 409), LayoutManagerModule = __webpack_require__( /*! ./layout_manager */ 410), trackerModule = __webpack_require__( /*! ./tracker */ 806), REINIT_REFRESH_ACTION = "_reinit", REINIT_DATA_SOURCE_REFRESH_ACTION = "_updateDataSource", DATA_INIT_REFRESH_ACTION = "_dataInit", FORCE_RENDER_REFRESH_ACTION = "_forceRender", RESIZE_REFRESH_ACTION = "_resize", ACTIONS_BY_PRIORITY = [REINIT_REFRESH_ACTION, REINIT_DATA_SOURCE_REFRESH_ACTION, DATA_INIT_REFRESH_ACTION, FORCE_RENDER_REFRESH_ACTION, RESIZE_REFRESH_ACTION], vizUtils = __webpack_require__( /*! ../core/utils */ 12), _map = vizUtils.map, _each = iteratorModule.each, _reverseEach = iteratorModule.reverseEach, _isArray = Array.isArray, _isDefined = typeUtils.isDefined, _setCanvasValues = vizUtils.setCanvasValues, DEFAULT_OPACITY = .3, REFRESH_SERIES_DATA_INIT_ACTION_OPTIONS = ["series", "commonSeriesSettings", "dataPrepareSettings", "seriesSelectionMode", "pointSelectionMode", "synchronizeMultiAxes", "resolveLabelsOverlapping"], REFRESH_SERIES_FAMILIES_ACTION_OPTIONS = ["equalBarWidth", "minBubbleSize", "maxBubbleSize", "barWidth", "barGroupPadding", "barGroupWidth", "negativesAsZeroes", "negativesAsZeros"], FORCE_RENDER_REFRESH_ACTION_OPTIONS = ["adaptiveLayout", "crosshair", "resolveLabelOverlapping", "adjustOnZoom", "zoomingMode", "scrollingMode", "stickyHovering"], FONT = "font"; function checkHeightRollingStock(rollingStocks, stubCanvas) { var canvasSize = stubCanvas.end - stubCanvas.start, size = 0; rollingStocks.forEach(function(rollingStock) { size += rollingStock.getBoundingRect().width }); while (canvasSize < size) { size -= findAndKillSmallValue(rollingStocks) } } function findAndKillSmallValue(rollingStocks) { var smallestObject, width; 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); width = smallestObject.rollingStock.getBoundingRect().width; rollingStocks[smallestObject.index] = null; return width } function checkStackOverlap(rollingStocks) { var i, j, iLength, jLength, 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 = [], stubCanvas = { start: isRotated ? canvas.left : canvas.top, end: isRotated ? canvas.width - canvas.right : canvas.height - canvas.bottom }, 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(), secondRect = secondRolling.getBoundingRect(), 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, currentRollingStock, 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, j, currentRollingStock, nextRollingStock, currentBBox, 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(), x = bBox.x, y = bBox.y, endX = bBox.x + bBox.width, 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(), 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(), 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, renderer = that._renderer, root = renderer.root, 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, disposeObject = function(propName) { if (that[propName]) { that[propName].dispose(); that[propName] = null } }, unlinkGroup = function(name) { that[name].linkOff() }, 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 extend({ chart: this }, 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 drawOptions, recreateCanvas, that = this; if (0 === that._canvas.width && 0 === that._canvas.height) { return } that._resetIsReady(); drawOptions = that._prepareDrawOptions(_options); recreateCanvas = drawOptions.recreateCanvas; that._preserveOriginalCanvas(); 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 }, _preserveOriginalCanvas: function() { this.__originalCanvas = this._canvas; this._canvas = extend({}, this._canvas) }, _layoutAxes: noop, _renderElements: function(drawOptions) { var argBusinessRange, zoomMinArg, zoomMaxArg, that = this, preparedOptions = that._prepareToRender(drawOptions), isRotated = that._isRotated(), isLegendInside = that._isLegendInside(), trackerCanvases = [], dirtyCanvas = extend({}, that._canvas); 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 i, singleSeries, that = this, series = that.series, seriesLength = series.length, 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 currentLabel, nextLabel, currentLabelRect, nextLabelRect, i, j, points, labels = [], 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, legendSettings = getLegendSettings(that._legendDataField); that._legend = new legendModule.Legend({ renderer: that._renderer, widget: that, 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, themeManager = that._themeManager, legendOptions = themeManager.getOptions("legend"), 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 options, animationOptions = this._getAnimationOptions(); 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), 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, style = item.getLegendStyles, opacity = style.normal.opacity; if (!item.visible) { if (!_isDefined(opacity) || opacity > DEFAULT_OPACITY) { opacity = DEFAULT_OPACITY } legendData.textOpacity = DEFAULT_OPACITY } var opacityStyle = { opacity: opacity }; legendData.states = { hover: extend({}, style.hover, opacityStyle), selection: extend({}, style.selection, opacityStyle), normal: extend({}, style.normal, opacityStyle) }; 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", "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_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 width, height, that = this; width = Math.max(canvas.width - canvas.left - canvas.right, 0); 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 parsedData, that = this, themeManager = that._themeManager, data = that._dataSourceItems(), dataValidatorOptions = themeManager.getOptions("dataPrepareSettings"), seriesTemplate = themeManager.getOptions("seriesTemplate"); if (seriesTemplate) { that._populateSeries(data) } that._groupSeries(); parsedData = dataValidatorModule.validateData(data, that._groupsData, that._incidentOccurred, dataValidatorOptions); themeManager.resetPalette(); that.series.forEach(function(singleSeries) { singleSeries.updateData(parsedData[singleSeries.getArgumentField()]) }); that._handleSeriesDataUpdated() }, _renderCompleteHandler: function() { var that = this, 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 = void 0; var seriesTheme = void 0; 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 = void 0; 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 }, getStackedPoints: function(point) { var stackName = point.series.getStackName(); return this._getVisibleSeries().reduce(function(stackPoints, series) { if (!_isDefined(series.getStackName()) && !_isDefined(stackName) || stackName === series.getStackName()) { stackPoints = stackPoints.concat(series.getPointsByArg(point.argument)) } return stackPoints }, []) }, 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 */ 95).plugin); BaseChart.addPlugin(__webpack_require__( /*! ../core/title */ 106).plugin); BaseChart.addPlugin(__webpack_require__( /*! ../core/tooltip */ 108).plugin); BaseChart.addPlugin(__webpack_require__( /*! ../core/loading_indicator */ 121).plugin); BaseChart.addPlugin(__webpack_require__( /*! ../core/data_source */ 146).plugin); var _change_TITLE = BaseChart.prototype._change_TITLE; BaseChart.prototype._change_TITLE = function() { _change_TITLE.apply(this, arguments); this._change(["FORCE_RENDER"]) } }, /*!*************************************************************!*\ !*** ./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), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, paletteModule = __webpack_require__( /*! ../palette */ 168), _isString = typeUtils.isString, _parseScalar = __webpack_require__( /*! ./utils */ 12).parseScalar, themeModule = __webpack_require__( /*! ../themes */ 50), _getTheme = themeModule.getTheme, _addCacheItem = themeModule.addCacheItem, _removeCacheItem = themeModule.removeCacheItem, _extend = extend, _each = each; __webpack_require__( /*! ./themes/generic.light */ 783); __webpack_require__( /*! ./themes/generic.dark */ 784); __webpack_require__( /*! ./themes/generic.contrast */ 785); __webpack_require__( /*! ./themes/generic.carmine */ 786); __webpack_require__( /*! ./themes/generic.darkmoon */ 787); __webpack_require__( /*! ./themes/generic.softblue */ 788); __webpack_require__( /*! ./themes/generic.darkviolet */ 789); __webpack_require__( /*! ./themes/generic.greenmist */ 790); __webpack_require__( /*! ./themes/material */ 791); __webpack_require__( /*! ./themes/ios */ 792); 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, current = that._current || {}, 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, _round = Math.round, objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47), defaultOffset = { horizontal: 0, vertical: 0 }, 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, ofBBox = options.of.getLayoutOptions(), myBBox = that.getLayoutOptions(), at = options.at, my = options.my, offset = options.offset || defaultOffset, shiftX = -alignFactors[my.horizontal] * myBBox.width + ofBBox.x + alignFactors[at.horizontal] * ofBBox.width + parseInt(offset.horizontal), 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), STRING = "string", NUMERIC = "numeric", DATETIME = "datetime", DISCRETE = "discrete", SEMIDISCRETE = "semidiscrete", CONTINUOUS = "continuous", LOGARITHMIC = "logarithmic", VALUE_TYPE = "valueType", ARGUMENT_TYPE = "argumentType", extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, axisTypeParser = __webpack_require__( /*! ../core/utils */ 12).enumParser([STRING, NUMERIC, DATETIME]), _getParser = __webpack_require__( /*! ./parse_utils */ 249).getParser, _isDefined = typeUtils.isDefined, _isFunction = typeUtils.isFunction, _isArray = Array.isArray, _isString = typeUtils.isString, _isDate = typeUtils.isDate, _isNumber = typeUtils.isNumeric, _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), valB = selector(b), aa = _isDefined(valA) ? 1 : 0, 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 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, filterInfinity = axisType !== DISCRETE ? function(x) { return isFinite(x) || void 0 === x ? x : null } : eigen; return function(unit, field) { var parseUnit = filterInfinity(parser(unit)); if (void 0 === parseUnit) { validUnit(unit, field, incidentOccurred) } return parseUnit } } function prepareParsers(groupsData, incidentOccurred) { var sizeParser, valueParser, argumentParser = createParserUnit(groupsData.argumentType, groupsData.argumentAxisType, incidentOccurred), categoryParsers = [argumentParser], cache = {}, 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, field, value, ii = parsers.length, obj = extend({}, cell); 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 i, parsedData = [], 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, value, ii = data.length; 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 data, mode = smallValuesGrouping.mode, others = {}; if (!mode || "none" === mode) { return } others[argumentField] = String(smallValuesGrouping.groupName || "others"); others[valueField] = 0; 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], 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 = [], 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 reSortCategories, dataByArguments = {}, isDiscrete = groupsData.argumentAxisType === DISCRETE, userCategories = isDiscrete && groupsData.argumentOptions && groupsData.argumentOptions.categories, sortFunction = function(data) { return data }, sortingMethodOption = options.sortingMethod; 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 groupsIndexes, groupsWithUndefinedValueType = [], groupsWithUndefinedArgumentType = [], argumentTypeGroup = groupsData.argumentOptions && axisTypeParser(groupsData.argumentOptions.argumentType); 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 || {}, userArgumentCategories = argumentOptions && argumentOptions.categories || [], argumentAxisType = correctAxisType(groupsData.argumentType, argumentOptions.type, !!userArgumentCategories.length, incidentOccurred); groupsData.groups.forEach(function(group) { var valueOptions = group.valueOptions || {}, valueCategories = valueOptions.categories || [], 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 i, ii, k, item, data = [], sourceIsDefined = _isDefined(source), hasError = sourceIsDefined && !_isArray(source); 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) { var dataByArgumentFields; 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); 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, dateSerialization = __webpack_require__( /*! ../../core/utils/date_serialization */ 55), isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined, 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, 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 = {}, typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, _each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, pointModule = __webpack_require__( /*! ./points/base_point */ 796), _isDefined = typeUtils.isDefined, vizUtils = __webpack_require__( /*! ../core/utils */ 12), _isEmptyObject = typeUtils.isEmptyObject, _normalizeEnum = vizUtils.normalizeEnum, _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, states = __webpack_require__( /*! ../components/consts */ 119).states, rangeCalculator = __webpack_require__( /*! ./helpers/range_data_calculator */ 252), scatterSeries = __webpack_require__( /*! ./scatter_series */ 107), lineSeries = __webpack_require__( /*! ./line_series */ 204), areaSeries = __webpack_require__( /*! ./area_series */ 169), barSeries = __webpack_require__( /*! ./bar_series */ 145), rangeSeries = __webpack_require__( /*! ./range_series */ 801), bubbleSeries = __webpack_require__( /*! ./bubble_series */ 802), pieSeries = __webpack_require__( /*! ./pie_series */ 803), financialSeries = __webpack_require__( /*! ./financial_series */ 804), stackedSeries = __webpack_require__( /*! ./stacked_series */ 805), DISCRETE = "discrete", SELECTED_STATE = states.selectedMark, HOVER_STATE = states.hoverMark, HOVER = states.hover, NORMAL = states.normal, SELECTION = states.selection, APPLY_SELECTED = states.applySelected, APPLY_HOVER = states.applyHover, RESET_ITEM = states.resetItem, NONE_MODE = "none", INCLUDE_POINTS = "includepoints", NEAREST_POINT = "nearestpoint", SERIES_SELECTION_CHANGED = "seriesSelectionChanged", POINT_SELECTION_CHANGED = "pointSelectionChanged", SERIES_HOVER_CHANGED = "seriesHoverChanged", POINT_HOVER_CHANGED = "pointHoverChanged", ALL_SERIES_POINTS = "allseriespoints", ALL_ARGUMENT_POINTS = "allargumentpoints", POINT_HOVER = "pointHover", CLEAR_POINT_HOVER = "clearPointHover", SERIES_SELECT = "seriesSelect", POINT_SELECT = "pointSelect", POINT_DESELECT = "pointDeselect", 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 || {}, labelFont = _extend({}, opt.font) || {}, labelBorder = opt.border || {}, labelConnector = opt.connector || {}, backgroundAttr = { fill: opt.backgroundColor || defaultColor, "stroke-width": labelBorder.visible ? labelBorder.width || 0 : 0, stroke: labelBorder.visible && labelBorder.width ? labelBorder.color : "none", dashStyle: labelBorder.dashStyle }, 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; function getValueChecker(axisType, axis) { if (!axis || "logarithmic" !== axisType || false !== axis.getOptions().allowNegatives) { return function() { return true } } else { return function(value) { return value > 0 } } } Series.prototype = { constructor: Series, _createLegendState: _noop, getLegendStyles: function() { return this._styles.legendStyles }, _createStyles: function(options) { var that = this, 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) { var clipLabels = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : true; this._paneClipRectID = baseId; this._widePaneClipRectID = wideId; this._forceClipping = forceClipping; this._clipLabels = clipLabels }, 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 pointByArgument, that = this, pointsByArgument = that.pointsByArgument, options = that._getCreatingPointOptions(data), arg = data.argument.valueOf(), 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) } } 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; this._argumentChecker = getValueChecker(settings.argumentAxisType, that.getArgumentAxis()); this._valueChecker = getValueChecker(settings.valueAxisType, that.getValueAxis()); return that }, _argumentChecker: function() { return true }, _valueChecker: function() { return true }, getOptions: function() { return this._options }, _getOldPoint: function(data, oldPointsByArgument, index) { var arg = data.argument && data.argument.valueOf(), 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 points, that = this, oldPointsByArgument = that.pointsByArgument || {}, data = that._getData(); that.pointsByArgument = {}; that._calculateErrorBars(data); var skippedFields = {}; 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, 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 segments, that = this, points = that._points || [], closeSegment = points[0] && points[0].hasValue() && that._options.closed, groupForPoint = { markers: that._markersGroup, errorBars: that._errorBarGroup }; that._drawnPoints = []; that._graphics = that._graphics || []; that._segments = []; 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, 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._clipLabels && 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, methods; if (seriesType) { methods = seriesNS.mixins[widgetType][seriesType]; for (methodName in methods) { delete this[methodName] } } }, _setType: function(seriesType, widgetType) { var methodName, 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, state = that.fullState, 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, currentNearestPoint = that._nearestPoint, 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 customizeObject, pointOptions, customLabelOptions, customOptions, useLabelCustomOptions, usePointCustomOptions, that = this, options = that._options, customizePoint = options.customizePoint, customizeLabel = options.customizeLabel; 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, options = that._options, styles = that._createPointStyles(pointOptions, data, point), 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, aggregateByCategory) { var options = this.getOptions().aggregation; var method = _normalizeEnum(options.method); var customAggregator = "custom" === method && options.calculate; var aggregator = void 0; if (isDiscrete && !aggregateByCategory) { 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, aggregateByCategory = _ref2.aggregateByCategory; var that = this, isDiscrete = that.argumentAxisType === DISCRETE || that.valueAxisType === DISCRETE, dataIndex = 0, dataSelector = this._getPointDataSelector(), options = that.getOptions(), 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) } }, aggregationMethod = this._getAggregationMethod(isDiscrete, aggregateByCategory); if (isDiscrete) { if (aggregateByCategory) { var categories = this.getArgumentAxis().getTranslator().getBusinessRange().categories; var groups = categories.reduce(function(g, category) { g[category.valueOf()] = []; return g }, {}); data.forEach(function(dataItem) { groups[dataItem.argument].push(dataItem) }); return categories.reduce(function(result, c) { addAggregatedData(result, aggregationMethod({ aggregationInterval: null, intervalStart: c, intervalEnd: c, data: groups[c].map(getData) }, that)); return result }, []) } else { 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, 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, 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, argValue = arg.valueOf(), 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, action = data.action, seriesModes = that._seriesModes, target = data.target, targetOptions = target.getOptions(), pointHoverMode = _normalizeEnum(targetOptions.hoverMode), 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 */ 63); var _utils = __webpack_require__( /*! ../../core/utils */ 12); var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 3); var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 0); var _math = Math, _round = _math.round, _floor = _math.floor, _abs = _math.abs, CONNECTOR_LENGTH = 12, LABEL_BACKGROUND_PADDING_X = 8, LABEL_BACKGROUND_PADDING_Y = 4; function getClosestCoord(point, coords) { var closestCoord, closestDistance = 1 / 0; (0, _iterator.each)(coords, function(_, coord) { var x = point[0] - coord[0], y = point[1] - coord[1], 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, 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 labelPoints, x1 = rotatedBBox.x, xc = x1 + rotatedBBox.width / 2, x2 = x1 + rotatedBBox.width - 1, y1 = rotatedBBox.y, yc = y1 + rotatedBBox.height / 2, y2 = y1 + rotatedBBox.height - 1, 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), 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, 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, xr = xl + bBox.width, xc = xl + _round(bBox.width / 2), yt = bBox.y, yb = yt + bBox.height, yc = yt + _round(bBox.height / 2), points = [ [ [xl, yt], [xr, yt] ], [ [xr, yt], [xr, yb] ], [ [xr, yb], [xl, yb] ], [ [xl, yb], [xl, yt] ] ], 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], point1y = pair[0][1], point2x = pair[1][0], 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], x = _round(figure.x + (figure.y - labelPoint[1]) / Math.tan((0, _utils.degreesToRadians)(figure.angle))), 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, renderer = that._renderer, container = that._container, options = that._options || {}, 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 labelPoint, isHorizontal, that = this, figure = that._figure, options = that._options, strategy = that._strategy || selectStrategy(figure), bBox = that._shiftBBox(that._bBoxWithoutRotation), rotatedBBox = that.getBoundingRect(), points = []; 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 _text$setMaxSize = this._text.setMaxSize(maxWidth - padding, void 0, this._options), rowCount = _text$setMaxSize.rowCount, textIsEmpty = _text$setMaxSize.textIsEmpty; if (0 === rowCount) { rowCount = 1 } if (rowCount !== this._rowCount) { rowCountChanged = true; this._rowCount = rowCount } 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 _utils = __webpack_require__( /*! ../../core/utils */ 12); var _type = __webpack_require__( /*! ../../../core/utils/type */ 1); var _common = __webpack_require__( /*! ../../../core/utils/common */ 4); var DISCRETE = "discrete"; var abs = Math.abs, floor = Math.floor, ceil = Math.ceil, min = Math.min; function continuousRangeCalculator(range, minValue, maxValue) { range.min = range.min < minValue ? range.min : minValue; range.max = range.max > maxValue ? range.max : maxValue } function createGetLogFunction(axisType, axis) { if ("logarithmic" !== axisType) { return null } var base = axis.getOptions().logarithmBase; return function(value) { var log = (0, _utils.getLog)(abs(value), base); var round = log < 0 ? floor : ceil; return round(log) } } function getRangeCalculator(axisType, axis, getLog) { var rangeCalculator = continuousRangeCalculator; if (axisType === DISCRETE) { rangeCalculator = function(range, minValue, maxValue) { if (minValue !== maxValue) { range.categories.push(maxValue) } range.categories.push(minValue) } } else { if (axis) { rangeCalculator = function(range, value) { var interval = axis.calculateInterval(value, range.prevValue), minInterval = range.interval; range.interval = (minInterval < interval ? minInterval : interval) || minInterval; range.prevValue = value; continuousRangeCalculator(range, value, value) } } } if (getLog) { return function(range, minValue, maxValue) { var minArgs = []; rangeCalculator(range, minValue, maxValue); 0 !== minValue && minArgs.push(getLog(minValue)); 0 !== maxValue && minArgs.push(getLog(maxValue)); var linearThreshold = min.apply(null, minArgs); range.linearThreshold = range.linearThreshold < linearThreshold ? range.linearThreshold : linearThreshold } } return rangeCalculator } 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 = (0, _utils.unique)(range.categories) } return range } function getValueForArgument(point, extraPoint, x, range) { if (extraPoint && (0, _type.isDefined)(extraPoint.value)) { var y1 = point.value, y2 = extraPoint.value, x1 = point.argument, 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 viewportFilter, rangeCalculator = getRangeCalculator(series.valueAxisType), argumentAxis = series.getArgumentAxis(), viewport = argumentAxis && series.getArgumentAxis().visualRange() || {}, calculatePointBetweenPoints = isLineSeries(series) ? calculateRangeBetweenPoints : _common.noop; if (argumentAxis && argumentAxis.getMarginOptions().checkInterval) { var range = series.getArgumentAxis().getTranslator().getBusinessRange(); var add = (0, _utils.getAddFunction)(range, false); var interval = range.interval; if (isFinite(interval) && (0, _type.isDefined)(viewport.startValue) && (0, _type.isDefined)(viewport.endValue)) { viewport.startValue = add(viewport.startValue, interval, -1); viewport.endValue = add(viewport.endValue, interval) } } 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 && (0, _type.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 (0, _type.isDefined)(argument) && dictionary[argument.valueOf()] } } if (!(0, _type.isDefined)(viewport.startValue) && !(0, _type.isDefined)(viewport.endValue)) { return function() { return true } } if (!(0, _type.isDefined)(viewport.endValue)) { return function(argument) { return argument >= viewport.startValue } } if (!(0, _type.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 || [], range = {}; if (data.length) { if (series.argumentAxisType === DISCRETE) { range = { categories: data.map(function(item) { return item.argument }) } } else { var interval = void 0; 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 = min(i1, i2) } range = { min: data[0].argument, max: data[data.length - 1].argument, interval: interval } } } return processCategories(range) }, getRangeData: function(series) { var points = series.getPoints(); var useAggregation = series.useAggregation(); var argumentCalculator = getRangeCalculator(series.argumentAxisType, points.length > 1 && series.getArgumentAxis(), createGetLogFunction(series.argumentAxisType, series.getArgumentAxis())); var valueRangeCalculator = getRangeCalculator(series.valueAxisType, null, createGetLogFunction(series.valueAxisType, series.getValueAxis())); var viewportReducer = getViewportReducer(series); var range = points.reduce(function(range, point, index, points) { var argument = point.argument; if (!point.isArgumentCorrect()) { return range } 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), 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 ((0, _type.isDefined)(viewport.startValue) || (0, _type.isDefined)(viewport.length)) { argumentCalculator(range.arg, argumentRange.min, argumentRange.min) } if ((0, _type.isDefined)(viewport.endValue) || (0, _type.isDefined)(viewport.length) && (0, _type.isDefined)(viewport.startValue)) { argumentCalculator(range.arg, argumentRange.max, argumentRange.max) } } } processCategories(range.arg); processCategories(range.val); return range }, getViewport: function(series) { var reducer, points = series.getPoints(), range = {}; 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() || {}), valueViewPort = series.getValueAxis().visualRange() || {}, valueViewPortFilter = getViewPortFilter(valueViewPort), points = series.getPoints(), addValue = function(values, point, isEdge) { var minValue = point.getMinValue(), maxValue = point.getMaxValue(), isMinValueInViewPort = valueViewPortFilter(minValue), 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) } } }, addEdgePoints = isLineSeries(series) ? function(result, points, index) { var point = points[index], prevPoint = points[index - 1], nextPoint = points[index + 1]; if (nextPoint && argumentViewPortFilter(nextPoint.argument)) { addValue(result[1], point, true) } if (prevPoint && argumentViewPortFilter(prevPoint.argument)) { addValue(result[1], point, true) } } : _common.noop, 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 */ 12).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 hasHorizontalOverlapping, hasVerticalOverlapping, horizontalInverted = bBox1.x > bBox2.x, verticalInverted = bBox1.y > bBox2.y, x1 = bBox1.x, x2 = bBox2.x, width1 = bBox1.width, width2 = bBox2.width; if ("left" === alignment) { x1 += width1 / 2; x2 += width2 / 2 } else { if ("right" === alignment) { x1 -= width1 / 2; x2 -= width2 / 2 } } hasHorizontalOverlapping = horizontalInverted ? x2 + width2 + spacing > x1 : x1 + width1 + spacing > x2; 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 _Translator2d, extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, Range = __webpack_require__( /*! ./range */ 109).Range, categoryTranslator = __webpack_require__( /*! ./category_translator */ 808), intervalTranslator = __webpack_require__( /*! ./interval_translator */ 809), datetimeTranslator = __webpack_require__( /*! ./datetime_translator */ 810), logarithmicTranslator = __webpack_require__( /*! ./logarithmic_translator */ 811), vizUtils = __webpack_require__( /*! ../core/utils */ 12), typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), getLog = vizUtils.getLogExt, getPower = vizUtils.getPower, raiseToExt = vizUtils.raiseToExt, isDefined = typeUtils.isDefined, adjust = __webpack_require__( /*! ../../core/utils/math */ 30).adjust, _abs = Math.abs, CANVAS_PROP = ["width", "height", "left", "top", "bottom", "right"], 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 br, transformFrom, transformTo, i, transform = "logarithmic" === range.axisType ? function(value) { return getLog(value, range.base) } : function(value) { return value }, array = [], length = breaks.length, 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, range.allowNegatives, range.linearThreshold); minVisible = getLog(minVisible, range.base, range.allowNegatives, range.linearThreshold); min = getLog(min, range.base, range.allowNegatives, range.linearThreshold); max = getLog(max, range.base, range.allowNegatives, range.linearThreshold) } 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, options = that._options, range = that._businessRange, categories = range.categories || [], script = {}, canvasOptions = that._prepareCanvasOptions(), visibleCategories = vizUtils.getCategoriesInfo(categories, range.minVisible, range.maxVisible).categories, 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 i, b, end, length, breaks = this._breaks, size = this._options.breaksSize; 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, length, br, prevBreak, prop = { length: 0, breaksSize: void 0, inBreak: false }, 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 = void 0; 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, 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 = void 0; 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(), 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 = void 0; var max = void 0; 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(raiseToExt(newMin, canvasOptions.base)) : isDateTime ? new Date(newMin) : newMin; newMax = isLogarithmic ? adjust(raiseToExt(newMax, canvasOptions.base)) : 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 prop, that = this, breaks = that._breaks; 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, canvasOptions = that._canvasOptions, breaks = that._breaks, prop = { length: 0 }, 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, breaks = that._breaks, prop = { length: 0 }, canvasOptions = that._canvasOptions, startPoint = canvasOptions.startPoint, 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, each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, _isFinite = isFinite, _Number = Number, _round = Math.round, baseGaugeModule = __webpack_require__( /*! ./base_gauge */ 147), _formatValue = baseGaugeModule.formatValue, _getSampleText = baseGaugeModule.getSampleText, _patchFontOptions = __webpack_require__( /*! ../core/utils */ 12).patchFontOptions, extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, 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, 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 val, that = this, rootElement = this._rootElement, 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 tailWidth, tailHeight, x = options.x, y = options.y, type = COEFFICIENTS_MAP[options.type], cloudWidth = options.textWidth + 2 * options.horMargin, cloudHeight = options.textHeight + 2 * options.verMargin, cx = x, 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 bBox, info, that = this, textCloudOptions = that._getTextCloudOptions(), text = _formatValue(that._actualValue, that._options.text); that._text.attr({ text: text }); bBox = that._text.getBBox(); 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 root, text, bBox, sampleText, that = this; 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 root, text, bBox, that = this; 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 backgroundColor, spaceColor, that = this, options = that._options, 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(); 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, font = options.text.font; if (!font || !font.color) { font = extend({}, font, { color: options.color }) } return _patchFontOptions(font) }, _updateBarItemsPositions: function() { var that = this, 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 */ 12).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, domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 13), clickEventName = __webpack_require__( /*! ../../events/click */ 20).name, downPointerEventName = __webpack_require__( /*! ../../events/pointer */ 23).down, movePointerEventName = __webpack_require__( /*! ../../events/pointer */ 23).move, 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), 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 coords, id = params.getData(e, true); 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 */ 40); var domAdapter = __webpack_require__( /*! ./dom_adapter */ 13); var windowUtils = __webpack_require__( /*! ./utils/window */ 7); var window = windowUtils.getWindow(); var typeUtils = __webpack_require__( /*! ./utils/type */ 1); var styleUtils = __webpack_require__( /*! ./utils/style */ 88); var sizeUtils = __webpack_require__( /*! ./utils/size */ 176); var htmlParser = __webpack_require__( /*! ./utils/html_parser */ 260); 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(), 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], container = this[0], 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) { 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 i, nodes = []; 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"), 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 = [], 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 = [], 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 = [], 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), 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, domAdapter = __webpack_require__( /*! ../dom_adapter */ 13); var isTagName = /<([a-z][^\/\0>\x20\t\r\n\f]+)/i; var tagWrappers = { "default": { tagsCount: 0, startTags: "", endTags: "" }, thead: { tagsCount: 1, startTags: "
").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), noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop, extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend, registerComponent = __webpack_require__( /*! ../../../core/component_registrator */ 9), SchedulerWorkSpace = __webpack_require__( /*! ./ui.scheduler.work_space.indicator */ 199), dateUtils = __webpack_require__( /*! ../../../core/utils/date */ 22), tableCreator = __webpack_require__( /*! ../ui.scheduler.table_creator */ 239), HorizontalShader = __webpack_require__( /*! ../shaders/ui.scheduler.current_time_shader.horizontal */ 726); var TIMELINE_CLASS = "dx-scheduler-timeline", GROUP_TABLE_CLASS = "dx-scheduler-group-table", HORIZONTAL_GROUPED_WORKSPACE_CLASS = "dx-scheduler-work-space-horizontal-grouped", HEADER_PANEL_CELL_CLASS = "dx-scheduler-header-panel-cell", HEADER_PANEL_WEEK_CELL_CLASS = "dx-scheduler-header-panel-week-cell", HEADER_ROW_CLASS = "dx-scheduler-header-row"; var HORIZONTAL = "horizontal", DATE_TABLE_CELL_BORDER = 1, DATE_TABLE_HEADER_MARGIN = 10, 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, $focusedCell = this._$focusedCell, rowCellCount = this._getCellCount(), edgeCellIndex = this._isRTL() ? 0 : rowCellCount - 1, 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, $focusedCell = this._$focusedCell, rowCellCount = this._getCellCount(), edgeCellIndex = this._isRTL() ? rowCellCount - 1 : 0, 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), 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 headerScrollableOnScroll; var config = this.callBase(), timelineConfig = { direction: HORIZONTAL, onStart: function() { if (this._headerScrollable) { headerScrollableOnScroll = this._headerScrollable.option("onScroll"); this._headerScrollable.option("onScroll", void 0) } }.bind(this), onScroll: function(e) { this._headerScrollable && this._headerScrollable.scrollTo({ left: e.scrollOffset.left }) }.bind(this), onEnd: function(e) { this._headerScrollable && this._headerScrollable.option("onScroll", headerScrollableOnScroll) }.bind(this) }; return this.option("crossScrollingEnabled") ? config : extend(config, timelineConfig) }, _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), $cells = [], colspan = this._getCellCountInDay(), cellTemplate = this.option("dateCellTemplate"); for (var i = 0; i < this._getWeekDuration() * this.option("intervalCount"); i++) { var $th = $("
"), 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 */ 30); 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 = roundByAbs(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/open_xml_currency_format.js ***! \***********************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { module.exports = function(currencySymbol, accountingFormat) { if (!accountingFormat) { return } var encodeSymbols = { ".00": "{0}", "'": "\\'", "\\(": "\\(", "\\)": "\\)", " ": "\\ ", '"': """, "\\\xa4": currencySymbol }; var result = accountingFormat.split(";"); for (var i = 0; i < result.length; i++) { for (var symbol in encodeSymbols) { if (Object.prototype.hasOwnProperty.call(encodeSymbols, symbol)) { result[i] = result[i].replace(new RegExp(symbol, "g"), encodeSymbols[symbol]) } } } return 2 === result.length ? result[0] + "_);" + result[1] : result[0] } }, /*!******************************************************************!*\ !*** ./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"](), period = hours < 12 ? 0 : 1, 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(), signPart = timezoneOffset > 0 ? "-" : "+", timezoneOffsetAbs = Math.abs(timezoneOffset), hours = Math.floor(timezoneOffsetAbs / 60), minutes = timezoneOffsetAbs % 60, hoursPart = leftPad(hours.toString(), 2), 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, formatter, char, isCurrentCharEqualsNext, charCount = 0, separator = "'", isEscaping = false, 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 _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3); var _iterator2 = _interopRequireDefault(_iterator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } 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 _iterator2.default.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 */ 81); var _excel2 = _interopRequireDefault(_excel); var _excel3 = __webpack_require__( /*! ./excel.pattern_fill_helper */ 450); 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 */ 81); 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 = void 0; 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 */ 81); var _excel2 = _interopRequireDefault(_excel); var _excel3 = __webpack_require__( /*! ./excel.color_helper */ 266); 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 */ 86); var _color2 = _interopRequireDefault(_color); var _type = __webpack_require__( /*! ../core/utils/type */ 1); var _svg = __webpack_require__( /*! ../core/utils/svg */ 210); 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 */ 13); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); var _dom = __webpack_require__( /*! ../core/utils/dom */ 11); 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), imageData = window.atob(dataURL.substring(("data:" + mimeType + ";base64,").length)); return imageData } function arcTo(x1, y1, x2, y2, radius, largeArcFlag, clockwise, context) { var opSide, adjSide, centerX, centerY, startAngle, endAngle, cBx = (x1 + x2) / 2, cBy = (y1 + y2) / 2, aB = _atan2(y1 - y2, x1 - x2), k = largeArcFlag ? 1 : -1; aB += 90 * (PI / 180) * (clockwise ? 1 : -1); opSide = _sqrt(_pow(x2 - x1, 2) + _pow(y2 - y1, 2)) / 2; adjSide = _sqrt(_abs(_pow(radius, 2) - _pow(opSide, 2))); centerX = cBx + k * (adjSide * _cos(aB)); centerY = cBy + k * (adjSide * _sin(aB)); startAngle = _atan2(y1 - centerY, x1 - centerX); endAngle = _atan2(y2 - centerY, x2 - centerX); context.arc(centerX, centerY, radius, startAngle, endAngle, !clockwise) } function getElementOptions(element, rootAppended) { var coords, attr = parseAttributes(element.attributes || {}), options = (0, _extend.extend)({}, attr, { text: element.textContent.replace(/\s+/g, " "), textAlign: "middle" === attr["text-anchor"] ? "center" : attr["text-anchor"] }), transform = attr.transform; if (transform) { coords = transform.match(/translate\(-*\d+([.]\d+)*(,*\s*-*\d+([.]\d+)*)*/); if (coords) { coords = coords[0].match(/-*\d+([.]\d+)*/g); options.translateX = _number(coords[0]); options.translateY = coords[1] ? _number(coords[1]) : 0 } coords = transform.match(/rotate\(-*\d+([.]\d+)*(,*\s*-*\d+([.]\d+)*,*\s*-*\d+([.]\d+)*)*/); if (coords) { coords = coords[0].match(/-*\d+([.]\d+)*/g); options.rotationAngle = _number(coords[0]); options.rotationX = coords[1] && _number(coords[1]); options.rotationY = coords[2] && _number(coords[2]) } 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, y = options.y, width = options.width, height = options.height, 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, 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 params, prevParams, prevParamsLen, dArray = dAttr.replace(/,/g, " ").split(/([A-Z])/i).filter(function(item) { return "" !== item.trim() }), i = 0; do { 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; break; default: i++ } } while (i < dArray.length) } function parseStyles(element, options, rootAppended) { var field, style = element.style || {}; 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 = 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, textWidth = context.measureText(options.text).width, textHeight = parseInt(options.fontSize, 10), lineHeight = textHeight * TEXT_DECORATION_LINE_WIDTH_COEFF < 1 ? 1 : textHeight * TEXT_DECORATION_LINE_WIDTH_COEFF, y = options.y; 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 line, lines = [], 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), 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), xDiff = 0, 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, isText = "text" === tagName || "tspan" === tagName || void 0 === tagName, isImage = "image" === tagName, 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 = void 0; 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, 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, opacity, 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"; 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), patternCanvas = createCanvas(options.width, options.height, 0), 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 attr, newAttributes = {}; (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 convertSvgToCanvas(svg, canvas, rootAppended) { return drawCanvasElements(svg.childNodes, canvas.getContext("2d"), {}, { clipPaths: {}, patterns: {}, filters: {}, gradients: {}, rootAppended: rootAppended }) } function getCanvasFromSvg(markup, width, height, backgroundColor, margin) { var svgToCanvas = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : convertSvgToCanvas; var canvas = createCanvas(width, height, margin); var context = canvas.getContext("2d"); var svgElem = _svg2.default.getSvgElement(markup); var invisibleDiv = void 0; 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 (0, _deferred.fromPromise)(svgToCanvas(svgElem, canvas, markupIsDomElement && _dom2.default.contains(_dom_adapter2.default.getBody(), markup))).then(function() { return canvas }).always(function() { invisibleDiv && _dom_adapter2.default.getBody().removeChild(invisibleDiv); _dom_adapter2.default.getBody().removeChild(canvas) }) } exports.imageCreator = { getImageData: function(markup, options) { var mimeType = "image/" + options.format, width = options.width, height = options.height, backgroundColor = options.backgroundColor; if ((0, _type.isFunction)(options.__parseAttributesFn)) { parseAttributes = options.__parseAttributesFn } return getCanvasFromSvg(markup, width, height, backgroundColor, options.margin, options.svgToCanvas).then(function(canvas) { return getStringFromCanvas(canvas, mimeType) }) }, getData: function(markup, options) { var that = this; return 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); return data }) }, _getBlob: function(binaryData, mimeType) { var i, dataArray = new Uint8Array(binaryData.length); for (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) { return exports.imageCreator.getData(data, options) }; 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/comparator.js ***! \*******************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var _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 }; var _dom_adapter = __webpack_require__( /*! ../dom_adapter */ 13); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); var _data = __webpack_require__( /*! ./data */ 18); var _type = __webpack_require__( /*! ./type */ 1); var _type2 = _interopRequireDefault(_type); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var hasNegation = function(oldValue, newValue) { return 1 / oldValue === 1 / newValue }; var equals = function(oldValue, newValue) { oldValue = (0, _data.toComparable)(oldValue, true); newValue = (0, _data.toComparable)(newValue, true); if (oldValue && newValue && _type2.default.isRenderer(oldValue) && _type2.default.isRenderer(newValue)) { return newValue.is(oldValue) } var oldValueIsNaN = oldValue !== oldValue; var newValueIsNaN = newValue !== newValue; if (oldValueIsNaN && newValueIsNaN) { return true } if (0 === oldValue && 0 === newValue) { return hasNegation(oldValue, newValue) } if (null === oldValue || "object" !== ("undefined" === typeof oldValue ? "undefined" : _typeof(oldValue)) || _dom_adapter2.default.isElementNode(oldValue)) { return oldValue === newValue } return false }; exports.equals = equals }, /*!**************************************************!*\ !*** ./artifacts/transpiled/core/utils/queue.js ***! \**************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var errors = __webpack_require__( /*! ../errors */ 21), when = __webpack_require__( /*! ../../core/utils/deferred */ 6).when; function createQueue(discardPendingTasks) { var _tasks = [], _busy = false; function exec() { while (_tasks.length) { _busy = true; var task = _tasks.shift(), result = task(); if (void 0 === result) { continue } if (result.then) { when(result).always(exec); return } throw errors.Error("E0015") } _busy = false } function add(task, removeTaskCallback) { if (!discardPendingTasks) { _tasks.push(task) } else { if (_tasks[0] && removeTaskCallback) { removeTaskCallback(_tasks[0]) } _tasks = [task] } if (!_busy) { exec() } } function busy() { return _busy } return { add: add, busy: busy } } exports.create = createQueue; exports.enqueue = createQueue().add }, /*!**************************************************!*\ !*** ./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, 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, Bx = 3 * (x2 - x1) - Cx, Ax = 1 - Cx - Bx, Cy = 3 * y1, By = 3 * (y2 - y1) - Cy, Ay = 1 - Cy - By; var bezierX = function(t) { return t * (Cx + t * (Bx + t * Ax)) }; var bezierY = function(t) { return t * (Cy + t * (By + t * Ay)) }; var findXFor = function(t) { var z, x = t, i = 0; while (i < 14) { z = bezierX(x) - t; if (Math.abs(z) < .001) { break } x -= z / derivativeX(x); i++ } return x }; var derivativeX = function(t) { return Cx + t * (2 * Bx + 3 * t * Ax) }; return function(t) { return bezierY(findXFor(t)) } }; 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), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each, BaseStrategy = __webpack_require__( /*! ./base */ 155); 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, readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 49), domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 13); 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, BaseStrategy = __webpack_require__( /*! ./base */ 155), Observer = __webpack_require__( /*! ./observer */ 273); 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 */ 57); var compareVersions = __webpack_require__( /*! ../core/utils/version */ 53).compare; var errors = __webpack_require__( /*! ../core/utils/error */ 132); var useJQuery = __webpack_require__( /*! ./jquery/use_jquery */ 82)(); if (useJQuery && compareVersions(jQuery.fn.jquery, [1, 10]) < 0) { throw errors.Error("E0012") } __webpack_require__( /*! ./jquery/renderer */ 464); __webpack_require__( /*! ./jquery/hooks */ 465); __webpack_require__( /*! ./jquery/deferred */ 466); __webpack_require__( /*! ./jquery/hold_ready */ 467); __webpack_require__( /*! ./jquery/events */ 468); __webpack_require__( /*! ./jquery/easing */ 469); __webpack_require__( /*! ./jquery/element_data */ 470); __webpack_require__( /*! ./jquery/element */ 471); __webpack_require__( /*! ./jquery/component_registrator */ 472); __webpack_require__( /*! ./jquery/ajax */ 473) }, /*!****************************************************!*\ !*** ./artifacts/transpiled/ui/themes_callback.js ***! \****************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var Callbacks = __webpack_require__( /*! ../core/utils/callbacks */ 27); 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), commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4), typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), getKeyHash = commonUtils.getKeyHash, Class = __webpack_require__( /*! ../../core/class */ 15), Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred; module.exports = Class.inherit({ ctor: function(options) { this.options = options; this._setOption("disabledItemKeys", []); 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, removedItemKeys = this.options.removedItemKeys, addedItems = this.options.addedItems, removedItems = this.options.removedItems, selectedItems = this.options.selectedItems, selectedItemKeys = this.options.selectedItemKeys, 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) }, getSelectableItems: function(items) { return items.filter(function(item) { return !item.disabled }) }, _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) { var filterLength = encodeURI(JSON.stringify(remoteFilter)).length, needLoadAllData = this.options.maxFilterLengthInRequest && filterLength > this.options.maxFilterLengthInRequest, deferred = new Deferred, 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) { 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(), dataFilter = this.options.filter(), 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() - this.options.disabledItemKeys.length) { return true } return }, _getVisibleSelectAllState: function() { var items = this.getSelectableItems(this.options.plainItems()), hasSelectedItems = false, hasUnselectedItems = false; for (var i = 0; i < items.length; i++) { var item = items[i], itemData = this.options.getItemData(item), 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 */ 60); 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 */ 149); module.exports = DevExpress.data = DevExpress.data || {}; Object.defineProperty(DevExpress.data, "errorHandler", { get: function() { /*! ../../data/errors */ return __webpack_require__(37).errorHandler }, set: function(value) { __webpack_require__( /*! ../../data/errors */ 37).errorHandler = value } }); Object.defineProperty(DevExpress.data, "_errorHandler", { get: function() { /*! ../../data/errors */ return __webpack_require__(37)._errorHandler }, set: function(value) { __webpack_require__( /*! ../../data/errors */ 37)._errorHandler = value } }); DevExpress.data.DataSource = __webpack_require__( /*! ../../data/data_source */ 501); DevExpress.data.query = __webpack_require__( /*! ../../data/query */ 42); DevExpress.data.Store = __webpack_require__( /*! ../../data/abstract_store */ 101); DevExpress.data.ArrayStore = __webpack_require__( /*! ../../data/array_store */ 69); DevExpress.data.CustomStore = __webpack_require__( /*! ../../data/custom_store */ 151); DevExpress.data.LocalStore = __webpack_require__( /*! ../../data/local_store */ 502); DevExpress.data.base64_encode = __webpack_require__( /*! ../../data/utils */ 41).base64_encode; DevExpress.data.Guid = __webpack_require__( /*! ../../core/guid */ 34); DevExpress.data.utils = {}; DevExpress.data.utils.compileGetter = __webpack_require__( /*! ../../core/utils/data */ 18).compileGetter; DevExpress.data.utils.compileSetter = __webpack_require__( /*! ../../core/utils/data */ 18).compileSetter; DevExpress.EndpointSelector = __webpack_require__( /*! ../../data/endpoint_selector */ 503); DevExpress.data.queryImpl = __webpack_require__( /*! ../../data/query */ 42).queryImpl; DevExpress.data.queryAdapters = __webpack_require__( /*! ../../data/query_adapters */ 184); 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 */ 18).toComparable; DevExpress.data.utils.multiLevelGroup = __webpack_require__( /*! ../../data/store_helper */ 83).multiLevelGroup; DevExpress.data.utils.arrangeSortingInfo = __webpack_require__( /*! ../../data/store_helper */ 83).arrangeSortingInfo; DevExpress.data.utils.normalizeDataSourceOptions = __webpack_require__( /*! ../../data/data_source/data_source */ 46).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, domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 13), window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow(), callOnce = __webpack_require__( /*! ../core/utils/call_once */ 61), DXPROXY_HOST = "dxproxy.devexpress.com:8000", urlMapping = {}; var getUrlParser = callOnce(function() { var a = domAdapter.createElement("a"), 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, config = __webpack_require__( /*! ../../core/config */ 29), odataUtils = __webpack_require__( /*! ./utils */ 110), proxyUrlFormatter = __webpack_require__( /*! ../proxy_url_formatter */ 282), errors = __webpack_require__( /*! ../errors */ 37).errors, query = __webpack_require__( /*! ../query */ 42), Store = __webpack_require__( /*! ../abstract_store */ 101), mixins = __webpack_require__( /*! ./mixins */ 284), deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6), when = deferredUtils.when, Deferred = deferredUtils.Deferred; __webpack_require__( /*! ./query_adapter */ 157); 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(), fieldTypes = options.fieldTypes, 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, queryOptions; loadOptions = loadOptions || {}; 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, 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, fieldTypes = this._fieldTypes, 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 */ 45), iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3), odataUtils = __webpack_require__( /*! ./utils */ 110); __webpack_require__( /*! ./query_adapter */ 157); 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 */ 30).fitIntoRange; var toFixed = __webpack_require__( /*! ../utils */ 261).toFixed; var DEFAULT_CONFIG = { thousandsSeparator: ",", decimalSeparator: "." }, ESCAPING_CHAR = "'", 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 = [], 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), isPositiveZero = 1 / value === 1 / 0, isPositive = value > 0 || isPositiveZero, numberFormat = signFormatParts[isPositive ? 0 : 1]; if (isPercentFormat(numberFormat)) { value = 100 * value } if (!isPositive) { value = -value } var floatPointIndex = getFloatPointIndex(numberFormat), floatFormatParts = [numberFormat.substr(0, floatPointIndex), numberFormat.substr(floatPointIndex + 1)], minFloatPrecision = getRequiredDigitCount(floatFormatParts[1]), maxFloatPrecision = minFloatPrecision + getNonRequiredDigitCount(floatFormatParts[1]), minIntegerPrecision = getRequiredDigitCount(floatFormatParts[0]), maxIntegerPrecision = getNonRequiredDigitCount(floatFormatParts[0]) ? void 0 : minIntegerPrecision, integerLength = Math.floor(value).toString().length, floatPrecision = fitIntoRange(maxFloatPrecision, 0, MAXIMUM_NUMBER_LENGTH - integerLength), groupSizes = getGroupSizes(floatFormatParts[0]).reverse(); var valueParts = toFixed(value, floatPrecision < 0 ? 0 : floatPrecision).split("."); var valueIntegerPart = normalizeValueString(reverseString(valueParts[0]), minIntegerPrecision, maxIntegerPrecision), valueFloatPart = normalizeValueString(valueParts[1], minFloatPrecision, maxFloatPrecision); valueIntegerPart = applyGroups(valueIntegerPart, groupSizes, config.thousandsSeparator); var integerString = reverseString(formatNumberPart(reverseString(floatFormatParts[0]), valueIntegerPart)), 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 char, text, nextText, nextValueText = valueText; 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)), valueTextParts = valueText.split("."), valueTextWithModifiedFloat = valueTextParts[0] + ".3" + valueTextParts[1].slice(1), valueWithModifiedFloat = parseValue(valueTextWithModifiedFloat, isPercent, isNegative), 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 = ".", 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 */ 80).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), Class = __webpack_require__( /*! ../../core/class */ 15), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4), typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1), iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3), fx = __webpack_require__( /*! ../fx */ 39), animationPresetsModule = __webpack_require__( /*! ../presets/presets */ 182), deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6), when = deferredUtils.when, Deferred = deferredUtils.Deferred; var directionPostfixes = { forward: " dx-forward", backward: " dx-backward", none: " dx-no-direction", undefined: " dx-no-direction" }, DX_ANIMATING_CLASS = "dx-animating"; var TransitionExecutor = Class.inherit({ ctor: function() { this._accumulatedDelays = { enter: 0, leave: 0 }; this._animations = []; this.reset() }, _createAnimations: function($elements, initialConfig, configModifier, type) { var animationConfig, that = this, result = []; configModifier = configModifier || {}; animationConfig = this._prepareElementAnimationConfig(initialConfig, configModifier, type); if (animationConfig) { $elements.each(function() { var animation = that._createAnimation($(this), animationConfig, configModifier); if (animation) { animation.element.addClass(DX_ANIMATING_CLASS); animation.setup(); result.push(animation) } }) } return result }, _prepareElementAnimationConfig: function(config, configModifier, type) { var result; if ("string" === typeof config) { var presetName = config; config = animationPresetsModule.presets.getPreset(presetName) } if (!config) { result = void 0 } else { if (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, 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 result, that = this; 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), deferredStrategy = __webpack_require__( /*! ./selection.strategy.deferred */ 484), standardStrategy = __webpack_require__( /*! ./selection.strategy.standard */ 485), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined, 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, items = this.options.plainItems(), item = items[itemIndex]; if (!this.isSelectable() || !this.isDataItem(item)) { return false } var itemData = this.options.getItemData(item), 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 itemIndexStep, index, isSelectedItemsChanged = false, keyOf = this.options.keyOf, focusedItem = items[this._focusedItemIndex], focusedData = this.options.getItemData(focusedItem), focusedKey = keyOf(focusedData), isFocusedItemSelected = focusedItem && this.isItemDataSelected(focusedData); if (!isDefined(this._shiftFocusedItemIndex)) { this._shiftFocusedItemIndex = this._focusedItemIndex } var data, 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._selectionStrategy.getSelectableItems(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), itemKey = this.options.keyOf(itemData), 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, equalByValue = __webpack_require__( /*! ./common */ 4).equalByValue, 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), 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 keyHash, i, key = keyOf(item); 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], currentKeyValue = itemKeyValue && itemKeyValue[currentKeyExpr], 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 */ 30), iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3), errors = __webpack_require__( /*! ../core/errors */ 21), eventUtils = __webpack_require__( /*! ./utils */ 8), Emitter = __webpack_require__( /*! ./core/emitter */ 126), registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 96); var DX_PREFIX = "dx", TRANSFORM = "transform", TRANSLATE = "translate", ZOOM = "zoom", PINCH = "pinch", ROTATE = "rotate", START_POSTFIX = "start", UPDATE_POSTFIX = "", 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), 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 */ 281); data.odata = __webpack_require__( /*! ../../../bundles/modules/data.odata */ 504); 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 */ 31); 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 */ 507); var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget); var _promise = __webpack_require__( /*! ../../core/polyfills/promise */ 67); var _promise2 = _interopRequireDefault(_promise); var _bindable_template = __webpack_require__( /*! ../../core/templates/bindable_template */ 64); var _fx = __webpack_require__( /*! ../../animation/fx */ 39); 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_template.BindableTemplate(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 _this = this; 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() { clearTimeout(_this._waitParentAnimationTimeout); _this._waitParentAnimationTimeout = setTimeout(function() { return check() || runCheck() }, timeout) }; 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, that = this; (0, _iterator.each)(["before", "center", "after"], function() { var sectionClass = "dx-toolbar-" + this, $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(), afterRect = this._$afterSection.get(0).getBoundingClientRect(); this._alignCenterSection(beforeRect, afterRect, elementWidth); var $label = this._$toolbarItemsContainer.find(TOOLBAR_LABEL_SELECTOR).eq(0), $section = $label.parent(); if (!$label.length) { return } var labelOffset = beforeRect.width ? beforeRect.width : $label.position().left, widthBeforeSection = $section.hasClass(TOOLBAR_BEFORE_CLASS) ? 0 : labelOffset, widthAfterSection = $section.hasClass(TOOLBAR_AFTER_CLASS) ? 0 : afterRect.width, elemsAtSectionWidth = 0; $section.children().not(TOOLBAR_LABEL_SELECTOR).each(function() { elemsAtSectionWidth += (0, _renderer2.default)(this).outerWidth() }); var freeSpace = elementWidth - elemsAtSectionWidth, 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"), leftRect = isRTL ? afterRect : beforeRect, rightRect = isRTL ? beforeRect : afterRect, 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), labels = $labels.toArray(); maxWidth -= this._getCurrentLabelsPaddings(labels); var currentWidth = this._getCurrentLabelsWidth(labels), 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 labelMaxWidth, $label = (0, _renderer2.default)(labels[i]), currentLabelWidth = Math.ceil(getRealLabelWidth(labels[i])); 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", container = itemContainer || this["_$" + location + "Section"], itemHasText = !!(item.text || item.html), 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, $container = (0, _renderer2.default)("
").addClass(TOOLBAR_GROUP_CLASS), 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) } }, _dispose: function() { this.callBase(); clearTimeout(this._waitParentAnimationTimeout) } }); (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), Action = __webpack_require__( /*! ../core/action */ 111), viewPortUtils = __webpack_require__( /*! ../core/utils/view_port */ 73), extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, isPlainObject = __webpack_require__( /*! ../core/utils/type */ 1).isPlainObject, Toast = __webpack_require__( /*! ./toast */ 298); 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), window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow(), domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 13), eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5), ready = __webpack_require__( /*! ../core/utils/ready_callbacks */ 49).add, commonUtils = __webpack_require__( /*! ../core/utils/common */ 4), typeUtils = __webpack_require__( /*! ../core/utils/type */ 1), extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend, inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray, pointerEvents = __webpack_require__( /*! ../events/pointer */ 23), registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9), Overlay = __webpack_require__( /*! ./overlay */ 59), themes = __webpack_require__( /*! ./themes */ 31); var TOAST_CLASS = "dx-toast", TOAST_CLASS_PREFIX = TOAST_CLASS + "-", TOAST_WRAPPER_CLASS = TOAST_CLASS_PREFIX + "wrapper", TOAST_CONTENT_CLASS = TOAST_CLASS_PREFIX + "content", TOAST_MESSAGE_CLASS = TOAST_CLASS_PREFIX + "message", TOAST_ICON_CLASS = TOAST_CLASS_PREFIX + "icon", WIDGET_NAME = "dxToast", toastTypes = ["info", "warning", "error", "success"], TOAST_STACK = [], FIRST_Z_INDEX_OFFSET = 8e3, visibleToastInstance = null, 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: { 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(_device) { var isPhone = "phone" === _device.deviceType, isAndroid = "android" === _device.platform; return isPhone && isAndroid }, 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], 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__) { var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _get = function get(object, property, receiver) { if (null === object) { object = Function.prototype } var desc = Object.getOwnPropertyDescriptor(object, property); if (void 0 === desc) { var parent = Object.getPrototypeOf(object); if (null === parent) { return } else { return get(parent, property, receiver) } } else { if ("value" in desc) { return desc.value } else { var getter = desc.get; if (void 0 === getter) { return } return getter.call(receiver) } } }; var _renderer = __webpack_require__( /*! ../../core/renderer */ 2); var _renderer2 = _interopRequireDefault(_renderer); var _config = __webpack_require__( /*! ../../core/config */ 29); var _config2 = _interopRequireDefault(_config); var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _ui = __webpack_require__( /*! ../widget/ui.errors */ 19); var _ui2 = _interopRequireDefault(_ui); var _swatch_container = __webpack_require__( /*! ../widget/swatch_container */ 152); var _speed_dial_item = __webpack_require__( /*! ./speed_dial_item */ 509); var _speed_dial_item2 = _interopRequireDefault(_speed_dial_item); var _themes = __webpack_require__( /*! ../themes */ 31); 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 _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return call && ("object" === typeof call || "function" === typeof call) ? call : self } function _inherits(subClass, superClass) { if ("function" !== typeof superClass && null !== superClass) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass) } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass } } var FAB_MAIN_CLASS = "dx-fa-button-main"; var FAB_MAIN_CLASS_WITH_LABEL = "dx-fa-button-with-label"; var FAB_CLOSE_ICON_CLASS = "dx-fa-button-icon-close"; var INVISIBLE_STATE_CLASS = "dx-state-invisible"; var speedDialMainItem = null; var SpeedDialMainItem = function(_SpeedDialItem) { _inherits(SpeedDialMainItem, _SpeedDialItem); function SpeedDialMainItem() { _classCallCheck(this, SpeedDialMainItem); return _possibleConstructorReturn(this, (SpeedDialMainItem.__proto__ || Object.getPrototypeOf(SpeedDialMainItem)).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: "", label: "", direction: "auto", actions: [], activeStateEnabled: true, hoverStateEnabled: true, indent: 55, childIndent: 40, childOffset: 9, callOverlayRenderShading: true, closeOnOutsideClick: true }; return (0, _extend.extend)(_get(SpeedDialMainItem.prototype.__proto__ || Object.getPrototypeOf(SpeedDialMainItem.prototype), "_getDefaultOptions", this).call(this), (0, _extend.extend)(defaultOptions, (0, _config2.default)().floatingActionButtonConfig, { shading: false })) } }, { key: "_defaultOptionsRules", value: function() { return _get(SpeedDialMainItem.prototype.__proto__ || Object.getPrototypeOf(SpeedDialMainItem.prototype), "_defaultOptionsRules", this).call(this).concat([{ device: function() { return _themes2.default.isMaterial() }, options: { indent: 72, childIndent: 56, childOffset: 8 } }]) } }, { key: "_render", value: function() { this.$element().addClass(FAB_MAIN_CLASS); _get(SpeedDialMainItem.prototype.__proto__ || Object.getPrototypeOf(SpeedDialMainItem.prototype), "_render", this).call(this); this._moveToContainer(); this._renderCloseIcon(); this._renderClick() } }, { key: "_renderLabel", value: function() { _get(SpeedDialMainItem.prototype.__proto__ || Object.getPrototypeOf(SpeedDialMainItem.prototype), "_renderLabel", this).call(this); this.$element().toggleClass(FAB_MAIN_CLASS_WITH_LABEL, !!this._$label) } }, { 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._getVisibleActions().length ? this._getActionComponent()._createActionByOption("onClick") : this._createAction(this._clickHandler); this._setClickAction() } }, { key: "_getVisibleActions", value: function(actions) { var currentActions = actions || this.option("actions"); return currentActions.filter(function(action) { return action.option("visible") }) } }, { key: "_getCurrentOptions", value: function(actions) { var visibleActions = speedDialMainItem._getVisibleActions(actions); return 1 === visibleActions.length ? (0, _extend.extend)(visibleActions[0]._options, { position: this._getPosition() }) : (0, _extend.extend)(this._getDefaultOptions(), { visible: 0 !== visibleActions.length }) } }, { key: "_clickHandler", value: function() { var actions = this._actionItems.filter(function(action) { return action.option("actionVisible") }).sort(function(action, nextAction) { return action.option("index") - nextAction.option("index") }); if (1 === actions.length) { return } var lastActionIndex = actions.length - 1; for (var i = 0; i < actions.length; i++) { actions[i].option("animation", this._getActionAnimation(actions[i], i, lastActionIndex)); actions[i].option("position", this._getActionPosition(actions, i)); actions[i]._$wrapper.css("position", this._$wrapper.css("position")); actions[i].toggle() } if ((0, _config2.default)().floatingActionButtonConfig.shading) { this._isShadingShown = !this.option("shading"); this.option("shading", this._isShadingShown) } this._$icon.toggleClass(INVISIBLE_STATE_CLASS); this._$closeIcon.toggleClass(INVISIBLE_STATE_CLASS) } }, { key: "_updateZIndexStackPosition", value: function() { _get(SpeedDialMainItem.prototype.__proto__ || Object.getPrototypeOf(SpeedDialMainItem.prototype), "_updateZIndexStackPosition", this).call(this); var overlayStack = this._overlayStack(); overlayStack.push(this) } }, { key: "_renderActions", value: function() { var _this2 = this; var actions = this.option("actions"); var minActionButtonCount = 1; if (this._actionItems && this._actionItems.length) { this._actionItems.forEach(function(actionItem) { actionItem.dispose(); actionItem.$element().remove() }); this._actionItems = [] } 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() }); action._options.actionComponent = action; action._options.parentPosition = this._getPosition(); action._options.actionVisible = action._options.visible; this._actionItems.push(this._createComponent($actionElement, _speed_dial_item2.default, (0, _extend.extend)({}, action._options, { visible: false }))) } } }, { key: "_getActionAnimation", value: function(action, index, lastActionIndex) { var actionAnimationDelay = 30; action._options.animation.show.delay = actionAnimationDelay * index; action._options.animation.hide.delay = actionAnimationDelay * (lastActionIndex - index); return action._options.animation } }, { key: "_getDirectionIndex", value: function(actions, direction) { var directionIndex = 1; if ("auto" === direction) { var contentHeight = this.$content().height(); var actionsHeight = this.initialOption("indent") + this.initialOption("childIndent") * actions.length - contentHeight; var offsetTop = this.$content().offset().top; if (actionsHeight < offsetTop) { return -directionIndex } else { var offsetBottom = this._getContainer().height() - contentHeight - offsetTop; return offsetTop >= offsetBottom ? -directionIndex : directionIndex } } return "down" !== direction ? -directionIndex : directionIndex } }, { key: "_getActionPosition", value: function(actions, index) { var action = actions[index]; var actionOffsetXValue = this.initialOption("childOffset"); var actionOffsetX = action._options.label && !this._$label ? this._isPositionLeft(this._getPosition()) ? actionOffsetXValue : -actionOffsetXValue : 0; var actionOffsetYValue = this.initialOption("indent") + this.initialOption("childIndent") * index; var actionOffsetY = this._getDirectionIndex(actions, this.option("direction")) * actionOffsetYValue; var actionPositionAtMy = action._options.label ? this._isPositionLeft(this._getPosition()) ? "left" : "right" : "center"; return { of: this.$content(), at: actionPositionAtMy, my: actionPositionAtMy, offset: { x: actionOffsetX, y: actionOffsetY } } } }, { key: "_outsideClickHandler", value: function(e) { if (this._isShadingShown) { var isShadingClick = (0, _renderer2.default)(e.target)[0] === this._$wrapper[0]; if (isShadingClick) { this._clickHandler() } } } }, { key: "_setPosition", value: function() { if (this.option("visible")) { this._hide(); this._show() } } }, { key: "_getPosition", value: function() { return this._getDefaultOptions().position } }, { key: "_getInkRippleContainer", value: function() { return this.$content() } }, { key: "_optionChanged", value: function(args) { switch (args.name) { case "actions": if (this._isVisible()) { this._renderIcon() } this._renderCloseIcon(); this._renderClick(); this._renderActions(); break; case "maxSpeedDialActionCount": this._renderActions(); break; case "closeIcon": this._renderCloseIcon(); break; case "position": this._setPosition(); break; case "label": if (this._isVisible()) { this._renderLabel() } this._setPosition(); break; case "icon": if (this._isVisible()) { this._renderIcon() } break; default: _get(SpeedDialMainItem.prototype.__proto__ || Object.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)({}, newAction._options, { actions: [newAction] })) } else { var savedActions = speedDialMainItem.option("actions"); savedActions.forEach(function(action) { if (action._options.id === newAction._options.id) { isActionExist = true; return newAction } }); delete speedDialMainItem._options.position; if (!isActionExist) { if (speedDialMainItem._getVisibleActions(savedActions).length >= speedDialMainItem.option("maxSpeedDialActionCount")) { newAction.dispose(); _ui2.default.log("W1014"); return } savedActions.push(newAction); speedDialMainItem.option((0, _extend.extend)(speedDialMainItem._getCurrentOptions(savedActions), { actions: savedActions })) } else { if (1 === savedActions.length) { speedDialMainItem.option((0, _extend.extend)({}, savedActions[0]._options, { actions: savedActions, position: speedDialMainItem._getPosition() })) } else { speedDialMainItem.option((0, _extend.extend)(speedDialMainItem._getCurrentOptions(savedActions), { actions: savedActions })) } } } }; 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)({}, savedActions[0]._options, { actions: savedActions })) } else { speedDialMainItem.option({ actions: savedActions }) } } }; exports.repaint = function() { if (!speedDialMainItem) { return } var visibleActions = speedDialMainItem._getVisibleActions(); var icon = 1 === visibleActions.length ? visibleActions[0].option("icon") : speedDialMainItem._getDefaultOptions().icon; var label = 1 === visibleActions.length ? visibleActions[0].option("label") : speedDialMainItem._getDefaultOptions().label; speedDialMainItem.option({ actions: speedDialMainItem.option("actions"), icon: icon, closeIcon: speedDialMainItem._getDefaultOptions().closeIcon, position: speedDialMainItem._getPosition(), label: label, maxSpeedDialActionCount: speedDialMainItem._getDefaultOptions().maxSpeedDialActionCount, direction: speedDialMainItem._getDefaultOptions().direction }) } }, /*!************************************************************!*\ !*** ./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), TextEditorMask = __webpack_require__( /*! ./ui.text_editor.mask */ 513); 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 _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 13); var _dom_adapter2 = _interopRequireDefault(_dom_adapter); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var isFocusingOnCaretChange = _browser2.default.msie || _browser2.default.safari; var getCaret = function(input) { var range = void 0; 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 }); var _createClass = 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) } } return function(Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps) } if (staticProps) { defineProperties(Constructor, staticProps) } return Constructor } }(); var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5); var _events_engine2 = _interopRequireDefault(_events_engine); var _utils = __webpack_require__( /*! ../../events/utils */ 8); var _array = __webpack_require__( /*! ../../core/utils/array */ 14); var _dom = __webpack_require__( /*! ../../core/utils/dom */ 11); 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") } } 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 _editor; return (_editor = this.editor).option.apply(_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["_" + 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["_" + eventName + "Handler"].bind(this) } }, { key: "detachEvents", value: function() { _events_engine2.default.off(this.editorInput(), "." + 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 pastingText = (0, _dom.clipboardText)(event); var restText = editor._maskRulesChain.text().substring(caret.end); var accepted = editor._handleChain({ text: pastingText, start: caret.start, length: pastingText.length }); var newCaret = caret.start + accepted; editor._handleChain({ text: restText, start: newCaret, length: restText.length }); editor._caret({ start: newCaret, end: newCaret }) }) } }, { 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) } }]); 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 */ 522); var _uiListEditStrategy2 = _interopRequireDefault(_uiListEditStrategy); var _message = __webpack_require__( /*! ../../localization/message */ 10); var _uiListEdit = __webpack_require__( /*! ./ui.list.edit.provider */ 523); 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("itemDragging.allowReordering")) { 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) } }, _setDeprecatedOptions: function() { this.callBase(); (0, _extend.extend)(this._deprecatedOptions, { allowItemReordering: { since: "19.2", alias: "itemDragging.allowReordering" } }) }, _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, itemDragging: {} }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function(_device) { return "ios" === _device.platform }, options: { menuMode: "slide", itemDeleteMode: "slideItem" } }, { device: { platform: "android" }, options: { itemDeleteMode: "swipe" } }]) }, _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 "itemDragging": 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), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, EditDecorator = __webpack_require__( /*! ./ui.list.edit.decorator */ 140), abstract = EditDecorator.abstract, eventUtils = __webpack_require__( /*! ../../events/utils */ 8), pointerEvents = __webpack_require__( /*! ../../events/pointer */ 23), feedbackEvents = __webpack_require__( /*! ../../events/core/emitter.feedback */ 128); var LIST_EDIT_DECORATOR = "dxListEditDecorator", POINTER_DOWN_EVENT_NAME = eventUtils.addNamespace(pointerEvents.down, LIST_EDIT_DECORATOR), ACTIVE_EVENT_NAME = eventUtils.addNamespace(feedbackEvents.active, LIST_EDIT_DECORATOR), LIST_ITEM_CONTENT_CLASS = "dx-list-item-content", SWITCHABLE_DELETE_READY_CLASS = "dx-list-switchable-delete-ready", SWITCHABLE_MENU_SHIELD_POSITIONING_CLASS = "dx-list-switchable-menu-shield-positioning", SWITCHABLE_DELETE_TOP_SHIELD_CLASS = "dx-list-switchable-delete-top-shield", SWITCHABLE_DELETE_BOTTOM_SHIELD_CLASS = "dx-list-switchable-delete-bottom-shield", SWITCHABLE_MENU_ITEM_SHIELD_POSITIONING_CLASS = "dx-list-switchable-menu-item-shield-positioning", SWITCHABLE_DELETE_ITEM_CONTENT_SHIELD_CLASS = "dx-list-switchable-delete-item-content-shield", 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(), listTopOffset = $list.offset().top, listHeight = $list.outerHeight(), itemTopOffset = $itemElement.offset().top, itemHeight = $itemElement.outerHeight(), dirtyTopShieldHeight = itemTopOffset - listTopOffset, 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.scroll_view.js ***! \***************************************************************/ /*! dynamic exports provided */ /*! all exports used */ function(module, exports, __webpack_require__) { var $ = __webpack_require__( /*! ../../core/renderer */ 2), devices = __webpack_require__( /*! ../../core/devices */ 16), windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7), messageLocalization = __webpack_require__( /*! ../../localization/message */ 10), registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9), getPublicElement = __webpack_require__( /*! ../../core/utils/dom */ 11).getPublicElement, extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop, PullDownStrategy = __webpack_require__( /*! ./ui.scroll_view.native.pull_down */ 530), SwipeDownStrategy = __webpack_require__( /*! ./ui.scroll_view.native.swipe_down */ 531), SimulatedStrategy = __webpack_require__( /*! ./ui.scroll_view.simulated */ 532), Scrollable = __webpack_require__( /*! ./ui.scrollable */ 92), LoadIndicator = __webpack_require__( /*! ../load_indicator */ 76), themes = __webpack_require__( /*! ./../themes */ 31), LoadPanel = __webpack_require__( /*! ../load_panel */ 163); var SCROLLVIEW_CLASS = "dx-scrollview", SCROLLVIEW_CONTENT_CLASS = SCROLLVIEW_CLASS + "-content", SCROLLVIEW_TOP_POCKET_CLASS = SCROLLVIEW_CLASS + "-top-pocket", SCROLLVIEW_BOTTOM_POCKET_CLASS = SCROLLVIEW_CLASS + "-bottom-pocket", SCROLLVIEW_PULLDOWN_CLASS = SCROLLVIEW_CLASS + "-pull-down", SCROLLVIEW_REACHBOTTOM_CLASS = SCROLLVIEW_CLASS + "-scrollbottom", SCROLLVIEW_REACHBOTTOM_INDICATOR_CLASS = SCROLLVIEW_REACHBOTTOM_CLASS + "-indicator", SCROLLVIEW_REACHBOTTOM_TEXT_CLASS = SCROLLVIEW_REACHBOTTOM_CLASS + "-text", SCROLLVIEW_LOADPANEL = SCROLLVIEW_CLASS + "-loadpanel"; var refreshStrategies = { pullDown: PullDownStrategy, swipeDown: SwipeDownStrategy, simulated: SimulatedStrategy }; var isServerSide = !windowUtils.hasWindow(); var scrollViewServerConfig = { finishLoading: noop, release: noop, refresh: noop, _optionChanged: function(args) { if ("onUpdated" !== args.name) { return this.callBase.apply(this, arguments) } } }; var ScrollView = Scrollable.inherit(isServerSide ? scrollViewServerConfig : { _getDefaultOptions: function() { return extend(this.callBase(), { pullingDownText: messageLocalization.format("dxScrollView-pullingDownText"), pulledDownText: messageLocalization.format("dxScrollView-pulledDownText"), refreshingText: messageLocalization.format("dxScrollView-refreshingText"), reachBottomText: messageLocalization.format("dxScrollView-reachBottomText"), onPullDown: null, onReachBottom: null, refreshStrategy: "pullDown" }) }, _defaultOptionsRules: function() { return this.callBase().concat([{ device: function() { var realDevice = devices.real(); return "android" === realDevice.platform }, options: { refreshStrategy: "swipeDown" } }, { device: function() { return themes.isMaterial() }, options: { pullingDownText: "", pulledDownText: "", refreshingText: "", reachBottomText: "" } }]) }, _init: function() { this.callBase(); this._loadingIndicatorEnabled = true }, _initScrollableMarkup: function() { this.callBase(); this.$element().addClass(SCROLLVIEW_CLASS); this._initContent(); this._initTopPocket(); this._initBottomPocket(); this._initLoadPanel() }, _initContent: function() { var $content = $("
").addClass(SCROLLVIEW_CONTENT_CLASS); this._$content.wrapInner($content) }, _initTopPocket: function() { var $topPocket = this._$topPocket = $("
").addClass(SCROLLVIEW_TOP_POCKET_CLASS), $pullDown = this._$pullDown = $("
").addClass(SCROLLVIEW_PULLDOWN_CLASS); $topPocket.append($pullDown); this._$content.prepend($topPocket) }, _initBottomPocket: function() { var $bottomPocket = this._$bottomPocket = $("
").addClass(SCROLLVIEW_BOTTOM_POCKET_CLASS), $reachBottom = this._$reachBottom = $("
").addClass(SCROLLVIEW_REACHBOTTOM_CLASS), $loadContainer = $("
").addClass(SCROLLVIEW_REACHBOTTOM_INDICATOR_CLASS), $loadIndicator = new LoadIndicator($("
")).$element(), $text = this._$reachBottomText = $("
").addClass(SCROLLVIEW_REACHBOTTOM_TEXT_CLASS); this._updateReachBottomText(); $reachBottom.append($loadContainer.append($loadIndicator)).append($text); $bottomPocket.append($reachBottom); this._$content.append($bottomPocket) }, _initLoadPanel: function() { var $loadPanelElement = $("
").addClass(SCROLLVIEW_LOADPANEL).appendTo(this.$element()); var loadPanelOptions = { shading: false, delay: 400, message: this.option("refreshingText"), position: { of: this.$element() } }; this._loadPanel = this._createComponent($loadPanelElement, LoadPanel, loadPanelOptions) }, _updateReachBottomText: function() { this._$reachBottomText.text(this.option("reachBottomText")) }, _createStrategy: function() { var strategyName = this.option("useNative") ? this.option("refreshStrategy") : "simulated"; var strategyClass = refreshStrategies[strategyName]; if (!strategyClass) { throw Error("E1030", this.option("refreshStrategy")) } this._strategy = new strategyClass(this); this._strategy.pullDownCallbacks.add(this._pullDownHandler.bind(this)); this._strategy.releaseCallbacks.add(this._releaseHandler.bind(this)); this._strategy.reachBottomCallbacks.add(this._reachBottomHandler.bind(this)) }, _createActions: function() { this.callBase(); this._pullDownAction = this._createActionByOption("onPullDown"); this._reachBottomAction = this._createActionByOption("onReachBottom"); this._tryRefreshPocketState() }, _tryRefreshPocketState: function() { this._pullDownEnable(this.hasActionSubscription("onPullDown")); this._reachBottomEnable(this.hasActionSubscription("onReachBottom")) }, on: function(eventName) { var result = this.callBase.apply(this, arguments); if ("pullDown" === eventName || "reachBottom" === eventName) { this._tryRefreshPocketState() } return result }, _pullDownEnable: function(enabled) { if (0 === arguments.length) { return this._pullDownEnabled } if (this._$pullDown && this._strategy) { this._$pullDown.toggle(enabled); this._strategy.pullDownEnable(enabled); this._pullDownEnabled = enabled } }, _reachBottomEnable: function(enabled) { if (0 === arguments.length) { return this._reachBottomEnabled } if (this._$reachBottom && this._strategy) { this._$reachBottom.toggle(enabled); this._strategy.reachBottomEnable(enabled); this._reachBottomEnabled = enabled } }, _pullDownHandler: function() { this._loadingIndicator(false); this._pullDownLoading() }, _loadingIndicator: function(value) { if (arguments.length < 1) { return this._loadingIndicatorEnabled } this._loadingIndicatorEnabled = value }, _pullDownLoading: function() { this.startLoading(); this._pullDownAction() }, _reachBottomHandler: function() { this._loadingIndicator(false); this._reachBottomLoading() }, _reachBottomLoading: function() { this.startLoading(); this._reachBottomAction() }, _releaseHandler: function() { this.finishLoading(); this._loadingIndicator(true) }, _optionChanged: function(args) { switch (args.name) { case "onPullDown": case "onReachBottom": this._createActions(); break; case "pullingDownText": case "pulledDownText": case "refreshingText": case "refreshStrategy": this._invalidate(); break; case "reachBottomText": this._updateReachBottomText(); break; default: this.callBase(args) } }, isEmpty: function() { return !$(this.content()).children().length }, content: function() { return getPublicElement(this._$content.children().eq(1)) }, release: function(preventReachBottom) { if (void 0 !== preventReachBottom) { this.toggleLoading(!preventReachBottom) } return this._strategy.release() }, toggleLoading: function(showOrHide) { this._reachBottomEnable(showOrHide) }, isFull: function() { return $(this.content()).height() > this._$container.height() }, refresh: function() { if (!this.hasActionSubscription("onPullDown")) { return } this._strategy.pendingRelease(); this._pullDownLoading() }, startLoading: function() { if (this._loadingIndicator() && this.$element().is(":visible")) { this._loadPanel.show() } this._lock() }, finishLoading: function() { this._loadPanel.hide(); this._unlock() }, _dispose: function() { this._strategy.dispose(); this.callBase(); if (this._loadPanel) { this._loadPanel.$element().remove() } } }); registerComponent("dxScrollView", ScrollView); module.exports = ScrollView }, /*!*************************************************************!*\ !*** ./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 */ 13); 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 */ 49); var _ready_callbacks2 = _interopRequireDefault(_ready_callbacks); var _translator = __webpack_require__( /*! ../../animation/translator */ 26); var _translator2 = _interopRequireDefault(_translator); var _ui = __webpack_require__( /*! ../widget/ui.widget */ 17); 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 = 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")), contentSize = Math.round(this.option("contentSize")), baseContainerSize = Math.round(this.option("baseContainerSize")), 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 */ 13); 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 */ 26); var _translator2 = _interopRequireDefault(_translator); var _class = __webpack_require__( /*! ../../core/class */ 15); var _class2 = _interopRequireDefault(_class); var _animator = __webpack_require__( /*! ./animator */ 309); 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 */ 307); 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 = "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 = void 0; 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._updateScrollbar(); this._scrollbar.cursorEnter() }, _cursorLeaveHandler: function() { this._scrollbar.cursorLeave() }, dispose: _common.noop }); var hoveredScrollable, 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, "." + 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 _this5 = this, _arguments = arguments; 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, "." + 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("." + 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("." + 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, "." + SCROLLABLE_SIMULATED_CURSOR); _events_engine2.default.off(this._$container, "." + 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, Class = __webpack_require__( /*! ../../core/class */ 15), abstract = Class.abstract, animationFrame = __webpack_require__( /*! ../../animation/frame */ 113); 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 = {}, newIndexByKey = {}, addedCount = 0, removeCount = 0, 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], oldNextIndex = index - addedCount + removeCount, nextOldItem = oldItems[oldNextIndex], 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), oldIndex = oldIndexByKey[key], 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 */ 17); var _ui2 = _interopRequireDefault(_ui); var _button = __webpack_require__( /*! ./button */ 35); var _button2 = _interopRequireDefault(_button); var _uiCollection_widget = __webpack_require__( /*! ./collection/ui.collection_widget.edit */ 52); 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__( /*! ../core/templates/bindable_template */ 64); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj } } var BUTTON_GROUP_CLASS = "dx-buttongroup", BUTTON_GROUP_WRAPPER_CLASS = BUTTON_GROUP_CLASS + "-wrapper", BUTTON_GROUP_ITEM_CLASS = BUTTON_GROUP_CLASS + "-item", BUTTON_GROUP_FIRST_ITEM_CLASS = BUTTON_GROUP_CLASS + "-first-item", BUTTON_GROUP_LAST_ITEM_CLASS = BUTTON_GROUP_CLASS + "-last-item", BUTTON_GROUP_ITEM_HAS_WIDTH = BUTTON_GROUP_ITEM_CLASS + "-has-width", SHAPE_STANDARD_CLASS = "dx-shape-standard"; var ButtonCollection = _uiCollection_widget2.default.inherit({ _initTemplates: function() { var _this = this; this.callBase(); this._defaultTemplates.item = new _bindable_template.BindableTemplate(function($container, data, model) { _this._prepareItemStyles($container); _this._createComponent($container, _button2.default, (0, _extend.extend)({}, model, data, _this._getBasicButtonOptions(), { _templateData: model, template: model.template || _this.option("buttonTemplate") })) }, ["text", "type", "icon", "disabled", "visible", "hint"], this.option("integrationOptions.watchMethod")) }, _getBasicButtonOptions: function() { return { focusStateEnabled: false, onClick: null, hoverStateEnabled: this.option("hoverStateEnabled"), activeStateEnabled: this.option("activeStateEnabled"), stylingMode: this.option("stylingMode") } }, _getDefaultOptions: function() { return (0, _extend.extend)(this.callBase(), { itemTemplateProperty: 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) }, _renderItemContent: function(args) { args.container = (0, _renderer2.default)(args.container).parent(); return this.callBase(args) }, _renderItemContentByNode: function(args, $node) { args.container = (0, _renderer2.default)(args.container.children().first()); return this.callBase(args, $node) }, _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: [], buttonTemplate: "content", onSelectionChanged: null, onItemClick: null }) }, _setDeprecatedOptions: function() { this.callBase(); (0, _extend.extend)(this._deprecatedOptions, { itemTemplate: { since: "19.2", alias: "buttonTemplate" } }) }, _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 }) }, _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"), buttonTemplate: this.option("buttonTemplate"), scrollingEnabled: false, selectedItemKeys: this.option("selectedItemKeys"), focusStateEnabled: this.option("focusStateEnabled"), hoverStateEnabled: this.option("hoverStateEnabled"), activeStateEnabled: this.option("activeStateEnabled"), stylingMode: this.option("stylingMode"), 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 "buttonTemplate": 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 */ 541) }, /*!*********************************************************!*\ !*** ./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), eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5), translator = __webpack_require__( /*! ../../animation/translator */ 26), extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend, Color = __webpack_require__( /*! ../../color */ 86), messageLocalization = __webpack_require__( /*! ../../localization/message */ 10), devices = __webpack_require__( /*! ../../core/devices */ 16), registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9), Editor = __webpack_require__( /*! ../editor/editor */ 48), NumberBox = __webpack_require__( /*! ../number_box */ 115), TextBox = __webpack_require__( /*! ../text_box */ 91), Draggable = __webpack_require__( /*! ../draggable */ 189), clickEvent = __webpack_require__( /*! ../../events/click */ 20); var COLOR_VIEW_CLASS = "dx-colorview", COLOR_VIEW_CONTAINER_CLASS = "dx-colorview-container", COLOR_VIEW_ROW_CLASS = "dx-colorview-container-row", COLOR_VIEW_CELL_CLASS = "dx-colorview-container-cell", COLOR_VIEW_PALETTE_CLASS = "dx-colorview-palette", COLOR_VIEW_PALETTE_CELL_CLASS = "dx-colorview-palette-cell", COLOR_VIEW_PALETTE_HANDLE_CLASS = "dx-colorview-palette-handle", COLOR_VIEW_PALETTE_GRADIENT_CLASS = "dx-colorview-palette-gradient", COLOR_VIEW_PALETTE_GRADIENT_WHITE_CLASS = "dx-colorview-palette-gradient-white", COLOR_VIEW_PALETTE_GRADIENT_BLACK_CLASS = "dx-colorview-palette-gradient-black", COLOR_VIEW_HUE_SCALE_CLASS = "dx-colorview-hue-scale", COLOR_VIEW_HUE_SCALE_CELL_CLASS = "dx-colorview-hue-scale-cell", COLOR_VIEW_HUE_SCALE_HANDLE_CLASS = "dx-colorview-hue-scale-handle", COLOR_VIEW_HUE_SCALE_WRAPPER_CLASS = "dx-colorview-hue-scale-wrapper", COLOR_VIEW_CONTROLS_CONTAINER_CLASS = "dx-colorview-controls-container", COLOR_VIEW_RED_LABEL_CLASS = "dx-colorview-label-red", COLOR_VIEW_GREEN_LABEL_CLASS = "dx-colorview-label-green", COLOR_VIEW_BLUE_LABEL_CLASS = "dx-colorview-label-blue", COLOR_VIEW_HEX_LABEL_CLASS = "dx-colorview-label-hex", COLOR_VIEW_ALPHA_CHANNEL_SCALE_CLASS = "dx-colorview-alpha-channel-scale", COLOR_VIEW_APLHA_CHANNEL_ROW_CLASS = "dx-colorview-alpha-channel-row", COLOR_VIEW_ALPHA_CHANNEL_SCALE_WRAPPER_CLASS = "dx-colorview-alpha-channel-wrapper", COLOR_VIEW_ALPHA_CHANNEL_LABEL_CLASS = "dx-colorview-alpha-channel-label", COLOR_VIEW_ALPHA_CHANNEL_HANDLE_CLASS = "dx-colorview-alpha-channel-handle", COLOR_VIEW_ALPHA_CHANNEL_CELL_CLASS = "dx-colorview-alpha-channel-cell", COLOR_VIEW_ALPHA_CHANNEL_BORDER_CLASS = "dx-colorview-alpha-channel-border", COLOR_VIEW_COLOR_PREVIEW = "dx-colorview-color-preview", COLOR_VIEW_COLOR_PREVIEW_CONTAINER_CLASS = "dx-colorview-color-preview-container", COLOR_VIEW_COLOR_PREVIEW_CONTAINER_INNER_CLASS = "dx-colorview-color-preview-container-inner", COLOR_VIEW_COLOR_PREVIEW_COLOR_CURRENT = "dx-colorview-color-preview-color-current", 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, getHorizontalPaletteStep = function(e) { var step = 100 / that._paletteWidth; if (e.shiftKey) { step *= that.option("keyStep") } step = step > 1 ? step : 1; return Math.round(step) }, 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() }, getVerticalPaletteStep = function(e) { var step = 100 / that._paletteHeight; if (e.shiftKey) { step *= that.option("keyStep") } step = step > 1 ? step : 1; return Math.round(step) }, 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() }, updatePaletteValue = function() { that._placePaletteHandle(); that._updateColorFromHsv(that._currentColor.hsv.h, that._currentColor.hsv.s, that._currentColor.hsv.v) }, getHueScaleStep = function(e) { var step = 360 / (that._hueScaleWrapperHeight - that._hueScaleHandleHeight); if (e.shiftKey) { step *= that.option("keyStep") } step = step > 1 ? step : 1; return step }, updateHueScaleValue = function(step) { that._currentColor.hsv.h += step; that._placeHueScaleHandle(); var handleLocation = translator.locate(that._$hueScaleHandle); that._updateColorHue(handleLocation.top + that._hueScaleHandleHeight / 2) }, 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 }, 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), renderedRowsCount = $renderedRows.length, rowCount = this.option("editAlphaChannel") ? 2 : 1, delta = renderedRowsCount - rowCount; if (delta > 0) { $renderedRows.eq(-1).remove() } if (delta < 0) { delta = Math.abs(delta); var i, rows = []; 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), $paletteGradientWhite = $("
").addClass([COLOR_VIEW_PALETTE_GRADIENT_CLASS, COLOR_VIEW_PALETTE_GRADIENT_WHITE_CLASS].join(" ")), $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, { contentTemplate: null, boundary: this._$palette, allowMoveByClick: true, boundOffset: function() { return -this._paletteHandleHeight / 2 }.bind(this), onDragMove: 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, { contentTemplate: null, boundary: this._$hueScaleWrapper, allowMoveByClick: true, dragDirection: "vertical", onDragMove: 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, handleHeight = this._hueScaleHandleHeight, 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)), saturation = this._currentColor.hsv.s, 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 = $("